/* ===== Design tokens — 极简商务 ===== */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --border: #e6e8ec;
  --border-strong: #d3d7de;
  --text: #1c2530;
  --text-2: #5a6675;
  --text-3: #8b96a5;
  --brand: #2563eb;

  /* status color blocks (red / blue / green / yellow) */
  --red: #e5484d;      --red-bg: #fdecec;    --red-bd: #f6c9cb;
  --blue: #2563eb;     --blue-bg: #e8f0fe;   --blue-bd: #c3d8fb;
  --green: #2f9e62;    --green-bg: #e6f6ec;  --green-bd: #bfe6cd;
  --yellow: #d98816;   --yellow-bg: #fdf3e0; --yellow-bd: #f3dcae;
  --gray: #6b7688;     --gray-bg: #eef1f4;   --gray-bd: #dde1e7;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --shadow-lg: 0 12px 40px rgba(16,24,40,.16);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.boot { padding: 80px; text-align: center; color: var(--text-3); }
.mono { font-variant-numeric: tabular-nums; }

/* ===== Login ===== */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 500px at 100% -10%, #eaf1fe 0%, transparent 55%),
    radial-gradient(900px 500px at -10% 110%, #eef6f1 0%, transparent 50%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 940px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  display: grid; grid-template-columns: 1.05fr 1fr;
  overflow: hidden;
}
.login-brand {
  padding: 40px;
  background: linear-gradient(160deg, #1e3a8a 0%, #2563eb 60%, #3b82f6 100%);
  color: #fff;
  display: flex; flex-direction: column; justify-content: space-between;
}
.login-brand .lg { font-size: 22px; font-weight: 700; letter-spacing: .5px; }
.login-brand .sub { font-size: 13px; opacity: .85; margin-top: 10px; line-height: 1.7; }
.login-brand .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.login-brand .chip {
  font-size: 12px; padding: 5px 10px; border-radius: 999px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22);
}
.login-form { padding: 40px; }
.login-form h2 { font-size: 18px; margin-bottom: 4px; }
.login-form p.muted { color: var(--text-3); margin: 0 0 22px; font-size: 13px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong);
  border-radius: 8px; background: var(--surface); color: var(--text); font-size: 14px; outline: none;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
textarea.input { resize: vertical; min-height: 76px; }
.btn {
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  padding: 9px 14px; border-radius: 8px; font-size: 13px; font-weight: 500;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.sm { padding: 5px 9px; font-size: 12px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.err-msg { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 8px; }
/* ===== Login 岗位账号快捷块（分组 + 折叠 + 自适应网格，杜绝文字断行）===== */
.quick-accounts { margin-top: 18px; border-top: 1px dashed var(--border-strong); padding-top: 14px; }
.quick-hint { font-size: 12px; color: var(--text-3); margin-bottom: 10px; line-height: 1.6; }
.quick-hint .boot { display: inline; color: var(--text-3); }
.quick-groups { display: flex; flex-direction: column; gap: 12px; }
.quick-group-title { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.quick-group-title .qg-count { font-weight: 500; color: var(--text-3); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; font-size: 11px; }
/* auto-fill 网格：桌面一行多个、自动换行；单元格 minmax 保证不被压扁 */
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.quick-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface-2);
  border-radius: 8px; padding: 8px 10px; font-size: 13px; color: var(--text); min-height: 38px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.quick-btn:hover { border-color: var(--brand); background: #f2f6ff; }
.quick-btn.amb { border-style: dashed; color: var(--text-3); }
.quick-btn .qb-warn { color: #b4231f; font-size: 11px; border-left: 1px solid var(--border); padding-left: 6px; flex: 0 0 auto; }
.quick-more-btn { margin-top: 12px; width: 100%; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 8px; padding: 9px; font-size: 12px; }
.quick-more-btn:hover { border-color: var(--brand); color: var(--brand); background: #f2f6ff; }
/* 手机端（≤860px）：每项至少 44px 高、文字不换行不挤断；网格退到 2 列但保持 nowrap+ellipsis */
@media (max-width: 860px) {
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .quick-btn { min-height: 44px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* ===== App shell ===== */
.topbar {
  height: 56px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 20px;
  position: sticky; top: 0; z-index: 20;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.topbar .logo {
  width: 26px; height: 26px; border-radius: 7px; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-size: 14px; font-weight: 700;
}
.topbar .brand-logo { height: 34px; width: auto; display: block; }
.topbar .brand-name { font-weight: 700; font-size: 15px; color: var(--text); letter-spacing: .5px; }
@media (max-width: 768px) {
  .topbar { padding: 0 10px; }
  .topbar .brand { gap: 6px; }
  .topbar .brand-logo { height: 22px; }
  .topbar .brand-name { font-size: 13px; white-space: nowrap; letter-spacing: 0; }
  .topbar .user { gap: 6px; }
}
.topbar .user { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: #dbe6fb; color: #1e40af;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.role-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--gray-bg);
  color: var(--gray); border: 1px solid var(--gray-bd); font-weight: 500;
}

.nav { display: flex; gap: 4px; padding: 12px 20px 0; background: var(--bg); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.subnav { display: none; gap: 8px; padding: 10px 20px 0; background: var(--bg); flex-wrap: wrap; }
.subtab { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 8px; padding: 6px 14px; font-size: 13px; }
.subtab.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.tab {
  border: none; background: transparent; padding: 10px 14px 12px; font-size: 14px; color: var(--text-2);
  border-bottom: 2px solid transparent; font-weight: 500;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tab .idx { font-size: 11px; color: var(--text-3); margin-right: 5px; }
.tab.active .idx { color: var(--brand); }
.tab { position: relative; }
.nav-badge { position: absolute; top: 4px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--red); color: #fff; font-size: 10px; line-height: 16px; font-weight: 700; text-align: center; }

.content { padding: 20px; max-width: 1400px; margin: 0 auto; }
.view-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.view-head h2 { font-size: 17px; }
.view-head .desc { color: var(--text-3); font-size: 13px; margin-top: 3px; }

/* ===== KPI cards ===== */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.kpi .k-label { font-size: 12px; color: var(--text-3); }
.kpi .k-value { font-size: 19px; font-weight: 700; margin-top: 6px; letter-spacing: -.3px; word-break: break-all; line-height: 1.25; }
.kpi .k-sub { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.kpi.warn .k-value { color: var(--red); }
.kpi.good .k-value { color: var(--green); }
.kpi.info .k-value { color: var(--brand); }
.kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--border); }
.kpi.warn::after { background: var(--red); }
.kpi.good::after { background: var(--green); }
.kpi.info::after { background: var(--brand); }

/* ===== Panels & tables ===== */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel + .panel { margin-top: 16px; }
.toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; background: var(--surface-2); }
.toolbar .spacer { flex: 1; }
.toolbar .lbl { font-size: 12px; color: var(--text-3); }
.toolbar select.input, .toolbar .input { width: auto; min-width: 120px; padding: 7px 10px; font-size: 13px; }

/* 冻结表头：容器内滚动 + sticky th（separate 边框模型保证 sticky 时边框不消失） */
.table-wrap { overflow: auto; max-height: 74vh; }
@media (max-width: 720px){ .table-wrap { max-height: 68vh; } }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.data th, table.data td { padding: 7px 9px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data th { color: var(--text-3); font-weight: 600; font-size: 12px; background: var(--surface); position: sticky; top: 0; z-index: 2; }
table.data thead th { box-shadow: inset 0 -1px 0 var(--border), 0 1px 0 var(--border); }
table.data tbody tr:nth-child(even) td { background: #FAFBFC; }
table.data tbody tr:hover td { background: #E8F1FF; }
table.data tbody tr.row-sel td { background: #CFE4FF; font-weight: 600; }
table.data tbody tr.row-sel td:first-child { box-shadow: inset 4px 0 0 #2563EB; }
table.data tbody tr.row-red td { background: #fef4f4; }
table.data tbody tr.row-red:hover td { background: #fdecec; }
table.data tbody tr.row-red.row-sel td { background: #FFD9D9; }
table.data tbody tr.row-red.row-sel td:first-child { box-shadow: inset 4px 0 0 #DC2626; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
.clickable { cursor: pointer; }
.sortable { cursor: pointer; user-select: none; }
.sortable:hover { color: var(--text); }
.muted { color: var(--text-3); }
.empty { padding: 40px; text-align: center; color: var(--text-3); }

/* ===== Badges & color blocks ===== */
.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; border: 1px solid transparent; line-height: 1.4;
}
.badge.red { color: var(--red); background: var(--red-bg); border-color: var(--red-bd); }
.badge.blue { color: var(--blue); background: var(--blue-bg); border-color: var(--blue-bd); }
.badge.green { color: var(--green); background: var(--green-bg); border-color: var(--green-bd); }
.badge.yellow { color: var(--yellow); background: var(--yellow-bg); border-color: var(--yellow-bd); }
.badge.gray { color: var(--gray); background: var(--gray-bg); border-color: var(--gray-bd); }

.cell {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 64px; padding: 6px 10px; border-radius: 8px; font-weight: 700; font-size: 14px;
  border: 1px solid transparent;
}
.cell.red { color: var(--red); background: var(--red-bg); border-color: var(--red-bd); }
.cell.blue { color: var(--blue); background: var(--blue-bg); border-color: var(--blue-bd); }
.cell.green { color: var(--green); background: var(--green-bg); border-color: var(--green-bd); }
.cell .tag { display: block; font-size: 11px; font-weight: 500; margin-top: 2px; text-align: center; }
.kv-cell { display: flex; flex-direction: column; align-items: center; }

tr.row-red td { background: #fef4f4; }
tr.row-red:hover td { background: #fdecec; }

/* progress bar */
.pbar { height: 8px; border-radius: 6px; background: var(--gray-bg); overflow: hidden; min-width: 90px; }
.pbar > i { display: block; height: 100%; border-radius: 6px; }
.pbar.red > i { background: var(--red); }
.pbar.yellow > i { background: var(--yellow); }
.pbar.green > i { background: var(--green); }

/* ===== Module 3 parent/child ===== */
.parent-row td { font-weight: 600; }
.expand-btn {
  border: 1px solid var(--border-strong); background: var(--surface); width: 22px; height: 22px;
  border-radius: 6px; display: inline-grid; place-items: center; color: var(--text-2); font-size: 13px; line-height: 1;
}
.expand-btn:hover { border-color: var(--brand); color: var(--brand); }
.child-row > td { background: var(--surface-2); padding: 0 12px; }
.child-inner { padding: 12px 8px 12px 34px; }
.child-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.child-table th, .child-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.child-table th { color: var(--text-3); font-weight: 600; font-size: 12px; }
.child-table tr.qc-fail td { background: #fdecec; }
.check { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); }
.check input { width: 15px; height: 15px; accent-color: var(--brand); }
.prog { position: relative; height: 22px; min-width: 92px; border-radius: 11px; background: #eef1f5; overflow: hidden; box-shadow: inset 0 0 0 1px #e3e6ea; }
.prog i { position: absolute; left: 0; top: 0; bottom: 0; display: block; }
.prog i.ok { background: #16a34a; }
.prog i.wait { background: #2563eb; }
.prog i.bad { background: #dc2626; }
.prog b { position: absolute; left: 0; right: 0; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #1f2937; font-weight: 600; text-shadow: 0 0 3px #fff, 0 0 3px #fff; }
.prog-legend { display: flex; flex-wrap: wrap; gap: 10px; padding: 8px 12px; font-size: 12px; color: var(--text-2, #4b5563); }
tr.row-leave { transition: opacity .25s ease-out, transform .25s ease-out; opacity: 0; transform: translateY(-4px); }
/* 模块三：订单编号（筛选/搜索/清单） */
.linklike { border: none; background: none; padding: 0; color: var(--link, #2563eb); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.badge.blue { background: #e0edff; color: #1d4ed8; }
.search-box { display: flex; align-items: center; gap: 6px; }
.search-box .input { min-height: 40px; width: 210px; font-size: 14px; }
.ord-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 12px 4px; font-size: 12px; }
.ord-chips .chip { border: 1px solid var(--line, #e3e6ea); background: #fff; border-radius: 999px; padding: 5px 10px; font: 500 12px/1 inherit; cursor: pointer; }
.ord-chips .chip.on { background: #111827; color: #fff; border-color: #111827; }
.unit-tag { display: inline-block; margin-left: 4px; font-size: 12px; color: var(--text-2, #4b5563); }
/* 客户编号：客户名称下方小字，不占列宽 */
.sub-code { font-size: 11px; line-height: 1.4; color: var(--text-3, #6b7280); letter-spacing: .2px; margin-top: 1px; }
.field .sub-code { display: block; min-height: 14px; }
.recv .unit-tag { margin-left: 0; white-space: nowrap; }
@media (max-width: 768px) { .search-box .input { width: 150px; min-height: 44px; } .ord-chips .chip { padding: 8px 12px; min-height: 36px; } }
/* ===== 03-01 手机端收货质检卡片（一材料一卡、纵向流、无价格、无扫码）===== */
.mrecv-list { display: flex; flex-direction: column; gap: 12px; padding: 10px 12px 16px; }
.mrecv { border: 1px solid var(--border-strong); border-radius: 14px; background: #fff; padding: 12px 13px; box-shadow: 0 1px 2px rgba(16,24,40,.05); }
.mrecv.qc-fail { border-color: #f3c2c2; background: #fff7f7; }
.mrecv.row-term { background: #f6f8fb; }
.mrecv-hd { display: flex; align-items: flex-start; gap: 8px; justify-content: space-between; }
.mrecv-name { font-weight: 700; font-size: 15px; line-height: 1.35; color: var(--text, #111827); }
.mrecv-spec { font-size: 11.5px; color: var(--text-3, #6b7280); margin-left: 6px; font-weight: 500; }
.mrecv-meta { font-size: 11.5px; color: var(--text-3, #6b7280); margin-top: 3px; }
.mrecv-prog { height: 8px; border-radius: 6px; background: #eef1f5; overflow: hidden; margin: 9px 0 6px; }
.mrecv-prog i { display: block; height: 100%; border-radius: 6px; transition: width .3s; }
.mrecv-prog i.ok, .mrecv-prog { --p: #16a34a; }
.mrecv-prog i { background: linear-gradient(90deg,#16a34a,#2563eb); }
.mrecv-prog i.bad { background: #dc2626; }
.mrecv-nums { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2, #374151); margin-bottom: 10px; }
.mrecv-nums b { font-size: 13.5px; color: #111; }
.mrecv-in { display: flex; gap: 8px; align-items: center; }
.mrecv-in .num-in { flex: 1; min-width: 0; height: 44px; font-size: 16px; }
.mrecv-in .btn { min-height: 44px; padding: 0 16px; font-size: 14px; }
.mrecv-qc { display: flex; gap: 8px; margin-top: 8px; }
.qc-big { flex: 1; min-height: 46px; border-radius: 10px; border: 1.5px solid var(--border-strong); background: #fff; font-size: 15px; font-weight: 700; cursor: pointer; transition: .15s; }
.qc-big.pass.on { background: #16a34a; border-color: #16a34a; color: #fff; }
.qc-big.fail.on { background: #dc2626; border-color: #dc2626; color: #fff; }
.qc-big:active { transform: scale(.98); }
.mrecv-term { margin-top: 8px; width: 100%; min-height: 40px; font-size: 12.5px; }
.mrecv-readonly { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 13px; color: var(--text-2); }
.ord-chips .chip.gen { border-style: dashed; color: var(--brand, #2563eb); border-color: var(--brand, #2563eb); background: #f5f8ff; }
.child-table tr.row-term { opacity: .72; }
.row-term .muted, .row-term td { color: #6b7280; }
.prog-legend span { display: inline-flex; align-items: center; gap: 5px; }
.prog-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.prog-legend i.ok { background: #16a34a; }
.prog-legend i.wait { background: #2563eb; }
.prog-legend i.bad { background: #dc2626; }
.prog-legend i.rest { background: #eef1f5; box-shadow: inset 0 0 0 1px #d7dce2; }
.rc-pt { flex-wrap: wrap; gap: 8px 18px; }
.rc-pt .radio { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text); cursor: pointer; }
.rc-pt .radio input { width: 16px; height: 16px; cursor: pointer; }
table.data.sm { font-size: 12.5px; }
table.data.sm th, table.data.sm td { padding: 6px 8px; }
.radio-pill { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.radio-pill button { border: none; background: var(--surface); padding: 8px 14px; font-size: 14px; color: var(--text-2); cursor: pointer; transition: background .15s, color .15s; }
.radio-pill button + button { border-left: 1px solid var(--border-strong); }
.radio-pill button.on.pass { background: #16a34a; color: #fff; font-weight: 700; }
.radio-pill button.on.pass::before { content: "✓ "; }
.radio-pill button.on.fail { background: #dc2626; color: #fff; font-weight: 700; }
.radio-pill button.on.fail::before { content: "✕ "; }
.radio-pill button:disabled { opacity: .55; cursor: default; }
.radio-pill button.flash { animation: qcf .5s ease-out; }
@keyframes qcf { 0% { outline: 3px solid #fbbf24; } 100% { outline: 3px solid transparent; } }
@media (max-width: 768px) { .radio-pill button { padding: 11px 16px; min-height: 44px; } }

/* ===== Modal ===== */
.overlay {
  position: fixed; inset: 0; background: rgba(16,24,40,.45); display: flex;
  align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.modal {
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 760px; max-height: 90vh; overflow: auto;
}
.modal.lg { max-width: 1120px; }
.modal.xl { max-width: 1380px; }
@media (min-width: 1500px) { .modal { max-width: 860px; } .modal.lg { max-width: 1240px; } }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 16px; }
.modal-head .x { border: none; background: transparent; font-size: 20px; color: var(--text-3); line-height: 1; }
.modal-body { padding: 18px 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kv-list { display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; font-size: 13px; }
.kv-list .k { color: var(--text-3); }
.followups { margin-top: 6px; }
.followups .fu { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; font-size: 13px; }
.followups .fu .meta { font-size: 11px; color: var(--text-3); margin-bottom: 3px; }

/* ===== Chart (aging) ===== */
.chart-row { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: center; }
@media (max-width: 720px){ .chart-row { grid-template-columns: 1fr; } .login-card{ grid-template-columns: 1fr; } .login-brand{ display:none; } .grid2{ grid-template-columns: 1fr; } }

/* ===== 模块四：平铺合并单元格 ===== */
.m4-flat td[rowspan] { vertical-align: middle; background: var(--surface); }
/* 前3列横向滚动冻结（冻结到「销售经理」列为止，订单总金额起可滑动） */
.m4-flat th.fz1,.m4-flat td.fz1{position:sticky;left:0;width:6.5em;min-width:6.5em;max-width:6.5em;z-index:2}
.m4-flat th.fz2,.m4-flat td.fz2{position:sticky;left:6.5em;width:10em;min-width:10em;max-width:10em;z-index:2}
.m4-flat th.fz3,.m4-flat td.fz3{position:sticky;left:16.5em;width:5em;min-width:5em;max-width:5em;z-index:2;box-shadow:2px 0 0 rgba(0,0,0,.08)}
.m4-flat thead th.fz1,.m4-flat thead th.fz2,.m4-flat thead th.fz3,.m4-flat thead th.fz4{z-index:3;background:var(--surface-2,#f3f4f6)}
.m4-flat .fz1 .name-wrap,.m4-flat .fz2 .name-wrap,.m4-flat .fz1 .cw4,.m4-flat .fz2 .cw9{max-width:100%}
.m4-flat .ord-first td { border-top: 2px solid var(--border-strong); }
.nowrap { white-space: nowrap; }
@media (max-width: 720px){
  /* 手机端同为平铺：紧凑字号与内边距，表格横向滑动，操作按钮保持可点面积 */
  .m4-flat { font-size: 12px; min-width: 900px; }
  .m4-flat th, .m4-flat td { padding: 8px 6px; }
  .m4-flat td[rowspan] { vertical-align: middle; }
  .m4-flat .cell { font-size: 12px; padding: 5px 8px; }
  .m4-flat .badge { font-size: 11.5px; padding: 3px 7px; }
  .m4-flat .kv-cell .cell { font-size: 12px; }
  .m4-flat .btn.sm { min-height: 40px; padding: 6px 10px; font-size: 12px; }
  .m4-flat .pbar { width: 70px !important; }
}

/* ===== 首次登录改密软提醒横幅 ===== */
.pw-banner {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: var(--yellow-bg); border-bottom: 1px solid var(--yellow-bd);
  color: #8a5a06; font-size: 13px; padding: 8px 16px;
}
.pw-banner .btn { background: var(--surface); border: 1px solid var(--yellow-bd); color: #8a5a06; }

/* ===== 指标可点击热区（月拜访/报价/转化 → 底部明细） ===== */
button.metric-btn {
  all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 6px;
  min-height: 40px; min-width: 64px; padding: 6px 10px; margin: -6px -10px;
  cursor: pointer; border-radius: 12px; -webkit-tap-highlight-color: transparent;
}
button.metric-btn:hover { background: var(--surface-2); }
button.metric-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
button.metric-btn .chev { color: var(--text-3); font-size: 16px; line-height: 1; }
@media (max-width: 720px){
  button.metric-btn { min-height: 56px; padding: 8px 12px; margin: -8px -12px; }
  button.metric-btn .chev { font-size: 20px; }
}

/* ===== 底部明细面板 (Bottom Sheet) ===== */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(16,24,40,.42); z-index: 1100;
  opacity: 0; transition: opacity .22s ease; -webkit-backdrop-filter: blur(1px); backdrop-filter: blur(1px);
}
.sheet-backdrop.on { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1101;
  background: var(--surface); border-radius: 16px 16px 0 0;
  max-height: 78vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateY(100%); transition: transform .26s cubic-bezier(.22,.61,.36,1);
}
.sheet.on { transform: translateY(0); }
body.sheet-open { overflow: hidden; }
.sheet-grab { width: 40px; height: 4px; border-radius: 4px; background: var(--border-strong); margin: 10px auto 0; }
.sheet-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 10px 16px 12px; border-bottom: 1px solid var(--border);
}
.sheet-title { font-size: 16px; font-weight: 700; color: var(--text); }
.sheet-sub { font-size: 13px; color: var(--text-2); margin-top: 3px; }
.sheet-count { font-size: 16px; }
.sheet-count.red { color: var(--red); }
.sheet-count.blue { color: var(--blue); }
.sheet-x {
  all: unset; box-sizing: border-box; cursor: pointer; -webkit-tap-highlight-color: transparent;
  width: 40px; height: 40px; flex: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--text-2); background: var(--gray-bg);
}
.sheet-x:hover { background: var(--border); }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 0 24px; }
.sheet-list { display: flex; flex-direction: column; }
.sheet-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--surface-2); }
.sheet-item:last-child { border-bottom: 0; }
.si-no {
  flex: none; width: 22px; height: 22px; border-radius: 50%; margin-top: 1px;
  background: var(--gray-bg); color: var(--text-2); font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.si-main { flex: 1; min-width: 0; }
.si-title { font-size: 15px; font-weight: 600; color: var(--text); display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.si-dot { color: var(--text-3); margin: 0 6px; font-weight: 400; }
.si-fields { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.si-chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 3px 8px; color: var(--text);
}
.si-chip i { font-style: normal; color: var(--text-3); }
.sheet-empty { padding: 40px 24px; text-align: center; color: var(--text-2); font-size: 14px; }
.sheet-empty span { display: block; margin-top: 8px; font-size: 12.5px; color: var(--text-3); line-height: 1.7; }
@media (min-width: 721px){
  .sheet { left: 50%; right: auto; bottom: 24px; transform: translate(-50%, 140%); width: 560px; border-radius: 16px; }
  .sheet.on { transform: translate(-50%, 0); }
}
.donut { display: flex; align-items: center; gap: 16px; }
.donut .center { font-size: 12px; color: var(--text-3); }
.legend { display: flex; flex-direction: column; gap: 8px; }
.legend .li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend .dot { width: 10px; height: 10px; border-radius: 3px; }
.legend .li .amt { margin-left: auto; color: var(--text-2); font-variant-numeric: tabular-nums; }

.bar-list .bar-item { margin-bottom: 12px; }
.bar-list .bar-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); margin-bottom: 4px; }

.section-title { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 18px 0 10px; display:flex; align-items:center; gap:8px; }
.section-title .pill { font-size: 11px; color: var(--text-3); font-weight: 400; }
.link-btn { border: none; background: none; color: var(--brand); font-size: 13px; padding: 0; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #111827; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13px;
  box-shadow: var(--shadow-lg); z-index: 60; opacity: 0; transition: opacity .2s; pointer-events: none;
}
.toast.show { opacity: 1; }
.hint { font-size: 12px; color: var(--text-3); }
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.right { margin-left: auto; }
.pill-toggle { display:inline-flex; gap:0; border:1px solid var(--border-strong); border-radius:8px; overflow:hidden; }
.pill-toggle button { border:none; background:var(--surface); padding:7px 12px; font-size:13px; color:var(--text-2); }
.pill-toggle button.on { background:var(--brand); color:#fff; font-weight:600; }
.pill-toggle button:disabled { color: var(--text-3); background: var(--surface-2); }

/* ===== 模块三：待办/历史视图切换 + 手机端收货操作区 ===== */
.seg { display: inline-flex; border: 1px solid var(--line, #e3e6ea); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 8px 14px; font-size: 13px; color: var(--muted, #6b7280); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line, #e3e6ea); }
.seg button.on { background: #111827; color: #fff; font-weight: 600; }
.recv { display: flex; align-items: center; gap: 6px; }
.recv .num-in { width: 78px; min-height: 44px; font-size: 16px; text-align: right; }
.recv .btn { min-height: 44px; padding: 0 12px; }
@media (max-width: 768px) {
  .seg button { padding: 10px 14px; font-size: 14px; }
  .child-table td, .child-table th { padding: 10px 8px; }
}

/* =========================================================
   模块 05 · 变压器报价
   ========================================================= */
.q5 { display: flex; flex-direction: column; gap: 14px; }
.q5-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.q5-tab { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 9px; padding: 8px 13px; font-size: 13px; cursor: pointer; }
.q5-tab b { color: var(--text-3); font-weight: 700; margin-right: 2px; }
.q5-tab.on { background: #111827; border-color: #111827; color: #fff; }
.q5-tab.on b { color: #cbd5e1; }
.q5-note { font-size: 12.5px; color: var(--text-2); background: var(--blue-bg); border: 1px solid var(--blue-bd); border-radius: 8px; padding: 8px 11px; }
.q5-note b { color: var(--blue); }

.q-bar { display: flex; align-items: flex-end; gap: 10px 14px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 13px; }
.q-bar label { font-size: 12px; color: var(--text-3); display: flex; flex-direction: column; gap: 4px; }
.q-bar select, .q-bar input[type="date"], .q-bar input[type="text"] { font: inherit; font-size: 13px; color: var(--text); border: 1px solid var(--border-strong); border-radius: 7px; padding: 7px 9px; min-height: 36px; background: #fff; }
.q-bar input#f-kw { min-width: 210px; }
.q-count { font-size: 12px; color: var(--text-3); margin-left: auto; }
.q-sw { flex-direction: row !important; align-items: center; gap: 6px !important; }
.q-sw input { width: 17px; height: 17px; }

.q-sec { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px; display: flex; flex-direction: column; gap: 10px; }
.q-sec h4 { margin: 0; font-size: 14px; color: var(--text); }
.q-hint { font-size: 12px; color: var(--text-3); line-height: 1.65; }
.q-empty { font-size: 13px; color: var(--text-2); line-height: 1.8; padding: 8px 4px; }
.q-empty.pad { padding: 22px 14px; text-align: center; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.q-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }

/* 列名速查条（sticky 兜底） */
.q-legend { display: flex; align-items: center; gap: 6px; overflow-x: auto; padding: 7px 9px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; -webkit-overflow-scrolling: touch; }
.q-legend-t { font-size: 11.5px; color: var(--text-3); flex: 0 0 auto; }
.q-chip { flex: 0 0 auto; border: 1px solid var(--border-strong); background: #fff; color: var(--text-2); font-size: 11.5px; border-radius: 20px; padding: 4px 10px; cursor: pointer; }
.q-chip:active, .q-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 数据表：冻结表头 + 冻结最左列（规格书九） */
.q-wrap { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.q-data { border-collapse: separate; border-spacing: 0; }
table.q-data th { position: -webkit-sticky; position: sticky; top: 0; z-index: 2; background: var(--surface); min-width: 68px; font-size: 12px; }
table.q-data .q-fix { position: -webkit-sticky; position: sticky; left: 0; z-index: 1; background: var(--surface); }
table.q-data thead th.q-fix { z-index: 4; box-shadow: inset -1px -1px 0 var(--border), 1px 0 0 var(--border); }
table.q-data tbody td.q-fix { box-shadow: inset -1px 0 0 var(--border); }
table.q-data tbody tr:hover .q-fix { background: var(--surface-2); }
/* 型号库：行号钉在最左(56px)，内部代码右移让位，两列都不随横向滚动 */
table.q-data .q-rowno { left: 0; width: 56px; min-width: 56px; max-width: 56px; padding: 8px 4px !important; text-align: center; color: var(--text-3); font-weight: 600; background: #fafbfd; }
table.q-data thead th.q-rowno { z-index: 5; }
table.q-data .q-rowno ~ .q-fix { left: 56px; }
/* 型号库：图纸编号/容量/材质/温升/裕度 为只读（取自成本行，与 B 区一致） */
table.q-data td.q-ro { color: var(--text-1); white-space: nowrap; }
table.q-data td { white-space: normal; vertical-align: top; }
table.q-data .num { white-space: nowrap; }
.th-sub { display: block; font-weight: 400; font-size: 10.5px; color: var(--text-3); margin-top: 2px; }
td.q-hl, th.q-hl { background: #fff8e1 !important; box-shadow: inset 0 0 0 1px #f3dcae; }

/* 内部代码色块 / 状态标记 */
.q-code { display: inline-block; background: #111827; color: #fff; font-size: 11.5px; font-weight: 700; letter-spacing: .3px; border-radius: 5px; padding: 2px 7px; }
.q-tag { display: inline-block; font-size: 10.5px; color: var(--text-3); background: var(--gray-bg); border: 1px solid var(--gray-bd); border-radius: 5px; padding: 1px 5px; }
.q-tag.round { color: var(--blue); background: var(--blue-bg); border-color: var(--blue-bd); }
.q-sp { color: var(--brand); font-weight: 600; }
.q-eff { color: var(--green); }
.q-pos { color: var(--green); font-weight: 600; }
.q-neg { color: var(--red); font-weight: 600; }

/* 表内输入 */
.q-in { font: inherit; font-size: 13px; border: 1px solid var(--border-strong); border-radius: 6px; padding: 5px 7px; width: 100%; max-width: 150px; background: #fff; color: var(--text); }
.q-in-n { width: 62px; text-align: right; }
.q-in-r { width: 52px; text-align: right; }
.q-w-enc { width: 180px; min-width: 180px; max-width: 180px; }
.q-orange { background: #fff7ed; border-color: #f3dcae; color: #9a3412; }
/* 每个材料组固定三行：重量 / 单价(或金额) / 成本 —— 成本在所有列落在同一条水平线上 */
.q-g { display: grid; grid-template-rows: 32px 32px 20px; gap: 3px; align-items: center; vertical-align: top; min-width: 96px; }
.q-g .q-in { width: 100%; max-width: none; margin: 0; }
.q-gr-ro { font-size: 12px; color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; }
.q-gr-ro i { font-style: normal; font-size: 9px; color: var(--text-3); border: 1px solid var(--border); border-radius: 3px; padding: 0 3px; margin-left: 3px; }
.q-gc { text-align: right; font-size: 12px; font-weight: 600; color: var(--text); border-top: 1px solid var(--border); padding-top: 2px; font-variant-numeric: tabular-nums; }
.q-g-none .q-gr { text-align: center; color: var(--text-3); }
.unit { font-size: 11px; color: var(--text-3); margin-left: 2px; }
.q-del { color: var(--red); border-color: var(--red-bd); }
tfoot .q-tot { font-size: 15px; font-weight: 700; color: var(--brand); }
tfoot .q-tot-l { text-align: right; color: var(--text-2); font-size: 13px; }
tfoot .q-upper { font-size: 12.5px; color: var(--text-2); }
.q-ta { width: 100%; min-height: 190px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; border: 1px solid var(--border-strong); border-radius: 8px; padding: 9px; }
.btn.file { cursor: pointer; }

/* ---- 03-02 生产工艺管理 ---- */
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.green:hover { filter: brightness(1.05); }
.cf-bar-btn { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.cf-bar-btn:hover .cf-pct { color: var(--brand); text-decoration: underline; }
.cf-bar { flex: 1; height: 10px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; min-width: 70px; }
.cf-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #5b8cff); border-radius: 6px; transition: width .25s; }
.cf-bar.full i { background: linear-gradient(90deg, var(--green), #34d399); }
.cf-pct { font-size: 12px; font-weight: 700; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cf-tbl td { vertical-align: top; }
.cf-tbl tr.cf-done td { background: #f2fbf6; }
.cf-in { display: flex; gap: 6px; }
.cf-in input { width: 74px; }
.cf-unit { align-self: center; font-size: 12px; color: var(--text-3); }
.cf-tag { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 20px; font-size: 11px; font-weight: 700; background: var(--blue-bg); color: var(--blue); border: 1px solid var(--blue-bd); }
.cf-who { font-size: 11px; margin-top: 3px; }
.cf-final { margin-top: 14px; border: 1px dashed var(--border-strong); border-radius: 10px; padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--surface-2); }
.cf-final.on { border-style: solid; border-color: var(--green-bd); background: var(--green-bg); }
.cf-final-lb { font-weight: 800; }
.cf-final-mn { flex: 1; min-width: 220px; font-size: 12px; color: var(--text-2); }
.cf-final-act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
@media (max-width: 720px) {
  .cf-tbl .btn.sm { min-height: 40px; padding: 8px 12px; }
  .cf-in input { width: 66px; min-height: 40px; }
  .cf-final { flex-direction: column; align-items: stretch; }
}

/* ---- 02-03 履约保证金与赊销风控 ---- */
.badge.orange { color: #c2410c; background: #ffedd5; border-color: #fed7aa; }
/* 长文案徽标（逾期/坏账分级）：12 字自动换行，不再撑破行宽 */
.badge-wrap { display: inline-block; max-width: 12em; white-space: normal; word-break: break-all; line-height: 1.45; text-align: left; vertical-align: middle; }
.bd-cap-step { cursor: pointer; color: var(--brand); }
.bd-cap-step:hover { text-decoration: underline; }
.bd-block table.data td { white-space: normal; }
.m4-cr { margin-top: 4px; }
.spad-wrap { margin-top: 8px; }
.spad { border: 1.5px dashed var(--border-strong); border-radius: 10px; background: #fff; touch-action: none; display: block; }
.spad-tools { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 12px; }
.sa-gt { margin-top: 14px; border: 1px solid var(--red-bd); background: #fff7f7; border-radius: 10px; padding: 12px 14px; }
.sa-gt-h { font-weight: 800; font-size: 14px; color: var(--red); }
.sa-gt-info { margin-top: 6px; font-size: 13px; }
.sa-gt-why { margin-top: 6px; font-size: 12.5px; color: var(--text-2); line-height: 1.7; }
.gt-doc { font-size: 13.5px; line-height: 1.95; }
.gt-doc h4 { text-align: center; font-size: 17px; margin: 0 0 8px; }
.gt-doc .gt-to { font-weight: 700; }
.gt-doc p { margin: 8px 0; text-indent: 2em; }
.gt-doc .gt-sign { margin-top: 16px; padding-top: 10px; border-top: 1px dashed var(--border-strong); font-size: 12.5px; }
.g-cl { display: grid; grid-template-columns: 56px 130px 1fr; gap: 6px; margin-bottom: 8px; }
.gimg { max-width: 100%; border: 1px solid var(--border); border-radius: 8px; }
.sp-fund-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 8px 10px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); font-size: 12.5px; }
.dp-tbl td, .dp-tbl th { white-space: nowrap; }
.cr-filter { display: flex; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid var(--border); }
@media (max-width: 720px) {
  .g-cl { grid-template-columns: 1fr; }
  .sp-fund-bar { flex-direction: column; align-items: flex-start; }
  .dp-tbl td, .dp-tbl th { white-space: normal; }
}

/* ---- 02-02 发货流程（发货单 7 步）---- */
.q-mode-cell { min-width: 168px; white-space: normal; }
.ddr-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-bottom: 1px solid var(--border); }
.ddr-names { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); font-size: 13px; line-height: 1.9; word-break: break-all; }
.dd-bak { margin: 0 14px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.dd-bak > summary { cursor: pointer; padding: 9px 12px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.dd-bak[open] > summary { border-bottom: 1px solid var(--border); }
.dd-bak .table-wrap { margin: 0; }
.q-mode-cell .pill-toggle { font-size: 12px; }
.q-mode-cell .pill-toggle button { padding: 4px 8px; font-size: 12px; }
.q-mode-cell .pill-toggle button:disabled { opacity: .5; cursor: not-allowed; }
.q-mode-info { font-size: 11px; margin-top: 4px; white-space: nowrap; }
.q-warn { margin-top: 6px; padding: 8px 12px; border: 1px solid var(--red-bd); background: var(--red-bg); color: var(--red); border-radius: 8px; font-size: 13px; font-weight: 600; }
/* 成本差异门禁：必须有人拍板选口径，不是普通提示，所以比 .q-warn 更醒目 */
.q-chain-gate { border-width: 2px; border-left: 6px solid var(--red); padding: 10px 12px; line-height: 1.6; }
.q-chain-gate .btn { vertical-align: middle; }
.btn.ghost { background: transparent; border-color: var(--border-strong); color: var(--text-2); }
.ck { display: inline-flex; align-items: center; gap: 6px; margin: 3px 10px 3px 0; font-size: 13px; cursor: pointer; }
.ck input { width: 16px; height: 16px; accent-color: var(--brand); }
td.ship-cell { white-space: normal; min-width: 190px; }
.shp-row { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.shp-code { font-size: 12px; font-weight: 700; color: var(--text-2); min-width: 46px; }
.shp-bar { display: flex; align-items: center; gap: 5px; flex: 1; min-width: 60px; }
.shp-bar .cf-bar { min-width: 44px; height: 8px; }
.shp-bar .cf-pct { font-size: 11px; }
.sp-step { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.sp-step.locked { opacity: .72; }
.sp-step.done { background: linear-gradient(90deg, rgba(22, 163, 74, .07), transparent 60%); }
.sp-no { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.sp-step.done .sp-no { background: var(--green); }
.sp-step.locked .sp-no { background: var(--gray); }
.sp-main { flex: 1; min-width: 0; }
.sp-lb { font-weight: 800; font-size: 14px; }
.sp-own { font-weight: 400; font-size: 12px; margin-left: 8px; }
.sp-detail { margin-top: 6px; font-size: 13px; }
.sp-act { flex: none; width: 118px; text-align: right; }
.sp-kv { display: flex; gap: 8px; font-size: 12.5px; padding: 2px 0; }
.sp-kv span { color: var(--text-3); flex: none; width: 128px; }
.sp-kv b { font-weight: 600; word-break: break-all; }
.sp-chk { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin: 6px 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sp-chk.on { border-color: var(--green-bd); background: var(--green-bg); }
.sp-chk-lb { font-weight: 700; min-width: 130px; }
.sp-chk-sys { flex: 1; min-width: 180px; font-size: 12.5px; color: var(--text-2); }
.sp-chk-f { display: flex; gap: 8px; align-items: center; }
.sp-sign { display: flex; flex-direction: column; gap: 6px; }
.sp-sign-p { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.sp-sign-p.on { border-color: var(--green-bd); background: var(--green-bg); }
.sp-sign-n { font-weight: 700; min-width: 72px; }
.sp-photos { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0; }
.sp-img { width: 148px; }
.sp-img img { width: 148px; height: 112px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
.sp-up { margin-top: 4px; }
.sp-ownlist { max-height: 320px; overflow: auto; }
.sa-tbl td, .sa-tbl th { white-space: nowrap; }
.sa-qty { width: 84px; text-align: right; }
.sa-docs { display: flex; flex-wrap: wrap; }
.shp-tpl-tbl td { vertical-align: middle; }
.rc-custcode { font-family: var(--mono, ui-monospace, Menlo, monospace); font-size: 11.5px; color: var(--text-2); letter-spacing: .3px; }
.rc-codebar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 12px; margin: 0 0 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.gap-warn { margin: 10px 14px; padding: 10px 12px; border: 1px solid #fed7aa; background: #fff7ed; color: #9a3412; border-radius: 8px; font-size: 13px; line-height: 1.7; }
@media print { .rc-codebar { display: none; } }
.sp-own-cell { white-space: normal; }
.sp-own-note { font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.sp-own-lead .sp-own-gl { color: var(--brand); }
.sp-own-lead { background: var(--blue-bg); border-radius: 6px; padding: 4px 6px; }
.sp-own-grp { display: flex; align-items: baseline; gap: 8px; padding: 3px 0; border-bottom: 1px dashed var(--border); }
.sp-own-grp:last-of-type { border-bottom: none; }
.sp-own-gl { flex: none; width: 78px; font-size: 12px; font-weight: 700; color: var(--text-3); }
.sp-own-gi { display: flex; flex-wrap: wrap; gap: 2px 4px; }
.sp-own-off { margin-top: 8px; font-size: 12px; }
.sp-own-off > summary { cursor: pointer; color: var(--text-3); }
.sp-own-off .ck { font-size: 12px; }
@media (max-width: 720px) { .sp-own-grp { display: block; } .sp-own-gl { width: auto; display: block; margin-bottom: 2px; } }
@media (max-width: 720px) {
  .sp-step { flex-wrap: wrap; }
  .sp-act { width: 100%; text-align: left; }
  .sp-act .btn.sm { min-height: 40px; }
  .sp-kv span { width: 104px; }
  .sa-qty { width: 72px; min-height: 40px; }
}
.q-staff td { padding: 8px 10px; }

@media (max-width: 768px) {
  .q-bar { padding: 10px; gap: 8px 10px; }
  .q-bar input#f-kw { min-width: 150px; }
  .q-bar .btn { white-space: nowrap; }
  .q-count { margin-left: 0; width: 100%; }
  table.q-data th, table.q-data td { padding: 6px 6px; font-size: 11.5px; }
  table.q-data thead th { font-size: 11px; }
  .q-in { font-size: 15px; }          /* 防 iOS 聚焦缩放 */
  .q-in-n { width: 64px; }
  .q-g { grid-template-rows: 36px 36px 22px; min-width: 104px; }
  .q-gc { font-size: 12.5px; }
  /* 五个页签排一行：不换行 + 横向滑动 */
  .q5-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .q5-tab { padding: 8px 10px; font-size: 12px; white-space: nowrap; flex: 0 0 auto; }
  .q-actions .btn { flex: 1 1 auto; min-height: 44px; }
}

.sheet-overlay .modal { max-width: 1220px; width: 96vw; }
/* =========================================================
   对外报价单 —— 照公司报价单模板 1:1 复刻（A4 横向）
   ========================================================= */
.quote-sheet { background: #fff; color: #000; padding: 10px 12px; font-family: "Songti SC", SimSun, "Times New Roman", serif; font-size: 10.5px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.quote-sheet .qs-row { border: 1.2px solid #000; margin-top: -1.2px; }
.quote-sheet .qs-row:first-of-type { margin-top: 0; }
/* 页眉 */
.qs-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 8px 6px; border: 1.2px solid #000; }
.qs-logo { display: flex; align-items: center; min-width: 132px; }
.qs-mark { height: 30px; width: auto; display: block; }
.qs-logo-t { display: none; flex-direction: column; line-height: 1.15; }
.qs-logo-t b { font-size: 15px; letter-spacing: 1px; color: #1F3A6E; }
.qs-logo-t i { font-size: 7.5px; font-style: normal; letter-spacing: .5px; color: #4a5568; }
/* 大标题相对整张报价表真居中（letter-spacing 会在末字后留空，故右移半个字距补偿） */
.qs-title { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) translateX(3px); white-space: nowrap; text-align: center; font-size: 22px; font-weight: 700; letter-spacing: 6px; }
/* 右上角商务块：宽度取最长的一行（邮箱），其余两行在该宽度内居中 */
.qs-biz { flex: 0 0 auto; width: max-content; min-width: 0; text-align: center; line-height: 1.45; font-size: 9.5px; }
/* 有效期 / 简介 / 优势 / 抬头 */
.qs-valid { padding: 5px 8px; font-size: 10px; }
.qs-valid b { font-weight: 700; }
.qs-intro { padding: 6px 8px; line-height: 1.65; text-indent: 2em; text-align: justify; }
.qs-adv-t { text-align: center; font-weight: 700; font-size: 11.5px; padding: 4px; background: #f0f0f0; }
.qs-adv { display: flex; }
.qs-adv-c { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 4px; text-align: center; line-height: 1.45; }
.qs-adv-c + .qs-adv-c { border-left: 1.2px solid #000; }
.qs-adv-c b { font-size: 10.5px; }
.qs-adv-c span { font-size: 9px; color: #222; }
.qs-to { display: flex; align-items: center; background: #1F6FC4; color: #fff; font-weight: 700; font-size: 11px; }
.qs-to span { word-break: break-word; }
.qs-to-c { flex: 1; padding: 4px 8px; }
.qs-to-p { padding: 4px 9em 4px 8px; text-align: right; }
/* 明细表 */
/* 固定布局：列宽由 colgroup 指定（百分比合计 100%），屏幕与打印比例一致，不因内容长短抖动 */
.qs-table { width: 100%; border-collapse: collapse; table-layout: fixed; margin-top: -1.2px; font-size: 10px; }
.qs-table th, .qs-table td { border: 1.2px solid #000; padding: 4px 5px; text-align: center; vertical-align: middle; word-break: break-word; }
.qs-table td.n { text-align: right; font-variant-numeric: tabular-nums; }
.qs-table td.qs-t-left { text-align: left; }
.qs-table th { background: #e8e8e8; font-weight: 700; }
.qs-table td.n { text-align: right; font-variant-numeric: tabular-nums; }
.qs-table td.qs-b { font-weight: 700; }
.qs-table td.qs-merge { font-weight: 400; }
.qs-table td.qs-blank { padding: 14px; color: #666; }
.qs-sum td { background: #fbe3cc; font-weight: 700; text-align: right; padding: 4px 6px; }
.qs-sum.upper td { background: #f8d3ae; }
.qs-sum .qs-total { text-align: right; font-size: 11px; }
/* 红框内合计单元格居中（覆盖 .qs-sum td 的右对齐） */
.qs-sum td.qs-ctr { text-align: center; }
.qs-sum .qs-upper { text-align: center; letter-spacing: .5px; white-space: normal; word-break: break-all; }
/* 条款 */
/* 条款与页脚合并为同一个外框（照纸质模板：中间不再有横线） */
.qs-terms { border: 1.2px solid #000; border-top: 0; border-bottom: 0; padding: 5px 8px 5px; line-height: 1.55; font-size: 9.5px; }
.qs-term b { color: #1F6FC4; display: block; margin-top: 3px; }
.qs-term p { margin: 0 0 0 1em; }
/* 页脚 + 印章 */
.qs-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 4px 8px 4px; border: 1.2px solid #000; border-top: 0; font-size: 10px; }
/* 底部客户经理三项：占满印章左侧的整条区域，居中并均匀分散 */
.qs-cc { flex: 1 1 auto; min-width: 0; display: flex; justify-content: space-evenly; align-items: baseline; gap: 28px; padding: 0 4px; }
.qs-cc span { white-space: nowrap; }
/* 页脚右侧：公司全称 + 商务中心 两行文字，公章居中压在两行之上（半透明，文字可透出） */
.qs-seal { position: relative; display: flex; align-items: center; justify-content: center; min-width: 196px; min-height: 56px; padding: 3px 6px 2px; }
.qs-seal-txt { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.qs-seal-txt i { font-style: normal; font-size: 10.5px; letter-spacing: .5px; color: #000; text-align: center; }
/* 公章按物理尺寸 40mm（有限公司标准公章直径）：打印/横版PDF 纸面与真实盖章一致；屏幕预览同比例 */
.qs-seal-mark { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -75%); height: 40mm; width: auto; opacity: .9; pointer-events: none; mix-blend-mode: multiply; }
.qs-seal.qs-seal-none::before { content: "（印章位）"; display: block; width: 40mm; height: 40mm; line-height: 40mm; border: 2px dashed #b91c1c; color: #b91c1c; border-radius: 50%; font-size: 11px; }

/* 打印排版：只由 JS 在打印期间挂 .qs-print 生效（也用于打印前离屏实测高度），不改屏幕显示 */
.quote-sheet.qs-print { padding: 10px 0 8px; font-size: 10px; }
.quote-sheet.qs-print .qs-valid { padding-top: 3px; padding-bottom: 3px; }
.quote-sheet.qs-print .qs-intro { padding-top: 4px; padding-bottom: 4px; }
.quote-sheet.qs-print .qs-adv-t { padding-top: 3px; padding-bottom: 3px; }
.quote-sheet.qs-print .qs-adv-c { padding-top: 4px; padding-bottom: 4px; }
.quote-sheet.qs-print .qs-to-c, .quote-sheet.qs-print .qs-to-p { padding-top: 3px; padding-bottom: 3px; }
.quote-sheet.qs-print .qs-table th, .quote-sheet.qs-print .qs-table td { padding-top: 3px; padding-bottom: 3px; }
/* 首行下移约半行，避免顶到可印区上沿被切 */
.quote-sheet.qs-print .qs-terms { padding: 4px 8px 3px; }
.quote-sheet.qs-print .qs-foot { padding: 3px 8px 6px; }
/* 公章随页脚一起上移（整体收紧约3行，便于多行报价时一页容纳） */
.quote-sheet.qs-print .qs-seal { padding: 2px 6px 2px; min-width: 188px; min-height: 62px; align-items: center; }
.quote-sheet.qs-print .qs-seal-mark { height: 40mm; top: 50%; }
/* 一页打印开关（在弹层底栏，打印时整条底栏不输出） */
.qs-fit-lb { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none; }
.qs-fit-lb input { width: auto; margin: 0; cursor: pointer; }
.qs-fit-lb i { font-style: normal; font-size: 12px; color: var(--text-3); }

@media print {
  @page { size: A4 landscape; margin: 7mm; }
  html, body { background: #fff !important; }
  /* 两条触发路径都只印报价单：① App 内「打印」按钮(加 .printing-quote)；② 系统/浏览器打印菜单——只要报价单弹层开着(:has(.quote-sheet))，无需按钮也隔离 */
  body.printing-quote > *:not(.sheet-overlay),
  body:has(.quote-sheet) > *:not(.sheet-overlay) { display: none !important; }
  body.printing-quote .overlay, body:has(.quote-sheet) .overlay { position: static !important; display: block !important; background: #fff !important; padding: 0 !important; }
  body.printing-quote .modal, body:has(.quote-sheet) .modal { box-shadow: none !important; max-width: none !important; width: auto !important; border: 0 !important; border-radius: 0 !important; max-height: none !important; overflow: visible !important; margin: 0 !important; }
  body.printing-quote .sheet-overlay .modal, body:has(.quote-sheet) .sheet-overlay .modal { max-width: none !important; width: auto !important; }
  body.printing-quote .modal-head, body.printing-quote .modal-foot,
  body:has(.quote-sheet) .modal-head, body:has(.quote-sheet) .modal-foot { display: none !important; }
  body.printing-quote .modal-body, body:has(.quote-sheet) .modal-body { padding: 0 !important; max-height: none !important; overflow: visible !important; }
  body.printing-quote .quote-sheet, body:has(.quote-sheet) .quote-sheet { padding: 10px 0 0; font-size: 10px; }
  body.printing-quote .qs-seal-mark, body:has(.quote-sheet) .qs-seal-mark { opacity: .96; }
  /* 强制打印背景色：客户名称蓝带、总计桃色行、表头灰底、四大优势等，不依赖“背景图形”勾选 */
  body.printing-quote .quote-sheet, body.printing-quote .quote-sheet *,
  body:has(.quote-sheet) .quote-sheet, body:has(.quote-sheet) .quote-sheet * {
    -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important;
  }
  /* 任一区块整行不可跨页拆分，避免每页首尾行被切一半 */
  body.printing-quote .qs-head, body.printing-quote .qs-row, body.printing-quote .qs-terms,
  body.printing-quote .qs-foot, body.printing-quote .qs-table tr,
  body:has(.quote-sheet) .qs-head, body:has(.quote-sheet) .qs-row, body:has(.quote-sheet) .qs-terms,
  body:has(.quote-sheet) .qs-foot, body:has(.quote-sheet) .qs-table tr { page-break-inside: avoid; break-inside: avoid; }
}

/* 成本行已并入 .q-gc（三行网格第三行） */
/* 报价清单：抬头区与明细表 */
.q-head-bar label { min-width: 150px; }
.q-head-bar label:nth-child(1), .q-head-bar label:nth-child(2) { flex: 1 1 190px; }
table.q-cart td { white-space: normal; }
table.q-cart tbody tr:nth-child(even) { background: var(--surface-2); }
/* ①报价筛选：紧凑收缩布局——表格不强制撑满，窄列贴内容，多余空白消除，温升及之后整体左移 */
table.q-pick { width: auto; }
table.q-pick th, table.q-pick td { padding: 8px 9px; }
table.q-pick th.q-narrow, table.q-pick td.q-narrow { white-space: nowrap; width: 1%; min-width: 0; }
table.q-cart .q-in { max-width: 118px; }
/* ②报价清单输入框宽度：规格/型号 +1字、数量 -1字、备注 10字 */
table.q-cart .q-w-spec { width: 132px; max-width: 132px; }
table.q-cart .q-w-qty { width: 48px; max-width: 48px; }
table.q-cart .q-w-note { width: 140px; max-width: 140px; }
@media (max-width: 768px) {
  table.q-cart .q-w-spec { width: 146px; max-width: 146px; }
  table.q-cart .q-w-qty { width: 50px; max-width: 50px; }
  table.q-cart .q-w-note { width: 150px; max-width: 150px; }
}
@media (max-width: 768px) { .q-head-bar label { min-width: 46%; } }

/* ⑤ 人员档案：行内编辑 + 报价单取值预览 */
table.q-staff th { font-size: 11.5px; }
table.q-staff td { padding: 6px 8px; }
table.q-staff .q-in { max-width: 168px; }
table.q-staff td .q-in { width: 100%; }
table.q-staff .q-ops { white-space: nowrap; text-align: right; }
table.q-staff .q-ops .btn { min-height: 34px; }
.q-src { border-color: var(--blue-bd); background: #fbfdff; }
.q-src-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.q-src-c { border: 1px solid var(--border-strong); border-radius: 8px; background: #fff; padding: 9px 11px; display: flex; flex-direction: column; gap: 2px; }
.q-src-c b { font-size: 13px; color: var(--text); }
.q-src-c span { font-size: 12px; color: var(--text-2); }
.q-src-c i { font-style: normal; font-size: 11px; color: var(--text-3); margin-top: 3px; }
.q-src-t { font-size: 11px !important; color: var(--blue) !important; font-weight: 600; margin-bottom: 2px; }
.q-src-line { width: 100%; display: flex; gap: 6px 18px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-2); border-top: 1px dashed var(--border); padding-top: 7px; }
.q-src-line b { color: var(--text); font-weight: 600; }
@media (max-width: 768px) {
  .q-src-grid { grid-template-columns: 1fr; }
  table.q-staff .q-in { font-size: 15px; max-width: none; }
  table.q-staff td { padding: 8px 6px; }
  table.q-staff .q-ops .btn { min-height: 40px; }
}

/* =========================================================
   ② 成本系数后台 · B 区：每图号一行，重量/单价/成本横向平行
   左侧 6 列（图号…裕度）冻结；宽度与 left 偏移在同一处定义，
   手机端两套数值各自自洽（避免 JS 内联偏移与 CSS 宽度不一致）
   ========================================================= */
.q-bwrap { max-height: 74vh; }
table.q-btab { font-size: 11.5px; }
table.q-btab th, table.q-btab td { padding: 5px 6px; white-space: nowrap; }
table.q-btab thead th { min-width: 0; }
table.q-btab .q-in { width: 58px; padding: 3px 4px; font-size: 11.5px; text-align: right; }
/* 冻结列 */
table.q-btab .q-fz { position: -webkit-sticky; position: sticky; z-index: 3; background: var(--surface); }
table.q-btab thead .q-fz { z-index: 6; }
table.q-btab tbody tr:hover .q-fz { background: var(--surface-2); }
/* 电脑端：width 与 left 一一对应（left = 前面所有列宽之和） */
.q-fz0 { width: 48px; min-width: 48px; max-width: 48px; left: 0; }
.q-fz1 { width: 118px; min-width: 118px; max-width: 118px; left: 48px; }
.q-fz2 { width: 140px; min-width: 140px; max-width: 140px; left: 166px; }
.q-fz3 { width: 96px; min-width: 96px; max-width: 96px; left: 306px; }
.q-fz4 { width: 54px; min-width: 54px; max-width: 54px; left: 402px; }
.q-fz5 { width: 46px; min-width: 46px; max-width: 46px; left: 456px; }
.q-fz6 { width: 54px; min-width: 54px; max-width: 54px; left: 502px; }
.q-fz7 { width: 52px; min-width: 52px; max-width: 52px; left: 556px; }
table.q-btab .q-fzi { width: 100%; text-align: left; }
table.q-btab .q-fzi-n { text-align: right; }
/* 冻结列只读（图纸编号/容量/材质/温升/裕度）：纯文字，无输入框外观 */
table.q-btab td.q-ro { text-align: center; color: var(--text-1); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.q-btab td.q-rowno { color: var(--text-3); font-weight: 600; background: #fafbfd; }
/* 冻结区右边界：分隔线 + 淡阴影，提示「到这里为止是钉住的」 */
.q-fz-edge { box-shadow: inset -1px 0 0 var(--border-strong), 8px 0 10px -8px rgba(16, 24, 40, .28); }
/* 材料组跨列表头 */
table.q-btab th.q-gp { text-align: center; background: #f4f7fb; border-left: 1px solid var(--border-strong); border-bottom: 1px solid var(--border); }
table.q-btab th.q-sub { font-size: 10.5px; font-weight: 500; color: var(--text-3); background: #fafbfd; text-align: right; border-left: 1px solid var(--border); }
table.q-btab th.q-sub-c { color: var(--text); font-weight: 700; background: #f2f5f9; }
table.q-btab td.q-cell { min-width: 62px; text-align: right; }
table.q-btab td.q-cost { background: #fbfcfe; font-variant-numeric: tabular-nums; }
table.q-btab td.q-dim { color: var(--text-3); text-align: center; }
table.q-btab td.num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 768px) {
  .q-bwrap { max-height: 70vh; }
  table.q-btab { font-size: 11px; }
  table.q-btab th, table.q-btab td { padding: 5px 5px; }
  table.q-btab .q-in { width: 54px; font-size: 14px; padding: 5px 4px; }  /* ≥14px 避免 iOS 聚焦缩放 */
  /* 手机端：width 与 left 同样成一套 */
  .q-fz0 { width: 40px; min-width: 40px; max-width: 40px; left: 0; }
  .q-fz1 { width: 104px; min-width: 104px; max-width: 104px; left: 40px; }
  .q-fz2 { width: 110px; min-width: 110px; max-width: 110px; left: 144px; }
  .q-fz3 { width: 82px; min-width: 82px; max-width: 82px; left: 254px; }
  .q-fz4 { width: 52px; min-width: 52px; max-width: 52px; left: 336px; }
  .q-fz5 { width: 46px; min-width: 46px; max-width: 46px; left: 388px; }
  .q-fz6 { width: 54px; min-width: 54px; max-width: 54px; left: 434px; }
  .q-fz7 { width: 52px; min-width: 52px; max-width: 52px; left: 488px; }
}

/* =========================================================
   手机端专用紧凑布局（⑤ 变压器报价）—— ≤768px 生效
   ========================================================= */
@media (max-width: 768px) {
  /* 1) 五个页签：一行等宽、不换行、不横向滚 */
  .q5-tabs { flex-wrap: nowrap; overflow: visible; gap: 4px; }
  .q5-tab { flex: 1 1 0; min-width: 0; padding: 8px 2px; font-size: 12px; text-align: center; white-space: nowrap; }
  .q5-tab b { margin-right: 0; }

  /* 2) ①报价筛选：所有列都保留（内部代码/材质类型/温升/裕度是搜索关键字段，不隐藏），
        手机端靠表格横向自由滑动查看全部列，仅收紧行距列距 */
  table.q-pick th, table.q-pick td { padding: 5px 5px; line-height: 1.3; }

  /* 3) ⑥干变成本 B 区：手机端只冻结「行号 + 图号」两列，其余横向滑动，
        避免冻结 6 列吃满窄屏导致无法操作 */
  table.q-btab .q-fz2, table.q-btab .q-fz3, table.q-btab .q-fz4,
  table.q-btab .q-fz5, table.q-btab .q-fz6, table.q-btab .q-fz7 { position: static; }
  table.q-btab .q-fz-edge { box-shadow: none; }
  table.q-btab .q-fz1 { box-shadow: inset -1px 0 0 var(--border-strong), 6px 0 8px -6px rgba(16, 24, 40, .25); }
  table.q-btab th, table.q-btab td { padding: 4px 4px; }

  /* 4) 通用：05 各表行距更紧、字号略小，触控目标仍 ≥40px */
  .q-data th, .q-data td { line-height: 1.35; }
  .q-actions .btn { min-height: 44px; }
}

/* =========================================================
   对外报价单：手机端横版预览 + 打印方向提示
   ========================================================= */
.qs-mob-hint { display: none; }
@media (max-width: 768px) {
  /* 打印弹层里的方向提示（仅手机显示） */
  .sheet-overlay .modal-foot { flex-wrap: wrap; }
  .qs-mob-hint { display: block; width: 100%; order: -1; font-size: 12px; line-height: 1.5; color: #8a5a06;
    background: #fff7e6; border: 1px solid #f0c36d; border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }
  .qs-mob-hint b { color: #b45309; }
}
/* 手机端【屏幕预览】统一字号：表头=表体、标题收敛、正文一致，解决大小不一；
   限定 screen，打印/PDF 版式（@media print + .qs-print）完全不受影响 */
@media screen and (max-width: 768px) {
  .quote-sheet { font-size: 13px; padding: 8px 8px; }
  .quote-sheet .qs-title { font-size: 17px; }
  .quote-sheet .qs-logo-t b { font-size: 14px; }
  .quote-sheet .qs-logo-t i { font-size: 8px; }
  .quote-sheet .qs-biz { font-size: 11.5px; }
  .quote-sheet .qs-valid { font-size: 12.5px; }
  .quote-sheet .qs-intro { font-size: 12.5px; line-height: 1.6; }
  .quote-sheet .qs-adv-t { font-size: 13px; }
  .quote-sheet .qs-adv-c b { font-size: 12.5px; }
  .quote-sheet .qs-adv-c span { font-size: 11.5px; }
  .quote-sheet .qs-to { font-size: 13px; }
  .quote-sheet .qs-table { font-size: 12.5px; }
  .quote-sheet .qs-table th, .quote-sheet .qs-table td { font-size: 12.5px; padding: 5px 4px; }
  .quote-sheet .qs-sum td { font-size: 12.5px; }
  .quote-sheet .qs-sum .qs-total { font-size: 13px; }
  .quote-sheet .qs-terms { font-size: 12px; line-height: 1.6; }
  .quote-sheet .qs-seal-txt i { font-size: 12px; }
}
/* ④ 合同编辑弹窗 */
.ctr-form{display:flex;flex-direction:column;gap:12px}
.ctr-hd{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.ctr-hd label,.ctr-grid label{display:flex;flex-direction:column;gap:3px;font-size:12px;color:var(--text-2)}
.ctr-hd input,.ctr-grid input{font-size:15px;padding:8px 10px;border:1px solid var(--line);border-radius:6px;min-height:40px}
.ctr-item{border:1px solid var(--line);border-radius:8px;padding:10px;margin-bottom:8px}
.ctr-item-hd{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px}
.ctr-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.ctr-grid label.ro{background:#f6f7f9;border-radius:6px;padding:6px 8px;justify-content:center}
.ctr-grid label.ro b{font-size:15px;color:var(--text-1)}
@media(min-width:769px){.ctr-grid{grid-template-columns:1fr 1fr 1fr}.ctr-hd{grid-template-columns:repeat(4,1fr)}}
@media(max-width:768px){.ctr-grid label,.ctr-hd label{font-size:13px}.ctr-grid input,.ctr-hd input{font-size:16px}}
.ctr-block{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--text-2)}
.ctr-block textarea{font-size:14px;padding:8px;border:1px solid var(--line);border-radius:6px;resize:vertical}
.ctr-sec-t{font-size:12px;color:var(--text-2);font-weight:600;margin-top:2px}
.ctr-bi{margin-top:4px}

/* ===== 对账单（往来对账函） ===== */
.rc-editor{max-height:70vh;overflow:auto}
.rc-hd{display:flex;gap:14px;flex-wrap:wrap;margin-bottom:10px}
.rc-hd label{display:flex;flex-direction:column;font-size:12px;color:var(--text-2);gap:4px}
.rc-hd input{padding:6px 8px;border:1px solid var(--line);border-radius:6px;font-size:13px;min-width:180px}
.rc-rows{overflow:auto;border:1px solid var(--line);border-radius:8px;max-height:52vh;-webkit-overflow-scrolling:touch}
.rc-tbl{border-collapse:separate;border-spacing:0;font-size:12px;min-width:100%}
.rc-tbl th{position:sticky;top:0;z-index:3;background:#e9eef4;color:var(--text);padding:7px 5px;border-bottom:2px solid var(--line);border-right:1px solid var(--line);white-space:nowrap;font-weight:600;font-size:11.5px}
.rc-tbl th:first-child{left:0;z-index:5;border-left:1px solid var(--line)}
.rc-tbl td{padding:0;border-bottom:1px solid var(--line);border-right:1px solid var(--line)}
.rc-tbl td.rc-sticky-col{position:sticky;left:0;z-index:2;background:#fbf6ec;box-shadow:1px 0 0 var(--line)}
.rc-tbl tbody tr:nth-child(even) td{background:#e9eef4}
.rc-tbl tbody tr:nth-child(even) td:first-child{background:#e9eef4}
.rc-tbl tbody tr:hover td{background:#dbe7fb}
.rc-tbl input[data-f="qty"]{min-width:40px;width:40px}
.rc-tbl input{width:100%;min-width:60px;padding:5px 4px;border:0;border-radius:0;font-size:12px;background:transparent;box-sizing:border-box}
.rc-tbl input:focus{outline:2px solid var(--brand);outline-offset:-2px;background:#fff}
.rc-tbl input.num{text-align:right;font-variant-numeric:tabular-nums;min-width:92px}
.rc-tbl input[data-f="ship_date"]{min-width:12em;white-space:normal}
/* 关键金额列淡色底 */
.rc-tbl input[data-f="contract_amount"]{background:#fff7e6}
.rc-tbl input[data-f="received"]{background:#eaf7ee}
.rc-tbl input[data-f="contract_owed"],.rc-tbl input[data-f="ship_unpaid"]{background:#fdecec}
.rc-tbl input[data-f="project"],.rc-tbl input[data-f="model"],.rc-tbl input[data-f="ship_model"],.rc-tbl input[data-f="note"]{min-width:104px;text-align:left}
/* 编辑表按项目分组合并 */
.rc-grouped{table-layout:fixed;width:100%}
.rc-grouped th{overflow-wrap:anywhere;white-space:normal}
.rc-grouped input{min-width:0;width:100%;box-sizing:border-box;overflow:hidden}
.rc-grouped tbody tr:nth-child(even) td,.rc-grouped tbody tr:nth-child(odd) td{background:#fff}
.rc-grouped tbody tr:hover td{background:#f2f7ff}
.rc-grouped .rc-grp-head td{border-top:2px solid #b9c4d4}
.rc-grouped td[rowspan]{vertical-align:middle;background:#fbf6ec !important}
.rc-grouped td[rowspan] input{background:transparent}
.rc-tbl tfoot .rc-total-row td{background:#E6F4EA;font-weight:700;border-top:2px solid #b9c4d4}
.rc-tbl tfoot .rc-tot-lab{position:sticky;left:0;z-index:2;text-align:center}
/* 客户名称超 15 字换行，不撑列宽 */
.cust-name{display:inline-block;max-width:15em;white-space:normal;word-break:break-all;line-height:1.35;vertical-align:top}
/* 移动端对账编辑表豁免：不转 block、不吸附末列/首列——避免横滑时吸附列色条遮挡中间金额列 */
@media (max-width: 860px){
  .rc-rows table{display:table;width:auto;min-width:100%;overflow-x:visible}
  .rc-rows thead th:last-child,.rc-rows tbody td:last-child,.rc-rows tfoot td:last-child{position:static;right:auto;z-index:auto;background:transparent;box-shadow:none}
  .rc-rows .rc-tbl td.rc-sticky-col,.rc-rows .rc-tbl tfoot .rc-tot-lab{position:static;left:auto;z-index:auto;box-shadow:none}
  .rc-rows .rc-tbl th{left:auto;z-index:3}
}
/* 触屏无 hover：去掉悬停色带，避免滑动后残留色条遮字 */
@media (hover:none){
  .rc-tbl tbody tr:hover td,.rc-grouped tbody tr:hover td{background:transparent}
}
.rc-block{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--text-2);margin-top:10px}
.rc-block textarea{font-size:13px;padding:8px;border:1px solid var(--line);border-radius:6px;resize:vertical}
.rc-acct{margin-top:10px;font-size:12px;color:var(--text-2);background:var(--bg-2);padding:8px 10px;border-radius:6px;line-height:1.7}
/* A4 对账函版式 */
.recon-sheet{background:#fff;color:#000;padding:10px 12px;font-family:"Songti SC",SimSun,"Times New Roman",serif;font-size:11px;line-height:1.4;-webkit-print-color-adjust:exact;print-color-adjust:exact;max-width:1120px;margin:0 auto}
.recon-sheet .rc-topbar{height:30px}
.recon-sheet .rc-logo{height:28px;width:auto;display:block}
.recon-sheet .rc-title{font-size:20px;text-align:center;font-weight:700;margin:6px 0 10px}
.recon-sheet .rc-intro{font-size:11.5px;text-indent:2em;margin:0 0 8px;line-height:1.6}
.recon-sheet .rc-table{width:100%;table-layout:fixed;border-collapse:collapse;font-size:9.5px;border:1.4px solid #000}
.recon-sheet .rc-table th,.recon-sheet .rc-table td{border:1px solid #000;padding:4px 3px;text-align:center;vertical-align:middle;overflow-wrap:anywhere;white-space:normal}
.recon-sheet .rc-table td.num{text-align:right;font-variant-numeric:tabular-nums}
.recon-sheet .rc-shipdate{word-break:break-all;white-space:normal;text-align:center}
.recon-sheet .rc-nw,.rc-tbl th.rc-nw{white-space:nowrap !important;overflow-wrap:normal !important;word-break:normal !important}
.recon-sheet .rc-table thead th{background:#F6E7C1;font-weight:700;font-size:9.5px}
.recon-sheet .rc-proj{font-weight:700}
.recon-sheet .rc-g{color:#15803d;font-weight:700}
.recon-sheet .rc-b{color:#1d4ed8;font-weight:700}
.recon-sheet .rc-r{color:#dc2626;font-weight:700}
.recon-sheet .rc-sum td{font-weight:700;background:#E6F4EA}
.recon-sheet .rc-owed-row{text-align:left !important;font-size:11px;padding:7px 6px !important;background:#FBF7EE}
.recon-sheet .rc-acct-row{text-align:left !important;font-size:11px;padding:5px 6px !important}
.recon-sheet .rc-sign-row{text-align:right !important;padding:14px 10px 10px !important}
.recon-sheet .rc-seal{position:relative;display:inline-flex;align-items:center;justify-content:center;min-width:220px;min-height:118px;padding:12px 8px}
.recon-sheet .rc-sign-txt{display:flex;flex-direction:column;align-items:center;gap:8px}
.recon-sheet .rc-sign-txt i{font-style:normal;font-size:12.5px;letter-spacing:.5px;color:#000;text-align:center;white-space:nowrap}
.recon-sheet .rc-seal-mark{position:absolute;left:50%;top:50%;transform:translate(-50%,-54%);height:120px;width:auto;opacity:.92;pointer-events:none;mix-blend-mode:multiply}
.recon-sheet.rc-print{max-width:none;padding:4px 0}
@media print{
  /* 只印对账函：编辑弹窗与页面全部隐藏（recon-open 由弹窗开关维护，不依赖 :has()） */
  body.printing-recon > *:not(.recon-overlay),
  body.recon-open > *:not(.recon-overlay){display:none !important}
  body.printing-recon .recon-overlay,body.recon-open .recon-overlay{position:static !important;display:block !important;background:#fff !important;padding:0 !important}
  body.printing-recon .recon-overlay .modal,body.recon-open .recon-overlay .modal{box-shadow:none !important;max-width:none !important;width:auto !important;border:0 !important;border-radius:0 !important;max-height:none !important;overflow:visible !important;margin:0 !important}
  body.printing-recon .recon-overlay .modal-head,body.printing-recon .recon-overlay .modal-foot,
  body.recon-open .recon-overlay .modal-head,body.recon-open .recon-overlay .modal-foot{display:none !important}
  body.printing-recon .recon-overlay .modal-body,body.recon-open .recon-overlay .modal-body{padding:0 !important;max-height:none !important;overflow:visible !important}
  body.printing-recon .recon-sheet,body.recon-open .recon-sheet{max-width:none;padding:6px 0}
  body.printing-recon .recon-sheet,body.printing-recon .recon-sheet *,
  body.recon-open .recon-sheet,body.recon-open .recon-sheet *{-webkit-print-color-adjust:exact !important;print-color-adjust:exact !important}
  /* 印章：打印管线（尤其 Safari 导出 PDF）会丢弃 mix-blend 层 → 改正常混合；签署行不跨页 */
  .recon-sheet .rc-seal-mark{mix-blend-mode:normal !important;opacity:.95 !important}
  .recon-sheet .rc-sign-row,.recon-sheet .rc-seal{break-inside:avoid !important;page-break-inside:avoid !important}
  .recon-sheet{max-width:100% !important}
  .recon-sheet .rc-table{width:100% !important;table-layout:fixed !important}
}
/* 竖版纸张（页宽<860）：整表缩放＋收紧字号，保证 15 列不超出页边距 */
@media print and (max-width: 860px) {
  .recon-sheet{zoom:.78}
  .recon-sheet .rc-table{font-size:9px !important}
  .recon-sheet .rc-table th,.recon-sheet .rc-table td{padding:2.5px 1.5px !important;word-break:break-all !important;overflow-wrap:anywhere !important}
}
/* ===== 对账函 A4 表豁免移动端全局表格规则 =====
   全局 @media(max-width:860px) 会把 table 转 block 并吸附首/末列(白底)，
   手机 Safari 导出 PDF 走竖版页宽(<860px)会命中该规则 → 15 列定宽表被拆散、
   吸附白底列在打印渲染时盖住中间金额列。此处对 .recon-sheet 恢复表格布局。 */
@media (max-width: 860px) {
  .recon-sheet .rc-table { display: table; width: 100%; overflow: visible; table-layout: fixed; }
  .recon-sheet .rc-table th, .recon-sheet .rc-table td { position: static; left: auto; right: auto; z-index: auto; box-shadow: none; }
  .recon-sheet .rc-table tbody td:first-child, .recon-sheet .rc-table tbody td:last-child,
  .recon-sheet .rc-table tfoot td:first-child, .recon-sheet .rc-table tfoot td:last-child { background: transparent; }
  .recon-sheet .rc-table thead th { background: #F6E7C1; }
  .recon-sheet .rc-table .rc-sum td, .recon-sheet .rc-table .rc-sum td:first-child, .recon-sheet .rc-table .rc-sum td:last-child { background: #E6F4EA; }
  .recon-sheet .rc-table .rc-owed-row td, .recon-sheet .rc-table .rc-owed-row td:first-child, .recon-sheet .rc-table .rc-owed-row td:last-child { background: #FBF7EE; }
}
@media print {
  .recon-sheet .rc-table { display: table !important; width: 100% !important; overflow: visible !important; table-layout: fixed !important; }
  .recon-sheet .rc-table th, .recon-sheet .rc-table td { position: static !important; left: auto !important; right: auto !important; z-index: auto !important; box-shadow: none !important; }
  .recon-sheet .rc-table tbody td:first-child, .recon-sheet .rc-table tbody td:last-child,
  .recon-sheet .rc-table tfoot td:first-child, .recon-sheet .rc-table tfoot td:last-child { background: transparent !important; }
  .recon-sheet .rc-table thead th { background: #F6E7C1 !important; }
  .recon-sheet .rc-table .rc-sum td, .recon-sheet .rc-table .rc-sum td:first-child, .recon-sheet .rc-table .rc-sum td:last-child { background: #E6F4EA !important; }
  .recon-sheet .rc-table .rc-owed-row td, .recon-sheet .rc-table .rc-owed-row td:first-child, .recon-sheet .rc-table .rc-owed-row td:last-child { background: #FBF7EE !important; }
  .recon-sheet .rc-table tr { page-break-inside: avoid; break-inside: avoid; }
}
/* ===== 权限矩阵（00 账号与权限管理） ===== */
.pmx-wrap{overflow:auto;max-height:72vh;border-top:1px solid var(--line)}
.pmx{border-collapse:separate;border-spacing:0;font-size:12px;width:100%}
.pmx th{position:sticky;top:0;z-index:3;background:#eef1f5;padding:6px 8px;border-bottom:2px solid var(--line);border-right:1px solid var(--line);white-space:nowrap;vertical-align:bottom}
.pmx th.pmx-h{left:0;z-index:5;text-align:left}
.pmx-c{min-width:56px;text-align:center}
.pmx-nm{font-weight:600;font-size:12px}
.pmx-role{font-size:10px;color:var(--text-2);font-weight:400;margin-top:2px}
.pmx-l{position:sticky;left:0;z-index:2;background:#fff;padding:6px 10px;border-right:1px solid var(--line);border-bottom:1px solid var(--line);white-space:nowrap;max-width:280px;overflow:hidden;text-overflow:ellipsis}
.pmx-grp td{position:sticky;left:0;background:#f6e7c1;font-weight:700;padding:6px 10px;border-bottom:1px solid var(--line);border-top:1px solid var(--line)}
.pmx-cell{text-align:center;border-right:1px solid var(--line);border-bottom:1px solid var(--line);padding:4px}
.pmx-cell input[type=checkbox]{width:16px;height:16px;accent-color:var(--brand);cursor:pointer}
.pmx-cell input[type=checkbox]:disabled{opacity:.45;cursor:not-allowed}
/* ===== 发货审核流程（04） ===== */
.au-step{display:flex;align-items:center;gap:14px;padding:12px 14px;border-bottom:1px solid var(--line)}
.au-no{width:32px;height:32px;border-radius:50%;background:var(--brand);color:#fff;display:grid;place-items:center;font-weight:700;flex:none}
.au-main{flex:none;width:auto}
.au-lb{font-weight:600;font-size:14px}
.au-own{margin-top:4px}
.au-own select{width:6em;min-width:0;padding:5px 6px;font-size:12px}
.au-st{min-width:96px;text-align:right}
.au-step .badge{font-size:10px;padding:2px 7px}
.au-act{min-width:72px;text-align:right}
.au-step .btn{padding:4px 9px;font-size:12px}
.au-notebox{flex:1;min-width:260px;text-align:left}
.au-notebox textarea{width:100%;box-sizing:border-box;resize:vertical;font-size:13px;line-height:1.5;padding:8px;border:1px solid var(--line);border-radius:6px}
/* 04 表格列宽限宽换行（客户4字/项目9字/型号14字，超出自动转行） */
.cw4,.cw9,.cw14{display:inline-block;white-space:normal;word-break:break-all;line-height:1.35;vertical-align:top}
.cw4{max-width:4em}.cw9{max-width:9em}.cw14{max-width:14em}
/* 03-03 历史出厂资料 / 第 4 步质检报告核查 */
.ta-c{text-align:center}.ta-r{text-align:right;white-space:nowrap}
.ok-c{color:var(--green)}.warn-c{color:var(--yellow)}.miss-c{color:var(--red)}
.qc-wrap{border:1px solid var(--border);border-radius:10px;padding:10px 12px;margin-bottom:10px;background:var(--surface-2)}
.qc-hd{display:flex;flex-wrap:wrap;align-items:center;gap:8px;font-size:13px}
.qc-hd .muted{font-size:11px}
.qc-tip{font-size:12px;color:var(--text-3);margin-top:6px;line-height:1.55}
.qc-err{font-size:12px;color:var(--red);margin-top:6px}
.qc-acts{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.qc-list{margin-top:8px;display:flex;flex-direction:column;gap:4px}
.qc-docs{display:flex;flex-direction:column;gap:8px;margin-top:8px}
.qc-doc{border:1px solid #e3e6ea;border-radius:8px;padding:8px 10px;background:#fff}
.qc-doc-hd{display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-size:12px}
.qc-doc-hd b{font-size:12px}
.qc-line{font-size:12px;line-height:1.5;padding:4px 8px;border-radius:6px;background:var(--surface)}
.qc-line.warn{border-left:3px solid var(--yellow)}
.qc-line.miss{border-left:3px solid var(--red)}
.qc-kv{font-size:12px;color:var(--text-2);margin:6px 0;line-height:1.5}
.qc-item{display:flex;gap:8px;padding:7px 8px;border-radius:8px;background:var(--surface-2);margin-bottom:5px}
.qc-item.warn{background:var(--yellow-bg)}
.qc-item.miss{background:var(--red-bg)}
.qc-ic{font-weight:700;flex:0 0 16px;text-align:center}
.qc-item.ok .qc-ic{color:var(--green)}.qc-item.warn .qc-ic{color:var(--yellow)}.qc-item.miss .qc-ic{color:var(--red)}
.qc-item.mm{background:#ffedd5}.qc-item.mm .qc-ic{color:#c2410c}
.qc-grp{margin-bottom:10px}.qc-grp-h{font-weight:600;font-size:12px;padding:2px 0}
.qc-grp-h.miss{color:var(--red)}.qc-grp-h.mm{color:#c2410c}.qc-grp-h.warn{color:var(--yellow)}
.qc-bd{flex:1;min-width:0}
.qc-lb{font-size:12.5px;font-weight:600}
.qc-lb .muted{font-weight:400;font-size:11px}
.qc-vl{font-size:12px;color:var(--text-2);margin-top:2px;word-break:break-all}
.qc-nt{font-size:11.5px;color:var(--text-3);margin-top:2px}
/* 核查结论里的「系统缺参考标准」块：如实列出系统尚未录入限值的项，便于逐步补齐 */
.qc-nostd{margin:8px 0;padding:9px 10px;border-radius:8px;background:var(--surface-2);border-left:3px solid #64748b}
.qc-nostd-t{font-size:12.5px;font-weight:700;color:var(--text-1);margin-bottom:6px}
.qc-nostd-i{font-size:12px;color:var(--text-2);padding:4px 0;border-top:1px dashed var(--border);line-height:1.5}
.qc-nostd-i:first-of-type{border-top:0}
.qc-nostd-i b{display:block;font-size:12px;color:var(--text-1)}
.qc-nostd-i span{display:block;font-size:11.5px}
.qc-nostd-f{font-size:11.5px;color:var(--text-3);margin-top:7px;padding-top:6px;border-top:1px solid var(--border);line-height:1.55}
/* 02-02 生产发货审核：列宽按字数收紧（产品型号 7 字，数量/已发货 2 字，未发货 3 字） */
.cw7{display:inline-block;white-space:normal;word-break:break-all;line-height:1.3;vertical-align:top;max-width:7em}
.cw15{display:inline-block;white-space:normal;word-break:break-all;line-height:1.3;vertical-align:top;max-width:15em}
.m4-flat th.c-model,.m4-flat td.c-model{width:15.6em;min-width:15.6em;max-width:15.6em}
.m4-flat th.c-qty,.m4-flat td.c-qty{width:2.8em;min-width:2.8em;text-align:center;padding-left:4px;padding-right:4px}
.m4-flat th.c-shp,.m4-flat td.c-shp{width:2.8em;min-width:2.8em;text-align:center;padding-left:4px;padding-right:4px}
.m4-flat th.c-unshp,.m4-flat td.c-unshp{width:3.8em;min-width:3.8em;text-align:center;padding-left:4px;padding-right:4px}
.m4-flat th.c-qty,.m4-flat th.c-shp,.m4-flat th.c-unshp{white-space:nowrap}

#p-items input { padding: 7px 9px; font-size: 13px; }
#p-items .tbl td, .tbl.sm #p-items td { padding: 4px 6px; }
#p-items tfoot td { border-top: 2px solid var(--border); background: var(--surface-2); }

.att-cell { position: relative; }
.att-pop { display: none; position: absolute; left: 0; top: 100%; z-index: 40; min-width: 260px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 10px 12px; font-size: 12px; line-height: 1.9; }
.att-cell:hover .att-pop { display: block; }
.att-pop-t { margin-bottom: 4px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }


/* ===== 移动端适配：明细表表内双向滚动 → 表头吸顶 + 仅首列吸附 =====
   旧规则吸附末列(right:0)会盖住倒数第二列、横向滑不到底；且 table 只有 overflow-x，
   表头 sticky top 无垂直滚动容器可依附 → 竖屏滚动时表头被滑走。
   现改为 overflow:auto + max-height，让表自身成为双向滚动容器：表头吸顶、首列吸附。
   视口被内核锁定竖屏时全景模式同样命中本媒体查询，故横屏全景滑不到末列的问题一并修复。 */
@media (max-width: 860px) {
  table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.data, table.tbl, table.child-table { overflow: auto; max-height: 72vh; overscroll-behavior: contain; }
  /* 外层 wrap 不再二次滚动：移动端以表自身为唯一滚动容器，避免嵌套滚动条抢手势 */
  .table-wrap, .tw { overflow: visible; max-height: none; }
  table.data thead th, table.tbl thead th, table.child-table thead th {
    position: -webkit-sticky; position: sticky; top: 0; z-index: 3; background: var(--surface);
  }
  /* 客户往来平铺表：移动端只保留首列（客户名称）冻结，放开其余冻结列 */
  .m4-flat .fz2, .m4-flat .fz3 { position: static; left: auto; box-shadow: none; }
  .kpis, .kpi-row { grid-template-columns: repeat(2, 1fr) !important; }
  .modal, .modal.lg, .modal.xl { max-width: 96vw; }
  .grid2 { grid-template-columns: 1fr !important; }
  .btn.sm { padding: 7px 10px; }
}

/* ===== 单据明细弹窗：分区标题 / 签字行 / 历史单价差值配色 ===== */
.sub-h { font-size: 12px; font-weight: 700; color: var(--text-2); margin: 14px 0 6px; padding-top: 8px; border-top: 1px solid var(--border); }
.sub-h:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.sign-row { font-size: 13px; padding: 4px 0; border-bottom: 1px dashed var(--border); }
.price-up { color: var(--red); font-weight: 600; }
.price-down { color: var(--green); font-weight: 600; }

/* 明细表冻结表头：桌面与移动端都以 .detail-wrap 作为唯一滚动容器，避免与全局
   @media(max-width:860px) table{display:block} 冲突导致 sticky 失效。选择器均带 .detail-wrap，
   特异性高于全局 table / thead th:last-child 规则，可稳定覆盖。 */
.detail-wrap { overflow: auto; max-height: 52vh; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.detail-wrap table.data { width: 100%; }
.detail-wrap table.data thead th { position: -webkit-sticky; position: sticky; top: 0; z-index: 2; background: var(--surface-2); }
.detail-wrap table.data thead th::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; border-bottom: 1px solid var(--border); }
@media (max-width: 860px) {
  .detail-wrap table.data { display: table; width: 100%; overflow: visible; max-height: none; }
  .detail-wrap table.data thead th { position: -webkit-sticky; position: sticky; top: 0; right: auto; box-shadow: none; }
  .detail-wrap table.data tbody td:last-child,
  .detail-wrap table.data tfoot td:last-child { position: static; right: auto; box-shadow: none; }
}

/* ===== 06 生产看板 ===== */
.bd-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.bd-toolbar .spacer { flex: 1; }
.bd-tip { font-size: 13px; line-height: 1.5; color: #7a4b00; background: #fff7e6; border: 1px solid #ffd591; border-radius: 8px; padding: 9px 12px; margin-bottom: 12px; }
.bd-tip-gray { color: var(--text-2); background: var(--surface-2); border-color: var(--border); }
.bd-block { margin-bottom: 20px; }
.bd-h { font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 8px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.bd-bars { display: flex; flex-direction: column; gap: 8px; }
.bd-bar-row { display: grid; grid-template-columns: 150px 1fr 96px; align-items: center; gap: 10px; cursor: pointer; }
.bd-bar-lb { font-size: 13px; color: var(--text-1); }
.bd-bar-lb.worst { color: var(--red); font-weight: 700; }
.bd-worst-tag { font-size: 11px; color: #fff; background: var(--red); border-radius: 4px; padding: 1px 5px; }
.bd-bar-track { height: 16px; background: var(--surface-2); border-radius: 8px; overflow: hidden; }
.bd-bar-track i { display: block; height: 100%; background: var(--brand); border-radius: 8px; min-width: 2px; }
.bd-bar-track i.worst { background: var(--red); }
.bd-bar-val { font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }
.bd-bar-val.worst { color: var(--red); font-weight: 700; }
table.bd-mx td, table.bd-mx th { text-align: center; }
table.bd-mx .bd-mx-lb { text-align: left; font-weight: 600; }
table.bd-mx td { font-size: 12px; font-variant-numeric: tabular-nums; }
.bd-rx-u { font-size: 11px; color: var(--text-3); }
.bd-rx-empty, .bd-rx-dot { color: var(--text-3); }
.bd-rx-danger { background: #fde8e8; color: var(--red); font-weight: 700; }
.bd-extend { border: 1px dashed var(--border-strong); border-radius: 10px; padding: 12px 14px; background: var(--surface); }
.bd-ext-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.bd-ext { border: 1px solid var(--border); border-radius: 8px; padding: 16px 12px; text-align: center; color: var(--text-3); font-size: 13px; background: var(--surface-2); }
@media (max-width: 860px) {
  .bd-bar-row { grid-template-columns: 96px 1fr 64px; gap: 6px; }
  .bd-bar-lb { font-size: 12px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi .k-value { font-size: 17px; word-break: break-all; }
}

.sw{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--text-3);cursor:pointer;padding-bottom:6px}
.sw input{width:auto}

/* ===== 手机端极简收货台 ===== */
.recv-list{display:flex;flex-direction:column;gap:10px;padding:4px 2px}
.recv-ord{display:block;width:100%;text-align:left;background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:14px 16px;min-height:56px}
.recv-ord .l1{display:flex;justify-content:space-between;align-items:center;font-size:15px}
.recv-ord .prog{color:var(--text-2);font-size:13px}
.recv-ord .l2{color:var(--text-2);font-size:13px;margin-top:2px}
.recv-top{display:flex;align-items:center;gap:10px;position:sticky;top:0;z-index:5;background:var(--bg);padding:8px 2px;font-size:15px}
.recv-top span{color:var(--text-2)}
.recv-top button{margin-left:auto}
.recv-card{background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:16px}
.rc-name{font-size:17px;font-weight:600;color:var(--text)}
.rc-num{font-size:14px;margin-top:6px;color:var(--text-2)}
.rc-num b{color:var(--text);font-size:20px}
.rc-in{display:block;margin-top:10px;font-size:14px;color:var(--text-2)}
.input.big{height:48px;font-size:18px}
#rc-over.warn{color:var(--red);font-weight:600;margin-left:8px}
.rc-btns{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}
.btn.big{height:56px;font-size:18px;font-weight:700;border-radius:12px}
.btn.big.ok{background:var(--green);border-color:var(--green);color:#fff}
.btn.big.no{background:var(--red);border-color:var(--red);color:#fff}
.recv-done{margin-top:12px;display:flex;flex-direction:column;gap:6px}
.recv-stamp{display:flex;justify-content:space-between;align-items:center;gap:8px;width:100%;text-align:left;border:1px dashed var(--border-strong);border-radius:10px;padding:8px 12px;background:transparent;min-height:44px}
.recv-stamp .s1{font-size:14px;color:var(--text)}
.recv-stamp .s2{font-size:12px;white-space:nowrap}
.recv-stamp.ok .s2{color:var(--green)}
.recv-stamp.fail .s2{color:var(--red);font-weight:600}
.recv-bot{position:sticky;bottom:0;padding:10px 2px;background:var(--bg)}
.recv-bot .btn{width:100%;height:52px;font-size:17px}
/* 全局：数字等宽＋按键即时反馈＋去移动端点按延迟 */
table th, table td { font-variant-numeric: tabular-nums; }
.name-wrap{max-width:16em;word-break:break-all;white-space:normal;line-height:1.45}
.name-wrap.nw15{max-width:15em}
td.m6-merge{vertical-align:middle;background:var(--surface)}
.cf-proj{padding:10px 14px;background:var(--surface-2,#f3f4f6);border-bottom:1px solid var(--border,#e5e7eb);font-size:13px;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.cf-proj .lbl{color:var(--text-2,#6b7280);font-size:12px}
.btn, button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; cursor: pointer; }
.btn { transition: transform .05s ease, filter .05s ease; }
.btn:active, .btn.pressed, button:active, button.pressed { transform: translateY(1px) scale(.98); filter: brightness(.94); }
/* 小明同学 智能助手 */
.xm-fab{position:fixed;right:18px;bottom:18px;z-index:900;display:flex;align-items:center;gap:6px;height:46px;padding:0 16px;border-radius:23px;background:var(--primary,#2563eb);color:#fff;border:none;font-size:14px;font-weight:600;box-shadow:0 4px 14px rgba(0,0,0,.18);cursor:pointer}
.xm-ico{width:24px;height:24px;border-radius:50%;background:rgba(255,255,255,.22);display:flex;align-items:center;justify-content:center;font-size:13px}
.xm-panel{position:fixed;right:18px;bottom:74px;z-index:901;width:380px;max-width:calc(100vw - 24px);height:520px;max-height:calc(100vh - 100px);display:flex;flex-direction:column;background:var(--surface,#fff);border:1px solid var(--border,#e5e7eb);border-radius:14px;box-shadow:0 10px 30px rgba(0,0,0,.18);overflow:hidden;resize:both;min-width:280px;min-height:44px}
.xm-panel.xm-min{height:auto !important;max-height:none;width:260px;min-height:0;resize:none}
.xm-panel[hidden],.xm-fab[hidden]{display:none}
.xm-panel.xm-min .xm-msgs,.xm-panel.xm-min .xm-chips,.xm-panel.xm-min .xm-in{display:none}
.xm-hd{display:flex;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid var(--border,#e5e7eb);touch-action:none}
.xm-panel.xm-min .xm-hd{border-bottom:none}
.xm-hd .muted{flex:1;font-size:11px}
.xm-msgs{flex:1;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:8px}
.xm-m{max-width:88%;padding:8px 10px;border-radius:10px;font-size:13px;line-height:1.55}
.xm-m.user{align-self:flex-end;background:var(--primary,#2563eb);color:#fff}
.xm-m.bot{align-self:flex-start;background:var(--bg,#f3f4f6);color:var(--text,#111)}
.xm-chips{display:flex;flex-wrap:wrap;gap:6px;padding:8px 12px;border-top:1px solid var(--border,#e5e7eb)}
.xm-chip{border:1px solid var(--border,#e5e7eb);background:var(--surface,#fff);border-radius:14px;padding:4px 10px;font-size:12px;cursor:pointer}
.xm-in{display:flex;gap:8px;padding:10px 12px}
.xm-in .input{flex:1}
@media (max-width:640px){.xm-panel{right:12px;left:12px;width:auto;bottom:70px;height:60vh}.xm-fab{right:12px;bottom:12px}}

/* ---- 手机端横屏：全景模式靠视口固定宽度等比缩小（无 body 变换）；以下旋转规则仅作内核兜底 ---- */
#ls-toggle{position:fixed;left:12px;bottom:18px;z-index:1200;padding:8px 14px;border:1px solid var(--line,#e5e7eb);border-radius:999px;background:var(--surface,#fff);color:var(--text-2,#555);font-size:12px;box-shadow:0 2px 10px rgba(0,0,0,.15);display:none;cursor:pointer}
@media (max-width:820px){#ls-toggle{display:block}}
#ls-tiers{position:fixed;left:12px;bottom:56px;z-index:1200;display:none;gap:6px}
#ls-tiers button{padding:4px 10px;border:1px solid var(--line,#e5e7eb);border-radius:999px;background:var(--surface,#fff);color:var(--text-2,#555);font-size:11px;cursor:pointer}
#ls-tiers button.on{border-color:#2563EB;color:#2563EB;background:#EFF6FF}
/* 全景模式布局宽度=桌面档，窄屏媒体查询会隐藏开关；用 html.panorama 强制保留开关与档位 */
html.panorama #ls-toggle{display:block}
/* 全景下按钮不做 transform 补偿（叠加缩放会让内核命中测试错位、点不中），直接放大到可读可点尺寸 */
html.panorama #ls-toggle{font-size:16px;padding:10px 16px;left:12px;bottom:16px}
html.panorama #ls-tiers{left:12px;bottom:64px;gap:8px}
html.panorama #ls-tiers button{font-size:15px;padding:10px 16px}
@media (min-width:821px){html:not(.panorama) #ls-tiers{display:none!important}}
/* 开关/档位按钮反向补偿锚点：左下角放大回物理尺寸 */
#ls-toggle,#ls-tiers{transform-origin:left bottom}
html.ls{overflow:hidden}
body.landscape{position:fixed;top:0;left:0;width:100vh;height:100vw;transform:rotate(90deg) translateY(-100%);transform-origin:top left;overflow:hidden;background:var(--bg,#f5f6f8)}
/* 横屏时改由 #app 内部滚动：body 不滚动，fixed 弹窗/提示才能钉满可视区且双向可滑 */
body.landscape #app{height:100%;overflow:auto;-webkit-overflow-scrolling:touch}
/* ===== 明细表列宽拖拽 + 列隐藏/显示 ===== */
.col-cfg-bar{display:flex;justify-content:flex-end;align-items:center;gap:8px;margin:2px 0 4px}
.col-cfg-btn{font-size:12px;padding:2px 10px;border:1px solid var(--border,#e5e7eb);background:var(--surface,#fff);border-radius:6px;color:var(--text-2,#555);cursor:pointer}
.col-cfg-btn:hover{border-color:#2563EB;color:#2563EB}
.col-cfg-hint{font-size:11px;color:var(--text-3,#999)}
.col-rz-host{position:relative}
.col-rz{position:absolute;top:0;right:-3px;width:7px;height:100%;cursor:col-resize;touch-action:none;z-index:6}
.col-rz:hover,body.col-resizing .col-rz{background:rgba(37,99,235,.35)}
body.col-resizing{user-select:none;cursor:col-resize}
table.col-fixed th,table.col-fixed td{overflow:hidden;text-overflow:ellipsis}
table.col-fixed td .name-wrap{max-width:100%}
.col-menu{position:fixed;z-index:1300;background:var(--surface,#fff);border:1px solid var(--border,#e5e7eb);border-radius:8px;box-shadow:0 6px 24px rgba(0,0,0,.12);padding:8px;max-height:320px;overflow:auto;min-width:190px}
.col-menu .cm-title{font-size:12px;font-weight:600;color:var(--text-2,#555);margin:0 0 6px 2px}
.col-menu label{display:flex;gap:6px;align-items:center;font-size:12.5px;padding:3px 4px;cursor:pointer;border-radius:4px}
.col-menu label:hover{background:#E8F1FF}
.col-menu label span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:220px}
.col-menu .cm-acts{display:flex;gap:6px;margin-top:6px}
/* ===== 工序配置：结构化行编辑 ===== */
.cf-cfg-row{display:flex;align-items:center;gap:8px;margin-bottom:6px}
.cf-cfg-row .input{flex:1;min-width:0}
.cf-cfg-row .input[data-f="unit"],.cf-cfg-row .input[data-f="factor"]{flex:0 0 auto}
.cf-cfg-seq{width:18px;text-align:right;flex:0 0 auto}
@media (max-width:860px){.col-cfg-hint{display:none}}

/* ===== 移动端仅首列吸附（客户名称等行归属列）=====
   放在文件末尾以在同特异性下覆盖 .detail-wrap 等表头规则；斑马纹/选中/红行底色
   特异性更高仍优先，故吸附列不丢行状态配色。表头首列需同时吸顶+吸左，层级最高。 */
@media (max-width: 860px) {
  table.data tbody td.fz-first, table.tbl tbody td.fz-first, table.child-table tbody td.fz-first {
    position: -webkit-sticky; position: sticky; left: 0; z-index: 2; background: var(--surface);
    box-shadow: 1px 0 0 var(--border);
  }
  table.data thead th.fz-first, table.tbl thead th.fz-first, table.child-table thead th.fz-first {
    position: -webkit-sticky; position: sticky; left: 0; top: 0; z-index: 5; background: var(--surface);
    box-shadow: 1px 0 0 var(--border);
  }
  .detail-wrap table.data thead th.fz-first { z-index: 5; left: 0; box-shadow: 1px 0 0 var(--border); }
  .detail-wrap table.data tbody td.fz-first { position: -webkit-sticky; position: sticky; left: 0; z-index: 2; background: var(--surface); box-shadow: 1px 0 0 var(--border); }
}

