/* Custx 订单系统：克制、信息密、按钮够大 */
[hidden] { display: none !important; }
:root {
  --bg: #F4F5F7; --card: #FFFFFF; --ink: #1B1F24; --muted: #5B6470; --line: #DDE1E6; --line2: #EEF0F2;
  --brand: #0E6468; --brand-ink: #0B4F52; --brand-soft: #E3F0F0;
  --warn-bg: #FFF7DD; --warn-line: #F0D58A; --warn-ink: #6B4500;
  --err-bg: #FDECEA; --err-ink: #8A1F14; --ok-bg: #E8F5EE; --ok-ink: #145C36;
  --radius: 10px;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 15px; line-height: 1.55; }
a { color: var(--brand); }
a:hover { color: var(--brand-ink); }
h1 { font-size: 24px; margin: 0 0 6px; }
h2 { font-size: 17px; margin: 0 0 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* 顶栏 */
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 10px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--brand); text-decoration: none; font-size: 17px; white-space: nowrap; }
.search { flex: 1 1 260px; min-width: 0; }
.search input { width: 100%; height: 40px; border: 1px solid #C6CCD3; border-radius: 8px; padding: 0 12px; font: inherit; background: #F7F8FA; }
.me { display: flex; align-items: center; gap: 10px; }
.me form { margin: 0; }
.avatar { width: 34px; height: 34px; border-radius: 17px; background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.me-text { display: flex; flex-direction: column; line-height: 1.2; }
.me-text small { color: var(--muted); }
.link { background: none; border: 0; padding: 8px 4px; color: var(--brand); font: inherit; cursor: pointer; text-decoration: underline; min-height: 44px; }

/* 框架 */
.frame { display: flex; flex-wrap: wrap; min-height: calc(100vh - 61px); }
.side { flex: 1 1 170px; max-width: 210px; background: var(--card); border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.side a { display: block; padding: 11px 12px; border-radius: 8px; text-decoration: none; color: #2F363E; }
.side a.on { background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; }
.main { flex: 999 1 560px; min-width: 0; padding: 22px 26px 40px; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 760px) {
  .side { max-width: none; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .side a { white-space: nowrap; }
  .main { padding: 16px; }
}

/* 卡片与表单 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card.narrow { max-width: 460px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
input, select, textarea { height: 42px; border: 1px solid #C6CCD3; border-radius: 8px; padding: 0 10px; font: inherit; font-size: 15px; color: var(--ink); background: #FFF; }
textarea { height: auto; padding: 10px; }
.btn { height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid #C6CCD3; background: #FFF; font: inherit; font-size: 15px; cursor: pointer; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #FFF; font-weight: 700; }
.error { background: var(--err-bg); color: var(--err-ink); padding: 10px 12px; border-radius: 8px; margin: 0; }
.ok { background: var(--ok-bg); color: var(--ok-ink); padding: 10px 12px; border-radius: 8px; margin: 0; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 13px; padding: 9px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line2); }
tr.dim td { color: #8A929C; }
td.actions { display: flex; gap: 6px; }
td.actions form { margin: 0; }

/* 登录 */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.login-card h1 { color: var(--brand); }

/* 工作台 */
.head-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px; }
.head-row p { margin: 0; }
.todos { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.todo { display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--ink); min-height: 116px; }
.todo.warn { border-color: var(--warn-line); }
.todo .k { font-size: 13px; color: var(--muted); }
.todo .v { font-size: 30px; font-weight: 700; }
.todo.warn .v { color: #8A5A00; }
.todo .d { font-size: 13px; color: #444C56; }
.pipe { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.pipe .cell { display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; border-radius: 8px; background: #F7F8FA; border: 1px solid #E4E7EB; }
.pipe .cell.late { background: var(--warn-bg); border-color: var(--warn-line); }
.pipe .cell span { font-size: 13px; color: #444C56; }
.pipe .cell b { font-size: 22px; }
.pipe .cell small { font-size: 12px; color: #8A5A00; font-weight: 700; min-height: 1em; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 7px 0; border-bottom: 1px solid var(--line2); font-size: 14px; }
.feed time { color: var(--muted); margin-right: 12px; }

/* 导入结果 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stats div { background: #F7F8FA; border: 1px solid #E4E7EB; border-radius: 8px; padding: 12px; display: flex; flex-direction: column; }
.stats div.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.stats span { font-size: 13px; color: var(--muted); }
.stats b { font-size: 26px; }
a.btn { display: inline-flex; align-items: center; text-decoration: none; }
.btn.danger { border-color: #E5A79F; color: var(--err-ink); }
.pill { padding: 8px 14px; border-radius: 999px; background: #EEF0F3; font-weight: 700; }
.pill.warn { background: var(--warn-bg); color: #8A5A00; }
.tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #EEF0F3; color: #3D4550; margin-right: 4px; }
.tag.warn { background: #FFF1CC; color: var(--warn-ink); }
.hint { font-size: 13px; color: var(--brand-ink); margin: 4px 0 0; }

/* 核查 */
.review-grid { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.review-grid .shot { flex: 1 1 100%; min-width: 0; }
.review-grid .shot img { max-width: 1040px; }
.review-grid .shot img { width: 100%; border: 1px solid var(--line); border-radius: 8px; display: block; }
.noshot { padding: 18px; background: #F7F8FA; border-radius: 8px; color: var(--muted); }
.rawtext { white-space: pre-wrap; font-size: 13px; background: #F7F8FA; border: 1px solid #E4E7EB; border-radius: 8px; padding: 12px; margin: 10px 0 0; max-height: 420px; overflow: auto; }
.review-form { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.review-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; }
.review-head h2 { margin: 0; }
.flags { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.flags li { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 8px; padding: 8px 12px; display: flex; flex-direction: column; color: var(--warn-ink); }
.flags li span { font-size: 13px; }
.note { background: #F7F8FA; border-radius: 8px; padding: 10px 12px; margin: 0; white-space: pre-wrap; }
.note b { margin-right: 8px; }
fieldset.piece { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 10px; margin: 0; }
fieldset.piece legend { font-weight: 700; padding: 0 6px; }
.slot { border-top: 1px dashed var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.slot-name { font-weight: 700; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; }
label.check input { height: 20px; width: 20px; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* 订单详情 */
.detail-grid { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.detail-grid > section { flex: 2 1 520px; min-width: 0; }
.detail-grid > aside { flex: 1 1 320px; min-width: 0; }
.piece-row { border-bottom: 1px solid var(--line2); padding: 10px 0; display: flex; flex-direction: column; gap: 4px; }
.slot-line { font-size: 14px; }
.sw { display: inline-block; width: 12px; height: 12px; border: 1px solid #C6CCD3; border-radius: 3px; vertical-align: -1px; margin: 0 4px; }
.shot-img { width: 100%; border: 1px solid var(--line); border-radius: 8px; }
.section-title { margin: 12px 0 0; }

/* 通用补充 */
.btn.big { height: 56px; font-size: 17px; padding: 0 22px; width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.warn-text { color: #8A5A00; font-weight: 700; }
.warn-card { border-color: var(--warn-line); }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0; }
.inline-form label { flex-direction: row; align-items: center; gap: 6px; }
.inline-form .grow, .grow { flex: 1 1 200px; min-width: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs a { padding: 9px 14px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: #2F363E; }
.tabs a.on { background: var(--brand-soft); color: var(--brand-ink); border-color: #B9D8D8; font-weight: 700; }
.row-actions a { padding: 6px 4px; }
.row-actions a.on { font-weight: 700; color: var(--brand-ink); }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; padding: 3px 8px; border-radius: 6px; background: #F1F3F5; border: 1px solid #E1E4E8; margin: 2px 4px 2px 0; }
.chip .sw, .sw { display: inline-block; width: 14px; height: 14px; border: 1px solid #B8BEC6; border-radius: 3px; vertical-align: -2px; margin-right: 4px; }

/* 扫码页（手机优先） */
.scan-page { display: flex; flex-direction: column; gap: 14px; max-width: 720px; }
.scanbox { display: flex; gap: 8px; flex-wrap: wrap; }
.scanbox input { flex: 1 1 220px; height: 52px; font-size: 18px; }
.scanbox .btn { height: 52px; }
.camera { display: flex; flex-direction: column; gap: 8px; }
.camera video { width: 100%; max-height: 50vh; background: #000; border-radius: 10px; object-fit: cover; }
.big-msg { font-size: 17px; font-weight: 700; }
.piece-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.pc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pc-seq { font-size: 30px; line-height: 1; }
.pc-of { font-size: 20px; }
.pc-mark { background: #1B1F24; color: #fff; padding: 2px 8px; border-radius: 4px; font-size: 18px; }
.pc-body { display: flex; gap: 14px; flex-wrap: wrap; }
.pc-img { width: 132px; height: 132px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.pc-main { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pc-prod { font-size: 17px; }
.pc-spec { font-size: 16px; }
.pc-slot { border-top: 1px dashed var(--line); padding-top: 8px; }
.pc-text { font-size: 26px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.acts { display: flex; flex-direction: column; gap: 10px; }
.act { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.act select { height: 52px; font-size: 17px; }
.timer { font-size: 18px; font-weight: 700; margin: 0; color: var(--brand-ink); }
details.problem { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
details.problem summary { cursor: pointer; font-weight: 700; color: var(--err-ink); padding: 6px 0; }
details.problem label.check { padding: 8px 0; font-size: 16px; }
.pick-list { list-style: none; margin: 0; padding: 0; }
.pick-list li a { display: block; padding: 14px 10px; border-bottom: 1px solid var(--line2); font-size: 16px; }

/* 拣货 */
.mat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.mat { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; }
.mat img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.mat-noimg { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: #F1F3F5; font-weight: 700; font-size: 20px; color: #6B7480; min-width: 80px; }
.mat-text { padding: 8px 10px; }
.piece-rows { list-style: none; margin: 0; padding: 0; }
.piece-rows li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--line2); }
.piece-rows li form { margin: 0; }
.piece-rows li.done { opacity: .55; }
.piece-rows li a { text-decoration: none; color: var(--ink); }
.focus { display: flex; flex-direction: column; gap: 10px; }

/* 格子 */
.cubby-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.cubby { border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.cubby b { font-size: 22px; }
.cubby.full { background: var(--ok-bg); border-color: #9DD3B3; }
.cubby.late { background: var(--warn-bg); border-color: var(--warn-line); }
.cubby small { color: var(--muted); }

/* 排版 */
table.lay td { vertical-align: top; }
tr.hl td { background: #FFFBEA; }
.lay-slot { margin-bottom: 6px; }
.lay-slot b { font-size: 16px; }
.up { display: flex; gap: 6px; align-items: center; margin: 0; }
.up input[type=file] { height: auto; padding: 6px; max-width: 210px; font-size: 13px; }

/* 配置 · 产品 */
.prod-list { display: flex; flex-direction: column; }
.prod { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line2); align-items: flex-start; }
.prod img, .prod .mat-noimg { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; font-size: 13px; }
.prod.dim { opacity: .6; }
