:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --line: #e3e7ee;
  --line-strong: #cfd6e2;
  --text: #1c2430;
  --text-2: #5b6675;
  --text-3: #8b95a4;
  --brand: #1f5fbf;
  --brand-soft: #eaf1fb;
  --ok: #1a7f4b;
  --ok-soft: #e7f5ee;
  --warn: #a4650b;
  --warn-soft: #fdf3e2;
  --danger: #b4322f;
  --danger-soft: #fbeceb;
  --radius: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: 13px; color: inherit; }
a { color: var(--brand); text-decoration: none; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #eef3fa 0%, #f7f9fc 60%, #eef1f6 100%);
}
.login-card {
  width: 360px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 34px 32px 28px;
  box-shadow: 0 10px 30px rgba(28, 36, 48, .07);
}
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.login-mark {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 500; letter-spacing: .5px;
}
.login-title { font-size: 15px; font-weight: 500; }
.login-sub { color: var(--text-3); font-size: 12px; margin: 0 0 24px; text-align: center; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn-primary { width: 100%; height: 38px; margin-top: 6px; }
.login-foot { margin-top: 18px; color: var(--text-3); font-size: 11.5px; text-align: center; }
.login-err {
  background: var(--danger-soft); color: var(--danger);
  padding: 8px 10px; border-radius: 6px; margin-bottom: 12px; font-size: 12px;
}

/* ---------- 骨架 ---------- */
.shell { display: flex; min-height: 100vh; }

.side {
  width: 196px;
  flex: 0 0 196px;
  background: #101a28;
  color: #c9d3e0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.side-brand {
  display: flex; align-items: center; gap: 9px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.side-mark {
  width: 26px; height: 26px; border-radius: 6px; background: var(--brand);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500;
}
.side-brand b { color: #fff; font-weight: 500; font-size: 13px; }
.side-brand span { display: block; color: #6d7c8f; font-size: 10.5px; line-height: 1.3; }
.side nav { padding: 10px 8px; flex: 1; }
.side nav a {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 6px; color: #b9c4d2;
  font-size: 12.5px; margin-bottom: 2px;
}
.side nav a:hover { background: rgba(255,255,255,.055); color: #fff; }
.side nav a.on { background: var(--brand); color: #fff; }
.side nav .sep { height: 1px; background: rgba(255,255,255,.07); margin: 10px 6px; }
.side nav a .n { font-size: 13px; width: 15px; text-align: center; opacity: .9; }
.side-foot { padding: 12px 16px; font-size: 10.5px; color: #5d6b7d; border-top: 1px solid rgba(255,255,255,.07); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.top {
  height: 52px; flex: 0 0 52px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  position: sticky; top: 0; z-index: 20;
}
.top h1 { font-size: 14.5px; font-weight: 500; margin: 0; }
.top .crumb { color: var(--text-3); font-size: 12px; margin-left: 10px; }
.top-right { display: flex; align-items: center; gap: 14px; }
.who { display: flex; align-items: center; gap: 8px; }
.who.click { cursor: pointer; padding: 4px 8px 4px 4px; border-radius: 999px; border: 1px solid transparent; }
.who.click:hover { background: #f2f6fc; border-color: #e2eaf5; }
.who.click:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft);
  color: var(--brand); display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 500;
}
.who .nm { font-size: 12.5px; }
.who .rl { font-size: 10.5px; color: var(--text-3); }
/* 我的资料弹窗 */
.me-hd { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.me-hd .avatar { width: 40px; height: 40px; font-size: 16px; }
.me-hd .t1 { font-size: 15px; font-weight: 600; }
.me-hd .t2 { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.me-sec { font-size: 12px; color: var(--text-3); margin: 16px 0 8px; padding-top: 12px; border-top: 1px dashed var(--line); }
.me-form { display: grid; gap: 12px; }

.content { padding: 18px 20px 40px; flex: 1; }

/* ---------- 通用组件 ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.card-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.card-hd h2 { font-size: 13px; font-weight: 500; margin: 0; }
.card-bd { padding: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  height: 30px; padding: 0 12px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--text);
  border-radius: 6px; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #b9c3d3; background: #fafbfd; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: #1a52a6; border-color: #1a52a6; }
.btn-danger { color: var(--danger); border-color: #e8c3c2; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { height: 26px; padding: 0 9px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-link {
  background: none; border: none; color: var(--brand); cursor: pointer;
  padding: 0 6px; height: auto;
}
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--danger); }

.field { display: block; }
.field > .lb, .field label.lb {
  display: block; font-size: 11.5px; color: var(--text-2); margin-bottom: 4px;
}
.input, select.input, textarea.input {
  width: 100%; height: 32px; padding: 0 9px;
  border: 1px solid var(--line-strong); border-radius: 6px; background: #fff;
  outline: none;
}
textarea.input { height: auto; padding: 7px 9px; resize: vertical; min-height: 60px; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,95,191,.1); }
.input[readonly], .input:disabled { background: #f6f7f9; color: var(--text-2); }

.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.toolbar .grow { flex: 1; }
.toolbar .search { width: 230px; }

table.tb { width: 100%; border-collapse: collapse; }
table.tb th {
  text-align: left; font-weight: 500; font-size: 11.5px; color: var(--text-2);
  background: #fafbfc; padding: 9px 12px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.tb td { padding: 10px 12px; border-bottom: 1px solid #f0f2f6; vertical-align: middle; }
table.tb tr:hover td { background: #fafcff; }
table.tb td.num, table.tb th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tb .mono { font-variant-numeric: tabular-nums; letter-spacing: .2px; }

.tag {
  display: inline-block; padding: 1px 7px; border-radius: 4px;
  font-size: 11px; line-height: 18px; white-space: nowrap;
}
.tag-draft { background: #f0f2f5; color: #5b6675; }
.tag-reviewing { background: var(--warn-soft); color: var(--warn); }
.tag-approved { background: var(--ok-soft); color: var(--ok); }
.tag-rejected { background: var(--danger-soft); color: var(--danger); }
.tag-closed, .tag-shipped { background: var(--brand-soft); color: var(--brand); }
.tag-cancelled { background: #f0f2f5; color: #98a2b3; }
.tag-in_production { background: #eef4ff; color: #2b56a8; }

/* 备料数量不足 BOM 应备量：工单状态旁的红标 */
.short-tip {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 4px;
  background: #fdecea; color: #c0392b; border: 1px solid #f3c2bd;
  font-size: 11px; line-height: 18px; white-space: nowrap; vertical-align: middle;
}

.empty { padding: 44px 16px; text-align: center; color: var(--text-3); }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
}
.kpi .k { font-size: 11.5px; color: var(--text-2); }
.kpi .v { font-size: 21px; font-weight: 500; margin-top: 5px; font-variant-numeric: tabular-nums; }
.kpi .v small { font-size: 12px; color: var(--text-3); font-weight: 400; margin-left: 3px; }
/* 7 天内到期有单时整框标红，提醒先处理 */
.kpi.alert { border-color: #d64b45; box-shadow: 0 0 0 1px #d64b45; background: #fdf4f3; }
.kpi.alert .k { color: #a3302c; }
.kpi.alert .v { color: #b4322f; }

/* ---------- 不良品详情：字段两列排布 ---------- */
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; }
.kv { display: flex; gap: 8px; font-size: 12.5px; line-height: 1.75; }
.kv .k { color: #8b95a4; flex: 0 0 96px; }
.kv .v { color: #2c3748; flex: 1; min-width: 0; word-break: break-all; }
@media (max-width: 900px) { .kv-grid { grid-template-columns: 1fr; } }

/* ---------- 库存结存排序表头 ---------- */
.th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.th-sort:hover { color: var(--brand); }
.th-sort .sort-ic { font-size: 10px; color: #b4b2a9; margin-left: 4px; }
.th-sort:hover .sort-ic { color: var(--brand); }

/* ---------- 工作台「资料待补充」提示 ---------- */
.todo-box {
  border: 1px solid #f0cfa0; border-radius: 10px; padding: 12px 14px; margin-bottom: 16px;
  background: linear-gradient(180deg, #fff8ec, #fffdf8);
  box-shadow: 0 1px 2px rgba(201,122,22,.10);
}
.todo-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.todo-ic {
  width: 19px; height: 19px; border-radius: 50%; background: #c0392b; color: #fff;
  font-size: 12px; font-weight: 700; line-height: 1; flex: 0 0 19px;
  display: inline-flex; align-items: center; justify-content: center;
}
.todo-hd b { font-size: 14px; color: #a3302c; letter-spacing: .3px; }
.todo-sub { font-size: 12px; color: #9a7b52; }
.todo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.todo-item { border: 1px solid #f1d7b3; border-radius: 8px; background: #fff; overflow: hidden; }
.todo-item summary { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; list-style: none; }
.todo-item summary::-webkit-details-marker { display: none; }
.todo-item summary:hover { background: #fffaf3; }
.ti-n {
  font-size: 20px; font-weight: 600; color: #c0392b; font-variant-numeric: tabular-nums;
  min-width: 42px; text-align: right; line-height: 1.1;
}
.ti-txt { flex: 1 1 auto; display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.ti-txt b { font-size: 12.8px; color: #3d4a5c; font-weight: 600; }
.ti-txt span { font-size: 11px; color: #b4322f; }
.ti-go { font-size: 12px; color: #1f5fbf; white-space: nowrap; }
.ti-go::after { content: ' ▸'; font-size: 10px; }
.todo-item[open] .ti-go::after { content: ' ▾'; }
.ti-bd { padding: 2px 12px 12px; border-top: 1px dashed #f1e2cb; }
.ti-list {
  margin: 8px 0; padding-left: 16px; font-size: 12px; color: #4a5666;
  max-height: 170px; overflow: auto; line-height: 1.8;
}
.ti-list .mono { color: #8b95a4; }
.ti-miss { color: #b4322f; font-size: 11px; margin-left: 6px; white-space: nowrap; }
.ti-hint { font-size: 11.5px; color: #8b95a4; margin: 6px 0; }
@media (max-width: 900px) {
  .todo-grid { grid-template-columns: 1fr; }
  .ti-list { max-height: 140px; }
}

/* ---------- 弹层 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(16,26,40,.42);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 48px 20px; overflow: auto; z-index: 60;
}
.dialog {
  background: #fff; border-radius: 10px; width: 100%; max-width: 720px;
  box-shadow: 0 16px 48px rgba(16,26,40,.22);
}
.dialog.wide { max-width: 940px; }
.dialog-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.dialog-hd h3 { margin: 0; font-size: 13.5px; font-weight: 500; }
.dialog-bd { padding: 16px 18px; }
.dialog-ft {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 18px; border-top: 1px solid var(--line); background: #fbfcfd;
  border-radius: 0 0 10px 10px;
}
.x {
  border: none; background: none; font-size: 18px; line-height: 1;
  color: var(--text-3); cursor: pointer; padding: 2px 4px;
}
.x:hover { color: var(--text); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

.item-tb { width: 100%; border-collapse: collapse; }
.item-tb th {
  font-size: 11px; font-weight: 500; color: var(--text-2); text-align: left;
  padding: 6px 4px; border-bottom: 1px solid var(--line);
}
.item-tb td { padding: 4px 3px; }
.item-tb .input { height: 30px; }

.chk-row { display: flex; gap: 16px; flex-wrap: wrap; padding-top: 4px; }
.chk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 12.5px; }
.chk input { accent-color: var(--brand); }

.rev-list { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.rev-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid #f0f2f6;
}
.rev-row:last-child { border-bottom: none; }
.rev-row .dept { width: 62px; color: var(--text-2); }
.rev-row .res { flex: 1; }
.rev-row .cm { color: var(--text-3); font-size: 11.5px; }
.rev-row .acts { display: flex; gap: 6px; }
.pill-pass { color: var(--ok); }
.pill-reject { color: var(--danger); }
.pill-wait { color: var(--text-3); }

.prog { display: inline-flex; gap: 3px; align-items: center; }
.prog i {
  width: 14px; height: 5px; border-radius: 3px; background: #e5e9f0; display: inline-block;
}
.prog i.pass { background: var(--ok); }
.prog i.reject { background: var(--danger); }
.prog span { margin-left: 5px; color: var(--text-3); font-size: 11px; }

.toast-wrap {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.toast {
  background: #1c2430; color: #fff; padding: 8px 14px; border-radius: 6px;
  font-size: 12.5px; box-shadow: 0 6px 20px rgba(16,26,40,.2);
  animation: tin .18s ease-out;
}
.toast.err { background: var(--danger); }
@keyframes tin { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.hint { color: var(--text-3); font-size: 11.5px; margin-top: 6px; }
.dl { display: grid; grid-template-columns: 92px 1fr; gap: 6px 10px; font-size: 12.5px; }
.dl dt { color: var(--text-2); }
.dl dd { margin: 0; }

@media (max-width: 900px) {
  .side { width: 62px; flex: 0 0 62px; }
  .side-brand b, .side-brand span, .side nav a .txt, .side-foot { display: none; }
  .side nav a { justify-content: center; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }
  .content { padding: 14px 12px 40px; }
}

/* ---------- 生产工序流转 ---------- */
.step-row { display: flex; align-items: center; gap: 12px; padding: 9px 6px; border-bottom: 1px solid #f0f2f6; }
.step-row:last-child { border-bottom: none; }
.step-row .sn {
  width: 22px; height: 22px; border-radius: 50%; background: #eef1f6; color: #5b6675;
  display: flex; align-items: center; justify-content: center; font-size: 11px; flex: 0 0 22px;
}
.step-row.running .sn { background: var(--brand); color: #fff; }
.step-row.done .sn { background: var(--ok); color: #fff; }
.step-row .sname { width: 175px; flex: 0 0 175px; font-size: 12.5px; }
.step-row .sst { flex: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.step-row .sact { flex: 0 0 auto; display: flex; gap: 6px; align-items: center; }

/* 工序还没做出来的数量（红字） */
.pend-tip {
  display: inline-block; padding: 1px 7px; border-radius: 4px;
  background: #fdecea; color: #c0392b; border: 1px solid #f3c2bd;
  font-size: 11px; line-height: 18px; white-space: nowrap;
}

/* 工序完工时间 */
.fin-time {
  color: #7a8494; font-size: 11.5px; white-space: nowrap;
}

/* ---------- 打印 ---------- */
.print-bar {
  position: sticky; top: 0; background: #fff; border-bottom: 1px solid var(--line);
  padding: 10px 16px; display: flex; gap: 8px; justify-content: center; z-index: 10;
}
.print-sheet {
  background: #fff; width: 210mm; min-height: 297mm; margin: 20px auto;
  padding: 16mm 14mm; box-shadow: 0 2px 16px rgba(16,26,40,.1);
}
.print-sheet h1 { font-size: 20px; text-align: center; margin: 0 0 16px; letter-spacing: 3px; font-weight: 600; }
.print-sheet .ph {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px;
  font-size: 12.5px; margin-bottom: 14px; border: 1px solid #555; padding: 9px 12px;
}
.print-sheet .ph b { font-weight: 600; margin-right: 8px; }
.print-sheet table { width: 100%; border-collapse: collapse; font-size: 12px; }
.print-sheet th, .print-sheet td { border: 1px solid #555; padding: 6px 8px; text-align: left; }
.print-sheet th { background: #f2f4f7; font-weight: 600; }
.print-sheet p { font-size: 12px; margin: 10px 0 0; }
.print-sheet .pf { display: flex; justify-content: space-between; margin-top: 26px; font-size: 12.5px; }
.print-sheet .small { font-size: 11px; color: #555; }

@media print {
  .side, .top, .print-bar, .toast-wrap { display: none !important; }
  body { background: #fff; }
  .shell { display: block; }
  .content { padding: 0; }
  .print-sheet { width: auto; min-height: 0; margin: 0; padding: 0; box-shadow: none; }
  @page { size: A4; margin: 14mm 12mm; }
}

/* ---------- 手机适配 ---------- */
.content { overflow-x: auto; }
@media (max-width: 640px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .step-row { flex-wrap: wrap; gap: 8px; }
  .step-row .sname { width: auto; flex: 1 1 100%; }
  .step-row .sst { flex: 1 1 auto; }
  .print-sheet { width: 100%; min-height: 0; padding: 12px; margin: 10px 0; }
  .print-sheet .ph { grid-template-columns: 1fr; }
  .dialog-bd { padding: 12px; }
  table.tb { font-size: 12px; }
}

/* ---------- 品牌 Logo ---------- */
.brand-logo {
  height: 46px; display: block; margin: 0 auto 4px;
}
.login-brand { margin-bottom: 0; text-align: center; }
.side-brand {
  padding: 14px 12px 12px;
}
.side-logo {
  background: #fff; border-radius: 7px; padding: 7px 9px;
  display: flex; align-items: center; justify-content: center;
}
.side-logo img { height: 19px; display: block; }
.side-foot { font-size: 10px; }
@media (max-width: 900px) {
  .side-logo { padding: 5px 3px; border-radius: 5px; }
  .side-logo img { height: 14px; }
}

/* 打印单据表头 */
.print-head {
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1.2pt solid #333; padding-bottom: 7px; margin-bottom: 12px;
}
.print-head img { height: 30px; display: block; flex: 0 0 auto; }
.print-head .co-name { font-size: 10pt; color: #333; text-align: right; line-height: 1.45; }
.print-head .co-name b { font-size: 11pt; display: block; }
.print-head .co-name .cn-en { font-size: 8.5pt; color: #555; letter-spacing: .2px; display: block; }
.print-head .co-name .co-line { font-size: 8.5pt; color: #555; margin-top: 1px; white-space: nowrap; }

/* ---------- 正式单据（送货单等） ---------- */
.print-sheet .doc-title { text-align: center; margin: 6px 0 12px; }
.print-sheet .doc-title h1 {
  font-size: 19pt; letter-spacing: 6px; margin: 0; font-weight: 700; color: #16304f;
}
.print-sheet .doc-title .doc-en {
  font-size: 8pt; letter-spacing: 3px; color: #7a8494; margin-top: 2px; text-transform: uppercase;
}
.print-sheet table.meta {
  width: 100%; border-collapse: collapse; font-size: 9.5pt; margin-bottom: 10px;
}
.print-sheet table.meta td { border: 1px solid #9aa4b2; padding: 5px 8px; }
.print-sheet table.meta td.k {
  background: #f4f6f9; color: #3c4a5c; width: 13%; white-space: nowrap; font-weight: 600;
}
.print-sheet table.meta td.v { width: 37%; }
.print-sheet table.tb-doc { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
.print-sheet table.tb-doc th, .print-sheet table.tb-doc td {
  border: 1px solid #9aa4b2; padding: 6px 8px; vertical-align: middle;
}
.print-sheet table.tb-doc th { background: #eef2f8; font-weight: 600; color: #16304f; white-space: nowrap; }
.print-sheet table.tb-doc tr.sum td { background: #fafbfd; font-weight: 600; }
.print-sheet table.tb-doc tr.fee td { background: #fdfbf4; color: #4a3f2a; }
.print-sheet .r { text-align: right; }
.print-sheet .c { text-align: center; }
.print-sheet .muted { color: #aab3c0; }
/* 采购单：明细带产品图，打印时也要看得清 */
.print-sheet table.tb-doc.po-tb td { padding: 5px 7px; }
.print-sheet .po-img {
  width: 64px; height: 64px; object-fit: cover; display: block; margin: 0 auto;
  border: 1px solid #d5dbe4; border-radius: 4px; background: #fff;
}
.print-sheet .po-img-empty {
  display: block; width: 64px; height: 64px; margin: 0 auto;
  border: 1px dashed #ccd4df; border-radius: 4px; background: #fafbfd;
}
.print-sheet .amt-upper {
  margin-top: 8px; font-size: 9.5pt; border: 1px solid #9aa4b2; padding: 6px 10px;
  display: flex; justify-content: space-between; align-items: center; background: #fafbfd;
}
.print-sheet .amt-upper b { font-size: 10.5pt; color: #16304f; letter-spacing: 1px; }
.print-sheet .amt-upper .amt-num { color: #3c4a5c; }
.print-sheet .doc-note {
  margin-top: 8px; font-size: 9pt; color: #3c4a5c; border-left: 3px solid #d9e0ea;
  padding: 4px 8px; background: #fafbfd;
}
.print-sheet .sign-row {
  display: flex; justify-content: space-between; margin-top: 26px; font-size: 9.5pt; color: #2a3542;
}
.print-sheet .doc-foot {
  margin-top: 12px; padding-top: 6px; border-top: 1px dashed #b9c2cf;
  font-size: 8pt; color: #8b95a4; text-align: center;
}

/* ---------- 侧栏分组 ---------- */
.nav-group {
  font-size: 10px; color: #61707f; letter-spacing: 1.5px;
  padding: 12px 12px 4px; margin-top: 2px;
}
.nav-group:first-child { padding-top: 6px; }
@media (max-width: 900px) {
  .nav-group {
    height: 1px; padding: 0; margin: 8px 10px; overflow: hidden;
    background: rgba(255,255,255,.09); color: transparent;
  }
}

/* ---------- 物料分类 ---------- */
.cat-sub {
  display: flex; align-items: baseline; gap: 8px;
  padding: 12px 0 4px; border-top: 1px solid #f0f2f6;
}
.cat-sub:first-child { border-top: none; padding-top: 6px; }
.cat-name { font-size: 12.5px; font-weight: 500; color: #16304f; }
.cat-cnt { font-size: 11px; color: #8b95a4; }
.cat-empty { font-size: 12px; color: #a8b0bd; padding: 2px 0 10px; }

/* ---------- 侧栏分组色条 ---------- */
.nav-group {
  display: flex; align-items: center; gap: 7px;
  font-size: 10.5px; font-weight: 500; letter-spacing: 1.2px;
  padding: 12px 12px 5px;
}
.nav-group i {
  display: block; width: 3px; height: 11px; border-radius: 2px;
  background: currentColor; flex: 0 0 3px;
}
@media (max-width: 900px) {
  .nav-group { height: 1px; padding: 0; margin: 8px 10px; overflow: hidden; background: currentColor; opacity: .5; }
  .nav-group i { display: none; }
}

/* ---------- Logo 放大 ---------- */
.side-logo img { height: 26px; }
.brand-logo { height: 56px; }
@media (max-width: 900px) {
  .side-logo img { height: 15px; }
}

/* ---------- 侧栏改白底（覆盖深色版） ---------- */
.side {
  width: 214px; flex: 0 0 214px;
  background: #ffffff;
  border-right: 1px solid #e3e7ee;
  color: #3d4a5c;
  box-shadow: 1px 0 0 rgba(16,26,40,.03);
}
.side-brand {
  border-bottom: 1px solid #eef1f6;
  padding: 14px 14px 12px;
}
.side-logo {
  background: transparent; padding: 0;
  justify-content: flex-start;
}
.side-logo img { height: 30px; }
.side nav {
  padding: 6px 8px 18px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.side nav::-webkit-scrollbar { width: 6px; }
.side nav::-webkit-scrollbar-thumb { background: #d5dbe6; border-radius: 3px; }
.side nav::-webkit-scrollbar-track { background: transparent; }
.side nav a {
  color: #3d4a5c;
  font-size: 14px;
  padding: 9px 10px;
  border-radius: 7px;
  margin-bottom: 1px;
}
.side nav a .n {
  font-size: 15px; width: 18px; opacity: .85;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 18px; height: 18px;
}
.side nav a .n svg { width: 18px; height: 18px; display: block; }
.side nav a:hover .n { opacity: 1; }
.side nav a.on .n { opacity: 1; }
.side nav a:hover { background: #f1f5fd; color: #1f5fbf; }
.side nav a.on { background: #1f5fbf; color: #fff; box-shadow: 0 2px 6px rgba(31,95,191,.25); }
.side nav a.on .n { opacity: 1; }
.side-foot {
  color: #98a2b3;
  border-top: 1px solid #eef1f6;
  padding: 10px 14px;
  background: #fff;
}
.nav-group {
  font-size: 11.5px; font-weight: 600; letter-spacing: 1px;
  padding: 14px 10px 5px;
}
.nav-group i { width: 3px; height: 12px; }

@media (max-width: 900px) {
  .side { width: 64px; flex: 0 0 64px; }
  .side-logo { justify-content: center; }
  .side-logo img { height: 16px; }
  .nav-group { margin: 6px 8px; }
}

/* ---------- 侧栏滚动可见性 ---------- */
.side nav { overflow-y: scroll; scrollbar-width: thin; }
.side nav::-webkit-scrollbar { width: 7px; }
.side nav::-webkit-scrollbar-thumb {
  background: #cfd6e2; border-radius: 4px; border: 1px solid #fff;
}
.side nav::-webkit-scrollbar-thumb:hover { background: #b4bdcc; }
.side nav::-webkit-scrollbar-track { background: #fafbfd; }
.nav-group { padding: 10px 10px 4px; }
.side nav a { padding: 8px 10px; }
.side-foot { display: none; }

/* ---------- 物料大类卡片 ---------- */
.cat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.cat-card {
  position: relative; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 16px 14px 20px; cursor: pointer;
  transition: all .15s;
}
.cat-card::before {
  content: ''; position: absolute; left: 0; top: 10px; bottom: 10px;
  width: 4px; border-radius: 0 3px 3px 0; background: var(--c);
}
.cat-card:hover { border-color: var(--c); box-shadow: 0 3px 10px rgba(16,26,40,.07); }
.cat-card.on { border-color: var(--c); box-shadow: 0 4px 14px rgba(16,26,40,.09); background: #fcfdff; }
.cc-name { font-size: 15px; font-weight: 500; color: #16304f; }
.cc-cnt { font-size: 26px; font-weight: 600; color: var(--c); line-height: 1.2; margin-top: 4px; }
.cc-cnt small { font-size: 12px; font-weight: 400; margin-left: 2px; color: #8b95a4; }
.cc-desc { font-size: 11.5px; color: #8b95a4; margin-top: 2px; }

/* ---------- 子分类筛选 ---------- */
.sub-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 10px; }
.sub-tab {
  padding: 5px 12px; border-radius: 15px; border: 1px solid var(--line);
  background: #fff; font-size: 12.5px; cursor: pointer; color: #4a5666;
}
.sub-tab:hover { border-color: #b9c3d3; }
.sub-tab.on { background: #1f5fbf; color: #fff; border-color: #1f5fbf; }

@media (max-width: 900px) {
  .cat-cards { grid-template-columns: 1fr 1fr; }
}

/* ---------- 商品搜索选择器 ---------- */
.pk-wrap { position: relative; }
.pk-list {
  display: none; position: absolute; left: 0; top: 36px; z-index: 80;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16,26,40,.14);
  min-width: 470px; overflow: hidden;
}
.pk-tabs {
  display: flex; gap: 2px; padding: 6px 7px; background: #fafbfd;
  border-bottom: 1px solid #eef1f6; flex-wrap: wrap;
}
.pk-tab {
  padding: 3px 9px; border-radius: 12px; font-size: 12px; color: #4a5666;
  cursor: pointer; white-space: nowrap; line-height: 17px;
}
.pk-tab i { font-style: normal; color: #a2acb9; font-size: 10.5px; margin-left: 3px; }
.pk-tab:hover { background: #eef3fa; }
.pk-tab.on { background: #1f5fbf; color: #fff; }
.pk-tab.on i { color: #c6dbf7; }
.pk-body { max-height: 248px; overflow-y: auto; }
.pk-tag {
  font-size: 10px; padding: 0 5px; border-radius: 3px; line-height: 15px;
  white-space: nowrap; flex: none;
}
.g-fg { background: #eaf1fb; color: #1f5fbf; }
.g-tg { background: #f0ecfc; color: #5c43b8; }
.g-semi { background: #fdf3e2; color: #a4650b; }
.g-raw { background: #e7f5ee; color: #1a7f4b; }
.pk-noprice { color: #b8c0cb; font-size: 11px; }
.pk-more {
  padding: 8px 10px; color: #8b95a4; font-size: 11.5px;
  text-align: center; background: #fafbfd; border-top: 1px solid #f2f4f8;
}
.pk-item {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 10px; cursor: pointer; font-size: 12.5px; border-bottom: 1px solid #f4f6f9;
}
.pk-item:last-child { border-bottom: none; }
.pk-item:hover { background: #f1f5fd; }
.pk-code { color: #8b95a4; font-size: 11px; flex: none; min-width: 62px; white-space: nowrap; }
.pk-name {
  color: #1c2430; font-weight: 500; flex: none; max-width: 190px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pk-spec {
  color: #8b95a4; font-size: 11.5px; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pk-price { color: #1f5fbf; font-variant-numeric: tabular-nums; flex: none; white-space: nowrap; }
/* 不显示价格的下拉（BOM 里）：名称可以放宽一点，右边空出来的位置别浪费 */
.pk-list.pk-no-price .pk-name { max-width: 260px; }
.pk-noprice { color: #b8c0cb; font-size: 11px; white-space: nowrap; }
.pk-none { padding: 12px; color: #8b95a4; font-size: 12px; }

/* ---------- 每页底部操作说明 ---------- */
.page-help {
  margin: 16px 0 6px; padding: 14px 18px 15px;
  background: #f7f9fd; border: 1px solid #e2e9f4; border-left: 3px solid #2F6FE4;
  border-radius: 8px;
}
.page-help .ph-hd {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: #1f4b8f; margin-bottom: 8px;
}
.page-help .ph-ic {
  width: 16px; height: 16px; border-radius: 50%; background: #2F6FE4; color: #fff;
  font-size: 11px; font-weight: 700; font-style: italic; display: inline-flex;
  align-items: center; justify-content: center; line-height: 1; flex: none;
}
.page-help .ph-list {
  margin: 0; padding-left: 18px; color: #55616f; font-size: 12.5px; line-height: 1.85;
}
.page-help .ph-list li { margin: 0 0 2px; }
.page-help .ph-list li::marker { color: #93aacb; }

@media (max-width: 720px) {
  .page-help { padding: 12px 14px 13px; margin: 12px 0 4px; }
  .page-help .ph-list { font-size: 12px; line-height: 1.8; padding-left: 16px; }
}

/* ---------- 角色权限编辑器 ---------- */
.perm-hint { font-size: 12.5px; color: #5b6675; margin-bottom: 12px; line-height: 1.7; }
.perm-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.perm-grp { border: 1px solid #e3e7ee; border-radius: 8px; padding: 8px 11px 9px; background: #fcfdff; }
.perm-ghd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.perm-gname { font-size: 12.5px; font-weight: 600; color: #16304f; }
.perm-all { font-size: 11.5px; color: #1f5fbf; background: none; border: none; cursor: pointer; padding: 0; }
.perm-all:hover { text-decoration: underline; }
.perm-list { display: flex; flex-direction: column; gap: 1px; }
.perm-it {
  display: flex; align-items: flex-start; gap: 7px; font-size: 12.5px; color: #2c3e55;
  padding: 3px 4px; border-radius: 5px; cursor: pointer; line-height: 1.45;
}
.perm-it:hover { background: #f1f5fd; }
.perm-it input { width: 15px; height: 15px; margin: 2px 0 0; flex: none; cursor: pointer; }
.perm-it em {
  display: block; font-style: normal; color: #a2acb9; font-size: 10.5px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
}
.perm-warn {
  margin-top: 11px; background: #fdf6ea; border-left: 3px solid #b9791a;
  padding: 7px 10px; font-size: 12px; color: #8a5a10; border-radius: 4px; line-height: 1.6;
}
@media (max-width: 760px) {
  .perm-groups { grid-template-columns: 1fr; }
}

/* ---------- 供应商按物料分类 ---------- */
.sup-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding-bottom: 8px; }
.sup-fgroup {
  font-size: 11px; color: #8b95a4; margin: 0 2px 0 8px; padding-right: 6px;
  border-right: 1px solid #e3e7ee; letter-spacing: .5px;
}
.sup-fgroup:first-child { margin-left: 0; }
.sup-ftag {
  padding: 3px 10px; border-radius: 14px; border: 1px solid #e3e7ee; background: #fff;
  font-size: 12px; color: #4a5666; cursor: pointer; white-space: nowrap; line-height: 18px;
}
.sup-ftag:hover { border-color: #b9c3d3; }
.sup-ftag.on { background: #1f5fbf; border-color: #1f5fbf; color: #fff; }
.sup-ftag.muted { color: #b4bcc8; }
.sup-ftag.muted.on { background: #7A8797; border-color: #7A8797; color: #fff; }

.sup-chip {
  display: inline-block; padding: 1px 7px; margin: 1px 3px 1px 0; border-radius: 9px;
  background: #eef3fa; color: #2c548f; font-size: 11px; line-height: 16px; white-space: nowrap;
}

.sup-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sup-grp { border: 1px solid #e3e7ee; border-radius: 8px; padding: 7px 10px 8px; background: #fcfdff; }
.sup-gname { font-size: 12px; font-weight: 600; color: #16304f; padding-left: 6px; margin-bottom: 5px; }
.sup-cks { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.sup-ck {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: #2c3e55;
  cursor: pointer; padding: 2px 3px; border-radius: 4px;
}
.sup-ck:hover { background: #f1f5fd; }
.sup-ck input { width: 14px; height: 14px; cursor: pointer; margin: 0; }
@media (max-width: 760px) {
  .sup-picker { grid-template-columns: 1fr; }
  .sup-fgroup { display: none; }
}

/* ---------- 搜索条与分页 ---------- */
.prod-search { display: flex; gap: 8px; align-items: center; margin: 8px 0 4px; }
.prod-search .input.search { max-width: 320px; }
.pager {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 12px 0 4px; font-size: 12.5px; color: #5b6675;
}
.pager .btn:disabled { opacity: .45; cursor: default; }
@media (max-width: 720px) {
  .prod-search .input.search { max-width: none; flex: 1; }
}

@media (max-width: 720px) {
  .pk-list { min-width: 0; right: 0; }
  .pk-tabs { gap: 1px; padding: 5px; }
  .pk-tab { padding: 3px 7px; font-size: 11.5px; }
}

/* ---------- 客户收款记录 / 图片放大 ---------- */
.pay-box {
  border: 1px solid #e3e7ee; border-radius: 8px; padding: 10px 12px 12px;
  background: #fbfcfe; margin: 10px 0 12px;
}
.pay-hd {
  display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px;
  font-size: 12.5px; font-weight: 600; color: #16304f;
}
.pay-hd .small { font-weight: 400; }
.pay-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.pay-empty {
  font-size: 12px; color: #8b95a4; padding: 4px 0 2px;
}
.pay-thumb-wrap { position: relative; width: 92px; height: 92px; }
.pay-thumb {
  width: 92px; height: 92px; object-fit: cover; border-radius: 6px;
  border: 1px solid #dde3ec; background: #fff; cursor: zoom-in; display: block;
}
.pay-thumb:hover { border-color: #2F6FE4; box-shadow: 0 3px 10px rgba(47,111,228,.18); }
.pay-del {
  position: absolute; top: -6px; right: -6px; width: 19px; height: 19px;
  border-radius: 50%; border: none; background: #b4322f; color: #fff;
  font-size: 13px; line-height: 1; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.pay-del:hover { background: #8f2421; }

.sign-tip {
  margin: 4px 0 12px; padding: 7px 11px; font-size: 12px; color: #1f4b8f;
  background: #eef4fe; border-left: 3px solid #2F6FE4; border-radius: 4px;
}

.lightbox {
  position: fixed; inset: 0; z-index: 9999; background: rgba(10,16,26,.86);
  display: flex; align-items: center; justify-content: center; cursor: zoom-out;
  padding: 3vh 3vw;
}
.lightbox img {
  max-width: 94vw; max-height: 88vh; border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5); background: #fff;
}
.lightbox .lb-tip {
  position: absolute; bottom: 18px; left: 0; right: 0; text-align: center;
  color: rgba(255,255,255,.7); font-size: 12px;
}

/* ---------- 生产交期确认 ---------- */
.plan-box {
  border: 1px solid #e3e7ee; border-radius: 8px; padding: 10px 12px 11px;
  background: #fbfcfe; margin: 12px 0;
}
.plan-hd {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; font-weight: 600; color: #16304f; margin-bottom: 7px;
}
.plan-main { font-size: 13px; color: #1c2430; }
.plan-main b { font-size: 15px; color: #1f5fbf; }
.plan-ok { color: #1a7f4b; font-size: 12px; margin-left: 8px; }
.plan-bad { color: #b4322f; font-size: 12px; margin-left: 8px; font-weight: 500; }
.plan-warn { font-size: 12px; color: #8a5a10; }

/* ---------- 工单弹窗：待核交期提示 ---------- */
.wo-warn {
  background: #fdf6ea; border-left: 3px solid #b9791a; color: #8a5a10;
  padding: 8px 11px; border-radius: 4px; font-size: 12.5px; line-height: 1.65;
}

/* ---------- 无权限查看收款记录 ---------- */
.pay-lock { color: #8a5a10; background: #fdf6ea; border-left: 3px solid #b9791a;
  padding: 7px 10px; border-radius: 4px; font-size: 12px; }

/* ---------- 收款 / 合同两栏 ---------- */
.pay-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0 12px; }
.pay-two .pay-box { margin: 0; }
.lb-tip, .field .lb-tip {
  font-size: 10.5px; color: #a2acb9; font-weight: 400; margin-left: 4px;
}
.input.ro, .input:disabled {
  background: #f4f6f9; color: #6b7686; cursor: not-allowed;
}
@media (max-width: 820px) {
  .pay-two { grid-template-columns: 1fr; }
}

/* 无收款权限时合同栏占满整行 */
.pay-two.one { grid-template-columns: 1fr; }

/* ---------- 上传：拖拽高亮 ---------- */
.up-drop { transition: all .15s; }
.up-over {
  outline: 2px dashed #2F6FE4 !important; outline-offset: 3px;
  background: #eef4fe !important; border-radius: 6px;
}

/* ---------- 手机上传来源选择 ---------- */
.up-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.up-opt {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 18px 10px 14px; border: 1px solid #dde3ec; border-radius: 10px;
  background: #fbfcfe; color: #1f5fbf; cursor: pointer;
}
.up-opt:hover, .up-opt:active { border-color: #2F6FE4; background: #eef4fe; }
.up-opt b { font-size: 13.5px; color: #16304f; font-weight: 600; }
.up-opt i { font-style: normal; font-size: 11.5px; color: #8b95a4; }
@media (max-width: 480px) {
  .up-choice { grid-template-columns: 1fr; gap: 10px; }
  .up-opt { flex-direction: row; justify-content: flex-start; padding: 16px 14px; gap: 12px; }
  .up-opt b { font-size: 14px; }
  .up-opt i { margin-left: auto; }
}

/* ---------- 统一的「添加图片」窗口（物料档案 / 盘点补图共用） ---------- */
.imgdlg-drop {
  border: 1.5px dashed #cfd6e2; border-radius: 12px; background: #fafbfd;
  padding: 26px 16px 22px; text-align: center; cursor: pointer;
}
.imgdlg-drop:hover { border-color: #2F6FE4; background: #f4f8ff; }
.imgdlg-plus { display: block; font-size: 26px; line-height: 1; color: #9fb0c8; margin-bottom: 8px; }
.imgdlg-t1 { font-size: 14px; color: #16304f; font-weight: 600; }
.imgdlg-t2 { font-size: 12px; color: #8b95a4; margin-top: 5px; }
.imgdlg-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
/* 选图弹窗内容少，不比别的表单窗需要铺满整屏（手机 .mask 是 stretch，会把它拉满） */
.dialog.imgdlg-dlg { min-height: auto; align-self: center; }
@media (max-width: 480px) {
  .imgdlg-drop { padding: 20px 12px 18px; }
  .imgdlg-plus { font-size: 22px; }
}

/* 资料列表：短字段不折行 */
table.tb td.nw { white-space: nowrap; }

/* ============================================================
   手机端适配（≤768px）
   侧栏改抽屉、顶部栏紧凑、表格容器内横滑、弹窗铺满
   ============================================================ */

/* 桌面端默认不显示（手机样式里再打开） */
.burger { display: none; }
.side-mask { display: none; }

@media (max-width: 768px) {
  .shell { display: block; min-height: 100vh; }

  /* ---- 侧栏：抽屉 ---- */
  .side {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 252px; flex: none; height: 100%;
    transform: translateX(-102%);
    transition: transform .22s cubic-bezier(.4, 0, .2, 1);
    z-index: 70; box-shadow: 0 0 32px rgba(8, 16, 28, .3);
  }
  .side.open { transform: none; }
  .side nav { padding: 8px 10px; }
  .side nav a { padding: 12px 12px; font-size: 14.5px; margin-bottom: 3px; }
  .side nav a .n { width: 18px; font-size: 14px; }
  .side-mask {
    display: block; position: fixed; inset: 0;
    background: rgba(8, 16, 28, .45); z-index: 65;
    opacity: 0; pointer-events: none; transition: opacity .2s;
  }
  .side-mask.on { opacity: 1; pointer-events: auto; }
  body.side-open { overflow: hidden; }

  /* ---- 顶部栏 ---- */
  .top {
    height: 54px; flex: 0 0 54px; padding: 0 12px; gap: 6px;
    justify-content: flex-start;
  }
  .burger {
    display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px;
    width: 40px; height: 40px; margin-left: -6px; padding: 0;
    background: #eef3fb; border: 1px solid #dbe4f2; border-radius: 9px;
    cursor: pointer; flex: none;
  }
  .burger:active { background: #e2ebfa; }
  .burger > span {
    display: block; width: 18px; height: 2px; background: #2b4a6f; border-radius: 2px;
  }
  /* 首次进入闪一下，提示这里能点 */
  .burger.hint { animation: burgerHint 1.5s ease-out 3; }
  @keyframes burgerHint {
    0%, 100% { box-shadow: 0 0 0 0 rgba(47,111,228,.55); background: #eef3fb; }
    50% { box-shadow: 0 0 0 7px rgba(47,111,228,0); background: #dbe7fb; }
  }
  .top-title { flex: 1; min-width: 0; display: flex; align-items: baseline; }
  .top h1 {
    font-size: 16px; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; max-width: 100%;
  }
  .top .crumb { display: none; }
  .top-right { gap: 8px; flex: none; }
  .who-txt { display: none; }
  .who { gap: 0; }
  .avatar { width: 30px; height: 30px; font-size: 13px; }

  /* ---- 内容区 ---- */
  .content { padding: 12px 12px calc(24px + env(safe-area-inset-bottom)); }

  /* ---- 卡片 / 工具栏 ---- */
  .card { border-radius: 10px; margin-bottom: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card-hd { padding: 12px 14px; flex-wrap: wrap; gap: 10px; }
  .toolbar { padding: 10px 12px; flex-wrap: wrap; gap: 8px; }
  .toolbar .search { width: 100%; }

  /* ---- 表格：容器内横滑，不再把列挤成竖排 ---- */
  table.tb { min-width: max-content; }
  table.tb th, table.tb td { padding: 9px 10px; white-space: nowrap; }
  table.tb td .small { white-space: normal; }

  /* ---- 表单 / 按钮：手指友好（16px 防止 iOS 聚焦缩放） ---- */
  input, select, textarea, .input, .btn { font-size: 16px; }
  .btn { min-height: 42px; padding-left: 14px; padding-right: 14px; }
  .btn-sm { min-height: 36px; font-size: 14px; }
  .field .lb { font-size: 13px; }
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }

  /* ---- 弹窗：铺满屏幕，底部按钮好点 ---- */
  .mask { padding: 0; align-items: stretch; }
  .dialog {
    max-width: 100%; width: 100%; min-height: 100%;
    border-radius: 0; display: flex; flex-direction: column;
  }
  .dialog.wide { max-width: 100%; }
  .dialog-hd { padding: 14px; position: sticky; top: 0; background: #fff; z-index: 2; }
  .dialog-bd { padding: 14px; flex: 1; }
  .dialog-ft {
    position: sticky; bottom: 0; border-radius: 0;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: #fbfcfd;
  }
  .dialog-ft .btn { flex: 1; min-height: 44px; }

  /* ---- 登录页：垂直居中 ---- */
  .login-wrap { min-height: 100vh; min-height: 100dvh; padding: 20px 16px; }
  .login-card { width: 100%; max-width: 420px; padding: 28px 22px 24px; }
  .login-card .btn-primary { height: 46px; font-size: 16px; }

  /* ---- KPI 卡片 ---- */
  .kpis { gap: 10px; }
  .kpi { padding: 12px; }
  .kpi .v { font-size: 20px; }

  /* ---- 页面底部说明 ---- */
  .page-help { padding: 12px 14px; font-size: 12.5px; }
}

/* 手机端：操作说明折叠 + 工具栏按钮排列 */
@media (max-width: 768px) {
  .page-help { padding: 11px 14px; margin: 12px 0 4px; }
  .page-help .ph-hd { margin-bottom: 0; cursor: pointer; }
  .page-help .ph-title { flex: 1; }
  .page-help .ph-toggle {
    font-size: 12px; font-weight: 400; color: #6b83a8;
    border: 1px solid #d7e0ee; border-radius: 4px; padding: 1px 8px; background: #fff;
  }
  .page-help.collapsed .ph-list { display: none; }

  /* 工具栏：去掉弹簧，按钮均分，避免一行只剩半个按钮 */
  .toolbar > .grow { display: none; }
  .toolbar > .btn { flex: 1 1 auto; }
  .toolbar > .input, .toolbar > select.input { flex: 1 1 auto; width: auto; min-width: 0; }
  .toolbar .search { flex: 1 1 100%; width: 100%; }
}

/* 报表筛选条：手机上日期各占一行，去掉「至」和固定的维度框 */
@media (max-width: 768px) {
  .rpt-sep, .rpt-dim-fixed { display: none; }
  #rptFrom, #rptTo { flex: 1 1 100%; width: 100%; }
  .rpt-lb { flex: 0 0 100%; }
}

/* 手机端提示条挪到底部：弹窗是整屏的，顶部提示会盖住弹窗标题 */
@media (max-width: 768px) {
  .toast-wrap { top: auto; bottom: 92px; }
}

/* 抽屉展开时恢复菜单文字（900px 断点原本把它们藏了，那是针对 64px 窄条） */
@media (max-width: 768px) {
  .side nav a .txt { display: inline; }
  .side-brand b, .side-brand span { display: block; }
  .side nav a { justify-content: flex-start; }
}

/* 抽屉里恢复分组标题（900px 断点原本把它压成 1px 分隔线，那是给 64px 窄条用的） */
@media (max-width: 768px) {
  .nav-group {
    height: auto; overflow: visible; background: none; margin: 0;
    padding: 15px 12px 5px; color: inherit;
    display: flex; align-items: center; gap: 7px;
    font-size: 11px; font-weight: 600; letter-spacing: 1.2px;
  }
  .nav-group i { display: block; width: 3px; height: 12px; border-radius: 2px; background: currentColor; flex: 0 0 3px; }
  .nav-group:first-child { padding-top: 8px; }
}

/* ── 采购单：物料行内的「历史常用供应商」推荐 ────────────────── */
.po-hint { margin-top: 3px; line-height: 1.5; }
.po-hint-hd { font-size: 10.5px; color: #9aa4b2; letter-spacing: .3px; }
.po-sup-chip {
  display: block; width: fit-content; max-width: 108px;
  margin: 3px 0 0; padding: 1px 7px;
  font-size: 11px; border-radius: 9px; text-decoration: none;
  color: #4a5464; background: #f2f5fa; border: 1px solid #e2e8f2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.po-sup-chip:hover { background: #e6edf9; border-color: #c8d6ee; color: #1e4c8a; }
.po-sup-chip.on { background: #1a7f4b; border-color: #1a7f4b; color: #fff; font-weight: 600; }
.po-sup-chip.off { color: #b0b8c4; background: #f7f8fa; border-color: #eceff4; text-decoration: line-through; }

/* 采购单：历史价格单元格（价格 + 哪家/哪天 + 历史统计），窄列里要能截断不换行挤成一团 */
.po-last { display: block; line-height: 1.5; }
.po-last .po-who {
  display: block; color: #6b7684; max-width: 200px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.po-last .po-when { display: block; color: #9aa4b2; }
.po-last .po-stat { display: block; color: #8b95a4; margin-top: 2px; white-space: nowrap; }

/* 可排序的表头（供应商等级）：点一下升序、再点降序 */
th.th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
th.th-sort:hover { color: #1f5fbf; }
th.th-sort .sc { color: #b8c0cb; margin-left: 3px; font-size: 11px; }
th.th-sort.on { color: #1f5fbf; }
th.th-sort.on .sc { color: #1f5fbf; }

/* 盘点单：按分类筛选的胶囊条（只切显示，不影响数据） */
.st-catbar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 10px 12px; margin-bottom: 8px;
  background: #fff; border: 1px solid var(--line, #dfe4ec); border-radius: 8px;
}
.st-cat {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 14px; cursor: pointer;
  font-size: 12.5px; color: #4a5666;
  background: #f5f7fa; border: 1px solid #e6eaf1;
}
.st-cat:hover { border-color: #c8d6ee; color: #1f5fbf; }
.st-cat i { font-style: normal; font-size: 11px; color: #8b95a4; }
.st-cat.on { background: #1f5fbf; border-color: #1f5fbf; color: #fff; }
.st-cat.on i { color: #dbe7fb; }
/* 盘点单里的物料搜索框：窄屏也能用，别把分类胶囊挤没了 */
.st-catbar #stQ { flex: 1 1 150px; min-width: 120px; }
@media (max-width: 480px) {
  .st-catbar #stQ { flex: 1 1 100%; max-width: none !important; }
}
.po-hint-tip { font-size: 10.5px; color: #8a94a6; margin-top: 3px; }
.po-hint-tip.warn { color: #b26a00; }

/* ── 采购单列表：筛选栏 + 分页 ────────────────────────────── */
.po-filter {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 16px; border-bottom: 1px solid var(--line); background: #fbfcfe;
}
.po-filter .po-f-q { width: 210px; height: 30px; }
.po-filter .po-f-d { width: 142px; height: 30px; }
.po-filter .po-f-s { width: 140px; height: 30px; }
.po-filter .po-f-lb { font-size: 12px; color: var(--text-2); }

.po-pager {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px; border-top: 1px solid var(--line);
}
.po-pager .pg-info { font-size: 12px; color: var(--text-2); }
.po-pager .pg-info b { color: var(--text-1); font-weight: 600; }
.po-pager .pg-btns { display: flex; gap: 4px; flex-wrap: wrap; }
.po-pager .pg-btns button { min-width: 32px; padding: 0 8px; }
.po-pager .pg-gap { padding: 0 2px; color: #b3bac5; font-size: 12px; align-self: center; }
.po-pager .pg-size { width: 104px; height: 30px; margin-left: auto; }

/* 物料档案里的产品缩略图（报价表同步过来的图） */
.dthumb {
  width: 54px; height: 54px; object-fit: contain; border-radius: 6px;
  border: 1px solid #e3e8ef; background: #fff; cursor: zoom-in; display: block;
}
.dthumb:hover { border-color: #2F6FE4; box-shadow: 0 3px 10px rgba(47,111,228,.18); }
