/* ============================================================
   浦城百晓书 · 聊天页统一样式 chat.css
   ============================================================
   本文件由三份历史层合并而成（2026-11-15 老板令：一个功能只留一份、不带版本号）：
     ① chat-ui-upgrade（布局升级：侧栏/顶栏/消息流/输入区/出处/移动端）
     ② chat-v37（色值+间距+动效覆盖层，元宝《chat 正式改版方案稿》）
     ③ chat-v38g（问答框工具行 / 会话分组收藏重命名 / 圆形头像）
   合并方式＝按原 <link> 加载顺序原样拼接，层叠结果与合并前完全等价。
   依赖：/assets/css/theme.css（必须先引入）
   ============================================================ */

@font-face {
  font-family: "BaiXiaoWordmark";
  src: url(data:font/woff2;base64,d09GMk9UVE8AAAiEAA8AAAAADMwAAAgyAAIAxAAAAAAAAAAAAAAAAAAAAAAAAAAAGYFeDY1iGyAcSAZgDggAVAE2AiQDDgQGBYQeByAXJBgOG8ELUZRQUjXFjwTTbT5SavTUJrPJ5qEue3AydPZzQ++mfwFySY1pukA7YKrWTpS6UyeFIF5zOjX7enbpO7oerLnbvK0vXZuIISKRF/PayDQircJD/Knv7ge7FMIB7Nxg9YJWqKUybIpBl6Z7qZVipQoHMKAR2z4pX1rRXrFa7IEfpGGrXoEeKOD69v5mtlXPF8+0C5yJvBMgAEDbiVFE1TPv3qA7Cy0F9iuLlWG/JjUeukREsiPk0j3paLAHRRBVna3QVU8W3hCf56utjjSItirlKEuz2hwS/pFNMEedPUdkWN3SVa21ufsS1kmBmzkCssQGkGRPEP6TwWVXpPbKWiL3etq7oIz6f9g4IUAIzPdVCJ0JQSESlGKho+RP9p+6QB91YEVKKvrCpI6yM4DW1k5XYVwbYaZvj8Dy5U53YUE7oBIQICm3p+BP+BMjL/WTZ3Nt6Mt0TlTsrZWwsFZsrgTpWF8keTYWVVrrHXIvDd17xd4RivdET6OPf7S+RJ4Wopd88MYfL2oT9qlIjRno1h2SRI36KqiEg2bDTe9iI5n2rd3C2/flSu/xZjsIGbtmWP1x+1fbAKDHY3jJovR1k+VvAIjoPwiACQhiTQnF4yXZFVZJm0c1n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format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

/* ============================================================
   浦城百晓书 · 聊天页布局升级样式
   依赖：/assets/css/theme.css（必须先引入）
   覆盖：侧栏 / 顶栏 / 消息流 / 输入区 / 出处标记 / 移动端
   ============================================================ */

/* ---------- 应用骨架 ---------- */
.app {
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ---------- 侧栏 ---------- */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar-head {
  padding: var(--s-4) var(--s-4) var(--s-3);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.brand { display: flex; align-items: center; gap: var(--s-3); }
.brand-mark { width: 52px; height: 52px; flex: none; }
.brand-name {
  font-family: "BaiXiaoWordmark", "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: 17px; font-weight: 700; color: var(--brand-800);
  letter-spacing: .08em; line-height: 1.2;
}
.brand-sub { font-size: 11px; color: var(--ink-500); letter-spacing: .06em; }
.btn-new-chat {
  display: flex; align-items: center; justify-content: center; gap: var(--s-2);
  width: 100%; padding: 10px;
  background: var(--brand-600); color: var(--ink-on-brand);
  border: none; border-radius: var(--r-md);
  font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.btn-new-chat:hover { background: var(--brand-700); }

.session-list { flex: 1; overflow-y: auto; padding: var(--s-2) 0; }
.session-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px var(--s-4); cursor: pointer;
  position: relative;
  transition: background var(--dur-fast) var(--ease);
}
.session-item:hover { background: var(--surface-2); }
.session-item.active {
  background: var(--brand-050);
  /* 左侧 2px 主色圆角条 */
  box-shadow: inset 2px 0 0 var(--brand-600);
}
.session-title {
  font-size: 14px; color: var(--ink-700);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.session-item.active .session-title { color: var(--ink-900); font-weight: 500; }

/* ---------- 主区 ---------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.header {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex-shrink: 0;
}
.header-title {
  font-family: var(--font-serif);
  font-size: 16px; font-weight: 600;
  color: var(--ink-900); flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.header-actions { display: flex; align-items: center; gap: var(--s-2); margin-left: auto; }
.icon-btn {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: var(--r-sm);
  background: none; border: none; cursor: pointer;
  color: var(--ink-700); font-size: 14px; font-family: inherit;
  transition: background var(--dur-fast) var(--ease);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- 消息流 ---------- */
.messages {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: var(--s-4);
  padding: var(--s-5) var(--s-4);
  scroll-behavior: smooth;
}

/* 出处标记 */
.citations {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2);
  margin-top: var(--s-3); padding-top: var(--s-2);
  border-top: 1px dashed var(--line-strong);
}
.citations-label { font-size: 12px; color: var(--ink-300); }
.citation-tag { font-size: 12px; }
/* 1125批·头号：个人库出处标注（is_personal=true 的那几条）高亮区分 */
.citation-tag.personal { color: var(--accent, #2b6cb0); font-weight: 600; }
/* 工单 v3.16.242 R 批：web 渠道出处可点击（带 url 的 citation 渲染为链接） */
.citation-tag[href] {
  color: var(--accent, #2b6cb0);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.citation-tag[href]:hover { opacity: .8; }

/* ---------- 输入区 ---------- */
.composer {
  padding: var(--s-3) var(--s-4) var(--s-2);
  border-top: 1px solid var(--line);
  background: var(--surface);
  flex-shrink: 0;
}
.composer-box {
  display: flex; align-items: flex-end; gap: var(--s-2);
}
.composer-box textarea {
  flex: 1; resize: none;
  min-height: 48px; max-height: 160px;
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  color: var(--ink-900);
  font-size: 15px; font-family: inherit; line-height: 1.6;
  outline: none;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.composer-box textarea:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px var(--brand-050);
}
.btn-send {
  padding: 0 22px; height: 48px;
  background: var(--brand-600); color: var(--ink-on-brand);
  border: none; border-radius: var(--r-lg);
  font-size: 15px; font-weight: 600; font-family: inherit; cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.btn-send:hover { background: var(--brand-700); }
.btn-send:disabled { opacity: .5; cursor: not-allowed; }
.composer-hint { padding: 6px 4px 4px; font-size: 12px; color: var(--ink-300); }

/* ---------- 空状态 ---------- */
.empty-mark { width: 96px; height: 96px; }
.empty-title {
  font-family: var(--font-serif);
  font-size: 26px; font-weight: 600; color: var(--ink-900);
  letter-spacing: .02em; margin: 0;
}
.empty-desc { color: var(--ink-500); font-size: 15px; margin: 0; }
.chip-row { display: flex; flex-wrap: wrap; gap: var(--s-2); justify-content: center; }
.chip {
  padding: 8px 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; color: var(--ink-700);
  font-size: 14px; font-family: inherit; cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.chip:hover { border-color: var(--brand-500); color: var(--brand-600); transform: translateY(-1px); }

/* ---------- 移动端底部导航 ---------- */
.bottom-nav {
  display: none;
  height: var(--bottom-nav-height);
  border-top: 1px solid var(--line);
  background: var(--surface);
  flex-shrink: 0;
}
.nav-item {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: var(--ink-500); font-size: 13px; font-family: inherit;
  transition: color var(--dur-fast) var(--ease);
}
.nav-item.active { color: var(--brand-600); font-weight: 600; }

/* 遮罩 */
.scrim {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0,0,0,.4);
}
.hidden { display: none !important; }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .app { flex-direction: column; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 70;
    width: 280px; min-width: 280px;
    transform: translateX(-100%);
    transition: transform var(--dur) var(--ease);
    box-shadow: var(--sh-3);
  }
  .sidebar.open { transform: translateX(0); }
  .bottom-nav { display: flex; }
  .message { max-width: 85%; }
  .header-title { font-size: 15px; }
  .composer { padding: var(--s-2) var(--s-3) var(--s-2); }
  .composer-box textarea { min-height: 44px; }
  .btn-send { height: 44px; }
}

/* ================= 小白 · 空态 ================= */
.bx-hero { position: relative; display: flex; flex-direction: column; align-items: center; }
.bx-hero-glow {
  position: absolute; left: 50%; top: 6px; transform: translateX(-50%);
  width: 190px; height: 190px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--brand-050) 0%, transparent 68%);
  pointer-events: none;
}
.bx-hero-img {
  position: relative; height: 172px; width: auto; display: block;
  filter: drop-shadow(0 10px 22px rgba(47,107,94,.16));
  animation: bxFloat 5.5s var(--ease-in-out, ease-in-out) infinite;
}
@keyframes bxFloat {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-7px); }
}
.bx-hero-cap {
  margin-top: -6px; font-size: 12px; color: var(--ink-300);
  letter-spacing: .16em;
}
.bx-hero-cap b { color: var(--accent-600, #C08A4A); font-weight: 600; }

/* ================= 小白 · 侧栏引导卡 ================= */
.bx-card {
  flex: none; margin: 0 var(--s-3) var(--s-3);
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--brand-050) 0%, var(--surface) 100%);
  box-shadow: var(--sh-1);
}
.bx-card-img { width: 46px; height: 46px; flex: none; border-radius: 50%;
  object-fit: cover; background: var(--surface); box-shadow: 0 2px 6px rgba(47,107,94,.14); }
.bx-card-body { flex: 1; min-width: 0; }
.bx-card-name { font-size: 13px; font-weight: 600; color: var(--ink-900);
  font-family: var(--font-serif); letter-spacing: .02em; }
.bx-card-desc { font-size: 11.5px; color: var(--ink-500); line-height: 1.55; margin-top: 2px; }
.bx-card-btn {
  flex: none; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--brand-500); background: transparent;
  color: var(--brand-600); font-size: 12px; font-family: inherit; cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.bx-card-btn:hover { background: var(--brand-600); color: var(--ink-on-brand); }
@media (prefers-reduced-motion: reduce) { .bx-hero-img { animation: none; } }

/* ================= 空态山水 · 尺寸回调 ================= */
.empty-mark { width: 108px; height: 108px; }
.scape-wrap { position: relative; display: inline-flex; margin-bottom: 2px; }
.scape-glow {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 112px; height: 112px; border-radius: 50%;
  background: radial-gradient(circle, var(--brand-100) 0%, transparent 68%);
  opacity: .85; pointer-events: none;
}
.scape-cap {
  font-size: 12.5px; letter-spacing: .16em; color: var(--ink-500);
  margin: 10px 0 14px; text-align: center;
}

/* ================= 侧栏折叠 / 展开 ================= */
.btn-collapse {
  margin-left: auto; flex: none;
  width: 28px; height: 28px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--ink-500); cursor: pointer; transition: all .18s var(--ease);
}
.btn-collapse:hover { background: var(--brand-050); color: var(--brand-700); border-color: var(--brand-200); }
.btn-collapse svg { width: 16px; height: 16px; transition: transform .22s var(--ease); }

/* 桌面端：折叠时侧栏滑出，主区占满 */
@media (min-width: 769px) {
  .sidebar { transition: margin-left var(--dur) var(--ease); }
  body.sb-collapsed .sidebar { margin-left: calc(-1 * var(--sidebar-width)); }
  body.sb-collapsed #btnMenu { display: inline-flex !important; }
  body:not(.sb-collapsed) #btnMenu { display: none; }
}
@media (max-width: 768px) {
  .btn-collapse { display: none; }
}

/* P0-4：收起态显式展开兜底（不靠 header-brand 是否还在，按钮必须可见可点） */
.bx-sidebar-expand {
  display: none;
  width: 36px; height: 36px; flex: none; border-radius: 10px;
  align-items: center; justify-content: center;
  border: 1px solid var(--line, rgba(47,107,94,.16));
  background: var(--surface, #fff);
  color: var(--brand-700, #2F6B5E); cursor: pointer;
}
.bx-sidebar-expand:hover { background: var(--brand-050, rgba(47,107,94,.07)); }
.bx-sidebar-expand svg { width: 20px; height: 20px; }
body.sb-collapsed .bx-sidebar-expand { display: inline-flex; }
body.is-guest .bx-sidebar-expand { display: none !important; }
@media (max-width: 768px) { .bx-sidebar-expand { display: none !important; } }

/* ================= 游客模式状态条 ================= */
.guest-bar {
  display: flex; align-items: center; gap: 10px;
  margin: 0 auto; padding: 8px 14px;
  max-width: 880px; width: calc(100% - 32px);
  border-radius: 999px;
  background: var(--brand-050);
  border: 1px solid var(--brand-100);
  color: var(--ink-600); font-size: 12.5px;
}
.guest-bar-icon { width: 18px; height: 18px; color: var(--brand-600); flex: none; }
.guest-bar-text { flex: 1; min-width: 0; }
.guest-bar-text b { color: var(--brand-700); font-weight: 600; }
.guest-bar-btn {
  flex: none; padding: 5px 12px; border-radius: 999px; border: 0;
  background: var(--brand-600); color: #fff; font-size: 12px; cursor: pointer;
  font-family: inherit; white-space: nowrap;
}
.guest-bar-btn:hover { background: var(--brand-700); }
body:not(.is-guest) .guest-bar { display: none; }


/* ===== 顶栏联动：侧栏可见→显示收起按钮+会话标题；侧栏隐藏→显示 logo+站名 ===== */
.header-brand {
  display: none; align-items: center; gap: 9px;
  cursor: pointer; user-select: none;
  padding: 5px 12px 5px 6px; border-radius: 999px;
  transition: background .18s;
}
.header-brand:hover { background: var(--brand-50, rgba(47,107,94,.07)); }
.header-brand-mark { width: 28px; height: 28px; flex: none; display: block; }
.header-brand-name {
  font-family: "BaiXiaoWordmark", "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: 15.5px; font-weight: 700; color: var(--brand-800);
  letter-spacing: .08em; white-space: nowrap;
}
.btn-collapse-top {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; flex: none;
  border: 1px solid var(--line, rgba(47,107,94,.16));
  border-radius: 10px; background: var(--surface, #fff);
  color: var(--brand-700); font-size: 15px; line-height: 1; cursor: pointer;
  transition: background .18s, border-color .18s;
}
.btn-collapse-top:hover { background: var(--brand-50, rgba(47,107,94,.07)); border-color: var(--brand-300); }
body:not(.sb-collapsed):not(.is-guest) .header-brand { display: none; }
body.sb-collapsed .header-brand,
body.is-guest .header-brand { display: inline-flex; }
body.sb-collapsed .header-title,
body.is-guest .header-title { display: none; }
body.sb-collapsed .btn-collapse-top,
body.is-guest .btn-collapse-top { display: none; }

/* ===== 小白卡片：全身立绘 ===== */
.bx-card { align-items: flex-start; }
.bx-avatar-wrap { flex: none; }
.bx-card-avatar {
  width: 58px; height: 58px; border-radius: 14px;
  background: linear-gradient(160deg, #EEF3F0, #E2EAE6);
  border: 1px solid rgba(47,107,94,.14);
  object-fit: contain; padding: 3px;
}

/* 桌面收起态：顶部品牌区可点击展开，隐藏汉堡避免重复 */
@media (min-width: 769px) {
  body.sb-collapsed #btnMenu { display: none !important; }
}


/* ==================== ② v37 覆盖层 ==================== */

/* ============================================================
   chat-v37.css · 聊天界面改版覆盖层（元宝定稿方案，2026-11-15）
   设计标准：元宝《chat 正式改版方案稿》——四条铁律：
   不改交互逻辑 / 不改 DOM 结构 / 只动色值+间距+动效 / 与 v36 三色一体
   本文件为增量覆盖层，不重复 base 样式；加载于 theme.css 与 chat-ui-upgrade.css 之后。
   路径归位说明：字体走 /assets/fonts/（不照搬方案稿临时路径）。
   ============================================================ */

/* ---------- 色值 token（元宝衔接点①：一处定义全站变） ---------- */
:root {
  --ink-gold: #C9A84E;              /* 丹桂金 */
  --ink-gold-soft: rgba(201, 168, 78, .4);
  --ink-gold-faint: rgba(201, 168, 78, .12);
  --ink-gold-line: rgba(201, 168, 78, .3);
  --y-sidebar-900: #1E4A41;         /* 侧栏深墨绿（渐变起） */
  --y-brand-deep: #26574B;          /* 用户气泡深一度 */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: .12s;
  --dur-base: .15s;
  --dur-slow: .24s;
}

/* ---------- E. 全站动效规范 ---------- */
.message { animation: yMsgIn var(--dur-base) var(--ease-out) both; }
@keyframes yMsgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.btn-new-chat, .bx-card-btn, .btn-send {
  transition: background var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.btn-new-chat:active, .bx-card-btn:active, .btn-send:active { transform: scale(.97); }
.session-item { transition: background var(--dur-fast) var(--ease-out); }

/* ============================================================
   A. 侧栏 sidebar
   ============================================================ */
.sidebar {
  background: linear-gradient(180deg, var(--y-sidebar-900) 0%, var(--brand-600) 100%);
}
/* A2 品牌 logo SVG 内联改丹桂金（呈现属性可被 CSS 覆盖，DOM 不动） */
.sidebar .brand-mark g { fill: var(--ink-gold); }
.sidebar .brand-mark g + g { fill: var(--accent-500); }
/* A3/A4 品牌字 */
.sidebar .brand-name { color: #FFFFFF; font-weight: 600; }
.sidebar .brand-sub { color: rgba(232, 213, 163, .7); }
/* A5 收起按钮 */
.sidebar .btn-collapse {
  color: var(--ink-gold);
  border: 1px solid var(--ink-gold-soft);
  border-radius: 50%;
  transition: background var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out);
}
.sidebar .btn-collapse:hover { background: var(--ink-gold); color: #FFFFFF; }
/* A6 新建对话 · 侧栏唯一 CTA 焦点 */
.sidebar .btn-new-chat {
  background: var(--ink-gold);
  color: #FFFFFF;
  border: none;
}
.sidebar .btn-new-chat:hover { background: #D6B96A; }
/* A7/A8 会话列表 */
.session-list { background: transparent; }
.session-item { color: rgba(255, 255, 255, .86); }
.session-item:hover { background: rgba(255, 255, 255, .08); }
.session-item.active,
.session-item.is-active,
.session-item[aria-current="true"] {
  background: var(--ink-gold-faint);
  color: #FFFFFF;
  box-shadow: inset 3px 0 0 var(--ink-gold);
}
/* A9 小白卡片 */
.bx-card {
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--ink-gold-soft);
  transition: border-color var(--dur-base) var(--ease-out);
}
.bx-card:hover { border-color: var(--ink-gold); }
.bx-card-name { color: #FFFFFF; }
.bx-card-desc { color: rgba(255, 255, 255, .65); }
/* A10 小白头像圆形 + 金光晕 */
.bx-card-avatar {
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(201, 168, 78, .3);
}
/* A11 问小白按钮 */
.bx-card-btn {
  background: var(--ink-gold);
  color: #FFFFFF;
  border: none;
}
.bx-card-btn:hover { background: #D6B96A; }

/* ============================================================
   B. 主区 header
   ============================================================ */
.header { border-bottom: 1px solid var(--ink-gold-line); }
.header-brand-mark g { fill: var(--ink-gold); }
.header-brand-mark g + g { fill: var(--accent-500); }
.bx-sidebar-expand, .icon-btn, .btn-collapse-top {
  color: var(--brand-600);
  transition: color var(--dur-base) var(--ease-out);
}
.bx-sidebar-expand:hover, .icon-btn:hover, .btn-collapse-top:hover { color: var(--ink-gold); }

/* ============================================================
   C. 消息流 messages
   ============================================================ */
/* C1 用户气泡深一度 */
.message.user .message-bubble { background: var(--y-brand-deep); }
/* C2 AI 气泡微暖米白 */
.message.ai .message-bubble {
  background: #FAF7F0;
  border-color: rgba(201, 168, 78, .18);
}
/* C4 轮次高亮 → 丹桂金 */
.turn-focus {
  box-shadow: 0 0 0 2px var(--ink-gold);
  border-radius: var(--r-lg, 12px);
}
/* C5 滚动条 */
.messages, .session-list { scrollbar-width: thin; scrollbar-color: var(--ink-gold-soft) transparent; }
.messages::-webkit-scrollbar, .session-list::-webkit-scrollbar { width: 6px; }
.messages::-webkit-scrollbar-thumb, .session-list::-webkit-scrollbar-thumb {
  background: var(--ink-gold-soft);
  border-radius: 3px;
}
.messages::-webkit-scrollbar-thumb:hover, .session-list::-webkit-scrollbar-thumb:hover {
  background: var(--ink-gold);
}

/* ============================================================
   D. 输入区 composer
   ============================================================ */
.composer-box {
  border: 1px solid rgba(201, 168, 78, .45);
  transition: border-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}
.composer-box:focus-within {
  border-color: var(--ink-gold);
  box-shadow: 0 0 0 2px var(--ink-gold-soft);
  transform: translateY(-1px);
}
/* D2 发送按钮（实际类名 .btn-send） */
.btn-send {
  background: var(--ink-gold);
  color: #FFFFFF;
  border: none;
}
.btn-send:hover { background: #D6B96A; }
.btn-send:disabled { opacity: .45; }
/* D3 底部提示小字 */
.composer-hint { color: rgba(201, 168, 78, .6); }

/* ============================================================
   F/G/H. 游客页 guest.html
   ============================================================ */
/* F1 guest-bar → 深墨绿品牌条（DOM 零改动：现有 icon+text 结构直接改样式） */
.guest-bar {
  background: var(--y-sidebar-900);
  border-bottom: 1px solid rgba(201, 168, 78, .35);
  border-radius: 0;
}
.guest-bar-icon { color: var(--ink-gold); }
.guest-bar-text { color: rgba(255, 255, 255, .82); }
.guest-bar-text b { color: var(--ink-gold); }

/* G1 空态主标语 · ChibiFu 书法体（真字体到位秒级生效） */
@font-face {
  font-family: 'ChibiFu';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/chibi_subset.woff2') format('woff2');
  unicode-range: U+4E00-9FFF, U+3000-303F, U+FF00-FFEF;
}
.scape-cap, .empty-greeting {
  font-family: 'ChibiFu', 'STXingkai', '华文行楷', 'KaiTi', 'Noto Serif SC', serif;
  font-size: 22px;
  letter-spacing: 3px;
  color: var(--ink-gold);
  animation: yRiseIn var(--dur-slow) var(--ease-out) both;
}
@keyframes yRiseIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* G2 空态装饰图 → 丹桂金（渐变 stop 换金系，DOM 不动） */
.empty-mark linearGradient stop { stop-color: #D9B96A; }
.empty-mark linearGradient stop:last-child { stop-color: #9C7A2E; }
.empty-mark linearGradient#skyGrad stop { stop-color: rgba(217, 185, 106, .14); }
.empty-mark linearGradient#skyGrad stop:last-child { stop-color: var(--surface, #FAF7F0); }

/* G3 引导 chip（guest .chip / index .suggest-chip 两套全盖） */
.chip, .suggest-chip {
  background: var(--ink-gold-faint);
  border: 1px solid var(--ink-gold-soft);
  color: #8A6D1F;
  transition: border-color var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}
.chip:hover, .suggest-chip:hover {
  border-color: var(--ink-gold);
  background: var(--ink-gold-faint);
  transform: translateY(-2px);
}
/* G4 空态入场 */
.empty-state { animation: yRiseIn var(--dur-slow) var(--ease-out) both; }

/* H. 次数用尽 overlay（#guestOverlay 内作用域，不外溢） */
#guestOverlay #guestTitle { color: var(--ink-gold); font-weight: 700; }
#guestOverlay .pc-mark { filter: sepia(.6) saturate(2.2) hue-rotate(-8deg); }
#guestOverlay .guest-benefits li {
  border-left: 3px solid var(--ink-gold);
  background: var(--ink-gold-faint);
  animation: yRiseIn var(--dur-slow) var(--ease-out) both;
}
#guestOverlay .guest-benefits li:nth-child(2) { animation-delay: .06s; }
#guestOverlay .guest-benefits li:nth-child(3) { animation-delay: .12s; }
#guestOverlay .guest-benefits li:nth-child(4) { animation-delay: .18s; }
#guestOverlay .btn-primary {
  background: var(--ink-gold);
  color: #FFFFFF;
  border: none;
}
#guestOverlay .btn-primary:hover { background: #D6B96A; }
#guestOverlay .pc-link {
  color: var(--brand-600);
  border: 1px solid var(--ink-gold-soft);
  border-radius: 8px;
  padding: 6px 14px;
}
#guestOverlay .pc-link:hover { background: var(--ink-gold-faint); }

/* ---------- 收口：小屏不破版（最小干预） ---------- */
@media (prefers-reduced-motion: reduce) {
  .message, .empty-state, .scape-cap, .empty-greeting,
  #guestOverlay .guest-benefits li { animation: none !important; }
}


/* ==================== ③ v38g 融合层 ==================== */

/* ============================================================
   chat-v38g.css · chat 对齐融合层（元宝 v38g《chat 对齐》定稿，2026-11-15）
   落位说明：设计以元宝 v38g 为标准；类名/路径按本仓归位规矩，
   不照搬包内 chat-skin.css 类名与 ../assets 临时路径。
   变更点：
     ① composer 工具行：传文件 / 传图片 / 选知识库（九宫格、视频、音频、@、表情一个不留）
     ② 左栏会话列表：今天/近7天/更早+自建分组、折叠、收藏、就地重命名、移分组、删除、只看收藏
     ③ 登录态头像统一圆形细圆框
   接线说明：选知识库 / 传文件 / 传图片 后端问答接口暂无 kb_id 与附件位，
   先落 UI 不假装可用（元宝铁律：不假装有功能）；手机「按住说话」同口径预留。
   ============================================================ */

/* ---------- ① composer 工具行 ---------- */
.composer-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}
.ct-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-700);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color .15s var(--ease-out, ease), color .15s ease;
}
.ct-btn .ct-ic { font-size: 13px; line-height: 1; color: var(--ink-500); }
.ct-btn:hover { border-color: var(--brand-500); color: var(--brand-700); }
.ct-btn:hover .ct-ic { color: var(--brand-600); }
.ct-btn b { font-weight: 600; color: var(--brand-700); }
.ct-btn:disabled { opacity: .55; cursor: not-allowed; }
.ct-btn.voice-only { display: none; }

/* 附件暂存条：文件一行一条，图片横排缩略图（不是九宫格） */
.attach-strip { margin-top: 10px; }
.attach-strip.hidden { display: none; }
.attach-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--ink-700);
}
.attach-row .ar-name {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attach-row .ar-sz { margin-left: auto; flex: none; color: var(--ink-300); font-size: 12px; }
.attach-row .ar-x, .ia .ia-x {
  flex: none;
  border: 0;
  background: none;
  color: var(--ink-500);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px 4px;
  font-family: inherit;
}
.attach-row .ar-x:hover { color: #d9534f; }
.img-attach { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.img-attach .ia {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.img-attach .ia img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-attach .ia .ia-x {
  position: absolute;
  right: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: center;
}
.img-attach .ia .ia-x:hover { color: #d9534f; }

/* ---------- 通用浮层（传文件/传图片/选知识库/分组） ---------- */
.gscrim {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(20, 40, 35, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.gscrim.hidden { display: none; }
.gmodal {
  width: min(420px, 92vw);
  max-height: 80vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  padding: 20px;
}
.gmodal h3 { margin: 0 0 6px; font-size: 16px; color: var(--ink-900); font-family: var(--font-serif, inherit); }
.gmodal .gm-sub { margin: 0 0 14px; font-size: 12.5px; color: var(--ink-500); }
.gmodal .gm-f { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.gmodal .gm-ghost {
  border: 1px solid var(--line-strong);
  background: none;
  border-radius: var(--r-md);
  padding: 9px 16px;
  color: var(--ink-700);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}
.gmodal .gm-primary {
  border: 0;
  background: var(--brand-600);
  border-radius: var(--r-md);
  padding: 9px 16px;
  color: #fff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.gmodal .gm-primary:hover { background: var(--brand-700); }

/* 知识库单选 */
.kb-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.kb-list .radio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink-700);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  text-align: left;
}
.kb-list .radio.on { border-color: var(--brand-500); background: var(--brand-050); color: var(--brand-700); font-weight: 600; }
.kb-note { margin: 10px 0 0; font-size: 12px; color: var(--ink-500); }

/* 分组管理 */
.group-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.group-list button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 10px 12px;
  color: var(--ink-700);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}
.group-list button:hover { border-color: var(--brand-500); color: var(--brand-700); }
.group-list button span { color: var(--ink-300); font-size: 12.5px; }
.group-list .gh-time { cursor: default; }
.group-list .gh-time:hover { border-color: var(--line); color: var(--ink-700); }

/* ---------- ② 左栏会话列表：分组 / 收藏 / 重命名 / 移分组 / 删除 ---------- */
.sidebar-head .sb-actions { display: flex; gap: 8px; width: 100%; }
.sidebar-head .sb-actions .btn-new-chat { flex: 1; min-width: 0; }
.sb-group-btn {
  flex: none;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-sm);
  padding: 0 12px;
  font-size: 13px;
  color: var(--brand-700);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.sb-filter { margin: 8px 0 4px; }
.sb-filter button {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12.5px;
  color: var(--ink-700);
  cursor: pointer;
  font-family: inherit;
}
.sb-filter button.on { background: var(--brand-050); border-color: var(--brand-500); color: var(--brand-700); }

.session-group { margin-bottom: 10px; }
.session-gh {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  color: var(--ink-500);
  font-size: 12px;
  letter-spacing: .04em;
}
.session-gh .gh-toggle {
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.session-gh .gh-arrow { display: inline-block; transition: transform .15s ease; font-size: 10px; }
.session-group.collapsed .gh-arrow { transform: rotate(-90deg); }
.session-group.collapsed .session-gb { display: none; }
.session-gh .gh-cnt { color: var(--ink-300); }

.session-item { position: relative; }
.session-time { font-size: 11px; color: var(--ink-300); margin-left: 6px; flex: none; }
.session-item .session-title { flex: 1; min-width: 0; }

/* 悬停动作条：★收藏 ✎重命名 ▤移分组 ✕删除 */
.session-acts {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 5px;
  box-shadow: var(--sh-1);
  z-index: 2;
}
.session-item:hover .session-acts,
.session-item.show-acts .session-acts { display: flex; }
.session-acts button {
  border: 0;
  background: none;
  color: var(--ink-500);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 5px;
  font-family: inherit;
  line-height: 1;
}
.session-acts button:hover { color: var(--brand-700); }
.session-acts button.sa-del:hover { color: #d9534f; }
.session-item.fav .sa-fav { color: var(--accent-600); }
/* 收藏条替代旧的内嵌删除 ×（功能同一后端接口，入口并入动作条） */
.session-del { display: none !important; }

/* 只看收藏 */
.session-list.fav-only .session-item:not(.fav) { display: none; }
.session-list.fav-only .session-group { display: none; }
.session-list.fav-only .session-group.has-fav { display: block; }

/* 就地重命名 */
.session-rename {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--brand-500);
  border-radius: var(--r-xs);
  padding: 4px 6px;
  font: inherit;
  font-size: 13px;
  color: var(--ink-900);
  background: var(--surface);
  outline: none;
}

/* ---------- ③ 登录态头像细圆框 ---------- */
.acct-avatar, .acct-menu-avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--brand-050);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line);
}
[data-theme="dark"] .acct-avatar,
[data-theme="dark"] .acct-menu-avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line-strong); }

/* ---------- 深色微调 ---------- */
[data-theme="dark"] .gscrim { background: rgba(0, 0, 0, .55); }

/* ---------- 手机适配 ---------- */
@media (max-width: 820px) {
  .ct-btn.voice-only { display: inline-flex; }
  .session-time { display: none; }
  .session-item:hover .session-acts { display: none; }
  .session-item.show-acts .session-acts { display: flex; }
  .gmodal { width: min(400px, 94vw); max-height: 78vh; }
}

/* ---------- 备案小字（2026-11-16 老板令：全站页脚统一挂 ICP+公安备案） ---------- */
.bx-beian {
  flex: none; padding: 2px var(--s-3) calc(var(--s-3) + 2px);
  text-align: center; font-size: 10.5px; color: var(--ink-300); line-height: 1.7;
}
.bx-beian a { color: var(--ink-300); text-decoration: none; margin: 0 4px; }
.bx-beian a:hover { color: var(--brand-600); }
.composer-hint .bx-beian { padding: 0; font-size: 11px; }
.composer-hint .bx-beian a { margin: 0 3px; color: var(--ink-300); }
