:root {
  --navy: #0f172a;
  --navy-2: #1e293b;
  --blue: #2563eb;
  --blue-d: #1d4ed8;
  --bg: #f1f5f9;
  --card: #ffffff;
  --line: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; color: var(--text); background: var(--bg); }

/* ---------- 登录/注册 全屏 ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%); }
.auth-card { width: 380px; background: #fff; border-radius: 12px; padding: 36px 32px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.auth-logo { text-align: center; margin-bottom: 22px; }
.auth-logo .mark { width: 52px; height: 52px; border-radius: 12px; background: var(--blue);
  color: #fff; font-weight: 700; font-size: 22px; display: inline-flex; align-items: center; justify-content: center; }
.auth-logo-img { height: 62px; max-width: 100%; object-fit: contain; display: block; margin: 0 auto 8px; }
.brand-img { height: 34px; background: #fff; border-radius: 8px; padding: 3px; flex: none; object-fit: contain; }
.auth-logo h1 { font-size: 19px; margin-top: 12px; }
.auth-logo p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.auth-card label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
.auth-card input, .auth-card select { width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 14px; outline: none; }
.auth-card input:focus, .auth-card select:focus { border-color: var(--blue); }
.btn { width: 100%; padding: 11px; border: none; border-radius: 8px; cursor: pointer; font-size: 15px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-d); }
.btn-ghost { background: #f1f5f9; color: var(--text); }
.btn-ghost:hover { background: #e2e8f0; }
.btn-sm { padding: 6px 12px; font-size: 13px; width: auto; }
.auth-link { text-align: center; margin-top: 16px; font-size: 13px; color: var(--muted); }
.auth-link a { color: var(--blue); cursor: pointer; }

/* ---------- 后台布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 224px; background: var(--navy); color: #cbd5e1; display: flex; flex-direction: column; }
.sidebar .brand { padding: 18px 18px; color: #fff; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #334155; }
.sidebar .brand .mark { width: 34px; height: 34px; border-radius: 8px; background: var(--blue);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; }
.sidebar .brand b { font-size: 15px; line-height: 1.2; }
.sidebar .brand .brand-name { font-size: 17px; font-weight: 700; letter-spacing: .5px; white-space: nowrap; }
.nav { padding: 10px; flex: 1; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 8px;
  color: #cbd5e1; cursor: pointer; font-size: 14px; margin-bottom: 4px; }
.nav a:hover { background: #334155; color: #fff; }
.nav a.active { background: var(--blue); color: #fff; }
.nav a .ic { width: 18px; text-align: center; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 56px; background: #fff; border-bottom: 1px solid var(--line); display: flex;
  align-items: center; justify-content: space-between; padding: 0 22px; }
.topbar .title { font-weight: 600; font-size: 16px; }
.topbar .user { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.badge { padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.badge-admin { background: #dbeafe; color: var(--blue-d); }
.badge-user { background: #f1f5f9; color: var(--muted); }
.content { padding: 22px; overflow: auto; }

/* ---------- 卡片/表单 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin-bottom: 18px; }
.card h3 { font-size: 15px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 200px; }
label.fld { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 5px; }
input, select, textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; font-family: inherit; outline: none; background: #fff; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); }
textarea { resize: vertical; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.page-head h2 { font-size: 18px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { background: #f8fafc; color: var(--muted); font-weight: 600; }
td .qty { width: 64px; padding: 5px 7px; }
.st { padding: 2px 9px; border-radius: 999px; font-size: 12px; }
.st-pending { background: #fef3c7; color: var(--warn); }
.st-active { background: #dcfce7; color: var(--ok); }
.st-disabled { background: #fee2e2; color: var(--danger); }
.link { color: var(--blue); cursor: pointer; }
.link-danger { color: var(--danger); cursor: pointer; }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- 对比/需求 ---------- */
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; font-size: 13px; }
.kv div:nth-child(odd) { color: var(--muted); }
.total { font-weight: 700; font-size: 15px; margin-top: 10px; }
/* 配单清单按「系统 → 柜体」分组标题 */
#billTbl td.sys-h {
  background: #1f3864; color: #fff; font-weight: 700; font-size: 14px;
  padding: 7px 10px; letter-spacing: 1px;
}
#billTbl td.cab-h {
  background: #d9e1f2; color: #1f3864; font-weight: 700; font-size: 13px;
  padding: 5px 10px; border-top: 2px solid #1f3864;
}
/* 各柜体 / 各系统末尾的「手动加一行」入口 */
#billTbl td.row-add { background: #f6f8fc; padding: 4px 12px; border-top: 1px dashed #c8d4ea; }
#billTbl td.row-add.sys-add { background: #eef2f9; border-top: 2px solid #c8d4ea; }
#billTbl td.row-add .link { font-size: 12.5px; }


/* ---------------- 产品管理 V2 / 配单 V2 材料归类 ---------------- */
.v2-mat { border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
.v2-mat-h { background: #1f3864; color: #fff; font-weight: 700; font-size: 14px; padding: 8px 12px;
  cursor: pointer; letter-spacing: .5px; display: flex; align-items: center; gap: 6px; }
.v2-brand { background: #f8fafc; border-top: 1px solid #e2e8f0; }
.v2-brand-h { background: #e8eef7; color: #1f3864; font-weight: 700; font-size: 13px; padding: 6px 12px 6px 26px;
  cursor: pointer; display: flex; align-items: center; gap: 6px; }
.v2-cnt { background: rgba(255,255,255,.25); color: #fff; border-radius: 10px; padding: 0 8px;
  font-size: 12px; font-weight: 700; }
.v2-brand-h .v2-cnt { background: #1f3864; }
.v2-items { padding: 4px 12px 8px 40px; }
.v2-item { font-size: 13px; padding: 2px 0; color: #334155; }
.v2-tbl { width: 100%; border-collapse: collapse; margin: 4px 0 8px 26px; max-width: calc(100% - 26px); }
.v2-tbl th { background: #f1f5f9; color: #475569; font-size: 12px; text-align: left; padding: 5px 8px; }
.v2-tbl td { font-size: 13px; padding: 5px 8px; border-top: 1px solid #eef2f7; color: #334155; }
.v2-tbl td .muted { color: #94a3b8; }

/* 产品管理 V2 扁平清单：筛选条 + 列表 */
.v2-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 12px 4px 14px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.v2-filter label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.v2-filter .inp { width: auto; min-width: 140px; }
.v2-filter .btn-ghost { align-self: flex-end; }
.v2-list-tbl { width: 100%; border-collapse: collapse; }
.v2-list-tbl th { background: #f1f5f9; color: #475569; font-size: 12px; text-align: left; padding: 8px 10px; white-space: nowrap; }
.v2-list-tbl td { font-size: 13px; padding: 8px 10px; border-top: 1px solid #eef2f7; color: #334155; vertical-align: middle; }
.v2-list-tbl tr:hover td { background: #f8fafc; }
.v2-tag { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.v2-tag.mat { background: #e8eef7; color: #1f3864; }

/* ---------------- 配单工作台「预分析」面板 / 分析报告弹窗 ---------------- */
.analyze-card { border-left: 3px solid var(--blue); }
.ab-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
/* 配单类型徽标（自动配单 / 人工修改版） */
.kind-badge { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.kind-badge.auto { background: #e6f4ea; color: #1e7e34; }
.kind-badge.manual { background: #fff3e0; color: #c6620b; }
/* 配单记录：原始文件下载链接 */
.dl-link { color: var(--blue); cursor: pointer; font-size: 12px; font-weight: 600; white-space: nowrap; }
.dl-link:hover { text-decoration: underline; }
.bill-list-tbl { width: 100%; border-collapse: collapse; }
.bill-list-tbl th { background: #f1f5f9; color: #475569; font-size: 12px; text-align: left; padding: 9px 10px; white-space: nowrap; }
.bill-list-tbl td { font-size: 13px; padding: 9px 10px; border-top: 1px solid #eef2f7; color: #334155; vertical-align: top; }
.bill-list-tbl tr:hover td { background: #f8fafc; }
.bill-list-tbl td.ops { white-space: nowrap; }
.bill-list-tbl td.ops .link { margin-right: 8px; }

/* ---------- toast ---------- */
.toast { position: fixed; top: 18px; right: 18px; background: var(--navy); color: #fff; padding: 11px 16px;
  border-radius: 8px; font-size: 14px; opacity: 0; transform: translateY(-8px); transition: .25s; pointer-events: none; z-index: 99; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.err { background: var(--danger); }

/* ---------- modal ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center;
  justify-content: center; z-index: 50; }
.modal { width: 460px; max-width: 92vw; background: #fff; border-radius: 10px; padding: 22px; }
.modal h3 { margin-bottom: 14px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.section-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- modal 通用小部件（picker 等复用） ---------- */
.modal-h { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.modal-h .x { border: none; background: #eef2f7; color: #475569; width: 26px; height: 26px;
  border-radius: 6px; cursor: pointer; font-size: 14px; line-height: 1; }
.modal-h .x:hover { background: #e2e8f0; }
.inp { height: 32px; padding: 0 8px; border: 1px solid #cbd5e1; border-radius: 7px; font-size: 13px;
  background: #fff; color: inherit; }
.inp:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,.15); }

/* ---------- 配单行「从产品库选规格」弹窗 ---------- */
.pick-modal { width: 720px; max-width: 95vw; max-height: 90vh; display: flex; flex-direction: column; padding: 18px; }
.pick-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.pick-toolbar label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: #64748b; }
.pick-list { overflow: auto; flex: 1; border: 1px solid #eef2f7; border-radius: 9px; padding: 8px;
  min-height: 220px; max-height: 60vh; }
.pick-card { border: 1px solid #e8edf3; border-radius: 9px; padding: 9px 11px; margin-bottom: 8px; background: #fff; }
.pick-p { cursor: pointer; border-radius: 6px; padding: 3px 4px; }
.pick-p:hover { background: #f1f5f9; }
.pick-p-main { font-size: 14px; }
.pick-p-sub { font-size: 12px; color: #64748b; margin-top: 2px; }
.pick-skus { margin-top: 7px; border-top: 1px dashed #e2e8f0; padding-top: 7px; display: flex;
  flex-direction: column; gap: 5px; }
.pick-sku { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 5px 7px;
  border-radius: 6px; background: #f8fafc; }
.pick-sku:hover { background: #eef4ff; }
.pick-sku-spec { font-weight: 700; min-width: 96px; }
.pick-sku-price { margin-left: auto; font-weight: 700; color: #1e7e34; }

/* ---------- 系统加行：选择归属柜体的弹窗 ---------- */
.cab-opt { cursor: pointer; }
.cab-opt:hover { background: #eef4ff; border-color: #bfdbfe; }

/* ---------- 配单行规格列「选规格」按钮 ---------- */
.cell-pick { display: flex; align-items: center; gap: 4px; }
.pick-btn { border: none; background: #e8eef7; color: #1f3864; width: 24px; height: 24px;
  border-radius: 6px; cursor: pointer; font-size: 13px; line-height: 1; flex: none; }
.pick-btn:hover { background: #d6e2f5; }

/* ---------------- 产品多级分类树 ---------------- */
.cat-tree { max-height: calc(100vh - 250px); overflow: auto; }
.cat-node { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 7px;
  cursor: pointer; font-size: 13px; color: var(--text); border: 1px solid transparent; }
.cat-node:hover { background: #f1f5f9; }
.cat-node.active { background: #eff6ff; border-color: #bfdbfe; color: var(--blue-d); font-weight: 600; }
.cat-caret { width: 14px; flex: none; text-align: center; color: var(--muted); font-size: 11px; }
.cat-caret.ghost { opacity: .35; }
.cat-ic { flex: none; font-size: 12px; }
.cat-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-cnt { flex: none; font-size: 11px; color: var(--muted); background: #f1f5f9;
  border-radius: 999px; padding: 1px 7px; }
.cat-node.active .cat-cnt { background: #fff; color: var(--blue-d); }
.cat-ops { display: none; gap: 6px; flex: none; font-size: 12px; color: var(--muted); }
.cat-node:hover .cat-ops { display: flex; }
.cat-ops span:hover { color: var(--blue); }
.cat-ops [data-del]:hover { color: var(--danger); }
.cat-empty { padding: 22px 10px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.8; }

/* ---------------- 产品分类管理页（精简单卡） ---------------- */
.page-sub { color: var(--muted); font-size: 13px; margin-top: 6px; line-height: 1.6; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500; background: #eef2ff; color: var(--blue-d); white-space: nowrap; }
.pill.gray { background: #f1f5f9; color: var(--muted); }
.pill .muted { font-size: 11px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-title h3 { margin: 0; }

.cat-card { padding: 14px 18px 12px; }
.cat-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.cat-bar b { font-size: 15px; }
.cat-bar .muted { font-size: 12px; }
.cat-search { position: relative; margin-left: auto; width: 260px; max-width: 100%; }
.cat-search input { height: 36px; padding-left: 32px; font-size: 13px; background: #f8fafc; }
.cat-search input:focus { background: #fff; }
.cat-search .cs-ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  font-size: 13px; color: var(--muted); pointer-events: none; }
.cat-card .cat-tree { max-height: calc(100vh - 330px); padding: 8px 0; }
.cat-card .cat-node { padding: 8px 10px; font-size: 13.5px; border-radius: 9px; gap: 7px; }
.cat-card .cat-caret { width: 16px; font-size: 12px; }
.cat-card .cat-cnt { font-size: 11.5px; padding: 2px 9px; }
.cat-card .cat-ops { display: flex; opacity: .45; gap: 8px; font-size: 13px; }
.cat-card .cat-node:hover .cat-ops { opacity: 1; }
/* 产品分类管理：材料名 → 厂家 → 产品 树（产品行） */
.cat-card .cat-node.lvl0 { font-weight: 600; }
.cat-card .cat-node.lvl1 { color: var(--blue-d); }
.cat-card .cat-node.lvl1 .cat-name { font-weight: 500; }
.cat-prod { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 52px; font-size: 13px;
  color: var(--text); border-radius: 7px; }
.cat-prod:hover { background: #f8fafc; }
.cat-prod .cp-name { font-weight: 500; }
.cat-prod .cp-model { color: var(--blue-d); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px;
  background: #eff6ff; border-radius: 5px; padding: 1px 6px; }
.cat-prod .cp-meta { color: var(--muted); font-size: 12px; }
.cat-prod .cp-ops { margin-left: auto; display: flex; gap: 10px; font-size: 12px; opacity: 0; }
.cat-prod:hover .cp-ops { opacity: 1; }
.cat-selbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; min-height: 36px; }
.cat-selbar .crumb { margin-top: 0; }

.crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; margin-top: 10px; }
.crumb span.cb { background: #f1f5f9; border-radius: 6px; padding: 3px 9px; }
.crumb span.cb.cur { background: #dbeafe; color: var(--blue-d); font-weight: 600; }
.crumb i { color: var(--muted); font-style: normal; }
.detail-rows { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px 14px;
  font-size: 13px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.detail-rows > div:nth-child(odd) { color: var(--muted); }

/* ---------------- 多级联动分类选择器 ---------------- */
.casc { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.casc .casc-sel { width: auto; min-width: 148px; max-width: 240px; padding: 8px 10px; }
.casc-sep { color: var(--muted); font-size: 12px; }
@media (max-width: 1280px) {
  .cat-card .cat-tree { max-height: 46vh; }
}
/* ---------------- 产品编辑（独立整页） ---------------- */
.editor-head { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.editor-head h2 { font-size: 20px; letter-spacing: -.2px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--blue);
  cursor: pointer; font-size: 13px; margin-bottom: 10px; }
.back-link:hover { color: var(--blue-d); text-decoration: underline; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.editor-layout > section { min-width: 0; }
.editor-layout aside { min-width: 0; position: sticky; top: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid .fg-2 { grid-column: 1 / -1; }
.form-grid .fld { margin-top: 12px; }
.form-grid > div:first-child .fld, .form-grid .fg-2:first-child .fld { margin-top: 4px; }
.fld-tip { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.fld-note { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.cell-sub { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.5;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-remark { max-width: 190px; font-size: 12.5px; color: var(--muted); }
.cell-remark > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 配单清单上方的「名称 / 备注」一行 */
.bill-meta { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.bill-meta .fld { margin-top: 0; flex: 1; min-width: 0; }
.bill-meta input, .bill-meta textarea { width: 100%; box-sizing: border-box; }
.bill-meta textarea { resize: vertical; min-height: 34px; }
/* 招标「设备需求表」解析卡 */
.rt-wrap { overflow-x: auto; margin-top: 10px; max-height: 420px; overflow-y: auto; }
.rt-table { min-width: 720px; }
.rt-table th { font-size: 12px; color: var(--muted); font-weight: 600; position: sticky; top: 0; background: #fff; }
.rt-table th, .rt-table td { padding: 6px 8px; font-size: 12.5px; }
.rt-ok { background: #e6f4ea; color: #1e7e34; padding: 7px 10px; border-radius: 6px; font-size: 12.5px; margin-top: 8px; }
.rt-out { background: #fff8e6; color: #8a6100; padding: 7px 10px; border-radius: 6px; font-size: 12.5px; margin-top: 8px; line-height: 1.7; }
.rt-notes { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; color: #8a6100; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #eef2ff;
  color: var(--blue-d); font-size: 11px; font-weight: 500; }
/* 可选规格（多 SKU）编辑表 */
.sku-wrap { overflow-x: auto; }
.sku-table { min-width: 860px; }
.sku-table th { font-size: 12px; color: var(--muted); font-weight: 600; }
.sku-table th, .sku-table td { padding: 6px 8px; }
.sku-table input { height: 34px; font-size: 13px; padding: 0 9px; }
.sku-table td:last-child { text-align: center; white-space: nowrap; }
/* 规格快选 */
.spec-pick { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.spec-pick input { flex: 1; }
.spec-area { min-height: 240px; line-height: 1.75; font-size: 14px; resize: vertical; }
.remark-area { min-height: 76px; line-height: 1.7; font-size: 14px; resize: vertical; }
.editor-foot { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 -22px -22px;
  padding: 14px 22px; background: #fff; border-top: 1px solid var(--line);
  box-shadow: 0 -8px 22px rgba(15,23,42,.07); }
.tips { list-style: none; font-size: 13px; color: var(--muted); line-height: 1.9; }
.tips li { position: relative; padding-left: 14px; }
.tips li::before { content: '·'; position: absolute; left: 3px; color: var(--blue); font-weight: 700; }
.tips b { color: var(--text); font-weight: 600; }
@media (max-width: 1280px) {
  .editor-layout { grid-template-columns: minmax(0, 1fr); }
  .editor-layout aside { position: static; }
}
@media (max-width: 760px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}
.filters { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.filters > input:not([type=checkbox]) { flex: 1; max-width: 340px; }
label.chk { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted);
  flex: none; white-space: nowrap; }
label.chk input { width: auto; }

/* ---------------- 配单清单：按柜分组 ---------------- */
.bill-group td { background: #eef2ff; border-top: 2px solid var(--blue); border-bottom: 1px solid #c7d2fe; }
.bill-group .bg-name { font-weight: 700; color: var(--blue-d); font-size: 13.5px; }
.bill-group .bg-cnt { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 8px; }
.cell-group { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.cab-scope { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 10px;
  padding: 10px 12px; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; }
.cab-scope .cs-title { width: 100%; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.cab-scope label.chk { background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 11px; cursor: pointer; }
.cab-scope label.chk:hover { border-color: #bfdbfe; }
.cab-scope label.chk.on { background: #dbeafe; border-color: #bfdbfe; color: var(--blue-d); }
.cab-scope .cs-actions { width: 100%; display: flex; align-items: center; gap: 8px; margin: 2px 0 4px; }
.cab-scope .cs-actions .btn-sm { padding: 4px 12px; font-size: 12.5px; }
.cab-scope .cs-hint { font-size: 12px; }

/* ---------------- 通用分页条（所有列表页共用） ---------------- */
.pager { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.pager-spacer { flex: 1; }
.pager .muted b { color: var(--text); font-weight: 600; }
.pager-size { width: auto; min-width: 100px; height: 30px; font-size: 12.5px; padding: 0 8px; }
.pager-now { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.pager-jump { width: 58px; height: 30px; text-align: center; font-size: 12.5px; padding: 0 4px; }
.pager .btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------------- 向量详情 ---------------- */
.vec-bars { display: flex; flex-direction: column; gap: 3px; max-height: 240px; overflow: auto;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #f8fafc; }
.vec-bar { display: flex; align-items: center; gap: 8px; font-size: 11px; font-family: ui-monospace, Consolas, monospace; }
.vec-i { width: 26px; flex: none; color: var(--muted); text-align: right; }
.vec-track { flex: 1; height: 9px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.vec-fill { display: block; height: 100%; border-radius: 3px; }
.vec-fill.pos { background: var(--blue); }
.vec-fill.neg { background: #f97316; }
.vec-v { width: 66px; flex: none; text-align: right; color: var(--text); }
.vec-text { background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  font-size: 12px; line-height: 1.6; white-space: pre-wrap; word-break: break-all; max-height: 180px; overflow: auto;
  font-family: inherit; margin: 0; }
@media (max-width: 880px){
  .section-2 { grid-template-columns: 1fr; }
  .sidebar { width: 64px; }
  .sidebar .brand b, .sidebar .brand small, .nav a span { display: none; }
}

/* ---------------- 配单行：需求依据 ---------------- */
tr.row-basis > td { padding: 0 !important; }
.basis-box { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline;
  padding: 6px 12px 8px 12px; font-size: 12px; line-height: 1.7; color: #566;
  background: #f7f9fc; border-top: 1px dashed #e3e8ef; }
tr.row-basis.ok > td .basis-box { background: #eafaf0; }
.basis-tag { background: #305496; color: #fff; padding: 1px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600; align-self: center; }
.basis-status { padding: 1px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; color: #fff; align-self: center; }
.basis-status.ok { background: #1e7e34; }
.basis-status.doubt { background: #e67e22; }
.basis-status.warn { background: #c0392b; }
.basis-kv { color: #566; word-break: break-word; }
.basis-kv > i { color: #8a94a6; font-style: normal; margin-right: 5px; }
.basis-kv b, .basis-kv > i { font-weight: 600; }
