/* 司机/快递员端 · 深色工作模式 + 安全橙 */
:root {
  --bg: #14161b; --surface: #1d2027; --surface-2: #232730; --border: #2f333e;
  --ink: #e9ebf0; --ink-2: #b6bcc9; --muted: #7f8798;
  --accent: #ff7a1a; --accent-dim: rgba(255,122,26,.13);
  --ok: #3fbf82; --warn: #e0a92a; --danger: #f2604f; --blue: #4d9ee8;
  --r-sm: 7px; --r-md: 11px; --r-lg: 16px;
  --font: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "SF Mono", Consolas, monospace;
  --disp: "Bebas Neue", "Arial Narrow", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); background: #0d0e11; color: var(--ink); font-size: 14px; line-height: 1.55; }
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; font-size: 15px; color: var(--ink); }

.shell { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg);
  display: flex; flex-direction: column; position: relative; }

.top-stack { position: sticky; top: 0; z-index: 30; }
.hd { position: relative; background: linear-gradient(135deg, #1d2027, #14161b 70%);
  padding: 14px 16px 12px; display: flex; align-items: center; gap: 10px; }
.hd-t { flex: 1; min-width: 0; }
.hd-t h1 { font-size: 15.5px; margin: 0; font-weight: 700; letter-spacing: .04em; }
.hd-t p { margin: 1px 0 0; font-size: 9.5px; font-family: var(--mono); letter-spacing: .18em; color: var(--muted); }
.hd-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(63,191,130,.15); }

.main { flex: 1; padding: 13px 13px 88px; }

.tabs { position: fixed; bottom: 0; left: 0; right: 0; max-width: 480px; margin: 0 auto;
  background: rgba(29,32,39,.97); backdrop-filter: blur(10px); border-top: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(3, 1fr); z-index: 40;
  padding: 7px 0 calc(7px + env(safe-area-inset-bottom)); }
.tab { background: none; border: none; display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--muted); font-size: 10.5px; padding: 3px 0; transition: color .15s; }
.tab svg { width: 21px; height: 21px; stroke-width: 1.8; }
.tab.on { color: var(--accent); }
.tab.on svg { stroke-width: 2.3; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  overflow: hidden; margin-bottom: 11px; }
.card-hd { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.card-hd h2 { font-size: 13.5px; margin: 0; font-weight: 700; letter-spacing: .03em; }
.card-hd .code { font-family: var(--mono); font-size: 9.5px; color: var(--muted); letter-spacing: .14em; }
.card-hd .more { margin-left: auto; font-size: 11.5px; color: var(--accent); background: none; border: none; }
.card-bd { padding: 13px 14px; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 12px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 11px 12px; }
.stat b { display: block; font-family: var(--disp); font-size: 26px; line-height: 1.05; letter-spacing: .02em; }
.stat span { font-size: 10.5px; color: var(--muted); }
.stat--hero { background: linear-gradient(135deg, #e05f00, #a84600); border: none; }
.stat--hero b, .stat--hero span { color: #fff; }
.stat--hero span { opacity: .82; }

.btn { border: 1px solid var(--border); background: var(--surface-2); color: var(--ink);
  border-radius: var(--r-sm); padding: 9px 14px; font-size: 13.5px; font-weight: 500;
  transition: all .15s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:active { transform: scale(.98); }
.btn--pri { background: var(--accent); border-color: var(--accent); color: #1a1000; font-weight: 700; }
.btn--ok { background: var(--ok); border-color: var(--ok); color: #06150d; font-weight: 700; }
.btn--danger { background: transparent; border-color: rgba(242,96,79,.45); color: var(--danger); }
.btn--block { width: 100%; padding: 12px; font-size: 15px; }
.btn--sm { padding: 7px 11px; font-size: 12.5px; min-height: 32px; }
.btn:disabled { opacity: .4; }

.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; padding: 2px 7px;
  border-radius: 3px; font-family: var(--mono); letter-spacing: .03em; }
.tag--run { background: var(--accent-dim); color: var(--accent); }
.tag--ok { background: rgba(63,191,130,.14); color: var(--ok); }
.tag--wait { background: rgba(255,255,255,.07); color: var(--ink-2); }
.tag--bad { background: rgba(242,96,79,.14); color: var(--danger); }
.mono { font-family: var(--mono); }

/* 车次卡 */
.trip { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  margin-bottom: 11px; overflow: hidden; transition: border-color .2s; }
.trip.open { border-color: rgba(255,122,26,.4); }
.trip-top { padding: 12px 14px; }
.trip-line1 { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.trip-no { font-family: var(--mono); font-size: 12.5px; font-weight: 600; letter-spacing: .03em; }
.trip-line1 .tag { margin-left: auto; }
.trip-plate { font-family: var(--mono); font-size: 17px; font-weight: 700; letter-spacing: .06em; }
.trip-meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.bar { height: 7px; background: rgba(255,255,255,.07); border-radius: 4px; overflow: hidden; margin-top: 9px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #ff7a1a, #ffb066); border-radius: 4px; }
.bar-row { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 10px; color: var(--muted); margin-top: 5px; }

.trip-orders { border-top: 1px solid var(--border); background: var(--surface-2); }
.to { padding: 10px 14px; border-bottom: 1px solid rgba(47,51,62,.6); display: flex; gap: 10px; align-items: flex-start; }
.to:last-child { border-bottom: none; }
.to-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-top: 7px; flex: none; }
.to-body { flex: 1; min-width: 0; }
.to-no { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); }
.to-route { font-size: 13px; margin-top: 2px; }
.to-addr { font-size: 11px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.to-right { text-align: right; flex: none; }
.to-right b { display: block; font-family: var(--mono); font-size: 12px; }

.trip-actions { display: flex; gap: 8px; padding: 11px 14px; border-top: 1px solid var(--border); }
.trip-actions .btn { flex: 1; }

/* 扫码 */
.scan-box { padding: 16px 14px; }
.big-input { width: 100%; height: 58px; font-size: 19px; text-align: center; letter-spacing: .08em;
  border: 2px dashed rgba(255,122,26,.45); border-radius: var(--r-md); background: var(--accent-dim);
  color: var(--accent); font-family: var(--mono); font-weight: 600; outline: none; }
.big-input::placeholder { color: rgba(255,122,26,.45); letter-spacing: .02em; font-weight: 400; }
.scan-tip { font-size: 11.5px; color: var(--muted); text-align: center; margin: 9px 0 14px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; font-size: 13px; }
.kv span { color: var(--muted); font-size: 12px; }
.kv b { font-weight: 600; text-align: right; }

.flow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 11px; }

.tl { padding: 2px 0; }
.tl-item { display: flex; gap: 10px; padding: 8px 0; position: relative; }
.tl-item::before { content: ""; position: absolute; left: 4px; top: 22px; bottom: -8px; width: 1px; background: var(--border); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border); flex: none; margin-top: 4px; }
.tl-item.on .tl-dot { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.tl-body { flex: 1; }
.tl-body b { font-size: 12.5px; display: block; }
.tl-body span { font-size: 11px; color: var(--muted); }

.empty { text-align: center; padding: 34px 18px; color: var(--muted); font-size: 12.5px; }
.empty svg { display: block; margin: 0 auto 9px; opacity: .28; }

.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 26px 22px; }
.login-card h2 { margin: 0 0 3px; font-size: 18px; }
.login-card .sub { font-family: var(--mono); font-size: 9.5px; color: var(--muted); letter-spacing: .16em; margin-bottom: 20px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 11.5px; color: var(--muted); letter-spacing: .06em; margin-bottom: 5px; }
.field input, .field select { width: 100%; border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 10px 11px; background: var(--surface-2); outline: none; transition: border-color .15s; }
.field input:focus { border-color: var(--accent); }
.err { background: rgba(242,96,79,.1); border: 1px solid rgba(242,96,79,.3); color: var(--danger);
  font-size: 12px; padding: 9px 11px; border-radius: var(--r-sm); margin-top: 10px; }
.hint { font-size: 11.5px; color: var(--muted); text-align: center; margin-top: 14px; }
.hint b { font-family: var(--mono); color: var(--ink-2); }

.toasts { position: fixed; top: 68px; left: 50%; transform: translateX(-50%); z-index: 90;
  display: flex; flex-direction: column; gap: 7px; pointer-events: none; }
.toast { background: rgba(233,235,240,.95); color: #14161b; font-size: 12.5px; padding: 9px 15px;
  border-radius: 20px; font-weight: 500; animation: tin .22s ease-out; }
.toast.err { background: rgba(242,96,79,.96); color: #fff; }
.toast.ok { background: rgba(63,191,130,.96); color: #06150d; }
@keyframes tin { from { opacity: 0; transform: translateY(-6px); } }

/* 本车次装载清单（扫码页快捷定位） */
.sq-list { border-top: 1px solid var(--border); }
.sq-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px;
  border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s; }
.sq-row:active, .sq-row:hover { background: rgba(255,255,255,.03); }
.sq-main { min-width: 0; flex: 1; }
.sq-main b { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sq-main span { display: block; font-family: var(--mono); font-size: 10px; color: var(--muted); margin-top: 2px; }
.sq-w { font-family: var(--mono); font-size: 11px; color: var(--ink-2); white-space: nowrap; }
.sq-empty { padding: 16px 14px; font-size: 12px; color: var(--muted); text-align: center; }
.sq-hint { padding: 8px 14px; font-size: 10.5px; color: var(--muted); opacity: .8;
  border-top: 1px dashed var(--border); font-family: var(--mono); letter-spacing: .04em; }

/* ============ 定位状态条 ============ */
.geo-bar { display: flex; align-items: center; gap: 9px; padding: 8px 14px;
  background: var(--surface-2); border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border); }
.geo-bar.busy { background: rgba(77,158,232,.09); }
.geo-pin { position: relative; width: 24px; height: 24px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: rgba(127,135,152,.16); color: var(--muted); }
.geo-bar.on .geo-pin { background: rgba(63,191,130,.16); color: var(--ok); }
.geo-bar.busy .geo-pin { background: rgba(77,158,232,.16); color: var(--blue); }
.geo-pulse { position: absolute; inset: -3px; border-radius: 50%; border: 1px solid var(--blue);
  animation: geoPulse 1.4s ease-out infinite; }
@keyframes geoPulse { 0% { transform: scale(.8); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }
.geo-txt { flex: 1; min-width: 0; }
.geo-txt b { display: block; font-size: 12px; font-weight: 600; color: var(--ink); }
.geo-txt span { display: block; font-size: 10px; color: var(--muted); font-family: var(--mono);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.geo-bar em { font-style: normal; font-size: 10px; color: var(--muted); flex: none; }
.geo-act { font-size: 11px; padding: 3px 9px; border-radius: 20px; flex: none;
  color: var(--accent); border: 1px solid rgba(255,122,26,.45); background: var(--accent-dim); }

/* 扫件页定位块 */
.scan-geo { margin-top: 11px; padding: 9px 11px; border-radius: var(--r-sm); text-align: center;
  font-size: 11.5px; color: var(--muted); background: rgba(127,135,152,.08);
  border: 1px dashed var(--border); line-height: 1.6; }
.scan-geo.on { color: var(--ok); background: rgba(63,191,130,.08); border-color: rgba(63,191,130,.3); border-style: solid; }
.scan-geo em { display: block; font-style: normal; font-size: 10px; color: var(--muted); margin-top: 1px; }

/* 订单行快捷操作 */
.to-acts { display: flex; gap: 5px; justify-content: flex-end; margin-top: 5px; }
.to-acts button { font-size: 10.5px; padding: 3px 8px; border-radius: 4px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); }
.to-acts button:active { border-color: var(--accent); color: var(--accent); }

/* ============ 货物品类 / 特殊属性 ============ */
.trip-mix { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 7px; }
.mix-group { font-size: 10px; padding: 2px 7px; border-radius: 3px; font-weight: 600;
  background: rgba(127,135,152,.16); color: var(--ink-2); }
.mix-group.g-chilled { background: rgba(77,158,232,.16); color: #7bb6ea; }
.mix-group.g-frozen { background: rgba(90,140,230,.2); color: #8fb4f0; }
.mix-group.g-hazmat { background: rgba(220,90,80,.18); color: #ef8b80; }
.mix-group.g-live { background: rgba(63,191,130,.16); color: #5fd3a0; }
.mix-cat { font-size: 10px; padding: 2px 6px; border-radius: 3px;
  background: rgba(255,255,255,.06); color: var(--muted); }

.to-tags, .sq-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 4px; }
.cat-badge { font-size: 9.5px; padding: 1px 6px; border-radius: 3px;
  background: rgba(127,135,152,.18); color: var(--ink-2); }
.fl-badge { font-size: 9.5px; padding: 1px 6px; border-radius: 3px;
  background: rgba(255,122,26,.14); color: #ffa15c; }
.fl-badge.hot { background: rgba(220,90,80,.2); color: #ff8a7e; }

.handling { margin: 0 0 10px; padding: 9px 11px; border-radius: var(--r-sm);
  background: rgba(255,180,60,.08); border: 1px solid rgba(255,180,60,.28); }
.hd-t { font-size: 10px; letter-spacing: .1em; color: #ffc46b; font-family: var(--mono);
  margin-bottom: 5px; }
.hd-n { font-size: 11px; color: var(--ink-2); line-height: 1.55; }
.hd-n + .hd-n { margin-top: 3px; }
