﻿:root {
 color-scheme: dark;
 font: 17px/1.5 system-ui, "Microsoft YaHei", sans-serif;
 color: #e0e5e9;
 background: #212529;
}
* { box-sizing: border-box; }
body { margin: 0; }
main { width: 90%; max-width: 1700px; margin: 20px auto; }
nav { display: flex; gap: 18px; padding-bottom: 13px; margin-bottom: 17px; border-bottom: 1px solid #444b51; }
a { color: #6eacff; text-decoration: none; }
a:hover { text-decoration: underline; }
input, button {
 font: inherit;
 color: inherit;
 background: transparent;
 border: 1px solid #495057;
 padding: .48em .75em;
}
input { width: 100%; min-width: 0; border-radius: 6px; }
button { cursor: pointer; }
button:hover { background: #343a40; }
:focus-visible { outline: 2px solid #75adfa; outline-offset: 2px; }
#route-list { border-top: 1px solid #444b51; margin-top: 16px; padding-top: 14px; }
#route-list a { display: block; width: fit-content; }
.vehicle-form { display: flex; }
.vehicle-form input { flex: 1; border-radius: 6px 0 0 6px; }
.vehicle-form button { white-space: nowrap; border-left: 0; }
.vehicle-form button:last-child { border-radius: 0 6px 6px 0; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 8px 0 16px; font-size: .85rem; }
.legend i { display: inline-block; width: 15px; height: 9px; margin-right: 4px; }
.up { background: #71a8f5; }
.down { background: #e3e8ec; }
.other { background: #858c95; }
.muted { color: #aeb8c0; font-size: .88rem; }
.scroll { overflow-x: auto; }
.timeline { width: 100%; min-width: 0; font-size: .9rem; }
.timeline-row { display: grid; grid-template-columns: minmax(72px, 9vw) minmax(0, 1fr); min-height: 25px; align-items: center; }
.track { position: relative; height: 19px; }
.segment { position: absolute; top: 4px; min-width: 1px; height: 10px; }
.axis { height: 33px; border-bottom: 1px solid #444b51; }
.tick { position: absolute; max-width: 12%; overflow: hidden; font-size: .72rem; color: #b9c3cc; white-space: nowrap; }
.records, .matrix { border-collapse: collapse; margin: 14px 0; }
.records { width: 100%; min-width: 760px; }
th, td { text-align: left; padding: 2px 10px 2px 0; white-space: nowrap; font-weight: normal; }
th { border-bottom: 1px solid #444b51; padding-bottom: 7px; }
.matrix th, .matrix td { min-width: 72px; text-align: center; padding: 0 6px; }
.matrix th { padding-bottom: 10px; }
.matrix tbody tr:nth-child(odd) td:first-child { background: #303438; }
.matrix td.active { background: #236e35; padding: 0; }
.matrix td.active a { display: block; min-height: 26px; }
.pagination { display: flex; gap: 8px; align-items: center; margin: 18px 0 4px; }
.direction-switch { margin-left: 8px; color: inherit; font-size: inherit; text-decoration: none; cursor: pointer; border-bottom: 1px solid transparent; }
.direction-switch:hover { text-decoration: none; border-bottom-color: currentColor; }
.pagination a, .pagination .current { min-width: 1.9rem; padding: .18rem .55rem; border-radius: 6px; text-align: center; font-size: .9rem; line-height: 1.6; }
.pagination a { color: #98a2ab; border: 1px solid #3a4249; text-decoration: none; }
.pagination a:hover { color: #e0e5e9; border-color: #5b666f; background: #2a2f34; }
.pagination .current { color: #cdd4da; background: #31373d; border: 1px solid #454e56; }
.error { color: #ffb4a9; }

/* 地图页 */
.map-title { font-size: 1.05rem; margin-bottom: 4px; }
.bus-map { height: 68vh; min-height: 420px; border: 1px solid #3a4249; border-radius: 8px; margin: 12px 0 8px; background: #1b1f23; }
/* 容器固定尺寸，图标绝对居中：地图锚点就是图标中心 */
.bus-marker { position: relative; width: 64px; height: 34px; cursor: pointer; }
.bus-marker .bus-icon { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); height: 20px; width: auto; display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,.3)); }
.bus-marker .bus-label { position: absolute; left: 50%; bottom: calc(50% + 13px); transform: translateX(-50%); background: #2b3a45; color: #fff; font-size: 9px; line-height: 12px; padding: 0 4px; border-radius: 3px; white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.plane-icon { width: .88em; height: .88em; vertical-align: -.08em; margin-right: 3px; opacity: .9; }
.card-panel{background:#2a2f34;border-radius:10px;padding:12px 14px;margin:14px 0}
.chart-title{font-size:12px;color:#7b8794;margin-bottom:8px}
.hour-chart{display:flex;align-items:flex-end;gap:2px;height:64px}
.hour-bar{flex:1;min-height:2px;background:currentColor;opacity:.55;border-radius:2px 2px 0 0}
.hour-axis{display:flex;gap:2px;margin-top:4px}
.hour-tick{flex:1;font-size:9px;color:#7b8794;text-align:left}
.fleet-wrap{ max-height: 72vh; overflow: auto; }
.fleet-matrix th.fleet{ writing-mode: vertical-rl; transform: rotate(180deg); font-size: 12px; color:#8fa0ad; min-width: 28px; padding: 0 2px; text-align: center; }
.fleet-matrix td{ min-width: 28px; height: 28px; padding: 0; border: none; }
.fleet-matrix td.date{ min-width: 112px; text-align: left; padding: 0 10px; color:#e0e5e9; font-size: 14px; position: sticky; left: 0; background: #212529; z-index: 2; }
.fleet-matrix tbody tr.weekday td.date{ background: #212529; }
.fleet-matrix tbody tr.weekend td.date{ background: #3a3f45; }
.fleet-matrix tbody td:not(.date){ background-image: linear-gradient(to right, transparent calc(50% - 0.5px), rgba(255,255,255,0.16) calc(50% - 0.5px), rgba(255,255,255,0.16) calc(50% + 0.5px), transparent calc(50% + 0.5px)); }
.fleet-matrix tbody td.on{ background-color: #236e35; background-image: none; }
.fleet-matrix thead th{ position: sticky; top: 0; background: #212529; z-index: 3; }
.fleet-matrix thead th:first-child{ left: 0; z-index: 4; background: #212529; }
.fleet-matrix th.fleet a{ color:#6eacff; text-decoration:none; }
.fleet-matrix th.fleet a:hover{ text-decoration:underline; }
.service-hours{ font-size: .95rem; color: #cfd8de; letter-spacing: .02em; margin: 2px 0 6px; }
