/* =============================================================================
 * 古北德邻 · AI 客服浮窗样式（主站与 /guides/ 内容集群共用）
 * ⚠️ 单一来源：主站 index.html 与本目录下的 /guides/ 各页都引用本文件。
 *    调整客服外观只改这里，两边自动保持一致。
 * 所有 var() 均带兜底值 —— guides 的 CSS 变量集与主站不同（没有 --accent/--sans），
 * 靠兜底值保证在两边渲染一致。
 * ===========================================================================*/
.chat-widget { position: fixed; right: 22px; bottom: 22px; z-index: 100; }
/* 胶囊按钮 —— 与右下角「客人留言板」(.gb-fab) 外形完全一致（同高 46px / 同圆角 23px / 同内距），
   仅靠【颜色 + 文案 + 图标】区分功能：本按钮＝品牌绿(客房咨询)，留言板＝蓝色(公开问答)。 */
.chat-fab {
  display: inline-flex; align-items: center; gap: 8px;
  height: 46px; box-sizing: border-box; padding: 0 20px;
  border-radius: 23px; border: none; cursor: pointer;
  background: var(--accent, #2f5d50); color: #fff;
  font-family: var(--sans, inherit); font-size: 15px; font-weight: 600; line-height: 1;
  white-space: nowrap; position: relative;
  box-shadow: 0 8px 24px rgba(35,71,64,.35);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.chat-fab:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(35,71,64,.45); }
.chat-fab-icon { font-size: 18px; line-height: 1; }
.chat-fab-label { font-size: 15px; font-weight: 600; }
/* 未读角标（金色「1」）——按业务要求停用，不再显示。
   用 CSS 隐藏而非删 HTML，是为了不改 39 个页面、且页面解析瞬间就不会闪出角标。
   原视觉定义保留在下方注释里，将来要恢复只需替换这两行：
   .chat-fab-badge { display: inline-flex; align-items: center; justify-content: center;
     min-width: 20px; height: 20px; box-sizing: border-box; padding: 0 6px;
     border-radius: 10px; background: var(--gold, #c9a86a); color: #2b2310;
     font-size: 12px; font-weight: 700; line-height: 1; } */
.chat-fab-badge { display: none; }
.chat-panel {
  position: absolute; bottom: 60px; right: 0; width: 340px; max-width: calc(100vw - 36px);
  height: 460px; max-height: calc(100vh - 120px);
  background: #fff; border-radius: 16px; box-shadow: 0 18px 50px rgba(20,30,26,.28);
  display: flex; flex-direction: column; overflow: hidden;
}
/* 关键：类选择器会盖过 UA 的 [hidden]{display:none}，必须显式关闭，否则面板常显 */
.chat-panel[hidden] { display: none; }
.chat-header {
  background: var(--accent, #2f5d50); color: #fff; padding: 14px 16px; font-weight: 600;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.chat-header #chatTitle { margin-right: auto; }
/* 面板内互跳按钮（客人留言板）——白底反色，一眼看出「点这里可切到另一个功能」。
   由 chat.js 注入，无需改 40 个页面的静态 HTML。 */
.chat-goto-gb {
  background: #fff; color: var(--accent, #2f5d50); border: none; border-radius: 8px;
  padding: 5px 10px; font-size: 12px; font-weight: 700; line-height: 1.2; cursor: pointer;
  font-family: var(--sans, inherit); white-space: nowrap;
  transition: background .15s ease;
}
.chat-goto-gb:hover { background: #eef3ef; }
.chat-close { background: none; border: none; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: #f7f5ef; }
.msg { max-width: 85%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.5; word-break: break-word; }
.msg.bot { background: #fff; border: 1px solid var(--line, #e2dccf); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.user { background: var(--accent, #2f5d50); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg.typing { font-style: italic; color: var(--muted, #6b6b66); }
.chat-contact { padding: 10px 16px; font-size: 13px; color: var(--accent, #2f5d50); background: #eef3ef; border-top: 1px solid var(--line, #e2dccf); }
.chat-input { display: flex; border-top: 1px solid var(--line, #e2dccf); }
.chat-input input {
  flex: 1; border: none; padding: 13px 14px; font-size: 14px; outline: none;
  font-family: var(--sans, inherit); color: var(--text, #2b2b29); background: #fff;
}
.chat-input button { border: none; background: var(--accent, #2f5d50); color: #fff; padding: 0 18px; cursor: pointer; font-size: 14px; }
/* 在线回答模式：多行文本 + IMG 图片行 + URL 链接 */
.msg.bot.rich { max-width: 90%; }
.chat-line { white-space: pre-wrap; word-break: break-word; }
.chat-img { display: block; max-width: 100%; border-radius: 10px; margin: 6px 0 2px; border: 1px solid var(--line, #e2dccf); }
.chat-link { color: var(--accent, #2f5d50); text-decoration: underline; word-break: break-all; }
@media (max-width: 480px) { .chat-panel { width: calc(100vw - 28px); right: -4px; } }
