/* ============================================================================
   四主题（内测）· 2026-11-06
   ----------------------------------------------------------------------------
   生效条件：<html class="theme-preview" data-theme="aurora|compass|midnight|paper">
   明色（无 data-theme）与暗色（data-theme="dark"）完全不受本文件影响：
   所有结构改动都挂在 html.theme-preview 下，令牌改动都挂在 html[data-theme="…"] 下。

   红线：业务单元格的底色由富文本 inline style 决定（.wl-round-content 的
   background-color），本文件**不得**给它或其祖先链加 filter / opacity /
   backdrop-filter / mix-blend-mode，也不得改它的 background。详见
   docs/系统规范_界面主题.md。
   ========================================================================== */

/* ---------------------------------------------------------------- 1. 令牌 */

/* ① 清透 Glass Violet ------------------------------------------------------ */
html[data-theme="aurora"] {
  --bg: #f5f6fd;
  --bg-soft: #f8f9ff;
  --panel: #ffffff;
  --panel-2: #f3f5fc;
  --line: #e8eaf3;
  --line-soft: #eef0f7;
  --line-strong: #d9dff0;
  --text: #151a2e;
  --text-dim: #6f7694;
  --accent: #4f6bfa;
  --accent-soft: #eef1ff;
  --accent-line: #dfe5ff;
  --accent-text: #3d56e0;
  --on-accent: #ffffff;
  --accent-2: #22c1c3;
  --info: #7c5cff;
  --info-soft: #f4f0ff;
  --info-line: #e5dcff;
  --warn: #d9a029;
  --warn-soft: #fff8e8;
  --danger: #e05b73;
  --danger-soft: #fff0f3;
  --ok-soft: #eafaf6;
  --ok-text: #1c8a74;
  --bubble-user: #eef1ff;
  --vm-bg: #f7f8fe;
  --shadow: 0 1px 2px rgba(20, 30, 60, .04), 0 12px 32px -20px rgba(20, 30, 60, .18);
  --shadow-pop: 0 1px 2px rgba(20, 30, 60, .05), 0 26px 60px -30px rgba(20, 30, 60, .34);
  --radius: 14px;
  --r-sm: 9px;
  --r-lg: 20px;
  --overlay: rgba(24, 30, 55, .38);
  --hero-blue: #e4eaff;
  --hero-violet: #efe7ff;
  --hero-mint: #e2f7f2;
  --t-page-bg:
    radial-gradient(1200px 640px at 0% -12%, #cdd9ff 0%, transparent 60%),
    radial-gradient(1000px 580px at 104% -2%, #c6f2ec 0%, transparent 58%),
    radial-gradient(980px 600px at 54% 116%, #e9d6ff 0%, transparent 60%),
    radial-gradient(760px 420px at 92% 86%, #ffdcea 0%, transparent 60%),
    #e7ebfa;
  --t-shell-pad: 18px;
  --t-gap: 14px;
  --t-topbar-h: 46px;
  --t-r-pane: 20px;
  --t-pane-bg: rgba(255, 255, 255, .62);
  --t-pane-line: rgba(255, 255, 255, .85);
  --t-pane-shadow: 0 1px 2px rgba(20, 30, 60, .05), 0 20px 46px -28px rgba(20, 30, 60, .30);
  --t-blur: blur(22px) saturate(1.35);
  --t-rail-bg: rgba(255, 255, 255, .58);
  --t-rail-ink: #1b2434;
  --t-rail-dim: #5c667a;
  --t-rail-active: #ffffff;
  --t-rail-active-ink: #3d56e0;
  --t-rail-line: rgba(40, 60, 110, .10);
  --t-vm-bg: rgba(255, 255, 255, .60);
  --t-topbar-bg: rgba(255, 255, 255, .56);
  --t-kpi-1: linear-gradient(135deg, #eef0ff 0%, #f7f5ff 100%);
  --t-kpi-2: linear-gradient(135deg, #e7f8f6 0%, #f2fdfb 100%);
  --t-kpi-3: linear-gradient(135deg, #fdeef6 0%, #fff6fa 100%);
  --t-kpi-line: rgba(79, 107, 250, .12);
  --t-kpi-num: #1d2a55;
  --t-grad: linear-gradient(135deg, #4f6bfa 0%, #7c5cff 100%);
}

/* ② 罗盘 Compass ----------------------------------------------------------- */
html[data-theme="compass"] {
  --bg: #f4f6fa;
  --bg-soft: #f8fafd;
  --panel: #ffffff;
  --panel-2: #f3f5fa;
  --line: #e9ecf4;
  --line-soft: #eff2f8;
  --line-strong: #d8dfec;
  --text: #1c2434;
  --text-dim: #7d879b;
  --accent: #4f6bfa;
  --accent-soft: #eef2ff;
  --accent-line: #dbe3ff;
  --accent-text: #3d56e0;
  --on-accent: #ffffff;
  --accent-2: #169f8a;
  --info: #7c5cff;
  --info-soft: #f4f0ff;
  --info-line: #e5dcff;
  --warn: #cf8f1f;
  --warn-soft: #fff7e7;
  --danger: #dc5a70;
  --danger-soft: #fff0f2;
  --ok-soft: #eaf8f3;
  --ok-text: #1a846d;
  --bubble-user: #eef2ff;
  --vm-bg: #fbfcfe;
  --shadow: 0 1px 2px rgba(20, 30, 60, .04), 0 14px 32px -22px rgba(20, 30, 60, .18);
  --shadow-pop: 0 1px 2px rgba(20, 30, 60, .04), 0 22px 48px -28px rgba(20, 30, 60, .30);
  --radius: 12px;
  --r-sm: 8px;
  --r-lg: 16px;
  --overlay: rgba(20, 28, 48, .40);
  --hero-blue: #e6ecff;
  --hero-violet: #efe9ff;
  --hero-mint: #e3f6f2;
  --t-page-bg: #eef1f7;
  --t-shell-pad: 10px;
  --t-gap: 10px;
  --t-topbar-h: 44px;
  --t-r-pane: 14px;
  --t-pane-bg: rgba(255, 255, 255, .78);
  --t-pane-line: rgba(255, 255, 255, .72);
  --t-pane-shadow: 0 1px 2px rgba(20, 30, 60, .04), 0 16px 36px -26px rgba(20, 30, 60, .22);
  --t-blur: blur(20px) saturate(1.25);
  --t-rail-bg: #1b2b4b;
  --t-rail-ink: #e8edff;
  --t-rail-dim: #93a0c0;
  --t-rail-active: rgba(255, 255, 255, .12);
  --t-rail-active-ink: #ffffff;
  --t-rail-line: rgba(255, 255, 255, .10);
  --t-vm-bg: rgba(255, 255, 255, .72);
  --t-topbar-bg: rgba(255, 255, 255, .62);
  --t-kpi-1: linear-gradient(135deg, #2b3f7a 0%, #5b4293 100%);
  --t-kpi-2: linear-gradient(135deg, #22345f 0%, #3d548c 100%);
  --t-kpi-3: linear-gradient(135deg, #3a2f6e 0%, #6a4f9e 100%);
  --t-kpi-line: rgba(255, 255, 255, .16);
  --t-kpi-num: #ffffff;
  --t-kpi-ink: rgba(255, 255, 255, .74);
  --t-grad: linear-gradient(105deg, #27376b 0%, #4a3c86 56%, #6f5bd8 100%);
}

/* ③ 夜幕 Midnight Glass ---------------------------------------------------- */
html[data-theme="midnight"] {
  --bg: #0c1018;
  --bg-soft: #101622;
  --panel: #121a26;
  --panel-2: #18212f;
  --line: rgba(255, 255, 255, .09);
  --line-soft: rgba(255, 255, 255, .06);
  --line-strong: rgba(255, 255, 255, .16);
  --text: #e9edf8;
  --text-dim: #98a4bc;
  --accent: #6d8dff;
  --accent-soft: rgba(109, 141, 255, .16);
  --accent-line: rgba(109, 141, 255, .34);
  --accent-text: #a9bfff;
  --on-accent: #0b1018;
  --accent-2: #22c1c3;
  --info: #a78bfa;
  --info-soft: rgba(167, 139, 250, .14);
  --info-line: rgba(167, 139, 250, .30);
  --warn: #efc171;
  --warn-soft: rgba(239, 193, 113, .12);
  --danger: #f28c9a;
  --danger-soft: rgba(242, 140, 154, .12);
  --ok-soft: rgba(94, 234, 212, .12);
  --ok-text: #86dbbd;
  --bubble-user: #1c2740;
  --vm-bg: #0e141e;
  --shadow: 0 1px 2px rgba(0, 0, 0, .34);
  --shadow-pop: 0 18px 44px rgba(0, 0, 0, .48);
  --radius: 14px;
  --r-sm: 8px;
  --r-lg: 20px;
  --overlay: rgba(0, 0, 0, .66);
  --hero-blue: #1b2a44;
  --hero-violet: #251f3d;
  --hero-mint: #17332f;
  --t-page-bg:
    radial-gradient(900px 480px at 10% -6%, rgba(109, 141, 255, .16) 0%, transparent 60%),
    radial-gradient(800px 420px at 92% 4%, rgba(34, 193, 195, .10) 0%, transparent 58%),
    radial-gradient(760px 420px at 60% 108%, rgba(167, 139, 250, .12) 0%, transparent 60%),
    #090d14;
  --t-shell-pad: 12px;
  --t-gap: 12px;
  --t-topbar-h: 46px;
  --t-r-pane: 18px;
  --t-pane-bg: rgba(255, 255, 255, .035);
  --t-pane-line: rgba(255, 255, 255, .08);
  --t-pane-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 24px 54px -34px rgba(0, 0, 0, .9);
  --t-blur: blur(20px) saturate(1.2);
  --t-rail-bg: rgba(255, 255, 255, .035);
  --t-rail-ink: #e9edf8;
  --t-rail-dim: #8894ad;
  --t-rail-active: linear-gradient(135deg, rgba(109, 141, 255, .26), rgba(167, 139, 250, .20));
  --t-rail-active-ink: #ffffff;
  --t-rail-line: rgba(255, 255, 255, .07);
  --t-vm-bg: rgba(255, 255, 255, .04);
  --t-topbar-bg: rgba(255, 255, 255, .035);
  --t-kpi-1: linear-gradient(135deg, rgba(109, 141, 255, .18), rgba(167, 139, 250, .10));
  --t-kpi-2: linear-gradient(135deg, rgba(34, 193, 195, .16), rgba(109, 141, 255, .08));
  --t-kpi-3: linear-gradient(135deg, rgba(167, 139, 250, .18), rgba(244, 114, 182, .10));
  --t-kpi-line: rgba(255, 255, 255, .12);
  --t-kpi-num: #f2f5ff;
  --t-kpi-ink: #98a4bc;
  --t-grad: linear-gradient(135deg, #6d8dff 0%, #a78bfa 100%);
}

/* ④ 素净 Quiet Paper ------------------------------------------------------- */
html[data-theme="paper"] {
  --bg: #f7f4ee;
  --bg-soft: #faf7f1;
  --panel: #fffdf8;
  --panel-2: #f5efe3;
  --line: #e9e5da;
  --line-soft: #efeae0;
  --line-strong: #ddd5c4;
  --text: #1c1a17;
  --text-dim: #7a7466;
  --accent: #1f3a5f;
  --accent-soft: #e9eef4;
  --accent-line: #d6dfe9;
  --accent-text: #1f3a5f;
  --on-accent: #ffffff;
  --accent-2: #4c6b58;
  --info: #6b5a86;
  --info-soft: #f0ecf4;
  --info-line: #e2dceb;
  --warn: #b07a1a;
  --warn-soft: #fbf4e2;
  --danger: #a8473a;
  --danger-soft: #f9ece8;
  --ok-soft: #edf3ed;
  --ok-text: #3f6b4d;
  --bubble-user: #f2eee4;
  --vm-bg: #faf6ee;
  --shadow: 0 1px 2px rgba(31, 58, 95, .05);
  --shadow-pop: 0 1px 2px rgba(31, 58, 95, .06), 0 18px 34px -26px rgba(31, 58, 95, .30);
  --radius: 8px;
  --r-sm: 6px;
  --r-lg: 10px;
  --overlay: rgba(40, 34, 24, .42);
  --hero-blue: #f4efe4;
  --hero-violet: #f1ece2;
  --hero-mint: #eef2e9;
  --t-page-bg:
    radial-gradient(900px 460px at 0% -8%, #f6f1e6 0%, transparent 60%),
    radial-gradient(760px 420px at 100% 0%, #f7f3ea 0%, transparent 58%),
    #f0ebe1;
  --t-shell-pad: 10px;
  --t-gap: 10px;
  --t-topbar-h: 46px;
  --t-r-pane: 8px;
  --t-pane-bg: rgba(255, 253, 248, .84);
  --t-pane-line: rgba(228, 223, 210, .9);
  --t-pane-shadow: 0 1px 2px rgba(31, 58, 95, .05), 0 14px 28px -24px rgba(31, 58, 95, .20);
  --t-blur: blur(18px) saturate(1.12);
  --t-rail-bg: #f6f1e6;
  --t-rail-ink: #1c1a17;
  --t-rail-dim: #7a7466;
  --t-rail-active: #fffdf9;
  --t-rail-active-ink: #1f3a5f;
  --t-rail-line: #e9e5da;
  --t-vm-bg: rgba(250, 246, 238, .8);
  --t-topbar-bg: rgba(247, 244, 238, .66);
  --t-kpi-1: #fffdf9;
  --t-kpi-2: #faf6ee;
  --t-kpi-3: #f4eee2;
  --t-kpi-line: #e9e5da;
  --t-kpi-num: #1f3a5f;
  --t-grad: linear-gradient(135deg, #1f3a5f 0%, #3d5f86 100%);
}

/* 知识库满宽态是 JS 写的内联栅格，用这个变量把缝隙接上主题的 --t-gap */
html.theme-preview { --menu-gap: var(--t-gap); }

/* ---------------------------------------------------------------- 2. 外壳 */

html.theme-preview .shell {
  grid-template-columns: var(--menu-w) var(--t-gap) minmax(0, 1fr) var(--t-gap) var(--vm-width);
  grid-template-rows: var(--t-topbar-h) var(--t-gap) minmax(0, 1fr);
  padding: var(--t-shell-pad);
  background: var(--t-page-bg);
  background-attachment: fixed;
}
html.theme-preview .col-menu,
html.theme-preview .workspace-topbar,
html.theme-preview .col-func,
html.theme-preview .col-vm {
  border-radius: var(--t-r-pane);
  border: 1px solid var(--t-pane-line);
  box-shadow: var(--t-pane-shadow);
  overflow: hidden;
}
html.theme-preview .col-menu { background: var(--t-rail-bg); color: var(--t-rail-ink); }
html.theme-preview .workspace-topbar { background: var(--t-topbar-bg); }
html.theme-preview .col-func { background: var(--t-pane-bg); }
html.theme-preview .col-vm { background: var(--t-vm-bg); }
html.theme-preview .col-func,
html.theme-preview .vm-resizer,
html.theme-preview .col-vm { grid-row: 3; }
/* 玻璃质感：只在支持 backdrop-filter 的浏览器生效，不支持的浏览器回落到纯色面 */
@supports (backdrop-filter: blur(1px)) {
  html.theme-preview .col-menu,
  html.theme-preview .workspace-topbar,
  html.theme-preview .col-vm,
  html.theme-preview .col-func { backdrop-filter: var(--t-blur); }
}
/* 分隔条：换成"缝隙里的一条细线"，hover 才亮 */
html.theme-preview .sidebar-resizer::after,
html.theme-preview .vm-resizer::after { display: none; }
html.theme-preview .sidebar-resizer,
html.theme-preview .vm-resizer { background: transparent; }

/* 知识库满宽态（app.css 的 .shell.kb-full 还写着旧的 4px 轨道）：缝隙统一成 --t-gap，
   并且功能区从第 3 列起，和别的页面左边距完全一致（用户 2026-11-06 反馈「知识库左边距不一样」）。 */
html.theme-preview .shell.kb-full:not(.workspace-hidden) {
  grid-template-columns: var(--menu-w) var(--t-gap) minmax(0, 1fr);
}
html.theme-preview .shell.kb-full:not(.workspace-hidden) .col-func { grid-column: 3 / -1; }
html.theme-preview .shell.kb-full .workspace-topbar { grid-column: 3 / -1; }
/* 窗口级浮层对话：同样是 3 列，缝隙统一 */
html.theme-preview .shell.vm-window { grid-template-columns: var(--menu-w) var(--t-gap) minmax(0, 1fr); }
html.theme-preview .shell.vm-window .workspace-topbar { grid-column: 3 / -1; }
html.theme-preview .shell.vm-window .col-func { grid-column: 3; grid-row: 3; }

/* 收起右侧对话 / 交换左右：列数不同，缝隙保持一致 */
html.theme-preview .shell.vm-collapsed { grid-template-columns: var(--menu-w) var(--t-gap) minmax(0, 1fr); }
html.theme-preview .shell.vm-collapsed .col-func { grid-column: 3; grid-row: 3; }
html.theme-preview .shell.panes-swapped { grid-template-columns: var(--menu-w) var(--t-gap) var(--vm-width) var(--t-gap) minmax(0, 1fr); }
html.theme-preview .shell.panes-swapped .col-vm { grid-column: 3; grid-row: 3; }
html.theme-preview .shell.panes-swapped .col-func { grid-column: 5; grid-row: 3; }
/* 专注对话（工作区隐藏）：保持原布局，只换底色，不做浮层 */
html.theme-preview .shell.workspace-hidden {
  grid-template-columns: var(--menu-w) var(--t-gap) minmax(0, 1fr);
  grid-template-rows: var(--t-topbar-h) var(--t-gap) minmax(0, 1fr);
}
html.theme-preview .shell.workspace-hidden .col-func,
html.theme-preview .shell.workspace-hidden .vm-resizer { display: none; }
html.theme-preview .shell.workspace-hidden .col-vm { grid-column: 3; grid-row: 3; }
html.theme-preview .shell.workspace-hidden .workspace-topbar { grid-column: 3 / -1; grid-row: 1; }
/* 窗口级「呼唤美维斯」浮层：沿用新半径 */
html.theme-preview .shell.vm-window { grid-template-columns: var(--menu-w) var(--t-gap) minmax(0, 1fr); }
html.theme-preview .shell.vm-window .col-func { grid-column: 3; grid-row: 3; }
html.theme-preview .shell.vm-window .workspace-topbar { grid-column: 3 / -1; }
html.theme-preview .shell.vm-window .col-vm { border-radius: var(--t-r-pane); }

/* ---------------------------------------------------------------- 3. 左栏 */

html.theme-preview .col-menu { padding: 14px 10px 10px; }
html.theme-preview .workspace-brand { padding: 0 8px 14px; }
html.theme-preview .brand-name,
html.theme-preview .brand-name small { color: var(--t-rail-ink); }
html.theme-preview .menu-group { color: var(--t-rail-dim); opacity: .9; letter-spacing: .1em; }
html.theme-preview .menu .m-item { color: var(--t-rail-ink); border-radius: calc(var(--t-r-pane) * .42); }
html.theme-preview .menu .m-item i { color: var(--t-rail-dim); }
html.theme-preview .menu .m-item:hover { background: color-mix(in srgb, var(--t-rail-active) 60%, transparent); color: var(--t-rail-ink); }
html.theme-preview .menu .m-item:hover i { color: var(--t-rail-ink); }
html.theme-preview .menu .m-item.active {
  background: var(--t-rail-active);
  color: var(--t-rail-active-ink);
  border-color: transparent;
  box-shadow: 0 1px 2px rgba(10, 20, 45, .10);
  font-weight: 650;
}
html.theme-preview .menu .m-item.active i { color: var(--t-rail-active-ink); }
html.theme-preview .menu .m-item.active::before {
  content: ''; position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 3px; background: var(--t-grad);
}
html.theme-preview .menu .m-item { position: relative; }
/* 暗底左栏（罗盘 / 夜幕）：徽标与底栏配套 */
html.theme-preview .menu .m-item .m-badge { background: rgba(255, 255, 255, .14); color: inherit; }
html.theme-preview .menu-foot { background: transparent; border-top-color: var(--t-rail-line); }
html.theme-preview .menu-foot .who,
html.theme-preview .menu-foot .mf-cap { color: var(--t-rail-dim); }
html.theme-preview .menu-foot .mini-btn,
html.theme-preview .menu-foot .bell { color: var(--t-rail-dim); }
html.theme-preview .menu-foot .mini-btn:hover,
html.theme-preview .menu-foot .bell:hover { color: var(--t-rail-ink); border-color: var(--t-rail-line); }
html[data-theme="compass"] .menu-foot .mini-btn,
html[data-theme="compass"] .menu-foot .bell,
html[data-theme="midnight"] .menu-foot .mini-btn,
html[data-theme="midnight"] .menu-foot .bell { border-color: transparent; }
html.theme-preview .menu-foot .bell b { color: var(--t-rail-active-ink); }

/* ---------------------------------------------------------------- 4. 顶栏 */

html.theme-preview .workspace-topbar { padding: 0 10px; gap: 6px; }
html.theme-preview .workspace-tabs { padding: 8px 0; gap: 4px; }
html.theme-preview .workspace-tab { border-radius: 999px; border-color: transparent; }
html.theme-preview .workspace-tab.active {
  background: var(--panel);
  border-color: var(--line);
  box-shadow: 0 1px 2px rgba(20, 30, 60, .06);
  color: var(--text);
}
html.theme-preview .workspace-tab:not(.active) { color: var(--text-dim); }
html.theme-preview .chrome-btn { border-radius: 999px; }
html.theme-preview .chrome-btn:hover { background: var(--panel-2); }
html.theme-preview .assistant-toggle { border-radius: 999px; }
html.theme-preview .assistant-toggle:hover { background: var(--panel-2); }

/* ---------------------------------------------------------------- 5. 中栏 */

html.theme-preview .col-func { padding: 0; }
html.theme-preview .func-head { padding: 18px 22px 12px; background: transparent; }
html.theme-preview .func-title { font-size: 21px; letter-spacing: -.01em; }
html.theme-preview .page-heading p { font-size: 12px; color: var(--text-dim); }
html.theme-preview .func-body { padding: 0 22px 26px; }
/* 团队项目：自己的顶栏 + 表格 */
html.theme-preview .wl-topbar { padding: 14px 0 10px; }
html.theme-preview .wl-topbar h1 { font-size: 21px; letter-spacing: -.01em; }
html.theme-preview .wl-filters button { border-radius: 999px; }
html.theme-preview .wl-filters .selected { background: var(--accent-soft); }
html.theme-preview .wl-searchbar input,
html.theme-preview .wl-topbar select { border-radius: 999px; }
html.theme-preview .wl-table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--panel);
}
html.theme-preview .wl-table th {
  background: var(--panel-2);
  color: var(--text-dim);
  font-size: 11.5px;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--line);
}
html.theme-preview .wl-table td { border-bottom: 1px solid var(--line-soft); }
html.theme-preview .wl-table tbody tr:hover td { background: color-mix(in srgb, var(--accent-soft) 42%, var(--panel)); }
/* 格子卡外框：只改卡片边框/圆角/表头表脚，**不碰 .wl-round-content 的底色** */
html.theme-preview .wl-round { border-radius: calc(var(--radius) - 2px); border-color: var(--line); box-shadow: none; }
html.theme-preview .wl-round-head { background: var(--panel-2); color: var(--text-dim); }
html.theme-preview .wl-round.is-first .wl-round-head { background: color-mix(in srgb, var(--warn-soft) 78%, var(--panel)); color: var(--warn-text, #8a5a00); }
html.theme-preview .wl-round-foot { background: transparent; }
html.theme-preview .wl-project-link b { font-size: 14px; }
html.theme-preview .wl-lane-empty { border-radius: calc(var(--radius) - 4px); }
/* 表格脚注、说明 */
html.theme-preview .wl-footnote { color: var(--text-dim); }

/* ---------------------------------------------------------------- 6. 右栏 */

html.theme-preview .vm-head { border-bottom: 1px solid var(--line-soft); background: transparent; }
html.theme-preview #vm-persona { font-weight: 650; }
html.theme-preview .vm-greet { border-bottom-color: var(--line-soft); }
html.theme-preview .msg.user .bubble { background: var(--bubble-user); border-radius: 14px 14px 4px 14px; }
html.theme-preview .msg.bot .bubble { background: transparent; }
html.theme-preview .composer-box {
  border-radius: calc(var(--radius) + 6px);
  background: var(--panel);
  border-color: var(--line);
  box-shadow: 0 2px 10px -6px rgba(20, 30, 60, .25);
}
html.theme-preview .composer-box:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
html.theme-preview #chat-send { background: var(--t-grad); border-color: transparent; color: #fff; }
html.theme-preview .conversation-panel { border-radius: var(--radius); }

/* ---------------------------------------------------------------- 7. 控件 */

html.theme-preview .pill { border-radius: calc(var(--radius) - 4px); }
html.theme-preview .pill.primary { background: var(--t-grad); border-color: transparent; color: #fff; box-shadow: 0 6px 16px -10px rgba(20, 30, 60, .5); }
html.theme-preview .ghost-pill { background: var(--panel); border-color: var(--line); color: var(--text); }
html.theme-preview .ghost-pill:hover { border-color: var(--accent-line); }
html.theme-preview input,
html.theme-preview select,
html.theme-preview textarea { border-radius: calc(var(--radius) - 4px); background: var(--panel); }
html.theme-preview .chip { border-radius: 999px; }
html.theme-preview .panel { border-radius: var(--radius); box-shadow: var(--shadow); }

/* 8. 团队项目统计带：用户 2026-11-06 16:08 要求去掉（四个主题都不要），DOM 与样式一并删除。 */

/* ---------------------------------------------------------------- 9. 左下角主题切换器
   注意：这一段**不加 html.theme-preview 前缀**——默认明色/暗色下也要显示成一个正常的按钮，
   否则用户会看到一个没样式的「默认」二字，以为界面没变（2026-11-06 实测踩到）。 */
html .theme-switch {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  height: 26px; padding: 0 9px 0 6px; margin-left: 2px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); color: var(--text-dim);
  font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
html .theme-switch:hover { border-color: var(--accent-line); color: var(--accent-text); }
html .theme-switch .theme-swatch {
  width: 14px; height: 14px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5);
}
html .theme-switch .ts-caret { font-size: 9px; opacity: .55; margin-left: -2px; }
html .theme-switch[aria-expanded="true"] { border-color: var(--accent); color: var(--accent-text); }
html.theme-preview .theme-switch { border-color: var(--t-rail-line); background: transparent; color: var(--t-rail-ink); }
html.theme-preview .theme-switch:hover { background: color-mix(in srgb, var(--t-rail-active) 55%, transparent); color: var(--t-rail-ink); }
html.sidebar-collapsed .theme-switch { padding: 0 6px; }
html.sidebar-collapsed .theme-switch #theme-nm,
html.sidebar-collapsed .theme-switch .ts-caret { display: none; }

.theme-pop {
  position: fixed; z-index: 200; width: 300px; padding: 10px;
  border-radius: 16px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text);
  box-shadow: var(--shadow-pop);
}
.theme-pop.hidden { display: none; }
.tp-head { padding: 6px 8px 10px; }
.tp-head b { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.tp-head b i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tp-head small { display: block; margin-top: 4px; font-size: 11px; color: var(--text-dim); }
.tp-list { display: grid; gap: 3px; }
.tp-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.tp-item:hover { background: var(--panel-2); }
.tp-item.is-on { background: var(--accent-soft); border-color: var(--accent-line); }
.tp-dots { display: flex; gap: 3px; flex: 0 0 auto; }
.tp-dots i { width: 12px; height: 12px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(20, 30, 60, .14); }
.tp-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tp-txt b { font-size: 12.5px; font-weight: 650; display: flex; align-items: baseline; gap: 6px; }
.tp-txt b small { font-size: 10px; font-weight: 500; color: var(--text-dim); letter-spacing: .04em; }
.tp-txt > span { font-size: 11px; color: var(--text-dim); }
.tp-check { margin-left: auto; width: 16px; height: 16px; flex: 0 0 16px; border-radius: 50%; border: 1.5px solid var(--line-strong); }
.tp-item.is-on .tp-check { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 0 44%, transparent 46%); }

/* 工作概览：主线/辅助线入口卡在 app.css 里写死了白底深字，暗色主题下读不了；
   这里统一换成令牌（明色主题下视觉不变）。 */
html.theme-preview .ov-entry {
  background: var(--panel);
  border-color: var(--line);
  color: var(--text);
  box-shadow: none;
}
html.theme-preview .ov-entry:hover { border-color: var(--accent-line); box-shadow: var(--shadow); }
html.theme-preview .ov-entry-k { color: var(--text-dim); }
html.theme-preview .ov-entry b { color: var(--text); }
html.theme-preview .ov-entry-d { color: var(--text-dim); }
html.theme-preview .ov-entry i { color: var(--accent-text); }
/* 业务看板四张统计卡：确保暗色下数字和标签都够亮 */
html.theme-preview .stat .n { color: var(--text); }
html.theme-preview .stat .l,
html.theme-preview .stat small { color: var(--text-dim); }
html.theme-preview .stat.on { background: var(--accent-soft); }

/* ---------------------------------------------------------------- 10. 主题专属细节 */

/* ① 清透：更轻的边框、强调"浮" */
html[data-theme="aurora"].theme-preview .wl-table-wrap { border-color: rgba(255, 255, 255, .8); }
html[data-theme="aurora"].theme-preview .col-menu { border-color: rgba(255, 255, 255, .85); }
html[data-theme="aurora"].theme-preview .workspace-tab.active { background: #fff; border-color: rgba(255, 255, 255, .9); }

/* ② 罗盘：深色壳里的品牌感 */
html[data-theme="compass"].theme-preview .col-menu { border-color: rgba(0, 0, 0, .18); }
html[data-theme="compass"].theme-preview .brand-name small { color: rgba(255, 255, 255, .5); }
html[data-theme="compass"].theme-preview .col-func { border-color: #e6eaf3; }

/* ③ 夜幕：玻璃、发光、去网格 */
html[data-theme="midnight"].theme-preview .wl-table { background: transparent; }
html[data-theme="midnight"].theme-preview .wl-table td { background: transparent; }
html[data-theme="midnight"].theme-preview .wl-table-wrap { background: rgba(255, 255, 255, .02); }
html[data-theme="midnight"].theme-preview .wl-table th { background: rgba(255, 255, 255, .045); backdrop-filter: blur(10px); }
html[data-theme="midnight"].theme-preview .wl-table tbody tr:hover td { background: rgba(255, 255, 255, .035); }
html[data-theme="midnight"].theme-preview .wl-round { border-color: rgba(255, 255, 255, .10); background: rgba(255, 255, 255, .03); }
html[data-theme="midnight"].theme-preview .wl-round-head { background: rgba(255, 255, 255, .06); }
html[data-theme="midnight"].theme-preview .wl-round.is-first .wl-round-head { background: rgba(255, 176, 32, .16); color: #f0c27a; }
html[data-theme="midnight"].theme-preview .wl-round.is-first .wl-round-name { color: #f0c27a; }
html[data-theme="midnight"].theme-preview .msg.user .bubble { color: var(--text); }
html[data-theme="midnight"].theme-preview .pill.primary { color: #0b1018; }
html[data-theme="midnight"].theme-preview #chat-send { color: #0b1018; }

/* ④ 素净：排版当主角，几乎无阴影 */
html[data-theme="paper"].theme-preview .func-title,
html[data-theme="paper"].theme-preview .wl-topbar h1,
html[data-theme="paper"].theme-preview #vm-persona {
  font-family: "Songti SC", "SimSun", Georgia, serif;
  letter-spacing: .01em;
}
html[data-theme="paper"].theme-preview .wl-table { font-size: 13px; }
html[data-theme="paper"].theme-preview .wl-table th { letter-spacing: .14em; font-size: 10.5px; }
html[data-theme="paper"].theme-preview .wl-project-link b { font-family: "Songti SC", "SimSun", Georgia, serif; font-weight: 700; letter-spacing: .01em; }
html[data-theme="paper"].theme-preview .overview-welcome h2,
html[data-theme="paper"].theme-preview .section-caption h3,
html[data-theme="paper"].theme-preview .func-head h2 { font-family: "Songti SC", "SimSun", Georgia, serif; }
html[data-theme="paper"].theme-preview .wl-topbar h1,
html[data-theme="paper"].theme-preview .func-title { font-size: 22px; }
html[data-theme="paper"].theme-preview .wl-table th { color: #8b8371; }
html[data-theme="paper"].theme-preview .wl-table-wrap { border-color: #e4dfd2; }
html[data-theme="paper"].theme-preview .pill.primary { background: #1b1a17; }
html[data-theme="paper"].theme-preview .wl-round { border-radius: 4px; }
html[data-theme="paper"].theme-preview .wl-table-wrap { box-shadow: none; }
html[data-theme="paper"].theme-preview .pill.primary { background: #1b1a17; border-color: #1b1a17; box-shadow: none; }
html[data-theme="paper"].theme-preview #chat-send { background: #1f3a5f; color: #fff; }
