/* 客户档案管理系统 —— 统一样式（商业软件风格）

   设计取向：信息密度优先、可读性优先（销售每天要用，不是展示页），
   在此前提下按主流商业后台的样子统一：左侧导航 + 顶栏 + 内容区卡片。

   ── 三条硬规则（改样式前先看）────────────────────────────────────
   1. **颜色只能出现在本文件**：先写进 :root 令牌，再在 [data-theme="…"] 里覆盖。
      模板与 JS 一律用 var(--…) 或读计算样式 —— 页面里写死 #rrggbb 会让那套主题下
      字看不见（深色底 + 深色字）。新增配色 = 加一个覆盖块 + app/theme.py 加一行。
   2. **类名是模板的接口**，改名等于改所有页面。加新类可以，删旧类要先全库搜。
   3. **不引外部 CDN / 字体**：内网与离线机器都要能开出正确的样子（守 R02）。
   ───────────────────────────────────────────────────────────── */

/* ================================================================ 结构令牌 */
:root {
  --sidebar-w: 232px;
  --topbar-h: 54px;
  /* 内容区宽度上限（用户 2026-10-11）：
     「左侧功能导航栏宽度没问题，但右侧具体功能、配置、结果展示页面宽度可以适当增加，
       当前右侧页面左右两侧均有很大区域的空白区域，造成页面内容排版显示被压缩成多行。」

     原来 1440px 在 1920 宽的屏上左右各留 ~240px 空白，而表格/表单被压得换行。
     提到 1760px 后：1920 屏左右各留 ~64px（仍留呼吸位，不至于贴边），
     而 1440 及以下的屏**完全不受影响**（内容本来就比上限窄，max-width 不起作用）。
     ⚠ 没做成「铺满整个宽度」：长行文字（说明段落）拉太宽会难读 ——
       所以说明类文字另有限宽（见 .cat-note 等），表格才吃满宽度。 */
  --content-max: 1760px;
  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 14px;
  /* R233 校验补的：弹层/面板用的是 md（10px 与 14px 之间那一档），
     原先只写在规则里、令牌从未定义 → `border-radius` 静默失效（浏览器直接丢弃该声明）。 */
  --radius-md: 12px;
}

/* 超宽屏（≥2200px）再放宽一档：这类屏上 1760 又显得中间一坨。
   仍然留边，不铺满。 */
@media (min-width: 2200px) {
  :root { --content-max: 2000px; }
}

/* ================================================================ 配色：经典蓝（默认） */
:root,
[data-theme="default"] {
  --bg: #f4f6f8;
  /* 登录页背景图：默认 none（用样式自带渐变），有图时页面内联覆盖 */
  --lg-bg: none;
  --card: #ffffff;
  --surface-2: #fafbfc;
  --surface-3: #f1f4f8;
  --border: #e2e6ec;
  --border-soft: #eef1f5;
  --border-strong: #cfd6e0;
  --text: #1f2430;
  --muted: #6b7484;
  --faint: #98a1b0;
  --primary: #2f6feb;
  --primary-dark: #1f57c8;
  --primary-soft: #eaf1fe;
  --primary-border: #c9dcfb;
  --on-primary: #ffffff;
  --ok: #1a7f37;
  --ok-soft: #e9f6ec;
  /* R195：聊天浮层的阴影直接复用现成的 `--shadow`（它在每个主题里都定义好了，
     而且是**整条阴影简写**、不是一个颜色值 —— 拼进 `0 6px 18px var(--shadow)` 会变非法值）。 */
  --ok-border: #c5e6cd;
  --warn: #a86a00;
  --warn-soft: #fdf4e3;
  --warn-border: #f0dcb4;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --danger-border: #f4c7c2;
  --hover: #fafbfd;
  --thead: #fafbfc;
  --input-bg: #ffffff;
  --ring: rgba(47, 111, 235, .14);
  --overlay: rgba(15, 22, 36, .38);
  --sidebar-bg: #ffffff;
  --sidebar-text: #3b4351;
  --sidebar-muted: #8b94a3;
  --sidebar-hover: #f2f5fa;
  --sidebar-active-bg: #eaf1fe;
  --sidebar-active-text: #2f6feb;
  --sidebar-border: #e7ebf1;
  --topbar-bg: #ffffff;
  --topbar-border: #e7ebf1;
  --shadow: 0 1px 3px rgba(20, 30, 50, .06), 0 4px 16px rgba(20, 30, 50, .04);
  --shadow-sm: 0 1px 2px rgba(20, 30, 50, .06);
  --shadow-lg: 0 10px 34px rgba(20, 40, 80, .12);
  --login-grad: linear-gradient(140deg, #eef3fb, #f7f9fc 55%, #eef6f1);
  --chart-grid: #eef1f5;
  --chart-grid-x: #f2f4f8;
  --chart-axis: #cbd2dc;
  --chart-label: #6b7484;
  --chart-measured: #2f6feb;
  --chart-p3: #e8b4b0;
  --chart-p15: #b9d0f2;
  --chart-p50: #8fb4e8;
  /* R360：饼图分片配色（8 片；超出合并「其他」） */
  --pie-0: #2f6feb;
  --pie-1: #e0985a;
  --pie-2: #4f9d69;
  --pie-3: #c46b7a;
  --pie-4: #7a6fc0;
  --pie-5: #3fa3a3;
  --pie-6: #b08a3e;
  --pie-7: #8a94a6;
  --map-0: #eef2f8;
  --map-1: #c9dcf5;
  --map-2: #93b8ec;
  --map-3: #5a8fe0;
  --map-4: #2f6feb;
}

/* ================================================================ 配色：暗黑 */
[data-theme="dark"] {
  --bg: #12151a;
  /* 登录页背景图：默认 none（用样式自带渐变），有图时页面内联覆盖 */
  --lg-bg: none;
  --card: #1a1f27;
  --surface-2: #20262f;
  --surface-3: #252c36;
  --border: #2c3440;
  --border-soft: #252c36;
  --border-strong: #3b4653;
  --text: #e6e9ef;
  --muted: #9aa4b2;
  --faint: #6f7a89;
  --primary: #4f8ef7;
  --primary-dark: #6ba0f9;
  --primary-soft: #1e2b41;
  --primary-border: #2f4468;
  --on-primary: #0e1319;
  --ok: #4cc46a;
  --ok-soft: #16281c;
  --ok-border: #27512f;
  --warn: #e0a83c;
  --warn-soft: #2b2416;
  --warn-border: #574623;
  --danger: #ef6a5c;
  --danger-soft: #2e1a18;
  --danger-border: #5b2f2a;
  --hover: #20262f;
  --thead: #20262f;
  --input-bg: #161b22;
  --ring: rgba(79, 142, 247, .26);
  --overlay: rgba(0, 0, 0, .58);
  --sidebar-bg: #161b22;
  --sidebar-text: #c6cdd8;
  --sidebar-muted: #7b8694;
  --sidebar-hover: #20262f;
  --sidebar-active-bg: #1e2b41;
  --sidebar-active-text: #6ba0f9;
  --sidebar-border: #242b35;
  --topbar-bg: #1a1f27;
  --topbar-border: #262e38;
  --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .28);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-lg: 0 12px 38px rgba(0, 0, 0, .5);
  --login-grad: linear-gradient(140deg, #141920, #10141a 55%, #131a17);
  --chart-grid: #262d38;
  --chart-grid-x: #212832;
  --chart-axis: #495462;
  --chart-label: #9aa4b2;
  --chart-measured: #6ba0f9;
  --chart-p3: #a86e6a;
  --chart-p15: #4d6c96;
  --chart-p50: #6f93c9;
  /* R360：饼图分片配色（8 片；超出合并「其他」） */
  --pie-0: #6ba0f9;
  --pie-1: #d99a63;
  --pie-2: #66b37f;
  --pie-3: #d3818f;
  --pie-4: #9089d4;
  --pie-5: #4fb3b3;
  --pie-6: #c09a52;
  --pie-7: #98a3b5;
  --map-0: #232a35;
  --map-1: #2b3d58;
  --map-2: #37608f;
  --map-3: #4a86c8;
  --map-4: #6ba0f9;
}

/* ================================================================ 配色：护眼绿 */
[data-theme="green"] {
  --bg: #eaf0e8;
  --lg-bg: none;
  --card: #f8fbf6;
  --surface-2: #f2f7f0;
  --surface-3: #e7eee4;
  --border: #d3dfcd;
  --border-soft: #e0e9dc;
  --border-strong: #b9cbb2;
  --text: #243027;
  --muted: #5f6f5c;
  --faint: #8b9a87;
  --primary: #3f7d54;
  --primary-dark: #336545;
  --primary-soft: #e1efe2;
  --primary-border: #bcd8bf;
  --on-primary: #ffffff;
  --ok: #2f7a44;
  --ok-soft: #e0f0e1;
  --ok-border: #b9d9bc;
  --warn: #8f6a12;
  --warn-soft: #f6efd9;
  --warn-border: #e3d3a5;
  --danger: #a8402f;
  --danger-soft: #f7e5e0;
  --danger-border: #e3bfb6;
  --hover: #f0f6ee;
  --thead: #f0f5ee;
  --input-bg: #ffffff;
  --ring: rgba(63, 125, 84, .16);
  --overlay: rgba(30, 45, 30, .38);
  --sidebar-bg: #f4f9f2;
  --sidebar-text: #33452f;
  --sidebar-muted: #7e8f7a;
  --sidebar-hover: #e6efe3;
  --sidebar-active-bg: #dcecdc;
  --sidebar-active-text: #2f6b45;
  --sidebar-border: #dbe6d7;
  --topbar-bg: #f8fbf6;
  --topbar-border: #dbe6d7;
  --shadow: 0 1px 3px rgba(30, 50, 32, .07), 0 4px 16px rgba(30, 50, 32, .05);
  --shadow-sm: 0 1px 2px rgba(30, 50, 32, .07);
  --shadow-lg: 0 10px 34px rgba(30, 50, 32, .14);
  --login-grad: linear-gradient(140deg, #e3efe0, #f4f9f2 55%, #eaf0e8);
  --chart-grid: #e0e9dc;
  --chart-grid-x: #e6eee3;
  --chart-axis: #b0c1a9;
  --chart-label: #5f6f5c;
  --chart-measured: #3f7d54;
  --chart-p3: #d9a49c;
  --chart-p15: #a9c6a4;
  --chart-p50: #6ea27a;
  /* R360：饼图分片配色（8 片；超出合并「其他」） */
  --pie-0: #3f7d54;
  --pie-1: #c08a4a;
  --pie-2: #5b8fb0;
  --pie-3: #b5717a;
  --pie-4: #7d719f;
  --pie-5: #4a9090;
  --pie-6: #9a8340;
  --pie-7: #8b9489;
  --map-0: #e9f0e9;
  --map-1: #c3d9c4;
  --map-2: #93bb95;
  --map-3: #5f9263;
  --map-4: #3f7d54;
}

/* ================================================================ 配色：蓝灰商务 */
[data-theme="slate"] {
  --bg: #eef1f5;
  --lg-bg: none;
  --card: #ffffff;
  --surface-2: #f7f9fb;
  --surface-3: #eceff4;
  --border: #d8dee6;
  --border-soft: #e6eaf0;
  --border-strong: #bcc6d2;
  --text: #1e2833;
  --muted: #5f6b7a;
  --faint: #8d99a8;
  --primary: #3a5a7d;
  --primary-dark: #2c4763;
  --primary-soft: #e7edf4;
  --primary-border: #c2d0de;
  --on-primary: #ffffff;
  --ok: #2b6b52;
  --ok-soft: #e4f0ea;
  --ok-border: #bcd8ca;
  --warn: #8a6414;
  --warn-soft: #f5efdd;
  --warn-border: #ded0a9;
  --danger: #a83f38;
  --danger-soft: #f6e6e4;
  --danger-border: #ddbfbb;
  --hover: #f4f7fa;
  --thead: #f2f5f9;
  --input-bg: #ffffff;
  --ring: rgba(58, 90, 125, .16);
  --overlay: rgba(20, 30, 42, .42);
  --sidebar-bg: #26323f;
  --sidebar-text: #cdd6e0;
  --sidebar-muted: #8593a3;
  --sidebar-hover: #2f3d4c;
  --sidebar-active-bg: #3a5a7d;
  --sidebar-active-text: #ffffff;
  --sidebar-border: #313e4d;
  --topbar-bg: #ffffff;
  --topbar-border: #dde3ea;
  --shadow: 0 1px 3px rgba(25, 35, 50, .07), 0 4px 16px rgba(25, 35, 50, .05);
  --shadow-sm: 0 1px 2px rgba(25, 35, 50, .07);
  --shadow-lg: 0 10px 34px rgba(25, 35, 50, .16);
  --login-grad: linear-gradient(140deg, #e7edf4, #f7f9fb 55%, #e9eef3);
  --chart-grid: #e6eaf0;
  --chart-grid-x: #eceff4;
  --chart-axis: #b6c1ce;
  --chart-label: #5f6b7a;
  --chart-measured: #3a5a7d;
  --chart-p3: #cf9891;
  --chart-p15: #a7bdd2;
  --chart-p50: #6f8ba8;
  /* R360：饼图分片配色（8 片；超出合并「其他」） */
  --pie-0: #3a5a7d;
  --pie-1: #b08a5e;
  --pie-2: #4f7f6a;
  --pie-3: #a3747c;
  --pie-4: #6f6b93;
  --pie-5: #4a8a8a;
  --pie-6: #96793d;
  --pie-7: #7f8899;
  --map-0: #e8ecf1;
  --map-1: #c6d2df;
  --map-2: #9aafc4;
  --map-3: #6b8aa6;
  --map-4: #3a5a7d;
}

/* ================================================================ 配色：暖阳米黄 */
[data-theme="warm"] {
  --bg: #f3ece0;
  --lg-bg: none;
  --card: #fdfaf3;
  --surface-2: #f9f4e9;
  --surface-3: #f1e9da;
  --border: #e3d8c4;
  --border-soft: #ece3d3;
  --border-strong: #cdbfa6;
  --text: #3a2f24;
  --muted: #776a58;
  --faint: #a1957f;
  --primary: #b06a2c;
  --primary-dark: #94551f;
  --primary-soft: #f7ebda;
  --primary-border: #e2c7a3;
  --on-primary: #ffffff;
  --ok: #5d7a35;
  --ok-soft: #eef2e0;
  --ok-border: #cfdcb2;
  --warn: #9a6b12;
  --warn-soft: #f8efd8;
  --warn-border: #e4d1a3;
  --danger: #a8432f;
  --danger-soft: #f8e6de;
  --danger-border: #e3c1b2;
  --hover: #faf5ea;
  --thead: #f7f1e6;
  --input-bg: #fffdf8;
  --ring: rgba(176, 106, 44, .16);
  --overlay: rgba(60, 45, 25, .40);
  --sidebar-bg: #f9f3e8;
  --sidebar-text: #453729;
  --sidebar-muted: #8d7f6c;
  --sidebar-hover: #f1e7d6;
  --sidebar-active-bg: #f0e0c9;
  --sidebar-active-text: #96591c;
  --sidebar-border: #e8ddc9;
  --topbar-bg: #fdfaf3;
  --topbar-border: #e8ddc9;
  --shadow: 0 1px 3px rgba(60, 45, 25, .08), 0 4px 16px rgba(60, 45, 25, .05);
  --shadow-sm: 0 1px 2px rgba(60, 45, 25, .08);
  --shadow-lg: 0 10px 34px rgba(60, 45, 25, .16);
  --login-grad: linear-gradient(140deg, #f4ebda, #fdfaf3 55%, #f2ece0);
  --chart-grid: #ece3d3;
  --chart-grid-x: #f1e9da;
  --chart-axis: #c8b99f;
  --chart-label: #776a58;
  --chart-measured: #b06a2c;
  --chart-p3: #cf9c8a;
  --chart-p15: #ddc49a;
  --chart-p50: #c08f52;
  /* R360：饼图分片配色（8 片；超出合并「其他」） */
  --pie-0: #b4553a;
  --pie-1: #c8913f;
  --pie-2: #5c8a5c;
  --pie-3: #a5677a;
  --pie-4: #7b6493;
  --pie-5: #3f8f8f;
  --pie-6: #8a7040;
  --pie-7: #8d8d8d;
  --map-0: #f6ece0;
  --map-1: #e6d0b4;
  --map-2: #d4ab7d;
  --map-3: #c0854a;
  --map-4: #b4553a;
}

/* ================================================================ 基础 */
* { box-sizing: border-box; }

/* `hidden` 属性必须真的能隐藏（用户 2026-10-31 报「海外件两个字段不消失」）。
   ⚠ 坑：HTML 的 `hidden` 只对应浏览器默认样式 `[hidden]{display:none}`，
     而**作者样式**里任何 `display:flex/grid/block` 优先级都比它高 ——
     于是 `<div class="oe-addr-row" hidden>` 照样铺开。
       .oe-addr-row { display: flex }   ← 这条赢了
   本项目为此已经逐个类打过三次补丁（.bf-wait / .table-scroll / .oe-gift-head），
   每次新加一个 display 容器就再踩一遍。这里统一兜底一次，往后不必再补。
   `!important` 是必要的：具体类选择器的优先级高于单个属性选择器。 */
[hidden] { display: none !important; }

/* 长说明折叠按钮（fold_long.js 用，用户 2026-10-31 需求 4）
   口径（用户两次澄清后）：超 1 行的说明**整段收起**，未超的原样显示。
   所以折叠态没有"半截文字"、也没有渐隐遮罩 —— 之前那版两者都有，
   用户看到的是「第二行被部分遮挡」，判定为失败。
   这里只管按钮样式；收起/展开由 JS 切 `hidden` 属性完成（见 app.css 顶部的
   `[hidden]{display:none!important}` 兜底）。 */
.fold-btn { display: inline-block; margin: 2px 0 10px; padding: 0;
  border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 12px; color: var(--primary); }
.fold-btn:hover { text-decoration: underline; }
/* 说明整段收起后，按钮独占一行时要有点下边距，否则紧贴下一个表单控件 */
.fold-btn + .f, .fold-btn + form { margin-top: 2px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC",
        "Hiragino Sans GB", "Segoe UI", sans-serif;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 键盘可达性：只在键盘聚焦时显示焦点环，鼠标点击不闪 */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

/* ================================================================ 骨架：侧栏 + 顶栏 */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: var(--sidebar-bg); border-right: 1px solid var(--sidebar-border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}

.sidebar .brand {
  display: flex; align-items: center; gap: 9px;
  padding: 0 16px; height: var(--topbar-h); flex: 0 0 var(--topbar-h);
  border-bottom: 1px solid var(--sidebar-border);
  color: var(--sidebar-text); font-weight: 700; font-size: 14.5px;
  text-decoration: none;
}
.sidebar .brand:hover { text-decoration: none; }
.sidebar .brand .logo {
  width: 24px; height: 24px; border-radius: 6px; flex: 0 0 24px;
  background: var(--primary); color: var(--on-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.sidebar .brand .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 自定义图标（用户 2026-10-23 需求 7）：图片按 contain 塞进 24px 方块，
   不裁切也不拉变形 —— 客户给的 logo 常常是长方形，拉成 1:1 会很难看。 */
.sidebar .brand .logo-img { object-fit: contain; background: transparent; }

.sidebar nav { padding: 10px 10px 18px; display: flex; flex-direction: column; gap: 2px; }
.sidebar .nav-group { margin-top: 12px; }
.sidebar .nav-group:first-child { margin-top: 0; }
.sidebar .nav-group > .lbl {
  color: var(--sidebar-muted); font-size: 11.5px; font-weight: 600;
  letter-spacing: .06em; padding: 6px 10px 4px;
}
.sidebar nav a {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--sidebar-text); font-size: 13.5px; text-decoration: none;
}
.sidebar nav a:hover { background: var(--sidebar-hover); text-decoration: none; }
.sidebar nav a.active {
  background: var(--sidebar-active-bg); color: var(--sidebar-active-text); font-weight: 600;
}
/* 导航项的小标记：用 CSS 画（不依赖图标字体，离线机器也不会显示成方块）
   ⚠ R226：选择器**必须同时覆盖 a 和 .nav-soon** —— 只写 `a .ico` 时，
     `.nav-soon` 里的空 `<i>` 拿不到宽高，会**整块消失**、该行比上下行少一段缩进，
     看起来就像「这一项坏了」（截图 331 第一版就是这样）。 */
.sidebar nav a .ico,
.sidebar nav .nav-soon .ico {
  width: 6px; height: 6px; border-radius: 2px; flex: 0 0 6px;
  background: var(--sidebar-muted); opacity: .55; margin: 0 5px 0 3px;
  transition: background .12s, opacity .12s;
}
.sidebar nav a:hover .ico { background: var(--sidebar-text); opacity: .9; }
.sidebar nav a.active .ico { background: var(--sidebar-active-text); opacity: 1; }
/* 导航里「框架已建、内容待定」的条目：看得见、但明确不可点（用户 2026-10-13 要求）
   R226（用户 2026-10-17）：「推荐营养品字样调整成和推荐奶粉一样，暂未上线字样写在后面」。
   改前有两个毛病，都是「一上手就不对」的观感问题：
     ① 整行用 `--sidebar-muted` 发灰 + 图标 opacity .28 → 看起来像「这项坏了/被禁用」，
        而不像「和其它菜单一样的入口，只是还没开」；
     ② 标签用 `margin-left: auto` 顶到侧栏最右边 → 名字和「暂未上线」之间空一大截，
        在这条 232px 的窄栏里像是两个不相干的东西。
   改后：文字/字号/图标与普通导航项**同一套**（不再发灰）；标签紧贴名字后面（写在后面）；
   仍然不是 <a>、光标仍是 default —— 「不可点」这件事由标签承担，不再靠"灰掉"表达。 */
.sidebar nav .nav-soon {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--sidebar-text); font-size: 13.5px;
  cursor: default;                      /* 不是手型 —— 手型会让人觉得能点 */
  user-select: none;
}
.sidebar nav .nav-soon .ico { opacity: .55; background: var(--sidebar-muted); }
/* 整行不折行：侧栏只有 ~200px，菜单名 + 标签一旦换行就会把行高撑成两倍、
   并与上下项错位（第一版实测就是这样）。名字过长时用省略号，别换行。 */
.sidebar nav .nav-soon .t {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.sidebar nav .nav-soon .soon-tag {
  flex: 0 0 auto;
  /* ⚠ 这里**不能**写 margin-left: auto —— 那会把标签顶到侧栏最右边，
     名字与标签之间空出一大截（改前就是这样）。用户要的是「写在后面」。 */
  padding: 0 5px; border-radius: 999px;
  border: 1px solid var(--sidebar-border);
  color: var(--sidebar-muted);
  font-size: 10.5px; line-height: 1.6; white-space: nowrap;
}
/* ---------------- 折线图（app/charts.py 给类名，颜色在这里定义）----------------
   线的颜色**只用已在每套配色里定义过的令牌**：
     --chart-measured（主色蓝） / --chart-p3（对比色）/ --chart-p15（浅蓝）/ --warn（警示黄）
   ⚠ 踩过的坑：我一开始自定义了 --chart-primary / --chart-secondary，但那两个令牌**任何配色里都没有**
     → `stroke: var(--chart-primary)` 被浏览器判为无效而丢弃 → 折线**压根不画**，只剩孤立的点
     （点因为写了 `fill` 会退回默认黑色，所以看着「有图」，其实线全没了）。
     加新令牌必须**同时加进全部 5 套配色块**（tests 会核对），否则就是这个下场。

   **线型按「指标」定、不按「板块」定**（用户 2026-10-13 第三轮）：
     · 颜色同指标同色 —— 销售额 = 主色、利润 = 警示黄、毛利率 = 对比色（两个板块一样，便于对照）；
     · 虚实同指标同型 —— 销售额、利润**实线**，毛利率**虚线**（它是右轴的 %，量纲不同）。
   为什么不再用「我的 = 虚线」区分板块：同一张图上「销售额是实线、毛利率是虚线」才是稳定的读图习惯，
   而板块差别两张图各自有标题、不必靠线型分辨（用户要求「向下管理中的颜色也调整成一样」）。
   类名仍是 s 前缀 / d 前缀（s = 向下管理那块、d = 我的那块），只影响**配色分组**，不再影响虚线。
   ⚠ 这里**绝不能**写成带斜杠加星号的原样写法（形如 s 斜杠星 d 斜杠星）：
     注释里的「星号加斜杠」会**提前结束注释**，后面那半句会掉进 CSS 变成非法规则，
     连带把后面的规则一起吃掉（本轮排查时真的踩到了，卡了我一次 CSS 全量自检）。 */
/* 横向可滚（横轴随数据增长）。右侧留 8px：滚动条或卡片边缘会压到**最后一个日期标签**
   （用户 2026-10-13 实报「横坐标最后一天字样有被遮挡」——根因是当时右侧只留了 12px）。 */
.chart-scroll { overflow-x: auto; overflow-y: hidden; padding: 0 8px 2px 0; }
.chart { display: block; }
.chart .grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart .zero { stroke: var(--chart-axis); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .tick { fill: var(--chart-label); font-size: 10px; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { stroke: none; }
/* 点上的数值标签：字号小、描边用卡片底色（压在网格线/折线上也读得清）。
   颜色仍只在 css 里给，模板只写类名。 */
.chart .plabel { font-size: 9.5px; paint-order: stroke; stroke: var(--card);
                 stroke-width: 2.6px; stroke-linejoin: round; }
/* 超标点的数值标签：斜体 + 与点同色，提示「这个数超出坐标范围，图上是钉住的」 */
.chart .plabel.out { font-style: italic; }
.chart .plabel.s0, .chart .plabel.d0 { fill: var(--chart-measured); }
.chart .plabel.s1, .chart .plabel.d1 { fill: var(--warn); }
.chart .plabel.s2, .chart .plabel.d2 { fill: var(--chart-p3); }
.chart .line.s0, .chart .line.d0 { stroke: var(--chart-measured); }
.chart .line.s1, .chart .line.d1 { stroke: var(--warn); }
.chart .line.s2, .chart .line.d2 { stroke: var(--chart-p3); }
/* 毛利率（第 3 条线）虚线；销售额/利润（第 0/1 条）实线 —— 与板块无关 */
.chart .line.s2, .chart .line.d2 { stroke-dasharray: 5 3; stroke-width: 1.8; }
/* 超出坐标范围的点（毛利率被截断到 ±100%）：**空心方块**，一眼看出「这个点跑到边界外了」，
   悬浮提示与数值标签仍是真实值（图好读，数字不撒谎）。用户 2026-10-13 拍板方案一。 */
.chart .dot.out { fill: var(--card); stroke: var(--text); stroke-width: 1.4; }
.chart .dot.out.s0, .chart .dot.out.d0 { stroke: var(--chart-measured); }
.chart .dot.out.s1, .chart .dot.out.d1 { stroke: var(--warn); }
.chart .dot.out.s2, .chart .dot.out.d2 { stroke: var(--chart-p3); }
.chart .dot.s0, .chart .dot.d0 { fill: var(--chart-measured); }
.chart .dot.s1, .chart .dot.d1 { fill: var(--warn); }
.chart .dot.s2, .chart .dot.d2 { fill: var(--chart-p3); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px;
          color: var(--muted); margin: 2px 0 4px; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px;
            margin-right: 5px; vertical-align: middle; }
.legend .cap { padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border);
                       color: var(--muted); font-size: 11px; }
.legend i.s0, .legend i.d0 { background: var(--chart-measured); }
.legend i.s1, .legend i.d1 { background: var(--warn); }
.legend i.s2, .legend i.d2 { background: var(--chart-p3); }
/* 图例里的线型要与图上一致：只有毛利率那条画成虚线 */
.legend i.s2, .legend i.d2 {
  height: 0; border-top: 2px dashed var(--chart-p3); background: none; }
/* 图表标题行：标题在左、月份下拉在右（用户 2026-10-13） */
.chart-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 2px; }
.chart-head h3 { margin: 0; }
.chart-head .grow { flex: 1 1 auto; }
.chart-head form { display: flex; align-items: center; gap: 6px; margin: 0; }
/* 人员选择：按组织框架分组的清单 + 按组快选 */
/* ---------------- 「向下管理」选人区（唯一实现处 _report_pick.html）----------------
   用户 2026-10-13 第三轮：**要横向排版** ——
     按组选：一行胶囊，形如「奶粉煋球 / 销售团队 / 驻马店 / 齐晴组 5 人（王君、王珂…）」；
     按人选：一行胶囊，**每个人名前一个多选框**；
     应用 / 全员合计 / 清空 放在两行**下方**。
   第一版是「左边一个纵列组 + 右边一个多选下拉」，要上下对着看才能挑人，现在改成两块横排。 */
.pick-box { border-top: 1px solid var(--border-soft); margin-top: 10px; padding-top: 8px; }
.pick-box .pick-row { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap;
                      margin-bottom: 8px; }
.pick-box .pick-row > .lbl { flex: 0 0 auto; color: var(--muted); font-size: 12.5px;
                             padding-top: 4px; }
.pick-box .chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
                  border: 1px solid var(--border); border-radius: 999px; font-size: 12.5px;
                  cursor: pointer; user-select: none; }
.pick-box .chip:hover { background: var(--hover); }
.pick-box .chip input { margin: 0; }
/* 选中态：整颗胶囊变色，一眼看出挑了哪些组/人 */
.pick-box .chip:has(input:checked) { border-color: var(--primary-border);
                                     background: var(--primary-soft); color: var(--primary-dark); }
.pick-box .chip .muted { color: var(--muted); font-size: 11.5px; }
.pick-box .chip.off { border-style: dashed; color: var(--muted); cursor: default; background: none; }
.pick-box .pick-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* 「叠加计算」勾选项：长在状态标签行里，做小一号（与 .btn.sm 同高，不撑高标题行） */
.sum-box { display: inline-flex; align-items: center; gap: 4px; margin: 0; }
.chip.sm { padding: 1px 8px; font-size: 12px; }
.chip.sm::after { content: none; }
.pick-box .pick-acts .hint { color: var(--muted); font-size: 12px; }
select.msel { min-width: 190px; max-width: 420px; height: auto; min-height: 34px; }
form.bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 4px 0 8px; }
form.bar label.f > span { white-space: nowrap; }

.sidebar .side-foot {
  margin-top: auto; padding: 12px 16px; border-top: 1px solid var(--sidebar-border);
  color: var(--sidebar-muted); font-size: 11.5px;
}

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

.topbar {
  height: var(--topbar-h); flex: 0 0 var(--topbar-h);
  background: var(--topbar-bg); border-bottom: 1px solid var(--topbar-border);
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
  position: sticky; top: 0; z-index: 50;
}
.topbar .crumb {
  color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 7px;
  /* R334：站点名/面包屑也不许折行 —— 顶栏按钮变多后它被挤成三行，
     整个顶栏高度跟着被撑开。放不下就省略号，不要断字。 */
  white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis;
}
.topbar .crumb b { color: var(--text); font-weight: 600; }
.topbar .crumb .sep { color: var(--faint); }
.topbar .grow { flex: 1; }

/* 用户区：姓名 + 角色 + 配色 + 改密码/退出 */
.topbar .who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
/* R334（2026-11-02）：右上角这一串**不许折行**。
   顶栏加了「AI 沟通辅助」入口之后可用宽度变窄，1280 宽的屏上
   「改密码」「退出」被挤成竖排（每行一个字），看着像坏了。 */
.topbar .who,
.topbar .who a { white-space: nowrap; flex: 0 0 auto; }
.topbar .who .chip {
  display: flex; align-items: center; gap: 7px; padding: 4px 10px 4px 5px;
  border: 1px solid var(--border); border-radius: 20px; background: var(--card);
  color: var(--text); white-space: nowrap;
}
.topbar .who .chip .av {
  width: 22px; height: 22px; border-radius: 50%; background: var(--primary-soft);
  color: var(--primary); display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.topbar .who .chip .rl { color: var(--muted); font-size: 12px; }

/* 配色选择器 */
.themepick { position: relative; }
.themepick > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 7px;
  padding: 5px 11px; border: 1px solid var(--border); border-radius: 20px;
  background: var(--card); color: var(--text); font-size: 13px; white-space: nowrap;
}
.themepick > summary::-webkit-details-marker { display: none; }
.themepick > summary:hover { border-color: var(--primary); color: var(--primary); }
.themepick .dots { display: inline-flex; gap: 2px; }
.themepick .dots i { width: 9px; height: 9px; border-radius: 50%; display: block; }
.themepick .menu {
  position: absolute; right: 0; top: calc(100% + 7px); z-index: 60;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 6px; min-width: 232px;
}
.themepick .menu a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-size: 13.5px;
}
.themepick .menu a:hover { background: var(--hover); text-decoration: none; }
.themepick .menu a.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.themepick .menu a .sw { display: inline-flex; gap: 2px; flex: 0 0 auto; }
.themepick .menu a .sw i { width: 11px; height: 11px; border-radius: 3px; display: block;
  border: 1px solid rgba(0, 0, 0, .08); }
.themepick .menu a .sub { color: var(--muted); font-size: 11.5px; font-weight: 400; }

/* 内容区 */
.wrap { max-width: var(--content-max); margin: 0 auto; padding: 20px 22px 40px; width: 100%; }

/* ================================================================ 页头 */
.page-head {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 16px; flex-wrap: wrap;
}
.page-head h1 { font-size: 19px; margin: 0; font-weight: 700; letter-spacing: .01em; }
.page-head .sub { color: var(--muted); font-size: 13px; }
.page-head .grow { flex: 1; }

/* 奶粉图例（R220，用户 2026-10-17）：页头标题左侧的缩略图。
   白底 + 细边框是为了让「白底商品图」在卡片背景上也看得出边界；
   object-fit: contain 保证**不裁切**（图例要能认出是哪罐，裁掉一边就没用了）。 */
.milk-thumb {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; flex: none;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); overflow: hidden;
}
.milk-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.milk-thumb-no { color: var(--muted); font-size: 12px; background: var(--surface-2); }

/* 工具条：页头下方的筛选/操作行 */
.toolbar {
  display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.toolbar .grow { flex: 1; }

/* ================================================================ 卡片 */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 16px 18px; margin-bottom: 16px;
}
.card > h2 {
  font-size: 15px; margin: 0 0 12px; padding-bottom: 9px;
  border-bottom: 1px solid var(--border-soft); font-weight: 700;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.card > h2 .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.card > h2 .grow { flex: 1; }

.grid { display: grid; gap: 16px; align-items: start; }
/* align-items:start —— 同行的卡片各自按内容高度，不要被最高的那个拉长：
   拉长后短的那张会撑出一大片空边框，看起来像加载失败。 */
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
/* R235：任务汇总顶部 6 个卡片（总数/已完成/进行中/逾期/按期率/耗时） */
.grid.c5 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* 统计块 */
.stat {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm);
}
.stat .n { font-size: 26px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.stat.alert .n { color: var(--danger); }
.stat.warn .n { color: var(--warn); }
.stat.ok .n { color: var(--ok); }
.stat.primary .n { color: var(--primary); }

/* ================================================================ 表格 */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--border-soft); }
th {
  color: var(--muted); font-weight: 600; font-size: 12.5px;
  background: var(--thead); white-space: nowrap;
}
tbody tr:hover { background: var(--hover); }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.act { white-space: nowrap; }
.table-scroll { overflow-x: auto; }

/* ================================================================ 标签 */
.tag {
  display: inline-block; padding: 1px 8px; border-radius: 20px;
  font-size: 12px; line-height: 1.7; white-space: nowrap;
  background: var(--surface-3); color: var(--muted); border: 1px solid var(--border);
}
.tag.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-border); }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }
.tag.danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }
.tag.primary { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-border); }

/* ================================================================ 表单 */
label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
label.f .req { color: var(--danger); }

/* ⚠ 必须把「没写 type 的 input」和几种新类型也列进来。
   属性选择器 `[type=text]` 只匹配**显式写了** type 的元素，
   而项目里大量模板写的是 `<input name=...>`（不写 type，浏览器默认 text）——
   这些框一直没有被样式覆盖：宽度不是 100%、圆角和边框也和别处不同，
   表现是同一张表单里输入框**宽窄不一、观感参差**（2026-10-22 录单页重排时实测到）。
   同理 `datetime-local` / `url` / `time` 这些类型以前也不在列表里。
   注：不把 `file` / `color` / `range` / `checkbox` / `radio` 拉进来 —— 它们的外观规则完全不同。 */
input:not([type]), input[type=text], input[type=password], input[type=date],
input[type=number], input[type=search], input[type=email], input[type=tel],
input[type=url], input[type=datetime-local], input[type=time], input[type=month],
select, textarea {
  width: 100%; padding: 7px 10px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font: inherit;
  background: var(--input-bg); color: var(--text);
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}
textarea { min-height: 68px; resize: vertical; }
label.f small { color: var(--muted); font-size: 12px; }
/* 勾选项：小方框 + 文字同行 */
label.chk { display: flex; align-items: flex-start; gap: 7px; margin-bottom: 8px;
  font-size: 13.5px; cursor: pointer; }
label.chk input[type=checkbox], label.chk input[type=radio] { margin: 3px 0 0; flex: 0 0 auto; }

.btn {
  display: inline-block; padding: 7px 15px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  font: inherit; font-size: 13.5px; text-align: center; white-space: nowrap;
  line-height: 1.5;
}
.btn:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 600; }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: var(--on-primary); }
.btn.danger { color: var(--danger); border-color: var(--danger-border); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }
.btn.tiny { padding: 2px 8px; font-size: 12px; border-radius: 6px; }
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; vertical-align: middle; }
/* R192（2026-10-15 实测截图发现）：inline-flex 默认会让子项**收缩** —— 一行里控件一多，
   第一个 label.f 被压窄，「归档每页」折成两行、下拉里选中的文字被裁掉。
   label 是给人读的，永远不该被压缩：不收缩 + 文字不折行（与 form.bar 同一条规矩）。 */
form.inline > label.f { flex: 0 0 auto; }
form.inline > label.f > span { white-space: nowrap; }

/* 分页下拉（_paging.html::per_select）放进**任意** flex 工具条时都可能被压窄：
   实测（2026-10-23 营养品知识层）标签「每页」被挤成竖排、下拉窄成一条缝。
   与上面 form.inline 同一条规矩，但选择器挂在下拉自己身上 ——
   不必要求每一页的工具条都恰好是 form.inline / form.bar。 */
label.f.per-sel { flex: 0 0 auto; min-width: 104px; }
label.f.per-sel > span { white-space: nowrap; }
/* inline 模式：标签与下拉同一行（工具条里其它控件都没有标签时用它） */
label.f.per-sel-inline { display: flex; align-items: center; gap: 6px; min-width: auto; }
label.f.per-sel-inline > span { margin-bottom: 0; }

/* ================================================================ 提示条 */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 10px; font-size: 13.5px;
  border: 1px solid transparent; white-space: pre-wrap; }
.flash.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-border); }
.flash.error { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }
.flash.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }
.flash.info { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-border); }
/* 中性提示（原来模板里写死 GitHub 那套灰，换主题后与页面打架） */
.flash.neutral { background: var(--surface-3); color: var(--text); border-color: var(--border); }

/* ================================================================ 语义文字色 */
/* 模板里**不要写死 #rrggbb**（深色主题下会变成深底深字，看不见）——
   需要带颜色的字用这几个类。 */
.danger-text { color: var(--danger); }
.warn-text { color: var(--warn); }
.ok-text { color: var(--ok); }
.primary-text { color: var(--primary); }
.muted-text { color: var(--muted); }

/* 代码/命令块：浅底 + 等宽 + 可横向滚动 */
.pre-block {
  background: var(--surface-2); border: 1px solid var(--border-soft);
  padding: 10px 12px; border-radius: 8px; overflow-x: auto; margin: 8px 0;
}

/* ================================================================ 通用小件 */
.empty { color: var(--muted); text-align: center; padding: 34px 16px; font-size: 13.5px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
/* 表格里放多个操作时的容器：一行放得下就一行，放不下就换行。
   不这么做的话（哪怕给了 select max-width），窄屏下最后一列会被**切在视口外** ——
   被切掉的按钮既看不见也点不到，而页面看起来「正常」。 */
.tbl-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
/* 行内长说明：表格里很多单元格是 `td.nowrap`（按钮不折行），white-space 会被子元素**继承**，
   于是塞在里面的整句说明永远不换行、直接顶出容器（用户报过）。
   需要换行的说明一律加这个类：显式恢复 normal + 独占一行 + 限宽。 */
.note-wrap { white-space: normal; flex-basis: 100%; display: block;
             max-width: 44em; line-height: 1.6; }
/* flex 子项默认会被压缩：表单被压窄时里面的 <select> 会缩到只剩一个箭头 ——
   看着「有控件」，实际没法选（实测截图里就是这样）。所以表单不参与收缩，
   并给下拉一个最小宽度。 */
.tbl-actions > form { flex: 0 0 auto; display: inline-flex; align-items: center;
                      gap: 6px; white-space: nowrap; }
.tbl-actions select { min-width: 9.5em; }
.mono { font-family: Consolas, "Courier New", monospace; }
hr.soft { border: none; border-top: 1px solid var(--border-soft); margin: 14px 0; }

/* 「说明/解释」块 —— 商业软件里常见的浅底提示区 */
.note {
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-left: 3px solid var(--primary); border-radius: 8px;
  padding: 10px 13px; font-size: 13px; color: var(--muted); margin: 10px 0;
}
.note b { color: var(--text); }
.note.warn { border-left-color: var(--warn); background: var(--warn-soft); }
/* R193/R194：恢复数据 / 执行升级 这类「一步下去不可逆」的警示盒。
   独立一个类而不是内联色值 —— 颜色只允许出现在本文件（项目规矩），
   而且以后要统一调红/调浅只改这一处。 */
.note.danger { border-left-color: var(--danger); background: var(--danger-soft);
  border-color: var(--danger-border); color: var(--text); }
.note.danger b { color: var(--danger); }
/* 备份/恢复区里那些「当前是什么情况」的小指标（体积、行数） */
.bk-facts { display: flex; flex-wrap: wrap; gap: 18px; margin: 6px 0 14px; }
.bk-facts > div { font-size: 12.5px; color: var(--muted); }
.bk-facts > div b { display: block; font-size: 17px; color: var(--text);
  font-weight: 600; margin-top: 2px; }

/* 未登录时的外层（登录页自己撑满整屏，这里不加内边距） */
.wrap-bare { min-height: 100vh; }
.flash-float {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 200; width: max-content; max-width: min(560px, 92vw);
}

/* ================================================================ 登录页 */
.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--login-grad); padding: 24px;
}
.login-box {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 30px 32px; width: 100%; max-width: 372px;
}
.login-box h1 { font-size: 19px; margin: 0 0 4px; }
.login-box .sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.login-box .btn { width: 100%; padding: 10px; margin-top: 6px; }
.login-box .foot { color: var(--muted); font-size: 12px; margin-top: 16px; text-align: center; }

/* ================================================================ 图表 */
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: auto; }
.chart-legend {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--muted); margin: 8px 0 0; align-items: center;
}
.chart-legend i { display: inline-block; width: 15px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.chart-legend .dot { width: 9px; height: 9px; border-radius: 50%; }

/* ================================================================ 客户卡 */
.cust-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); }
.cust-card {
  position: relative;                      /* 删除按钮浮在右上角，需要定位上下文 */
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); display: block; color: inherit;
}
.cust-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
/* 卡片主体是链接（原来整个卡片就是 <a>，但 <a> 里不能放 form/button，
   所以拆成「外层 div + 内层 a + 角落的删除表单」） */
.cust-card .cust-main { display: block; padding: 13px 15px; color: inherit; }
.cust-card .cust-main:hover { text-decoration: none; }
/* 删除按钮：默认淡出，鼠标移到卡片上才明显 —— 避免一屏全是红色按钮 */
.cust-card .cust-del { position: absolute; top: 9px; right: 10px; opacity: .45; transition: opacity .15s; }
.cust-card:hover .cust-del, .cust-card .cust-del:focus-within { opacity: 1; }
.cust-card .nm { font-weight: 700; font-size: 14.5px; margin-bottom: 3px; padding-right: 52px; }
.cust-card .meta { color: var(--muted); font-size: 12.5px; }
.cust-card .tags { margin-top: 8px; display: flex; gap: 5px; flex-wrap: wrap; }

/* 健康档案 / 关怀条目 */
.item {
  border: 1px solid var(--border); border-left: 3px solid var(--border);
  border-radius: 8px; padding: 11px 14px; margin-bottom: 9px; background: var(--card);
}
.item.high { border-left-color: var(--danger); }
.item.normal { border-left-color: var(--warn); }
.item.low { border-left-color: var(--ok); }
.item.overdue { background: var(--danger-soft); border-left-color: var(--danger); }
.item .t { font-weight: 600; margin-bottom: 3px; }
.item .m { color: var(--muted); font-size: 12.5px; }
.item .body { margin-top: 7px; font-size: 13px; white-space: pre-wrap; }
.item .acts { margin-top: 9px; display: flex; gap: 7px; flex-wrap: wrap; }
/* 草稿标记与草稿预览的显隐：`hidden` 属性会被任何 display 规则压掉，
   所以显式兜一条（反馈弹窗里「有草稿」标记/预览靠 JS 切 hidden）。 */
.item .act-hidden[hidden] { display: none; }

/* 风险城市卡 */
.city-card { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; background: var(--card); }
.city-card.high { border-color: var(--danger-border); background: var(--danger-soft); }
.city-card.normal { border-color: var(--warn-border); background: var(--warn-soft); }
.city-card .hd { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.city-card .wx { font-size: 13px; color: var(--muted); }
.risk-line { margin-top: 7px; font-size: 13px; }
.risk-line .kind { font-weight: 600; }

/* 分页/筛选条 —— 页级筛选做成面板（与 .toolbar 同一观感），
   嵌在卡片内部的筛选行自动降级为朴素行，避免「卡中卡」 */
.filters {
  display: flex; gap: 9px; flex-wrap: wrap; align-items: flex-end;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
}
.filters label.f { margin-bottom: 0; min-width: 150px; }
.filters label.f.wide { min-width: 220px; }
.filters .btn-row { align-items: center; }
.card .filters, .toolbar .filters {
  background: transparent; border: none; box-shadow: none; padding: 0; margin-bottom: 0;
}

details.more { margin-top: 8px; }
details.more summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
details.more summary:hover { color: var(--primary); }

/* ================================================================ 显示模式切换 */
.viewswitch { display: flex; align-items: center; margin: 0; font-size: 13px; }
.viewswitch .lbl { color: var(--muted); margin-right: 8px; }
/* 两段式：当前模式是实心块，另一个是可点的浅色块 —— 一眼看出现在用的是哪个 */
.viewswitch .seg { display: inline-flex; border: 1px solid var(--border);
  border-radius: 6px; overflow: hidden; }
.viewswitch .seg > * { padding: 4px 12px; text-decoration: none; line-height: 1.6;
  color: var(--muted); background: var(--card); }
.viewswitch .seg > * + * { border-left: 1px solid var(--border); }
.viewswitch .seg .on { background: var(--primary); color: var(--on-primary); font-weight: 600; }
.viewswitch .seg a:hover { background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.viewswitch .hint { color: var(--muted); margin-left: 10px; font-size: 12px; }

/* ================================================================ 账号页的组织架构分组 */
.acct-tools { margin: 6px 0 10px; }
details.acct-grp { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px;
  background: var(--card); }
details.acct-grp > summary.grp-head {
  display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  padding: 9px 12px; font-size: 13.5px; background: var(--surface-2); border-radius: 8px;
}
details.acct-grp[open] > summary.grp-head { border-bottom: 1px solid var(--border);
  border-radius: 8px 8px 0 0; }
/* 去掉浏览器默认的三角，用自己的（跨浏览器外观一致） */
details.acct-grp > summary.grp-head::-webkit-details-marker { display: none; }
details.acct-grp > summary.grp-head .caret {
  width: 0; height: 0; border-left: 5px solid var(--muted);
  border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  transition: transform .12s; flex: 0 0 auto;
}
details.acct-grp[open] > summary.grp-head .caret { transform: rotate(90deg); }
summary.grp-head .gname { font-weight: 600; }
summary.grp-head:hover { background: var(--primary-soft); }
/* 子分组往右缩进，层级一眼可见 */
details.acct-grp .grp-body { padding: 8px 10px 10px; }
details.acct-grp .grp-body > details.acct-grp { margin-left: 18px; }
table.acct-table { width: 100%; border-collapse: collapse; }
table.acct-table th, table.acct-table td { padding: 7px 9px; border-bottom: 1px solid var(--border-soft);
  text-align: left; vertical-align: top; }
table.acct-table thead th { background: var(--thead); color: var(--muted); font-weight: 600;
  font-size: 12.5px; white-space: nowrap; }
table.acct-table tbody tr:hover { background: var(--hover); }
details.acct-grp.ungrouped > summary.grp-head { background: var(--warn-soft); }

/* ================================================================ 响应式 */
/* 窄屏：侧栏收成图标条（不隐藏导航 —— 藏起来就找不到功能了） */
@media (max-width: 1000px) {
  :root { --sidebar-w: 60px; }
  .sidebar .brand .txt, .sidebar nav a span.t, .sidebar .nav-group > .lbl,
  /* R226：占位条目在图标条模式下也要收起文字与标签，否则 60px 宽的侧栏会被撑破 */
  .sidebar nav .nav-soon .t, .sidebar nav .nav-soon .soon-tag,
  .sidebar .side-foot { display: none; }
  .sidebar .brand { justify-content: center; padding: 0; }
  .sidebar nav a { justify-content: center; padding: 9px 0; }
  .sidebar nav a .ico { width: auto; flex: 0 0 auto; font-size: 15px; }
  .sidebar nav .nav-soon { justify-content: center; padding: 9px 0; }
}
@media (max-width: 720px) {
  .wrap { padding: 14px; }
  .topbar { padding: 0 12px; gap: 10px; }
  .topbar .crumb .sub { display: none; }
}

/* ---------------------------------------------------------------- 拉取进度条
   用户要求（2026-10-11）：「点开始拉取后没有进度条，不知道系统是否已经开始执行」。
   颜色一律用令牌（换配色自动跟着变）；具体数值由页面 JS 写 width。 */
.pj-bar {
  height: 14px; border-radius: 8px; overflow: hidden;
  background: var(--surface-3); border: 1px solid var(--border);
  margin: 4px 0 8px;
}
.pj-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  transition: width .35s ease;
}
.pj-line { margin: 0 0 4px; font-size: 13px; color: var(--text); display: flex; gap: 10px; flex-wrap: wrap; }
.pj-line b { color: var(--primary); font-variant-numeric: tabular-nums; }

/* 多角色勾选（R53）—— 用勾选框而不是多选下拉：多选下拉要按住 Ctrl 点，
   非技术用户会以为「只能选一个」，而角色少配一个的表现是「权限悄悄变小」。 */
.chk-grid { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center;
            max-width: 640px; }
.chk-grid .chk { display: inline-flex; align-items: center; gap: 5px;
                 white-space: nowrap; font-weight: normal; }
.chk-grid .chk input { margin: 0; }
/* R435（2026-11-10）：flex 容器里的长说明会被压成极窄一列、跟勾选项叠在一起
   （用户报的「页面有压字问题」就是这个）。给它单独占一行并且允许换行。
   ⚠ 不要改成 `flex: 1`：那会让它和勾选项抢同一行的剩余宽度，仍然会挤。 */
.chk-grid > .chk-note,
.chk-grid > span.small {
  flex: 1 1 100%; min-width: 0; white-space: normal;
  line-height: 1.6; word-break: break-word; }

/* 列表锚点：分页/筛选后**不要把页面弹回最顶端**，而是让列表本身对齐视口顶端。
   顶栏是 position:sticky（高 --topbar-h），偏移量必须**正好等于**顶栏高度：
   多留一点（比如 +12px）反而会在顶栏下面露出一条上一张卡片的内容 —— 看着就像「没对齐」。
   实测：留 12px 时，列表上方还露着「复购提醒」卡片的一行字。 */
.list-anchor { scroll-margin-top: var(--topbar-h); }
/* ⚠ 这里**不要**写 `html { scroll-behavior: smooth; }`（上一版就是它出的问题）：
   报表页的每次提交都是新文档，浏览器会从页顶一路动画滚到锚点 ——
   用户已经停在那块时，就变成「每点一次应用、页面从上到下滚一次」。
   现在改由 `app/static/anchor_scroll.js` 决定：已经在那就瞬时对齐、不在才平滑滚。
   scroll-margin-top 仍要留着：哈希锚点（如分页的 #nocfg）定位时不能被吸顶栏压住。 */
/* 62px = 吸顶栏 54 + 8 余量；**必须与 anchor_scroll.js 里的 TOPBAR 一致**，
   否则「哈希定位」与「脚本定位」会停在差 8px 的两个位置（实测差过）。 */
[data-anchor], .list-anchor { scroll-margin-top: calc(var(--topbar-h) + 8px); }

/* 分页器（四个列表页 + 产品目录共用，见 templates/_paging.html） */
.pager { margin-top: 12px; }
.pager-note { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; }
.pager-note.warn { color: var(--warn); }

/* ================================================================
   冻结表头（用户 2026-10-11）：产品列表向下滚动时表头保持可见，类似 Excel 冻结首行。

   为什么必须**限制容器高度 + 容器自己滚**，而不是简单给 th 加 position:sticky：
   `position: sticky` 是相对**最近的滚动容器**生效的，而 `.table-scroll` 带
   `overflow-x: auto` —— 按 CSS 规范，一个轴不是 visible 时另一个轴的 visible 会被
   计算成 auto，所以它**本身就是滚动容器**。容器不限高、自己不滚，页面滚动时
   th 会跟着页面一起滚走，sticky 完全不生效（这是最容易被误以为「浏览器不支持」的坑）。
   给容器限高后，滚动发生在容器内部，表头就稳稳冻住了 —— 也正是 Excel 冻结窗格的手感。

   高度取 min(62vh, 560px)：默认每页 10 行时表格约 600px，限高后会自然出现内部滚动条，
   表头立刻体现价值；选 20/50/100/不分页 时更明显。取 vh 是为了在小屏笔记本上也不吃满屏幕。
   ================================================================ */
.table-scroll.sticky-head {
  max-height: min(62vh, 560px);
  overflow: auto;                 /* 允许纵向滚动（原规则只有横向） */
}
.table-scroll.sticky-head > table { border-collapse: separate; border-spacing: 0; }
/* 表头必须**不透明**，否则下面的行会透出来；--thead 是不透明令牌 */
.table-scroll.sticky-head thead th {
  position: sticky; top: 0; z-index: 3; background: var(--thead);
  /* 用 inset 阴影代替 border：边框会跟着单元格滚走，滚动时表头下方那条线会消失 */
  box-shadow: inset 0 -1px 0 var(--border);
}
/* 行内输入框在表头之上会被压住，这里让表头始终在最上层（含焦点态的控件） */
.table-scroll.sticky-head thead th * { position: relative; z-index: 1; }

/* 不可取消的勾选项（内置管理员在「谁能看到这个页面」里）：
   禁用控件浏览器会自己调灰，但**说明文字要一起变淡**，否则看着像「能点、只是没点到」。
   再加一个 not-allowed 光标，把「改不了」这件事在鼠标上就告诉用户。 */
.chk-grid .chk.locked { color: var(--muted); cursor: not-allowed; }
.chk-grid .chk.locked input:disabled { cursor: not-allowed; }

/* 内容区变宽后（1760px），筛选区的下拉/输入框也跟着放宽一点：
   原来 150px 的下拉在宽屏上显得局促，城市名这类长值会被截断。 */
@media (min-width: 1500px) {
  .filters label.f { min-width: 180px; }
  .filters label.f.wide { min-width: 280px; }
}

/* ================================================================
   「历史订单」按钮 + 弹窗（用户 2026-10-11）
   按钮旁边就带「N 单 · 最近 YYYY-MM-DD」——用户要的是「一眼看到有没有订单」，
   不要先点开才知道有没有。
   ================================================================ */
.ord-btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ord-btn .n { font-variant-numeric: tabular-nums; font-weight: 600; }
.ord-btn .d { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.ord-btn.none { color: var(--muted); }

.modal-mask {
  position: fixed; inset: 0; z-index: 300; display: none;
  background: var(--overlay); padding: 40px 18px;
  align-items: flex-start; justify-content: center;
}
.modal-mask.on { display: flex; }
.modal-box {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: min(920px, 100%); max-height: 86vh; display: flex; flex-direction: column;
}
.modal-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft); flex: 0 0 auto; flex-wrap: wrap;
}
.modal-head .grow { flex: 1; }
.modal-body { padding: 14px 16px 18px; overflow: auto; }

.order-list { display: flex; flex-direction: column; gap: 14px; }
.order-item { border: 1px solid var(--border-soft); border-radius: var(--radius);
              padding: 10px 12px; background: var(--surface-2); }
.order-item .order-hd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
                        margin-bottom: 6px; }
.order-item .order-hd .grow { flex: 1; }
.order-tbl { width: 100%; border-collapse: collapse; }
.order-tbl th, .order-tbl td { padding: 5px 8px; border-bottom: 1px solid var(--border-soft);
                               font-size: 13px; text-align: left; }
.order-tbl th { background: transparent; color: var(--muted); font-weight: 600; font-size: 12px; }
.order-tbl tr:last-child td { border-bottom: none; }

/* 客户卡片里的操作行（历史订单 + 删除）：并排、不换行挤压 */
.cust-acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
             margin-top: 8px; }

/* ================================================================
   子标签页（用户 2026-10-11：系统接口版块排版要简洁、分组、分类，
   可用子窗口减少同一页面显示的内容）

   做成一排横向标签（而不是侧边竖排）：本页最多 4 个标签，横排更省纵向空间，
   也符合「一览式后台」的观感。当前标签用下划线 + 主色 + 加粗，一眼看得出在哪。
   ================================================================ */
.tabs {
  display: flex; gap: 4px; flex-wrap: wrap; align-items: center;
  border-bottom: 1px solid var(--border); margin: 0 0 16px;
}
/* 历史记录弹窗（R181，用户 2026-10-14）：三条分类 + 每条可展开。
   与「授权弹窗 / 历史订单弹窗」同一套观感（modal-dlg），别另创视觉语言。 */
/* 知识拓扑的只读版（R186）：只读账号看到的是静态值，没有输入框。
   与可编辑版同一套视觉语言（方向用 tag、限值用 mono 数字），只是不可改。 */
.kb-ro {
  display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center;
  padding: 8px 2px; color: var(--text);
}
.kb-ro .dirs { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.kb-ro .lim { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); }
.kb-ro .lim span:first-child { color: var(--text); }

.hist-group { margin-bottom: 14px; }
.hist-group + .hist-group { border-top: 1px solid var(--border); padding-top: 12px; }
.hist-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.hist-list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.hist-item + .hist-item { border-top: 1px solid var(--border); }
.hist-item > summary {
  cursor: pointer; padding: 7px 10px; display: flex; align-items: baseline; gap: 8px;
  list-style: none; background: var(--surface-2);
}
.hist-item > summary::-webkit-details-marker { display: none; }
.hist-item > summary:hover { background: var(--hover); }
.hist-item[open] > summary { background: var(--primary-soft); }
.hist-item > summary::before { content: '▸'; color: var(--muted); font-size: 11px; }
.hist-item[open] > summary::before { content: '▾'; }
.hist-name { font-weight: 600; }
.hist-detail { padding: 8px 12px 10px 22px; background: var(--card); }
.hist-detail .kv-row { color: var(--muted); }
.hist-detail .mono { color: var(--text); word-break: break-all; }

.tabs .tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  color: var(--muted); font-size: 13.5px; text-decoration: none;
  border: 1px solid transparent; border-bottom: none; margin-bottom: -1px;
}
.tabs .tab:hover { color: var(--text); background: var(--surface-2); }
.tabs .tab.on {
  color: var(--primary); font-weight: 600;
  background: var(--card); border-color: var(--border);
  box-shadow: inset 0 2px 0 var(--primary);
}
.tabs .tab .tag { font-size: 11px; padding: 0 6px; }
.tab-pane > .card:last-child { margin-bottom: 0; }
/* 标签页里的分组小节：左侧一条竖线 + 小标题，视觉上把「同一类」的卡片抱在一起 */
.tgroup { border-left: 2px solid var(--border); padding-left: 14px; margin-bottom: 16px; }
.tgroup > .gtitle {
  font-size: 13px; font-weight: 700; color: var(--text);
  margin: 0 0 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.tgroup > .gtitle .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.tgroup > .card:last-child { margin-bottom: 0; }

/* ================================================================
   紧凑排版（用户 2026-10-11：「上面的文字描述也重新排版，压缩高度」）
   —— 订单列表与复购预测页顶部的说明原来各占半屏，天天用的人不需要；
   压成一行的同时**不删信息**：要看的细节收进 <details>，想核对随时展开。
   ================================================================ */
.card.tight { padding: 10px 14px; }
.card.tight > h2 { margin: 0 0 4px; }

/* 一行说明：左侧标题 + 中间正文 + 右侧「展开」；窄屏自动折行，不硬挤 */
.oneline {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  font-size: 13px; line-height: 1.7;
}
.oneline > b {
  flex: none; color: var(--primary); font-size: 12.5px;
  border: 1px solid var(--primary-soft); background: var(--primary-soft);
  border-radius: var(--radius-sm); padding: 1px 8px;
}
.oneline > span { color: var(--text); }
.oneline .more { margin: 0; }
.oneline details.more[open] { flex-basis: 100%; }

/* 提示条收紧（未匹配订单提示原来占三行） */
.flash.tight { padding: 8px 12px; line-height: 1.6; }
.flash.tight > .more { margin-top: 2px; }

/* ================================================================
   弹窗（用户 2026-10-11：新建对接做成按钮 + 弹窗，不要和列表同屏）
   用原生 <dialog>：Esc 关闭、焦点陷阱、遮罩与层级都由浏览器管，零依赖
   （本项目要能冻结成 exe，不引入第三方 UI 库 —— 守 R02「少一个依赖少一个部署失败点」）。
   ================================================================ */
.modal-dlg {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); color: var(--text);
  padding: 0; max-width: 860px; width: calc(100% - 40px);
  box-shadow: var(--shadow-lg, 0 12px 40px rgba(0, 0, 0, .22));
}
.modal-dlg::backdrop { background: rgba(0, 0, 0, .38); }
.modal-dlg .modal-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.modal-dlg .modal-head > b { font-size: 14.5px; }
.modal-dlg .modal-body { padding: 14px 16px 16px; max-height: 76vh; overflow: auto; }
.modal-dlg .modal-body > form > .f:first-child { margin-top: 0; }

/* 一行式统计条：把「数据落地情况」那 4 张大卡压成一行（用户说排版乱） */
.stats-line {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  padding: 10px 14px; margin-top: 12px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  font-size: 13px;
}
.stats-line > .lbl {
  flex: none; color: var(--primary); font-size: 12.5px; font-weight: 700;
  border: 1px solid var(--primary-soft); background: var(--primary-soft);
  border-radius: var(--radius-sm); padding: 1px 8px;
}
.stats-line > .kv { color: var(--muted); }
.stats-line > .kv > b { color: var(--text); font-size: 14px; }
.stats-line > .more { margin: 0; flex-basis: 100%; }

/* 弹窗里动态生成的配置项按两列排（原来一列铺满，弹窗拉得很长、看着乱） */
.modal-dlg .grid.c2 > label.f { margin-bottom: 10px; }
.modal-dlg .grid.c2 > label.f > input { width: 100%; }
@media (max-width: 900px) {
  .modal-dlg .grid.c2 { grid-template-columns: minmax(0, 1fr); }
}

/* 两行式筛选栏：第一行条件、第二行说明+按钮。
   为什么不用自动折行：字段一多，浏览器会在随机位置断行（本项目实测把「重置/筛选」
   挤到了搜索框正下方，看着像排版坏了）。分行后字段宽度怎么变都不散。 */
.filters.two-row { display: block; }
.filters.two-row .filter-fields {
  display: flex; gap: 9px; flex-wrap: wrap; align-items: flex-end;
}
.filters.two-row .filter-fields label.f { margin-bottom: 0; }
.filters.two-row .filter-acts {
  display: flex; align-items: center; gap: 9px;
  margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--border);
}

/* 单行筛选条（用户 2026-10-12：「客户关怀，搜索条件，调整为1行」）
   ================================================================
   关怀页条件最多（状态/范围/每页/销售姓名/销售微信号/客户姓名/客户微信/客户手机号/到期天数
   + 筛选/重置 = 11 个控件）。默认 `.filters` 的 label.f 是 min-width:150px，
   11 个控件必然折成两行。

   做法：字段宽度**逐个指定**（宽的选择框用 width 固定，避免被最长的选项撑开），
   gap 收到 7px、控件字号 13px。算下来一行约 1275px：
     · 1920 屏（内容区约 1620px）→ 一行；
     · 1600 屏（约 1300px）→ 仍是一行；
     · 再窄（如 1366）→ **自然折行**（保留 flex-wrap，不裁掉任何条件）。
   为什么不 nowrap：窄窗口会把「重置」或末尾条件挤出可视区，用户看到的是「条件少了」而不是「挤了」。

   ⚠ 选择框被 width 固定后，长选项文本会被浏览器裁掉（如「全部（该账号绑定的所有微信号）」）。
     所以 care.html 里给这两个动态下拉补了 title（hover 能看到完整文本），别再删。 */
.filters.dense { gap: 7px; padding: 10px 12px; }
/* ⚠ 不要给 .filter-fields 加 flex:1 1 100% —— 它一旦占满整行，
   后面的「筛选/重置」必然被挤到第二行（实测：1920/1600/1440 下都是 2 行）。
   按钮就放在**同一条 flex 行**里（模板里 .filter-acts 是 .filter-fields 的子元素），
   窗口窄时它自然跟着折到末尾。 */
.filters.dense .filter-fields {
  display: flex; gap: 7px; flex-wrap: wrap; align-items: flex-end;
  /* flex: 1 1 auto —— 让它**吃掉表单的剩余宽度**。
     实测教训：容器宽度恰好等于内容宽度（1238px = 1175 + gaps）时，
     末尾的「筛选/重置」差 1px 就掉到第二行（亚像素舍入），表现是「条件一行、按钮第二行」。
     留出余量后同一行放下。 */
  flex: 1 1 auto;
}
.filters.dense label.f { min-width: 0; margin-bottom: 0; }
.filters.dense label.f > span { font-size: 12.5px; }
.filters.dense select, .filters.dense input[type=search], .filters.dense input[type=text] {
  font-size: 13px; padding: 5px 7px; height: 32px;
}
.filters.dense .filter-acts {
  display: flex; align-items: center; gap: 7px;
  margin-top: 0; padding-top: 0; border-top: none;
}
.filters.dense .filter-acts .btn { height: 32px; padding: 5px 12px; font-size: 13px; }

/* ── 订单与复购预测的单行筛选条（用户 2026-10-23：「搜索、城市和省份都显示到一行，
      包括"只看未匹配用户"选项，也合并到一行中」）────────────────────────────
   这一条有 10 个条件 + 2 个按钮，是全站最挤的一条筛选栏。
   宽度逐个指定（不是统一的 150px 最小值），总宽算下来约 1180px：
     搜索 190 + 两个日期 132×2 + 销售姓名 92 + 两个微信号 104×2
     + 手机号 104 + 省市 84×2 + 只看未匹配 96 + 筛选 56 + 重置 56 + gaps 11×6 = 1184
   1500 屏内容区约 1224px → 一行放得下；1366 屏约 1090px → 自然折成两行（那时确实放不下）。

   ⚠ 必须保留 flex-wrap（.filters.dense 里已有）。改 nowrap 的后果是
     「重置」被挤出可视区 —— 用户看到的是"条件少了一个"，而不是"挤了"。 */
/* ⚠ 这里**不能**用 `.filters.dense` 的 `flex: 1 1 auto`：那会让字段区吃掉整行剩余宽度，
   算到「筛掉/重置」时恰好差几像素 → 按钮被挤到第二行（实测 1500 屏就是这样）。
   改成 `0 1 auto`：字段区按内容宽度（1087px），按钮跟在后面，
   合计 1204px < 1224px → 一行放下；窄屏时仍会整体折行（保留父级 wrap）。 */
.orders-bar .filter-fields { gap: 6px; flex: 0 1 auto; min-width: 0; }
/* 每个字段都不许被压缩：宽度是算好的，压下去占位符会看不见 */
.orders-bar .filter-fields > label { flex: 0 0 auto; }
/* 宽度按「1500 屏窄装下」定：合计 1215px（含 11 个 6px 间隙 = 1281… 见下方说明）
   实测 1500 屏内容区 1224px，所以每一档都比"舒服"再紧一点：
   宁可输入框短一点（占位符会被截，但 title 里有完整提示），也不要折行。 */
/* ⚠ 可用宽度不是「条宽 1224」而是 **1196**：`.filters` 自己有 padding 12/14，
   算宽度要按内容盒算（第一版按外框算，差 15px 就一直折行）。 */
.orders-bar label.f.w-kw { width: 160px; }
.orders-bar label.f.w-date { width: 124px; }
.orders-bar label.f.w-sale { width: 84px; }
.orders-bar label.f.w-wx { width: 94px; }
.orders-bar label.f.w-phone { width: 94px; }
.orders-bar label.f.w-region { width: 76px; }
.orders-bar label.f > span { white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.orders-bar .filter-fields input { width: 100%; }
/* 「只看未匹配」：与其它字段**底边对齐**（其它字段上面还有一行小标签，
   按中线对齐会让复选框高出一截）。 */
.orders-bar .chk-inline { display: inline-flex; align-items: center; gap: 5px;
  height: 32px; font-size: 13px; white-space: nowrap; color: var(--muted);
  flex: 0 0 auto; }
.orders-bar .chk-inline input { width: auto; margin: 0; }
.orders-bar .filter-acts { gap: 6px; }
.orders-bar .filter-acts .btn { height: 32px; padding: 5px 14px; font-size: 13px; }

/* ================================================================
   单行说明条（用户 2026-10-11 续：「订单与复购预测页面，上面的文字说明也进行重新排版，压缩高度」）

   原来这两页顶部是「卡片 + 多行灰字」，各占半屏。做法：**一行、无边框、小灰字**，
   把「当前条件 / 口径 / 排序」用「｜」串起来；细节仍收进 details（压缩高度 ≠ 删信息）。
   为什么不做成卡片：一行文字的卡片要额外吃 padding + border + shadow ≈ 30px，
   而它每天被看几十次、不是需要强调的内容。
   ================================================================ */
.hint-line {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--muted);
  line-height: 1.6; margin: 0 0 12px;
}
.hint-line > b { color: var(--text); font-weight: 600; }
.hint-line > .sep { color: var(--border); }

/* R411（用户 2026-11-09）：批量导入每张卡片的「导入到哪 / 去哪看 / 用来做什么」。
   为什么用 dl 而不是三个 div：这三条是「字段 → 值」的对应关系，语义上就是定义列表；
   两栏网格让标签对齐，卡片高度不会被长短不一的说明撑得参差不齐。 */
.imp-flow {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 10px;
  margin: 8px 0 10px; padding: 8px 10px;
  font-size: 12.5px; line-height: 1.65;
  border: 1px solid var(--border-soft); border-radius: 6px;
  background: var(--bg);
}
/* R411：intro 与三行说明同属一个折叠块（默认收起，页面整洁）。
   内层 p 不带 .small.muted —— 那会让 fold_long.js 再折它一次，出现嵌套按钮。 */
.imp-note { flex: 1 1 100%; min-width: 0; }
.imp-intro { margin: 0 0 4px; font-size: 12.5px; line-height: 1.65; color: var(--muted); }
.imp-note .imp-flow { margin-bottom: 0; }
.imp-flow dt { color: var(--muted); white-space: nowrap; }
.imp-flow dd { margin: 0; color: var(--text); }
.imp-flow dd a { color: var(--primary); text-decoration: none; }
.imp-flow dd a:hover { text-decoration: underline; }
.hint-line .more { margin: 0; }
.hint-line details.more[open] { flex-basis: 100%; }
.hint-line details.more > summary { color: var(--muted); }
/* 表格上方的说明条紧贴表格，不留大空 */
.hint-line + .table-scroll, .hint-line + .card { margin-top: 0; }

/* 一行式提示条（用户 2026-10-11 续）：保留警示底色，但说明 + 链接 + 展开排在同一行。
   为什么还留着底色：它讲的是「有数据没进系统」这类需要抬头看的事，不是普通说明。 */
.flash.oneline-flash {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  padding: 8px 12px; line-height: 1.6;
}
.flash.oneline-flash > .more { margin: 0; }
.flash.oneline-flash details.more[open] { flex-basis: 100%; }

/* 重算结果摘要（用户 2026-10-11：「清晰识别重算进度和结果」）
   六个数字排成一行，每个下面一行小字说明它代表什么 —— 光给数字用户还得猜。 */
.rc-result {
  display: flex; gap: 22px; flex-wrap: wrap;
  margin: 10px 0 0; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2);
}
.rc-result > .rc-n { display: flex; flex-direction: column; gap: 2px; min-width: 96px; }
.rc-result > .rc-n > b { font-size: 19px; line-height: 1.2; color: var(--text); }
.rc-result > .rc-n > span { font-size: 12px; color: var(--muted); }
.rc-result > .rc-n.warn > b { color: var(--warn); }


/* 「← 返回上一页」（用户 2026-10-11）：顶栏里的小按钮。
   放在面包屑右边、配色选择器左边；窄屏时隐藏（顶栏空间优先给配色与账号）。 */
.backbtn {
  margin-right: 10px;
  flex: 0 0 auto;
  white-space: nowrap;
}
@media (max-width: 900px) {
  .backbtn .t { display: none; }
}

/* ================================================================ 小工具（管理 → 小工具）
   工具卡片网格：一行放几个，窄屏自动折行。
   为什么要网格：工具很多（几十个），排成一列要点很久；卡片能一眼扫完用途。 */
.tool-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.tool-card { padding: 12px 14px; }
.tool-card h2 { font-size: 15px; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.tool-card form { margin: 0; }
/* 工具输出（最后几行）：等宽、可滚动、不撑破卡片 */
.tool-out {
  margin: 0; padding: 10px 12px; max-height: 260px; overflow: auto;
  /* ⚠ 这里原来引用了 --code-bg / --fg / --mono 三个令牌，而它们**在任何配色块里都没定义**：
     浏览器会把 `background: var(--code-bg)` 整条声明判为无效丢弃 → 输出区没有底色、字色也退回默认，
     深色主题下就是「浅底浅字」看不出内容。已改为每套配色都定义过的现有令牌。
     （这类「令牌名写错/漏定义」是静默失败：不报错、只是样式不生效，见 tests 的 CSS 令牌自检。） */
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 8px;
  font: 12.5px/1.5 ui-monospace, Consolas, "Courier New", monospace;
  color: var(--text); white-space: pre-wrap; word-break: break-all;
}
.h-sm { font-size: 15px; margin: 0 0 6px; }
/* ---------------------------------------------------------------- 数据出处标记（R142）
   用户 2026-10-13：「风险数据源、健康档案等从外部数据引用的内容，要标明出处…增加数据可信度。」
   统一用「📖 出处」小标记（带官方链接，悬浮看机构/说明/更新时间）。
   样式只在这里定义 —— 模板里不写字面色值；用到的令牌必须在每套配色里都存在。 */
.src-tag {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 10px;
  background: var(--primary-soft); border: 1px solid var(--primary-border);
  font-size: 12px; line-height: 18px; white-space: nowrap; vertical-align: middle;
}
.src-tag::before { content: "📖 "; }
.src-tag a { color: var(--primary-dark); text-decoration: none; }
.src-tag a:hover { text-decoration: underline; }
.src-line {
  margin: 8px 0 0; padding: 6px 10px; border-left: 3px solid var(--primary);
  background: var(--surface-2); border-radius: 0 6px 6px 0;
  font-size: 12.5px; line-height: 1.6; color: var(--muted);
}
.src-line a { color: var(--primary-dark); }
.src-line .muted { color: var(--faint); }

/* 「完成标准」说明块（R146）：报表口径这类文字要让看数的人一眼看到，
   所以给一个轻量底色的盒子，而不是混在灰字里。样式只在这里定义。 */
.std-note {
  margin: 0 0 10px; padding: 7px 11px; border-radius: 6px;
  background: var(--surface-3); border: 1px solid var(--border-soft);
  font-size: 12.5px; line-height: 1.65; color: var(--muted);
}
.std-note b { color: var(--text); }

/* ================================================================ 产品对比 · 推荐奶粉（R153）
   项目规则：颜色只能出现在这一个文件里，模板/JS 一律引用 var(--…)。
   类名统一带 milk- 前缀，避免与既有页面撞名。 */

/* 引导式表单：一行放得下的项就一行，别把页面拉长 */
.milk-form .chk-grid { margin-bottom: 8px; }
.milk-form .symptom-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.milk-form .symptom-tags button {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  border-radius: var(--radius-sm); padding: 2px 8px; font-size: 12px; cursor: pointer;
}
.milk-form .symptom-tags button:hover { background: var(--hover); }

/* 推荐结果 */
.milk-tier { margin-top: 14px; }
.milk-tier > h3 { margin: 0 0 8px; font-size: 14px; }
.milk-tier .tier-meta { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.milk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.milk-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: 12px; }
.milk-card .mc-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.milk-card .mc-name { font-weight: 600; }
.milk-card .mc-nfz { font-size: 12px; color: var(--muted); }
.milk-card .mc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.milk-card .mc-price { font-weight: 600; color: var(--primary); }
.milk-card .mc-reasons { margin: 8px 0 0; padding: 0; list-style: none; }
.milk-card .mc-reasons > li {
  border-top: 1px dashed var(--border-soft); padding: 6px 0; font-size: 12px; line-height: 1.6;
}
.milk-card .mc-reasons .rn { font-weight: 600; }
.milk-card .mc-reasons .gb { color: var(--muted); }
.milk-card .mc-reasons .ev { display: block; color: var(--muted); margin-top: 2px; }
.milk-card .mc-dirs { font-size: 12px; color: var(--muted); margin-top: 6px; }
.milk-card .mc-foot { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }

/* ── 产品目录的产品列表筛选条（用户 2026-10-23 需求 6）────────────────────
   要求：「只看 / 分类 / 关键词 / 每页」与各自的选项排在同一行、逐一对应。
   原来用通用 .filters：label 在上、控件在下，五个条件必然折成两三行，
   标签与控件隔着一行距离，看着就对不上。

   这里的关键是**每个 label 自己是一个不换行的整体**（标签在左、控件在右），
   整条也不换行。为什么敢 nowrap：这一条在内容区 1000px+ 的宽度下总宽约 820px，
   而再窄的屏（<900px）本来就不该挤一行 —— 用媒体查询放开换行。 */
.cat-bar {
  display: flex; gap: 8px; align-items: center;
  flex-wrap: nowrap; margin: 0 0 10px;
}
.cat-bar .cat-f {
  display: inline-flex; align-items: center; gap: 6px;
  flex: 0 0 auto; margin: 0; white-space: nowrap;
  font-size: 13px; color: var(--muted);
}
.cat-bar .cat-f > span { margin: 0; font-size: 13px; color: var(--muted); }
.cat-bar .cat-f select { width: auto; min-width: 96px; }
.cat-bar .cat-f input[type=text] { width: 150px; }
.cat-bar .btn { flex: 0 0 auto; }
@media (max-width: 900px) {
  /* 窄屏：允许换行，但每个「标签 + 控件」仍然保持成组，不会拆散 */
  .cat-bar { flex-wrap: wrap; }
}

/* ── R173：产品匹配页的批量导入导出工具条 ────────────────────────────────
   导出/导入/修改都是写入权限，只读用户页面上根本不渲染这几个控件。 */
/* 用户 2026-10-23 第 2 条：「候选每页、条数、导出候选列表等等功能按钮应该排成 1 行」。
   原来的外壳（边框 + 内边距 + margin-left:auto 的长说明）会把工具栏挤成两行，
   所以外壳去掉了：现在 .milk-io 只是「一串控件」的容器，排布由外层 .milk-bar 决定。 */
.milk-io { display: contents; }

/* 产品匹配页的整条工具栏：每页档位 + 条数 + 导出 / 导入 全在一行。
   一律 flex-start + nowrap 的前提是每个子项都不许被压缩（见下），
   压缩会让「候选每页」这类标签折成两行，反而更高。 */
.milk-bar {
  display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap;
  margin: 0 0 10px; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--card);
}
.milk-bar > *, .milk-bar form > * { flex: 0 0 auto; }
.milk-bar form.inline { align-items: flex-end; }
.milk-bar label.f { margin-bottom: 0; min-width: auto; }
.milk-bar label.f > span { white-space: nowrap; }
.milk-bar .nowrap { white-space: nowrap; }

/* ── R166 A：产品信息查询的「查询历史」标签条 ───────────────────────────
   搜过的词 / 看过的产品各留最近 30 条，按账号。颜色一律走主题变量。 */
.qh-card { margin-top: 12px; padding: 8px 10px; }
.qh-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.qh-head .grow { flex: 1; }
.qh-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.qh-chip {
  display: inline-flex; align-items: center; gap: 4px; max-width: 280px;
  padding: 3px 10px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--card); color: var(--text); font-size: 12.5px;
  text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.qh-chip:hover { border-color: var(--primary); color: var(--primary); }
.qh-chip.on { border-color: var(--primary); color: var(--primary); font-weight: 600; }
.qh-chip .qh-n { color: var(--muted); font-size: 11px; }
.qh-chip .qh-zero { color: var(--warn); font-size: 11px; }

/* ── R177：产品匹配页「归档记录」默认折叠（原生 details）───────────────
   summary 沿用区块标题（.gtitle）的观感，但要点得出「可展开」。 */
.arch-details > summary.gtitle {
  cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 8px;
  flex-wrap: wrap; margin: 0 0 8px;
}
.arch-details > summary.gtitle::-webkit-details-marker { display: none; }
.arch-details > summary.gtitle::before {
  content: "▸"; color: var(--muted); font-size: 12px; line-height: 1;
}
.arch-details[open] > summary.gtitle::before { content: "▾"; }
.arch-details > summary.gtitle:hover { color: var(--primary); }

/* ── R172：推荐结果的专业说明（本品含量水平 / 可直接对客户说的话 / 方向整体表现）─────
   用户 2026-10-14：「同级别三个产品的文字描述一样，相同数据没有对比意义」。
   下面这几条负责把「这款奶粉这一项是多少、处于什么水平、所以侧重什么」讲清楚。
   颜色一律走主题变量，暗色/纸张等主题自动跟随。 */
.milk-card .mc-sib { margin-top: 4px; }
.milk-card .mc-dirsum { margin: 6px 0 0; padding-left: 18px; list-style: disc; color: var(--muted); font-size: 12px; }
.milk-card .mc-dirsum > li { margin: 1px 0; }
.milk-card .mc-reasons .mc-val { margin-top: 3px; font-size: 13px; }
.milk-card .mc-reasons .mc-val b { color: var(--primary); }
.milk-card .mc-reasons .mc-val b.muted { color: var(--muted); font-weight: 500; }
.milk-card .mc-reasons .lvl {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 10px;
  font-size: 11px; line-height: 16px; border: 1px solid var(--border); color: var(--muted);
}
.milk-card .mc-reasons .lvl.lead { color: var(--ok); border-color: var(--ok-border); background: var(--ok-soft); }
.milk-card .mc-reasons .lvl.high { color: var(--ok); border-color: var(--ok-border); }
.milk-card .mc-reasons .lvl.low { color: var(--warn); border-color: var(--warn-border); }
.milk-card .mc-reasons .lvl.none { color: var(--muted); font-style: italic; }
.milk-card .mc-reasons .mc-say {
  margin-top: 4px; padding: 6px 8px; border-left: 3px solid var(--primary);
  background: var(--card); color: var(--text); font-size: 12.5px; line-height: 1.6;
}
.milk-card .mc-reasons .ev-box { margin-top: 4px; }
.milk-card .mc-reasons .ev-box > summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.milk-card .mc-reasons .ev-box .ev { display: block; margin-top: 3px; }

/* 知识拓扑表：段位限值三列并排，窄屏也不换行 */
.milk-kb td .lim { font-size: 12px; white-space: nowrap; }
.milk-kb td .lim input { width: 66px; }
.milk-kb .dirs { display: flex; flex-wrap: wrap; gap: 6px; }

/* 匹配页 */
.milk-match .kw { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }

/* ================================================================ R206
   推荐奶粉改版（用户 2026-10-16）：量化汇总块 + Excel 式营养素对比表。
   颜色一律用变量（本文件是**唯一**允许出现颜色字面量的地方）。 */

/* ---- 量化汇总（卡片里） ---- */
.mc-summary { margin: 8px 0 10px; padding: 8px 10px;
  border-left: 3px solid var(--primary); background: var(--primary-soft); border-radius: 4px; }
.mc-summary .mcs-say { font-size: 13px; line-height: 1.75; }
.mc-summary .mcs-metrics { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 4px; }
.mc-summary .mcs-m { font-size: 12.5px; color: var(--muted); }
.mc-summary .mcs-m b { color: var(--text); font-size: 14px; }
.mc-summary .mcs-m.ok b { color: var(--ok); }
.mc-summary .mcs-m.warn b { color: var(--warn); }

/* ---- 对比表（Excel 形态：首列大类、次列营养素、其余为各款数值 + 国标限值） ---- */
.cmp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cmp-table th, .cmp-table td { border: 1px solid var(--border); padding: 5px 8px;
  vertical-align: top; text-align: left; }
.cmp-table thead th { background: var(--primary-soft); position: sticky; top: 0; z-index: 1; }
.cmp-table .ct-cat { width: 96px; background: var(--primary-soft); }
.cmp-table .ct-name { width: 200px; }
.cmp-table .ct-gb { width: 168px; }
.cmp-table .ct-group td { background: var(--primary-soft); font-size: 13px; }
/* 每格数值：智库/换算的标签用小字，未获取用灰字（**不是 0**） */
.cmp-table .ct-val b { font-size: 14px; }
.cmp-table .ct-val .tag { margin-left: 4px; }
.cmp-table .ct-val.miss { color: var(--muted); }
.cmp-table .ct-val.lead { background: var(--ok-soft); }
.cmp-table tr.ct-row.same { background: var(--primary-soft); }
.cmp-table tr.ct-row.same td { color: var(--muted); }

/* 「隐藏相同项」：折叠而不是删除 —— 并且必须带 !important，
   否则 .ct-row 上的 display 之类会把 [hidden]/类隐藏盖掉（本项目踩过同一条）。 */
.cmp-table tr.hide, .cmp-table tr.ct-group.hide { display: none !important; }

/* R218（用户 2026-10-17）：营养素对比表的**大类标签**。
   观感与全站那套服务端标签共用 `.tabs`（不另创视觉语言），只做两件必要的事：
     · 收紧上下间距（它在卡片里，不是页面级导航）；
     · 抹掉 button 的浏览器默认外观 —— `.tabs .tab` 是按 <a> 写的，button 会带上
       UA 的底色与字体，不抹掉就会出现「两个灰色方块」（实测过）。
   `ct-off` 是**大类筛选**的隐藏类，与「隐藏相同项」的 `hide` 分开：
   两条机制要能共存，换个标签不能把用户勾的效果弄丢。 */
.cmp-tabs { margin: 0 0 10px; }
.cmp-tabs .tab { background: none; font: inherit; font-size: 13.5px; cursor: pointer; }
.cmp-table tr.ct-off { display: none !important; }

/* R206/R209（用户 2026-10-17）：补全数据按钮行 + 等待浮层。
   浮层是**就地一层**（不引库、不改页面结构）：抓取要几秒到几十秒，
   用户得能看见「还要多久」，而不是对着一屏白。 */
.bf-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 0; }
/* R207：形态特征 4 组（每组一行：标签 + 若干勾选） */
.bf-group { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin: 4px 0; }
.bf-glabel {
  min-width: 44px; color: var(--muted); font-size: 13px;
}
.bf-group .chk { margin: 0; }
.bf-wait {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: var(--overlay);
}
.bf-wait[hidden] { display: none !important; }
.bf-panel {
  width: min(460px, 92vw); padding: 18px 20px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.bf-head { font-weight: 600; margin-bottom: 10px; }
.bf-bar-wrap {
  height: 8px; border-radius: 4px; overflow: hidden;
  background: var(--surface-2); margin-bottom: 8px;
}
.bf-bar { height: 100%; width: 0; background: var(--primary); transition: width .2s linear; }
.bf-game { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); }
.bf-level { color: var(--primary); margin: 6px 0 4px; }
.bf-word { font-size: 18px; letter-spacing: 2px; margin-bottom: 8px; }

/* ================================================================ 历史通知（R211，用户 2026-10-16）
   列表一行一条，压成真正的单行（本项目规矩：密集行行高 ≤48px，不许折行）；
   时间用等宽字体，方便竖着扫。颜色一律用变量（深色主题下才不会深底深字）。 */
.nt-list { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.nt-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-top: 1px solid var(--border);
  cursor: pointer; min-height: 40px;
}
.nt-row:first-child { border-top: 0; }
.nt-row:hover { background: var(--muted); }
.nt-time { flex: 0 0 132px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.nt-who { flex: 0 0 118px; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-body { flex: 1 1 auto; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-scope { flex: 0 0 132px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-read { flex: 0 0 96px; text-align: right; white-space: nowrap; }
.nt-go { flex: 0 0 auto; }
.nt-col { flex: 1 1 0; min-width: 240px; }
.nt-col h4 { margin: 0 0 6px; font-size: 13px; }
.nt-cols { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.nt-names { display: flex; flex-wrap: wrap; gap: 6px; }
.nt-name {
  display: inline-flex; align-items: baseline; gap: 5px;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 2px 9px; font-size: 12px; background: var(--card);
}
.nt-name i { font-style: normal; font-size: 11px; }
.nt-meta { margin: 0 0 10px; }
.nt-text { white-space: pre-wrap; word-break: break-word; font-size: 13.5px; line-height: 1.65; }
.nt-img { display: block; margin-top: 10px; }
.nt-img img { max-width: 100%; border: 1px solid var(--border); border-radius: 8px; }
.modal-dlg.wide { width: min(980px, 94vw); }

/* ================================================================ 手工奶粉映射确认页（R205/R210）
   一行一款：标题行（名称+标签+操作）+ 已关联信息 + 候选项列表 + 改指输入。
   颜色一律用变量（深色主题下才不会深底深字）。 */
.mm-row { border-top: 1px solid var(--border); padding: 10px 2px; }
.mm-row:first-child { border-top: 0; }
.mm-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mm-head b { font-size: 13.5px; }
.mm-acc { margin-top: 6px; font-size: 12.5px; }
.mm-cands { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.mm-cand {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px;
}
.mm-cand-main { flex: 1 1 auto; min-width: 0; }
.mm-cand-main b { font-size: 12.5px; }
.mm-assign { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.mm-assign .f { margin: 0; }
.mm-assign .f > input { min-width: 320px; }

/* ================================================================ 推荐页的「备注」折叠（R215，用户 2026-10-16）
   用户原话：「此类信息可以以『备注』形式折叠，点击『备注』再展开说明信息……
   本页尽量压缩默认显示，避免太多字形成视觉压力。」
   所以解释类文字统一收进 details.note-fold；summary 上只留一行摘要，点开才展开。
   ⚠ 只改「默认收起来」，一个字都没删 —— 断言仍能在 HTML 里找到原文案。 */
/* R223（用户 2026-10-17）：整块折叠（「公司内部价格与销量」这类数据块）。
   与 `note-fold`（胶囊小折叠，用于解释文字）区分：这个是**块级标题折叠**，
   收起时仍留一行摘要（`bf-sum`），不点开也能看到关键数字。 */
details.block-fold > summary {
  cursor: pointer; list-style: none; display: flex; align-items: baseline;
  gap: 10px; flex-wrap: wrap; padding: 2px 0 8px;
}
details.block-fold > summary::-webkit-details-marker { display: none; }
details.block-fold > summary::before {
  content: "▾"; color: var(--muted); font-size: 11px;
}
details.block-fold:not([open]) > summary::before { content: "▸"; }
details.block-fold > summary:hover .gtitle-inline { color: var(--primary); }
details.block-fold .gtitle-inline { font-size: 14px; font-weight: 600; }
details.block-fold .bf-sum { margin-left: auto; font-size: 12.5px; color: var(--muted); }
details.block-fold .bf-sum b { color: var(--text); }

details.note-fold { margin: 8px 0 2px; }
details.note-fold > summary {
  cursor: pointer; color: var(--muted); font-size: 12.5px;
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 2px 10px; background: var(--card);
}
details.note-fold > summary:hover { color: var(--primary); border-color: var(--primary); }
details.note-fold[open] > summary { color: var(--primary); border-color: var(--primary); }
details.note-fold > summary::-webkit-details-marker { display: none; }
details.note-fold > summary::before { content: "▸"; font-size: 10px; }
details.note-fold[open] > summary::before { content: "▾"; }
.note-list { margin: 8px 0 0; padding-left: 18px; }
.note-list > li { margin: 4px 0; font-size: 12.5px; line-height: 1.6; }
/* 「排序依据」跟在「推荐结果」那一行后面：不换行，右侧对齐 */
.milk-tier > h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
details.inline-fold { margin: 0; }
details.inline-fold > summary { font-size: 12.5px; }
details.inline-fold p { max-width: 62em; }

/* ================================================================ 产品信息查询页的紧凑两行块（R216，用户 2026-10-16）
   用户原话：「内部销售价格、内部成本价格、本月销售情况，也做折叠，每个调整成两行，例如：
   『内部销售价格  我们自己卖出去的价格』和『近 1 个月平均价 ￥30.00 最近一次卖出价 ￥30.00
   （订单 166813 · 2026-10-05 · 郑少杰）』可以放在一行显示。」
   第 1 行 = 名称 + 副标题 + （右侧）说明按钮；第 2 行 = 数字同行排开。 */
.kv-2row { display: flex; flex-direction: column; gap: 6px; }
.kv-r1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kv-r1 > b { font-size: 14px; }
.kv-r2 { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; }
.kv-r2 > .kv { font-size: 12.5px; color: var(--muted); }
.kv-r2 > .kv > b { font-size: 14px; color: var(--text); margin-left: 4px; }

/* 长文铺满：原来这两段用 .note-wrap，而它带 `max-width: 44em`（给表格说明列用的），
   用在独立长文上就是「只占左边一半」——用户反馈的正是这个。这里给一个铺满的类。 */
.note-wide {
  white-space: pre-wrap; word-break: break-word;
  font-size: 12.5px; line-height: 1.75; margin: 6px 0 0;
  max-width: none;
}
/* 「取值说明」弹层里的正文（正文用 textContent 渲染，这里只管排版） */
.note-text {
  white-space: pre-wrap; word-break: break-word;
  font-size: 13px; line-height: 1.75;
}

/* R483（2026-11-19）：文本域专用类。
   原来「数据迟滞提示」的 textarea 借用了 `.note-wrap`（表格说明列用的，带
   max-width:44em），结果框只占一半、字挤在左边；简洁模式下更被
   `body.compact .note-wrap` 整块藏掉，那一格变成空白。
   文本域有自己要管的东西，不跟说明文字混用。 */
.hint-text {
  display: block; width: 100%; box-sizing: border-box;
  white-space: pre-wrap; max-width: none;
  font: inherit; line-height: 1.6; padding: 6px 8px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--input-bg, var(--card)); color: inherit;
  resize: vertical;
}
/* 标签栏与下方内容之间的间距（R216：智库信息四块改标签） */
.tabs-bar { margin-top: 14px; }

/* R207 形态特征 + 上传说明的**两栏布局**（用户 2026-10-17 反馈「右侧还有很多空间却折成两行」）。
   为什么不复用 `.chk-grid`：它带 `max-width: 640px`（给「一排筛选项」用的），
   套在这里会把右边说明挤成窄栏 —— 根因就是那个限宽，不是文案长。
   规则：整块吃满卡片宽度；左块按内容自然宽；右块 `flex: 1 1 320px` 吃掉剩余宽度。
   窄屏（< 900px）折成上下两行 —— 手机上并排会更挤。 */
.bf-layout {
  display: flex; align-items: flex-start; gap: 28px; flex-wrap: wrap;
  max-width: none;
}
.bf-layout .bf-left { flex: 0 1 auto; min-width: 0; }
.bf-layout .bf-right { flex: 1 1 320px; min-width: 0; }
/* R225：这段说明独立占一行（不塞进右栏 —— 右栏只有约 716px，66 个字放不下）。
   长文本**不做 nowrap**：窄屏该换行就换行，硬撑会溢出卡片。 */
.bf-layout + .bf-why { margin-top: 10px; line-height: 1.6; }
@media (max-width: 900px) {
  .bf-layout { gap: 14px; }
  .bf-layout .bf-right { flex: 1 1 100%; }
}

/* ================================================================
   订单录入（P3）—— 录单 / 审核两页共用的排版
   ----------------------------------------------------------------
   用户 2026-10-22：「订单录入界面优化，同时新建订单页面也要重新排版，
   当前排版视觉效果不好，不沉稳，本项目要考虑商业用途，所以排版要规范。」

   旧版两个具体毛病（都在宽屏 1500px 下实测）：
     ① 字段网格用 auto-fit minmax(220px,1fr) —— 算出 6 列而一组只有 4 个字段，
        右侧留两列空洞，行行不齐；这里改成**固定 4 列**，只在窄屏降列；
     ② 标签用 <label class="small muted"> + <br>，字号与基线和项目其它表单不一致 ——
        统一走项目已有的 label.f > span。

   为什么放在 app.css 而不是各页 <style>：录单页与审核页都要用同一套栅格，
   各写一份必然一边改了另一边没改（本项目反复踩的那类问题）。
   ================================================================ */
/*    改版依据（用户 2026-10-22）：「新建订单页面也要重新排版，当前排版视觉效果不好，
   不沉稳，本项目要考虑商业用途，所以排版要规范」。

   旧版三个问题：
     ① 字段网格用 `auto-fit minmax(220px,1fr)` —— 宽屏下会算出 6 列，
        而一组只有 4 个字段 → 右侧留两列空洞，行行不齐；
     ② 标签用 `<label class="small muted">` 加 `<br>`，基线高低不一，
        字号也和项目其它表单（`label.f > span`）不同；
     ③ 五张卡片各带自己的网格，纵向堆叠、间距不一致，看着像临时拼的。

   现在：**固定列数 + 项目统一的 label.f**，断点收窄时才降列，任何宽度下行都是齐的。 */
.oe-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 16px; }
.oe-form > .span2 { grid-column: span 2; }
.oe-form > .span4 { grid-column: 1 / -1; }
@media (max-width: 1180px) { .oe-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .oe-form > .span2 { grid-column: 1 / -1; } }
@media (max-width: 720px) { .oe-form { grid-template-columns: 1fr; }
  .oe-form > .span2, .oe-form > .span4 { grid-column: 1 / -1; } }

/* 收件信息一行（用户 2026-10-31 需求 3）。
   为什么单独一条规则、不塞进 .oe-form 网格：那一行是「四个窄 + 一个宽」，
   用 4 列网格做不出来 —— 地址只能占 2 列（半行），用户要的是**占满整行剩余**。
   flex 下前四个固定窄宽（够放 11 位手机号 / 4 字省市），地址 flex:1 吃满。
   窄屏（<1100px）按 220px 折行，地址自动独占一行但仍然整行宽。 */
.oe-addr-row { display: flex; gap: 0 14px; align-items: flex-end; flex-wrap: wrap; }
.oe-addr-row > .f { display: flex; flex-direction: column; gap: 4px; }
.oe-addr-row > .f > span { font-size: 12px; color: var(--muted); }
.oe-addr-row > .oe-c-narrow { flex: 0 0 auto; }
.oe-addr-row > .oe-c-narrow:nth-child(1) { width: 108px; }   /* 收件人 */
.oe-addr-row > .oe-c-narrow:nth-child(2) { width: 132px; }   /* 联系电话 */
.oe-addr-row > .oe-c-narrow:nth-child(3) { width: 104px; }   /* 省 */
.oe-addr-row > .oe-c-narrow:nth-child(4) { width: 118px; }   /* 市 */
.oe-addr-row > .oe-c-wide { flex: 1 1 300px; min-width: 260px; }
.oe-addr-row input { width: 100%; box-sizing: border-box; }
@media (max-width: 1100px) {
  /* 太窄时地址先独占一行（仍然整行），再窄就让前四个也平分 */
  .oe-addr-row > .oe-c-wide { flex: 1 1 100%; }
}
@media (max-width: 620px) {
  .oe-addr-row > .oe-c-narrow { flex: 1 1 46%; width: auto !important; }
}

/* 卡片内的小节标题（一张卡里放两组字段时用来分隔，避免多开一张卡） */
.oe-sub { font-size: 12.5px; font-weight: 700; color: var(--muted);
  margin: 4px 0 10px; padding-left: 1px; }
.oe-sub + .oe-form { margin-top: 0; }
.oe-div { border-top: 1px dashed var(--border); margin: 6px 0 14px; }

/* 商品行表格：输入框撑满单元格，金额右对齐等宽数字便于竖向核对 */
.oe-items td { padding: 5px 6px; vertical-align: middle; }
.oe-items th.num, .oe-items td.num { text-align: right; font-variant-numeric: tabular-nums; }
.oe-items td .btn { padding: 2px 8px; font-size: 12px; }

/* 合计条：与项目 .stats-line 同一观感，但贴在本卡片内部（不另起一张卡） */
.oe-sum { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap;
  margin-top: 12px; padding: 9px 12px; font-size: 13px;
  background: var(--primary-soft); border: 1px solid var(--primary-border);
  border-radius: var(--radius-sm); }
.oe-sum .n { font-size: 17px; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums; }
.oe-sum .hint { color: var(--muted); font-size: 12px; }

/* 底部操作条：与上方卡片同宽、按钮左对齐，符合"表单收尾"的阅读顺序 */
.oe-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 14px 18px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); }

/* 已选客户条：不用彩色 flash，避免和真正的提示混淆 */
.oe-picked { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 10px 12px; border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); background: var(--bg); font-size: 13px; }
.oe-picked .kv { color: var(--muted); }
.oe-picked .kv b { color: var(--text); font-weight: 600; }

/* 审核页：每个商品行一个浅分隔块，行多时不容易串行 */
.oe-line { padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.oe-line:last-child { border-bottom: none; padding-bottom: 0; }
.oe-line-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-bottom: 10px; }
.oe-line-name { font-weight: 700; font-size: 14px; }
.oe-line-meta { color: var(--muted); font-size: 12.5px; }

/* ================================================================ 任务管理（R24，2026-10-25）
   用户需求：主页「工作日历」左侧新增「任务管理」，以**任务表格**为基准。

   三条约定：
     1. 颜色一律 var(--…)，不写字面值 —— 5 套主题自动生效（本文件第 1 条硬规则）。
     2. 类名 `tk-` 前缀：与平台面的 `pf-` 同理，避免和业务面已有类名相撞。
     3. 进度条与百分比**必须同一行**：分两行会被读成「两个不同的指标」。 */

.tk-bar { display: inline-block; width: 74px; height: 6px; border-radius: 3px;
  background: var(--surface-3); overflow: hidden; vertical-align: middle; }
.tk-bar > i { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
.tk-bar.ok > i { background: var(--ok); }
.tk-bar.warn > i { background: var(--warn); }
.tk-bar.danger > i { background: var(--danger); }
.tk-pct { font-size: 12px; color: var(--muted); margin-left: 6px;
  font-variant-numeric: tabular-nums; }
td.tk-prog { white-space: nowrap; }

/* 子任务行：缩进 + 折线，一眼看出「这几个是同一件事拆出来的」 */
.tk-child td:first-child { padding-left: 34px; position: relative; }
.tk-child td:first-child::before { content: "└"; position: absolute; left: 14px;
  color: var(--faint); }
.tk-sub { color: var(--faint); font-size: 11.5px; margin-top: 2px; }
.tk-name { font-weight: 600; }
.tk-overdue { color: var(--danger); }

/* 「所有任务」模式：按下态 + 日期框变灰。
   两个视觉必须同时出现 —— 只变灰会让人以为日期控件坏了。 */
.btn.on { background: var(--primary-soft); border-color: var(--primary);
  color: var(--primary-dark); font-weight: 650; }
input[type="date"]:disabled { background: var(--surface-3); color: var(--faint);
  border-color: var(--border); cursor: not-allowed; }
.tk-mode { font-size: 12px; color: var(--muted); background: var(--surface-3);
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px;
  white-space: nowrap; }
.tk-mode b { color: var(--primary-dark); font-weight: 650; }
.tk-mode.all { background: var(--primary-soft); border-color: var(--primary-border); }

/* 详情页：右上角「状态 + 进度」固定成一列，不要跟着标题宽度跑 */
.tk-head { display: flex; align-items: flex-start; gap: 14px; }
.tk-head .tk-side { flex: none; width: 190px; text-align: right; }
.tk-head .tk-side .row2 { white-space: nowrap; margin-top: 7px; }
.tk-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px;
  color: var(--muted); margin-top: 5px; }
.tk-kv { display: grid; grid-template-columns: 92px 1fr 92px 1fr; gap: 10px 12px;
  font-size: 13px; margin: 14px 0 0; padding-top: 14px;
  border-top: 1px solid var(--border-soft); }
.tk-kv dt { color: var(--muted); font-size: 12.5px; }
.tk-kv dd { margin: 0; }
.tk-detail-body { background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px;
  line-height: 1.7; white-space: pre-wrap; }

/* 过程反馈时间线 */
.tk-flow { list-style: none; margin: 0; padding: 0 0 0 4px; }
.tk-flow li { position: relative; padding: 0 0 14px 20px; border-left: 2px solid var(--border); }
.tk-flow li:last-child { border-left-color: transparent; padding-bottom: 0; }
.tk-flow li::before { content: ""; position: absolute; left: -6px; top: 3px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--card);
  border: 2px solid var(--border-strong); }
.tk-flow li.act::before { border-color: var(--primary); background: var(--primary); }
.tk-flow .who { font-weight: 650; font-size: 13px; }
.tk-flow .when { color: var(--faint); font-size: 11.5px; margin-left: 7px; }
.tk-flow .txt { margin: 2px 0 0; color: var(--text); font-size: 13px; white-space: pre-wrap; }
.tk-flow .chg { font-size: 12px; color: var(--muted); margin-top: 3px; }
.tk-flow .chg b { color: var(--primary-dark); }

/* 状态分布（报表） */
.tk-dist { display: grid; gap: 7px; }
.tk-dist .row { display: grid; grid-template-columns: 100px 1fr 52px;
  align-items: center; gap: 10px; font-size: 12.5px; }
.tk-dist .row .b { height: 14px; border-radius: 4px; background: var(--surface-3);
  overflow: hidden; }
.tk-dist .row .b > i { display: block; height: 100%; background: var(--primary); }
.tk-dist .row .b > i[data-tone="ok"] { background: var(--ok); }
.tk-dist .row .b > i[data-tone="warn"] { background: var(--warn); }
.tk-dist .row .b > i[data-tone="danger"] { background: var(--danger); }
.tk-dist .row .v { text-align: right; color: var(--muted);
  font-variant-numeric: tabular-nums; }

/* ================================================================ 主体身份条（2026-10-25）
   主体面上每个页面顶部都显示「当前主体 / 登录人 / 切换主体 / 退出主体」。

   用户反馈的原始问题是「主体登录后首页没有区域颜色框、看着像一整块」，
   根因是它渲染了自己那份极简模板（现在已改为与主应用同一份 dashboard.html）。
   这条身份条解决的是另一半：多开几个主体的窗口时，必须一眼看出自己在哪个主体里。
   颜色只用令牌，5 套主题自动跟着变。 */


/* ---------------------------------------------- 任务汇总：可点数字与清单弹层（R235）
   颜色只用主题令牌（本项目规矩：颜色只出现在这一处，且不许写字面量）。 */
.tk-num { color: inherit; text-decoration: none; cursor: pointer; }
.tk-num:hover { text-decoration: none; }
a.stat.tk-num:hover .n { text-decoration: underline; text-underline-offset: 3px; }
td.num a.tk-num { border-bottom: 1px dashed var(--border); }
td.num a.tk-num:hover { border-bottom-color: var(--primary); color: var(--primary); }

dialog.tr-dlg {
  width: min(980px, 92vw); max-height: 82vh; padding: 0;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--card); color: var(--text); box-shadow: var(--shadow);
}
dialog.tr-dlg::backdrop { background: var(--overlay); }
.tr-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--card); z-index: 1;
}
.tr-head b { font-size: 15px; }
.tr-sub { color: var(--muted); font-size: 12.5px; }
.tr-head .btn { margin-left: auto; }
.tr-body { padding: 0 14px 14px; overflow: auto; max-height: calc(82vh - 54px); }
.tr-empty { padding: 22px 4px; color: var(--muted); }
table.tr-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tr-table th {
  text-align: left; color: var(--muted); font-weight: 600; font-size: 12.5px;
  padding: 8px 8px; border-bottom: 1px solid var(--border); white-space: nowrap;
  position: sticky; top: 0; background: var(--card);
}
table.tr-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); }
table.tr-table tr.tr-over td { background: var(--warn-soft); }
table.tr-table a { color: var(--primary); text-decoration: none; }
table.tr-table a:hover { text-decoration: underline; }


/* ============================================================ 主体登录页（R232 补）
   ⚠ 为什么现在才补：R25 做了五种登录样式，模板里类名齐全（lg / lg-pane / lg-form …），
     但 **CSS 一行都没写** —— 实测 `grep lg-pane app/static/` 只命中模板自己。
     后果是主体登录页裸奔：所有块按文档流堆叠，s2 那串装饰文案就变成
     「主体名上面一个类似图表的文字」（用户 2026-10-27 的原话）。
     这一段补上布局，颜色**刻意不跟员工主题走**：登录页是客户品牌的第一屏，
     运营方换自己的配色不该改客户的登录页（原模板注释里已定的口径）。 */
.lg {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 32px 20px; box-sizing: border-box;
  background: linear-gradient(140deg, #eef3fb, #f7f9fc 55%, #eef6f1);
  font-family: inherit; color: #1f2733;
}
.lg.has-bg {
  background-image: linear-gradient(rgba(12, 18, 28, .46), rgba(12, 18, 28, .46)), var(--lg-bg);
  background-size: cover; background-position: center;
}
.lg-pane { width: 100%; max-width: 380px; position: relative; }

/* 卡片本体 */
.lg-form {
  background: #fff; border-radius: 16px; padding: 30px 26px 22px;
  box-shadow: 0 18px 50px rgba(20, 32, 54, .14), 0 2px 6px rgba(20, 32, 54, .06);
  display: flex; flex-direction: column; gap: 14px;
}
.lg-brand { text-align: center; margin-bottom: 6px; }
.lg-name { font-size: 20px; font-weight: 700; color: #1a2230; line-height: 1.35;
  word-break: break-word; }
.lg-code { margin-top: 6px; font-size: 12.5px; color: #7c8798; }
.lg-code .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* 图标（R232：由平台配置；没配就完全不渲染，不留空位） */
.lg-logo-text {
  width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #3d7bfd, #2f5fd0);
}
.lg-logo-img { margin: 0 auto 10px; width: 64px; height: 64px; }
.lg-logo-img img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* 字段 */
.lg-f { display: flex; flex-direction: column; gap: 6px; }
.lg-f > span { font-size: 12.5px; color: #6b7688; }
.lg-f input {
  height: 42px; padding: 0 12px; font-size: 14px; color: #1a2230;
  border: 1px solid #d9e0ea; border-radius: 9px; background: #fbfcfe;
  transition: border-color .15s, box-shadow .15s;
}
.lg-f input:focus {
  outline: none; border-color: #3d7bfd; background: #fff;
  box-shadow: 0 0 0 3px rgba(61, 123, 253, .16);
}
.lg-btn {
  height: 44px; margin-top: 4px; border: 0; border-radius: 9px; cursor: pointer;
  font-size: 15px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, #3d7bfd, #2f5fd0);
}
.lg-btn:hover { filter: brightness(1.05); }
.lg-btn:active { transform: translateY(1px); }
.lg-err {
  padding: 9px 12px; border-radius: 8px; font-size: 13px;
  color: #8a1f17; background: #fdecea; border: 1px solid #f6c9c4;
}
.lg-foot { margin-top: 14px; text-align: center; font-size: 12px; color: #9aa4b4; }

/* R576：网站底部备案信息。
   链接不能继承正文颜色（否则看不出可点），也不能用主题强调色——
   备案号是合规信息，不是行动召唤，用中性蓝灰即可。 */
.site-beian {
  padding: 14px 16px 18px; text-align: center;
  font-size: 12px; line-height: 1.5;
  color: var(--faint, #9aa4b4);
}
.beian-line { margin-top: 10px; text-align: center; font-size: 12px; line-height: 1.5;
              color: var(--faint, #9aa4b4); }
.beian-line > a { color: var(--muted, #5a6472); text-decoration: none;
                  border-bottom: 1px dotted currentColor; }
.beian-line > a:hover { color: var(--accent-strong, #2f6fda); }
.lg-beian { margin-top: 6px; }
/* 登录卡片内的备案号间距（partial 自带 .beian-line，模板里不再套第二层 div） */
.lg .beian-line { margin-top: 6px; }
.pf-login-foot .beian-line { margin-top: 12px; }
.ffoot .beian-line { margin-top: 8px; }

/* 五种预设：只差背景与卡片取向，字段与按钮完全一致（换样式不影响登录）
   ⚠ s1 是默认档：模板回落到 `lg-s1`，所以这里必须有显式规则 ——
   否则样式表里根本找不到 `.lg-s1`，改默认样式时没人知道该改哪。 */
.lg.lg-s1 { background: linear-gradient(140deg, #eef4ff, #f7faff 50%, #edf6ff); }
.lg.lg-s2 { background: linear-gradient(140deg, #eef3fb, #f2f7ff 50%, #eaf2ff); }
.lg.lg-s2 .lg-form { box-shadow: 0 24px 60px rgba(31, 74, 166, .18); }
.lg.lg-s3 { background: linear-gradient(160deg, #f6f8fb, #eef1f6); }
.lg.lg-s3 .lg-form { border-top: 4px solid #3d7bfd; }
.lg.lg-s4 { background: linear-gradient(150deg, #eef7f2, #f6faf7 55%, #eaf3ee); }
.lg.lg-s4 .lg-btn { background: linear-gradient(135deg, #2f9e6b, #1f7d52); }
.lg.lg-s5 { background: linear-gradient(155deg, #232b3a, #1a2130 60%, #151a26); }
.lg.lg-s5 .lg-form { background: #fbfcfe; }
.lg.has-bg .lg-form { background: rgba(255, 255, 255, .97); }

/* 背景图存在时，文字与卡片都靠白底承载；没有背景图时也不会出现对比度问题 */

@media (max-width: 480px) {
  .lg { padding: 18px 14px; align-items: flex-start; }
  .lg-form { padding: 24px 18px 18px; border-radius: 14px; }
  .lg-name { font-size: 18px; }
}


/* --------------------------------------------------- 任务反馈（R234，粘贴/附件）
   颜色只用主题令牌。 */
.tk-fb {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-soft);
  display: flex; flex-direction: column; gap: 8px;
}
.tk-fb-row { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.tk-fb-input {
  flex: 1 1 420px; min-width: 240px; padding: 8px 10px; font: inherit;
  font-size: 13.5px; line-height: 1.5; color: var(--text);
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  resize: vertical;
}
.tk-fb-input:focus { outline: none; border-color: var(--primary); }
.tk-fb-prog { font-size: 12.5px; color: var(--muted); display: flex; align-items: center;
  gap: 5px; padding-top: 8px; white-space: nowrap; }
.tk-fb-files { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tk-fb-chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.tk-chip {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px;
  color: var(--muted); background: var(--surface-3, var(--hover));
  border: 1px solid var(--border);
}
.tk-fb-actions { display: flex; justify-content: flex-end; }

/* 反馈记录里的附件缩略图 */
.tk-atts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.tk-atts a { display: block; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.tk-atts img { display: block; width: 88px; height: 88px; object-fit: cover; }
.tk-atts .tk-att-file {
  padding: 4px 8px; font-size: 12px; color: var(--primary); text-decoration: none;
}

/* 赠品区（用户 2026-10-31 需求 5：商品明细 -> 产品名称下面加「赠品」分类）。
   视觉上要比主商品表弱一档：赠品不是这单的收入，摆得同样重会让人以为要填。 */
.oe-gift-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin: 18px 0 8px; padding-top: 14px; border-top: 1px dashed var(--border); }
.oe-gift-head > h3 { margin: 0; font-size: 14px; font-weight: 600; }
table.oe-gift { background: transparent; }
table.oe-gift th { font-weight: 500; color: var(--muted); }
table.oe-gift td, table.oe-gift th { padding-top: 6px; padding-bottom: 6px; }

/* `hidden` 属性只在没有别的 display 规则时生效；`.table-scroll` 自带 display，
   所以赠品区那层「隐藏」会被它压过去（表现为空表头一直露着）。这里显式兜住。 */
.table-scroll[hidden], .oe-gift-head[hidden] { display: none !important; }

/* ================================================================
   审批流程配置（R306，用户 2026-10-31 第三轮）

   为什么单独一组：这一页三层下拉联动 + 两个弹窗，样式散在模板里会
   在下一轮改版时漏改一处（本项目已有先例：折叠、赠品表都返工过）。
   ⚠ 颜色令牌只用主题已定义的（--muted / --danger …），别用 --muted-foreground。
   ================================================================ */
.af-lv { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.af-name {
  width: 100%; padding: 4px 8px; font-size: 13px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--input-bg); color: var(--text);
}
.af-name::placeholder { color: var(--faint); }
.af-row select { width: 100%; }
.af-target, .af-fbrow {
  display: flex; align-items: center; gap: 6px; margin-top: 4px; flex-wrap: wrap;
}
.af-target-text, .af-fb-text { flex: 1 1 auto; min-width: 90px; }
.af-resolve { display: block; margin-top: 3px; }
.af-row .btn.sm { padding: 2px 8px; font-size: 12px; }

/* 组织架构树：一行一个团队，层级用左内边距表达（与推送分组下拉同一口径） */
.af-tree {
  border: 1px solid var(--border); border-radius: var(--radius);
  max-height: 52vh; overflow: auto; background: var(--card);
}
.af-tree-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 7px 10px; border: 0; background: transparent; cursor: pointer;
  text-align: left; color: var(--text); font: inherit; font-size: 13px;
  border-bottom: 1px solid var(--border-soft);
}
.af-tree-row:hover:not(:disabled) { background: var(--hover); }
.af-tree-row:last-child { border-bottom: 0; }
.af-tree-row:disabled { color: var(--faint); cursor: not-allowed; }
.af-tree-name { flex: 1 1 auto; }

/* 人员搜索列表 */
.af-ulist {
  border: 1px solid var(--border); border-radius: var(--radius);
  max-height: 46vh; overflow: auto; margin-top: 8px; background: var(--card);
}
.af-urow {
  display: flex; align-items: baseline; gap: 10px; width: 100%;
  padding: 7px 10px; border: 0; background: transparent; cursor: pointer;
  text-align: left; color: var(--text); font: inherit; font-size: 13px;
  border-bottom: 1px solid var(--border-soft);
}
.af-urow:hover { background: var(--hover); }
.af-urow.on { background: var(--primary-soft); }
.af-urow.on .af-uname { font-weight: 700; }
.af-urow:last-child { border-bottom: 0; }
.af-uname { flex: none; }

/* 「待我审批 / 别人那儿」分组标题 */
.oe-mine-head {
  display: flex; align-items: baseline; gap: 8px;
  margin: 16px 0 8px; font-size: 13.5px; font-weight: 700;
}
.oe-mine-head .small { font-weight: 400; }

/* ================================================================
   首页「待办事项」框（R307，用户 2026-10-31）

   为什么单独分组：四类来源混在一个列表里会让人分不清「哪条是哪来的」，
   所以按来源小标题分组；组之间用一条淡分隔线，不加大卡片（首页已经够长）。
   ================================================================ */
.todo-group + .todo-group {
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border);
}
.todo-head {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin-bottom: 6px;
}
.todo-head > b { font-size: 13.5px; }

/* ================================================================ R360 图表扩展
   柱状图与饼图的样式。几何全在 app/charts_ext.py 里算好，这里只管外观。
   颜色一律用上面的 --pie-N 与已有的 .s0~.s3，模板里不出现色值。 */

.chart .bar { fill: var(--chart-measured); opacity: .92; }
.chart .bar.s1 { fill: var(--warn); }
.chart .bar.s2 { fill: var(--chart-p50); }
.chart .bar.s3 { fill: var(--chart-p3); }
.chart .bar:hover { opacity: 1; }

/* 柱顶数值：字号比折线图的点标签略大（柱子宽，不会糊） */
.chart .bval { font-size: 10px; fill: var(--chart-label); paint-order: stroke;
               stroke: var(--card); stroke-width: 2.4px; stroke-linejoin: round; }

/* x 轴分类标签 */
.chart .catlabel { font-size: 10.5px; fill: var(--chart-label); }

/* 饼图：inline-flex 让「饼 + 图例」并排，饼不会被拉成椭圆 */
.pie-inline { display: flex; flex-wrap: wrap; gap: 18px; align-items: center;
              padding: 4px 0 2px; }
.pie-canvas { flex: none; }
.chart-pie { display: block; }
.chart .slice { stroke: var(--card); stroke-width: 1.5; }
.chart .slice:hover { opacity: .85; }
.chart .pie-pct { font-size: 10.5px; fill: #fff; font-weight: 600;
                  paint-order: stroke; stroke: rgba(0,0,0,.28); stroke-width: 2px; }

/* 饼图分片配色（pc0~pc7 → --pie-0~7） */
.slice.pc0 { fill: var(--pie-0); }
.slice.pc1 { fill: var(--pie-1); }
.slice.pc2 { fill: var(--pie-2); }
.slice.pc3 { fill: var(--pie-3); }
.slice.pc4 { fill: var(--pie-4); }
.slice.pc5 { fill: var(--pie-5); }
.slice.pc6 { fill: var(--pie-6); }
.slice.pc7 { fill: var(--pie-7); }

/* 饼图图例：名字可能很长（产品名），给省略号 + 悬停看全 */
.pie-legend { flex: 1 1 220px; min-width: 180px; display: flex;
              flex-direction: column; gap: 3px; }
.pie-legend .cap { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.pie-li { display: flex; align-items: center; gap: 7px; font-size: 12.5px;
          line-height: 1.7; }
.pie-li > i { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.pie-li > i.pc0 { background: var(--pie-0); }
.pie-li > i.pc1 { background: var(--pie-1); }
.pie-li > i.pc2 { background: var(--pie-2); }
.pie-li > i.pc3 { background: var(--pie-3); }
.pie-li > i.pc4 { background: var(--pie-4); }
.pie-li > i.pc5 { background: var(--pie-5); }
.pie-li > i.pc6 { background: var(--pie-6); }
.pie-li > i.pc7 { background: var(--pie-7); }
.pie-li .nm { flex: 1 1 auto; min-width: 0; overflow: hidden;
              text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.pie-li .pc { flex: none; color: var(--muted); font-variant-numeric: tabular-nums;
              min-width: 46px; text-align: right; }
.pie-li .vv { flex: none; color: var(--faint, var(--muted)); font-size: 11.5px;
              font-variant-numeric: tabular-nums; min-width: 62px; text-align: right; }

/* ---- 数据统计表 ---- */
.rt-wrap { overflow-x: auto; }
.rt-cap { font-size: 11.5px; color: var(--muted); padding: 2px 0 6px; }
.rt-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.rt-table th { text-align: left; font-weight: 620; font-size: 12px; color: var(--muted);
               padding: 7px 10px; border-bottom: 1px solid var(--border);
               white-space: nowrap; background: var(--surface-2, var(--hover)); }
.rt-table th.num { text-align: right; }
.rt-table td { padding: 7px 10px; border-bottom: 1px solid var(--border-soft, var(--border));
               vertical-align: top; }
.rt-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.rt-table td.dim { max-width: 260px; overflow: hidden; text-overflow: ellipsis;
                   white-space: nowrap; }
.rt-table tbody tr:last-child td { border-bottom: 1px solid var(--border); }
.rt-table tbody tr:hover td { background: var(--hover); }
.rt-table tfoot td { font-weight: 650; background: var(--surface-2, var(--hover));
                     border-bottom: 0; }
.rt-table .rt-total-k { color: var(--text); }
/* 「重算」小标签：合计里不能相加的那几列要标出来，否则用户以为算错了 */
.rt-table .rt-hint { font-size: 9.5px; font-weight: 600; color: var(--muted);
                     border: 1px solid var(--border); border-radius: 3px;
                     padding: 0 3px; margin-left: 4px; vertical-align: 1px; }
.rt-note { font-size: 11.5px; color: var(--muted); padding: 7px 2px 0; }

/* ---- R562：一句话建报表（AI 入口）----
   输入框 + 按钮一行；结果块自己撑开，不挤压下面的表单。 */
.re-ai .re-ai-tag { font-size: 9.5px; font-weight: 700; letter-spacing: .04em;
  color: var(--card, #fff); background: var(--accent, #2f6feb);
  border-radius: 3px; padding: 1px 5px; margin-left: 6px; vertical-align: 2px; }
/* ---- R566：取值归并配置 ---- */
.mg-cfg { border: 1px solid var(--border); border-radius: var(--radius-sm);
          padding: 10px 12px; margin: 10px 0; }
.mg-body { margin-top: 10px; }
.mg-preview { font-size: 12.5px; line-height: 1.7; margin: 8px 0; }
.mg-preview .mg-tag { display: inline-block; font-size: 11px; padding: 0 5px;
                      border-radius: 3px; border: 1px solid var(--border);
                      color: var(--muted); margin: 0 4px 4px 0; }
.mg-preview .mg-tag b { color: var(--text); font-weight: 600; }
.mg-preview .mg-warn { color: var(--warn); }
.mg-preview .mg-more { color: var(--muted); font-size: 11.5px; }

/* ---- R567/R568：多轮对话（记录区限高可滚动、可展开） ---- */
.re-ai-log { max-height: 320px; overflow-y: auto; margin: 8px 0 10px;
             border: 1px solid var(--border); border-radius: var(--radius-sm);
             padding: 8px; background: var(--surface-2, var(--hover)); }
/* 空对话不要留一个空框 */
.re-ai-log:empty { display: none; }
/* 展开全部：限高取消（用户明确要能回看所有轮次） */
.re-ai-log.full { max-height: none; }
.re-ai-msg { display: flex; gap: 8px; margin: 0 0 10px; }
.re-ai-msg:last-child { margin-bottom: 0; }
.re-ai-msg .re-ai-who { flex: 0 0 26px; font-size: 11px; color: var(--muted);
                        padding-top: 3px; text-align: right; }
.re-ai-body { flex: 1; min-width: 0; font-size: 13px; line-height: 1.65;
              background: var(--card); border: 1px solid var(--border);
              border-radius: 8px; padding: 7px 10px; word-break: break-word;
              white-space: pre-wrap; }
/* 我这一侧用浅色区分，但不写死颜色（深色主题下也要能看） */
.re-ai-msg.me .re-ai-body { background: var(--hover); }
/* R570：AI 配置卡 —— 一行一项，比一大段话好读 */
.re-ai-card { width: 100%; border-collapse: collapse; margin: 2px 0 8px;
  font-size: 12.5px; table-layout: fixed; }
.re-ai-card th { width: 30%; text-align: left; font-weight: 500;
  color: var(--muted); padding: 5px 8px; vertical-align: top;
  border-bottom: 1px solid var(--line); white-space: nowrap; }
.re-ai-card td { padding: 5px 8px; vertical-align: top;
  border-bottom: 1px solid var(--line); word-break: break-all; }
.re-ai-card tr:last-child th, .re-ai-card tr:last-child td { border-bottom: 0; }
.re-ai-card tr.bad th { color: var(--warn, #a86500); }
.re-ai-card tr.bad td { color: var(--warn, #a86500); }
.re-ai-tag { display: inline-block; margin-left: 4px; padding: 0 5px;
  border-radius: 3px; font-size: 11px; line-height: 16px;
  background: var(--warn-bg, #fff4e0); color: var(--warn, #a86500); }
.re-ai-ask { margin: 2px 0 4px; padding: 6px 9px; border-radius: 5px;
  background: var(--bg2); font-size: 12.5px; line-height: 1.5; }
.re-ai-fold { margin-top: 4px; font-size: 12px; color: var(--muted); }
.re-ai-fold > summary { cursor: pointer; user-select: none; }
.re-ai-fold > summary:hover { color: var(--fg); }
.re-ai-notes { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px;
               color: var(--muted); }
.re-ai-q { margin-top: 8px; padding: 8px 10px; border-left: 3px solid var(--warn);
           background: var(--hover); border-radius: 4px; font-size: 12.5px; }
.re-ai-q ul { margin: 4px 0; padding-left: 18px; }
.re-ai-act { margin-top: 8px; }
.re-ai-tools { display: flex; align-items: center; gap: 10px; margin-top: 6px;
               flex-wrap: wrap; }
.re-ai-logbar { display: inline-flex; }

.re-ai-row { display: flex; gap: 8px; align-items: flex-start; }
.re-ai-row textarea { flex: 1; min-height: 46px; resize: vertical;
  font: inherit; font-size: 13px; padding: 7px 9px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--input-bg, var(--card)); color: var(--text); }
.re-ai-out { margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2, var(--hover));
  font-size: 12.5px; }
.re-ai-out b { display: block; margin-bottom: 4px; }
.re-ai-out ul { margin: 6px 0 0 18px; padding: 0; color: var(--muted); }
.re-ai-out .re-ai-err { color: var(--danger, #d9534f); }
.re-ai-out .re-ai-sum { color: var(--text); }

/* ---- R560：交叉透视表（行 × 列）----
   首列与表头用 sticky：行多时往下滚还能看出「这是谁那一行」。
   sticky 在 border-collapse:separate 下才可靠（collapse 会把边框裁掉）。 */
.pivot-wrap { overflow: hidden; }
.pivot-cap { font-size: 11.5px; color: var(--muted); padding: 2px 0 6px; }
.pivot-scroll { overflow: auto; max-height: 70vh; border: 1px solid var(--border);
                border-radius: var(--radius-sm); }
.pivot-tbl { border-collapse: separate; border-spacing: 0; font-size: 12.5px;
             min-width: 100%; }
.pivot-tbl th, .pivot-tbl td { padding: 6px 10px; white-space: nowrap; }
.pivot-tbl thead th { position: sticky; top: 0; z-index: 3;
                      background: var(--surface-2, var(--hover));
                      border-bottom: 1px solid var(--border);
                      font-size: 11.5px; font-weight: 620; color: var(--muted); }
.pivot-tbl .pv-corner { left: 0; z-index: 4; text-align: left; color: var(--text); }
.pivot-tbl .pv-row { position: sticky; left: 0; z-index: 2;
                     background: var(--surface, var(--card)); text-align: left;
                     font-weight: 600; color: var(--text);
                     border-right: 1px solid var(--border);
                     border-bottom: 1px solid var(--border-soft, var(--border)); }
.pivot-tbl td.pv-num { text-align: right; font-variant-numeric: tabular-nums;
                       border-bottom: 1px solid var(--border-soft, var(--border)); }
.pivot-tbl td.pv-col-shade { background: var(--hover); }
.pivot-tbl .pv-nil { color: var(--muted); opacity: .55; }
.pivot-tbl .pv-rowtotal { font-weight: 650; background: var(--hover); }
.pivot-tbl .pv-total-h { background: var(--hover); }
.pivot-tbl tfoot td, .pivot-tbl tfoot th { position: sticky; bottom: 0; z-index: 2;
                      background: var(--surface-2, var(--hover)); font-weight: 650;
                      border-top: 1px solid var(--border); }
.pivot-tbl tfoot th { left: 0; z-index: 3; }
.pivot-tbl .pv-grand { color: var(--text); }
.pivot-note { font-size: 11.5px; color: var(--muted); padding: 7px 2px 0; }
.rt-empty { padding: 22px 18px; border: 1px dashed var(--border); border-radius: var(--radius-sm);
            text-align: center; }
.rt-empty > b { display: block; font-size: 13px; color: var(--text); margin-bottom: 5px; }
.rt-empty > span { font-size: 12px; color: var(--muted); line-height: 1.6; }

/* 堆叠柱的段内标签：白字 + 深描边（深色段/浅色段都要能读）。
   与柱顶外侧标签的区别只在填充色：段内标签底下是彩色块，必须反白。 */
.chart .bval.in-bar { fill: #fff; stroke: rgba(0,0,0,.42); stroke-width: 2.6px; font-weight: 600; }

/* ================================================================ 地图（R361）
   色阶 --map-0..4：0=无数据（最浅），4=最高。定义在每个配色块里，
   这里只负责用法 —— 颜色值不写在这个区块里（本项目红线：颜色只写在配色块）。 */
.mapchart { display: block; }
.mapchart .mprov { stroke: var(--card); stroke-width: .8; vector-effect: non-scaling-stroke;
                   transition: fill .12s ease; }
.mapchart .mprov:hover { stroke: var(--text); stroke-width: 1.4; }
.mapchart .mprov.mk0 { fill: var(--map-0); }
.mapchart .mprov.mk1 { fill: var(--map-1); }
.mapchart .mprov.mk2 { fill: var(--map-2); }
.mapchart .mprov.mk3 { fill: var(--map-3); }
.mapchart .mprov.mk4 { fill: var(--map-4); }
.mapchart .mprov.mk5 { fill: var(--map-4); }
.mapchart .mlabel { font-size: 9.5px; fill: var(--card); paint-order: stroke;
                    stroke: rgba(0,0,0,.45); stroke-width: 2.2; stroke-linejoin: round;
                    pointer-events: none; text-anchor: middle; }
/* 图例色块：与地图同一套色阶。mk5 与 mk4 同色 —— 最深的省不必再分一档 */
.legend .mkchip { display: inline-block; width: 11px; height: 11px; border-radius: 2px;
                  margin-right: 4px; vertical-align: -1px; border: 1px solid var(--border); }
.legend .mkchip.mk0 { background: var(--map-0); }
.legend .mkchip.mk1 { background: var(--map-1); }
.legend .mkchip.mk2 { background: var(--map-2); }
.legend .mkchip.mk3 { background: var(--map-3); }
.legend .mkchip.mk4 { background: var(--map-4); }
.legend .mkchip.mk5 { background: var(--map-4); }

/* ============================================================ R379（需求 15）
   右上角账号悬停菜单 + 「简洁页面」。

   为什么要自己写而不是用 <details>：顶栏里 details 展开会把顶栏撑高、
   把下面的内容顶下去（实测过）。这里用绝对定位的浮层，不占布局。
   纯 CSS 实现（:hover + :focus-within）—— 没有 JS 也能开，键盘 Tab 也能用。 */
.acct-menu { position: relative; }
.acct-drop {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 148px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.16);
  padding: 6px; z-index: 60;
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .14s ease, transform .14s ease, visibility .14s;
}
.acct-menu:hover .acct-drop,
.acct-menu:focus-within .acct-drop {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.acct-item {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; border-radius: 7px; font-size: 13px;
  color: var(--text); text-decoration: none; white-space: nowrap;
}
.acct-item:hover { background: var(--accent); }
.acct-item.on { color: var(--primary); font-weight: 600; }
/* R412（用户 2026-11-09）：「当前没有勾选效果（看不到）」——
   原来 .acct-tick 是个空 span，未勾时什么都不画，看不出是开关。
   现在画成**真正的方框**：未勾＝浅边框空框，已勾＝主题色实心 + 白勾。
   尺寸固定 15px，开关前后文字不左右跳。 */
.acct-box {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; flex: 0 0 15px;
  border: 1.5px solid var(--border-strong); border-radius: 3px;
  background: var(--card); color: transparent;
  font-size: 11px; font-weight: 700; line-height: 1;
  transition: background .12s ease, border-color .12s ease;
}
.acct-check:hover .acct-box { border-color: var(--primary); }
.acct-item.on .acct-box {
  background: var(--primary); border-color: var(--primary);
  color: var(--card);
}
/* 兼容旧标记（别的地方可能还在用） */
.acct-tick { display: inline-block; width: 14px; text-align: center;
  color: var(--primary); font-weight: 700; }

/* ---------------- 简洁页面：隐藏页面上的文字描述类 ----------------
   用户 2026-11-09 原话：
     「勾选后要隐藏所有（除特别重要，或存在安全风险、或存在不可逆操作的除外）文字描述类。」

   与旧版的差别（旧版几乎看不出效果，实测首页只藏了两处）：
     旧版只列了 .hint / .card > p.small / .hint-line 等少数几种，
     而本项目大量说明写的是 `p.small.muted`、`.empty`、`.note`、`details.more`
     —— 这些一条都没被藏，所以用户觉得"勾了没反应"。

   ⚠ 三条硬约束（藏错比不藏更危险）：
     ① **表格里的数据不藏**：td / th 上的 .muted 是值（电话、金额、日期），不是说明；
     ② **错误 / 警告 / 危险一律保留**：藏起来用户就不知道为什么失败、也看不到风险；
     ③ **不可逆操作与必填标记保留**：删号/清数据的确认文字、必填星号藏了等于害人。
   落地方式：先宽选择器隐藏，再用**更高优先级**把三类关键内容放出来。
   为什么不全靠 :not()：例外一多，选择器会长到没人敢改；分成"藏"与"放"两段更好读。 */
body.compact .hint,
body.compact .hint-line,
body.compact .page-head .sub,
body.compact p.lead,
body.compact p.small,
body.compact p.small.muted,
body.compact .card > p.small,
body.compact .card > p.small.muted,
body.compact .card > .note,
body.compact .note,
body.compact .note.small,
body.compact .note-fold,
/* R483（2026-11-19）：`.note-wrap` 只该藏「说明文字」。
   ⚠ 它同时被用在 `<textarea class="note-wrap">` 上 —— 结果是简洁模式下
     **整个输入框被 display:none 吃掉**（用户报的「这块压字/显示错乱」）。
   表格单元格更不能藏：`td.note-wrap` / `th.note-wrap` 里装的是**值**（如接口返回的
   错误消息、产品名），那正是本节开头硬约束第①条要保的东西。 */
body.compact .note-wrap:not(td):not(th):not(textarea),
body.compact .note-wide,
body.compact .note-list,
body.compact .lead,
body.compact .sub,
body.compact .empty:not(td .empty):not(tbody .empty),
body.compact .pf-hint,
body.compact .pf-empty,
body.compact .of-empty,
body.compact .rt-hint,
body.compact .rt-note,
body.compact .rt-empty,
body.compact .rv-hint,
body.compact .rv-empty,
body.compact .rc-empty,
body.compact .role-note,
body.compact .pager-note,
body.compact .chat-panel-tip,
body.compact .chat-empty,
body.compact .aq-empty,
body.compact .imp-intro,
body.compact details.more,
body.compact .fold-btn,
body.compact label.f > small,
body.compact label.f > .small,
body.compact .field-hint,
body.compact .oe-addr-hint,
body.compact .card h2 .hint,
body.compact [class$="-hint"],
body.compact [class*="-hint "] { display: none !important; }

/* ── 例外 A：错误 / 警告 / 危险 / 成功提示 —— 永远保留 ── */
body.compact .flash,
body.compact .flash *,
body.compact .error,
body.compact .danger,
body.compact .warn,
body.compact .tag.warn,
body.compact .tag.danger,
body.compact [data-keep-text],
body.compact [data-keep-text] * { display: revert !important; }

/* ── 例外 B：不可逆操作 / 安全相关 —— 永远保留 ── */
body.compact .dg-body,
body.compact .dg-panel,
body.compact .dg-panel *,
body.compact .danger-zone,
body.compact .danger-zone *,
body.compact .irreversible,
body.compact .irreversible * { display: revert !important; }

/* ── 例外 C：必填标记与校验提示 —— 永远保留 ──
   `.req` / `required` 是"不填就提交不了"的关键信号；`.field-error` 是失败原因。 */
body.compact .req,
body.compact .required,
body.compact .field-error,
body.compact .invalid,
body.compact .invalid-feedback,
body.compact .form-error { display: revert !important; }

/* 表格里的说明可以藏，但**单元格里的值**不能藏（电话/金额/日期都是值） */
body.compact td.muted,
body.compact th.muted,
body.compact td .small,
body.compact td .muted,
body.compact th .small { display: revert !important; }

/* ── R480（用户 2026-11-19）：**逐处点名**的隐藏标记 ──────────────────
   用户一次点名了 10 个页面里 26 段说明文字要藏起来。

   为什么不用「再放宽选择器」那套：上面那串宽选择器（`.hint` / `.small` /
   `[class$="-hint"]`）已经覆盖了大部分；剩下的都是**结构性长在别处**的
   （`<span class="small muted">` 在 .btn-row 里、`<small>` 嵌了两层、
   `.flash` 里的解释句…）。继续放宽会命中表格里的**数据**（td 里的 .small
   是金额和日期），那正是本节开头三条硬约束里的第①条。

   所以改成**显式标记**：谁是说明文字，谁自己带 `data-compact-hide`。
   好处是改一处只影响一处，以后再加同类需求也不用动全局规则。

   ⚠ 特异性写成两个属性（(0,3,1)），确保能压过上面「例外 A/B/C」的
     `display: revert !important` —— 否则放在 .flash 里的说明句会被放出来。 */
body.compact [data-compact-hide][data-compact-hide] { display: none !important; }

/* ================================================================ 外部库查询（可折叠）
   R410（用户 2026-11-09）：「推荐奶粉 和 推荐营养品页面，外部库查询默认折叠」。
   没用脚本折叠，而是原生 <details>：脚本没加载时最坏只是不折，页面照常可用。
   折叠时只留一行标题 —— 收起来的高度要跟卡片标题一致，否则看着像一条缝。 */
details.card.ext-fold { padding: 0; }
details.card.ext-fold > summary.ext-fold-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  cursor: pointer; list-style: none; user-select: none;
  padding: 14px 18px; font-size: 15px; font-weight: 700;
}
/* 去掉浏览器默认三角，用自己的（折叠方向跨浏览器一致） */
details.card.ext-fold > summary.ext-fold-head::-webkit-details-marker { display: none; }
details.card.ext-fold > summary.ext-fold-head::marker { content: ""; }
details.card.ext-fold[open] > summary.ext-fold-head {
  padding-bottom: 9px; border-bottom: 1px solid var(--border-soft);
}
details.card.ext-fold > summary.ext-fold-head:hover { color: var(--primary); }
summary.ext-fold-head .ext-fold-caret {
  width: 0; height: 0; flex: 0 0 auto;
  border-left: 5px solid var(--muted);
  border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  transition: transform .12s;
}
details.card.ext-fold[open] > summary.ext-fold-head .ext-fold-caret { transform: rotate(90deg); }
summary.ext-fold-head .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
/* 展开后的内容沿用卡片内边距（padding 提到 summary 上是为了折叠时不留空） */
details.card.ext-fold > *:not(summary) { margin-left: 18px; margin-right: 18px; }
details.card.ext-fold > *:nth-child(2) { margin-top: 12px; }
details.card.ext-fold > *:last-child { margin-bottom: 14px; }

/* ---------------- R424：订单凭证图片 ----------------
   缩略图用固定方块 + object-fit: cover：不同比例的截图混排时不会把表格撑歪。
   文件缺失时给一个虚线框（明确是「没传」而不是「坏了」）。 */
.img-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.img-grid a { display: block; width: 96px; height: 96px; border-radius: 6px;
              overflow: hidden; border: 1px solid var(--border); background: var(--card); }
.img-grid a:hover { border-color: var(--accent); }
.img-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-missing { width: 96px; height: 96px; border: 1px dashed var(--border);
               border-radius: 6px; display: flex; flex-direction: column;
               align-items: center; justify-content: center; gap: 2px;
               padding: 6px; text-align: center; overflow: hidden; }
.img-missing span { font-size: 11px; color: var(--muted); word-break: break-all;
                    line-height: 1.2; max-height: 44px; overflow: hidden; }
.img-missing small { font-size: 11px; color: var(--warn); }

/* ══════════════════════════════════════════════════════════════════════════
   R425 / R426（v3.95）：订单页客户钱包 / 充值赠送消费 / 寄存拆分 / 实收汇总

   为什么必须有这一段：这几个块是**新加的 class，之前没有任何样式**，
   靠浏览器默认样式渲染 —— 实测三个金额框各占一整行、标签和输入框没对齐，
   页面拉得很长（用户一贯要求「改动不要拉长页面」）。
   ══════════════════════════════════════════════════════════════════════════ */

/* 钱包块：上排四个数 + 右侧入口；下面一行三个金额框并排 */
.oe-wallet {
  margin-top: 10px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 9px; background: var(--surface, transparent);
}
.oe-wallet-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.oe-wallet-top .kv { font-size: 13px; color: var(--muted); }
.oe-wallet-top .kv b { color: var(--text); font-size: 15px; }
.oe-wallet-top .oe-bal b { font-size: 17px; color: var(--primary); }
.oe-wallet-top .btn { margin-left: auto; }

/* 三个金额框一行排开（窄屏自动折行，不挤成一列）
   R431（2026-11-10）：`align-items: start` + 标签统一「文字 → 输入框 → 提示」三段，
   三个框必须落在同一条基线上；提示缺失的那两格用同高度的占位留白。 */
.oe-money {
  display: grid; gap: 10px; margin-top: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  align-items: start;
}
.oe-money > label { display: flex; flex-direction: column; gap: 3px;
                    font-size: 12px; color: var(--muted); }
.oe-money input { text-align: right; height: 34px; box-sizing: border-box; }
.oe-money .small { font-size: 11px; line-height: 1.5; min-height: 16px; }

/* 优惠：勾选项 + 展开后三档下拉一行 */
.oe-discount { margin-top: 10px; }
.oe-discount .oe-chk { display: inline-flex; align-items: center; gap: 6px;
                       font-size: 13px; cursor: pointer; }
.oe-discount .oe-chk input { width: auto; }
.oe-discount-body {
  display: grid; gap: 10px; margin-top: 8px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
}
.oe-discount-body > label { display: flex; flex-direction: column; gap: 3px;
                            font-size: 12px; color: var(--muted); }
.oe-discount-body > .small { grid-column: 1 / -1; }

/* 实收汇总条：与现有 .oe-sum 同族，但这里只是明确间距 */
.oe-wallet #oe-sum { margin-top: 12px; padding-top: 8px;
                     border-top: 1px dashed var(--border); }
.oe-wallet .oe-sum-final b { font-size: 18px; color: var(--primary); }
.oe-wallet .oe-sum-note { margin: 6px 0 0; }

/* 寄存拆分两列：数字右对齐，窄一点不打挤 */
.oe-items .oe-ship-qty, .oe-items .oe-storage-qty { text-align: right; }

/* ============================================================================
   销售多选下拉（R442，用户 2026-11-12）
   配合 app/templates/_sales_picker.html + app/static/sales_picker.js
============================================================================ */
.msel { position: relative; display: inline-block; min-width: 150px; }
.msel-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 6px; padding: 5px 8px; text-align: left; cursor: pointer;
  border: 1px solid var(--line, #d6dbe3); border-radius: 6px;
  background: var(--card, #fff); color: inherit; font: inherit; line-height: 1.4;
  white-space: nowrap; overflow: hidden;
}
.msel-btn > span { overflow: hidden; text-overflow: ellipsis; }
.msel.has-sel .msel-btn { border-color: var(--brand, #2f7de1); color: var(--brand, #2f7de1); }
.msel-caret { font-style: normal; opacity: .55; flex: none; }
.msel-pop {
  position: absolute; z-index: 40; top: calc(100% + 4px); left: 0;
  width: 288px; max-width: 88vw; padding: 6px;
  border: 1px solid var(--line, #d6dbe3); border-radius: 8px;
  background: var(--card, #fff); box-shadow: 0 8px 24px rgba(16, 24, 40, .14);
}
.msel-search {
  width: 100%; margin-bottom: 6px; padding: 5px 8px;
  border: 1px solid var(--line, #d6dbe3); border-radius: 5px;
  font: inherit;
}
.msel-list { max-height: 268px; overflow-y: auto; }
.msel-item {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: 6px; padding: 4px 6px; border-radius: 5px; cursor: pointer;
}
.msel-item:hover { background: var(--hover, #f2f5f9); }
.msel-nm { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msel-sub {
  grid-column: 2; font-size: 11px; opacity: .55;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.msel-n {
  grid-row: 1 / span 2; grid-column: 3;
  font-size: 11px; opacity: .6; font-variant-numeric: tabular-nums;
  padding-left: 4px;
}
.msel-empty { padding: 10px 8px; font-size: 12px; opacity: .6; }
.msel-foot { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line, #d6dbe3); }
/* 筛选栏里的这一格要稍宽：默认显示「全部销售」四个字不能挤成省略号 */
.orders-bar .w-pick { min-width: 168px; }
.orders-bar .w-pick .msel { width: 100%; }

/* ---- R442（2026-11-12）：精确筛选新增的四格 + 销售多选 ----
   12 个条件在 1500 屏放不进一行（原注释：8 个刚好 1196px）。
   容器本身是 flex-wrap，会自然折成两行 —— 这符合用户「多个搜索条件框、
   更精确搜索」的要求，不需要为了「一行」把输入框压到看不清内容。 */
.orders-bar label.f.w-name { width: 84px; }
.orders-bar label.f.w-addr { width: 132px; }
.orders-bar label.f.w-status { width: 116px; }
.orders-bar .filter-fields select { width: 100%; }

/* R441：历史单「原销售姓名」后面的小标签（纯文字、不可点，与其它 tag 同形但更小） */
.tag.ghost {
  background: transparent; color: var(--muted-fg, #6b7280);
  border-color: var(--border, #d6dbe3); margin-left: 4px; font-weight: 400;
}
.tag.xs { padding: 0 4px; font-size: 10px; line-height: 16px; }

/* ============================================================================
   R508（用户 2026-11-20）：图片浮层预览
   用户原话：「所有图片不通过新弹出浏览器页面形式展示，而应通过弹出浮动窗口形式展示。
     应避免图片链接打开时跳转到新的浏览器页面。」

   ⚠ 全部用主题令牌，不写死颜色（深色主题下写死白底会闪一下）。
   ⚠ z-index 比 modal-mask(300) 高：推流详情页里图片浮层可能从弹窗里点开。
   ========================================================================= */
.img-lightbox {
  position: fixed; inset: 0; z-index: 400;
  background: var(--overlay);
  display: flex; flex-direction: column;
  padding: 12px;
}
.img-lightbox[hidden] { display: none; }
.img-lb-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 8px 12px; margin-bottom: 10px;
  flex: 0 0 auto;
}
.img-lb-cap { font-size: 13px; color: var(--text); }
.img-lb-grow { flex: 1; }
.img-lb-stage {
  flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 10px; overflow: auto;
}
.img-lb-stage img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; border-radius: 6px; cursor: default;
}
.img-lb-err { text-align: center; color: var(--muted); padding: 30px 16px; }
/* 浮层打开时禁掉背景滚动，否则滚轮会把底下页面滚走 */
body.img-lb-on { overflow: hidden; }

/* ================================================================
   R521（用户 2026-11-21）：报表次坐标（右轴）
   —— 左轴系列画柱，右轴系列画折线（Excel「主次坐标」的常见形态）。
   颜色复用 s0..s2 三个语义色，与左轴柱同色系不冲突；
   `rline` 加粗一点，压在柱子上也看得清。
   ================================================================ */
.chart .tick-r { fill: var(--chart-label); font-size: 10px; }
.chart .rline { stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart .rdot { stroke: var(--card); stroke-width: 1.2; }
.chart .rline.s0, .chart .rdot.s0 { stroke: var(--chart-measured); }
.chart .rline.s1, .chart .rdot.s1 { stroke: var(--warn); }
.chart .rline.s2, .chart .rdot.s2 { stroke: var(--chart-p3); }
.chart .rdot.s0 { fill: var(--chart-measured); }
.chart .rdot.s1 { fill: var(--warn); }
.chart .rdot.s2 { fill: var(--chart-p3); }
