:root {
  --brand-primary: #0076fe;
  --brand-hover: #0069e6;
  --brand-active: #005bc7;
  --action-primary: #006de8;
  --brand-soft: #eaf3ff;
  --brand-border: #b8d7ff;
  --focus-ring: rgba(0, 118, 254, 0.28);
  --color-disabled: #aab3bc;
  /* 统一设计令牌（主界面/数据统计/车间工作台共用同一套灰阶、字号、圆角、控件高度） */
  --border: #d9dee7;
  --line: #d9dee7;
  --line-soft: #e9edf2;
  --surface: #ffffff;
  --surface-muted: #f6f8fa;
  --text: #252a33;
  --text-secondary: #606a78;
  --text-muted: #8a919d;
  --muted: #8a919d;
  --bg: #f5f6f8;
  --row-hover: rgba(17, 24, 39, .075);   /* 行悬停叠加层（2026-11-27 统一，约等于 #ededed） */
  --row-zebra: #f8f9fb;                  /* 极浅斑马纹（2026-11-28 用户拍板） */
  --font-title: 20px;
  --font-section: 16px;
  --font-body: 14px;
  --font-meta: 13px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --control-height: 32px;
}

* { box-sizing: border-box; }

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

.container { max-width: 960px; margin: 32px auto; padding: 0 20px; }
body.page-dashboard { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
.page-dashboard .container {
  flex: 1;
  min-height: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.page-dashboard .page-toolbar { flex-shrink: 0; }
/* 主界面工具栏：按钮/输入框统一 32px（见 .btn / .toolbar-search 基类） */
.page-dashboard .col-panel { flex-shrink: 0; }
.page-dashboard .table-scroll { flex: 1; min-height: 0; overflow: auto; }
.page-dashboard .table-footer { flex-shrink: 0; }
/* 主界面操作提示（如：删除被拦的订单） */
.flash-notice { flex-shrink: 0; padding: 10px 14px; margin: 0 0 12px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 6px; color: #b91c1c; font-size: 14px; }

/* 设置页：统一字号 14px（只作用于内容区，不动顶部导航栏） */
body.page-settings .container, body.page-settings .container * { font-size: 14px; }
/* 设置页：按钮/标签统一 32px（见 .btn / .settings-tab 基类） */
/* 设置页：横向铺满（桌面版全屏布局，左右只留少量边距） */
body.page-settings .container { max-width: none; margin: 24px; padding: 0; }
/* 设置页表格：勾选列窄列居中 */
body.page-settings th.row-select, body.page-settings td.row-select { width: 32px; text-align: center; padding: 6px 4px; }
/* 设置页表格表单：取消 360px 宽度限制，让表格横向铺满（表头横排而非竖排）。
   后加的设置页（房门/饰面/门店/门店价/其他）2026-10-27 前漏在名单外，表格缩在左边；
   大板页（2026-11-03 加）同样漏名单——2026-11-05 用户反馈列拥挤才补上。
   门店五金价页（#shop-metal-save-form，2026-11-05 加）第三次犯同一病——新表单页
   上线时对照本名单逐 id 核对。 */
body.page-settings #price-save-form,
body.page-settings #metal-save-form,
body.page-settings #craft-save-form,
body.page-settings #door-save-form,
body.page-settings #facing-save-form,
body.page-settings #sheet-price-save-form,
body.page-settings #shop-save-form,
body.page-settings #shop-price-save-form,
body.page-settings #shop-metal-save-form,
body.page-settings #other-save-form { max-width: none; }
/* 设置页内联编辑表格：table-layout:fixed 固定列宽，避免海量行（700+）输入时重排列宽，
   导致卡顿并打断中文输入法（IME）组合 */
body.page-settings /* 设置价格表序号列（2026-10-28）：首格空 td 由 counter 就地编号，增删行自动重排 */
.price-edit-table { counter-reset: rowno; }
.price-edit-table tbody tr { counter-increment: rowno; }
.price-edit-table tbody td.rowno::before { content: counter(rowno); color: #94a3b8; min-width: 2.2em; display: inline-block; text-align: center; }
/* 序号列整体上下/左右居中（2026-10-30 用户反馈：行高时序号偏上偏左——
   ::before 只居中数字块自身，块在单元格里靠左+基线对齐，门店价本行高时肉眼可见） */
body.page-settings .price-edit-table tbody td.rowno { text-align: center; vertical-align: middle; }
.price-edit-table th.col-rowno { width: 3em; }
.price-edit-table { table-layout: fixed; width: 100%; }
/* 分档弹窗（挂在 body 上吃不到 .container 的字号规则，2026-10-30 用户拍板）：
   整卡 14px、一行数据一行（nowrap）；表格 auto 布局不跟价格表 fixed 走 */
#tier-overlay .tier-table { table-layout: auto; width: auto; }
#tier-overlay input { font-size: 14px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 3px; }
/* 分档弹窗操作区（2026-10-30 用户拍板）：加一档靠左，取消/确定右对齐 */
#tier-overlay .tier-footer { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
#tier-overlay .tier-footer-sp { flex: 1 1 auto; }
/* 行操作（2026-10-30 二次反馈：箭头几乎看不见、按钮比输入框低一截）：
   实心小方按钮（深描边+灰底+深色粗字，▲▼ 比 ↑↓ 粗壮），与输入框垂直居中对齐 */
#tier-overlay .tier-table td { vertical-align: middle; }
#tier-overlay .tier-table input { vertical-align: middle; }
#tier-overlay .tier-ops { white-space: nowrap; text-align: right; }
#tier-overlay .tier-op { display: inline-block; vertical-align: middle; min-width: 26px; height: 26px;
  padding: 0 6px; margin-left: 4px; line-height: 24px; font-size: 14px; font-weight: 700;
  color: #334155; background: #f1f5f9; border: 1px solid #94a3b8; border-radius: 4px; cursor: pointer; }
#tier-overlay .tier-op:hover { background: var(--brand-soft); border-color: var(--brand-primary); color: var(--brand-primary); }
#tier-overlay .tier-op-del { color: #d92d20; border-color: #f87171; background: #fef2f2; font-weight: 600; }
#tier-overlay .tier-op-del:hover { background: #fee2e2; border-color: #d92d20; color: #d92d20; }
body.page-settings .price-edit-table input { padding: 4px 8px; width: 100%; font-size: 14px; box-sizing: border-box; }
body.page-settings .price-edit-table td { padding: 4px 6px; }
/* 表头行统一水平+垂直居中（2026-10-28 序号列后用户反馈：全局 th 左对齐 vs 序号数字
   居中看着不齐；只限设置页，成员/审计/平台页复用本表格类不受影响），表体数据列不动 */
body.page-settings .price-edit-table th { white-space: nowrap; text-align: center; vertical-align: middle; }
/* 五金价格表「米+按数量」行内警示（2026-10-28 方案1）：实际按长度计价的黄徽章 */
body.page-settings .mtrap-badge { display: inline-block; margin-left: 4px; padding: 0 6px;
  border-radius: 999px; font-size: 12px; color: #92400e; background: #fef3c7; user-select: none; }
/* 行内保存成功的即时反馈（2026-10-28）：行绿底一闪 */
body.page-settings .price-edit-table tr.row-just-saved td { animation: rowflash 1.2s ease-out; }
@keyframes rowflash { from { background: #dcfce7; } to { background: transparent; } }
/* 编辑中的行整行淡蓝高亮（2026-10-29 用户反馈：行多时找不着正在编辑的行）：
   tr[data-edit="1"] 由 editRow 置位，取消/行内保存成功后移除；「添加」与一键建行
   的新行天生编辑态，同样高亮（未保存新行一眼可辨）。九张设置价格页共用本表类 */
body.page-settings .price-edit-table tr[data-edit="1"] td { background: #dbeafe; }
/* 价格库行悬停/录入中高亮走统一的「行叠加层」规则（见 #main-table td 之后总块，
   2026-11-27 拍板撤掉 2026-10-30 的「点击行浅黄锚点」方案）。 */
/* .chk 勾选组：框和文字同行（通用规则，2026-11-12 起不只价格表内）。
   全局 label{display:flex;flex-direction:column} 会把文字压到框下方，全局 input 的
   10px 内边距又撑大框——两处都显式盖掉。平台管理「只看活跃」「开通」曾因只写了
   .price-edit-table 作用域而上下叠行。 */
.chk label { display: inline-flex; flex-direction: row; gap: 0; align-items: center; white-space: nowrap; }
.chk input[type="checkbox"] { width: 14px; height: 14px; padding: 0; margin-right: 4px; }
/* 板件类型勾选组（板材/门店价两页共用）：一行放下。上面 input 的 width:100% 会把
   复选框也撑成整列宽（一框一行）——价格表作用域内再盖一次 */
body.page-settings .price-edit-table .chk label { display: inline-flex; flex-direction: row; gap: 0; align-items: center; white-space: nowrap; }
body.page-settings .price-edit-table .chk input[type="checkbox"] { width: 14px; height: 14px; padding: 0; margin-right: 4px; }

/* 设置页价格库：搜索框（页眉内联）+ 分页条 */
body.page-settings .settings-search {
  display: flex; flex-direction: row; align-items: center; gap: 8px;
  max-width: none; margin: 0;
}
body.page-settings .settings-search input {
  width: 200px; height: 32px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 4px; font-size: 14px;
}
body.page-settings .pagination {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--muted);
}
body.page-settings .pagination .range-link { font-size: 13px; color: var(--brand-primary); }
body.page-settings .pagination .range-link.muted { color: var(--muted); border-color: transparent; }

/* 板材页：视口内固定布局 —— 页眉工具栏、表格内部滚动、保存按钮固定右下角 */
body.page-prices { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
body.page-prices .topbar { flex-shrink: 0; }
body.page-prices .container {
  flex: 1; min-height: 0; max-width: none; margin: 0;
  padding: 12px 24px; display: flex; flex-direction: column;
}
body.page-prices .settings-header { flex-shrink: 0; }
body.page-prices .card.price-panel {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  margin-top: 0; padding: 0; overflow: hidden;
}
body.page-prices .price-panel-head { flex-shrink: 0; padding: 0 16px; border-bottom: 1px solid var(--border); }
body.page-prices .price-panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 16px; }
body.page-prices .price-panel-foot {
  flex-shrink: 0; display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 16px; border-top: 1px solid var(--border);
}
/* 界面页脚：保存/取消 固定在视口底部，横跨整个界面（容器外），对全部设置页统一 */
body.page-prices .page-footer {
  flex-shrink: 0; display: flex; justify-content: flex-end; align-items: center;
  gap: 8px; padding: 12px 24px; border-top: 1px solid var(--border);
  background: #fff;
}
body.page-prices .page-footer .footer-actions { display: flex; align-items: center; gap: 8px; }
/* 分页条靠左，保存/取消靠右（无分页条的其他设置页则整体靠右，保持一致） */
body.page-prices .page-footer .pagination { margin-right: auto; }
/* 设置页底部新增表单：横排、可换行 */
body.page-prices .add-form {
  display: flex; flex-direction: row; align-items: center; flex-wrap: wrap;
  gap: 8px; max-width: none; margin: 0;
}
body.page-prices .add-form input { padding: 4px 8px; }
/* 计价规则表单：紧凑、分组布局（数字字段网格 + 异形计价单行横排） */
body.page-prices .rules-form { max-width: none; gap: 20px; }
body.page-prices .rules-form .rules-grid {
  display: flex; flex-wrap: wrap; gap: 12px 32px;
}
body.page-prices .rules-form .field {
  display: flex; flex-direction: row; align-items: center; gap: 8px; font-size: 14px;
}
body.page-prices .rules-form .field-label {
  font-size: 13px; white-space: nowrap; text-align: left;
}
body.page-prices .rules-form .rules-grid .field-label { width: 180px; flex-shrink: 0; }
body.page-prices .rules-form .field input { width: 100px; padding: 8px 10px; }
/* 保存后需刷新已打开报价页的防呆提示（2026-10-27 用户把两轨口径误当不一致） */
body.page-prices .rules-hint { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
body.page-prices .rules-form .accurate-block {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 24px;
  padding-top: 16px; border-top: 1px solid var(--border);
}
body.page-prices .rules-form .accurate-block > .field-label { flex-shrink: 0; }
body.page-prices .rules-form .field.inline {
  display: flex; flex-direction: row; align-items: center; gap: 6px;
}
body.page-prices .rules-form .accurate-block input[type="radio"] {
  width: auto; padding: 0; border: 0; margin: 0;
}
/* 公司信息表单：字段布局 + 收款二维码选择 */
body.page-prices .company-form { max-width: 720px; gap: 20px; }
body.page-prices .company-form .company-row { display: flex; flex-wrap: wrap; gap: 16px 40px; }
body.page-prices .company-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline; font-size: 13px; color: var(--muted); margin: 0 0 16px; }
body.page-prices .company-meta strong { color: var(--text); font-weight: 600; }
body.page-prices .company-form .inline-field { flex-direction: row; align-items: center; gap: 8px; }
body.page-prices .company-form .inline-field input { width: 240px; }
body.page-prices .company-form .field { gap: 6px; }
body.page-prices .company-form textarea {
  resize: vertical; font-size: 14px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 6px; font-family: inherit; box-sizing: border-box;
}
body.page-prices .qr-field { display: flex; flex-direction: row; align-items: flex-start; gap: 16px; }
body.page-prices .qr-label { font-size: 14px; white-space: nowrap; padding-top: 4px; }
body.page-prices .qr-main { display: flex; flex-direction: column; gap: 6px; }
/* 单框：占位文字、图片、＋/－ 控件全部收在同一个 120px 框里；
   空态虚线框居中放大 ＋，有图时图片铺满、＋/－ 缩为右下角浮层 */
body.page-prices .qr-box {
  position: relative; width: 120px; height: 120px; box-sizing: border-box; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
}
body.page-prices .qr-box.qr-empty { border-style: dashed; border-color: var(--brand-primary); }
body.page-prices .qr-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; padding: 6px; box-sizing: border-box;
}
body.page-prices .qr-placeholder { color: var(--muted); font-size: 13px; text-align: center; padding: 0 10px; }
body.page-prices .qr-actions { display: flex; gap: 6px; z-index: 1; }
body.page-prices .qr-box:not(.qr-empty) .qr-actions { position: absolute; right: 4px; bottom: 4px; }
body.page-prices .qr-add, body.page-prices .qr-remove {
  width: 26px; height: 26px; padding: 0; font-size: 15px; line-height: 24px; box-sizing: border-box;
  background: rgba(255, 255, 255, .92); border: 1px solid var(--border); border-radius: 6px; cursor: pointer;
}
body.page-prices .qr-empty .qr-add { width: 40px; height: 40px; font-size: 22px; line-height: 38px; }
body.page-prices .qr-add { color: var(--brand-primary); }
body.page-prices .qr-add:hover { background: var(--brand-soft); }
body.page-prices .qr-remove { color: #d92d20; }
body.page-prices .qr-remove:hover { background: #fef3f2; }
body.page-prices .qr-hint { margin: 0; font-size: 12px; color: var(--muted); }
/* 车间设置：按工作流程分四个区块；每个区块内为「标签列 + 控件列」网格，
   设置项各行独立高度、互不挤压；窄屏自动退化为单列。方式/开关仍用单选。 */
body.page-prices .workshop-form { max-width: 960px; gap: 0; }
body.page-prices .workshop-form .ws-section { padding: 18px 0 20px; border-bottom: 1px solid var(--border); }
body.page-prices .workshop-form .ws-section:last-child { border-bottom: 0; }
body.page-prices .workshop-form .ws-section-title { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
body.page-prices .workshop-form .ws-grid { display: grid; grid-template-columns: max-content 1fr; gap: 14px 16px; align-items: center; }
body.page-prices .workshop-form .ws-item { display: contents; }
body.page-prices .workshop-form .ws-label { font-size: 14px; white-space: nowrap; justify-self: start; }
body.page-prices .workshop-form .ws-control { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; min-width: 0; }
body.page-prices .workshop-form .ws-note { margin: 0 0 12px; font-size: 13px; }
body.page-prices .workshop-form .ws-hint { flex-basis: 100%; margin: 0; font-size: 13px; }
body.page-prices .workshop-form .ws-block-error { margin: 10px 0 0; }
body.page-prices .workshop-form .ws-control-workstations { gap: 10px; }
body.page-prices .workshop-form .ws-control-size { gap: 4px 8px; }
body.page-prices .workshop-form .ws-control-size input { width: 90px; }
body.page-prices .workshop-form #pack-workstations {
  font-family: inherit; font-size: 14px; line-height: 1.7;
  width: 420px; max-width: 480px; height: 72px; padding: 6px 8px;
}
body.page-prices .workshop-form .ws-side-hint { white-space: nowrap; }
body.page-prices .workshop-form .radio { display: inline-flex; flex-direction: row; align-items: center; gap: 4px; font-size: 14px; }
body.page-prices .workshop-form input[type="radio"] { width: auto; height: auto; padding: 0; border: 0; margin: 0; }
body.page-prices .workshop-form input:not([type="radio"]) { width: 80px; }
body.page-prices .workshop-form input[name="label_printer"] { width: 150px; }
body.page-prices .workshop-form select { height: 28px; border: 1px solid var(--border); border-radius: 4px; background: #fff; font-size: 14px; padding: 0 4px; }
/* 保存栏：提示语居左，按钮靠右（页脚本身常驻视口底部） */
body.page-prices .page-footer .ws-savebar-hint { margin-right: auto; }
body.page-prices .page-footer .btn { white-space: nowrap; flex-shrink: 0; }
/* 标签预览：固定三组样例并排展示，窄屏自动换行纵向排列 */
body.page-prices #label-room-preview-images { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; margin-top: 8px; }
body.page-prices .preview-group { min-width: 280px; }
body.page-prices .preview-group-title { font-size: 13px; font-weight: 600; margin: 0 0 6px; }
body.page-prices #label-room-preview-error { margin: 8px 0 0; font-size: 13px; }
@media (max-width: 640px) {
  body.page-prices .workshop-form .ws-grid { grid-template-columns: 1fr; gap: 4px; }
  body.page-prices .workshop-form .ws-item { display: block; margin: 0 0 14px; }
  body.page-prices .workshop-form .ws-item .ws-label { display: block; margin-bottom: 4px; }
  body.page-prices .workshop-form .ws-control { gap: 8px 12px; }
  body.page-prices .workshop-form #pack-workstations { width: 100%; }
  body.page-prices .page-footer .ws-savebar-hint { flex-basis: 100%; margin: 0 0 4px; }
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
}

h1 { margin: 0 0 8px; font-size: 20px; }
.muted { color: var(--muted); }

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.settings-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 0;
  border-bottom: none;
  flex: 1 1 auto;   /* 占满整行，右对齐页签（margin-left:auto）才有参照 */
}
.settings-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.settings-actions .toolbar-form { display: inline-block; margin: 0; }
.settings-actions label.btn { cursor: pointer; }
.settings-actions input[type="file"] { display: none; }
/* 库级工具=子标签同款（2026-11-15 用户：原 btn-ghost 蓝字蓝底，改与 板材/五金 一致）：
   紧凑规格照 .settings-subtabs .settings-tab（26px/500），label 挂文件输入要可点 */
.price-library-actions .settings-tab { height: 26px; line-height: 26px; padding: 0 10px; font-weight: 500; }
.price-library-actions label.settings-tab { cursor: pointer; }
.settings-tab {
  display: inline-block;
  height: 32px;
  line-height: 32px;
  padding: 0 14px;
  font-size: 14px;
  color: var(--brand-primary);
  background: #fff;
  border: 1px solid var(--brand-primary);
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
}
.settings-tab:hover { background: var(--brand-soft); color: var(--brand-primary); }
.settings-tab.active {
  background: var(--brand-primary);
  color: #fff;
  font-weight: 600;
  border-color: var(--brand-primary);
}
/* 不常用页签（操作日志）靠右：与常用价格库/设置区隔开 */
.settings-tab-right { margin-left: auto; }
/* 标签归组（2026-10-30）：一级 7 个固定，价格类 6 张收进「价格库」二级行 */
.settings-tab-rows { display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; }
.settings-subtabs { display: flex; gap: 8px; }
.settings-subtabs .settings-tab { height: 26px; line-height: 26px; padding: 0 10px; font-weight: 500; }
/* 二级行左右分布（F，2026-10-30）：子标签靠左、库级工具靠右——工具不再垂直居中
   悬浮于两行之间，右缘与一级「操作日志」共用同一条右基准线 */
/* 二级页签行定高（2026-11-12 用户反馈：板材/五金 → 工艺切换整页跳 6px）：
   板材/五金行右侧多一组「下载模板/导入导出」按钮（32px），其余页签只有 tabs（26px），
   行高随之 32 vs 26、页头 72 vs 66。锁 32px 最小高度，七页签头部完全等高。 */
.settings-subrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
/* 价格表长文本单行省略（H，2026-10-30 用户反馈：五金规格长文本折行撑高行）：
   只读单元格 nowrap+省略号，悬停 title 看全文（app.js syncCellTitles 同步）；
   编辑态 input 自带横向滚动不受影响 */
body.page-settings .price-edit-table td span.cell {
  display: inline-block; max-width: 100%; vertical-align: bottom;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 设置页说明收 ⓘ（I，2026-10-30，同报价页交互）：ⓘ 常驻、点开弹一行说明条 */
body.page-settings .settings-hint-row { margin: 6px 0 0; }
body.page-settings .settings-hint-row .tab-info { font-size: 15px; }
.settings-actions-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

/* 订单详情页标签页（板件列表 / 五金列表） */
.order-tabs { display: flex; gap: 8px; margin-bottom: 8px; flex-shrink: 0; }
.order-tab {
  height: 32px;
  line-height: 32px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--brand-primary);
  background: #fff;
  border: 1px solid var(--brand-primary);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}
.order-tab:hover { background: var(--brand-soft); }
.order-tab.active { background: var(--brand-primary); color: #fff; }
/* 批B⑦（2026-11-11）大板张数脏态：页签橙点 + 保存按钮高亮 */
.order-tab.dirty::after {
  content: ""; display: inline-block; width: 8px; height: 8px;
  background: #f59e0b; border-radius: 50%; margin-left: 6px; vertical-align: middle;
}
.order-tab.active.dirty::after { background: #fff; }
#sheet-save-btn.sheet-dirty { background: #fef3c7; border-color: #f59e0b; color: #92400e; font-weight: 700; }
.order-tabs .list-search { margin-left: auto; width: 240px; height: 32px; padding: 0 10px; border: 1px solid #9aa5b1; border-radius: 3px; background: #fff; font-size: 14px; }
.order-tabs .list-search::placeholder { color: #9aa5b1; }
/* 页签 ⓘ 口径提示（2026-10-23）：圆圈 i 点一下弹一行说明 */
.tab-info { margin-left: 6px; font-weight: 400; cursor: help; }
.tab-hint { margin: -2px 0 8px; padding: 6px 10px; font-size: 13px; color: #5a6b7d; background: #f2f6fa; border: 1px solid #d7e1ea; border-radius: 4px; }
.panel-list-table { min-width: 2400px; white-space: nowrap; }
.metal-list-table { min-width: 760px; white-space: nowrap; }
.material-summary-table { min-width: 760px; white-space: nowrap; }
/* 订单详情宽表身份列吸顶（2026-11-28 用户拍板）：JS 按表头实测宽度给前 N 列加 .pin-col
   并写 left；容器 <900px 时自动不吸（窄屏固定列会吃掉大半屏幕）。固定列不透明、
   偶行跟斑马、组头沿用组头底色，横向滚动时不透底。 */
#panel-table.pin-cols th.pin-col, #panel-table.pin-cols td.pin-col,
#metal-table.pin-cols th.pin-col, #metal-table.pin-cols td.pin-col,
#material-summary-table.pin-cols th.pin-col, #material-summary-table.pin-cols td.pin-col {
  position: sticky; z-index: 2; background-color: #fff;
}
#panel-table.pin-cols th.pin-col, #metal-table.pin-cols th.pin-col,
#material-summary-table.pin-cols th.pin-col { background-color: var(--surface-muted); }
#panel-table.pin-cols tbody tr:nth-child(even) td.pin-col,
#metal-table.pin-cols tbody tr:nth-child(even) td.pin-col,
#material-summary-table.pin-cols tbody tr:nth-child(even) td.pin-col {
  background-color: var(--row-zebra);
}
#panel-table.pin-cols tr.room-group td.pin-col,
#metal-table.pin-cols tr.room-group td.pin-col { background-color: #f7f9fb; }
#panel-table.pin-cols td.pin-col.pin-last, #metal-table.pin-cols td.pin-col.pin-last,
#material-summary-table.pin-cols td.pin-col.pin-last {
  border-right: 1px solid var(--line-soft);
}
#panel-table.pin-cols th.pin-col.pin-last, #metal-table.pin-cols th.pin-col.pin-last,
#material-summary-table.pin-cols th.pin-col.pin-last { border-right: 1px solid var(--border); }
/* 大板张数表（2026-11-02）：照材料汇总口径——nowrap 不折行、基材/颜色 保底宽；
   四个手填数字框收窄到 84px，数字列不再霸占整表宽度 */
#sheet-table { min-width: 900px; white-space: nowrap; }
#sheet-table th:nth-child(2), #sheet-table th:nth-child(3) { min-width: 110px; }
#sheet-table input[type="number"] { width: 84px; height: 26px; padding: 0 8px; }
/* 详情页三张表首列序号（2026-10-31）：服务端 loop.index，翻页/筛选不重排；灰字居中 */
.page-order-detail th.col-rowno { width: 52px; text-align: center; }
.page-order-detail td.rowno { color: #94a3b8; text-align: center; }
/* 初次渲染兜底：大订单（1000+ 行）先只画前 100 行，避免整表闪现后被 JS 收起（FOUC）。
   JS 分页接管后用内联 display:table-row/none 覆盖本规则。第 100 行之后默认不渲染。 */
/* 板件/五金列表 2026-11-07 起按房间分组、不再分页：撤掉「首屏只显示前 100 行」的
   无 JS 兜底（否则第 101 行之后的房间组头永远不显示） */

/* 订单详情页：全屏固定布局 —— 页面不滚动，仅列表内部滚动 */
.page-order-detail { font-size: 14px; height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
.page-order-detail .topbar { flex-shrink: 0; }
.page-order-detail .container {
  flex: 1;
  min-height: 0;
  max-width: none;
  margin: 0;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
}
.page-order-detail .card { flex-shrink: 0; }
.page-order-detail .card.order-list-card { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 8px; }
.page-order-detail .card.order-header-card { padding: 8px 16px; }
/* 订单名称与「保存」同一行：h1 左、动作右；报价/物料清单在列表工具栏行（order-tabs 为 flex，无需特判） */
.page-order-detail .order-header-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-order-detail .order-header-title h1 { margin: 0; }
.page-order-detail .order-header-actions { text-align: right; }
.page-order-detail table, .page-order-detail th, .page-order-detail td { font-size: 14px; }
.page-order-detail th, .page-order-detail td { padding: 4px 10px; }
.page-order-detail h1 { font-size: 18px; }
.page-order-detail h2 { font-size: 16px; }
.order-tab-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
/* 大板张数操作条（2026-11-11 上移）：放在 .order-table-scroll 之外、flex 列顶部——
   页面 100vh、表格在滚动盒内滚，工具条在盒外天然吸顶，滚到哪儿都能点；flex-shrink:0 防压扁 */
.sheet-toolbar { flex-shrink: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0 2px 8px; }
.sheet-toolbar-left { display: flex; gap: 8px; align-items: center; }
.order-table-scroll { flex: 1; min-height: 0; overflow: auto; }
.order-table-scroll thead th { position: sticky; top: 0; z-index: 1; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--border); flex-shrink: 0; font-size: 14px; color: var(--muted); }
.pager-nav { display: inline-flex; align-items: center; gap: 8px; }
.pager-btn { background: none; border: none; padding: 0 4px; height: auto; line-height: normal; color: var(--brand-primary); font-size: 14px; cursor: pointer; }
.pager-btn:hover { background: none; color: var(--brand-hover); }
.pager-btn:disabled { background: none; color: var(--muted); cursor: not-allowed; }

/* 报价页：仿桌面版「报价数据」对话框（顶部字段 + 板材/五金/工艺费三页签 + 底部合计） */
.page-quote { font-size: 14px; height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
.page-quote .topbar { flex-shrink: 0; }
.page-quote .container {
  flex: 1; min-height: 0; max-width: none; margin: 0; padding: 8px 12px;
  display: flex; flex-direction: column;
}
.page-quote .card { flex-shrink: 0; }
.page-quote .card.quote-top { position: relative; padding: 8px 12px; display: flex;
  align-items: center; gap: 12px; flex-wrap: nowrap; }
/* 返回订单详情（2026-10-31）：报价页常驻返回链路 */
.page-quote /* 返回链与字段同一基线（2026-11-01 用户反馈：13px 与 14px 混排看着上下不齐）：
   统一字号与行高，视觉中心对齐 */
.quote-back { flex: 0 0 auto; display: inline-block; font-size: 14px; line-height: 20px;
  color: var(--brand-primary); text-decoration: none; white-space: nowrap; }
.page-quote .quote-field label, .page-quote .quote-field b { line-height: 20px; }
.page-quote .quote-back:hover { text-decoration: underline; }
.page-quote .card.quote-tabs-card { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 8px 12px; margin-top: 8px; }
.page-quote .card.quote-bottom { padding: 8px 12px; margin-top: 8px; }
.page-quote .card.quote-records { padding: 8px 12px; margin-top: 8px; }
.page-quote .card.quote-records h2 { margin: 0 0 8px; font-size: 16px; }
.page-quote .card.quote-view-banner { padding: 8px 12px; margin-top: 8px; }
.page-quote .card.quote-view-banner p { margin: 0; }
.page-quote table { margin-top: 0; }

/* 物料清单页：仿报价页全屏布局 —— 横向铺满、标签页切换、表格内部滚动，全字号 14px */
.page-material { font-size: 14px; height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
.page-material .topbar { flex-shrink: 0; }
.page-material .container {
  flex: 1; min-height: 0; max-width: none; margin: 0; padding: 12px 16px;
  display: flex; flex-direction: column;
}
.page-material .card { flex-shrink: 0; }
.page-material .card.quote-top { padding: 8px 12px; }
.page-material .material-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.page-material .card.material-tabs-card {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  padding: 8px 12px; margin-top: 8px;
}
.page-material table, .page-material th, .page-material td { font-size: 14px; }
.page-quote th, .page-quote td { font-size: 14px; padding: 3px 8px; }
.page-quote input[type="number"] { width: 90px; height: 26px; padding: 0 8px; }
/* 报价页头三段式（2026-11-01 用户拍板）：左 订单名称/单号 ｜ 中 报价门店 ｜ 右 客户/订单日期 */
.quote-fields { display: flex; align-items: center;
  gap: 24px; flex: 1 1 auto; }
.qf-left { display: flex; align-items: center; gap: 24px; }
/* 报价门店相对整个头部卡片绝对居中（以 .quote-top 为定位基准，不受返回链/左右字段宽度影响）；
   gap 与左右两段一致 24px（2026-11-04 用户反馈：计价方式与报价门店贴边差一点重叠） */
.qf-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 24px; }
.qf-right { margin-left: auto; display: flex; align-items: center; gap: 24px; }
.quote-field { white-space: nowrap; }
/* 门店未绑定高亮（防忘选） */
/* 未绑定不再给下拉框染色（2026-11-01 用户拍板：整框正常显示，避免任何变色/卡顿）：
   防忘靠保存前确认 + 下拉框 title 提示 */
.quote-field { display: inline-flex; align-items: baseline; gap: 6px; }
.quote-field label { color: var(--muted); }
.quote-field b { font-weight: 600; color: var(--text); }
.quote-tabs-card .order-tab-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.quote-tabs-card .order-table-scroll { flex: 1; min-height: 0; overflow: auto; }
.quote-tabs-card .order-table-scroll thead th { position: sticky; top: 0; z-index: 1; }
.quote-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.quote-totals { display: flex; align-items: baseline; gap: 24px; flex-wrap: wrap; }
.quote-total { color: var(--text); }
.quote-total b { color: var(--brand-primary); font-weight: 600; }
.quote-grand { font-weight: 700; }
.quote-grand b { font-size: 16px; }
.quote-actions { display: flex; gap: 8px; }

/* 订单流程条：拆单→报价→开料→封边→打孔→二次优化→分拣→打包→发货 */
.order-flow { display: flex; align-items: flex-start; margin-bottom: 10px; }
.flow-step { display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0; }
.flow-dot {
  width: 26px; height: 26px; line-height: 26px;
  border-radius: 50%; text-align: center;
  font-size: 13px; font-weight: 600;
  background: #fff; color: #9aa3af;
  border: 1px solid #cbd5e1;
}
.flow-step.done .flow-dot { background: #16a34a; border-color: #16a34a; color: #fff; }
.flow-step.current .flow-dot { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; box-shadow: 0 0 0 4px var(--focus-ring); }
.flow-label { font-size: 14px; color: #9aa3af; white-space: nowrap; }
.flow-step.done .flow-label { color: #374151; }
.flow-step.current .flow-label { color: var(--brand-primary); font-weight: 600; }
.flow-line { flex: 1; height: 2px; background: #e5e7eb; margin: 12px 6px 0; min-width: 12px; }
.flow-line.done { background: #16a34a; }
.flow-step .flow-dot.flow-light-yellow { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.flow-step .flow-dot.flow-light-green { background: #16a34a; border-color: #16a34a; color: #fff; }

/* 订单详情页元信息字段区 */
.order-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 24px; margin: 0 0 12px; }
.order-meta .meta-item { display: flex; gap: 6px; font-size: 14px; line-height: 22px; }
.order-meta dt { color: #374151; flex-shrink: 0; }
.order-meta dt::after { content: "："; }
.order-meta dd { margin: 0; color: #374151; min-width: 0; flex: 1 1 auto; }
.order-meta dd input { padding: 2px 8px; height: 24px; font-size: 13px; }
/* 编辑框撑满所在格（2026-11-09）：长标签+长输入不再溢出压到右侧字段 */
.order-meta dd input:not([type="radio"]), .order-meta dd select { width: 100%; box-sizing: border-box; }
.order-meta dd input[type="radio"] { width: auto; height: auto; padding: 0; border: 0; }
.order-meta dd .radio-option { display: inline-flex; flex-direction: row; align-items: center; gap: 4px; margin-right: 16px; cursor: pointer; }
/* 详情页表单铺满整行（覆盖全局 form max-width:360px），字段区自适应多列 */
.page-order-detail form { max-width: none; }
.page-order-detail .order-meta { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

form { display: flex; flex-direction: column; gap: 16px; max-width: 360px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}
button {
  height: 32px;
  line-height: 32px;
  padding: 0 16px;
  background: var(--action-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}
button:hover { background: var(--brand-hover); }
/* 统一控件状态：禁用半透明+不可点；键盘聚焦统一品牌聚焦环（浏览器默认轮廓不统一） */
button:disabled, .btn:disabled { opacity: .55; cursor: not-allowed; }
button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }

.phases { padding-left: 20px; line-height: 1.9; }

.error { color: #d92d20; background: #fef3f2; border: 1px solid #fecdca; padding: 8px 12px; border-radius: 6px; }
.banner { background: #f0f7fb; border: 1px solid #bfdcec; border-radius: 8px; padding: 12px 16px; margin: 0 0 16px; position: relative; }
.banner-title { font-weight: 600; margin: 0 0 4px; }
.banner .warn { color: #b54708; margin: 4px 0 0; }
.banner .btn { margin-top: 8px; }
/* 报价与生产差异卡（2026-11-10 转置版）：生产版数量与报价版不同的格橙色加粗 */
.diff-hit { color: #b54708; font-weight: 600; }

table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: var(--font-body); }
th, td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
th { background: var(--surface-muted); font-weight: 600; }
.btn { display: inline-block; height: 32px; line-height: 32px; padding: 0 14px; background: var(--action-primary); color: #fff; border-radius: 6px; text-decoration: none; font-size: 14px; }
.btn:hover { background: var(--brand-hover); }
.btn-danger { background: #d92d20; border: 1px solid #d92d20; }
.btn-danger:hover { background: #b42318; }
.link { background: none; border: none; padding: 0; height: auto; line-height: normal; color: var(--brand-primary); font-size: 13px; cursor: pointer; text-decoration: underline; margin-right: 8px; }
/* 悬停必须显式压掉全局 button:hover 的深蓝底：否则底色与 .link:hover 字色同为
   --brand-hover，字被背景吞掉（平台页启用/停用/改到期、报价页「编辑」均中招过） */
.link:hover { color: var(--brand-hover); background: none; }
.link-danger { background: none; border: none; padding: 0; height: auto; line-height: normal; color: #d92d20; font-size: 14px; cursor: pointer; text-decoration: underline; }
.link-danger:hover { color: #b42318; background: none; }
.table-scroll th.row-select, .table-scroll td.row-select { width: 32px; text-align: center; padding: 6px 4px; }

.slots { display: flex; flex-wrap: wrap; gap: 10px; }
.slot { width: 120px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.slot-complete { border-color: #16a34a; background: #f0fdf4; }
.slot-active { border-color: var(--brand-primary); background: var(--brand-soft); }
.slot-free { background: #f9fafb; color: var(--muted); }
.slot-no { font-weight: 700; }
.slot-label { font-size: 12px; color: var(--muted); }
.slot-progress { font-size: 13px; margin-top: 4px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.tag-complete { background: #dcfce7; color: #15803d; }
.tag-active { background: #dbeafe; color: #1d4ed8; }
.tag-waiting { background: #f3f4f6; color: var(--muted); }
.tag-free { background: #f3f4f6; color: var(--muted); }
#scan-form { display: flex; gap: 8px; margin-top: 12px; }
#scan-input { flex: 1; font-family: Consolas, "Courier New", monospace; font-size: 18px; padding: 12px; }
.toast { display: none; position: fixed; top: 16px; left: 50%; transform: translateX(-50%); padding: 10px 20px; border-radius: 6px; color: #fff; z-index: 100; }
.toast.ok { background: #16a34a; }
.toast.err { background: #d92d20; }
tr.unscanned { background: #fff7ed; }
.events { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.events li { padding: 4px 0; border-bottom: 1px dashed var(--border); }
.buffer { list-style: none; padding: 0; margin: 0; }
.buffer li { padding: 6px 0; border-bottom: 1px dashed var(--border); display: flex; gap: 8px; align-items: center; }
.buffer li .muted { flex: 1; }
tr.purchased { color: var(--muted); }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 200; }
.modal-box { background: #fff; padding: 16px; border-radius: 8px; max-width: 90vw; max-height: 90vh; overflow: auto; }
.modal-box img { display: block; max-width: 100%; margin: 8px 0; border: 1px solid var(--border); }

.range-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; font-size: 14px; color: var(--muted); }
.range-link { padding: 4px 12px; border: 1px solid var(--border); border-radius: 14px; text-decoration: none; color: var(--text); }
.range-link.active { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
.kpi-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.kpi-card { flex: 1; min-width: 140px; border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; }
.kpi-value { font-size: 22px; font-weight: 700; }
.kpi-label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.num { text-align: right; }

/* 主界面：28 列宽表 + 列显隐 */
.table-toolbar { display: flex; justify-content: flex-end; margin-top: 12px; }
.col-panel {
  margin: 8px 16px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fafbfc;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}
.col-item { flex-direction: row; align-items: center; gap: 4px; font-size: 14px; cursor: pointer; }
.col-item input[type="checkbox"] { padding: 0; width: 14px; height: 14px; }
.table-scroll { overflow-x: auto; margin-top: 0; background: #fff; }
#batch-form { display: flex; flex-direction: column; flex: 1; min-height: 0; max-width: none; gap: 0; margin: 0; }
#main-table { min-width: 2000px; white-space: nowrap; margin-top: 0; font-size: 14px; line-height: 1.35; }
#main-table th, #main-table td { white-space: nowrap; padding: 4px 8px; border: 0; border-bottom: 1px solid var(--line-soft); text-align: left; }
#main-table th { background: var(--surface-muted); color: var(--text-secondary); font-size: var(--font-meta); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.th-sort { color: inherit; text-decoration: none; white-space: nowrap; }
.th-sort:hover { color: var(--brand-primary); }
.th-sort.active { color: var(--brand-primary); font-weight: 700; }
/* 可排序列未激活时的灰色 ↕ 提示（2026-10-31）：让用户一眼知道这列能点 */
.th-sort .sort-hint { color: var(--text-muted); font-size: 12px; }
.th-sort:hover .sort-hint { color: var(--brand-primary); }
#main-table td { color: #252a33; }
/* 行悬停统一叠加层（2026-11-27 用户拍板，取代此前的四套特例：主界面实色、车间半透明、
   改过价加深黄、车间末列补色）。inset 阴影画在背景之上、边框与内容之下——黄底/绿进度条/
   蓝选中态/红缺价一律保留，无需逐表排除；焦点在行内（正在录价）时保持高亮。
   触屏/无悬停指针不启用；偏好减少动效时不做过渡。 */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  :where(#main-table, .panel-list-table, .metal-list-table, .material-summary-table, .download-table,
      .members-table, .role-table, .role-matrix-table, .pdl-table, .platform-fb-table,
      .price-edit-table, .sp-table) tbody td,
  body.page-workshop-stats table tbody td,
  body.page-quote tbody td,
  #sheet-table tbody tr[data-kind="sheet"] td { transition: box-shadow .12s ease; }
}
@media (hover: hover) and (pointer: fine) {
  :where(#main-table, .panel-list-table, .metal-list-table, .material-summary-table, .download-table,
      .members-table, .role-table, .role-matrix-table, .pdl-table, .platform-fb-table,
      .price-edit-table, .sp-table) tbody tr:hover td,
  :where(#main-table, .panel-list-table, .metal-list-table, .material-summary-table, .download-table,
      .members-table, .role-table, .role-matrix-table, .pdl-table, .platform-fb-table,
      .price-edit-table, .sp-table) tbody tr:focus-within td,
  body.page-workshop-stats table tbody tr:hover td,
  body.page-workshop-stats table tbody tr:focus-within td,
  body.page-quote tbody tr:hover td,
  body.page-quote tbody tr:focus-within td,
  #sheet-table tbody tr[data-kind="sheet"]:hover td,
  #sheet-table tbody tr[data-kind="sheet"]:focus-within td {
    box-shadow: inset 0 0 0 9999px var(--row-hover);
  }
  /* 行内控件透明：整行颜色连续，输入框白底不把行切碎 */
  :where(.price-edit-table, .sp-table, #sheet-table) tbody tr:hover input,
  :where(.price-edit-table, .sp-table, #sheet-table) tbody tr:hover select,
  :where(.price-edit-table, .sp-table, #sheet-table) tbody tr:focus-within input,
  :where(.price-edit-table, .sp-table, #sheet-table) tbody tr:focus-within select,
  body.page-quote tbody tr:hover input,
  body.page-quote tbody tr:hover select,
  body.page-quote tbody tr:focus-within input,
  body.page-quote tbody tr:focus-within select { background: transparent; }
}
/* 极浅斑马纹（2026-11-28 用户拍板）：宽表静止扫读防串行。特异性归零——任何行状态底色
   （缺价红/编辑蓝/已处理灰等）都能压过它；悬停叠加层照常画在最上层。
   只铺不会折叠数据的行表；报价页/存价弹窗/车间（状态色密集）与可折叠的房间树不铺。 */
:where(#main-table, .material-summary-table, .download-table, .members-table, .role-table,
       .role-matrix-table, .pdl-table, .platform-fb-table, .price-edit-table,
       body.page-workshop-stats)
  :where(tbody tr:nth-child(even):not(.room-group) td) { background-color: var(--row-zebra); }
:where(#sheet-table) :where(tbody tr[data-kind="sheet"]:nth-child(even) td) {
  background-color: var(--row-zebra);
}
/* 主界面十字高亮（2026-11-28 用户拍板）：悬停单元格时同列整列轻蓝，宽表横向对列不再
   靠眼数。JS 在 app.js 维护 .is-col-hover（进表时加、离开表时清）。 */
#main-table th.is-col-hover, #main-table td.is-col-hover { background-color: #eef3f9; }
/* 主界面身份列吸顶（2026-11-28 用户拍板）：只在「订单编号是第一个可见数据列」时由 JS 加
   .pin-identity（用户把别的列拖到它前面或隐藏编号列即撤掉，避免和自定义列序打架）。
   勾选列（有的话）一并吸住，编号列紧随其后；吸住的单元格用不透明底色，横向滚动不透出
   下层内容，也不铺斑马纹（固定列保持干净白）。 */
#main-table.pin-identity th.row-select,
#main-table.pin-identity td.row-select,
#main-table.pin-identity th[data-col="order_no"],
#main-table.pin-identity td[data-col="order_no"] {
  position: sticky; z-index: 2; background-color: #fff;
}
#main-table.pin-identity th.row-select,
#main-table.pin-identity td.row-select { left: 0; }
#main-table.pin-identity th[data-col="order_no"],
#main-table.pin-identity td[data-col="order_no"] { left: var(--pin-lead, 36px); }
#main-table.pin-identity.pin-nosel th[data-col="order_no"],
#main-table.pin-identity.pin-nosel td[data-col="order_no"] { left: 0; }
#main-table.pin-identity th.row-select,
#main-table.pin-identity th[data-col="order_no"] { background-color: var(--surface-muted); }
#main-table.pin-identity td[data-col="order_no"] { border-right: 1px solid var(--line-soft); }
#main-table.pin-identity th[data-col="order_no"].is-col-hover,
#main-table.pin-identity td[data-col="order_no"].is-col-hover,
#main-table.pin-identity th.row-select.is-col-hover,
#main-table.pin-identity td.row-select.is-col-hover { background-color: #eef3f9; }
#main-table [data-col].hidden { display: none; }
.hidden { display: none; }

/* 主界面列拖拽排序（HTML5 拖拽 + 插入指示线） */
#main-table th[data-col] { cursor: grab; }
#main-table th[data-col]:active { cursor: grabbing; }
#main-table th.dragging { opacity: .4; }
#main-table th.drop-before { box-shadow: inset 2px 0 0 var(--brand-primary); }
#main-table th.drop-after { box-shadow: inset -2px 0 0 var(--brand-primary); }
.col-reset {
  flex-basis: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0 0 4px;
  height: auto;
  line-height: normal;
  color: var(--brand-primary);
  cursor: pointer;
  font-size: 14px;
}
.col-reset:hover { background: none; color: var(--brand-hover); }

/* 主界面顶部工具栏与设置下拉 */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.page-actions { display: flex; gap: 8px; align-items: center; }
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: 100%; margin-top: 4px;
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); z-index: 50; min-width: 140px;
}
.menu a { display: block; padding: 8px 14px; color: var(--text); text-decoration: none; font-size: 14px; }
.menu a:hover { background: #f5f7fa; }
.menu-group { display: block; padding: 8px 14px 3px; font-size: 12px; color: var(--muted); }

/* 导出物料清单下拉：7 表勾选 + 导出所选 / 全部导出 */
.export-sheets { padding: 8px 12px; display: flex; flex-direction: column; gap: 4px; border-bottom: 1px solid var(--border); }
.export-sheet-item { display: flex; flex-direction: row; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; white-space: nowrap; }
.export-sheet-item input[type="checkbox"] { width: 14px; height: 14px; }
.export-actions { display: flex; gap: 8px; padding: 8px 12px; }
.export-actions .btn { flex: 1; text-align: center; }

/* 主界面：全宽工具栏 + 表格底栏（复刻根目录「主界面.csv」的布局） */
.page-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.toolbar-search { display: flex; flex-direction: row; align-items: center; gap: 8px; max-width: none; margin: 0; }
.toolbar-search input { min-width: 260px; height: var(--control-height); padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; font-size: 14px; }
.toolbar-search input::placeholder { font-size: 14px; color: #9aa5b1; }
.toolbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.btn-ghost { background: var(--brand-soft); color: var(--brand-primary); border: 1px solid var(--brand-border); }
.btn-ghost:hover { background: var(--brand-primary); color: #fff; }
.btn-danger-text { background: #fef3f2; color: #d92d20; border: 1px solid #f0b9b4; }
.btn-danger-text:hover { background: #d92d20; color: #fff; }
/* 行内紧凑小按钮（成员操作列等）：沿用 ghost/danger-text 配色（悬停蓝底白字/红底白字，避开
   全局 button:hover 蓝底叠深色字的冲突），字号与原链接按钮一致(13px)，高度略收；需写在 .btn 之后以覆盖其尺寸。 */
.btn-sm { height: 28px; line-height: 28px; padding: 0 10px; font-size: 13px; vertical-align: middle; }
.date-filter { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 6px 16px; background: #fff; border-bottom: 1px solid var(--border); }
.date-filter-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
/* 「只看活跃」等勾选组与时间胶囊同高同节奏（2026-11-14 用户反馈：看着矮一截）——
   胶囊是 padding:3px 10px + 1px 边的高 27px；勾选组补齐同样的垂直留白。 */
.date-filter-tabs .chk { display: inline-flex; align-items: center; padding: 3px 10px; border: 1px solid transparent; }
.date-filter-tabs .chk label { height: 19px; }
/* —— 平台列表页工具条齐一化（2026-11-14 用户八连反馈）——
   ①使用详情行内三种高度（搜索30/胶囊27/日期32）统一 30px；②用户管理/反馈墙头部 63px →
   与使用详情/下载的 44px 齐平（搜索 38→30、留白 12→6）。只挂平台页新增类，
   租户主界面同款 date-filter 组件不受影响。 —— */
.usage-toolbar .date-filter-item { height: 30px; box-sizing: border-box; display: inline-flex; align-items: center; }
.usage-toolbar .chk { height: 30px; box-sizing: border-box; }
.usage-toolbar .date-custom input[type="date"] { height: 30px; }
.panel-toolbar.platform-users-toolbar { margin: 6px 0; }
.platform-users-toolbar input[type="text"] { height: 30px; padding: 0 8px; }
.panel-toolbar.platform-fb-toolbar { margin: 6px 0; }
.panel-toolbar.platform-fb-filter { margin: 0; }  /* 表单同挂 panel-toolbar 类，别再吃上下 12px */
.platform-fb-toolbar input[type="search"] { height: 30px; padding: 0 8px; }
.platform-fb-toolbar select { height: 30px; box-sizing: border-box; }
.platform-fb-toolbar .btn { height: 30px; }
.date-filter-label { font-size: 13px; color: var(--text-secondary); }
.date-filter-item { padding: 3px 10px; font-size: var(--font-body); border: 1px solid transparent; border-radius: 3px; color: #1f2933; text-decoration: none; }
.date-filter-item:hover { background: var(--brand-soft); color: var(--brand-primary); }
.date-filter-item.active { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
.date-filter-hint { font-size: 12px; color: #9aa5b1; margin-left: 6px; }
.date-custom { display: inline-flex; flex-direction: row; align-items: center; flex-wrap: nowrap; gap: 6px; margin: 0; max-width: none; }
.date-custom input[type="date"] { height: var(--control-height); padding: 0 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: var(--font-body); }
.date-custom button { height: var(--control-height); line-height: var(--control-height); padding: 0 12px; }
.date-custom button[hidden] { display: none; }  /* 改日期前不显示「应用」（防全局 button 规则盖过 UA hidden） */
.range-summary { font-size: 13px; color: var(--text-secondary); white-space: nowrap; }
.panel-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.panel-toolbar .toolbar-form { display: inline-block; margin: 0; }
.panel-toolbar label.btn { cursor: pointer; }
.panel-toolbar input[type="file"] { display: none; }
/* 成员管理页：列表 + 新增表单 + 岗位复选框 + 编辑/重置弹窗 */
.panel-title { font-weight: 600; font-size: 14px; }
.members-toolbar .panel-title { margin-right: auto; }
.members-table td { vertical-align: middle; }
/* 成员页 body 借用 page-settings 作用域，其 .price-edit-table 的 table-layout:fixed（等宽列）不适合
   成员列表：状态列空耗、操作列挤压溢出。这里加权改回按内容自适应；时间列已截到分钟、表字号 13px 压宽。 */
body.page-settings .price-edit-table.members-table { table-layout: auto; }
.members-table { font-size: 13px; }
.members-table .col-select { width: 36px; text-align: center; }
.members-table .col-select input[type="checkbox"] { cursor: pointer; }
.members-table td:last-child { white-space: nowrap; }   /* 操作列按钮不折行；表格已套 .table-scroll 兜底 */
.members-table .btn-sm { white-space: nowrap; margin: 1px 4px 1px 0; }
/* 平台侧租户到期徽标：黄=宽限中/30 天内到期，红=已到期（租户管理与使用详情两页共用） */
.expiry-yellow { color: #b45309; font-weight: 600; }
.expiry-red { color: #d92d20; font-weight: 700; }
.member-form { max-width: 760px; gap: 16px; }
.member-row { display: flex; flex-wrap: nowrap; gap: 12px 24px; align-items: center; }
.member-form .inline-field { display: flex; flex-direction: row; align-items: center; gap: 8px; font-size: 14px; }
.member-form .inline-field input { width: 170px; padding: 6px 10px; }
.role-fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; margin: 12px 0 0; }
.role-fieldset legend { font-size: 14px; padding: 0 6px; color: var(--text); }
.role-table { width: 100%; border-collapse: collapse; }
.role-table th, .role-table td { text-align: left; padding: 6px 10px; font-size: 14px; }
.role-table th { font-weight: 600; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
.role-table td { border-bottom: 1px solid var(--border); white-space: nowrap; }
.role-table tr:last-child td { border-bottom: none; }
.role-table .role-col-check { width: 80px; text-align: center; }
.role-table .role-col-check input { cursor: pointer; }
/* 岗位权限对照（成员页 details 折叠，默认收起；2026-11-01） */
/* 成员页复用 body.page-prices 的 100vh/overflow:hidden 固定布局：页面不滚。
   小屏放开对照表后若让它按 flex 默认压缩，会被 .role-matrix 的 overflow:hidden
   裁掉下半截且无任何滚动 —— 故 flex-shrink:0 不压缩，内容区自带上下滚动
   （大屏内容不超高时与原先完全一致），表设最小宽防列压碎、表头吸顶。 */
.role-matrix { padding: 0; margin: 0 0 16px; overflow: hidden; flex-shrink: 0; }
.role-matrix > summary { cursor: pointer; user-select: none; padding: 12px 16px;
  font-weight: 600; font-size: 14px; list-style: none; }
.role-matrix > summary::-webkit-details-marker { display: none; }
.role-matrix > summary::before { content: "▸"; color: var(--muted); margin-right: 6px;
  display: inline-block; transition: transform 0.15s; }
.role-matrix[open] > summary { border-bottom: 1px solid var(--border); }
.role-matrix[open] > summary::before { transform: rotate(90deg); }
.role-matrix-body { padding: 12px 16px 14px; max-height: min(55vh, 480px); overflow: auto; }
.role-matrix-table { table-layout: fixed; min-width: 560px; }
.role-matrix-table thead th { position: sticky; top: 0; background: #fff; z-index: 1;
  box-shadow: 0 1px 0 var(--border); }
.role-matrix-table th.role-matrix-cap { text-align: left; width: 34%; }   /* fixed 布局下不设宽会被 7 列均分挤成窄条（2026-11-02） */
.role-matrix-table td.c-yes { text-align: center; color: #16a34a; font-weight: 600; }
.role-matrix-table td.c-no { text-align: center; color: #cbd5e1; }
.role-matrix-table .role-matrix-section th { text-align: left; background: #f8fafc;
  color: var(--muted); font-size: 12px; padding: 6px 8px; }
.role-matrix-notes { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 12px; }
.role-matrix-notes li { margin: 2px 0; }
.member-dialog { border: none; border-radius: 10px; padding: 0; width: 360px; max-width: 92vw; }
#role-dialog { width: 560px; }
#add-dialog { width: 560px; }
.member-dialog::backdrop { background: rgba(0, 0, 0, 0.4); }
.member-dialog .dialog-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.member-dialog .dialog-header h3 { margin: 0; font-size: 15px; }
.member-dialog .dialog-body { padding: 16px; }
.member-dialog .dialog-body .inline-field { display: flex; flex-direction: row; align-items: center; gap: 8px; font-size: 14px; }
.member-dialog .dialog-body .inline-field input { width: 220px; padding: 6px 10px; }
#role-dialog input[readonly] { background: #f2f3f5; color: var(--muted); }
.member-dialog .dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.member-dialog .req { color: #d92d20; font-weight: 700; }
.add-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 0 0 12px; }
.add-field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.add-field > span { font-size: 13px; }
.add-field input { width: 100%; padding: 6px 10px; }
.close-button { background: none; border: none; font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted); padding: 0 4px; }
.table-footer .footer-summary { font-size: var(--font-meta); color: var(--text-secondary); }
.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 16px;
  font-size: 14px;
  background: #fff;
  border-top: 1px solid var(--border);
}
.pagination { color: var(--muted); }
.pagination a { margin: 0 4px; color: var(--brand-primary); text-decoration: none; }
.pagination a:hover { color: var(--brand-hover); }
/* 进度组件（公共）：主界面与数据统计页同一套语义 —— 完成=浅绿轨+绿条、
   进行中=浅蓝轨+蓝条、未开始=浅灰轨+灰条；主界面窄条 48px，统计页页级覆盖 64px */
.ws-prog { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ws-prog .prog-bar { width: 48px; }
.ws-prog.p-done .prog-bar { background: #dcfce7; }
.ws-prog.p-done .prog-bar-fill { background: #16a34a; }
.ws-prog.p-doing .prog-bar { background: #dbeafe; }
.ws-prog.p-doing .prog-bar-fill { background: var(--brand-primary); }
.ws-prog.p-zero .prog-bar { background: #e5e7eb; }
.ws-prog.p-zero .prog-bar-fill { background: #9ca3af; }
.ws-prog-num, .ws-prog-none { font-size: 12px; color: var(--text-muted); }
.prog-bar { height: 8px; border-radius: 4px; background: #e5e7eb; overflow: hidden; flex-shrink: 0; }
.prog-bar-fill { display: block; height: 100%; background: #9ca3af; }
.empty-hint { padding: 24px 16px; }

/* 空态大上传卡片（抖音式）：租户一个订单都没有时的中央上传入口，点击任意处弹文件框 */
.empty-upload {
  margin: 48px auto 24px;
  max-width: 560px;
  padding: 44px 24px 32px;
  text-align: center;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s, background-color 0.15s;
}
.empty-upload:hover, .empty-upload:focus-visible,
.empty-upload.drop-hot {
  border-color: var(--brand-primary);
  background: var(--brand-soft);
}

/* 导入生产版页头（2026-11-09）：标题/目标单上下文层级 */
.prod-title { font-size: 22px; }
.prod-target { margin: 2px 0 14px; text-align: center; }
.prod-target-no { margin: 0 0 2px; font-size: 16px; font-weight: 600; }
.prod-target .muted { margin: 0; font-size: 13px; }

/* 导入生产版专用入口（2026-11-07）：顶掉全局 form{display:flex;max-width:360px}，
   让空态大卡居中撑开；整页竖排居中 */
body.page-import-prod .prod-import-wrap { max-width: 960px; margin: 0 auto; padding: 16px 16px 0; text-align: center; }
body.page-import-prod .prod-import-wrap > .muted { margin: 0 0 4px; }
body.page-import-prod #prod-import-form { display: block; max-width: none; }
body.page-import-prod .prod-import-back { margin: 8px 0 32px; }
.empty-upload-icon { color: var(--text-muted); margin: 0 0 6px; }
.empty-upload-title { margin: 0 0 10px; font-size: var(--font-section); font-weight: 600; color: var(--text); }
.empty-upload-sub { margin: 0 0 18px; font-size: var(--font-meta); line-height: 1.7; color: var(--text-muted); }
.empty-upload .btn { min-width: 120px; }
.empty-upload-note { margin: 16px 0 0; font-size: var(--font-meta); color: var(--text-muted); }
/* 表格内空态行（统计页三表/明细弹窗）：居中弱化，不与数据行争夺注意力 */
td.empty-hint { text-align: center; color: var(--text-muted); }

/* 表格列映射（人工兜底）页 */
.map-form { max-width: none; }
.map-table { margin-top: 0; min-width: 0; white-space: normal; }
.map-table select { padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 14px; }
.map-actions { display: flex; gap: 10px; align-items: center; }

/* ===== Auth 入口视觉系统：登录 / 注册 / 注册成功 三页共享（.auth-page） ===== */
body.page-login .container { max-width: none; margin: 0; padding: 0; }

/* 下载中心/CAD 公开页铺满（2026-11-25 用户截图实锤 3560a44 假铺满）：
   真正卡宽的是 base.html main.container 的 960 帽——顶栏通栏而内容浮 960 小岛
   像没加载完；表格九列吃宽度。呼吸位由 .downloads-page 自带 24px padding 提供 */
body.page-downloads .container { max-width: none; margin: 0; padding: 0; }

body.page-login.auth-page {
  --auth-bg: #eef3f5;
  --auth-surface: #ffffff;
  --auth-text: #17212b;
  --auth-muted: #6d7b86;
  --auth-border: #d9e2e7;
  --auth-border-strong: #b8cbd3;
  --brand-primary: #0076fe;
  --brand-hover: #0069e6;

  --auth-danger: #b64343;
  background: var(--auth-bg);
  /* 登录页与主站同一字体栈，避免进入后台后字体突变 */
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Segoe UI", sans-serif;
}

/* 分栏壳：左品牌栏 + 右表单区（>900px 双栏；≤900px 折叠为顶部品牌条） */
.auth-page .auth-split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  min-height: 100svh;
}

.auth-page .auth-aside {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  /* 左 8vw 右 5vw：文字块经 .auth-content 向分栏中线收拢，不再贴左边缘 */
  padding: 48px 5vw 48px 8vw;
  box-sizing: border-box;
  background: linear-gradient(160deg, #0a4a75, #062f4e);
  color: #fff;
}

/* 品牌文字内容块：限宽后推向右侧（靠拢分栏中线），与表单卡形成向心组合 */
.auth-page .auth-content {
  width: min(620px, 100%);
  margin-left: auto;
}

.auth-page .auth-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.auth-page .auth-logo { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; }
.auth-page .auth-brand-name { font-size: 24px; line-height: 1.2; color: #fff; }

.auth-page .auth-slogan {
  margin: 14px 0 0;
  font-size: clamp(30px, 2.4vw, 44px);
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
}

/* 主口号副句：原品牌句降级为辅助行（2026-11-04 主口号改卖点先行） */
.auth-page .auth-slogan-sub {
  margin: 10px 0 0;
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.72);
}

.auth-page .auth-chips { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.auth-page .auth-chip {
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  font-size: 17px;
  color: rgba(255, 255, 255, 0.92);
}

/* 物料辅助说明：轻量一行，只表达「价格可配置」，不承诺库存/采购能力 */
.auth-page .auth-note {
  margin: 16px 0 0;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.84);
}

/* 线描插画：纯装饰（aria-hidden），右下角内收（不贴边），透明度经 currentColor 控制 */
.auth-page .auth-illus {
  position: absolute;
  right: 7%;
  bottom: 7%;
  width: min(420px, 38%);
  height: auto;
  color: rgba(255, 255, 255, 0.22);
  pointer-events: none;
}

.auth-page .auth-main {
  display: flex;
  flex-direction: column;
  /* 卡片靠向分栏中线（flex-start + 左内边距），大屏不再漂到右缘 */
  align-items: flex-start;
  justify-content: center;
  padding: 64px 24px 32px 6vw;
  box-sizing: border-box;
}

.auth-page .login-card {
  width: 100%;
  max-width: 424px;
  display: flex;
  flex-direction: column;
  padding: 34px 30px 28px;
  background: var(--auth-surface);
  border: 1px solid var(--auth-border);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(25, 55, 67, 0.08), 0 2px 8px rgba(25, 55, 67, 0.04);
  box-sizing: border-box;
  animation: login-enter 420ms cubic-bezier(.22, .8, .24, 1) both;
}
@keyframes login-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-page .login-card-head { margin-bottom: 20px; }
.auth-page .login-eyebrow {
  display: block;
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--auth-muted);
}
.auth-page .login-title { margin: 0 0 6px; font-size: 26px; line-height: 1.25; font-weight: 400; color: var(--auth-text); }
.auth-page .login-sub { margin: 0; font-size: 14px; line-height: 1.6; color: var(--auth-muted); }

.auth-page .login-card form { max-width: none; gap: 16px; }
.auth-page .login-card label { font-size: 14px; font-weight: 400; color: var(--auth-text); }
.auth-page .login-card input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--auth-border-strong);
  border-radius: 6px;
  font-size: 14px;
  color: var(--auth-text);
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}
.auth-page .login-card input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.auth-page .login-card .error {
  margin: 0 0 16px;
  padding: 10px 12px;
  background: rgba(182, 67, 67, 0.08);
  border: 1px solid rgba(182, 67, 67, 0.28);
  border-radius: 6px;
  color: var(--auth-danger);
  font-size: 14px;
}
/* 被挤下线提示：信息性质（非报错），蓝底与 error 区分 */
.auth-page .login-card .login-kicked {
  margin: 0 0 16px;
  padding: 10px 12px;
  background: rgba(28, 100, 242, 0.08);
  border: 1px solid rgba(28, 100, 242, 0.28);
  border-radius: 6px;
  color: #1c64f2;
  font-size: 14px;
}

.auth-page .auth-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.auth-page .auth-field label { font-size: 14px; font-weight: 400; color: var(--auth-text); }
/* 2026-11-16 用户纠偏：字段下辅助说明行——类名此前无配套 CSS 吃了 16px 默认字号，喧宾夺主 */
.auth-page .auth-hint { font-size: 14px; font-weight: 400; color: var(--auth-muted); margin: 0; }

.auth-page .pw-wrap { position: relative; display: block; }
.auth-page .pw-wrap input { width: 100%; padding-right: 48px; box-sizing: border-box; }
.auth-page .pw-toggle {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  height: 28px; min-width: 28px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--auth-muted);
  border: none; border-radius: 4px; cursor: pointer;
}
.auth-page .pw-toggle:hover { background: transparent; color: var(--brand-primary); }
.auth-page .pw-toggle:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}
.auth-page .pw-toggle .pw-icon { width: 18px; height: 18px; display: block; }
.auth-page .pw-toggle .pw-icon-eye-off { display: none; }
.auth-page .pw-toggle.pw-show .pw-icon-eye { display: none; }
.auth-page .pw-toggle.pw-show .pw-icon-eye-off { display: block; }

/* 历史账号下拉（参照三维家）：账号框箭头 + 白卡列表，行内 × 删除不要的账号 */
.auth-page .id-field { position: relative; }
.auth-page .id-wrap { position: relative; display: block; }
.auth-page .id-wrap input { width: 100%; padding-right: 48px; box-sizing: border-box; }
.auth-page .id-caret {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  height: 28px; min-width: 28px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--auth-muted);
  border: none; border-radius: 4px; cursor: pointer;
}
.auth-page .id-caret:hover { background: transparent; color: var(--brand-primary); }
.auth-page .id-caret:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.auth-page .id-caret svg { width: 18px; height: 18px; display: block; transition: transform 140ms ease; }
.auth-page .id-caret[aria-expanded="true"] svg { transform: rotate(180deg); }
/* hidden 属性显式兜底：类里的 display:inline-flex 会压过 UA 的 [hidden]{display:none} */
.auth-page .id-caret[hidden] { display: none; }
.auth-page .id-history {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  margin: 0; padding: 4px; list-style: none;
  background: #fff; border: 1px solid var(--auth-border-strong); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
  max-height: 264px; overflow-y: auto;
}
/* display 切换走 hidden 属性，显式兜底防止类样式压过它 */
.auth-page .id-history[hidden] { display: none; }
.auth-page .id-option { display: flex; align-items: center; gap: 2px; }
.auth-page .id-pick {
  flex: 1; min-width: 0; text-align: left;
  min-height: 36px; padding: 0 10px; box-sizing: border-box;
  background: transparent; border: none; border-radius: 6px; cursor: pointer;
  font-size: 14px; color: var(--auth-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.auth-page .id-option:hover .id-pick,
.auth-page .id-pick:focus-visible { background: var(--surface-muted); }
.auth-page .id-del {
  flex: none; width: 28px; height: 28px; padding: 0; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: 6px; cursor: pointer;
  font-size: 16px; color: var(--auth-muted);
}
.auth-page .id-del:hover { color: #b64343; background: rgba(182, 67, 67, 0.08); }

.auth-page .login-submit {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; min-height: 50px; padding: 0 18px;
  border: 0; border-radius: 6px; box-sizing: border-box;
  background: var(--action-primary); color: #fff;
  font: inherit; font-size: 15px; font-weight: 400; line-height: 1.2;
  text-align: center; text-decoration: none; cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}
.auth-page .login-submit:hover { background: var(--brand-hover); color: #fff; text-decoration: none; }
.auth-page .login-submit:active { transform: translateY(1px); }
.auth-page button.login-submit:disabled { background: var(--color-disabled); color: #fff; cursor: not-allowed; transform: none; }
.auth-page .login-submit:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 3px; }

.auth-page .login-secondary {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--auth-muted);
}
.auth-page .login-secondary a { color: var(--brand-primary); font-weight: 400; }
/* 忘记密码提示（登录页卡内）：独占一行的静音文案；重置由工厂管理员操作，站内无自助流程 */
.auth-page .login-secondary .login-hint { width: 100%; font-size: 14px; }
.auth-page .login-secondary a:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; border-radius: 2px; }

/* 免费注册次级按钮（登录页卡内）：描边空心，视觉重量低于实心登录主按钮 */
.auth-page .login-secondary .register-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 0 18px;
  box-sizing: border-box;
  border: 1px solid var(--auth-border-strong);
  border-radius: 6px;
  background: var(--auth-surface);
  color: var(--auth-text);
  font: inherit;
  font-size: 15px;
  text-decoration: none;
  transition: border-color 160ms ease, color 160ms ease;
}
.auth-page .login-secondary .register-secondary:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  text-decoration: none;
}
.auth-page .login-secondary .register-secondary:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 3px;
  border-radius: 6px;
}

.auth-page .login-footer {
  margin-top: auto;
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: var(--auth-muted);
}
.auth-page .login-footer::before { content: ""; display: block; align-self: stretch; border-top: 1px solid var(--auth-border); }

@media (max-width: 900px) {
  /* align-content: start：单列时不让 min-height 的富余空间把品牌条行撑高 */
  .auth-page .auth-split { grid-template-columns: 1fr; align-content: start; }
  .auth-page .auth-aside { gap: 0; padding: 10px 16px; }
  .auth-page .auth-content { width: auto; margin: 0; }   /* 品牌条恢复满宽一行 */
  .auth-page .auth-logo { width: 34px; height: 34px; }   /* 手机品牌条保持原尺寸 */
  .auth-page .auth-brand-name { font-size: 22px; }
  .auth-page .auth-slogan,
  .auth-page .auth-slogan-sub,
  .auth-page .auth-chips,
  .auth-page .auth-note,
  .auth-page .auth-illus { display: none; }   /* 品牌条只留一行；口号/标签/说明/插画隐藏 */
  .auth-page .auth-brand-row,
  .auth-page .auth-brand-link { white-space: nowrap; }
  .auth-page .auth-main { padding: 20px 16px 24px; }   /* 表单顶部间距紧凑 */
}

@media (max-width: 720px) {
  .auth-page .login-card { padding: 24px 20px; box-shadow: 0 8px 24px rgba(25, 55, 67, 0.06); }
}

/* 一次性入场动效（纯 CSS）：仅在用户未偏好减弱动效时生效；
   只动 opacity/transform/stroke-dashoffset，不改布局，不影响登录按钮可点击时间。
   reduced-motion 下本块整体不生效（完全静止）；下方 1ms 覆盖块为第二道保险。 */
@media (prefers-reduced-motion: no-preference) {
  .auth-aside .auth-brand-row,
  .auth-aside .auth-slogan,
  .auth-aside .auth-slogan-sub,
  .auth-aside .auth-chips,
  .auth-aside .auth-note,
  .auth-aside .auth-illus {
    animation: auth-rise 500ms ease-out both;
  }
  .auth-aside .auth-slogan { animation-delay: 80ms; }
  .auth-aside .auth-slogan-sub { animation-delay: 120ms; }
  .auth-aside .auth-chips { animation-delay: 160ms; }
  .auth-aside .auth-note { animation-delay: 200ms; }
  .auth-aside .auth-illus { animation-delay: 240ms; }
  .auth-illus path,
  .auth-illus rect {
    stroke-dasharray: 700;
    animation: auth-draw 1000ms ease-out both;
    animation-delay: 300ms;
  }
  .auth-page .login-card { animation-delay: 120ms; }
}
@keyframes auth-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes auth-draw {
  from { stroke-dashoffset: 700; }
  to { stroke-dashoffset: 0; }
}

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

/* ===== 登录页独有（品牌并入卡片 + 记住登录 + 账号提示） ===== */
.login-page .login-secondary { justify-content: center; }
.login-page button.login-submit { font-size: 18px; font-weight: 400; min-height: 38px; }
.login-page .login-secondary a { font-size: 14px; }

.login-page .login-tenant {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  margin: 0 0 16px;
  padding: 10px 12px;
  background: var(--brand-soft);
  border: 1px solid #cfe3e7;
  border-radius: 6px;
  font-size: 14px;
  color: var(--auth-text);
}
.login-page .login-tenant span { font-size: 14px; color: var(--auth-muted); }
.login-page .login-tenant strong { font-weight: 400; }

.login-page .login-remember {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 400;
  color: var(--auth-text);
  cursor: pointer;
}
.login-page .login-remember input { width: auto; min-height: 0; padding: 0; }
.login-page .login-remember-note,.login-page .login-account-note { display: none; }

/* ===== 注册页独有（字段说明） ===== */
.register-page .login-card form { gap: 18px; }
.register-page .field-hint { margin: -2px 0 0; font-size: 14px; line-height: 1.45; font-weight: 400; color: var(--auth-muted); }

.register-page .login-secondary { justify-content: center; }
.register-page button.login-submit { font-size: 18px; min-height: 38px; }

/* ===== 注册成功页独有（弱化网格 + 结构化交付信息 + 复制） ===== */
.register-success-page .login-submit { min-height: 38px; font-size: 18px; font-weight: 400; }

.register-success-page .success-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-primary);
}
.register-success-page .success-mark svg { width: 22px; height: 22px; }

.register-success-page .success-details { margin: 0 0 20px; }
.register-success-page .success-detail { margin: 0 0 14px; }
.register-success-page .success-detail:last-child { margin-bottom: 0; }
.register-success-page .success-detail dt { margin: 0 0 4px; font-size: 13px; color: var(--auth-muted); }
.register-success-page .success-detail dd {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px 10px;
  font-size: 15px;
  color: var(--auth-text);
}
.register-success-page .success-detail code {
  flex: 1 1 240px;
  min-width: 0;
  padding: 6px 10px;
  background: var(--brand-soft);
  border: 1px solid #cfe3e7;
  border-radius: 6px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 16px;
  color: var(--auth-text);
  overflow-wrap: anywhere;
  word-break: break-word;
}
/* 工厂编码是次要信息（以后邀请成员/处理登录问题时才用得上）：视觉放轻，保留复制入口 */
.register-success-page .success-detail.subtle code {
  font-size: 14px;
  color: var(--auth-muted);
}
.register-success-page .success-detail dd .copy-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--auth-border-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--brand-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.register-success-page .success-detail dd .copy-btn:hover { background: var(--brand-soft); border-color: var(--brand-primary); }
.register-success-page .success-detail dd .copy-btn:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 3px; }
.register-success-page .success-detail dd .copy-btn svg { width: 14px; height: 14px; }

.register-success-page .success-note { margin: 0 0 20px; font-size: 14px; line-height: 1.6; color: var(--auth-muted); }

.register-success-page .copy-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 720px) {
  .register-page .decoration-measure { display: none; }
  .register-success-page .success-detail dd { display: grid; gap: 8px; }
  .register-success-page .success-detail dd .copy-btn { justify-self: end; }
}

/* 使用说明页（SSR，卡片式分节，仿设置页排版） */
.help-page { display: flex; flex-direction: column; gap: 16px; }
.help-page .help-intro { margin: 0; line-height: 1.6; }
.help-page .help-section { padding: 20px 24px; }
.help-page h2 { margin: 0 0 12px; font-size: 17px; color: var(--text); }
.help-page h2::before { content: ""; display: inline-block; width: 4px; height: 16px; background: var(--brand-primary); border-radius: 2px; margin-right: 8px; vertical-align: -2px; }
/* 车间段落内的共享片段用 h3 小标题（与工作台弹窗同一份内容） */
.help-page h3 { margin: 16px 0 6px; font-size: 15px; color: var(--brand-primary); }
.help-page .help-workshop > section:first-of-type h3 { margin-top: 8px; }
.help-page h4 { margin: 14px 0 4px; font-size: 14px; color: var(--text); }
.help-page .help-chapter { scroll-margin-top: 16px; }
.help-page p { margin: 8px 0; line-height: 1.7; color: var(--text); }
.help-page ul, .help-page ol { margin: 8px 0; padding-left: 22px; }
.help-page li { margin: 5px 0; line-height: 1.7; }
.help-page b { font-weight: 600; }
.help-page code { background: #f1f5f9; border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; font-size: 13px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.help-page kbd { background: #fff; border: 1px solid #cbd5e1; border-bottom-width: 2px; border-radius: 4px; padding: 1px 6px; font-size: 12px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.help-page a { color: var(--brand-primary); text-decoration: none; }
.help-page a:hover { text-decoration: underline; }
.help-page .help-toc { padding: 16px 24px; }
.help-page .help-toc b { display: block; margin-bottom: 8px; }
.help-page .help-toc ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; }
.help-page .help-toc li { margin: 0; }
.help-page .help-version { margin-top: 16px; font-size: 13px; }

/* 车间统计页（page-workshop-stats，Task 8） */
.page-workshop-stats .card { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 8px; }
.page-workshop-stats .card-title { margin: 0 0 10px; font-size: 15px; }
.page-workshop-stats .stats-meta { margin: 10px 2px 0; font-size: 12px; }
.page-workshop-stats .pager-line { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 13px; }
.page-workshop-stats .date-custom input[type="date"] { padding: 3px 6px; }
/* 预设胶囊与主界面筛选一致：覆盖全局 button 蓝底样式，
   未选中透明文字；重置特异性高于全局 .active，故选中/悬停需同权重补回 */
.page-workshop-stats .date-filter-tabs button.date-filter-item {
  height: auto; line-height: normal; padding: 3px 10px;
  background: none; border: 1px solid transparent; border-radius: 3px; color: #1f2933;
}
.page-workshop-stats .date-filter-tabs button.date-filter-item:hover {
  background: var(--brand-soft); color: var(--brand-primary);
}
.page-workshop-stats .date-filter-tabs button.date-filter-item.active {
  background: var(--brand-primary); color: #fff; border-color: var(--brand-primary);
}
.page-workshop-stats .row-btn { border: none; background: none; color: var(--brand-primary, #0076fe); cursor: pointer; padding: 0; font-size: 13px; }
.page-workshop-stats .tag-revoked { color: #b54708; }
.page-workshop-stats #items-dialog { width: 980px; max-width: 94vw; }
/* 明细弹窗现场核查工具条：搜索 + 房间/柜体筛选 + 结果数 + 复制 */
.page-workshop-stats .items-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.page-workshop-stats .items-filters input[type="text"] {
  height: var(--control-height); padding: 0 8px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); width: 200px; font-size: var(--font-body);
}
.page-workshop-stats .items-filters select {
  height: var(--control-height); border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: #fff; max-width: 170px; font-size: var(--font-body);
}
.page-workshop-stats .items-filters #items-copy { margin-left: auto; }
.page-workshop-stats .custom-toggle { cursor: pointer; }
.page-workshop-stats .page-toolbar { flex-wrap: wrap; }
.page-workshop-stats .page-toolbar > * { min-width: 0; max-width: 100%; }
.page-workshop-stats .toolbar-right { flex-wrap: wrap; }
.page-workshop-stats .toolbar-search input { min-width: 0; width: 260px; max-width: 100%; }
.page-workshop-stats .pager-line { flex-wrap: wrap; }
.page-workshop-stats .date-custom { max-width: 100%; }
.page-workshop-stats .date-custom input { min-width: 0; }

/* 全宽布局（仅本页）：铺满视口，窄屏两侧仅留呼吸边距；
   .container 原 max-width:960px 与 padding:0 20px 都在此覆盖 */
.page-workshop-stats .container { max-width: none; margin: 12px 16px; padding: 0; }
@media (max-width: 640px) {
  .page-workshop-stats .container { margin: 8px 10px; }
}

/* 五卡指标（本页主视觉）：2+3 两个无边框分组容器以留白分区，颜色仍表达
   工序（浅蓝/蓝/绿）；组间 24px、组内 16px，窄屏先两组上下排、组内卡片
   再自行换行（flex-wrap 天然达成，不按第几张卡写分隔规则）；
   卡片浅彩底+1px 同色边，不用阴影 */
.page-workshop-stats .kpi-groups { display: flex; flex-wrap: wrap; gap: 24px; }
.page-workshop-stats .kpi-group { flex: 1 1 auto; min-width: 0; }
.page-workshop-stats .kpi-group-cards { display: flex; flex-wrap: wrap; gap: 16px; }
.page-workshop-stats .kpi-group-cards .kpi-card { flex: 1 1 230px; min-width: 0; }
/* 非管理员左组仅订单数一卡：不参与行内拉伸，保持单卡宽度、不留报价空位 */
.page-workshop-stats .kpi-group-single { flex: 0 1 auto; }
.page-workshop-stats .kpi-group-single .kpi-card { flex: 0 1 230px; }
.page-workshop-stats .kpi-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 20px 16px; text-align: center;
  border-radius: var(--radius-md);
}
.page-workshop-stats .kpi-label { font-weight: 600; color: var(--text); }
/* 次行由 min-height 预留高度：无副信息的卡（报价/打包包数）留空 div 即可，五卡次行对齐 */
.page-workshop-stats .kpi-sub { min-height: 20px; color: var(--text-secondary); }
.page-workshop-stats .kpi-c-sky { background: #eff6ff; border: 1px solid #bfdbfe; }
.page-workshop-stats .kpi-c-sky .kpi-value { color: var(--brand-primary); }
.page-workshop-stats .kpi-c-blue { background: #dbeafe; border: 1px solid #93c5fd; }
.page-workshop-stats .kpi-c-blue .kpi-value { color: #1d4ed8; }
.page-workshop-stats .kpi-c-green { background: #dcfce7; border: 1px solid #86efac; }
.page-workshop-stats .kpi-c-green .kpi-value { color: #15803d; }

/* 当前进度单元格：复用公共 ws-prog 组件（完成绿/进行中蓝/未开始灰），本页加宽 */
.page-workshop-stats .ws-prog { gap: 8px; }
.page-workshop-stats .ws-prog .prog-bar { width: 64px; }

/* 字体统一 14px（同 page-settings 的统一惯例，置于段尾覆盖前文 12/13px）；
   KPI 数值为主角（44/600），其余回归层级：标签 16、说明/元信息 13（KPI 次行 14） */
.page-workshop-stats .container, .page-workshop-stats .container * { font-size: 14px; }
.page-workshop-stats .kpi-value { font-size: 44px; line-height: 1.1; font-weight: 600; }
.page-workshop-stats .kpi-label { font-size: var(--font-section); }
.page-workshop-stats .kpi-sub { font-size: var(--font-body); }
.page-workshop-stats .stats-meta, .page-workshop-stats .ws-prog-num,
.page-workshop-stats .ws-prog-none { font-size: var(--font-meta); }
.page-workshop-stats .date-filter-label { font-size: var(--font-title); font-weight: 600; color: var(--text); }
/* 工具栏左右内边距与 stats-meta（2px）对齐，避免「数据统计」与导出按钮两侧缩进 */
.page-workshop-stats .page-toolbar { padding: 10px 2px; }

/* 搜索板件（本页第三页签，现场主入口）：页签条复用 date-filter 视觉；状态徽标按
   业务语义配色——未分拣灰 / 已分拣蓝 / 已打包绿 / 历史琥珀 / 撤包史橙；
   尺寸筛选生效列淡蓝描边（loc-hit），关键词命中 <mark> 淡黄 */
.page-workshop-stats .ws-tabs { margin: 16px 0 12px; }
.page-workshop-stats .locator-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
/* 可搜索订单选择框：输入只过滤候选，点击/Enter 候选才切订单；候选浮层盖在
   表格上方，历史快照带「历史记录」琥珀徽标（复用 loc-st-hist）。选择框与
   板件关键词同行（flex:1 平分，空间不足自动换行）。 */
.page-workshop-stats .loc-order-box { position: relative; flex: 1 1 280px; min-width: 240px; }
.page-workshop-stats .loc-order-box #loc-order { width: 100%; padding-right: 30px; }
.page-workshop-stats .loc-order-clear {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  border: none; background: none; padding: 0 4px; cursor: pointer;
  font-size: 15px; line-height: 1; color: var(--text-muted);
}
.page-workshop-stats .loc-order-clear:hover { color: var(--text-primary); }
.page-workshop-stats .loc-order-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 40;
  max-height: 280px; overflow-y: auto; padding: 4px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .14);
}
.page-workshop-stats .loc-order-item {
  display: block; width: 100%; padding: 7px 10px; text-align: left; cursor: pointer;
  border: none; border-radius: 6px; background: none; font: inherit; color: inherit;
}
.page-workshop-stats .loc-order-item:hover,
.page-workshop-stats .loc-order-item.active { background: #eef4ff; }
.page-workshop-stats .loc-order-item .loc-tag { margin-right: 6px; }
.page-workshop-stats .loc-order-empty { padding: 10px; text-align: center; color: var(--text-muted); }
.page-workshop-stats .locator-bar input[type="text"] {
  flex: 1; min-width: 220px; height: var(--control-height);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 10px;
}
.page-workshop-stats .loc-dims { display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: center; margin: 4px 0; }
.page-workshop-stats .dim-row { display: flex; align-items: center; gap: 4px; }
.page-workshop-stats .dim-row > label { color: var(--text-secondary); }
.page-workshop-stats .dim-row input {
  height: var(--control-height); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0 6px; width: 84px;
}
.page-workshop-stats .dim-row .loc-about { width: 64px; }
.page-workshop-stats .dim-sep { color: var(--text-muted); }
.page-workshop-stats .loc-swap { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.page-workshop-stats .loc-hint { margin: 4px 0 8px; }
.page-workshop-stats .loc-result-bar { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.page-workshop-stats .th-sort { border: none; background: none; padding: 0; cursor: pointer; font: inherit; color: inherit; }
.page-workshop-stats .th-sort.asc::after { content: " ↑"; }
.page-workshop-stats .th-sort.desc::after { content: " ↓"; }
.page-workshop-stats .loc-tag {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: var(--font-meta); white-space: nowrap;
}
.page-workshop-stats .loc-st-unsorted { background: #e5e7eb; color: #4b5563; }
.page-workshop-stats .loc-st-sorted { background: #dbeafe; color: #1d4ed8; }
.page-workshop-stats .loc-st-packed { background: #dcfce7; color: #15803d; }
.page-workshop-stats .loc-st-hist { background: #fef3c7; color: #b45309; }
.page-workshop-stats .loc-st-revoked { background: #ffedd5; color: #c2410c; }
.page-workshop-stats .loc-warn { color: #b54708; }
.page-workshop-stats .loc-hit { outline: 1px solid #93c5fd; outline-offset: -1px; }
.page-workshop-stats mark { background: #fef08a; padding: 0 1px; }
.page-workshop-stats .piecework-panel { margin-top: 16px; }
.page-workshop-stats .section-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-workshop-stats #loc-limit {
  height: var(--control-height); border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: #fff;
}
/* 报价板件计费规则标识与基础价旁的只读计费价 */
/* 徽章 user-select:none：徽章与材料名同格，可选中会被连字复制出「兔宝宝PET缺价」这类错价键（2026-10-27 实况） */
.page-quote .row-badge { display: inline-block; margin-left: 5px; padding: 1px 5px; border-radius: 8px; font-size: 11px; white-space: nowrap; user-select: none; }
.page-quote .badge-accurate { color: #92400e; background: #fef3c7; }
.page-quote .badge-purchased { color: #1e40af; background: #dbeafe; }
.page-quote .badge-missing { color: #b91c1c; background: #fee2e2; }
/* 板材两级树（2026-11-07）：组头汇总行可点展开，子行缩进 */
.page-quote tr.panel-group { cursor: pointer; background: #f7f9fb; }
.page-quote tr.panel-group td { font-weight: 500; }
.page-quote tr.panel-group .g-arrow { display: inline-block; width: 14px; color: #8a8a8a; transition: transform .15s; }
.page-quote tr.panel-group.open .g-arrow { transform: rotate(90deg); }
.page-quote tr.panel-child td:first-child { padding-left: 14px; }
/* 导入结果横幅（2026-11-09）：一行结果+中性要点、细节折叠、右上角小 × */
.banner { position: relative; }
.banner-x { position: absolute; top: 6px; right: 8px; border: none; background: none; color: #6b7280; font-size: 18px; line-height: 1; cursor: pointer; padding: 4px; }
.banner-x:hover { color: #111; }
.banner-sub { margin: 4px 0 0; font-size: 13px; color: #5a6b7d; }
.banner-more { margin-left: 10px; color: #1d4ed8; text-decoration: none; white-space: nowrap; }
.banner-more:hover { text-decoration: underline; }

/* 历史原件紧凑行（2026-11-09）：标题+各版本同排，间距 14px、可换行 */
.orig-line { margin: 0; font-size: 13px; line-height: 1.6; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.orig-title { font-weight: 600; }
.orig-item a { text-decoration: none; }
.orig-item a:hover { text-decoration: underline; }

/* 订单详情页房间分组（2026-11-07）：组头可点展开，子行缩进 */
tr.room-group { cursor: pointer; background: #f7f9fb; }
tr.room-group td { font-weight: 500; }
tr.room-group .g-arrow { display: inline-block; width: 14px; color: #8a8a8a; transition: transform .15s; }
tr.room-group.open .g-arrow { transform: rotate(90deg); }
tr.room-child td:first-child { padding-left: 14px; color: #8a8a8a; }
.room-count-badge { margin-left: 8px; padding: 1px 8px; border-radius: 10px; background: #eef2f7; color: #5a6b7d; font-size: 12px; font-weight: 400; }
/* 门店价徽章（门店定价 P1）：蓝底标示该行取价来自门店价本；同样禁选中防复制连字 */
.page-quote .badge-shop { color: #1d4ed8; background: #dbeafe; }
/* 分档徽章（计价引擎 P1）：青底标示该行取价命中分档（档名并集）；同样禁选中防复制连字 */
.page-quote .badge-tier { color: #fff; background: #0e7490; }
/* 缺价横幅：两条建价路径提示（报价页改价入库 / 价格库一键建行） */
/* 未绑定门店智能提示（方案三）：信息级蓝底，区别于缺价横幅的红；按钮样式沿用主按钮 */
.page-quote .shop-hint-banner button { margin-left: 8px; padding: 4px 10px; font-size: 13px; }
/* 价格库预填行来源说明 */
.page-prices .prefill-note-row td { padding: 6px 10px; font-size: 13px; color: #9f1239;
  background: #fff1f2; border: 1px solid #fecdd3; }
/* 缺价行整行浅红高亮（防报价员漏报）：徽章只随 row-missing 显隐，JS 输入单价后实时摘掉 */
.page-quote tr.row-missing td { background: #fff1ef; }
.page-quote tr:not(.row-missing) .badge-missing { display: none; }
/* 不输出不报价行整行置灰：行留着（管理员可改回正常），但一眼可见不参与报价与导出 */
.page-quote tr.row-skip td { background: #f3f4f6; color: #9ca3af; }
.page-quote tr.row-skip input.unit { color: #9ca3af; }
/* 不报价行（输出不报价/不输出不报价）单价/金额显示 — 而非 0：0 会被当成缺价去改价。
   输入框保留在 DOM（JS 联动/改回正常恢复库价依赖它），仅 CSS 隐藏、原位补 — */
.page-quote #metal-table tr[data-output="输出不报价"] td.munit input.unit,
.page-quote #metal-table tr[data-output="不输出不报价"] td.munit input.unit { display: none; }
.page-quote #metal-table tr[data-output="输出不报价"] td.munit::after,
.page-quote #metal-table tr[data-output="不输出不报价"] td.munit::after { content: "—"; color: #9ca3af; }
/* 选中行浅蓝高亮：点进输入框提示正在改哪行；置于 row-missing 之后，编辑时蓝底优先于缺价红底 */
.page-quote tr.row-active td { background: #eef5ff; }
.page-quote .billing-note { display: block; color: var(--text-muted); font-size: 12px; white-space: nowrap; }
/* 上次报价对照角标（②基础版）：走 row-badge 彩底体系（同「缺价」款的醒目度），琥珀底区别于缺价红；
   可点击填入输入框 → cursor:pointer */
.page-quote .prev-price { color: #92400e; background: #fef3c7; cursor: pointer; }
/* 设为最终报价（批C 2026-11-11）：★徽章——记录列表「最终」列 + 回看页横幅；
   琥珀金系与订单详情「已冻结」chip 同族（金=对客定稿语义），加粗区别于「上次」角标 */
.page-quote .badge-final { color: #92400e; background: #fef3c7; font-weight: 600; }
/* 批B⑤（2026-11-11）：对照条并入价格表卡片顶部（原独立 card 撤除），计数徽章与行内「上次」角标同琥珀系 */
.page-quote .prev-strip { margin: 0 0 10px; font-size: 13px; color: var(--text-muted); }
.page-quote .prev-chip { display: inline-block; background: #fef3c7; color: #92400e; border-radius: 999px; padding: 1px 9px; margin: 0 2px; font-size: 12px; font-weight: 600; }
/* 其他费用页签增删行（批1③）：本单显式清单——添加按钮行 + 自由行名称输入框 */
.other-toolbar { display: flex; align-items: center; gap: 12px; padding: 10px 2px 0; flex-wrap: wrap; }
.other-toolbar .muted { font-size: 12px; }
.page-quote #other-table input.fee-name { width: 220px; box-sizing: border-box; }
/* 存价勾选弹窗（批1④）：默认勾选本次改过价的行，未勾选只跳过库回写 */
.modal-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); z-index: 1000;
  display: flex; align-items: center; justify-content: center; }
.modal-mask.hidden { display: none; }   /* 本规则在全局 .hidden 之后，须显式压过 display:flex */
/* 弹窗 v3（2026-10-30）：可编辑键列 + 通配徽章 + 计价方式下拉 + 未定价价格框。
   控件一律定宽——auto 表格里 width:100% 会互相抢宽把徽章挤出列、单价框贪宽 */
.sp-table .sp-key, .sp-table .sp-price {
  padding: 2px 6px; font-size: 14px;
  border: 1px solid var(--border); border-radius: 3px; box-sizing: border-box;
}
.sp-table .sp-key { width: 160px; }
/* 键列按字段分宽（2026-10-30 用户实测：颜色缩在左边、五金规格显示不全）：
   颜色/名称/规格是主要辨识列给足；超长值输入框内横向滚动 */
.sp-table .sp-key[data-field="material"] { width: 260px; }
.sp-table .sp-key[data-field="name"] { width: 200px; }
.sp-table .sp-key[data-field="style"] { width: 300px; }
.sp-table .sp-price { width: 90px; text-align: right; }
.sp-table select { width: 96px; padding: 2px 4px; font-size: 14px; border: 1px solid var(--border); border-radius: 3px; }
.sp-table .wildcard-badge { display: inline-block; margin-left: 4px; padding: 0 6px;
  border-radius: 999px; font-size: 12px; color: #5a6b7d; background: #eef2f6; user-select: none; }
/* 弹窗改动即高亮（2026-10-30）：行内键/价/计价方式偏离初值 → 整行浅黄。
   悬停/焦点叠加层走统一规则（#main-table td 之后总块），黄底不再被覆盖。 */
.sp-table tr.sp-changed td { background: #fef9c3; }
/* 对比列（D）：库原值 → 新值；无库行显示「新建」 */
.sp-table td.sp-diff { color: #64748b; font-size: 13px; white-space: nowrap; }
/* 保存结果区（A/C/E）：摘要 + 关闭/去补分档/刷新本单 */
.sp-result { margin-top: 12px; padding: 12px 14px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 6px; }
.sp-result-text { margin: 0 0 10px; font-size: 14px; color: #166534; }
.sp-result-actions { display: flex; justify-content: flex-end; gap: 8px; }
/* .btn 的 display:inline-block 会压过 UA 的 [hidden]{display:none}——结果区按钮显隐失效 */
#save-prices-result [hidden] { display: none; }
.sp-dialog { background: #fff; border-radius: 8px; padding: 16px 20px; width: min(1200px, 96vw); font-size: 14px;
  max-height: 80vh; display: flex; flex-direction: column; box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18); }
.sp-dialog h3 { margin: 0 0 6px; font-size: 16px; }
.sp-groups { overflow: auto; border: 1px solid #e5e7eb; border-radius: 6px; padding: 6px 12px; }
.sp-group-title { font-weight: 600; margin: 8px 0 4px; font-size: 14px; color: var(--text-muted, #6b7280); }
/* 存价弹窗横向表格（2026-10-29）：按组拆列，观感对齐报价页页签表格 */
.sp-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 2px 0 8px; table-layout: auto; }
.sp-table th { font-weight: 600; text-align: left; padding: 4px 8px;
  border-bottom: 1px solid #e5e7eb; white-space: nowrap; color: var(--text-muted, #6b7280); }
.sp-table td { padding: 4px 8px; border-bottom: 1px solid #f1f5f9; white-space: nowrap; }  /* 一行不折两行 */
.sp-table tbody tr:last-child td { border-bottom: none; }
.sp-table th.sp-num-head, .sp-table td.sp-num { text-align: right; white-space: nowrap; }
.sp-table td.sp-mute { color: var(--text-muted, #6b7280); }
.sp-footer { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.sp-footer #save-prices-count { font-size: 12px; }
.sp-footer .btn { margin-left: auto; }
.sp-footer .btn + .btn { margin-left: 0; }
/* 全选行（2026-11-04 用户反馈：框和「全选」上下叠成两行）：全局 label{flex-direction:column}
   把文字压到框下方、全局 input 的 10px 内边距又把框撑大——照价格表 .chk label 的修法横排同高 */
.sp-checkall { display: inline-flex; flex-direction: row; gap: 0; align-items: center; white-space: nowrap; }
.sp-checkall input[type="checkbox"] { width: 14px; height: 14px; padding: 0; margin-right: 4px; }

/* 主界面拖拽导入订单：文件拖入页面时的全屏虚线提示框（app.js 动态挂载） */
.drop-overlay {
  display: none; position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 999;
  align-items: center; justify-content: center;
  background: rgba(0, 118, 254, 0.08);
  border: 3px dashed var(--brand-primary); border-radius: 8px;
  color: var(--brand-primary); font-size: 24px; font-weight: 600;
  pointer-events: none;   /* 覆盖层不挡事件，drop 始终落在 document 上 */
}
.drop-overlay.on { display: flex; }
/* 详情页三表列排序（2026-10-31）：表头可点提示，箭头沿用主界面样式 */
.page-order-detail th.sortable { cursor: pointer; user-select: none; }
.page-order-detail th.sortable:hover { color: var(--brand-primary); }
.page-order-detail th.sortable .sort-hint { color: var(--text-muted); font-size: 12px; }
.page-order-detail th.sortable:hover .sort-hint { color: var(--brand-primary); }
/* 报价页各页签列排序（2026-10-31）：表头可点提示 */
.page-quote th.sortable { cursor: pointer; user-select: none; }
.page-quote th.sortable:hover { color: var(--brand-primary); }
.page-quote th.sortable .sort-hint { color: var(--text-muted); font-size: 12px; }
.page-quote th.sortable:hover .sort-hint { color: var(--brand-primary); }
/* 设置价格库表头排序（2026-10-31）：可点提示 */
.price-edit-table th.sortable:hover { color: var(--brand-primary); }
.price-edit-table th.sortable .sort-hint { color: var(--text-muted); font-size: 12px; }
.price-edit-table th.sortable:hover .sort-hint { color: var(--brand-primary); }
/* 门店价本「当前门店」标识（2026-10-31）：改价前一眼确认在改哪家店 */
/* 门店价本店名胶囊（2026-10-31 用户拍板：只显示店名、蓝底白字；与搜索框同一行右对齐） */
/* 门店价本工具栏（2026-10-31 用户拍板）：店名绝对居中，右侧组右对齐；
   说明条绝对定位展开，不挤动任何元素（点 ⓘ 店名不挪位） */
body.page-settings .panel-toolbar.shop-toolbar {
  position: relative; flex-wrap: nowrap; margin: 12px 0;
}
body.page-settings .shop-toolbar .shop-book-hint {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  margin: 0; display: flex; align-items: center; gap: 6px;
}
.shop-toolbar .shop-book-hint .tab-hint {
  position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  width: min(760px, 80vw); z-index: 20; white-space: normal; margin: 0;
}
body.page-settings .shop-toolbar .shop-toolbar-right {
  margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.shop-book-tag { display: inline-flex; align-items: center; gap: 4px; padding: 0 14px;
  height: 32px; border-radius: 999px; background: var(--brand-primary); color: #fff;
  font-size: 14px; font-weight: 600; white-space: nowrap; }
.shop-book-tag .tab-info { margin-left: 2px; color: #fff; opacity: .9; }
/* 通用返回链接（设置子页）：沿用报价页返回链样式 */
.page-back { display: inline-block; margin: 0 0 8px; font-size: 13px;
  color: var(--brand-primary); text-decoration: none; }
.page-back:hover { text-decoration: underline; }

/* 门店页 ⓘ 并入工具栏（2026-10-31）：右对齐同排，说明条向下浮层不占行 */
body.page-settings .panel-toolbar .shops-hint {
  margin: 0 0 0 auto; position: relative; display: flex; align-items: center;
}
.shops-hint .tab-hint {
  position: absolute; top: calc(100% + 6px); right: 0; left: auto;
  width: min(560px, 80vw); z-index: 20; white-space: normal; margin: 0; text-align: left;
}
/* 价格库六页 ⓘ 并入工具栏（2026-10-31）：与清空全部同排，说明向下浮层不占行 */
body.page-settings .panel-toolbar .price-hint {
  position: relative; display: inline-flex; align-items: center; margin: 0 0 0 4px;
}
.price-hint .tab-hint {
  position: absolute; top: calc(100% + 6px); right: 0;
  width: min(760px, 80vw); z-index: 20; white-space: normal; margin: 0; text-align: left;
}
/* 报价页当前绑定门店胶囊（2026-10-31）：蓝底白字；未绑定灰底 */
/* 「报价门店」标签蓝底白字（2026-11-01 用户拍板）；下拉框保持默认配色不变。
   「计价方式」标签同款胶囊（2026-11-04 用户反馈：样式参照报价门店） */
.quote-field.shop-field label,
.quote-field.mode-field label {
  background: var(--brand-primary); color: #fff; font-weight: 600;
  padding: 1px 8px; border-radius: 4px;
}

/* 覆盖导入确认弹窗（2026-11-09，overwrite-confirm.js 动态注入 .ocf-*）：三个入口
 * （导入生产版/导入页并入/历史原件重导）共用的覆盖前差异摊开——数量、条码增删、字段变化 */
.ocf-wrap { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center;
  justify-content: center; background: rgba(16, 24, 40, 0.5); }
.ocf-wrap[hidden] { display: none; }
.ocf-box { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 64px); overflow: auto;
  background: #fff; border-radius: 12px; padding: 18px 20px 16px; box-shadow: 0 12px 32px rgba(16, 24, 40, 0.22); }
.ocf-title { margin: 0 0 6px; font-size: 16px; font-weight: 600; color: #b42318; }
.ocf-head { margin: 0 0 10px; font-size: 13.5px; color: var(--text-muted, #667085);
  word-break: break-all; }
.ocf-table { width: 100%; border-collapse: collapse; margin: 0 0 8px; font-size: 13.5px; }
.ocf-table th, .ocf-table td { padding: 5px 8px; border-bottom: 1px solid var(--brand-border, #d0d5dd); text-align: left; }
.ocf-table th { color: var(--text-muted, #667085); font-weight: 500; }
.ocf-table td:nth-child(2), .ocf-table td:nth-child(3), .ocf-table td:nth-child(4), .ocf-table th:nth-child(2), .ocf-table th:nth-child(3), .ocf-table th:nth-child(4) { text-align: right; }
.ocf-rows { margin: 0 0 8px; }
.ocf-line { margin: 3px 0; font-size: 13px; }
.ocf-line.ocf-warn { color: #b45309; }
.ocf-line.ocf-muted { color: var(--text-muted, #667085); }
.ocf-foot { margin: 0 0 12px; font-size: 12.5px; color: var(--text-muted, #667085); }
.ocf-btns { display: flex; justify-content: flex-end; gap: 8px; }

/* 助手三模式胶囊（2026-11-14）：改三维家报表 / 新建报表 / 改板件标签 */
.mode-pill { display: inline-flex; background: #f1f3f5; border-radius: 999px; padding: 4px; gap: 2px; }
.mode-pill-item { padding: 7px 22px; border: none; background: none; cursor: pointer;
  font: inherit; font-size: 13px; color: #5d5d5d; text-decoration: none; white-space: nowrap; }
.mode-pill-item:hover { color: #1a1a1a; }
.mode-pill-item.on { background: #fff; color: #111; font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
