    /* ============================================================
       灵犀 · Design System v0.41 —— 浅色 Linear 风控制台
       白底 + 黑灰文字 + 单一蓝色强调 + 极少量紫色（仅 AI / 项目经理标识）。
       深色作为可切换主题保留：<html data-theme="dark">。
       纯前端换肤：所有 id / JS 契约保持不变。
       参考实测规范 landing-assets/design-spec.md（浅色版翻译）：
       发丝边框 rgba(0,0,0,.07)、卡片圆角 8-10px、按钮胶囊、微交互 150ms、
       零 emoji 图标（全内联 SVG 1.6px 描边）、零紫色大渐变。
       ============================================================ */
    :root {
      color-scheme: light;
      /* —— 表面（白 → 极浅灰四级，几乎零色偏）—— */
      --bg: #FFFFFF;
      --bg-subtle: #FAFAFB;
      --surface: #FFFFFF;
      --surface-2: #F4F4F6;
      --surface-3: #EAEAEE;
      --elev: #FFFFFF;
      --overlay-bg: rgba(24, 24, 27, .28);
      /* —— 描边（发丝级，绝不用 1px solid #ccc 实线感）—— */
      --border: rgba(0, 0, 0, .07);
      --border-strong: rgba(0, 0, 0, .12);
      --border-accent: rgba(75, 110, 245, .42);
      /* —— 文字 —— */
      --text: #18181B;
      --muted: #6B6D76;
      --faint: #7E808A;  /* 三级文字：白底对比 ≈3.9:1，比 #9497A1 更耐读 */
      --on-accent: #FFFFFF;
      /* —— 单一强调色：蓝（与公众号排版主题同源）—— */
      --accent: #4B6EF5;
      --accent-hover: #3F5FE0;
      --accent-soft: rgba(75, 110, 245, .09);
      --accent-ring: rgba(75, 110, 245, .16);
      /* —— 紫：只作 AI / 项目经理标识用，克制 —— */
      --ai: #6D4AE0;
      --ai-soft: rgba(109, 74, 224, .10);
      --ai-border: rgba(109, 74, 224, .26);
      /* —— 语义色 —— */
      --danger: #D64545;
      --danger-soft: rgba(214, 69, 69, .08);
      --ok: #12855C;
      --warn: #9A6B12;
      /* —— 代码块：两个主题都保持深底（可读性 + 工程感）—— */
      --code-bg: #17181C;
      --code-text: #E7E8EC;
      --code-border: rgba(255, 255, 255, .10);
      /* v0.83：收款二维码的衬底。**深浅两个主题都是白的**，这是唯一一个刻意不跟随
         主题翻转的表面色——二维码要被摄像头扫，深色衬底会让识别率掉下去；这是功能
         正确性，不是配色偏好。写成 token 而不是就地 #fff，是为了让这个例外只有一处
         可改、也只有一处需要解释。 */
      --qr-paper: #FFFFFF;
      /* —— 七团队 + 项目经理 + 自建：白底可读的低饱和色相（沿用原色相，降饱和/压亮度）—— */
      --daily: #2F8F6B;      --daily-rgb: 47, 143, 107;
      --finance: #9A6B12;    --finance-rgb: 154, 107, 18;
      --ecommerce: #B05C2E;  --ecommerce-rgb: 176, 92, 46;
      --image: #AC4B84;      --image-rgb: 172, 75, 132;
      --research: #1B7A92;   --research-rgb: 27, 122, 146;
      --media: #6D4AE0;      --media-rgb: 109, 74, 224;
      /* v0.47 B：小红书团队自己的徽章色（小红书品牌红，压到白底可读的低饱和档）。 */
      --xiaohongshu: #C9333F; --xiaohongshu-rgb: 201, 51, 63;
      --education: #3665C4;  --education-rgb: 54, 101, 196;
    --video: #1F8A7C;  --video-rgb: 31, 138, 124;
      /* v0.57：变化检测团队——测绘/遥感味的橄榄绿，与 video 的青绿拉开距离。 */
      --change: #5E7A38;     --change-rgb: 94, 122, 56;
      /* v0.68：机械设计团队——工业蓝灰（工程蓝图的色调）。与 research 的青蓝
         (#1B7A92)、education 的宝蓝 (#3665C4) 明度/饱和度都拉开，不撞色。 */
      --cad: #4A6B8A;        --cad-rgb: 74, 107, 138;
      --pm: #6D4AE0;         --pm-rgb: 109, 74, 224;
      --custom: #4B6EF5;     --custom-rgb: 75, 110, 245;
      --tint: .09;           /* 徽章底色透明度 */
      --tint-bd: .22;        /* 徽章描边透明度 */
      /* —— 圆角：结构锐利、交互圆润 —— */
      --r-xs: 6px; --r-sm: 8px; --r: 10px; --r-lg: 12px; --r-xl: 16px; --r-pill: 999px;
      /* —— 阴影：极轻，不发光 —— */
      --sh-1: 0 1px 2px rgba(16, 17, 26, .05);
      --sh-2: 0 2px 8px rgba(16, 17, 26, .07), 0 1px 2px rgba(16, 17, 26, .04);
      --sh-3: 0 16px 44px rgba(16, 17, 26, .14), 0 2px 8px rgba(16, 17, 26, .06);
      --ring: 0 0 0 3px var(--accent-ring);
      --ease: cubic-bezier(.4, 0, .2, 1);
      --t: .15s;
    }

    [data-theme="dark"] {
      color-scheme: dark;
      --bg: #0B0B0D;
      --bg-subtle: #0F0F12;
      --surface: #141417;
      --surface-2: #1A1A1F;
      --surface-3: #232329;
      --elev: #17171B;
      --overlay-bg: rgba(4, 4, 6, .66);
      --border: rgba(255, 255, 255, .08);
      --border-strong: rgba(255, 255, 255, .15);
      --border-accent: rgba(124, 140, 255, .48);
      --text: #ECECEE;
      --muted: #9A9AA6;
      --faint: #7B7B87;
      --on-accent: #FFFFFF;
      --accent: #7C8CFF;
      --accent-hover: #93A0FF;
      --accent-soft: rgba(124, 140, 255, .15);
      --accent-ring: rgba(124, 140, 255, .24);
      --ai: #A78BFA;
      --ai-soft: rgba(167, 139, 250, .16);
      --ai-border: rgba(167, 139, 250, .34);
      --danger: #E97A73;
      --danger-soft: rgba(233, 122, 115, .12);
      --ok: #4EC98A;
      --warn: #D8AC5E;
      --code-bg: #0E0E11;
      --code-text: #E7E8EC;
      --code-border: rgba(255, 255, 255, .08);
      --qr-paper: #FFFFFF;  /* 见浅色主题处的说明：二维码衬底不跟随主题 */
      --daily: #6CC0A0;      --daily-rgb: 108, 192, 160;
      --finance: #D2AB6B;    --finance-rgb: 210, 171, 107;
      --ecommerce: #D68F6B;  --ecommerce-rgb: 214, 143, 107;
      --image: #D38CB2;      --image-rgb: 211, 140, 178;
      --research: #6CB4C6;   --research-rgb: 108, 180, 198;
      --media: #A892E2;      --media-rgb: 168, 146, 226;
      --xiaohongshu: #E8737E; --xiaohongshu-rgb: 232, 115, 126;
      --education: #7FA8E6;  --education-rgb: 127, 168, 230;
    --video: #5FB3A8;  --video-rgb: 95, 179, 168;
      --change: #9CB86A;     --change-rgb: 156, 184, 106;
      --cad: #8FB0CE;        --cad-rgb: 143, 176, 206;
      --pm: #A78BFA;         --pm-rgb: 167, 139, 250;
      --custom: #8F9AE8;     --custom-rgb: 143, 154, 232;
      --tint: .15;
      --tint-bd: .30;
      --sh-1: 0 1px 2px rgba(0, 0, 0, .35);
      --sh-2: 0 4px 14px rgba(0, 0, 0, .38);
      --sh-3: 0 18px 50px rgba(0, 0, 0, .55);
    }

    * { box-sizing: border-box; }
    ::selection { background: var(--accent-ring); color: var(--text); }
    ::-webkit-scrollbar { width: 10px; height: 10px; }
    ::-webkit-scrollbar-thumb {
      background: var(--border-strong); border-radius: var(--r-pill);
      border: 3px solid transparent; background-clip: padding-box;
    }
    ::-webkit-scrollbar-thumb:hover { background: var(--faint); background-clip: padding-box; }
    ::-webkit-scrollbar-track { background: transparent; }
    html, body { height: 100%; }
    body {
      margin: 0; min-height: 100vh; display: flex;
      color: var(--text); background: var(--bg);
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
      -webkit-font-smoothing: antialiased;
      font-size: 14px; line-height: 1.6;
    }
    button, input, textarea, select { font-family: inherit; }
    /* 内联图标系统：单一线性风格，1.6px 描边，随文字颜色 */
    .ic {
      width: 16px; height: 16px; flex: none; display: block;
      fill: none; stroke: currentColor; stroke-width: 1.6;
      stroke-linecap: round; stroke-linejoin: round;
    }
    .ic-sm { width: 14px; height: 14px; }

    /* ---------------- 左侧栏（Linear 窄栏）---------------- */
    #sidebar {
      width: 236px; flex-shrink: 0;
      background: var(--bg-subtle);
      border-right: 1px solid var(--border);
      display: flex; flex-direction: column;
      position: relative; z-index: 40;
    }
    #sidebar .side-head {
      padding: 14px 14px 12px;
      display: flex; align-items: center; gap: 9px;
    }
    .logo-mark {
      width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
      background: #fff; overflow: hidden;
      display: flex; align-items: center; justify-content: center;
      border: 1px solid var(--border); box-shadow: var(--sh-1);
    }
    .logo-mark img, .login-logo img, .welcome-badge img {
      width: 100%; height: 100%; display: block; object-fit: contain;
      transform: scale(1.12);
    }
    #sidebar .side-head h1 { font-size: 14.5px; margin: 0; font-weight: 600; letter-spacing: .02em; }
    #sidebar .side-head .sub { font-size: 11.5px; color: var(--faint); display: block; margin-top: 1px; }
    #newBtn {
      margin: 2px 12px 8px; padding: 8px 12px; cursor: pointer; font-size: 13px; font-weight: 500;
      background: var(--surface); color: var(--text);
      border: 1px solid var(--border); border-radius: var(--r-sm);
      box-shadow: var(--sh-1);
      transition: background var(--t) var(--ease), border-color var(--t) var(--ease);
      display: flex; align-items: center; justify-content: flex-start; gap: 7px;
    }
    #newBtn:hover { background: var(--surface-2); border-color: var(--border-strong); }
    #newBtn:active { background: var(--surface-3); }
    /* Codex 式左上角工作入口：高频功能与会话列表同属导航，不再横塞在顶栏。 */
    .side-tools {
      display: flex; flex-direction: column; gap: 2px;
      margin: 0 8px 8px; padding: 0 0 8px;
      border-bottom: 1px solid var(--border);
    }
    .side-tools .tool-btn {
      width: 100%; display: flex; justify-content: flex-start;
      padding: 7px 10px; color: var(--muted); font-size: 13px;
    }
    .side-tools .tool-btn .ic { color: var(--faint); }
    .side-tools .tool-btn:hover .ic { color: var(--text); }
    .side-tools .tool-btn .lbl { display: inline; }
    .side-section-label {
      padding: 0 16px 4px; color: var(--faint); font-size: 11px;
      font-weight: 500; letter-spacing: .04em;
    }
    #sessionList { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 8px 14px; }
    /* Codex 式侧栏底座：偏好与管理统一落在左下，避免和当前会话操作混在顶栏。 */
    .side-footer {
      flex: none; display: flex; flex-direction: column; gap: 2px;
      padding: 8px; border-top: 1px solid var(--border);
      background: var(--bg-subtle);
    }
    .side-footer .tool-btn {
      width: 100%; display: flex; justify-content: flex-start;
      padding: 7px 10px; color: var(--muted); font-size: 13px;
    }
    .side-footer .tool-btn .ic { color: var(--faint); }
    .side-footer .tool-btn:hover .ic { color: var(--text); }
    .side-footer .tool-btn .lbl { display: inline; }
    .side-settings { width: 100%; }
    /* 桌面端从侧栏向右、贴着底部展开；内容过多时只滚动菜单本身。 */
    .side-settings .dropdown {
      left: calc(100% + 8px); right: auto; top: auto; bottom: 0;
      min-width: 220px; max-height: calc(100vh - 20px); overflow-y: auto;
    }
    .sess-item {
      position: relative; padding: 7px 10px; border-radius: var(--r-xs); cursor: pointer; font-size: 13px;
      color: var(--muted); margin-bottom: 1px; white-space: nowrap;
      overflow: hidden; text-overflow: ellipsis;
      transition: background var(--t) var(--ease), color var(--t) var(--ease);
    }
    .sess-item:hover { background: var(--surface-2); color: var(--text); }
    .sess-item.active { background: var(--surface-3); color: var(--text); font-weight: 500; }

    /* ---------------- 主区 ---------------- */
    #main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
    header {
      padding: 0 16px; height: 48px; flex: none;
      border-bottom: 1px solid var(--border);
      display: flex; align-items: center; gap: 12px; justify-content: space-between;
      background: var(--bg);
      position: sticky; top: 0; z-index: 30;
    }
    .head-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
    header .sub { color: var(--muted); font-size: 12.5px; }
    .menu-btn {
      display: none; background: transparent; color: var(--muted); border: none;
      border-radius: var(--r-xs); width: 30px; height: 30px; cursor: pointer; flex-shrink: 0;
      align-items: center; justify-content: center; padding: 0;
      transition: background var(--t) var(--ease), color var(--t) var(--ease);
    }
    .menu-btn:hover { background: var(--surface-2); color: var(--text); }
    .head-actions { display: flex; align-items: center; gap: 2px; min-width: 0; }
    /* 工具栏按钮：无边框幽灵态（不再是一排 chips） */
    .hk-open, .tool-btn {
      background: transparent; color: var(--muted); border: none;
      border-radius: var(--r-xs); padding: 6px 9px; cursor: pointer; font-size: 13px; flex-shrink: 0;
      transition: background var(--t) var(--ease), color var(--t) var(--ease);
      display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
    }
    .hk-open:hover, .tool-btn:hover { background: var(--surface-2); color: var(--text); }
    .hk-open:active, .tool-btn:active { background: var(--surface-3); }
    .icon-only { padding: 6px; }
    .head-sep { width: 1px; height: 18px; background: var(--border); margin: 0 5px; flex: none; }

    /* 设置下拉 */
    .menu-wrap { position: relative; }
    .dropdown {
      position: absolute; right: 0; top: calc(100% + 6px); min-width: 188px;
      background: var(--elev); border: 1px solid var(--border); border-radius: var(--r);
      box-shadow: var(--sh-3); padding: 5px; z-index: 60; display: none;
      animation: popIn .13s var(--ease);
    }
    .menu-wrap.open .dropdown { display: block; }
    .menu-wrap.open > .tool-btn { background: var(--surface-2); color: var(--text); }
    @keyframes popIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
    .menu-item {
      display: flex; align-items: center; gap: 9px; width: 100%;
      background: transparent; border: none; color: var(--text);
      padding: 7px 9px; border-radius: var(--r-xs); font-size: 13px; cursor: pointer; text-align: left;
      transition: background var(--t) var(--ease), color var(--t) var(--ease);
    }
    .menu-item:hover { background: var(--surface-2); }
    .menu-item .ic { color: var(--faint); }
    .menu-item:hover .ic { color: var(--muted); }
    .menu-sep { height: 1px; background: var(--border); margin: 5px -5px; }
    #logoutBtn { color: var(--muted); }
    #logoutBtn:hover { background: var(--danger-soft); color: var(--danger); }
    #logoutBtn:hover .ic { color: var(--danger); }
    /* 主题切换：按当前主题只显示一个图标 */
    .ic-moon { display: block; }
    .ic-sun { display: none; }
    [data-theme="dark"] .ic-moon { display: none; }
    [data-theme="dark"] .ic-sun { display: block; }

    /* 身份徽标 */
    #whoami { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-width: 0; }
    #whoami .who-name { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .role-badge {
      font-size: 11px; padding: 1px 7px; border-radius: var(--r-xs); font-weight: 500; flex-shrink: 0;
      color: var(--muted); background: var(--surface-2); border: 1px solid var(--border);
    }
    .role-badge.tenant { color: var(--accent); background: var(--accent-soft); border-color: var(--border-accent); }
    .role-badge.superadmin { color: var(--finance); background: rgba(var(--finance-rgb), var(--tint)); border-color: rgba(var(--finance-rgb), var(--tint-bd)); }
    .bind-code {
      font-size: 11.5px; color: var(--muted); border: 1px solid var(--border);
      border-radius: var(--r-xs); padding: 1px 8px; cursor: default; white-space: nowrap; background: var(--bg-subtle);
    }
    .bind-code b { color: var(--text); letter-spacing: .06em; font-weight: 600; }

    /* 已开通团队条 */
    #teamStrip {
      padding: 8px 20px; border-bottom: 1px solid var(--border); background: var(--bg-subtle);
      display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--muted);
    }
    /* 手机端横向滚动时，条目一律不许被压扁成竖排（flex-wrap:nowrap 下必须 flex:none）。 */
    #teamStrip .strip-label { margin-right: 2px; color: var(--faint); white-space: nowrap; flex: none; }
    #teamStrip .tag { flex: none; }
    #teamStrip .strip-custom { color: var(--muted); margin-left: 6px; white-space: nowrap; flex: none; }

    /* ---------------- 聊天区 ---------------- */
    #chat {
      flex: 1; overflow-y: auto; padding: 28px 24px 10px;
      display: flex; flex-direction: column; gap: 20px;
      max-width: 824px; width: 100%; margin: 0 auto;
    }
    /* #empty：欢迎面板（renderWelcomePanel 注入 innerHTML，display:none/block 契约不变） */
    .empty {
      color: var(--muted); margin: 6vh auto 0; max-width: 760px; width: 100%;
      font-size: 14px; line-height: 1.7; padding: 0 2px 20px;
    }
    .welcome-badge {
      display: flex; align-items: center; justify-content: center;
      width: 44px; height: 44px; margin: 0 auto 14px; border-radius: 12px;
      background: #fff; overflow: hidden;
      border: 1px solid var(--border); box-shadow: var(--sh-1);
    }
    .welcome-title { text-align: center; font-size: 20px; font-weight: 600; color: var(--text); margin: 0 0 8px; letter-spacing: .01em; }
    .welcome-sub { text-align: center; font-size: 13.5px; line-height: 1.7; color: var(--muted); max-width: 480px; margin: 0 auto 28px; }
    .welcome-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 12px; margin-bottom: 20px; }
    .welcome-card {
      border: 1px solid var(--border); border-radius: var(--r); background: var(--surface);
      padding: 14px 15px 13px; text-align: left; box-shadow: var(--sh-1);
      transition: border-color var(--t) var(--ease), transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
      display: flex; flex-direction: column;
    }
    .welcome-card:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--sh-2); }
    .welcome-card-head { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
    .welcome-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
    .welcome-card-name { font-weight: 600; font-size: 13.5px; color: var(--text); }
    .welcome-card-desc { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin: 0 0 11px; }
    .welcome-examples { display: flex; flex-direction: column; gap: 6px; margin-top: auto; }
    .welcome-ex-btn {
      text-align: left; background: var(--bg-subtle); border: 1px solid var(--border); color: var(--muted);
      border-radius: var(--r-xs); padding: 7px 10px; font-size: 12px; line-height: 1.45; cursor: pointer;
      transition: border-color var(--t) var(--ease), background var(--t) var(--ease), color var(--t) var(--ease);
      font-family: inherit;
    }
    .welcome-ex-btn:hover { border-color: var(--border-accent); background: var(--accent-soft); color: var(--text); }
    .welcome-foot { text-align: center; font-size: 11.5px; color: var(--faint); margin-top: 4px; line-height: 1.7; }

    .msg {
      display: flex; flex-direction: column; gap: 6px; max-width: 84%;
      animation: msgIn .28s var(--ease);
    }
    @keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
    .msg.user { align-self: flex-end; align-items: flex-end; }
    .msg.assistant { align-self: flex-start; }
    .bubble {
      padding: 11px 15px; border-radius: var(--r-lg); line-height: 1.72;
      word-break: break-word; font-size: 14.5px;
    }
    .user .bubble {
      background: var(--accent-soft); border: 1px solid var(--border-accent); color: var(--text);
      white-space: pre-wrap; border-bottom-right-radius: 4px;
    }
    .assistant .bubble {
      background: var(--surface); border: 1px solid var(--border); box-shadow: var(--sh-1);
      border-bottom-left-radius: 4px;
    }
    .bubble h1, .bubble h2, .bubble h3 { margin: .7em 0 .35em; line-height: 1.35; font-weight: 600; }
    .bubble h1 { font-size: 1.24em; } .bubble h2 { font-size: 1.14em; } .bubble h3 { font-size: 1.04em; }
    .bubble p { margin: .45em 0; }
    .bubble p:first-child { margin-top: 0; } .bubble p:last-child { margin-bottom: 0; }
    .bubble ul, .bubble ol { margin: .45em 0; padding-left: 1.4em; }
    .bubble li { margin: .2em 0; }
    .bubble strong { color: var(--text); font-weight: 600; }
    .bubble a { color: var(--accent); }
    /* P2-2：==高亮== 的落地样式。浏览器自带的 <mark> 默认是「黄底黑字」，在本控制台
       的深色气泡里刺眼且读不动，所以按主题色重画一版：低饱和底 + 保持正文字色。 */
    .bubble mark {
      background: color-mix(in srgb, var(--accent) 22%, transparent);
      color: inherit; padding: .5px 3px; border-radius: 3px;
    }
    .bubble code {
      background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
      padding: .5px 5px; border-radius: 5px;
      font-family: "SFMono-Regular", "Cascadia Code", Consolas, monospace; font-size: .87em;
    }
    .bubble pre {
      background: var(--code-bg); color: var(--code-text); padding: 13px 15px;
      border-radius: var(--r-sm); margin: .7em 0; overflow-x: auto; border: 1px solid var(--code-border);
    }
    .bubble pre code { background: none; border: none; padding: 0; color: inherit; font-size: .86em; line-height: 1.65; }
    /* v0.45：宽表外包 .tbl-wrap 负责横向滚动。table 用 min-width:100% + 单元格不换行，
       窄表仍撑满气泡宽度，宽表则按内容自然撑宽触发滚动，不会被硬挤成竖排文字。 */
    .bubble .tbl-wrap { overflow-x: auto; max-width: 100%; margin: .7em 0; -webkit-overflow-scrolling: touch; }
    .bubble table { border-collapse: collapse; width: auto; min-width: 100%; font-size: .92em; }
    .bubble th, .bubble td { border: 1px solid var(--border); padding: 7px 11px; text-align: left; white-space: nowrap; }
    .bubble th { background: var(--surface-2); font-weight: 600; }
    .bubble tr:nth-child(even) td { background: var(--bg-subtle); }
    .bubble tbody tr:hover td { background: var(--surface-2); }

    /* 团队徽章：低饱和着色软徽章 + 同色圆点（零 emoji） */
    .tag {
      font-size: 11.5px; padding: 2px 9px 2px 8px; border-radius: var(--r-xs);
      display: inline-flex; align-items: center; gap: 6px; font-weight: 500;
      white-space: nowrap; border: 1px solid var(--border); color: var(--muted); background: var(--surface-2);
    }
    .tag::before {
      content: ''; width: 6px; height: 6px; border-radius: 50%;
      background: currentColor; flex: none; opacity: .9;
    }
    .msg > .tag { align-self: flex-start; }
    .tag.daily { color: var(--daily); background: rgba(var(--daily-rgb), var(--tint)); border-color: rgba(var(--daily-rgb), var(--tint-bd)); }
    .tag.finance { color: var(--finance); background: rgba(var(--finance-rgb), var(--tint)); border-color: rgba(var(--finance-rgb), var(--tint-bd)); }
    .tag.ecommerce { color: var(--ecommerce); background: rgba(var(--ecommerce-rgb), var(--tint)); border-color: rgba(var(--ecommerce-rgb), var(--tint-bd)); }
    .tag.image { color: var(--image); background: rgba(var(--image-rgb), var(--tint)); border-color: rgba(var(--image-rgb), var(--tint-bd)); }
    .tag.research { color: var(--research); background: rgba(var(--research-rgb), var(--tint)); border-color: rgba(var(--research-rgb), var(--tint-bd)); }
    .tag.media { color: var(--media); background: rgba(var(--media-rgb), var(--tint)); border-color: rgba(var(--media-rgb), var(--tint-bd)); }
    .tag.xiaohongshu { color: var(--xiaohongshu); background: rgba(var(--xiaohongshu-rgb), var(--tint)); border-color: rgba(var(--xiaohongshu-rgb), var(--tint-bd)); }
    .tag.education { color: var(--education); background: rgba(var(--education-rgb), var(--tint)); border-color: rgba(var(--education-rgb), var(--tint-bd)); }
    .tag.video { color: var(--video); background: rgba(var(--video-rgb), var(--tint)); border-color: rgba(var(--video-rgb), var(--tint-bd)); }
    .tag.change { color: var(--change); background: rgba(var(--change-rgb), var(--tint)); border-color: rgba(var(--change-rgb), var(--tint-bd)); }
    .tag.cad { color: var(--cad); background: rgba(var(--cad-rgb), var(--tint)); border-color: rgba(var(--cad-rgb), var(--tint-bd)); }
    /* 紫色 = AI / 项目经理标识（全站唯一紫用途） */
    .tag.pm { color: var(--ai); background: var(--ai-soft); border-color: var(--ai-border); }
    .tag.custom { color: var(--custom); background: rgba(var(--custom-rgb), var(--tint)); border-color: rgba(var(--custom-rgb), var(--tint-bd)); }

    /* 思考中 */
    .thinking .bubble { color: var(--muted); }
    .thinking .bubble::after {
      content: ''; display: inline-block; width: 14px; text-align: left;
      animation: dots 1.3s steps(4, end) infinite;
    }
    @keyframes dots { 0%{content:'';} 25%{content:'·';} 50%{content:'··';} 75%{content:'···';} }
    /* 步骤级进度：已完成打勾 / 当前项高亮。有清单时关掉省略号动画。 */
    .thinking .bubble.has-steps::after { content: none; animation: none; }
    .prog-steps { display: flex; flex-direction: column; gap: 5px; }
    .prog-step { display: flex; align-items: baseline; gap: 8px; line-height: 1.5; }
    .prog-step .prog-mark { flex: none; width: 1em; text-align: center; font-size: 12px; }
    .prog-step.done { color: var(--muted); }
    .prog-step.done .prog-mark { color: var(--ok); }
    .prog-step.active { color: var(--text); font-weight: 500; }
    .prog-step.active .prog-mark { color: var(--ai); }
    .prog-step .prog-secs { color: var(--faint); font-weight: 400; font-size: 12px; }

    /* 富输出：图片 / 视频 / 来源 / 下载 */
    /* v0.71 交付文件列表：工程图 / 三维模型这类「拿走用」的产物，直接在气泡里给下载。 */
    .msg-files { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
    .msg-files-head { font-size: 12.5px; color: var(--text-dim); letter-spacing: .01em; }
    .file-chip {
      display: flex; align-items: center; gap: 10px;
      padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
      background: var(--surface-2); color: var(--text); text-decoration: none;
      font-size: 13px; transition: border-color .15s, background .15s;
    }
    .file-chip:hover { border-color: var(--accent); background: var(--surface-3); }
    .file-ext {
      flex: none; min-width: 46px; text-align: center;
      padding: 2px 6px; border-radius: 5px;
      background: rgba(var(--cad-rgb), .16); color: var(--cad);
      font-size: 11px; font-weight: 600; letter-spacing: .03em;
    }
    .file-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .msg-images, .msg-videos { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
    .msg-images img {
      max-width: 260px; max-height: 260px; border-radius: var(--r-sm); cursor: zoom-in;
      border: 1px solid var(--border); background: var(--surface-2); box-shadow: var(--sh-1);
      transition: box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
    }
    .msg-images img:hover { box-shadow: var(--sh-2); border-color: var(--border-strong); }
    .msg-videos video {
      max-width: 320px; max-height: 320px; border-radius: var(--r-sm);
      border: 1px solid var(--border); background: #000; box-shadow: var(--sh-1);
    }
    .sources {
      margin-top: 4px; background: var(--bg-subtle); border: 1px solid var(--border);
      border-radius: var(--r-sm); padding: 10px 14px;
    }
    .sources .sources-h { color: var(--faint); font-size: 11.5px; margin-bottom: 5px; font-weight: 600; letter-spacing: .04em; }
    .sources ol { margin: 0; padding-left: 1.3em; }
    .sources li { margin: .2em 0; font-size: 13px; }
    .sources a { color: var(--accent); text-decoration: none; word-break: break-all; }
    .sources a:hover { text-decoration: underline; }
    .doc-actions { margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; }
    .task-receipt {
      margin-top: 8px; padding: 12px 13px; border: 1px solid var(--border-accent);
      border-radius: var(--r); background: var(--accent-soft); display: flex;
      flex-direction: column; align-items: flex-start; gap: 9px;
    }
    .task-receipt-head { color: var(--accent); font-size: 13px; font-weight: 650; }
    .task-receipt-grid {
      width: 100%; display: grid; grid-template-columns: max-content minmax(0, 1fr);
      gap: 5px 12px; font-size: 12px; line-height: 1.55;
    }
    .task-receipt-grid span { color: var(--muted); }
    .task-receipt-grid b { color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
    .doc-btn {
      background: var(--surface); color: var(--text); border: 1px solid var(--border);
      border-radius: var(--r-xs); padding: 6px 12px; font-size: 12.5px; text-decoration: none; cursor: pointer;
      transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
      display: inline-flex; align-items: center; gap: 6px; box-shadow: var(--sh-1);
    }
    .doc-btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
    /* v0.47 B：内容资产的两个动作是 <button>（不是 <a>），按钮默认字体不继承，显式拉齐。 */
    .doc-btn.asset-btn { font-family: inherit; font-size: 12.5px; line-height: 1.2; }
    /* 资产面板里展开的正文：保留换行、超长自滚，绝不把 modal 撑破。 */
    .asset-body { white-space: pre-wrap; max-height: 38vh; overflow: auto; }

    /* toast：中性深色浮层（两个主题一致） */
    #toast {
      position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(10px);
      background: #1D1E22; color: #F2F3F5; border: 1px solid rgba(255,255,255,.10);
      border-radius: var(--r-sm); padding: 10px 18px; font-size: 13px; z-index: 200;
      opacity: 0; pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease);
      max-width: 80vw; box-shadow: var(--sh-3);
    }
    #toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

    /* ---------------- 输入区 ---------------- */
    footer { border-top: 1px solid var(--border); background: var(--bg); padding: 12px 24px 14px; flex: none; }
    .files { max-width: 776px; margin: 0 auto 8px; display: flex; flex-wrap: wrap; gap: 6px; }
    .file-chip {
      background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-xs);
      padding: 4px 9px; font-size: 12px; color: var(--muted);
      display: flex; align-items: center; gap: 6px;
    }
    .file-chip button { background: none; border: none; color: var(--faint); cursor: pointer; font-size: 13px; padding: 0; line-height: 1; }
    .file-chip button:hover { color: var(--danger); }
    .composer {
      max-width: 776px; margin: 0 auto; display: flex; gap: 6px; align-items: flex-end;
      background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
      padding: 6px; box-shadow: var(--sh-1); transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
    }
    .composer:focus-within { border-color: var(--border-accent); box-shadow: var(--ring); }
    .icon-btn {
      background: transparent; color: var(--faint); border: none;
      border-radius: var(--r-xs); height: 36px; width: 36px; cursor: pointer; flex-shrink: 0;
      display: flex; align-items: center; justify-content: center; padding: 0;
      transition: color var(--t) var(--ease), background var(--t) var(--ease);
    }
    .icon-btn:hover { color: var(--text); background: var(--surface-2); }
    textarea {
      flex: 1; resize: none; background: transparent; color: var(--text);
      border: none; border-radius: var(--r-xs); padding: 9px 4px;
      font-size: 14.5px; min-height: 36px; max-height: 168px; line-height: 1.55; min-width: 0;
    }
    textarea:focus { outline: none; }
    textarea::placeholder { color: var(--faint); }
    .send {
      background: var(--accent); color: var(--on-accent); border: none; border-radius: var(--r-pill);
      padding: 0 18px; height: 36px; cursor: pointer; font-size: 13.5px; font-weight: 500; flex-shrink: 0;
      transition: background var(--t) var(--ease), opacity var(--t) var(--ease);
    }
    .send:hover:not(:disabled) { background: var(--accent-hover); }
    .send:disabled { opacity: .4; cursor: not-allowed; }
    /* 停止按钮（任务进行中替换发送按钮的位置） */
    .stop {
      background: transparent; color: var(--danger);
      border: 1px solid var(--border-strong); border-radius: var(--r-pill);
      padding: 0 16px; height: 36px; cursor: pointer; font-size: 13.5px; font-weight: 500;
      flex-shrink: 0; transition: background var(--t) var(--ease), border-color var(--t) var(--ease);
    }
    .stop:hover:not(:disabled) { background: var(--danger-soft); border-color: var(--danger); }
    .stop:disabled { opacity: .5; cursor: not-allowed; }

    /* ---------------- v0.73「按住说话」 ---------------- */
    /* 麦克风按钮沿用 .icon-btn 的尺寸，只加录音态与不可用态两种外观。
       touch-action:none 是**必需**的：不写的话手指按住往上滑会被浏览器判成页面滚动，
       pointermove 收不全、还会直接抛 pointercancel——「上滑取消」就永远做不出来。
       user-select/-webkit-touch-callout 关掉长按选中与 iOS 的长按菜单，
       否则在手机上按住 300ms 就弹出「拷贝／查询」，录音手势被系统抢走。 */
    .mic-btn {
      touch-action: none; user-select: none; -webkit-user-select: none;
      -webkit-touch-callout: none;
    }
    .mic-btn.rec { color: var(--danger); background: var(--danger-soft); }
    /* 不可用态（环境不支持录音）：**保持可见但明显灰掉**。刻意不隐藏——
       客户在微信里看不到按钮只会来问「说话呢」，看到一个灰的、点一下告诉他
       为什么用不了，比凭空消失好交代。 */
    .mic-btn.mic-off { opacity: .38; }
    .mic-btn.mic-off:hover { color: var(--faint); background: transparent; }

    /* 录音浮层：固定在视口底部、盖在 composer 上方。position:fixed 而不是塞进
       footer 流内，是为了它出现/消失时**不撑动 composer 的高度**——录音中输入框
       跳一下会让人以为点错了。 */
    #voiceHud {
      position: fixed; left: 50%; transform: translateX(-50%);
      bottom: 104px; z-index: 70; display: none;
      flex-direction: column; align-items: center; gap: 9px;
      background: var(--elev); border: 1px solid var(--border);
      border-radius: var(--r-lg); box-shadow: var(--sh-3);
      padding: 14px 20px 12px; min-width: 208px; max-width: min(88vw, 320px);
      pointer-events: none;  /* 浮层绝不吃掉手势：指针事件全归麦克风按钮 */
    }
    #voiceHud.show { display: flex; }
    /* 取消态：整个浮层转成危险色，一眼看出「现在松手是取消不是发送」 */
    #voiceHud.cancel { border-color: var(--danger); }
    .vh-time { font-size: 20px; font-weight: 600; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
    #voiceHud.cancel .vh-time { color: var(--danger); }
    /* 音量条：7 根，高度由 JS 按 RMS 实时改。有反馈客户才知道「它真在听」，
       没反馈的录音条和一个假动画没有区别。 */
    .vh-wave { display: flex; align-items: center; gap: 3px; height: 26px; }
    .vh-bar {
      width: 3px; height: 4px; border-radius: 2px; background: var(--accent);
      transition: height .08s linear;
    }
    #voiceHud.cancel .vh-bar { background: var(--danger); }
    .vh-tip { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.5; }
    #voiceHud.cancel .vh-tip { color: var(--danger); }
    /* 识别中：把波形换成一句静态提示，避免「还在录」的错觉 */
    #voiceHud.busy .vh-wave, #voiceHud.busy .vh-time { display: none; }
    .file-chip img.thumb { width: 20px; height: 20px; object-fit: cover; border-radius: 4px; display: block; }
    .hint {
      /* 含金融免责声明，必须读得清：用二级文字色而不是三级。 */
      color: var(--muted); font-size: 11.5px; margin: 9px auto 0; text-align: center;
      line-height: 1.6; max-width: 776px;
    }

    /* ---------------- 弹窗 / 抽屉 ---------------- */
    .ov, #hkOverlay, #memOverlay, #dcOverlay, #ctOverlay {
      position: fixed; inset: 0; background: var(--overlay-bg);
      backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
      display: none; align-items: flex-start; justify-content: center; z-index: 80;
      padding: 48px 16px; overflow-y: auto;
    }
    #hkOverlay.show, #memOverlay.show, #ctOverlay.show, #dcOverlay.show, .ov.show { display: flex; }
    .hk-modal {
      background: var(--elev);
      border: 1px solid var(--border); border-radius: var(--r-xl);
      width: 100%; max-width: 640px; padding: 20px 22px; display: flex; flex-direction: column; gap: 14px;
      box-shadow: var(--sh-3); animation: modalIn .22s var(--ease);
    }
    @keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
    .hk-modal h2 {
      margin: 0; font-size: 15.5px; font-weight: 600; letter-spacing: .01em;
      display: flex; justify-content: space-between; align-items: center; gap: 10px;
    }
    .hk-close {
      background: transparent; border: none; color: var(--faint); font-size: 14px; cursor: pointer;
      width: 28px; height: 28px; border-radius: var(--r-xs); line-height: 1; flex: none;
      transition: color var(--t) var(--ease), background var(--t) var(--ease);
    }
    .hk-close:hover { color: var(--text); background: var(--surface-2); }
    .hk-form {
      display: flex; flex-direction: column; gap: 9px; background: var(--bg-subtle);
      border: 1px solid var(--border); border-radius: var(--r); padding: 14px;
    }
    .hk-form .row { display: flex; gap: 8px; }
    .hk-form input, .hk-form textarea, .hk-form select,
    .login-card input, .wx-code-box input {
      background: var(--surface); color: var(--text); border: 1px solid var(--border);
      border-radius: var(--r-sm); padding: 8px 11px; font-size: 13px; flex: 1; min-width: 0;
      transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
    }
    .hk-form textarea { resize: vertical; min-height: 54px; line-height: 1.55; }
    .hk-form input:focus, .hk-form textarea:focus, .hk-form select:focus { outline: none; border-color: var(--border-accent); box-shadow: var(--ring); }
    .hk-form input::placeholder, .hk-form textarea::placeholder { color: var(--faint); }
    .hk-form select { cursor: pointer; }
    .hk-form .create-btn, .create-btn {
      background: var(--accent); color: var(--on-accent); border: none; border-radius: var(--r-pill);
      padding: 8px 16px; cursor: pointer; font-size: 13px; font-weight: 500; align-self: flex-start;
      transition: background var(--t) var(--ease), opacity var(--t) var(--ease);
    }
    .create-btn:hover:not(:disabled) { background: var(--accent-hover); }
    .create-btn:disabled { opacity: .45; cursor: not-allowed; }
    .hk-list { display: flex; flex-direction: column; gap: 8px; max-height: 44vh; overflow-y: auto; }
    .hk-item {
      border: 1px solid var(--border); border-radius: var(--r); padding: 11px 13px;
      background: var(--surface); transition: border-color var(--t) var(--ease);
    }
    .hk-item:hover { border-color: var(--border-strong); }
    .hk-item.disabled { opacity: .55; }
    .hk-row { display: flex; align-items: center; gap: 8px; }
    .hk-name { font-weight: 500; font-size: 13.5px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .hk-prompt { color: var(--muted); font-size: 12.5px; margin: 6px 0 0; word-break: break-word; line-height: 1.6; }
    .hk-btn {
      background: var(--surface); color: var(--muted); border: 1px solid var(--border);
      border-radius: var(--r-xs); padding: 4px 10px; cursor: pointer; font-size: 12px; flex-shrink: 0;
      transition: border-color var(--t) var(--ease), background var(--t) var(--ease), color var(--t) var(--ease);
    }
    .hk-btn:hover { border-color: var(--border-strong); background: var(--surface-2); color: var(--text); }
    .hk-btn.run { color: var(--accent); }
    .hk-btn.run:hover { border-color: var(--border-accent); background: var(--accent-soft); color: var(--accent); }
    .hk-btn.del:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
    .hk-btn.ct-armed, .ct-armed { background: var(--accent); color: var(--on-accent); border-color: transparent !important; }
    .hk-btn.ct-armed:hover, .ct-armed:hover { background: var(--accent-hover); color: var(--on-accent); }
    .hk-scheds { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
    .hk-sched {
      display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--muted);
      border-top: 1px solid var(--border); padding-top: 8px;
    }
    .hk-task-id { color: var(--text); font-size: 11.5px; font-weight: 600; }
    .hk-next { flex-basis: 100%; color: var(--muted); }
    .hk-sched code, .hk-form code {
      background: var(--surface-2); border: 1px solid var(--border);
      padding: 1px 6px; border-radius: 5px; color: var(--text); font-size: 11.5px;
    }
    .hk-status { font-size: 11px; padding: 1px 8px; border-radius: var(--r-xs); border: 1px solid var(--border); color: var(--muted); }
    .hk-status.ok { color: var(--ok); border-color: rgba(var(--daily-rgb), var(--tint-bd)); }
    .hk-status.err { color: var(--danger); border-color: var(--danger); }
    .hk-status.skip { color: var(--warn); border-color: rgba(var(--finance-rgb), var(--tint-bd)); }
    .hk-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 18px; line-height: 1.7; }

    /* 定时任务：列表是主界面，创建表单仅在需要时展开。全部限定在 #hkOverlay，
       避免影响复用 .hk-modal / .hk-form / .hk-list 的其他管理面板。 */
    #hkOverlay .hk-task-modal { max-width: 760px; gap: 18px; }
    #hkOverlay .hk-panel-head {
      display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
    }
    #hkOverlay .hk-panel-head h2 { display: block; font-size: 20px; line-height: 1.25; }
    #hkOverlay .hk-panel-subtitle { margin-top: 6px; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
    #hkOverlay .hk-head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
    #hkOverlay .hk-create-toggle {
      min-height: 36px; padding: 0 14px; border: 1px solid var(--border-accent);
      border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent);
      font-size: 12.5px; font-weight: 600; cursor: pointer;
      transition: background var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease);
    }
    #hkOverlay .hk-create-toggle:hover, #hkOverlay .hk-create-toggle.active {
      background: var(--accent); border-color: var(--accent); color: var(--on-accent);
    }
    #hkOverlay .hk-close { width: 36px; height: 36px; font-size: 16px; }
    #hkOverlay .hk-panel-status {
      position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
      overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
    }
    #hkOverlay .hk-create-panel[hidden] { display: none !important; }
    #hkOverlay .hk-create-panel {
      gap: 14px; padding: 16px; border-color: var(--border-strong); background: var(--bg-subtle);
    }
    #hkOverlay .hk-create-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
    #hkOverlay .hk-create-heading > div { display: flex; flex-direction: column; gap: 4px; }
    #hkOverlay .hk-create-heading b { color: var(--text); font-size: 14px; }
    #hkOverlay .hk-create-heading span { color: var(--muted); font-size: 12px; line-height: 1.5; }
    #hkOverlay .hk-create-cancel {
      border: 0; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; padding: 3px 0;
    }
    #hkOverlay .hk-create-cancel:hover { color: var(--text); }
    #hkOverlay .hk-create-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
    #hkOverlay .hk-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
    #hkOverlay .hk-field > span { color: var(--text); font-size: 12px; font-weight: 550; }
    #hkOverlay .hk-field small { color: var(--faint); font-size: 10.5px; font-weight: 400; }
    #hkOverlay .hk-field-wide { grid-column: 1 / -1; }
    #hkOverlay .hk-field-rule { grid-column: 1 / 2; }
    #hkOverlay .hk-field input, #hkOverlay .hk-field textarea, #hkOverlay .hk-field select {
      width: 100%; min-height: 42px; padding: 10px 12px; box-sizing: border-box;
    }
    #hkOverlay .hk-field textarea { min-height: 82px; }
    #hkOverlay .hk-create-submit { display: flex; align-items: end; }
    #hkOverlay .hk-create-submit .create-btn { width: 100%; min-height: 42px; align-self: auto; }
    #hkOverlay .hk-create-footnote { color: var(--muted); font-size: 11.5px; line-height: 1.55; }

    #hkOverlay .hk-list { gap: 12px; max-height: 58vh; }
    #hkOverlay .hk-task-card {
      padding: 18px; border-color: var(--border); border-radius: var(--r-lg);
      box-shadow: 0 1px 2px rgba(16, 24, 40, .03);
    }
    #hkOverlay .hk-task-card:hover { border-color: var(--border-strong); }
    #hkOverlay .hk-task-row { align-items: flex-start; gap: 18px; }
    #hkOverlay .hk-task-copy { flex: 1; min-width: 0; }
    #hkOverlay .hk-task-title-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
    #hkOverlay .hk-name {
      flex: 0 1 auto; color: var(--text); font-size: 15px; font-weight: 650;
      overflow: visible; text-overflow: clip; white-space: normal; line-height: 1.45;
    }
    #hkOverlay .hk-team-chip {
      flex: none; padding: 2px 8px; border-radius: var(--r-pill); background: var(--surface-2);
      color: var(--muted); font-size: 10.5px; line-height: 1.5;
    }
    #hkOverlay .hk-prompt { margin-top: 7px; font-size: 12.5px; line-height: 1.55; }
    #hkOverlay .hk-task-actions { display: flex; align-items: center; gap: 7px; flex: none; }
    #hkOverlay .hk-btn { min-height: 34px; padding: 6px 12px; }
    #hkOverlay .hk-btn:disabled { opacity: .5; cursor: wait; }
    #hkOverlay .hk-scheds { margin-top: 15px; gap: 10px; }
    #hkOverlay .hk-sched {
      display: flex; align-items: center; justify-content: space-between; flex-wrap: nowrap; gap: 18px;
      padding-top: 14px; color: var(--muted);
    }
    #hkOverlay .hk-sched-info { flex: 1; min-width: 0; }
    #hkOverlay .hk-sched-title-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
    #hkOverlay .hk-schedule-rule { color: var(--text); font-size: 13.5px; font-weight: 600; line-height: 1.45; }
    #hkOverlay .hk-task-state {
      padding: 2px 8px; border-radius: var(--r-pill); font-size: 10.5px; font-weight: 600;
      border: 1px solid var(--border); background: var(--surface-2);
    }
    #hkOverlay .hk-task-state.running { color: var(--ok); border-color: rgba(var(--daily-rgb), var(--tint-bd)); background: rgba(var(--daily-rgb), var(--tint)); }
    #hkOverlay .hk-task-state.paused { color: var(--muted); }
    #hkOverlay .hk-task-state.error { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
    #hkOverlay .hk-sched-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 12px; margin-top: 7px; }
    #hkOverlay .hk-next { flex-basis: auto; color: var(--muted); }
    #hkOverlay .hk-task-id { color: var(--faint); font-size: 11px; font-weight: 500; }
    #hkOverlay .hk-status { font-size: 10.5px; }
    #hkOverlay .hk-task-toggle { min-width: 68px; }
    #hkOverlay .hk-task-toggle.retry { color: var(--danger); border-color: var(--danger); }

    #hkOverlay .hk-empty-state {
      min-height: 250px; display: flex; flex-direction: column; align-items: center; justify-content: center;
      gap: 8px; padding: 32px 20px; border: 1px dashed var(--border-strong); border-radius: var(--r-lg);
      background: var(--bg-subtle);
    }
    #hkOverlay .hk-empty-state .hk-empty-icon { color: var(--accent); font-size: 34px; line-height: 1; }
    #hkOverlay .hk-empty-state b { color: var(--text); font-size: 15px; }
    #hkOverlay .hk-empty-state > span:not(.hk-empty-icon) { max-width: 360px; }
    #hkOverlay .hk-empty-state .hk-create-toggle { margin-top: 7px; }
    #hkOverlay .hk-empty-state small { color: var(--faint); font-size: 11px; }

    /* 记忆 */
    .mem-kind {
      font-size: 11px; padding: 1px 8px; border-radius: var(--r-xs); flex-shrink: 0; font-weight: 500;
      color: var(--muted); background: var(--surface-2); border: 1px solid var(--border);
    }
    .mem-kind.preference { color: var(--daily); background: rgba(var(--daily-rgb), var(--tint)); border-color: rgba(var(--daily-rgb), var(--tint-bd)); }
    .mem-kind.fact { color: var(--research); background: rgba(var(--research-rgb), var(--tint)); border-color: rgba(var(--research-rgb), var(--tint-bd)); }
    .mem-kind.feedback { color: var(--finance); background: rgba(var(--finance-rgb), var(--tint)); border-color: rgba(var(--finance-rgb), var(--tint-bd)); }
    .mem-meta { color: var(--faint); font-size: 11.5px; margin-left: 4px; }

    /* 每日内容 */
    .dc-item {
      display: flex; gap: 14px; border: 1px solid var(--border); border-radius: var(--r);
      padding: 12px 13px; background: var(--surface); align-items: flex-start;
      transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
    }
    .dc-item:hover { border-color: var(--border-strong); box-shadow: var(--sh-1); }
    .dc-cover { width: 104px; height: 68px; object-fit: cover; border-radius: var(--r-sm); flex-shrink: 0; background: var(--surface-2); }
    .dc-body { flex: 1; min-width: 0; }
    .dc-col {
      font-size: 11px; padding: 1px 8px; border-radius: var(--r-xs); font-weight: 500;
      color: var(--ai); background: var(--ai-soft); border: 1px solid var(--ai-border);
    }
    .dc-title { font-weight: 600; margin: 8px 0 4px; font-size: 14.5px; }
    .dc-title a { color: var(--text); text-decoration: none; }
    .dc-title a:hover { color: var(--accent); }
    .dc-sum { color: var(--muted); font-size: 12.5px; line-height: 1.6; }
    .dc-meta { color: var(--faint); font-size: 11.5px; margin-top: 6px; }
    /* v0.63：卡片上的超管操作（编辑 / 删除）与栏目设置列表行。租户视角不渲染这些。 */
    .dc-ops { display: flex; gap: 6px; margin-top: 8px; }
    .dc-col-row {
      border: 1px solid var(--border); border-radius: var(--r); padding: 10px 11px;
      background: var(--surface); display: flex; flex-direction: column; gap: 6px;
    }
    .dc-col-row.off { opacity: .62; }
    .dc-col-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
    .dc-col-name { font-weight: 600; font-size: 13.5px; }
    .dc-col-key { font-size: 11px; color: var(--faint); }
    .dc-col-info { font-size: 11.5px; color: var(--muted); line-height: 1.6; word-break: break-word; }
    .dc-col-ops { display: flex; gap: 6px; margin-left: auto; }

    /* 自建团队 / 工具勾选 */
    .ct-tools { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 2px 0; }
    .ct-tools label { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text); cursor: pointer; }
    .ct-sec { font-size: 11.5px; color: var(--faint); margin: 12px 0 4px; letter-spacing: .06em; font-weight: 600; }
    /* v0.47 C：「我的团队」配置页的引导件——四步指引条、模板按钮、带说明的字段标签。 */
    .ct-steps { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 10px 0 2px; }
    .ct-steps span { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); }
    .ct-steps b {
      display: inline-flex; align-items: center; justify-content: center;
      width: 16px; height: 16px; border-radius: var(--r-pill);
      background: var(--accent-soft); color: var(--accent); font-size: 10.5px; font-weight: 700;
    }
    .ct-tpl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 2px; }
    .ct-tpl-hint { font-size: 11.5px; color: var(--muted); }
    .ct-field { display: flex; flex-direction: column; gap: 4px; }
    .ct-label { font-size: 12px; color: var(--text); font-weight: 600; }
    .ct-help { font-weight: 400; color: var(--muted); font-size: 11px; margin-left: 6px; }
    .ct-trigger { font-size: 11px; color: var(--muted); margin-top: 2px; }
    input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }

    /* v0.53 A：团队成员编制（可增删排序的角色行）。 */
    .ct-roles { display: flex; flex-direction: column; gap: 8px; }
    .ct-role {
      border: 1px solid var(--border); border-radius: var(--r); padding: 8px 9px;
      background: var(--bg-subtle); display: flex; flex-direction: column; gap: 6px;
    }
    .ct-role-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
    .ct-role-idx { font-size: 11px; color: var(--faint); min-width: 30px; }
    .ct-role-head input { flex: 1; min-width: 110px; }
    .ct-role-ops { display: flex; gap: 4px; }
    .ct-role-ops .hk-btn { padding: 3px 8px; font-size: 11.5px; }
    .ct-role textarea { min-height: 54px; }
    .ct-role-add { align-self: flex-start; margin-top: 2px; }
    .ct-chain { font-size: 11px; color: var(--accent); margin-top: 2px; }

    /* v0.53 B：就地校验——字符计数、字段级红字、表单顶部错误摘要。不再用 alert。 */
    .ct-count { font-size: 11px; color: var(--faint); margin-left: auto; font-variant-numeric: tabular-nums; }
    .ct-count.over { color: var(--danger); font-weight: 600; }
    .ct-err { font-size: 11.5px; color: var(--danger); margin-top: 2px; display: none; }
    .ct-err.on { display: block; }
    .ct-field.bad > input, .ct-field.bad > textarea { border-color: var(--danger); }
    .ct-role.bad { border-color: var(--danger); }
    .ct-form-err {
      display: none; border: 1px solid var(--danger); background: var(--danger-soft);
      color: var(--danger); border-radius: var(--r); padding: 8px 10px;
      font-size: 12px; line-height: 1.6; margin: 10px 0 0;
    }
    .ct-form-err.on { display: block; }

    /* v0.53 C：启停状态徽章与操作按钮分离——徽章只报状态，按钮恒为动词。 */
    .hk-badge {
      font-size: 11px; padding: 1px 7px; border-radius: var(--r-pill);
      background: var(--accent-soft); color: var(--accent); font-weight: 600; white-space: nowrap;
    }
    .hk-badge.off { background: var(--surface-3); color: var(--muted); }

    /* ============================================================
       v0.59 团队工作室 —— 左「对话共创 / 表单」双页签 + 右实时流程图。
       客户反馈：建团队一上来就是长表单太劝退。改成 Dify 式：左边跟顾问聊，
       右边同步把团队结构画出来；不想聊的人切「表单」还是原来那套字段。
       纯 CSS + 内联 SVG，零外部依赖；浅/深色共用同一组变量。
       ============================================================ */
    .ct-studio { max-width: min(1200px, 94vw); }
    .ct-head-ops { display: flex; align-items: center; gap: 8px; }
    .ct-studio-body { display: flex; gap: 16px; align-items: flex-start; }
    .ct-studio-left { flex: 1 1 55%; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
    .ct-studio-right { flex: 1 1 45%; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
    .ct-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
    .ct-tab {
      background: transparent; border: none; border-bottom: 2px solid transparent;
      color: var(--muted); padding: 7px 13px; font-size: 13px; cursor: pointer;
      border-radius: var(--r-xs) var(--r-xs) 0 0;
      transition: color var(--t) var(--ease), background var(--t) var(--ease);
    }
    .ct-tab:hover { color: var(--text); background: var(--surface-2); }
    .ct-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
    .ct-pane { display: none; flex-direction: column; gap: 10px; }
    .ct-pane.on { display: flex; }
    .ct-studio-foot {
      display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
      border-top: 1px solid var(--border); padding-top: 10px;
    }
    .ct-studio-foot .create-btn { align-self: auto; }

    /* 对话共创：与主聊天区同源的简化气泡 */
    .ct-chat {
      border: 1px solid var(--border); border-radius: var(--r); background: var(--bg-subtle);
      padding: 12px; display: flex; flex-direction: column; gap: 9px;
      min-height: 220px; max-height: 44vh; overflow-y: auto;
    }
    .ct-msg { display: flex; }
    .ct-msg.user { justify-content: flex-end; }
    .ct-bubble {
      max-width: 88%; border-radius: var(--r-lg); padding: 8px 12px; font-size: 13px;
      line-height: 1.65; background: var(--surface); border: 1px solid var(--border);
      color: var(--text); white-space: pre-wrap; word-break: break-word;
    }
    .ct-msg.user .ct-bubble { background: var(--accent); color: var(--on-accent); border-color: transparent; }
    .ct-chat-empty { color: var(--muted); font-size: 12.5px; line-height: 1.75; }
    .ct-seeds { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
    .ct-seed { text-align: left; white-space: normal; line-height: 1.5; }
    .ct-typing { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
    .ct-spin {
      width: 13px; height: 13px; border-radius: 50%; flex: none;
      border: 2px solid var(--border-strong); border-top-color: var(--accent);
      animation: ctSpin .8s linear infinite;
    }
    @keyframes ctSpin { to { transform: rotate(360deg); } }
    .ct-chat-input { display: flex; gap: 8px; align-items: flex-end; }
    .ct-chat-input textarea {
      flex: 1; min-width: 0; min-height: 46px; resize: vertical; line-height: 1.55;
      background: var(--surface); color: var(--text); border: 1px solid var(--border);
      border-radius: var(--r-sm); padding: 8px 11px; font-size: 13px; font-family: inherit;
      transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
    }
    .ct-chat-input textarea:focus { outline: none; border-color: var(--border-accent); box-shadow: var(--ring); }
    .ct-chat-input textarea::placeholder { color: var(--faint); }
    .ct-chat-err {
      display: none; align-items: center; gap: 8px; flex-wrap: wrap;
      border: 1px solid var(--danger); background: var(--danger-soft); color: var(--danger);
      border-radius: var(--r); padding: 7px 10px; font-size: 12px; line-height: 1.6;
    }
    .ct-chat-err.on { display: flex; }

    /* v0.60：技能过滤条（搜索 + 分类 + 来源分组）。生态目录种进来两百多条之后，
       没有过滤器这个列表就是不可用的——所以搜索框是功能而不是装饰。 */
    .sk-filter {
      display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
      margin: 0 0 8px;
    }
    .sk-filter input[type=search], .sk-filter select {
      background: var(--surface); color: var(--text); border: 1px solid var(--border);
      border-radius: var(--r-sm); padding: 6px 10px; font-size: 12.5px; font-family: inherit;
      transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
    }
    .sk-filter input[type=search] { flex: 1 1 190px; min-width: 0; }
    .sk-filter input[type=search]:focus, .sk-filter select:focus {
      outline: none; border-color: var(--border-accent); box-shadow: var(--ring);
    }
    .sk-filter input[type=search]::placeholder { color: var(--faint); }
    .sk-count { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
    .sk-count.over { color: var(--danger); font-weight: 600; }
    .sk-src {
      font-size: 10.5px; padding: 0 6px; border-radius: var(--r-pill);
      background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
      white-space: nowrap;
    }
    .sk-cat {
      font-size: 10.5px; padding: 0 6px; border-radius: var(--r-pill); font-weight: 600;
      background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong);
      white-space: nowrap;
    }

    /* 技能勾选区（表单页签内） */
    .ct-skills { display: flex; flex-direction: column; gap: 6px; }
    .ct-skill {
      display: flex; gap: 9px; align-items: flex-start; cursor: pointer;
      border: 1px solid var(--border); border-radius: var(--r-sm);
      padding: 7px 9px; background: var(--surface);
      transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
    }
    .ct-skill:hover { border-color: var(--border-strong); background: var(--surface-2); }
    .ct-skill input { margin-top: 2px; flex: none; }
    .ct-skill-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
    .ct-skill-name { font-size: 12.5px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
    .ct-skill-desc { font-size: 11.5px; color: var(--muted); line-height: 1.55; word-break: break-word; }
    .ct-ver {
      font-size: 10.5px; padding: 0 6px; border-radius: var(--r-pill); font-weight: 600;
      background: var(--ai-soft); color: var(--ai); border: 1px solid var(--ai-border);
    }
    .ct-scope {
      font-size: 10.5px; padding: 0 6px; border-radius: var(--r-pill); font-weight: 500;
      background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
    }

    /* v0.64B 3：对话里的技能推荐 chips（挂在助手回复下方，可勾选后一键带进团队表单） */
    .skill-sug {
      margin-top: 8px; padding: 10px 12px; border: 1px solid var(--border);
      border-radius: var(--r-sm); background: var(--bg-subtle);
    }
    .skill-sug-h { font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }
    .skill-sug-chips { display: flex; flex-wrap: wrap; gap: 6px; }
    .skill-chip {
      font: inherit; font-size: 11.5px; line-height: 1.5; cursor: pointer;
      padding: 4px 10px; border-radius: var(--r-pill); text-align: left;
      border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
      transition: border-color var(--t) var(--ease), background var(--t) var(--ease),
                  color var(--t) var(--ease);
    }
    .skill-chip:hover { border-color: var(--ai-border); background: var(--surface-2); }
    .skill-chip.on {
      background: var(--ai-soft); color: var(--ai); border-color: var(--ai-border); font-weight: 600;
    }

    /* ---- 流程图（内联 SVG；编辑器右栏与系统团队详情共用同一渲染器）---- */
    .ct-flow-wrap {
      border: 1px solid var(--border); border-radius: var(--r); background: var(--bg-subtle);
      padding: 10px; overflow: auto; max-height: 64vh;
    }
    .ct-flow-wrap svg { display: block; margin: 0 auto; }
    .ct-flow-tip { color: var(--muted); font-size: 12px; text-align: center; margin-top: 8px; line-height: 1.6; }
    .ctf { font-family: inherit; }
    .ctf-card { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1; }
    .ctf-card.trigger { fill: var(--accent-soft); stroke: var(--border-accent); }
    .ctf-card.pm { fill: var(--ai-soft); stroke: var(--ai-border); }
    .ctf-card.deliver { fill: var(--surface-2); stroke: var(--border-strong); }
    .ctf-card.ghost { fill: none; stroke: var(--border-strong); stroke-dasharray: 5 4; opacity: .6; }
    .ctf-title { fill: var(--text); font-size: 12.5px; font-weight: 600; }
    .ctf-tag { fill: var(--faint); font-size: 10.5px; }
    .ctf-sub { fill: var(--muted); font-size: 11px; }
    .ctf-link { fill: none; stroke: var(--border-strong); stroke-width: 1.4; }
    .ctf-arrow { fill: var(--border-strong); stroke: none; }
    .ctf-badge { fill: var(--surface-2); stroke: var(--border); stroke-width: 1; }
    .ctf-badge.skill { fill: var(--ai-soft); stroke: var(--ai-border); }
    .ctf-badge.kb { fill: var(--accent-soft); stroke: var(--border-accent); }
    .ctf-btext { fill: var(--muted); font-size: 10.5px; }
    .ctf-btext.skill { fill: var(--ai); }
    .ctf-btext.kb { fill: var(--accent); }

    /* ---- ⚡ 技能库面板 ---- */
    .skill-item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
    .skill-pre {
      background: var(--code-bg); color: var(--code-text); border: 1px solid var(--code-border);
      border-radius: var(--r-sm); padding: 10px 12px; font-size: 11.5px; line-height: 1.7;
      font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
      white-space: pre-wrap; word-break: break-word; max-height: 240px; overflow: auto; margin: 8px 0 0;
    }
    .skill-rev { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
    .skill-revs { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; border-top: 1px solid var(--border); padding-top: 8px; }

    /* ---- 系统团队「查看内部实现」抽屉 ---- */
    .bt-tools { display: flex; flex-direction: column; gap: 6px; }
    .bt-tool { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text); flex-wrap: wrap; }
    .bt-native { font-size: 10.5px; padding: 0 6px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
    .bt-role { border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px 10px; background: var(--surface); }
    .bt-role-name { font-size: 12.5px; font-weight: 600; color: var(--text); }
    .bt-role-duty { font-size: 11.5px; color: var(--muted); line-height: 1.6; margin-top: 3px; }

    /* 窄屏：双栏降级为上下堆叠，流程图区域自身横向滚动，杜绝页面横向溢出。 */
    @media (max-width: 859px) {
      .ct-studio-body { flex-direction: column; gap: 14px; }
      .ct-studio-left, .ct-studio-right { flex: 1 1 auto; width: 100%; }
      .ct-chat { max-height: 40vh; }
      .ct-flow-wrap { max-height: 46vh; -webkit-overflow-scrolling: touch; }
      .ct-tab { padding: 7px 10px; font-size: 12.5px; }
      .ct-studio-foot { position: sticky; bottom: 0; background: var(--elev); z-index: 1; padding-bottom: 4px; }
    }

    /* 租户管理 */
    .tm-tenant {
      border: 1px solid var(--border); border-radius: var(--r); padding: 12px 13px;
      background: var(--surface); display: flex; flex-direction: column; gap: 9px;
    }
    .tm-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
    .tm-name { font-weight: 600; font-size: 13.5px; }
    .tm-contact { color: var(--muted); font-size: 12px; }
    .tm-teams { display: flex; flex-wrap: wrap; gap: 7px 14px; }
    .tm-teams label { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text); cursor: pointer; }
    .tm-save { align-self: flex-start; }
    .wx-code-actions { display: flex; gap: 8px; flex-wrap: wrap; }
    .wx-code-box {
      background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--r);
      padding: 16px 18px; display: flex; flex-direction: column; gap: 12px;
    }
    .wx-code {
      font-size: 28px; letter-spacing: .18em; font-weight: 600; color: var(--accent);
      font-family: "SFMono-Regular", Consolas, monospace;
    }
    /* v0.72 扫码接入 */
    .wx-scan-box { display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; }
    .wx-qr-frame {
      width: 220px; height: 220px; display: flex; align-items: center; justify-content: center;
      background: #fff; border: 1px solid var(--border); border-radius: var(--r); padding: 10px;
    }
    .wx-qr-frame img { width: 100%; height: 100%; image-rendering: pixelated; }
    .wx-scan-state { font-size: 13.5px; color: var(--text); min-height: 20px; }
    .wx-scan-sub { font-size: 12px; color: var(--muted); }
    .wx-scan-ok { color: var(--accent); font-weight: 600; }
    .wx-scan-err { color: var(--danger); }
    .wx-legacy-toggle {
      background: none; border: none; padding: 0; cursor: pointer;
      color: var(--muted); font-size: 12.5px; text-decoration: underline; align-self: flex-start;
    }

    /* 💰 用量与成本 */
    .us-seg { display: flex; gap: 6px; margin-bottom: 2px; }
    .us-seg-on { background: var(--accent) !important; color: var(--on-accent) !important; border-color: transparent !important; }
    .us-summary { color: var(--muted); font-size: 12.5px; margin: 0 0 10px; }
    .us-summary b { color: var(--text); font-weight: 600; }
    .us-table-wrap { overflow-x: auto; }
    .us-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 560px; }
    .us-table th {
      text-align: left; color: var(--muted); font-weight: 500; font-size: 11.5px;
      padding: 6px 10px; border-bottom: 1px solid var(--border); white-space: nowrap;
    }
    .us-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
    .us-table tr.us-tenant-row { cursor: pointer; }
    .us-table tr.us-tenant-row:hover { background: var(--surface-2); }
    .us-table td.us-amt { font-weight: 600; color: var(--text); }
    .us-arrow { display: inline-block; color: var(--muted); transition: transform .15s var(--ease); }
    .us-arrow.open { transform: rotate(90deg); }
    .us-sub-row td { padding: 0; border-bottom: 1px solid var(--border); }
    .us-sub-wrap { padding: 4px 10px 12px 28px; background: var(--bg-subtle); }
    .us-sub-table { width: 100%; border-collapse: collapse; font-size: 12px; }
    .us-sub-table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 11px; padding: 5px 8px; white-space: nowrap; }
    .us-sub-table td { padding: 5px 8px; color: var(--muted); white-space: nowrap; }
    .us-unpriced-tag {
      display: inline-block; margin-left: 6px; font-size: 10.5px; color: var(--muted);
      background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-xs); padding: 0 5px;
    }
    .us-price-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
    .us-price-name { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .us-price-row input { flex: none; width: 96px; }
    .us-price-row input.us-price-name-input { flex: 1; width: auto; min-width: 0; }

    /* 📊 交互分析（v0.64B）：表格沿用 .us-table，这里只加成功率着色与横条 */
    .ix-ok { color: var(--ok); font-weight: 600; }
    .ix-bad { color: var(--danger); font-weight: 600; }
    .ix-na { color: var(--faint); }
    .ix-bar-row { display: flex; align-items: center; gap: 10px; font-size: 12px; margin-bottom: 6px; }
    .ix-bar-label { flex: none; width: 116px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .ix-bar { flex: 1; min-width: 40px; height: 8px; background: var(--surface-2); border-radius: var(--r-pill); overflow: hidden; }
    .ix-bar i { display: block; height: 100%; background: var(--accent); border-radius: var(--r-pill); }
    .ix-bar-num { flex: none; min-width: 116px; text-align: right; color: var(--text); }

    /* 🗂 对话记录（v0.66）：列表沿用 .us-table，这里只加来源角标与消息条 */
    .cl-src { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: var(--r-pill); font-size: 11px; line-height: 17px; background: var(--surface-2); color: var(--muted); }
    .cl-src-wx { background: var(--accent-soft); color: var(--accent); }
    .cl-cut { display: inline-block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
    .us-table tr.cl-row { cursor: pointer; }
    .us-table tr.cl-row:hover { background: var(--surface-2); }
    .cl-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
    .cl-who { color: var(--muted); font-size: 12.5px; }
    .cl-who b { color: var(--text); font-weight: 600; }
    .cl-list { max-height: 56vh; overflow-y: auto; }
    .cl-msg { border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; margin-bottom: 8px; background: var(--surface); }
    .cl-msg.cl-user { background: var(--bg-subtle); }
    .cl-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-bottom: 5px; }
    .cl-role { font-weight: 600; color: var(--text); }
    /* 原文一字不改地展示：pre-wrap 保留换行，break-word 防长链接把弹窗撑爆 */
    .cl-text { font-family: inherit; font-size: 13px; line-height: 1.75; color: var(--text); white-space: pre-wrap; word-break: break-word; margin: 0; }
    .cl-pager { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
    /* 翻到头的按钮要看起来点不动——本项目 .hk-btn 没有 disabled 态，这里就地补上 */
    .cl-pager .hk-btn:disabled { opacity: .45; cursor: not-allowed; }
    .cl-pager .hk-btn:disabled:hover { border-color: var(--border); background: var(--surface); color: var(--muted); }

    /* ---------------- 登录门 ---------------- */
    #app { display: none; min-height: 100vh; width: 100%; }
    #app.ready { display: flex; }
    #loginGate {
      position: fixed; inset: 0; display: none; align-items: center; justify-content: center;
      background: var(--bg-subtle); z-index: 100; padding: 24px; overflow: auto;
    }
    #loginGate.show { display: flex; }
    /* 极淡网格背景，替代原来的紫色大光斑（去 AI 感第 1 条） */
    #loginGate::before {
      content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
      background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
      background-size: 44px 44px;
      mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 78%);
      -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 78%);
      opacity: .8;
    }
    .login-card {
      position: relative; z-index: 1;
      width: 100%; max-width: 380px;
      background: var(--surface);
      border: 1px solid var(--border); border-radius: var(--r-xl); padding: 30px 28px;
      display: flex; flex-direction: column; gap: 13px;
      box-shadow: var(--sh-3); animation: modalIn .3s var(--ease);
    }
    .login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 2px; }
    .login-logo {
      width: 42px; height: 42px; border-radius: 11px; background: #fff;
      display: flex; align-items: center; justify-content: center; overflow: hidden;
      border: 1px solid var(--border); box-shadow: var(--sh-1); flex-shrink: 0;
    }
    .login-brand h1 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: .1em; }
    .login-brand .sub { color: var(--muted); font-size: 12px; display: block; margin-top: 2px; letter-spacing: .04em; }
    .login-slogan { color: var(--muted); font-size: 12.5px; line-height: 1.7; margin: -2px 0 4px; }
    .login-back-link { display: inline-block; margin-top: 8px; color: var(--accent); font-size: 12px; text-decoration: none; }
    .login-back-link:hover { text-decoration: underline; }
    .login-tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 3px; border-radius: var(--r-sm); }
    .login-tab {
      flex: 1; background: transparent; color: var(--muted); border: none;
      border-radius: var(--r-xs); padding: 7px 0; cursor: pointer; font-size: 13px; font-weight: 500;
      transition: background var(--t) var(--ease), color var(--t) var(--ease);
    }
    .login-tab.active { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }
    .login-tab:not(.active):hover { color: var(--text); }
    .login-tip { color: var(--muted); font-size: 12px; margin: -2px 0 2px; line-height: 1.6; }
    .login-card label { font-size: 12px; color: var(--muted); margin-bottom: -7px; }
    .login-card input { padding: 10px 12px; font-size: 14px; border-radius: var(--r-sm); }
    .login-card input:focus { outline: none; border-color: var(--border-accent); box-shadow: var(--ring); }
    .login-card .login-btn {
      background: var(--accent); color: var(--on-accent); border: none; border-radius: var(--r-pill);
      padding: 11px 12px; cursor: pointer; font-size: 14px; font-weight: 500; margin-top: 6px;
      transition: background var(--t) var(--ease), opacity var(--t) var(--ease);
    }
    .login-card .login-btn:hover:not(:disabled) { background: var(--accent-hover); }
    .login-card .login-btn:disabled { opacity: .5; cursor: not-allowed; }
    .login-err { color: var(--danger); font-size: 12px; min-height: 14px; margin: -6px 0 -4px; }
    /* v0.47 A：注册邮箱验证码——输入框 + 「获取验证码」按钮同排（375px 下也不换行挤压）。 */
    .reg-code-row { display: flex; gap: 8px; align-items: stretch; }
    .reg-code-row input { flex: 1; min-width: 0; }
    .reg-code-btn {
      flex: 0 0 auto; white-space: nowrap; background: var(--surface); color: var(--accent);
      border: 1px solid var(--border-accent); border-radius: var(--r-sm);
      padding: 10px 12px; font-size: 13px; font-family: inherit; cursor: pointer;
      transition: background var(--t) var(--ease), opacity var(--t) var(--ease);
    }
    .reg-code-btn:hover:not(:disabled) { background: var(--accent-soft); }
    .reg-code-btn:disabled { opacity: .5; cursor: not-allowed; color: var(--muted); border-color: var(--border); }
    /* v0.73：卡片底部的次要文字链（「忘记密码？」/「← 返回登录」）。用 button 而不是
       <a> —— 它们在表单里，<a href="#"> 会污染 URL，button 还能天然 type="button" 避免
       误触发表单提交。 */
    .login-foot { display: flex; justify-content: center; margin-top: -2px; }
    .login-link {
      background: none; border: none; padding: 2px 4px; cursor: pointer;
      color: var(--muted); font-size: 12px; font-family: inherit;
      transition: color var(--t) var(--ease);
    }
    .login-link:hover { color: var(--accent); text-decoration: underline; }
    /* 登录页主题切换（右上角） */
    #loginThemeBtn {
      position: absolute; top: 18px; right: 18px; z-index: 2;
      background: transparent; border: 1px solid var(--border); color: var(--muted);
      width: 32px; height: 32px; border-radius: var(--r-sm); cursor: pointer;
      display: flex; align-items: center; justify-content: center; padding: 0;
      transition: color var(--t) var(--ease), border-color var(--t) var(--ease);
    }
    #loginThemeBtn:hover { color: var(--text); border-color: var(--border-strong); }

    /* ---------------- 图片灯箱 ---------------- */
    #lightbox {
      position: fixed; inset: 0; z-index: 300; display: none; align-items: center; justify-content: center;
      background: rgba(10, 10, 12, .82); backdrop-filter: blur(4px); padding: 24px; cursor: zoom-out;
    }
    #lightbox.show { display: flex; animation: modalIn .18s var(--ease); }
    #lightbox img { max-width: 94vw; max-height: 92vh; border-radius: var(--r-sm); box-shadow: var(--sh-3); }

    /* ---------------- 移动侧栏遮罩 ---------------- */
    #navScrim { display: none; position: fixed; inset: 0; background: var(--overlay-bg); z-index: 35; }

    /* ============================================================
       响应式：手机端（<= 860px / <= 480px）
       ============================================================ */
    @media (max-width: 1080px) {
      .tool-btn .lbl { display: none; }
      .tool-btn { padding: 6px; }
      /* 左侧导航必须始终保留文字；上面的收缩规则只服务顶栏图标。 */
      #sidebar .tool-btn .lbl { display: inline; }
    }
    @media (max-width: 860px) {
      #sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; width: 82vw; max-width: 300px;
        transform: translateX(-100%); transition: transform .26s var(--ease);
        box-shadow: var(--sh-3); z-index: 40;
      }
      #app.nav-open #sidebar { transform: none; }
      #app.nav-open #navScrim { display: block; }
      .menu-btn { display: inline-flex; }
      header { padding: 0 10px; }
      /* 手机端设置入口已经在抽屉底部：菜单在侧栏内部向上展开，不会被顶栏裁切。 */
      .menu-wrap.side-settings.open .dropdown {
        position: absolute; left: 0; right: 0; top: auto; bottom: calc(100% + 6px);
        min-width: 0; width: auto; max-height: calc(100vh - 108px);
      }
      #whoami .bind-code { display: none; }
      #teamStrip { padding: 8px 14px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
      #teamStrip::-webkit-scrollbar { display: none; }
      #chat { padding: 18px 14px 6px; gap: 16px; }
      .msg { max-width: 92%; }
      footer { padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); }
      .msg-images img { max-width: 46vw; }
      .msg-videos video { max-width: 72vw; }
      .ov, #hkOverlay, #memOverlay, #dcOverlay, #ctOverlay { padding: 0; align-items: stretch; }
      .hk-modal {
        max-width: 100%; min-height: 100vh; border-radius: 0; border: none;
        padding: 16px 14px calc(16px + env(safe-area-inset-bottom)); gap: 13px;
      }
      .hk-modal h2 { position: sticky; top: 0; background: var(--elev); padding: 4px 0; z-index: 1; }
      .hk-list { max-height: none; }
      #hkOverlay .hk-task-modal { min-height: 100dvh; }
      #hkOverlay .hk-panel-head {
        position: sticky; top: 0; z-index: 2; margin: -4px -2px 0; padding: 4px 2px 10px;
        background: var(--elev);
      }
      #hkOverlay .hk-panel-head h2 { position: static; padding: 0; }
      #hkOverlay .hk-close { width: 40px; height: 40px; }
      #hkOverlay .hk-create-toggle { min-height: 40px; }
      .dc-cover { width: 84px; height: 56px; }
      .hint { font-size: 11px; }
      .dropdown { min-width: 176px; }
    }
    @media (max-width: 480px) {
      #sidebar { width: 86vw; }
      #whoami .who-name { max-width: 92px; }
      .login-card { padding: 24px 20px; }
      .login-brand h1 { font-size: 19px; }
      .bubble { font-size: 14px; padding: 10px 13px; }
      .hk-form .row { flex-wrap: wrap; }
      #hkOverlay .hk-panel-head { gap: 10px; }
      #hkOverlay .hk-head-actions { gap: 5px; }
      #hkOverlay .hk-create-toggle { padding: 0 11px; }
      #hkOverlay .hk-create-grid { grid-template-columns: 1fr; }
      #hkOverlay .hk-field-wide, #hkOverlay .hk-field-rule { grid-column: auto; }
      #hkOverlay .hk-task-card { padding: 15px; }
      #hkOverlay .hk-task-row { flex-direction: column; align-items: stretch; gap: 12px; }
      #hkOverlay .hk-task-actions { width: 100%; }
      #hkOverlay .hk-task-actions .hk-btn { flex: 1; min-height: 40px; }
      #hkOverlay .hk-sched { flex-direction: column; align-items: stretch; gap: 12px; }
      #hkOverlay .hk-task-toggle { width: 100%; min-height: 40px; }
      #hkOverlay .hk-empty-state { min-height: 220px; }
      .empty { margin-top: 4vh; font-size: 13px; }
      .welcome-grid { grid-template-columns: 1fr; }
      .welcome-sub { max-width: none; }
      /* v0.73：composer 多了一个麦克风按钮，375px 宽度下把两个图标按钮收窄、
         发送按钮内边距收紧，保证输入框仍有可用宽度、整条不换行不溢出。 */
      .composer { gap: 4px; }
      .icon-btn { width: 30px; height: 32px; }
      .send, .stop { padding: 0 13px; height: 32px; font-size: 13px; }
      textarea { font-size: 14px; padding: 7px 3px; min-height: 32px; }
      #voiceHud { bottom: 96px; padding: 12px 16px 10px; min-width: 176px; }
    }
    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    }

    /* ============================================================
       v0.77 —— PM 控制回路可视化（任务卡 / 交付物面板 / 身份分层）
       参照 Proma 的信息架构，视觉仍守 v0.41 的浅色 Linear 基线：
       发丝边框、单一蓝强调、零 emoji（全内联 SVG）、零大渐变。
       动效只有三项：阶段轨当前段渐变、折叠 500ms、完成 3 秒倒计时。
       ============================================================ */

    /* ---- 1. 任务卡（Run Card） ---- */
    .run-card {
      border: 1px solid var(--border);
      border-radius: var(--r);
      background: var(--bg-subtle);
      padding: 10px 12px;
      margin: 2px 0;
    }
    .run-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
    .run-status { font-weight: 500; color: var(--text); }
    .run-head .tag { margin: 0; }
    /* 计时用 tabular-nums，秒数跳动时宽度不抖 */
    .run-elapsed { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--faint); font-size: 12px; }

    /* 阶段轨：5 段。已完成实线、未来虚线、当前段做一次流动渐变。 */
    .run-rail { display: flex; align-items: center; list-style: none; margin: 9px 0 2px; padding: 0; }
    /* 节点按内容宽（0 1 auto），连接线吃掉所有余量——若给节点 flex:1 1 0 平分，
       中文标签在窄一点的气泡里会立刻被 ellipsis 截成「定…」。 */
    .run-node {
      display: flex; align-items: center; gap: 4px; flex: 0 1 auto; min-width: 0;
      font-size: 11.5px; color: var(--faint); position: relative;
    }
    .run-node > .run-ic { flex: none; width: 1em; text-align: center; font-size: 11px; }
    .run-node > .run-nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .run-node.done { color: var(--ok); }
    .run-node.active { color: var(--ai); font-weight: 500; }
    .run-node.fail { color: var(--danger); }
    /* 连接线画在节点之间（最后一个不画） */
    .run-node:not(:last-child)::after {
      content: ""; flex: 1 1 auto; height: 1px; margin: 0 6px; min-width: 8px;
      background: var(--border-strong);
    }
    .run-node.done:not(:last-child)::after { background: var(--ok); opacity: .45; }
    .run-node.active:not(:last-child)::after {
      background: linear-gradient(90deg, var(--ai), var(--border));
      background-size: 200% 100%; animation: runFlow 1.2s linear infinite;
    }
    @keyframes runFlow { from { background-position: 200% 0; } to { background-position: 0 0; } }
    /* 退回徽记 ↺N —— 琥珀而非红：退回是质量控制，不是错误。
       用真实元素而不是 ::before：伪元素也是 flex item，靠 order 把它排到标签之后
       会连带排到「连接线」之后，徽记就跑到下一个节点头上去了（实测踩过）。 */
    .run-retry {
      color: var(--warn); font-size: 10.5px; font-weight: 600; flex: none;
      font-variant-numeric: tabular-nums;
    }

    /* 分节 */
    .run-sec { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 7px; }
    .run-sec-head {
      display: flex; align-items: center; gap: 6px;
      font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 5px;
    }
    .run-count { color: var(--faint); font-weight: 400; }
    .run-expand {
      margin-left: auto; background: none; border: 0; padding: 0; cursor: pointer;
      color: var(--faint); font-size: 11.5px; font-family: inherit;
    }
    .run-expand:hover { color: var(--accent); }

    /* 验收标准清单：全程同一份 DOM，验收时只改 data-state */
    .run-crit-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
    .run-crit { display: flex; align-items: flex-start; gap: 6px; font-size: 12.5px; color: var(--muted); }
    .run-crit > i { flex: none; width: 1em; text-align: center; font-style: normal; font-size: 11px; line-height: 1.5; }
    .run-crit[data-state="pending"] > i { color: var(--faint); }
    .run-crit[data-state="pass"] > i { color: var(--ok); }
    .run-crit[data-state="pass"] { color: var(--text); }
    .run-crit[data-state="fail"] > i { color: var(--warn); }
    .run-crit[data-state="fail"] { color: var(--text); }
    .run-crit-note { font-style: normal; color: var(--warn); font-size: 11.5px; margin-left: 4px; }
    .run-crit-list.collapsed .run-crit:nth-child(n+5) { display: none; }

    /* 退回历史 */
    .run-round { display: flex; align-items: baseline; gap: 6px; font-size: 12px; color: var(--warn); }
    .run-round + .run-round { margin-top: 3px; }
    .run-round > i { font-style: normal; flex: none; }
    .run-round-t { color: var(--faint); }

    /* ---- 2. 完成后折叠成一行摘要 ---- */
    .run-done { margin: 2px 0; }
    .run-sum {
      display: flex; align-items: center; gap: 6px; width: 100%;
      background: none; border: 0; padding: 2px 0; cursor: pointer;
      font-family: inherit; font-size: 13px; color: var(--muted); text-align: left;
    }
    .run-sum:hover { color: var(--text); }
    .run-sum .run-caret { flex: none; transition: transform var(--t) var(--ease); }
    .run-done.open .run-sum .run-caret { transform: rotate(90deg); }
    .run-sum-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .run-sum-cd { flex: none; color: var(--faint); font-size: 11.5px; font-variant-numeric: tabular-nums; }
    /* 折叠动画：500ms（与 Proma 一致），max-height 足够容纳长清单 */
    .run-body { overflow: hidden; max-height: 0; opacity: 0; transition: max-height .5s var(--ease), opacity .5s var(--ease); }
    .run-done.open .run-body { max-height: 1400px; opacity: 1; }

    /* ---- 3. PM 与团队的身份分层 ---- */
    /* 助手消息挂一条 2px 团队色导轨；PM 用 --ai 紫，团队用各自色。 */
    .msg.assistant[data-lane] { border-left: 2px solid var(--lane-c, var(--border-strong)); padding-left: 10px; }
    .msg.assistant[data-lane="pm"] { border-left-color: var(--ai); }
    /* v0.80 A：说话人统一为项目经理（气泡永远是 pm 导轨），承办团队降级成气泡内
       第一行小字「承办：日常工程师团队 · 项目经理已验收」。v0.77 那条以工程师
       团队为说话人的角色说明就此废止——它正是客户说的「团队直接跟我说话」。 */
    .deliver-by {
      display: flex; align-items: center; gap: 4px;
      font-size: 11px; color: var(--faint); letter-spacing: .02em;
      margin: 0 0 6px; padding-bottom: 5px; border-bottom: 1px solid var(--border);
    }
    .deliver-by .lane-dot { width: 5px; height: 5px; border-radius: var(--r-pill); background: var(--ai); flex: none; }

    /* ---- 4. 交付物面板（右栏 / 窄屏底部抽屉） ---- */
    #deliverPanel {
      flex: none; width: 288px; border-left: 1px solid var(--border);
      background: var(--bg-subtle); display: none; flex-direction: column; min-height: 0;
    }
    #deliverPanel.show { display: flex; }
    .dp-head {
      display: flex; align-items: center; gap: 8px; flex: none;
      padding: 14px 16px 10px; border-bottom: 1px solid var(--border);
      font-size: 13px; font-weight: 600; color: var(--text);
    }
    .dp-count { font-weight: 400; color: var(--faint); font-size: 12px; }
    .dp-close {
      margin-left: auto; background: none; border: 0; cursor: pointer; padding: 2px;
      color: var(--faint); display: inline-flex; border-radius: var(--r-xs);
    }
    .dp-close:hover { color: var(--text); background: var(--border); }
    .dp-list { flex: 1 1 auto; overflow-y: auto; padding: 10px 12px 16px; display: flex; flex-direction: column; gap: 8px; }
    .dp-empty { color: var(--faint); font-size: 12.5px; line-height: 1.7; padding: 8px 4px; }
    .dp-item {
      border: 1px solid var(--border); border-radius: var(--r-sm);
      background: var(--surface); padding: 9px 10px;
    }
    .dp-item-h { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--faint); margin-bottom: 3px; }
    .dp-dot { width: 6px; height: 6px; border-radius: var(--r-pill); background: var(--lane-c, var(--accent)); flex: none; }
    .dp-title { font-size: 12.5px; color: var(--text); line-height: 1.5; margin-bottom: 6px; word-break: break-word; }
    .dp-acts { display: flex; flex-wrap: wrap; gap: 5px; }
    .dp-acts .doc-btn { font-size: 11.5px; padding: 3px 8px; }
    .dp-rounds { color: var(--warn); }

    /* 头部入口按钮上的计数徽标 */
    .dp-badge {
      position: absolute; top: 1px; right: 1px; min-width: 14px; height: 14px;
      border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent);
      font-size: 9.5px; line-height: 14px; text-align: center; padding: 0 3px;
      font-variant-numeric: tabular-nums;
    }

    /* ---- 5. @ 团队指定 —— 可见的 pin（解决静默传参无反馈） ---- */
    .pin-bar { display: flex; align-items: center; gap: 6px; padding: 0 0 6px; font-size: 12px; color: var(--muted); }
    .pin-chip {
      display: inline-flex; align-items: center; gap: 5px;
      border: 1px solid var(--border-accent); background: var(--accent-soft);
      color: var(--accent); border-radius: var(--r-pill); padding: 2px 6px 2px 9px; font-size: 11.5px;
    }
    .pin-x { background: none; border: 0; cursor: pointer; color: inherit; padding: 0 2px; display: inline-flex; opacity: .7; }
    .pin-x:hover { opacity: 1; }
    /* @ 提及浮层锚在 composer 上。position 写在 CSS 而不是标记里的 inline style——
       v0.73 的 composer 片段是别的测试的锚点，标记要保持原样。 */
    .composer { position: relative; }
    .mention-pop {
      position: absolute; z-index: 40; bottom: 100%; left: 0; margin-bottom: 6px;
      min-width: 240px; max-width: 320px; max-height: 260px; overflow-y: auto;
      background: var(--elev); border: 1px solid var(--border-strong);
      border-radius: var(--r); box-shadow: var(--sh-3); padding: 4px;
    }
    .mention-item {
      display: flex; align-items: center; gap: 7px; width: 100%;
      background: none; border: 0; cursor: pointer; text-align: left;
      padding: 6px 8px; border-radius: var(--r-xs); font-family: inherit;
      font-size: 12.5px; color: var(--text);
    }
    .mention-item:hover, .mention-item.on { background: var(--accent-soft); }
    .mention-item .mi-sub { margin-left: auto; font-size: 11px; color: var(--faint); }
    .mention-empty { padding: 8px 10px; font-size: 12px; color: var(--faint); }

    /* ---- 6. 响应式 ---- */
    /* <1100px：右栏改成底部抽屉，不再占横向空间 */
    @media (max-width: 1100px) {
      #deliverPanel {
        position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto;
        max-height: 62vh; z-index: 45; border-left: 0; border-top: 1px solid var(--border-strong);
        border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--sh-3);
        background: var(--elev);
      }
      .dp-list { padding-bottom: 24px; }
    }
    /* 窄屏阶段轨：只显示当前节点，其余收起（避免 5 段挤成一团或溢出） */
    @media (max-width: 560px) {
      .run-node:not(.active) > .run-nm { display: none; }
      .run-node { flex: 0 0 auto; }
      .run-node.active { flex: 1 1 auto; }
      .run-card { padding: 9px 10px; }
      .mention-pop { min-width: 0; left: 0; right: 0; max-width: none; }
    }

    /* ============================================================
       v0.83 客户自助充值
       全部取现有变量（--accent / --border / --surface-*），不另起一套配色。
       唯一刻意放大的元素是**应付金额**：个人收款码没有回调，那个带唯一小数尾数的
       数字是系统识别付款人的唯一凭据，客户随手抹掉零头这笔钱就认不出来了。它必须
       是弹窗里最大、最先被看见的一行——这是功能正确性，不是视觉偏好。
       ============================================================ */

    /* 左侧导航里的充值入口（v0.82 起高频工具都在左栏，这里只补「余额告警」态）。
       形态完全继承 .side-tools .tool-btn，不另起一套按钮样式；额度吃紧/用完时
       整项转成危险色——客户扫一眼左栏就知道该点哪儿，不必先去读余额徽标。 */
    #topupEntry.alarm { color: var(--danger); }
    #topupEntry.alarm .ic { color: var(--danger); }
    #topupEntry.alarm:hover .ic { color: var(--danger); }

    /* 402「额度已用完」那句话后面的行内「去充值」。做成链接样式而不是按钮：
       它长在一段助手气泡的文字里，一颗实心按钮会把那段话撑变形。 */
    .tp-inline-link {
      font: inherit; color: var(--accent); background: none; border: 0;
      padding: 0 2px; cursor: pointer; text-decoration: underline;
      text-underline-offset: 2px;
    }
    .tp-inline-link:hover { color: var(--accent-hover); }

    /* 预设金额 */
    .tp-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
    .tp-preset {
      font: inherit; font-size: 13.5px; font-weight: 600;
      color: var(--text); background: var(--surface); border: 1px solid var(--border);
      border-radius: var(--r); padding: 9px 18px; cursor: pointer;
      transition: border-color var(--t) var(--ease), background var(--t) var(--ease), color var(--t) var(--ease);
    }
    .tp-preset:hover {
      border-color: var(--border-accent); background: var(--accent-soft); color: var(--accent);
    }

    /* 应付金额区 */
    .tp-pay {
      border: 1px solid var(--border-accent); border-radius: var(--r);
      background: var(--accent-soft); padding: 14px 16px; text-align: center; margin-top: 10px;
    }
    .tp-pay-label { font-size: 12.5px; color: var(--muted); }
    .tp-pay-label b { color: var(--danger); font-weight: 600; }
    .tp-amount {
      font-size: 34px; font-weight: 700; color: var(--accent);
      letter-spacing: .01em; line-height: 1.25; margin: 2px 0 4px;
      font-variant-numeric: tabular-nums;
    }
    .tp-why { font-size: 11.5px; color: var(--muted); line-height: 1.7; }
    .tp-why b { color: var(--text); font-weight: 600; }

    /* 收款二维码 */
    .tp-qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 12px 0; }
    .tp-qr {
      width: 190px; height: 190px; object-fit: contain;
      border: 1px solid var(--border); border-radius: var(--r); background: var(--qr-paper); padding: 6px;
    }
    .tp-qr-thumb {
      width: 54px; height: 54px; object-fit: contain; flex: none;
      border: 1px solid var(--border); border-radius: var(--r-xs); background: var(--qr-paper); padding: 3px;
    }
    .tp-meta {
      display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
      font-size: 12px; color: var(--muted); margin-bottom: 8px;
    }
    .tp-meta b { color: var(--text); font-weight: 600; letter-spacing: .04em; }

    /* 后台对账列：应付金额排最前且用等宽数字——超管是拿眼睛在一列数字里找那个和收款
       账单一致的值，等宽对齐才扫得快。 */
    .tp-pay-amount {
      font-size: 15px; font-weight: 700; color: var(--accent); flex: none;
      font-variant-numeric: tabular-nums; min-width: 92px;
    }
    /* 付款人昵称。金额自 2026-08-07 起不再唯一（客户充多少付多少），这个名字成了
       认错人的唯一防线，所以它跟着租户名同行显示、而不是沉到下面那行灰色小字里。 */
    .tp-payer {
      margin-left: 8px; padding: 1px 7px; border-radius: var(--r-xs);
      font-size: 12px; font-weight: 500; color: var(--text);
      background: var(--surface-3); border: 1px solid var(--border);
    }
    /* 没填付款人的单子要显眼地「缺一块」——这是提醒超管去看截图/时刻，别只凭金额确认。 */
    .tp-payer-none { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
    .tp-proof-thumb {
      width: 34px; height: 34px; object-fit: cover; flex: none; cursor: zoom-in;
      border: 1px solid var(--border); border-radius: var(--r-xs);
    }

    /* 状态徽章：沿用 .hk-badge 的形状，只换语义色。 */
    .hk-badge.tp-st-confirmed { background: rgba(var(--daily-rgb), var(--tint)); color: var(--ok); }
    .hk-badge.tp-st-claimed { background: rgba(var(--finance-rgb), var(--tint)); color: var(--warn); }
    .hk-badge.tp-st-rejected { background: var(--danger-soft); color: var(--danger); }
    .hk-badge.tp-st-expired { background: var(--surface-3); color: var(--muted); }

    @media (max-width: 560px) {
      .tp-amount { font-size: 28px; }
      .tp-qr { width: 160px; height: 160px; }
    }
