:root {
  --bg: #f4f2ec; --panel: #ffffff; --panel-2: #faf8f3; --ink: #1b1f2a; --ink-2: #3a4150; --muted: #6b7280;
  --line: #e6e1d6; --line-2: #d6cfbf;
  --brand: #0e6e6a; --brand-ink: #0a4f4c; --brand-soft: #e2f0ee;
  --sand: #b7791f; --sand-soft: #fbf0dc;
  --ok: #15803d; --ok-soft: #e6f4ea; --warn: #b45309; --warn-soft: #fdf1df; --bad: #b91c1c; --bad-soft: #fde7e7;
  --info: #1d4ed8; --info-soft: #e7edfc;
  --radius: 12px; --shadow: 0 1px 2px rgba(27,31,42,.05), 0 4px 16px rgba(27,31,42,.06);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Segoe UI", Roboto, "Noto Sans", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; }
h2 { font-size: 20px; } h3 { font-size: 16px; } h4 { font-size: 14px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .mono { font-family: var(--mono); font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; } .row.top { align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.hide { display: none !important; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

/* ---------- 顶栏 + 侧栏 ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; height: 56px; padding: 0 20px;
  background: var(--ink); color: #f3f1ea; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: #fff; letter-spacing: .5px; }
.logo svg { flex: none; }
.logo small { font-weight: 500; color: #b9b3a3; font-size: 12px; letter-spacing: 0; }
.topbar .spacer { flex: 1; }
.topbar select { background: #2a2f3c; color: #fff; border: 1px solid #3b4252; border-radius: 8px; padding: 6px 10px; font: inherit; max-width: 280px; }
.demo-tag { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--sand); color: #fff; font-weight: 600; }
.shell { display: grid; grid-template-columns: 210px 1fr; min-height: calc(100vh - 56px); }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 16px 10px; }
.side a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 500; margin-bottom: 2px; }
.side a:hover { background: var(--panel-2); text-decoration: none; }
.side a.on { background: var(--brand-soft); color: var(--brand-ink); }
.side a .cnt { margin-left: auto; background: var(--bad); color: #fff; font-size: 11px; border-radius: 99px; padding: 0 7px; line-height: 18px; }
.side .sec { font-size: 11px; color: var(--muted); padding: 14px 12px 6px; letter-spacing: .5px; }
main.main { padding: 22px 26px 60px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* ---------- 卡片 / 表格 ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.card + .card { margin-top: 14px; }
.card h3 { margin-bottom: 10px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h3 { margin: 0; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--panel-2); }
.tbl tr.sel td { background: var(--brand-soft); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- 按钮 / 表单 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); font: 500 13.5px var(--font); cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--ink-2); }
.btn.pri { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.pri:hover { background: var(--brand-ink); }
.btn.gold { background: var(--sand); border-color: var(--sand); color: #fff; }
.btn.danger { color: var(--bad); border-color: #f0c2c2; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--brand); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 15px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
label.f .hint { font-weight: 400; color: var(--muted); font-size: 11.5px; }
input.i, select.i, textarea.i { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff;
  font: 14px var(--font); color: var(--ink); }
textarea.i { height: auto; min-height: 70px; padding: 8px 10px; resize: vertical; }
input.i:focus, select.i:focus, textarea.i:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 14px; }
.form-grid .s2 { grid-column: span 2; } .form-grid .s4 { grid-column: 1 / -1; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 6px 12px; font: 13px var(--font); cursor: pointer; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--ink); color: #fff; }

/* ---------- 标签 ---------- */
.tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 500;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.tag.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.tag.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.tag.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.tag.info { background: var(--info-soft); border-color: transparent; color: var(--info); }
.tag.brand { background: var(--brand-soft); border-color: transparent; color: var(--brand-ink); }
.tag.gold { background: var(--sand-soft); border-color: transparent; color: #8a5a12; }
.cc { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 18px; padding: 0 4px; border-radius: 4px;
  font: 700 10.5px var(--font); letter-spacing: .4px; color: #fff; vertical-align: 1px; }
.cc-CN { background: #c0392b; } .cc-KZ { background: #0ea5c6; } .cc-KG { background: #dc2626; } .cc-UZ { background: #2563eb; }
.cc-TJ { background: #16a34a; } .cc-TM { background: #15803d; }
.lv { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.lv0 { background: #eceae4; color: #6b7280; } .lv1 { background: var(--info-soft); color: var(--info); }
.lv2 { background: var(--brand-soft); color: var(--brand-ink); } .lv3 { background: linear-gradient(90deg,#f6e2b3,#f3d28a); color: #6b4410; }
.stars { color: var(--sand); letter-spacing: 1px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); } .dot.info { background: var(--info); }

/* ---------- 统计 ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .k { font-size: 12px; color: var(--muted); }
.kpi .v { font-size: 24px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12px; color: var(--muted); }
.kpi.alert .v { color: var(--bad); }

/* ---------- 路线 ---------- */
.route { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; flex-wrap: wrap; }
.route .arr { color: var(--muted); font-weight: 400; }
.map-wrap { background: linear-gradient(180deg, #f8f6f0, #f1eee5); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.map-wrap svg { display: block; width: 100%; height: auto; }

/* ---------- 时间线 ---------- */
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl li { position: relative; padding: 0 0 14px 26px; }
.tl li::before { content: ""; position: absolute; left: 7px; top: 16px; bottom: -2px; width: 2px; background: var(--line); }
.tl li:last-child::before { display: none; }
.tl li .b { position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); background: #fff; }
.tl li.done .b { background: var(--brand); border-color: var(--brand); }
.tl li.done .b::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.tl li.done::before { background: var(--brand); }
.tl li.skip .b { border-style: dashed; }
.tl li.now .b { border-color: var(--sand); box-shadow: 0 0 0 4px var(--sand-soft); }
.tl li.opt { color: var(--muted); }
.tl .t { font-weight: 500; } .tl .w { font-size: 12px; color: var(--muted); }
.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }

/* ---------- 担保 ---------- */
.escrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.escrow div { background: var(--panel-2); border-radius: 8px; padding: 8px 10px; }
.escrow b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.escrow span { font-size: 11.5px; color: var(--muted); }

/* ---------- 聊天 ---------- */
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; padding: 4px 2px; }
.msg { max-width: 82%; padding: 7px 11px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13.5px; }
.msg.me { align-self: flex-end; background: var(--brand-soft); border-color: transparent; }
.msg .meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.phrases { display: flex; flex-wrap: wrap; gap: 6px; }
.phrases button { border: 1px solid var(--line-2); background: #fff; border-radius: 99px; padding: 4px 10px; font: 12.5px var(--font); cursor: pointer; color: var(--ink-2); }
.phrases button:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- 弹窗 / 提示 ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(20,22,28,.45); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--panel); border-radius: 14px; width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { width: min(860px, 100%); }
.modal header { padding: 16px 20px 0; font-weight: 700; font-size: 16px; }
.modal .mb { padding: 14px 20px; }
.modal footer { padding: 0 20px 18px; display: flex; justify-content: flex-end; gap: 8px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px;
  border-radius: 10px; z-index: 60; box-shadow: var(--shadow); font-size: 14px; max-width: calc(100vw - 32px); }
.toast.err { background: var(--bad); }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.notice { padding: 10px 12px; border-radius: 8px; font-size: 13px; display: flex; gap: 8px; align-items: flex-start; }
.notice.warn { background: var(--warn-soft); color: #7c3d06; } .notice.info { background: var(--info-soft); color: #1e3a8a; }
.notice.bad { background: var(--bad-soft); color: #7f1d1d; } .notice.ok { background: var(--ok-soft); color: #14532d; }
.notice + .notice { margin-top: 6px; }

/* ---------- 司机卡 ---------- */
.dcard { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fff; }
.dcard + .dcard { margin-top: 10px; }
.dcard .name { font-weight: 600; font-size: 15px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; flex: none; }
.price { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.reasons { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: flex; overflow-x: auto; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); gap: 4px; }
  .side .sec { display: none; }
  .side a { white-space: nowrap; margin: 0; }
  main.main { padding: 16px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .escrow { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 12px; gap: 8px; }
  .logo small { display: none; }
}
