/* 颜色与字体取自 docs/01-设计规格.md 第 13.2 节（品牌色取自 logo）。 */
:root {
  --bg: #FFFFFF;
  --panel: #F6F7F9;
  --brand: #162B82;
  --brand-soft: #EEF1FA;
  --ink: #1A1D23;
  --muted: #6B7280;
  --line: #E6E8EC;
  --amber: #D97706;
  --green: #15803D;
  --red: #B91C1C;
  --radius: 8px;
  --font: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font); }
a { color: var(--brand); }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 15px; margin: 0 0 10px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; margin: 4px 0; }
.mt { margin-top: 24px; }
.empty { padding: 48px 0; text-align: center; }

.top { border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 5; }
.top-in { max-width: 1120px; margin: 0 auto; padding: 0 32px; height: 56px; display: flex; align-items: center; gap: 24px; }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; }
.brand span { color: var(--brand); }
.nav { display: flex; gap: 18px; }
.nav a { color: var(--muted); text-decoration: none; }
.newbtn { margin-left: auto; }
.who { margin-left: 8px; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.page { max-width: 1120px; margin: 0 auto; padding: 28px 32px 64px; }
.narrow { max-width: 380px; margin: 48px auto; }
.narrow.wide { max-width: 720px; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.end { display: flex; align-items: flex-end; }
label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 14px; }
label.check { flex-direction: row; align-items: center; gap: 8px; }
input, select, textarea {
  font: inherit; color: var(--ink); padding: 9px 12px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--bg); min-width: 0;
}
input.short { width: 120px; padding: 6px 8px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.btn-primary {
  font: inherit; font-weight: 600; color: #fff; background: var(--brand); text-decoration: none;
  border: 0; border-radius: var(--radius); padding: 9px 16px; cursor: pointer; display: inline-block;
}
.btn-ghost {
  font: inherit; color: var(--brand); background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 8px 14px; cursor: pointer;
}
.link { background: none; border: 0; color: var(--brand); cursor: pointer; font: inherit; padding: 0; }
.inline { display: inline-flex; gap: 8px; align-items: center; margin-right: 12px; }
.error { color: var(--red); background: #FEF2F2; border-radius: var(--radius); padding: 10px 12px; margin: 0 0 16px; }
.notice { color: var(--ink); background: #FFFBEB; border-radius: var(--radius); padding: 10px 12px; margin: 0 0 16px; }

/* 工具条：状态标签、搜索 */
.toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar h1 { margin: 0; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: var(--radius); font-size: 14px; }
.tab.on { color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.count { color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 2px; }
.search { margin-left: auto; }
.search input { width: 300px; }

/* 列表：每行 56px */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 150px 220px 88px; align-items: center; gap: 12px; min-height: 56px; border-bottom: 1px solid var(--line); padding: 8px 0; }
.row .no { font-weight: 600; font-variant-numeric: tabular-nums; text-decoration: none; color: var(--ink); }
.row .name { font-weight: 600; }
.row .sub { color: var(--muted); font-size: 13px; }
.row .amt { text-align: right; }
.row .when { text-align: right; font-size: 13px; }
.prog { display: flex; flex-direction: column; gap: 4px; }
.pips { display: flex; gap: 3px; }
.pips i { width: 14px; height: 4px; border-radius: 2px; background: var(--line); display: block; }
.pips i.on { background: var(--brand); }
.state { font-size: 13px; color: var(--muted); }
.pager { display: flex; gap: 16px; justify-content: center; margin-top: 18px; }

/* 订单详情 */
.dhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.dhead h1 { margin: 4px 0; }
.dtotal { font-size: 24px; font-weight: 600; }
.pill { font-size: 13px; font-weight: 600; color: var(--brand); background: var(--brand-soft); border-radius: 999px; padding: 2px 10px; vertical-align: middle; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.steps { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.step { border-bottom: 1px solid var(--line); }
.step summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 14px 0; }
.step summary::-webkit-details-marker { display: none; }
.mark { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; color: var(--muted); flex: none; }
.step.done .mark { background: var(--green); border-color: var(--green); color: #fff; }
.step.skip .mark { background: var(--panel); }
.step.cur .mark { border-color: var(--brand); color: var(--brand); font-weight: 700; }
.stitle { font-weight: 600; }
.sstate { margin-left: auto; font-size: 13px; }
.sbody { padding: 0 0 18px 38px; display: flex; flex-direction: column; gap: 12px; }
.fields .btn-ghost { justify-self: start; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; align-items: end; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.card { background: var(--panel); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card p { margin: 6px 0; }
.card textarea { width: 100%; margin-bottom: 8px; }
.card .stack { gap: 8px; }
.card select { width: 100%; }
.note { border-top: 1px solid var(--line); padding-top: 8px; margin: 8px 0 0; }
.wide-card { max-width: 760px; margin-bottom: 18px; background: var(--bg); border: 1px solid var(--line); }
table.plain { width: 100%; border-collapse: collapse; font-size: 14px; }
table.plain th, table.plain td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }

@media (max-width: 720px) {
  .page { padding: 16px; }
  .top-in { padding: 0 16px; gap: 12px; }
  .nav { gap: 12px; font-size: 14px; }
  .who span { display: none; }
  .newbtn { position: fixed; right: 16px; bottom: 16px; z-index: 6; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
  .search { margin-left: 0; width: 100%; }
  .search input { width: 100%; }
  .row { grid-template-columns: 1fr auto; grid-template-areas: "no amt" "who who" "prog prog"; gap: 6px 12px; padding: 12px 0; }
  .row .no { grid-area: no; }
  .row .who { grid-area: who; }
  .row .amt { grid-area: amt; }
  .row .prog { grid-area: prog; flex-direction: row; justify-content: space-between; align-items: center; }
  .row .when { display: none; }
  .grid { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 1fr; }
  .sbody { padding-left: 0; }
  .dtotal { font-size: 20px; }
}

.files { list-style: none; padding: 0; margin: 0 0 8px; font-size: 14px; }
.files li { padding: 4px 0; }
.uploader { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filepick { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; color: var(--brand); border: 1px dashed var(--line); border-radius: var(--radius); padding: 8px 12px; cursor: pointer; font-size: 14px; }
.filepick input { font-size: 13px; max-width: 220px; }
.sbody.dragging, .card.dragging { outline: 2px dashed var(--brand); outline-offset: 4px; }

.live { font-size: 12px; color: var(--green); margin-left: auto; }
.live[hidden] { display: none; }
#changed { display: flex; align-items: center; gap: 8px; }

.intake-drop { max-width: 760px; }
.intake { max-width: 760px; border-left: 3px solid var(--brand); }
.intake-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.intake .pill.bad { color: var(--red); background: #FEF2F2; }
.intake .match { color: var(--brand); font-weight: 600; margin: 8px 0; }
.intake .items { padding-left: 18px; margin: 6px 0; }
.intake .warn { color: var(--amber); padding-left: 18px; font-size: 14px; margin: 8px 0; }
.intake-form details { margin: 8px 0; }
.intake-form .grid2 { margin-top: 8px; }
.intake-form label.check { font-size: 14px; color: var(--ink); }
body.dropping::after { content: "松开即可识别"; position: fixed; inset: 16px; border: 2px dashed var(--brand); border-radius: 12px; background: rgba(238,241,250,.85); color: var(--brand); font-size: 22px; display: flex; align-items: center; justify-content: center; z-index: 20; pointer-events: none; }
.banner { display: block; background: #FFFBEB; color: var(--ink); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; text-decoration: none; font-weight: 600; }
