/* ============================================================
   边总家电代购订单管理系统 · 演示 Demo 样式
   纯静态、无外链、无框架；1280px 桌面优先，兼容手机浏览器
   ============================================================ */
:root {
  --navy: #0f2744;
  --navy-2: #16365c;
  --navy-3: #1d4470;
  --brand: #1e4f8f;
  --brand-2: #2f6fb3;
  --bg: #f2f5f9;
  --card: #ffffff;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --text: #1b2a3c;
  --text-2: #3d4f63;
  --muted: #6b7c93;
  --muted-2: #93a2b5;
  --green: #157a52;
  --green-bg: #e8f5ef;
  --amber: #9a6200;
  --amber-bg: #fdf3e0;
  --red: #b3261e;
  --red-bg: #fbeceb;
  --blue: #1e5f9e;
  --blue-bg: #eaf2fb;
  --gray-bg: #eef2f6;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(15, 39, 68, .05), 0 4px 14px rgba(15, 39, 68, .04);
  --mono: "Consolas", "SFMono-Regular", "Courier New", monospace;
  --font: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-2); }
h1, h2, h3, h4, p { margin: 0; }
button { font-family: inherit; }
::selection { background: #cfe0f5; }

/* ---------- 顶部导航 ---------- */
.app-header {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(90deg, #0d2138 0%, #123053 55%, #173a63 100%);
  color: #dbe6f5;
  box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 3px 12px rgba(8, 20, 35, .22);
}
.app-header-inner {
  max-width: 1460px; margin: 0 auto; padding: 0 20px;
  height: 56px; display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand-logo {
  width: 30px; height: 30px; border-radius: 7px;
  background: linear-gradient(135deg, #2d6ba8, #173a63);
  border: 1px solid rgba(255,255,255,.18);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px;
}
.brand-text { line-height: 1.15; }
.brand-text strong { display: block; color: #fff; font-size: 14px; letter-spacing: .5px; }
.brand-text small { color: #8fa9c8; font-size: 10.5px; letter-spacing: 1.5px; }
.main-nav { display: flex; align-items: stretch; gap: 2px; flex: 1 1 auto; overflow-x: auto; height: 56px; }
.main-nav::-webkit-scrollbar { height: 0; }
.main-nav a {
  display: flex; align-items: center; padding: 0 11px;
  color: #a9c0dc; font-size: 12.5px; white-space: nowrap;
  border-bottom: 2px solid transparent; transition: color .15s, background .15s;
}
.main-nav a:hover { color: #fff; background: rgba(255,255,255,.05); }
.main-nav a.active {
  color: #fff; font-weight: 600; border-bottom-color: #6ea8e0;
  background: linear-gradient(180deg, rgba(110,168,224,.12), rgba(110,168,224,0));
}
.header-meta { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; font-size: 12px; color: #9db4d1; }
.demo-flag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 4px; font-size: 11px;
  color: #ffd58a; background: rgba(255, 190, 80, .16); border: 1px solid rgba(255, 190, 80, .32);
}
.demo-flag i { width: 5px; height: 5px; border-radius: 50%; background: #ffc45c; display: inline-block; }
.header-user { display: flex; align-items: center; gap: 7px; color: #cfdcec; }
.avatar {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: #2a5788; color: #fff; font-size: 11px; border: 1px solid rgba(255,255,255,.15);
}
.header-date { color: #809bb9; font-variant-numeric: tabular-nums; }

/* ---------- 页面骨架 ---------- */
.layout { max-width: 1460px; margin: 0 auto; padding: 18px 20px 40px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 14px; flex-wrap: wrap; }
.page-title { display: flex; align-items: center; gap: 10px; }
.page-title h1 { font-size: 19px; font-weight: 700; color: var(--navy); letter-spacing: .2px; }
.page-title .crumb { color: var(--muted); font-size: 12px; }
.page-desc { color: var(--muted); font-size: 12.5px; margin-top: 4px; max-width: 880px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.demo-note {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px;
  color: var(--amber); background: var(--amber-bg); border: 1px solid #f0dcae;
  padding: 3px 9px; border-radius: 4px;
}
footer.app-footer {
  max-width: 1460px; margin: 8px auto 0; padding: 14px 20px 26px;
  color: var(--muted-2); font-size: 11.5px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  border-top: 1px solid var(--line);
}

/* ---------- 栅格与卡片 ---------- */
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.mt-14 { margin-top: 14px; }
.mt-10 { margin-top: 10px; }
.mt-8 { margin-top: 8px; }
.mb-0 { margin-bottom: 0; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); min-width: 0;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.card-head h2, .card-head h3 { font-size: 13.5px; font-weight: 600; color: var(--navy); display: flex; align-items: center; gap: 8px; }
.card-head .sub { color: var(--muted); font-size: 11.5px; font-weight: 400; }
.card-head .head-actions { display: flex; align-items: center; gap: 8px; }
.card-body { padding: 14px 16px; }
.card-body.tight { padding: 10px 12px; }
.card-body.flush { padding: 0; }
.card-foot { padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11.5px; background: #fbfcfe; border-radius: 0 0 var(--radius) var(--radius); }
.card-link { font-size: 12px; color: var(--brand); }

/* ---------- KPI ---------- */
.kpi { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand-2); opacity: .85; }
.kpi.k-amber::after { background: #d98b12; }
.kpi.k-red::after { background: var(--red); }
.kpi.k-green::after { background: var(--green); }
.kpi-label { color: var(--muted); font-size: 12px; display: flex; align-items: center; justify-content: space-between; }
.kpi-value { font-size: 25px; font-weight: 700; color: var(--navy); letter-spacing: .3px; font-variant-numeric: tabular-nums; line-height: 1.25; }
.kpi-value small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.kpi-foot { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.trend-up { color: var(--green); }
.trend-down { color: var(--red); }
.kpi.red .kpi-value { color: var(--red); }
.kpi.amber .kpi-value { color: var(--amber); }
.mini-bar { height: 4px; border-radius: 2px; background: var(--gray-bg); overflow: hidden; margin-top: 6px; }
.mini-bar i { display: block; height: 100%; background: var(--brand-2); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 13px; border-radius: 5px; cursor: pointer;
  border: 1px solid var(--line-strong); background: #fff; color: var(--text-2);
  font-size: 12.5px; white-space: nowrap; transition: all .15s;
}
.btn:hover { border-color: var(--brand-2); color: var(--brand); background: #f7faff; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--navy-3); border-color: var(--navy-3); color: #fff; }
.btn.danger { background: #fff; border-color: #e5b7b3; color: var(--red); }
.btn.danger:hover { background: var(--red-bg); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--brand); padding: 0 8px; }
.btn.ghost:hover { background: var(--blue-bg); }
.btn.sm { height: 27px; padding: 0 9px; font-size: 12px; }
.btn.lg { height: 38px; padding: 0 18px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.active:hover { background: var(--navy-3); border-color: var(--navy-3); color: #fff; }
.btn-primary-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 徽标 / 标签 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 10px; font-size: 11px; line-height: 1.5;
  background: var(--gray-bg); color: var(--text-2); white-space: nowrap; font-weight: 500;
}
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.blue { background: var(--blue-bg); color: var(--blue); }
.badge.navy { background: #e8eef6; color: var(--navy-3); }
.badge.outline { background: #fff; border: 1px solid var(--line-strong); color: var(--muted); }
.badge.solid-green { background: var(--green); color: #fff; }
.badge.solid-red { background: var(--red); color: #fff; }
/* 订单状态色（与 docs/02 §7.6 展示规范对齐：状态名称必须同时以文字展示） */
.badge.indigo { background: #e9ecf7; color: #3f4f8f; }
.badge.cyan { background: #e3f3f5; color: #0f6f7a; }
.badge.deepgreen { background: #dcefe4; color: #0d5c3c; }
.badge.purple { background: #f0e9f7; color: #6b3fa0; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 2px; }
.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px;
  font-size: 11px; border-radius: 3px; color: var(--muted); background: #f4f7fb; border: 1px solid var(--line);
  white-space: nowrap;
}
.tag.warn { color: var(--amber); background: var(--amber-bg); border-color: #f0dcae; }
.tag.danger { color: var(--red); background: var(--red-bg); border-color: #efc5c2; }
.tag.ok { color: var(--green); background: var(--green-bg); border-color: #bfe3d2; }

/* ---------- 表格 ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.table th {
  text-align: left; padding: 9px 12px; background: #f7f9fc; color: var(--muted);
  font-weight: 600; font-size: 11.5px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.table td { padding: 9px 12px; border-bottom: 1px solid #eef2f7; color: var(--text-2); vertical-align: middle; }
table.table tbody tr:last-child td { border-bottom: none; }
table.table tbody tr:hover { background: #f9fbfe; }
table.table tbody tr.clickable { cursor: pointer; }
table.table tbody tr.highlight-red { background: #fdf3f2; }
table.table tbody tr.highlight-red:hover { background: #fbeae8; }
table.table tbody tr.highlight-amber { background: #fdf8ec; }
table.table tbody tr.highlight-amber:hover { background: #fbf3df; }
table.table tr.selected-row { background: #eef5fd !important; box-shadow: inset 3px 0 0 var(--brand-2); }
table.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.table .center { text-align: center; }
table.table .nowrap { white-space: nowrap; }
table.table td.strong { color: var(--navy); font-weight: 600; }
.table-note { padding: 8px 16px; color: var(--muted); font-size: 11.5px; border-top: 1px solid var(--line); background: #fbfcfe; }
.table-compact td, .table-compact th { padding: 6px 10px; }
.mono { font-family: var(--mono); font-size: 11.5px; letter-spacing: .1px; white-space: nowrap; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; color: var(--navy); }
.money.muted { color: var(--text-2); font-weight: 500; }
.neg { color: var(--red) !important; }
.pos { color: var(--green) !important; }
.zero { color: var(--muted-2); }

/* ---------- 筛选器 ---------- */
.filters {
  display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fcfdff;
}
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label { font-size: 11.5px; color: var(--muted); }
.field.inline { flex-direction: row; align-items: center; gap: 6px; }
.input, .select {
  height: 30px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 5px;
  background: #fff; color: var(--text); font-size: 12.5px; font-family: inherit; outline: none;
  min-width: 0;
}
.input:focus, .select:focus, textarea.input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 2px rgba(47,111,179,.12); }
.input.w-sm { width: 110px; }
.input.w-md { width: 150px; }
.input.w-lg { width: 220px; }
textarea.input { height: auto; min-height: 78px; padding: 8px 9px; line-height: 1.6; resize: vertical; }
.checkbox { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-2); cursor: pointer; height: 30px; }
.checkbox input { accent-color: var(--brand); }
.filter-actions { display: flex; gap: 8px; margin-left: auto; }

/* ---------- 标签页 ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 16px; background: #fff; }
.tab {
  padding: 10px 14px; font-size: 12.5px; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; user-select: none; background: none; border-top: 0; border-left: 0; border-right: 0;
}
.tab:hover { color: var(--brand); }
.tab.active { color: var(--navy); font-weight: 600; border-bottom-color: var(--brand); }
.tab .cnt { font-size: 10.5px; color: var(--muted); margin-left: 4px; }
.seg { display: inline-flex; background: #eef2f7; border-radius: 6px; padding: 2px; }
.seg button {
  border: 0; background: transparent; padding: 5px 12px; font-size: 12px; border-radius: 4px;
  color: var(--muted); cursor: pointer;
}
.seg button.active { background: #fff; color: var(--navy); font-weight: 600; box-shadow: 0 1px 3px rgba(15,39,68,.12); }

/* ---------- 弹层 / 抽屉 / Toast ---------- */
.overlay-mask {
  position: fixed; inset: 0; background: rgba(15, 32, 52, .38); z-index: 90;
  opacity: 0; visibility: hidden; transition: opacity .18s;
}
.overlay-mask.show { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 560px; max-width: 94vw; z-index: 95;
  background: #fff; box-shadow: -8px 0 28px rgba(15,39,68,.16);
  transform: translateX(102%); transition: transform .22s ease; display: flex; flex-direction: column;
}
.drawer.show { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { font-size: 14px; color: var(--navy); }
.drawer-head .close, .modal-head .close {
  border: 0; background: transparent; font-size: 20px; line-height: 1; color: var(--muted);
  cursor: pointer; padding: 0 4px;
}
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px 28px; }
.drawer-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; background: #fbfcfe; }
.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -48%); z-index: 95;
  width: 620px; max-width: 94vw; max-height: 88vh; background: #fff; border-radius: 10px;
  box-shadow: 0 18px 50px rgba(15,39,68,.24); display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; transition: all .18s;
}
.modal.show { opacity: 1; visibility: visible; transform: translate(-50%, -50%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 14px; color: var(--navy); }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: #fbfcfe; border-radius: 0 0 10px 10px; }
#toastRoot { position: fixed; right: 20px; bottom: 22px; z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  min-width: 220px; max-width: 380px; background: #16324f; color: #eaf2fc;
  padding: 10px 14px; border-radius: 6px; font-size: 12.5px; box-shadow: 0 8px 22px rgba(15,39,68,.25);
  animation: toastIn .2s ease;
}
.toast.ok { background: #14603f; }
.toast.warn { background: #7a4d00; }
.toast.err { background: #8d2019; }
.toast small { display: block; color: #b9cde3; font-size: 11px; margin-top: 2px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 提示块 ---------- */
.alert {
  display: flex; gap: 9px; padding: 10px 13px; border-radius: 6px; font-size: 12.5px;
  background: var(--blue-bg); color: #174a7c; border: 1px solid #cfe0f2; line-height: 1.6;
}
.alert.warn { background: var(--amber-bg); color: #7a4d00; border-color: #f0dcae; }
.alert.danger { background: var(--red-bg); color: #8d2019; border-color: #efc5c2; }
.alert.ok { background: var(--green-bg); color: #106040; border-color: #bfe3d2; }
.alert .ico { font-weight: 700; flex: 0 0 auto; }
.notice-line { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.rule-box {
  background: #f8fafd; border: 1px dashed #cdd9e6; border-radius: 6px;
  padding: 10px 13px; font-size: 12px; color: var(--text-2); line-height: 1.8;
}
.rule-box code { font-family: var(--mono); background: #eef3f9; padding: 1px 5px; border-radius: 3px; color: var(--navy-3); font-size: 11.5px; }
.rule-box strong { color: var(--navy); }

/* ---------- 文本与辅助 ---------- */
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.xs { font-size: 10.5px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.flex-center { display: flex; align-items: center; gap: 8px; }
.flex-wrap { flex-wrap: wrap; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.grow { flex: 1 1 auto; min-width: 0; }
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.vdivider { width: 1px; align-self: stretch; background: var(--line); margin: 0 4px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.break { word-break: break-all; }
.hl { background: #fff7d6; padding: 0 2px; border-radius: 2px; }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 6px 10px; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text); word-break: break-all; }
.section-title { font-size: 12px; font-weight: 600; color: var(--navy); margin: 16px 0 8px; padding-left: 8px; border-left: 3px solid var(--brand-2); }
.section-title:first-child { margin-top: 0; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted-2); font-size: 12.5px; }
.avatar-sm { width: 22px; height: 22px; border-radius: 50%; background: #dbe7f4; color: var(--navy-3); display: inline-grid; place-items: center; font-size: 10.5px; font-weight: 600; }

/* ---------- 工作台 ---------- */
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  border-bottom: 1px solid #eef2f7; font-size: 12.5px;
}
.todo-item:last-child { border-bottom: none; }
.todo-item:hover { background: #f9fbfe; }
.todo-ico {
  width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center;
  background: var(--blue-bg); color: var(--brand); font-size: 12px; flex: 0 0 auto;
}
.todo-ico.warn { background: var(--amber-bg); color: var(--amber); }
.todo-ico.red { background: var(--red-bg); color: var(--red); }
.todo-ico.green { background: var(--green-bg); color: var(--green); }
.todo-main { flex: 1 1 auto; min-width: 0; }
.todo-main b { font-weight: 600; color: var(--navy); }
.todo-meta { color: var(--muted); font-size: 11px; }
.chart-wrap { padding: 8px 16px 12px; }
.chart-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); padding: 0 16px 4px; }
.chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }
svg.chart { display: block; width: 100%; height: auto; }
.calendar-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; padding: 4px 0; }
.cal-cell { text-align: center; font-size: 11px; color: var(--muted); padding: 6px 0; border-radius: 5px; background: #f6f9fc; }
.cal-cell b { display: block; font-size: 15px; color: var(--navy); margin-top: 2px; font-variant-numeric: tabular-nums; }
.cal-cell.today { background: #e9f1fa; outline: 1px solid #b9d2ec; }
.quick-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.quick-link {
  border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; background: #fbfcff;
  display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 12.5px;
}
.quick-link:hover { border-color: var(--brand-2); color: var(--brand); background: #f6faff; }

/* ---------- 录单识别 ---------- */
.intake-grid { display: grid; grid-template-columns: 360px minmax(0, 1fr) 330px; gap: 14px; align-items: start; }
.source-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: -14px -16px 12px; padding: 0 16px; }
.source-tabs .tab { padding: 9px 12px; font-size: 12px; }
.upload-box {
  border: 1.5px dashed #c3d3e4; border-radius: 7px; background: #f8fbff;
  padding: 16px; text-align: center; color: var(--muted); font-size: 12px; cursor: pointer;
}
.upload-box:hover { border-color: var(--brand-2); background: #f2f8ff; }
.upload-box b { color: var(--brand); }
.source-thumbs { display: flex; gap: 8px; margin-top: 10px; }
.source-thumb {
  width: 84px; height: 62px; border-radius: 5px; overflow: hidden; border: 1px solid var(--line);
  background: #eef2f7; cursor: pointer; position: relative; flex: 0 0 auto;
}
.source-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.source-thumb.active { outline: 2px solid var(--brand-2); outline-offset: 1px; }
.source-thumb span { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(15,39,68,.66); color: #fff; font-size: 9.5px; text-align: center; padding: 1px 0; }
.sample-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.sample-chip {
  border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 4px 11px;
  font-size: 11.5px; color: var(--muted); cursor: pointer;
}
.sample-chip.active { background: var(--navy-3); border-color: var(--navy-3); color: #fff; }
.raw-text {
  background: #f7f9fc; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px;
  font-size: 12px; color: var(--text-2); white-space: pre-wrap; line-height: 1.75;
  max-height: 240px; overflow: auto; font-family: var(--mono);
}
.img-preview { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #f4f6f9; max-height: 330px; display: flex; align-items: center; justify-content: center; }
.img-preview img { max-width: 100%; max-height: 330px; display: block; }
.conf-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.conf-table th { text-align: left; padding: 7px 10px; background: #f7f9fc; color: var(--muted); font-size: 11.5px; font-weight: 600; border-bottom: 1px solid var(--line); }
.conf-table td { padding: 7px 10px; border-bottom: 1px solid #eef2f7; vertical-align: middle; }
.conf-table tr.needs-check td { background: #fdf9ef; }
.conf-table .f-name { color: var(--muted); width: 88px; }
.conf-table .f-val { font-weight: 600; color: var(--navy); word-break: break-all; }
.conf-table .f-val input, .conf-table .f-val select { width: 100%; }
.conf-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; padding: 1px 6px; border-radius: 9px; font-variant-numeric: tabular-nums; }
.conf-pill.high { background: var(--green-bg); color: var(--green); }
.conf-pill.mid { background: var(--amber-bg); color: var(--amber); }
.conf-pill.low { background: var(--red-bg); color: var(--red); }
.dup-card { border: 1px solid #f0dcae; background: #fffdf7; border-radius: 6px; padding: 10px 12px; margin-bottom: 8px; }
.dup-card .dup-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; margin-bottom: 4px; }
.dup-card .dup-head b { color: var(--amber); }
.signal-chips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.signal-chip { font-size: 10px; padding: 1px 6px; border-radius: 3px; background: #f2e7c9; color: #7a5a00; }
.signal-chip.off { background: #eef2f7; color: var(--muted-2); text-decoration: line-through; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .field > label { font-size: 11.5px; }
.form-grid .input, .form-grid .select { width: 100%; height: 32px; }

/* ---------- 订单池 / 详情 ---------- */
.drawer .order-title-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.drawer .order-title-line .no { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li { position: relative; padding: 0 0 14px 18px; border-left: 2px solid #e4ebf3; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -6px; top: 3px; width: 10px; height: 10px;
  border-radius: 50%; background: #fff; border: 2px solid var(--line-strong);
}
.timeline li.done::before { background: var(--brand); border-color: var(--brand); }
.timeline li.current::before { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47,111,179,.16); }
.timeline .t-title { font-size: 12.5px; color: var(--navy); font-weight: 600; }
.timeline .t-meta { font-size: 11px; color: var(--muted); margin-top: 1px; }
.evidence-row { display: flex; gap: 8px; flex-wrap: wrap; }
.evidence {
  width: 92px; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; background: #f4f6f9;
}
.evidence img { width: 100%; height: 70px; object-fit: cover; display: block; }
.evidence span { display: block; font-size: 9.5px; color: var(--muted); padding: 2px 4px; text-align: center; }

/* ---------- 派单 ---------- */
.steps { display: flex; align-items: center; gap: 0; margin-bottom: 14px; }
.step { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.step .idx {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: #e6edf5; color: var(--muted); font-size: 11px; font-weight: 600;
}
.step.active { color: var(--navy); font-weight: 600; }
.step.active .idx { background: var(--brand); color: #fff; }
.step.done .idx { background: var(--green); color: #fff; }
.step-line { flex: 1 1 auto; height: 1px; background: var(--line); margin: 0 10px; min-width: 16px; }
.quote-table tr.picked { background: #eef5fd; box-shadow: inset 3px 0 0 var(--brand-2); }
.quote-table .radio-cell { width: 30px; text-align: center; }
.quote-table .price { font-family: var(--mono); font-size: 13px; color: var(--navy); font-weight: 700; }
.supplier-name { display: flex; flex-direction: column; gap: 1px; }
.supplier-name small { color: var(--muted); font-size: 10.5px; }
.ability { display: flex; gap: 4px; flex-wrap: wrap; }
.plan-preview { background: #f8fafd; border: 1px solid var(--line); border-radius: 6px; padding: 12px; font-size: 12px; line-height: 1.8; }
.plan-preview .label { color: var(--muted); display: inline-block; width: 70px; }
.dispatch-flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.flow-node { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 11.5px; background: #fbfcff; position: relative; }
.flow-node b { display: block; color: var(--navy); font-size: 12px; margin-bottom: 2px; }
.flow-node.done { border-color: #bfe3d2; background: #f4fbf7; }
.flow-node.done::after { content: "✓"; position: absolute; right: 8px; top: 6px; color: var(--green); font-weight: 700; }
.flow-node.waiting { border-style: dashed; color: var(--muted); }

/* ---------- 台账 ---------- */
.ledger-table td { font-size: 12px; }
.ledger-table .diff-cell { font-weight: 700; }
.formula-bar {
  display: flex; gap: 18px; flex-wrap: wrap; padding: 10px 16px;
  background: #f7f9fc; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; color: var(--text-2);
}
.formula-bar code { font-family: var(--mono); color: var(--navy-3); background: #eaf1f9; padding: 2px 6px; border-radius: 3px; font-size: 11.5px; }
.summary-mini { font-size: 12px; }
.summary-mini td, .summary-mini th { padding: 6px 9px; }
.bar-inline { height: 6px; background: #eef2f7; border-radius: 3px; overflow: hidden; min-width: 60px; }
.bar-inline i { display: block; height: 100%; background: var(--brand-2); border-radius: 3px; }
.recon-card { border: 1px solid var(--line); border-radius: 6px; padding: 12px; background: #fff; }
.recon-card.diff { border-color: #efc5c2; background: #fffbfa; }
.recon-card.ok { border-color: #bfe3d2; background: #fbfefc; }

/* ---------- 发票 ---------- */
.invoice-rule-table td { font-size: 12px; }
.rule-tag-group { display: flex; gap: 4px; flex-wrap: wrap; }
.overdue-text { color: var(--red); font-weight: 600; }
.invoice-progress { display: flex; gap: 4px; align-items: center; }
.progress-step { height: 4px; flex: 1; background: #e9eef5; border-radius: 2px; }
.progress-step.on { background: var(--brand-2); }
.progress-step.done { background: var(--green); }

/* ---------- 门户 ---------- */
.portal-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: linear-gradient(90deg, #12304f, #1c4a78); color: #e7f0fa;
  border-radius: 8px; padding: 14px 18px; margin-bottom: 14px; flex-wrap: wrap;
}
.portal-banner .who { display: flex; align-items: center; gap: 10px; }
.portal-banner .who .avatar { width: 34px; height: 34px; font-size: 13px; background: #2d6198; }
.portal-banner h2 { font-size: 15px; color: #fff; }
.portal-banner p { color: #a9c0dc; font-size: 11.5px; margin-top: 2px; }
.portal-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.ship-timeline { display: flex; align-items: flex-start; gap: 0; padding: 8px 0; }
.ship-node { flex: 1; text-align: center; position: relative; font-size: 11px; color: var(--muted); }
.ship-node::before { content: ""; position: absolute; top: 7px; left: -50%; width: 100%; height: 2px; background: #e4ebf3; }
.ship-node:first-child::before { display: none; }
.ship-node.done::before { background: var(--brand-2); }
.ship-dot { width: 14px; height: 14px; border-radius: 50%; background: #dfe7f0; border: 2px solid #fff; margin: 0 auto 4px; position: relative; z-index: 1; }
.ship-node.done .ship-dot { background: var(--brand); }
.ship-node.current .ship-dot { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47,111,179,.18); }
.supplier-ops { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.inline-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-form .input { height: 28px; width: 170px; font-size: 12px; }
.upload-inline { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--brand); cursor: pointer; }

/* ---------- 路线图 ---------- */
.phase-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.phase-card { display: flex; flex-direction: column; }
.phase-head { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.phase-head .phase-tag { font-size: 11px; color: var(--muted); letter-spacing: 1px; }
.phase-head h3 { font-size: 16px; color: var(--navy); margin: 3px 0 4px; }
.phase-head p { font-size: 11.5px; color: var(--muted); }
.phase-card.p1 { border-top: 3px solid var(--brand); }
.phase-card.p2 { border-top: 3px solid #4f83b8; }
.phase-card.p3 { border-top: 3px solid #7d9dbd; }
.feature-list { list-style: none; margin: 0; padding: 8px 16px 14px; flex: 1; }
.feature-list li { padding: 6px 0 6px 18px; position: relative; font-size: 12.5px; color: var(--text-2); border-bottom: 1px dashed #eef2f7; }
.feature-list li:last-child { border-bottom: none; }
.feature-list li::before { content: "•"; position: absolute; left: 4px; color: var(--brand-2); }
.feature-list li small { color: var(--muted-2); font-size: 10.5px; margin-left: 4px; }
.gantt { overflow-x: auto; }
.gantt-row { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 10px; min-width: 760px; }
.gantt-label { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.gantt-track { position: relative; height: 26px; background: repeating-linear-gradient(90deg, #f4f7fb 0, #f4f7fb 1px, transparent 1px, transparent 12.5%); border-left: 1px solid var(--line); }
.gantt-bar {
  position: absolute; top: 5px; height: 16px; border-radius: 3px; background: linear-gradient(90deg, #2f6fb3, #1e4f8f);
  color: #fff; font-size: 10px; padding: 0 6px; line-height: 16px; white-space: nowrap; overflow: hidden;
}
.gantt-bar.p2 { background: linear-gradient(90deg, #5b8fc2, #3c71a1); }
.gantt-bar.p3 { background: linear-gradient(90deg, #8aa6c2, #6d8dac); }
.gantt-axis { display: grid; grid-template-columns: 150px 1fr; gap: 10px; margin-bottom: 4px; min-width: 760px; }
.gantt-axis .weeks { display: grid; grid-template-columns: repeat(24, 1fr); font-size: 9.5px; color: var(--muted-2); text-align: center; }
.milestone-list { list-style: none; margin: 0; padding: 0; }
.milestone-list li { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px dashed #eef2f7; font-size: 12.5px; align-items: baseline; }
.milestone-list li:last-child { border-bottom: none; }
.milestone-list .m-week { flex: 0 0 78px; font-family: var(--mono); font-size: 11.5px; color: var(--brand); }
.milestone-list .m-name { flex: 0 0 180px; color: var(--navy); font-weight: 600; }
.milestone-list .m-desc { color: var(--muted); flex: 1; }
.dep-list { font-size: 12.5px; line-height: 2; }
.dep-list .arrow { color: var(--muted-2); margin: 0 6px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .intake-grid { grid-template-columns: 320px minmax(0, 1fr); }
  .intake-grid .confirm-col { grid-column: 1 / -1; }
}
@media (max-width: 1100px) {
  .grid-5, .grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main-nav a { padding: 0 8px; font-size: 12px; }
  .header-date { display: none; }
  .phase-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .layout { padding: 12px 12px 30px; }
  .intake-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4, .grid-5, .grid-6 { grid-template-columns: 1fr 1fr; }
  .app-header-inner { padding: 0 12px; gap: 10px; }
  .header-meta .demo-flag span { display: none; }
  .header-user span.uname { display: none; }
  .dispatch-flow { grid-template-columns: 1fr 1fr; }
  .filters .filter-actions { margin-left: 0; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4, .grid-5, .grid-6 { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 82px 1fr; }
  .brand-text small { display: none; }
  .main-nav { height: 50px; }
  .app-header-inner { height: 50px; }
  .card-head { flex-wrap: wrap; }
}

/* ---------- 打印 ---------- */
@media print {
  body { background: #fff; font-size: 11px; }
  .app-header, .page-actions, .filters, .demo-note, #toastRoot, .overlay-mask, .drawer, .modal, footer.app-footer, .tabs, .seg { display: none !important; }
  .layout { max-width: none; padding: 0; }
  .card { box-shadow: none; border: 1px solid #bbb; break-inside: avoid; }
  .card-head { background: #f4f4f4; }
  .table-wrap { overflow: visible; }
  table.table th, table.table td { border: 1px solid #bbb; padding: 4px 6px; }
  a { color: #000; text-decoration: none; }
  .badge, .tag { border: 1px solid #999; background: #fff !important; color: #000 !important; }
  .kpi { break-inside: avoid; }
}
