/* ============================================================
   极速物流 · 运营后台 设计系统
   工业实用风·浅色版：暖白纸面 + 安全橙强调
   展示字 Bebas Neue / 等宽 IBM Plex Mono / 正文 Noto Sans SC
   ============================================================ */
:root {
  --bg: #f5f3ee;
  --surface: #fff;
  --surface-2: #ecebe5;
  --text: #22242a;
  --muted: #62666f;
  --accent: #e05f00;
  --accent-strong: #ff7a1a;
  --accent-dim: rgba(224, 95, 0, .10);
  --border: rgba(34, 36, 42, .12);
  --border-strong: rgba(34, 36, 42, .26);
  --ok: #1c9a63;
  --warn: #b97a00;
  --danger: #d23b3b;
  --info: #2266cc;

  --font-display: "Bebas Neue", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;

  --fs-xs: 11px; --fs-sm: 12.5px; --fs-md: 14px;
  --fs-lg: 18px; --fs-xl: 24px; --fs-hero: 40px; --fs-mega: 56px;

  --s1: 4px; --s2: 8px; --s3: 14px; --s4: 22px; --s5: 36px;
  --r-sm: 3px; --r-md: 6px; --r-lg: 10px;
  --sh1: 0 1px 3px rgba(60, 50, 35, .10);
  --sh2: 0 8px 24px rgba(60, 50, 35, .14);
  --sh3: 0 24px 64px rgba(60, 50, 35, .18);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --fast: 160ms; --base: 320ms; --slow: 640ms;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { color-scheme: light; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: var(--fs-md); line-height: 1.7;
  letter-spacing: .01em; min-height: 100vh; overflow-x: hidden;
}
::selection { background: var(--accent-strong); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(56rem 38rem at 8% -12%, rgba(255, 122, 26, .10), transparent 60%),
    repeating-linear-gradient(90deg, rgba(34,36,42,.03) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(0deg, rgba(34,36,42,.025) 0 1px, transparent 1px 96px);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============ 布局 ============ */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; }
.sidebar {
  border-right: 1px solid var(--border); background: rgba(255,255,255,.75);
  backdrop-filter: blur(8px); padding: var(--s4) 0;
  display: flex; flex-direction: column; gap: var(--s3);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { padding: 0 var(--s4); display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 34px; height: 34px; background: var(--accent-strong); border-radius: var(--r-sm);
  display: grid; place-items: center; font-family: var(--font-display);
  font-size: 22px; color: #fff; clip-path: polygon(0 0, 100% 0, 100% 72%, 72% 100%, 0 100%);
  flex: none;
}
.brand-name { font-weight: 700; letter-spacing: .06em; font-size: 15px; line-height: 1.3; }
.brand-sub { font-size: var(--fs-xs); color: var(--muted); font-family: var(--font-mono); letter-spacing: .1em; display: block; }
.nav { display: flex; flex-direction: column; gap: 1px; padding: 0 var(--s2); }
.nav-label { font-size: var(--fs-xs); color: var(--muted); letter-spacing: .2em; padding: var(--s2) var(--s3) var(--s1); }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px var(--s3);
  color: var(--muted); text-decoration: none; font-size: 13.5px; cursor: pointer;
  border-left: 2px solid transparent; border-radius: 0 var(--r-sm) var(--r-sm) 0;
  transition: color var(--fast) ease-out, background var(--fast) ease-out, border-color var(--fast) ease-out;
}
.nav a:hover { color: var(--text); background: rgba(34,36,42,.05); }
.nav a.active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-dim); font-weight: 500; }
.nav a svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; }
.nav .badge {
  margin-left: auto; font-family: var(--font-mono); font-size: var(--fs-xs);
  background: var(--accent-strong); color: #fff; padding: 0 6px; border-radius: 99px; font-weight: 600;
}
.sidebar-foot { margin-top: auto; padding: var(--s3) var(--s4); border-top: 1px solid var(--border); font-size: var(--fs-xs); color: var(--muted); font-family: var(--font-mono); letter-spacing: .06em; line-height: 1.8; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border);
  background: rgba(245,243,238,.88); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20; flex: none;
}
.topbar h1 { font-size: var(--fs-lg); font-weight: 700; letter-spacing: .02em; margin-right: auto; line-height: 1.35; }
.topbar h1 small { display: block; font-size: var(--fs-xs); color: var(--muted); font-weight: 400; letter-spacing: .1em; font-family: var(--font-mono); }
.search {
  display: flex; align-items: center; gap: 8px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-md); padding: 0 var(--s3); width: 280px;
  transition: border-color var(--fast) ease-out;
}
.search:focus-within { border-color: var(--accent); }
.search input { flex: 1; background: none; border: none; font-size: var(--fs-sm); min-height: 40px; outline: none; }
.search input::placeholder { color: var(--muted); }
.search kbd { font-family: var(--font-mono); font-size: 10px; border: 1px solid var(--border-strong); border-radius: 3px; padding: 0 4px; color: var(--muted); }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--r-md);
  border: 1px solid var(--border); color: var(--muted); background: var(--surface);
  transition: all var(--fast) ease-out; position: relative;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); border: 2px solid var(--bg); }
.avatar {
  width: 40px; height: 40px; border-radius: var(--r-md); display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  font-family: var(--font-display); font-size: 16px; color: var(--accent); letter-spacing: .05em;
}
.ticker { overflow: hidden; border-bottom: 1px solid var(--border); background: var(--accent-dim); display: flex; align-items: center; flex: none; min-height: 27px; }
.ticker-label {
  flex: none; padding: 5px var(--s3); font-family: var(--font-mono); font-size: 10.5px;
  color: var(--accent); letter-spacing: .16em; border-right: 1px solid var(--border);
  background: #f3e4d6; display: flex; align-items: center; gap: 7px; white-space: nowrap;
  position: relative; z-index: 2;
}
.ticker-label .live { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .22; } }
.ticker-track { display: flex; gap: 42px; padding: 5px 0; white-space: nowrap; animation: ticker 42s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track span { font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: .02em; }
.ticker-track b { color: var(--text); font-weight: 500; }
.ticker-track em { font-style: normal; color: var(--accent); }
@keyframes ticker { to { transform: translateX(-50%); } }

.content { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }

/* ============ KPI ============ */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3); }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: var(--s3) var(--s4); position: relative; overflow: hidden; box-shadow: var(--sh1);
  transition: all var(--fast) ease-out;
}
.kpi:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--sh2); }
.kpi--hero { background: linear-gradient(135deg, var(--accent-strong) 0%, #cc5400 100%); border: none; color: #fff; box-shadow: var(--sh2); }
.kpi--hero::after {
  content: ""; position: absolute; right: -28px; top: -28px; width: 120px; height: 120px; transform: rotate(45deg);
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.14) 0 8px, transparent 8px 18px);
}
.kpi--hero .kpi-label, .kpi--hero .kpi-sub, .kpi--hero .kpi-delta { color: rgba(255,255,255,.88); }
.kpi-label { font-size: var(--fs-sm); color: var(--muted); letter-spacing: .06em; display: flex; align-items: center; gap: 8px; }
.kpi-label i { width: 7px; height: 7px; background: currentColor; flex: none; }
.kpi-value { font-family: var(--font-display); font-size: var(--fs-hero); line-height: 1.05; letter-spacing: .02em; margin: var(--s2) 0 2px; font-variant-numeric: tabular-nums; }
.kpi--hero .kpi-value { font-size: var(--fs-mega); color: #fff; }
.kpi-value small { font-size: var(--fs-lg); letter-spacing: .05em; margin-left: 2px; }
.kpi-delta { font-family: var(--font-mono); font-size: var(--fs-xs); }
.kpi-delta.up { color: var(--ok); } .kpi-delta.down { color: var(--danger); }
.kpi-sub { font-size: var(--fs-xs); color: var(--muted); }

/* ============ 面板 ============ */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--sh1); min-width: 0; }
.panel-head { display: flex; align-items: baseline; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.panel-head h2 { font-size: var(--fs-md); font-weight: 700; letter-spacing: .04em; }
.panel-head .code { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--muted); letter-spacing: .12em; }
.panel-head .more { margin-left: auto; font-size: var(--fs-sm); color: var(--muted); padding: 2px 4px; transition: color var(--fast); }
.panel-head .more:hover { color: var(--accent); }
.panel-body { padding: var(--s3) var(--s4) var(--s4); }
.mid { display: grid; grid-template-columns: 7fr 5fr; gap: var(--s3); align-items: stretch; }

/* 图表 */
.chart-legend { display: flex; gap: var(--s4); font-size: var(--fs-xs); color: var(--muted); margin-bottom: var(--s2); }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.chart-legend i { width: 12px; height: 3px; background: var(--accent-strong); }
.chart-legend i.g { background: var(--info); }
.chart-legend b { color: var(--text); font-family: var(--font-mono); font-weight: 500; }

/* 车队行 */
.fleet { display: flex; flex-direction: column; }
.fleet-row { display: grid; grid-template-columns: 92px 1fr auto; gap: var(--s3); align-items: center; padding: 11px var(--s4); border-bottom: 1px solid var(--border); transition: background var(--fast); cursor: pointer; }
.fleet-row:last-child { border-bottom: none; }
.fleet-row:hover { background: rgba(34,36,42,.03); }
.plate { font-family: var(--font-mono); font-size: 11px; font-weight: 600; text-align: center; border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: 3px 2px; background: var(--surface-2); white-space: nowrap; }
.fleet-meta b { font-size: var(--fs-sm); font-weight: 500; display: block; }
.fleet-meta span { font-size: var(--fs-xs); color: var(--muted); font-family: var(--font-mono); }
.route { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.route .bar { flex: 1; height: 3px; background: var(--surface-2); border-radius: 2px; position: relative; }
.route .bar i { position: absolute; inset: 0 auto 0 0; background: var(--accent-strong); border-radius: 2px; }
.route .dot-r { width: 5px; height: 5px; border-radius: 50%; background: var(--border-strong); flex: none; }
.route .dot-r.on { background: var(--accent-strong); }
.pct { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--muted); min-width: 54px; text-align: right; }
.pct b { color: var(--accent); font-weight: 600; }

/* ============ 表格 ============ */
.table-wrap { overflow: auto; max-height: calc(100vh - 336px); }
.table-wrap thead th { position: sticky; top: 0; z-index: 3; background: var(--surface); box-shadow: inset 0 -1px 0 var(--border); }
.table-wrap table { width: 100%; border-collapse: collapse; min-width: 820px; }
thead th { text-align: left; font-size: 10.5px; color: var(--muted); font-weight: 500; letter-spacing: .12em; padding: 9px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); white-space: nowrap; }
tbody tr { transition: background var(--fast); }
tbody tr:hover { background: rgba(34,36,42,.03); }
tbody tr:last-child td { border-bottom: none; }
tbody tr.clickable { cursor: pointer; }
td.city { color: var(--muted); white-space: normal; min-width: 120px; max-width: 168px; line-height: 1.35; }
td.city b { color: var(--text); font-weight: 500; }
.cargo { max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.waybill { font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 600; letter-spacing: .04em; display: inline-flex; align-items: center; gap: 7px; }
.barcode { display: inline-flex; gap: 1px; align-items: flex-end; height: 15px; }
.barcode i { width: 2px; height: 15px; background: var(--accent-strong); }
.barcode i:nth-child(3n) { width: 1px; opacity: .65; }
.barcode i:nth-child(4n) { height: 11px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 500; letter-spacing: .04em; padding: 2px 9px; border-radius: 99px; border: 1px solid; white-space: nowrap; }
.chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.chip.run { color: var(--info); border-color: rgba(34,102,204,.35); background: rgba(34,102,204,.08); }
.chip.done { color: var(--ok); border-color: rgba(28,154,99,.35); background: rgba(28,154,99,.08); }
.chip.wait { color: var(--warn); border-color: rgba(185,122,0,.35); background: rgba(185,122,0,.08); }
.chip.bad { color: var(--danger); border-color: rgba(210,59,59,.4); background: rgba(210,59,59,.08); }
.chip.idle { color: var(--ok); border-color: rgba(28,154,99,.35); background: rgba(28,154,99,.08); }
.chip.off { color: var(--muted); border-color: var(--border-strong); background: var(--surface-2); }
.progress { display: flex; align-items: center; gap: 8px; }
.progress .bar { width: 60px; height: 3px; background: var(--surface-2); border-radius: 2px; overflow: hidden; }
.progress .bar i { display: block; height: 100%; background: var(--accent-strong); }
.table-foot { display: flex; align-items: center; gap: var(--s3); padding: 10px var(--s4); border-top: 1px solid var(--border); font-size: var(--fs-xs); color: var(--muted); font-family: var(--font-mono); }
th.sortable { cursor: pointer; user-select: none; transition: color var(--fast); }
th.sortable:hover { color: var(--text); }
.sort { display: inline-block; margin-left: 5px; vertical-align: middle; border-left: 3.5px solid transparent; border-right: 3.5px solid transparent; border-top: 5px solid rgba(34,36,42,.16); transition: border-color var(--fast); }
th.sortable:hover .sort { border-top-color: var(--muted); }
.sort.asc { border-bottom: 5px solid var(--accent); border-top-color: transparent; }
.sort.desc { border-top: 5px solid var(--accent); }
.table-foot .right { margin-left: auto; display: flex; gap: 8px; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 0 14px; min-height: 36px; border-radius: var(--r-md);
  font-size: var(--fs-sm); font-weight: 500; letter-spacing: .03em;
  border: 1px solid var(--border-strong); color: var(--text); background: var(--surface);
  transition: all var(--fast) ease-out; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; font-weight: 700; }
.btn-primary:hover { background: #ff8c3a; color: #fff; }
.btn-sm { min-height: 29px; padding: 0 9px; font-size: 11.5px; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { color: var(--danger); border-color: rgba(210,59,59,.35); }
.btn-danger:hover { background: rgba(210,59,59,.08); color: var(--danger); border-color: var(--danger); }

/* ============ 表单 / 筛选 ============ */
.filters { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 10.5px; color: var(--muted); letter-spacing: .1em; }
.field input, .field select, .field textarea {
  min-height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); font-size: var(--fs-sm); outline: none; min-width: 150px;
  transition: border-color var(--fast);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { min-height: 72px; padding: 8px 10px; resize: vertical; }
.field input::placeholder { color: #a0a3aa; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.form-grid .field { min-width: 0; }
.form-grid .field input, .form-grid .field select { width: 100%; min-width: 0; }
.form-grid .full { grid-column: 1 / -1; }
.mono { font-family: var(--font-mono); }

/* ============ 弹层 ============ */
.mask { position: fixed; inset: 0; background: rgba(20,18,14,.42); backdrop-filter: blur(2px); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 24px; animation: fadeIn 160ms ease-out; }
@keyframes fadeIn { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh3); width: 100%; max-width: 620px; max-height: 86vh; display: flex; flex-direction: column; animation: rise 220ms var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.99); } }
.modal-head { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal-head h3 { font-size: var(--fs-md); font-weight: 700; letter-spacing: .04em; }
.modal-head .x { margin-left: auto; font-size: 18px; color: var(--muted); line-height: 1; padding: 4px 6px; }
.modal-head .x:hover { color: var(--danger); }
.modal-body { padding: var(--s4); overflow-y: auto; }
.modal-foot { padding: var(--s3) var(--s4); border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }
.drawer-mask { position: fixed; inset: 0; background: rgba(20,18,14,.35); z-index: 90; animation: fadeIn 160ms; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(560px, 94vw); background: var(--surface); box-shadow: var(--sh3); z-index: 91; display: flex; flex-direction: column; animation: slideIn 240ms var(--ease); }
@keyframes slideIn { from { transform: translateX(24px); opacity: .6; } }
.drawer-head { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.drawer-head h3 { font-size: var(--fs-md); font-weight: 700; }
.drawer-body { padding: var(--s4); overflow-y: auto; flex: 1; }
.drawer-foot { padding: var(--s3) var(--s4); border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* toast */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #22242a; color: #fff; border-radius: var(--r-md); padding: 9px 14px; font-size: var(--fs-sm); box-shadow: var(--sh2); animation: rise 180ms var(--ease); display: flex; align-items: center; gap: 8px; }
.toast.ok { border-left: 3px solid #38b26e; }
.toast.err { border-left: 3px solid #ff6b6b; }

/* ============ 地图页 ============ */
.map-layout { display: grid; grid-template-columns: 340px 1fr; gap: var(--s3); height: calc(100vh - 170px); min-height: 520px; }
.map-side { display: flex; flex-direction: column; gap: var(--s3); min-height: 0; }
.map-side .panel { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.map-side .list { overflow-y: auto; flex: 1; }
.group-hd { position: sticky; top: 0; z-index: 2; padding: 6px var(--s4); font-size: 10.5px;
  letter-spacing: .08em; color: var(--muted); background: var(--surface-2, #f7f5f0);
  border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 6px; }
.group-hd em { font-style: normal; font-family: var(--font-mono); color: var(--text); }
.order-item { padding: 10px var(--s4); border-bottom: 1px solid var(--border); cursor: pointer; transition: background var(--fast); }
.order-item:hover { background: rgba(34,36,42,.03); }
.order-item.active { background: var(--accent-dim); border-left: 2px solid var(--accent); padding-left: calc(var(--s4) - 2px); }
.order-item b { font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
.order-item .row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.order-item .meta { font-size: 11px; color: var(--muted); font-family: var(--font-mono); margin-top: 2px; }
.map-box { position: relative; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--sh1); }
#map { position: absolute; inset: 0; background: #e8e6df; }
.legend { position: absolute; left: 12px; bottom: 12px; z-index: 500; background: rgba(255,255,255,.94); border: 1px solid var(--border); border-radius: var(--r-md); padding: 8px 12px; font-size: 11px; display: flex; gap: 14px; box-shadow: var(--sh1); }
.legend span { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.legend i.run { background: #ff7a1a; } .legend i.idle { background: #1c9a63; }
.legend i.off { background: #8a8f98; } .legend i.fix { background: #2266cc; }
.legend i.go, .legend i.plan { width: 18px; height: 0; border-radius: 0; border-top: 3px solid #16a34a; }
.legend i.plan { border-top-style: dashed; }
.map-float { position: absolute; right: 12px; bottom: 12px; z-index: 500; background: rgba(255,255,255,.95); border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 14px; font-size: 11.5px; box-shadow: var(--sh1); max-width: 236px; backdrop-filter: blur(4px); }
.map-layers { position: absolute; right: 12px; top: 12px; z-index: 500; display: flex; background: rgba(255,255,255,.95); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--sh1); }
.map-layers button { border: none; background: none; padding: 6px 13px; font-size: 12px; color: var(--muted); cursor: pointer; font-family: inherit; transition: all var(--fast) ease-out; }
.map-layers button + button { border-left: 1px solid var(--border); }
.map-layers button:hover { color: var(--text); background: var(--accent-dim); }
.map-layers button.on { background: var(--accent); color: #fff; }
.map-float b { font-family: var(--font-mono); }
.veh-marker { display: flex; flex-direction: column; align-items: center; }
.veh-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.veh-dot.run { background: #ff7a1a; } .veh-dot.idle { background: #1c9a63; }
.veh-dot.off { background: #8a8f98; }
.veh-tag { font-family: var(--font-mono); font-size: 9.5px; background: rgba(255,255,255,.92); border: 1px solid rgba(34,36,42,.2); border-radius: 3px; padding: 0 4px; margin-top: 2px; white-space: nowrap; }
.map-box.hide-tag .veh-tag { display: none; }
.map-tip { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 600;
  background: rgba(190,60,50,.94); color: #fff; font-size: 11.5px; padding: 6px 12px;
  border-radius: 20px; box-shadow: var(--sh2); }
.replay-bar { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.replay-track { flex: 1; height: 3px; border-radius: 2px; background: var(--border); overflow: hidden; }
.replay-track i { display: block; height: 100%; background: #2266cc; transition: width .2s linear; }

/* ============ 其他 ============ */
.empty { text-align: center; color: var(--muted); font-size: var(--fs-sm); padding: var(--s5) 0; font-family: var(--font-mono); letter-spacing: .08em; }
.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.stack { display: flex; flex-direction: column; gap: var(--s3); }
.kv { display: grid; grid-template-columns: 88px 1fr; gap: 6px 12px; font-size: var(--fs-sm); }
.kv dt { color: var(--muted); font-size: var(--fs-xs); letter-spacing: .06em; }
.kv dd { margin: 0; }
.section-title { font-size: var(--fs-xs); color: var(--muted); letter-spacing: .16em; font-family: var(--font-mono); margin: var(--s3) 0 var(--s2); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 0 0 14px 18px; border-left: 1px solid var(--border-strong); position: relative; }
.timeline li:last-child { border-left-color: transparent; }
.timeline li::before { content: ""; position: absolute; left: -4px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-strong); }
.timeline b { font-size: var(--fs-sm); }
.timeline .t { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }
.msg-item { display: flex; gap: 12px; padding: 12px var(--s4); border-bottom: 1px solid var(--border); align-items: flex-start; }
.msg-item.unread { background: rgba(255,122,26,.04); }
.msg-item .ico { width: 8px; height: 8px; border-radius: 50%; margin-top: 8px; flex: none; background: var(--muted); }
.msg-item .ico.warning { background: var(--warn); } .msg-item .ico.danger { background: var(--danger); } .msg-item .ico.info { background: var(--info); }
.msg-item .body { flex: 1; min-width: 0; }
.msg-item b { font-size: var(--fs-sm); }
.msg-item p { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; }
.msg-item .time { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.doc-warn { color: var(--danger); font-family: var(--font-mono); font-size: 10.5px; }
.doc-ok { color: var(--muted); font-family: var(--font-mono); font-size: 10.5px; }
.link { color: var(--accent); cursor: pointer; }
.link:hover { text-decoration: underline; }

/* ============ 运费配置 ============ */
.pricing-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .8fr); gap: var(--s4); align-items: start; }
.matrix-key { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-family: var(--font-mono); font-size: 10px; color: var(--muted); }
.matrix-key .hint { color: var(--accent); }
.matrix-wrap { overflow-x: auto; padding: var(--s3) var(--s4) var(--s4); }
table.matrix { border-collapse: separate; border-spacing: 3px; width: 100%; min-width: 620px; }
table.matrix th { font-weight: 500; font-size: 11px; color: var(--muted); padding: 5px 6px; text-align: center; white-space: nowrap; }
table.matrix thead th em { display: block; font-style: normal; font-family: var(--font-mono); font-size: 9px; opacity: .65; }
table.matrix th.corner { text-align: left; font-size: 10px; letter-spacing: .1em; font-family: var(--font-mono); color: var(--muted); }
table.matrix tbody th { text-align: right; font-size: 12px; color: var(--text); }
table.matrix tbody th.wild, table.matrix thead th.wild { color: var(--accent); }
table.matrix td { text-align: center; border-radius: 5px; padding: 7px 4px; cursor: pointer; border: 1px solid transparent; transition: all var(--fast) ease-out; font-family: var(--font-mono); font-size: 11px; }
table.matrix td b { display: block; font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: .01em; }
table.matrix td span { font-size: 9.5px; color: var(--muted); }
table.matrix td.cell-miss { color: var(--muted); background: rgba(34,36,42,.03); border-style: dashed; border-color: var(--border); }
table.matrix td.cell-miss b { color: var(--muted); font-weight: 400; }
table.matrix td.cell-wild { border-color: rgba(224,95,0,.28); }
table.matrix td:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--sh1); }
.panel-foot-note { padding: 10px var(--s4) 14px; font-size: 11px; color: var(--muted); border-top: 1px dashed var(--border); line-height: 1.6; }
.panel-foot-note b { color: var(--text); font-family: var(--font-mono); }

/* 开关 */
.switch { display: inline-flex; align-items: center; gap: 6px; border: none; background: none; cursor: pointer; padding: 0; font-size: 11px; color: var(--muted); font-family: inherit; }
.switch i { width: 28px; height: 15px; border-radius: 20px; background: rgba(34,36,42,.18); position: relative; transition: background var(--fast); flex: none; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform var(--fast) var(--ease); }
.switch.on { color: var(--ok); }
.switch.on i { background: var(--ok); }
.switch.on i::after { transform: translateX(13px); }

/* 试算结果 */
.quote-result { margin-top: var(--s3); border-top: 1px solid var(--border); padding-top: var(--s3); }
.quote-total { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.quote-total span { font-size: var(--fs-xs); color: var(--muted); letter-spacing: .1em; }
.quote-total b { font-family: var(--font-display); font-size: 30px; color: var(--accent-strong); letter-spacing: .01em; }
.quote-line { display: flex; justify-content: space-between; font-size: 12px; padding: 4px 0; color: var(--muted); }
.quote-line b { color: var(--text); font-family: var(--font-mono); font-weight: 500; }
.quote-line b.down { color: var(--ok); }
.hint-line { font-size: 11px; color: var(--muted); margin-top: var(--s3); line-height: 1.6; }

/* ============ 骨架屏 ============ */
.skeleton { background: linear-gradient(90deg, rgba(34,36,42,.05) 25%, rgba(34,36,42,.09) 37%, rgba(34,36,42,.05) 63%); background-size: 400% 100%; animation: shine 1.4s ease-in-out infinite; border-radius: 5px; }
@keyframes shine { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.sk-row { height: 13px; margin-bottom: 9px; }
.sk-card { height: 76px; border-radius: var(--r-md); }

/* ============ 空状态 ============ */
.empty svg { display: block; margin: 0 auto 8px; opacity: .35; }
.empty::before {
  content: ""; display: block; width: 44px; height: 44px; margin: 0 auto 10px; opacity: .3;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322242a' stroke-width='1.4' stroke-linecap='round'%3E%3Cpath d='M3 8l9-5 9 5v9l-9 5-9-5z'/%3E%3Cpath d='M3 8l9 5 9-5M12 13v9'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ============ 入场动效 ============ */
@keyframes riseIn { from { opacity: 0; transform: translateY(10px); } }
.kpis .kpi, .content > .panel, .pricing-grid > .panel { animation: riseIn .4s var(--ease) both; }
.kpis .kpi:nth-child(2) { animation-delay: 45ms; }
.kpis .kpi:nth-child(3) { animation-delay: 90ms; }
.kpis .kpi:nth-child(4) { animation-delay: 135ms; }
.pricing-grid > .panel:nth-child(2) { animation-delay: 70ms; }

/* ============ 侧栏折叠 ============ */
.app { transition: grid-template-columns var(--fast) var(--ease); }
.app.collapsed { grid-template-columns: 64px 1fr; }
.app.collapsed .brand-name, .app.collapsed .brand-sub, .app.collapsed .nav-label,
.app.collapsed .sidebar-foot, .app.collapsed .nav a span.badge { display: none; }
.app.collapsed .nav a { justify-content: center; padding: 10px 0; font-size: 0; gap: 0; }
.app.collapsed .nav a svg { width: 19px; height: 19px; }
.app.collapsed .brand { justify-content: center; padding: 0 0 var(--s4); }
.sidebar-toggle { position: absolute; right: -13px; top: 22px; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border-strong); display: grid; place-items: center; cursor: pointer; z-index: 30; box-shadow: var(--sh1); color: var(--muted); transition: all var(--fast); }
.sidebar-toggle:hover { color: var(--accent); border-color: var(--accent); transform: scale(1.08); }

/* 登录 */
.login-page { min-height: 100vh; display: grid; place-items: center; position: relative; z-index: 1; padding: 24px; }.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh3); padding: var(--s5) var(--s5) var(--s4); position: relative; overflow: hidden; }
.login-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--accent-strong), #f3a24a); }
.login-card .mark { width: 46px; height: 46px; background: var(--accent-strong); clip-path: polygon(0 0, 100% 0, 100% 72%, 72% 100%, 0 100%); display: grid; place-items: center; font-family: var(--font-display); font-size: 28px; color: #fff; margin-bottom: 14px; }
.login-card h2 { font-size: 20px; letter-spacing: .06em; }
.login-card .sub { font-size: var(--fs-xs); color: var(--muted); font-family: var(--font-mono); letter-spacing: .1em; margin-bottom: var(--s4); }
.login-card .field { margin-bottom: var(--s3); }
.login-card .field input { width: 100%; min-height: 42px; }
.login-err { background: rgba(210,59,59,.08); border: 1px solid rgba(210,59,59,.3); color: var(--danger); border-radius: var(--r-md); padding: 8px 12px; font-size: var(--fs-sm); margin-bottom: var(--s3); }
.login-hint { font-size: 11px; color: var(--muted); margin-top: var(--s3); font-family: var(--font-mono); }

/* 响应式 */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .mid { grid-template-columns: 1fr; }
  .map-layout { grid-template-columns: 290px 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; padding: var(--s2) var(--s3); gap: var(--s3); overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .brand-sub, .sidebar-foot, .nav-label { display: none; }
  .nav { flex-direction: row; padding: 0; }
  .nav a { border-left: none; border-bottom: 2px solid transparent; border-radius: 0; padding: 8px; }
  .nav a.active { border-bottom-color: var(--accent); }
  .search { width: auto; flex: 1; }
  .map-layout { grid-template-columns: 1fr; height: auto; }
  .map-box { height: 460px; }
}

/* ============ 车队统计 / 装载调度 ============ */
.kpis--5 { grid-template-columns: repeat(5, 1fr); }
.mix { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); padding: var(--s4); }
.mix-col { min-width: 0; }
.mix-title { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); letter-spacing: .12em; margin-bottom: 10px; }
.mix-row { display: grid; grid-template-columns: 68px 1fr auto; align-items: center; gap: 10px; margin-bottom: 8px; }
.mix-lbl { font-size: var(--fs-sm); white-space: nowrap; }
.mix-bar { height: 8px; background: rgba(224,95,0,.12); border-radius: 2px; overflow: hidden; }
.mix-bar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width .5s var(--ease); }
.mix-bar--alt { background: rgba(47,125,91,.12); }
.mix-bar--alt i { background: #2f7d5b; }
.mix-val { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }

/* 自然流：面板按内容撑开，整页滚动，不再压缩到视口内 */
.dispatch-grid { display: grid; grid-template-columns: 400px 1fr; gap: var(--s3); align-items: stretch; }
.dispatch-grid > .panel { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.dispatch-grid > .panel > .panel-head, .dispatch-grid > .panel > .filters, .dispatch-grid > .panel > .modal-foot { flex: none; }
.pick-list { max-height: 620px; overflow: auto; }
.plan-body { padding: var(--s4); }
.plan-empty { flex: 1; display: grid; place-items: center; padding: 54px var(--s4); }
.table-wrap--compact { max-height: 560px; }
.pick-row {
  display: grid; grid-template-columns: 18px 1fr auto; gap: 9px; align-items: center;
  padding: 7px var(--s4); border-bottom: 1px solid var(--border); cursor: pointer; transition: background var(--fast);
}
.pick-row:hover { background: var(--accent-dim); }
.pick-row.on { background: var(--accent-dim); box-shadow: inset 2px 0 0 var(--accent); }
.pick-row input { width: 15px; height: 15px; min-height: auto; }
.pick-main { min-width: 0; }
.pick-title { font-size: var(--fs-sm); font-weight: 600; }
.pick-meta { font-size: 10.5px; color: var(--muted); font-family: var(--font-mono); margin-top: 2px; }
.pick-w { text-align: right; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
.pick-w b { display: block; font-size: var(--fs-sm); color: var(--ink, #22242a); }

.trip-card { border: 1px solid var(--border); border-radius: var(--r-md); padding: 9px 13px; margin-bottom: 9px; background: var(--surface); }
.trip-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.trip-plate { font-family: var(--font-mono); font-weight: 700; font-size: var(--fs-md); letter-spacing: .04em; }
.trip-tags { display: flex; gap: 5px; margin-left: auto; flex-wrap: wrap; }
.loadbar { display: grid; grid-template-columns: 64px 1fr 62px; align-items: center; gap: 9px;
  margin-top: 6px; font-family: var(--font-mono); font-size: 10px; color: var(--muted); white-space: nowrap; }
.loadbar .track { height: 6px; background: rgba(34,36,42,.07); border-radius: 2px; overflow: hidden; position: relative; }
.loadbar .track i { display: block; height: 100%; border-radius: 2px; transition: width .5s var(--ease); }
.loadbar .track i.w { background: var(--accent); }
.loadbar .track i.v { background: #2f7d5b; }
.trip-items { margin-top: 7px; border-top: 1px dashed var(--border); padding-top: 5px; max-height: 96px; overflow-y: auto; }
.trip-item { display: flex; gap: 8px; font-size: 10.5px; padding: 2px 0; color: var(--muted); }
.trip-item b { color: var(--ink, #22242a); font-family: var(--font-mono); font-weight: 600; }
.trip-foot { display: flex; gap: 8px; margin-top: 6px; padding-top: 5px; border-top: 1px dashed var(--border);
  font-size: 10.5px; color: var(--muted); }
.trip-foot b { color: var(--accent-strong); font-family: var(--font-mono); }
.saving-box { display: flex; align-items: center; gap: var(--s4); padding: 8px 14px; background: linear-gradient(90deg, rgba(47,125,91,.08), transparent); border: 1px solid rgba(47,125,91,.25); border-radius: var(--r-md); margin-bottom: 9px; }
.saving-box .big { font-family: var(--font-display); font-size: 26px; color: #2f7d5b; line-height: 1.1; }

/* 运输链路：揽收 → 网点集货 → 干线 → 目的网点 → 末端派送 */
.leg-chain { display: flex; align-items: center; gap: 0; padding: 5px var(--s4); border-bottom: 1px solid var(--border); background: linear-gradient(90deg, rgba(224,95,0,.04), transparent); overflow-x: auto; }
.leg-node { display: flex; flex-direction: column; gap: 0; padding: 3px 9px; border-radius: var(--r-sm); white-space: nowrap; flex: none; }
.leg-node .n { font-size: var(--fs-sm); font-weight: 600; color: var(--muted); line-height: 1.45; }
.leg-node .d { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .08em; color: var(--muted); opacity: .75; }
.leg-node.on { background: var(--accent-dim); box-shadow: inset 0 0 0 1px rgba(224,95,0,.35); }
.leg-node.on .n { color: var(--accent-strong); }
.leg-node.on .d { color: var(--accent); opacity: 1; }
.leg-arrow { width: 26px; height: 1px; background: var(--border-strong); position: relative; flex: none; }
.leg-arrow::after { content: ""; position: absolute; right: 0; top: -2.5px; width: 6px; height: 6px; border-top: 1px solid var(--border-strong); border-right: 1px solid var(--border-strong); transform: rotate(45deg); }
.leg-note { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--muted); white-space: nowrap; padding-left: var(--s3); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 1180px) {
  .kpis--5 { grid-template-columns: repeat(3, 1fr); }
  .mix { grid-template-columns: 1fr; }
  .leg-chain { flex-wrap: wrap; row-gap: 4px; }
  .leg-note { width: 100%; margin-left: 0; padding-left: 0; }
}

/* ============ 装载调度：小屏 / 窄屏降级 ============ */
@media (max-width: 1180px) {
  .dispatch-grid { grid-template-columns: 1fr; }
  .pick-list { max-height: 400px; }
  .table-wrap--compact { max-height: 380px; }
}

/* ============ 货物品类 / 混装分组 ============ */
.pick-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.cat-chip { font-size: 9.5px; padding: 1px 6px; border-radius: 3px;
  background: rgba(31,111,178,.1); color: #1f6fb2; }
.flag-chip { font-size: 9.5px; padding: 1px 6px; border-radius: 3px;
  background: rgba(224,95,0,.1); color: var(--accent); }
.flag-chip.hot { background: rgba(190,60,50,.12); color: #be3c32; }

.group-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: var(--s3); }
.group-chip { font-size: 10.5px; padding: 3px 9px; border-radius: 3px;
  background: #f1ede5; color: var(--ink-2); }
.group-chip.g-chilled, .group-chip.g-frozen { background: rgba(31,111,178,.1); color: #1f6fb2; }
.group-chip.g-hazmat { background: rgba(190,60,50,.1); color: #be3c32; }
.group-chip.g-live { background: rgba(47,125,91,.1); color: #2f7d5b; }
.group-note { font-size: 10.5px; color: var(--muted); }

.trip-handle { margin-top: 7px; padding: 6px 9px; border-radius: 4px;
  background: rgba(224,95,0,.05); border: 1px dashed rgba(224,95,0,.28);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.th-t { font-size: 9.5px; letter-spacing: .1em; font-family: var(--font-mono); color: var(--accent); }
.th-n { font-size: 10.5px; color: var(--ink-2); }
.th-more { font-size: 10px; color: var(--muted); }
