  /* finesse · register=product · A=brand-green+neutral-ramp · B=regular/500
   * C=app-shell-2col · D=CSS-only · E=flat-dark-hairline · SOUL=6 SPECTACLE=1 DENSITY=6 */
  :root {
    /* 品牌层 —— 2026-10-19 换微信绿（与管理端 tokens.css 同源），原 WhatsApp 绿已废弃 */
    --brand: #07c160;
    --brand-dark: #06ad56;
    --brand-ink: #04241d;      /* 绿实底上压的字 */
    --brand-100: #4ade80;
    --brand-text: #4ade80;     /* 淡绿底上压的字（深色底用亮绿） */
    --brand-soft: rgba(7, 193, 96, .14);
    /* 语义层 */
    --ok: #07c160;
    --warn: #f0b232;
    --warn-soft: rgba(240, 178, 50, .16);
    --danger: #fa5151;
    /* 中性层 —— 深浅两套与管理端 tokens.css 同值（微信官方深色 #111/#191919），
       2026-10-19 员工端换微信风：只换颜色，排版令牌与布局不动 */
    --bg: #111111;
    --surface: #191919;
    --surface-2: #232323;
    --surface-3: #2a2a2a;
    --bubble-out: #0a5b43;      /* 微信绿系推导的深色气泡（原 WhatsApp #2b5d45） */
    --line: rgba(255, 255, 255, .08);
    --line-strong: rgba(255, 255, 255, .16);
    --inset: rgba(255, 255, 255, .04);
    --neutral-soft: rgba(255, 255, 255, .07);
    --ink-0: #e5e5e5;
    --ink-1: #c9c9c9;
    --ink-2: #a3a3a3;
    --ink-3: #7e7e7e;
    --ink-4: #5c5c5c;
    --bg-glow: #1a1a1a;
    --bar-bg: rgba(17, 17, 17, .94);
    --bar-highlight: rgba(255, 255, 255, .05);
    --scrim: rgba(0, 0, 0, .62);
    color-scheme: dark;
    /* 字体：Windows 上让「微软雅黑 UI」统一接管中英文，
       避免 Segoe UI 管拉丁 + YaHei 管中文造成的字面不匹配 */
    --font-ui: -apple-system, BlinkMacSystemFont, "PingFang SC",
      "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", sans-serif;
    --font-mono: "SFMono-Regular", "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
    /* 字号刻度：12 / 13 / 14 / 16 / 17 / 22，每级至少差 1px，中文不低于 12px */
    --fs-micro: 12px;
    --fs-xs: 13px;
    --fs-sm: 14px;
    --fs-base: 16px;
    --fs-body: 16px;
    --fs-md: 16px;
    --fs-lg: 17px;
    --fs-xl: 22px;
    /* 行高分档：标签紧、列表中、正文松 */
    --lh-tight: 1.32;
    --lh-ui: 1.5;
    --lh-read: 1.75;
    /* 间距（4px 基准） */
    --s-1: 4px; --s-2: 8px; --s-3: 12px;
    --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-7: 28px;
    /* 圆角 / 阴影 */
    --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px; --r-pill: 999px;
    --sh-1: 0 1px 2px rgba(0, 0, 0, .24);
    --sh-2: 0 8px 24px rgba(0, 0, 0, .36);
    --sh-app: 0 24px 64px rgba(0, 0, 0, .5);
    /* 动效 */
    --t-fast: 150ms;
    --t-base: 240ms;
    --e-out: cubic-bezier(.22, 1, .36, 1);
    /* 层级：抽屉 < 弹层 < 确认框 < 浮层提示 < 首屏骨架
       员工端手机版左菜单里能直接开「商品库/话术速查/切换产品」，
       抽屉(z55) 曾压住弹层(z50)，弹窗一开就被菜单挡住 —— 这里按层排开，别再随手写数字 */
    --z-header: 10;
    --z-overlay: 50;
    --z-drawer-mask: 54;
    --z-drawer: 55;
    --z-sheet: 60;
    --z-dialog: 70;
    --z-toast: 90;
    --z-splash: 95;
    /* 旧变量别名（组件已引用，统一收口到新令牌） */
    --wa-green: var(--brand);
    --wa-green-dark: var(--brand-dark);
    --panel: var(--surface);
    --panel-2: var(--surface-2);
    --bubble-in: var(--surface-2);
    --text: var(--ink-1);
    --text-dim: var(--ink-3);
    --border: var(--line);
  }

  /* 字号三档（2026-10-21）：手机小屏 / 老员工看不清时放大一档；只改刻度变量，其余样式自动跟随。
     默认（标准）不加 data-fs，保持原样；data-fs 由 06-ui 的 applyFontScale 写到 <html> 上。 */
  html[data-fs="s"] {
    --fs-micro: 11px; --fs-xs: 12px; --fs-sm: 13px;
    --fs-base: 15px; --fs-body: 15px; --fs-md: 15px; --fs-lg: 16px; --fs-xl: 20px;
  }
  html[data-fs="l"] {
    --fs-micro: 13px; --fs-xs: 14px; --fs-sm: 15.5px;
    --fs-base: 18px; --fs-body: 18px; --fs-md: 18px; --fs-lg: 19px; --fs-xl: 24px;
  }


  /* ---------------- 浅色主题（只覆盖值，不改结构） ---------------- */
  :root[data-theme="light"] {
    --bg: #ededed;
    --surface: #ffffff;
    --surface-2: #f7f7f7;
    --surface-3: #f0f0f0;
    --bubble-out: #d9fdd3;      /* 微信浅色气泡绿，本来就是 */
    --line: rgba(0, 0, 0, .06);
    --line-strong: rgba(0, 0, 0, .12);
    --inset: rgba(0, 0, 0, .035);
    --neutral-soft: rgba(0, 0, 0, .06);
    --ink-0: #191919;
    --ink-1: #353535;
    --ink-2: #5a5a5a;
    --ink-3: #7f7f7f;
    --ink-4: #a8a8a8;
    --brand-100: #07c160;
    --brand-text: #0a7d43;     /* 白底上的微信绿太淡（对比度只有 2.2），文字压深一档 */
    --brand-ink: #ffffff;
    --brand-soft: rgba(7, 193, 96, .10);
    --warn: #b87400;
    --warn-soft: rgba(250, 157, 59, .14);
    --danger: #e64340;
    --sh-1: 0 1px 2px rgba(0, 0, 0, .06);
    --sh-2: 0 8px 24px rgba(0, 0, 0, .10);
    --sh-app: 0 24px 64px rgba(0, 0, 0, .16);
    --bg-glow: #e2e2e2;
    --bar-bg: rgba(255, 255, 255, .92);
    --bar-highlight: rgba(255, 255, 255, .9);
    --scrim: rgba(0, 0, 0, .45);
    color-scheme: light;
  }
  * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
  html, body {
    margin: 0; padding: 0; height: 100%;
    background: var(--bg); color: var(--ink-1);
    font-family: var(--font-ui);
    font-size: var(--fs-base); line-height: var(--lh-ui);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-variant-numeric: tabular-nums;
    overscroll-behavior: none;
    overflow-x: clip;
  }
  body { display: flex; flex-direction: column; height: 100dvh; }
  #app { display: flex; flex-direction: column; height: 100dvh; }
  button { font-family: inherit; }
  :focus-visible { outline: 2px solid var(--brand-100); outline-offset: 2px; }
  .sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: .01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: .01ms !important;
      scroll-behavior: auto !important;
    }
  }

  /* ---------------- 登录页 ---------------- */
  /* 首屏骨架：#login 默认就在 DOM 里，/api/me 回来之前会先画出来 → 刷新时「闪一下登录页」。
     进页面时 html 带 .booting（index.html 的内联脚本打上），骨架盖住登录页；
     boot 结束（进主界面或确认未登录）再摘掉这个类。 */
  html.booting #login { visibility: hidden; }
  #splash { display: none; }
  html.booting #splash {
    position: fixed; inset: 0; z-index: var(--z-splash);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-4);
    background: var(--bg);
  }
  .splash-brand {
    width: 60px; height: 60px; border-radius: var(--r-xl);
    display: grid; place-items: center;
    background: var(--brand-soft); color: var(--brand-100);
  }
  .splash-brand svg { width: 30px; height: 30px; }
  .splash-bar {
    width: 96px; height: 3px; border-radius: 2px;
    background: var(--line); overflow: hidden;
  }
  .splash-bar i {
    display: block; width: 42%; height: 100%; border-radius: 2px;
    background: var(--brand);
    animation: splashSlide 1.1s ease-in-out infinite;
  }
  @keyframes splashSlide {
    from { transform: translateX(-105%); }
    to { transform: translateX(240%); }
  }
  @media (prefers-reduced-motion: reduce) {
    .splash-bar i { animation: none; width: 100%; }
  }

  #login {
    position: fixed; inset: 0; z-index: var(--z-overlay);
    display: flex; align-items: center; justify-content: center;
    padding: var(--s-6);
    background: var(--bg);
  }
  #login .card {
    display: flex; flex-direction: column; align-items: center;
    gap: var(--s-4); width: 100%; max-width: 360px;
  }
  #login h1 { margin: 0 0 var(--s-2); font-size: var(--fs-xl); font-weight: 600; letter-spacing: -.012em; line-height: var(--lh-tight); text-align: center; }
  #login .brand {
    width: 64px; height: 64px; border-radius: var(--r-xl);
    display: grid; place-items: center;
    background: var(--brand-soft); color: var(--brand-100);
  }
  #login .brand svg { width: 30px; height: 30px; }
  .field { width: 100%; display: flex; flex-direction: column; gap: var(--s-2); }
  .field input {
    width: 100%; padding: 14px 16px; border-radius: var(--r-md);
    border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-1);
    font-size: var(--fs-body); outline: none;
    transition: border-color var(--t-fast);
  }
  .field input:hover { border-color: var(--line-strong); }
  .field input:focus { border-color: var(--brand); }
  .field button {
    width: 100%; height: 48px; border: 0; border-radius: var(--r-md); cursor: pointer;
    background: var(--brand); color: var(--brand-ink);
    font-size: var(--fs-body); font-weight: 600;
    transition: filter var(--t-fast);
  }
  .field button:hover { filter: brightness(1.06); }
  .field button:active { filter: brightness(.92); }
  .field button:disabled { opacity: .55; cursor: not-allowed; }
  #loginErr, #regErr, #codeErr {
    color: var(--danger); font-size: var(--fs-xs); min-height: 18px; text-align: center;
  }
  #loginErr.ok, #regErr.ok { color: var(--brand-100); }

  /* 验证码行 */
  .cap-row { display: flex; gap: var(--s-2); width: 100%; }
  .cap-row input { flex: 1; min-width: 0; }
  .cap-box {
    flex: 0 0 auto; width: 132px; height: 48px;
    border-radius: var(--r-md); overflow: hidden;
    border: 1px solid var(--line); cursor: pointer;
  }
  .cap-box svg { display: block; width: 100%; height: 100%; }

  .login-foot {
    display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; justify-content: center;
    font-size: var(--fs-sm);
  }
  .login-foot a { color: var(--brand-100); text-decoration: none; }
  .login-foot a:hover { text-decoration: underline; }

  /* ---------------- 顶部栏 ---------------- */
  header {
    flex: 0 0 auto; display: flex; align-items: center; gap: var(--s-3);
    padding: var(--s-2) var(--s-4);
    padding-top: max(var(--s-2), env(safe-area-inset-top));
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: var(--z-header);
  }
  header .avatar {
    width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto;
    display: grid; place-items: center;
    background: var(--brand-soft); color: var(--brand-100);
  }
  header .avatar svg { width: 20px; height: 20px; }
  /* WhatsApp 实心 logo 撑满 24 视口，比原来的线框气泡显大，单独收一档 */
  header .avatar .wa-logo { width: 18px; height: 18px; }
  header .who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
  header .who-top { display: flex; align-items: center; gap: var(--s-2); min-width: 0; }
  header .who-bottom { display: flex; align-items: center; gap: var(--s-2); min-width: 0; }
  header .who-top b {
    font-size: var(--fs-md); font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .presence {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: var(--fs-micro); color: var(--ink-3); flex: 0 0 auto;
  }
  .presence .dot {
    width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
    box-shadow: 0 0 0 3px rgba(7, 193, 96, .14);
    animation: breathe 2.4s ease-in-out infinite;
  }
  @keyframes breathe {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 3px rgba(7, 193, 96, .14); }
    50% { opacity: .62; box-shadow: 0 0 0 5px rgba(7, 193, 96, .05); }
  }
  .prod-pick {
    align-self: center; max-width: 100%;
    display: inline-flex; align-items: center; gap: 4px;
    border: 1px solid var(--line); background: var(--surface-2);
    color: var(--ink-2); font-size: var(--fs-micro);
    padding: 2px 8px; border-radius: var(--r-pill);
    cursor: pointer;
    transition: border-color var(--t-fast), color var(--t-fast);
  }
  .prod-pick::before { content: "产品"; color: var(--ink-4); white-space: nowrap; flex: 0 0 auto; }
  .prod-pick:hover { border-color: var(--line-strong); color: var(--ink-0); }
  .prod-pick:hover::before { color: var(--ink-3); }
  .prod-pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .prod-pick svg { width: 11px; height: 11px; flex: 0 0 auto; }
  .icon-btn {
    flex: 0 0 auto; width: 44px; height: 44px;
    display: grid; place-items: center;
    border: 0; background: transparent; color: var(--ink-3);
    border-radius: 50%; cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast);
  }
  .icon-btn svg { width: 20px; height: 20px; }
  .icon-btn:hover { background: var(--surface-2); color: var(--ink-1); }
  .icon-btn:active { background: var(--surface-2); }

  /* 顶栏「更多」下拉：清空对话 / 退出登录 */
  .more-wrap { position: relative; flex: 0 0 auto; }
  .more-menu {
    position: fixed; top: 60px; right: 12px; /* 实际位置由 JS 按触发按钮计算 */
    min-width: 148px; padding: 4px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-md); box-shadow: var(--sh-2);
    z-index: 20;
    animation: sheetUp 180ms var(--e-out);
  }
  .more-item {
    display: flex; align-items: center; gap: var(--s-2);
    width: 100%; padding: 10px var(--s-3);
    border: 0; background: transparent; color: var(--ink-1);
    font-size: var(--fs-sm); text-align: left; border-radius: var(--r-sm);
    cursor: pointer; white-space: nowrap;
    transition: background var(--t-fast);
  }
  .more-item:hover { background: var(--surface-2); }
  .more-item svg { width: 16px; height: 16px; flex: 0 0 auto; }
  .more-item.danger { color: var(--danger); }
  .more-value { margin-left: auto; padding-left: var(--s-3); color: var(--ink-4); font-size: var(--fs-micro); }
  .more-sep { height: 1px; background: var(--line); margin: 4px 6px; }

  /* ---------------- 消息区 ---------------- */
  #chat {
    flex: 1 1 auto; overflow-y: auto; overflow-x: hidden;
    padding: var(--s-4) var(--s-3) var(--s-2);
    display: flex; flex-direction: column; gap: var(--s-2);
    -webkit-overflow-scrolling: touch;
    /* 滚动条出现/消失会让内容区宽度跳一下（流式输出时最明显，看起来整个聊天区在抖）。
       预留槽位后宽度恒定，PC 端不会再抽动。 */
    scrollbar-gutter: stable;
  }
  .row { display: flex; width: 100%; }
  .row.me { justify-content: flex-end; }
  .row.bot { justify-content: flex-start; }

  .sys {
    align-self: center; text-align: center;
    font-size: var(--fs-xs); color: var(--ink-3);
    background: var(--surface-2); padding: 6px var(--s-3);
    border: 1px solid var(--line); border-radius: var(--r-md);
    max-width: 88%; margin: var(--s-1) 0;
  }

  /* 浮层提示：聊天区被左菜单盖住时（改对话模式等）用它，不写进会话历史 */
  #toastHost {
    position: fixed; left: 50%; transform: translateX(-50%);
    bottom: calc(88px + env(safe-area-inset-bottom));
    z-index: var(--z-toast);
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    pointer-events: none;
  }
  .toast {
    max-width: min(86vw, 420px);
    padding: 9px 14px; border-radius: var(--r-pill);
    background: var(--ink-0); color: var(--bg);
    font-size: var(--fs-xs); line-height: 1.45; text-align: center;
    box-shadow: var(--sh-2);
    opacity: 0; transform: translateY(6px);
    transition: opacity .18s ease, transform .18s ease;
  }
  .toast.on { opacity: .96; transform: none; }

  /* 顶部系统行：AI 状态徽章 + 说明文字 */
  .sys-status {
    display: flex; align-items: center; gap: var(--s-2);
    max-width: 96%; text-align: left;
  }
  .sys-status .sys-text { flex: 1; min-width: 0; text-wrap: balance; }
  .ai-badge {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; gap: 4px;
    font-size: var(--fs-micro); font-weight: 600; letter-spacing: 0;
    padding: 2px var(--s-2); border-radius: var(--r-pill);
    border: 1px solid transparent; white-space: nowrap;
  }
  .ai-badge i { width: 6px; height: 6px; border-radius: 50%; display: block; }
  .ai-badge.on { color: var(--brand-100); background: var(--brand-soft); border-color: rgba(7, 193, 96, .3); }
  .ai-badge.on i { background: var(--brand); }
  .ai-badge.off { color: var(--warn); background: var(--warn-soft); border-color: rgba(240, 178, 50, .3); }
  .ai-badge.off i { background: var(--warn); }

  /* 时间戳：100% 宽换到气泡下一行 */
  .row { flex-wrap: wrap; }
  .stamp { flex: 0 0 100%; font-size: var(--fs-micro); color: var(--ink-4); margin-top: 4px; padding: 0 2px; line-height: var(--lh-tight); }
  .row.me .stamp { text-align: right; }

  /* 回到底部 */
  #app { position: relative; }
  /* 回到最新（2026-11-03，C-21）：锚在消息区右下角，距输入栏 12px。
     手机端在下面的 @media (max-width: 899px) 里再抬高，避开输入框上方的悬浮功能条。
     2026-11-03 补：从纯图标圆钮改成「图标 + 回到底部」胶囊 —— 员工看不出箭头是干嘛的，
     加文字才明确（用户点名要求）。 */
  .to-bottom {
    position: absolute; right: 16px; bottom: 12px; z-index: 6;
    display: inline-flex; align-items: center; gap: 5px;
    height: 34px; padding: 0 13px 0 11px; border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    color: var(--ink-2);
    font-size: var(--fs-micro); line-height: 1; white-space: nowrap;
    cursor: pointer;
    /* 比卡片重一档：它浮在消息上，得能压住内容又不抢眼 */
    box-shadow: var(--sh-2);
    transition: opacity var(--t-fast), transform var(--t-fast),
      color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
  }
  .to-bottom svg { width: 15px; height: 15px; flex: 0 0 auto; }
  .to-bottom-txt { font-weight: 500; letter-spacing: .2px; }
  .to-bottom:hover {
    color: var(--brand-100); border-color: var(--brand);
    background: var(--surface-2);
  }
  .to-bottom:active { transform: scale(.96); }

  /* 失败重试 */
  .retry-btn {
    margin-left: 8px; padding: 2px 10px; font-size: var(--fs-micro);
    border-radius: 999px; border: 1px solid var(--line-strong);
    background: transparent; color: var(--brand-100); cursor: pointer;
  }
  .retry-btn:hover { background: var(--brand-soft); }

  .bubble {
    max-width: 86%; padding: 12px var(--s-4);
    border-radius: var(--r-lg);
    line-height: var(--lh-read);
    word-break: break-word; white-space: pre-wrap; position: relative;
    border: 1px solid transparent;
  }
  .bubble.me {
    background: var(--bubble-out); border-top-right-radius: 3px;
  }
  .bubble.bot {
    background: var(--surface-2); border-top-left-radius: 3px;
    border-color: var(--line);
  }
  /* 话术库答复按内容收缩会把总结行挤成两行，统一撑满可用宽度（上限仍是 86%/620px） */
  .bubble.bubble-ans { width: 100%; }
  /* 客户原话太长时先折 4 行（-webkit-line-clamp 保留省略号，纯 CSS 不需要测字数） */
  .me-body.clamp {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4;
    overflow: hidden;
  }
  .me-more {
    display: block; margin-top: 6px; padding: 0;
    font: inherit; font-size: var(--fs-micro); line-height: 1.4;
    background: transparent; border: 0; cursor: pointer;
    color: inherit; opacity: .75; text-decoration: underline;
  }
  .me-more:hover { opacity: 1; }

  /* 话术卡片 */
  .card { display: flex; flex-direction: column; gap: var(--s-3); }
  /* 卡片头：整张卡只有这一处强强调，用墨色 + 字重，不用品牌色 */
  .card-title {
    font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0;
    color: var(--ink-0); line-height: var(--lh-tight);
    display: flex; align-items: center; gap: var(--s-2);
  }
  .card-title > span { display: flex; align-items: center; gap: 6px; min-width: 0; }
  .card-title svg { width: 14px; height: 14px; flex: 0 0 auto; color: var(--ink-4); }
  .tag {
    font-size: var(--fs-micro); padding: 1px 8px;
    border-radius: var(--r-sm); font-weight: 500;
    background: var(--neutral-soft); color: var(--ink-3);
  }
  .tag.b { background: var(--warn-soft); color: var(--warn); }
  .tag.c { background: var(--neutral-soft); color: var(--ink-4); }

  /* 区块标签：把「彩色小标题」压成中性注记——
     大小写字母距、图标、彩色全部去掉，靠留白和字色分层，不靠装饰 */
  .sec { display: flex; flex-direction: column; gap: 5px; }
  /* 标签行兼作工具栏：左边标签，右边复制按钮。
     按钮走正常流，永远不会跑出气泡——之前在手机端用 absolute 贴右，
     会压到气泡圆角上，看着像溢出了。 */
  .sec-label {
    font-size: var(--fs-micro); color: var(--ink-3); font-weight: 500;
    letter-spacing: 0; line-height: var(--lh-tight);
    display: flex; align-items: center; justify-content: flex-start;
    gap: var(--s-2); min-width: 0;
  }
  .sec-label-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* 标签行里的弹性占位：按钮整组贴右，中间的角标/按钮不会被 space-between 甩到正中 */
  .sec-spacer { flex: 1 1 auto; }
  .sec-label svg { display: none; }
  .sec-label.zh::before, .sec-label.en::before { content: none; }
  /* 正文：英文话术是主件（亮墨），中文对照是参照（灰），强调只靠字重 */
  .sec-body { font-size: var(--fs-base); color: var(--ink-0); line-height: var(--lh-read); }
  .sec-body.zh { color: var(--ink-3); }
  .sec-body.en { color: var(--ink-0); }
  .sec-body strong { color: var(--ink-0); font-weight: 700; }

  .opt {
    border: 1px solid var(--line); border-radius: var(--r-md);
    padding: 10px var(--s-3) var(--s-3);
    display: flex; flex-direction: column; gap: var(--s-3);
    background: var(--inset);
  }
  .opt-head {
    font-size: var(--fs-xs); font-weight: 600; color: var(--ink-0);
    line-height: var(--lh-tight);
    display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline;
    word-break: break-word;
  }
  .opt-head .opt-no { flex: 0 0 auto; white-space: nowrap; }
  .scene {
    font-size: var(--fs-micro); color: var(--ink-3); font-weight: 400;
    flex: 1 1 100%; line-height: var(--lh-ui); word-break: break-word;
  }

  .copy-line {
    display: flex; gap: var(--s-2); align-items: stretch;
  }
  .copy-line .sec-body { flex: 1; }
  .copy-btn {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    background: transparent; color: var(--ink-3);
    font-size: var(--fs-micro); height: 24px; padding: 0 9px; line-height: 1;
    border-radius: var(--r-sm); cursor: pointer; white-space: nowrap;
    transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
  }
  .copy-btn:hover { background: var(--surface-3); color: var(--ink-0); border-color: var(--line-strong); }
  .copy-btn:active { background: var(--brand-soft); }
  /* 「改一下」是次要动作：去掉边框，别和「复制」抢视线 */
  .copy-btn.ghost { border-color: transparent; }
  .copy-btn.done { background: var(--brand); color: var(--brand-ink); border-color: transparent; }

  .divider { height: 1px; background: var(--line); margin: 1px 0; }

  /* 折叠：一条提问可能命中 3 条话术，全展开要刷 4 屏。
     默认只展开最相关那条，其余折成一行标题，点开看细节。 */
  .fold > summary {
    display: flex; align-items: center; gap: 6px;
    cursor: pointer; list-style: none;
    font-size: var(--fs-xs); color: var(--ink-2);
    line-height: var(--lh-ui); padding: 7px 0; min-width: 0;
  }
  .fold > summary::-webkit-details-marker { display: none; }
  .fold > summary::before {
    content: ''; flex: 0 0 auto;
    width: 0; height: 0;
    border-left: 5px solid var(--ink-4);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transition: transform var(--t-fast);
  }
  .fold[open] > summary::before { transform: rotate(90deg); }
  .fold > summary:hover { color: var(--ink-0); }
  .fold > summary:focus-visible { outline: 1px dashed var(--line-strong); outline-offset: 2px; }
  .fold-sum-title {
    flex: 1 1 auto; min-width: 0; color: var(--ink-1);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  /* 序号 + 标题绑成一个整体（拆开的话手机上「1.」会孤零零占一行） */
  .fold-sum-head {
    display: flex; align-items: baseline; gap: 5px;
    flex: 1 1 auto; min-width: 0;
  }
  /* 角标整组：桌面跟在标题后同一行，手机上整组换行 */
  .fold-sum-badges {
    display: flex; align-items: center; gap: 6px;
    flex: 0 0 auto;
  }
  /* 展开 / 收起 提示（纯 CSS，跟着 open 状态自己变） */
  .fold-sum-hint { flex: 0 0 auto; font-size: var(--fs-micro); color: var(--ink-4); }
  /* 标题行里的标签不许被压成竖排 */
  .fold > summary .tag { flex: 0 0 auto; white-space: nowrap; }

  /* 手机上：第一行 = ▸ 1. 标题 …… 展开，待填角标/对应句另起一行。
     靠 order 把「展开」提到角标前面，否则角标换行后会把展开也拽下去。 */
  @media (max-width: 520px) {
    .fold > summary { flex-wrap: wrap; row-gap: 4px; align-items: flex-start; }
    .fold > summary::before { margin-top: 6px; }
    .fold-sum-head { flex: 1 1 auto; min-width: 0; }
    .fold-sum-title { white-space: normal; line-height: 1.35; }
    .fold-sum-badges { order: 2; flex: 1 1 100%; margin-top: 1px; }
    .fold-sum-hint { order: 1; margin-left: auto; align-self: center; }
  }
  .fold-sum-hint::after { content: '展开'; }
  .fold[open] > summary .fold-sum-hint::after { content: '收起'; }
  /* 卡片级折叠：标题行本身就是卡片头，别再多一层留白 */
  .fold > summary .card-title { flex: 1 1 auto; min-width: 0; }
  .fold-opt > summary { padding: 5px 0; }

  /* ---------------- 一条答复 = 一个气泡 ----------------
     总结行 + 可折叠的话术列表 + 缺口提示，全部装在同一个气泡里，
     不再一条话术发一个气泡（那样一次提问会刷出三四个独立消息）。 */
  .ans { display: flex; flex-direction: column; gap: var(--s-3); }
  .sum { font-size: var(--fs-xs); color: var(--ink-2); line-height: var(--lh-ui); }
  .sum b { color: var(--ink-0); font-weight: 700; }
  .sum-sub { font-size: var(--fs-micro); color: var(--ink-4); }
  .ans-list { display: flex; flex-direction: column; gap: 2px; }
  .ans-list > .fold + .fold { border-top: 1px solid var(--line); }
  .fold-no {
    flex: 0 0 auto; color: var(--ink-3);
    font-variant-numeric: tabular-nums; font-size: var(--fs-micro);
  }

  /* 选项 tab：三个方案竖排会占满整屏，改成横排切换 */
  .tabs { display: flex; flex-direction: column; gap: var(--s-2); }
  .tab-bar { display: flex; gap: 6px; flex-wrap: wrap; }
  .tab {
    font: inherit; font-size: var(--fs-micro); line-height: 1;
    padding: 6px 11px; border-radius: var(--r-pill); cursor: pointer;
    border: 1px solid var(--line); background: transparent; color: var(--ink-2);
    transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
  }
  .tab:hover { color: var(--ink-0); border-color: var(--line-strong); }
  .tab.on {
    background: var(--brand-soft); border-color: var(--brand); color: var(--ink-0);
    font-weight: 600;
  }
  .tab-panel { display: none; flex-direction: column; gap: var(--s-3); }
  .tab-panel.on { display: flex; }
  .tab-scene { font-size: var(--fs-micro); color: var(--ink-3); line-height: var(--lh-ui); }

  /* 纠错重生成的标记：一行弱提示，不抢正文 */
  .regen-tag {
    display: inline-block; margin-bottom: var(--s-2);
    padding: 2px var(--s-2); border-radius: var(--r-pill);
    /* 底色是半透明绿（不是绿色实底），文字必须用 brand-100：
       深色主题下 brand-100 是亮绿、浅色主题下是深绿，两种都清楚 */
    font-size: var(--fs-micro); color: var(--brand-text);
    background: var(--brand-soft); border: 1px solid rgba(7, 193, 96, .28);
  }

  /* 思考面板挂在气泡**上方**，独立于气泡本身：
     slot 独占一整行把气泡挤到下一行，宽度贴合内容，但和气泡同属一条 row，
     滚动天然同步（不是 position:fixed，也不是另起一条消息）。 */
  .think-slot {
    flex: 0 0 100%; display: flex; align-items: flex-start;
    min-width: 0;
  }
  /* 宽度固定，不做 shrink-to-fit：收起时那一行文字每个字都在变，
     面板如果跟着内容伸缩，整个聊天区会一直抖动 */
  .think-slot .think { width: 100%; max-width: 86%; margin-bottom: var(--s-2); }

  /* AI 思考过程：模型边吐字边展示，但员工要的是能直接发给客户的话，
     所以原始输出折进一个默认收起的面板——收起时只露最新一行，
     展开能看完整过程；生成完这里保持收起，下面是整理好的最终结果。 */
  .think {
    margin: 0 0 var(--s-3);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface-1);
    overflow: hidden;
  }
  .think > summary {
    display: flex; align-items: center; gap: var(--s-2);
    padding: 7px 10px; cursor: pointer; list-style: none;
    font-size: var(--fs-micro); color: var(--ink-3);
    user-select: none;
  }
  .think > summary::-webkit-details-marker { display: none; }
  .think-caret { flex: none; display: flex; }
  .think-caret svg {
    width: 14px; height: 14px;
    transition: transform var(--t-fast);
  }
  .think[open] .think-caret svg { transform: rotate(90deg); }
  .think-title { flex: none; font-weight: 600; color: var(--ink-2); }
  .think.is-live .think-title::after {
    content: '…'; animation: caret 1s steps(1) infinite;
  }
  .think-live {
    flex: 1 1 auto; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--ink-3);
  }
  .think-meta { flex: none; color: var(--ink-3); font-variant-numeric: tabular-nums; }
  .think-body {
    max-height: 240px; overflow: auto;
    padding: 9px 11px 11px;
    border-top: 1px dashed var(--line);
    font-size: var(--fs-micro); color: var(--ink-2);
    white-space: pre-wrap; word-break: break-word;
    line-height: 1.62;
  }

  /* 流式输出：末尾跟着一个闪烁光标，让「还在生成」这件事看得见 */
  .stream-caret::after {
    content: '▍'; color: var(--brand); margin-left: 1px;
    animation: caret 1s steps(1) infinite;
  }
  @keyframes caret { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
  .stream-hint {
    display: flex; align-items: center; gap: var(--s-2);
    font-size: var(--fs-micro); color: var(--ink-3);
  }

  /* 缺口提示：比话术卡弱一点，但不能弱到看不见——漏答比答错更难被发现 */
  .openq {
    border: 1px dashed var(--warn);
    border-radius: var(--r-md);
    background: var(--warn-soft);
    padding: var(--s-3);
    display: flex; flex-direction: column; gap: var(--s-2);
  }
  .openq-head { font-size: 12px; color: var(--warn); line-height: 1.5; }
  .openq-line { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
  .openq-text {
    flex: 1; min-width: 0; font-size: 13px; color: var(--ink-0);
    line-height: 1.5; word-break: break-word;
  }
  .openq-btn {
    flex: none; font: inherit; font-size: 12px; line-height: 1;
    padding: 6px 10px; border-radius: var(--r-pill); cursor: pointer;
    background: transparent; color: var(--ink-1);
    border: 1px solid var(--line-strong);
    transition: background .15s, color .15s;
  }
  .openq-btn:hover:not(:disabled) { background: var(--surface-3); color: var(--ink-0); }
  .openq-btn:disabled { opacity: .5; cursor: default; }
  /* 底部：整段原话一次性问 AI（逐句问会丢掉句子之间的上下文） */
  .openq-foot {
    display: flex; justify-content: flex-end; gap: var(--s-2);
    margin-top: 2px; padding-top: var(--s-2);
    border-top: 1px dashed var(--line-strong);
  }
  .openq-all {
    font: inherit; font-size: 12px; line-height: 1;
    padding: 7px 12px; border-radius: var(--r-pill); cursor: pointer;
    background: var(--brand-soft); color: var(--brand);
    border: 1px solid transparent;
    transition: background var(--t-fast), color var(--t-fast);
  }
  .openq-all:hover:not(:disabled) { background: var(--brand); color: var(--brand-ink); }
  .openq-all:disabled { opacity: .5; cursor: default; }

  /* 回答反馈：做得轻，别跟「复制话术」抢视觉重心 */
  .fb-bar {
    display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
    margin-top: var(--s-2); padding-top: var(--s-2);
    border-top: 1px dashed var(--line);
  }
  .fb-label { font-size: 11px; color: var(--ink-3); margin-right: 2px; }
  .fb-btn {
    font: inherit; font-size: 11px; line-height: 1;
    padding: 4px 9px; border-radius: 999px; cursor: pointer;
    background: transparent; color: var(--ink-2);
    border: 1px solid var(--line);
    transition: background .15s, color .15s, border-color .15s;
  }
  .fb-btn:hover { background: var(--surface-3); color: var(--ink-0); border-color: var(--line-strong); }
  /* 同上：soft 底配 brand-100；「不对」原来写死浅粉底深红字，深色下是一块刺眼的白 */
  .fb-btn.on { background: var(--brand-soft); color: var(--brand-text); border-color: transparent; }
  .fb-btn.fb-bad.on { background: rgba(250, 81, 81, .16); color: var(--danger); border-color: transparent; }
  .fb-note { font-size: 11px; color: var(--ink-3); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fb-reason-box { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; width: 100%; margin-top: 6px; }
  .fb-regen-opt {
    flex: 0 0 100%; display: flex; align-items: center; gap: 5px;
    font-size: 11px; color: var(--ink-3); cursor: pointer; user-select: none;
  }
  .fb-regen-opt input { width: 13px; height: 13px; margin: 0; accent-color: var(--brand); }
  .fb-reason {
    flex: 1; font: inherit; font-size: 12px;
    padding: 6px 9px; border-radius: 8px;
    border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-0);
  }
  .fb-reason:focus { outline: none; border-color: var(--brand); background: var(--surface); }
  .fb-send {
    font: inherit; font-size: 12px; padding: 6px 12px; border-radius: 8px; cursor: pointer;
    border: 1px solid transparent; background: var(--brand); color: var(--brand-ink);
  }

  /* AI 原始输出（markdown 轻量渲染）：小标题也用墨色，绿色只留给可点元素 */
  .md h3 {
    font-size: var(--fs-sm); font-weight: 600; line-height: var(--lh-tight);
    margin: var(--s-4) 0 2px; color: var(--ink-0);
  }
  .md h3:first-child { margin-top: 0; }
  .md p { margin: 8px 0; }
  .md strong { color: var(--ink-0); font-weight: 700; }
  .md .kv { margin: 8px 0; }
  .md .kv b {
    color: var(--ink-3); font-weight: 500; font-size: var(--fs-micro);
    margin-right: 2px;
  }
  .md code {
    font-family: var(--font-mono);
    background: var(--inset); padding: 1px 5px; border-radius: 5px;
    font-size: var(--fs-xs); color: var(--ink-1);
  }

  /* 输入中动画 */
  .typing { display: flex; gap: var(--s-1); padding: var(--s-1) 2px; }
  .typing i {
    width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4);
    animation: blink 1.2s infinite ease-in-out;
  }
  .typing i:nth-child(2) { animation-delay: .18s; }
  .typing i:nth-child(3) { animation-delay: .36s; }
  @keyframes blink { 0%,80%,100% { opacity:.28; transform: translateY(0); } 40% { opacity:1; transform: translateY(-3px); } }

  /* ---------------- 快捷话题 ---------------- */
  #quick {
    flex: 0 0 auto; display: flex; gap: var(--s-2);
    padding: var(--s-2) var(--s-3) 0;
    overflow-x: auto; scrollbar-width: none;
  }
  #quick::-webkit-scrollbar { display: none; }
  .chip {
    flex: 0 0 auto; border: 1px solid var(--line);
    background: var(--surface-2); color: var(--ink-2);
    border-radius: var(--r-pill); padding: 8px var(--s-3);
    font-size: var(--fs-sm); cursor: pointer; white-space: nowrap;
    transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
  }
  .chip:hover { background: var(--surface-3); border-color: var(--line-strong); color: var(--ink-0); }

  /* 侧栏「我的会话记录」：新建 + 历史列表（右侧小字标产品与时间） */
  .sess-new {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; height: 36px; margin-bottom: 8px;
    border: 1px dashed var(--brand); border-radius: var(--r-md);
    background: var(--brand-soft); color: var(--brand-100); font-size: var(--fs-sm);
  }
  .sess-new svg { width: 14px; height: 14px; }
  .sess-new:hover { background: var(--brand); color: #fff; border-style: solid; }
  /* 会话列表自己承接滚动（PC 侧栏 / 手机抽屉都要用，故放通用规则） */
  .sess-mini-list {
    display: flex; flex-direction: column; gap: 6px;
    flex: 1 1 auto; min-height: 0;
    overflow-y: auto; overflow-x: hidden;
    scrollbar-width: thin;
    padding-right: 2px; padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .sess-mini-list::-webkit-scrollbar { width: 8px; }
  .sess-mini-list::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
  .sess-mini-list::-webkit-scrollbar-track { background: transparent; }
  /* 会话项：标题独占一行，产品名 + 时间落到第二行——
     原来三列挤一行，标题和产品名同时被省略号切断，是「廉价感」最重的一处 */
  .sess-mini {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "title more" "meta meta";
    align-items: center; column-gap: 8px; row-gap: 3px;
    width: 100%; padding: 9px 10px;
    border: 1px solid var(--line); border-radius: var(--r-md);
    background: var(--surface); text-align: left; cursor: pointer;
  }
  .sess-mini:hover { border-color: var(--line-strong); background: var(--surface-2); }
  .sess-mini.on { border-color: var(--brand); background: var(--brand-soft); }
  .sess-mini-title {
    grid-area: title; min-width: 0; font-size: var(--fs-sm); color: var(--ink-1);
    line-height: var(--lh-tight);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .sess-mini.on .sess-mini-title { color: var(--ink-0); }
  .sess-mini-meta {
    grid-area: meta; min-width: 0; text-align: left;
    display: flex; align-items: baseline; gap: 8px;
    font-size: var(--fs-micro); line-height: var(--lh-tight); color: var(--ink-4);
  }
  .sess-mini-meta b { display: block; font-weight: 400; color: var(--ink-3); max-width: 62%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sess-mini-empty { padding: 10px 4px; font-size: var(--fs-micro); color: var(--ink-4); }

  /* 自定义确认框：替代原生 confirm（原生弹窗样式割裂且不可控） */
  .cfm { position: fixed; inset: 0; z-index: var(--z-dialog); display: flex; align-items: center; justify-content: center; }
  .cfm.hidden { display: none; }
  .cfm-mask { position: absolute; inset: 0; background: var(--scrim); }
  .cfm-box {
    position: relative; width: min(86vw, 340px); padding: 20px 18px 14px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 16px; box-shadow: var(--sh-2);
  }
  .cfm-msg { font-size: var(--fs-sm); line-height: var(--lh-ui); color: var(--ink-1); margin-bottom: 18px; }
  .cfm-ops { display: flex; gap: 10px; }
  .cfm-ops button {
    flex: 1; height: 40px; border-radius: 10px; font-size: var(--fs-sm);
    border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-1);
  }
  .cfm-ops button.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
  .sess-mini { position: relative; }
  .sess-mini.pinned .sess-mini-title::before { content: "📌 "; font-size: 11px; }
  .sess-mini-more {
    flex: 0 0 auto; width: 22px; height: 22px; padding: 0;
    display: grid; place-items: center;
    border: 0; background: transparent; color: var(--ink-4);
    border-radius: 6px; font-size: 15px; line-height: 1;
    opacity: 0; transition: opacity .12s;
  }
  .sess-mini:hover .sess-mini-more, .sess-mini.on .sess-mini-more { opacity: 1; }
  .sess-mini-more:hover { background: var(--surface-3); color: var(--ink-1); }
  .sess-menu {
    position: fixed; z-index: 60; min-width: 152px; padding: 4px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-md); box-shadow: var(--sh-2);
  }
  .sess-menu button {
    display: flex; align-items: center; width: 100%; height: 34px; padding: 0 10px;
    border: 0; background: transparent; color: var(--ink-1);
    font-size: var(--fs-xs); text-align: left; border-radius: 6px;
  }
  .sess-menu button:hover { background: var(--surface-2); }
  .sess-menu button.danger { color: var(--danger); }
  .sess-rename {
    flex: 1 1 auto; min-width: 0; height: 24px; padding: 0 6px;
    font-size: var(--fs-xs); color: var(--ink-0);
    border: 1px solid var(--brand); border-radius: 6px; background: var(--surface);
  }
  .chip:active { background: var(--brand-soft); }

  /* ---------------- 输入栏（悬浮胶囊） ---------------- */
  footer {
    position: relative;   /* 字数提示要绝对定位在输入条上方 */
    flex: 0 0 auto;
    display: flex; gap: var(--s-2); align-items: center;
    margin: var(--s-2) var(--s-3) calc(var(--s-3) + env(safe-area-inset-bottom));
    padding: 4px;
    background: var(--bar-bg);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
    border: 1px solid var(--line);
    border-radius: 26px;
    box-shadow: var(--sh-2), inset 0 1px 0 var(--bar-highlight);
    transition: border-color var(--t-fast);
  }
  footer:focus-within { border-color: var(--brand); }
  /* 聊天态 ⇄ 菜单态 的双向过渡：聊天框收缩的同时菜单展开 */
  .chat-part {
    flex: 1 1 0%; min-width: 0; overflow: hidden;
    display: flex; align-items: center; gap: var(--s-2);
    opacity: 1;
    transition: flex-grow 320ms var(--e-out), opacity 220ms var(--e-out);
  }
  .menu-part {
    flex: 0 1 0%; min-width: 0; overflow: hidden;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    opacity: 0;
    /* 宽度 0 时仍会占一个 footer gap(8px)，用负 margin 抵消，保证左右留白对称 */
    margin-left: -8px;
    transition: flex-grow 320ms var(--e-out), opacity 220ms var(--e-out),
                margin-left 320ms var(--e-out);
  }
  footer.menu-open .chat-part { flex-grow: 0; opacity: 0; pointer-events: none; }
  footer.menu-open .menu-part { flex-grow: 1; opacity: 1; margin-left: 0; }

  .bar-btn {
    flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%;
    border: 1px solid var(--line); background: var(--surface-2);
    color: var(--ink-2); display: grid; place-items: center; cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  }
  .bar-btn svg { width: 18px; height: 18px; }
  .bar-btn:hover { border-color: var(--line-strong); color: var(--ink-0); }
  .bar-btn:active { background: var(--brand-soft); }
  .bar-btn:disabled { opacity: .45; cursor: not-allowed; }

  /* 菜单态：带文字的胶囊按钮（纯图标用户看不懂） */
  .menu-item {
    display: inline-flex; align-items: center; gap: 6px;
    height: 44px; padding: 0 12px; border-radius: 22px;
    border: 1px solid var(--line); background: var(--surface-2);
    color: var(--ink-2); font-size: var(--fs-sm);
    cursor: pointer; white-space: nowrap;
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  }
  .menu-item svg { width: 16px; height: 16px; flex: 0 0 auto; }
  .menu-item:hover { border-color: var(--line-strong); color: var(--ink-0); }
  .menu-item:active { background: var(--brand-soft); }
  /* 手机用短名省宽度，≥720px 宽度够就用完整名称 */
  .lbl-long { display: none; }
  @media (min-width: 720px) {
    .lbl-short { display: none; }
    .lbl-long { display: inline; }
    .menu-part { gap: 16px; }
  }

  /* 外观按钮：手机收进「⋯」；≥900px 放顶栏并显示当前状态（只放图标时切到"跟随系统"会像没反应） */
  .theme-top { display: none; }
  .theme-top svg { width: 17px; height: 17px; flex: 0 0 auto; }
  @media (min-width: 900px) {
    .theme-top {
      display: inline-flex; align-items: center; gap: 6px;
      height: 34px; padding: 0 12px; border-radius: 17px;
      border: 1px solid var(--line); background: var(--surface-2);
      color: var(--ink-2); font-size: var(--fs-sm); cursor: pointer;
      transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
    }
    .theme-top:hover { border-color: var(--line-strong); color: var(--ink-0); }
    .theme-top:active { background: var(--brand-soft); }
    /* 「⋯」与外观按钮保持同一套描边胶囊，别一个有线一个没有 */
    #moreBtn {
      width: 34px; height: 34px; border-radius: 17px;
      border: 1px solid var(--line); background: var(--surface-2);
      color: var(--ink-2);
    }
    #moreBtn:hover { border-color: var(--line-strong); color: var(--ink-0); background: var(--surface-2); }
    .more-item-theme { display: none; }
    /* PC 工具入口在常驻侧栏，底部输入栏不再需要菜单按钮 */
    #menuBtn { display: none; }
  }

  /* 侧栏工具区（仅桌面）：常驻入口，比塞在底部菜单里更顺 */
  .side-tools { display: none; }
  .side-head { display: none; }
  @media (min-width: 900px) {
    .side-tools {
      display: flex; gap: 6px; padding: 0 var(--s-1) var(--s-3);
    }
    .side-tool {
      flex: 1; display: inline-flex; flex-direction: column; align-items: center;
      gap: 3px; padding: 8px 2px; border-radius: var(--r-md);
      border: 1px solid var(--line); background: var(--surface-2);
      color: var(--ink-2); font-size: var(--fs-micro); cursor: pointer;
      transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
    }
    .side-tool svg { width: 17px; height: 17px; }
    .side-tool:hover { border-color: var(--brand); color: var(--ink-0); background: var(--brand-soft); }
    .side-head { display: flex; align-items: center; padding: 0 var(--s-1) var(--s-2); }
    .side-title {
      font-size: var(--fs-micro); font-weight: 600; letter-spacing: 0;
      color: var(--ink-4);
    }
  }

  /* 菜单按钮：聊天态是 44 圆图标，菜单态变成「聊天」胶囊 */
  #menuBtn .ic-chat, #menuBtn .btn-label { display: none; }
  footer.menu-open #menuBtn {
    width: auto; height: 44px; padding: 0 12px; border-radius: 22px;
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--brand-100); border-color: var(--brand);
    background: var(--brand-soft); font-size: var(--fs-sm);
  }
  footer.menu-open #menuBtn .ic-menu { display: none; }
  footer.menu-open #menuBtn .ic-chat { display: block; width: 16px; height: 16px; }
  footer.menu-open #menuBtn .btn-label { display: inline; }

  #msg {
    flex: 1; resize: none; max-height: 130px; min-height: 44px;
    border: 0; outline: none; background: transparent;
    border-radius: 22px; padding: 11px var(--s-2);
    color: var(--ink-1);
    font-size: var(--fs-body); font-family: inherit; line-height: 1.4;
  }
  #msg::placeholder {
    color: var(--ink-4);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  #send {
    flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; border: 0;
    background: var(--brand); color: var(--brand-ink); cursor: pointer;
    display: grid; place-items: center;
    transition: filter var(--t-fast);
  }
  #send svg { width: 20px; height: 20px; }
  #send:hover { filter: brightness(1.06); }
  #send:active { filter: brightness(.9); }
  #send:disabled { opacity: .55; cursor: not-allowed; }

  /* ---------------- 产品切换抽屉 ---------------- */
  #prodSheet, #faqSheet, #catalogSheet, #sessSheet, #ovSheet, #editDlg, #afterDlg, #fillDlg {
    position: fixed; inset: 0; z-index: var(--z-sheet);
    display: flex; align-items: flex-end; justify-content: center;
  }
  #prodSheet .mask, #faqSheet .mask, #catalogSheet .mask, #sessSheet .mask, #ovSheet .mask, #editDlg .mask, #afterDlg .mask, #fillDlg .mask {
    position: absolute; inset: 0; background: var(--scrim);
  }
  #prodSheet .sheet, #faqSheet .sheet, #catalogSheet .sheet, #sessSheet .sheet, #ovSheet .sheet, #editDlg .sheet, #afterDlg .sheet, #fillDlg .sheet {
    position: relative; width: 100%; max-width: 460px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    padding: var(--s-4);
    padding-bottom: max(var(--s-4), env(safe-area-inset-bottom));
    box-shadow: 0 -12px 40px rgba(0, 0, 0, .45);
    animation: sheetUp var(--t-base) var(--e-out);
  }
  @keyframes sheetUp {
    from { transform: translateY(16px); opacity: .6; }
    to { transform: none; opacity: 1; }
  }
  .sheet-title {
    font-size: var(--fs-xs); color: var(--ink-4); font-weight: 600;
    letter-spacing: 0; padding: 0 var(--s-1) var(--s-2);
  }
  .prod-item {
    display: flex; flex-direction: column; gap: 2px; width: 100%;
    text-align: left; padding: 10px var(--s-3); margin-bottom: 4px;
    border-radius: var(--r-md); border: 1px solid transparent;
    background: transparent; color: var(--ink-1); cursor: pointer;
    transition: background var(--t-fast), border-color var(--t-fast);
  }
  .prod-item:hover { background: var(--surface-2); }
  .prod-item.on { border-color: var(--brand); background: var(--brand-soft); }
  .prod-item b { font-size: var(--fs-sm); font-weight: 500; }
  .prod-item small { font-size: var(--fs-micro); color: var(--ink-3); }
  .sheet-hint { font-size: var(--fs-micro); color: var(--ink-4); padding: var(--s-2) var(--s-1) 0; }

  /* 抽屉通用结构 */
  .sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 0 0 var(--s-2); }
  .sheet-x {
    width: 32px; height: 32px; border: 0; background: transparent;
    color: var(--ink-3); font-size: 20px; line-height: 1; border-radius: 50%; cursor: pointer;
  }
  .sheet-x:hover { background: var(--surface-2); color: var(--ink-0); }
  .sheet-lg { max-width: 560px; max-height: 82dvh; display: flex; flex-direction: column; }
  /* ID 选择器的 max-width:460px 优先级更高，这里显式让大抽屉吃 560px */
  #faqSheet .sheet.sheet-lg, #catalogSheet .sheet.sheet-lg { max-width: 560px; }

  /* 产品资料 */
  .prod-info { margin-top: var(--s-2); padding-top: var(--s-3); border-top: 1px solid var(--line); }
  /* 产品多时的承载：抽屉整体限高，列表内部滚动 */
  #prodSheet .sheet {
    max-height: 82dvh;
    display: flex; flex-direction: column;
  }
  .prod-list {
    flex: 1 1 auto; min-height: 48px; overflow-y: auto;
    margin-bottom: var(--s-1);
    scrollbar-width: thin;
  }
  #prodInfo, #prodSheet .sheet-hint { flex: 0 0 auto; }
  .prod-item b {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .prod-info-title { font-size: var(--fs-sm); font-weight: 500; color: var(--ink-0); margin-bottom: var(--s-1); }
  .prod-info p { margin: 0 0 var(--s-2); font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.5; }
  .info-block { margin-top: var(--s-2); }
  .info-label { font-size: var(--fs-micro); color: var(--ink-4); letter-spacing: 0; margin-bottom: 4px; }
  .info-chips { display: flex; flex-wrap: wrap; gap: 6px; }
  .info-chip {
    font-size: var(--fs-xs); color: var(--ink-2);
    border: 1px solid var(--line); background: var(--surface-2);
    padding: 2px 8px; border-radius: var(--r-pill);
  }
  .info-list { display: flex; flex-direction: column; gap: 3px; }
  .info-list div { font-size: var(--fs-xs); color: var(--ink-2); }
  .prod-empty { font-size: var(--fs-xs); color: var(--ink-4); line-height: 1.5; }

  /* 话术速查 */
  .faq-search { padding-bottom: var(--s-2); }
  .faq-search input {
    width: 100%; padding: 10px var(--s-3); border-radius: var(--r-md);
    border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-1);
    font-size: var(--fs-body); outline: none;
  }
  .faq-search input:focus { border-color: var(--brand); }
  .faq-list { overflow-y: auto; min-height: 0; flex: 1; padding-right: 2px; }
  .faq-item {
    border: 1px solid var(--line); border-radius: var(--r-md);
    margin-bottom: var(--s-2); background: var(--inset);
  }
  .faq-item summary {
    display: flex; align-items: center; gap: var(--s-2);
    padding: 10px var(--s-3); cursor: pointer; list-style: none;
  }
  .faq-item summary::-webkit-details-marker { display: none; }
  .faq-item summary::after {
    content: "▾"; margin-left: auto; color: var(--ink-4); font-size: 10px;
    transition: transform var(--t-fast);
  }
  .faq-item[open] summary::after { transform: rotate(180deg); }
  .faq-name { font-size: var(--fs-sm); font-weight: 500; color: var(--ink-0); }
  .faq-body { padding: 0 var(--s-3) var(--s-3); display: flex; flex-direction: column; gap: var(--s-2); }
  .faq-intent { font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.5; }
  .faq-empty { text-align: center; color: var(--ink-4); font-size: var(--fs-sm); padding: var(--s-6) 0; }

  /* 历史会话 */
  .sess-new-wrap { padding-bottom: var(--s-2); }
  .sess-new {
    width: 100%; padding: 10px; border-radius: var(--r-md);
    border: 1px dashed var(--line-strong); background: transparent;
    color: var(--brand-100); font-size: var(--fs-sm); cursor: pointer;
  }
  .sess-new:hover { border-color: var(--brand); background: var(--brand-soft); }
  .sess-list { overflow-y: auto; min-height: 0; flex: 1; }
  .sess-item {
    display: flex; align-items: center; gap: var(--s-2);
    padding: 10px var(--s-3); border-radius: var(--r-md);
    border: 1px solid var(--line); background: var(--inset);
    margin-bottom: var(--s-2); cursor: pointer;
  }
  .sess-item:hover { border-color: var(--line-strong); }
  .sess-item.on { border-color: var(--brand); background: var(--brand-soft); }
  .sess-main { flex: 1; min-width: 0; }
  .sess-title {
    font-size: var(--fs-sm); color: var(--ink-0);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .sess-sub { font-size: var(--fs-micro); color: var(--ink-4); margin-top: 2px; }
  .sess-del {
    flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%;
    border: 0; background: transparent; color: var(--ink-4);
    cursor: pointer; font-size: 16px; line-height: 1;
  }
  .sess-del:hover { background: var(--danger-soft); color: var(--danger); }
  /* 抽屉里的「改名」按钮：和删除同一行的轻量文字按钮 */
  .sess-ren {
    flex: 0 0 auto; height: 28px; padding: 0 8px; border-radius: 999px;
    border: 1px solid var(--line); background: transparent;
    color: var(--ink-3); font-size: var(--fs-micro); cursor: pointer;
  }
  .sess-ren:hover { border-color: var(--brand); color: var(--ink-0); }
  /* 置顶标：跟在标题前面，不占位、不换行 */
  .sess-pin {
    display: inline-block; margin-right: 5px; padding: 0 5px;
    font-size: 10px; line-height: 15px; border-radius: 4px;
    background: var(--brand-soft); color: var(--brand); vertical-align: 1px;
  }
  /* 抽屉里的改名输入框（复用 .sess-rename，宽度撑满标题行） */
  .sess-item .sess-rename { width: 100%; height: 26px; font-size: var(--fs-sm); }

  /* 填入后效果预览：直接复用话术卡那套 .sec / .sent-fold 样式 */
  .after-body { padding: 0 var(--s-3) var(--s-2); max-height: 62vh; overflow: auto; }

  /* 「改一下再复制」：一个大文本框 + 两行提示，复制走同一套 copyText */
  .edit-body { padding: 0 var(--s-3) var(--s-2); }
  .edit-body textarea {
    width: 100%; box-sizing: border-box; min-height: 34vh; max-height: 46vh;
    background: var(--surface-2); color: var(--ink-0);
    border: 1px solid var(--line); border-radius: var(--r-md);
    padding: 10px 12px; font: inherit; font-size: var(--fs-base); line-height: 1.55;
    outline: none; resize: vertical;
  }
  .edit-body textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
  .edit-hint { font-size: var(--fs-micro); color: var(--ink-4); margin-top: 6px; }

  /* 我记住的答复（员工端认可版）：问法 + 答复 + 停用/恢复 */
  .ov-list { padding: 0 var(--s-3) var(--s-4); overflow: auto; max-height: 62vh; }
  .ov-item {
    border: 1px solid var(--line); border-radius: var(--r-md);
    background: var(--inset); padding: 10px var(--s-3); margin-bottom: var(--s-2);
  }
  .ov-q { font-size: var(--fs-sm); color: var(--ink-0); word-break: break-word; }
  .ov-a {
    font-size: var(--fs-micro); color: var(--ink-3); line-height: 1.5; margin-top: 4px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  }
  .ov-meta { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); margin-top: 8px; }
  .ov-hits { font-size: var(--fs-micro); color: var(--ink-4); }
  .ov-off .ov-q, .ov-off .ov-a { opacity: .55; }
  .ov-tag { font-size: 10px; line-height: 15px; padding: 0 5px; border-radius: 4px; background: var(--surface-3); color: var(--ink-3); }

  /* 商品库（千级 SKU：搜索 + 分页，不一次渲染全部） */
  .cat-open {
    width: 100%; margin-top: var(--s-2); padding: 10px var(--s-3);
    border: 1px solid var(--brand); background: var(--brand-soft);
    color: var(--brand-100); border-radius: var(--r-md);
    font-size: var(--fs-sm); cursor: pointer; text-align: left;
  }
  .cat-open b { font-size: var(--fs-base); font-weight: 600; }
  .cat-meta { font-size: var(--fs-micro); color: var(--ink-4); padding: 0 2px var(--s-2); }
  .cat-list { overflow-y: auto; min-height: 0; flex: 1; }
  /* 商品行：默认只露关键信息，点开看属性。字段再多也不臃肿 */
  .cat-item {
    border: 1px solid var(--line); border-radius: var(--r-md);
    margin-bottom: var(--s-2); background: var(--inset);
  }
  .cat-item summary { list-style: none; padding: 9px var(--s-3); cursor: pointer; }
  .cat-item summary::-webkit-details-marker { display: none; }
  .cat-main { display: flex; align-items: baseline; gap: var(--s-2); }
  .cat-sku {
    flex: 0 0 auto; font-size: var(--fs-micro); color: var(--ink-4);
    font-variant-numeric: tabular-nums;
  }
  .cat-name-wrap { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
  .cat-name-en { font-size: var(--fs-micro); color: var(--ink-4); letter-spacing: 0; }
  .cat-meta { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
  .cat-meta-row { display: flex; gap: 10px; font-size: var(--fs-micro); line-height: var(--lh-ui); }
  .cat-meta-label { flex: 0 0 42px; color: var(--ink-4); }
  .cat-meta-value { flex: 1; min-width: 0; color: var(--ink-2); word-break: break-word; }
  .cat-name {
    flex: 1; min-width: 0; font-size: var(--fs-sm); color: var(--ink-0);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .cat-price {
    flex: 0 0 auto; font-size: var(--fs-sm); font-weight: 600;
    color: var(--brand-100); font-variant-numeric: tabular-nums;
  }
  .cat-sub {
    display: flex; gap: var(--s-3); margin-top: 3px;
    font-size: var(--fs-micro); color: var(--ink-4); font-variant-numeric: tabular-nums;
  }
  .cat-item[open] summary { border-bottom: 1px solid var(--line); }
  .cat-detail {
    padding: var(--s-2) var(--s-3) var(--s-3);
    display: flex; flex-direction: column; gap: var(--s-2);
  }
  .cat-attrs { font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.5; }
  .cat-detail .copy-btn { align-self: flex-start; }
  .cat-more-wrap { padding-top: var(--s-2); }
  .cat-more {
    width: 100%; padding: 10px; border-radius: var(--r-md);
    border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2);
    font-size: var(--fs-sm); cursor: pointer;
  }
  .cat-more:hover { border-color: var(--line-strong); color: var(--ink-0); }

  .chip-more { border-style: dashed; color: var(--ink-3); }
  .chip-more:hover { border-color: var(--brand); color: var(--brand-100); }

  .hidden { display: none !important; }

  /* ---------------- 桌面端：双栏应用外壳 ---------------- */
  @media (min-width: 900px) {
    body {
      padding: var(--s-5);
      background: radial-gradient(120% 80% at 50% -10%, var(--bg-glow) 0%, var(--bg) 60%);
    }
    #app {
      display: grid;
      grid-template-columns: 280px minmax(0, 1fr);
      grid-template-rows: auto minmax(0, 1fr) auto;
      grid-template-areas:
        "side header"
        "side chat"
        "side footer";
      /* width:100% 不能省：body 是 flex 列容器，margin:0 auto 会让 flex 项失去拉伸、
         宽度退化成「收缩到内容宽」——对话页内容短时只有 839px、点不同会话还会变宽变窄。
         显式 width + max-width + auto margin 才是「撑满并居中」的正确组合。 */
      width: 100%;
      height: calc(100dvh - var(--s-5) * 2);
      max-width: 1120px;
      margin: 0 auto;
      background: var(--bg);
      border: 1px solid var(--line);
      border-radius: var(--r-lg);
      overflow: hidden;
      box-shadow: var(--sh-app);
    }
    header {
      grid-area: header;
      position: static;
      padding: var(--s-3) var(--s-7);
    }
    #chat {
      grid-area: chat;
      min-height: 0;
      padding: var(--s-5) var(--s-7) var(--s-3);
      scrollbar-width: thin;
    }
    footer {
      grid-area: footer;
      margin: 0 var(--s-4) var(--s-4);
    }
    #prodSheet, #faqSheet, #catalogSheet, #sessSheet, #ovSheet, #editDlg, #afterDlg { align-items: center; }
    #prodSheet .sheet, #faqSheet .sheet, #catalogSheet .sheet, #sessSheet .sheet, #ovSheet .sheet, #editDlg .sheet, #afterDlg .sheet { border-radius: var(--r-xl); margin: 0 var(--s-4); }
    #quick {
      grid-area: side;
      flex-direction: column;
      align-items: stretch;
      gap: 6px;
      padding: var(--s-5) var(--s-4) var(--s-4);
      /* 顶部（工具按钮 / 标题 / 新建）固定，只有会话列表自己滚 —— 见 .sess-mini-list */
      overflow: hidden;
      background: var(--surface-3);
      border-right: 1px solid var(--line);
      border-top: 0;
    }
    #quick .side-tools, #quick .side-head, #quick .sess-new { flex: 0 0 auto; }

    /* 原来这里显示「点一下直接发送」（常用问题时代的提示），已随会话列表一起移除 */
    .chip {
      text-align: left;
      white-space: normal;
      border-radius: var(--r-md);
      padding: 9px var(--s-3);
      font-size: var(--fs-sm);
      line-height: 1.4;
    }
    .chip:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--ink-0); }
    .bubble { max-width: 620px; }
    .sys { max-width: 620px; }
    #chat::-webkit-scrollbar, #quick::-webkit-scrollbar { width: 8px; }
    #chat::-webkit-scrollbar-thumb, #quick::-webkit-scrollbar-thumb {
      background: var(--line-strong); border-radius: var(--s-1);
    }
    #chat::-webkit-scrollbar-track, #quick::-webkit-scrollbar-track { background: transparent; }
    /* 登录页卡片化 */
    #login .card {
      padding: var(--s-7) var(--s-6);
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: var(--r-xl);
      box-shadow: var(--sh-2);
    }
  }

  /* 平板 / 窄桌面：单列 720 居中 */
  /* 顶栏汉堡：仅窄屏显示 */
  #sideToggle { display: none; }
  #quickMask { display: none; }

  /* 窄屏（手机/小平板）：PC 侧栏改成左侧滑出抽屉；顶栏重排；底部改为「功能横滚条 + 单输入框」 */
  @media (min-width: 900px) {
    .think-slot .think { max-width: 620px; }
  }

  @media (max-width: 899px) {
    /* 顶栏：汉堡 | 名称(居中)+产品(下方) | ⋯ */
    header {
      display: grid;
      grid-template-columns: 40px minmax(0, 1fr) 40px;
      align-items: center; gap: 6px;
    }

    /* 回到最新：手机上输入框上方有一条悬浮功能横滚条（#menuPart，约 40px），
       按钮必须抬到它上面，否则会压在功能条右侧（2026-11-03 C-21 实测位置） */
    .to-bottom { right: 12px; bottom: 56px; height: 32px; padding: 0 12px 0 10px; }
    header .avatar { display: none; }
    #sideToggle { display: grid; }
    /* .who 是 flex column：靠 align-items 居中，text-align 对 flex 无效 */
    header .who { align-items: center; min-width: 0; }
    header .who-top, header .who-bottom { justify-content: center; }
    header .who-top b { font-size: 16px; }
    header .who-bottom { justify-content: center; }

    /* 侧栏抽屉 */
    #quick {
      display: flex;
      flex-direction: column; align-items: stretch; gap: 6px;
      position: fixed; left: 0; top: 0; bottom: 0; z-index: var(--z-drawer);
      width: 80vw; max-width: 320px;
      padding: max(14px, env(safe-area-inset-top)) 12px 14px;
      transform: translateX(-100%);
      transition: transform .22s ease;
      background: var(--surface);
      border-right: 1px solid var(--line);
      box-shadow: 0 0 32px rgba(0, 0, 0, .35);
      overflow: hidden;
    }
    #quick.open { transform: none; }
    #quickMask {
      display: block;
      position: fixed; inset: 0; z-index: var(--z-drawer-mask);
      background: var(--scrim);
      opacity: 0; pointer-events: none; transition: opacity .2s;
    }
    #quickMask.show { opacity: 1; pointer-events: auto; }
    /* 抽屉里的会话条目改两行：标题一行，产品 · 时间一行 */
    #quick .side-tools { display: flex; gap: 6px; padding-bottom: 10px; }
    #quick .side-tool {
      flex: 1; display: inline-flex; flex-direction: column; align-items: center;
      gap: 3px; padding: 8px 2px; border-radius: var(--r-md);
      border: 1px solid var(--line); background: var(--surface-2);
      color: var(--ink-2); font-size: var(--fs-micro);
    }
    #quick .side-tool svg { width: 17px; height: 17px; }
    #quick .side-head { display: flex; padding-bottom: 6px; }
    #quick .side-title { font-size: var(--fs-micro); font-weight: 600; letter-spacing: 0; color: var(--ink-4); }
    #quick .sess-mini { gap: 3px 8px; padding: 9px 10px; }
    #quick .sess-mini-title { flex: 1 1 auto; }
    #quick .sess-mini-more { opacity: 1; order: 2; }
    #quick .sess-mini-meta {
      flex: 0 0 100%; order: 3; text-align: left;
      display: flex; align-items: center; gap: 6px;
    }
    #quick .sess-mini-meta b { display: inline; max-width: none; }

    /* 底部：悬浮在输入框上方的功能横滚条 + 单输入框；取消九宫格折叠 */
    #bar { position: relative; }
    /* 聊天区底部多留一条，让消息不被悬浮条压住（背景同色，视觉是无缝的） */
    #chat { padding-bottom: 52px; }
    #menuBtn { display: none; }
    #menuPart {
      position: absolute; left: 0; right: 0; bottom: calc(100% + 6px);
      flex: 0 0 auto; opacity: 1; margin: 0;
      justify-content: flex-start; gap: 6px;
      overflow-x: auto; overflow-y: hidden;
      padding: 2px; scrollbar-width: none;
      -webkit-overflow-scrolling: touch;
    }
    #menuPart::-webkit-scrollbar { display: none; }
    #chatPart { flex: 1 1 auto; opacity: 1; width: 100%; }
    /* 顺序：商品库 → 话术速查 → 切换产品 → 历史对话 */
    #menuPart #menuCatalog { order: 1; }
    #menuPart #menuFaq { order: 2; }
    #menuPart #menuProduct { order: 3; }
    #menuPart #menuHistory { order: 4; }
    /* 悬浮条上显示完整名称（可横滚，不必再缩成两个字） */
    #menuPart .lbl-short { display: none; }
    #menuPart .lbl-long { display: inline; }
    .menu-item {
      height: 34px; padding: 0 10px; border-radius: 17px; font-size: var(--fs-micro);
      background: var(--surface); box-shadow: var(--sh-1);
    }
    .menu-item svg { width: 14px; height: 14px; }
  }

  @media (min-width: 720px) and (max-width: 899px) {
    #chat, #quick, footer, header { max-width: 720px; margin-left: auto; margin-right: auto; width: 100%; }
    .bubble { max-width: 78%; }
    .think-slot .think { max-width: 78%; }
  }

  /* 复制按钮已并入标签行（见 .sec-label），这里不再做绝对定位。
     保留断点只为控制气泡宽度。 */
  @media (max-width: 520px) {
    .copy-btn { height: 22px; padding: 0 8px; }
  }

  /* 横屏手机：压缩纵向留白，避免内容被挤 */
  @media (max-height: 480px) and (orientation: landscape) {
    header { padding-top: 6px; padding-bottom: 6px; }
    header .avatar { width: 30px; height: 30px; font-size: 15px; }
    #chat { padding-top: 8px; padding-bottom: 4px; }
    #quick { padding-top: 4px; }
  }
  /* 客户原话分析：标题/正文直接复用 .md h3 + .md .kv，和 AI 卡的「客户问题AI分析」完全同款 */
  .ans-md { display: flex; flex-direction: column; }
  .ans-md .zh-t { color: var(--ink-0); word-break: break-word; }
  .ans-md .zh-t.is-pending { color: var(--ink-3); }
  .ans-md .zh-t.is-fail { color: var(--warn); }
  .ans-md .sents { margin-top: var(--s-2); }

  /* 匹配行：条数用绿色区分（绿只给「命中 / 可操作」，别处不要复用） */
  .ans-match .ans-n { color: var(--ok); font-weight: 700; }
  .ans-ask {
    font: inherit; color: var(--brand-text);
    background: none; border: 0; padding: 0; cursor: pointer;
    text-decoration: underline; text-underline-offset: 2px;
  }
  .ans-ask:hover:not(:disabled) { opacity: .85; }
  .ans-ask:disabled { opacity: .45; cursor: default; text-decoration: none; }

  /* 逐句对照：子块里只放每句中英文（中文一行、英文小字），不放整段中文总述 */
  .sents { display: flex; flex-direction: column; }
  .sent {
    display: flex; align-items: flex-start; gap: var(--s-2);
    padding: var(--s-2) 0;
  }
  .sent + .sent { border-top: 1px solid var(--line); }
  .sent-no {
    flex: none; width: 18px; height: 18px; border-radius: 50%;
    background: var(--surface-3); color: var(--ink-3);
    font-size: var(--fs-micro); line-height: 18px; text-align: center;
    font-variant-numeric: tabular-nums;
  }
  .sent-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .sent-zh { font-size: var(--fs-sm); line-height: var(--lh-ui); color: var(--ink-1); word-break: break-word; }
  .sent-zh.is-muted { color: var(--ink-3); }
  .sent-en { font-size: var(--fs-micro); line-height: var(--lh-ui); color: var(--ink-3); word-break: break-word; }
  .sent-tag {
    flex: none; font-size: var(--fs-micro); line-height: 18px;
    padding: 0 6px; border-radius: var(--r-pill); border: 1px solid var(--line);
  }
  .sent-tag.is-ok { color: var(--ok); border-color: var(--ok); }
  .sent-tag.is-miss { color: var(--warn); border-color: var(--warn); background: var(--warn-soft); }
  .sent-ask {
    flex: none; font-size: var(--fs-micro); padding: 2px 8px;
    border-radius: var(--r-pill); border: 1px solid var(--line);
    background: var(--surface-3); color: var(--ink-1);
  }
  .sent-ask:hover:not(:disabled) { background: var(--surface-2); color: var(--ink-0); }
  .sent-ask:disabled { opacity: .5; cursor: default; }

  /* 话术卡上的「对应第 N 句」 */
  .fold-for-inline { flex: 0 0 auto; font-size: 11px; color: var(--ink-4); white-space: nowrap; }
  .fold-for {
    flex: none; font-size: var(--fs-micro); line-height: 18px;
    padding: 0 6px; border-radius: var(--r-pill);
    border: 1px solid var(--line); color: var(--ink-3);
  }

  /* 待填占位符：[数量] / [3-5] / [推荐款]… 必须一眼看见，别让员工原样发给客户 */
  .ph {
    color: var(--warn);
    background: var(--warn-soft);
    border-radius: 4px;
    padding: 0 2px;
    font-weight: 600;
  }
  .ph-badge {
    margin-left: auto;
    flex: none;
    font-size: var(--fs-micro);
    line-height: 18px;
    padding: 0 6px;
    color: var(--warn);
    background: var(--warn-soft);
    border: 1px solid var(--warn);
    border-radius: var(--r-pill);
  }
  .copy-btn.has-ph { border-color: var(--warn); color: var(--warn); }
  /* 填完值：角标变绿、多一个「重新填写」 */
  /* 填入值沿用待填的高亮底色（员工能看出哪里填过、填了什么），只加下划线做区分 */
  .ph.filled { text-decoration: underline; text-underline-offset: 2px; }
  .ph-badge.done { color: var(--brand-text); background: var(--brand-soft); border-color: transparent; }
  .copy-btn.redo { border-color: var(--line); color: var(--ink-2); margin-right: 4px; }
  .copy-btn.redo:hover { border-color: var(--brand); color: var(--ink-0); }

  /* 字数提示：快到 2000 才出现，超限变红（服务端只收前 2000 字，超了必须让员工知道） */
  .msg-count {
    position: absolute; right: 8px; top: -20px;
    font-size: var(--fs-micro); line-height: 18px;
    padding: 0 7px; border-radius: var(--r-pill);
    color: var(--ink-3); background: var(--surface-2);
    border: 1px solid var(--line);
    opacity: 0; pointer-events: none;
    transition: opacity .15s;
  }
  .msg-count.on { opacity: 1; }
  .msg-count.over { color: var(--danger); border-color: var(--danger); font-weight: 600; }
  /* 卡片标题行里的待填角标：贴着标签，不要跟着 space-between 飞到最右 */
  .fold > summary .ph-badge { margin-left: 0; }

  /* 网络状态条：断网时常驻顶部（不遮挡 header，靠 sticky） */
  .net-bar {
    position: sticky; top: 0; z-index: 30;
    padding: 6px 12px;
    font-size: var(--fs-micro); line-height: 1.5;
    color: var(--brand-ink); background: var(--warn);
    text-align: center;
  }
  .net-bar.hidden { display: none; }
  .sess-search-wrap { padding: 0 var(--s-3) var(--s-2); }
  .sess-search-wrap input { width: 100%; }

  /* 「都不满意直接问AI」：与「对/不对」完全同尺寸（11px / 4px 9px），
     文字用主题的正文色（原来的 brand-ink 在深色下是深绿，看不清） */
  .fb-quick {
    margin-left: auto;
    font: inherit; font-size: 11px; line-height: 1;
    padding: 4px 9px; border-radius: 999px;
    background: transparent; color: var(--ink-2);
    border: 1px solid var(--line);
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
  }
  /* 与「对 / 不对」完全同一套视觉：默认灰边、hover 才变深，不要绿框 */
  .fb-quick:hover { background: var(--surface-3); color: var(--ink-0); border-color: var(--line-strong); }
  .fb-quick:disabled { opacity: .5; cursor: default; }

  /* 填值弹窗：一项一张卡，输入框下给「要求 / 英文译文」提示
     员工端没有全局 input/button 样式（只有 .field input 这类局部规则），这里必须写全 */
  .fill-list { padding: 0 var(--s-3); max-height: 52vh; overflow: auto; }
  .fill-item { margin-bottom: 12px; }
  .fill-item > label { display: flex; align-items: center; gap: 6px; font-size: var(--fs-micro); color: var(--ink-3); margin-bottom: 5px; }
  .fill-item > label b { color: var(--warn); font-weight: 600; }
  /* 名称 + 类型标签：让员工一眼知道这一格填什么（方括号里的字就是名称） */
  .fill-item .fill-name { font-size: var(--fs-xs); color: var(--ink-1); }
  /* 原占位符（[3-5] 这种）放在人话名称后面当注解 */
  .fill-item .fill-raw { font-size: 11px; color: var(--ink-4); }
  .fill-item .fill-kind {
    font-size: 11px; line-height: 1; padding: 2px 6px; border-radius: 999px;
    background: var(--surface-3); color: var(--ink-3); border: 1px solid var(--line);
  }
  .fill-item input {
    width: 100%; box-sizing: border-box;
    background: var(--surface-2); color: var(--ink-0);
    border: 1px solid var(--line); border-radius: var(--r-md);
    padding: 9px 12px; font: inherit; font-size: var(--fs-base);
    outline: none; transition: border-color .15s;
  }
  .fill-item input::placeholder { color: var(--ink-4); }
  .fill-item input:hover { border-color: var(--line-strong); }
  .fill-item input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

  /* 输入框 + 右侧「翻译」按钮（中文才需要，按钮在输入框内右侧） */
  .fill-input-wrap { position: relative; }
  .fill-input-wrap input { padding-right: 64px; }
  .fill-tr {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    padding: 4px 10px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--surface);
    color: var(--ink-2); font-size: 11px; line-height: 1.4; cursor: pointer;
  }
  .fill-tr:hover { border-color: var(--brand); color: var(--ink-0); }
  .fill-tr.need {
    border-color: var(--warn); color: var(--warn);
    background: var(--warn-soft);
    animation: trPulse 1s ease-in-out 2;
  }
  .fill-tr:disabled { opacity: .6; cursor: default; }
  @keyframes trPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(240,178,50,.0); } 50% { box-shadow: 0 0 0 4px rgba(240,178,50,.25); } }
  .fill-hint { font-size: var(--fs-micro); color: var(--ink-4); margin-top: 3px; min-height: 16px; }
  .fill-hint.warn { color: var(--warn); }
  .fill-hint.bad { color: var(--danger); }
  .fill-ops { display: flex; gap: var(--s-2); padding: var(--s-3); }
  .fill-ops button {
    flex: 1; padding: 11px 14px; border-radius: var(--r-md);
    border: 1px solid var(--line); background: var(--surface-2);
    color: var(--ink-1); font: inherit; font-size: var(--fs-base);
    cursor: pointer; transition: background .15s, border-color .15s;
  }
  .fill-ops button:hover { background: var(--surface-3); border-color: var(--line-strong); }
  .fill-ops button.primary {
    background: var(--brand); color: var(--brand-ink);
    border-color: var(--brand); font-weight: 600;
  }
  .fill-ops button.primary:hover { background: var(--brand); filter: brightness(.95); }

  /* 「不对」理由栏的收起按钮 */
  .fb-cancel {
    flex: 0 0 auto; align-self: center;
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; padding: 0; box-sizing: border-box;
    border-radius: 999px; border: 1px solid var(--line);
    background: transparent; color: var(--ink-3);
    font-size: 15px; line-height: 1; cursor: pointer;
  }
  .fb-cancel:hover { background: var(--surface-3); color: var(--ink-0); }

  /* 输入框上方的「这句话是谁说的」：员工 vs 客户，语用不同，处理方式也不同 */
  .bar-row { display: flex; flex: 1 1 auto; min-width: 0; gap: var(--s-2); align-items: center; }
  .ask-mode {
    display: flex; flex: 0 0 auto; gap: 6px;
    padding: 0 2px;
    align-items: center; flex-wrap: nowrap;
    overflow-x: auto; scrollbar-width: none;
  }
  .ask-mode::-webkit-scrollbar { display: none; }
  .am {
    flex: 0 0 auto; white-space: nowrap;
    font: inherit; font-size: 11px; line-height: 1;
    padding: 5px 11px; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--line); background: transparent; color: var(--ink-3);
  }
  .am:hover { color: var(--ink-0); border-color: var(--line-strong); }
  .am.on { background: var(--brand-soft); color: var(--brand-text); border-color: transparent; }
  /* AI 卡顶部的语用提示 */
  .role-bar {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin: 0 0 8px; padding: 7px 10px; border-radius: 8px;
    font-size: var(--fs-micro);
    background: var(--warn-soft); color: var(--warn);
  }
  .role-bar button {
    margin-left: auto; font: inherit; font-size: 11px;
    padding: 4px 10px; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--warn); background: transparent; color: var(--warn);
  }
  .role-tag { font-size: var(--fs-micro); color: var(--brand-text); background: var(--brand-soft); padding: 2px 8px; border-radius: 999px; }
  /* 员工认可版：不是提醒，是「这版放心用」，所以走品牌绿而不是警告色 */
  .role-bar.ok { background: var(--brand-soft); color: var(--brand-text); }

  /* 只发某句：挂在中文对照下面的一行折叠（收起时只有「只发某句 …… 展开」一行）；
     展开后一句英文 + 紧跟对应中文 + 右侧复制 —— 员工挑一句复制，不用整段复制再删。 */
  .sent-fold { border-top: 1px solid var(--line); margin: 1px 0 -12px; }
  /* 含「只发某句」的卡片：反馈条不要再加 8px 上边距，让折叠行下面紧贴分割线 */
  .ans:has(.sent-fold) > .fb-bar { margin-top: 0; }
  .sent-fold > summary { padding: 6px 0; color: var(--ink-3); }
  .sent-fold > summary .fold-sum-title { color: var(--ink-3); font-size: var(--fs-micro); }
  .sent-pairs { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 4px; }
  .sent-pair {
    display: grid; grid-template-columns: auto minmax(0, 1fr);
    gap: 1px 8px; align-items: start;
    padding: 8px 0; border-top: 1px dashed var(--line);
    cursor: pointer;              /* 整行可点：手机不用瞄准小方块 */
  }
  .sent-pair:first-child { border-top: 0; }
  .sent-check {
    grid-column: 1; grid-row: 1 / span 2;
    width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--brand); cursor: pointer;
  }
  .sf-en { grid-column: 2; grid-row: 1; font-size: var(--fs-sm); line-height: 1.45; color: var(--ink-1); word-break: break-word; }
  .sf-zh { grid-column: 2; grid-row: 2; font-size: var(--fs-micro); line-height: 1.5; color: var(--ink-3); word-break: break-word; }
  .sf-zh:empty { display: none; }
  /* 取消勾选的句子压暗，一眼能看出「这句不会发」 */
  .sent-pair:has(.sent-check:not(:checked)) .sf-en { color: var(--ink-4); }
  .sent-pair:has(.sent-check:not(:checked)) .sf-zh { color: var(--ink-4); opacity: .7; }
  /* 底部：已勾选 N / M 句 + 复制所选句子 */
  .sent-actions {
    display: flex; align-items: center; justify-content: space-between; gap: var(--s-2);
    border-top: 1px solid var(--line); margin-top: 2px; padding: 9px 0 2px;
  }
  .sent-count { font-size: var(--fs-micro); color: var(--ink-3); }
  .sent-actions .copy-btn:disabled { opacity: .45; cursor: default; }

  /* 商品库：先按款式分组（一行一个款式），点开才看该款式的 SKU */
  .style-group {
    border: 1px solid var(--line); border-radius: 10px;
    margin-bottom: 8px; background: var(--surface-2); overflow: hidden;
  }
  .style-group > summary.style-sum {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; cursor: pointer; list-style: none;
  }
  .style-group > summary.style-sum::-webkit-details-marker { display: none; }
  .style-sum-name { font-weight: 600; color: var(--ink-0); }
  .style-sum-en { font-size: var(--fs-micro); color: var(--ink-3); }
  .style-sum-count { margin-left: auto; font-size: var(--fs-micro); color: var(--ink-3); }
  .style-sum-price { font-size: var(--fs-micro); color: var(--brand-text); font-weight: 600; }
  .style-group[open] > summary.style-sum { border-bottom: 1px solid var(--line); }
  .style-group .cat-item { margin: 6px 8px; }

/* ===== 我的客户（浏览器插件同步的 WhatsApp 客户档案） ===== */
.wa-search-row { margin: 0 0 var(--s-2); }
.wa-search-row input {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--inset); color: var(--ink-0);
  font-family: var(--font-ui); font-size: var(--fs-sm);
}
.wa-search-row input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }

.wa-list { max-height: 58vh; overflow-y: auto; overscroll-behavior: contain; }

.wa-item {
  display: flex; align-items: center; gap: var(--s-2);
  padding: 9px var(--s-3); margin-bottom: var(--s-2);
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--inset); cursor: pointer;
}
.wa-item:hover { background: var(--neutral-soft); }
.wa-item:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

.wa-av {
  width: 38px; height: 38px; flex: none;
  border-radius: 50%; overflow: hidden;
  background: var(--surface-2); color: var(--ink-2);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-sm); font-weight: 500;
}
.wa-av img { width: 100%; height: 100%; object-fit: cover; display: block; }

.wa-main { flex: 1 1 auto; min-width: 0; }
.wa-name {
  font-size: var(--fs-sm); color: var(--ink-0); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wa-preview {
  font-size: var(--fs-micro); color: var(--ink-3); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.wa-right { flex: none; text-align: right; display: flex; flex-direction: column; gap: 2px; }
.wa-count { font-size: var(--fs-micro); color: var(--ink-3); }
.wa-phone {
  font-size: var(--fs-micro); color: var(--brand-text);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  border-bottom: 1px dashed var(--line-strong); cursor: pointer;
}

.wa-chat-head {
  display: flex; align-items: center; gap: var(--s-2);
  padding: 0 0 var(--s-2); margin-bottom: var(--s-2);
  border-bottom: 1px solid var(--line);
}
.wa-back {
  flex: none; padding: 4px 10px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: transparent; color: var(--ink-1);
  font-family: var(--font-ui); font-size: var(--fs-micro); cursor: pointer;
}
.wa-back:hover { background: var(--neutral-soft); }
.wa-chat-who {
  font-size: var(--fs-micro); color: var(--ink-3);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.wa-thread {
  max-height: 56vh; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: var(--s-2);
  padding: var(--s-2); border-radius: var(--r-md); background: var(--surface-2);
}
.wa-row { display: flex; }
.wa-row.in { justify-content: flex-start; }
.wa-row.out { justify-content: flex-end; }
.wa-b {
  max-width: 80%; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface);
}
.wa-row.out .wa-b { background: var(--bubble-out); border-color: transparent; }
.wa-t { font-size: var(--fs-sm); line-height: 1.55; color: var(--ink-0); white-space: pre-wrap; word-break: break-word; }
/* 中文：左边细线，和原文区分开 */
.wa-zh {
  margin-top: 5px; padding-left: 7px;
  border-left: 2px solid var(--line-strong);
  font-size: var(--fs-micro); line-height: 1.5;
  color: var(--ink-2); white-space: pre-wrap; word-break: break-word;
}
.wa-m { font-size: var(--fs-micro); color: var(--ink-2); }
/* 翻译方向（2026-11-08）：行内小字，直接跟在**原文**末尾，
   不再放到中文译文后面 / 右下角；没方向时整条不渲染。 */
.wa-dir {
  display: inline-block;
  margin-left: 8px;
  font-size: var(--fs-micro);
  color: var(--ink-2);
  opacity: .75;
  white-space: nowrap;
}

/* 图片（2026-10-30）：员工端原来只有「[图片]」占位，员工得切回 WhatsApp 才能看图。
   相册铺 2 列 120px 网格（和后台、WhatsApp 一致），单图按比例显示、上限 240px。
   图片要登录才能取，`<img src>` 会带 cookie，和后台同一套鉴权。 */
.wa-media-grid { display: grid; grid-template-columns: repeat(2, 120px); gap: 4px; line-height: 0; margin-top: 4px; }
.wa-media-img { display: block; }
.wa-media-img img {
  width: 120px; height: 120px; object-fit: cover; max-width: none;
  border-radius: 8px; border: 1px solid var(--line-strong); cursor: zoom-in;
}
.wa-media-single img {
  width: auto; height: auto; max-width: 240px; max-height: 240px; object-fit: contain;
}
.wa-media-note { margin-top: 6px; font-size: var(--fs-micro); line-height: 1.5; color: var(--ink-2); }

/* 视频封面（2026-10-31）：封面 + 左下角时长，点不开 —— 原件在 WhatsApp。 */
.wa-media-video { position: relative; display: inline-block; margin-top: 3px; line-height: 0; }
.wa-media-video img {
  display: block; max-width: 200px; max-height: 200px;
  border-radius: 8px; border: 1px solid var(--line-strong); background: rgba(127,127,127,.10);
}
.wa-media-dur {
  position: absolute; left: 6px; bottom: 6px; padding: 1px 5px; border-radius: 4px;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; line-height: 1.5;
}

/* 文件 / 视频 / 语音（2026-10-31）：只显示名字或时长，不下载 —— 原件去 WhatsApp 拿。 */
.wa-media-file {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  margin-top: 3px; padding: 5px 8px; border-radius: 8px;
  background: rgba(127, 127, 127, .12); border: 1px solid var(--line-strong);
  font-size: var(--fs-micro); color: var(--ink-1); word-break: break-all;
}
.wa-tm { margin-top: 3px; font-size: var(--fs-micro); color: var(--ink-3); text-align: right; }
/* 送达状态：蓝色双勾 = 客户已读（跟 WhatsApp 同一套语义） */
.wa-ack { font-size: 10px; letter-spacing: -1.5px; color: #8696a0; }
.wa-ack.ack-3 { color: #53bdeb; }

@media (max-width: 560px) {
  .wa-list { max-height: 62vh; }
  .wa-thread { max-height: 58vh; }
  .wa-b { max-width: 88%; }
}

/* ===== 我的客户 · 三级视图（账号 / 客户 / 对话） ===== */

/* 在线小圆点：跟着账号名走，不占额外一行 */
.wa-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-4); margin-right: 6px; vertical-align: middle;
}
.wa-dot.on { background: #07c160; box-shadow: 0 0 0 2px rgba(7, 193, 96, .18); }

/* 未读徽标 */
.wa-new {
  display: inline-block; min-width: 18px; padding: 0 5px;
  border-radius: var(--r-pill);
  background: #fa5151; color: #fff;
  font-size: var(--fs-micro); line-height: 18px; text-align: center;
  font-variant-numeric: tabular-nums;
}
/* 会话项里的未读徽标：**必须绝对定位**（2026-10-27 用户实测「变成一条红色横条」）。
   .wa-conv-item 是 flex column，徽标作为普通子元素会被拉伸成整行宽。 */
.wa-conv-item { position: relative; }
.wa-conv-item > .wa-new {
  position: absolute; top: 8px; right: 8px;
  min-width: 18px; height: 18px; padding: 0 5px;
  line-height: 18px;
}
/* 顶栏账号胶囊后面的未读徽标（2026-10-27 用户要求：从左菜单挪到这里） */
.wa-new-top {
  margin-left: 4px; min-width: 18px; height: 18px;
  line-height: 18px; font-weight: 500;
  vertical-align: middle;
}

/* 「正在看 XXX」——只在该账号此刻打开了某个客户时才出现 */
.wa-window {
  margin-top: 2px;
  font-size: var(--fs-micro); color: var(--brand-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 对话页的「在电脑上的 WhatsApp 里打开」 */
.wa-open-row {
  display: flex; flex-direction: column; gap: 4px;
  margin-bottom: var(--s-2);
}
.wa-open-btn {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--brand); border-radius: var(--r-md);
  background: var(--brand-soft); color: var(--brand-text);
  font-family: var(--font-ui); font-size: var(--fs-sm); cursor: pointer;
}
.wa-open-btn:hover { filter: brightness(1.08); }
.wa-open-btn:disabled { opacity: .6; cursor: default; }
/* 线程头里的紧凑变体：不通栏，与 Who 一行 */
.wa-open-btn.compact {
  flex: 0 0 auto; width: auto; padding: 6px 10px;
  font-size: var(--fs-micro); white-space: nowrap;
}
.wa-open-tip { font-size: var(--fs-micro); color: var(--ink-3); line-height: 1.5; }

/* 「更多」按钮上的未读角标 */
#moreBtn { position: relative; }
.wa-menu-badge {
  position: absolute; top: -3px; right: -3px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--r-pill);
  background: #fa5151; color: #fff;
  font-size: 10px; line-height: 16px; text-align: center;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

/* 客户意图：员工一眼看诉求，比译文再淡一档 */
.wa-intent {
  margin-top: 3px;
  font-size: var(--fs-micro);
  color: var(--brand-text);
  opacity: 0.92;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ===== 模块切换 + 模块落地页（2026-10-26 C-09，两个独立页面） ===== */
/* 模块切换只有一条入口：⋯ 菜单里的 .mod-jump（2026-10-26 用户要求去掉顶栏一键互切）。
   口令登录（uid=0，body.code-only）不能切模块：菜单项藏掉。
   口令用户进了对话助手也是空态（插件数据只归员工账号），插件端更没有口令登录。 */
.code-only .mod-jump { display: none !important; }

/* 登录后的模块落地页：二选一 */
#launch {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: var(--s-4);
}
.launch-box {
  width: 100%; max-width: 420px;
  display: flex; flex-direction: column; align-items: center; gap: var(--s-3);
}
.launch-box .brand {
  width: 52px; height: 52px; border-radius: var(--r-lg);
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-100);
}
.launch-box .brand svg { width: 26px; height: 26px; }
.launch-box h1 { font-size: var(--fs-xl); font-weight: 600; color: var(--ink-0); }
.launch-sub { font-size: var(--fs-sm); color: var(--ink-3); margin-bottom: var(--s-2); }
.launch-cards { width: 100%; display: flex; flex-direction: column; gap: var(--s-3); }
.launch-card {
  display: flex; align-items: center; gap: var(--s-3);
  width: 100%; padding: var(--s-4);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); cursor: pointer; text-align: left;
  font-family: var(--font-ui);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.launch-card:hover { border-color: var(--brand); background: var(--brand-soft); }
.launch-icon {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: var(--r-md);
  display: grid; place-items: center;
  /* 两个模块统一绿底绿图标（2026-10-26 用户要求：产品助手也用对话助手同款配色） */
  background: var(--brand-soft); color: var(--brand-100);
}
.launch-icon svg { width: 22px; height: 22px; }
/* WhatsApp 实心 logo 撑满 24 视口，比原来的线框图标显大，单独收一档 */
.launch-icon .wa-logo { width: 20px; height: 20px; }
.launch-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.launch-main b { font-size: var(--fs-base); font-weight: 600; color: var(--ink-0); }
.launch-main small { font-size: var(--fs-micro); color: var(--ink-3); }
.launch-go { flex: 0 0 auto; width: 18px; height: 18px; color: var(--ink-4); }
.launch-badge {
  flex: 0 0 auto; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: var(--r-pill);
  background: #fa5151; color: #fff;
  font-size: var(--fs-micro); line-height: 20px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.launch-foot { margin-top: var(--s-2); }
.launch-foot a { color: var(--ink-3); font-size: var(--fs-sm); text-decoration: none; }
.launch-foot a:hover { color: var(--danger); }

/* ===== 对话助手页（chat.html）：左菜单 / 消息流 / 底栏 ===== */
/* 账号胶囊复用 .prod-pick 的壳，但前缀不是「产品」是「账号」（按 ID 覆盖，产品页无此 ID）。
   底栏「切换账号」已改用产品页同款 .menu-item（图标+文字），不需要这个前缀。 */
#waAccCap::before { content: "账号"; color: var(--ink-4); white-space: nowrap; flex: 0 0 auto; }
/* 左菜单两个区块：我的账号（按内容高）+ 我的会话记录（吃掉剩余高度）。
   2026-10-26：不能给两块都 flex:1——账号卡只有一张时会被拉到 50% 高，会话列表被顶到底部。 */
/* 左菜单两个区块：我的账号（按内容高，**不压缩**）+ 我的会话记录（吃剩余高度）。
   2026-10-26 用户实测：浏览器窗口矮时「我的会话记录」标题和搜索框被账号卡盖住 ——
   两块都是默认 flex:0 1 auto（可压缩），第一块被压扁但内容不收缩 → 溢出盖住下面。
   现在第一块 flex:0 0 auto 固定，第二块才允许压缩（列表自己滚）。 */
.wa-side-block { display: flex; flex-direction: column; min-height: 0; flex: 0 0 auto; }
.wa-side-block:last-child { flex: 1 1 auto; min-height: 96px; }
.wa-side-block + .wa-side-block { margin-top: var(--s-3); }
/* 窗口很矮（< 560px）时侧栏整体可滚，别把会话区压没 */
@media (max-height: 560px) {
  #quick { overflow-y: auto; }
  .wa-side-block:last-child { flex: 0 0 auto; min-height: 0; }
}
#quick .wa-side-block .side-head { display: flex; padding-bottom: 6px; flex: 0 0 auto; }
.wa-acc-list, .wa-conv-list {
  display: flex; flex-direction: column; gap: 6px;
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  scrollbar-width: thin;
}
.wa-acc-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 10px;
  border: 1px solid transparent; border-radius: var(--r-md);
  background: var(--surface-2); color: var(--ink-1);
  cursor: pointer; text-align: left; position: relative;
  font-family: var(--font-ui);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.wa-acc-item:hover { border-color: var(--line-strong); }
.wa-acc-item.on { border-color: var(--brand); background: var(--brand-soft); }
.wa-acc-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.wa-acc-name {
  min-width: 0;
  font-size: var(--fs-sm); color: var(--ink-0);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wa-acc-sub {
  font-size: var(--fs-micro); color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wa-acc-meta { flex: 0 0 auto; font-size: var(--fs-micro); color: var(--ink-3); }
.wa-conv-item {
  display: flex; flex-direction: column; gap: 2px;
  width: 100%; padding: 9px 10px; position: relative;
  border: 1px solid transparent; border-radius: var(--r-md);
  background: var(--surface-2); color: var(--ink-1);
  cursor: pointer; text-align: left;
  font-family: var(--font-ui);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.wa-conv-item:hover { border-color: var(--line-strong); }
.wa-conv-item.on { border-color: var(--brand); background: var(--brand-soft); }
.wa-conv-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.wa-conv-title {
  flex: 1 1 auto; min-width: 0;
  font-size: var(--fs-sm); color: var(--ink-0);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wa-conv-time { flex: 0 0 auto; font-size: var(--fs-micro); color: var(--ink-4); }
.wa-conv-sub {
  font-size: var(--fs-micro); color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wa-empty {
  padding: var(--s-3) var(--s-2);
  font-size: var(--fs-micro); color: var(--ink-4); line-height: 1.6;
  /* 空态可能带换行（临时客户的说明是两行），不写这条会被压成一行 */
  white-space: pre-wrap;
}

/* 消息流顶部「上滑加载更早 / 已经是最早」提示（2026-11-03，C-21）：
   居中、比正文更淡，不能抢消息的视觉焦点 */
.wa-more {
  padding: var(--s-2);
  text-align: center;
  font-size: var(--fs-micro);
  color: var(--ink-4);
}

/* 会话项副标题：还没采到消息的会话（临时客户），用次要色提醒「点开同步」 */
.wa-conv-sub-hint { color: var(--ink-4); font-style: italic; }

/* 消息流顶部的会话头（吸顶，不随消息滚走） */
/* 单行：名字（可省略）+ 号码（不压缩，号码比名字重要） */
.wa-thread-who {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: baseline; gap: 8px;
}
.wa-thread-name {
  flex: 0 1 auto; min-width: 0;
  font-size: var(--fs-sm); font-weight: 500; color: var(--ink-0);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wa-thread-phone { flex: 0 0 auto; font-size: var(--fs-micro); color: var(--brand-text); cursor: pointer; }
.wa-thread-phone:hover { text-decoration: underline; }

/* 底栏：输入框与发送按钮直接复用产品页的 .chat-part / #waMsg / #send，
   输入框上方的胶囊行也用产品页的 .menu-part / .menu-item —— 本页只额外管禁用态文案。 */
#waMsg {
  flex: 1 1 auto; min-width: 0;
  min-height: 44px; max-height: 130px;
  padding: 11px var(--s-2);
  /* 与产品页 #msg 同口径：无边框、透明底 —— 边框和圆角由 footer 胶囊提供，
     自己再画一层会变成双层边框 */
  border: 0; outline: none; background: transparent;
  border-radius: 22px;
  color: var(--ink-1);
  font-family: var(--font-ui); font-size: var(--fs-body); line-height: 1.4;
  resize: none;
  /* 输入框自己的滚动条一律藏掉（2026-10-26 用户实测：手机端右侧出现一条灰竖块）。
     内容超过 max-height 时仍能滚，只是不画滚动条 —— 高度由 JS 的 auto-grow 负责长。 */
  overflow-y: auto;
  scrollbar-width: none;
}
#waMsg::-webkit-scrollbar { width: 0; height: 0; }
#waMsg:disabled { opacity: .55; cursor: not-allowed; }

/* ===== 会话搜索（左菜单「我的会话记录」+「选择对话」抽屉共用一套） ===== */
.wa-search {
  display: flex; align-items: center; gap: 6px;
  margin: 0 0 6px; padding: 0 8px; height: 30px;
  /* 不参与压缩：矮窗口时它会被 flex 压成 17px（2026-10-26 实测） */
  flex: 0 0 auto; min-height: 30px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface-2);
  transition: border-color var(--t-fast);
}
.wa-search:focus-within { border-color: var(--brand); }
.wa-search svg { width: 13px; height: 13px; flex: 0 0 auto; color: var(--ink-4); }
.wa-search input {
  flex: 1 1 auto; min-width: 0;
  border: 0; outline: none; background: transparent;
  color: var(--ink-1); font-family: var(--font-ui); font-size: var(--fs-micro);
}
.wa-search input::placeholder { color: var(--ink-4); }
/* 用自己的 ×（原生那个在不同浏览器里长得不一样，还会挤掉输入区） */
.wa-search input::-webkit-search-cancel-button,
.wa-search input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.wa-search-x {
  flex: 0 0 auto; width: 18px; height: 18px; padding: 0;
  border: 0; border-radius: 50%; background: var(--surface-3); color: var(--ink-3);
  font-size: 12px; line-height: 1; cursor: pointer;
}
.wa-search-x:hover { color: var(--ink-0); }
.wa-conv-count { margin-left: auto; font-size: var(--fs-micro); color: var(--ink-4); }

/* 未读一键定位（2026-11-03）：列表上方的胶囊按钮，只滚动 + 高亮，不打开会话 */
.wa-unread-jump {
  display: block;
  width: calc(100% - var(--s-3) * 2);
  margin: 0 var(--s-3) var(--s-2);
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: var(--fs-sm);
  cursor: pointer;
}
.wa-unread-jump:hover { border-color: var(--brand); }
/* 定位到的那一条短暂描边，2 秒后自动消失（不改变选中态） */
.wa-conv-hit { outline: 2px solid var(--brand); outline-offset: -2px; }

/* 会话头（吸顶）：贴住消息区顶部，底色比顶栏深一档，一眼分得清「这是客户信息条」。
   贴顶靠 #chat.has-head 把上内边距清零（负 margin 抵不过 PC 端 --s-5 的 20px，实测留 20px 缝）。 */
/* 会话头（通栏）：放在 #chat **外面**（.wa-main 里），所以不受滚动容器 padding
   和 scrollbar-gutter 影响，能真正贴到左右边框。底色比顶栏深一档，一眼分得清。 */
.wa-main {
  grid-area: chat;
  display: flex; flex-direction: column;
  min-height: 0; min-width: 0;
  /* 回到最新按钮锚在这里（2026-11-03 C-21） */
  position: relative;
  /* 必须裁切：不加这条，#chat 的内容会把 .wa-main 撑高 → grid 行被顶开、
     滚动条跑到顶栏、鼠标滚轮滚不动（2026-10-26 改坏过一次，用户实测抓出） */
  overflow: hidden;
}
.wa-main > #chat { flex: 1 1 auto; min-height: 0; }

/* 电脑端同步状态条（2026-11-03 C-18）
   位置：输入框正上方、聊天区下方，**真实占位**而不是浮层 —— 浮层会盖住最后一条消息。
   六种状态只换 data-st 与文案：
     diff 灰（电脑在别的对话）/ same 淡绿（已在这个对话）/ wait 黄（切换中）
     fail 红（没切过去）/ off 灰（插件没运行）
   按钮一律淡绿（动作色），与状态色分开，避免「红条里放绿按钮」看起来像两个系统。 */
.wa-pc-state {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: var(--s-2);
  /* 24px：比客户信息条更薄一档，两条加起来也不到原来一条的高度 */
  min-height: 24px; padding: 1px var(--s-3);
  font-size: var(--fs-micro); line-height: 1.3;
  border-bottom: 1px solid var(--line);
  background: var(--neutral-soft); color: var(--ink-2);
}
@media (min-width: 900px) { .wa-pc-state { padding-left: var(--s-7); padding-right: var(--s-7); } }
.wa-pc-text {
  flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wa-pc-act {
  flex: 0 0 auto; height: 20px; padding: 0 8px;
  border-radius: var(--r-pill); border: 1px solid rgba(7, 193, 96, .38);
  background: var(--brand-soft); color: var(--brand-text);
  font-size: var(--fs-micro); cursor: pointer; white-space: nowrap;
}
.wa-pc-act:hover { border-color: var(--brand); }
.wa-pc-state[data-st="same"] {
  background: var(--brand-soft); color: var(--brand-text); border-top-color: rgba(7, 193, 96, .24);
}
.wa-pc-state[data-st="wait"] { background: var(--warn-soft); color: var(--warn); border-top-color: rgba(240, 178, 50, .3); }
.wa-pc-state[data-st="fail"] { background: rgba(250, 81, 81, .10); color: var(--danger); border-top-color: rgba(250, 81, 81, .3); }
.wa-pc-state[data-st="off"] { background: var(--neutral-soft); color: var(--ink-3); }
/* 切换中的小转圈：用 currentColor 描边，跟着状态色走 */
.wa-pc-spin {
  width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%;
  border: 1.5px solid currentColor; border-top-color: transparent;
  animation: waPcSpin .9s linear infinite;
}
@keyframes waPcSpin { to { transform: rotate(360deg); } }
.wa-thread-head {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: var(--s-2);
  /* 单行紧凑：名字 + 号码同一行，高度由「详情」按钮撑起来。
     2026-11-03 压矮一档（26px 按钮 + 7px 留白 = 约 41px → 22px + 4px = 约 31px）：
     它下面多了一条电脑端同步条，两条加起来不能比原来一条高太多。
     注意别加 min-height —— 这里不是 border-box，加了会变成 22+padding+border。 */
  padding: 4px var(--s-3);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 900px) {
  .wa-thread-head { padding-left: var(--s-7); padding-right: var(--s-7); }
}
@media (min-width: 720px) and (max-width: 899px) {
  .wa-main { max-width: 720px; margin-left: auto; margin-right: auto; width: 100%; }
}
.wa-detail-btn {
  flex: 0 0 auto; height: 22px; padding: 0 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-1); font-family: var(--font-ui); font-size: var(--fs-micro);
  cursor: pointer; white-space: nowrap;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.wa-detail-btn:hover { border-color: var(--brand); color: var(--brand-text); background: var(--brand-soft); }
.wa-detail-btn:active { transform: scale(.98); }

/* 客户详情抽屉里的字段行 */
.wa-detail {
  display: flex; flex-direction: column;
  max-height: 52vh; overflow-y: auto; overscroll-behavior: contain;
  margin-bottom: var(--s-3);
}
.wa-detail-row {
  display: flex; gap: 10px; padding: 8px 2px;
  border-bottom: 1px dashed var(--line);
}
.wa-detail-row:last-child { border-bottom: 0; }
.wa-detail-k { flex: 0 0 76px; font-size: var(--fs-micro); color: var(--ink-4); }
.wa-detail-v {
  flex: 1 1 auto; min-width: 0;
  font-size: var(--fs-sm); color: var(--ink-1); word-break: break-word;
}
.wa-detail-v.copyable { color: var(--brand-text); cursor: pointer; }
.wa-detail-v.copyable:hover { text-decoration: underline; }

/* ===== 待发送卡片（2026-10-26 C-10）=====
   必须和真实气泡一眼区分：虚线边框 + 「待发送」标签 + 半透明。
   真实消息要等插件扫回来才出现，长一样的话员工会以为已经发出去了。 */
.wa-draft {
  align-self: flex-end;
  max-width: 78%; min-width: 200px;
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 12px;
  border: 1px dashed var(--brand);
  border-radius: var(--r-md);
  background: var(--brand-soft);
  color: var(--ink-1);
}
.wa-draft-tag { font-size: var(--fs-micro); color: var(--brand-text); }
/* 中文是「我说的」，英文才是「客户会收到的」——所以英文主色、中文次要 */
.wa-draft-zh { font-size: var(--fs-sm); color: var(--ink-3); white-space: pre-wrap; word-break: break-word; }
.wa-draft-out {
  font-size: var(--fs-sm); color: var(--ink-0);
  white-space: pre-wrap; word-break: break-word;
  padding-top: 6px; border-top: 1px dashed var(--line);
}
.wa-draft-state { font-size: var(--fs-micro); color: #e24b4a; }
.wa-draft-state:empty { display: none; }
.wa-draft-acts { display: flex; gap: 8px; }
.wa-draft-ok, .wa-draft-edit {
  flex: 1 1 auto; height: 32px; padding: 0 10px;
  border-radius: var(--r-pill);
  font-family: var(--font-ui); font-size: var(--fs-micro);
  cursor: pointer; white-space: nowrap;
  transition: filter var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.wa-draft-ok { border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); }
.wa-draft-ok:hover { filter: brightness(1.06); }
.wa-draft-ok:disabled { opacity: .6; cursor: default; }
.wa-draft-edit { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); }
.wa-draft-edit:hover { border-color: var(--line-strong); color: var(--ink-0); }
.wa-draft[data-state="sent"] {
  border-style: solid; border-color: var(--ok); background: var(--surface-2); opacity: .7;
}
.wa-draft[data-state="sent"] .wa-draft-tag { color: var(--ok); }
.wa-draft[data-state="failed"] { border-color: #e24b4a; }
.wa-draft[data-state="failed"] .wa-draft-tag { color: #e24b4a; }

/* 账号切换抽屉（左菜单入口与底栏按钮共用） */
#waAccSheet, #waConvSheet, #waDetailSheet {
  position: fixed; inset: 0; z-index: var(--z-sheet);
  display: flex; align-items: flex-end; justify-content: center;
}
#waAccSheet .mask, #waConvSheet .mask, #waDetailSheet .mask { position: absolute; inset: 0; background: var(--scrim); }
#waAccSheet .sheet, #waConvSheet .sheet, #waDetailSheet .sheet {
  position: relative; width: 100%; max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: var(--s-4);
  padding-bottom: max(var(--s-4), env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .45);
  animation: sheetUp var(--t-base) var(--e-out);
}
#waAccSheet .wa-list, #waConvSheet .wa-list { max-height: 60vh; }
@media (min-width: 900px) {
  #waAccSheet, #waConvSheet, #waDetailSheet { align-items: center; }
  #waAccSheet .sheet, #waConvSheet .sheet, #waDetailSheet .sheet { border-radius: var(--r-xl); margin: 0 var(--s-4); }
}

/* 左菜单「我的账号」：只显示当前账号，点击弹全部（与产品助手「切换产品」同一套交互） */
.wa-cur-acc {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 10px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface-2); color: var(--ink-1);
  cursor: pointer; text-align: left; position: relative;
  font-family: var(--font-ui);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.wa-cur-acc:hover { border-color: var(--line-strong); background: var(--brand-soft); }
.wa-cur-acc svg { flex: 0 0 auto; width: 13px; height: 13px; color: var(--ink-4); }

/* 顶栏连接点：对话助手页显示的是「当前账号的插件心跳」。
   已连接=绿点呼吸（沿用 .presence .dot 默认）；已断开=灰点静止（.off，不呼吸也不闪）。 */
.presence .dot.off {
  background: var(--ink-3);
  box-shadow: none;
  animation: none;
}
