/* =========================================================================
   样品制作系统 · 工业软件主题（参考 Oracle / SAP / Siemens 控制台风格）
   设计原则：沉稳深navy侧栏 + 钢蓝强调 + 冷灰底 + 细边框数据网格 + 语义状态
   ========================================================================= */
:root {
  /* 表面与文字 */
  --bg: #eceff3;          /* 冷灰背景（控制台底色） */
  --surface: #ffffff;
  --panel: #f4f6f9;       /* 表头/分区浅条 */
  --ink: #0f172a;         /* 深墨（标题/深色表面） */
  --text: #1f2933;
  --muted: #5e6c82;       /* 次级文字
                             ⚠️ 修正一：原 #64748b 在 --panel(#f4f6f9) / --accent-soft(#f3f8fc) 上仅 4.40/4.45:1（低于 AA 4.5），压暗 5% 后全场景达标。
                             ⚠️ 修正二：#5f6e84 在 --surface-2(#ecf3f3 系, rgb(236,239,243)) 上为 4.4955:1，差 0.005 仍不达标
                             （项目页 .muted 实测命中）；再微调至 #5e6c82 → 该底色 4.617:1、白底 5.33:1 */
  --border: #d6dce4;      /* 冷调边框 */
  --border-soft: #e6eaf0;

  /* ===== 强调色 v3（2026-09-02 · 系统升级为「业务流管理系统」）=====
     原钢蓝 #14629e 整体迁移到品牌橘红体系（王毅口径：内部蓝色按钮改为与登录页一致的橘色）。
     ⚠️ 取值铁律：--accent 会**承载白字**（.btn / .step.cur / .seg-pill.active / .id-pill.run 等），
        对白必须 ≥4.5:1。实测：#c43a18 = 5.30:1 ✓，#a8340f = 6.64:1 ✓。
        纯品牌色 #e54a25 对白仅 3.93:1（低于 AA），**只能用于无文字的装饰填充**（渐变起点/圆点/装饰条）。 */
  --accent: #c43a18;
  --accent-d: #a8340f;
  --accent-soft: #fef2ee;
  --accent-line: #e0a189;

  /* 侧栏：深navy控制台 */
  --nav-bg: #0e1a2b;
  --nav-2: #14273f;
  --nav-text: #aebfd4;
  --nav-text-dim: #7e93af;   /* ⚠️ 修正：原 #6f819a 在 --nav-2(#14273f) 上仅 3.80:1（低于 AA），提亮后 4.80:1 */
  /* 侧栏激活项底色：原 #1c4e7e（钢蓝）与主色橘的指示条撞成冷暖混搭，改为暖赭石 #8a3520。
     对 --nav-bg(#0e1a2b) 对比度 2.17:1（原蓝仅 2.03:1，更清晰）；白字对其 8.04:1 ✓ */
  --nav-active: #8a3520;
  --nav-hover: rgba(255,255,255,.06);
  /* ===== 毛玻璃三层（需求十三轮 2；方案定稿 outputs/业务流管理系统_毛玻璃规范_交互预览.html）
     G1 常驻面板玻璃 · G2 弹窗遮罩玻璃 · G3 路由转场纱幕。
     仅在 @supports(backdrop-filter) 内启用，不支持的浏览器走原实心规则（零 JS 降级）。 ===== */
  --glass-panel-bg: rgba(255,255,255,.70);
  --glass-panel-blur: saturate(180%) blur(18px);
  --glass-nav-bg: rgba(17,24,39,.86);
  --glass-nav-blur: saturate(160%) blur(20px);
  --glass-nav-glow: radial-gradient(120% 90% at 80% -10%, rgba(196,58,24,.20), transparent 60%);
  --glass-scrim-bg: rgba(10,16,30,.48);
  --glass-scrim-blur: saturate(115%) blur(10px);
  --glass-veil-bg: linear-gradient(180deg, rgba(255,255,255,.88), rgba(244,246,250,.74));
  --glass-veil-blur: blur(14px) saturate(140%);

  /* ===== 语义状态 v4（2026-09-02 需求十三 · 三色体系 + 去绿）=====
     三主色：橙=品牌与当前节点 · 蓝=进度与完成 · 金=提醒与未完成。
     🟦 完成度阶梯：未启动(中性灰) → 进行中(浅蓝) → 完成(实心蓝)，**同色相深浅递进**
        表达进度，而非更换色相 —— 去绿后「新建」与「完成」不会撞色
        （原 .st.new 用 --info 蓝，若 done 直接改蓝会与 new 同色）。
     🟨 金色只做底与边，文字交给深墨（#0f172a on #f0a500 = 8.58:1），
        避开 L30-40 + H35-45 + 高饱和的土黄区（旧 #b07c0c L37 对白仅 3.66:1 不达 AA）。
     🔴 危险色保留深红 #c0392b（对白 5.44:1，与橙/金/蓝色相差均 ≥6°）。 */
  --st-draft-bg: #f1f5f9; --st-draft-ink: #475569; --st-draft-line: #cbd5e1;  /* 未启动 6.92:1 */
  --st-prog-bg:  #e8f1f8; --st-prog-ink:  #15608f; --st-prog-line:  #bcd6ec;  /* 进行中 5.92:1 */
  --st-done-bg:  #1f7cba; --st-done-ink:  #ffffff; --st-done-line:  #15608f;  /* 完成 4.52:1 */
  --st-done-h:   #2b8ac6; --st-done-deep: #0e5c8a;                            /* hover / 深边 */
  --gold: #f0a500; --gold-h: #f7b520; --gold-ink: #7c4e03;                    /* 提醒与未完成 */
  --gold-bg: #fffdf5; --gold-bg-h: #fbeab8; --gold-line: #f2d9a0; --gold-edge: #e09400;
  --err: #c0392b;  --err-d: #a5301f;  --err-bg: #fbecea;  --err-line: #f0c5bf;        /* 危险：深红；--err-d 供实底危险按钮的边/hover（#a5301f 对白 6.6:1） */
  /* 信息态保留蓝：与 --st-prog / --st-done 同色相，承担「数据 / 信息 / 说明」语义。
     冷暖分工：橘=行动与当前态，蓝=数据、信息与进度。这是三主色里的第 3 色，不是残留。 */
  --info: #1f7cba; --info-bg: #e8f1f8; --info-line: #bcd6ec;
  --gray: #475569; --gray-bg: #f1f5f9; --gray-line: #d6dce4;
  /* SAP 风格状态标签（阶段编号 / 操作主按钮）：统一浅蓝徽标，避免填充色突兀 */
  --stage-tag-bg:   #eaf2ff;
  --stage-tag-line: #cddffb;
  --stage-tag-ink:  #14468f;

  /* 补全「被引用但从未定义」的令牌（UI 审计发现：以下 6 个此前无 fallback 调用，
     实际渲染为 unset —— 催办/保存时间线圆点、重新打样横幅、签核记录标题配色全部失效） */
  --amber: #b97800;      --amber-line: #f2d9a0;   /* 催办圆点（金族图形档，对白 3.65:1 ≥3:1） */
  --info-ink: #15608f;                            /* info-bg 上的正文色（原 #0e4a78，随 --info 一并对齐数据蓝） */
  --panel-ink: #0f172a;                           /* 同 --ink */
  --nav-muted: #6f819a;  --nav-line: #1f3350;     /* 深 navy 面上的次级色与分隔线 */

  --radius: 6px;
  --radius-sm: 4px;
  --mbar: 48px; /* 移动端顶栏高度 */
  --shadow: 0 1px 2px rgba(15,23,42,.05);

  /* ===== 设计系统基线 v2（2026-08-28 · UI 审计后补齐）=====
     历史遗留：全站散落 23 档字号、10 种硬编码圆角、20+ 种阴影。
     以下令牌为收敛目标；既有语义色/报表令牌一律不改，避免影响单据外观。 */

  /* 字阶：8 档，取代 .5 尾数的临时值 */
  --fs-2xs: 11px;  --fs-xs: 12px;  --fs-sm: 13px;  --fs-md: 14px;
  --fs-lg: 16px;   --fs-xl: 18px;  --fs-2xl: 22px; --fs-3xl: 28px;
  --lh-tight: 1.35; --lh-base: 1.55; --lh-loose: 1.7;

  /* 间距：4px 基准 */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;

  /* 圆角 */
  --r-xs: 3px; --r-sm: 4px; --r-md: 6px; --r-lg: 10px; --r-pill: 999px;

  /* 层级阴影：三级即可覆盖卡片/浮层/模态 */
  --elev-1: 0 1px 2px rgba(15,23,42,.05);
  --elev-2: 0 2px 6px rgba(15,23,42,.08);
  --elev-3: 0 8px 24px rgba(15,23,42,.14);

  /* 焦点环：WCAG 2.4.11 要求指示物与相邻色 ≥3:1，
     原 focus 用 --accent-soft 对白仅 1.14:1（等于看不见），改用 --accent 达 6.42:1 */
  --ring: 0 0 0 2px #fff, 0 0 0 4px var(--accent);
  --ring-err: 0 0 0 2px #fff, 0 0 0 4px var(--err);

  /* 中性线色与表面（原令牌缺失，此前靠硬编码 #d7dbe2 / #e7eaf0 顶替） */
  --line: #dde3ea; --line-strong: #c8d2dd; --surface-2: #f7f9fb;
  --muted-strong: #55637a;   /* 小字在 --panel 上仍满足 AA（原 --muted 仅 4.40:1） */

  /* ===== 边框色令牌（第 1 批收敛）=====
     按「中性 → 语义 → 语义族梯度」组织。所有取值 1:1 沿用原硬编码，零视觉变化。 */
  --line-hairline: #e2e6ee;   /* 最浅：卡片/分区描边 */
  --line-control:  #c2cbd6;   /* 控件默认边框（次要按钮、输入框同级） */
  --line-solid:    #0a1422;   /* 深色实边（侧栏分隔） */
  --line-accent:   #8f2f12;   /* 主按钮描边（原 #0d4a80 钢蓝 → 品牌橘深描边） */
  --line-info:     #1f7cba;   /* 信息 / 数据类高亮（保留蓝，作橘红的对色） */
  --line-success:  #15608f;   /* 完成态（需求十三绿清除 → 数据蓝深档） */
  /* 警告族：深描边 → 强调条 → 控件态 → 提示框 */
  --line-warning:        #754005;
  --line-warning-bright: #ffb74d;
  --line-warning-soft:   #ffcc99;
  --line-warning-mute:   #f0d49a;
  /* 错误族：深描边 → 强调条/控件态 → 驳回区 → 关闭横幅 */
  --line-danger-bright: #ff8a8a;
  --line-danger-soft:   #e5c6c0;
  --line-danger-mute:   #f0b6ae;

  /* ===== 文字色令牌（第 2 批收敛）=====
     绝大多数 1:1 沿用原值；两处为对比度修正（见下方注释，属有意的视觉微调）。 */
  --text-strong: #1f2937;          /* 最强正文（卡片标题等） */
  --text-faint:  #6b7280;          /* 三级/弱化文字 */
  --text-on-dark:   #ffffff;       /* navy 深底上的文字 */
  /* 橘底高亮上的次级文字（原 #cfe7ff 为蓝底配套）。
     ⚠️ 对 --accent(#c43a18) 实测 4.77:1；早先取的 #fde6df 仅 4.43:1 不达标 ——
        暖色底上的浅色文字极易跌破 AA，取值必须留余量。 */
  --text-on-accent: #fff0ea;
  --text-nav-weak:       #e0837a;  /* 侧栏退出链接 */
  --text-nav-weak-hover: #f3b6af;
  --text-warning: #7c4e03;         /* 警告文字，对白 5.93:1
                                      ⚠️ 修正：原 .fld-cur 用 #b26a00 仅 4.24:1（低于 AA），统一到此值 */
  --text-danger:  #c0392b;         /* 错误文字，同 --err */
  --text-danger-deep: #8a2c20;     /* 浅红底上的错误文字（关闭横幅） */

  /* ===== 表面色令牌（第 3 批收敛）===== */

  /* 中性表面阶梯。
     原散落 9 种"几乎一样"的浅灰，实测亮度后仅 2 对差值在不可辨范围（Δ<1.0），
     其余 Δ1.1–4.4 属真实差异，故不强合并 —— 令牌化的目的是让阶梯「显式」，不是抹平。 */
  --surface-1: #fafbfc;   /* 表格交替行 */
  --surface-2: #f7f9fb;   /* 卡片浅底（同时吸收 #f7f9fc，Δ亮度 0.06） */
  --surface-3: #eef1f5;   /* hover 态表面 */
  /* #f4f6f9 / #f3f5f8 → 统一用既有 --panel（两者 Δ亮度 0.85，不可辨） */

  /* 按钮渐变：180deg 三段式（起始 0% → 中段 60% → 收尾 100%）。
     ⚠️ v3 改为橘红三段：三档对白字实测 5.30 / 6.07 / 6.64:1，全部达 WCAG AA。
     hover 沿用原「提亮一档」惯例，提亮后仍 ≥4.63:1 —— 暖色高饱和，提亮幅度必须小，否则立刻跌破 AA。 */
  --btn-primary-1: #c43a18;   --btn-primary-2: #b5340f;  --btn-primary-3: var(--accent-d);
  --btn-primary-h1: #d1431f;  --btn-primary-h2: #c43a18; --btn-primary-h3: #b5340f;
  --btn-secondary-1: #ffffff; --btn-secondary-2: #f8fafc;
  --btn-secondary-h1: #faffff;--btn-secondary-h2: #f0f4f8;
  /* ⚠️ 修正：原渐变起始 #cc7a09 上的白字仅 3.30:1（远低于 AA）；整条色阶压暗一档后
     起始 4.70 / 中段 5.28 / 收尾 7.83，hover 三档同样全部达标。 */
  --btn-warning-1: #a76407;   --btn-warning-2: #9a5e07;      --btn-warning-3: #7a4505;
  --btn-warning-h1: #b06a0a;  --btn-warning-h2: #8f5107;     --btn-warning-h3: #6d3d04;
  /* 危险按钮（删除/驳回/作废）改走品牌橘（需求十三轮3）：--accent / --accent-d；
     --err 深红仅保留给错误态文字/徽标/驳回时间线，不再用于按钮。 */

  /* 语义浅底（提示条 / 状态卡 / 字段态） */
  --tint-warning-1: #fff6e3;      /* 催办按钮渐变起始 */
  --tint-warning-2: #fff1d3;      /* 催办 hover 起始 */
  --tint-warning-3: #fbe8cd;      /* 催办 hover 收尾 */
  --tint-warning-flash: #fff8e6;  /* flash.warn 底 */
  --tint-warning-field: #fff3e0;  /* 当前节点字段底 */
  --tint-warning-ph: #fff5eb;     /* PDF 预览占位底 */
  --tint-danger-field: #ffe3e3;   /* 必填未填字段底 */
  --tint-danger-banner: #fdecea;  /* 关闭横幅底 */
  --tint-info-step: #fef2ee;      /* 当前步骤卡（当前态=主色橘，原 #eaf1ff 蓝） */
  --tint-ok-step: #e8f1f8;        /* 完成步骤卡 */
  --tint-import: #fef7f4;         /* 导入卡片底（原 #f3f8fc 蓝调） */

  /* 品牌与导航强调面 */
  --brand-grad-end: #e54a25;      /* brand-mark 渐变收尾（原 #2a8fd0 蓝 → 橘→亮橘同色系渐变） */
  --nav-active-bar: #e54a25;      /* 侧栏激活指示条（「我在哪」= 主色橘，原 #3ea6e0 蓝） */

  /* 滚动条 */
  --scroll-thumb: #c3ccd8;
  --scroll-thumb-hover: #a9b5c4;

  /* ===== 阴影 / 立体边令牌（第 4 批收敛）=====
     按钮的 `0 2px 0 0 <色>` 是「底部厚度层」，与渐变同属按钮系统，故一并按变体命名。
     #fff3e0 / #f0b6ae 与既有 --tint-warning-field / --line-danger-mute 完全同值，直接复用不新建。 */
  --btn-secondary-edge: #b0bac8;  --btn-secondary-edge-h: #a0aab8;
  --btn-warning-edge:   #653604;  --btn-warning-edge-h:   #562e03;
  --btn-urge-edge:      #e7c992;

  /* 辉光（与 --ring 配套的第二层） */
  --glow-danger:  #ffd6d6;   /* 必填未填字段内发光 */
  --glow-on-dark: #8fc4f0;   /* 深色表面的焦点环外圈，对 navy 高对比 */

  /* ===== 品牌主色 v3（2026-09-02 · 系统升级「业务流管理系统」）=====
     主色严格 3 种：①嘉益橘红（品牌 / 主行动）②深墨 ink（导航 / 文字）③数据流蓝（对色辅助）。
     ⚠️ 原 --cayi #fa3812 为 logo 原色，饱和度过高；收敛为 #e54a25 作装饰填充（王毅：不要过于饱和）。
     ⚠️ 合流（需求十三轮 3 收尾）：承载文字的橙统一走 --accent / --accent-d；纯装饰橙走 --cayi；
       --cayi-d 仅作受保护区报表 .sec-title 的历史锚点（值 = --accent，受保护区不可动，勿删）。 */
  --cayi: #e54a25;        /* 装饰填充（无字）：渐变起点 / 圆点 / 装饰条（对白 3.93:1，**不可承载文字**） */
  --cayi-d: #c43a18;      /* 受保护区报表 .sec-title 历史锚点（= --accent；活跃代码已全收敛到 --accent） */
  --cayi-glow: rgba(196, 58, 24, .16);   /* 装饰辉光（登录页圆点 / 节点光晕） */

  /* 对色：数据流蓝。与橘红构成对比色关系，只承担「数据 / 信息 / 图表」类辅助元素，
     不承载主行动 —— 主行动一律橘红，避免两种主色争夺注意力。 */
  --data: #1f7cba; --data-d: #15608f; --data-soft: #e8f1f8; --data-line: #bcd6ec;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Roboto, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background:var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--muted-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 等宽数字（KPI / 单号 / 数量） */
.num, .kpi-num, .node-num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ===== 应用骨架 ===== */
.app-shell { display: flex; min-height: 100vh; }

/* ===== 左侧导航栏（控制台风格，深navy实心） ===== */
.sidebar {
  width: 212px; min-width: 212px;
  background:var(--nav-bg);
  color: var(--nav-text);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  z-index: 100;
  border-right:1px solid var(--line-solid);
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 16px 14px; border-bottom:1px solid rgba(255,255,255,.08);
  background:var(--nav-2);
}
.brand-mark {
  width: 34px; height: 34px; border-radius: var(--radius-sm); flex-shrink: 0;
  background:linear-gradient(135deg, var(--accent) 0%, var(--brand-grad-end) 100%);
  color:#fff; font-weight: 700; font-size: 14px; letter-spacing: 1px;
  display: flex; align-items: center; justify-content: center;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.15);
}
.brand-text { line-height: 1.25; font-size: 14px; font-weight: 700; color:#fff; }
/* small 元素被 UA 默认缩到父级的 80%（12px → 约 10px），低于可读下限；统一兜底到 12px。
   单据打印页里显式声明过 9.5 / 10.5px 的 .sh-* small 选择器更具体，不受影响。 */
small { font-size: var(--fs-xs); }
.brand-text small { display: block; font-size: var(--fs-xs); font-weight: 400; color: var(--nav-text-dim); letter-spacing: .5px; }

/* 导航链接 */
.snav { display: flex; flex-direction: column; padding: 8px 8px; gap: 1px; flex: 1; }
.snav a {
  display: flex; align-items: center; gap: 10px;
  color: var(--nav-text); text-decoration: none; font-size: 14px;
  padding: 10px 12px; border-radius: var(--radius-sm); transition: background .12s, color .12s;
  position: relative;
}
.snav a:hover { background:var(--nav-hover); color:#fff; text-decoration: none; }
.snav a.active {
  background:var(--nav-active); color:#fff; font-weight: 600;
}
.snav a.active::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 2px 2px 0; background:var(--nav-active-bar);
}
.si { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; opacity: 0.9; }
.si svg { width: 18px; height: 18px; }
.snav a.bell { position: relative; }

/* 侧栏分组标题 */
.snav-group {
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--nav-text-dim);
  padding: 16px 12px 4px; margin-top: 2px;
  border-top:1px solid rgba(255,255,255,.06);
}
.snav-group:first-child { border-top:none; margin-top: 0; padding-top: 4px; }

/* 侧栏底部：用户 / 退出 */
.sidebar-bottom {
  padding: 10px 12px 14px; border-top:1px solid rgba(255,255,255,.08);
  display: flex; flex-direction: column; gap: 6px; font-size: 14px; background:var(--nav-2);
}
.sidebar-bottom a.bell {
  color: var(--nav-text); text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 10px; border-radius: var(--radius-sm); position: relative;
}
.sidebar-bottom a.bell:hover { background:var(--nav-hover); color:#fff; }
.user-info { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; color: var(--nav-text); font-size: 12px; }
.user-info small { color: var(--nav-text-dim); font-size: var(--fs-xs); }
.sidebar-bottom > a:last-child {
  color:var(--text-nav-weak); text-decoration: none; padding: 7px 10px; border-radius: var(--radius-sm); font-size: var(--fs-sm);
}
.sidebar-bottom > a:last-child:hover { background:rgba(192,57,43,.18); color:var(--text-nav-weak-hover); }

/* 主内容区 */
.main-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ===================== 移动端适配 ===================== */
.mobile-bar, .nav-overlay, .bottom-nav { display: none; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; width: 100%; max-width: 100%; }

/* 红点徽标 */
.badge-count {
  position: absolute; top: 8px; right: -10px; background:var(--err); color:#fff;
  font-size: var(--fs-2xs); font-weight: 700; padding: 1px 5px; border-radius: var(--r-pill);
  border:1px solid var(--nav-2);
}

/* ===== 布局容器 ===== */
/* width:100% + min-width:0 —— flex 子项默认 min-width:auto 会被宽内容撑破容器，
   导致整页横向滚动（原先 iPad 工作台溢出 647px）。内容超宽时由内部 .table-scroll 自行滚动。 */
.container { width: 100%; max-width: 1240px; min-width: 0; margin: 0 auto; padding: 20px 24px 40px; }
.container-wide { max-width: 1440px; }
.main-content > * { min-width: 0; }
.card {
  background:var(--surface); border:1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 16px; box-shadow:var(--shadow);
  min-width: 0; /* 防止内部宽表格撑破卡片 */
}
.card > h2:first-child { margin-top: 0; }
.card h2 { margin: 0 0 14px; font-size: 16px; font-weight: 700; color: var(--ink);
  display: flex; align-items: center; gap: 8px; }
.card h2::before {
  content: ""; width: 4px; height: 14px; border-radius: var(--r-xs); background:var(--gray); display: inline-block;
}
.card h3 { margin: 16px 0 8px; font-size: var(--fs-md); font-weight: 700; color: var(--ink); }

/* 待办卡片：克制的高亮（左侧强调条） */
.card-todo { border-color:var(--line); box-shadow:inset 3px 0 0 var(--gray); }
.card-todo h2 { color: var(--ink); }

/* 页面标题 + 操作区（统一页头栏） */
.page-title { font-size: 20px; font-weight: 700; margin: 0; color: var(--ink); letter-spacing: .2px; }
.page-sub { color: var(--muted); font-size: var(--fs-sm); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.toolbar .page-head-l { display: flex; flex-direction: column; gap: 2px; }

/* ===== 状态徽章（语义、方正、带状态点） ===== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600;
  background:var(--gray-bg); color: var(--gray); border:1px solid var(--gray-line);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background:currentColor; }
.badge.mine { background:var(--info-bg); color: var(--info); border-color:var(--info-line); }
.badge.done { background:var(--st-done-bg); color: var(--st-done-ink); border-color:var(--st-done-line); }
.badge.warn { background:var(--gold-bg); color: var(--gold-ink); border-color:var(--gold-line); }

/* 语义状态（可独立用于文本/单元格） */
.st { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600; border:1px solid; }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background:currentColor; }
.st.new  { color: var(--st-draft-ink); background:var(--st-draft-bg); border-color:var(--st-draft-line); }
.st.prog { color: var(--st-prog-ink); background:var(--st-prog-bg); border-color:var(--st-prog-line); }
.st.done { color: var(--st-done-ink);  background:var(--st-done-bg);  border-color:var(--st-done-line); }
.st.err  { color: var(--err); background:var(--err-bg); border-color:var(--err-line); }
.st.gray { color: var(--gray); background:var(--gray-bg); border-color:var(--gray-line); }

/* ===== 按钮（SAP 工业风：扁平、语义、不突兀） =====
   设计原则：
   · 统一按语义着色，同一含义同一颜色；
   · 去除厚重立体投影，仅保留极淡层级阴影，避免喧宾夺主；
    · hover 统一微微上浮 + 加深，保持"可点击"暗示但不突兀；
   · ⚠️ 例外：密集工具栏（.ap-actions-btns）内禁用位移，见该段注释。 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 18px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; font-weight: 600; text-decoration: none; text-align: center;
  color:#fff;
  /* 显式列举过渡属性（原 transition:all 会连带过渡布局属性，
     在长列表的操作列里滚动/重排时产生不必要的合成开销） */
  transition: background-color .12s ease, border-color .12s ease,
              box-shadow .12s ease, transform .12s ease,
              color .12s ease, opacity .12s ease;
  font-family: inherit;
  position: relative;
  /* 主按钮：品牌橘红填充（v3 由钢蓝迁移，见 :root 注释） */
  background: var(--accent);
  border:1px solid var(--accent-d);
  box-shadow: 0 1px 2px rgba(196,58,24,.18);
}
.btn:hover {
  background: var(--btn-primary-h2);
  transform: translateY(-1px);
  box-shadow: 0 3px 6px -1px rgba(196,58,24,.22);
  text-decoration: none; color:#fff;
}
.btn:active {
  transform: translateY(0);
  box-shadow: inset 0 1px 2px rgba(15,23,42,.14);
}

/* 次要按钮：白底细边，弱存在感，用于取消/返回/导出等 */
.btn.secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-control);
  box-shadow: 0 1px 2px rgba(15,23,42,.05);
}
.btn.secondary:hover {
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: 0 2px 4px -1px rgba(15,23,42,.08);
}

/* 成功按钮：数据蓝（需求十三绿清除），hover 压深不提亮（#2b8ac6 对白仅 3.6:1 会破 AA） */
.btn.success {
  background: var(--st-done-bg);
  color: #fff;
  border-color: var(--st-done-deep);
  box-shadow: 0 1px 2px rgba(31,124,186,.18);
}
.btn.success:hover {
  background: var(--st-done-deep);
  box-shadow: 0 3px 6px -1px rgba(14,92,138,.22);
}

/* 信息按钮：数据蓝实底（仪表盘四键语义分工：蓝=浏览与复制，金=催办，红=删除） */
.btn.info {
  background: var(--info);
  color: #fff;
  border-color: var(--st-done-deep);
  box-shadow: 0 1px 2px rgba(31,124,186,.18);
}
.btn.info:hover {
  background: var(--st-done-deep);
  box-shadow: 0 3px 6px -1px rgba(14,92,138,.22);
}

/* 危险按钮：深红实底，用于删除/驳回/关闭。
   2026-09-03 用户指令：由品牌橙改回深红——09-02 版把 danger 染成品牌橙导致
   仪表盘操作列「查看/复制/删除」三键同色无法区分，现恢复危险语义红。 */
.btn.danger {
  background: var(--err);
  border-color: var(--err-d);
  box-shadow: 0 1px 2px rgba(192,57,43,.18);
}
.btn.danger:hover {
  background: var(--err-d);
  box-shadow: 0 3px 6px -1px rgba(165,48,31,.22);
}

/* 警告按钮：琥珀，用于需要留意的强操作 */
.btn.warning {
  background: var(--btn-warning-2);
  border-color: var(--line-warning);
  box-shadow: 0 1px 2px rgba(154,94,7,.18);
}
.btn.warning:hover {
  background: var(--btn-warning-h2);
  box-shadow: 0 3px 6px -1px rgba(143,81,7,.22);
}

.btn.small { padding: 5px 12px; font-size: 12px; }
/* 提交中 / 禁用：统一降饱和并禁用位移，防止误判为可再次点击 */
.btn.is-loading, .btn:disabled {
  opacity: .65; cursor: progress; transform: none; box-shadow:none; filter: saturate(.6);
}
.btn:disabled { cursor: not-allowed; }
/* 按下态：统一"下沉 1px + 内阴影"反馈 */
.btn.secondary:active, .btn.danger:active, .btn.warning:active, .btn.success:active, .btn.info:active, .btn.urge:active {
  transform: translateY(1px);
  box-shadow:inset 0 1px 3px 0 rgba(15,23,42,.14);
}
/* 开关型按钮（如【签核历史】）：aria-pressed 直接驱动视觉，开/关两态一眼可辨 */
.btn[aria-pressed="true"] { border-color:var(--accent); }
.btn[aria-pressed="false"] {
  background:var(--surface); color: var(--muted); border-color:var(--border-soft);
  box-shadow:none;
}
.btn[aria-pressed="false"]::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background:var(--line-strong); margin-right: 2px;
}
.btn.ghost {
  background:transparent; color: var(--muted-strong); border-color:transparent;
  box-shadow:none;
}
.btn.ghost:hover { background:var(--surface-2); transform: none; box-shadow:none; }

/* 催办按钮：浅琥珀底 + 深琥珀字/边，与 warning 实色区分 */
.btn.urge {
  background: var(--gold-bg);
  color: var(--gold-ink);
  border-color: var(--gold-line);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(240,165,0,.10);
}
.btn.urge:hover {
  background: var(--gold-bg-h);
  color: var(--text-warning);
  transform: translateY(-1px);
  text-decoration: none;
  box-shadow: 0 2px 4px -1px rgba(180,83,9,.12);
}
.btn.urge:active { transform: translateY(0); box-shadow: inset 0 1px 2px rgba(180,83,9,.12); }

/* ===== 表单 ===== */
label.fld { display: block; margin-bottom: 12px; font-size: 14px; }
label.fld > span { display: block; color: var(--muted); margin-bottom: 5px; font-size: 13px; font-weight: 600; }
/* 当前节点字段：浅橙提示（本轮工艺需要填写的字段） */
label.fld-cur {
  background:var(--tint-warning-field);
  border-left:3px solid var(--line-warning-bright);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 8px 10px 4px;
}
label.fld-cur > span { color:var(--text-warning); }
label.fld-cur input, label.fld-cur select, label.fld-cur textarea {
  border-color:var(--line-warning-soft);
  box-shadow:0 0 0 1px var(--tint-warning-field);
}
/* 必填未填写：浅红提示（保存草稿或推送流转时校验未过） */
label.fld-err {
  background:var(--tint-danger-field) !important;
  border-left:3px solid var(--line-danger-bright) !important;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 8px 10px 4px;
}
label.fld-err > span { color:var(--text-danger) !important; }
label.fld-err input, label.fld-err select, label.fld-err textarea {
  border-color:var(--line-danger-bright) !important;
  box-shadow:0 0 0 1px var(--glow-danger) !important;
}
input[type=text], input[type=password], input[type=date], input[type=number],
select, textarea {
  width: 100%; padding: 8px 10px; border:1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit; background:#fff; color: var(--text);
}
textarea { min-height: 64px; resize: vertical; }
/* 填写页对齐（2026-09-08 王毅）：单行控件统一高度，消除 input/select/date 高度参差 */
input[type=text], input[type=password], input[type=date], input[type=number], select {
  height: 36px;
}
/* 焦点指示：P0 无障碍修复。原 ring 用 --accent-soft（对白仅 1.14:1，几乎不可见），
   改为双层环：内白环保证在深色表面上可辨，外 accent 环对白 6.42:1，满足 WCAG 2.4.11 的 3:1 */
input:focus, select:focus, textarea:focus {
  outline:none; border-color:var(--accent); box-shadow:var(--ring);
}
/* 鼠标点击保留轻量提示，键盘导航才出完整焦点环 */
input:focus:not(:focus-visible), select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) { box-shadow:0 0 0 2px var(--accent-soft); }

/* 表单控件 hover 反馈（SAP Fiori 输入控件基线 · 2026-09-01 整体优化）
   原实现只有 :focus 一种状态，鼠标掠过时控件毫无反馈，用户无法预判"此处可编辑"。
   补 hover 边框加深，与 focus 双层环构成「悬停可点 → 聚焦可编辑」的渐进提示；
   显式列出过渡属性（原 .btn 的 transition:all 会连带过渡不需要的属性）。 */
input[type=text], input[type=password], input[type=date], input[type=number],
input[type=email], input[type=search], select, textarea {
  transition: border-color .12s ease, box-shadow .12s ease, background-color .12s ease;
}
input[type=text]:hover, input[type=password]:hover, input[type=date]:hover,
input[type=number]:hover, input[type=email]:hover, input[type=search]:hover,
select:hover, textarea:hover {
  border-color: var(--line-control);
}
/* 只读 / 禁用态不给出"可编辑"暗示，避免误导点击 */
input[readonly]:hover, input[disabled]:hover,
select[disabled]:hover, textarea[readonly]:hover, textarea[disabled]:hover {
  border-color: var(--border);
}

/* 所有可交互元素统一焦点环（键盘可达性基线） */
a:focus-visible, button:focus-visible, .btn:focus-visible,
[tabindex]:focus-visible, summary:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline:none; box-shadow:var(--ring); border-radius: var(--r-sm);
}
/* 深色表面（侧栏 / 深底标题栏）上的焦点环改为白环，保证对比 */
.sidebar a:focus-visible, .sidebar button:focus-visible,
.modal-header button:focus-visible { box-shadow:0 0 0 2px var(--nav-bg), 0 0 0 4px var(--glow-on-dark); }
/* 错误态控件焦点环用红色，保持语义一致 */
input.input-err:focus-visible, select.input-err:focus-visible,
textarea.input-err:focus-visible { box-shadow:var(--ring-err); }

input[readonly], .ro { background:var(--panel); color: var(--muted); }
/* 数字输入居中（与报表同口径：文字向左、数字居中） */
input.n-num, td.n-num, div.n-num { text-align: center; font-variant-numeric: tabular-nums; }
/* 必填校验失败：控件红框 + 字段标签红字（.fld-err 复用既有配色） */
input.input-err, select.input-err, textarea.input-err {
  border-color:var(--err) !important;
  box-shadow:0 0 0 2px rgba(220, 38, 38, .12);
}
.form-err-summary { margin: 0 0 12px; }
/* 空数据行：弱化 + 居中，避免被误读为有效记录 */
table.grid tbody tr.empty-row td {
  text-align: center; color: var(--muted); padding: 26px 10px;
  background:repeating-linear-gradient(135deg, var(--surface-1), var(--surface-1) 8px, var(--panel) 8px, var(--panel) 16px);
}
.ro { padding: 8px 10px; border-radius: var(--radius-sm); min-height: 36px; line-height: 18px; border:1px solid var(--border-soft); }

.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
/* 2026-09-01 需求八·王毅口径：窗体对齐报表样式——包材表与其他要求表纵向铺满 form-grid 全宽。
   报表端（report_production.html）两表本就是纵向堆叠、各占 8 列全宽；原 3 列布局把两表挤进
   左右两格导致名称列实际像素太窄、长名字（如"额外的 SKU LABEL"）仍被截断。 */
.form-grid > table.insp-tbl#pkgTbl,
.form-grid > table.insp-tbl#otherReqTbl { grid-column: 1 / -1; width: 100%; }
.form-grid > table.insp-tbl#otherReqTbl { margin-top: 14px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1024px) and (min-width: 641px) { .form-grid { grid-template-columns: repeat(2, 1fr); } .form-grid.cols-4 { grid-template-columns: repeat(2, 1fr); } .form-grid .span-2 { grid-column: span 2; } }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } .form-grid.cols-4 { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: span 1; } }

/* 报表中心：查询框与报表按钮 */
.rc-search-wrap { margin-bottom: 14px; max-width: 420px; }

/* ===== 报表中心表格重排：冻结表头 + 冻结前三列、表头居中、报表按钮页行 ===== */
.rc-table-scroll {
  overflow: auto;
  max-height: 72vh;                 /* 给表头 sticky 一个滚动视窗 */
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--panel);
}
/* 用 separate + inset 阴影画边框：sticky 横向滚动时边框不丢 */
table.grid.rc-table {
  width: 100%;
  border-collapse: separate; border-spacing: 0;
}
table.grid.rc-table th,
table.grid.rc-table td {
  text-align: center;               /* 表头与单元格居中 */
  vertical-align: middle;
  white-space: nowrap;
  padding: 10px 12px;
  border: none;
  box-shadow: inset -1px 0 var(--border-soft), inset 0 -1px var(--border-soft);
}
table.grid.rc-table thead th {
  position: sticky; top: 0; z-index: 3;
  background: var(--panel);
  color: var(--ink); font-weight: 700;
  border-bottom: 2px solid var(--line);
}
/* 当前节点列允许换行，避免长标签挤占 */
table.grid.rc-table td.stage-cell { white-space: normal; line-height: 1.5; }
/* 冻结前三列：客户编号 / 总样品单号 / 样品单号（横向滚动时左固定）；列宽随小字号收紧 */
table.grid.rc-table th:nth-child(1),
table.grid.rc-table td:nth-child(1) { position: sticky; left: 0;     min-width: 68px;  width: 68px;  z-index: 2; background: var(--panel); }
table.grid.rc-table th:nth-child(2),
table.grid.rc-table td:nth-child(2) { position: sticky; left: 68px;  min-width: 90px;  width: 90px;  z-index: 2; background: var(--panel); }
table.grid.rc-table th:nth-child(3),
table.grid.rc-table td:nth-child(3) { position: sticky; left: 158px; min-width: 160px; width: 160px; z-index: 2; background: var(--panel); }
/* 冻结列表头置于最上层，盖住普通表头与滚动内容 */
table.grid.rc-table thead th:nth-child(1),
table.grid.rc-table thead th:nth-child(2),
table.grid.rc-table thead th:nth-child(3) { z-index: 4; background: var(--panel); }
/* 偶数行 / hover 底色也要覆盖冻结列，避免透出滚动内容 */
table.grid.rc-table tbody tr:nth-child(even) td:nth-child(1),
table.grid.rc-table tbody tr:nth-child(even) td:nth-child(2),
table.grid.rc-table tbody tr:nth-child(even) td:nth-child(3) { background: var(--surface-1); }
table.grid.rc-table tbody tr:hover td:nth-child(1),
table.grid.rc-table tbody tr:hover td:nth-child(2),
table.grid.rc-table tbody tr:hover td:nth-child(3) { background: var(--surface-2); }
/* 生成报表：每个按钮独占一行（页行排列） */
table.grid.rc-table td.rpt-col { white-space: normal; min-width: 132px; }
table.grid.rc-table td.rpt-col .rpt-btn {
  display: block; width: 100%; box-sizing: border-box;
  margin: 4px 0; white-space: nowrap; text-align: center;
}
.stage-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; color: var(--data-d); background:var(--data-soft); padding: 2px 8px; border-radius: var(--radius-sm); font-size: 12px; }

/* 表单填写进度（必填 2/2 ✓ / 缺 N 项） */
.fill-stat {
  margin-left: 8px; font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 2px 8px; border-radius: var(--r-pill); background:var(--panel);
  border:1px solid var(--border-soft); letter-spacing: .2px;
}
/* ⚠️ 修正：--warn(#b45309) 在 --warn-bg(#fbf1e4) 上为 4.497:1，差一点点不达 AA；
   改用已有的 --text-warning(#8a5a00)，同底 5.31:1。 */
.fill-stat.warn { color: var(--gold-ink); background:var(--gold-bg); border-color:var(--gold-line); }
.fill-stat.ok  { color: var(--st-prog-ink);  background:var(--st-prog-bg);  border-color:var(--st-prog-line); }

/* 分组标题（左侧强调条） */
.sec {
  background:var(--panel); border-left:3px solid var(--gray);
  padding: 7px 12px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-weight: 700; margin: 18px 0 12px; font-size: 13px; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}

/* 提示 */
/* 提示改为右上角浮动 Toast：不挤占版面（详情页 100vh 布局尤其需要），自动消失 */
.flash-wrap {
  position: fixed; top: 14px; right: 24px; z-index: 2000;
  max-width: 440px; padding: 0; display: flex; flex-direction: column; gap: 8px;
}
.flash {
  padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 0; font-size: 13px;
  border:1px solid; background:#fff; line-height: 1.6;
  box-shadow:0 8px 24px rgba(20, 40, 66, .16);
  animation: flash-in .22s ease-out;
  cursor: pointer;
}
@keyframes flash-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}
.flash.is-out { opacity: 0; transform: translateY(-6px); transition: all .25s ease; }
.flash.err { background:var(--err-bg); color: var(--err); border-color:var(--err-line); }
.flash.ok  { background:var(--st-prog-bg);  color: var(--st-prog-ink);  border-color:var(--st-prog-line); }
.flash.warn { background:var(--tint-warning-flash); color:var(--text-warning); border-color:var(--line-warning-mute); }

/* ===== 数据网格（企业表格） ===== */
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th, table.grid td {
  border:1px solid var(--border-soft); padding: 9px 10px; text-align: left; vertical-align: middle;
  white-space: nowrap;            /* 默认单行显示，避免编号/文本怪异断行 */
}
table.grid thead th {
  background:var(--panel); color: var(--ink); font-weight: 700; white-space: nowrap;
  border-bottom:2px solid var(--line); position: sticky; top: 0; z-index: 2;
  text-align: center;
}
table.grid tbody tr:nth-child(even) { background:var(--surface-1); }
table.grid tbody tr:hover td { background:var(--surface-2); }
table.grid td.num, table.grid th.num { text-align: center; font-variant-numeric: tabular-nums; }
/* 长文本单元格（如附件文件名）：允许正常换行，避免撑破表格 */
table.grid td.wrap { white-space: normal; }
/* 状态列：阶段编号 + 状态文字，允许在列内自动换行，避免右侧被遮挡/截断 */
table.grid td.status-cell { white-space: normal; min-width: 132px; line-height: 1.5; }
/* 阶段编号：与报表中心 SAP 风格一致，改用浅蓝徽标（减弱视觉冲击，统一控件色系） */
table.grid td.status-cell .stage-no {
  display: inline-flex; align-items: center; margin-right: 6px; padding: 1px 7px; border-radius: var(--r-sm);
  font-size: 12px; font-weight: 700; line-height: 1.35; color: var(--stage-tag-ink);
  background: var(--stage-tag-bg); border: 1px solid var(--stage-tag-line);
  vertical-align: 1px; letter-spacing: .3px;
}
/* 项目/流水列：仅在「项目」与「流水」之间断行，编号本身不拆断 */
table.grid td.ids-cell { white-space: normal; vertical-align: top; }
/* 操作列：按钮允许换行且不被右侧边框遮挡；保证至少容纳两个按钮 */
table.grid td.flex { white-space: normal; min-width: 116px; }
table.grid td.flex .btn { white-space: nowrap; }
table.grid td.ids-cell .prj-link,
table.grid td.ids-cell .srf-link { white-space: nowrap; display: inline-block; }
.table-scroll { overflow-x: auto; }
.table-scroll-v { max-height: 70vh; overflow: auto; }
.table-scroll table.grid thead th { position: sticky; top: 0; }

/* ===== KPI 卡片 ===== */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi-card {
  background:var(--surface); border:1px solid var(--border); border-radius: var(--radius);
  padding: 16px 14px; text-align: left; position: relative; box-shadow:var(--shadow);
}
.kpi-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; border-radius: var(--radius) 0 0 var(--radius); background:var(--data-line); }
.kpi-card.mine { border-color:var(--data-line); box-shadow:inset 3px 0 0 var(--data); }
.kpi-card.mine::before { background:var(--data); }
.kpi-num { font-size: 25px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.kpi-label { font-size: var(--fs-xs); color: var(--muted); margin-top: 6px; text-transform: uppercase; letter-spacing: .5px; }

/* ===== 流程全景 ===== */
.segments { display: flex; flex-direction: column; gap: 12px; }
.segment { border:1px solid var(--border); border-radius: var(--radius); overflow: hidden; background:var(--surface); }
.seg-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 16px; background:var(--panel); cursor: pointer; user-select: none;
  border-bottom:1px solid transparent;
}
.seg-head:hover { background:var(--surface-3); }
.seg-title { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; color: var(--ink); }
.seg-dot { width: 10px; height: 10px; border-radius: 50%; }
.seg-count {
  font-size: 12px; background:var(--surface); padding: 1px 8px; border-radius: var(--r-pill);
  border:1px solid currentColor; font-weight: 700;
}
.seg-arrow { color: var(--muted); font-size: 12px; }
.seg-body { padding: 14px 16px; background:#fff; border-top:1px solid var(--border); }
.node-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.node-card {
  display: block; border:1px solid var(--border); border-radius: var(--radius-sm); padding: 12px;
  text-decoration: none; color: var(--text); background:var(--surface); transition: .12s; box-shadow:var(--shadow);
}
.node-card:hover { background:#fff; border-color:var(--line-strong); transform: translateY(-1px); text-decoration: none; }
.node-name { font-size: var(--fs-md); font-weight: 700; line-height: 1.4; color: var(--ink); }
.node-desc { font-size: 12px; margin-top: 4px; line-height: 1.35; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.node-role { font-size: 12px; margin-top: 4px; color: var(--muted); }
.node-num { font-size: 21px; font-weight: 700; margin-top: 8px; color: var(--data); }

/* ===== 流程进度条（步骤芯片） ===== */
.flowbar { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 14px; }
.flowbar .step {
  padding: 3px 9px; border-radius: var(--radius-sm); font-size: var(--fs-xs); font-weight: 600;
  background:var(--gray-bg); color: var(--gray); border:1px solid var(--gray-line); white-space: nowrap;
}
.flowbar .step.done { background:var(--st-done-bg); color: var(--st-done-ink); border-color:var(--st-done-line); }
.flowbar .step.cur  { background:var(--accent); color:#fff; border-color:var(--accent); }
.flowbar .arrow { color: var(--muted); }

/* 只读字段标记 */
em.edt {
  font-style: normal; font-size: 11px; color: var(--muted-strong); background:var(--gray-bg);
  padding: 1px 6px; border-radius: var(--radius-sm); margin-left: 6px; font-weight: 600;
}

/* 两栏布局 */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1024px) and (min-width: 641px) { .two-col { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .two-col { grid-template-columns: 1fr; } }

/* ===== 图表（配色对齐强调色 + 语义） ===== */
.bar-chart { display: flex; flex-direction: column; gap: 10px; }
.bar-item { display: flex; align-items: center; gap: 10px; }
.bar-label { width: 84px; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.bar-track { flex: 1; height: 18px; background:var(--gray-bg); border-radius: var(--radius-sm); overflow: hidden; }
.bar-fill { height: 100%; background:var(--data); border-radius: var(--radius-sm); transition: width .4s ease; }
.bar-val { width: 30px; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.donut-wrap { position: relative; width: 160px; height: 160px; margin: 10px auto; }
.donut { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
.donut-num { font-size: 22px; font-weight: 700; color: var(--ink); }
.donut-label { font-size: 12px; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; justify-content: center; margin-top: 10px; }
.legend-item { font-size: 12px; display: flex; align-items: center; gap: 6px; color: var(--text); }
.legend-dot { width: 10px; height: 10px; border-radius: var(--r-xs); }

.trend-chart { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding: 10px 0 22px; border-bottom:1px solid var(--border); position: relative; }
.trend-item { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.trend-bar { width: 100%; background:var(--data); border-radius: var(--r-xs) 2px 0 0; opacity: .9; min-height: 2px; }
.trend-date { position: absolute; bottom: 4px; font-size: var(--fs-xs); color: var(--muted); transform: rotate(-45deg); transform-origin: left top; white-space: nowrap; }

/* ===== 通知中心 ===== */
.notify-list { display: flex; flex-direction: column; gap: 12px; }
.notify-item {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 14px; border:1px solid var(--border); border-radius: var(--radius); background:var(--surface); box-shadow:var(--shadow);
}
.notify-item.unread { background:#fff; border-color:var(--line); }
.notify-title { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; color: var(--ink); }
.notify-title .dot { width: 8px; height: 8px; background:var(--err); border-radius: 50%; }
.notify-meta { font-size: 12px; margin-top: 4px; color: var(--muted); }
.notify-body { margin: 8px 0 0; padding: 0; font-family: inherit; font-size: 13px; color: var(--text); white-space: pre-wrap; line-height: 1.5; }
.notify-actions { flex-shrink: 0; }

/* ===== 详情页：视口高 flex 容器，三段各自独立滚 ===== */
/* 根本性方案：详情页自成为 height:100vh 的 flex 容器,
   内部三段(冻结头 + 红框主内容 + 蓝框签核)各占满、各自独立垂直滚。
   【关键陷阱】每一层 flex 子项都必须 min-height: 0,
   否则 flex 默认 min-height: auto 会被内容自然高度撑爆,
   overflow-y: auto 永远不会出现滚动条 —— 这是 flex+独立滚的经典坑。 */
.detail-shell {
  display: flex; flex-direction: column;
  height: 100vh;        /* 占满视口,内部全在它之内 */
  min-height: 0;
}
.detail-frozen {
  flex-shrink: 0;       /* 冻结头不压缩, 始终自然高度在顶部 */
  position: sticky; top: 0; z-index: 20;   /* 双保险: 即使布局变化也始终置顶 */
  background:var(--panel); padding: 8px 20px 6px;
  border-bottom:2px solid var(--line);
}
/* 冻结第一行：标题组 | 信息芯片 | 按钮组 */
.frozen-bar {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: nowrap;
}
/* 左侧：标题 + 三层ID徽章（整体不压缩，避免徽章换行错位） */
.fb-left {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0; min-width: 0;
}
.frozen-bar .page-title {
  font-size: 17px; white-space: nowrap; margin: 0; min-width: 0;
}
.frozen-chips {
  display: flex; gap: 5px; flex-wrap: wrap; flex: 1 1 auto; min-width: 0;
  align-items: center;
}
.chip {
  font-size: var(--fs-sm); padding: 2px 7px; border-radius: var(--r-pill);
  background:var(--surface); color: var(--muted); border:1px solid var(--border-soft);
  white-space: nowrap; line-height: 1.4;
}
.chip.accent { background:var(--gray-bg); color: var(--muted-strong); border-color:var(--gray-line); font-weight: 600; }
.chip.st-prog { background:var(--st-prog-bg); color: var(--st-prog-ink); border-color:var(--st-prog-line); }
.chip.st-done { background:var(--st-done-bg); color: var(--st-done-ink); border-color:var(--st-done-line); }

/* ===== 三层ID徽章(项目/流水/客户编号) ===== */
.id-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-sm); padding: 3px 10px; border-radius: var(--r-pill);
  white-space: nowrap; line-height: 1.5; font-weight: 600;
  border:1px solid transparent; text-decoration: none;
}
.id-pill .srf-k { font-size: 12px; font-weight: 600; opacity: .82; letter-spacing: .5px; }
.id-pill b { font-size: var(--fs-md); font-weight: 700; letter-spacing: .3px; font-variant-numeric: tabular-nums; }
.id-pill.prj { background:var(--st-prog-bg); color: var(--st-prog-ink); border-color:var(--st-prog-line); }
.id-pill.prj:hover { background:var(--st-done-bg); color:#fff; }
.id-pill.run { background:var(--st-prog-bg); color:var(--st-prog-ink); border-color:var(--st-prog-line);
  box-shadow:0 1px 2px rgba(21,96,143,.18); }
.id-pill.cust { background:var(--surface); color: var(--muted); border-color:var(--border-soft); }
.id-pill.cust .srf-k { opacity: .7; }
/* 列表中项目编号链接 */
/* padding 由 1px 6px 提到 3px 8px：命中盒 21px → 25px 高（桌面鼠标也更好点），行高仅增 4px */
.prj-link { font-weight: 600; color: var(--st-prog-ink); text-decoration: none;
  padding: 3px 8px; border-radius: var(--radius-sm); white-space: nowrap;
  background:var(--st-prog-bg); border:1px solid var(--st-prog-line);
  font-variant-numeric: tabular-nums; }
.prj-link:hover { background:var(--st-done-bg); color:#fff; }

/* ===== 流水号徽章（全局统一显示） ===== */
.srf-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: var(--fs-sm); padding: 3px 10px; border-radius: var(--r-pill);
  background:var(--gray); color:#fff; border:1px solid var(--gray);
  white-space: nowrap; line-height: 1.5; font-weight: 600;
  box-shadow:0 1px 2px rgba(15,23,42,.18);
}
.srf-pill .srf-k { font-size: 12px; font-weight: 600; opacity: .82; letter-spacing: .5px; }
.srf-pill b { font-size: var(--fs-md); font-weight: 700; letter-spacing: .3px; font-variant-numeric: tabular-nums; }
.srf-pill.ghost {
  background:var(--gray-bg); color: var(--gray); border-color:var(--gray-line);
  box-shadow:none;
}
/* 表格 / 列表中小尺寸流水号链接 */
.srf-link {
  font-weight: 700; color: var(--muted-strong); text-decoration: none; white-space: nowrap;
  font-variant-numeric: tabular-nums; padding: 3px 8px; border-radius: var(--radius-sm);
  background:var(--gray-bg); border:1px solid var(--gray-line);
}
.srf-link:hover { background:var(--gray); color:#fff; }
/* 签核 / 通知页流水号标签 */
.srf-tag { font-weight: 600; color: var(--muted-strong); }
/* 操作按钮组：3列×2行等宽等高网格，整体贴右 */
.frozen-actions {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  grid-auto-rows: 1fr;
  gap: 6px;
  margin-left: auto;          /* 向右对齐 */
  justify-items: stretch;
}
.frozen-actions .btn {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  height: 100%;
  padding: 5px 8px;
  font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  text-align: center; line-height: 1.2;
  white-space: nowrap;
}
/* 刷新中状态 */
.frozen-actions .btn.is-loading { opacity: .72; cursor: progress; }
/* 签核历史：关闭态用弱化样式表示面板已隐藏 */
.frozen-actions .btn.is-off {
  background:var(--surface); color: var(--muted);
  border-color:var(--border-soft);
  box-shadow:none;
}
/* 冻结第二行：分段进度药丸（B·封样 → A·颜色样 → C·检测样 → D·大货） */
.seg-chips {
  display: flex; gap: 7px; margin-top: 5px; flex-wrap: wrap;
}
.seg-pill {
  font-size: 12px; padding: 3px 11px; border-radius: var(--r-pill); border:1px solid var(--border-soft);
  background:var(--surface); color: var(--muted); display: inline-flex; align-items: center; gap: 2px;
  line-height: 1.4;
}
.seg-pill b { font-weight: 800; color: var(--muted-strong); letter-spacing: .3px; }
.seg-pill em { font-style: normal; font-size: var(--fs-2xs); opacity: .7; }
.seg-pill i { font-style: normal; font-size: var(--fs-2xs); font-weight: 700; }
.seg-pill.active {
  background:var(--accent); color:#fff; border-color:var(--accent);
}
.seg-pill.active b { color:#fff; }
.seg-pill.active em { opacity: .85; color:#fff; }
.seg-pill.active i { color:var(--text-on-accent); }

/* 中间内容区：flex:1 占满 .detail-shell 剩余高度, 本身 overflow:hidden+min-height:0
   把高度约束传下去; 内部 .detail-body 再分两栏 */
.detail-scroll {
  flex: 1; min-height: 0;
  padding: 12px 24px 32px;
  overflow: hidden;
}
/* 两栏容器：占满 .detail-scroll 高度, 两栏 stretch 对齐 */
.detail-body {
  display: flex; gap: 16px;
  align-items: stretch;
  height: 100%;
  min-height: 0;
}
/* 左主内容(红框)：flex:1 撑满, 内部 overflow-y:auto 独立垂直滚 —— 红框内出现滚动条 */
.detail-main {
  flex: 1; min-width: 0; min-height: 0;
  overflow-y: auto;
  padding-right: 8px;     /* 给滚动条留缝, 避免内容贴边 */
  -webkit-overflow-scrolling: touch;
}
/* 右签核面板(蓝框)：固定宽, 内部 overflow-y:auto 独立垂直滚 —— 蓝框内出现滚动条 */
.flow-aside {
  width: 340px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 14px;
  overflow-y: auto;
  min-height: 0;
  padding: 0 0 0 4px;
  -webkit-overflow-scrolling: touch;
  transition: width .18s ease, opacity .18s ease;
}
/* 【签核历史】按钮：隐藏右侧状态/签核面板，主区自动占满 */
.detail-body.flow-collapsed .flow-aside {
  width: 0; opacity: 0; padding-left: 0; overflow: hidden;
  pointer-events: none; border:0;
}
.detail-body.flow-collapsed { gap: 0; }
/* 蓝框卡片:flex-shrink:0 是关键——作为 .flow-aside(flex column) 的子项,
   默认会被压缩到容器内, 内容在卡片内部被 overflow:hidden 截掉、蓝框不出滚动条;
   不压缩后卡片按自然高度排, 总高超出容器即触发蓝框 overflow-y:auto 滚动 */
.fa-card { flex-shrink: 0; background:var(--panel); border:1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.fa-head { padding: 10px 14px; font-size: 14px; font-weight: 600; letter-spacing: .04em;
  color:#fff; background:var(--nav-bg); border-bottom:1px solid var(--nav-line); }
.fa-status { padding: 8px 14px 10px; }
.fa-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  font-size: 14px; padding: 6px 0; border-bottom:1px dashed var(--line); }
.fa-row:last-child { border-bottom:none; }
.fa-row .hl { color: var(--data); font-weight: 600; }
/* OA 审批流时间线 */
.timeline { position: relative; padding: 16px 14px 8px; }
.timeline::before { content: ""; position: absolute; left: 19px; top: 20px; bottom: 18px;
  width: 2px; background:var(--line); }
.tl-item { position: relative; padding: 0 0 18px 24px; }
.tl-dot { position: absolute; left: 13px; top: 3px; width: 12px; height: 12px; border-radius: 50%;
  background:var(--gray); border:2px solid var(--panel); box-shadow:0 0 0 1px var(--line); }
.tl-item.kind-save .tl-dot { background:var(--nav-muted); box-shadow:0 0 0 1px var(--line); }
.tl-item.kind-urge .tl-dot { background:var(--amber); box-shadow:0 0 0 1px var(--amber-line); }
.tl-item.kind-reject .tl-dot { background:var(--err); box-shadow:0 0 0 1px var(--line-danger-mute); }
.tl-item.kind-reject .tl-title { color: var(--err); }
/* 驳回操作区 */
.reject-box { border-left:3px solid var(--err); }
.reject-box .fa-title { color: var(--err); }
.reject-box select, .reject-box input[type="text"] { border-color:var(--line-danger-soft); }
.reject-box select:focus, .reject-box input[type="text"]:focus { border-color:var(--err); }
/* 驳回关闭 / 重新打样横幅 */
.banner { border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 10px;
  font-size: 13px; line-height: 1.6; }
.banner a { text-decoration: underline; }
.banner.closed { background:var(--tint-danger-banner); border:1px solid var(--line-danger-mute); color:var(--text-danger-deep); }
.banner.reborn { background:var(--info-bg); border:1px solid var(--info-line); color: var(--info-ink); }
.tl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tl-role { font-size: 14px; font-weight: 600; color: var(--panel-ink); }
.tl-role-name { font-style: normal; font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 2px; }
.tl-time { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl-title { font-size: 14px; margin-top: 2px; color: var(--panel-ink); }
.tl-node { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: var(--r-xs);
  background:var(--info-bg); color: var(--info-ink); border:1px solid var(--info-line); }
.tl-desc { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.55; }
.notice-box {
  background:var(--info-bg); border:1px solid var(--info-line); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.notice-box p { margin: 0; font-size: 13px; color: var(--muted-strong); }
.notice-box a { font-size: 13px; }

/* 段状态瓦片（旧版大卡片，保留兼容；新版用 .seg-chips/.seg-pill） */
.seg-status { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.seg-tile {
  flex: 1; min-width: 120px; border:1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 11px; background:var(--surface); box-shadow:var(--shadow);
}
.seg-tile.on { }
.seg-tile.active { border-color:var(--accent); background:var(--accent-soft); }
.seg-tile .st-name { font-weight: 700; font-size: 13px; color: var(--ink); }
.seg-tile.active .st-name { color: var(--accent-d); }
.seg-tile .st-tag { color: var(--muted); font-size: 11px; font-weight: 600; }
.seg-tile .st-node { color: var(--muted); margin-top: 2px; font-size: 12px; }

/* ===== 操作面板（步骤进度 + 操作按钮，紧凑卡片） ===== */
.action-panel {
  background:var(--surface); border:1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px;
  box-shadow:var(--shadow);
  position: sticky; top: 0; z-index: 25;   /* 在 .detail-main 内滚动时冻结置顶 */
}
/* 第一行：分段步骤进度条 */
.ap-steps {
  padding-bottom: 12px; margin-bottom: 12px;
  border-bottom:1px dashed var(--border-soft);
}
.ap-steps-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  margin-bottom: 10px; flex-wrap: wrap;
}
.ap-steps-title {
  font-size: var(--fs-md); font-weight: 700; color: var(--ink);
  display: inline-flex; align-items: center; gap: 6px;
}
.ap-steps-title::before {
  content: ""; width: 4px; height: 14px; border-radius: var(--r-xs); background:var(--gray); display: inline-block;
}
.ap-steps-cur { font-size: var(--fs-sm); color: var(--muted); }
.ap-steps-cur b { color: var(--accent-d); font-weight: 800; font-size: 14px; letter-spacing: .3px; }

.step-bar {
  display: flex; align-items: flex-start; flex-wrap: wrap; gap: 0;
}
.step {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 64px; flex: 1 1 auto; position: relative; text-align: center;
}
.step-dot {
  width: 16px; height: 16px; border-radius: 50%; border:2px solid var(--border);
  background:var(--surface); position: relative; z-index: 2; transition: all .15s;
}
.step-code {
  font-size: var(--fs-xs); font-weight: 800; letter-spacing: .3px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.step-name { font-size: var(--fs-xs); color: var(--muted); line-height: 1.25; }
/* ⚠️ 修正：--warn(#b45309) 在 --warn-bg(#fbf1e4) 上为 4.497:1，差一点点不达 AA；
   改用 --text-warning(#8a5a00)，同底 5.31:1。字号 11→12（低于 12px 在手机上不可读）。 */
.step-confirm {
  font-size: var(--fs-xs); font-weight: 600; color: var(--gold-ink); background:var(--gold-bg);
  border:1px solid var(--gold-line); border-radius: var(--r-pill); padding: 0 5px; line-height: 1.4;
  margin-top: 1px;
}
/* 已完成 */
.step.done .step-dot {
  background:var(--st-done-bg); border-color:var(--st-done-bg);
}
.step.done .step-dot::after {
  content: "✓"; color:#fff; font-size: var(--fs-2xs); font-weight: 700;
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
}
.step.done .step-code { color: var(--st-prog-ink); }
.step.done .step-name { color: var(--st-prog-ink); }
/* 当前 */
.step.cur .step-dot {
  background:var(--accent); border-color:var(--accent-d);
  box-shadow:0 0 0 3px var(--accent-soft), 0 0 0 4px var(--accent-line);
}
.step.cur .step-code { color: var(--accent-d); }
.step.cur .step-name { color: var(--accent-d); font-weight: 700; }
/* 待处理 */
.step.pending .step-dot { background:var(--surface); border-color:var(--border); }
.step.pending .step-code { color: var(--muted); }
.step.pending .step-name { color: var(--muted); }
/* 连接线 */
.step-line {
  flex: 0 0 24px; height: 2px; background:var(--border); margin-top: 7px; align-self: flex-start;
}
.step-line.done { background:var(--st-done-bg); }

/* 第二行：操作按钮（SAP Fiori toolbar 风格 · 2026-09-01 整体优化）
   设计原则：
   · 宽度由内容驱动（content-driven），绝不截断文案；
   · 语义层级靠「底色 + 字色 + 描边」三者的组合区分，而不是全部实心填充；
   · 正向流转靠左、破坏性/辅助操作靠右分隔，降低误触（Fiori footer bar 惯例）。 */
.ap-actions {
  display: flex; flex-direction: column; gap: 8px;
  /* SAP Fiori "Action Bar"：操作区自成一层。
     原实现是裸区块，按钮行与上方流程步骤、下方表单字段之间没有边界，
     扫视时容易把"流转按钮"误读为某个字段的附属操作。
     浅灰容器 + 细描边让"可执行动作"成为一个明确的语义区块。 */
  background: var(--surface-2);
  border: 1px solid var(--line-hairline);
  border-radius: var(--r-md);
  padding: 10px 12px;
}
.ap-actions-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
}
.ap-actions-label {
  flex: 0 0 auto; align-self: center;
  font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap;
}
.ap-actions-btns {
  flex: 1 1 auto; display: flex; gap: 8px; align-items: center;
  min-width: 0; flex-wrap: wrap;   /* 窄屏/长文案时换行，绝不挤压截断 */
}
.ap-actions-item {
  flex: 0 0 auto; display: flex; min-width: 0;
}
.ap-actions-item form,
.ap-actions-item > button {
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.ap-actions-item .btn {
  /* 2026-09-01 王毅「退回…（编辑）可以显示完整，不用遮挡」修复：
     原规则 width:160px + overflow:hidden + text-overflow:ellipsis 会把
     「退回至「大货订单下单」（编辑）」这类长文案截成省略号（右括号丢失）。
     改为 Fiori 的内容驱动宽度：min-width 保底对齐、宽度随文案伸展、禁止截断。 */
  width: auto;
  min-width: 96px;
  max-width: none;
  height: 32px;                 /* Fiori compact 控件高度，全行按钮等高 */
  padding: 0 14px;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  letter-spacing: .01em;
}
/* 辅助操作（驳回 / 催办）推到行尾，与流转操作形成左右分组，
   中间由 auto 外边距撑开——破坏性操作远离常用路径，减少误点。 */
.ap-actions-item--aux { }
.ap-actions-item:not(.ap-actions-item--aux) + .ap-actions-item--aux {
  margin-left: auto;
}
.ap-actions-item--aux + .ap-actions-item--aux { margin-left: 0; }

/* 工具栏内语义按钮去实心化（Fiori semantic button）：
   红/琥珀在此处改为「白底 + 语义色字 + 语义色描边」，hover 才填浅语义底。
   工具栏里只有主流转（钢蓝实心）保持填充态，视觉焦点唯一，
   避免 4~5 个高饱和实色块并列造成的"仪表盘噪点"。 */
.ap-actions-btns .btn.danger,
.ap-actions-btns .btn.warning,
.ap-actions-btns .btn.urge {
  background: var(--surface);
  box-shadow: none;
  font-weight: 600;
}
.ap-actions-btns .btn.danger {
  color: var(--err); border-color: var(--line-danger-soft);
}
.ap-actions-btns .btn.danger:hover {
  background: var(--err-bg); border-color: var(--err); color: var(--text-danger-deep);
}
.ap-actions-btns .btn.warning {
  color: var(--text-warning); border-color: var(--line-warning-soft);
}
.ap-actions-btns .btn.warning:hover {
  background: var(--gold-bg); border-color: var(--gold-edge); color: var(--text-warning);
}
.ap-actions-btns .btn.urge {
  color: var(--text-warning); border-color: var(--line-warning-soft);
}
.ap-actions-btns .btn.urge:hover {
  background: var(--gold-bg); border-color: var(--gold-edge); color: var(--text-warning);
}
/* 工具栏内一律不做位移反馈：密集按钮区 translateY 会造成整行跳动，
   改用背景/描边变化表达 hover（同 Fiori / Tesla 车机的"稳定目标"原则）。 */
.ap-actions-btns .btn:hover { transform: none; }
.ap-actions-btns .btn:active {
  transform: none; box-shadow: inset 0 1px 3px 0 rgba(15,23,42,.14);
}
.ap-actions-btns .btn.secondary:hover { box-shadow: 0 1px 2px rgba(15,23,42,.08); }

/* ⚠️ 移动端断点必须放在桌面规则之后（2026-09-01 层叠 bug 修复）：
   这些规则原写在 style.css 顶部（约 413 行）的 @media 块里，而 .ap-actions-* 主规则在
   本文件更靠后 —— 两者特异性相同（.ap-actions-item .btn = 0,2,0），按源码顺序后者胜出，
   导致 .ap-actions-item .btn 的 width:100% / flex:1 1 45% 长期被桌面规则覆盖，从未生效。
   媒体查询不会提升特异性，只有顺序能决定胜负。 */
@media (max-width: 768px) {
  .ap-actions-row { flex-wrap: wrap; gap: 8px; }
  .ap-actions-label { width: 100%; margin-bottom: 2px; }
  .ap-actions-btns { gap: 8px; flex-wrap: wrap; }
  .ap-actions-item { flex: 1 1 45%; min-width: 120px; }
  /* 按钮撑满所在栅格，且允许文案换行（Tesla 大点击区原则）：
     绝不因栅格宽度不足而截断「退回至「大货订单下单」（编辑）」这类长文案。 */
  .ap-actions-item .btn {
    width: 100%; min-width: 0; min-height: 38px; height: auto;
    padding: 7px 12px;
    white-space: normal; line-height: 1.35;
  }
  /* 窄屏换行后左右分组失去意义，取消推右避免布局跳变 */
  .ap-actions-item:not(.ap-actions-item--aux) + .ap-actions-item--aux { margin-left: 0; }
}

.ap-hints {
  display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center;
}

/* 旧版兼容类（保留） */
.ap-block {
  padding-bottom: 8px; margin-bottom: 8px;
  border-bottom:1px dashed var(--border-soft);
}
.ap-block:last-child { border-bottom:none; margin-bottom: 0; padding-bottom: 0; }
.ap-label {
  font-size: var(--fs-md); font-weight: 700; color: var(--ink); margin-bottom: 4px;
}
.ap-label-err { color: var(--err); }
/* 操作提示条（SAP Fiori "Message Strip" · 2026-09-01 整体优化）
   原实现是裸文字夹在按钮行之间，与正文同级、极易被扫视时略过。
   改为带容器的 Message Strip：浅底 + 左侧 3px 强调条 + 胶囊圆角，
   让"执行前必读的前置条件"在视觉上自成一层，而不抢夺按钮的注意力。 */
.ap-hint {
  display: inline-flex; align-items: flex-start; gap: 6px;
  font-size: var(--fs-sm); line-height: var(--lh-tight); color: var(--muted-strong);
  /* 白底：Action Bar 容器（.ap-actions）已改为 --surface-2 浅灰，
     提示条必须比容器亮一档才能浮出来（层叠对比：容器灰 → 卡片白 → 左条强调色）。 */
  background: var(--surface);
  border: 1px solid var(--line-hairline);
  border-left: 3px solid var(--gray);
  border-radius: var(--r-sm);
  padding: 5px 10px;
}
.ap-hint b { color: var(--text-warning); font-weight: 700; }
.ap-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.ap-reject-form {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.ap-reject-form select { min-width: 200px; flex: 1; }
.ap-reject-form input[type="text"] { min-width: 180px; flex: 2; }
.ap-urge { margin-top: 4px; }

/* 流转操作区 */
.flow-actions { margin-top: 10px; padding: 12px; background:var(--surface); border:1px solid var(--border); border-radius: var(--radius-sm); }
.flow-actions .fa-title { font-weight: 700; font-size: 13px; margin-bottom: 4px; color: var(--ink); }
.flow-actions .fa-hint { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.flow-actions .fa-hint b { color: var(--gold-ink); }

/* ===== 登录页 · 业务流管理系统（2026-09-02 v3 · 左右分栏版）=====
   用户拍板：登录界面按「v1 设计」= 左右分栏（左品牌叙事 / 右登录卡）。
   手法 = 浅冷灰整页 + 左上暖橘/右下数据蓝双辉光 + 点阵底纹 + 六节点流程链 + 白卡登录。
   主色严格 3 种，与全站一致：嘉益橘红(--cayi) / 深墨(--lp-ink) / 数据流蓝(--data)。

   ⚠️ 铁律一：浅底上严禁 background-clip:text 白→灰渐变（白底白字等于不可见），标题一律 solid color。
   ⚠️ 铁律二：本区块 hex 色值**全部走 --lp-* 局部令牌**（挂在 .login-page 上，自定义属性可继承，
      不污染全局 :root）。设计系统守卫会拦截安全区内的硬编码 6 位十六进制色值。
   ⚠️ 铁律三：.right/.card/.btn/.fld 是系统既有全局类——本区块一切选择器必须限定在
      .login-page 命名空间下，严禁裸写类名（曾因 .right 撞全局 text-align 排查半天）。
   ⚠️ 对比度定案：纯品牌色 #e54a25 只允许出现在 ≥24px 粗体大标题(.accent，对浅底 3.61:1 > 3:1 大字 AA)
      与无文字装饰；小字强调一律 --accent(#c43a18, 4.87:1) 或 --accent-d(#a8340f)。 */
.login-page {
  /* --- 局部令牌（浅色分栏版） --- */
  --lp-bg: #f4f6fa;            /* 整页浅冷灰 */
  --lp-card: #ffffff;          /* 登录卡 */
  --lp-field: #eef2f7;         /* 输入/验证码底 */
  --lp-ink: #0f172a;           /* 主文字 */
  --lp-text: #334155;          /* 次级正文（10.4:1 on --lp-bg） */
  --lp-mid: #5c6a80;           /* 说明/节点 label（≈5:1 on --lp-bg） */
  --lp-faint: #6e7a90;         /* 辅助小字（≈4.5:1 on --lp-bg） */
  --lp-live: #1f7cba;          /* SYS LIVE 在线点（需求十三绿清除 → 数据蓝，4.52:1） */
  --lp-err-bg: #fdf0ee;
  --lp-err-ink: #8a2c20;
  --lp-err-line: #eccfca;
  --lp-mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  display: grid; grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 60% 50% at 0% 30%, rgba(229, 74, 37, 0.06), transparent 60%),
    radial-gradient(ellipse 50% 50% at 100% 100%, rgba(31, 124, 186, 0.05), transparent 60%),
    var(--lp-bg);
  position: relative;
  overflow: hidden;
  font-size: 14px;
}

/* ===== 左侧：品牌叙事 ===== */
.login-page .lgt-left {
  position: relative;
  padding: 56px 56px 36px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
/* 去无效框线：左右两栏不再用竖分隔线，靠插画与背景光晕自然分区 */
.login-page .lgt-illus {
  flex: 1 1 auto;
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1;
  min-height: 0; padding: 12px 0 8px;
}
.login-page .lgt-illus svg {
  width: min(100%, 520px); height: auto; max-height: 100%;
  display: block;
}
/* 背景点阵：浅底必须用深色点（铁律） */
.login-page .lgt-left::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(15, 23, 42, 0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom right, #000 0%, transparent 70%);
  mask-image: linear-gradient(to bottom right, #000 0%, transparent 70%);
}

.login-page .lgt-brand {
  display: flex; align-items: center; gap: 14px;
  position: relative; z-index: 2;
}
.login-page .lgt-logo img { height: 42px; width: auto; display: block; }
.login-page .lgt-brand-name { display: flex; flex-direction: column; gap: 2px; }
.login-page .lgt-brand-name .cn {
  font-size: 18px; font-weight: 700; color: var(--lp-ink); letter-spacing: 1px;
}
.login-page .lgt-brand-name .en {
  font-family: var(--lp-mono);
  font-size: 10px; color: var(--lp-mid); letter-spacing: 2px; text-transform: uppercase;
}

.login-page .lgt-hero { position: relative; z-index: 2; margin-top: 0; }
.login-page .lgt-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--lp-mono);
  font-size: 11px; color: var(--accent-d);
  letter-spacing: 3px; text-transform: uppercase; font-weight: 700;
  margin-bottom: 14px;
  /* 去无效框线：裸标签（点 + 字），不再套胶囊底与边框 */
}
.login-page .lgt-eyebrow::before {
  content: ""; width: 6px; height: 6px;
  background: var(--cayi); border-radius: 50%;
  box-shadow: 0 0 6px var(--cayi-glow);
}
.login-page .lgt-title {
  font-size: 44px; font-weight: 800; line-height: 1.15;
  margin: 0 0 14px; letter-spacing: -0.5px;
  color: var(--lp-ink);
}
/* 大字（44px/800）AA 阈值 3:1：#e54a25 对浅底 3.61:1 ✓；小字禁用本色 */
.login-page .lgt-title .accent { color: var(--cayi); }
.login-page .lgt-desc {
  font-size: 14px; color: var(--lp-text); line-height: 1.75;
  max-width: 440px; margin: 0 0 30px;
}

/* 六节点流程链（研发→业务→样品→检测→封样→大货），lead=业务 */
.login-page .flow-chain {
  display: flex; align-items: center;
  font-family: var(--lp-mono);
  font-size: 11px; margin-top: 24px;
}
.login-page .flow-chain .node {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  position: relative; flex-shrink: 0;
}
.login-page .flow-chain .dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--lp-card);
  border: 2px solid var(--data);
  position: relative; z-index: 2;
  transition: all .3s ease;
}
.login-page .flow-chain .node.lead .dot {
  border-color: var(--cayi); background: var(--cayi);
  box-shadow: 0 0 12px var(--cayi-glow);
  transform: scale(1.15);
}
.login-page .flow-chain .node.lead .label {
  color: var(--accent); font-weight: 800; letter-spacing: 1.5px;
}
.login-page .flow-chain .label { color: var(--lp-mid); letter-spacing: 1px; }
.login-page .flow-chain .link {
  flex: 1; height: 2px;
  background: var(--data);
  position: relative; margin: 0 -2px 22px; min-width: 22px;
  overflow: hidden;
}
.login-page .flow-chain .node.lead + .link,
.login-page .flow-chain .link:has(+ .node.lead) {
  background: linear-gradient(90deg, var(--cayi) 0%, var(--data) 100%);
}
.login-page .flow-chain .link::after {
  content: "";
  position: absolute; top: 0; left: -30%; height: 100%; width: 30%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.9), transparent);
  animation: lgtFlowMove 2.4s linear infinite;
}
@keyframes lgtFlowMove { 0% { left: -30%; } 100% { left: 100%; } }

.login-page .lgt-foot {
  margin-top: 36px; position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--lp-mono);
  font-size: 11px; color: var(--lp-faint); letter-spacing: 0.5px;
}
.login-page .lgt-foot-item { display: flex; align-items: center; gap: 6px; }
.login-page .lgt-foot .live {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--lp-live); font-weight: 600;
}
.login-page .lgt-foot .live::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--lp-live);
  box-shadow: 0 0 5px rgba(21, 128, 61, 0.5);
  animation: lgtPulse 1.4s ease-in-out infinite;
}
@keyframes lgtPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* ===== 右侧：登录 ===== */
.login-page .lgt-right {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  padding: 40px; overflow: hidden; text-align: left;
}
.login-page .lgt-right::before {
  content: "";
  position: absolute; top: -20%; right: -10%;
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(229, 74, 37, 0.10) 0%, transparent 60%);
  pointer-events: none;
}
.login-page .lgt-right::after {
  content: "";
  position: absolute; bottom: -20%; left: -10%;
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(31, 124, 186, 0.10) 0%, transparent 60%);
  pointer-events: none;
}

.login-page .lgt-card {
  position: relative; z-index: 2;
  width: 100%; max-width: 420px;
  background: var(--lp-card);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  padding: 40px 36px 32px;
  box-shadow: 0 18px 48px -18px rgba(15, 23, 42, 0.18);
  animation: lgtCardIn .6s ease both;
}
@keyframes lgtCardIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.login-page .lgt-card::before {
  content: "";
  position: absolute; top: -1px; left: 32px; right: 32px; height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--cayi) 50%, transparent 100%);
  border-radius: 2px;
}

.login-page .lgt-card-title { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.login-page .lgt-card-title .cn {
  font-size: 22px; font-weight: 700; color: var(--lp-ink); letter-spacing: 1px;
}
.login-page .lgt-card-title .en {
  font-family: var(--lp-mono);
  font-size: 10px; color: var(--lp-mid); letter-spacing: 2px; text-transform: uppercase;
}
.login-page .lgt-card-sub { font-size: 12px; color: var(--lp-mid); margin: 0 0 26px; }

.login-page .fld { display: block; margin-bottom: 16px; }
.login-page .fld > .lbl {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; color: var(--lp-mid); letter-spacing: 0.5px;
  margin-bottom: 6px;
  font-family: var(--lp-mono);
  text-transform: uppercase; font-weight: 600;
}
.login-page .input {
  position: relative;
  display: flex; align-items: center;
  height: 44px;
  background: var(--lp-field);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  transition: all .15s ease;
}
.login-page .input:hover { border-color: rgba(15, 23, 42, 0.16); }
.login-page .input:focus-within {
  border-color: var(--cayi); background: var(--lp-card);
  box-shadow: 0 0 0 3px rgba(229, 74, 37, 0.16);
}
.login-page .input .icon {
  width: 18px; height: 18px; margin: 0 10px 0 12px;
  color: var(--lp-mid); flex-shrink: 0;
}
.login-page .input:focus-within .icon { color: var(--cayi); }
.login-page .input input {
  flex: 1; height: 100%;
  background: transparent; border: 0; outline: 0;
  color: var(--lp-ink); font: inherit; font-size: 14px;
  padding-right: 12px;
}
.login-page .input input::placeholder { color: var(--lp-faint); }

/* 验证码行：算式 + 答案 + 刷新 */
.login-page .captcha-inline { display: flex; gap: 8px; }
.login-page .captcha-expr {
  flex: 0 0 auto; min-width: 110px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--lp-field);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  font-family: var(--lp-mono);
  font-size: 15px; font-weight: 700; color: var(--lp-ink);
  letter-spacing: 1px; font-variant-numeric: tabular-nums;
  /* 接口偶发失败时兜底文案较长，截断防撑宽挤压答案框 */
  max-width: 46%; white-space: nowrap; overflow: hidden;
}
.login-page .captcha-answer {
  flex: 1; height: 44px; min-width: 0;
  background: var(--lp-field);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px; padding: 0 14px;
  color: var(--lp-ink); font: inherit; font-size: 14px;
  font-family: var(--lp-mono);
  letter-spacing: 1px; outline: 0; transition: all .15s ease;
}
.login-page .captcha-answer:hover { border-color: rgba(15, 23, 42, 0.16); }
.login-page .captcha-answer:focus {
  border-color: var(--cayi); background: var(--lp-card);
  box-shadow: 0 0 0 3px rgba(229, 74, 37, 0.16);
}
.login-page .captcha-refresh {
  width: 44px; height: 44px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 0; border-radius: 8px; color: var(--lp-mid);
  cursor: pointer; transition: all .15s ease;
}
.login-page .captcha-refresh:hover {
  color: var(--accent);
  background: rgba(229, 74, 37, 0.09);
}
.login-page .captcha-refresh.spin svg { animation: lgtSpin .8s linear; }
@keyframes lgtSpin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

/* 错误提示：浅红底 + 深红字（5.9:1） */
.login-page .flash.err {
  margin-bottom: 18px; padding: 10px 14px;
  font-size: 13px; border-radius: 8px;
  background: var(--lp-err-bg); color: var(--lp-err-ink);
  border: 1px solid var(--lp-err-line); border-left: 3px solid var(--accent);
}

/* 登录按钮：与全站主按钮同源三段渐变（对白 5.30~6.64:1 全达标） */
.login-page .btn {
  position: relative;
  width: 100%; height: 46px;
  margin-top: 22px;
  background: linear-gradient(180deg, var(--btn-primary-1) 0%, var(--btn-primary-2) 60%, var(--btn-primary-3) 100%);
  color: #fff;
  border: 0; border-radius: 8px;
  font: inherit; font-size: 14px; font-weight: 600; letter-spacing: 4px;
  cursor: pointer; overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.15) inset,
    0 -2px 0 0 rgba(122, 32, 10, .55) inset,
    0 4px 12px rgba(196, 58, 24, .35);
  transition: all .2s ease;
}
.login-page .btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, var(--btn-primary-h1) 0%, var(--btn-primary-h2) 60%, var(--btn-primary-h3) 100%);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.2) inset,
    0 -2px 0 0 rgba(122, 32, 10, .55) inset,
    0 8px 24px rgba(196, 58, 24, .45);
  color: #fff;
}
.login-page .btn:active { transform: translateY(0); }
.login-page .btn::after {
  content: "";
  position: absolute; top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.28), transparent);
  transition: left .6s ease;
}
.login-page .btn:hover::after { left: 130%; }

.login-page .lgt-card-foot {
  margin-top: 22px; padding-top: 18px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; color: var(--lp-mid);
}
.login-page .lgt-card-foot .ver {
  font-family: var(--lp-mono); color: var(--lp-faint);
}

/* ===== 左栏插画：保温杯工程线稿 + 电路走线（v4）=====
   颜色全走令牌：走线/杯身=数据蓝(--data)，扫描线/芯片/暖点=嘉益橘(--cayi)。 */
.login-page .ic-flow {
  stroke: var(--data); stroke-width: 1.5; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
  opacity: .8;
  stroke-dasharray: 7 9;
  animation: icDash 3.2s linear infinite;
}
.login-page .ic-flow.warm { stroke: var(--cayi); opacity: .75; }
@keyframes icDash { to { stroke-dashoffset: -64; } }

.login-page .ic-dot { fill: var(--data); animation: icPulse 2.4s ease-in-out infinite; }
.login-page .ic-dot.warm { fill: var(--cayi); }
.login-page .ic-dot.d2 { animation-delay: .5s; }
.login-page .ic-dot.d3 { animation-delay: 1.1s; }
@keyframes icPulse {
  0%, 100% { opacity: .35; }
  50% { opacity: 1; }
}

.login-page .ic-node { fill: var(--data); opacity: .5; }

.login-page .ic-gear, .login-page .ic-chip {
  stroke: var(--data); stroke-width: 1.5; fill: none;
  opacity: .55;
  stroke-linecap: round; stroke-linejoin: round;
  transform-box: fill-box; transform-origin: center;
  animation: icSpin 24s linear infinite;
}
.login-page .ic-gear.rev { animation-direction: reverse; }
.login-page .ic-chip {
  stroke: var(--cayi); opacity: .7;
  animation: none;
}
@keyframes icSpin { to { transform: rotate(360deg); } }

.login-page .ic-cup {
  stroke: var(--data); stroke-width: 2; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
  opacity: .88;
}

.login-page .ic-scan rect {
  fill: var(--cayi); opacity: .55;
}
.login-page .ic-scan {
  animation: icScan 4.6s ease-in-out infinite;
}
@keyframes icScan {
  0%, 100% { transform: translateY(106px); opacity: 0; }
  12% { opacity: .55; }
  50% { transform: translateY(276px); opacity: .55; }
  62% { opacity: 0; }
}

/* 减动效偏好：插画动画全部静止（守卫要求） */
@media (prefers-reduced-motion: reduce) {
  .login-page .ic-flow, .login-page .ic-dot, .login-page .ic-gear,
  .login-page .ic-scan, .login-page .flow-chain .link::after,
  .login-page .lgt-foot .live::before, .login-page .lgt-card { animation: none; }
  .login-page .ic-dot, .login-page .ic-scan rect { opacity: .6; }
}

/* 窄屏：单列堆叠，品牌区在上、登录卡在下 */
@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-page .lgt-left { padding: 32px 24px 20px; border-right: 0; border-bottom: 1px solid rgba(15, 23, 42, 0.08); }
  .login-page .lgt-hero { margin-top: 16px; padding-bottom: 0; }
  .login-page .lgt-title { font-size: 30px; }
  .login-page .lgt-desc { font-size: 13px; margin-bottom: 18px; }
  .login-page .flow-chain { font-size: 10px; }
  .login-page .lgt-foot { display: none; }
  .login-page .lgt-right { padding: 24px; }
  .login-page .lgt-illus svg { max-height: 240px; }
}
@media (max-width: 480px) {
  .login-page .flow-chain .label { display: none; }
  .login-page .flow-chain .link { margin-bottom: 0; }
  .login-page .lgt-card { padding: 28px 20px 22px; }
}


/* ===== 打印报表 ===== */
.report { max-width: 820px; margin: 24px auto; background:#fff; padding: 40px 48px; border:1px solid var(--border); font-size: 13px; }
.report h1 { text-align: center; font-size: 22px; margin: 0 0 4px; }
.report .meta { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 16px 0; }
.report .meta div { min-width: 30%; }
.report .meta .k { color: var(--muted); }
.report table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.report table th, .report table td { border:1px solid #333; padding: 6px 8px; }
.report .sig { display: flex; justify-content: space-between; margin-top: 40px; }
.report .imgbox { border:1px dashed #999; height: 120px; text-align: center; color:#999; display: flex; align-items: center; justify-content: center; margin: 8px 0; }
.report .imgbox img { max-height: 120px; max-width: 100%; }
@media print {
  .sidebar, .no-print, .detail-frozen { display: none !important; }
  .main-content { width: 100%; }
  .detail-scroll { overflow: visible; }
  .report { border:none; margin: 0; padding: 0; }
}

.muted { color: var(--muted); }
.right { text-align: right; }
.flex { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ==================== 专业报表样式（基于嘉益表单规范）==================== */
/* ⚠️ 下行是历史遗留的「顶层自定义属性」——写在任何选择器之外，CSS 层面无效，从未生效过。
   其中 --ink: #1f2430 若被激活，会把三张报表正文色从 :root 的 #0f172a 改掉（属受保护区外观变更，禁止）。
   --cayi / --cayi-d 已按同值补进 :root（见上方）；此行保留仅为不改动受保护区文件结构。 */
--cayi: #fa3812; --cayi-d: #d62b08; --ink: #1f2430;
.sheet { background: #fff; border: 1px solid #c9ced8; max-width: 960px; margin: 0 auto; font-size: 12px; color: var(--ink); line-height: 1.5; }
.sh-hdr { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 2px solid #1a2540; background: #fff; }
.sh-hdr .sh-logo { height: 36px; flex-shrink: 0; }
.sh-corp { font-weight: 700; font-size: 14px; line-height: 1.3; flex: 1; color: #1a2540; }
.sh-corp small { display: block; font-weight: 400; font-size: 10.5px; color: #555; }
.sh-ttl { background: #eafbe9; text-align: center; padding: 5px 16px; font-weight: 700; font-size: 15px; border: 1px solid #b2d9b0; border-radius: 4px; white-space: nowrap; color: #1a2540; }
.sh-ttl.inspection { background: #eff6ff; border-color: #bfdbfe; }
.sh-ttl.seal { background: #fef3c7; border-color: #fde68a; }
.sh-cust-tag { font-size: 11px; white-space: nowrap; border-left: 1px solid #d7dbe2; padding-left: 12px; min-width: 72px; }
.sh-cust-tag b { display: block; font-size: 18px; font-weight: 800; color: #1a2540; }
.sh-cust-tag small { color: #777; }
.sh-kv { display: flex; align-items: stretch; border-bottom: 1px solid #e7eaf0; min-height: 28px; }
.sh-kv:last-child { border-bottom: none; }
.sh-k { background: #f4f7fb; font-weight: 600; font-size: 11.5px; color: #33414f; padding: 4px 8px; min-width: 110px; width: 110px; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid #e7eaf0; flex-shrink: 0; }
.sh-k small { font-weight: 400; color: #73808f; font-size: 9.5px; line-height: 1.2; }
.sh-v { padding: 4px 10px; font-size: 12px; flex: 1; display: flex; align-items: center; flex-wrap: wrap; gap: 3px; color: #222; }
.sh-grid3 { display: grid; grid-template-columns: 180px 1fr 1fr; border-bottom: 1px solid #d7dbe2; }
.sh-g-dept { border-right: 1px solid #d7dbe2; display: flex; flex-direction: column; }
.sh-g-lab { background: #f4f7fb; font-weight: 600; font-size: 11px; color: #33414f; padding: 5px 10px; border-bottom: 1px solid #d7dbe2; }
.sh-g-lab small { display: block; font-weight: 400; color: #73808f; font-size: 9.5px; }
.sh-recv-row { display: flex; border-bottom: 1px solid #e7eaf0; flex: 1; }
.sh-recv-row:last-child { border-bottom: none; }
.sh-recv-nm { width: 80px; padding: 3px 8px; font-size: 10.5px; border-right: 1px solid #e7eaf0; display: flex; flex-direction: column; justify-content: center; color: #33414f; }
.sh-recv-sig { flex: 1; display: flex; align-items: center; padding: 3px 8px; min-height: 34px; }
.sh-recv-sig img { max-height: 30px; }
.sign-empty { color: #c8cdd6; font-size: 11px; }
.sh-sup-photo { display: grid; grid-template-columns: 1fr 52%; border-bottom: 1px solid #d7dbe2; }
.sh-sup-col { border-right: 1px solid #d7dbe2; }
.sh-photo-col { padding: 8px; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr; gap: 6px; }
.sh-ph-label { font-size: 11px; font-weight: 600; color: #33414f; text-align: center; }
.sh-ph-label small { display: block; font-weight: 400; color: #73808f; font-size: 9.5px; }
.photo-box { border: 1px dashed #c9ced8; border-radius: 6px; display: flex; align-items: center; justify-content: center; background: #fafbfd; overflow: hidden; cursor: pointer; position: relative; min-height: 80px; }
.photo-box.large { min-height: 180px; }
.photo-box img { max-width: 100%; max-height: 260px; object-fit: contain; display: block; }
.photo-box .ph { color: #9aa3b2; font-size: 11px; text-align: center; padding: 10px; line-height: 1.6; }
.photo-box:hover { border-color: var(--cayi, #fa3812); background: #fff; }
.sec-title { background: #fff0ec; color: var(--cayi-d, #d62b08); font-weight: 700; padding: 4px 12px; border-bottom: 1px solid #d7dbe2; font-size: 12px; }
.sec-title.blue { background: #eff6ff; color: #1d4ed8; }
.sec-title.green { background: #e8f1f8; color: #15608f; }
.req { color: #e11d48; font-style: normal; font-weight: 700; margin-left: 2px; }
.comp-tb { width: 100%; border-collapse: collapse; }
.comp-tb th, .comp-tb td { border: 1px solid #d7dbe2; padding: 4px 6px; font-size: 11px; vertical-align: middle; }
.comp-tb th { background: #f4f7fb; color: #33414f; font-size: 10.5px; font-weight: 600; }
.comp-tb td.lab { background: #fafbfd; font-weight: 600; width: 200px; }
.comp-tb td.lab small { display: block; font-weight: 400; color: #73808f; font-size: 9.5px; }

/* ===== 封样申请单报表（按 封样申请单模板_v1 逐行重建） ===== */
.basic-tb { width: 100%; border-collapse: collapse; border: 1px solid #d7dbe2; }
.basic-tb td { border: 1px solid #e7eaf0; padding: 5px 8px; font-size: 11px; vertical-align: middle; line-height: 1.45; }
.basic-tb td.lab { background: #f4f7fb; color: #33414f; font-weight: 600; font-size: 11px; width: 12.5%; white-space: nowrap; }
.basic-tb td.lab small { display: block; font-weight: 400; color: #73808f; font-size: 9.5px; }
.basic-tb td.val { background: #fff; color: #222; }
.kv-list { border: 1px solid #d7dbe2; }
.kv-list .sh-kv { border-bottom: 1px solid #e7eaf0; }
.kv-list .sh-kv:last-child { border-bottom: none; }
.part-tb { width: 100%; border-collapse: collapse; }
.part-tb th, .part-tb td { border: 1px solid #d7dbe2; padding: 3px 5px; font-size: 10.5px; vertical-align: middle; }
.part-tb th { background: #D9E1F2; color: #1a2540; font-weight: 600; text-align: center; }
.part-tb td { color: #222; }
/* 仅作用于零件表空态提示；切勿再用裸 .muted —— 会污染全站次级文字色与对齐。
   颜色取 --muted-strong(#55637a)：白底 6.4:1，比 --muted 更适合长时段扫读。 */
.part-tb td.muted { color: var(--muted-strong); text-align: center; padding: 10px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; padding: 10px; border: 1px solid #d7dbe2; }
.photo-grid .photo-box { min-height: 160px; }
.r-meta { text-align: right; padding: 8px 14px; color: #999; font-size: 10.5px; border-top: 1px solid #e7eaf0; }
@media print {
  .basic-tb, .kv-list, .part-tb, .photo-grid { page-break-inside: avoid; }
  .part-tb th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.insp-tb { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.insp-tb th, .insp-tb td { border: 1px solid #d7dbe2; padding: 5px 8px; vertical-align: middle; }
.insp-tb th { background: #f4f7fb; font-weight: 600; font-size: 10.5px; white-space: nowrap; }
.insp-tb .ok { color: #15608f; font-weight: 700; }
.insp-tb .ng { color: #dc2626; font-weight: 700; }
.insp-tb .qa-sig { font-size: 10px; color: #555; }
.data-tb { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.data-tb th, .data-tb td { border: 1px solid #d7dbe2; padding: 3px 5px; text-align: center; vertical-align: middle; }
.data-tb th { background: #f4f7fb; font-weight: 600; font-size: 10px; white-space: nowrap; }
.data-tb .pos-col { background: #fafbfd; font-weight: 600; text-align: left; min-width: 40px; }
.data-tb .neg { color: #dc2626; }
.sh-footer { display: grid; grid-template-columns: 1fr 1fr; }
.sh-footer .sh-kv { border-bottom: none; border-right: 1px solid #d7dbe2; min-height: 44px; }
.sh-footer .sh-kv:last-child { border-right: none; }
.sign-box { height: 48px; display: flex; align-items: center; justify-content: center; }
.sign-box img { max-height: 42px; }
.rpt-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.rpt-toolbar .btn { font-size: 13px; }
@media print {
  /* 每页页脚：@page 的 margin box（Chrome 131+ 支持 counter(page)/counter(pages)）。
     🔴 为什么必须用 margin box 而不是表格外的 .n-footer：
       ① .n-footer 在文档流末尾，浏览器只把它印在**最后一页**；
       ② 普通元素里的 counter(page)/counter(pages) 在 Chrome 恒为 0（本机实测 t1.pdf：
          输出「第 0 页 / 共 0 页」），旧规则实际是坏的。
       margin box 是唯一能做到「每页居中 + 当前页/总页数都正确」的纯 CSS 方案。 */
  /* 🔴 垂直边距 7mm → 11mm/10mm（2026-09-11，王毅「分页的页眉和页脚文字被拆分了」）：
     Safari 打印时**页眉页脚不是我们画的**，是 WebKit 自己绘制的（页眉=文档标题+日期，
     页脚=URL+「第N/M页」）。它把这两条画在**内容框外**、离内容框固定约 24.7pt / 22.3pt 处
     （实测反推：header_top = topMargin − 24.72；footer_bottom = contentBottom + 22.32）。
     7mm(19.84pt) 边距 < 24.72pt ⇒ 页眉顶落到 y = −4.88（跨在纸张上边缘 → 上半截被切），
     页脚底落到 y = 844.37（跨在纸张下边缘 → 下半截被切）。生产导出 PDF 实测值
     −4.88 / 836.12..844.37 与该模型**完全吻合**。
     ⇒ 把边距抬到 11mm/10mm（31.18 / 28.35pt）后两条都完整落在纸张内：6.46 / 835.86。
     ⚠️ 改这两个数前先算：top ≥ 24.72pt(8.72mm)，bottom ≥ 22.32pt(7.87mm)；
       同时每页可用高会变小 → 必须同步收紧图片 max-height（见下方纸张预算）。 */
  @page {
    size: A4 portrait;
    margin: 11mm 7mm 10mm;
    @bottom-center {
      content: "第 " counter(page) " 页 / 共 " counter(pages) " 页";
      font-size: 9px;
      color: #666;
    }
  }
  body { background: #fff; }
  .sidebar, .no-print, .mobile-bar, .bottom-nav, .nav-overlay, .rpt-toolbar, .detail-frozen { display: none !important; }
  .main-content { width: 100%; padding: 0; }
  .sheet { border: none; max-width: 100%; font-size: 10.5px; box-shadow: none; }
  .sh-hdr img { height: 32px; }
  .photo-box.large { min-height: 140px; }
  .comp-tb th, .comp-tb td, .insp-tb th, .insp-tb td { padding: 2px 4px; font-size: 10px; }
  .comp-tb td.lab { width: 170px; }
  .sh-kv { page-break-inside: avoid; }
  .report { border: none; margin: 0; padding: 0; box-shadow: none; max-width: 100%; }
}

/* ===== 样品制作通知单（8 列网格，1:1 复刻 Excel 版式） ===== */
/* 报表图片缩放系数（唯一真相源）：屏幕与打印所有 .n-img 尺寸均由它派生。
   改这一个数即可整体调整参考图片/图稿大小（1.5 = 放大 150%，2026-09-11 王毅）。 */
:root { --rpt-img-scale: 1.5; }
.notice-sheet { max-width: 980px; }
/* 颜色匹配提醒（客户资料 vs 零件中文颜色） */
.color-warn-box { max-width: 980px; margin: 0 auto 12px; padding: 10px 14px; border: 1px solid #f0c36d;
  background: #fff8e6; color: #7a5b00; font-size: 13px; line-height: 1.7; border-radius: 6px; }
.color-warn-box .cw-item { display: inline-block; margin: 2px 8px 2px 0; padding: 1px 8px;
  background: #fdeecb; border-radius: 4px; font-weight: 600; }
/* Pantone 色表 */
.pt-swatch { width: 30px; height: 18px; border-radius: 3px; display: inline-block;
  border: 1px solid rgba(15,23,42,.15); vertical-align: middle; box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
#pt-table td { vertical-align: middle; }

.notice-grid { width: 100%; table-layout: fixed; border-collapse: collapse; background: #fff; }
/* PDF 模板列宽比例：A/B/C 窄，D-H（颜色/值区）宽 */
.notice-grid col.cA { width: 11%; }
.notice-grid col.cB { width: 12%; }
.notice-grid col.cC { width: 13%; }
.notice-grid col.cD { width: 13%; }
.notice-grid col.cE { width: 13%; }
.notice-grid col.cF { width: 13%; }
.notice-grid col.cG { width: 12.5%; }
.notice-grid col.cH { width: 12.5%; }
.notice-grid td { border: 1px solid #b9c0cc; padding: 3px 6px; font-size: 11px; vertical-align: middle; word-break: break-word; line-height: 1.4; }

/* 表格外公司抬头 */
.n-header { display: flex; align-items: center; gap: 12px; padding: 6px 0 10px; border-bottom: 2px solid #1a2540; margin-bottom: 8px; }
.n-header .n-logo { height: 56px; width: auto; display: block; flex-shrink: 0; }
.n-header-text { flex: 1; text-align: center; }
.n-header-text .n-corp { font-size: 17px; font-weight: 700; color: #1a2540; margin-bottom: 4px; }
.n-header-text .n-title { font-size: 15px; font-weight: 700; color: #1a2540; }
/* 公司抬头行（thead 内）：屏幕上无边框；打印超过 1 页时随 thead 每页锁定重复（2026-08-27 规范） */
.notice-grid thead td.r-hdr { border: none; background: #fff; padding: 0 0 8px 0; }
/* 单号条（thead 内第二行，2026-09-11 王毅）：总样品单号 / 样品单号 / 合同号 PO No.
   放 thead 内 → 浏览器分页时随表头**每页重复**（与公司抬头同一机制，已用 Chrome 打印实测确认）。
   屏幕上同样显示，保证所见即所印。 */
.notice-grid thead td.r-meta {
  border: none; background: #fff; padding: 0 0 6px 0;
  font-size: 10.5px; color: #33414f; text-align: left;
}
.notice-grid thead td.r-meta .n-meta-item { display: inline-block; margin-right: 22px; white-space: nowrap; }
.notice-grid thead td.r-meta b { font-weight: 600; color: #55637a; margin-right: 4px; }

.notice-grid .n-lbl { background: #f4f7fb; font-size: 10.5px; color: #33414f; font-weight: 600; text-align: center; }
/* 2026-08-28 修订：报表内「显示/抓取/填写」的信息——文字向左对齐，数字居中对齐；表头/标签一律居中 */
.notice-grid .n-val { text-align: left; color: #222; }
.notice-grid .n-th { background: #d9e1f2; font-weight: 600; font-size: 10.5px; text-align: center; color: #33414f; }
/* ===== 图片小节标题（参考图片/图稿/签样图片/样品照片，2026-09-11 第四次改版）=====
   🔴 为什么从「独立表格行」并进「图片单元格内的块级标题」：
     旧结构是小节标题 `<tr class="r-sec">` + 图片 `<tr class="r-img">` 两个独立表格行，
     靠 `tr.r-sec { break-after: avoid }` 保证不分离。但该属性在 Safari 不生效
     （WebKit 对表格行系元素的 break-* 支持不完整），生产导出 PDF 实测就是
     「第 1 页末尾只有『参考图片』标题、图片整张跑到第 2 页」。
   🔴 现在的保证机制：标题与**首张图片**同处 `.n-fig` 这一个**普通块级盒**，
      打印态 `break-inside: avoid` —— 普通块的分页回避各引擎都支持，
      且两个子元素物理上同盒 ⇒ 标题与首图不可能被分到两页。
   屏幕态：`.n-fig { display: contents }` 使标题/图片仍是 `.notice-imgs` 的直接 flex 项，
      标题用 `flex: 0 0 100%` 独占一整行 ⇒ 观感与旧版 `.n-th` 整行色条一致，预览无变化。 */
.n-fig { display: contents; }
.notice-grid .n-sec {
  flex: 0 0 100%; background: #d9e1f2; font-weight: 600; font-size: 10.5px;
  text-align: center; color: #33414f; padding: 4px 8px; margin: 0 0 6px;
}
.notice-grid .r-tall td { height: 45px; }
/* 图片行高度：跟随 --rpt-img-scale 同比放大，保证图片不被行高裁切 */
.notice-grid .r-img td { height: calc(169px * var(--rpt-img-scale)); }
.notice-grid .n-part-name,
.notice-grid .n-part-draw,
.notice-grid .n-part-mat,
.notice-grid .n-part-color { text-align: left; }
/* 数值单元格（由后端 is_num_value 判定：整数/小数/千分位/百分比/带单位/区间/ISO日期）居中 */
.notice-grid .n-val.n-num,
.notice-grid .n-part-name.n-num,
.notice-grid .n-part-draw.n-num,
.notice-grid .n-part-mat.n-num,
.notice-grid .n-part-color.n-num { text-align: center; }
/* 图片/附件展示区保持左对齐，避免整块图片被推到右侧。
   n-media（生产任务单/封样单）与 n-img-cell（通知单/检验报告）是同一种「整行图片容器」的两个历史类名，
   统一条规则，避免只改一处导致另一处对齐口径漂移。 */
.notice-grid td.n-media,
.notice-grid td.n-img-cell { text-align: left; }
/* 签名页脚行（2026-09-11）：签名区由「表格外 div」移入表格最后一行。
   原在表外时，图片缩小后它会单独落到一页，而该页没有 thead 可重复 → 无报表标题、无单号条，
   还白占一页纸。移入表内后落到任何页都带重复表头。
   单元格去掉格线与内边距，让 .sign-footer 自带的顶部横线保持原有观感（屏幕/打印一致）。 */
.notice-grid tr.r-sign td { border: none; background: #fff; padding: 0; }
/* ===== 报表图片区（参考图片 / 图稿，四张报表共用）=====
   🔴 缩放单一真相源：--rpt-img-scale（:root 定义）。改一处，屏幕与打印同比生效。
   2026-09-11 王毅：图片等比例扩大 150%，且布局整齐对齐。
   · 宽高改为**固定值**（原先 width 在 120–220px 之间随图片宽高比浮动 → 每行宽窄不一、列对不齐）；
     固定后 flex 换行天然等宽等高，配合 object-fit:contain 不变形 → 行列对齐。
   · align-items 由 center 改 flex-start：多行时每行顶部对齐，避免参差错落。 */
.notice-imgs {
  display: flex; flex-wrap: wrap; align-items: flex-start;
  gap: calc(8px * var(--rpt-img-scale)); padding: 6px;
}
.n-img {
  position: relative; flex: 0 0 auto;
  width: calc(220px * var(--rpt-img-scale));
  height: calc(150px * var(--rpt-img-scale));
  border: 1px solid #d7dbe2; border-radius: 4px; overflow: hidden; background: #fafbfd;
}
.n-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.n-img-idx { position: absolute; top: 2px; left: 2px; background: rgba(15,23,42,.6); color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 3px; }
.n-file { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid #d7dbe2; border-radius: 4px; background: #fff8ef; text-decoration: none; color: #222; font-size: 11px; }
.n-file.pdf { background: #fff5eb; border-color: #f0d49a; }
.n-file-tag { font-size: 10px; font-weight: 700; letter-spacing: .5px; background: var(--gray); color: #fff; padding: 2px 6px; border-radius: 3px; }
.n-file-name { max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* ⚠️ 原 #9aa3b2 白底仅 2.54:1（连大字 3:1 都不到，几乎不可读）。改用 --muted-strong(#55637a, 6.08:1)，
   与 .part-tb td.muted 的空态提示取色保持同一口径。仅改颜色、不动布局与字号，打印输出无影响。 */
.notice-empty { color: var(--muted-strong); font-size: 12px; padding: 0 6px; }
.notice-advance { display: flex; align-items: center; gap: 12px; margin-top: 16px; max-width: 980px; margin-left: auto; margin-right: auto; flex-wrap: wrap; }

/* 打印页脚（表格外的那一条）：已废弃显示 —— 页脚改由 @page 的 @bottom-center margin box
   统一负责（见文件前部 @media print 内的 @page 声明），每页都会出现且页码正确。
   此处保留 DOM 与选择器仅为不改动四个报表模板的结构；display 恒为 none。 */
.n-footer { display: none !important; }
.n-footer.no-screen { display: none !important; }
@media print {
  .notice-grid thead { display: table-header-group; }
  .notice-grid thead td.r-hdr { border: none; padding: 0 0 4px 0; }
  .notice-grid thead td.r-meta { font-size: 9px; padding: 0 0 4px 0; }
  .notice-grid td { font-size: 9px; padding: 2px 4px; }
  .notice-grid .r-tall td { height: 28px; }
  /* ===== 打印态图片区：一行一张、尽可能大（2026-09-11 王毅） =====
     屏幕态保持「定宽相框 + 每行多张」（便于预览对照，不在此覆盖）；
     打印态改为「相框贴合图片」：
       · .notice-imgs 由 flex 换行改 block  → 一行一张；
       · .n-img 用 width:max-content + max-width:100% → 相框宽度 = 图片按整行宽等比放大后的
         宽度（不留白、不变形）；height:auto 让相框跟着图片走；
       · img 用 max-width:100% + max-height 双约束 → 取「整行宽」与「一页可用高」中的较小者；
       · margin:0 auto 居中 → 一列图共居中线，视觉整齐；
       · break-inside:avoid → 单张图不会被分页切断。
     🔴 max-height 是「每张图占多高」的唯一旋钮，也直接决定**每页几张**（2026-09-11 王毅定 3 张）：
       纸张预算（2026-09-11 改用 @page margin 11mm 7mm 10mm 后重算）——
         A4 高 841.89pt − 上边距 31.18 − 下边距 28.35 = 内容高 776.69pt；
       再减每页重复的表头(公司抬头+单号条)约 50pt、小节标题块约 21pt+间距，
       第 2 页起图片起点 ≈ 内容顶 + 85pt ≈ 116pt。
       每页 N 张 ⇒ 需要 3H + 2×gap(15.75pt) + 末张 margin(5mm=14.17pt) + 签名行(约 30pt)
         ≤ 776.69 − 85 = 691.7pt（H = 单张高）。N=3 ⇒ H ≤ 205pt(72.5mm)；
         **现取 70mm**：3×198.4 + 31.5 + 14.17 + 30 = 671pt ≤ 691.7pt ✓ 留 20pt 余量，
         既能保「每页 3 张」，也能让签名行继续落在同页而不被挤到第 4 页。
       改这个数前先按上面公式算「每页几张 + 签名是否还挤得下」，别只凭感觉。
       （实测基线：@page 7mm/76mm 时 3 页、3 张/页、末图停在 y=773.25。） */
  .notice-imgs { display: block; padding: 0; }
  .n-img {
    width: max-content; max-width: 100%; height: auto;
    margin: 0 auto 5mm;
    break-inside: avoid; page-break-inside: avoid;
  }
  .n-img img { width: auto; height: auto; max-width: 100%; max-height: 70mm; }
  .notice-grid .r-img td { height: auto; }
  .notice-grid .r-img { break-inside: avoid; page-break-inside: avoid; }
  /* 🔴 小节标题与「首张图片」同处 .n-fig 原子块 → 分页时不可能分离（2026-09-11 第四次改版）。
     打印态必须把 .n-fig 从 display:contents 变回 block，否则没有盒子可施加 break-inside。 */
  .n-fig { display: block; break-inside: avoid; page-break-inside: avoid; }
  .notice-grid .n-sec { break-after: avoid; page-break-after: avoid; }
  .notice-advance { display: none !important; }
  .n-header { border-bottom-width: 1.5px; padding: 4px 0 6px; margin-bottom: 4px; }
  .n-header .n-logo { height: 40px; }
  .n-header-text .n-corp { font-size: 14px; }
  .n-header-text .n-title { font-size: 12px; }
  /* 页脚不再在此渲染：改由 @page 的 @bottom-center margin box 每页输出（见文件前部）。
     原 `.n-footer { display:flex }` 与 `.n-footer-page::after { counter(page) }` 已删除 ——
     前者只印最后一页，后者在 Chrome 里恒为「第 0 页」。 */
}

/* 单据页脚：生成日期 + 制作人，靠右对齐（屏幕与打印均显示） */
.n-meta { margin-top: 10px; text-align: right; font-size: 11px; color: #555; line-height: 1.7; }
.n-meta > div { display: inline-block; text-align: right; }

/* ===== 驳回弹窗模态框 ===== */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 999;
  background: rgba(15,23,42,.45); backdrop-filter: blur(3px);
  align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: var(--surface); border-radius: 8px;
  box-shadow: 0 20px 60px rgba(15,23,42,.25);
  width: 460px; max-width: 92vw; overflow: hidden;
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity:0; transform:translateY(-12px) scale(.97); } to { opacity:1; transform:none; } }
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; background: var(--err); color: #fff;
}
.modal-header h3 { margin: 0; font-size: 15px; font-weight: 700; }
.modal-close {
  background: none; border: none; color: #fff; font-size: 22px; cursor: pointer;
  line-height: 1; padding: 0 4px; opacity: .8;
}
.modal-close:hover { opacity: 1; }
.modal-body { padding: 16px 18px; }
.modal-body .fld { margin-bottom: 12px; }
.modal-body .fld > span { font-size: 13px; font-weight: 700; }
.modal-body select, .modal-body input[type="text"] {
  width: 100%; margin-top: 4px; font-size: 14px; padding: 9px 11px;
}
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 18px; border-top: 1px solid var(--border-soft);
  background: var(--panel);
}
/* 打印时隐藏弹窗 */
@media print { .modal-overlay { display: none !important; } }

/* ===== 样品制作通知单预览弹窗 ===== */
.modal-header.modal-primary {
  /* ⚠️ 起始色曾用硬编码 #1a6bb8（钢蓝），改主色后会在橘色渐变上留下蓝头；统一走令牌 */
  background: linear-gradient(180deg, var(--btn-primary-1) 0%, var(--btn-primary-2) 60%, var(--btn-primary-3) 100%);
}
.modal-box.modal-wide { width: 1080px; max-width: 96vw; }
.notice-modal-body {
  padding: 0; background: #eef1f5; height: 72vh; max-height: 860px;
}
.notice-modal-body iframe {
  width: 100%; height: 100%; border: 0; display: block; background: #fff;
}
.notice-modal-body .sheet,
.notice-modal-body .notice-sheet,
.notice-modal-body .inspection-sheet { max-width: none; }

/* ===== A9 样品检验报告填写弹窗 ===== */
.insp-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px 16px; margin-bottom:14px; }
.insp-grid .fld > span { font-size:12px; }
.insp-grid .fld input { background:#f7f8fa; }
.insp-tbl { width:100%; border-collapse:collapse; font-size:13px; margin-bottom:10px; }
/* 2026-08-28 修订：表头居中；填写/带入的信息文字向左、数字居中（.n-num 由 JS 按内容实时判定） */
.insp-tbl th, .insp-tbl td { border:1px solid #e7eaf0; padding:6px 8px; text-align:left; vertical-align:middle; }
.insp-tbl th { background:#f5f7fa; font-weight:600; white-space:nowrap; text-align:center; }
.insp-tbl input, .insp-tbl select, .insp-tbl textarea { width:100%; padding:5px 7px; font-size:13px; box-sizing:border-box; text-align:left; margin:0; }
.insp-tbl textarea { field-sizing:content; min-height:28px; resize:vertical; }
/* 2026-09-01 王毅 19:30「上下行距可以再紧凑些」：包材表与其他要求表纵向信息密度更高，
   cell 与 textarea 内边距收紧，避免「1 行长规格占 2-3 倍行高」的视觉留白。 */
.insp-tbl#pkgTbl th, .insp-tbl#pkgTbl td,
.insp-tbl#otherReqTbl th, .insp-tbl#otherReqTbl td { padding:4px 8px; line-height:1.45; }
.insp-tbl#pkgTbl input, .insp-tbl#pkgTbl select, .insp-tbl#pkgTbl textarea,
.insp-tbl#otherReqTbl input, .insp-tbl#otherReqTbl select, .insp-tbl#otherReqTbl textarea { padding:3px 6px; }
.insp-tbl#pkgTbl textarea, .insp-tbl#otherReqTbl textarea { min-height:22px; line-height:1.45; }
.insp-tbl td.n-num, .insp-tbl input.n-num { text-align:center; }
/* 自动带入（抓取）的只读字段同样遵循「文字向左、数字居中」 */
.insp-grid .fld input, #sealAppModal .fld input, #inspectionModal .fld input { text-align:left; }
.insp-grid .fld input.n-num, #sealAppModal .fld input.n-num, #inspectionModal .fld input.n-num { text-align:center; }
/* 首列（零件名称/角色等）保持左对齐，便于阅读行标题 */
.insp-tbl td:first-child { text-align:left; }
.insp-tbl .cd-delta, .insp-tbl .ft-color, .insp-tbl input[readonly] { background:#f7f7f9; color:#555; }
/* 色差/膜厚记录：零件名称、颜色列按内容自适应，避免被截断遮挡 */
#colorDiffTbl, #filmTbl { table-layout: auto; }
#colorDiffTbl th:nth-child(1), #colorDiffTbl td:nth-child(1),
#filmTbl th:nth-child(1), #filmTbl td:nth-child(1) { white-space: nowrap; min-width: 120px; }
/* 2026-09-01 16:44 王毅：颜色列加宽至 200px（容纳 PVD/喷漆等长文本）；同时去掉 Δ / 下 列的多余单元格 */
#colorDiffTbl th:nth-child(2), #colorDiffTbl td:nth-child(2),
#filmTbl th:nth-child(2), #filmTbl td:nth-child(2) { white-space: nowrap; min-width: 200px; }
/* 色差 Δ cell / 膜厚「下」cell：把删除按钮并入内部 flex 布局，避免末尾出现多余单元格 */
#colorDiffTbl td.cd-delta-cell,
#filmTbl td.ft-bottom-cell { display: flex; align-items: center; gap: 4px; padding: 4px; }
#colorDiffTbl td.cd-delta-cell input.cd-delta { flex: 1; min-width: 0; }
#filmTbl td.ft-bottom-cell input.ft-bottom { flex: 1; min-width: 0; }
.cd-del, .ft-del { padding: 2px 8px; font-size: 12px; line-height: 1.4; flex-shrink: 0; }
#colorDiffTbl td:nth-child(1) select, #colorDiffTbl td:nth-child(2) input,
#filmTbl td:nth-child(1) select, #filmTbl td:nth-child(2) input { width: auto; min-width: 100%; }
.photo-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(120px,1fr)); gap:8px; margin:8px 0; }
.photo-grid .ph-item { border:1px solid #e7eaf0; border-radius:8px; padding:6px; text-align:center; background:#fff; }
.photo-grid .ph-item img { max-width:100%; max-height:120px; border-radius:6px; }
.photo-grid .ph-del { font-size: var(--fs-xs); color:#666; display:block; margin-top:4px; }
.insp-btn-row { display:flex; align-items:center; gap:12px; padding:8px 0; }
.insp-btn-row .btn { white-space:nowrap; }
.insp-btn-row .muted { font-size:12px; }
@media (max-width:760px){ .insp-grid{ grid-template-columns:repeat(2,1fr); } }

/* ===== 样品检验报告（与样品制作通知单统一版式：8 列网格 + 公司抬头） ===== */
.inspection-sheet { max-width: 980px; }
/* 斜向备注说明（PDF/在线表格中的灰色斜体备注） */
.inspection-grid .i-note { font-style: italic; color: #8a93a3; font-size: 9px; font-weight: 400; margin-top: 2px; line-height: 1.35; }
/* 2026-08-28 修订：文字向左、数字居中；.i-center 判定类单元格（PASS/FAIL、检查点）保持居中 */
.inspection-grid .i-desc { text-align: left; }
.inspection-grid .i-desc.n-num { text-align: center; }
.inspection-grid .i-en { font-weight: 600; color: #222; }
.inspection-grid .i-zh { color: #33414f; }
.inspection-grid .i-center { text-align: center; }
/* 检验结果 / 检查点打勾配色：PASS/OK=绿色 FAIL/NG=红色 OTHER/无=蓝色 */
.inspection-grid .pass, .inspection-grid .ok { color: #15608f; font-weight: 700; }
.inspection-grid .fail, .inspection-grid .ng { color: #dc2626; font-weight: 700; }
.inspection-grid .other, .inspection-grid .none { color: #2563eb; font-weight: 700; }
.inspection-grid .r-img td { height: auto; }
@media print {
  .inspection-grid .i-note { font-size: 7.5px; }
  .inspection-grid .r-img td { height: auto; }
}
/* ===== 详情页底部操作条 ===== */
.detail-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 16px; padding: 14px 16px; flex-wrap: wrap;
  background:var(--panel); border:1px solid var(--line); border-radius: var(--radius);
}
.detail-footer .df-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-footer form { display: inline-flex; }

/* ===== 配件清单：杯/盖零件动态行编辑器（A1 表单 + 详情页） ===== */
.parts-editor { width: 100%; }
.parts-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 8px; }
.parts-table th, .parts-table td {
  border:1px solid var(--border-soft); padding: 6px 8px; text-align: left; vertical-align: middle;
}
.parts-table thead th {
  background:var(--panel); color: var(--ink); font-weight: 700; font-size: 12px;
  border-bottom:1px solid var(--line); white-space: nowrap;
}
.parts-table input[type="text"] { width: 100%; padding: 6px 8px; font-size: 13px; }
.parts-table .parts-op { width: 36px; text-align: center; }
.parts-add {
  display: inline-flex; align-items: center; gap: 4px;
  background:var(--gray-bg); color: var(--muted-strong); border:1px dashed var(--gray-line);
  border-radius: var(--radius-sm); padding: 5px 12px; font-size: 12px; cursor: pointer;
}
.parts-add:hover { background:var(--gray-line); color: var(--gray); }
/* min 28×28：WCAG 2.5.8 要求指针目标 ≥24×24，原 23×22 不达标（触屏视口另有 44×36 覆盖） */
.parts-del {
  background:transparent; border:none; color: var(--muted); font-size: 18px;
  line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; min-height: 28px;
}
.parts-del:hover { background:var(--err-bg); color: var(--err); }

/* ===== 配件清单扁平表格（ERP 物料编码风格） ===== */
.parts-table .td-model { font-weight: 700; color: var(--ink); white-space: nowrap; }
tr.model-break td { border-top:2px solid var(--border); }
.kind-badge {
  display: inline-block; min-width: 22px; text-align: center;
  padding: 1px 7px; border-radius: var(--r-lg); font-size: 12px; line-height: 1.5;
}
.kind-cup { background:var(--gray-bg); color: var(--muted-strong); border:1px solid var(--gray-line); }
.kind-lid { background:var(--st-prog-bg); color: var(--st-prog-ink); border:1px solid var(--st-prog-line); }
.pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding-top: 12px; margin-top: 4px;
  border-top:1px solid var(--border-soft); flex-wrap: wrap;
}
.pager-btns { display: inline-flex; gap: 8px; }

/* ===== 配件清单页（数据与报表 → 配件清单） ===== */
.part-group {
  border:1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 14px; overflow: hidden; background:var(--surface);
}
.part-group-head {
  display: flex; flex-wrap: wrap; gap: 0; background:var(--panel);
  border-bottom:1px solid var(--border-soft);
}
.pg-cell {
  padding: 10px 14px; display: flex; flex-direction: column; gap: 2px;
  border-right:1px solid var(--border-soft); min-width: 140px;
}
.pg-cell:last-child { border-right:none; flex: 1; }
.pg-model { background:var(--surface-2); }
.pg-model b { color: var(--ink); }
.pg-k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.pg-cell b { font-size: 14px; color: var(--ink); }
.part-group-body { display: flex; gap: 0; flex-wrap: wrap; }
.part-col { flex: 1; min-width: 300px; padding: 12px 14px; }
.part-col + .part-col { border-left:1px solid var(--border-soft); }
.part-col-title {
  font-size: 12px; font-weight: 700; color: var(--ink); margin-bottom: 8px;
  padding-left: 8px; border-left:3px solid var(--gray);
}

/* 空状态 */
.empty { text-align: center; padding: 40px 20px; }
.empty-icon { font-size: 34px; color: var(--line); margin-bottom: 8px; }

/* ===== 多图片字段 ===== */
.images-editor { display: flex; flex-direction: column; gap: 10px; }
.images-existing, .images-readonly, .images-preview {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.img-thumb {
  position: relative; width: 96px; height: 96px;
  border:1px solid var(--border-soft); border-radius: var(--radius-sm);
  background:var(--panel); overflow: hidden;
}
.img-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.img-thumb.preview { border-style: dashed; border-color:var(--line); }
.pdf-preview-ph {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  font-size: 15px; font-weight: 700; color: var(--muted);
  background:var(--tint-warning-ph);
}
/* 28×28：WCAG 2.5.8 要求 ≥24×24，原 22×22 不达标（触屏视口另有 44×44 覆盖） */
/* 文件上传控件：默认只有 21px 高，低于 WCAG 2.5.8 的 24×24 下限 */
input[type="file"] { min-height: 28px; padding: 5px 0; font-size: var(--fs-sm); }
.img-del {
  position: absolute; top: 2px; right: 2px;
  width: 28px; height: 28px; line-height: 28px; padding: 0;
  background:rgba(192,57,43,.85); color:#fff; border:none;
  border-radius: 50%; font-size: 16px; cursor: pointer;
}
.img-del:hover { background:var(--err); }
.img-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  background:rgba(15,23,42,.65); color:#fff; font-size: var(--fs-2xs);
  padding: 2px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.images-upload input[type="file"] { display: none; }
.images-upload .btn { cursor: pointer; }
.images-upload .btn:hover { background:var(--line); }

/* 窄屏自适应：配件页分组改为纵向堆叠 */
@media (max-width: 640px) {
  .part-group-body { flex-direction: column; }
  .part-col + .part-col { border-left:none; border-top:1px solid var(--border-soft); }
  .pg-cell { min-width: 100%; border-right:none; border-bottom:1px solid var(--border-soft); }
  .pg-cell:last-child { border-bottom:none; }
  .parts-table th, .parts-table td { padding: 5px 6px; }
  .parts-table input[type="text"] { padding: 5px 6px; }
  .img-thumb { width: 76px; height: 76px; }
}

/* ===== 客户 PDF 数据导入（新建样品单顶部） ===== */
.import-card { border-color:var(--line); background:linear-gradient(180deg, var(--tint-import), #fff); }
.import-card h2 { display: flex; align-items: baseline; gap: 10px; }
.import-card h2 .import-sub { font-size: 12px; font-weight: 400; color: var(--muted); }
.import-bar { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.import-item { display: flex; flex-direction: column; gap: 4px; }
.import-item > span { font-size: 12px; color: var(--muted); font-weight: 600; line-height: 18px; }
.import-item select, .import-item input[type="file"] {
  padding: 8px 10px; border:1px solid var(--border); border-radius: var(--radius-sm);
  background:#fff; color: var(--text); font-size: 13px; min-width: 150px;
  height: 36px; box-sizing: border-box;
}
.import-item input[type="file"] { min-width: 210px; }
.import-action .btn { height: 36px; padding: 0 18px; width: 100%; box-sizing: border-box; }
.import-hint { font-size: 12px; line-height: 1.5; max-width: 340px; }
.import-result { margin-top: 14px; border-top:1px dashed var(--border-soft); padding-top: 12px; }
.import-summary { font-size: 13px; color: var(--text); margin-bottom: 8px; }
.import-summary .import-done { color: var(--st-prog-ink); font-weight: 600; margin-left: 8px; }
.import-table { font-size: 13px; }
.import-table td b { color: var(--ink); }
.import-note { font-size: 11px; color: var(--gold-ink); margin-top: 2px; }
.import-actions { margin-top: 12px; display: flex; gap: 10px; }
@media (max-width: 640px) {
  .import-bar { flex-direction: column; align-items: stretch; }
  .import-item select, .import-item input[type="file"] { width: 100%; min-width: 0; }
  .import-hint { max-width: none; }
}

/* ===== B1 子流程：新建封样申请单（业务→样品→品质→研发 顺序完成，可逆） ===== */
.seal-app-card .sec { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seal-app { display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.sa-step {
  flex: 1 1 130px; min-width: 120px;
  border:1px solid var(--line-hairline); border-radius: var(--r-lg); padding: 10px 12px;
  background:var(--surface-2); position: relative;
}
/* 「当前步骤」= 当前态，归主色橘；外圈同色淡辉光（原 rgba(37,99,235,.12) 蓝） */
.sa-step.cur { border-color:var(--accent); background:var(--tint-info-step); box-shadow:0 0 0 2px rgba(196,58,24,.12); }
.sa-step.done { border-color:var(--line-success); background:var(--tint-ok-step); }
.sa-step-role { font-weight: 600; font-size: 14px; color:var(--text-strong); }
.sa-step-status { font-size: 13px; margin-top: 4px; color:var(--text-faint); }
.sa-arrow { align-self: center; color:var(--text-faint); font-size: 18px; font-weight: 700; }
@media (max-width: 640px) {
  .sa-arrow { transform: rotate(90deg); }
}


/* =========================================================================
   设计系统基线 · 收尾规则（2026-08-28 UI 审计）
   ========================================================================= */

/* 无障碍：尊重系统「减少动态效果」偏好（WCAG 2.3.3） */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* 数据网格：粘住的表头需要一条分隔阴影，滚动时才能与内容分离（否则两者糊在一起） */
table.grid thead th {
  box-shadow:inset 0 -2px 0 0 var(--line), 0 2px 4px -2px rgba(15,23,42,.12);
}
/* 表格行：键盘/鼠标焦点落进行内控件时整行高亮，长表格不易看错行 */
table.grid tbody tr:hover td { background:var(--surface-2); }
table.grid tbody tr:focus-within td { background:var(--surface-2); }

/* 卡片：与表格/面板共用同一层级阴影令牌（--elev-1 与原 --shadow 等值，纯令牌化） */
.card { box-shadow:var(--elev-1); }

/* 小字：次级说明用 --muted-strong，在 --panel 浅底上仍满足 AA 4.5:1
   （不动 .muted 本体，避免波及三张受保护报表的既有配色） */
.page-sub, .kpi-label { color: var(--muted-strong); }

/* 滚动条：细窄、与冷灰主题一致（WebKit） */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb {
  background:var(--scroll-thumb); border-radius: var(--r-pill);
  border:2px solid transparent; background-clip:content-box;
}
::-webkit-scrollbar-thumb:hover { background:var(--scroll-thumb-hover); background-clip:content-box; }

/* 表格表头排序链接 */
th .sort-link {
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  margin: -4px -6px;
  border-radius: var(--r-sm);
}
th .sort-link:hover { background: var(--surface-2); color: var(--muted-strong); }
th .sort-link.active { color: var(--ink); font-weight: 600; }
th .sort-arrow { font-size: 10px; line-height: 1; opacity: .8; }

/* ===== 清单表统一规范（2026-08-29）：小字号 / 表头居中 / 数字居中 / 文本左对齐 ===== */
/* 应用对象：工作台「我的待办」「全部样品单」、报表中心、配件清单。与上方 KPI 卡片不同字号。 */
table.grid.list-table {
  font-size: 12px;
  width: 100%;
  border-collapse: collapse;
}
table.grid.list-table th,
table.grid.list-table td {
  padding: 6px 8px;
  vertical-align: middle;
  white-space: nowrap;
}
/* 表头：文字居中 + 加粗 */
table.grid.list-table th {
  text-align: center;
  font-weight: 600;
}
/* 数据默认：文本左对齐（文字 / 英文+数字；纯数字由 .n-num / .num 居中） */
table.grid.list-table td {
  text-align: left;
}
/* 数字列 / 操作列：居中（.num / .center / .n-num 标注；.n-num 由 numcls 过滤器按值自动追加） */
table.grid.list-table td.num,
table.grid.list-table td.center,
table.grid.list-table td.n-num {
  text-align: center;
}
/* 需要左对齐的场景（长链接/备注）仍可用 .left（当前默认已左对齐，.left 仅作显式声明） */
table.grid.list-table td.left {
  text-align: left;
}
/* 报表中心冻结列底色需覆盖 .list-table 的默认右对齐文本（保持不透明，避免透出滚动内容） */
table.grid.list-table.rc-table td:nth-child(1),
table.grid.list-table.rc-table td:nth-child(2),
table.grid.list-table.rc-table td:nth-child(3) { background: var(--panel); }

/* =========================================================================
   移动端 / 平板 深度适配 v2（2026-08-30）
   1) 修复表头 sticky 被移动端顶栏遮挡  2) 操作型宽表小屏转卡片视图
   3) 弹窗小屏可滚动（防按钮点不到）     4) 触摸热区与平板宽度利用
   卡片视图：需模板给 td 标 data-label="列名"，桌面端完全不受影响
   ========================================================================= */
@media (max-width: 640px) {
  /* ---- 1) 表头避开移动端顶栏 ---- */
  /* .table-scroll 无 max-height，sticky 相对视口 → 必须下移一个顶栏高度 */
  table.grid thead th { top: var(--mbar, 48px); }
  /* 有 max-height 的容器内部滚动，表头贴容器顶部即可 */
  .table-scroll-v table.grid thead th,
  .rc-table-scroll table.grid thead th,
  .pt-scroll table.grid thead th { top: 0; }

  /* ---- 2) 卡片视图（工作台两表 / 报表中心） ---- */
  /* 卡片化后取消容器的高度限制与列冻结，改由页面滚动 */
  .cardify-wrap { max-height: none !important; overflow: visible !important; }

  table.grid.cardify { border: none; background: transparent; }
  table.grid.cardify thead { display: none; }
  table.grid.cardify,
  table.grid.cardify tbody,
  table.grid.cardify tr,
  table.grid.cardify td { display: block; width: 100%; }
  table.grid.cardify tr {
    display: flex; flex-direction: column;
    border: 1px solid var(--border-soft); border-radius: var(--radius);
    margin-bottom: 10px; padding: 2px 0; background: var(--surface);
    box-shadow: 0 1px 3px rgba(15,23,42,.05);
  }
  table.grid.cardify tbody tr:nth-child(even) { background: var(--surface); }
  table.grid.cardify tbody tr:hover td { background: transparent; }
  table.grid.cardify td {
    position: static !important;
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    border: none; border-bottom: 1px dashed var(--border-soft);
    padding: 8px 12px; white-space: normal; text-align: right;
    font-size: 13px; line-height: 1.5;
    min-width: 0 !important; width: 100% !important;
    background: transparent !important; box-shadow: none !important;
  }
  table.grid.cardify td:last-child { border-bottom: none; }
  table.grid.cardify td::before {
    content: attr(data-label);
    flex: 0 0 auto; max-width: 42%;
    font-size: 12px; font-weight: 600; color: var(--muted); text-align: left;
  }
  /* 无标签单元格（操作列）隐藏伪元素，按钮纵向铺满 */
  table.grid.cardify td[data-label=""]::before,
  table.grid.cardify td.no-label::before { display: none; }
  table.grid.cardify td.rpt-col,
  table.grid.cardify td.ops-col {
    flex-direction: column; align-items: stretch; gap: 6px; padding-top: 8px;
  }
  table.grid.cardify td.rpt-col::before,
  table.grid.cardify td.ops-col::before {
    max-width: none; margin-bottom: 2px;
  }
  table.grid.cardify td.rpt-col .rpt-btn,
  table.grid.cardify td.ops-col .btn {
    display: block; width: 100%; min-height: 40px; line-height: 40px; padding: 0 12px; text-align: center;
  }
  /* 操作列里的 inline form 需撑满，否则按钮只占半宽 */
  table.grid.cardify td.ops-col form { display: block; width: 100%; margin: 0; }
  table.grid.cardify td.ops-col .parts-del {
    display: block; width: 100%; min-height: 40px; font-size: 20px; line-height: 1;
  }
  /* 可编辑单元格（用户管理/角色邮箱等）：控件占右侧，不挤掉左侧标签 */
  table.grid.cardify td > input,
  table.grid.cardify td > select,
  table.grid.cardify td > textarea { flex: 1 1 auto; min-width: 0; max-width: 62%; }
  table.grid.cardify td > div.flex {
    flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end;
  }
  table.grid.cardify td > div.flex input { flex: 1 1 100%; max-width: none; }
  /* 主标题列：无论 DOM 顺序，始终置顶显示（order 仅对 flex 子项生效） */
  table.grid.cardify td.card-title {
    order: -1;
    font-size: 14px; font-weight: 700; color: var(--ink);
    border-bottom: 1px solid var(--border-soft); background: var(--panel) !important;
  }
  table.grid.cardify td.muted { color: var(--muted); }
  table.grid.cardify td .srf-link { font-size: 13px; }

  /* 修复卡片视图左右溢出（2026-08-31）：超长编号/时间等字段截断省略，
     防止匿名 flex item 被 nowrap 内容撑破卡片宽度。 */
  table.grid.cardify td {
    overflow: hidden;
  }
  table.grid.cardify td > * {
    min-width: 0;
    max-width: 100%;
  }
  table.grid.cardify td > a.srf-link,
  table.grid.cardify td > a.prj-link,
  table.grid.cardify td > .srf-link,
  table.grid.cardify td > .prj-link,
  table.grid.cardify td > span:not(.badge):not(.stage-no),
  table.grid.cardify td > time,
  table.grid.cardify td > em,
  table.grid.cardify td > b {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
  }
  /* 状态列：stage-no + 文本组合，允许整体折行，避免文本节点溢出 */
  table.grid.cardify td.status-cell {
    flex-wrap: wrap;
    gap: 6px 14px;
  }
  table.grid.cardify td.status-cell::before {
    flex: 0 0 100%;
    max-width: none;
    margin-bottom: -4px;
  }
  table.grid.cardify td.status-cell .stage-no {
    flex: 0 0 auto;
  }
  /* 操作/报表列按钮不截断 */
  table.grid.cardify td.ops-col > *,
  table.grid.cardify td.rpt-col > *,
  table.grid.cardify td.ops-col a,
  table.grid.cardify td.rpt-col a {
    white-space: normal;
    overflow: visible;
    max-width: none;
  }

  /* ---- 3) 弹窗小屏：限高 + 内部滚动，保证底部按钮可达 ---- */
  .modal-overlay {
    align-items: flex-start;                 /* 避免 flex 居中导致顶部溢出不可滚 */
    padding: calc(var(--mbar, 48px) + 8px) 10px calc(12px + env(safe-area-inset-bottom));
    overflow-y: auto; -webkit-overflow-scrolling: touch;
  }
  .modal-box {
    width: 100%; max-width: 100%;
    max-height: calc(100vh - var(--mbar, 48px) - 24px - env(safe-area-inset-bottom));
    display: flex; flex-direction: column; margin: 0 auto;
  }
  .modal-box.modal-wide { width: 100%; max-width: 100%; }
  .modal-header { padding: 12px 14px; position: sticky; top: 0; z-index: 2; }
  .modal-body { padding: 14px; overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1 1 auto; }
  .modal-footer {
    position: sticky; bottom: 0; flex-wrap: wrap; gap: 8px; padding: 10px 12px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
  .modal-footer .btn { flex: 1 1 45%; min-height: 44px; }
  .modal-close { font-size: 26px; padding: 0 6px; min-width: 40px; }

  /* ---- 4) 触摸热区：小按钮在手机上不小于 38px ---- */
  .btn.small { min-height: 38px; padding: 8px 13px; font-size: 13.5px; }
  table.grid td.flex .btn,
  table.grid td.ids-cell .btn,
  .parts-table .btn.danger.small { min-height: 38px; }
  .pagination .btn.small, .pager .btn.small { min-height: 38px; padding: 9px 14px; }

  /* 查阅型宽表（配件清单/Pantone）：收紧内边距，横向滚动更省力 */
  table.grid.list-table th, table.grid.list-table td { padding: 7px 8px; }
  .pt-scroll { max-height: calc(100vh - 200px); }
  .pt-swatch { display: inline-block; }
}

/* ---- 平板（641–1024px）：让出更多表格宽度，压缩侧栏与留白 ---- */
@media (max-width: 1024px) and (min-width: 641px) {
  .sidebar { width: 156px; min-width: 156px; }
  .snav a { padding: 9px 10px; font-size: 13.5px; gap: 8px; }
  .brand-text small { display: none; }
  .container { padding: 14px 14px 26px; }
  .container.container-wide { max-width: 100%; }
  .card { padding: 14px; }
  .kpi-row { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
  table.grid.list-table { font-size: 12.5px; }
  table.grid.list-table th, table.grid.list-table td { padding: 6px 7px; }
  .rc-table-scroll { max-height: 66vh; }
  .table-scroll-v { max-height: 66vh; }
  .modal-box.modal-wide { max-width: 94vw; }
  .toolbar { flex-wrap: wrap; }

  /* 样品详情：两栏布局会把主内容压到 ~260px（侧栏 180 + 流程面板 280 + 间距/内边距），
     表格里的输入框只剩 24px 宽。改为上下堆叠，主内容吃满宽度。
     ⚠️ 必须写在这里（.flow-aside / .detail-main 基础规则之后）才生效。 */
  .detail-body { flex-direction: column; height: auto; gap: 12px; }
  .detail-main { overflow-y: visible; padding-right: 0; }
  .flow-aside { width: 100%; min-width: 0; max-width: 100%; max-height: 46vh; overflow: auto; }
  /* 冻结头第一行：按钮组 min-content 达 354px，不换行会被挤出容器右边界近 290px */
  .frozen-bar { flex-wrap: wrap; }
  .frozen-actions { margin-left: 0; width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* 新建生产任务单：PO# / 数量 / 交期 三列栅格（原为内联样式，无法响应；≤1024px 塌成单列） */
.d-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }

/* ============================================================
   字段管理页 · 删除选项圆钮（2026-08-30 走查补漏）
   原为模板内联样式写死 20×20 —— 低于 WCAG 2.5.8 对指针设备的 24×24 下限，
   且是「删除」这类破坏性操作（不可逆），误点/点不中都不可接受。
   桌面 28×28，≤1024px 放大到 44×44。
   配色全部走令牌（--err-bg / --err-line / --text-danger-deep），不引硬编码色：
   实测 --err(#c0392b) 在 --err-line(#f0c5bf) 上仅 3.48:1，故文字统一取更深的
   --text-danger-deep(#8a2c20)，常态 7.0:1 / hover 5.46:1，两态均达 AA。
   焦点环由全局 button:focus-visible 规则统一提供，此处不重复声明。
   ⚠️ 定义必须放在下方 @media (max-width:1024px) 块**之前**：同优先级下后写的规则胜出，
      若放到文件末尾会把媒体查询里的 44×44 反压回 28×28（同 08-29 记录的顺序陷阱）。
   ============================================================ */
.opt-del {
  width: 28px; height: 28px; line-height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: var(--err-bg); color: var(--text-danger-deep);
  border-radius: 999px; font-size: 17px; cursor: pointer; padding: 0;
}
.opt-del:hover { background: var(--err-line); }

/* ============================================================
   触控可达性（手机 + 平板，≤1024px）—— 2026-08-29 使用者视角走查
   依据 WCAG 2.5.5 / 2.5.8：可点区域建议 ≥44×44，密集表格内折中到「宽 ≥44 / 高 ≥32」。
   只放大「命中盒」，不改视觉密度（仍用 padding 撑高，字号不动）。
   ============================================================ */
@media (max-width: 1024px) {
  /* 表格/列表里的编号链接：原 24–25px 高，手指极易点偏 */
  .srf-link, .prj-link {
    display: inline-flex; align-items: center;
    min-height: 32px; padding: 6px 10px;
  }
  /* 小按钮：原 31px 高；min-width 保证「1 / 2 / 3」这类单字符分页按钮也不小于 44px 宽 */
  .btn.small { min-width: 44px; min-height: 38px; padding: 8px 14px; }
  /* 零件行删除 / 添加 */
  .parts-del { min-width: 44px; min-height: 36px; font-size: 20px; padding: 4px 8px; }
  .parts-add { min-height: 38px; padding: 8px 14px; }
  /* 表头排序链接：原 23px 高，且和标题挤在一起 */
  th .sort-link { min-height: 32px; padding: 6px 8px; }
  /* 表单控件：原 30px 高 */
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
  select, textarea { min-height: 38px; }
  /* 表格内嵌的紧凑输入（如零件表内编辑）保持原密度，避免行高失控 */
  table input, table select { min-height: 28px; }
  /* 图片 / 附件的删除按钮：原 22×22，触屏上几乎点不中 */
  .img-del { width: 44px; height: 44px; line-height: 44px; font-size: 20px; }
  /* 项目号胶囊：原 29px 高 */
  .id-pill { min-height: 32px; }
  /* 文件上传控件：原 21px 高 */
  input[type="file"] { min-height: 38px; padding: 7px 0; }
  /* 新建生产单的三列栅格：320px 屏上每列只剩 29px，塌成单列 */
  .d-grid3 { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 16px; }
  /* 登录验证码行：320px 屏上算式 + 输入框 + 刷新按钮会挤到输入框只剩 30px */
  .captcha-inline { flex-wrap: wrap; }
  .captcha-inline .captcha-expr { min-width: 84px; }
  .captcha-inline input[type=text] { flex: 1 1 auto; min-width: 72px; padding: 0 10px; }
  .captcha-inline .captcha-refresh { flex: 0 0 auto; }
  /* 字段管理页「删除选项」圆钮：原为内联样式写死 20×20，触屏上几乎点不中 */
  .opt-del { width: 44px; height: 44px; font-size: 22px; }
}

/* （字段管理页 .opt-del 的基础定义与说明见上方，勿再在此重复定义） */

/* ============================================================
   报表「屏幕可读性」提升（2026-08-30 走查补漏，CSS_VER=90）
   背景：通知单 / 检验报告 / 封样申请单 的表格字号为 11px / 10.5px，
   且**没有被 @media print 覆盖**——屏幕与打印共用同一套尺寸。
   直接改会动到对外打印的正式单据（这正是「专业报表样式」块被列为受保护区的原因）。
   解法：仅在 @media screen 下提到 12px，**@media print 一行不动**，
   打印输出与嘉益表单规范完全一致，屏幕可读性同时达标。
   走查实测：通知单 112 处 / 检验报告 272 处 / 封样申请单 189 处 <12px 文本全部消除。
   ============================================================ */
@media screen {
  /* 通知单 */
  .notice-grid td { font-size: 12px; }
  .notice-grid .n-th, .notice-grid .n-lbl, .notice-grid .n-sec { font-size: 12px; }
  .n-file { font-size: 12px; }
  .r-meta { font-size: 12px; }
  /* 单据页脚（「单据生成日期：… ｜ 制作人：…」，11px）与图片序号角标（10px） */
  .n-meta { font-size: 12px; }
  .n-img-idx { font-size: 12px; }
  /* 检验报告 */
  .insp-tb { font-size: 12px; }
  .insp-tb th { font-size: 12px; }
  .insp-tb .qa-sig { font-size: 12px; }
  /* 封样 / 数据表 */
  .data-tb { font-size: 12px; }
  .data-tb th { font-size: 12px; }
}

/* ===== 表格列宽拖拽手柄（table-fit：工作台/报表中心/配件清单 SAP 列表） =====
   手柄挂在表头单元格右缘；th 本身 position:sticky 即定位上下文。
   仅桌面脚本注入，≤640px 卡片视图不会出现。 */
.col-rs-handle {
  position: absolute; top: 0; right: 0; width: 8px; height: 100%;
  cursor: col-resize; z-index: 6; touch-action: none;
}
.col-rs-handle::after {
  content: ''; position: absolute; top: 25%; bottom: 25%; left: 3px; width: 2px;
  border-radius: 2px; background: transparent; transition: background .15s;
}
th:hover > .col-rs-handle::after { background: rgba(20, 70, 143, .40); }
body.col-resizing, body.col-resizing * {
  cursor: col-resize !important;
  user-select: none !important; -webkit-user-select: none !important;
}

/* ===== 确认类弹窗层级（2026-08-31）：需盖过可能仍打开的表单弹窗（同 999 会被 DOM 靠后者压住） ===== */
.modal-overlay.modal-top { z-index: 1100; }

/* ===== 右上角按钮布局（2026-09-01 数次返工，最终定稿：单行三按钮）=====
   历史：3row（三行 6 按钮）→ 单行三按钮 → 2row（两行 4 按钮含签核历史）→ **单行三按钮**（王毅最终口径）。
   frozen-actions-2row / frozen-actions-3row 的选择器已随布局一并删除——
   若哪天要回滚，用 git 找回而不要手写。 */

/* ===== 「报告」入口弹窗：4 张单据入口（2026-09-01）=====
   2×2 栅格；未生成的项不灰不藏（点了才提示），故样式上不做区分。 */
.rpt-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.rpt-grid .btn {
  width: 100%;
  min-height: 46px;
  font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  text-align: center; line-height: 1.25;
}
@media (max-width: 640px) {
  .rpt-grid { grid-template-columns: 1fr; }
}

/* =========================================================================
   2026-09-01 · 客户维度只读（#205）+ 用户管理页美化（#206）   [CSS_VER 100]
   ========================================================================= */

/* ---- #205 非本客户单据只读 ---- */
.banner.cust-ro {
  background: var(--gold-bg);
  border: 1px solid var(--gold-line);
  color: var(--gold-ink);
  font-weight: 600;
}
.badge.ro-flag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 7px;
  border-radius: var(--r-pill);
  background: var(--gray-bg);
  border: 1px solid var(--gray-line);
  color: var(--gray);
  vertical-align: 1px;
  letter-spacing: 1px;
}

/* ---- #206 用户管理页 ---- */
.card-head-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.users-table td { vertical-align: middle; }
.users-table .col-uid { width: 48px; text-align: center; }
.users-table input[type="text"],
.users-table input[type="password"],
.users-table select {
  height: 32px;
  padding: 5px 9px;
  font-size: var(--fs-sm);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.users-table input[type="text"]:focus,
.users-table input[type="password"]:focus,
.users-table select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}
.users-table td:nth-child(2) { min-width: 120px; }  /* 账号 */
.users-table td:nth-child(3) { min-width: 96px; }   /* 姓名 */
.users-table td:nth-child(5) { min-width: 96px; }   /* 负责客户 */
.users-table td:nth-child(6) { min-width: 160px; }  /* 邮箱 */
.users-table .user-ops {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.users-table .user-ops input[type="password"] { width: 104px; flex: 0 0 auto; }
.users-table .user-ops .btn { flex: 0 0 auto; }
.users-table tbody tr { transition: background .12s ease; }
.users-table tbody tr:hover td { background: var(--surface-2); }
.users-table tr.row-admin td { background: var(--panel); }
.users-table tr.row-admin td:first-child { border-left: 3px solid var(--gray); }

/* 负责客户多选（2026-09-03 方案B：user_customers 关联表） */
.cust-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  align-items: center;
  min-height: 32px;
  padding: 5px 2px;
}
.cust-checks .ck {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.cust-checks .ck input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
  flex: 0 0 auto;
}
.cust-checks .ck span { line-height: 1; }

/* 新建用户子卡片 */
.subcard {
  margin-top: 18px;
  padding: 14px 16px 16px;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.subcard h3 { margin: 0 0 10px; font-size: var(--fs-md); }
.subcard .new-user-form { align-items: flex-end; }
.subcard .new-user-form .fld { margin: 0; }
.subcard .new-user-form input[type="text"],
.subcard .new-user-form select {
  height: 32px;
  padding: 5px 9px;
  font-size: var(--fs-sm);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.subcard .new-user-form input[type="text"]:focus,
.subcard .new-user-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}
@media (max-width: 900px) {
  .users-table .user-ops { flex-wrap: wrap; white-space: normal; }
}

/* ===== [CSS_VER 101] 右上角工具条恢复「签核历史」：单行 4 按钮网格 =====
   仅样品详情页（sample_detail.html）使用 frozen-actions-4btn 修饰类；
   project.html 等其余页面的 3 列 frozen-actions 不受影响。
   双类选择器(0,2,0)压过旧媒体查询单类规则，断点由此处统一接管。 */
.frozen-actions.frozen-actions-4btn { grid-template-columns: repeat(4, minmax(92px, 1fr)); }
@media (max-width: 640px) {
  .frozen-actions.frozen-actions-4btn { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .frozen-actions.frozen-actions-4btn .btn { white-space: normal; }
}

/* ===== [CSS_VER 102] 四张报表签名页脚（制单人/审核人/打印人；跨部门两行）===== */
.sign-footer {
  margin-top: 10px; font-size: 11px; color: #555; line-height: 1.8;
  border-top: 1px solid var(--border-soft); padding-top: 6px;
}
.sign-footer .sf-row { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.sign-footer .sf-row-3 { justify-content: space-between; }
.sign-footer .sf-row-2 { justify-content: space-between; }
.sign-footer .sf-depts { justify-content: flex-start; margin-bottom: 2px; }
.sign-footer .sf-label { color: #888; }
.sign-footer .sf-sep { color: #bbb; }
@media print {
  .sign-footer { color: #444; }
}

/* =========================================================================
   响应式断点（2026-09-01 从文件头部整体搬迁至此 —— 层叠顺序修复）

   原位置在 style.css 第 281~439 行（所有组件主规则之前）。CSS 层叠中
   媒体查询不提升特异性，仅按源码顺序决胜：同选择器同属性时「后出现者胜」。
   （注：此处刻意不直书 @media 关键字，避免静态解析工具把注释误判为规则块。）
   因此这三个块里凡是与其后主规则冲突的属性，全部被静默覆盖 —— 实测 75 处失效，
   移动端实际渲染的是被压缩的桌面布局（.form-grid 仍 3 列、.btn 仍是 7px 18px
   的桌面小尺寸、.detail-scroll 仍 overflow:hidden、.flow-aside 仍 340px 溢出）。

   搬到文件末尾后，这些断点才真正生效，恢复到作者原本的设计意图。
   ⚠️ 桌面端（>1024px）零影响：以下块均为 max-width 媒体查询，宽屏下不参与层叠。
   ⚠️ 维护铁律：新增响应式覆盖必须写在其对应主规则之后（本文件后半部分即是此范式，
      参见 .opt-del 处 2026-08-29 记录的同类顺序陷阱注释）。
   ========================================================================= */
/* === 紧凑桌面/平板 (641px-1024px)：保留侧边栏，适度压缩 === */
@media (max-width: 1024px) and (min-width: 641px) {
  .sidebar { width: 180px; min-width: 180px; }
  .main-content { padding: 0; }
  .container { padding: 16px 18px 30px; }
  .kpi-row { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
  .kpi-card { padding: 14px 12px; }
  .kpi-num { font-size: 23px; }
  .node-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr 1fr; }
  /* 平板：原两栏会把主内容和流程面板都压窄（表格里的输入框只剩 24px 宽、完全没法用）。
     ⚠️ 具体改法写在文件末尾「平板（641–1024px）」块里 —— 这里的媒体查询位于
     .flow-aside 基础规则（width:340px）之前，写在这里会被后面的基础规则覆盖掉。 */
  table.grid { font-size: 13px; }
  table.grid th, table.grid td { padding: 8px 9px; }
}

/* === 移动端 (<640px)：抽屉导航 + 底部 Tab === */
@media (max-width: 640px) {
  .app-shell { display: block; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; height: 100%;
    width: 82%; max-width: 300px; min-width: 0; z-index: 300;
    transform: translateX(-100%); transition: transform .25s ease;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    background:var(--nav-bg);
  }
  .sidebar.open { transform: translateX(0); box-shadow:4px 0 24px rgba(0,0,0,.4); }
  .sidebar .brand { font-size: 14px; padding: 16px; }
  .snav a { justify-content: flex-start; padding: 13px 14px; font-size: 15px; min-height: 44px; }
  .snav-group { font-size: 12px; }
  .user-info { display: flex; }
  .sidebar-bottom { display: flex; padding: 16px 12px 18px; gap: 10px; }
  .sidebar-bottom > a:last-child { display: block; min-height: 40px; }

  .mobile-bar {
    display: flex; align-items: center; justify-content: center;
    position: sticky; top: 0; z-index: 150;
    height: var(--mbar, 48px); min-height: var(--mbar, 48px);
    background:var(--nav-bg);
    color:#fff; box-shadow:0 1px 6px rgba(0,0,0,.3);
  }
  .mobile-bar .mobile-title { font-size: 16px; font-weight: 600; letter-spacing: .5px; }

  .nav-overlay { display: none; position: fixed; inset: 0; background:rgba(15,23,42,.5); z-index: 250; }
  .nav-overlay.show { display: block; }

  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
    height: calc(54px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background:var(--surface); border-top:1px solid var(--border);
    box-shadow:0 -2px 10px rgba(15,23,42,.08);
  }
  .bn-tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; color: var(--muted); text-decoration: none; font-size: 11px;
    position: relative; min-height: 44px; -webkit-tap-highlight-color: transparent;
  }
  .bn-tab:hover { text-decoration: none; }
  .bn-tab .bi { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; }
  .bn-tab .bi svg { width: 20px; height: 20px; }
  .bn-tab.active { color: var(--accent); }
  .bn-tab.active .bi { transform: translateY(-1px); }
  .bottom-nav .badge-count { top: 4px; right: 50%; transform: translateX(16px); border-color:var(--surface); }

  .main-content { width: 100%; padding-bottom: calc(54px + env(safe-area-inset-bottom)); }
  .container { padding: 0 12px; margin: 14px auto; }
  .card { padding: 14px; border-radius: var(--radius); }
  .card h2 { font-size: 15px; }
  .page-title { font-size: 17px; margin: 0 0 12px; }

  .toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .toolbar .btn, .toolbar .flex { width: 100%; }
  .toolbar .flex { justify-content: stretch; gap: 8px; }
  .toolbar .flex .btn { flex: 1; }

  table.grid { font-size: 12px; }
  table.grid th, table.grid td { padding: 9px 9px; white-space: nowrap; }
  table.grid th:first-child, table.grid td:first-child {
    position: sticky; left: 0; background:#fff; z-index: 1;
    box-shadow:2px 0 4px rgba(0,0,0,.06);
  }
  table.grid thead th:first-child { background:var(--panel); }

  input[type=text], input[type=password], input[type=date], input[type=number],
  select, textarea { font-size: 16px; padding: 12px; }
  .btn { min-height: 44px; font-size: 15px; padding: 12px 18px; width: auto; }
  .btn.small { min-height: 34px; padding: 7px 12px; font-size: 13px; }
  label.fld { font-size: 14px; margin-bottom: 14px; }

  .form-grid { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: repeat(auto-fit, minmax(98px, 1fr)); gap: 10px; }
  .kpi-card { padding: 14px 8px; }
  .kpi-num { font-size: 22px; }
  .node-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .node-card { padding: 12px 10px; }

  .notify-item { flex-direction: column; gap: 6px; }
  .notify-item > div:last-child { align-self: stretch; }
  .notify-body { font-size: 13px; }

  .detail-shell { height: auto; min-height: 100vh; }
  .flash-wrap { top: calc(var(--mbar, 48px) + 8px); left: 12px; right: 12px; max-width: none; }
  .detail-frozen { position: sticky; top: var(--mbar, 48px); z-index: 30; padding: 8px 12px 6px; }
  .frozen-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .frozen-bar .page-title { font-size: 15px; }
  .fb-left { flex-wrap: wrap; }
  .frozen-chips { justify-content: flex-start; }
  .frozen-actions { width: 100%; grid-template-columns: repeat(3, 1fr); margin-left: 0; }
  .frozen-actions .btn { width: 100%; }
  .seg-chips { gap: 4px; }
  .seg-pill { font-size: var(--fs-2xs); padding: 2px 7px; }
  .detail-scroll { padding: 10px 12px calc(54px + env(safe-area-inset-bottom) + 20px); overflow: visible; }
  .detail-frozen .flowbar .step { font-size: 11px; padding: 2px 7px; }
  .detail-frozen .flex { flex-wrap: wrap; gap: 8px; }
  .detail-frozen .flex .btn { flex: 1 1 auto; width: 100%; }
  .detail-body { flex-direction: column; gap: 12px; height: auto; }
  .detail-main { width: auto; padding-right: 0; }
  /* min-width:0 + max-width:100% —— 蓝框内 .frozen-actions 的 min-content 达 354px，
     不改的话 320px 屏上 aside 会撑到 340px 顶破整页（实测溢出 44px）。 */
  .flow-aside {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    max-height: 50vh;       /* 移动端限制蓝框高度, 内部仍独立滚 */
    overflow: auto;
    padding: 0;
  }
  .step-bar { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .step { min-width: 56px; flex: 0 0 auto; }
  .step-line { flex: 0 0 18px; }
  .two-col { grid-template-columns: 1fr; }
  /* 登录页窄屏规则统一收在「登录页」区块的 640px 断点内，此处不再重复定义（避免两处断点口径漂移） */
  .report { padding: 18px 16px; max-width: 100%; }
  .report table { font-size: 12px; }
  .report table th, .report table td { padding: 5px 6px; }
}

@media (max-width: 480px) {
  .container { padding: 0 10px; margin: 10px auto; }
  .card { padding: 12px; }
  .card h2 { font-size: 14px; }
  .bn-tab { font-size: var(--fs-xs); }
  .bn-tab .bi { font-size: 18px; }
  .mobile-bar .mobile-title { font-size: 15px; }
  /* 320px 屏上 3 列 × min92px + 2 间距 = 288px > 容器 272px；改 2 列并允许按钮文字折行 */
  .frozen-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .frozen-actions .btn { white-space: normal; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .node-grid { grid-template-columns: 1fr; }
  /* 窄屏登录（≤480px）：卡片内边距再收一档，给表单多让出 12px */
  .login-page .lgt-card { padding: 24px 18px; }
  .login-page .btn { letter-spacing: 2px; }
  table.grid th, table.grid td { padding: 8px 7px; }
  .badge { font-size: 12px; padding: 2px 8px; }
}

/* ==========================================================================
   毛玻璃三层 · 需求十三轮 2（方案定稿 outputs/业务流管理系统_毛玻璃规范_交互预览.html）
   G1 常驻玻璃 = 深色侧栏（内容从其下经过时呈磨砂深蓝 + 品牌橙微光）
   G2 遮罩玻璃 = 弹窗遮罩（原 blur(3px) 升级为 saturate+blur(10px)，180ms 淡入）
   G3 路由纱幕 = 页面跳转转场（160ms 淡入淡出 + 顶部品牌橙扫描线）
   降级：全部包在 @supports(backdrop-filter) 内——不支持的浏览器走上方原实心
   规则，零 JS、零布局位移；reduced-motion 由文件内全局 reduce 块统一接管。
   ========================================================================== */
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  /* G1 · 深色侧栏玻璃 */
  .sidebar {
    background: var(--glass-nav-bg);
    background-image: var(--glass-nav-glow);
    -webkit-backdrop-filter: var(--glass-nav-blur);
    backdrop-filter: var(--glass-nav-blur);
    box-shadow: 1px 0 0 rgba(15,23,42,.06);
  }
  .sidebar .brand, .sidebar-bottom { background: rgba(20,39,63,.42); }

  /* G2 · 弹窗遮罩玻璃（display:none→flex 无法过渡，用 180ms 关键帧淡入） */
  .modal-overlay {
    background: var(--glass-scrim-bg);
    -webkit-backdrop-filter: var(--glass-scrim-blur);
    backdrop-filter: var(--glass-scrim-blur);
  }
  .modal-overlay.show { animation: scrimIn .18s ease both; }
  @keyframes scrimIn { from { opacity: 0; } to { opacity: 1; } }
}

/* G3 · 路由纱幕：默认不可见、不拦截点击；.show 时 160ms 淡入 */
.route-veil {
  position: fixed; inset: 0; z-index: 3000;
  background: var(--glass-veil-bg);
  -webkit-backdrop-filter: var(--glass-veil-blur);
  backdrop-filter: var(--glass-veil-blur);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .16s ease, visibility 0s linear .16s;
}
.route-veil.show {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity .16s ease;
}
/* 品牌橙扫描线：顶部掠过一道细光（呼应登录页插画），完成后隐入纱幕 */
.route-veil::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transform: translateX(-100%);
}
.route-veil.show::before { animation: veilScan .6s ease-out both; }
@keyframes veilScan { to { transform: translateX(100%); } }
.route-veil .veil-hint {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-size: 12px; letter-spacing: 2px; color: var(--muted);
}
@media print { .route-veil { display: none !important; } }
