:root {
  --dark:#252629;
  --deep:#242529;
  --ink:#202126;
  --muted:#64656b;
  --line:#dedee1;
  --bg:#fafafa;
  --action:#3b3c41;
  --paper:#fff;
  --shadow:0 1px 2px #1a1a2109,0 4px 12px #1a1a2105;
  --num:ui-monospace,"SFMono-Regular",Menlo,monospace;
  color:var(--ink);
  font:14px/1.5 -apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft Yahei",sans-serif;
  font-variant-numeric:tabular-nums;
}

* {
  box-sizing:border-box;
}

body {
  margin:0;
  background:var(--bg);
  min-width:1180px;
}

button,input,select {
  font:inherit;
  color:inherit;
}

button,a,input,select {
  outline-offset:3px;
}

button {
  cursor:pointer;
}

button:disabled {
  opacity:.45;
  cursor:default;
}

.rail {
  width:192px;
  position:fixed;
  inset:0 auto 0 0;
  display:flex;
  flex-direction:column;
  overflow-y:auto;
  padding:28px 14px 20px;
  background:linear-gradient(125deg,#fcfcfd,#f7f7f8);
  border-right:1px solid var(--line);
  color:var(--ink);
  z-index:2;
}
.brand {
  display:flex;
  align-items:center;
  gap:8px;
  margin:0 7px 24px;
  font-size:25px;
  font-weight:700;
  letter-spacing:-1.25px;
  line-height:1.25;
}
.brand i {
  display:inline-block;
  width:25px;
  height:18px;
  border-radius:12px;
  background:linear-gradient(61deg,#242529 45%,#fcfcfd 46% 53%,#242529 54%);
  transform:rotate(-12deg);
}
.rail-search {
  display:flex;
  align-items:center;
  gap:8px;
  padding:7px 9px;
  min-height:34px;
  border:1px solid #d9d9dc;
  border-radius:6px;
  background:linear-gradient(#f5f5f6,#f1f1f3);
  color:#58595f;
  box-shadow:inset 0 1px 2px #17172005;
  font-size:13px;
  text-align:left;
}
.rail-search:hover {background:#eaeaec}
.rail-search kbd {
  margin-left:auto;
  font:11px/1.5 var(--num);
  padding:0 4px;
  border:1px solid #d7d7da;
  border-radius:3px;
  background:#fafafa;
}
.rail nav {margin:24px 0 0;padding-top:12px;border-top:1px solid var(--line)}
.nav-group summary {cursor:pointer;font-weight:600;padding:7px 8px}
.nav-group summary::marker {color:var(--muted);font-size:11px}
.nav-children {display:grid;gap:3px;margin:4px 0 0 5px;padding-left:4px;border-left:1px solid var(--line)}
.rail a {
  display:flex;
  gap:5px;
  align-items:center;
  padding:10px 5px;
  border:1px solid transparent;
  border-radius:6px;
  color:#404147;
  font-size:13px;
  text-decoration:none;
}
.rail a[aria-current=page] {
  border-color:#dcdce0;
  background:linear-gradient(100deg,#e3e3e6,#ebebed);
  color:#1f2024;
  font-weight:600;
}
.rail a:hover:not([aria-current=page]) {background:#eeeef0}
.icon svg {display:block;width:18px;height:18px;stroke-linecap:round;stroke-linejoin:round}
.rail nav a[aria-current=page] [data-icon="day"] svg {fill:currentColor}
.light-dot,.pending::before {
  display:inline-block;
  width:7px;
  height:7px;
  border-radius:50%;
}
.rail-foot {margin:auto 6px 0;padding-top:22px;color:var(--ink);font-size:13px}
.rail-foot small {display:block;color:var(--muted);margin:4px 0 0 15px}
.light-dot {margin-right:8px;background:#83858b}
.workspace {
  margin-left:192px;
}

.top {
  height:63px;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 36px;
  background:#fff;
  color:var(--muted);
  font-size:12px;
}

.top b {
  color:#95969c;
  font-weight:400;
  padding:0 7px;
}

.top strong {
  color:var(--ink);
  font-weight:550;
}

.mock-label {
  border:1px solid var(--line);
  border-radius:4px;
  padding:3px 9px;
}

#content {
  max-width:1720px;
  margin:auto;
  padding:32px clamp(24px,2.4vw,44px) 60px;
}

.lead,.panel-title,.tools,.period,.scope,.dialogfoot,.switches,.config-bar {
  display:flex;
  align-items:center;
  gap:12px;
}

.lead,.panel-title,.scope,.config-bar {
  justify-content:space-between;
}

.lead {
  margin-bottom:22px;
}

.lead h1 {
  font-size:32px;
  letter-spacing:-1px;
  line-height:1.2;
  margin:0 0 8px;
  font-weight:630;
}

.lead p,.panel-title p {
  margin:0;
  color:var(--muted);
  font-size:13px;
}

button.btn,.period button,.period input,.period select,.tools input,.tools select,.config-input {
  background:#fff;
  border:1px solid #d4d4d9;
  border-radius:5px;
  min-height:36px;
  padding:6px 12px;
}

button.btn:hover,.period button:hover,.text:hover,.tree:hover,.date-link:hover {
  background:#ededf0;
}

.btn.primary {
  color:#fff;
  background:var(--action);
  border-color:var(--action);
}

.btn.primary:hover {
  background:#242428;
}

.period {
  gap:5px;
}

.period button {
  font-size:19px;
  line-height:1;
  width:36px;
  padding:0;
}

.period input,.period select {
  font-variant-numeric:tabular-nums;
  font-size:13px;
}

.breadcrumbs {display:flex;align-items:center;gap:4px}
.breadcrumbs .icon {margin-right:5px}
.breadcrumbs svg {width:14px;height:14px}
.report-heading time {font-variant-numeric:tabular-nums}
.report-heading time span {margin-left:4px;font-weight:400;color:#85858c}
.report-heading p {display:flex;align-items:center;gap:10px}
.report-heading p strong {font-weight:500;color:var(--ink)}
.heading-note {padding-left:10px;border-left:1px solid #d5d5d9}
.hero {
  display:grid;
  grid-template-columns:minmax(0,1.74fr) minmax(0,1fr);
  gap:14px;
}
.metric {
  position:relative;
  min-width:0;
  border:1px solid #d8d8dc;
  border-radius:10px;
  background:linear-gradient(110deg,#fff 2%,#f3f3f5);
  box-shadow:var(--shadow),inset 0 1px 0 #fff;
}
.metric-distance {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:15px 26px;
  overflow:hidden;
  background:linear-gradient(108deg,#fafafa 0%,#f2f2f3 78%,#efeff1 100%);
}
.metric-copy {z-index:1}
.amount-label {color:#52535a;font-size:14px}
.amount {
  font:600 clamp(42px,3.8vw,66px)/1.14 -apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft Yahei",sans-serif;
  font-variant-numeric:tabular-nums;
  letter-spacing:-.045em;
  margin-top:7px;
  white-space:nowrap;
}
.amount small {margin-left:8px;font-size:17px;font-weight:500;letter-spacing:0;color:#53545b}
.dispatch-art {
  display:block;
  width:clamp(150px,13vw,205px);
  height:125px;
  object-fit:contain;
  flex:none;
}
.metric-count {
  display:grid;
  align-content:center;
  padding:12px 20px;
}
.metric-count .amount-label {font-size:13px}
.count-value {font-size:24px;line-height:1.15;font-weight:620;letter-spacing:-.035em;margin-top:2px}
.count-value small {margin-left:5px;font-size:13px;font-weight:500;letter-spacing:0}
.fleet-line {display:flex;align-items:flex-end;justify-content:space-between;gap:10px;margin-top:8px;padding-top:7px;border-top:1px solid #d9d9dd}
.pending {display:flex;align-items:center;gap:6px;color:#575861;font-size:12px;margin-bottom:2px}
.pending::before {content:"";background:#a0a1a7}
.pending.attention::before {background:#dc9617}
.archive {
  margin:8px 0 0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  color:var(--muted);
  font-size:12px;
}

.archive strong {
  color:var(--action);
  font-weight:600;
  margin-right:8px;
}

.archive button,.text,.date-link {
  background:none;
  border:0;
  color:var(--action);
  padding:4px 6px;
  border-radius:3px;
  cursor:pointer;
  font-size:13px;
}

.panel {
  background:#fff;
  border:1px solid var(--line);
  border-radius:10px;
  box-shadow:var(--shadow);
  margin-top:16px;
  overflow:hidden;
}

.panel-title {
  padding:16px 22px 12px;
  align-items:flex-start;
}

.panel h2,.config-bar h2 {
  font-size:19px;
  margin:0;
  letter-spacing:-.3px;
}

.panel-title p {
  margin-top:4px;
}

.tools {
  padding:0 22px 12px;
  gap:8px;
}

.tools input {
  width:240px;
}

.tools .right {
  margin-left:auto;
}

.switches {
  gap:0;
  background:#eeeef0;
  border:1px solid var(--line);
  padding:2px;
  border-radius:6px;
}

.switches button {
  border:0;
  background:transparent;
  border-radius:4px;
  padding:4px 12px;
  color:var(--muted);
  font-size:13px;
}

.switches button.on {
  color:#29292d;
  background:#fff;
  box-shadow:0 1px 3px #26262b20;
}

.ledger {
  width:100%;
  border-collapse:collapse;
  font-size:13px;
}

.ledger th {
  font-weight:500;
  color:var(--muted);
  background:#efeff1;
  text-align:left;
}

.ledger td,.ledger th {
  padding:12px 11px;
  border-top:1px solid var(--line);
}

.ledger td:first-child,.ledger th:first-child {
  padding-left:23px;
}

.ledger td:last-child,.ledger th:last-child {
  padding-right:23px;
}

.ledger .n {
  text-align:right;
  font-variant-numeric:tabular-nums;
}

.ledger tbody tr:not(.group):hover {background:#fafafb}

.ledger .km {
  font-weight:650;
  color:var(--deep);
}

.ledger .group td {
  background:#f8f8f9;
  font-weight:600;
}

.tree {
  display:inline-flex;
  gap:8px;
  align-items:center;
  font:inherit;
  background:none;
  border:0;
  padding:1px 6px 1px 0;
}

.tree span {
  width:11px;
  color:#76767f;
}

.badge {
  display:inline-block;
  font-size:11px;
  font-weight:500;
  color:#85510c;
  background:#fbefd5;
  border-radius:3px;
  padding:2px 6px;
}

.muted {
  color:var(--muted);
}

.foot {
  padding:11px 22px;
  color:var(--muted);
  border-top:1px solid var(--line);
  font-size:12px;
}

.empty-msg {
  padding:26px;
  color:var(--muted);
  text-align:center;
}

.days {
  display:grid;
  grid-template-columns:repeat(16,minmax(35px,1fr));
  gap:5px;
  padding:0 22px 18px;
}

.day-cell {
  border:1px dashed #cdcdd1;
  border-radius:4px;
  height:34px;
  background:#fcfcfd;
  color:#60616a;
  font:13px var(--num);
}

.day-cell.saved {
  border-style:solid;
  background:#efeff2;
  border-color:#d5d5dc;
  color:#363640;
}

.day-cell:hover {
  border-color:var(--action);
  color:var(--action);
}

.config-form {
  padding:0 22px 14px;
}

.config-group {
  border:0;
  border-top:1px solid var(--line);
  margin:14px 0 22px;
  padding:12px 0 0;
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px 20px;
}

.config-group legend {
  font-size:15px;
  font-weight:600;
  padding:0 8px 0 0;
}

.field {
  display:grid;
  gap:5px;
  font-size:13px;
}

.field>span {
  color:var(--muted);
}

.config-input {
  width:100%;
  font-variant-numeric:tabular-nums;
}

.config-bar {
  padding:15px 22px;
  background:#f7f7f8;
  border-top:1px solid var(--line);
}

dialog {
  border:1px solid var(--line);
  box-shadow:0 12px 60px #16161c33;
  border-radius:8px;
  padding:24px 28px;
  max-width:800px;
  min-width:400px;
  max-height:80vh;
}

dialog::backdrop {
  background:#1a1b2440;
}

dialog h2 {
  margin-top:0;
  font-size:20px;
}

dialog p {
  color:var(--muted);
}

.dialogfoot {
  justify-content:flex-end;
  margin-top:18px;
}

.toast {
  position:fixed;
  bottom:22px;
  right:26px;
  background:var(--deep);
  color:white;
  padding:10px 16px;
  border-radius:5px;
  z-index:4;
  max-width:550px;
}

.toast:empty {
  display:none;
}

.config-alert {
  color:#925300;
}

.rule-note {
  margin:10px 22px 20px;
  padding:12px 15px;
  background:#f5f5f7;
  color:var(--muted);
  font-size:13px;
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible {
  outline:2px solid #65677a;
}

.day-cell {
  height:49px;
  display:grid;
  align-content:center;
  gap:3px;
}

.day-cell strong {
  font:600 13px var(--num);
}

.day-cell small {
  font-size:10px;
  line-height:1.2;
  color:var(--muted);
}

.day-cell.saved small {
  color:var(--action);
}

.daily-workspace {
  display:grid;
  grid-template-columns:minmax(0,1.55fr) minmax(0,1fr);
  align-items:start;
  gap:16px;
  margin-top:16px;
}
.daily-left {min-width:0}
.daily-left .trend-panel {margin:0}
.daily-evidence {
  position:sticky;
  top:12px;
  min-width:0;
}
.daily-workspace .daily-evidence .record-evidence {
  max-height:calc(100vh - 24px);
  overflow-y:auto;
  overscroll-behavior:auto;
}
.daily-list .panel-title {align-items:center}
.daily-list .tools {flex-wrap:wrap}
.daily-list .tools input {width:min(240px,56%)}
.daily-workspace .daily-list {margin-top:0;min-width:0}
.daily-ledger {width:100%;table-layout:fixed}
.daily-ledger tbody tr {cursor:pointer}
.daily-ledger th:nth-child(1) {width:10%}
.daily-ledger th:nth-child(2) {width:16%}
.daily-ledger th:nth-child(3) {width:29%}
.daily-ledger th:nth-child(4) {width:15%}
.daily-ledger th:nth-child(5),.daily-ledger th:nth-child(6) {width:15%}
.verdict {white-space:nowrap}
.verdict.empty-run {color:#85510c;background:#fff2da;border-radius:4px;padding:2px 5px}
.daily-ledger td,.daily-ledger th {padding:9px 9px;vertical-align:middle}
.daily-ledger td:first-child,.daily-ledger th:first-child {padding-left:16px}
.daily-ledger td:last-child,.daily-ledger th:last-child {padding-right:16px}
.daily-ledger .daily-pick {
  padding:1px 0;
  color:var(--ink);
  border:0;
  background:none;
  font:inherit;
  text-align:left;
}
.daily-pick strong,.daily-distance strong {font-weight:600}
.daily-km,.daily-identity small,.daily-accounting {display:block}
.daily-identity small,.daily-accounting {color:var(--muted);font-size:12px}
.daily-window time {white-space:nowrap;font-variant-numeric:tabular-nums}
.daily-ledger tbody tr.is-selected td {background:#eeeef1}
.daily-ledger tbody tr.is-selected td:first-child {box-shadow:inset 3px 0 #4d4e54}
.daily-ledger .daily-accounting {font-weight:400}

.month-windows {width:min(660px,65vw)}

.record-pager {display:flex;justify-content:flex-end;align-items:center;gap:10px;padding:12px 16px;border-top:1px solid var(--line);font-size:13px}
.record-pager label {margin-right:auto}
.record-pager select {padding:4px 6px;background:#fff;border:1px solid var(--line);border-radius:4px}
.record-pager button.btn {min-height:30px;padding:3px 9px}

.daily-table-tools {display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;padding:0 22px 12px}
.daily-table-tools .tools {padding:0;flex:1}
.daily-table-tools .btn {white-space:nowrap}

.nav-group + .nav-group {margin-top:12px}
.etc-preview {display:block;width:100%;height:calc(100vh - 180px);min-height:560px;border:0}

.config-group .field-help { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

.month-actions {display:flex;align-items:center;gap:12px}
.analysis-rules {margin:16px 0;background:white;border:1px solid var(--line);border-radius:6px}
.analysis-rules summary {padding:11px 16px;cursor:pointer;font-size:13px;font-weight:600}
.analysis-rules > div {max-width:100ch;padding:0 18px 13px}
.analysis-rules p {margin:0 0 8px;color:var(--ink);font-size:13px;line-height:1.7}
.analysis-rules .rule-archive {color:var(--muted);margin-bottom:0}
.analysis-rules summary:focus-visible {outline:2px solid var(--action);outline-offset:2px}
