:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --line: #e4e7eb;
  --line-2: #d3d8de;
  --text: #1d2129;
  --muted: #6b7280;
  --dim: #9aa1ab;
  --primary: #185fa5;
  --primary-dark: #124a80;
  --primary-soft: #e8f1fa;
  --ok: #0f6e56;
  --ok-soft: #e3f3ec;
  --warn: #a86412;
  --warn-soft: #fbf1de;
  --danger: #b3352b;
  --danger-soft: #fbeae8;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 12px rgba(16, 24, 40, 0.05);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }

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

h1, h2, h3, h4 { margin: 0; font-weight: 600; }
a { color: var(--primary); text-decoration: none; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(180deg, #eef3f9 0%, #f4f5f7 60%);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px 28px 26px;
  box-shadow: var(--shadow);
}
.login-card h1 { font-size: 20px; letter-spacing: 0.5px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin: 6px 0 22px; }
.login-card .field { margin-bottom: 14px; }
.login-hint {
  margin-top: 18px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

/* ---------- 布局 ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 56px;
  padding: 0 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .brand { font-weight: 600; font-size: 15px; letter-spacing: 0.3px; white-space: nowrap; }
.topbar .brand span { color: var(--primary); }
.topbar .spacer { flex: 1; }
.topbar .who { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* 测试模式标记：点一下进设置页关掉 */
.test-tag {
  border: 0;
  background: #fdf0d9;
  color: #9a6410;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.test-tag:hover { background: #f9e5c3; }

/* 设置页的开关行 */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #d7dbe0;
  cursor: pointer;
  transition: background .18s;
  flex: none;
}
.switch::after {
  content: '';
  position: absolute;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .22);
  transition: transform .18s;
}
.switch.on { background: var(--primary); }
.switch.on::after { transform: translateX(20px); }

.tabs {
  display: flex;
  gap: 2px;
  padding: 0 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 56px;
  z-index: 19;
  overflow-x: auto;
}
.tabs button {
  border: 0;
  background: none;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-family: inherit;
}
.tabs button.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.page { padding: 18px 20px 60px; max-width: 1400px; margin: 0 auto; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel + .panel { margin-top: 14px; }
.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.panel-head h3 { font-size: 14px; }
.panel-body { padding: 14px 16px; }

/* ---------- 统计卡 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.stat .k { color: var(--muted); font-size: 12px; }
.stat .v { font-size: 24px; font-weight: 600; margin-top: 4px; letter-spacing: -0.5px; }
.stat .v small { font-size: 12px; font-weight: 400; color: var(--dim); margin-left: 4px; }

.chart { display: flex; align-items: flex-end; gap: 10px; height: 130px; padding-top: 10px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.chart .bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.chart .bar {
  width: 100%;
  background: var(--primary-soft);
  border-radius: 4px 4px 0 0;
  min-height: 3px;
  position: relative;
  transition: height .3s;
}
.chart .bar.hi { background: var(--primary); }
.chart .lbl { font-size: 11px; color: var(--dim); }
.chart .num { font-size: 11px; color: var(--muted); }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label { font-size: 12px; color: var(--muted); }
input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 8px 10px;
  outline: none;
  width: 100%;
  min-height: 36px;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(24, 95, 165, 0.12); }
input::placeholder, textarea::placeholder { color: var(--dim); }
textarea { resize: vertical; min-height: 70px; }
select { appearance: none; background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7280' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn.danger { color: var(--danger); border-color: #e8c4c0; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.edit { color: var(--primary); border-color: #bcd4ea; background: #f7fbff; }
.btn.edit:hover { background: var(--primary-soft); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--bg); color: var(--primary); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { height: 28px; font-size: 13px; padding: 0 10px; border-radius: 6px; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar .grow { flex: 1; min-width: 120px; }
.toolbar input, .toolbar select { width: auto; min-width: 130px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; background: #fafbfc; font-size: 12px; position: sticky; top: 0; }
tbody tr:hover { background: #fafbfc; }
td.wrap { white-space: normal; min-width: 160px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 36px 16px; text-align: center; color: var(--dim); font-size: 13px; }

/* ---------- 订单表格：Excel 式分列 + 表头筛选 ---------- */
table.excel { width: 100%; font-size: 12.5px; }
table.excel th, table.excel td { padding: 7px 8px; }
table.excel th { vertical-align: middle; }
table.excel th.ctr, table.excel td.ctr { text-align: center; }
table.excel td.wrap3 {
  white-space: normal; word-break: break-word; line-height: 1.55;
  max-height: 4.7em; overflow: hidden;
}
table.excel td.wrap3 > span {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
table.excel td { overflow: hidden; text-overflow: ellipsis; }
table.excel .cell-strong { font-weight: 600; }
table.excel .dash { color: #c9cfd8; }
table.excel .sub-ok { color: var(--ok); font-size: 11px; font-weight: 400; }
table.excel .seq-tag.flat { margin-left: 0; }

/* 筛选行：表头下面那一排输入框 */
table.excel tr.filter-row th {
  position: static; background: #f5f7fa; padding: 4px 5px;
  border-bottom: 1px solid var(--line-2); font-weight: 400;
}
table.excel .f-in {
  width: 100%; height: 26px; min-height: 26px; padding: 0 6px;
  font-size: 12px; color: var(--text); background: #fff;
  border: 1px solid #d8dee6; border-radius: 6px; outline: none;
}
table.excel .f-in:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(24, 95, 165, .1); }
table.excel select.f-in { padding: 0 2px; cursor: pointer; }
table.excel .f-clear-th { text-align: right; }
table.excel .f-clear-th .btn { font-size: 12px; padding: 0 10px; height: 26px; }
table.excel .loading-cell { padding: 34px 16px; text-align: center; color: var(--dim); font-size: 13px; }

/* 隐藏筛选行 */
#olist.no-filter table.excel tr.filter-row { display: none; }

/* 表格下面的统计条 */
.ord-foot {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 9px 14px; border-top: 1px solid var(--line);
  background: #fafbfc; color: var(--muted); font-size: 12.5px;
}
.ord-foot b { color: var(--text); font-variant-numeric: tabular-nums; }
.ord-foot .f-tag { color: var(--primary); background: var(--primary-soft); padding: 1px 8px; border-radius: 20px; }
.ord-foot .f-tip { color: var(--dim); }
.ord-foot .f-scroll { color: var(--dim); }
.ord-foot .btn { margin-left: auto; }

/* 操作列钉在右边：列多要横向滚动时，按钮不会被滚走 */
table.excel thead th:last-child,
table.excel tbody td:last-child {
  position: sticky; right: 0; z-index: 3; background: #fff;
  box-shadow: -8px 0 10px -8px rgba(16, 24, 40, .18);
}
table.excel thead tr:first-child th:last-child { background: #fafbfc; z-index: 5; }
table.excel tr.filter-row th:last-child { background: #f5f7fa; }
table.excel tbody tr:hover td:last-child { background: #fafbfc; }
table.excel td.act-cell .btn { padding: 0 7px; font-size: 12px; }
table.excel td.act-cell .btn + .btn { margin-left: 3px; }

table.excel .progress-mini { min-width: 0; }
table.excel .progress-mini .track { min-width: 26px; }

/* 冻结前两列（勾选框 + 单号）：横向滚动时单号始终看得见 */
table.excel thead th:nth-child(1), table.excel tbody td:nth-child(1) {
  position: sticky; left: 0; z-index: 4; background: #fff;
}
table.excel thead th:nth-child(2), table.excel tbody td:nth-child(2) {
  position: sticky; left: 40px; z-index: 4; background: #fff;
  box-shadow: 8px 0 10px -8px rgba(16, 24, 40, .18);
}
table.excel thead th:nth-child(1), table.excel thead th:nth-child(2) { z-index: 6; background: #fafbfc; }
table.excel tr.filter-row th:nth-child(1), table.excel tr.filter-row th:nth-child(2) { background: #f5f7fa; }
table.excel tbody tr:hover td:nth-child(1), table.excel tbody tr:hover td:nth-child(2) { background: #fafbfc; }

/* ---------- 订单表格：列设置与拖动 ---------- */
th[draggable="true"] { cursor: grab; user-select: none; }
th[draggable="true"]:active { cursor: grabbing; }
th .grip {
  display: inline-block; margin-right: 5px; color: #ccd2da;
  font-size: 10px; letter-spacing: -1px; vertical-align: 1px;
}
th:hover .grip { color: var(--primary); }
th.dragging { opacity: .35; }
th.drag-over { background: var(--primary-soft); box-shadow: inset 2px 0 0 var(--primary); }
td.act-cell { white-space: nowrap; }
td.act-cell .btn + .btn { margin-left: 4px; }

/* ---------- 手机扫码进入弹窗 ---------- */
.qr-hero { display: flex; justify-content: center; padding: 6px 0 10px; }
.qr-hero img {
  width: 300px; height: 300px; display: block; padding: 8px;
  background: #fff; border: 1px solid #e3e8ee; border-radius: 10px;
}
.qr-addr { display: flex; justify-content: center; }
.qr-addr input { width: 100%; text-align: center; font-size: 13.5px; }
.qr-pick { display: block; margin-top: 12px; font-size: 12.5px; color: var(--muted); line-height: 2; }
.qr-pick select { margin-left: 6px; font-size: 12.5px; }
.qr-btns { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }
.qr-warn {
  margin: 12px 0 0; padding: 9px 12px; border-radius: 8px; font-size: 12.5px; line-height: 1.7;
  color: #9a3412; background: #fff7ed; border: 1px solid #fed7aa;
}

/* 表头右边缘的拖动条：拖它可以改列宽 */
.th-rz {
  position: absolute; top: 0; right: 0; width: 9px; height: 100%;
  cursor: col-resize; touch-action: none; z-index: 7;
}
.th-rz::after {
  content: ''; position: absolute; top: 7px; bottom: 7px; right: 0; width: 1px;
  background: #dbe1e9;
}
.th-rz:hover::after, .th-rz.on::after {
  top: 2px; bottom: 2px; width: 2px; background: var(--primary);
}
body.col-resizing, body.col-resizing * { cursor: col-resize !important; user-select: none; }
.colw-tip {
  position: fixed; z-index: 9999; display: none; pointer-events: none;
  padding: 3px 8px; font-size: 12px; line-height: 16px; font-variant-numeric: tabular-nums;
  color: #fff; background: rgba(17, 24, 39, .88); border-radius: 5px;
}

.seq-tag {
  display: inline-block; margin-left: 5px; padding: 0 5px;
  font-size: 11px; line-height: 16px; font-weight: 600;
  color: var(--primary); background: var(--primary-soft); border-radius: 4px;
  vertical-align: 1px;
}
.hint-line {
  padding: 10px 14px; color: var(--muted); font-size: 12.5px;
  border-top: 1px solid var(--line); background: #fafbfc;
}

.colset-row {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 2px; border-bottom: 1px dashed var(--line);
}
.colset-row:last-child { border-bottom: 0; }
.colset-name {
  flex: 1; display: flex; align-items: center; gap: 9px;
  cursor: pointer; font-size: 13px; padding: 2px 0;
}
.colset-name input {
  width: 15px; height: 15px; min-height: 0; margin: 0;
  accent-color: var(--primary);
}
.colset-row .btn { width: 30px; padding: 0; }

.chg-val {
  display: inline-block; max-width: 210px; white-space: normal; word-break: break-all;
}
.chg-diff { max-width: 340px; white-space: normal; word-break: break-word; line-height: 1.7; }
.chg-diff .chg-old { color: var(--dim); }
.chg-diff .chg-arrow { color: #c3c9d2; margin: 0 7px; }
.chg-diff .chg-new { font-weight: 600; color: var(--text); }
.chg-diff .chg-flag {
  margin-left: 8px; font-size: 11px; color: var(--danger);
  background: var(--danger-soft); border-radius: 4px; padding: 0 5px;
}
td.nowrap { white-space: nowrap; }

.pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 20px;
  font-size: 12px;
  line-height: 18px;
  border: 1px solid transparent;
}
.pill.wait { background: var(--bg); color: var(--muted); border-color: var(--line-2); }
.pill.run { background: var(--warn-soft); color: var(--warn); }
.pill.done { background: var(--ok-soft); color: var(--ok); }
.pill.cancel { background: var(--danger-soft); color: var(--danger); }
.pill.pay0 { background: var(--danger-soft); color: var(--danger); }
.pill.pay1 { background: var(--warn-soft); color: var(--warn); }
.pill.pay2 { background: var(--ok-soft); color: var(--ok); }

.progress-mini { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.progress-mini .track { flex: 1; height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress-mini .fill { height: 100%; background: var(--primary); border-radius: 3px; }
.progress-mini span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- 弹窗 ---------- */
.mask {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, .42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal {
  background: var(--panel);
  border-radius: 12px;
  width: 100%;
  max-width: 620px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(16, 24, 40, .2);
}
.modal.wide { max-width: 860px; }
.modal.xwide { max-width: 1060px; }
.modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 15px; flex: 1; }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.span2 { grid-column: span 2; }

/* ---------- 进度明细 ---------- */
.proc-list { display: flex; flex-direction: column; gap: 9px; }
.proc-row { display: grid; grid-template-columns: 60px 1fr 90px; align-items: center; gap: 10px; }
.proc-row .n { font-size: 13px; color: var(--text); }
.proc-row .track { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.proc-row .fill { height: 100%; background: var(--primary); border-radius: 4px; }
.proc-row .fill.full { background: var(--ok); }
.proc-row .t { font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 提示 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  background: #1d2129;
  color: #fff;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 300;
  max-width: 80vw;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}
.toast.err { background: var(--danger); }
.toast.ok { background: #1d2129; }
.loading { padding: 40px; text-align: center; color: var(--dim); font-size: 13px; }

/* ---------- 手机端 ---------- */
.m-body { background: #eef0f3; padding-bottom: env(safe-area-inset-bottom); }
.m-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--primary);
  color: #fff;
  padding: 12px 16px calc(12px + env(safe-area-inset-top)) 16px;
}
.m-head .l1 { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.m-head .l1 .spacer { flex: 1; }
.m-head .l1 .who { font-size: 12px; font-weight: 400; opacity: .85; }
.m-head .l2 { font-size: 12px; opacity: .85; margin-top: 2px; }
.m-search { padding: 12px 16px 4px; }
.m-search input { height: 40px; font-size: 15px; }

.m-list { padding: 8px 12px 90px; display: flex; flex-direction: column; gap: 10px; }
.m-card {
  background: #fff;
  border-radius: 12px;
  padding: 13px 14px;
  box-shadow: 0 1px 2px rgba(16,24,40,.06);
  border: 1px solid #e8ebef;
}
.m-card .row1 { display: flex; align-items: baseline; gap: 8px; }
.m-card .no { font-size: 16px; font-weight: 600; letter-spacing: .3px; }
.m-card .row1 .spacer { flex: 1; }
.m-card .meta { color: var(--muted); font-size: 13px; margin-top: 3px; line-height: 1.5; }
.m-card .req { color: var(--warn); font-size: 12px; margin-top: 4px; }
.m-card .pbar { margin-top: 9px; display: flex; align-items: center; gap: 8px; }
.m-card .pbar .track { flex: 1; height: 6px; background: #eef0f3; border-radius: 3px; overflow: hidden; }
.m-card .pbar .fill { height: 100%; background: var(--primary); border-radius: 3px; }
.m-card .pbar span { font-size: 12px; color: var(--muted); }
.m-card:active { background: #fafbfc; }

.m-tabs {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 30;
}
.m-tabs button {
  flex: 1;
  border: 0;
  background: none;
  padding: 10px 0 12px;
  font-family: inherit;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}
.m-tabs button.on { color: var(--primary); font-weight: 600; }

.sheet-mask {
  position: fixed;
  inset: 0;
  background: rgba(16,24,40,.45);
  z-index: 100;
  display: flex;
  align-items: flex-end;
}
.sheet {
  width: 100%;
  background: #fff;
  border-radius: 16px 16px 0 0;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}
.sheet-head { display: flex; align-items: center; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.sheet-head h3 { font-size: 15px; flex: 1; }
.sheet-head .x { border: 0; background: none; font-size: 20px; color: var(--dim); padding: 0 4px; line-height: 1; cursor: pointer; }
.sheet-body { padding: 14px 16px; overflow-y: auto; }
.sheet-foot { padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 10px; }
.sheet-foot .btn { flex: 1; height: 44px; font-size: 15px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 13px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
}
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip.dis { opacity: .45; }
/* 本产线的工序：加一圈主色底纹，一眼看出哪个是自己常做的 */
.chip.mine { background: #eaf3fd; border-color: #9dc4ea; }
.chip.mine.on { background: var(--primary); border-color: var(--primary); }

/* ---------- 手机报工弹层 ---------- */
.order-box {
  background: #f4f5f7;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}
.order-box .ob-model { font-size: 15px; color: var(--text); font-weight: 600; }
.order-box .ob-req { color: var(--warn); }
.order-box b { color: var(--text); }

/* 我的工序做到哪一步 */
.my-status {
  margin-top: 12px;
  padding: 8px 11px;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 13px;
  line-height: 1.5;
}
.my-status b { font-variant-numeric: tabular-nums; }
.my-status.done { background: var(--ok-soft); color: var(--ok); font-weight: 600; }

/* 工序按钮：一道一块，上面工序名，下面状态 */
.chips.procs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.chip.proc {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 7px 12px;
  line-height: 1.35;
  text-align: left;
}
.chip.proc .pn { font-size: 15px; font-weight: 600; }
.chip.proc .ps { font-size: 11px; opacity: .72; }
.chip.proc.part { background: var(--warn-soft); border-color: #e0b775; }
.chip.proc.done { background: var(--ok-soft); border-color: #b9dfcd; color: var(--ok); }
.chip.proc.done .ps { opacity: .85; }
.chip.proc:disabled { cursor: default; }
/* 选中态放最后，盖住"报了一部分"的底色 */
.chip.proc.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip.proc.on .ps { opacity: .9; }

/* 本次报工数量 */
.qty-line {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}
.qty-line b { font-size: 17px; color: var(--primary); font-variant-numeric: tabular-nums; }
.qty-line input { width: 76px; height: 34px; font-size: 15px; text-align: center; }
.qty-line a { font-size: 12.5px; margin-left: auto; }
.qty-max { color: var(--dim); font-size: 12px; }

.m-card .mine-line { margin-top: 8px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.m-card .mine-line b { color: var(--text); font-variant-numeric: tabular-nums; }
.m-card .mine-line.done { color: var(--ok); font-weight: 600; }
.m-card.mine-done { border-color: #bfe3d2; background: #fbfefc; }

/* 工序多选（账号岗位设置） */
.pick-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fafbfc; }
.pick-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pick-row + .pick-row { margin-top: 8px; }
.pick-line { font-size: 12px; color: #9aa1ab; width: 52px; flex: none; }
.pick {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  border-radius: 999px; padding: 5px 13px; font-size: 13px; cursor: pointer;
  font-family: inherit; transition: .12s;
}
.pick:hover { border-color: var(--primary); }
.pick.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.pick.on::before { content: '✓ '; }

/* 手机端搜索区的扫码按钮 */
.m-search { display: flex; gap: 8px; align-items: center; }
.m-search input { flex: 1; }
.m-search .scan-btn {
  flex: none;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: #fff;
  font-size: 14px;
  font-family: inherit;
  color: var(--primary);
  font-weight: 500;
  cursor: pointer;
}

/* 全屏扫码遮罩 */
.scan-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .88);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}
.scan-mask video {
  width: 78vw;
  max-width: 420px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, .5);
}
.scan-mask .scan-tip { color: #fff; font-size: 14px; opacity: .9; text-align: center; line-height: 1.7; }
.scan-mask .scan-cancel {
  border: 1px solid rgba(255, 255, 255, .45);
  background: transparent;
  color: #fff;
  padding: 9px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-family: inherit;
}

.stepper { display: flex; align-items: center; gap: 0; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.stepper button {
  width: 52px; height: 50px;
  border: 0; background: #f7f8fa;
  font-size: 22px; color: var(--text);
  cursor: pointer; font-family: inherit;
  line-height: 1;
}
.stepper button:active { background: var(--line); }
.stepper input {
  flex: 1;
  border: 0;
  border-left: 1px solid var(--line-2);
  border-right: 1px solid var(--line-2);
  border-radius: 0;
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  height: 50px;
  min-height: 50px;
  padding: 0;
}
.stepper input:focus { box-shadow: none; }
.quick { display: flex; gap: 8px; margin-top: 8px; }
.quick button {
  flex: 1; height: 34px; border: 1px solid var(--line-2); background: #fff;
  border-radius: 8px; font-size: 13px; color: var(--muted); font-family: inherit; cursor: pointer;
}
.quick button:active { border-color: var(--primary); color: var(--primary); }

.m-label { font-size: 13px; color: var(--muted); margin: 16px 0 8px; }
.m-label:first-child { margin-top: 0; }

.log-item { background: #fff; border: 1px solid #e8ebef; border-radius: 10px; padding: 11px 13px; display: flex; align-items: center; gap: 10px; }
.log-item .l { flex: 1; min-width: 0; }
.log-item .t1 { font-size: 14px; font-weight: 500; }
.log-item .t2 { font-size: 12px; color: var(--muted); margin-top: 2px; }
.log-item .q { font-size: 18px; font-weight: 600; color: var(--primary); font-variant-numeric: tabular-nums; }
.log-sum { background: var(--primary-soft); color: var(--primary-dark); border-radius: 10px; padding: 12px 14px; font-size: 14px; display: flex; }
.log-sum .spacer { flex: 1; }
.log-sum b { font-size: 20px; font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .page { padding: 12px 12px 60px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar .brand { font-size: 14px; }
  .panel-head { padding: 10px 12px; }
  .panel-body { padding: 12px; }
}

/* ===== 测试模式：账号快选（登录页、后台换账号共用） ===== */
.q-grp { font-size: 11.5px; color: #9aa1ab; margin: 12px 0 6px; letter-spacing: .4px; }
.q-grp:first-child { margin-top: 0; }
.swap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 8px; }
.swap-acc { display: block; width: 100%; min-width: 0; text-align: left; font: inherit; line-height: 1.35;
  cursor: pointer; background: #fff; border: 1px solid #dfe3e8; border-radius: 10px; padding: 9px 11px;
  transition: border-color .12s, background .12s; }
.swap-acc:hover { border-color: var(--primary); background: #f7fbff; }
.swap-acc.on { border-color: var(--primary); background: #eef6ff; }
.swap-acc .an { display: block; font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.3; }
.swap-acc .au { font-size: 11.5px; color: #9aa1ab; font-weight: 400; margin-left: 5px; }
.swap-acc .ad { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) {
  .swap-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
}

/* 手机报工列表顶部的一句话说明（工人只看到自己报过的单） */
.m-note { font-size: 12px; color: #9aa1ab; background: #f4f5f7; border-radius: 9px;
  padding: 8px 11px; line-height: 1.5; text-align: center; }

/* ===== 扫码引导（摄像头打不开时的出口） ===== */
.scan-warn { background: var(--warn-soft); border: 1px solid #f0d8ac; color: #8a5a10;
  border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.75; }
.scan-help-h { font-size: 14px; font-weight: 600; color: var(--text); margin: 18px 0 6px; }
.scan-help-p { font-size: 13px; color: var(--muted); line-height: 1.75; margin: 0 0 8px; }
.help-inp { width: 100%; height: 46px; border: 1px solid var(--line-2); border-radius: 10px;
  padding: 0 12px; font-size: 16px; color: var(--text); background: #fff; outline: none; }
.help-inp:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(24,95,165,.12); }
.help-btn { width: 100%; height: 46px; margin-top: 9px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line-2); background: #fff; color: var(--text); font-size: 15px; font-weight: 500; }
.help-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.help-btn:active { opacity: .85; }

/* 后台「手机端」弹窗里的 https 地址块（网页扫码用） */
.qr-secure { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.qr-secure-h { font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.qr-secure-p { font-size: 12px; color: var(--muted); line-height: 1.7; margin: 6px 0 8px; }

/* ===== 物料台账 ===== */
.subtabs { display: inline-flex; gap: 4px; background: #eef0f3; padding: 3px; border-radius: 9px; }
.subtabs button {
  font: inherit; font-size: 13px; height: 28px; padding: 0 14px; border: 0; border-radius: 7px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.subtabs button.on { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(16,24,40,.08); }

.mat-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.mat-bar .grow { flex: 1; min-width: 80px; }
.mat-bar input, .mat-bar select { width: auto; min-width: 120px; }

.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
th.chk, td.chk { text-align: center; }
th.chk input, td.chk input { width: 15px; height: 15px; cursor: pointer; accent-color: var(--primary); }

.img-cell { cursor: pointer; text-align: center; }
.mat-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line-2); display: block; margin: 0 auto; }
.mat-noimg { display: inline-block; padding: 3px 6px; font-size: 11.5px; color: var(--dim);
  border: 1px dashed var(--line-2); border-radius: 6px; }
.img-cell:hover .mat-noimg { color: var(--primary); border-color: var(--primary); }

.req-tbl th, .req-tbl td, .pk-tbl th, .pk-tbl td { white-space: nowrap; font-size: 12.5px; padding: 7px 8px; }
.req-tbl tbody tr:hover, .pk-tbl tbody tr:hover { background: #fafbfc; }
.req-tbl tbody tr { cursor: pointer; }

.req-line {
  display: grid; align-items: center; gap: 6px; margin-bottom: 8px;
  grid-template-columns: minmax(120px, 1.6fr) minmax(90px, 1fr) 78px 60px 78px 82px 28px;
}
.req-line input { min-width: 0; width: 100%; }
.req-line .l_amt { text-align: right; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.req-line .l_del { width: 28px; height: 34px; border: 1px solid var(--line-2); background: #fff; border-radius: 7px;
  color: var(--dim); cursor: pointer; font-size: 16px; line-height: 1; }
.req-line .l_del:hover { color: var(--danger); border-color: #e8c4c0; background: var(--danger-soft); }

tr.pick-detail > td { background: #f7f9fb; padding: 0 !important; }
.mini-tbl { width: 100%; }
.mini-tbl th, .mini-tbl td { font-size: 12px; padding: 6px 10px; background: transparent; border-bottom: 1px solid var(--line); }
.mini-tbl thead th { color: var(--muted); font-weight: 500; }

/* 申购表列多，操作列钉在右边，横着滚也不会跑丢 */
.req-tbl th:last-child, .req-tbl td:last-child {
  position: sticky; right: 0; background: var(--panel);
  box-shadow: -7px 0 8px -7px rgba(16,24,40,.18);
}
.req-tbl tbody tr:hover td:last-child { background: #fafbfc; }
.req-tbl .btn.sm { padding: 0 7px; }
.req-tbl th, .req-tbl td { padding: 7px 6px; }

/* ---------- 皮仓（皮革仓） ---------- */
.lv-chk { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: #475569; cursor: pointer; white-space: nowrap; }
.lv-tip { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.lv-ta {
  width: 100%; min-height: 200px; padding: 10px 11px; border: 1px solid var(--line-2); border-radius: 8px;
  font-family: Consolas, Menlo, monospace; font-size: 12.5px; line-height: 1.5; resize: vertical; outline: none;
}
.lv-ta:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(24,95,165,.12); }

/* 表格里的可编辑格：平时看着像普通数字，点进去才像输入框 */
.lv-inp {
  width: 100%; min-width: 0; height: 28px; padding: 0 6px; border: 1px solid transparent; border-radius: 6px;
  background: transparent; font-family: inherit; font-size: 13px; color: var(--text); outline: none;
}
.lv-inp:hover { border-color: var(--line-2); background: #fff; }
.lv-inp:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(24,95,165,.12); }
.lv-inp.num { text-align: right; font-variant-numeric: tabular-nums; }
.lv-inp.manual { background: var(--warn-soft); border-color: #efdcb4; font-weight: 600; }
.lv-inp select, select.lv-inp { padding: 0 2px; }

.lv-tbl th, .lv-tbl td { white-space: nowrap; }
.lv-tbl th:last-child, .lv-tbl td:last-child { position: static; box-shadow: none; background: transparent; }
.lv-tbl tbody tr.on { background: #f3f8fd; }
.lv-tbl tbody tr.on td:last-child { background: #f3f8fd; }
.lv-tbl .lv-no { font-size: 12px; color: var(--muted); white-space: normal; line-height: 1.45; }

.lv-u { font-style: normal; font-size: 11px; color: var(--dim); margin-left: 1px; }
.lv-pill {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 20px;
  background: var(--ok-soft); color: var(--ok); font-size: 11px; line-height: 18px; white-space: nowrap;
}
.lv-more {
  display: inline-block; margin-left: 5px; padding: 0 6px; height: 20px; border-radius: 20px;
  border: 1px solid var(--line-2); background: #fff; color: var(--primary); font-size: 11px;
  font-family: inherit; cursor: pointer; line-height: 18px;
}
.lv-more:hover { background: var(--primary-soft); border-color: var(--primary); }

/* 皮仓底部操作条：跟表格一起滚到底 */
.lv-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px; border-top: 1px solid var(--line); background: #fbfcfd;
  position: sticky; bottom: 0; z-index: 3;
}
.lv-foot-l, .lv-foot-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lv-note { font-size: 12.5px; color: var(--muted); }
.lv-note b { color: var(--text); }
.lv-foot .btn.primary { min-height: 34px; padding: 0 16px; }

.lv-sk th, .lv-sk td { white-space: nowrap; }
.lv-sk .lv-inp { height: 30px; }

/* ---------- 手机皮仓收料点数 ---------- */
.pl-body { background: #f2f4f7; }
.pl-back { color: #fff; font-size: 22px; line-height: 1; padding: 0 6px 0 0; background: none; border: 0; }
.pl-batch {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  background: #fff; border-bottom: 1px solid var(--line);
}
.pl-batch label { font-size: 13px; color: var(--muted); white-space: nowrap; }
.pl-batch input {
  flex: 1; min-width: 0; height: 36px; padding: 0 10px; border: 1px solid var(--line-2);
  border-radius: 7px; font: inherit; font-size: 15px; outline: none;
}
.pl-batch input:focus { border-color: var(--primary); }
.pl-batch button {
  width: 38px; height: 36px; border: 1px solid var(--line-2); background: #fff;
  border-radius: 7px; font-size: 16px; color: var(--primary);
}

.pl-card { margin: 10px; padding: 12px; background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.pl-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pl-cats button {
  flex: 1 1 auto; min-width: 60px; height: 40px; padding: 0 8px;
  border: 1px solid var(--line-2); border-radius: 8px; background: #fafbfc;
  color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600;
}
.pl-cats button i { display: block; font-style: normal; font-size: 10px; font-weight: 400; color: var(--muted); }
.pl-cats button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pl-cats button.on i { color: rgba(255,255,255,.8); }

.pl-row { display: flex; gap: 8px; margin-bottom: 9px; }
.pl-fld { min-width: 0; }
.pl-fld.grow { flex: 1; }
.pl-fld.w90 { width: 40%; max-width: 150px; }
.pl-fld label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.pl-fld .pl-opt { font-weight: 400; color: #b3b9c2; }
.pl-fld input {
  width: 100%; height: 44px; padding: 0 10px; border: 1px solid var(--line-2);
  border-radius: 8px; font: inherit; font-size: 16px; outline: none; background: #fff;
}
.pl-fld input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(24,95,165,.1); }
.pl-fld input[type=number] { font-variant-numeric: tabular-nums; }

.pl-calc {
  display: flex; align-items: center; justify-content: space-between;
  margin: 4px 0 10px; padding: 10px 12px; border-radius: 8px; background: #eef6ff;
  font-size: 13px; color: #3c5b7a;
}
.pl-calc b { font-size: 19px; color: var(--primary); font-variant-numeric: tabular-nums; }
.pl-add {
  width: 100%; height: 46px; border: 0; border-radius: 9px;
  background: var(--primary); color: #fff; font: inherit; font-size: 16px; font-weight: 600;
}
.pl-add:disabled { opacity: .5; }

.pl-sum {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 0 10px;
  background: #dfe3e8; border: 1px solid #dfe3e8; border-radius: 10px; overflow: hidden;
}
.pl-sum div { padding: 8px 4px; background: #fff; text-align: center; }
.pl-sum span { display: block; font-size: 11px; color: var(--muted); }
.pl-sum b { display: block; margin-top: 2px; font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }

.pl-list { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.pl-empty { padding: 40px 12px; text-align: center; color: var(--muted); font-size: 13.5px; line-height: 1.8; }
.pl-item { padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.pl-item.on { border-color: var(--primary); background: #f6fbff; }
.pl-itop { display: flex; align-items: center; gap: 7px; }
.pl-itop b { font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-cat { padding: 1px 7px; border-radius: 20px; font-size: 11px; background: #eef6ff; color: var(--primary); white-space: nowrap; }
.pl-cat.real { background: #fdf1e6; color: #b5651d; }
.pl-qty { font-size: 15px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.pl-imeta { margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.5; word-break: break-all; }
.pl-iops { display: flex; gap: 8px; justify-content: flex-end; margin-top: 7px; }
.pl-iops button {
  padding: 3px 14px; border: 1px solid var(--line-2); border-radius: 6px;
  background: #fff; color: var(--primary); font: inherit; font-size: 12.5px;
}
.pl-iops button[data-act=del] { color: var(--danger); }
.pl-tip { margin: 2px 12px 90px; padding: 10px 12px; border-radius: 8px; background: #fff8e9; color: #8a6d3b; font-size: 12px; line-height: 1.7; }

/* ---------- 采购登记台账 ---------- */
.ledger-tbl select.ld-pay {
  width: 88px; height: 26px; padding: 0 4px; border: 1px solid var(--line-2);
  border-radius: 5px; font: inherit; font-size: 12px; color: var(--text); background: #fff;
}
.ledger-tbl select.ld-pay:focus { border-color: var(--primary); outline: none; }
.ledger-tbl td.ld-price { cursor: pointer; border-bottom: 1px dashed var(--line-2); }
.ledger-tbl td.ld-price:hover { color: var(--primary); border-bottom-color: var(--primary); }
