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

/* ===== Design Tokens（见 DESIGN-SYSTEM.md 第 12 章） ===== */
:root {
  /* 主色 · 安全橙（方案A工业橙；变量名保留 --blue-* 以兼容全站引用，值已换橙） */
  --blue-50: #fff7ed; --blue-100: #ffedd5; --blue-200: #fed7aa;
  --blue-600: #f97316; --blue-700: #ea580c; --blue-800: #9a3412;
  /* 语义色（六态 · Tailwind 系；等我方橙 #d97706 偏黄，与主色橙 #f97316 偏红区分） */
  --green-50: #f0fdf4; --green-600: #16a34a; --green-700: #166534;
  --orange-50: #fef3c7; --orange-100: #fef9c3; --orange-500: #f59e0b; --orange-600: #d97706; --orange-700: #92400e;
  --red-50: #fef2f2; --red-100: #fee2e2; --red-200: #fecaca;
  --red-600: #dc2626; --red-700: #b91c1c; --red-800: #991b1b;
  /* 标签文字深档（底色不动、文字换深档，达 WCAG AA ≥4.5:1） */
  --tag-blue-text: #1e40af; --tag-orange-text: #92400e; --tag-red-text: #991b1b;
  /* 紫色「等待对方」语义（双边系统：橙=等我方，紫=等供应商/客户） */
  --purple-50: #f3e8ff; --purple-600: #7c3aed; --tag-purple-text: #6b21a8;
  /* 查询红字（专用，非错误；换纯红与主色橙区分） */
  --accent-red: #dc2626; --accent-red-border: #fca5a5; --accent-red-ph: #f87171;
  /* 中性（石墨系 · 冷灰） */
  --text-primary: #0f172a; --text-secondary: #475569; --text-tertiary: #64748b; --text-faint: #94a3b8;
  --bg-page: #f6f7f9; --bg-surface: #ffffff; --bg-weak: #fafbfc; --bg-weak-2: #f1f3f6;
  --border-light: #eef0f3; --border: #dcdfe6; --border-strong: #e3e6ec;
  /* 深色侧边栏（深石板 #1e293b） */
  --nav-bg: #1e293b; --nav-border: #273449; --nav-hover: #273449;
  --nav-text: #cbd5e1; --nav-text-strong: #f1f5f9; --nav-text-dim: #94a3b8;
  --nav-text-faint: #64748b; --nav-muted: #94a3b8;
  /* 青色筛选区 */
  --cyan-50: #e8f6fb; --cyan-100: #d8eef7; --cyan-200: #cfe9f3; --cyan-300: #9ed3e6; --cyan-700: #0b6b8a;
  /* 字体 / 间距 / 圆角 / 阴影 / 层级 */
  --font-sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Source Han Sans SC", "Noto Sans SC", sans-serif;
  --font-mono: Consolas, "SFMono-Regular", Menlo, monospace;
  --fs-micro: 11px; --fs-caption: 12px; --fs-body-sm: 13px; --fs-body: 14px;
  --fs-title: 15px; --fs-h3: 16px; --fs-display: 18px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px;
  --radius-sm: 4px; --radius-md: 6px; --radius-lg: 8px; --radius-xl: 10px;
  --shadow-xs: 0 1px 4px rgba(0,0,0,.05); --shadow-sm: 0 4px 16px rgba(0,0,0,.12);
  --shadow-md: 0 8px 24px rgba(0,0,0,.16); --shadow-lg: 0 12px 40px rgba(0,0,0,.25);
  --z-sticky: 10; --z-drop: 30; --z-overlay: 60; --z-modal: 90; --z-img: 120; --z-global: 999;
}

body { font: 14px/1.6 "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Source Han Sans SC", "Noto Sans SC", sans-serif; color: var(--text-primary); background: var(--bg-page); font-variant-numeric: tabular-nums; }
/* v6 T-03 数字等宽对齐：金额/数量用等宽数字，竖排可比较 */
.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
/* v6 I-02 键盘焦点环：全站可见，禁 outline:none 无替代 */
:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 2px; border-radius: var(--radius-sm); }
/* v6 N-01 面包屑：一级域 › 分组 › 当前页，每级可点 */
.bc { font-size: var(--fs-caption); color: var(--text-tertiary); margin-bottom: 4px; }
.bc a { color: var(--text-secondary); text-decoration: none; cursor: pointer; }
.bc a:hover { color: var(--blue-600); text-decoration: underline; }
.bc b { color: var(--text-primary); font-weight: 600; }
.bc .bc-sep { color: var(--text-faint); margin: 0 4px; }
.hidden { display: none !important; }
.muted { color: var(--text-tertiary); font-size: var(--fs-caption); }
.mt8 { margin-top: 8px; }
.mt16 { margin-top: 16px; }
.err { color: var(--red-600); font-size: var(--fs-caption); min-height: 18px; }

/* 登录 */
.login-wrap { display: flex; min-height: 100vh; }
/* 左海报区（60%）：深石板 + 网格纹理 + 底部渐变蒙版保证文字可读 */
.login-poster {
  width: 60%; flex: none; position: relative; background: var(--nav-bg); color: #fff;
  display: flex; flex-direction: column; padding: 44px 48px 40px; overflow: hidden;
}
.lp-mesh { position: absolute; inset: 0; pointer-events: none; opacity: .45;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 34px 34px; }
.lp-mask { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(15,23,42,.05) 30%, rgba(15,23,42,.6) 72%, rgba(15,23,42,.9) 100%); }
.login-poster > * { position: relative; }
.lp-logo { display: flex; align-items: center; gap: 10px; }
.lp-mk { width: 32px; height: 32px; border-radius: 8px; background: var(--blue-600); display: flex; align-items: center; justify-content: center; font: 600 15px var(--font-mono); color: #fff; }
.lp-nm { font-size: 15px; font-weight: 600; color: #f1f5f9; }
.lp-nm em { display: block; font: 400 9px/1.3 var(--font-mono); color: #64748b; font-style: normal; letter-spacing: .06em; margin-top: 1px; }
.lp-body { margin-top: auto; }
.lp-body h1 { font-size: 32px; line-height: 1.24; font-weight: 600; letter-spacing: -.012em; max-width: 15ch; }
.lp-body h1 em { font-style: normal; color: #fb923c; }
.lp-sub { margin-top: 12px; font-size: 13px; line-height: 1.75; color: #cbd5e1; max-width: 38ch; }
.lp-pts { margin-top: 26px; display: flex; flex-direction: column; gap: 12px; }
.lp-pt { display: flex; gap: 11px; align-items: flex-start; }
.lp-pt span { width: 20px; height: 20px; border-radius: 5px; background: rgba(249,115,22,.16); border: 1px solid rgba(249,115,22,.3); display: flex; align-items: center; justify-content: center; font: 600 10px/1 var(--font-mono); color: #fb923c; flex: none; margin-top: 1px; }
.lp-pt div { font-size: 12px; color: #cbd5e1; line-height: 1.6; }
.lp-pt b { display: block; color: #f1f5f9; font-weight: 500; font-size: 12.6px; margin-bottom: 1px; }
.lp-foot { margin-top: auto; padding-top: 22px; font: 10.5px var(--font-mono); color: #64748b; letter-spacing: .04em; }
/* 右登录区（40%） */
.login-side { width: 40%; flex: none; display: flex; align-items: center; justify-content: center; background: #fff; }
.login-card {
  width: 360px; background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); padding: 32px;
  display: flex; flex-direction: column; gap: 12px;
}
.login-title { font-size: var(--fs-display); font-weight: 600; text-align: center; margin-bottom: 8px; }
.login-card label { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-caption); color: var(--text-secondary); }
.login-card input { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 9px 12px; font-size: var(--fs-body); }
.login-card input:focus { outline: none; border-color: var(--blue-600); }
/* 登录页响应式：窄屏单列，海报收为顶部横幅 */
@media (max-width: 768px) {
  .login-wrap { flex-direction: column; }
  .login-poster { width: 100%; height: 180px; padding: 20px; }
  .login-poster .lp-body h1 { font-size: 20px; }
  .login-poster .lp-pts, .login-poster .lp-foot { display: none; }
  .login-side { width: 100%; padding: 24px 16px; }
}

/* 本地测试账号区（登录页；仅本地测试模式出现） */
.local-test { border: 1px dashed var(--blue-200); background: var(--blue-50); border-radius: var(--radius-lg); padding: 10px 12px; }
.lt-head { font-size: var(--fs-caption); font-weight: 600; color: var(--blue-600); margin-bottom: 8px; }
.lt-list { display: flex; flex-direction: column; gap: 6px; }
.lt-row {
  display: flex; align-items: center; gap: 8px; font-size: var(--fs-caption);
  background: #fff; border: 1px solid var(--blue-100); border-radius: var(--radius-md); padding: 6px 8px;
}
.lt-row .lt-btn { border: none; background: var(--blue-600); color: #fff; border-radius: var(--radius-sm); padding: 3px 9px; font-size: var(--fs-caption); cursor: pointer; }
.lt-row .lt-reset { background: var(--blue-50); color: var(--blue-600); }
.lt-row .lt-name { font-weight: 600; color: var(--text-primary); }
.lt-row .lt-phone { color: #4a5261; font-family: Consolas, monospace; }
.lt-row .lt-org { color: var(--text-tertiary); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-tip { font-size: var(--fs-micro); color: var(--text-tertiary); margin-top: 8px; }
.lt-tip b { color: var(--blue-600); }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 200px; background: var(--nav-bg); color: var(--nav-text); flex-shrink: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { font-size: var(--fs-h3); font-weight: 600; color: #fff; padding: 20px 20px 4px; }
/* v52 右上角固定顶栏：铃铛 + 组织名 + 用户名 */
.topbar { display: flex; align-items: center; gap: 16px; height: 48px; padding: 0 16px;
  background: #fff; border-bottom: 1px solid var(--border-light); position: sticky; top: 0; z-index: var(--z-drop); }
.topbar-org { font-size: var(--fs-body-sm); color: var(--text-secondary); }
.topbar-me { font-size: var(--fs-body-sm); color: var(--text-primary); font-weight: 500; }
.topbar-grow { flex: 1; }
.ic { width: 16px; height: 16px; vertical-align: -2px; display: inline-block; }
#notif-bell { cursor: pointer; user-select: none; position: relative; font-size: 18px; }
.notif-badge {
  position: absolute; top: -6px; right: -8px; min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--red-600); color: #fff; font-size: var(--fs-micro); line-height: 16px; text-align: center;
  border-radius: var(--radius-lg); display: inline-block;
}
.topbar-mute { cursor: pointer; font-size: 16px; margin: 0 12px; opacity: .75; }
.topbar-mute.muted { opacity: .35; }
/* 右下角消息通知弹窗（② 消息通知） */
.notif-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 1200; display: flex; flex-direction: column; gap: 10px; }
.notif-toast {
  min-width: 260px; max-width: 360px; background: #fff; color: var(--text-primary);
  border: 1px solid var(--border-light); border-left: 3px solid var(--blue-600);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 10px 14px;
  font-size: var(--fs-body); position: relative; animation: nt-in .25s ease;
}
.notif-toast b { display: block; font-size: 13px; }
.notif-toast > div { margin-top: 4px; color: var(--text-tertiary); font-size: 12.5px; line-height: 1.5; }
.notif-toast .nt-close { position: absolute; top: 6px; right: 10px; cursor: pointer; color: var(--text-tertiary); font-size: 16px; }
.notif-toast.out { opacity: 0; transform: translateX(20px); transition: all .3s ease; }
@keyframes nt-in { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
.notif-panel {
  position: fixed; top: 56px; right: 16px; width: 320px; max-height: 70vh; overflow-y: auto;
  background: #fff; color: var(--text-primary); border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  z-index: 1000; padding: 8px 0;
}
.notif-panel .np-item { padding: 10px 16px; border-bottom: 1px solid var(--border-light); cursor: pointer; }
.notif-panel .np-item:hover { background: #f5f7fa; }
.notif-panel .np-item.unread { background: var(--blue-50); }
.notif-panel .np-title { font-size: var(--fs-body); font-weight: 600; }
.notif-panel .np-body { font-size: var(--fs-caption); color: var(--text-secondary); margin-top: 2px; }
.notif-panel .np-time { font-size: var(--fs-micro); color: var(--text-faint); margin-top: 2px; }
.notif-panel .np-foot { padding: 8px 16px; font-size: var(--fs-caption); color: var(--blue-600); cursor: pointer; }
/* v52 站内公告：历史公告明细悬浮窗 */
.ann-list { max-height: 62vh; overflow-y: auto; }
.ann-item { border-bottom: 1px solid var(--border-light); padding: 11px 2px; }
.ann-item:last-child { border-bottom: none; }
.ann-item-hd { font-size: var(--fs-body); }
.ann-item-hd b { font-weight: 600; }
.ann-item-body { font-size: var(--fs-caption); color: var(--text-secondary); white-space: pre-wrap; margin: 4px 0; }
.ann-item-foot { font-size: var(--fs-micro); color: var(--text-faint); }
.dlg-overlay {
  position: fixed; inset: 0; background: rgba(15,20,30,.45); z-index: 2000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.dlg-box {
  background: #fff; color: var(--text-primary); border-radius: var(--radius-xl); width: 360px; max-width: 100%;
  padding: 20px; box-shadow: var(--shadow-lg);
}
.dlg-title { font-size: var(--fs-h3); font-weight: 600; margin-bottom: 8px; }
.dlg-msg { font-size: var(--fs-body); line-height: 1.6; color: var(--text-primary); }
.dlg-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.dlg-box .btn-danger { background: var(--red-600); border-color: var(--red-600); color: #fff; }
.org-line { font-size: var(--fs-caption); color: var(--nav-muted); padding: 0 20px 16px; border-bottom: 1px solid var(--nav-border); }
#nav { flex: 1; padding: 8px 0; overflow-y: auto; }
#nav a {
  display: block; padding: 10px 20px; color: var(--nav-text); text-decoration: none; font-size: var(--fs-body);
  border-left: 3px solid transparent;
}
#nav a.active { background: var(--nav-border); color: #fff; border-left-color: var(--blue-600); }
#nav a:hover { background: var(--nav-hover); }
.sidebar-foot { padding: 14px 20px; font-size: var(--fs-caption); color: var(--nav-muted); border-top: 1px solid var(--nav-border); }
.sidebar-foot a { color: var(--blue-600); margin-left: 8px; }
.sidebar-foot a.active { color: var(--blue-600); font-weight: 600; }
.main { flex: 1; padding: 24px; max-width: none; }

/* ===== 多标签页导航（多容器保活） ===== */
.tab-bar { display: flex; gap: 6px; align-items: center; margin-bottom: 16px; padding-bottom: 0; overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--blue-50); color: #5b6b8c; font-size: var(--fs-body-sm); cursor: pointer; white-space: nowrap; user-select: none; }
.tab.active { background: var(--blue-600); color: #fff; }
.tab-close { margin-left: 2px; font-size: var(--fs-title); line-height: 1; opacity: .65; }
.tab-close:hover { opacity: 1; }
.panes { position: relative; }
.pane { display: none; }
.pane.active { display: block; }

/* 通用 */
.card { background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); padding: 16px; margin-bottom: 16px; }
/* KPI 格（财务概览看板内层：非卡片，浅底 + 细边框，避免「卡片套卡片」） */
.kpi { display: block; padding: 12px 14px; border: 1px solid var(--border-light); border-radius: var(--radius-md); background: var(--bg-weak); text-decoration: none; color: inherit; }
.kpi:hover { border-color: var(--blue-200); background: var(--blue-50); }
.kpi b { color: var(--text-primary); }
.kpi .num { margin-top: 4px; }
/* 卡片内的段标题：财务模块四段式（单据头/票款进度/商品明细/时间线）靠它分层级。
   注意：财务模块之前用的是 .box / .t，那两个类从来没写进过样式表（页面直接塌成一片），
   现已统一到 .card + h3，不要再引入平行类。 */
.card > h3 { font-size: var(--fs-title); font-weight: 600; margin: 0 0 10px; color: var(--text-primary); }
.card.warn { border-left: 4px solid var(--orange-600); }
.card.err { border-left: 4px solid var(--red-600); }
.btn {
  display: inline-block; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px 16px;
  font-size: var(--fs-body-sm); cursor: pointer; background: #fff; color: var(--text-primary);
}
.btn:hover { background: var(--bg-weak); border-color: var(--border-strong); }
.btn-primary { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.btn-primary:hover { background: var(--blue-700); }
.btn-danger { background: var(--red-50); border-color: var(--red-200); color: var(--red-600); }
.btn-danger:hover { background: var(--red-100); }
.btn-lg { padding: 10px 20px; font-size: var(--fs-body); }
.btn-sm { padding: 4px 10px; font-size: var(--fs-caption); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

table { width: 100%; border-collapse: collapse; font-size: var(--fs-body-sm); }
/* 单元格不折行（2026-10-02 定案）：th/td 一律 nowrap，列宽按内容自适应；
   宽表由横向滚动容器兜底（fitTables 自动包装 / enh-table-wrap / 内联 overflow-x），
   不再挤压换行导致行高忽大忽小。确需折行的内容显式加 td.wrappable。 */
/* 2026-10-03 用户定案：明细汇总表内容一律居中显示 */
th, td { text-align: center; padding: 8px 10px; border-bottom: 1px solid var(--border-light); vertical-align: middle; white-space: nowrap; }
th { color: var(--text-secondary); font-weight: 500; background: var(--bg-weak); }
td.wrappable { white-space: normal; }
/* v52 长文本列单行省略（默认紧凑，悬停 title 看全文；「表格换行」开关打开后仍可换行看全文） */
td.cell-clip { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 表格换行开关（UI P1-3）：开启后 #main 下所有 th/td 允许换行，宽表免横向滚动，可读性优先 */
#main.wrap-tables th, #main.wrap-tables td { white-space: normal; word-break: break-word; }
.tbl-scroll { overflow-x: auto; }
tr:hover td { background: var(--bg-weak); }

.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 3px; border-radius: var(--radius-sm); font-size: var(--fs-caption); white-space: nowrap; }
.tag::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }
.tag-green { background: var(--green-50); color: var(--green-700); }
.tag-orange { background: var(--orange-50); color: var(--orange-700); }
.tag-red { background: var(--red-50); color: var(--red-800); }
.tag-gray { background: var(--bg-weak-2); color: var(--text-secondary); }
.tag-blue { background: var(--blue-50); color: var(--tag-blue-text); }
.tag-purple { background: var(--purple-50); color: var(--tag-purple-text); }
/* v6 E-04 锁态：无权限列显示灰底+角标「锁」，不隐藏列 */
.tag-lock { position: relative; background: var(--bg-weak-2); color: var(--text-faint); padding-right: 20px; }
.tag-lock::after { content: "🔒"; position: absolute; right: 5px; top: 50%; transform: translateY(-50%); font-size: 10px; }
/* v51 C-03 换货配对：一次红冲 + 一次补发在对账单里是**两行**（不合并，查账才有落点）。
   两行加同色左边条，点任意一行把另一行高亮并滚到眼前 —— 「这两行是同一笔换货」必须看得见。 */
tr[data-pair] { box-shadow: inset 3px 0 0 var(--purple-600); }
tr[data-pair].pair-on { background: var(--purple-50); }
/* v52 审批设置：已添加成员标签（可移除）+ 下拉选人 */
.apg-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.apg-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--blue-50); color: var(--blue-800);
  border: 1px solid var(--blue-200); border-radius: var(--radius-md); padding: 2px 8px; font-size: var(--fs-caption); }
.apg-chip a { color: var(--red-600); cursor: pointer; font-weight: 700; text-decoration: none; margin-left: 2px; }
.apg-sel { min-width: 200px; }
/* v6 F-03 单据时间轴：留痕可视化（request_log） */
.timeline { margin-top: 10px; padding-left: 4px; }
.tl-item { position: relative; padding: 0 0 12px 20px; border-left: 2px solid var(--border-strong); }
.tl-item:last-child { border-left-color: transparent; }
.tl-item::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--blue-600); }
.tl-time { font-size: var(--fs-micro); color: var(--text-faint); }
.tl-actor { font-weight: 600; color: var(--text-primary); }
.tl-detail { color: var(--text-secondary); font-size: var(--fs-caption); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-3); }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-caption); color: var(--text-secondary); }
input, select, textarea {
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: 7px 10px; font-size: var(--fs-body-sm); font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue-600); }
textarea { width: 100%; min-height: 120px; resize: vertical; font-family: Consolas, monospace; }

.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.perm-grid label { display: flex; gap: 6px; align-items: center; font-size: var(--fs-body-sm); }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
/* 面板标题统一规范：大小 15px / 石墨深 / 600 字重（与 .rq-title 一致） */
.toolbar > b { font-size: var(--fs-title); color: var(--text-primary); font-weight: 600; }
/* 设备/租赁模块辅助（v69） */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ptitle { font-size: var(--fs-title); font-weight: 600; color: var(--text-primary); }
.sub { font-size: var(--fs-micro); color: var(--text-tertiary); }
.upgrade-hint { display: flex; align-items: center; gap: 8px; background: var(--blue-50); border: 1px solid var(--blue-200); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: var(--fs-body-sm); color: var(--blue-800); }
.upgrade-hint a { font-weight: 600; color: var(--blue-700); cursor: pointer; }
.upgrade-hint a:hover { text-decoration: underline; }
/* 统计卡（证照到期 / 通用） */
.stat { background: #f8fafc; border: 1px solid var(--border-light); border-radius: 10px; padding: 12px 16px; min-width: 140px; }
.stat .n { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.stat .l { font-size: var(--fs-caption); color: var(--text-tertiary); margin-top: 2px; }
/* 时间轴（设备详情） */
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--border-light); }
.tl { position: relative; margin-bottom: 12px; }
.tl::before { content: ""; position: absolute; left: -19px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--blue-600); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--blue-600); }
.tl .t { font-weight: 600; font-size: var(--fs-body-sm); }
.tl .d { font-size: var(--fs-micro); color: var(--text-faint); }
.tl .c { font-size: var(--fs-body-sm); color: var(--text-secondary); }
/* v23 明细汇总页顶部操作区吸顶（2026-10-03 用户定案）：筛选/行操作固定显示，下方明细滚动查看 */
.sticky-tools {
  position: sticky; top: 0; z-index: var(--z-drop);
  background: #fff;
  margin: -16px -16px 12px; padding: 16px 16px 4px;
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 2px 8px rgba(31,35,41,.06);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.sticky-tools .toolbar:last-child { margin-bottom: 8px; }
/* 2026-10-02：新增商品面板从「一排无标签输入框」改为卡片式带标签表单 —— 用户反馈「商品库不能手动单个添加」，
   根因不是没有入口，而是字段没有标签、看不出哪个填什么。 */
.skus .sku-row { border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 10px 12px; margin-bottom: 8px; background: #fcfdff; }
.skus .sku-row .sku-row-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: var(--fs-body-sm); color: var(--text-primary); }
.skus .sku-row .sku-row-hd .btn { margin-left: auto; }
.skus .sku-row .sku-flags { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; }
.skus .sku-row .sku-flags label { display: flex; flex-direction: row; align-items: center; gap: 4px; font-size: var(--fs-caption); color: var(--text-secondary); }
.sku-head { font-size: var(--fs-caption); color: var(--text-secondary); }

/* 2026-10-02 通用小弹窗：就地补充信息（提料现场录临时物资等），不跳页 */
.dlg-back { position: fixed; inset: 0; background: rgba(31,35,41,.35); display: flex; align-items: center; justify-content: center; z-index: var(--z-global); }
.dlg { background: #fff; border-radius: var(--radius-xl); padding: 18px 20px; width: 480px; max-width: 92vw; box-shadow: var(--shadow-lg); }
.dlg-wide { width: 880px; max-width: 96vw; max-height: 86vh; overflow: auto; text-align: left; }
.dlg-xwide { width: 1180px; max-width: 98vw; }
.dlg-hd { font-size: var(--fs-title); font-weight: 600; margin-bottom: 4px; color: var(--text-primary); }
.dlg-tip { font-size: var(--fs-caption); color: var(--text-tertiary); margin-bottom: 12px; line-height: 1.5; }
.dlg .form-grid { grid-template-columns: 1fr; }
.dlg-ft { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
/* 全局搜索（/ 命令面板）结果项 */
.gs-item { padding: 8px 10px; border-radius: var(--radius-md); cursor: pointer; font-size: var(--fs-body-sm); color: var(--text-primary); }
.gs-item:hover { background: var(--blue-50); color: var(--blue-800); }
/* 工作台待办模块内的待办行（UI-21 模块聚合） */
.todo-line { padding: 5px 0; font-size: var(--fs-caption); color: var(--text-secondary); cursor: pointer; border-bottom: 1px dashed var(--border-light); }
.todo-line:last-child { border-bottom: 0; }
.todo-line:hover { color: var(--blue-700); }
.todo-line b { color: var(--text-primary); font-family: var(--font-mono); margin-left: 4px; }
/* 工作台编辑模式：进入编辑态才显示抓手、可拖 */
.dash-edit .home-card { cursor: grab; border-style: dashed; border-color: var(--border-strong); }
.dash-edit .home-card:hover { border-color: var(--blue-600); }

/* 选品下拉：按商品分组（v20——解决「提料只能选名称、规格选不了」） */
.le-group-hd { padding: 5px 10px; font-size: var(--fs-caption); color: var(--text-secondary); background: var(--bg-weak-2); border-top: 1px solid var(--border-light); }
.le-group-hd b { color: var(--text-primary); font-weight: 600; }
.le-item .le-sku-main { color: var(--text-primary); }
.le-new { padding: 7px 10px; font-size: var(--fs-caption); color: var(--blue-600); cursor: pointer; border-top: 1px solid var(--border-light); background: var(--blue-50); }
.le-new:hover { background: var(--blue-50); }

.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: var(--text-primary); color: #fff; padding: 10px 20px; border-radius: var(--radius-lg);
  font-size: var(--fs-body-sm); z-index: var(--z-global); max-width: 60vw;
}
.toast.err { background: var(--red-600); }
.toast.error { background: var(--red-600); }
.toast.success { background: var(--green-600); }
.toast.warn { background: var(--orange-600); }
.toast.info { background: var(--text-primary); }

/* 画布设计器（#31 档 3）：三栏工作台 + A4 画布 */
#main.wide { max-width: none; }
.cv-card { padding: 12px; }
.cv-sep { width: 1px; height: 20px; background: var(--border-strong); display: inline-block; }
.cv-grow { flex: 1; }
.cv-main { display: flex; gap: 10px; align-items: flex-start; }
.cv-left { width: 188px; flex-shrink: 0; max-height: 72vh; overflow: auto; border-right: 1px solid var(--border-light); padding-right: 8px; }
.cv-right { width: 252px; flex-shrink: 0; max-height: 72vh; overflow: auto; border-left: 1px solid var(--border-light); padding-left: 8px; }
.cv-stagewrap { flex: 1; overflow: auto; background: #e9edf3; border-radius: var(--radius-lg); padding: 12px; max-height: 72vh; }
.cv-stage { position: relative; margin: 0 auto; }
.cv-page { position: relative; background: #fff; box-shadow: var(--shadow-sm); overflow: hidden; }
.cv-grid {
  position: absolute; left: 0; top: 0; right: 0; bottom: 0;
  background-image: linear-gradient(to right, #eef2f7 1px, transparent 1px), linear-gradient(to bottom, #eef2f7 1px, transparent 1px);
}
.cv-content { position: absolute; }
.cv-split { position: absolute; left: 0; right: 0; border-top: 1px dashed #7aa0ff; pointer-events: none; }
.cv-split span { position: absolute; right: 2px; top: -13px; font-size: 9px; color: var(--blue-600); background: var(--blue-50); padding: 0 3px; border-radius: var(--radius-sm); }
.cel { position: absolute; overflow: hidden; white-space: pre-wrap; line-height: 1.35; cursor: move; }
.cel:hover { outline: 1px dashed #9db8ff; }
.cel.sel { outline: 1px solid var(--blue-600); }
.cel-table { border: 1px dashed #b6bcc6 !important; }
.cel-line, .cel-rect { cursor: move; }
.cv-badge { position: absolute; right: 0; top: 0; font-size: 9px; line-height: 14px; background: rgba(47,107,255,.14); color: var(--blue-600); padding: 0 3px; border-radius: 0 0 0 3px; pointer-events: none; }
.cvph { font-style: normal; color: var(--text-secondary); background: #f1f3f7; border-radius: var(--radius-sm); padding: 0 3px; font-size: .92em; }
.cv-h { position: absolute; width: 7px; height: 7px; background: #fff; border: 1px solid var(--blue-600); border-radius: 2px; z-index: 6; }
.cv-h-nw { left: -4px; top: -4px; cursor: nwse-resize; }
.cv-h-n { left: calc(50% - 4px); top: -4px; cursor: ns-resize; }
.cv-h-ne { right: -4px; top: -4px; cursor: nesw-resize; }
.cv-h-e { right: -4px; top: calc(50% - 4px); cursor: ew-resize; }
.cv-h-se { right: -4px; bottom: -4px; cursor: nwse-resize; }
.cv-h-s { left: calc(50% - 4px); bottom: -4px; cursor: ns-resize; }
.cv-h-sw { left: -4px; bottom: -4px; cursor: nesw-resize; }
.cv-h-w { left: -4px; top: calc(50% - 4px); cursor: ew-resize; }
.cv-guide { position: absolute; background: var(--red-600); z-index: 5; }
.cv-guide.v { width: 1px; }
.cv-guide.h { height: 1px; }
.cvtable { width: 100%; height: 100%; display: flex; flex-direction: column; }
.cvtr { display: flex; border-bottom: 1px solid #c6cbd4; }
.cvtr:last-child { border-bottom: 0; }
.cvc { flex: 1; border-right: 1px solid #c6cbd4; padding: 1px 3px; overflow: hidden; white-space: nowrap; }
.cvc:last-child { border-right: 0; }
.cvth { background: #f0f0f0; font-weight: 600; }
.cvtf { background: #fafafa; }
.cv-empty { font-size: var(--fs-micro); color: var(--text-tertiary); padding: 4px; }
.cv-foot { display: flex; gap: 12px; align-items: center; margin-top: 8px; border-top: 1px solid var(--border-light); padding-top: 8px; flex-wrap: wrap; }
.cv-sect { margin-bottom: 14px; font-size: var(--fs-caption); }
.cv-sect b { font-size: var(--fs-body-sm); }
.cv-row { display: flex; gap: 6px; align-items: center; margin-top: 6px; font-size: var(--fs-caption); color: var(--text-secondary); }
.cv-row.col { flex-direction: column; align-items: stretch; }
.cv-tools, .cv-pal { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.cv-dom { margin-top: 8px; font-size: var(--fs-caption); color: var(--text-secondary); font-weight: 600; }
.cv-grid4 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.cv-grid4 label { display: flex; flex-direction: column; font-size: var(--fs-micro); color: var(--text-secondary); }
.cv-card .cv-left .btn, .cv-card .cv-right .btn, .cv-card .cv-bar .btn { padding: 4px 8px; font-size: var(--fs-micro); }
.cv-card .cv-left textarea, .cv-card .cv-right textarea { min-height: 56px; font-size: var(--fs-caption); }
.cv-card .cv-left input, .cv-card .cv-right input, .cv-card .cv-right select { padding: 4px 6px; font-size: var(--fs-caption); }
.cv-pv { position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: var(--z-overlay); background: rgba(20,24,32,.62); display: flex; flex-direction: column; padding: 20px; }
.cv-pv.hidden { display: none !important; }
.cv-pv-bar { display: flex; gap: 10px; align-items: center; background: #fff; border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 8px 12px; flex-wrap: wrap; }
.cv-pv iframe { flex: 1; border: 0; background: #fff; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* P13 PC 业务工作台 */
/* v46 第二步（2026-10-06 用户反馈「一级菜单显示明显些，和二三四级有明显区分、可收起展开」）：
   一级 = 可折叠分区 .nav-sec（.nav-hd 标题行 + .nav-kids 子树）。
   区分手段：① 一级加粗 + 更亮 + 大一号；② 组间上分隔线；③ 折叠箭头（▾/▸）；
   二/三/四级只靠缩进 + 字号递减，不加粗不亮，一眼看出是从属层级。 */
.nav-sec { border-top: 1px solid var(--nav-border); transition: transform .18s ease, box-shadow .18s ease; }
.nav-sec:first-child { border-top: 0; }
/* 拖拽排序：拖动项轻微放大 + 阴影；插入位置指示；顶部分割线区分常用区 */
.nav-sec.dragging { transform: scale(1.05); box-shadow: var(--shadow-md); position: relative; z-index: 2; background: var(--nav-hover); }
.nav-sec.drop-before { box-shadow: 0 -2px 0 var(--blue-600); }
.nav-sec.drop-after { box-shadow: 0 2px 0 var(--blue-600); }
.nav-divider { border-top: 1px dashed rgba(255,255,255,.35); margin: 8px 12px; }
.nav-pinned .nav-group::before { content: "★ "; color: #ffd166; }
.nav-hd { display: flex; align-items: center; cursor: pointer; user-select: none; }
#nav .nav-hd:hover .nav-group { color: #fff; }
.nav-sec.folded .nav-kids { display: none; }
.nav-caret { margin-left: auto; padding: 10px 14px 10px 4px; font-size: var(--fs-micro); line-height: 1; color: #7f8b9c; }
.nav-caret::before { content: "▾"; }
.nav-sec.folded .nav-caret::before { content: "▸"; }
.nav-hd:hover .nav-caret { color: var(--nav-text); }
/* 一级标题（#nav .nav-group 的优先级要压过 #nav a 的通用样式；border-left 归零避免与导航条错位） */
#nav .nav-group { border-left: 0; padding: 12px 14px 8px 18px; font-size: var(--fs-body-sm); font-weight: 600;
  color: var(--nav-text-strong); letter-spacing: .4px; }
.nav-sub { padding: 8px 20px 2px; font-size: var(--fs-micro); color: var(--nav-text-faint); letter-spacing: .5px; }
.nav-sub.lv3 { padding-left: 30px; }
#nav a.nav-in-sub { padding-left: 32px; font-size: var(--fs-body-sm); }
/* v46 四级树（2026-10-06 第 46 轮用户定案）：三级 / 四级链接缩进；只收字号不换色，整体观感不动 */
#nav a.nav-l3 { padding-left: 46px; font-size: var(--fs-caption); }
#nav a.nav-l4 { padding-left: 60px; font-size: var(--fs-caption); color: var(--nav-text-dim); }
.home-sec { font-size: var(--fs-body-sm); color: var(--text-secondary); margin: 18px 0 8px; font-weight: 500; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.home-card { background: #fff; border-radius: var(--radius-xl); padding: 14px 16px; cursor: pointer; box-shadow: var(--shadow-xs); border: 1px solid transparent; }
.home-card:hover { border-color: var(--blue-600); }
.home-title { font-size: var(--fs-title); font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.home-desc { font-size: var(--fs-caption); color: var(--text-tertiary); margin-top: 6px; }
.le-search-td { position: relative; min-width: 250px; }
.le-search { width: 100%; }
/* v65 表格式下拉（全站）：原 left:0;right:0 把面板锁死在 250px 单元格里，改为固定宽度起，容纳 6 列表格 */
.le-drop { position: absolute; z-index: var(--z-drop); left: 0; right: auto; top: 100%; min-width: 560px; max-width: 90vw; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); max-height: 320px; overflow: auto; }
.le-item { padding: 7px 10px; font-size: var(--fs-body-sm); cursor: pointer; }
.le-item:hover { background: var(--blue-50); }
/* 表格形态：.le-item 渲染成 <tr>，列头 sticky，数字列右对齐等宽 */
.le-drop .le-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.le-drop .le-head { padding: 7px 10px; font-size: var(--fs-caption); color: var(--text-secondary); border-bottom: 1px solid var(--border-light); background: var(--bg-weak-2); }
.le-drop .le-head b { color: var(--text-primary); }
.le-drop .le-table thead th { position: sticky; top: 0; background: #fff; z-index: 1; font-size: var(--fs-caption); color: var(--text-secondary); text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border-light); white-space: nowrap; }
.le-drop .le-table tbody td { padding: 6px 8px; font-size: var(--fs-body-sm); border-bottom: 1px solid #f5f7fa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); }
.le-drop tr.le-item:hover td, .le-drop tr.le-item.hl td { background: var(--blue-50); }
.le-drop tr.le-item.hl td:first-child { box-shadow: inset 3px 0 0 var(--blue-600); }
.le-drop .le-td-code { font-family: ui-monospace, Consolas, monospace; color: var(--text-secondary); }
.le-drop .le-td-name { font-weight: 600; }
.le-drop .le-td-stock, .le-drop .le-td-price { text-align: right; font-family: ui-monospace, Consolas, monospace; }
.le-drop .le-empty { padding: 12px 10px; font-size: var(--fs-body-sm); color: var(--text-tertiary); }

/* ---- v21 常用词联想（提料单「部位 / 用途」列）：与选品下拉同一视觉语言 ---- */
.ws-td { position: relative; min-width: 140px; }
.ws-drop { position: absolute; z-index: var(--z-drop); left: 0; top: 100%; min-width: 100%; width: max-content; max-width: 300px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  max-height: 220px; overflow: auto; }
.ws-item { padding: 6px 10px; font-size: var(--fs-body-sm); cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ws-item:hover, .ws-item.on { background: var(--blue-50); }
.ws-item .ws-meta { color: var(--text-tertiary); font-size: var(--fs-micro); white-space: nowrap; }
.ws-new { padding: 7px 10px; font-size: var(--fs-caption); color: var(--blue-600); cursor: pointer; border-top: 1px solid var(--border-light); background: var(--blue-50); }
.ws-new:hover { background: var(--blue-50); }
.ws-src { font-size: var(--fs-micro); padding: 1px 6px; border-radius: var(--radius-xl); background: var(--blue-50); color: var(--blue-600); }
.ws-src.hist { background: var(--bg-weak-2); color: var(--text-secondary); }

/* ---- 提料单 PC 增强（R2/R3）：行附件与分享图弹窗 ---- */
.att-item { display: flex; align-items: center; gap: 4px; line-height: 1.6; }
.att-item a { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-td .att-up { margin-top: 2px; }
.img-modal { position: fixed; left: 0; top: 0; right: 0; bottom: 0; background: rgba(15, 23, 42, 0.5); z-index: var(--z-img); display: flex; align-items: center; justify-content: center; }
.img-modal.hidden { display: none; }
.img-modal-box { background: #fff; border-radius: var(--radius-xl); max-width: 94vw; max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25); }
.img-modal-bar { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 10px 16px; border-bottom: 1px solid var(--border-strong); }
.img-modal-body { overflow: auto; padding: 14px; }
.img-modal-body img { max-width: 88vw; height: auto; display: block; }

/* ---- 模板设置内置表格（te-grid）：固定表头 + 计算函数/合计/版式/排序行 ---- */
.te-grid th, .te-grid td { border: 1px solid var(--border-strong); padding: 6px 8px; min-width: 112px; }
.te-grid thead th { position: sticky; top: 0; z-index: 1; background: var(--bg-weak); box-shadow: 0 1px 0 var(--border-strong); }
.te-grid .te-label { width: 100%; }
.te-code { margin-top: 3px; font-size: var(--fs-micro); color: var(--text-tertiary); white-space: nowrap; }
.te-grid .te-expr, .te-grid .te-when, .te-grid .te-group { width: 100%; }
.te-grid .te-fnins { width: 100%; margin-top: 4px; font-size: var(--fs-caption); }
.te-grid .te-when { margin-top: 4px; }
.te-rowlab { background: var(--bg-weak); font-weight: 600; color: var(--text-secondary); white-space: nowrap; min-width: 92px; }
.te-fmt .te-align { margin-left: 4px; }
.te-fmt .te-group { margin-top: 4px; }
.te-ops { white-space: nowrap; }
.te-vislb { display: flex; align-items: center; gap: 4px; font-size: var(--fs-caption); color: var(--text-secondary); }
.te-total-cell { color: var(--text-secondary); }
.te-addcol select { max-width: 150px; }

.rl-pick { cursor: pointer; }

/* ===== 价格悬浮浮窗（2026-10-03 用户定案）=====
   采购明细汇总表单价列只显示最新供应商报价一行；历史报价/最低价放浮窗，
   鼠标放到价格上浮出、移开即消失（不占行高）。 */
.ptip {
  position: fixed; z-index: var(--z-global); pointer-events: none;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); padding: 8px 12px;
  font-size: var(--fs-caption); max-width: 340px; color: var(--text-primary);
}
.ptip-t { font-weight: 600; margin-bottom: 4px; color: var(--text-secondary); }
.ptip-i { line-height: 1.8; display: flex; align-items: center; gap: 6px; }
.ptip-i .ptip-s { color: var(--text-primary); }
.ptip-i .ptip-d { color: var(--text-tertiary); font-size: var(--fs-micro); }
.ptip-i.ptip-min { border-top: 1px dashed var(--border-strong); margin-top: 2px; padding-top: 2px; }
.ptip .tag { margin-left: 2px; }

/* ================= 统一列表增强（enh，2026-10-01） ================= */
.enh-wrap { margin-top: 12px; }
.enh-bar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 8px 10px; background: #fff;
  border: 1px solid var(--border-strong); border-bottom: none; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.enh-bar input[type="text"] { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 6px 10px; font-size: var(--fs-body-sm); }
.enh-bar input[type="text"]:focus { outline: none; border-color: var(--blue-600); }
.enh-bar .btn { padding: 5px 12px; font-size: var(--fs-caption); }
.enh-info { margin-left: auto; }
.enh-table-wrap { border: 1px solid var(--border-strong); border-radius: 0 0 var(--radius-xl) var(--radius-xl); overflow-x: auto; background: #fff; }
.enh-wrap table { margin-top: 0 !important; border-collapse: collapse !important; width: 100%; }
.enh-wrap table th, .enh-wrap table td { border: none; border-bottom: 1px solid var(--border-light); padding: 7px 9px; text-align: center; vertical-align: middle; }
.enh-wrap table thead th { background: var(--bg-weak-2); }
/* 去斑马纹（精密仪器：靠 hover 高亮 + 1px 横线区分，不用偶数行底色） */
.enh-fbtn { cursor: pointer; margin-left: 5px; font-size: var(--fs-micro); color: var(--text-tertiary); }
.enh-fbtn:hover { color: var(--blue-600); }
.enh-pop {
  position: absolute; z-index: var(--z-overlay); top: 100%; left: 0; min-width: 170px; max-height: 260px; overflow: auto;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 10px;
  box-shadow: var(--shadow-md); font-size: var(--fs-caption);
}
.enh-pop-t { font-weight: 600; margin-bottom: 6px; }
.enh-pop-i { display: flex; align-items: center; gap: 5px; padding: 2px 0; }
.enh-pop-b { display: flex; gap: 6px; justify-content: flex-end; margin-top: 8px; }
.enh-modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: var(--z-modal);
  display: flex; align-items: center; justify-content: center;
}
.enh-modal { background: #fff; border-radius: var(--radius-xl); padding: 18px; width: 480px; max-height: 76vh; overflow: auto; }
.enh-modal h3 { font-size: var(--fs-title); margin-bottom: 10px; }
.enh-col-list { display: flex; flex-direction: column; gap: 6px; }
.enh-col-row { display: flex; align-items: center; gap: 8px; }
.enh-col-row input[type="text"] { flex: 1; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 5px 8px; font-size: var(--fs-body-sm); }
.enh-col-row .btn { padding: 3px 8px; }

/* ===== 表格内大标题行 + 合计行（2026-10-01 定案：明细汇总表要在表格里面汇总） =====
   大标题与合计行都是 <table> 的真实行（导出、打印、页面上共用同一份列定义），
   不再把汇总信息放在表格外面。 */
.enh-wrap table tr.enh-titlerow th.enh-title {
  font-family: "SimHei", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: var(--fs-display); font-weight: 700; text-align: center; letter-spacing: 1.5px;
  color: var(--text-primary); background: #fff; padding: 14px 8px 6px;
}
.enh-wrap table thead tr.enh-sumrow-active th { background: var(--bg-weak-2); }
.enh-wrap table tfoot tr.enh-sumrow td {
  background: var(--bg-weak-2); font-weight: 600; color: var(--text-primary);
  border-top: 2px solid var(--blue-600);
}
.enh-wrap table tfoot tr.enh-sumrow td b { color: #4a3300; letter-spacing: 1px; }

/* ===== 明细汇总表上方的「行操作」条（2026-10-01 定案：多选/全选搬到表格上方） ===== */
.toolbar.enh-selbar {
  background: #f4f7fc; border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  padding: 6px 10px; margin-top: 8px; flex-wrap: wrap; gap: 6px;
}
.toolbar.enh-selbar .sel-title { font-weight: 600; color: var(--text-primary); margin-right: 4px; }
.toolbar.enh-selbar .sep { width: 1px; height: 18px; background: var(--border-strong); margin: 0 4px; }
table tr.rl-pick { cursor: pointer; }
table tr.rl-pick:hover { background: var(--blue-50); }

/* 附件单元格：文件名直链 + 表内上传「＋」 */
.att-cell { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.att-cell .att-link { color: var(--blue-800); text-decoration: none; }
.att-cell .att-link:hover { text-decoration: underline; }
.att-cell .att-up {
  padding: 0 6px; line-height: 20px; font-size: var(--fs-caption); cursor: pointer;
  border: 1px dashed #b9c6dc; background: #fff;
}
.att-cell .att-up:hover { border-color: var(--blue-600); color: var(--blue-800); }

/* 模板编辑器：列头关键字冲突（同名不同码）高亮 —— 配合保存按钮禁用 */
.te-grid thead th.te-conflict { background: var(--red-50) !important; box-shadow: inset 0 0 0 2px var(--red-600); }
.te-grid thead th.te-conflict .te-code code { color: var(--red-700); }

/* v1.1 S1：模板编辑器重构 —— 三标签页 + 左列清单 + 右属性抽屉 */
.te-tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border-strong); margin-bottom: 12px; }
.te-tab { border: 0; background: transparent; padding: 7px 16px; cursor: pointer; font: inherit; color: var(--text-secondary); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.te-tab.on { color: var(--blue-600); border-bottom-color: var(--blue-600); font-weight: 600; }
.te-newgrid { display: grid; grid-template-columns: 1fr 320px; gap: 12px; align-items: start; }
@media(max-width:760px){ .te-newgrid { grid-template-columns: 1fr; } }
.te-collist { border: 1px solid var(--border-light); border-radius: var(--radius-lg); overflow: hidden; background: #fff; }
.te-cli { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--border-light); cursor: pointer; }
.te-cli:last-child { border-bottom: 0; }
.te-cli:hover { background: #f7f9fc; }
.te-cli.on { background: var(--blue-50); box-shadow: inset 3px 0 0 var(--blue-600); }
.te-cli.te-conflict { background: var(--red-50); }
.te-cli-drag { color: var(--text-tertiary); cursor: grab; font: 12px var(--mono); user-select: none; }
.te-cli-name { flex: 1; font-size: var(--fs-body-sm); }
.te-cli-code { font-size: var(--fs-micro); color: var(--text-tertiary); white-space: nowrap; }
.te-cli-ops { display: flex; align-items: center; gap: 2px; }
.te-vislb { display: inline-flex; align-items: center; cursor: pointer; }
.te-add { padding: 8px 10px; background: #f8fafd; border-top: 1px solid var(--border-light); }
.te-add select { width: 100%; }
.te-drawer { border: 1px solid var(--border-light); border-radius: var(--radius-lg); background: #fff; padding: 12px 14px; position: sticky; top: 8px; }
.te-dt { font-size: var(--fs-caption); color: var(--text-secondary); font-weight: 600; letter-spacing: .06em; margin-bottom: 10px; text-transform: uppercase; }
.te-drawer label { display: block; margin: 9px 0; font-size: var(--fs-body-sm); }
.te-drawer label span { display: block; margin-bottom: 3px; color: var(--muted); font-size: var(--fs-caption); }
.te-drawer input, .te-drawer select { width: 100%; box-sizing: border-box; }
.te-drawer input[readonly] { background: #f5f7fa; color: var(--muted); font-family: var(--mono); }
.te-adv { margin-top: 12px; border-top: 1px dashed var(--border-light); padding-top: 10px; }
.te-adv-hd { font-size: var(--fs-caption); color: var(--muted); margin-bottom: 6px; }


/* 采购派单面板：按商品指定供应商（2026-10-01） */
.sup-pick { position: relative; }
.sup-pick .sup-chip { display: inline-block; background: #eef3fb; border: 1px solid #cfdcf0; border-radius: var(--radius-sm); padding: 1px 4px 1px 6px; margin: 1px 3px 1px 0; font-size: var(--fs-caption); white-space: nowrap; }
.sup-pick .sup-chip a { color: var(--red-600); cursor: pointer; margin-left: 4px; text-decoration: none; font-weight: 700; }
.sup-pick .dp-sup { width: 100%; box-sizing: border-box; margin-top: 2px; }
td .dp-qty { text-align: right; }

/* ===== v20 分类维护（树形）===== */
.cat-node{display:flex;align-items:center;gap:8px;padding:7px 10px;border:1px solid var(--line,#e5e7eb);border-radius:8px;margin:5px 0;background:#fff;min-width:max-content;padding-right:16px}
.cat-node:hover{border-color:#cfe0ff;background:#fafcff}
.cat-node .cat-fold{color:var(--text-tertiary);font-size:11px;width:14px;text-align:center}
.cat-node .cat-ops{display:none;gap:4px;margin-left:10px}
.cat-node:hover .cat-ops{display:inline-flex}

/* ===== v24 商品库（对齐企云乐「商品管理」：第二列商品图片 / 多单位换算 / 三价）===== */
/* 筛选区固定三列一行（与企云乐筛选区一致：名称/编号/规格型号 ｜ 分类/品牌/单位 ｜ 仓库/条码/货位） */
.form-grid.f3 { grid-template-columns: repeat(3, minmax(200px, 1fr)); }
/* 同一格里放「输入框 + 复选框」时用它（如 计量单位 + 启用多单位），避免把勾选框塞进 label 造成点击串扰 */
.form-grid .fld { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-caption); color: var(--text-secondary); }
.form-grid .fld-row { display: flex; align-items: center; gap: 6px; }
.form-grid .fld-row .sk-unit { flex: 1 1 auto; min-width: 0; }
.form-grid .mu-inline { display: flex; flex-direction: row; align-items: center; gap: 4px; white-space: nowrap; font-size: var(--fs-caption); color: var(--text-secondary); }
/* 商品图片：上传区 + 列表缩略图 */
.img-block { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.img-block-t { font-size: var(--fs-caption); color: var(--text-secondary); }
.img-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.img-prev { width: 56px; height: 56px; object-fit: cover; border: 1px solid var(--border-light); border-radius: var(--radius-lg); background: var(--bg-weak); }
.goods-thumb { width: 40px; height: 40px; object-fit: cover; border: 1px solid var(--border-light); border-radius: var(--radius-md); background: var(--bg-weak); display: inline-block; }
.th-img { width: 62px; }
.td-img { padding: 3px 10px; }
.th-ops { min-width: 156px; }
.td-ops .btn { margin: 0 2px 0 0; }
/* 多单位换算（企云乐「启用多单位」）：一行 = 一个辅单位，1 辅单位 = N 基本单位 */
.sk-units { margin-top: 10px; padding: 8px 10px; border: 1px dashed #cfdcf0; border-radius: var(--radius-lg); background: #f8fbff; }
.sk-units .sku-row-hd { display: flex; align-items: baseline; gap: 8px; font-size: var(--fs-body-sm); color: var(--text-primary); margin-bottom: 6px; flex-wrap: wrap; }
.sk-unit-rows { display: flex; flex-direction: column; }
.sk-unit-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.sk-unit-row .eq { color: var(--text-tertiary); }
.sk-unit-row .sku-name { width: 132px; }
.sk-unit-row .sku-rate { width: 92px; }
.sk-unit-row .sku-base { min-width: 48px; font-size: var(--fs-caption); }
.sk-unit-row .sku-def { display: flex; align-items: center; gap: 4px; font-size: var(--fs-caption); color: var(--text-secondary); white-space: nowrap; }

/* ===== v24 提料单版式（对齐企云乐，2026-10-04 用户截图定案）=====
   顶部「色块」整块固定不动：标题行（含红色查询字段）+ 页签行（含行操作）；
   下方明细区独立上下滚动，表头吸顶。搜索框与查询字段用红字。 */
.rq-shell { display: flex; flex-direction: column; }
.rq-fixed {
  background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  padding: 8px 10px; margin-bottom: 10px;
}
.rq-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rq-bar + .rq-bar { margin-top: 8px; }
.rq-title { font-size: var(--fs-title); color: var(--text-primary); font-weight: 600; }
.rq-flex { flex: 1 1 auto; }
.rq-crit { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rq-crit label { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-caption); white-space: nowrap; }
.rq-crit .rq-mine { gap: 2px; }
.rq-tabs { display: inline-flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.rq-tab {
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-md);
  padding: 5px 12px; cursor: pointer; font-size: var(--fs-body-sm); color: var(--text-primary); font-family: inherit;
}
.rq-tab:hover { background: var(--bg-weak-2); }
.rq-tab.rq-on { background: #fff; border-color: var(--border-strong); font-weight: 600; color: var(--blue-700); }
.rq-tab-act { color: var(--blue-800); }
.rq-ops { margin-bottom: 0; }
/* 更多 ▾ 下拉（F-02：收纳批量导入/汇总模板设置/免询价直采） */
.rq-more-wrap { position: relative; display: inline-flex; }
.rq-more-menu { position: absolute; top: 100%; right: 0; z-index: var(--z-drop); min-width: 190px; background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.rq-more-menu .btn { text-align: left; white-space: nowrap; }
.rq-more-menu label { display: flex; align-items: center; gap: 6px; padding: 5px 10px; font-size: var(--fs-caption); color: var(--text-secondary); white-space: nowrap; }
/* 更多筛选收纳面板（多字段横排） */
.rq-filter-panel { position: absolute; top: 100%; right: 0; z-index: var(--z-drop); min-width: 540px; max-width: 92vw; background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 8px; }
/* 自定义多选下拉（multiSelect 组件） */
.ms-root { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.ms-trigger { white-space: nowrap; }
.ms-panel { position: absolute; top: 100%; left: 0; z-index: var(--z-drop); min-width: 220px; max-height: 280px; overflow: auto; background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 6px; }
.ms-opt { display: flex; align-items: center; gap: 7px; padding: 6px 8px; font-size: var(--fs-body-sm); color: var(--text-primary); border-radius: var(--radius-md); cursor: pointer; }
.ms-opt:hover { background: var(--bg-weak); }
.ms-opt input { margin: 0; }
.ms-opt .muted { margin-left: auto; font-size: var(--fs-micro); }
.ms-chips { display: inline-flex; flex-wrap: wrap; gap: 5px; }
.ms-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--blue-50); color: var(--blue-800); border: 1px solid var(--blue-200); border-radius: 999px; padding: 1px 8px; font-size: var(--fs-caption); }
.ms-chip a { color: var(--blue-700); cursor: pointer; text-decoration: none; font-weight: 700; margin-left: 1px; }
.ms-chip a:hover { color: var(--blue-800); }
/* 红色查询框 / 查询字段（用户截图上这一类字段是红字） */
.f-red { color: var(--accent-red); }
.f-red input, .f-red select { color: var(--accent-red); border-color: var(--border); }
.f-red input::placeholder { color: var(--accent-red-ph); }
.f-red input:focus, .f-red select:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(249,115,22,.14); }
/* 审核通过 / 审核驳回：红色按钮 */
.f-red-btn { background: var(--red-100); color: var(--red-700); border: 1px solid var(--red-200); font-weight: 600; }
.f-red-btn:hover:not(:disabled) { background: var(--red-100); }
/* 明细区独立上下滚动（表头吸顶），不再跟着整页滚 */
.rq-scroll { max-height: calc(100vh - 300px); overflow: auto; border: 1px solid var(--border-light); border-radius: var(--radius-lg); }
.rq-scroll table { margin: 0; }
/* v6 G-01 列冻结：明细汇总表首列（勾选）横滚时钉住；背景给实色避免透底 */
.rq-table th:first-child, .rq-table td:first-child { position: sticky; left: 0; z-index: 3; background: #fff; box-shadow: 1px 0 0 var(--border-light); }
.rq-table thead th:first-child { background: var(--bg-weak); z-index: 4; }
.rq-table thead th { position: sticky; top: 0; z-index: 2; background: var(--bg-weak); box-shadow: 0 1px 0 var(--border-strong); }
/* v43（2026-10-06 第 43 轮）采购明细汇总「采购数量」列就地输入实际采购数量：
   蓝色虚线 = 还没下单（填的是本次要发给供应商的数量）；橙色虚线 = 已下单（改了会发起订单变更单）。
   一眼看出"这一格能改"，又不用多一列按钮。 */
.pc-qty { width: 76px; text-align: center; border: 1px dashed #91caff; background: #f0f7ff; border-radius: var(--radius-sm); padding: 2px 4px; }
.pc-qty:focus { border-style: solid; border-color: var(--blue-600); background: #fff; outline: none; }
.pc-qty-chg { border-color: #ffd591; background: #fffbf0; }
.pc-qty-chg:focus { border-color: var(--orange-500); background: #fff; }
/* 行操作条嵌在青色固定块里时去掉自己的底色边框，避免"块中块"显得脏 */
.rq-fixed .toolbar.enh-selbar { background: transparent; border: none; padding: 0; margin: 0; }
/* v45（2026-10-06 第 45 轮用户截图定案）「采购中心 · 明细汇总」照这套版式：
   顶部色块里是「拍平的页签行 + 7 个红字查询框 + 行操作」，比提料单那块高一截，
   滚动区高度相应多扣一点，保证表格底边不出视口。 */
.rq-shell.pc-shell .rq-scroll { max-height: calc(100vh - 356px); }
/* v1.1 S2 列表出口：显示密度（紧凑 / 标准 / 宽松） */
.rq-table.d-compact th, .rq-table.d-compact td { padding-top: 3px; padding-bottom: 3px; }
.rq-table.d-loose th, .rq-table.d-loose td { padding-top: 12px; padding-bottom: 12px; }

/* ===== v47 订单中心：一套系统、两个视角（2026-10-06 第 47 轮用户定案）=====
   「采购订单 | 销售订单」不再是「跳去另一台系统」的入口，而是**同一张表**换数据源；
   做成分段控件，一眼看出是同一个页面的两个面（列 / 模板 / 导出口径完全一致）。 */
#oc-bar .oc-sdgroup { display: inline-flex; align-items: center; }
#oc-bar .oc-sdgroup .oc-sd { border-radius: 0; margin-left: -1px; }
#oc-bar .oc-sdgroup .oc-sd:first-child { border-top-left-radius: 8px; border-bottom-left-radius: 8px; margin-left: 0; }
#oc-bar .oc-sdgroup .oc-sd:last-child { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }
#oc-bar .sep { width: 1px; height: 18px; background: var(--border-strong); display: inline-block; }
.oc-crit { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-caption); color: var(--text-secondary); white-space: nowrap; }

/* ===== v26 即时材料（2026-10-04 第三十二轮，用户两张截图）===== */
/* 新建提料单顶部**居中**的工程名称（管理员在模板设置里固定，普通提料人只读） */
.in-eng-title { text-align: center; font-size: var(--fs-display); font-weight: 600; letter-spacing: 2px; color: var(--text-primary); padding: 6px 0 10px; }
/* v33：工程名称改由提料人自己填 —— 居中标题里嵌一个输入框（原来是一段只读文字） */
.in-eng-title .in-eng-label { font-size: var(--fs-body-sm); font-weight: 500; letter-spacing: 0; color: var(--text-secondary); margin-right: 8px; }
.in-eng-title .in-eng-input { width: 340px; text-align: center; font-size: var(--fs-h3); font-weight: 600; letter-spacing: 1px;
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: 5px 10px; }
.in-eng-title .in-eng-input:focus { outline: none; border-color: var(--blue-600); box-shadow: 0 0 0 2px rgba(31,111,235,.12); }
.in-eng-title .in-eng-hint { display: inline-block; margin-left: 10px; font-size: var(--fs-caption); font-weight: 400; letter-spacing: 0; }
/* 冲减行（数量为负）：整行淡橙底 + 左侧色条，一眼可辨「这行不发货，只做扣减」 */
.le-body tr.le-offset { background: var(--orange-100); }
.le-body tr.le-offset td:first-child { box-shadow: inset 3px 0 0 var(--orange-500); }
/* 明细汇总：展开的组内单行（缩进的浅底行，显示该行的单号/数量/供应商/状态） */
table tr.in-sub > td { background: #fbfdff; padding: 4px 10px 6px 46px; }
.in-subline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: var(--fs-caption); }
.in-subline b { color: var(--text-primary); }
.in-subline .muted { color: var(--text-tertiary); }
/* 数量列的净额提示（原始提料 − 冲减 = 净额） */
.qty-net-hint { font-size: var(--fs-micro); }
/* v35 确认收货面板（明细汇总「行操作」列就地签收）：与批量编辑面板同位置，浅底 + 左色条表示「这是一次签字动作」 */
#in-recvbox { border: 1px solid #cfe6ec; background: #f7fbfd; border-radius: var(--radius-lg); padding: 10px 12px 2px; box-shadow: inset 3px 0 0 var(--green-600); }
#in-recvbox .toolbar { margin-bottom: 8px; }
#in-recvbox .toolbar b { color: var(--green-700); }
#in-recvbox table { background: #fff; }
#in-recvbox th { background: #eef6f8; }

/* v52：批量导入 —— 数量为 0 的行标黄（保留不丢弃，提交时拦截并定位） */
.le-body tr.le-qty-zero { background: #fffbe6; }
.le-body tr.le-qty-zero td { background: #fffbe6; }
.le-body tr.le-qty-zero .le-qty { border-color: #e0a800; box-shadow: 0 0 0 1px #f0d59a inset; }

/* ==================================================================
   签工单 · 纸面（v54 版式化 v1.1）
   Q1 独立路由页 #/sign-works/new；Q2 屏幕 10.5pt / 打印 8pt；
   Q3 钉死半张高 = 屏幕上一张张固定 210×148.5mm 的纸，每张 6 行，
      第 7 行起自动开第 2 张（不压缩行高、不裁内容）。
   与打印件逐项一致：7 列宽 9/24/55/42/38/11/19mm（和 = 198mm）。
   ================================================================== */
.sw-page { padding: 16px; background: #eef0f4; min-height: 100vh; }
.sw-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  background: #fff; padding: 10px 14px; border-bottom: 1px solid #e3e7ee; margin: -16px -16px 16px; }
.sw-bar .sw-bar-t { font-weight: 650; font-size: 15px; }
.sw-bar .sw-bar-s { color: #6b7280; font-size: 13px; }
.sw-bar .sw-flex { flex: 1; }
.sw-sheet { width: 210mm; height: 148.5mm; padding: 5mm 6mm 4mm; margin: 0 auto 16px; background: #fff;
  box-shadow: 0 6px 22px rgba(16,24,40,.22); font-family: "SimSun","宋体",serif; color: #111;
  display: flex; flex-direction: column; position: relative; box-sizing: border-box; overflow: hidden; }
.sw-corp { display: flex; justify-content: space-between; align-items: flex-end; font-size: 8pt; line-height: 1.3; color: #333; }
.sw-corp .org { font-weight: 700; font-size: 9pt; color: #111; }
.sw-corp .meta b { font-weight: 400; color: #111; }
.sw-proj { text-align: center; font-size: 12.5pt; font-weight: 700; letter-spacing: .5pt; margin-top: 1.2mm;
  line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sw-docname { text-align: center; font-size: 15pt; font-weight: 700; letter-spacing: 6pt; margin: 1.4mm 0 1.6mm; line-height: 1.1; }
.sw-head3 { width: 100%; border-collapse: collapse; table-layout: fixed; }
.sw-head3 td { border: .35mm solid #000; height: 8.6mm; font-size: 10.5pt; padding: 0 2mm; vertical-align: middle; }
.sw-head3 td.lb { background: #f4f4f4; text-align: center; width: 15mm; font-weight: 700; font-size: 9pt; }
.sw-head3 td.vl { font-weight: 700; }
.sw-head3 td.vl input, .sw-head3 td.vl select { width: 100%; border: 0; background: transparent; font: inherit;
  color: inherit; outline: 0; -webkit-appearance: none; appearance: none; }
.sw-grid { width: 100%; border-collapse: collapse; table-layout: fixed; margin-top: -.35mm; }
.sw-grid th, .sw-grid td { border: .35mm solid #000; padding: 0; vertical-align: middle; }
.sw-grid thead th { background: #f4f4f4; font-size: 7.6pt; font-weight: 700; height: 7.4mm; text-align: center;
  line-height: 1.15; letter-spacing: .3pt; }
.sw-grid tbody td { height: 8.6mm; font-size: 10.5pt; padding: 0 1.4mm; line-height: 1.35; }
/* v1.2：单元格内容一律居中（用户定案：序号/部位/事项/原因/起止/人数/共计 全居中；打印同口径） */
.sw-grid tbody td, .sw-grid tbody td input { text-align: center; }
.sw-grid td.c { text-align: center; padding: 0 .6mm; }
.sw-grid td.r { text-align: center; font-weight: 700; padding-right: 0; }
.sw-total td { height: 7.4mm; background: #fafafa; font-weight: 700; font-size: 10.5pt; }
.sw-total td.lbl { text-align: right; padding-right: 2.5mm; letter-spacing: .3pt; }
.sw-total td.num { text-align: center; font-size: 11pt; }
.sw-f3 { margin-top: 1.6mm; display: flex; align-items: center; gap: 4mm; font-size: 10.5pt; }
.sw-f3 label { display: flex; align-items: center; gap: 1.5mm; }
.sw-f3 select, .sw-f3 input { border: 0; background: transparent; font: inherit; color: inherit; outline: 0; }
.sw-sign { margin-top: auto; padding-top: 1.5mm; }
.sw-sign table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.sw-sign td { height: 11.5mm; font-size: 10.5pt; padding: 0 2mm; vertical-align: bottom;
  border-left: .35mm solid #000; border-right: .35mm solid #000; border-bottom: .35mm solid #000; }
.sw-sign td.first { border-left: 0; }
.sw-sign td.last { border-right: 0; }
.sw-sign .k { color: #333; font-size: 9pt; }
.sw-sign .blank { display: inline-block; min-width: 24mm; border-bottom: .3mm dotted #666; margin: 0 1mm; }
.sw-foot { margin-top: 1.4mm; font-size: 6.4pt; color: #555; line-height: 1.35; letter-spacing: .1pt; }
.sw-pgno { position: absolute; right: 6mm; bottom: 2.2mm; font-size: 6.4pt; color: #666; }
/* 单元格里的输入：没有边框，但有「能点」的暗示（差异#4） */
.sw-grid td input { width: 100%; border: 0; background: transparent; font: inherit; color: inherit;
  padding: 0; outline: 0; box-sizing: border-box; }
.sw-grid td:hover input { background: #f7faff; }
.sw-grid td:focus-within { box-shadow: inset 0 0 0 1px var(--blue-600, #2f6bff); background: #f4f8ff; }
/* 起止日期一格：左右两半，各自一个透明 date 覆盖层
   v1.2 修复：原先两个 input 都 inset:0 完全重叠，后者的 date_to 盖住 date_from，
   点格子永远只弹「结束日期」→ 起始日期点不到，看起来就是「不能填」。 */
.sw-dr { display: flex; align-items: center; justify-content: center; height: 100%; gap: 1mm; }
.sw-dh { position: relative; flex: 1; height: 100%; display: flex; align-items: center; justify-content: center; }
.sw-dh .sw-drt { pointer-events: none; white-space: nowrap; font-size: 9pt; color: #333; }
.sw-dh .sw-drt.dim { color: #aaa; }
.sw-dh input[type=date] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.sw-drs { flex: 0 0 auto; font-size: 9pt; color: #666; }
/* 删除按钮：行尾悬浮，不占横向宽度（差异#6） */
.sw-grid tbody td.rel { position: relative; overflow: visible; }
.sw-del { position: absolute; right: -24px; top: 50%; transform: translateY(-50%); opacity: 0; transition: opacity .12s;
  width: 20px; height: 20px; border-radius: 50%; border: 0; background: #c62828; color: #fff; cursor: pointer;
  line-height: 1; font-size: 12px; padding: 0; }
.sw-grid tbody tr:hover .sw-del { opacity: 1; }
/* 字数计数（差异#10，软提示不拦） */
.sw-cnt { font-size: 6.6pt; color: #9aa3b2; text-align: right; line-height: 1; }
.sw-cnt.over { color: #c62828; }
/* 加一行按钮（差异#7） */
.sw-add { display: block; width: 210mm; margin: -6px auto 16px; border: 1px dashed #bcd0ff; background: #fff;
  color: #2f6bff; padding: 7px 0; border-radius: 6px; cursor: pointer; font-size: 13px; }
/* 窄屏：纸整体缩放，不重排列宽（版式不能因为屏窄就变形） */
@media (max-width: 1120px) { .sw-page { zoom: .85; } }
@media (max-width: 920px) { .sw-page { zoom: .68; } }
/* 打印：控件一律隐藏，纸严格 1:1 */
@media print {
  .sw-bar, .sw-add, .sw-del, .sw-cnt, .sw-page .muted-hint { display: none !important; }
  .sw-page { padding: 0; background: #fff; zoom: 1 !important; }
  .sw-sheet { margin: 0; box-shadow: none; page-break-after: always; }
  .sw-grid tbody td, .sw-head3 td, .sw-f3, .sw-sign td, .sw-total td { font-size: 8pt; }
  .sw-grid tbody td input, .sw-head3 td input, .sw-head3 td select { font-size: 8pt; }
}

/* ================= 权限组编辑页（v56）：三栏 = 域 / 权限点 / 摘要 =================
   左栏 12 个域（带「已选 N/M」）；中栏每点自带「勾了会发生什么」+ 风险标签；
   右栏实时摘要（已选 N/56 · 高危 N 个 · 数据范围 · 使用这个组的人）。 */
.pg-wrap { display: grid; grid-template-columns: 190px minmax(0, 1fr) 300px; gap: 12px; margin-top: 12px; align-items: start; }
.pg-domains { border: 1px solid #e3e7ee; border-radius: 8px; overflow: hidden; background: #fff; }
.pg-dom { display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px 10px; border: 0; border-bottom: 1px solid #eef1f6; background: #fff; cursor: pointer; font-size: 13px; text-align: left; }
.pg-dom:last-child { border-bottom: 0; }
.pg-dom:hover { background: #f7f9fc; }
.pg-dom.on { background: #eef3ff; color: #1c4bcc; font-weight: 600; }
.pg-dom .nm { flex: 1; }
.pg-dom .ct { font: 11.5px ui-monospace, Consolas, monospace; color: #6b7280; }
.pg-dom.on .ct { color: #1c4bcc; }
.pg-main { min-width: 0; }
.pg-dh { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #f7f9fc; border: 1px solid #e3e7ee; border-bottom: 0; border-radius: 8px 8px 0 0; font-size: 13px; }
.pg-main > #pg-perms { border: 1px solid #e3e7ee; border-radius: 0 0 8px 8px; max-height: 560px; overflow: auto; padding: 6px 10px; background: #fff; }
.pg-p { display: flex; gap: 9px; align-items: flex-start; padding: 8px 6px; border-bottom: 1px dashed #eef1f6; cursor: pointer; }
.pg-p:last-child { border-bottom: 0; }
.pg-p:hover { background: #fafbfd; }
.pg-p.on { background: #f6f9ff; }
.pg-p input { margin-top: 3px; }
.pg-p .tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pg-p .nm { font-size: 13px; font-weight: 600; }
.pg-p .ky { font: 11px ui-monospace, Consolas, monospace; color: #6b7280; background: #f2f4f8; border: 0; padding: 0 4px; align-self: flex-start; }
.pg-p .ds { font-size: 12.3px; color: #3d444d; line-height: 1.55; }
.pg-side { border: 1px solid #e3e7ee; border-radius: 8px; padding: 10px 12px; background: #fff; position: sticky; top: 8px; }
.pg-sum { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; padding-bottom: 6px; border-bottom: 1px solid #eef1f6; }
.pg-sum b { font-size: 18px; color: #1c4bcc; }
.pg-hi { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.pg-users { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
@media (max-width: 1100px) { .pg-wrap { grid-template-columns: 160px minmax(0, 1fr) 250px; } }
@media (max-width: 900px) { .pg-wrap { grid-template-columns: 1fr; } .pg-side { position: static; } }

/* 班组成员多选（v57）：勾选式，不用 <select multiple>（那个要 ctrl+点，手机点不了） */
.tu-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 10px; max-height: 240px; overflow: auto; border: 1px solid #e3e7ee; border-radius: 6px; padding: 8px 10px; background: #fff; }
.tu-chk { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; padding: 3px 2px; border-radius: 4px; }
.tu-chk:hover { background: #f7f9fc; }
.tu-chk input { margin: 0; }
.us-teams { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
@media (max-width: 900px) { .tu-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 动效降级（无障碍）：系统开「减少动态效果」时，所有过渡/动画几乎即时，尊重用户偏好 */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
