/* ==========================================================================
   云开假发生产管理系统 · 视觉体系（2026-10-01 UI 重构）

   风格：数据密集仪表盘（data-dense dashboard）。
   版式对齐「云开协同平台」：极简横向顶栏（只有导航 + 账号）、
   页面不留大段说明文字、能画成图就不写成字。

   配色三层分工，别混用：
     ① 石板灰（--brand）= 导航、主按钮、选中态这类「结构色」
     ② 蓝色（--accent）= 链接、筛选激活、焦点圈这类「可点提示」
     ③ 语义色（ok/warn/danger/violet）= 状态与数字着色
   底色到文字是工业浅灰底 + 纯白卡 + 细边框，不用重阴影。
   深浅色只覆盖变量，不动任何类名与结构。
   ========================================================================== */

:root {
  color-scheme: light;

  /* ========== 云开 UI 拆解包 - 设计令牌（2026-10-04 重建）========== */
  /* 基于：/tmp/ui-rebuild-kit/yunkai_deliverable/02_AI_Agent重建说明/design-tokens.json */

  /* 背景 ===== 2026-10-06「配色统一到冷调」这一轮改的就是这一段中性灰 =====
     起因：厂方「背景颜色、字体、字体大小感觉不统一」。把整站渲染出来数过——
     容器底是暖的（#FAFAF9 / #F8F8F7，22 个元素）、表头与分隔线是冷灰（#F3F4F6 / #E5E7EB，30 个元素），
     **暖底配冷灰，两套色温混在一起**，这就是看着不统一的来源。
     现在把**结构性的中性灰全部归到冷调**（对齐 kylin0525 采购工作台那一套）。
     不动的三类：① 品牌棕与它的浅底（--brand / --brand-soft，本来就是暖的，是"品牌"不是"中性"）；
     ② 语义色（ok / warn / danger / violet 与三档行底色——待生产的暖米色属于 warn 家族）；
     ③ 蓝色强调色。**层次关系（哪一层比哪一层深）一个都没改，只换了色温。 */
  --bg: #F5F7FB;           /* 页面背景（原 #FAFAF9 暖灰 → 冷调蓝白，与采购工作台同色） */
  --surface: #FFFFFF;      /* 卡片背景 */
  --surface-2: #F1F4F8;    /* 容器背景（原 #F8F8F7 暖灰） */
  --surface-3: #E9EEF6;    /* 比表面再深一档的中性底（原 #FEF7ED 暖米色）：次级表头、标签、跳过态 */

  /* 分隔线 */
  --line: #E6E9EF;         /* 边框/分隔（原 #E5E7EB 冷灰，改用采购工作台那一档） */
  --line-soft: #EFF2F7;    /* 软分隔线（原 #F3F4F6） */
  --th-bg: #EEF2F8;        /* 表头背景、页面分割、表格底纹（原 #F3F4F6） */

  /* 文字：正文 / 次要 / 弱化 */
  --ink: #111827;          /* 标题/关键正文（原 #1F2937） */
  --ink-2: #374151;        /* 次要标题 */
  --muted: #667085;        /* 辅助文字（原 #6B7280；在白底 5.0:1、在 --bg 上 4.69:1，都过 4.5） */
  --faint: #98A2B3;        /* 弱化文字（原 #9CA3AF） */

  /* ===== 界面主色：2026-10-06 对齐采购工作台，「可点 / 选中 / 焦点」合成一支靛蓝 =====
     改之前是「三种说法」：导航选中与主按钮用暖棕、链接与聚焦圈用蓝、划过底又是暖棕浅色——
     厂方原话「配色和点击显示的颜色我也想对齐一下」，从预览稿里选了「照采购工作台（一支靛蓝）」。
     ⚠️ `--brand` 这个名字现在指的是**界面主色（靛蓝）**，不再是云开棕：暖棕只剩在 logo.png 与
     内联 favicon 这两个品牌资产里。改名要动 30 多处规则、收益不抵风险，所以名字留着，含义以这条注释为准。
     三个值的角色：--brand 常态实心 / --brand-hover 更深一档（划过、按下）/ --brand-soft 选中浅底。
     **划过一律用中性灰（--surface-2 / --surface-3），不再用彩色底**——这是采购工作台的做法，
     划过是「我正指着它」、选中才是「我选了它」，一眼分得开。 */
  --brand: #2563EB;        /* 主按钮 / 导航选中实心 / 图表主色 / 登录页装饰线 */
  --brand-hover: #1D4ED8;  /* 深一档：划过、按下、板块开关的常态底 */
  --brand-soft: #EEF3FF;   /* 选中浅底（导航划过、字段触发器划过都不再用它） */
  --on-brand: #ffffff;     /* 主色上的文字（白字压 #1D4ED8 = 6.58:1，压 #2563EB = 5.12:1） */

  /* 强调色：并到同一支靛蓝（原 #3B82F6 亮蓝）。两个名字保留是因为角色不同
     （--brand = 实心结构色，--accent = 可点提示），但**现在是同一个值**，要分开只需改这一处。 */
  --accent: #2563EB;       /* 链接 / 进行中 / 焦点圈 */
  --accent-soft: #DBEAFE;  /* 强调浅底（工序格已打勾、筛选激活） */
  --accent-line: #93C5FD;  /* 强调边框 */
  --chart-teal: #0F766E;   /* 工作台对齐的图表青绿（2026-10-07 厂方四方案对比选「方案一 完整对齐」）：
                              今日发货数字 / 工序图条 / 图表绿点。只作**数据色**，不作交互色——交互色仍单一蓝（见上）。 */

  /* 语义色：对齐 UI 拆解包规范 */
  --ok: #16A34A;           /* 成功/已完成（原 #047857，调亮）*/
  --ok-soft: #DCFCE7;      /* 成功浅底（原 #e8f5ee）*/
  --ok-line: #86EFAC;      /* 成功边框（原 #b7e0c9）*/
  --warn: #F59E0B;         /* 警告/待处理（原 #b45309，调亮）*/
  --warn-soft: #FEF3C7;    /* 警告浅底（原 #fdf3e3）*/
  --warn-line: #FCD34D;    /* 警告边框（原 #efd8ac）*/
  --danger: #EF4444;       /* 危险/逾期（原 #dc2626，微调）*/
  --danger-soft: #FEE2E2;  /* 危险浅底（原 #fdecec）*/
  --danger-line: #FCA5A5;  /* 危险边框（原 #f4cccc）*/
  --violet: #8B5CF6;       /* 特殊状态（原 #6d28d9，调亮）*/
  --violet-soft: #EDE9FE;  /* 紫色浅底（原 #f1ecfe）*/
  --violet-line: #C4B5FD;  /* 紫色边框（原 #ddd0fb）*/

  /* 生产进度三个状态的行底色。必须是不透明值：整行底色会被左侧粘性列复用，
     半透明的话横向滚动时后面的列会透出来叠在一起（厂方 2026-10-01 报过这个 bug）。 */
  --row-wait: #fffaf1;    /* 待生产 */
  /* 异常行（停滞 / 逾期）直接复用语义软底，不再各写一份近似色：
     原来逾期行写死 #fdeeee，与 --danger-soft（#fdecec）只差 2/255，肉眼分不出却是两个值。 */

  /* 单值令牌：以前散在组件里的裸色值收在这里，改一处全站跟着变 */
  --line-strong: #cbd5e1;          /* 输入框悬浮描边 */
  --accent-soft-strong: #dfe9ff;   /* 强调软底的悬浮态 */
  --scrim: rgba(15, 23, 42, .42);  /* 弹窗遮罩 */
  /* 实心填充（状态胶囊、主色按钮、投放区）上的文字一律用这一支白，
     和 --on-brand（导航/主按钮上的白字）分开命名：一个是「品牌色上的字」，一个是「任何实心块上的字」 */
  --on-solid: #fff;
  /* 旧的 --green / --blue / --copper 三个别名已删除：全仓 0 处引用（2026-10-03 体检） */

  /* 主按钮 */
  --brand-btn: var(--brand);
  --brand-btn-hover: var(--brand-hover);

  /* 圆角四档（2026-10-05 对齐云开品牌规范：2 / 4 / 8 / 12） */
  --radius: 12px;        /* 卡片、弹层、大面板 */
  --radius-sm: 8px;      /* 按钮、输入框、下拉、分段控件 */
  --radius-xs: 4px;      /* 小按钮、菜单项、输入框内的小方块 */
  --radius-2xs: 2px;     /* 小标签、小图标容器（规范里的最小一档） */
  --radius-pill: 999px;  /* 胶囊、进度条、标签 */
  /* 三级柔阴影（2026-10-05 对齐云开品牌规范）。原来只有两级、且卡片几乎没阴影，看着发平 */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);         /* 轻：顶栏、下拉、气泡 */
  --shadow-card: 0 4px 16px rgba(17, 24, 39, .08);   /* 中：卡片、面板 */
  --shadow-pop: 0 8px 24px rgba(0, 0, 0, .12);       /* 重：弹层、大弹窗 */
  /* 分级之外的 5 个按角色命名的专用值（2026-10-10 全量审查 D2）。
     它们原来是**各写各的裸 rgba**，而守卫只认 16 进制色、一直没抓到。
     **取值一字未改**，只是收进令牌——视觉零变化，职责是"以后不许再裸写 rgba/rgb/hsl"。 */
  --shadow-menu: 0 10px 28px rgba(15, 23, 42, .16);          /* 下拉菜单 */
  --shadow-panel-lg: 0 14px 36px rgba(15, 23, 42, .18);      /* 大浮层（字段设置、导入复核面板） */
  --shadow-sticky: 5px 0 9px rgba(17, 24, 39, .04);          /* 粘性列右侧边缘投影（与 --line 合用） */
  --shadow-press: inset 0 1px 3px rgba(15, 23, 42, .32);     /* 主按钮按下 */
  --flash-row: inset 0 0 0 999px rgba(29, 78, 216, .13);     /* 跳转定位的整行高亮 */

  /* 布局尺寸（2026-10-07：左侧栏撤掉、导航回到顶栏）*/
  --topbar-h: 64px;             /* 顶栏高度（原 60px 改为 64px 对齐设计规范）*/
  --content-padding: 24px;      /* 内容区内边距 */
  --content-start-gap: 16px;    /* 各页内容起始间距：密集但留出清晰呼吸感 */
  --logo-h: 34px;               /* 顶栏品牌标识高度（原来侧栏里是 58px 竖着放；顶栏只有 64px 高，取 34px） */
  /* 焦点圈：所有可点元素共用一套（可见焦点是硬要求） */
  --ring: 0 0 0 3px rgba(29, 78, 216, .16);
  /* 2026-10-01 第1-2轮：使用者是工厂人员、屏幕小字看不清，整体字号上调一档 */
  /* 字号只有这几档，组件里别再写裸值（厂方 2026-10-01：字号要统一，有些太大了）。
     2026-10-03 体检前实际上有 15 档；2026-10-05 按云开品牌规范补上 32px 展示标题档，共八档；
     tests/design_tokens.mjs 会拦住裸字号，再写就红。 */
  --text-xs: 11.5px;      /* 极小提示 */
  --text-sm: 12.5px;      /* 次要标签 */
  --text-compact: 13px;   /* 表头、次要正文 */
  --text-body: 14px;      /* 正文、控件 */
  --text-title: 16px;     /* 卡片标题、章节标题（规范 16px 档） */
  --text-num: 20px;       /* 页面标题、关键数字（规范 20px 档） */
  --text-kpi: 26px;       /* 首页 KPI 大数字 */
  --text-hero: 32px;      /* 品牌大标题：登录页、页面标题块，全站最大（规范 32px 档） */
  /* 控件高度按「角色」命名，组件里不再出现裸数字。
     2026-10-03 体检前实际有 12 种取值；现按角色收档；2026-10-05 补 48px 档（规范里的登录按钮/搜索框高度）。 */
  --control-xl: 48px;     /* 登录按钮、顶栏搜索框（规范 48px 档） */
  --control-data: 36px;   /* 总览数量行 */
  --control-touch: 44px;  /* 总览触屏数量行、登录输入框 */
  --control-tap: 46px;    /* 触屏大按钮：手机端工序格 */
  --control-lg: 42px;     /* 大按钮、投放区、文件选择 */
  --control: 40px;        /* 次级按钮、输入框、下拉 */
  --control-nav: 38px;    /* 顶栏导航、图标按钮、表格行高 */
  --control-sm: 34px;     /* 行内小按钮、工序格、列表选项 */
  --control-xs: 30px;     /* 胶囊小工具、分页控件、分段控件、表头工具 */
  --control-icon: 26px;   /* 图标按钮：表头字段按钮、弹层关闭 */
  --pill-h: 24px;         /* 状态胶囊、小标签、分批按钮（原 22 并到这一档） */
  --thumb: 46px;          /* 产品缩略图方框 */

  /* 字体（2026-10-06 起自托管，厂方定的：正文思源黑体、标题思源宋体 700）
     两族都是**本站 /fonts 下的自托管字体**（fonts.css，按 unicode-range 拆成 202 个分包），
     不再看机器上装没装、也不请求境外 CDN——这条纪律 2026-10-01 就写在这儿了，现在才真正做到。
     以前全站写 Inter 优先，但 Inter 和思源黑体两边机器都没有 → 落到系统字：
     你的 Mac 是苹方、厂里的 Windows 是微软雅黑，所以「两个项目看着不一样」。
     拉丁字母与数字由思源黑体自己带（不再单列 Inter，否则会与中文两套观感）。 */
  --font: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  /* 标题那一支：思源宋体。只用在**页面大标题**与**登录页品牌标题**两处，
     正文 / 表格 / 按钮 / 数字一律还是黑体（厂方 2026-10-06 从预览稿里选的「宋体 700」）。 */
  --font-display: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;

  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
/* 各页面内容高矮不同，滚动条会时有时无；Windows 上那会让整页左右挪一下（厂方 2026-10-02 报的跳动）。
   常驻预留滚动条槽位，切换页面时宽度不再变化。 */
html { scrollbar-gutter: stable; }
/* hidden 属性必须压得住组件类里的 display，否则 hidden 形同虚设 */
[hidden] { display: none !important; }
/* 2026-10-07 厂方「这个字体和点击显示效果还是没有和我采购工作台同步到」——
   字体这一半差的不是字体族（两边早就是思源黑体），是**字体渲染**这一层：
   Mac 上不开 antialiased 会走次像素渲染，同一支思源黑体看着更粗更糊；采购工作台开着这两条，
   并排一比就觉得"字体不一样"。放在 body 上和采购工作台同一处（--font 那条贴在 :root）。
   注意：这两条在 Windows 上是空操作，不影响厂里机器。 */
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
h1, h2, h3, h4 { font-weight: 600; margin: 0; }
.tabular { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   骨架与顶栏：导航 + 账号，别的都不放
   ========================================================================== */

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.app-shell.is-progress-view { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }

/* ===== 顶栏（2026-10-07 厂方「左侧的目录还是改成到顶部去吧」）=====
   左侧那条 96px 竖栏整条撤掉，一行装下：logo → 板块切换 → 页签 → 账号菜单。
   顶栏走白底（--surface）+ 一条细线；侧栏没了之后它就是全站唯一的"结构性底色"，
   用 --surface-2 会和内容区的 --bg 混成一片、看不出边界。
   各页面完全一致：曾经给「生产」页单独放开宽度与内边距，导致切页时整行左右跳动（厂方 2026-10-02 报的）。 */
.topbar {
  position: sticky; top: 0; z-index: 30;
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px;
  min-height: var(--topbar-h);
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

/* 品牌标识：顶栏左端。右侧一条竖线把它和板块切换分开 */
.topbar-brand {
  flex: 0 0 auto;
  display: flex; align-items: center;
  padding-right: 12px;
  border-right: 1px solid var(--line);
}
.topbar-brand img { height: var(--logo-h); width: auto; object-fit: contain; }

/* 板块切换（两个并列胶囊：人发 / 化纤）与页签之间也有一条竖线 */
.topbar-division {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 6px;
  padding-right: 12px;
  border-right: 1px solid var(--line);
}

/* 页签那一行：横向排，空间不够时**自己横滑**，绝不把顶栏撑破（顶栏高度是死的） */
.topbar-nav {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.topbar-nav::-webkit-scrollbar { display: none; }

/* 右侧：账号 + ⋯ */
.topbar-right {
  flex: 0 0 auto; margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.header-account {
  display: flex; flex-direction: column; align-items: flex-end; gap: 0;
  min-width: 0; max-width: 180px;
}

.account-name { max-width: 100%; font-size: var(--text-sm); font-weight: 700; color: var(--ink-2); letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-role { max-width: 100%; font-size: var(--text-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.icon-btn {
  width: var(--control-nav); height: var(--control-nav); flex: 0 0 var(--control-nav);
  display: inline-grid; place-items: center;
  border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent;
  color: var(--muted); font-size: var(--text-title); font-weight: 650;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.header-menu-wrap { position: relative; display: flex; }
/* 顶栏在页面**最上**：菜单往下弹（往上会掉出屏幕），并贴着右边往左展开
   （2026-10-05 之前账号条钉在侧栏底部时是"往上弹、往右展开"，竖栏撤掉后方向整个反过来） */
.header-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40;
  min-width: 148px; padding: 6px;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-pop);
}
.header-menu button { text-align: left; border: none; background: transparent; border-radius: var(--radius-xs); padding: 8px 10px; font-size: var(--text-compact); color: var(--ink); }
.header-menu button:hover { background: var(--surface-3); }

/* 管理工作台：首屏先看风险、实发和客户，不铺重复说明卡片。 */
/* 2026-10-03 厂方：「卡片里的内容去掉第三行」——那行小备注（逾期几张单 / 几张单在排队交货）
   已经取消（同一句话改挂在卡片的悬浮说明 title 里），所以 .kpi-note 的规则一并删掉，不留没人用的样式。
   2026-10-07 厂方选「方案一 完整对齐采购工作台」：卡片一律细灰边（.is-emphasis 彩边与 .is-alarm 红左条
   两条路子都撤——报警感由红色数字承担），.is-alarm 类同时从 app.js 摘掉。 */
.overview-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
/* KPI 卡片：白卡、小标签在上、大数字在下，不放图标（对齐厂方云开协同首页的样子，2026-10-02 截图）。
   告警卡多一条红左边条，进场有轻微上浮动画。
   2026-10-03 收口：这一条原来在文件里声明了三次（96px 一版、118px 一版、动画一版），
   后两条把前一条整条盖掉，读代码时看不出最终值——已并成一条。
   2026-10-03 厂方：「顶部卡片高度尽量压缩，卡片里的内容去掉第三行」——备注行取消后只剩两行，
   min-height 118 → 72、内边距收紧，对齐方式由 space-between（当初是为了把备注钉在底部）改成居中。 */
.overview-kpi {
  min-height: 72px; padding: 10px 14px; display: flex; flex-direction: column;
  align-items: flex-start; justify-content: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-card); animation: kpi-in .4s ease-out both;
}
button.overview-kpi { cursor: pointer; text-align: left; font: inherit; color: inherit; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
button.overview-kpi:hover { border-color: var(--accent-line); box-shadow: var(--shadow-pop); transform: translateY(-1px); }
button.overview-kpi:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.overview-kpi { animation: kpi-in .4s ease-out both; }
.overview-kpi:nth-child(2) { animation-delay: .04s; }
.overview-kpi:nth-child(3) { animation-delay: .08s; }
.overview-kpi:nth-child(4) { animation-delay: .12s; }
.overview-kpi:nth-child(5) { animation-delay: .16s; }
.overview-kpi:nth-child(6) { animation-delay: .2s; }
@keyframes kpi-in { from { opacity: 0; transform: translateY(8px); } }
/* 2026-10-03 收口：KPI 卡片的「彩色图标块」设计 2026-10-02 就撤掉了（卡片现在只有标签 / 大数字 / 备注，
   不走图标），这里残留的 .kpi-tile / .kpi-icon 规则一起删掉。其中那段没有选择器的孤儿声明更危险——
   浏览器会把它连同紧随其后的下一条规则一起丢弃，属于隐性故障，不能再留。
   tone 说明（2026-10-07 厂方选「方案一 完整对齐采购工作台」后）：琥珀（待交）/ 红（逾期）/ 青绿（今日发货，
   --chart-teal）三支上色，数字用思源宋体 700（与两栏标题同一支字，工作台的大数字也是宋体）；
   其余 tone 仍是语义标记、不上色。 */
.overview-kpi .kpi-label { color: var(--muted); font-size: var(--text-compact); font-weight: 600; }
.overview-kpi .kpi-value { color: var(--ink); font-family: var(--font-display); font-size: var(--text-kpi); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.overview-kpi .kpi-value small { margin-left: 5px; color: var(--muted); font-size: var(--text-compact); font-weight: 500; }
.overview-kpi.tone-amber .kpi-value { color: var(--warn); }
.overview-kpi.tone-red .kpi-value { color: var(--danger); }
.overview-kpi.tone-green .kpi-value { color: var(--chart-teal); }
.overview-section { min-width: 0; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
/* 卡片下面全放图表，一块占一行（厂方 2026-10-03：「各客户未出货数量」要独占一行，客户多了半屏放不下）。
   工序图内部再并排——见下面的 .overview-stage-list。 */
.overview-charts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }

/* ---------- 首页：左右两个板块栏（厂方 2026-10-05「从中间对半分，左边人发、右边化纤」） ---------- */
.overview-boards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 14px; align-items: stretch; }
.overview-boards.is-single { grid-template-columns: minmax(0, 1fr); }
.overview-board { min-width: 0; display: grid; grid-template-rows: subgrid; grid-row: span 4; gap: 12px; }
.overview-board-head { display: flex; align-items: center; padding: 0 2px; }
/* 首页两栏标题（厂方 2026-10-07「现在的图标字体不满意」）：四方案真实字型对比后选定
   思源宋体 700、去掉蓝色小方块——与 .modal-title / 登录页封面同一支字（--font-display），
   至此站内宋体范围 = 弹窗标题 + 登录封面 + 首页两栏标题。 */
.overview-board-head h2 { margin: 0; color: var(--ink); font-family: var(--font-display); font-size: var(--text-title); font-weight: 700; letter-spacing: .02em; }
/* 每栏三张卡片（待交货数量 / 逾期未交数量 / 今日发货数量） */
.overview-kpis.is-board { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 0; }
/* 栏内的段落做成卡片：两栏并排时，边框能把"这块属于哪个板块"框住 */
.overview-board .overview-section, .overview-shipments { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.overview-head-note { color: var(--faint); font-size: var(--text-xs); font-weight: 500; }
/* 竖向柱状图：类目多了横向滚动（与「最近出货」同一套做法） */
.overview-columns { overflow-x: auto; padding: 4px 8px 0; }
.overview-columns svg { display: block; margin-inline: auto; }
.overview-column.is-clickable { cursor: pointer; }
.overview-column.is-clickable:hover .timeline-bar { fill: var(--brand-hover); }
.overview-column .timeline-bar { fill: var(--brand); }
/* 横向柱状图：一行一道工序，条长按件数，右侧写件数 */
.overview-bars { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; }
.overview-bar-row { display: grid; grid-template-columns: 80px minmax(0, 1fr) 96px; align-items: center; gap: 10px; min-height: var(--control-xs); }
.overview-bar-name { color: var(--ink-2); font-size: var(--text-compact); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overview-bar-track { height: 14px; border-radius: var(--radius-pill); background: var(--surface-2); overflow: hidden; }
/* 工序图条 2026-10-07 起用工作台对齐的青绿（--chart-teal）：客户图保持品牌蓝，一图一色（厂方选方案一） */
.overview-bar-track > i { display: block; height: 100%; border-radius: var(--radius-pill); background: var(--chart-teal); }
.overview-bar-value { color: var(--ink); font-size: var(--text-compact); font-variant-numeric: tabular-nums; text-align: right; }
/* 单位「件」的字号必须显式写：`small` 的浏览器默认是 `font-size: smaller`，
   父级 13px 会被压成 10.83px——全站唯一一档掉在八档令牌之外的字号（2026-10-06 量出来的）。 */
.overview-bar-value small { color: var(--muted); font-size: var(--text-xs); font-weight: 500; }
@media (max-width: 1023px) {
  .overview-boards { grid-template-columns: minmax(0, 1fr); }
  .overview-board { grid-template-rows: none; grid-row: auto; }
}
.overview-section-head { min-height: var(--control-nav); padding: 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.overview-section-head h2 { margin: 0; color: var(--ink-2); font-size: var(--text-compact); font-weight: 700; }
/* 图表卡标题前的彩色圆点（2026-10-07 厂方选方案一，对齐采购工作台「每图一色」）：
   客户图蓝点配蓝条、工序图青绿点配青绿条；最近出货 / 出货记录是列表不是图，不带点。 */
.overview-section-head.is-chart-customer h2::before,
.overview-section-head.is-chart-stage h2::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.overview-section-head.is-chart-customer h2::before { background: var(--brand); }
.overview-section-head.is-chart-stage h2::before { background: var(--chart-teal); }
.overview-section-head > span, .overview-section-head .text-link { color: var(--muted); font-size: var(--text-xs); }
/* 全厂口径下「各工序在生产数量」按板块各一张（厂方 2026-10-03：人发对应人发的、化纤对应化纤的），
   而且**两张并排**（厂方 2026-10-03：「2 个图表放到一行来」）。用 auto-fit：
   两张时两列；单板块只有一张时自动占满一行；窄屏放不下两列时自动回到一列。 */
.overview-stage-list { padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 12px; }
.overview-stage-group-title { margin: 0; padding: 8px 12px 0; font-size: var(--text-compact); font-weight: 700; color: var(--muted); }
.overview-shipment-list { padding: 2px 12px; }
.overview-shipment-row { min-height: var(--control-sm); display: grid; grid-template-columns: minmax(70px, .8fr) minmax(90px, 1fr) auto; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: var(--text-xs); }
.overview-shipment-row:last-child { border-bottom: 0; }
.overview-shipment-row strong { color: var(--ink); text-align: right; font-size: var(--text-sm); white-space: nowrap; }
.overview-empty { padding: 18px 12px; color: var(--muted); font-size: var(--text-sm); }
.text-link { padding: 0; border: 0; background: transparent; color: var(--accent); font: inherit; font-weight: 600; text-align: left; cursor: pointer; text-underline-offset: 2px; }
.text-link:hover { text-decoration: underline; }
.overview-risk-table td, .overview-customer-table td { height: var(--control-nav); padding-block: 5px; font-size: var(--text-sm); }
.orders-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.orders-search { width: min(340px, 100%); }
.orders-toolbar select { min-width: 170px; }
.orders-count { margin-right: auto; color: var(--muted); font-size: var(--text-xs); }
.orders-actions { display: flex; gap: 6px; }
.orders-table { min-width: 840px; table-layout: fixed; }
.orders-table th, .orders-table td { height: var(--control-nav); padding: 5px 10px; font-size: var(--text-sm); }
.orders-table-row small { display: block; }
/* 列宽按「内容真实需要」定（2026-10-09 用 44px 探针逐格量过：订单号 150 / 状态 84 / 客户 100 /
   下单·已发 78 / 待交 118 / 要求交期 120）。table-layout:fixed 下富余宽度**按列宽等比**分配，
   所以这套比例在任何屏宽下都保持一致——不会出现「订单号一大片空白、别的列挤在一起」。
   按内容比例给宽，也正是厂方要的「间距自适应」。 */
table.orders-table th.col-order-no, table.orders-table td.col-order-no { width: 150px; }
table.orders-table th.col-order-status, table.orders-table td.col-order-status { width: 84px; }
table.orders-table th.col-order-customer, table.orders-table td.col-order-customer { width: 100px; }
table.orders-table th.col-order-qty, table.orders-table td.col-order-qty { width: 78px; }
table.orders-table th.col-order-shipped, table.orders-table td.col-order-shipped { width: 78px; }
table.orders-table th.col-order-open, table.orders-table td.col-order-open { width: 118px; }
table.orders-table th.col-order-due, table.orders-table td.col-order-due { width: 120px; }
/* 全表信息居中（厂方 2026-10-09：「所有字段信息居中显示」）——原来数字右对齐、文字左对齐，
   同一行里左右两种对齐混着，看着就是「有的隔得很远有的很近」。
   ⚠️ 必须写 `table.data-table.orders-table` 这一串：通用那条 `table.data-table .num { text-align: right }`
   的权重比 `table.orders-table ... td` 高，只写后者的话数字列还是右对齐（实测 21 格里 13 格没居中）。 */
table.data-table.orders-table thead th, table.data-table.orders-table tbody td { text-align: center; }
/* 「起」：订单里各明细行的要求交期不止一种时，挂在日期后面（在线条里跟日期同一行，所以是 inline）。
   灰字小一号，读起来是「从这个日期起」而不是第二个日期。 */
.order-due-since { margin-left: 4px; color: var(--muted); font-size: var(--text-sm); }
.order-open-qty { color: var(--accent); font-weight: 700; }
.order-detail-row > td { padding: 0 !important; background: var(--surface-2); }
/* 展开的订单明细：一条明细一行（厂方 2026-10-01：「应该是每条数据只有一行，现在太乱了」）。
   表头行和数据行共用同一套网格列；窄屏时整块左右滑动，行不会被拆散。
   第 6 列（交期）按表头「要求交期」四个字定，日期本身 10 字符约 80px，所以留 84px。 */
.order-lines { min-width: 920px; }
.order-line-head, .order-line-row {
  display: grid; gap: 10px; align-items: center; padding: 9px 12px;
  grid-template-columns: minmax(130px, 1fr) minmax(100px, .8fr) 58px 58px 74px 84px minmax(210px, 1.8fr);
}
/* 明细表头压在 surface-3（比 surface-2 还深）上：faint 灰在这里只有 3.87:1，是全站最低的一处，改 muted（6.08:1） */
.order-line-head { background: var(--surface-3); color: var(--muted); font-size: var(--text-sm); font-weight: 600; }
.order-line-row { background: var(--surface); border-top: 1px solid var(--line-soft); font-size: var(--text-body); }
.order-line-row.is-cancelled { background: var(--row-wait); }
/* 明细也跟随主表居中（厂方 2026-10-09：「所有字段信息居中显示」）：
   表头、数字、日期、批次胶囊整组都居中，只有备注那种多行文字仍按左对齐读得更顺 */
.order-line-head > *, .order-line-row > * { justify-self: center; text-align: center; }
.order-line-row .num { font-variant-numeric: tabular-nums; }
.order-line-row .order-line-name { justify-self: stretch; }
.order-line-name { min-width: 0; }
.order-line-name strong { font-size: var(--text-body); }
.order-line-name .status { margin-left: 6px; }
.order-line-name small { display: block; margin-top: 2px; color: var(--faint); font-size: var(--text-sm); }
.order-line-specs { color: var(--ink-2); }
.order-line-open strong { font-size: var(--text-title); color: var(--warn); }
.order-line-open em { display: block; margin-top: 2px; color: var(--warn); font-style: normal; font-size: var(--text-sm); }
.order-line-batches { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; min-width: 0; }
.line-muted { color: var(--faint); font-size: var(--text-sm); }
/* 胶囊自己要能收窄：批次状态文字是弹性的一段，否则窄屏上会顶出表格右边缘。
   （2026-10-09 起胶囊里不再有拆分按钮——拆分只在生产页做。） */
.order-batch-chip { display: inline-flex; align-items: center; justify-content: center; gap: 6px; max-width: 100%; min-width: 0; padding: 3px 8px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface-2); color: var(--ink-2); font-size: var(--text-sm); white-space: nowrap; }
.order-batch-chip.is-done { border-color: var(--ok-line); background: var(--ok-soft); }
.order-batch-chip .order-batch-current { flex: 0 1 auto; min-width: 0; color: var(--muted); }
/* 同一明细的多批竖排成一组：整组在格子里居中（厂方 2026-10-09：「都居中显示」），
   组内每枚胶囊等宽（stretch）——连线才是直的，文字各自居中。 */
.order-batch-group { display: inline-flex; flex-direction: column; align-items: stretch; gap: 4px; min-width: 0; }
/* 分批连线照生产表那套画法（同线宽、同颜色、首尾各收一半），只是画在胶囊外面：
   一条竖线 + 每枚胶囊一根横线，读起来就是「这几批是一条明细拆出来的」。
   ⚠️ 左右两侧的 16px 必须**对称**：连线占的是左边那 16px，整组按外框居中，
   只留左边的话胶囊本身会往右偏 8px（实测偏移就是 8px），「都居中显示」就不成立了。 */
.order-batch-chip.is-linked { position: relative; margin: 0 16px; }
.order-batch-chip.is-linked::before { content: ''; position: absolute; left: -9px; top: -4px; bottom: -4px; border-left: 2px solid var(--accent-line); }
.order-batch-chip.is-linked::after { content: ''; position: absolute; left: -9px; width: 7px; top: 50%; border-top: 2px solid var(--accent-line); }
.order-batch-chip.is-linked[data-batch-link="first"]::before { top: 50%; }
.order-batch-chip.is-linked[data-batch-link="last"]::before { bottom: 50%; }
/* 胶囊的可点主体（点一下去生产页定位那一批） */
.order-batch-main { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; border: 0; background: transparent; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.order-batch-main:hover .order-batch-current { color: var(--accent); }
/* 焦点圈形状要跟可点主体一致：这个可点主体是胶囊（999px）里的一段，焦点圈也得是胶囊，
   原来是 6px 圆角，键盘走上去会在胶囊中间出现一个方圆形的框（2026-10-03 体检发现） */
.order-batch-main:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-pill); }
.order-batch-chip .batch-qty { flex: 0 0 auto; font-weight: 650; }
.batch-tag { color: var(--muted); font-weight: 700; }
.order-batch-current { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 2026-10-03 收口：这一族原来在文件里声明了两次（第1版是 flex 换行，第6轮改成三列 grid 大卡），
   后写的把 display / gap / margin 盖掉，只剩边框与白底还在生效——读代码看不出最终形态，已并成一条。 */
/* 出货差异板块（厂方 2026-10-11 第 2 问）：结论条目一行一条。
   差异数字刻意**不上色**——13px 的小字压 --danger/--warn 对比度不够（4.5:1 过不了），
   方向靠正负号 + 那一列的状态胶囊（胶囊自带浅底 + 深字，是过了线的）。 */
.variance-insights { display: grid; gap: 6px; margin: 0; padding-left: 18px; color: var(--muted); font-size: var(--text-compact); }

.shipment-summary { display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 240px) minmax(0, 1fr); gap: 12px; align-items: stretch; margin-bottom: 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.shipment-summary > :first-child, .shipment-summary > :nth-child(2) { min-width: 150px; padding: 12px 16px; display: grid; gap: 4px; border-right: 1px solid var(--line); }
.shipment-summary span { color: var(--muted); font-size: var(--text-xs); }
.shipment-summary strong { font-size: var(--text-num); line-height: 1; font-variant-numeric: tabular-nums; }
.shipment-summary strong small { margin-left: 4px; color: var(--muted); font-size: var(--text-xs); font-weight: 500; }
/* 单独成行（出货差异子视图的月份条）时靠左排；默认那套是给摘要行右端用的 */
.shipment-period.is-leading { justify-content: flex-start; margin-left: 0; padding: 0 0 12px; }

.shipment-period { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-left: auto; padding: 8px 12px; }
.shipment-period button { min-height: var(--control); padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--muted); font: inherit; font-size: var(--text-body); cursor: pointer; }
.shipment-period button.is-active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-hover); font-weight: 600; }
.shipments-list { overflow: hidden; }
.shipments-table { min-width: 720px; }
.shipments-table th, .shipments-table td { height: var(--control-nav); padding: 5px 10px; font-size: var(--text-sm); }
/* 分批生产：确认前先看清每批多少件 */
.split-preview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.split-preview > div { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.split-preview span { display: block; color: var(--faint); font-size: var(--text-compact); }
.split-preview strong { font-size: var(--text-num); font-variant-numeric: tabular-nums; }
.completion-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-xs); background: var(--surface-2); color: var(--muted); font-size: var(--text-xs); }
.completion-summary strong { color: var(--ink); white-space: nowrap; }
@media (max-width: 850px) { .overview-secondary { grid-template-columns: 1fr; } .overview-side { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1050px) { .overview-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .content { padding: 10px 10px calc(76px + env(safe-area-inset-bottom)); }
  .overview-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-kpi:nth-child(3n) { border-right: 1px solid var(--line); }
  .overview-kpi:nth-child(2n) { border-right: 0; }
  .overview-kpi { min-height: 68px; padding: 9px 11px; border-bottom: 1px solid var(--line); }
  .overview-kpi:nth-child(2) { border-right: 0; }
  .overview-kpi > strong { font-size: var(--text-num); }
  .overview-side { grid-template-columns: 1fr; }
  .orders-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .orders-search { grid-column: 1 / -1; width: 100%; }
  .orders-actions { justify-content: flex-end; }
  .order-line-head, .order-line-row { grid-template-columns: minmax(120px, 1.2fr) minmax(88px, .8fr) 52px 52px 66px 88px minmax(180px, 1.4fr); gap: 8px; padding: 8px 10px; }
  .order-lines { min-width: 820px; }
  .shipment-summary > div:first-child, .shipment-summary > div:nth-child(2) { min-width: 40%; flex: 1; padding: 10px 12px; }
  .shipment-period { margin-left: 0; }
}

/* 取数时盖一层提示（app.js beginLoading）：超过 150ms 才出现，快的时候不闪。
   只盖内容区不盖顶栏——加载中也还能点别的页签换地方。 */
.content-loading { position: absolute; inset: 0; z-index: 20; display: flex; align-items: flex-start; justify-content: center; padding-top: 16vh; background: var(--bg); background: color-mix(in srgb, var(--bg) 55%, transparent); }
.content-loading[hidden] { display: none; }
.content-loading-pill { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); color: var(--ink-2); font-size: var(--text-body); }
.loading-ring { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--ink-2); animation: loading-spin .8s linear infinite; }
@keyframes loading-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading-ring { animation: none; } }

/* 手机：导航落到贴底标签栏 */
/* 手机生产页的独立入口（桌面隐藏）：表头藏掉后逐列筛选和字段设置原来就够不着了 */
.mobile-progress-tools, .mobile-progress-filters { display: none; }

.mobile-tabbar { display: none; }
@media (max-width: 767px) {
  .header-bar { padding: 0 12px; gap: 8px; }
  .header-account { min-width: 0; max-width: 130px; padding: 0 8px; }
  .content { padding: 12px 12px calc(92px + env(safe-area-inset-bottom)); }
  .mobile-tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    /* 7 项（管理员 8 项）等宽一行：标签必须 nowrap——预览稿实测过，
       390px 下不 nowrap 的话「总览」会被折成两行。项数多时允许横滑。 */
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); overflow-x: auto;
    background: var(--surface); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mobile-tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 58px; padding: 6px 1px; border: none; background: transparent;
    font-size: var(--text-xs); color: var(--muted); white-space: nowrap;
  }
  .mobile-tab .nav-icon { font-size: var(--text-body); display: inline-flex; align-items: center; }
  .mobile-tab .nav-icon .ic { width: 20px; height: 20px; }
  .mobile-tab.is-active {
    /* 2026-10-07 与侧栏同一套选中语言：浅蓝底 + 深蓝字（原来只有字变蓝，手机上没有"选中块"） */
    background: var(--brand-soft);
    border-radius: var(--radius-sm);
    color: var(--brand-hover);
    font-weight: 600;
  }
}

/* ==========================================================================
   页面区块：标题行只留一句短标签 + 右侧动作，不写解释段落
   ========================================================================== */

.head-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.toolbar-end { margin-left: auto; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
/* 只给「竖着堆叠」的卡片留间距；网格里的卡片由 gap 负责，别让这条漏进去
   （踩过：KPI 第 2 张起各矮 12px，第一张显得高出一截） */
.card + .card { margin-top: 12px; }
.grid-2 > .card { margin-top: 0; }
.card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 15px 16px 0; }
.card-title { font-size: var(--text-title); font-weight: 650; }
.card-title .nav-icon { color: var(--accent); font-size: var(--text-compact); margin-right: 6px; }
.card-note { margin-left: auto; color: var(--faint); font-size: var(--text-compact); text-align: right; }
.card-body { padding: 14px 16px 16px; }
.card-body.tight { padding: 10px 12px 12px; }

/* 空态：一句事实，不加解释 */
/* 被撑高的卡片（.grid-2 等高）里，空态要居中，否则内容堆在顶部、下面一大片空白 */
.grid-2 .card-body > .api-empty { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.api-empty { padding: 26px 16px; text-align: center; color: var(--faint); }
.api-empty strong { display: block; color: var(--muted); font-size: var(--text-body); margin-bottom: 4px; }
.api-empty p { margin: 0; font-size: var(--text-sm); }

/* 图标：内联 SVG 线性图标（云开品牌规范：24×24 视图、统一线宽、随文字取色） */
.ic { display: block; width: 18px; height: 18px; flex: 0 0 auto; }
.card-title .ic { color: var(--accent); margin-right: 6px; }

/* 空状态：图标 + 说明 + 一个按钮（原来只有干巴巴一行字，看不出下一步点哪里） */
.api-empty-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--control-touch); height: var(--control-touch); margin: 0 auto 12px;
  border-radius: var(--radius-sm); background: var(--surface-2); color: var(--faint);
}
.api-empty-icon .ic { width: var(--control-icon); height: var(--control-icon); }

/* 页面标题块（2026-10-07 起已撤——厂方「（每个板块信息顶部）不需要那个标题了，去掉」）。
   原来这一整组 `.page-head` / `.page-head-title` / `.page-head-rule` / `.page-head.is-compact` 都删了，
   页面直接以内容开头（生产页顺带省下约 24px 高度）。**别再把它加回来**：厂方的口径是
   "尽量增加信息密度"，而这块标题不提供任何操作信息。
   撤掉之后全站可见的思源宋体只剩**弹窗标题**（`.modal-title`）与**登录页封面**两处。
   `--text-hero` 与 `--radius-2xs` 仍有人用（登录页封面 / 总览栏题与弹窗短线），
   所以 test:tokens 的"定义了却没人用"不会红。 */


/* --------------------------------------------------------------------------
   生产进度：高密度订单表，列筛选与字段同处表头。
   -------------------------------------------------------------------------- */
/* flex: 0 0 auto 是关键：这条行在 flex 列布局里会被压到 15px（厂方截图里按钮只剩上半截就是它），
   里面有内容时必须保持自身高度，不许被挤扁。 */
.progress-toolbar { flex: 0 0 auto; min-height: 0; padding: 2px 0 6px; gap: 8px; border-bottom: 0; }
.progress-toolbar .api-filter { min-width: 0; }
.progress-toolbar .api-filter select { width: min(200px, 42vw); }
/* 「隐藏已完工」开关：常驻工具行，完工行只藏不删（厂方 2026-10-09：整单 completed 还占着表，订单量翻 10 倍会挤爆） */
.progress-hide-done { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: var(--muted); font-size: var(--text-compact); font-weight: 500; white-space: nowrap; }
.progress-hide-done input { width: 16px; height: 16px; min-height: 0; margin: 0; accent-color: var(--brand); }
/* 状态分档（厂方 2026-10-09：「再加一个分档按钮，像筛子一样一键只看某一类」）：
   全部 / 待生产 / 生产中 / 已完工，连成一排分段控件；选中态沿用全站那套（浅蓝底 + 品牌描边 + 深蓝字 + 600） */
.progress-status-tabs { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; flex: 0 0 auto; }
.progress-status-tab { min-height: var(--control-nav); padding: 0 14px; border: 0; border-right: 1px solid var(--line); background: var(--surface); color: var(--muted); font: inherit; font-size: var(--text-body); cursor: pointer; white-space: nowrap; transition: background-color .15s ease, color .15s ease, box-shadow .15s ease; }
.progress-status-tab:last-child { border-right: 0; }
.progress-status-tab:hover:not(.is-active) { background: var(--surface-3); color: var(--ink); }
.progress-status-tab.is-active { background: var(--brand-soft); color: var(--brand-hover); font-weight: 600; box-shadow: inset 0 0 0 1px var(--brand); }
.progress-status-tab:focus-visible { outline: 2px solid var(--accent-line); outline-offset: -2px; }
/* flex 列：表格自己滚，分页条钉在下面（2026-10-03 分页改造） */
.progress-table-body { flex: 1 1 auto; min-height: 0; padding: 0; display: flex; flex-direction: column; }
.progress-table-body .table-scroll.progress-table-scroll { flex: 1 1 auto; height: auto; min-height: 0; }
.progress-th { display: flex; align-items: center; min-width: 0; }
.progress-th-label { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: var(--text-compact); font-weight: 650; line-height: 1.25; white-space: nowrap; text-align: center; }
.progress-th-trigger {
  /* 标签精确居中：左右留同宽安全边（中心不变），图标绝对定位到格子右缘，
     所以图标永远不会挤到文字上，文字也永远不会压到图标（厂方 2026-10-02 报的重叠）。
     安全边 15→12px（2026-10-02）：6 个字的字段名（要求出货时间）在 15px 下会被挤成省略号。 */
  display: inline-flex; align-items: center; justify-content: center; gap: 0;
  position: relative;
  box-sizing: border-box; width: 100%; min-width: 0; min-height: var(--control-icon); padding: 3px 12px;
  border: 1px solid transparent; border-radius: var(--radius-xs); background: transparent; color: var(--ink);
  font: 650 var(--text-compact)/1.25 var(--font); text-align: center; white-space: normal; cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
/* 字段名只有一行；**必须自己省略号裁掉**——放开 overflow 时文字会溢出格子盖到筛选图标上
   （厂方 2026-10-02 报的「图标和文字重叠」就是这么来的：我上轮把 overflow:hidden 去掉了） */
.progress-th-trigger > span:first-child { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 划过用中性底（不是彩色底）：划过 = 我正指着它，选中才上颜色 */
.progress-th-trigger:hover { background: var(--surface-2); color: var(--ink); }
.progress-th-trigger.is-filtered { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.progress-th-trigger:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }
/* 筛选图标：小漏斗比原来的小三角明显（厂方 2026-10-01「筛选没有图标，不明显」） */
/* 图标钉在格子右缘（内缩 3px），不参与居中计算 */
.progress-filter-icon { position: absolute; right: 1px; top: 50%; transform: translateY(-50%); width: 9px; height: 9px; color: var(--muted); opacity: .7; }
.progress-th-trigger:hover .progress-filter-icon { opacity: 1; color: var(--accent); }
.progress-th-trigger.is-filtered .progress-filter-icon { opacity: 1; color: var(--accent); }
/* 筛选弹层重做（厂方 2026-10-01：「太丑了，极简，原生」）：
   去掉分组边框与彩色块，做成系统右键菜单那种——白底、发丝边、圆角、
   选项整行高亮、当前值左侧一个勾；底部只留两个文字按钮。 */
.progress-filter-popup {
  position: fixed; z-index: 1000; display: flex; flex-direction: column; gap: 6px;
  box-sizing: border-box; width: min(260px, calc(100vw - 16px)); max-height: min(390px, calc(100vh - 16px));
  padding: 6px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-menu);
}
.progress-filter-popup[hidden] { display: none !important; }
.progress-filter-popup-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: var(--control-xs); padding: 2px 6px 0; }
.progress-filter-popup-head strong { font-size: var(--text-sm); }
.progress-filter-close { width: var(--control-icon); height: var(--control-icon); padding: 0; border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--muted); font: var(--text-num)/1 var(--font); cursor: pointer; }
.progress-filter-close:hover { background: var(--surface-2); color: var(--ink); }
.progress-filter-search { display: block; width: 100%; min-width: 0; }
.progress-filter-options { display: flex; flex-direction: column; min-height: 0; max-height: 240px; overflow: auto; border: 0; border-radius: var(--radius-xs); padding: 2px; scrollbar-width: thin; }
/* row-reverse：勾在左、值在右，跟系统菜单一致 */
.progress-filter-option { display: flex; flex-direction: row-reverse; align-items: center; justify-content: flex-end; gap: 8px; min-height: var(--control-sm); padding: 0 10px; border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--ink); font: var(--text-compact)/1.35 var(--font); text-align: left; cursor: pointer; }
.progress-filter-option:last-child { margin-bottom: 0; }
.progress-filter-option > span:first-child { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.progress-filter-option:hover { background: var(--surface-2); }
.progress-filter-option.is-selected { background: var(--accent-soft); color: var(--ink); font-weight: 700; }
.progress-filter-option-check { flex: 0 0 13px; color: transparent; font-size: var(--text-compact); }
.progress-filter-option.is-selected .progress-filter-option-check { color: var(--accent); }
.progress-filter-empty { margin: 0; padding: 12px 8px; color: var(--faint); font-size: var(--text-xs); text-align: center; }
.progress-filter-popup-count { color: var(--faint); font-size: var(--text-xs); text-align: right; }
.progress-filter-popup-actions { display: flex; justify-content: space-between; gap: 4px; padding: 2px; }
.progress-filter-popup-actions button { min-height: var(--control-sm); padding: 5px 12px; border: 1px solid transparent; border-radius: var(--radius-xs); background: transparent; color: var(--muted); font: var(--text-compact)/1.2 var(--font); font-weight: 600; cursor: pointer; }
.progress-filter-popup-actions button:hover { background: var(--surface-2); color: var(--ink); }
.progress-filter-popup-actions .progress-filter-apply { margin-left: auto; border-color: var(--accent); background: var(--accent); color: var(--on-solid); }
.progress-filter-popup-actions .progress-filter-apply:hover { filter: brightness(.96); color: var(--on-solid); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.table-scroll.progress-table-scroll {
  height: 100%; min-height: 0; overflow: auto;
  border: 0; border-radius: 0; background: transparent;
  scrollbar-width: thin; overscroll-behavior: contain;
}
/* 长编号用悬浮标题查看全值。 */
/* 厂方 2026-10-02：尽量不要左右滑动才能看全。列宽按「字段名一行放得下」精打细算，
   正常笔记本宽度（1366 起）一屏能看完人发 / 化纤两个板块；全厂是并集列，超宽时仍可左右滑。 */
/* 2026-10-03 收口：这条原来分两处声明（一处字号、一处排版），已并成一条 */
table.progress-table { width: 100%; min-width: 0; table-layout: fixed; background: var(--surface); }
/* 内边距必须带 .data-table 前缀才压得住通用规则：`table.data-table tbody td`（10px）比
   `table.progress-table td` 更具体，一直盖在上面——2026-10-02 量出来每格光内边距就吃掉 20px，
   行高 59px、订单号被挤成「HH90-2026…」，根因就是这条（表头内边距早先踩过同一个坑）。
   厂方 2026-10-02 要求「每行高度降低、增加信息密度」：纵向收到 5px，配 30px 的工序按钮。 */
table.data-table.progress-table th, table.data-table.progress-table td { padding: 5px 6px; }
table.progress-table tbody td { font-size: var(--text-body); white-space: nowrap; vertical-align: middle; text-align: center; }
table.progress-table .cell-order-quantity > span { font-size: var(--text-body); }
/* 数字列表头曾经右对齐，厂方 2026-10-02 要求整表居中，已并入下面那条统一规则 */
/* 选择器要比 table.data-table thead th（10px 内边距）更具体，否则内边距被它盖掉，
   表头可用宽度凭空少 12px，字段名就开始省略（踩过） */
table.data-table.progress-table thead th {
  position: sticky; top: 0; z-index: 3;
  background: var(--th-bg); box-shadow: 0 1px 0 var(--line);
  padding: 9px 2px; font-size: var(--text-compact); line-height: 1.3; white-space: nowrap; vertical-align: middle;
  /* 兜底：任何情况下文字都不许越出自己的格子 */
  overflow: hidden;
}
table.progress-table thead th:first-child { left: 0; z-index: 5; }
/* 2026-10-03 收口：字号与排版原来分两处声明，已并成一条 */
table.progress-table tbody td:first-child {
  position: sticky; left: 0; z-index: 2;
  /* 粘性列必须自带不透明底色：整行底色是半透明的，横向滑动时被它盖住的列会透出来叠在一起
     （厂方 2026-10-01 报的 bug：订单号格和后面的字段重叠成一团） */
  background: var(--surface);
  box-shadow: 1px 0 0 var(--line), var(--shadow-sticky);
}
/* 停滞 / 逾期的行底色是半透明色，粘性列换成同色的不透明版本，颜色才不会断层 */


/* 进度表所有列一律居中（厂方 2026-10-01）；数字也用等宽数字对齐，扫一眼就能比大小 */
table.progress-table thead th, table.progress-table tbody td.num { text-align: center; }
table.progress-table .progress-th, table.progress-table .progress-th-trigger { justify-content: center; }
table.progress-table td.cell-order-no .cell-order-contents { justify-content: center; }
/* 列之间的竖线：厂方 2026-10-02 要求「像表格一样」 */
table.progress-table thead th, table.progress-table tbody td { border-right: 1px solid var(--line-soft); }
table.progress-table tbody td:first-child { border-right-color: var(--line); }
table.progress-table thead th:last-child, table.progress-table tbody td:last-child { border-right: 0; }
/* 行底统一为页面白底，生产状态由轻量标签表达，避免分批完成后出现色块断层。 */
table.data-table.progress-table tbody tr.is-waiting-row td { background: var(--surface); }
table.data-table.progress-table tbody tr.is-doing-row td { background: var(--surface); }
table.data-table.progress-table tbody tr.is-done-row td { background: var(--surface); }
/* 停滞 / 逾期只提示对应字段，不再覆盖整行与合并单元格。 */


table.progress-table tbody tr.progress-empty-row td { padding: 18px !important; text-align: center; white-space: normal; }
/* 列数与列序随板块（人发/化纤/全厂）不同，列宽全部按列名列写，不按第几列写死。 */
/* 列宽按「字段值 + 字段名都要完整显示」精算（2026-10-02 用浏览器实测每个字段的真实文字宽：
   订单号 HH90-20260922 要 127px、下单日期 83px、要求出货时间表头 78px…… + 每边 6px 内边距）。
   声明宽度是硬下限：列多到超出一屏时表格直接横滑，不会被压窄到截断文字。 */
/* 默认那套（= 化纤）2026-10-09 按实测**加宽到内容放得下**（厂方：「加宽，要显示完全」）。
   之前这几列常年显示省略号：订单号 XH15LULU-20260104 要 148px、客户 15#（LULU）98px、
   商标印字 QUEEN BEYONCE 125px、品名 YCW-L22105A(原曲发TIKA…) 182px、色号 RTHL4/10B/22/103 135px。
   ⚠️ 代价：化纤整表现在比 1440 屏宽约 200px，**右边要左右滑动**（工序进度后半段与出货数量）；
   齿轮列是 sticky-right，永远点得到。人发那套（下面 [data-board=human_hair]）不受影响、仍然不横滑。 */
table.progress-table th.col-customer, table.progress-table td.col-customer { width: 112px; }
/* 最右边的「字段设置」齿轮列：跟着工序列、固定在右边，横向滚动时不跑掉（厂方 2026-10-02） */
table.progress-table th.col-settings, table.progress-table td.cell-settings {
  position: sticky; right: 0; z-index: 3;
  width: 40px; min-width: 40px; padding: 0; text-align: center;
  background: var(--surface); box-shadow: -1px 0 0 var(--line);
}
table.progress-table thead th.col-settings { z-index: 6; background: var(--th-bg); }
/* 「清除筛选」住在字段行最右这一格（厂方 2026-10-03：原来那条工具行会把它裁掉半截）。
   table-layout: fixed 下列宽由表头定：有筛选时整格加宽，没筛选回到 40px 只放齿轮。 */
table.progress-table thead th.col-settings.is-filtered { width: 132px; min-width: 132px; display: flex; align-items: center; gap: 4px; padding: 0 4px; }
.settings-clear {
  flex: 1 1 auto; min-width: 0; height: var(--control-xs); padding: 0 6px;
  border: 1px solid var(--accent-line); border-radius: var(--radius-xs);
  background: var(--accent-soft); color: var(--accent);
  font: 600 var(--text-xs)/1.2 var(--font); white-space: nowrap; cursor: pointer;
  transition: background-color .15s ease;
}
.settings-clear:hover { background: var(--accent); color: var(--on-solid); }
th.col-settings.is-filtered .table-settings-btn { flex: 0 0 30px; width: 30px; min-height: var(--control-xs); }


.table-settings-btn {
  width: 100%; height: 100%; min-height: var(--control-xs);
  display: grid; place-items: center;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.table-settings-btn svg { width: 16px; height: 16px; }
.table-settings-btn:hover { background: var(--surface-2); color: var(--ink); }
.table-settings-btn[aria-expanded="true"] { color: var(--accent); }

/* 拖表头右边界调列宽（ERP 习惯）：把手贴在格子右内侧，不占版面宽度 */
.col-resizer { position: absolute; top: 0; right: -4px; z-index: 4; width: 9px; height: 100%; cursor: col-resize; }
.col-resizer::after { content: ''; position: absolute; top: 22%; left: 4px; width: 1px; height: 56%; background: transparent; }
.col-resizer:hover::after { background: var(--accent); }
body.is-resizing-column { cursor: col-resize; user-select: none; }
table.progress-table th.col-orderNo, table.progress-table td.col-orderNo { width: 166px; }
table.progress-table td.one-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.progress-table td.one-line > span { display: block; width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.progress-table td.cell-order-no > span { font-variant-numeric: tabular-nums; }
table.progress-table td.cell-order-no .cell-order-contents { display: flex; align-items: center; gap: 4px; min-width: 0; }
/* 单号比列宽时先省略自己（列宽已按「HH90-20260922 完整显示」定死 140px，正常不会再截断） */
table.progress-table td.cell-order-no .cell-order-contents > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.progress-table th.col-orderDate, table.progress-table td.col-orderDate { width: 86px; }
table.progress-table th.col-dueDate, table.progress-table td.col-dueDate { width: 86px; }
table.progress-table th.col-lineStatus, table.progress-table td.col-lineStatus { width: 62px; }
/* 每个列都要在下面写上宽度：table-layout:fixed 下没写宽度的列会被挤成 0，
   字段名就只剩省略号（踩过：数量列没宽度，名字被截成「数量…」） */
table.progress-table th.col-qty, table.progress-table td.col-qty { width: 60px; }
table.progress-table th.col-trademark, table.progress-table td.col-trademark { width: 192px; }
table.progress-table th.col-product, table.progress-table td.col-product { width: 282px; }
table.progress-table th.col-customerStyle, table.progress-table td.col-customerStyle { width: 114px; }
table.progress-table th.col-productType, table.progress-table td.col-productType { width: 64px; }
table.progress-table th.col-color, table.progress-table td.col-color { width: 165px; }
table.progress-table th.col-spec, table.progress-table td.col-spec { width: 72px; }
table.progress-table th.col-remark, table.progress-table td.col-remark { width: 88px; }
table.progress-table td.line-status-cancelled { color: var(--danger); font-weight: 700; }
/* --------------------------------------------------------------------------
   列宽按板块各写一套（2026-10-03，厂方报「两个板块有混合」那轮）：
   人发的字段值短（客户 90#、品名 2221D、类型 13*6、尺寸 20"/110g），
   化纤的值长（客户 15#（LULU）、品名 YCW-L22105A(原曲发TIK…）、色号 RTHL4/10B/22/103）。
   以前两个板块共用一份宽度，两头不讨好：人发这边「尺寸」被挤成 20"/110…、
   整表 1451px 比内容区（1440 屏下 1396px）宽 55px，**第 7 道工序「完成」默认看不见**；
   化纤那边品名/色号又被截（那部分另记，见 HANDOFF）。
   现在人发那套按**实测文字宽度**收紧：整表落进内容区，不用横滑，工序与尺寸都完整。
   宽度都是在浏览器里逐个字段量出来的（14px 正文 + 每边 6px 内边距），不是估的。 */
/* 单号列不能收：浏览器实测「HH90-20260922」要 114px（原宽 132px 刚好），收窄就变成省略号——
   单号是厂方天天念的东西，宁可别处省。 */
table.progress-table[data-board="human_hair"] th.col-orderNo, table.progress-table[data-board="human_hair"] td.col-orderNo { width: 120px; }
table.progress-table[data-board="human_hair"] th.col-orderDate, table.progress-table[data-board="human_hair"] td.col-orderDate { width: 86px; }
table.progress-table[data-board="human_hair"] th.col-customer, table.progress-table[data-board="human_hair"] td.col-customer { width: 58px; }
table.progress-table[data-board="human_hair"] th.col-product, table.progress-table[data-board="human_hair"] td.col-product { width: 58px; }
table.progress-table[data-board="human_hair"] th.col-productType, table.progress-table[data-board="human_hair"] td.col-productType { width: 58px; }
table.progress-table[data-board="human_hair"] th.col-color, table.progress-table[data-board="human_hair"] td.col-color { width: 58px; }
table.progress-table[data-board="human_hair"] th.col-spec, table.progress-table[data-board="human_hair"] td.col-spec { width: 74px; }
table.progress-table[data-board="human_hair"] th.col-qty, table.progress-table[data-board="human_hair"] td.col-qty { width: 58px; }
table.progress-table[data-board="human_hair"] th.col-dueDate, table.progress-table[data-board="human_hair"] td.col-dueDate { width: 90px; }
table.progress-table[data-board="human_hair"] th.col-batch, table.progress-table[data-board="human_hair"] td.col-batch { width: 58px; }
/* 人发七道工序比化纤多一道，工序列要宽一档（408 vs 380）才放得下七个四字名按钮 */
table.progress-table[data-board="human_hair"] th.col-stages, table.progress-table[data-board="human_hair"] td.cell-stages { width: 408px; min-width: 408px; }
table.progress-table[data-board="human_hair"] th.col-status, table.progress-table[data-board="human_hair"] td.cell-status { width: 136px; }
/* 化纤保持厂方看惯的那套宽度不动：它有几处本来就装不下（订单号 XH15LULU-20260104 要 160px、
   色号 RTHL4/10B/22/103 要 83px、商标 QUEEN BEYONCE 要 128px…），全加宽要多 130px 左右的横滑，
   这个取舍留给厂方定，本轮不擅自改。 */
/* table-layout: fixed 只认表头单元格上的宽度，工序列与状态列必须同时写在 th 上 */
/* 工序按钮留够四字工序名（帽皮染色 / 三联机制）一行放得下：6 个按钮 × (46 文字 + 4 内边距) + 5 个 3px 间隙
   （2026-10-09 加了「出货数量」列后按实测把按钮内边距 3→2px、间隙 5→3px 收回来的，四字名仍完整） */
table.progress-table th.col-stages, table.progress-table td.cell-stages { width: 356px; min-width: 356px; }
/* 出货数量列：跟在工序进度（最后一格是「完成」）右边，厂方 2026-10-09：实际数应显示在完成右边。
   宽度按表头「出货数量」四个字定（内容最宽 57px，表头要 65px）。 */
table.progress-table th.col-shipped, table.progress-table td.cell-shipped { width: 68px; min-width: 68px; }
table.progress-table td.cell-shipped { text-align: center; font-variant-numeric: tabular-nums; }
/* 批次列：没分批留空，分批只写「100 件」；状态列要放得下「胶囊 + 工序名 / 分批按钮」一整行 */
table.progress-table th.col-batch, table.progress-table td.col-batch { width: 64px; }
table.progress-table th.col-status, table.progress-table td.cell-status { width: 138px; }
table.progress-table td.cell-status { text-align: left; }
table.progress-table td.cell-status .status { display: inline-flex; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 状态一行写完（厂方 2026-10-01）：胶囊 + 当前工序小字 / 分批按钮，全部并排。
   2026-10-02 两条：①胶囊固定不压缩（「生产中」绝不许被挤成「生产中…」）；
   ②整格内容左对齐——待生产 / 生产中 / 已完工 三个胶囊的起始位置必须完全一致，
   居中会随着后面挂「分批」还是工序名而左右漂移。 */
.cell-status-line { display: inline-flex; align-items: center; justify-content: flex-start; gap: 5px; max-width: 100%; width: 100%; padding-left: 4px; }
/* 胶囊在状态行里：外边距必须是 0（厂方 2026-10-02 第二次报「生产中的位置还是不统一」）——
   通用规则里的 margin: 0 auto 在 flex 行里会「吃掉」剩余空白，后面挂的工序名越短、胶囊被推得越靠右。
   三个状态的胶囊再等宽（min-width 66px）并内部居中，左边缘才能像素级对齐；flex: 0 0 auto 保证它永不被压窄。
   2026-10-03 收口：这三句原来各占一个声明块，已并成一条。 */
.cell-status-line .status { margin: 0; min-width: 66px; justify-content: center; padding: 0 8px; flex: 0 0 auto; }
.cell-status-stage { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--faint); font-size: var(--text-xs); }
/* 分批按钮与胶囊同高（24px）：它比胶囊高就会把整行撑起来，行高降不下来。
   必须带 table.progress-table 前缀——.tiny-action 的最小高度写在文件更靠后的位置，
   同权重下后写的赢，只写 .cell-split-btn 压不住（行高 45 而不是 41，踩过）。 */
/* 分批渲染的「继续显示」：整行一个居中按钮（生产页 694 行一次排完要 240ms，先放 200 行） */
/* 分页条（厂方 2026-10-03：50/100/200 一页可切，不要一次全显示）。订单页放表格下方，生产页贴在滚动区底部。 */
.table-pager {
  flex: 0 0 auto;
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 8px 2px 0; color: var(--muted); font-size: var(--text-compact);
}
.pager-info { color: var(--muted); font-variant-numeric: tabular-nums; }
/* 数字页码（云开品牌规范）：当前页实心品牌色，其余描边；两头用 … 省略 */
.pager-pages { display: inline-flex; align-items: center; gap: 4px; }
.pager-num {
  min-width: var(--control-xs); height: var(--control-xs); padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--radius-xs);
  background: var(--surface); color: var(--ink-2);
  font: inherit; font-size: var(--text-compact); font-variant-numeric: tabular-nums;
}
.pager-num:hover:not(:disabled):not(.is-active) { border-color: var(--brand); color: var(--brand); }
.pager-num.is-active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-hover); font-weight: 600; }
.pager-num:disabled { opacity: .45; cursor: default; }
.pager-ellipsis { padding: 0 2px; color: var(--faint); }
.pager-jump { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pager-jump input {
  width: 56px; min-height: var(--control-xs); padding: 3px 6px; text-align: center;
  border: 1px solid var(--line); border-radius: var(--radius-xs); background: var(--surface); color: var(--ink);
  font: inherit; font-size: var(--text-compact);
}
.pager-size { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pager-size select {
  min-height: var(--control-xs); padding: 3px 6px; font-size: var(--text-compact);
  border: 1px solid var(--line); border-radius: var(--radius-xs); background: var(--surface); color: var(--ink);
}
.table-pager .tiny-action[disabled] { opacity: .45; cursor: default; }
.table-pager .tiny-action[disabled]:hover { border-color: var(--line); color: var(--muted); background: transparent; }

table.progress-table .cell-split-btn { flex: 0 0 auto; min-height: 0; height: var(--pill-h); padding: 0 8px; border-radius: var(--radius-xs); font-size: var(--text-xs); }
table.progress-table th.cell-order-quantity, table.progress-table td.cell-order-quantity { width: 84px; }
table.progress-table td.cell-order-quantity > span { font-size: var(--text-compact); }
table.progress-table td.num.is-overdue { color: var(--danger); font-weight: 700; }
@media (max-width: 767px) {
  .app-shell.is-progress-view { height: auto; min-height: 100vh; overflow: visible; }
  .app-shell.is-progress-view .main-area { display: block; min-height: auto; }
  .content.is-progress-view { height: auto; flex: initial; display: block; }
  .progress-table-body { display: block; min-height: 0; }
  /* 手机端顶栏也保持一致（见上方说明） */
  .content.is-progress-view { padding: var(--content-start-gap) 12px calc(70px + env(safe-area-inset-bottom)); }
  .progress-filter-popup { gap: 9px; padding: 11px; }
  .progress-filter-search { height: var(--control); font-size: var(--text-compact); }
  .progress-filter-options { max-height: min(46vh, 300px); }
  .progress-filter-option { min-height: var(--control); font-size: var(--text-sm); }
  .progress-filter-popup-actions button { min-height: var(--control-nav); font-size: var(--text-sm); }
  .progress-filter-close { width: var(--control-sm); height: var(--control-sm); }
  .progress-toolbar { align-items: flex-start; }
  .table-scroll.progress-table-scroll { max-height: none; overflow-x: auto; overflow-y: visible; }
}
/* 七格工序压成单行；日期和完整状态仍可通过按钮提示查看。
   高度用「小号控件」那一档 34px（厂方 2026-10-02「每行的高度是否能降低，增加信息密度」）：
   行高因此从 59px 收到 45px，按钮还在够点的尺寸里；文字 11.5px 保证四字工序名
   （帽皮染色 / 三联机制）不被吞。 */
.stage-steps { display: flex; gap: 3px; min-width: 0; }
.stage-step {
  flex: 1 1 0; min-width: 0;
  display: flex; align-items: center; justify-content: center;
  height: var(--control-sm); box-sizing: border-box; padding: 0 2px; border: 1px solid var(--line); border-radius: var(--radius-xs);
  background: var(--surface); color: var(--muted); font: inherit;
  text-align: center; cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.stage-step:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.stage-step .step-name { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: var(--text-xs); font-weight: 600; line-height: 1.1; white-space: nowrap; }
.stage-step.is-done { border-color: var(--ok-line); background: var(--ok-soft); color: var(--ok); }
.stage-step.is-ticked { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.stage-step.is-doing { border-color: var(--accent-line); color: var(--accent); }
.stage-step.is-skipped { border-style: dashed; background: var(--surface-3); color: var(--faint); }
.stage-step.is-legacy_done { border-color: var(--violet-line); background: var(--violet-soft); color: var(--violet); }
.stage-step.is-legacy_unknown { border-style: dashed; border-color: var(--warn-line); color: var(--warn); }
.stage-step.is-current { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

/* ==========================================================================
   表格
   ========================================================================== */

.table-scroll { width: 100%; overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: var(--text-body); }
table.data-table thead th {
  background: var(--th-bg); color: var(--muted); font-weight: 650; font-size: var(--text-compact);
  letter-spacing: .02em; text-align: left;
  padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
/* 从订单 / 出货跳过来时的定位高亮：闪两下就停，不常驻（inset 阴影盖在任何底色上都看得见） */
@keyframes progress-row-flash { 0%, 100% { box-shadow: none; } 45% { box-shadow: var(--flash-row); } }
table.data-table tbody tr.is-flash-row td { animation: progress-row-flash 1.1s ease-in-out 2; }
table.data-table tbody td {
  padding: 10px; border-bottom: 1px solid var(--line-soft);
  vertical-align: middle; font-variant-numeric: tabular-nums;
}
table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table tbody tr:hover td { background: var(--surface-2); }
/* 生产表整行已有状态底色：悬停不换底色（见下方按状态的行底色规则） */
.table-main { font-weight: 600; }
.table-muted { display: block; color: var(--faint); font-size: var(--text-xs); font-weight: 400; margin-top: 2px; }
.number-cell { text-align: right; }

/* ==========================================================================
   标签、状态、按钮
   ========================================================================== */

.status { display: inline-flex; align-items: center; height: var(--pill-h); padding: 0 10px; border-radius: var(--radius-pill); font-size: var(--text-sm); font-weight: 650; line-height: 1; white-space: nowrap; }
.status.green { background: var(--ok-soft); color: var(--ok); }
.status.blue { background: var(--accent-soft); color: var(--accent); }
.status.copper { background: var(--warn-soft); color: var(--warn); }
.status.violet { background: var(--violet-soft); color: var(--violet); }
.status.red { background: var(--danger-soft); color: var(--danger); }
.status.ink { background: var(--surface-3); color: var(--muted); }
/* 生产状态三色（厂方 2026-10-02：要显眼、要分得开）：待生产=琥珀、正在生产=蓝、已完工=绿。
   用实心填充 + 白字，远看就能分（三个色与白字的对比度都 ≥4.5）。 */
.status.status-wait { background: var(--surface-2); color: var(--ink-2); box-shadow: none; }
.status.status-doing { background: var(--brand-soft); color: var(--brand-hover); box-shadow: none; }
.status.status-done { background: var(--ok-soft); color: var(--ok); box-shadow: none; }
.subtle-tag { display: inline-flex; align-items: center; height: var(--pill-h); padding: 0 9px; border-radius: var(--radius-pill); background: var(--surface-3); color: var(--muted); font-size: var(--text-xs); }

/* ==========================================================================
   统一控件层（2026-10-01 UI 重构）
   按钮、输入框、下拉只有这一套皮肤，各页面不再各写一份；高度只用三档。
   ========================================================================== */

/* ---- 按钮 ---- */
.primary-btn {
  min-height: var(--control-lg); height: var(--control-lg);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--brand-btn); color: var(--on-brand);
  font-size: var(--text-body); font-weight: 700;
  transition: background-color .15s ease, box-shadow .15s ease;
}
.primary-btn:hover { background: var(--brand-btn-hover); }
.primary-btn:active { box-shadow: var(--shadow-press); }
.ghost-btn {
  min-height: var(--control); height: var(--control);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink-2);
  font-size: var(--text-body); font-weight: 600;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.ghost-btn:hover { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
.tiny-action {
  min-height: var(--control-sm);
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-xs);
  padding: 5px 11px; font-size: var(--text-sm); font-weight: 600; color: var(--muted); white-space: nowrap;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.tiny-action:hover { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
.tiny-action.is-danger:hover { border-color: var(--danger-line); color: var(--danger); background: var(--danger-soft); }
.tiny-action.is-primary { border-color: transparent; background: var(--brand-btn); color: var(--on-brand); }
.tiny-action.is-primary:hover { background: var(--brand-btn-hover); color: var(--on-brand); }
button:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* 文件选择统一中文呈现：原生控件铺满整块但完全透明，选中的文件名写在下面（厂方 2026-10-02 审查：
   导入弹窗和产品图以前都露出浏览器英文按钮） */
.import-drop { position: relative; }
.import-drop input[type="file"], .file-cover input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.import-drop .file-name { display: block; margin-top: 4px; color: var(--accent); font-size: var(--text-xs); word-break: break-all; }
.file-cover { position: relative; display: flex; align-items: center; justify-content: center; min-height: var(--control-lg); padding: 8px 12px; border: 1px dashed var(--line); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-size: var(--text-sm); cursor: pointer; text-align: center; }
.file-cover:hover { border-color: var(--accent-line); color: var(--accent); }

.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 0 2px 12px; }
/* 从总览点数字跳过来时亮出来的「当前条件」，点一下就清除 */
.filter-chip { display: inline-flex; align-items: center; gap: 2px; min-height: var(--control-xs); padding: 3px 10px; border: 1px solid var(--accent-line); border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent); font: 600 var(--text-xs)/1.2 var(--font); cursor: pointer; }
.filter-chip:hover { border-color: var(--accent); }
.filter-chip.is-static { cursor: default; }

/* 字段设置面板（厂方 2026-10-02：像 ERP 一样自由调字段显示与宽度） */
.progress-toolbar-end { margin-left: auto; }
.field-settings {
  position: fixed; z-index: 40; width: min(540px, calc(100vw - 20px)); max-height: min(72vh, 560px); overflow: auto;
  margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); box-shadow: var(--shadow-panel-lg);
}
.field-settings-head { display: flex; align-items: center; gap: 10px; }
.field-settings-head strong { font-size: var(--text-title); }
.field-settings-head button { margin-left: auto; }
.field-settings-note { margin: 6px 0 10px; color: var(--faint); font-size: var(--text-compact); }
.field-settings-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 16px; }
.field-settings-row { display: flex; align-items: center; gap: 8px; font-size: var(--text-compact); font-weight: 500; color: var(--ink-2); }
.field-settings-row input { display: inline-block; width: auto; margin-top: 0; }
.field-settings-row input[type="checkbox"] { flex: 0 0 16px; width: 16px; height: 16px; min-height: 0; }
.field-settings-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field-settings-name em { margin-left: 6px; color: var(--faint); font-size: var(--text-xs); font-style: normal; }
.field-settings-row input[type="number"] { flex: 0 0 76px; min-height: var(--control-sm); padding: 4px 8px; font-size: var(--text-compact); }
.field-settings-unit { color: var(--faint); font-size: var(--text-xs); }

/* 账号管理页三段切换（账号 / 客户 / 车间）：外壳是一根灰轨道，所以选中那颗是**浅蓝底 + 品牌色细圈**——
   轨道本身就是 --surface-2，纯浅蓝底在里面几乎看不见（同明度），真正让它跳出来的是那圈描边 + 深蓝字。
   这里用 inset box-shadow 而不是 border：标签本来是 border:0，加 border 会把轨道挤宽 2px。
   划过底从 --surface-2 改成 --surface-3——轨道就是 --surface-2，原来的划过色等于没划过。 */
.admin-tabs {
  display: flex; gap: 2px; width: fit-content; margin-bottom: 14px; padding: 3px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2);
}
.admin-tab {
  min-height: var(--control-xs); padding: 0 18px; border: 0; border-radius: var(--radius-xs);
  background: transparent; color: var(--muted); font: inherit; font-size: var(--text-compact); font-weight: 600; cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.admin-tab:hover:not(.is-active) { background: var(--surface-3); color: var(--ink); }
.admin-tab.is-active { background: var(--brand-soft); color: var(--brand-hover); font-weight: 600; box-shadow: inset 0 0 0 1px var(--brand); }

/* ---- 输入框 / 下拉 / 文本域：全站唯一皮肤 ---- */
input[type="text"], input[type="search"], input[type="date"], input[type="month"], input[type="number"], input:not([type]),
input[type="password"], input[type="email"], input[type="tel"], select, textarea {
  box-sizing: border-box; max-width: 100%; min-height: var(--control);
  padding: 8px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background-color: var(--surface); color: var(--ink);
  font-family: var(--font); font-size: var(--text-body); font-weight: 400; line-height: 1.35;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { resize: vertical; line-height: 1.6; }
select {
  padding-right: 34px; appearance: none; cursor: pointer; text-overflow: ellipsis;
  /* 下拉箭头用内联 SVG，不引外部资源 */
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 14px 14px;
}
select[multiple] { padding-right: 11px; appearance: auto; background-image: none; cursor: default; }
select[multiple] option { padding: 3px 5px; }
input[type="text"]:hover, input[type="search"]:hover, input[type="date"]:hover, input[type="month"]:hover, input[type="number"]:hover, input:not([type]):hover,
input[type="password"]:hover, input[type="email"]:hover, input[type="tel"]:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input[type="text"]:focus, input[type="search"]:focus, input[type="date"]:focus, input[type="month"]:focus, input[type="number"]:focus, input:not([type]):focus,
input[type="password"]:focus, input[type="email"]:focus, input[type="tel"]:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: var(--ring); outline: none; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:disabled, select:disabled, textarea:disabled { background-color: var(--surface-2); color: var(--faint); cursor: not-allowed; }
.api-filter { display: inline-flex; align-items: center; gap: 8px; font-size: var(--text-compact); color: var(--muted); font-weight: 600; white-space: nowrap; }

/* 产品资料：以可快速查找的紧凑行表为主，图片只承担识别作用。 */
.product-toolbar { align-items: end; }
.product-toolbar .api-filter:first-child { min-width: min(320px, 100%); }
.product-toolbar input[type="search"] { width: min(340px, 100%); margin-top: 0; }
.product-count { margin-left: auto; }
.product-thumb { display: grid; width: var(--thumb); height: var(--thumb); place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-xs); background: var(--surface-2); color: var(--faint); font-size: var(--text-xs); }
.product-thumb img { width: 100%; height: 100%; object-fit: contain; }
.product-thumb.is-empty { border-color: transparent; background: transparent; }
.product-code { padding: 3px 6px; border-radius: var(--radius-xs); background: var(--surface-2); color: var(--muted); font: var(--text-xs)/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.product-table td { white-space: nowrap; }
.matrix-product-review select { display: block; width: min(100%, 320px); margin-top: 6px; }
.matrix-product-review { margin: 12px 0 8px; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.matrix-product-heading { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.matrix-product-heading strong { font-size: var(--text-compact); }
.matrix-product-variants { color: var(--faint); font-size: var(--text-compact); }
.matrix-product-summary { display: flex; gap: 14px; margin: 4px 0 7px; color: var(--muted); font-size: var(--text-xs); }
.matrix-product-scroll { max-height: 225px; overflow: auto; }
.matrix-product-scroll td { vertical-align: top !important; }
.matrix-product-variants { min-width: 160px; max-width: 280px; white-space: normal !important; line-height: 1.5; }
@media (max-width: 640px) {
  .admin-tabs { overflow-x: auto; padding-bottom: 3px; }
  .admin-tab { flex: 0 0 auto; padding-inline: 14px; }
  .product-toolbar { align-items: stretch; }
  .product-toolbar .api-filter:first-child { min-width: 100%; }
  .product-count { margin-left: 0; }
  .product-table { min-width: 760px; }
  .matrix-product-heading { align-items: flex-start; flex-direction: column; gap: 2px; }
  .matrix-product-scroll { max-height: 260px; }
  .matrix-product-scroll table { min-width: 620px; }
}

.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-row { display: grid; grid-template-columns: minmax(0, 1.5fr) auto auto; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.alert-row.is-danger { border-color: var(--danger-line); background: var(--danger-soft); }
.alert-row .alert-main { min-width: 0; }
.alert-row .alert-main strong { font-size: var(--text-sm); }
@media (max-width: 767px) { .alert-row { grid-template-columns: 1fr; } }

/* ==========================================================================
   表单（弹窗内）
   ========================================================================== */

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 14px; }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: span 1; } }
label { display: block; font-size: var(--text-compact); color: var(--muted); font-weight: 600; }
label input, label select, label textarea { display: block; width: 100%; margin-top: 6px; font-size: var(--text-body); font-weight: 400; }
/* 字段正下方的即时说明（例如订单号被占用、系统会自动接续）。空的时候不占位置，免得表单跳动 */
.field-warning { display: block; margin: 6px 0 0; padding: 6px 9px; border-radius: var(--radius-xs); border: 1px solid var(--warn-line); background: var(--warn-soft); color: var(--warn); font-size: var(--text-xs); font-weight: 400; line-height: 1.55; }
.field-warning:empty { display: none; }
/* 表单标签下的控件皮肤见「统一控件层」 */
label input[type="file"] { padding: 6px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.checkbox-label input { width: auto; margin: 0; }
.form-help { margin: 6px 0 0; color: var(--faint); font-size: var(--text-xs); line-height: 1.6; font-weight: 400; }
/* 账号表单的「选一项」区块（2026-10-05 账号页改版）：能看哪些数据 / 能做什么，都是单选卡片。
   每张卡一行标题 + 一行人话说明——权限的差别靠说明写清楚，不靠让人猜「生产管理」和「仓库」有什么不一样。 */
.choice-fieldset { margin: 14px 0 0; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.choice-fieldset legend { padding: 0 6px; font-size: var(--text-sm); font-weight: 700; color: var(--muted); }
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 720px) { .choice-grid { grid-template-columns: 1fr; } }
.choice-card {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto;
  align-items: center; gap: 2px 8px;
  padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
/* 悬停只是"浅一档的中性底"，**选中**才用品牌浅底（--brand-soft）。
   以前两者都用 --brand-soft，悬停和选中长得一样；这轮把 --surface-3 从暖米色改成中性色之后，
   正好把这两个状态分开：悬停 = 中性，选中 = 品牌色，选中的辨识度反而更高。 */
.choice-card:hover { border-color: var(--line-strong); background: var(--surface-2); }
.choice-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice-card:has(input:disabled) { cursor: not-allowed; opacity: .55; background: var(--surface-2); }
.choice-card input { grid-row: 1 / span 2; width: auto; margin: 0; }
.choice-title { font-size: var(--text-body); font-weight: 650; color: var(--ink); }
.choice-note { grid-column: 2; font-size: var(--text-xs); color: var(--muted); line-height: 1.5; }
/* ---- 账号弹窗（2026-10-06 改版）：三列表单、能力开关、凭据卡 ---- */
.form-grid.is-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.is-two-narrow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; }
.password-input-wrap { position: relative; display: block; margin-top: 6px; }
.password-input-wrap input { width: 100%; margin-top: 0; padding-right: 66px; }
.password-input-toggle {
  position: absolute; top: 50%; right: 7px; transform: translateY(-50%);
  min-width: 44px; min-height: var(--control-xs); padding: 3px 7px; border: 0; border-radius: var(--radius-xs);
  background: transparent; color: var(--accent); font: 600 var(--text-xs)/1.2 var(--font); cursor: pointer;
}
.password-input-toggle:hover { background: var(--surface-3); color: var(--brand-hover); }
/* 输入框下面挂一个动作按钮（生成密码）：用空 span 占住"标签"那一行，按钮才和输入框齐平 */
.field-inline-action { display: flex; flex-direction: column; gap: 5px; }
.field-inline-action .ghost-btn { height: var(--control); align-self: start; }   /* 别被列宽拉成一大条 */
/* 常用组合卡：紧凑一点，6 张两行排满（原来 5 张 3+2，第二行空一格显得没做完） */
.choice-grid.is-presets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice-grid.is-presets .choice-card { padding: 8px 10px; }
.choice-grid.is-presets .choice-note { min-height: 0; }
/* 能力细调：五个小开关，一排能放下 */
.cap-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cap-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: var(--control-sm); padding: 0 11px;
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--muted);
  font-size: var(--text-compact); font-weight: 600; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.cap-chip:hover { border-color: var(--line-strong); background: var(--surface-3); color: var(--ink); }
.cap-chip.is-on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-hover); }
.cap-chip input { width: auto; margin: 0; accent-color: var(--brand); }
/* 凭据卡：设完密码那一次把它摆出来，一键复制成"账号 + 密码"两行，方便直接发给使用者 */
.credential-card { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.credential-row { display: flex; align-items: center; gap: 10px; }
.credential-key { flex: 0 0 36px; color: var(--muted); font-size: var(--text-compact); font-weight: 600; }
.credential-row code { font-size: var(--text-title); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
/* 预览态顶部提示条：实心琥珀 + 白字（对比度 ≥4.5，和「待生产」胶囊同一支色），必须显眼 */
.impersonate-bar {
  position: sticky; top: 0; z-index: 35;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 16px;
  background: var(--warn); color: var(--on-solid);
  font-size: var(--text-compact); font-weight: 700;
}
.impersonate-dot { width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--on-solid); }
.impersonate-text { font-weight: 700; }
.impersonate-sub { font-weight: 500; opacity: .9; }
.impersonate-bar .ghost-btn { margin-left: auto; height: var(--control-xs); border-color: transparent; background: var(--on-solid); color: var(--warn); font-weight: 700; }
.impersonate-bar .ghost-btn:hover { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.choice-tip { margin: 9px 0 0; font-size: var(--text-sm); color: var(--muted); }
.choice-extra { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 14px; margin-top: 11px; }
@media (max-width: 720px) { .choice-extra { grid-template-columns: 1fr; } }

/* 账号列表里的「能看的数据」：板块是实心小标签，客户 / 车间名单是描边小标签。
   一眼扫过去先看到的是板块——「这个账号看不看得到化纤」是厂方最常确认的事。 */
.scope-cell { display: flex; flex-wrap: wrap; gap: 4px; max-width: 320px; }
.scope-tag {
  display: inline-flex; align-items: center; height: var(--pill-h); padding: 0 9px;
  border-radius: var(--radius-pill); font-size: var(--text-xs); font-weight: 600;
  background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.scope-tag.is-all { background: var(--brand); color: var(--on-brand); }
.scope-tag.is-narrow { background: transparent; border: 1px solid var(--line); }
.scope-tag.is-none { background: var(--warn-soft); color: var(--warn); }
.user-table-scroll { min-width: 0; }
.user-table { min-width: 760px; }
.user-table td[data-label] { white-space: normal; }
@media (max-width: 640px) {
  .form-grid.is-three, .form-grid.is-two-narrow { grid-template-columns: 1fr; }
  .choice-grid.is-presets { grid-template-columns: 1fr; }
  .user-table-scroll { overflow: visible; border: 0; }
  .user-table { width: 100%; min-width: 0; border-collapse: separate; border-spacing: 0 10px; }
  .user-table thead {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  .user-table tbody { display: grid; gap: 10px; }
  .user-table tbody tr {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px;
    padding: 8px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
  }
  .user-table tbody td { min-width: 0; padding: 7px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
  .user-table tbody td::before {
    display: block; margin-bottom: 4px; color: var(--muted); font-size: var(--text-xs); font-weight: 600;
    content: attr(data-label);
  }
  .user-table tbody td:first-child, .user-table tbody td:nth-child(2), .user-table tbody td:nth-child(3),
  .user-table tbody td.master-ops { grid-column: 1 / -1; }
  .user-table tbody td.master-ops { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; border-bottom: 0; }
  .user-table tbody td.master-ops::before { flex: 0 0 100%; }
}
.form-note { display: flex; gap: 9px; padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--accent-line); border-radius: var(--radius-sm); background: var(--accent-soft); }
.form-note strong { display: block; font-size: var(--text-sm); color: var(--accent); }
.form-note p { margin: 3px 0 0; font-size: var(--text-xs); color: var(--muted); line-height: 1.6; }
.form-note span { color: var(--accent); }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 34px 16px; overflow-y: auto;
  background: var(--scrim);
}
.modal { width: min(880px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); overflow: hidden; }
/* 弹窗头与页面头同一套语言（2026-10-06 厂方：「新建账号弹出的 ui 需要再和系统统一一下，现在有点生硬」）：
   小眉题 + **宋体大标题** + 品牌短线。原来这里是一个加粗黑体标题、和页面大标题不是一套。 */
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px 12px; border-bottom: 1px solid var(--line-soft); }
.modal-title { margin: 0; color: var(--ink); font-family: var(--font-display); font-size: var(--text-num); font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
.modal-rule { display: block; width: 28px; height: 3px; margin-top: 7px; border-radius: var(--radius-2xs); background: var(--brand); }
.modal-close { border: none; background: transparent; font-size: var(--text-num); line-height: 1; color: var(--faint); padding: 2px 6px; border-radius: var(--radius-xs); }
.modal-close:hover { background: var(--surface-3); color: var(--ink); }
.eyebrow { margin: 0 0 3px; font-size: var(--text-xs); font-weight: 700; letter-spacing: .12em; color: var(--faint); text-transform: uppercase; }
.modal-form { padding: 18px 20px 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.modal-form > label, .modal-form > .form-help, .modal-form > .form-grid, .modal-form > .form-note, .modal-form > .credential-card { margin-top: 12px; }
details.stage-section { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
details.stage-section summary { cursor: pointer; font-size: var(--text-sm); font-weight: 700; color: var(--muted); }
details.stage-section > *:not(summary) { margin-top: 10px; }

/* ==========================================================================
   登录、提示条、toast
   ========================================================================== */

/* 登录页（2026-10-04 对照 UI 拆解图 11 优化）*/
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--bg);
}

/* 登录卡沿用参考图的左右分区。品牌区的线束用内联 SVG 绘制，不依赖外部素材。 */
.auth-card {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.auth-cover {
  position: relative;
  isolation: isolate;
  min-height: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* 品牌块垂直居中（2026-10-06 优化：原来贴顶，中间空出一大片、底部又挤在一起） */
  justify-content: center;
  overflow: hidden;
  padding: 36px 34px 30px;
  background: linear-gradient(155deg, var(--surface-3) 0%, var(--surface-2) 100%);
}

/* 视觉重心比几何中心略高（人眼习惯）：居中之后再往上抬 15px，底部留给波纹 */
.auth-cover-brand { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 30px; }
.auth-cover-logo { width: 96px; height: 96px; object-fit: contain; }
/* 登录页品牌标题也走同一支思源宋体（原来写的是 "Songti SC"/"STSong" 这两个 **macOS 专有**名字，
   厂里 Windows 上会掉到系统默认宋体 SimSun、而 SimSun 没有 600 字重，大字号下又细又散）。
   字重 600 → 700：与页面大标题用同一档，也是厂方选的那一档。 */
.auth-cover-title { margin: 16px 0 0; color: var(--ink); font-family: var(--font-display); font-size: var(--text-hero); font-weight: 700; letter-spacing: .035em; }
.auth-cover-tagline { margin: 13px 0 0; color: var(--brand); font-family: var(--font-display); font-size: var(--text-body); letter-spacing: .32em; }
.auth-cover-sub { margin: 10px 0 0; color: var(--muted); font-size: var(--text-xs); letter-spacing: .12em; }
.auth-fiber-art {
  position: absolute; z-index: 0; left: -8%; bottom: -6%; width: 116%; height: 50%;
  color: var(--brand); opacity: .2; pointer-events: none;
  /* 由下往上淡出：波纹往封面底边自然收掉，不留一条硬边 */
  -webkit-mask-image: linear-gradient(to top, transparent 2%, black 42%);
  mask-image: linear-gradient(to top, transparent 2%, black 42%);
}
.auth-fiber-art path { fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; }
.auth-fiber-art path.is-highlight { stroke: var(--surface); stroke-width: 2; opacity: .9; }

.auth-panel { display: grid; place-items: center; margin: 18px; padding: 0; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.auth-panel-content { width: min(100%, 370px); padding: 38px 34px; }
/* 品牌横线（.auth-panel-accent）2026-10-07 随文案改版撤掉：表单上方改欢迎语「欢迎登录」，横线连同两条规则一起删。 */

/* 底部安全说明：一句事实 + 一把锁（规范里的登录页脚注） */
.auth-security { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line-soft); color: var(--faint); font-size: var(--text-sm); }
.auth-security .ic { width: 14px; height: 14px; }

@media (max-width: 767px) {
  .auth-gate { padding: 12px; }
  .auth-card { width: min(460px, 100%); grid-template-columns: minmax(0, 1fr); }
  .auth-cover { min-height: 112px; padding: 15px 20px; align-items: stretch; justify-content: center; }
  .auth-cover-brand { display: grid; grid-template-columns: 58px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left; }
  .auth-cover-logo { grid-row: 1 / 3; width: 58px; height: 58px; }
  .auth-cover-title { grid-column: 2; grid-row: 1; margin: 0; font-size: var(--text-title); line-height: 1.35; }
  .auth-cover-tagline { grid-column: 2; grid-row: 2; margin: 4px 0 0; font-size: var(--text-xs); letter-spacing: .1em; }
  .auth-cover-sub { display: none; }
  .auth-fiber-art { left: 0; bottom: -57%; width: 100%; height: 145%; opacity: .13; }
  .auth-panel { margin: 0; padding: 0 14px 14px; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; }
  .auth-panel-content { width: 100%; padding: 24px 10px 18px; }
  .auth-security { margin-top: 15px; padding-top: 12px; }
}

/* 标题 */
.auth-card h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: var(--text-num); /* 标题稍大一些 */
  font-weight: 700;
  letter-spacing: -.02em;
}

/* 副标题/提示 */
.auth-intro {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: var(--text-sm);
}

/* 表单 */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px; /* 增加间距 */
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--ink-2);
  font-size: var(--text-compact);
  font-weight: 600;
}

.auth-form input {
  height: var(--control-touch); /* 标准输入框高度 */
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-body);
  transition: border-color .2s ease, box-shadow .2s ease;
}

.auth-form input::placeholder {
  color: var(--faint);
}

/* 输入框前置图标（规范里的「带图标输入框」）。用内联 SVG 当背景图，不改 DOM、不引图标库；
   # 必须写成 %23，否则会被设计令牌守卫当成裸色值拦下。 */
.auth-form input[name="username"],
.auth-form input[name="displayName"],
.auth-form input[name="password"] {
  padding-left: 38px;
  background-repeat: no-repeat;
  background-position: 12px center;
  background-size: 16px 16px;
}

.auth-form input[name="username"],
.auth-form input[name="displayName"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8.4' r='3.6'/%3E%3Cpath d='M5 20c0-3.4 3.1-5.9 7-5.9s7 2.5 7 5.9'/%3E%3C/svg%3E");
}

.auth-form input[name="password"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4.5' y='10' width='15' height='10' rx='2'/%3E%3Cpath d='M8 10V7.5a4 4 0 0 1 8 0V10'/%3E%3C/svg%3E");
}

.auth-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* 登录按钮 - 使用品牌棕色 */
.auth-submit {
  height: var(--control-xl); /* 规范里的登录按钮 48px 档 */
  margin-top: 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--brand); /* 界面主色（2026-10-06 起是靛蓝 #2563EB） */
  color: var(--on-brand);
  font: inherit;
  font-size: var(--text-body);
  font-weight: 600;
  cursor: pointer;
  transition: background-color .2s ease, transform .1s ease;
}

.auth-submit:hover {
  background: var(--brand-hover);
}

.auth-submit:active {
  transform: scale(0.98);
}

.auth-submit:disabled {
  background: var(--surface-2);
  color: var(--muted);
  cursor: not-allowed;
}

/* 错误提示 */
.auth-note {
  min-height: 16px;
  margin: 12px 0 0;
  color: var(--danger);
  font-size: var(--text-sm);
}


.toast-region { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { min-width: 220px; max-width: 360px; padding: 11px 13px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-pop); pointer-events: auto; }
/* 点工序的确认提示压成一行：一句「已完成：美容」+ 一个文字按钮，不占地方（厂方 2026-10-02） */
.toast.is-compact { display: flex; align-items: center; gap: 10px; min-width: 0; width: fit-content; max-width: 340px; padding: 8px 12px; border-radius: var(--radius-sm); }
.toast.is-compact strong { font-size: var(--text-compact); white-space: nowrap; }
.toast.is-compact .toast-action { margin: 0 0 0 auto; padding: 3px 9px; }
.toast-action { margin-top: 7px; padding: 3px 10px; border: 1px solid var(--accent-line); border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent); font: inherit; font-size: var(--text-xs); font-weight: 600; cursor: pointer; }
.toast-action:hover { border-color: var(--accent); }
.toast strong { display: block; font-size: var(--text-sm); }
.toast small { display: block; margin-top: 3px; color: var(--faint); font-size: var(--text-xs); line-height: 1.5; }

.import-actions { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.order-template-links { display: flex; gap: 14px; margin-bottom: 8px; }
.order-template-links .text-link { font-size: var(--text-xs); }

.import-order-confirm { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.import-order-confirm div { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.import-order-confirm span { display: block; color: var(--muted); font-size: var(--text-xs); }
.import-order-confirm strong { display: block; margin-top: 3px; font-size: var(--text-title); font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .import-order-confirm { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.import-warning-list { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.import-warning { padding: 8px 11px; border-radius: var(--radius-sm); font-size: var(--text-xs); line-height: 1.6; border: 1px solid var(--warn-line); background: var(--warn-soft); color: var(--warn); }
.import-warning.green { border-color: var(--ok-line); background: var(--ok-soft); color: var(--ok); }
.import-detail-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--faint); font-size: var(--text-xs); }
.import-line-flagged td { background: var(--warn-soft); }
.import-line-note { margin-top: 3px; color: var(--warn); font-size: var(--text-xs); }
.import-line-table { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.synthetic-import-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 12px 0 8px; }
.synthetic-import-kpis > div { min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.synthetic-import-kpis span { display: block; color: var(--muted); font-size: var(--text-xs); }
.synthetic-import-kpis strong { display: block; margin-top: 3px; color: var(--ink); font-size: var(--text-body); font-variant-numeric: tabular-nums; }
.synthetic-import-summary { display: flex; flex-wrap: wrap; gap: 7px 14px; align-items: center; padding: 9px 2px; color: var(--muted); font-size: var(--text-xs); }
.synthetic-import-summary strong { color: var(--ink); font-size: var(--text-xs); }
.synthetic-import-section { margin-top: 8px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); color: var(--muted); }
.synthetic-import-section > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 2px; cursor: pointer; font-size: var(--text-sm); font-weight: 700; }
.synthetic-import-section > summary span { color: var(--faint); font-size: var(--text-xs); font-weight: 500; }
.synthetic-import-section .table-scroll { max-height: 250px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-xs); margin: 0 0 9px; }
.synthetic-import-section .data-table { font-size: var(--text-xs); }
.synthetic-import-section .data-table th, .synthetic-import-section .data-table td { padding: 6px 8px; }
.synthetic-import-lines { max-height: 380px !important; }
.synthetic-import-issues { max-height: 300px !important; }
.synthetic-import-section select, .synthetic-import-section input[type="date"], .synthetic-import-section input[type="number"] { min-width: 140px; }
.synthetic-import-confirm { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0 10px; padding: 9px 11px; border: 1px solid var(--accent-line); border-radius: var(--radius-xs); background: var(--accent-soft); color: var(--ink); font-size: var(--text-xs); font-weight: 500; line-height: 1.55; }
.synthetic-import-confirm input[type="checkbox"] { flex: 0 0 auto; width: auto; margin: 2px 0 0; }
.synthetic-import-footnote { margin-top: 10px; color: var(--faint); font-size: var(--text-xs); }
.qty-input { width: 84px; }
.rename-input { width: 100%; max-width: 200px; }

.audit-disclosure { margin-top: 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); }
.audit-disclosure > summary { padding: 9px 2px; cursor: pointer; font-size: var(--text-sm); font-weight: 600; }
.audit-disclosure-body { padding: 0 0 10px; }

@media (max-width: 640px) {
  .synthetic-import-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .synthetic-import-kpis strong { font-size: var(--text-compact); }
  .synthetic-import-summary { gap: 6px 10px; }
  .modal-form:has(.synthetic-import-kpis) { padding: 12px 10px; }
}

/* ==========================================================================
   第4轮：首页「今天要做什么」——提示条 + 要交的货大行 + 客户履约卡片
   ========================================================================== */
/* 客户两列表格、工序横向路线；精确数量始终可读。 */
.customer-ranking { max-height: 288px; overflow-y: auto; }
.customer-quantity-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: var(--text-body); }
.customer-quantity-table th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); text-align: left; padding: 8px 16px; }
.customer-quantity-table th:last-child { width: 35%; text-align: right; }
.customer-quantity-table td { height: var(--control-data); padding: 0 16px; border-bottom: 1px solid var(--line-soft); }
.customer-quantity-table tr:hover { background: var(--surface-2); }
.customer-name { display: block; width: 100%; min-height: var(--control-data); padding: 6px 0; border: 0; background: transparent; color: var(--accent); font: inherit; text-align: left; cursor: pointer; }
.customer-name:focus-visible, .customer-ranking:focus-visible, .stage-flow:focus-visible, .shipment-timeline:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.quantity-name { min-width: 0; overflow-wrap: anywhere; font-size: var(--text-body); }
.quantity-value { text-align: right; font-size: var(--text-body); font-variant-numeric: tabular-nums; white-space: nowrap; }
.quantity-value small { color: var(--muted); font-size: var(--text-sm); font-weight: 400; }
.stage-flow { min-width: 0; overflow-x: auto; padding: 16px 12px; }
.stage-flow ol { display: flex; align-items: stretch; gap: 20px; margin: 0; padding: 0; list-style: none; }
.stage-node { position: relative; flex: 1 0 76px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; padding: 12px 6px; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); background: var(--surface-2); text-align: center; }
.stage-node + .stage-node::before { content: '→'; position: absolute; left: -19px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.stage-node .quantity-value { text-align: center; }
.overview-stage-caption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 10px 12px 0; font-size: var(--text-compact); }
.overview-stage-caption span { color: var(--muted); font-size: var(--text-sm); }
.overview-section.is-zoomed .customer-ranking { max-height: none; }
.overview-section.is-zoomed .overview-stage-list { grid-template-columns: minmax(0, 1fr); }
.overview-head-links { display: inline-flex; align-items: center; gap: 10px; }
.shipment-timeline { overflow-x: auto; padding: 8px 12px 0; }
.shipment-timeline svg { display: block; width: 100%; }
.timeline-grid line { stroke: var(--line-soft); stroke-dasharray: 3 3; }
.timeline-grid text, .timeline-date { fill: var(--muted); font-size: var(--text-xs); }
.timeline-bar { fill: var(--accent); }
.timeline-hit { fill: transparent; }
.timeline-value { fill: var(--accent); font-size: var(--text-xs); font-weight: 600; }
.timeline-tip { fill: var(--ink); font-size: var(--text-xs); opacity: 0; }
.timeline-day:hover .timeline-tip, .timeline-day:focus .timeline-tip { opacity: 1; }
.timeline-day:focus { outline: none; }
.timeline-day:focus .timeline-hit { stroke: var(--accent); stroke-width: 2; }

@media (max-width: 767px) {
  .customer-name { min-height: var(--control-touch); }
  .customer-quantity-table td { height: var(--control-touch); }
  .overview-stage-list { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .overview-kpi { animation: none; } button.overview-kpi { transform: none; } }

/* 最近出货的时间段筛选（今日 / 最近 7 天 / 最近 30 天 / 自定义） */
.overview-range { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px 0; }
.overview-range button {
  min-height: var(--control-xs); padding: 3px 12px; border: 1px solid var(--line); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--muted); font: 600 var(--text-xs)/1.2 var(--font); cursor: pointer;
}
.overview-range button:hover { border-color: var(--accent-line); color: var(--accent); }
.overview-range button.is-active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-hover); font-weight: 600; }
.overview-range-custom { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: var(--text-sm); }
.overview-range-custom label { display: inline-flex; align-items: center; gap: 5px; }
.overview-range-custom input[type="date"] {
  height: var(--control-xs); padding: 2px 8px; border: 1px solid var(--line); border-radius: var(--radius-xs);
  background: var(--surface); color: var(--ink); font: var(--text-xs)/1.2 var(--font);
}
.overview-range-custom input[type="date"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.overview-range-total { margin-left: auto; color: var(--ink-2); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.overview-shipment-date { color: var(--muted); font-variant-numeric: tabular-nums; }
.overview-shipment-more { padding: 8px 0 2px; color: var(--muted); font-size: var(--text-xs); }

/* 工序积压条：条更粗、字更大（工厂屏幕远看也能读） */
.overview-shipment-row { font-size: var(--text-body); }
.overview-shipment-row strong { font-size: var(--text-title); }

/* ==========================================================================
   第5轮：订单页——大字号、待交数字突出
   （原来的「每单一条绿色进度条」2026-10-09 按厂方要求撤掉：「已发几成」改挂待交格的悬浮说明）
   ========================================================================== */
table.orders-table tbody td { font-size: var(--text-body); padding-top: 14px; padding-bottom: 14px; }
table.orders-table tbody td .text-link { font-size: var(--text-title); font-weight: 700; }
table.orders-table tbody td .table-muted { display: block; margin-top: 2px; font-size: var(--text-sm); }
table.orders-table .order-row-customer { font-size: var(--text-body); font-weight: 600; }
table.orders-table td.num { font-size: var(--text-title); font-variant-numeric: tabular-nums; }
table.orders-table td.order-open-qty { display: flex; flex-direction: column; align-items: center; gap: 6px; }
table.orders-table td.order-open-qty strong { font-size: var(--text-num); line-height: 1; color: var(--warn); }
table.orders-table td.order-open-qty:not(:has(strong)) { font-size: var(--text-title); }
.order-batch-chip .batch-tag { font-size: var(--text-sm); }

/* ==========================================================================
   第6轮：出货页——大数字摘要卡 + 大字号记录行
   （摘要卡与时间段的规则已并到文件上方那两条里，这里只留第6轮新增的）
   ========================================================================== */
.shipment-summary .overview-kpi { min-height: 88px; }
.shipment-rows { display: grid; }
/* 出货页的查找条件（厂方 2026-10-02 审查：要能找其它月份或某张订单） */
.shipments-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; padding: 0 2px 12px; }
.shipments-toolbar input[type="month"] {
  min-height: var(--control); padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: var(--text-body)/1.2 var(--font);
}
.shipments-toolbar input[type="month"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* 记录可展开：整行是按钮，展开后下面补来源明细与「去看这张订单」 */
.shipment-row { border-bottom: 1px solid var(--line-soft); }
.shipment-row-head {
  display: grid; grid-template-columns: 78px minmax(0, 1fr) auto auto; align-items: center; gap: 14px;
  width: 100%; padding: 13px 14px; border: 0; background: transparent;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.shipment-row-head:hover, .shipment-row.is-open .shipment-row-head { background: var(--surface-2); }
.shipment-row-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.shipment-row-detail { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 22px; padding: 2px 14px 13px 106px; }
.shipment-detail-field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.shipment-detail-field span { color: var(--muted); font-size: var(--text-xs); }
.shipment-detail-field strong { font-size: var(--text-body); font-variant-numeric: tabular-nums; }
.shipment-detail-lines { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: var(--text-xs); }
.shipment-row-detail .tiny-action { margin-left: auto; }
.shipment-row:last-child { border-bottom: 0; }
.shipment-row-date { display: flex; flex-direction: column; }
.shipment-row-date strong { font-size: var(--text-title); font-variant-numeric: tabular-nums; }
.shipment-row-date span { color: var(--muted); font-size: var(--text-sm); }
.shipment-row-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.shipment-row-main strong { font-size: var(--text-title); }
.shipment-row-main span { color: var(--muted); font-size: var(--text-compact); }
.shipment-row-qty strong { font-size: var(--text-num); font-variant-numeric: tabular-nums; }
.shipment-row-qty span { margin-left: 4px; color: var(--muted); font-size: var(--text-sm); }
@media (max-width: 1050px) { .shipment-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } .shipment-period { grid-column: 1 / -1; justify-content: flex-start; } }

/* ==========================================================================
   第7轮：导入向导（三步编号 + 大投放区 + 人话读到的内容）
   ========================================================================== */
.import-steps { display: grid; gap: 12px; }
.import-step { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.import-step .step-no { width: var(--control-sm); height: var(--control-sm); display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--accent); color: var(--on-solid); font-size: var(--text-title); font-weight: 700; }
.import-step-body { display: grid; gap: 9px; min-width: 0; }
.import-step-body > strong { font-size: var(--text-title); }
.import-step-body > p { margin: 0; color: var(--muted); font-size: var(--text-compact); line-height: 1.6; }
.import-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 96px;
  border: 2px dashed var(--accent-line); border-radius: var(--radius); background: var(--accent-soft);
  color: var(--accent); font-size: var(--text-title); font-weight: 600; cursor: pointer;
}
.import-drop:hover { background: var(--accent-soft-strong); }
.import-drop-icon { font-size: var(--text-num); line-height: 1; }
.import-drop input[type="file"] { max-width: 100%; }
.import-drop input[type="file"]::file-selector-button {
  min-height: var(--control-lg); margin-right: 12px; padding: 0 18px; border: 0; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--on-solid); font: inherit; font-size: var(--text-title); font-weight: 700; cursor: pointer;
}
.import-step-body textarea { min-height: 96px; font-size: var(--text-compact); }

.import-readout { display: grid; gap: 4px; margin-bottom: 12px; padding: 14px 16px; border: 1px solid var(--accent-line); border-radius: var(--radius); background: var(--accent-soft); }
.import-readout strong { font-size: var(--text-title); color: var(--ink); }
.import-readout span { font-size: var(--text-body); color: var(--muted); }
.import-readout-warn { color: var(--warn) !important; font-weight: 700; }
.import-readout-ok { color: var(--ok) !important; font-weight: 700; }

/* ==========================================================================
   第8轮：手机/平板——生产表在窄屏变卡片，工序按钮换行成大按钮，不再需要横滑
   ========================================================================== */
@media (max-width: 767px) {
  table.progress-table { width: 100% !important; min-width: 0 !important; table-layout: auto; }
  table.progress-table thead { display: none; }
  table.progress-table, table.progress-table tbody, table.progress-table tr, table.progress-table td { display: block; width: auto !important; min-width: 0 !important; }
  table.progress-table tbody tr {
    margin: 0 0 12px; padding: 12px 13px; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface); box-shadow: var(--shadow-card);
  }
  table.data-table.progress-table tbody td { padding: 3px 0; border: 0; text-align: left; }
  table.progress-table tbody td:first-child { position: static; box-shadow: none; }
  table.progress-table tbody td[data-label] { display: flex; align-items: baseline; gap: 8px; font-size: var(--text-body); }
  table.progress-table tbody td[data-label]::before {
    flex: 0 0 66px; content: attr(data-label); color: var(--muted); font-size: var(--text-sm);
  }
  table.progress-table td.cell-customer { font-size: var(--text-title); font-weight: 700; }
  table.progress-table td.cell-customer::before { display: none; }
  table.progress-table td.cell-order-no { margin-bottom: 6px; }
  table.progress-table td.cell-order-no::before { display: none; }
  table.progress-table td.cell-order-no .cell-order-contents { display: flex; align-items: center; gap: 6px; }
  table.progress-table td.cell-stages { width: 100% !important; padding-top: 10px; }
  table.progress-table td.cell-stages::before { display: none; }
  table.progress-table .stage-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
  table.progress-table .stage-step { height: var(--control-tap); border-radius: var(--radius-sm); }
  /* 手机生产页：筛选 / 字段设置 / 次要字段开关（桌面隐藏的那套在这里显示） */
  .mobile-progress-tools { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 2px 10px; }
  /* 桌面那条工具行（状态分档 + 车间 + 隐藏已完工）在手机上不出现：
     这些东西手机工具行里都有一份（筛选面板里的状态下拉、隐藏已完工勾选框），
     两份并排会重复，而且 390px 一排放不下 */
  .progress-toolbar { display: none; }
  .mobile-progress-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; padding: 0 2px 10px; }
  /* 次要字段默认收起，突出订单号 / 件数 / 批次 / 状态 / 工序（厂方 2026-10-02 审查） */
  table.data-table.progress-table tbody td[data-minor] { display: none; }
  table.data-table.progress-table.is-all-fields tbody td[data-minor] { display: flex; align-items: baseline; gap: 8px; font-size: var(--text-body); }
  .field-settings { max-width: calc(100vw - 20px); }
  table.progress-table .stage-step .step-name { font-size: var(--text-body); }
  table.progress-table td.cell-status { margin-bottom: 4px; }
  table.progress-table td.cell-status::before { display: none; }
  table.progress-table th.col-settings, table.progress-table td.cell-settings { display: none; }
  table.progress-table td.order-open-qty { flex-direction: row; align-items: baseline; }
  /* 订单页在手机上整行为卡片，避免横向滑动 */
  table.orders-table thead { display: none; }
  table.orders-table, table.orders-table tbody, table.orders-table tr, table.orders-table td { display: block; width: auto !important; }
  /* 桌面用的 min-width:840px 不放开，卡片会被撑成 840 宽、手机上还得横着拖——正是这段注释要避免的事 */
  table.orders-table { min-width: 0; }
  /* height:38px 是给桌面表格单元格的行高；手机整行变卡片后它成了硬高度，
     展开的明细（比 38px 高）会溢出去压在下一张单上——这里必须放开成 auto */
  table.orders-table tbody td { padding: 3px 0; border: 0; display: flex; align-items: baseline; gap: 8px; text-align: left; height: auto; }
  table.orders-table tbody tr { margin-bottom: 12px; padding: 12px 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
  /* 卡片上没有表头，数字必须自带名字（10 / 3 / 7 分不清是下单还是待交）。
     58px 是按最长的一个字段名「要求交期」（4 个字 × 12.5px）定的——窄了它会折成两行，
     标签一折行、同一张卡片里几行值的左边缘就参差不齐。
     （原来是 78px，那是给「要求出货日期」六个字的；2026-10-09 改叫「要求交期」后收回 58px） */
  table.orders-table tbody tr.order-list-row td[data-label]::before { flex: 0 0 58px; content: attr(data-label); color: var(--muted); font-size: var(--text-sm); }
  /* 不用挂标签的三格：订单号（第一行）、状态胶囊（自己说得清）、客户（就是名字）。
     状态列 2026-10-09 挪到订单号后面，所以这里从「最后一格」改成按列名认。 */
  table.orders-table tbody tr.order-list-row td:first-child::before,
  table.orders-table tbody tr.order-list-row td.col-order-status::before,
  table.orders-table tbody tr.order-list-row td.order-row-customer::before { display: none; }
  table.orders-table tbody tr.order-list-row td.order-open-qty { flex-direction: row; align-items: baseline; }
  /* 展开的明细行在手机上不做卡片：整块左右滑动，明细本身保持「一条一行」 */
  table.orders-table tbody tr.order-detail-row { margin: 0 0 12px; padding: 0; border: 0; border-radius: 0 0 var(--radius) var(--radius); background: var(--surface-2); }
  table.orders-table tbody tr.order-detail-row > td { display: block; padding: 0 !important; height: auto; }
  .shipment-row { grid-template-columns: 64px minmax(0, 1fr); row-gap: 6px; }
  .shipment-row-qty { grid-column: 2; }
  .due-row { grid-template-columns: 66px minmax(0, 1fr); row-gap: 6px; }
  .due-qty, .due-state { grid-column: 2; }
}

/* 第9轮：空状态给一句「下一步做什么」和按钮 */
.api-empty-action { margin-top: 12px; }
.api-empty strong { font-size: var(--text-title); }
.api-empty p { max-width: 460px; margin: 6px auto 0; font-size: var(--text-body); line-height: 1.7; }

/* ==========================================================================
   资料板块（客户 / 车间 / 产品）—— 2026-10-03 改版
   厂方三条：把藏在「⋯」里的都拿出来、2 个板块分开管理、极简好操作但核心内容不能缺。
   三页共用一套版式：卡片标题 + 右上一个主按钮 + 一张 4 列的窄表。
   2026-10-06：页内的「人发 / 化纤」大标签拆掉——板块由侧栏那个开关统一切，这三页只管当前板块。
   ========================================================================== */

/* 车间页顶上那条待分配提示：数字来自只读计数接口 /api/workshop-load，不拉整包生产进度 */
.pending-bar {
  display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 10px 14px;
  border: 1px solid var(--warn-line); border-radius: var(--radius-sm); background: var(--warn-soft);
  color: var(--warn); font-size: var(--text-body); font-weight: 600;
}
.pending-bar.is-clear { border-color: var(--ok-line); background: var(--ok-soft); color: var(--ok); }
.pending-bar .pending-go { margin-left: auto; }

/* 资料表：列少、数字右对齐、操作列贴右边；一行只有一个「主链接」 */
.master-table td, .master-table th { vertical-align: middle; }
.master-table .master-ops-head { width: 1%; text-align: right; }
.master-table .master-ops { text-align: right; white-space: nowrap; }
.master-table .master-ops .tiny-action + .tiny-action, .master-table .master-ops .row-more-wrap { margin-left: 6px; }
.master-table .master-name { font-weight: 650; color: var(--ink); }
.master-table .master-name:hover { color: var(--accent); text-decoration: underline; }
.master-table td.table-main .table-muted { display: block; margin: 2px 0 0; }
.master-table .master-overdue { color: var(--danger); font-weight: 650; }
.master-table tr.master-row-inactive { background: var(--surface-2); }
.master-table tr.master-row-inactive td.table-main { color: var(--faint); }
/* 产品行的缩略图与名字同格：没图时那格本身就是上传入口（虚线框「＋加图」） */
.master-product { display: flex; align-items: center; gap: 10px; }
.product-thumb.is-upload {
  display: flex; flex-direction: column; gap: 1px;
  border: 1px dashed var(--line-strong); background: var(--surface-2);
  color: var(--faint); font-size: var(--text-xs); font-weight: 650; cursor: pointer;
}
.product-thumb.is-upload:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.product-thumb.is-upload .thumb-plus { font-size: var(--text-body); line-height: 1; }

/* 表单里的「可后补」折叠区：必填之外的字段都收在这里，别让新表单一眼看到五六个输入框 */
.form-folding { margin: 10px 0 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.form-folding > summary { padding: 9px 12px; color: var(--muted); font-size: var(--text-body); font-weight: 600; cursor: pointer; }
.form-folding > summary:hover { color: var(--ink); }
.form-folding > label, .form-folding > .file-cover, .form-folding > .form-help { display: block; margin: 0 12px 10px; }
/* 表单底部那句「将建到「人发」板块」：板块由当前标签决定，但要让操作的人看见，不静默 */
.board-hint { margin-top: 12px; padding: 8px 11px; border-radius: var(--radius-xs); background: var(--surface-2); color: var(--muted); font-size: var(--text-sm); }
.board-hint b { color: var(--ink); }

/* 资料页行内「⋯」弹出的低频操作 */
.master-more-list { display: grid; gap: 8px; margin-bottom: 4px; }
.ghost-btn.is-block { width: 100%; justify-content: center; }
.row-more-wrap { display: inline-block; }

/* ==========================================================================
   顶栏布局（2026-10-07）：左侧栏整条撤掉，导航回到顶栏
   ========================================================================== */

/* 页签：横向一行，一个页签一颗胶囊；内容多的时候靠 `.topbar-nav` 自己横滑。
   2026-10-07 厂方「顶部各板块前面不要图标了」→ 页签只有文字（原来的图标 + gap 8px 都去掉）。
   好处不只是"素净"：8 个页签一次省下约 170px 横向空间，1280 那档原来只剩约 100px 余量。 */
.nav-item {
  flex: 0 0 auto;
  display: flex; align-items: center;
  min-height: var(--control-nav);
  padding: 0 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: var(--text-body);
  font-weight: 400;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}

.nav-item:hover:not(.is-active) {
  background: var(--surface-3);
  color: var(--ink);
}

/* 选中态：和采购工作台同一套语言（浅蓝底 + 深蓝字 + 字重 600）。
   ⚠️ 侧栏那版还有一根**左侧 3px 竖条**；页签横向排之后那根竖条没有位置了，
   所以这里靠**底色 + 字色 + 字重三处同时变**撑住"一眼看出选中"——
   三处缺一处就会退化成 2026-10-01 那个"看不出来"的老毛病。 */
.nav-item.is-active {
  background: var(--brand-soft);
  color: var(--brand-hover);
  font-weight: 600;
}

.nav-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 导航分隔线（工作板块 vs 资料板块）：横向排之后是一条**竖线**，不是横线 */
.nav-sep {
  flex: 0 0 auto;
  width: 1px;
  height: 20px;
  margin: 0 6px;
  background: var(--line);
}

/* Logo 区域：2026-10-05 厂方「四周留白偏多」——上下内边距 12 → 6、左右 8 → 4，
   图片上限 60 → 80 → 68px（厂方 2026-10-06：「又有点太大了，调整小一点」）；logo.png 本身也已经按内容重新裁过，四周只留 6px 透明边。 */
/* 板块切换（两个并列胶囊：人发 / 化纤）。
   2026-10-07 厂方「点击显示效果还是没有和采购工作台同步到」→ 选中态从**实心靛蓝块**改成采购工作台那一套：
   浅蓝底（--brand-soft）+ 描边用品牌色 + 深蓝字（--brand-hover）+ 字重 600。
   未选中态同时从白底改成透明——白底落在有色底的容器上比选中态还"跳"，
   会和"哪个是选中的"打架；透明之后只有选中那个带颜色。
   划过仍用中性令牌（--surface-3），不用彩色底——和 2026-10-06 那条"划过中性、选中才上色"一致。 */
.division-pill {
  height: var(--control-sm);
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: var(--text-body);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.division-pill:hover:not(.is-active) { border-color: var(--line-strong); background: var(--surface-3); color: var(--ink); }
.division-pill.is-active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-hover); font-weight: 600; }
.division-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 页面内容区：各板块共用同一条起始线，减少切页时的松紧跳变。 */
.main-area {
  flex: 1 1 auto;
  position: relative;
  overflow-x: auto;
}

.app-shell.is-progress-view .main-area {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.content {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: var(--content-start-gap) var(--content-padding) 40px;
}

.content.is-progress-view {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: var(--content-start-gap) var(--content-padding) 10px;
}

.content:focus { outline: none; }

/* 平板顶栏可能放不下全部页签：保留横滑，同时显出滚动条让溢出可见。 */
@media (min-width: 768px) and (max-width: 960px) {
  .topbar { gap: 8px; padding-inline: 10px; }
  .topbar-brand { padding-right: 8px; }
  .topbar-division { gap: 4px; padding-right: 8px; }
  .division-pill { padding-inline: 8px; }
  .topbar-right { gap: 6px; padding-left: 8px; }
  .nav-item { padding-inline: 7px; }
  .topbar-nav { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
  .topbar-nav::-webkit-scrollbar { display: block; height: 4px; }
  .topbar-nav::-webkit-scrollbar-thumb { border-radius: var(--radius-pill); background: var(--line-strong); }
}

/* 手机端响应式：顶栏只留 logo + 板块切换 + 账号，页签交给底部横条 */
@media (max-width: 767px) {
  :root {
    --topbar-h: 54px;
    --logo-h: 30px;   /* 顶栏矮了，logo 跟着小一档（桌面 34px） */
    --content-start-gap: 12px;
  }

  .topbar {
    padding: 0 12px;
    gap: 8px;
  }

  .topbar-brand { padding-right: 8px; }

  /* 手机端页签在底部那条横条里（#mobile-nav），顶栏这一行放不下 8 项也不该挤 */
  .topbar-nav { display: none; }

  .topbar-division { flex: 1 1 auto; padding-right: 0; border-right: none; }
  .division-pill { height: var(--control-xs); padding: 0 10px; font-size: var(--text-compact); }

  .topbar-right { padding-left: 8px; }
  .header-account { max-width: 130px; }

  .content {
    padding: var(--content-start-gap) 12px calc(92px + env(safe-area-inset-bottom));
  }
}

/* 原生控件保留提交与校验契约，月份 / 日期 / 单选浮层统一使用页面主题。 */
.control-picker { position: fixed; z-index: 10000; overflow: auto; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop); font-size: var(--text-body); }
.control-picker button { font: inherit; border: 0; background: transparent; color: inherit; border-radius: var(--radius-sm); cursor: pointer; min-height: var(--control-sm); padding: 6px 8px; }
.control-picker button:hover { background: var(--surface-2); color: var(--ink); }
.control-picker button.is-active { background: var(--brand-soft); color: var(--brand); }
.control-picker button:disabled { color: var(--faint); cursor: not-allowed; background: transparent; }
.control-picker button.is-selected { background: var(--brand); color: var(--surface); font-weight: 700; }
.control-picker button.is-today { box-shadow: inset 0 0 0 1px var(--brand); }
.control-picker-options { display: grid; gap: 2px; }
.control-picker-option { display: flex; justify-content: space-between; align-items: center; text-align: left; gap: 12px; overflow-wrap: anywhere; }
.control-picker-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 8px; }
.control-picker-grid, .control-picker-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.control-picker-grid.is-month { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.control-picker-week { color: var(--muted); font-size: var(--text-sm); padding: 4px 0 8px; }
.control-picker-footer { display: flex; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 6px; color: var(--brand); }

/* 分批关系在数量列表达；同一明细保持统一底色，异常只在对应字段提示。 */
table.data-table.progress-table tbody tr:hover td { background: var(--surface-2); }
table.progress-table td.cell-batch.is-linked { position: relative; padding-left: 18px; }
table.progress-table td.cell-batch.is-linked::before { content: ''; position: absolute; left: 8px; top: -1px; bottom: -1px; border-left: 2px solid var(--accent-line); }
table.progress-table td.cell-batch.is-linked::after { content: ''; position: absolute; left: 8px; width: 8px; top: 50%; border-top: 2px solid var(--accent-line); }
table.progress-table td.cell-batch[data-batch-link="first"]::before { top: 50%; }
table.progress-table td.cell-batch[data-batch-link="last"]::before { bottom: 50%; }
@media (max-width: 767px) {
  table.progress-table td.cell-batch.is-linked { padding-left: 0; }
  table.progress-table td.cell-batch.is-linked::after { display: none; }
  table.progress-table td.cell-batch.is-linked::before { content: '分批'; position: static; border: 0; color: var(--muted); }
}

/* ============================================================ 产品搜索选择器
   厂方 2026-10-08：「产品只能下拉一个一个看着选择比较麻烦，需要能搜索」。
   零依赖组合框：文本框 + 浮层。选项行用 padding 撑高度、不写字面高度——
   设计令牌守卫会把 22–48px 那个区间的字面量判成「裸控件高度」。 */
.product-combo { position: relative; display: block; }
.product-combo .combo-input {
  width: 100%;
  min-height: var(--control);
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-body);
}
.product-combo .combo-input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
/* 手工建单里的「＋ 新建产品」（厂方 2026-10-09）：全站只有一个弹窗容器（#entity-modal），
   在订单表单里再开一层弹窗会把订单表单顶掉，所以就地展开一行——填个品名就能建，建好立刻选中。
   内部编码系统生成、状态「待确认」，资料以后去「产品」页补。 */
/* 「＋ 新建产品」按钮要浮在产品浮层（z-index 40）之上：浮层是往下展开的，正好盖住这颗按钮，
   不这样点不到（线上库副本实测）——浮层开着也要求点得到，点了先把浮层收掉。 */
.product-new-open { position: relative; z-index: 45; }
.product-inline-new { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.product-inline-new input { display: inline-block; width: auto; flex: 1 1 180px; min-width: 0; margin-top: 0; }
.product-inline-new .form-help { flex: 1 1 100%; margin: 0; }
.product-inline-new .text-link { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: var(--text-sm); cursor: pointer; }
.product-combo .combo-panel {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 260px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop);
  padding: 4px;
}
.product-combo .combo-panel[hidden] { display: none; }
.product-combo .combo-option {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--ink);
  font-size: var(--text-compact);
  text-align: left;
  cursor: pointer;
}
.product-combo .combo-option small { color: var(--muted); font-size: var(--text-xs); }
/* 「按这个名字新建产品」：跟「已有产品」那一列区分开——.combo-option 的语义是已有产品，
   「搜不到产品时有没有把无关产品摆出来」那条老断言靠的就是它。 */
.product-combo .combo-new-product { display: flex; flex-direction: column; gap: 2px; width: 100%; margin-top: 2px; padding: 7px 10px; border: 0; border-top: 1px dashed var(--line); background: transparent; color: var(--brand-hover); font: inherit; font-size: var(--text-compact); text-align: left; cursor: pointer; }
.product-combo .combo-new-product small { color: var(--muted); font-size: var(--text-xs); }
.product-combo .combo-new-product:hover { background: var(--brand-soft); }
.product-combo .combo-option:hover,
.product-combo .combo-option.is-active { background: var(--brand-soft); color: var(--brand-hover); }
.product-combo .combo-option[aria-selected="true"] { box-shadow: inset 2px 0 0 var(--brand); }
.product-combo .combo-empty { padding: 10px; color: var(--muted); font-size: var(--text-compact); }

/* ============================================================ 样品单（2026-10-08 新增页签） */
.sample-summary { display: flex; gap: 18px; margin: 0 0 10px; color: var(--muted); font-size: var(--text-compact); }
.sample-summary b { color: var(--ink); font-size: var(--text-title); }
.sample-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; color: var(--muted); font-size: var(--text-compact); }
.sample-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.sample-timeline li { position: relative; padding-left: 14px; border-left: 2px solid var(--line-soft); }
.sample-timeline li::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}
.sample-timeline .timeline-when,
.sample-timeline .timeline-who { margin-left: 8px; color: var(--muted); font-size: var(--text-xs); }
.sample-timeline p { margin: 4px 0 0; color: var(--ink-2); font-size: var(--text-compact); }

/* ============================================================ 订单：展开明细下的动作条 / 编辑表单 */
.order-detail-actions { display: flex; gap: 8px; margin-top: 10px; }
.order-edit-lines { margin-top: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.order-edit-head,
.order-edit-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(90px, 1fr) minmax(150px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
}
.order-edit-head { background: var(--th-bg); color: var(--muted); font-size: var(--text-xs); }
.order-edit-row { border-top: 1px solid var(--line-soft); font-size: var(--text-compact); }
.order-edit-sku small { display: block; color: var(--muted); font-size: var(--text-xs); }
.order-edit-row input {
  width: 100%;
  min-height: var(--control-sm);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  padding: 0 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-compact);
}

@media (max-width: 767px) {
  .sample-summary { gap: 12px; }
  .order-edit-head { display: none; }
  .order-edit-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .order-edit-sku { grid-column: 1 / -1; }
}
