/* ==========================================================================
   OA运营平台 · 视觉层
   --------------------------------------------------------------------------
   设计语言：白卡 + 一像素淡描边 + 大留白 + 单一强调色
             （现代后台风格；装饰降到最低，颜色只用来表达「状态」）

   双轴主题：
     data-theme = light | dark        明暗基底（默认 light）
     data-skin  = indigo | emerald | cyan | violet | rose | graphite
                                      强调色皮肤（默认 indigo）

   两条硬约束（改动前务必读）：
   ① .row-actions 必须是 display:inline-flex、.icon-btn 必须 white-space:nowrap
      —— 否则表格操作列最小宽度会塌缩成「一个按钮」，按钮竖排、行高被撑高。
   ② app.js 会在内联样式里引用这些变量名，不能删：
      --accent --accent-2 --amber --border --card-soft --green --red
      --text --text-dim --text-faint
   ========================================================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }

/* ==========================================================================
   1. 设计令牌 —— 明暗基底
   ========================================================================== */

:root,
body[data-theme="light"] {
  /* —— 表面 —— */
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --surface-3: #f1f3f5;
  --card-soft: #f7f8fa;
  --sidebar-bg: #ffffff;
  --hover-bg: #f2f4f7;
  --input-bg: #ffffff;
  --row-alt: #f8f9fb;
  --row-hover: #eef1f6;
  --pill-gray-bg: #f1f3f5;

  /* —— 描边 —— */
  --border: #e7e9ed;
  --border-strong: #d5d9e0;

  /* —— 文字 —— */
  --text: #101828;
  --text-dim: #5b6472;
  --text-faint: #98a1ad;
  --mono-text: #3b4bd8;

  /* —— 语义色（状态专用）—— */
  --green: #15803d;
  --amber: #b45309;
  --red: #dc2626;
  --violet: #7c3aed;

  /* —— 强调色（皮肤层会覆盖）—— */
  --accent: #4f46e5;
  --accent-hover: #4038cf;
  --accent-fg: #ffffff;
  --accent-soft: #eef0fe;
  --accent-text: #4f46e5;
  --ring: rgba(79, 70, 229, 0.16);
  --accent-2: #0e7490;

  /* 登录页整页底色：一条从左到右的连续渐变（左端满饱和 → 右端几乎褪尽）。
     色标前段刻意保持满饱和，是因为左栏的白色文字压在这一段上，
     太早开始变淡会让小字号要点读不清。 */
  --login-canvas: linear-gradient(90deg,
      var(--accent) 0%,
      var(--accent) 34%,
      color-mix(in srgb, var(--accent) 52%, #ffffff) 60%,
      color-mix(in srgb, var(--accent) 18%, #ffffff) 82%,
      color-mix(in srgb, var(--accent) 4%, #ffffff) 100%);

  /* —— 阴影（极淡，只做层次不做特效）—— */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 14px rgba(16, 24, 40, 0.07);
  --shadow-lg: 0 16px 40px rgba(16, 24, 40, 0.12);

  /* —— 遮罩 / 滚动条 —— */
  --mask: rgba(16, 24, 40, 0.34);
  --scrollbar: rgba(16, 24, 40, 0.17);
  --scrollbar-hover: rgba(16, 24, 40, 0.3);

  /* —— 图表 —— */
  --chart-a: #4f46e5;
  --chart-b: #059669;
  --chart-c: #dc2626;

  /* —— 圆角 —— */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --radius: 14px;

  /* —— 字体 —— */
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", ui-monospace, "JetBrains Mono", "Menlo", "Consolas", monospace;
}

body[data-theme="dark"] {
  --bg: #0f1115;
  --surface: #171a20;
  --surface-2: #1c2027;
  --surface-3: #23272f;
  --card-soft: #1c2027;
  --sidebar-bg: #14171c;
  --hover-bg: #23272f;
  --input-bg: #1c2027;
  --row-alt: #1b1f27;
  --row-hover: #272c36;
  --pill-gray-bg: #23272f;

  --border: #262b33;
  --border-strong: #3a414b;

  --text: #e9ebee;
  --text-dim: #9ba4b0;
  /* 暗色下的次要文字色。
     ⚠️ 原值 #6d7681 在暗色面板（--surface-2/#1c2027、--surface-3/#23272f）上只有
     3.55~4.1 的对比度，低于 WCAG AA 的 4.5 —— 表现为「暗黑模式下所有小字都发灰看不清」
     （表头 .lb、.muted、.stat-sub、.done-sub、.brand-sub、版本号等，全站 60+ 处）。
     改成 #8b949e 后在最深的面板底上也有 ≈4.87，四类面板全部达标；层级仍保持
     faint < dim(#9ba4b0) < text(#e9ebee)。浅色层不动，避免顺带改掉浅色的视觉重量。 */
  --text-faint: #8b949e;
  --mono-text: #a5b4fc;

  --green: #4ade80;
  --amber: #fbbf24;
  --red: #f87171;
  --violet: #a78bfa;

  --accent: #4f46e5;
  --accent-hover: #6366f1;
  --accent-fg: #ffffff;
  --accent-soft: rgba(99, 102, 241, 0.15);
  --accent-text: #a5b4fc;
  --ring: rgba(129, 140, 248, 0.25);
  --accent-2: #22d3ee;

  /* 夜间版：往 --bg 里混（基色换成深底），方向与含义完全一致 */
  --login-canvas: linear-gradient(90deg,
      var(--accent) 0%,
      var(--accent) 34%,
      color-mix(in srgb, var(--accent) 55%, var(--bg)) 60%,
      color-mix(in srgb, var(--accent) 20%, var(--bg)) 82%,
      color-mix(in srgb, var(--accent) 4%, var(--bg)) 100%);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 18px 46px rgba(0, 0, 0, 0.55);

  --mask: rgba(5, 7, 10, 0.62);
  --scrollbar: rgba(255, 255, 255, 0.16);
  --scrollbar-hover: rgba(255, 255, 255, 0.28);

  --chart-a: #818cf8;
  --chart-b: #34d399;
  --chart-c: #f87171;
}

/* 未标注主题时的兜底（等同浅色）。
   ⚠️ color-scheme 的作用对象是**根元素**：只写在 body 上时，视口滚动条与部分原生控件
   仍可能按浅色绘制（暗色下会突出一条亮滚动条）。所以 html 和 body 两处都要给。 */
html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
body { color-scheme: light; }
body[data-theme="dark"] { color-scheme: dark; }

/* ==========================================================================
   2. 皮肤 —— 只负责强调色（浅色模式）
   ========================================================================== */

body[data-skin="indigo"] {
  --accent: #4f46e5; --accent-hover: #4038cf;
  --accent-soft: #eef0fe; --accent-text: #4f46e5;
  --ring: rgba(79, 70, 229, 0.16);
  --accent-2: #0e7490;
}
body[data-skin="emerald"] {
  --accent: #059669; --accent-hover: #047857;
  --accent-soft: #e9f7f1; --accent-text: #047857;
  --ring: rgba(5, 150, 105, 0.16);
  --accent-2: #0f766e;
}
body[data-skin="cyan"] {
  --accent: #0e7490; --accent-hover: #155e75;
  --accent-soft: #e9f4f8; --accent-text: #0e7490;
  --ring: rgba(14, 116, 144, 0.16);
  --accent-2: #4f46e5;
}
body[data-skin="violet"] {
  --accent: #7c3aed; --accent-hover: #6d28d9;
  --accent-soft: #f3efff; --accent-text: #6d28d9;
  --ring: rgba(124, 58, 237, 0.16);
  --accent-2: #db2777;
}
body[data-skin="rose"] {
  --accent: #e11d48; --accent-hover: #be123c;
  --accent-soft: #fdeef2; --accent-text: #be123c;
  --ring: rgba(225, 29, 72, 0.15);
  /* v1.51.22：原来是 `#b45309`（= 浅色主题的 `--amber`）—— 与语义色**同值**，
     仪表盘「成本回收」环的两段因此同色、看不出分界（用户 2026-10-13 报）。
     换成粉（pink-600）：与主色 rose(#e11d48) 有色相差，也不再撞任何语义色。 */
  --accent-2: #db2777;
}
body[data-skin="graphite"] {
  --accent: #334155; --accent-hover: #1e293b;
  --accent-soft: #eef0f3; --accent-text: #334155;
  --ring: rgba(51, 65, 85, 0.18);
  --accent-2: #0e7490;
}

/* --------------------------------------------------------------------------
   皮肤（**浅色专属**）：底色微调 + 等宽文字色
   🔴 为什么必须限定 `:not([data-theme="dark"])`：
      `--bg` / `--surface-2` / `--border` / `--border-strong` / `--mono-text`
      都是「**跟明暗走**」的变量，深色模式由 `body[data-theme="dark"]` 统一接管。
      从前这三套（emerald / rose / graphite）的底色直接写在 `body[data-skin="x"]` 里 ——
      它与 `body[data-theme="dark"]` 的**特异性相同、位置在后**，于是**深色下反被浅色值覆盖**：
      `--border` 变成 #e4ebe7 / #ece5e8 / #e5e7e9 这种**极浅色**，
      在暗底上把全站 55 处边框描成亮线（用户 2026-10-08 报的「深色下 3 个配色显示异常」）；
      `--mono-text` 同理会留在深色（#3b4bd8 之类）而看不清。
   ⛔ 以后新增皮肤：**强调色族**（--accent / -hover / -soft / -text / --ring / --accent-2）
      可以留在 `body[data-skin=…]`；**底色族**必须写进下面这一段（浅色专属）。
   -------------------------------------------------------------------------- */
body:not([data-theme="dark"])[data-skin="indigo"]   { --mono-text: #3b4bd8; }
body:not([data-theme="dark"])[data-skin="emerald"]  { --mono-text: #047857;
  /* 松翠：底色带一丝极淡的暖绿 */
  --bg: #f3f6f4; --surface-2: #f8fbf9; --border: #e4ebe7; --border-strong: #d1ddd6; }
body:not([data-theme="dark"])[data-skin="cyan"]     { --mono-text: #0e7490; }
body:not([data-theme="dark"])[data-skin="violet"]   { --mono-text: #6d28d9; }
body:not([data-theme="dark"])[data-skin="rose"]     { --mono-text: #be123c;
  /* 绯樱：暖白底 */
  --bg: #f7f4f5; --surface-2: #fbf8f9; --border: #ece5e8; --border-strong: #dcd1d6; }
body:not([data-theme="dark"])[data-skin="graphite"] { --mono-text: #334155;
  /* 石墨：完全中性的灰阶，几乎无彩 */
  --bg: #f3f4f5; --surface-2: #f9fafb; --border: #e5e7e9; --border-strong: #d2d6da; }

/* 深色模式下把「强调色文字」换成浅色调，保证在暗底上可读 */
body[data-theme="dark"][data-skin="indigo"]   { --accent-hover: #6366f1; --accent-soft: rgba(99,102,241,.16); --accent-text: #a5b4fc; --accent-2: #22d3ee; }
body[data-theme="dark"][data-skin="emerald"]  { --accent-hover: #10b981; --accent-soft: rgba(16,185,129,.16); --accent-text: #6ee7b7; --accent-2: #2dd4bf; --mono-text: #6ee7b7; }
body[data-theme="dark"][data-skin="cyan"]     { --accent-hover: #0891b2; --accent-soft: rgba(8,145,178,.20);  --accent-text: #67e8f9; --accent-2: #818cf8; --mono-text: #67e8f9; }
body[data-theme="dark"][data-skin="violet"]   { --accent-hover: #8b5cf6; --accent-soft: rgba(139,92,246,.18); --accent-text: #c4b5fd; --accent-2: #f472b6; --mono-text: #c4b5fd; }
body[data-theme="dark"][data-skin="rose"]     { --accent-hover: #f43f5e; --accent-soft: rgba(244,63,94,.17);  --accent-text: #fda4af; --accent-2: #f472b6; --mono-text: #fda4af; }
body[data-theme="dark"][data-skin="graphite"] { --accent-hover: #475569; --accent-soft: rgba(148,163,184,.16); --accent-text: #cbd5e1; --accent-2: #67e8f9; --mono-text: #cbd5e1; }

/* ==========================================================================
   3. 基础
   ========================================================================== */

html, body { height: 100%; }

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--accent-soft); color: var(--accent-text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-xs); }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* 旧的动态光晕层已废弃（保留元素但不再渲染，避免动 HTML 结构） */
.bg-orbs { display: none; }
body::before { content: none; }

#app { position: relative; z-index: 1; display: flex; height: 100vh; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-hover); }

/* ==========================================================================
   4. 侧边栏
   ========================================================================== */

.sidebar {
  width: 232px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 20px; }
/* 品牌标志：logo-mark.png 本身是**透明底**的蓝色圆形标志（v37 起），
   原来那层白色圆角底板 + 1px 边框会把标志框住、显得小 —— 用户要求去掉背景、放大 30%。
   放大口径：外框 40 → 52（= 40 × 1.3，加大 30%）；
   同时去掉 4px 内边距与 1px 边框，**实际图案**从约 30px 变成 52px（视觉上比 30% 更明显）。
   ⚠️ 不要再写 background/border：浅色下会重新框住标志；暗色下白底板尤其刺眼。
   ⚠️ 该 PNG 是**纯几何洪水填充**抠的（只抠与画布边缘连通的白色背景），图案内部的
      白色电路走线是**内容**、必须保留。重做透明底请用技能
      `logo-white-bg-to-alpha`（别拿 logo-mark-light.png 的白版 alpha 当蒙版 ——
      那个 alpha 自身是镂空的，会把白走线一起抠掉；也别做羽化，会糊出白晕）。 */
.brand-logo {
  position: relative;
  width: 52px; height: 52px;
  flex-shrink: 0;
  display: grid; place-items: center;
  background: none;
  border: none;
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
/* 旧的霓虹描边层已废弃 */
.brand-logo::after { content: none; }
.brand-logo svg { width: 26px; height: 26px; overflow: visible; }
.brand-name {
  font-size: 15.5px; font-weight: 700; letter-spacing: 0.2px;
  color: var(--text);
}
.brand-sub {
  font-size: 9.5px; color: var(--text-faint);
  margin-top: 3px; letter-spacing: 1.2px; font-weight: 500;
  text-transform: uppercase;
}

/* 旧的 SVG Logo 动画（当前用位图 logo，保留最小定义避免残留引用报错） */
.logo-hex-outer, .logo-hex-inner, .logo-core, .logo-pulse,
.logo-bar, .logo-dot, .logo-orbit, .logo-flow { animation: none; }
.logo-bar { transform-box: fill-box; transform-origin: bottom; }
.logo-core, .logo-orbit { transform-origin: 24px 24px; }

/* —— 主导航 —— */
.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px;
  border: none; border-radius: var(--r-md);
  background: transparent;
  color: var(--text-dim);
  font-size: 13.5px; font-weight: 500;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item::before, .nav-item::after { content: none; }
.nav-item:hover { background: var(--hover-bg); color: var(--text); }
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
}
.nav-item.active .nav-ico { color: var(--accent-text); opacity: 1; }
.nav-item:active { transform: none; }
.nav-ico { width: 18px; text-align: center; font-size: 14px; opacity: 0.85; }

/* —— 悬停动效（用户 2026-09-24 要的「鼠标放上去字体变大 + 有音乐效果」）——
   三条设计约束，改之前先读：
   ① **动效只用 transform**（scale / translate），一律不动 font-size / padding：
      改字号会重排 → 菜单右侧的待办徽标会跟着抖；scale 只改绘制、不动盒模型。
   ② `transform-origin: left center` —— 从文字左端放大，视觉上像「字长大」而不是整块漂移。
   ③ 音效不在这里：它是 app.js 的 `bindHoverSound()`（Web Audio 合成，**不引入任何音频文件**），
      开关 = 侧栏底部 `#btn-sound`，选择记在 localStorage。
   覆盖范围 = 侧栏 11 个菜单项 + 顶栏「外观设置」下拉开合项。
   ⚠️ 原生 `<select>` 展开的选项列表由操作系统绘制，CSS / JS 都碰不到它 ——
      所以「下拉菜单」的动效只能做在**控件本体**上（见下方 `.field-select`，那里已有一条注释）。 */
.nav-item {
  transition: background 0.15s ease, color 0.15s ease, transform 0.16s ease;
  transform-origin: left center;
}
.nav-label { display: inline-block; transition: transform 0.16s ease; }
.nav-item:hover { transform: scale(1.045); }
/* 字比图标多放大一点：用户要的是「对应的字体变大」，图标只是陪衬 */
.nav-item:hover .nav-label { transform: scale(1.07); }
.nav-item:hover .nav-ico { transform: scale(1.06); }
/* 按下时把放大收回去（否则「按下去反而更大」很怪）—— 必须写在 :hover 之后才盖得住 */
.nav-item:active { transform: none; }

/* 顶栏「外观设置」下拉里的两种按钮：模式切换 + 配色格子 */
.seg-toggle button, .theme-skin {
  transition: transform 0.16s ease, background 0.15s ease, color 0.15s ease,
              border-color 0.15s ease;
  transform-origin: center;
}
.seg-toggle button:hover, .theme-skin:hover { transform: scale(1.06); }

/* —— 菜单待办徽标（v37）——
   数字来自 /api/todos，与「点进去的那个列表」同口径（一律不带页面筛选）。
   常显脉冲是用户点名要的「强提醒」：不必去数，扫一眼就知道有事。
   颜色复用语义令牌：待办=琥珀（与「待我审批」统计卡同色）、需重提=红。
   margin-left:auto 把数字推到菜单行最右端，与左侧文字拉开距离。 */
.nav-badge {
  --badge-fg: var(--amber);
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; margin-left: auto; padding: 0 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--badge-fg) 14%, transparent);
  color: var(--badge-fg);
  font-size: 11.5px; font-weight: 700; line-height: 1;
  animation: todoPulse 1.9s ease-out infinite;
}
.nav-badge.is-alert { --badge-fg: var(--red); }
/* ⚠️ 必须显式写：上面的 display 是 (0,1,0)，会盖掉 [hidden] 的 UA 样式 display:none
   —— 不补这条，「0」会永远挂在菜单上（与 .trash-badge 同一个坑）。 */
.nav-badge[hidden] { display: none; }
/* 脉冲只做 box-shadow 扩散环、不缩放数字：缩放会让整行文字跟着抖。 */
@keyframes todoPulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--badge-fg) 60%, transparent); }
  70%  { box-shadow: 0 0 0 6px color-mix(in srgb, var(--badge-fg) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--badge-fg) 0%, transparent); }
}

.sidebar-foot {
  margin-top: auto;
  display: flex; align-items: center; gap: 9px;
  padding: 12px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.foot-title { font-size: 11.5px; color: var(--text-dim); }
.foot-ver { font-size: 10.5px; color: var(--text-faint); margin-top: 2px; font-family: var(--font-mono); }

/* ICP 备案号（主界面侧边栏底部；法律要求展示，且必须可点击跳转工信部）。
   ⚠️ 与 login.html 里的 `.la-icp` 是**同一件事的两处呈现** —— 换备案号时两处一起改。 */
.side-icp {
  margin-top: 8px; text-align: center;
  font-size: 10.5px; line-height: 1.5;
}
.side-icp a {
  color: var(--text-faint); text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.side-icp a:hover { color: var(--text-dim); border-bottom-color: currentColor; }

/* ==========================================================================
   5. 主区域 · 顶栏
   ========================================================================== */

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 15px 26px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.topbar h1 {
  font-size: 18px; font-weight: 700; letter-spacing: 0;
  color: var(--text);
}
.topbar-actions { display: flex; gap: 8px; align-items: center; }

.view { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 18px 26px 44px; }
.view::-webkit-scrollbar { width: 10px; }
.view::-webkit-scrollbar-track { background: transparent; }
.view::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 8px; border: 2px solid var(--bg); }
.modal-body { scrollbar-width: thin; }

/* ==========================================================================
   6. 按钮
   ========================================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px; font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn:hover { background: var(--hover-bg); }

.btn.primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.primary::after { content: none; }

.btn.ghost {
  background: var(--surface);
  color: var(--text-dim);
  border-color: var(--border-strong);
}
.btn.ghost:hover { background: var(--hover-bg); color: var(--text); }

.btn.small { padding: 6px 10px; font-size: 12px; border-radius: var(--r-sm); }

.btn.danger {
  background: var(--surface);
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 40%, transparent);
  border-color: rgba(220, 38, 38, 0.32);
}
body[data-theme="dark"] .btn.danger { border-color: rgba(248, 113, 113, 0.34); }
.btn.danger:hover { background: color-mix(in srgb, var(--red) 8%, var(--surface)); }

.btn.green {
  background: var(--surface);
  color: var(--green);
  border-color: rgba(21, 128, 61, 0.32);
}
body[data-theme="dark"] .btn.green { border-color: rgba(74, 222, 128, 0.32); }
.btn.green:hover { background: color-mix(in srgb, var(--green) 8%, var(--surface)); }

.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.ghost:active, .btn.small:active, .btn.primary:active { transform: none; }

/* —— 主题切换按钮 —— */
.theme-toggle {
  width: 36px; height: 36px; border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border-strong);
  color: var(--text-dim);
  transition: background 0.15s ease, color 0.15s ease;
}
.theme-toggle:hover { background: var(--hover-bg); color: var(--text); }
.theme-toggle svg { width: 16px; height: 16px; }
body[data-theme="light"] .ico-moon { display: none; }
body:not([data-theme="light"]) .ico-sun { display: none; }

/* ==========================================================================
   7. 主题面板（明暗 + 配色）
   ========================================================================== */

.theme-wrap { position: relative; }
.theme-pop {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 200;
  width: 268px; padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  animation: popIn 0.14s ease;
}
.theme-pop[hidden] { display: none; }
.tp-title {
  font-size: 11.5px; font-weight: 700; color: var(--text-faint);
  letter-spacing: 0.6px; text-transform: uppercase;
  margin-bottom: 8px;
}
.tp-sec + .tp-sec { margin-top: 16px; }

.seg-toggle {
  display: flex; gap: 2px; padding: 3px;
  background: var(--surface-3); border-radius: var(--r-md);
}
.seg-toggle button {
  flex: 1; padding: 7px 0;
  border: none; border-radius: 7px; background: transparent;
  color: var(--text-dim); font-size: 12.5px; font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
.seg-toggle button:hover { color: var(--text); }
.seg-toggle button.on {
  background: var(--surface); color: var(--text);
  font-weight: 600; box-shadow: var(--shadow-xs);
}

.theme-skins { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.theme-skin {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 9px 2px 8px;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); cursor: pointer;
  font-size: 11px; color: var(--text-dim); font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.theme-skin:hover { border-color: var(--border-strong); }
.theme-skin .sw { width: 20px; height: 20px; border-radius: 50%; }
.theme-skin.on {
  border-color: var(--accent); background: var(--accent-soft);
  color: var(--accent-text); font-weight: 600;
}

/* ==========================================================================
   8. 卡片
   ========================================================================== */

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.card::before { content: none; }
.card:hover { border-color: var(--border-strong); }
.card-title {
  font-size: 13.5px; font-weight: 700; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
  color: var(--text);
}
/* ⚠️ 墓碑规则（2026-09-22）：界面上的「备注性质提示词」已按用户要求全站删除，
   `.hint` 相关样式（本条 + .done-title .hint + 表单里那条）**故意保留**，
   仅剩 #exp-f-income-hint（动态反馈容器，文案由 JS 写入）还在用 class="hint"。勿当死代码清理。 */
.card-title .hint { font-size: 11px; color: var(--text-faint); font-weight: 400; }
.card-foot {
  font-size: 11px; color: var(--text-faint);
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ==========================================================================
   9. 仪表盘
   ========================================================================== */

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 15px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease;
}
.stat-card::before, .stat-card::after { content: none; }
.stat-card:hover { border-color: var(--border-strong); }
.stat-label { font-size: 11.5px; color: var(--text-dim); }
.stat-value {
  font-family: var(--font-mono); font-size: 19px; font-weight: 700;
  margin-top: 5px; letter-spacing: -0.2px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.stat-sub { font-size: 10.5px; color: var(--text-faint); margin-top: 4px; }

/* —— 其余各页的统计卡（项目管理 / 收支管理 / 我的报销 / 审批中心 / 商机跟进）——
   ⚠️ 这四条**必须逐条并进 `.stat-card`**，少一条就是「功能在、提示没了」的半成品：
      点上去照样开弹窗，但鼠标不变手型、没有「详情 ›」的浮动提示，用户根本不会去点。
   🔴 2026-09-27 重写仪表盘样式时这一组曾被整块删掉；
      **2026-10-05（v1.51.1）删椭圆环那一段时又误删了一次** —— 两次都是
      `test_card_detail.py` 第 2 节当场报红拦回来的。下次再动这一带的样式，
      改完先跑那一节（它判的就是这四条规则在不在）。 */
.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:hover { border-color: var(--border-strong); }
.stat-card .drill {
  float: right; font-size: 10.5px; font-weight: 600;
  color: var(--accent-text); opacity: 0.8;
}
.stat-card.clickable:hover .drill { opacity: 1; }

/* ==========================================================================
   9.1 仪表盘 —— 「静态工作台」（v1.51.1 起）
   --------------------------------------------------------------------------
   v1.50.4~v1.50.7 那一整套「3D 椭圆环 + 自动公转」已**整块删除**：
   几何常量（CF_*）、initDashRing()、fit()、每帧写 --cx/--cz/--a 的 rAF、
   拖动/键盘翻页/resize 重算，在 app.js 里一处不剩；这里对应的 .cf-* 规则也全清了。
   起因是用户 2026-10-05 明确「旋转动画效果取消」，并要求把侧栏那六个业务页
   （审批中心 / 费用报销 / 收支管理 / 商机跟进 / 项目管理 / 客户管理）都露到仪表盘上 ——
   环一次只看得清一张卡，本来就是「转着看」；改成静态工作台才能「一眼全看见」。

   DOM（app.js `dashboardView()` 产出）：
     .dash-hero                       欢迎条（强调色渐变，随皮肤变）
     .dash-sec[data-sec=kpi]          核心指标：.kpi-grid.dash-kpi > .kpi-card × 4
     .dash-sec[data-sec=workbench]    工作台：.mod-grid > .mod-card[data-mod] × 4~6
     .dash-sec.dash-profit            经营与分配细条（.strip > .strip-i × 5，仅老板视角）
     .dash-sec[data-sec=charts]       .dash-grid > .card.chart-card × 3
     .dash-sec[data-sec=trend]        月度趋势（仅 can("expenses")）
     .card.table-card × 2             未完结 / 已完结项目表（表格逻辑一个字没动）

   ⚠️ 这三个类名是**守卫挂点**，别随手改名（改了要同时改夹具/自测）：
      · .dash-kpi     = 核心指标那一组
      · .dash-profit  = 利润与分配那一组。fixture_scope / fixture_groupsplit 按它守
                        「业务员看不到利润数字」—— 业务员整块**不渲染**，所以查不到这个类名
      · .mod-card[data-mod] = 六个模块；夹具按它数「业务员只该看到 4 个模块」
   ⛔ 旧的 .cf-stage / .cf-ring / .cf-card / .cf-hint / .cf-tri / [data-bg] 全部作废，
      连同 static/img/dash/ 下那批背景图一起不再被引用。图**留在磁盘上**（没删），
      回退旧版时还能直接用；CSS 侧不留墓碑规则 —— 它们已经没有任何产物引用了。
   ⛔ 卡片类的「同元素、单类优先级相同 → 只看书写顺序」那条坑依然成立：
      .kpi-card / .mod-card 都别去挂 .stat-card（`.stat-card` 自带 background / border /
      padding / box-shadow / position:relative，晚出现会盖掉新卡片的样式）。
   ========================================================================== */

/* ---------- 9.1.1 欢迎条 ---------- */
/* 🔴 v1.51.12：**高度缩掉 1/3**（用户 2026-10-08：「红色框框的卡片高度减少 3 分之一」）。
   改前真身量得 **97px** = 上下 padding 20+20 + 内容 57（内容由 .dh-chip 主导：
   8+1边框+16+.dhc-k + 1+.dhc-v 22 + 1边框+8 = 57）。
   ⇒ 缩 1/3 的目标 ≈ 64.7px，靠**两处同时收**：本卡 padding 20→6（−28）
     + .dh-chip 上下 padding 8→6（chip 57→53，−4）= 12 + 53 = **65px（−33.0%）**。
   ⚠️ 只收本卡 padding 的话得收到 3.8px 才够，chip 会贴着渐变边缘 —— 所以必须两处一起收。
   ⚠️ 字号 / 边框 / 圆角**一律没动**：只动垂直内边距，避免文字重排与横向宽度变化。
   ⚠️ 改完用真身量（`.workbuddy/tools/make-dash-preview.py` + cdp 量 .dash-hero 的
      getBoundingClientRect().height），**别按算术估**。守卫见 test_dash_visual 的「欢迎条紧凑化」组。 */
.dash-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 6px 24px;
  margin-bottom: 18px;
  border-radius: var(--r-xl);
  color: #fff;
  background: linear-gradient(115deg, var(--accent) 0%, var(--accent) 42%, var(--accent-2) 100%);
  box-shadow: 0 10px 28px -12px var(--ring);
}
/* 两个光斑纯装饰（不收事件）—— 让那条渐变不至于是一块死平的颜色 */
.dash-hero::after {
  content: ""; position: absolute; right: -70px; top: -90px;
  width: 280px; height: 280px; border-radius: 50%;
  background: rgba(255, 255, 255, .10); pointer-events: none;
}
.dash-hero::before {
  content: ""; position: absolute; right: 60px; bottom: -120px;
  width: 190px; height: 190px; border-radius: 50%;
  background: rgba(255, 255, 255, .08); pointer-events: none;
}
.dh-l { position: relative; z-index: 1; }
.dh-hi { font-size: 19px; font-weight: 700; letter-spacing: .01em; }
.dh-sub { font-size: 12.5px; opacity: .88; margin-top: 3px; }
.dh-r { position: relative; z-index: 1; margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.dh-chip {
  /* v1.51.12：上下 padding 8→6（配合 .dash-hero 一起把整条缩掉 1/3，见上面那段说明） */
  min-width: 118px; padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .15);
}
.dhc-k { font-size: 11px; opacity: .88; }
.dhc-v { margin-top: 1px; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- 9.1.2 分区标题 ---------- */
.dash-sec { margin-bottom: 18px; }
.sec-head { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; }
.sec-bar { width: 3px; height: 15px; border-radius: 2px; background: var(--accent); }
.sec-head h2 { font-size: 14.5px; font-weight: 700; }
/* ⚠️ 墓碑（**别当死代码清理**）：2026-10-05 按用户要求把仪表盘三个分区标题旁的说明小字
   （「全公司口径 / 仅本人名下项目」「N 个模块 · 点卡片进入对应页面」「仅超管 / 股东可见」，
   以及欢迎条里的「 · 数据范围：…」）全部移除 —— 用户原话「红色框框位置的文字前端不要展示出来」。
   规则刻意留着：下次谁再往 `.sec-head` 里加一行说明文字，样式还是对的。
   🔴 与 §通用段那条 `.sec-note`（设置页「双因素手动密钥 / 恢复码」安全文案用的）**不是同一条**，
      那条必须保留。 */
.sec-note { margin-left: auto; font-size: 11.5px; color: var(--text-faint); }

/* ---------- 9.1.2b 仪表盘区块头的「时间范围」按钮组（v1.51.15，用户 2026-10-08） ----------
   用户原话：「加入按钮：全部，本月，本季度，本年度，自定义，默认为全部……
              按钮不要太大」。
   🔴 刻意做小：11px 字 / 3px×8px 内边距 / 1px 边框 / 胶囊圆角 999px。
   ⚠️ 用 `margin-left: auto` 推到标题行最右 —— 与上面那条 `.sec-note` 同一个手法
      （那块墓碑注释说「下次谁再往 .sec-head 里加东西，样式还是对的」，指的就是这个）。
   ⚠️ 只用了**已定义**的变量（本项目有守卫查「无效 CSS 会被浏览器静默丢弃」）：
      --border / --text-dim / --text-faint / --accent / --accent-fg / --input-bg / --r-sm。 */
.dash-range { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.rg-btn {
  font: inherit; font-size: 11px; font-weight: 600; line-height: 1.5;
  padding: 3px 8px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: transparent; color: var(--text-dim);
}
.rg-btn:hover { border-color: var(--accent); color: var(--accent); }
.rg-btn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.rg-custom { display: inline-flex; align-items: center; gap: 4px; }
.rg-date {
  font: inherit; font-size: 11px; padding: 2px 6px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--input-bg); color: var(--text);
}
.rg-sep { font-size: 11px; color: var(--text-faint); }
/* 窄屏：按钮组换行到标题下面一整行（与欢迎条同一档断点 560px） */
@media (max-width: 560px) {
  .dash-range { margin-left: 0; width: 100%; }
}

/* ---------- 9.1.3 核心指标（4 张） ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(212px, 1fr));
  gap: 14px;
}
/* ⚠️ auto-fit + 1fr：4 张卡在宽屏会自动把空轨道收掉、铺满整行（不写死列数）。
   卡片盒子在这里定义，别让别的类再插一脚（同元素同优先级只看书写顺序）。 */
.kpi-card {
  position: relative;
  overflow: hidden;
  padding: 8px 13px 9px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.kpi-card.clickable { cursor: pointer; }
.kpi-card.clickable:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.kpi-top { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.kpi-ico {
  flex: 0 0 26px; width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
/* 图标底色 = 语义色混一点底（浅色/深色都成立，不写死 hex） */
.ton-a  { background: var(--accent-soft); color: var(--accent-text); }
.ton-g  { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.ton-r  { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.ton-m  { background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); }
.ton-v  { background: color-mix(in srgb, var(--violet) 14%, transparent); color: var(--violet); }
.ton-cy { background: color-mix(in srgb, var(--accent-2) 15%, transparent); color: var(--accent-2); }
.kpi-label { font-size: 12px; color: var(--text-dim); }
/* ⚠️ 数字沿用 .stat-value 这一族类名：app.js 的进场数字动画按
   `.stat-value[data-num]` 选元素，改名会让动画静默失效（不报错）。 */
.kpi-card .kpi-value { font-size: 18px; letter-spacing: -.3px; }
.kpi-sub { margin-top: 3px; font-size: 11px; color: var(--text-faint); }
.kpi-card .drill { float: none; opacity: .55; transition: opacity .2s; }
.kpi-card.clickable:hover .drill { opacity: 1; }

/* ---------- 9.1.4 工作台（模块卡） ----------
   ⚠️ 刻意**不用 auto-fit**：张数是 6（老板/股东）或 4（业务员）两种确定值，
      auto-fit 在 1512 宽下会算出 5 列 → 6 张卡变成「5 + 1」，最后一张孤零零一行。
      这里直接按张数定列：6 张 3×2、4 张（.n4）2×2。 */
.mod-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
/* ⚠️ 宽屏才铺 3 列；正好 4 张的那档（业务员）用 .n4 走 2×2 ——
   6 张卡在 1512 宽下如果交给 auto-fit，会算出 5 列 → 「5 + 1」孤卡（设计稿否掉了这种排法）。 */
@media (min-width: 1180px) {
  .mod-grid { grid-template-columns: repeat(3, 1fr); }
  .mod-grid.n4 { grid-template-columns: repeat(2, 1fr); }
}
.mod-card {
  position: relative;
  overflow: hidden;
  padding: 8px 12px 7px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.mod-card.clickable { cursor: pointer; }
.mod-card.clickable:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}
/* 悬停时左边浮起一道强调色竖条（::after 不是定位在内容上，所以不用抬文字） */
.mod-card::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent); opacity: 0; transition: opacity .18s ease;
}
.mod-card.clickable:hover::after { opacity: 1; }
.mod-top { display: flex; align-items: center; gap: 9px; }
.mod-ico {
  flex: 0 0 24px; width: 24px; height: 24px; border-radius: 7px;
  display: grid; place-items: center; font-size: 12px;
}
.mod-name { font-size: 13px; font-weight: 600; }
.mod-go {
  margin-left: auto; font-size: 11.5px; color: var(--text-faint);
  white-space: nowrap; transition: color .18s ease;
}
.mod-card.clickable:hover .mod-go { color: var(--accent-text); }
.mod-main { display: flex; align-items: baseline; gap: 5px; margin: 6px 0 4px; }
.mod-num { font-size: 20px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mod-unit { font-size: 12px; color: var(--text-dim); }
.mod-foot {
  display: flex; gap: 14px; padding-top: 6px;
  border-top: 1px dashed var(--border);
}
.mod-foot > div { min-width: 0; }
/* ⚠️ nowrap 是必须的：这一格的值是 "¥169,929.00" 这种长串，折行会把卡片顶高 */
.mf-k { font-size: 10.5px; color: var(--text-dim); white-space: nowrap; }
.mf-v {
  margin-top: 1px; font-size: 12px; font-weight: 600;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* ---------- 9.1.5 经营与分配（老板专属细条） ----------
   容器带 .dash-profit —— 那是守卫挂点（业务员整块不渲染），别改名。 */
.strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  padding: 4px 0;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.strip-i { padding: 6px 14px; border-right: 1px solid var(--border); }
.strip-i:last-child { border-right: 0; }
/* 「待分配利润 / 股东分红」这两格可点（各自的专属明细弹窗 openPendingModal /
   openDividendModal **只有这一个入口** —— 别顺手把 clickable 去掉，那会把两个弹窗
   变成永远打不开的死代码）。其余三格是纯读数，不可点。 */
.strip-i.clickable { cursor: pointer; transition: background .15s ease; }
.strip-i.clickable:hover { background: var(--hover-bg); }
.strip-i .drill { float: none; opacity: .55; transition: opacity .2s; }
.strip-i.clickable:hover .drill { opacity: 1; }
.si-k { font-size: 11px; color: var(--text-dim); }
.si-v { margin-top: 2px; font-size: 15px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.si-s { margin-top: 1px; font-size: 10.5px; color: var(--text-faint); }

/* ---------- 9.1.6 经营看板（3 列） ---------- */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-items: stretch;
}
/* 🔴 v1.51.3：`.card` 是**全站通用类**（其它页面也在用）→ 这里绝不动它的 padding，
   而是按「仪表盘范围内的卡片」覆盖。用户 2026-10-05：「卡片有点高，不紧凑，缩 1/4」。 */
.dash-sec .card { padding: 11px; }
.dash-sec .card-title { margin-bottom: 9px; }
.dash-grid > .card { min-height: 147px; }
/* 可点的图表卡：目前只有老板视角的「成本回收」——
   它是 openCardDetail('advance_cost')（垫付成本明细）**唯一的入口**，别把 clickable 去掉。
   ⚠️ `.drill` 没有全局规则（只有 `.stat-card .drill` 和 `.kpi-card .drill`），
      这里必须自己写一条，否则「详情 ›」会以默认黑字原样显示、看着像误加的文案。 */
.chart-card.clickable { cursor: pointer; }
.chart-card.clickable:hover { border-color: var(--accent); }
.chart-card .drill { float: none; opacity: .6; transition: opacity .2s; }
.chart-card.clickable:hover .drill { opacity: 1; }

/* ---------- 9.1.7 响应式 ----------
   ⚠️ 只按**视口**断点改列数（卡片尺寸全是流式，没有 JS 按容器宽算的东西了）。 */
@media (max-width: 1180px) {
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .dash-grid > .card:last-child { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-grid > .card:last-child { grid-column: auto; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .strip { grid-template-columns: 1fr; }
  .strip-i { border-right: 0; border-bottom: 1px solid var(--border); }
  .strip-i:last-child { border-bottom: 0; }
}
@media (max-width: 560px) {
  .kpi-grid, .mod-grid { grid-template-columns: 1fr; }
  /* v1.51.12：跟着桌面版一起收（16→8）。⚠️ 窄屏上 `.dh-r` 会换行成两排，
     内容本身就有 ~119px，光靠 padding **达不到 −1/3**（那要负值）——
     这里只做「同向收窄」，别为了凑 1/3 把 padding 写成 0。 */
  .dash-hero { padding: 8px 14px; }
  .dh-hi { font-size: 17px; }
  .dh-r { margin-left: 0; width: 100%; }
  .dh-chip { flex: 1 1 auto; min-width: 0; }
}

/* 数字不再发光（旧版霓虹残留）—— 这几族类名全站共用，统一压掉。
   ⚠️ 这条原来还有一条 `.cf-card .stat-value { text-shadow: ... }` 的例外（深色封面流上
      要靠投影压出可读性），随环一起删了 —— 新卡片是浅色卡，不需要。 */
.stat-value, .profit-value, .kpi-value, .exp-value { text-shadow: none; }

@media (prefers-reduced-motion: reduce) {
  .kpi-card, .mod-card, .dash-grid > .card { transition: none; }
  .kpi-card.clickable:hover, .mod-card.clickable:hover { transform: none; }
}


/* 月度趋势折线图 */
.trend-chart { padding: 4px 2px 0; }
.rchart { display: block; margin: 0 auto; width: 100%; height: auto; }
.rchart .grid { stroke: var(--border); stroke-width: 1; }
.rchart .ylab, .rchart .xlab { fill: var(--text-faint); font-size: 10px; }
.rchart .ylab { text-anchor: end; }
.rchart .xlab { text-anchor: middle; }
.rchart polyline { filter: none; }
.legend { text-align: center; margin-top: 10px; font-size: 12px; color: var(--text-dim); }
.legend .lg { display: inline-flex; align-items: center; margin: 0 12px; }
.legend .lg i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; margin-right: 6px; }
.chart-empty { color: var(--text-faint); text-align: center; padding: 30px; font-size: 13px; }

/* 进度条 */
.seg-bar { display: flex; flex-direction: column; gap: 13px; margin-top: 6px; }
.seg-row {
  display: grid; grid-template-columns: 100px 1fr 84px;
  align-items: center; gap: 12px; font-size: 12.5px;
}
.seg-row .name { color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg-row .num { text-align: right; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.seg-track { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.seg-fill {
  height: 100%; border-radius: 99px;
  background: var(--accent);
  animation: none;
  box-shadow: none;
}
.seg-track.alt .seg-fill { background: var(--accent-2); }

/* 环形图 */
.donut-wrap { display: flex; align-items: center; gap: 18px; padding: 4px 0; position: relative; perspective: none; }
.donut-wrap::after { content: none; }
.donut {
  width: 88px; height: 88px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; position: relative;
  transform: none;
  transition: none;
}
.donut:hover { transform: none; }
.donut::before {
  content: ""; position: absolute; inset: 10px;
  background: var(--surface); border-radius: 50%;
}
.donut-inner { position: relative; text-align: center; }
.donut-inner .pct { font-size: 17px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.donut-inner .lbl { font-size: 10.5px; color: var(--text-faint); }
.donut-legend { display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.donut-legend .row { display: flex; align-items: center; gap: 8px; color: var(--text-dim); }
.donut-legend .swatch { width: 9px; height: 9px; border-radius: 3px; }
/* 旧的装饰轨道已废弃 */
.donut-orbit { display: none; }

/* ==========================================================================
   10. 表格
   ========================================================================== */

table.data { width: 100%; border-collapse: collapse; font-size: 13px; }

table.data th {
  text-align: left; padding: 10px 12px;
  color: var(--text-dim); font-size: 12px; font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  letter-spacing: 0;
}
table.data td {
  padding: 11px 12px; border-bottom: 1px solid var(--border);
  white-space: nowrap; vertical-align: middle;
  color: var(--text);
}
table.data tbody tr { transition: background 0.13s ease; animation: none; }
table.data tbody tr:last-child td { border-bottom: none; }
/* 斑马纹：偶数行浅底，便于横向对数。
   ⚠️ 它和下面的 :hover 特异性都是 (0,2,3)，只能靠「写在前面」让 hover 赢 —— 别调换顺序。 */
table.data tbody tr:nth-child(even) { background: var(--row-alt); }
table.data tbody tr:hover { background: var(--row-hover); }
table.data tbody tr:hover td { background: transparent; }

.num-cell { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--text-faint); }
.mono {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--mono-text);
}
.ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

/* 列表里的「备注」列：单行截断，悬停看全文（全文挂在 title 上）。
   单独给类名、不复用 .ellipsis —— 备注是辅助信息，宽度和主字段（客户名称）不该一样，
   颜色也要弱化，否则一行里最抢眼的反而是备注。
   ⚠️ table.data td 是 white-space:nowrap，不加 max-width 的话长备注会把表格顶得极宽。 */
.note-cell {
  max-width: 200px; overflow: hidden; text-overflow: ellipsis;
  color: var(--text-dim); cursor: help;
}

.dash-tools { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.dash-tools .search-wrap input { width: 260px; }
.dash-count { font-size: 12px; color: var(--text-faint); }

table.data.sortable th { cursor: pointer; user-select: none; }
table.data.sortable th:hover { color: var(--text); }

/* 表格列宽拖拽 */
th { position: relative; }
.resize-handle { position: absolute; right: -3px; top: 0; bottom: 0; width: 7px; cursor: col-resize; z-index: 6; }
.resize-handle:hover, .resize-handle:active { background: var(--accent-soft); }
body.resizing, body.resizing * { cursor: col-resize !important; user-select: none; }

/* 承载表格的卡片 */
.table-card { padding: 6px; max-width: 100%; overflow-x: auto; }
.table-wrap { overflow: auto; }

/* 分页组件的表格（用户与权限 / 系统日志） */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
  padding: 10px 12px; text-align: left; font-size: 13px;
  border-bottom: 1px solid var(--border); color: var(--text);
}
.data-table th { font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
.data-table tbody tr:last-child td { border-bottom: none; }
/* 斑马纹（同 table.data：nth-child 写在 :hover 之前，靠顺序取胜） */
.data-table tbody tr:nth-child(even) { background: var(--row-alt); }
.data-table tbody tr:hover { background: var(--row-hover); }

/* 空态 */
.empty { text-align: center; color: var(--text-faint); padding: 54px 0; font-size: 13.5px; }

/* 表格里的空值占位「—」（明细表、弹窗内小表）。
   原先这些格子的颜色是写死的内联 color:#777 —— 浅色下勉强能看，暗色下几乎糊掉。
   凡是要给「表格占位」上色，一律用这个类，别再写内联色值。 */
.empty-cell { text-align: center; color: var(--text-faint); }

/* 打印预览弹窗里、白色纸张 iframe **之外**的那圈容器底色。
   iframe 内部保持白纸（那是要打印的内容，不能跟着主题变），只有这圈跟随主题，
   否则暗色模式下会在弹窗里出现一块刺眼的浅灰亮斑。 */
.print-host { overflow: auto; padding: 14px; background: var(--surface-3); }
.empty .big { font-size: 32px; margin-bottom: 10px; opacity: 0.55; }

/* ==========================================================================
   11. 标签 / 徽章
   ========================================================================== */

.pill {
  display: inline-block; padding: 3px 9px; border-radius: var(--r-xs);
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: var(--pill-gray-bg); color: var(--text-dim);
}
.pill.blue { background: var(--accent-soft); color: var(--accent-text); }
.pill.gray { background: var(--pill-gray-bg); color: var(--text-dim); }
.pill.green { background: rgba(21, 128, 61, 0.10); color: var(--green); }
.pill.amber { background: rgba(180, 83, 9, 0.11); color: var(--amber); }
.pill.red { background: rgba(220, 38, 38, 0.10); color: var(--red); }
.pill.violet { background: rgba(124, 58, 237, 0.11); color: var(--violet); }
body[data-theme="dark"] .pill.green { background: rgba(74, 222, 128, 0.14); }
body[data-theme="dark"] .pill.amber { background: rgba(251, 191, 36, 0.14); }
body[data-theme="dark"] .pill.red { background: rgba(248, 113, 113, 0.14); }
body[data-theme="dark"] .pill.violet { background: rgba(167, 139, 250, 0.16); }
.pill, .status-badge { box-shadow: none; }

/* 「编号 → 详情」的下钻样式（项目编号 GK-xxx / 报销单号 BX-xxx / 支出记录 #N）。
   全站一个类：既能套在 .pill 上（表格里的编号标签），也能直接套在行内文字上
   （详情页/提示条里的单号，见 app.js 的 drillNo()）。

   ⚠️ 只写 color 不写背景，就是为了让 pill 自己的配色还能赢：
      `.pill.blue` / `.pill.violet` 是两个类、比这里的单类优先级高，
      所以蓝/紫标签不会被染成 accent 色，而裸文字会。以后加配色不用回来补。

   提示要**弱**：下划线用 dotted、hover 才变实线 —— 一列编号不能比金额还抢眼。 */
.drill-link {
  cursor: pointer;
  color: var(--accent-text);
  text-decoration: underline dotted;
  text-underline-offset: 2px;
  transition: filter 0.12s ease;
}
.drill-link:hover { text-decoration: underline solid; filter: brightness(0.92); }
body[data-theme="dark"] .drill-link:hover { filter: brightness(1.18); }
.drill-link:active { transform: translateY(1px); }

.status-icons { display: inline-flex; gap: 4px; font-size: 12px; }
.status-badge {
  display: inline-block; width: fit-content;
  padding: 5px 13px; border-radius: var(--r-xs);
  font-size: 12.5px; font-weight: 600;
}
.badge-green { background: rgba(21, 128, 61, 0.10); color: var(--green); }
.badge-amber { background: rgba(180, 83, 9, 0.11); color: var(--amber); }
.badge-red { background: rgba(220, 38, 38, 0.10); color: var(--red); }
.badge-gray { background: var(--pill-gray-bg); color: var(--text-dim); }
body[data-theme="dark"] .badge-green { background: rgba(74, 222, 128, 0.14); }
body[data-theme="dark"] .badge-amber { background: rgba(251, 191, 36, 0.14); }
body[data-theme="dark"] .badge-red { background: rgba(248, 113, 113, 0.14); }

/* 商机时间提醒 */
.blink-warn { animation: blinkWarn 1.4s ease-in-out infinite; }
@keyframes blinkWarn { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ==========================================================================
   12. 工具栏 / 表单控件
   ========================================================================== */

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.toolbar .btn, .toolbar .btn.small { height: 40px; }

.field-input, .field-select, .field-textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--text);
  padding: 9px 12px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field-input, .field-select { height: 40px; }
.field-input::placeholder, .field-textarea::placeholder { color: var(--text-faint); }
.field-input:focus, .field-select:focus, .field-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}
.field-select option, .field-input option { background: var(--surface); color: var(--text); }
.field-input.compact { width: 150px; }
.field-select.compact { width: 150px; }

/* 下拉控件（全站筛选条的 <select>）：鼠标移上去有「抬起 + 投影」的反馈，聚焦时换成强调环。
   ⚠️ 原生 <select> 弹出的那个列表是操作系统绘制的，CSS 摸不到它（只能靠 option 的 background/color
   跟随主题，上面那行已经做了）。所以这里做的是「控件本体」的动效，别指望能动画化选项行。 */
.field-select {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.18s ease,
              transform 0.18s ease, background-color 0.18s ease;
}
.field-select:hover {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  /* scale 让「字体变大」的观感与侧栏菜单一致（用户 2026-09-24 要求两处同款动效）。
     仍只动 transform：不改字号，所以不会把旁边的筛选项挤走。 */
  transform: translateY(-1px) scale(1.04);
}
/* :hover 在前、:focus 在后：聚焦时把位移收回去，避免「一边选中一边飘着」 */
.field-select:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--ring), var(--shadow-md);
  transform: translateY(0);
}
.field-select:active { transform: translateY(0) scale(0.995); }
/* 禁用态不参与动效 */
.field-select:disabled { cursor: not-allowed; transform: none; box-shadow: none; }
.field-select:disabled:hover { border-color: var(--border-strong); box-shadow: none; }

.search-wrap { position: relative; }
.search-wrap input { padding-left: 34px; width: 230px; }
.search-wrap::before {
  content: ""; position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 12px; height: 12px; border: 2px solid var(--text-faint); border-radius: 50%;
}
.search-wrap::after {
  content: ""; position: absolute; left: 22px; top: 55%;
  width: 6px; height: 2px; background: var(--text-faint); transform: rotate(45deg); border-radius: 2px;
}

/* 表格内操作按钮
   ⚠️ .row-actions 必须 inline-flex 且不换行；.icon-btn 必须 nowrap。
   否则表格该列最小宽度会塌缩成「一个按钮」，按钮竖排、行高被撑高。 */
.row-actions { display: inline-flex; gap: 6px; }
.icon-btn {
  background: var(--surface); border: 1px solid var(--border-strong);
  color: var(--text-dim); border-radius: var(--r-xs);
  padding: 4px 9px; font-size: 12px;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
  white-space: nowrap; flex: 0 0 auto;
}
.icon-btn:hover { color: var(--text); background: var(--hover-bg); }
.icon-btn.del:hover { color: var(--red); border-color: rgba(220, 38, 38, 0.36); background: rgba(220, 38, 38, 0.07); }

/* ==========================================================================
   13. 公司页
   ========================================================================== */

.company-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.company-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease;
}
.company-card:hover { border-color: var(--border-strong); transform: none; }
.company-name { font-size: 14px; font-weight: 700; color: var(--text); }
.company-count { font-size: 12px; color: var(--text-faint); }
.company-actions { display: flex; gap: 8px; margin-top: 2px; align-items: center; }

/* ---- 客户 / 公司的「创建人 + 已赋予给谁」（v1.43.0 起；v1.45.0 改为直印名字） ---- */
.md-card-head { display: flex; align-items: center; gap: 8px; }
.md-card-head .company-name { flex: 1; }
.md-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 4px; font-size: 12px; color: var(--text-dim);
}
.md-meta .md-owner.is-none { color: var(--text-faint); font-style: italic; }
.md-meta .md-shared {
  padding: 1px 7px; border-radius: 999px; cursor: help;
  border: 1px solid var(--border-strong); color: var(--text-dim);
}
/* 「未赋予」用虚线灰底，和「已赋予 张三」实线区分开 */
.md-meta .md-shared.is-none { color: var(--text-faint); border-style: dashed; }
.md-readonly { font-size: 12px; color: var(--text-faint); }
/* ⚰️ 墓碑（v1.45.0 第二十七轮）：用户要求把赋予收进编辑弹窗，批量入口整体删除，
   下面四个类**已无人引用**（`.md-check` 卡片勾选框 / `.md-selall` `.md-selinfo` 工具条 /
   `.company-card.is-sel` 选中高亮）。**故意保留规则**：老缓存页面引用到时不至于样式全丢。 */
.md-check { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.company-card.is-sel { border-color: var(--accent); background: var(--accent-soft); }
.md-selall {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--text-dim); cursor: pointer;
}
.md-selall input { accent-color: var(--accent); cursor: pointer; }
.md-selinfo { font-size: 12.5px; color: var(--text-faint); }
.md-selinfo.is-on { color: var(--accent); font-weight: 600; }

/* ---- 编辑弹窗里的「赋予给业务员」勾选区（v1.45.0 第二十七轮）---- */
.share-pick {
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface-2); padding: 12px 14px;
}
.share-pick-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.share-pick-sub { font-size: 12.5px; color: var(--text-dim); margin-bottom: 10px; line-height: 1.55; }
.share-pick-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 34vh; overflow: auto; padding: 2px;
}

/* v1.51.23：项目概况页的「销售员」勾选区（可多选）。
   与「赋予」那块（.share-pick）刻意分开命名 —— 两者语义不同（这里是「谁参与这条工单」，
   那里是「谁能看到/改这条主数据」），将来单独改样式不会互相牵连。
   ⚠️ 横排 + 自动换行：表单里是窄列，4 个人名竖着堆会把弹窗撑得很长。 */
.sales-pick { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 3px 0; }
.sales-pick-i {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; cursor: pointer; user-select: none;
}
.sales-pick-i input { margin: 0; cursor: pointer; }
.sales-pick-i.is-off { opacity: .6; cursor: not-allowed; }
.sales-pick-i.is-off input { cursor: not-allowed; }
/* 提成页的销售员姓名：只读文本（名单只在概况页勾选，见 salesRowHtml 的注释） */
.sp-name-text { font-size: 13px; font-weight: 600; }
/* v1.51.23b：项目列表「销售员」列 —— **每人一行**（名字 + 他自己的提成金额）。
   ⚠️ 用 flex-column 让多销售员自然分行；业务员视角只会有他那一行。 */
.sales-cell { display: inline-flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.sales-cell .sp-line { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.sales-cell .sp-amt { color: var(--red); font-size: 12.5px; }
/* 置灰行（本条创建人本人）：勾不上，但仍要**显示出来** —— 用户就是想知道谁是谁 */
.assign-row.is-off { opacity: 0.6; cursor: not-allowed; }
.assign-row.is-off:hover { border-color: var(--border); }

/* ==========================================================================
   14. 设置页
   ========================================================================== */

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.opts-editor { display: flex; flex-direction: column; gap: 10px; }
.opts-row { display: flex; align-items: center; gap: 8px; }
.opts-row .btn { height: 40px; }
.opts-row input { flex: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-dim); border-radius: var(--r-sm);
  padding: 5px 8px 5px 11px;
  font-size: 12px;
}
.chip[draggable="true"] { cursor: grab; user-select: none; -webkit-user-select: none; }
.chip[draggable="true"]:active { cursor: grabbing; }
.chip.dragging { opacity: 0.45; border-style: dashed; }
.chip button { background: none; border: none; color: var(--text-faint); font-size: 13px; line-height: 1; padding: 0 2px; }
.chip button:hover { color: var(--red); }

/* ---- 「费用支出类型」编辑器（设置页）----
   停用项与启用项必须一眼能分开：不是靠颜色轻重，而是靠「虚线边框 + 明确的小标题」——
   因为这两组 chip 长得像、挨得近，只调透明度很容易被看成一整组。
   ⚠️ 停用项不是删除：老单据的 category 列里存的就是这个名字，删了就按类别筛不出来。 */
.chip.off {
  opacity: 0.6;
  border-style: dashed;
  background: transparent;
}
.chip.off button:hover { color: var(--accent); }
/* 系统内置项（设备购销）：不可改名 / 删除 / 停用，所以没有按钮，右边距也跟着收掉 */
.chip.lock { padding-right: 11px; }
.chip.lock[draggable="false"] { cursor: default; }

.rbcat-off-row { margin-top: 12px; }
.rbcat-off-title {
  font-size: 12px; color: var(--text-faint); margin-bottom: 6px; line-height: 1.5;
}

.backup-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.backup-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 10px 12px; font-size: 12.5px;
}
.backup-row .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backup-row .meta { color: var(--text-faint); font-size: 11.5px; flex-shrink: 0; }

.info-line {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 0; font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.info-line:last-child { border-bottom: none; }
.info-line .k { color: var(--text-dim); }
.info-line .v { font-weight: 600; word-break: break-all; text-align: right; max-width: 70%; }

.upload-zone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--r-md);
  padding: 18px; text-align: center; color: var(--text-dim); font-size: 12.5px;
  margin-bottom: 12px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.upload-zone.drag { border-color: var(--accent); background: var(--accent-soft); }
.upload-zone input { margin-top: 8px; font-size: 12px; color: var(--text-dim); }

/* ==========================================================================
   15. 弹窗
   ========================================================================== */

.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: var(--mask);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.16s ease;
  perspective: none;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(0.99); } to { opacity: 1; transform: none; } }

.modal {
  width: min(760px, calc(100vw - 48px));
  max-height: calc(100vh - 70px);
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  animation: popIn 0.16s ease;
  transform-style: flat;
}
.modal.wide { width: min(940px, calc(100vw - 40px)); }
.modal.xl { width: min(1140px, calc(100vw - 40px)); }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 15.5px; font-weight: 700; color: var(--text); }
.modal-close {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-dim); border-radius: var(--r-xs);
  width: 28px; height: 28px; font-size: 15px; line-height: 1;
  transition: background 0.14s ease, color 0.14s ease;
}
.modal-close:hover { color: var(--text); background: var(--hover-bg); }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px 16px;
  border-top: 1px solid var(--border);
}

.modal-error {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.32);
  color: var(--red);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 12px;
  line-height: 1.6;
}
body[data-theme="dark"] .modal-error { background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.34); }

/* align-items:end 是关键：同一行里若某个 .form-group 的标签因为带 .hint 变成两行，
   它的控件会被顶下去 22px（实测 labelH 39 vs 17 → 控件 top 差 22px）。
   行末对齐后，同一行控件的底边（以及等高控件的顶边）必然齐平。 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; align-items: end; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-dim); }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full, .form-grid > label.span2 { grid-column: 1 / -1; }

/* 项目弹窗「项目概况 / 项目状态」用的 6 列栅格：一行放 2 个或 3 个字段都能精确控制。
   注意后面两条必须比 .form-group.full (0,2,0) 更具体，否则会被下面那条 span 3 覆盖掉。 */
.form-grid.as-grid6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.form-grid.as-grid6 > .form-group { grid-column: span 3; }        /* 默认：一行两个 */
.form-grid.as-grid6 > .form-group.third { grid-column: span 2; }  /* 一行三个 */
.form-grid.as-grid6 > .form-group.full { grid-column: 1 / -1; }   /* 整行 */
.form-label { font-size: 12px; color: var(--text-dim); font-weight: 600; }
.form-label .req { color: var(--red); }

/* .form-grid label 被设成 flex-column，会导致必填星号「*」被拆到单独一行。
   这里把它改成横向、可换行：星号跟文案同行，.hint 说明仍独占下一行。 */
.form-grid .form-group > .form-label {
  display: flex; flex-direction: row; flex-wrap: wrap;
  align-items: baseline; column-gap: 4px; row-gap: 6px;
}
.form-grid .form-group > .form-label .hint { flex-basis: 100%; }

/* 🔴 库存提示条容器（#inv-suggest / #inv-suggest-note）**为空时必须不占位**。
   用户 2026-10-14 截图反馈：「项目名称 / 项目类型 / 成交金额 三个框没排在同一条线上」。
   根因：`.form-group` 是 `display:flex; flex-direction:column; gap:6px`，
        空的容器虽然高度 0，**但仍是一个 flex item ⇒ 照样吃掉一个 6px 的 gap**；
        配合 `.form-grid { align-items:end }`，整组被顶高 → 输入框与同行控件错开
        （真身实测：Δtop = −6px，名称组高 68.3 vs 类型组 62.4）。
   `:empty` 只匹配「真·无子节点」—— 容器由 JS 用 innerHTML 填充，
   填了就不是 :empty，自然恢复占位。⛔ 别改成 `visibility:hidden`（仍占位）。
   ⚠️ 判断依据是「HTML 里这个 div 中间不能有空白换行」，本仓库两处都是紧贴写法。 */
#inv-suggest:empty, #inv-suggest-note:empty { display: none; }

/* 项目状态里的「开票/回款/结算」是只读徽标，天然只有 27px，夹在一堆 40px 控件里高度不齐。
   只在表单栅格内拉齐到 40px —— 全局改 .status-badge 会连带影响列表/表格里的徽标。 */
.form-grid .form-group > .status-badge {
  display: inline-flex; align-items: center;
  height: 40px; padding: 0 13px; width: fit-content;
}
.modal-sub { margin: 14px 0 8px; font-size: 12.5px; color: var(--text-dim); }

.company-pick { display: flex; gap: 8px; }
.company-pick select { flex: 1; }
.add-company-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border-strong);
  color: var(--text-dim); border-radius: var(--r-sm); height: 40px; padding: 0 14px;
  font-size: 12px; font-weight: 600;
  white-space: nowrap; transition: background 0.14s ease, color 0.14s ease;
}
.add-company-btn:hover { background: var(--hover-bg); color: var(--text); }

/* —— 项目编辑弹窗：左导航 + 右分栏 —— */
.proj-modal { display: flex; gap: 16px; align-items: flex-start; }
.proj-nav { width: 146px; flex-shrink: 0; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; }
.proj-nav-item {
  padding: 9px 12px; border-radius: var(--r-sm); border: 1px solid transparent;
  background: var(--surface-3); color: var(--text-dim); font-size: 12.5px;
  text-align: left; cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
  display: flex; align-items: center; gap: 6px;
}
.proj-nav-item:hover { color: var(--text); background: var(--hover-bg); }
.proj-nav-item.active {
  background: var(--accent); color: var(--accent-fg);
  border-color: transparent; font-weight: 600;
}
.proj-file-count {
  display: none; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: var(--accent-fg);
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  flex-shrink: 0;
}
.proj-file-count.show { display: inline-flex; align-items: center; justify-content: center; }
.proj-nav-item.active .proj-file-count { background: rgba(255, 255, 255, 0.26); }
.proj-panel { flex: 1; min-width: 0; }

/* ---- 回收站（顶栏入口 + 弹窗）---- */
/* 徽标：删除是不可逆的高风险动作，用户需要「删了东西去哪了」的即时反馈。
   零条时不渲染（hidden），避免一个常驻的 0 造成视觉噪音。 */
.trash-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px;
  border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 1; vertical-align: middle;
}
/* ⚠️ 必须显式写：上面的 display 是类选择器（0,1,0），会盖掉 [hidden] 的
   UA 样式 display:none（0,1,0 且更靠前）—— 不补这条，「回收站 0」永远挂在那儿。 */
.trash-badge[hidden] { display: none; }

/* 删除审批（v1.41.0）徽标：琥珀色，与回收站那个蓝底徽标区分开 ——
   两者语义不同：「已删待处理」vs「申请待批准」，同一个颜色会让人以为是同一个数。 */
.trash-badge.is-alert { background: var(--amber); }

/* ---- 删除审批（v1.41.0）：列表里的「⏳ 待删除」标记 + 回收站里的审批块 ---- */
/* 行内标记：与 .lock-chip 同族（都是一句状态说明），但用琥珀色 —— 它是「进行中」，不是「锁死」。
   ⚠️ nowrap：表格 td 本来就 nowrap，这里只是防止它被 flex 压缩成两行。 */
.del-pending {
  display: inline-flex; align-items: center; gap: 3px; white-space: nowrap;
  padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--amber); background: var(--card-soft);
  color: var(--amber); font-size: 12px; font-weight: 600;
}
/* ⚠️ .done-block 自带 margin-top:24px（为页面里「跟在主表格后面」准备的）——
   这里上面只隔了一条 .trash-bar（它自己已有 12px 下边距），24 + 12 太散，压回 4px。 */
.delreq-block { margin-top: 4px; margin-bottom: 14px; }
.delreq-block .done-title { color: var(--amber); }
/* 删除申请块里的「申请理由」列：默认 .note-cell 是 200px 单行省略，驳回理由跟在下面
   第二行会被闷掉，这里放宽一点并允许换行（它本来就是多行语义）。 */
.delreq-block .note-cell { max-width: 300px; }
.delreq-review {
  margin-top: 5px; padding-top: 5px; border-top: 1px dashed var(--border);
  color: var(--amber); font-size: 12px; line-height: 1.5; white-space: normal;
}
/* 「成本已入账」警告（v1.41.3）：业务员现在能对成本已被报销入账的项目提删除申请，
   批准会把那几条入账成本一起带走（项目子表级联删除）。这条必须让超管在点
   「批准删除」**之前**看见 —— 用红色，而不是 .delreq-review 那个琥珀色：
   「补充说明」和「批了会账实不符」不该是同一个视觉权重。 */
.delreq-warn {
  margin-top: 5px; padding-top: 5px; border-top: 1px dashed var(--border);
  color: var(--red); font-size: 12px; line-height: 1.5; white-space: normal;
}
/* ⚠️ .trash-label 原本是「单行省略」（overflow:hidden + ellipsis），而表格 td 默认 nowrap
   —— 上面那条警告是**第二行**，不放开就会被整个闷掉，看着像没渲染。
   与评审时「驳回理由看不见」是同一类坑（见 .delreq-review 上面的注释）。 */
.delreq-block .trash-label { max-width: 320px; white-space: normal; }

.trash-bar {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; margin-bottom: 12px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--card-soft);
}
.trash-hint { color: var(--text-dim); font-size: 13px; line-height: 1.6; }
.trash-hint b { color: var(--text); }
.trash-tools { display: flex; gap: 8px; flex: none; }

.trash-table td { vertical-align: middle; }
/* 名称可能很长（项目编号 + 客户名）：单行截断，全文挂 title。
   ⚠️ table.data td 是 nowrap，不给 max-width 会把表格顶得极宽。 */
.trash-label {
  max-width: 320px; overflow: hidden; text-overflow: ellipsis;
  color: var(--text); cursor: help;
}
.trash-by, .trash-time { color: var(--text-dim); white-space: nowrap; }
.trash-tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--card-soft);
  color: var(--text-dim); font-size: 12px; font-weight: 600; white-space: nowrap;
}
/* 剩余天数：只在快到期时才用醒目色 —— 全都标红等于没标（数值颜色只表达状态） */
.trash-days {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  border: 1px solid transparent;   /* 占位：urgent 时换成琥珀边，避免整行高度跳动 */
  color: var(--text-dim); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.trash-days.urgent {
  border: 1px solid var(--amber); color: var(--amber); background: var(--card-soft);
}

.trash-empty { padding: 42px 12px 46px; text-align: center; color: var(--text-dim); }
.trash-empty-ico { font-size: 34px; line-height: 1; margin-bottom: 10px; opacity: .5; }
.trash-empty-title { color: var(--text); font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.trash-empty-sub { font-size: 13px; line-height: 1.7; max-width: 460px; margin: 0 auto; }

/* ---- 冻结只读：已完结 / 成本已被设备购销报销入账的项目，业务员与股东都只读 ---- */
/* 弹窗里「哪些控件不该能动」用 CSS 表达，而不是打开时扫一遍 JS 把控件关掉：
   附件列表、成本明细行、开票/回款明细都是弹窗渲染之后**异步补进来**的，
   扫一遍必然漏掉它们（附件旁边的「✕ 删除」照样能点，看着只读其实能改）。
   CSS 对动态元素天然生效。JS 那边只额外给当下已存在的控件补 disabled（防键盘操作），
   真正的兜底在服务端 PUT / DELETE 的 403。 */
.proj-modal.frozen .proj-panel input,
.proj-modal.frozen .proj-panel select,
.proj-modal.frozen .proj-panel textarea {
  pointer-events: none;
  background: var(--card-soft);
  color: var(--text-dim);
}
.proj-modal.frozen .proj-panel button,
.proj-modal.frozen .proj-panel .upload-zone { display: none; }

/* 只读横幅：项目弹窗顶部、已通过报销的详情里各用一次 */
.frozen-banner {
  display: flex; align-items: center; gap: 6px;
  margin: 0 0 12px; padding: 10px 12px;
  border: 1px solid var(--amber); border-radius: 10px;
  background: var(--card-soft);
  color: var(--text); font-size: 13px; font-weight: 600; line-height: 1.5;
}
/* 列表里的「🔒 只读」徽标（占住「编辑」按钮的位置，别让操作列空着） */
.lock-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--border-strong); background: var(--card-soft);
  color: var(--text-dim); font-size: 12px; font-weight: 600; cursor: help;
}
/* 成本明细里「报销单自动入账」的行：业务员只读（用户 2026-09-23 的口径 —— 锁这几行，
   不锁整个项目）。⚠️ 这只是视觉拦截；真正的门是服务端 update_project 里的
   locked_cost_violation()，绕过前端直接发请求照样 403。 */
.cost-table tr.locked-row > td { background: var(--card-soft); }
.cost-table tr.locked-row > td:first-child::before {
  content: "🔒"; margin-right: 4px; font-size: 11px;
}
.cost-table tr.locked-row input,
.cost-table tr.locked-row select {
  color: var(--text-dim);
  background: var(--card-soft);
  cursor: not-allowed;
}
.cost-table tr.locked-row button { cursor: not-allowed; opacity: .7; }

.proj-sec { display: none; }
.proj-sec.active { display: block; }

/* 项目导航状态：完成绿 / 未完成黄（选中项保持反白） */
.proj-nav-item.nav-ok:not(.active) { color: var(--green); font-weight: 600; }
.proj-nav-item.nav-warn:not(.active) { color: var(--amber); font-weight: 600; }

/* —— 成本 / 交付 / 阶段 表格 —— */
.cost-section, .stage-section { margin-top: 18px; }
.cost-head, .stage-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
}
.cost-head h4, .stage-head h4 { font-size: 13px; color: var(--text); }
.cost-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-sm); }
.cost-table { width: 100%; border-collapse: collapse; min-width: 1500px; }
.cost-table.delivery-table { min-width: 0; }
/* 费用报销明细只有 5 列，不需要成本表那 1500px 的横向滚动宽度 */
.cost-table.reimburse-table { min-width: 0; }

/* 数字列表头必须跟着数字一起右对齐。
   ⚠️ `table.data th`（0,1,2）、`.cost-table th`（0,1,1）都写了 text-align:left，
   单靠 `.num-cell`（0,1,0）**盖不住** —— 所以「金额 / 比例 / 预计金额」这类表头一直
   是左对齐、而数字是右对齐：列一宽，表头贴列左、数字贴列右，中间空一大片，
   看着像两列（用户截图报过「没有一一对应」）。下面两条必须比上面那两条更具体。 */
table.data th.num-cell,
.cost-table th.num-cell { text-align: right; }

/* 窄屏（弹窗只剩 ~540px）下别让「¥2,900.00」折成两行 —— 折行会让右对齐失效、看起来又乱了 */
.cost-table.reimburse-table td.num-cell { white-space: nowrap; }
.stage-table { min-width: 720px; }
.cost-table th {
  text-align: left; font-size: 11.5px; color: var(--text-dim); font-weight: 600;
  padding: 8px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  white-space: nowrap;
}
.cost-table td { padding: 6px 8px; }
.cost-table tbody tr { border-bottom: 1px solid var(--border); }
.cost-table tbody tr:nth-child(even) { background: var(--row-alt); }
.cost-table tbody tr:last-child { border-bottom: none; }
.cost-table input[type="date"] { min-width: 126px; }
.cost-table input {
  width: 100%; background: var(--input-bg);
  border: 1px solid var(--border); border-radius: var(--r-xs);
  color: var(--text); padding: 7px 10px; font-size: 12.5px; outline: none;
}
.cost-table input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--ring); }
.cost-table input:disabled { opacity: 0.55; background: var(--surface-3); cursor: not-allowed; }
.tax-row td { background: rgba(180, 83, 9, 0.05); }
.tax-row td:first-child { border-radius: var(--r-xs) 0 0 var(--r-xs); }
.tax-row td:last-child { border-radius: 0 var(--r-xs) var(--r-xs) 0; }

.cost-total {
  display: flex; justify-content: flex-end; align-items: center; gap: 14px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 13px;
}
.cost-total .sum { font-size: 17px; font-weight: 700; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.st-amount { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent-text); }
.stage-total {
  text-align: right; font-size: 12.5px; color: var(--text-dim);
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border);
}
.stage-total b { color: var(--accent-text); font-size: 15px; }

.summary-strip {
  /* 项目状态底部汇总共 7 格，原来写死 6 列 → 「待分配利润」单独掉到第二行。
     用 auto-fit 让宽屏正好一行排满 7 格（空轨道自动塌陷、余量均分），窄屏再优雅折行。 */
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 16px;
}
.summary-box {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 12px 14px; text-align: center;
}
.summary-box .lb { font-size: 11px; color: var(--text-faint); }
.summary-box .vl { font-size: 15px; font-weight: 700; margin-top: 5px; color: var(--text); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   16. Toast
   ========================================================================== */

#toast-root { position: fixed; top: 18px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 240px; max-width: 380px;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 12px 15px;
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.2s ease;
}
@keyframes slideIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
.toast.out { opacity: 0; transform: translateX(18px); transition: all 0.22s ease; }
.toast .t-ico { font-size: 15px; }
.toast.ok .t-ico { color: var(--green); }
.toast.err .t-ico { color: var(--red); }
.toast.info .t-ico { color: var(--accent-text); }

/* —— 上传 / 导入 进度条（v1.51.6）——
   与 .toast 同容器同位置（右上角堆叠），只是多了条进度轨。
   ⚠️ .toast 自带 display:flex，这里覆盖成 block（它要上下两行）。
   ⚠️ 不确定态（服务端处理中）用条纹平移动画，**不要**写成 rotate —— 那会让进度轨
      在 100% 处转出圆角溢出。 */
.upbar { display: block; min-width: 268px; padding: 12px 15px; }
.upbar-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.upbar-name { font-size: 12.5px; font-weight: 600; color: var(--text); }
.upbar-pct {
  font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums;
}
.upbar-track {
  margin-top: 8px; height: 6px; border-radius: 999px;
  background: var(--border); overflow: hidden;
}
.upbar-fill {
  height: 100%; width: 0; border-radius: 999px;
  background: var(--accent); transition: width 0.18s ease;
}
.upbar-sub { margin-top: 6px; min-height: 15px; font-size: 11.5px; color: var(--text-faint); }
.upbar.ok .upbar-fill { background: var(--green); }
.upbar.ok .upbar-sub { color: var(--green); }
.upbar.err .upbar-fill { background: var(--red); }
.upbar.err .upbar-sub { color: var(--red); }
/* 总长未知（服务端处理中）：条纹来回走，表示"还在跑，别关窗口" */
.upbar.indet .upbar-fill {
  width: 100% !important;
  background: linear-gradient(90deg,
    var(--accent) 0 32%, transparent 32% 50%, var(--accent) 50% 82%, transparent 82%);
  background-size: 220% 100%;
  animation: upbarSlide 1.1s linear infinite;
}
@keyframes upbarSlide { from { background-position: 0 0; } to { background-position: -220% 0; } }
@media (prefers-reduced-motion: reduce) {
  .upbar-fill { transition: none; }
  .upbar.indet .upbar-fill { animation: none; }
}


/* ==========================================================================
   17. 用户与权限 / 系统日志
   ========================================================================== */

.rbac-mask {
  position: fixed; inset: 0; z-index: 9000; display: flex;
  align-items: center; justify-content: center; padding: 24px;
  background: var(--mask);
}
.rbac-dialog {
  width: min(580px, 94vw); max-height: 86vh; overflow: auto;
  border-radius: var(--r-lg); padding: 20px 22px;
  background: var(--surface); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
}
.rbac-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.rbac-head h3 { font-size: 15.5px; color: var(--text); font-weight: 700; }
.rbac-body { font-size: 13.5px; color: var(--text); }
.modal-foot { margin-top: 18px; text-align: right; }

.perm-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.perm-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border-radius: 999px; border: 1px solid var(--border); cursor: pointer;
  font-size: 12.5px; color: var(--text-dim); user-select: none;
  background: var(--surface-2);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.perm-chip:hover { border-color: var(--border-strong); }
.perm-chip.on {
  color: var(--accent-text); border-color: var(--accent);
  background: var(--accent-soft); box-shadow: none;
}
.perm-chip input { accent-color: var(--accent); }

.perm-tag {
  display: inline-block; padding: 3px 9px; margin: 0 6px 6px 0;
  border-radius: var(--r-xs); font-size: 12px;
  color: var(--text-dim);
  background: var(--surface-2); border: 1px solid var(--border);
}

.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.role-card {
  border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 14px 16px; background: var(--surface-2);
  transition: border-color 0.15s ease;
}
.role-card:hover { border-color: var(--border-strong); }
.role-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.role-name { font-weight: 600; color: var(--text); }
.role-scope { margin: 8px 0 6px; font-size: 12.5px; color: var(--text-dim); }
.role-perms { margin: 6px 0; }
.role-remark { font-size: 12px; min-height: 16px; }
.role-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

.pill.green { background: rgba(21, 128, 61, 0.10); color: var(--green); border: none; }
.pill.red { background: rgba(220, 38, 38, 0.10); color: var(--red); border: none; }
body[data-theme="dark"] .pill.green { background: rgba(74, 222, 128, 0.14); }
body[data-theme="dark"] .pill.red { background: rgba(248, 113, 113, 0.14); }

/* —— 已完结项目区 —— */
.done-block { margin-top: 24px; }
/* 第一个分组（跟随筛选栏）紧贴工具栏，不需要额外上边距；商机页的「跟进中商机」用它 */
.done-block.tight { margin-top: 0; }
.done-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 14px; flex-wrap: wrap; margin-bottom: 12px; padding: 0 2px;
}
.done-title { font-size: 14.5px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.done-title .hint { font-size: 11px; font-weight: 400; color: var(--text-faint); }
.done-sub { font-size: 11.5px; color: var(--text-faint); margin-top: 3px; }
.done-kpis { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-dim); }
.done-kpis b { font-family: var(--font-mono); font-size: 12.5px; color: var(--text); }

/* 「待结算项目」板块：骨架整套复用 .done-block 家族（与「已完结项目」同族，位置就在它上方），
   只把标题和左边一道竖条染成琥珀色以示区分 —— 两块说的是「还没结」vs「已经结了」，颜色要分开。
   ⚠️ 别改 .done-* 本身：那两个板块共用同一套类名，改了一处另一处跟着走样。 */
.settle-block .done-title { color: var(--amber); }
.settle-block .done-title::before {
  content: ""; width: 3px; height: 15px; border-radius: 2px;
  background: var(--amber); margin-right: 2px;
}

/* 「待审核项目」板块（v1.44.0）：同样整套复用 .done-block 家族（⚠️ 别去改 .done-*）。
   位置在**主表格之上**（也在「待结算」之上）—— 未通过审核的项目根本不算进项目统计，
   读者应该先看到它，才知道「项目总数为什么比列表条数少」。 */
.review-block .done-title { color: var(--violet); }
.review-block .done-title::before {
  content: ""; width: 3px; height: 15px; border-radius: 2px;
  background: var(--violet); margin-right: 2px;
}
/* 待审核块里的表格用虚线边框，与「已生效」的三块在视觉上区分开 */
.review-block .table-card { border-style: dashed; }

/* 侧栏底部的悬停音效开关：小、不抢视线，但状态要一眼能看出 */
.sound-toggle { margin-top: 10px; width: 100%; }
.sound-toggle[aria-pressed="false"] { color: var(--text-faint); }

/* 审批中心「按类型分区」的分隔条（v1.44.0，用户第 4 条：两类审核流程分类展示）。
   两块（新建项目 / 费用报销）之间需要一道明确的界，否则看起来是一张连着的表。
   ⚠️ 故意做得轻 —— 一条细线 + 一枚小标签，别做成大标题把页面切碎。 */
.type-sep { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; }
.type-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.type-sep span { font-size: 13px; font-weight: 700; color: var(--text-dim); letter-spacing: .3px; }

/* —— 系统日志页 —— */
.log-filter-card { margin-bottom: 14px; }
.log-filter {
  display: grid; gap: 12px; align-items: end;
  grid-template-columns: repeat(auto-fit, minmax(166px, 1fr));
}
.lf { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lf > span { font-size: 12px; color: var(--text-dim); }
.lf-wide { grid-column: span 2; }
.lf-mini { max-width: 132px; flex: 0 0 auto; }
.lf-actions { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; }
.log-quick {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border);
}
.log-quick .grow { flex: 1; }
.log-chip {
  appearance: none; cursor: pointer; font-size: 12.5px;
  padding: 6px 14px; border-radius: 999px;
  color: var(--text-dim); background: var(--surface-2);
  border: 1px solid var(--border);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.log-chip:hover { color: var(--text); border-color: var(--border-strong); }
.log-chip.active {
  color: var(--accent-text); border-color: var(--accent);
  background: var(--accent-soft); box-shadow: none;
}
.log-summary {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-bottom: 12px; font-size: 12.5px; color: var(--text-dim);
}
.log-summary b { color: var(--text); font-variant-numeric: tabular-nums; }
.log-summary .ls-ok b { color: var(--green); }
.log-summary .ls-bad b { color: var(--red); }
.log-table { min-width: 1080px; }
.log-table .log-ts { white-space: nowrap; font-size: 12.5px; }
.log-table .log-act { white-space: nowrap; font-weight: 600; }
.log-table .log-target { max-width: 280px; }
.log-table .log-detail { max-width: 240px; }
.log-table td { vertical-align: top; }
.log-module {
  display: inline-block; padding: 3px 9px; border-radius: var(--r-xs);
  font-size: 12px; white-space: nowrap;
  color: var(--text-dim); background: var(--surface-3);
  border: none;
}
.log-pager {
  display: flex; align-items: center; gap: 10px;
  padding-top: 12px; margin-top: 4px;
  border-top: 1px solid var(--border); font-size: 12.5px;
}
.log-pager .grow { flex: 1; }

/* ==========================================================================
   18. 记录归属（指派给业务员）
   ========================================================================== */

.owner-cell { white-space: nowrap; }
.assign-target { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.assign-sub { font-size: 12.5px; color: var(--text-dim); margin-bottom: 12px; }
.assign-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 46vh; overflow: auto; padding: 2px;
}
.assign-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface-2);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.assign-row:hover { border-color: var(--border-strong); }
.assign-row:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
/* ⚠️ 同一个 .assign-row 现在承载两种控件：项目/商机指派是**单选**，
   主数据「赋予」是**多选**（v1.45.0）—— 两种都要上色，别只写 radio。 */
.assign-row input[type="radio"],
.assign-row input[type="checkbox"] { accent-color: var(--accent); cursor: pointer; }
.assign-row.is-off input { cursor: not-allowed; }
.assign-name { flex: 1; font-size: 13px; color: var(--text); }

/* ==========================================================================
   19. 安全设置区 / 策略条
   ========================================================================== */

.policy-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 14px; padding: 10px 14px;
  font-size: 12.5px; line-height: 1.6;
  color: var(--amber);
  background: rgba(180, 83, 9, 0.07);
  border: 1px solid rgba(180, 83, 9, 0.24);
  border-radius: var(--r-md);
}
body[data-theme="dark"] .policy-bar { background: rgba(251, 191, 36, 0.09); border-color: rgba(251, 191, 36, 0.26); }
.policy-bar .icon-btn { margin-left: auto; color: var(--text-dim); }
.policy-bar .icon-btn + .icon-btn { margin-left: 0; }

.pwd-hint {
  display: flex; flex-wrap: wrap; gap: 6px 12px;
  font-size: 11px; line-height: 1.6; min-height: 0;
}
.pwd-hint > span { color: var(--text-faint); white-space: nowrap; }
.pwd-hint > span.ok { color: var(--green); }
.pwd-hint > span.bad { flex-basis: 100%; color: var(--red); white-space: normal; }

.sec-note { margin: 0 0 12px; font-size: 12px; line-height: 1.7; color: var(--text-dim); }
.sec-note b { color: var(--text); }
.sec-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.sec-divider { height: 1px; margin: 16px 0; background: var(--border); }

.chk-line {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-dim); cursor: pointer;
}
.chk-line input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.chk-line input[type="checkbox"]:disabled { cursor: not-allowed; }

/* 用户与权限页「安全状态」单元格 */
.sec-cell { display: flex; flex-wrap: wrap; gap: 5px; }
.sec-cell .pill { font-size: 10.5px; padding: 2px 7px; }

/* 用户与权限页「企业微信」单元格（v1.42.0）：
   收件地址（UserID/手机号）可能挺长，用等宽小字 + 省略号，hover 由 title 兜底看全。
   不换行是刻意的 —— 让这一列宽度稳定，不然一个长 UserID 会把整张表撑变形。 */
.wecom-cell { white-space: nowrap; }
.wecom-cell .pill {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 10.5px; padding: 2px 7px;
  max-width: 150px; overflow: hidden; text-overflow: ellipsis; display: inline-block;
  vertical-align: middle;
}
.wecom-cell .icon-btn { margin-left: 6px; vertical-align: middle; }

/* ==========================================================================
   20. 登录页
   ========================================================================== */

.login-body { overflow: auto; background: var(--bg); }

.login-wrap {
  width: 100%; min-height: 100vh;
  display: grid; grid-template-columns: 1.02fr 1fr;
  /* 整页一条连续渐变，左右两栏都不再自带底色（否则会出现分界线）。
     第一条是 color-mix / 变量失效时的兜底，露出 body 的中性底色。 */
  background: var(--bg);
  background: var(--login-canvas);
}
.login-theme { position: fixed; top: 18px; right: 18px; z-index: 40; }

/* —— 左侧品牌区（不再自带底色，压在整页渐变上）—— */
.login-aside {
  display: flex; flex-direction: column; justify-content: center;
  gap: 22px; padding: 56px 52px;
  background: transparent;
  color: #fff;
}
.la-inner { position: relative; max-width: 430px; }
/* 品牌 logo 直接压在彩色面板上（反白透明版，无白色底板） */
.la-brand {
  display: inline-flex; align-items: center;
  margin-bottom: 34px;
}
.la-brand img { display: block; width: 214px; height: auto; }
.la-slogan {
  font-size: 27px; font-weight: 800; line-height: 1.4;
  letter-spacing: 0.4px; margin-bottom: 12px;
  white-space: nowrap;                 /* 标语强制单行显示 */
}
.la-desc { font-size: 13.5px; line-height: 1.8; opacity: 0.82; }
.la-points {
  list-style: none; margin-top: 30px;
  display: flex; flex-direction: column; gap: 12px;
}
.la-points li {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; opacity: 0.92;
}
.la-points li i {
  flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; font-style: normal;
  font-size: 10px; background: rgba(255, 255, 255, 0.22);
}
.la-foot {
  position: relative; margin-top: 44px;
  font-size: 11px; letter-spacing: 0.4px; opacity: 0.68;
}
/* 登录页也能切配色（只改配色，不改明暗） */
.la-skins { display: flex; gap: 8px; margin-bottom: 14px; }
.la-skin {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  cursor: pointer; padding: 0;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.la-skin:hover { transform: scale(1.12); }
.la-skin.on { border-color: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3); }
.la-copy { line-height: 1.6; }

/* ICP 备案号（登录页品牌区底部；法律要求展示，且必须可点击跳转工信部）。
   底色是深色品牌区（.login-aside）→ 用 currentColor 继承白字，
   下划线用半透明白，免得在浅色主题下也硬编码成白色。 */
.la-icp {
  color: inherit; text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  transition: border-color 0.15s ease;
}
.la-icp:hover { border-bottom-color: currentColor; }

/* —— 右侧表单区（同样不再自带底色）—— */
.login-main {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px;
  background: transparent;
}
.login-card {
  width: 392px; max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 32px 30px 24px;
  box-shadow: var(--shadow-md);
  text-align: center;
}
/* 桌面分栏时左侧已有品牌，右侧不再重复整块 logo */
.login-main .login-logo { display: none; }

/* ⚠️ 容器**不能**再带 background / border / padding。
   它就是「暗色下那块白方块」的另一半原因 —— 图片去掉白底只解决一半，容器自己
   还是 #fff 的话，暗色卡片上照样是一个白色矩形（2026-09-23 实测踩坑）。
   padding 也一并去掉，否则图案外面多一层内边距，看着比桌面版缩一圈。 */
.login-logo {
  position: relative;
  margin: 0 auto 16px;
  display: inline-flex; align-items: center; justify-content: center;
}
.login-logo::after { content: none; }
.login-logo img { display: block; width: 200px; max-width: 100%; height: auto; }
/* 深浅两版切换：亮色用深蓝图案压白卡片；暗色必须换白字版，否则深蓝在深底上糊成一片。
   两版长宽比 3.380 / 3.361（差 0.58%），切换主题时高度几乎不跳。 */
.login-logo img.ll-dark { display: none; }
body[data-theme="dark"] .login-logo img.ll-light { display: none; }
body[data-theme="dark"] .login-logo img.ll-dark { display: block; }
.login-logo svg { width: 30px; height: 30px; }

.login-title { font-size: 20px; font-weight: 700; color: var(--text); }
.login-sub { font-size: 12px; color: var(--text-faint); margin: 7px 0 24px; line-height: 1.6; }
.login-field { text-align: left; margin-bottom: 14px; }
.login-label { display: block; font-size: 12px; color: var(--text-dim); font-weight: 600; margin-bottom: 6px; }
.login-btn { width: 100%; justify-content: center; margin-top: 8px; padding: 11px; font-size: 13.5px; }
.login-err { min-height: 18px; font-size: 12.5px; color: var(--red); margin-top: 10px; }
.login-foot { margin-top: 18px; font-size: 11px; color: var(--text-faint); line-height: 1.7; }

/* 步骤条 */
.login-steps {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin: -6px 0 20px;
}
.login-step {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--text-faint); font-weight: 600;
}
.login-step b {
  display: inline-grid; place-items: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface-3); border: 1px solid var(--border);
  font-size: 11px; font-weight: 700;
}
.login-step.active { color: var(--accent-text); }
.login-step.active b { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.login-step-line { width: 32px; height: 1px; background: var(--border); }

.login-hint {
  font-size: 12.5px; color: var(--text-dim);
  line-height: 1.75; margin: 0 0 14px; text-align: left;
}
.login-hint.small { font-size: 11.5px; color: var(--text-faint); }
.login-hint b { color: var(--text); }
.login-warn { font-size: 12px; color: var(--amber); margin-top: 6px; line-height: 1.6; }

/* 图形验证码 */
.captcha-row { display: flex; align-items: stretch; gap: 10px; }
.captcha-img {
  flex: 0 0 132px; display: grid; place-items: center;
  padding: 0; cursor: pointer; overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  transition: border-color 0.15s ease;
}
.captcha-img:hover { border-color: var(--accent); }
.captcha-img svg { display: block; width: 100%; height: 44px; }

/* 密码强度 */
.pwd-meter { margin: 2px 0 14px; text-align: left; }
.pwd-meter-bar { height: 5px; border-radius: 99px; overflow: hidden; background: var(--surface-3); }
.pwd-meter-bar > i {
  display: block; height: 100%; width: 0;
  border-radius: 99px; transition: width 0.22s ease, background 0.22s ease;
  background: var(--red);
}
.pwd-meter-bar > i.lv1 { width: 25%; background: var(--red); }
.pwd-meter-bar > i.lv2 { width: 50%; background: var(--amber); }
.pwd-meter-bar > i.lv3 { width: 75%; background: var(--accent); }
.pwd-meter-bar > i.lv4 { width: 100%; background: var(--green); }
.pwd-meter-text { font-size: 11.5px; color: var(--text-dim); margin-top: 7px; }
.pwd-rules { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.pwd-rules li { font-size: 11px; color: var(--text-faint); white-space: nowrap; }
.pwd-rules li.ok { color: var(--green); }

/* 动态码输入 */
.code-input {
  font-family: var(--font-mono);
  font-size: 19px; letter-spacing: 0.3em; text-align: center;
  padding: 11px 10px;
}

/* 二维码与手动密钥 */
.qr-box {
  display: grid; place-items: center; padding: 12px;
  margin-bottom: 14px; border-radius: var(--r-md);
  background: #fff; border: 1px solid var(--border);
}
.qr-box svg { display: block; width: 172px; height: 172px; }
.secret-code {
  font-family: var(--font-mono);
  font-size: 12.5px; letter-spacing: 0.08em; word-break: break-all;
  padding: 3px 8px; border-radius: var(--r-xs);
  background: var(--surface-3); color: var(--text);
}

/* 恢复码 */
.recovery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.recovery-grid code {
  font-family: var(--font-mono);
  font-size: 13px; letter-spacing: 0.06em; text-align: center;
  padding: 9px 6px; border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px dashed var(--border-strong); color: var(--text);
}
.recovery-actions { display: flex; gap: 10px; margin-bottom: 6px; }
.recovery-actions .btn { flex: 1; justify-content: center; }

/* ==========================================================================
   21. 响应式
   ========================================================================== */

@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  /* ⚠️ v1.51.1：`.dash-grid` 从这里**摘掉**了 —— 新版工作台的 3 列 → 2 列断点定义在 §9.1.7，
     而这条规则写在它后面、优先级又相同 → 留着会把「窄屏两列」压回单列。
     ⛔ 也别再往这里塞 `.kpi-grid / .mod-grid / .strip`：它们各自的断点都在 §9.1.7 里，写两处必打架。 */
  .settings-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  /* 6 列栅格在窄屏也要塌成单列，否则每格只剩几十像素 */
  .form-grid.as-grid6 { grid-template-columns: 1fr; }
  .form-grid.as-grid6 > .form-group,
  .form-grid.as-grid6 > .form-group.third { grid-column: auto; }
  .summary-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .login-wrap { grid-template-columns: 1fr; }
  /* ⚠️ grid 子项默认 min-width:auto，**不会**缩到比内容的 min-content 更窄 ——
     卡片是固定 width:392px、容器左右各 24px 内边距，合计 440px，在 390 / 375 的机器上
     直接把布局撑破：整页能左右拖动、右侧被切掉（实测 iPhone 62px / Z Fold7 外屏 65px）。
     给子项 min-width:0 才允许它收缩，卡片上那句 max-width:100% 这时才真正生效。 */
  .login-wrap > * { min-width: 0; }
  .login-aside { display: none; }
  /* 单栏时把 logo 加回来 */
  .login-main .login-logo { display: inline-flex; }
  .login-card {
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }
}

/* —— 触摸设备的输入控件：判据与屏幕宽度**无关** ——
   iOS 聚焦自动放大跟宽度没关系：iPad Air 横屏 1180px 一样中招（实测字号 13px，
   点输入框整页被放大且不缩回）。所以判据用 (pointer: coarse) 抓触摸设备，
   再把「窄窗口」并进来（桌面上把窗口拖窄同样需要放大）。
   桌面鼠标设备（pointer: fine 且宽 >980）**完全不受影响**，保持原来的紧凑 13px / 40px。
   16px 是硬阈值不是审美偏好；44px 是 Apple HIG 的最小触摸目标。 */
@media (max-width: 980px), (pointer: coarse) {
  .field-input, .field-select { font-size: 16px; height: 44px; }
  .login-btn { min-height: 44px; }
}

@media (max-width: 900px) {
  .sidebar { width: 68px; padding: 18px 10px; }
  /* 注意：导航标签必须由 .nav-label 这个 span 包裹才会被隐藏。
     早期写成 span:not(.nav-ico) 是错的 —— index.html 里标签是裸文本节点，
     那个选择器选不中任何元素，文字会被挤在 68px 里竖排换行。 */
  .brand-text, .sidebar-foot, .nav-label { display: none; }
  .brand { justify-content: center; padding: 2px 0 18px; }
  .nav-item { justify-content: center; padding: 11px 0; }
  .nav-ico { font-size: 16px; }
  /* 窄屏标签隐藏后，徽标缩成图标右上角的小圆点：位置放不下数字，但「有事」要看得见。
     加一圈与侧栏同色的描边，圆点压在图标上也分得清。 */
  .nav-badge {
    position: absolute; top: 5px; right: 9px;
    min-width: 10px; height: 10px; margin: 0; padding: 0;
    font-size: 0; line-height: 0;
    box-sizing: content-box;
    background: var(--badge-fg);
    border: 2px solid var(--sidebar-bg);
  }
  #btn-logout { font-size: 0 !important; padding: 8px 0 !important; }
  #btn-logout::before { content: "⏻"; font-size: 15px; }
  .topbar, .view { padding-left: 18px; padding-right: 18px; }
}

@media (max-width: 820px) {
  .lf-wide { grid-column: span 1; }
}

@media (max-width: 700px) {
  .toolbar .btn { height: auto; }
  .search-wrap input, .dash-tools .search-wrap input { width: 100%; }
  .search-wrap { flex: 1 1 100%; }
  /* ⚠️ v1.51.1：仪表盘的分组容器不再是 display:contents（环已删），
     但它们的窄屏断点统一在 §9.1.7，这里仍然只留 .stat-grid（别的页在用的那个网格）。 */
  .stat-grid { grid-template-columns: 1fr; }
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal { width: calc(100vw - 24px); }
  .proj-modal { flex-direction: column; }
  .proj-nav { width: 100%; flex-direction: row; flex-wrap: wrap; position: static; }
  .login-card { padding: 26px 20px 20px; }
}

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid > label.span2 { grid-column: auto; }
  .log-filter { grid-template-columns: 1fr; }
  .lf-mini { max-width: none; }
  .recovery-grid { grid-template-columns: 1fr; }
  .captcha-img { flex-basis: 108px; }
}

/* ============================= 费用报销 ============================= */
/* 仪表盘板块（四行申请表单）+ 费用审批页 + 审批详情弹窗 */
/* 墓碑：报销填单区已从页面收进「新增报销」弹窗（按钮走 .modal-foot），此规则暂无引用。
   保留是为了以后若再把表单内联回页面时不用重写；确认长期不用可删。 */
.rb-actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.rb-total-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.rb-total-row #rb-total { color: var(--red); font-weight: 700; font-variant-numeric: tabular-nums; }
.rb-pending-file {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px; font-size: 13px; color: var(--text-dim);
}
.rb-pending-file a { color: var(--accent-text); text-decoration: none; }
.rb-pending-file a:hover { text-decoration: underline; }
.rb-detail-head {
  display: flex; flex-wrap: wrap; gap: 18px; align-items: center;
  font-size: 13px; color: var(--text);
}
.rb-trail { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.rb-trail-title { font-size: 12.5px; color: var(--text-dim); margin-bottom: 8px; }
.rb-trail-row {
  display: flex; gap: 10px; align-items: center;
  font-size: 12.5px; margin-bottom: 6px; flex-wrap: wrap;
}
.rb-files { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; }
.rb-files a { color: var(--accent-text); text-decoration: none; }
.rb-files a:hover { text-decoration: underline; }
.rb-landed { margin-top: 12px; font-size: 13px; color: var(--green); }

/* ---- 待办提醒浮层（v37，每次进系统只弹一次）----
   每一行都是一颗**按钮**（整行可点，直接跳到对应页面），不是纯文字列表 ——
   「强提醒」的意义在于点一下就能去处理，而不是看完还得自己找菜单。 */
.todo-list { display: flex; flex-direction: column; gap: 8px; }
.todo-row {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 12px; align-items: center; width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.todo-row:hover { background: var(--hover-bg); border-color: var(--border-strong); }
/* 数字用琥珀：与侧栏徽标、「待我审批」统计卡同一套语义色 */
.todo-n {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px; padding: 0 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--amber) 14%, transparent);
  color: var(--amber);
  font-size: 13px; font-weight: 700; line-height: 1;
}
.todo-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.todo-txt b { font-size: 13.5px; font-weight: 600; color: var(--text); }
.todo-txt i { font-style: normal; font-size: 12px; color: var(--text-dim); }
.todo-go { font-size: 12.5px; color: var(--accent-text); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
