/* AI 浮层（ld-chat.js 注入元素的样式） */
.ld-chat-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 9999;
  width: 56px; height: 56px; border-radius: 50%;
  background: #7C3A2D; color: #FAF6EE; border: none;
  font-size: 24px; cursor: pointer;
  box-shadow: 0 6px 24px rgba(0,0,0,.2);
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
}
.ld-chat-panel {
  position: fixed; right: 24px; bottom: 92px; z-index: 9999;
  width: 520px; max-width: calc(100vw - 32px);
  height: 600px; max-height: calc(100vh - 120px);
  background: #FAF6EE; border-radius: 16px;
  box-shadow: 0 28px 70px -18px rgba(0,0,0,.22);
  display: none; flex-direction: row; overflow: hidden;
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  color: #2A2520;
}
.ld-chat-panel.is-open { display: flex; }

/* 左侧侧栏（v1.0 New chat + 会话列表） */
.ld-chat-sidebar {
  width: 168px; flex-shrink: 0;
  background: #1F3A34; color: #EDE7D7;
  display: flex; flex-direction: column;
  border-right: 1px solid rgba(237,231,215,.1);
}
.ld-chat-sidebar-head {
  padding: 18px 12px 12px;
  border-bottom: 1px solid rgba(237,231,215,.1);
}
.ld-chat-sidebar-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  color: rgba(237,231,215,.55); margin-bottom: 10px;
}
.ld-chat-new {
  width: 100%; background: #7C3A2D; color: #FBF8F2;
  border: none; border-radius: 8px; padding: 9px 10px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit;
}
.ld-chat-new:hover { background: #6a3025; }
.ld-chat-hist {
  flex: 1; overflow-y: auto; padding: 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.ld-chat-hist-item {
  width: 100%; text-align: left;
  background: transparent; border: none; border-radius: 8px;
  padding: 10px; cursor: pointer; font-family: inherit;
  color: #EDE7D7;
}
.ld-chat-hist-item:hover { background: rgba(237,231,215,.07); }
.ld-chat-hist-item.is-active { background: rgba(237,231,215,.13); }
.ld-chat-hist-title {
  font-size: 13px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ld-chat-hist-item:not(.is-active) .ld-chat-hist-title { font-weight: 500; }
.ld-chat-hist-sub {
  font-size: 11.5px; color: rgba(237,231,215,.55);
  margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 右侧主区（含 header / messages / suggs / input） */
.ld-chat-main {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; min-width: 0;
}

.ld-chat-header {
  padding: 12px 16px; border-bottom: 1px solid rgba(42,37,32,.1);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.ld-chat-header h3 { margin: 0; font-size: 15px; font-weight: 700; }
.ld-chat-actions { display: flex; gap: 8px; }
.ld-chat-actions button {
  background: transparent; border: 1px solid rgba(42,37,32,.2);
  border-radius: 999px; padding: 4px 10px; font-size: 11px;
  cursor: pointer; color: #3f3a32; font-family: inherit;
}
.ld-chat-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.ld-chat-msg { max-width: 80%; padding: 9px 13px; border-radius: 14px; font-size: 14px; line-height: 1.55; }
.ld-chat-msg.is-ai { background: #EEE8DC; color: #2A2520; align-self: flex-start; }
.ld-chat-msg.is-user { background: #7C3A2D; color: #FAF6EE; align-self: flex-end; }
.ld-chat-suggs { display: flex; gap: 6px; padding: 0 14px 8px; flex-wrap: wrap; flex-shrink: 0; }
.ld-chat-suggs button {
  background: transparent; border: 1px solid rgba(42,37,32,.2);
  border-radius: 999px; padding: 6px 12px; font-size: 12px;
  cursor: pointer; color: #3f3a32; font-family: inherit;
}

/* 输入栏（含 mic 图标） */
.ld-chat-input {
  display: flex; gap: 6px; padding: 10px 14px;
  border-top: 1px solid rgba(42,37,32,.1);
  align-items: center; flex-shrink: 0;
}
.ld-chat-icon-btn {
  width: 34px; height: 34px; border-radius: 50%;
  border: none; background: transparent;
  cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(42,37,32,.42);
  transition: background 0.12s;
}
.ld-chat-icon-btn:hover { background: rgba(42,37,32,.06); color: #3f3a32; }
.ld-chat-input input {
  flex: 1; min-width: 0;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid rgba(42,37,32,.14);
  background: #EFE9DD; font-size: 13px; outline: none;
  font-family: inherit;
}
.ld-chat-input button[data-act="send"] {
  width: 34px; height: 34px; border-radius: 50%; border: none;
  background: #7C3A2D; color: #FAF6EE; cursor: pointer; font-size: 16px;
  flex-shrink: 0;
}

/* 移动端：side bar 折叠（max-width 480 时） */
@media (max-width: 480px) {
  .ld-chat-panel { width: calc(100vw - 24px); }
  .ld-chat-sidebar { display: none; }
}
