/* ================================================================
   订单二维码流转工单系统 — 样式表
   浅色专业风格：深墨蓝侧栏 + 浅灰工作区 + 状态色语义
   ================================================================ */

:root {
  --ink: #0f172a;
  --ink-2: #1e293b;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-soft: #eff4ff;
  --bg: #f4f6fa;
  --card: #ffffff;
  --line: #e4e9f2;
  --line-strong: #cbd5e1;
  --text: #17233d;
  --muted: #64748b;
  --muted-2: #94a3b8;

  --st-wait: #94a3b8;
  --st-run: #2563eb;
  --st-done: #16a34a;
  --st-skip: #d97706;
  --st-over: #dc2626;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px -8px rgba(15, 23, 42, .12);
  --shadow-lg: 0 8px 32px -8px rgba(15, 23, 42, .22);
  --side-w: 224px;
}

* { 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: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

.sidebar {
  width: var(--side-w);
  flex: 0 0 var(--side-w);
  background: var(--ink);
  color: #cbd5e1;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 30;
}

.brand {
  padding: 20px 20px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #1e3a8a);
  display: grid; place-items: center;
  flex: 0 0 32px;
}
.brand-name { font-size: 14px; font-weight: 600; color: #fff; letter-spacing: .5px; }
.brand-sub { font-size: 11px; color: #64748b; letter-spacing: 1px; }

.nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.nav-group-label {
  font-size: 11px; color: #475569; padding: 12px 10px 6px; letter-spacing: 1px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px;
  color: #cbd5e1; font-size: 13.5px; cursor: pointer;
  margin-bottom: 2px; transition: background .15s, color .15s;
  user-select: none;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 500; }
.nav-item .badge-dot {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--st-over); color: #fff; border-radius: 9px;
  font-size: 11px; line-height: 18px; text-align: center; font-weight: 600;
}
.nav-item svg { flex: 0 0 16px; opacity: .9; }

.side-foot {
  padding: 12px 16px 16px; border-top: 1px solid rgba(255,255,255,.07);
  font-size: 12px; color: #64748b;
}
.side-user { display: flex; align-items: center; gap: 8px; color: #cbd5e1; font-size: 13px; }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; background: #334155;
  display: grid; place-items: center; font-size: 12px; color: #e2e8f0; font-weight: 600;
}
.side-user .logout { margin-left: auto; color: #94a3b8; cursor: pointer; font-size: 12px; }
.side-user .logout:hover { color: #fff; }

.main {
  margin-left: var(--side-w);
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
}

.topbar {
  height: 60px; background: rgba(255,255,255,.86); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px; position: sticky; top: 0; z-index: 20;
}
.page-title { font-size: 16px; font-weight: 600; color: var(--text); }
.page-sub { font-size: 12px; color: var(--muted); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.content { padding: 22px 24px 40px; max-width: 1560px; width: 100%; }

/* ---------------- 通用组件 ---------------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card-head {
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.card-title { font-size: 14px; font-weight: 600; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--text);
  font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: all .15s; line-height: 1;
}
.btn:hover { border-color: var(--muted-2); background: #fafbfc; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: var(--primary); border-color: var(--primary); color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { color: var(--st-over); border-color: #fbd5d5; background: #fff7f7; }
.btn-danger:hover { background: #fee2e2; border-color: #fca5a5; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: #eef2f7; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 6px; }
.btn-lg { height: 44px; padding: 0 22px; font-size: 15px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-icon { width: 34px; padding: 0; }

.input, .select, .textarea {
  height: 36px; width: 100%; padding: 0 11px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: #fff; color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input.input, textarea.textarea { -webkit-appearance: none; appearance: none; background-color: #fff; }
.input:-webkit-autofill, .input:-webkit-autofill:hover, .input:-webkit-autofill:focus,
.textarea:-webkit-autofill, .m-days-input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  -webkit-text-fill-color: var(--text);
}
.textarea { height: auto; padding: 9px 11px; resize: vertical; min-height: 76px; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29,78,216,.1);
}
.input::placeholder { color: var(--muted-2); }

.field { margin-bottom: 16px; }
.field-label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.field-label .req { color: var(--st-over); margin-left: 2px; }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.field-error { font-size: 12px; color: var(--st-over); margin-top: 5px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; font-weight: 500; line-height: 1;
  border: 1px solid transparent; white-space: nowrap;
}
.badge-wait { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }
.badge-run { background: #eff6ff; color: #1d4ed8; border-color: #dbeafe; }
.badge-done { background: #f0fdf4; color: #15803d; border-color: #dcfce7; }
.badge-skip { background: #fffbeb; color: #b45309; border-color: #fef3c7; }
.badge-over { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.badge-cancel { background: #f8fafc; color: #94a3b8; border-color: #e2e8f0; }
.badge-ghost { background: #fff; color: var(--muted); border-color: var(--line); }

.tag-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl thead th {
  text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px;
  background: #fafbfd; padding: 10px 14px; border-bottom: 1px solid var(--line);
  white-space: nowrap; position: sticky; top: 0;
}
table.tbl tbody td { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
table.tbl tbody tr { transition: background .12s; cursor: pointer; }
table.tbl tbody tr:hover { background: #f8fafc; }
table.tbl tbody tr.row-overdue { background: #fff8f8; }
table.tbl tbody tr.row-overdue:hover { background: #fef2f2; }
table.tbl tbody tr:last-child td { border-bottom: none; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.8px; }
.nowrap { white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 600; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.red { color: var(--st-over); }
.green { color: var(--st-done); }
.blue { color: var(--st-run); }

/* ---------------- 搜索区 ---------------- */
.search-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 18px; }
.search-box { position: relative; flex: 1; min-width: 260px; max-width: 520px; }
.search-box .input { padding-left: 34px; height: 38px; }
.search-box svg { position: absolute; left: 11px; top: 11px; color: var(--muted-2); }

/* ---------------- 统计卡 ---------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 18px; box-shadow: var(--shadow);
}
.stat-label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 26px; font-weight: 650; letter-spacing: -.5px; margin-top: 4px; color: var(--ink); }
.stat-value.red { color: var(--st-over); }
.stat-foot { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }

/* ---------------- 工序时间轴 ---------------- */
.timeline { padding: 6px 0 2px; }
.tl-item { display: flex; gap: 14px; position: relative; padding-bottom: 4px; }
.tl-rail { flex: 0 0 26px; display: flex; flex-direction: column; align-items: center; }
.tl-dot {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 600; background: #fff; border: 2px solid var(--line-strong);
  color: var(--muted); z-index: 1; flex: 0 0 22px;
}
.tl-line { width: 2px; flex: 1; background: #eef2f7; min-height: 14px; }
.tl-item:last-child .tl-line { display: none; }
.tl-dot.done { background: var(--st-done); border-color: var(--st-done); color: #fff; }
.tl-dot.run { background: var(--st-run); border-color: var(--st-run); color: #fff; box-shadow: 0 0 0 4px rgba(37,99,235,.12); }
.tl-dot.skip { background: var(--st-skip); border-color: var(--st-skip); color: #fff; }
.tl-dot.over { background: var(--st-over); border-color: var(--st-over); color: #fff; box-shadow: 0 0 0 4px rgba(220,38,38,.12); }
.tl-dot.removed { background: #f8fafc; border-style: dashed; color: var(--muted-2); }

.tl-body { flex: 1; padding-bottom: 16px; min-width: 0; }
.tl-row1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.tl-name.dim { color: var(--muted); font-weight: 500; }
.tl-meta { font-size: 12.5px; color: var(--muted); margin-top: 4px; display: flex; gap: 14px; flex-wrap: wrap; }
.tl-meta b { font-weight: 500; color: var(--ink-2); }
.tl-note {
  margin-top: 7px; font-size: 12.5px; color: #b45309; background: #fffbeb;
  border: 1px solid #fef3c7; border-radius: 6px; padding: 5px 9px; display: inline-block;
}
.tl-note.red { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.tl-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }

/* ---------------- 看板 ---------------- */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.board-col {
  flex: 0 0 246px; background: #eef2f7; border-radius: var(--radius);
  border: 1px solid var(--line); display: flex; flex-direction: column; max-height: calc(100vh - 210px);
}
.board-col-head {
  padding: 11px 13px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 7px; position: sticky; top: 0;
  background: #eef2f7; border-radius: var(--radius) var(--radius) 0 0;
}
.board-col-name { font-size: 13.5px; font-weight: 600; }
.board-count {
  font-size: 11.5px; color: var(--muted); background: #fff; border: 1px solid var(--line);
  border-radius: 20px; padding: 0 7px; height: 19px; line-height: 18px;
}
.board-col-over { background: var(--st-over); color: #fff; border-color: var(--st-over); }
.board-col-body { padding: 9px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.board-card {
  background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 10px 11px;
  cursor: pointer; transition: box-shadow .15s, transform .15s; box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.board-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.board-card.over { border-color: #fecaca; background: #fff8f8; }
.bc-no { font-family: ui-monospace, monospace; font-size: 11.5px; color: var(--muted); }
.bc-name { font-size: 13.5px; font-weight: 600; margin: 2px 0 4px; }
.bc-foot { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }

/* ---------------- 工序配置 ---------------- */
.proc-list { padding: 8px; }
.proc-head {
  display: grid; grid-template-columns: 18px 26px 148px 1fr 104px 62px auto;
  gap: 12px; padding: 6px 12px 8px;
  font-size: 12px; color: var(--muted-2); letter-spacing: .3px;
}
.proc-item {
  display: grid;
  grid-template-columns: 18px 26px 148px 1fr 104px 62px auto;
  align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  margin-bottom: 8px; transition: box-shadow .15s, border-color .15s, opacity .15s;
}
.proc-item.dragging { opacity: .45; border-style: dashed; }
.proc-item.drag-over { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29,78,216,.1); }
.proc-item.inactive { opacity: .55; background: #fafbfc; }
.drag-handle { cursor: grab; color: var(--muted-2); display: flex; padding: 2px; }
.drag-handle:active { cursor: grabbing; }
.proc-seq {
  width: 26px; height: 26px; border-radius: 7px; background: #f1f5f9; color: var(--muted);
  display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: 0 0 26px;
}
.proc-name { font-size: 14px; font-weight: 600; min-width: 0; }
.proc-name input {
  border: 1px solid transparent; background: transparent; font-size: 14px; font-weight: 600;
  padding: 4px 6px; border-radius: 6px; width: 100%; color: inherit; cursor: text;
}
.proc-name input:hover { background: #f8fafc; border-color: #eef2f7; }
.proc-name input:focus { background: #fff; border-color: var(--primary); outline: none; }
.proc-flags { display: flex; align-items: center; gap: 16px; font-size: 12.5px; color: var(--muted); justify-self: start; }
.proc-owners { font-size: 12.5px; }
.chip {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; margin: 2px 4px 2px 0;
  background: var(--primary-soft); color: var(--primary); border-radius: 5px; font-size: 12px;
}

/* switch */
.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; gap: 7px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 34px; height: 20px; border-radius: 10px; background: #cbd5e1; transition: background .18s; position: relative;
}
.switch-track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track::after { transform: translateX(14px); }
.switch input:disabled + .switch-track { opacity: .5; }

.days-input {
  width: 60px; height: 28px; text-align: center; border: 1px solid var(--line-strong);
  border-radius: 6px; font-size: 12.5px;
}

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.42); backdrop-filter: blur(2px);
  display: grid; place-items: center; z-index: 100; padding: 20px; animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: #fff; border-radius: 14px; box-shadow: 0 24px 64px -12px rgba(15,23,42,.4);
  width: 100%; max-width: 520px; max-height: 88vh; overflow: auto; animation: pop .18s ease;
}
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0 } to { transform: none; opacity: 1 } }
.modal-head { padding: 18px 20px 0; font-size: 16px; font-weight: 650; }
.modal-body { padding: 16px 20px; }
.modal-foot { padding: 0 20px 18px; display: flex; gap: 10px; justify-content: flex-end; }

/* ---------------- toast ---------------- */
.toast-host {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--ink); color: #fff; padding: 9px 18px; border-radius: 9px;
  font-size: 13.5px; box-shadow: var(--shadow-lg); animation: toastIn .2s ease;
  max-width: 76vw;
}
.toast.err { background: #b91c1c; }
.toast.ok { background: #15803d; }
@keyframes toastIn { from { transform: translateY(-10px); opacity: 0 } to { transform: none; opacity: 1 } }

/* ---------------- 空态 / 加载 ---------------- */
.empty { padding: 56px 20px; text-align: center; color: var(--muted); }
.empty-icon { width: 44px; height: 44px; margin: 0 auto 12px; opacity: .35; }
.empty-title { font-size: 14px; color: var(--text); margin-bottom: 4px; }
.loading { padding: 48px; text-align: center; color: var(--muted); }
.spinner {
  width: 22px; height: 22px; border: 2.5px solid #e2e8f0; border-top-color: var(--primary);
  border-radius: 50%; margin: 0 auto 10px; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

/* ---------------- 登录页 ---------------- */
.login-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr;
  background: var(--bg);
}
.login-left {
  background: radial-gradient(1200px 600px at 10% 0%, #1e3a8a 0%, #0f172a 55%, #0b1220 100%);
  color: #e2e8f0; padding: 56px; display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
}
.login-left::after {
  content: ''; position: absolute; width: 520px; height: 520px; right: -180px; bottom: -220px;
  background: radial-gradient(circle, rgba(37,99,235,.35), transparent 65%); border-radius: 50%;
}
.login-left h1 { font-size: 30px; line-height: 1.35; margin: 0 0 14px; font-weight: 650; letter-spacing: -.5px; }
.login-left p { color: #94a3b8; font-size: 14.5px; max-width: 440px; margin: 0 0 30px; line-height: 1.9; }
.login-points { display: flex; flex-direction: column; gap: 14px; position: relative; z-index: 1; }
.login-point { display: flex; gap: 11px; align-items: flex-start; font-size: 13.5px; color: #cbd5e1; }
.login-point .dot {
  width: 22px; height: 22px; border-radius: 6px; background: rgba(37,99,235,.2);
  border: 1px solid rgba(96,165,250,.35); display: grid; place-items: center; flex: 0 0 22px;
  color: #93c5fd; font-size: 11px; font-weight: 600;
}
.login-right { display: grid; place-items: center; padding: 40px; }
.login-card { width: 100%; max-width: 372px; }
.login-card h2 { font-size: 21px; margin: 0 0 6px; font-weight: 650; }
.login-card .tip { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.tabs { display: flex; gap: 4px; background: #eef2f7; padding: 4px; border-radius: 9px; margin-bottom: 22px; }
.tab {
  flex: 1; text-align: center; padding: 7px 0; border-radius: 6px; font-size: 13.5px;
  color: var(--muted); cursor: pointer; transition: all .15s; user-select: none;
}
.tab.active { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(15,23,42,.1); }
.demo-hint {
  margin-top: 20px; padding: 12px 14px; background: #f8fafc; border: 1px dashed var(--line-strong);
  border-radius: 9px; font-size: 12.5px; color: var(--muted); line-height: 1.9;
}
.demo-hint b { color: var(--ink-2); font-weight: 600; }

/* ---------------- 详情页 ---------------- */
.detail-head { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.detail-no { font-size: 20px; font-weight: 650; font-family: ui-monospace, monospace; letter-spacing: .3px; }
.kv { display: grid; grid-template-columns: 76px 1fr; gap: 7px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text); }
.alert {
  display: flex; align-items: center; gap: 10px; padding: 11px 15px; border-radius: 9px;
  font-size: 13.5px; margin-bottom: 16px; border: 1px solid transparent;
}
.alert-red { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.alert-amber { background: #fffbeb; border-color: #fef3c7; color: #b45309; }
.alert-gray { background: #f8fafc; border-color: var(--line); color: var(--muted); }
.progress-line { height: 6px; background: #eef2f7; border-radius: 3px; overflow: hidden; margin-top: 12px; }
.progress-line > i { display: block; height: 100%; background: linear-gradient(90deg, #2563eb, #3b82f6); border-radius: 3px; }

/* ---------------- 打印页 ---------------- */
.print-toolbar {
  position: sticky; top: 0; background: #fff; border-bottom: 1px solid var(--line);
  padding: 10px 20px; display: flex; gap: 10px; align-items: center; z-index: 10;
}
.print-area {
  width: 210mm; min-height: 148mm; margin: 24px auto; background: #fff;
  box-shadow: var(--shadow-lg); padding: 12mm 14mm; position: relative;
}
.print-head { display: flex; align-items: flex-start; border-bottom: 2px solid var(--ink); padding-bottom: 8px; }
.print-company { font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.print-doc-type { font-size: 12px; color: var(--muted); margin-top: 2px; letter-spacing: 3px; }
.print-code { margin-left: auto; text-align: right; }
.print-code .no { font-family: ui-monospace, monospace; font-size: 15px; font-weight: 700; }
.print-code .tc { font-family: ui-monospace, monospace; font-size: 11px; color: var(--muted); letter-spacing: 1px; }
.print-body { display: grid; grid-template-columns: 1fr 108px; gap: 12mm; margin-top: 6mm; }
.print-kv { display: grid; grid-template-columns: 62px 1fr 62px 1fr; gap: 5px 8px; font-size: 12.5px; }
.print-kv dt { color: var(--muted); }
.print-kv dd { margin: 0; border-bottom: 1px dotted var(--line-strong); padding-bottom: 2px; }
.print-qr { text-align: center; }
.print-qr img { width: 40mm; height: 40mm; display: block; }
.print-qr .tip { font-size: 10px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.print-foot { margin-top: 6mm; border-top: 1px solid var(--line); padding-top: 4mm; font-size: 11px; color: var(--muted); display: flex; }
.print-sign { margin-left: auto; }

@media print {
  @page { size: A5 landscape; margin: 0; }
  body { background: #fff; }
  .print-toolbar { display: none !important; }
  .print-area { box-shadow: none; margin: 0; width: auto; min-height: auto; padding: 8mm 10mm; }
}

/* ---------------- 手机扫码端 ---------------- */
.m {
  max-width: 480px; margin: 0 auto; min-height: 100vh;
  background: #f4f6fa; padding-bottom: 108px; position: relative;
}
.m-topbar {
  background: var(--ink); color: #fff; padding: 14px 16px;
  display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 10;
}
.m-topbar .t { font-size: 15px; font-weight: 600; }
.m-topbar .who { margin-left: auto; font-size: 12px; color: #94a3b8; }
.m-body { padding: 12px; }
.m-card {
  background: #fff; border-radius: 14px; padding: 15px; border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(15,23,42,.04); margin-bottom: 12px;
}
.m-order-no { font-family: ui-monospace, monospace; font-size: 15px; font-weight: 650; }
.m-cust { font-size: 15px; font-weight: 600; margin-top: 6px; }
.m-prod { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.m-kv { display: grid; grid-template-columns: 66px 1fr; gap: 6px 10px; font-size: 13px; margin-top: 10px; }
.m-kv dt { color: var(--muted); }
.m-kv dd { margin: 0; }

.m-current {
  background: linear-gradient(160deg, #1d4ed8, #1e3a8a); color: #fff; border-radius: 16px;
  padding: 18px; margin-bottom: 12px; box-shadow: 0 10px 30px -12px rgba(29,78,216,.6);
}
.m-current.over { background: linear-gradient(160deg, #dc2626, #991b1b); box-shadow: 0 10px 30px -12px rgba(220,38,38,.55); }
.m-cur-label { font-size: 12px; opacity: .82; letter-spacing: 1px; }
.m-cur-name { font-size: 26px; font-weight: 700; margin: 4px 0 2px; letter-spacing: .5px; }
.m-cur-meta { font-size: 12.5px; opacity: .9; display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.m-cur-seq { font-size: 12px; opacity: .8; }

.m-actions {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 480px;
  background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 9px; z-index: 20;
}
.m-btn {
  height: 50px; border-radius: 12px; border: none; font-size: 16.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  transition: opacity .15s, transform .1s; width: 100%;
}
.m-btn:active { transform: scale(.985); }
.m-btn:disabled { opacity: .5; }
.m-btn-start { background: var(--primary); color: #fff; }
.m-btn-done { background: var(--st-done); color: #fff; }
.m-btn-skip { background: #fff; color: var(--muted); border: 1px solid var(--line-strong); height: 42px; font-size: 14.5px; font-weight: 500; }

.m-block { text-align: center; padding: 44px 22px; }
.m-block-icon {
  width: 62px; height: 62px; border-radius: 50%; background: #fef2f2; color: var(--st-over);
  display: grid; place-items: center; margin: 0 auto 18px;
}
.m-block-icon.ok { background: #f0fdf4; color: var(--st-done); }
.m-block-title { font-size: 18px; font-weight: 650; margin-bottom: 8px; }
.m-block-text { font-size: 14px; color: var(--muted); line-height: 1.8; }
.m-block-actions { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }

.m-steps { display: flex; gap: 3px; margin-top: 12px; }
.m-step { flex: 1; height: 4px; border-radius: 2px; background: rgba(255,255,255,.25); }
.m-step.done { background: rgba(255,255,255,.95); }
.m-step.cur { background: #93c5fd; }

.m-sheet { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 60; display: flex; align-items: flex-end; }
.m-sheet-inner {
  background: #fff; width: 100%; max-width: 480px; margin: 0 auto;
  border-radius: 18px 18px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
  animation: sheetUp .22s ease;
}
@keyframes sheetUp { from { transform: translateY(100%) } to { transform: none } }
.m-sheet-title { font-size: 17px; font-weight: 650; margin-bottom: 4px; }
.m-sheet-sub { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.m-days-row { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.m-days-input {
  width: 96px; height: 48px; text-align: center; font-size: 24px; font-weight: 650;
  border: 1.5px solid var(--line-strong); border-radius: 10px; outline: none;
}
.m-days-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29,78,216,.1); }
.m-days-unit { font-size: 15px; color: var(--muted); }
.m-quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.m-quick button {
  height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: #fff; font-size: 13.5px; color: var(--text); cursor: pointer;
}
.m-quick button.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600; }

/* 手机端工序流水 */
.m-flow { display: flex; flex-direction: column; gap: 1px; max-height: 240px; overflow-y: auto; }
.m-flow-row {
  display: grid; grid-template-columns: 1fr 62px 56px; gap: 8px;
  align-items: center; padding: 9px 2px; font-size: 13px;
  border-bottom: 1px dashed #eef2f7;
}
.m-flow-row:last-child { border-bottom: none; }
.m-flow-row .nm { color: var(--muted-2); }
.m-flow-row .st { font-size: 12px; color: var(--muted-2); text-align: right; }
.m-flow-row .tm { font-size: 11.5px; color: var(--muted-2); text-align: right; }
.m-flow-row.done .nm { color: var(--text); }
.m-flow-row.done .st { color: var(--st-done); }
.m-flow-row.run .nm { color: var(--primary); font-weight: 600; }
.m-flow-row.run .st { color: var(--st-run); font-weight: 600; }
.m-flow-row.skip .nm { color: var(--muted); }
.m-flow-row.skip .st { color: var(--st-skip); }

.m-login-card { margin: 40px 14px; }.m-hint { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 14px; line-height: 1.8; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  :root { --side-w: 64px; }
  .brand-name, .brand-sub, .nav-item span.lbl, .nav-group-label, .side-foot .uinfo { display: none; }
  .nav-item { justify-content: center; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-left { display: none; }
}
@media (max-width: 760px) {
  .content { padding: 14px 12px 32px; }
  .topbar { padding: 0 14px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .print-area { width: 100%; margin: 12px 0; }
}

/* ---------------- 微信登录 ---------------- */
.wx-btn {
  width: 100%; height: 46px; border: none; border-radius: 10px;
  background: #07c160; color: #fff; font-size: 16px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; transition: background .15s, transform .1s;
}
.wx-btn:hover { background: #06ad56; }
.wx-btn:active { transform: scale(.99); }

.or-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 0 16px; color: var(--muted-2); font-size: 12px;
}
.or-divider::before, .or-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--line);
}

.wx-user { display: flex; align-items: center; gap: 10px; }
.wx-user img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.wx-avatar-ph {
  width: 40px; height: 40px; border-radius: 50%; background: #e8f7ee; color: #07c160;
  display: grid; place-items: center; font-size: 11px; font-weight: 600;
}
