:root {
  color-scheme: dark;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  --bg: #090f16;
  --panel: #121a23;
  --panel-2: #18222c;
  --line: #26323e;
  --line-blue: #22445d;
  --text: #d5dde5;
  --muted: #778693;
  --cyan: #28b8ff;
  --teal: #27e3c2;
  --orange: #ff6d4a;
  --yellow: #f1ca32;
  --red: #f45861;
}

* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; margin: 0; }
body { min-height: 100vh; min-height: 100dvh; overflow: hidden; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* 登录页 */
.login-view { position: relative; width: 100%; height: 100vh; height: 100dvh; overflow: hidden; background: #071a38; color: #68717e; }
.login-version { position: absolute; z-index: 2; top: 24px; left: 25px; margin: 0; color: rgba(207,222,244,.62); font-size: 14px; line-height: 17px; }
.login-stage {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  background: #071a38 url("./static/imgs/background.png") center / cover no-repeat; container-type: inline-size;
}
.login-form { position: absolute; top: 30.2%; left: 13.55%; width: 21.5%; margin: 0; }
.login-brand { margin-bottom: 2.35cqw; }
.login-brand img { display: block; width: 9.35cqw; height: auto; }
.login-brand p { margin: 1.05cqw 0 0; color: rgba(207,222,244,.58); font-size: .65cqw; white-space: nowrap; }
.login-field {
  display: flex; align-items: center; width: 21.5cqw; height: 2.35cqw; margin-bottom: 1.85cqw; padding: 0 1.15cqw;
  background: rgba(79,93,153,.28); border: 1px solid transparent; color: rgba(177,194,220,.46);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.login-field-password { background: rgba(79,93,153,.34); border-color: #1688df; box-shadow: 0 0 .75cqw rgba(0,139,255,.48); }
.login-field:focus-within { background: rgba(73,93,153,.4); border-color: #1b9bf3; box-shadow: 0 0 .8cqw rgba(0,151,255,.52); }
.login-field svg { flex: 0 0 auto; width: .85cqw; height: .85cqw; margin-right: .7cqw; fill: currentColor; stroke: currentColor; stroke-width: 1.6; }
.login-field input { min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: #dcecff; font-size: .76cqw; caret-color: #24a8ff; }
.login-field input::placeholder { color: rgba(177,194,220,.46); opacity: 1; }
.login-form > button {
  display: block; width: 9.5cqw; height: 2.35cqw; margin-top: 2.7cqw; padding: 0; border: 0; border-radius: 0;
  background: linear-gradient(90deg,#28a9f5 0%,#56b7f5 51%,#ee7779 100%); color: rgba(255,255,255,.9); font-size: .76cqw; cursor: pointer;
}
.login-form > button:hover { filter: brightness(1.1); }
.login-error { position: absolute; top: calc(100% + .8cqw); margin: 0; color: #ff8a8a; font-size: .62cqw; white-space: nowrap; }

/* 应用骨架 */
.app-view { height: 100vh; min-height: 620px; overflow: hidden; background: radial-gradient(circle at 50% 0,#102333 0,transparent 33%), var(--bg); }
.topbar {
  height: 55px; display: grid; grid-template-columns: 170px 1fr auto; align-items: stretch; border-bottom: 1px solid #1a3446;
  background: rgba(8,15,22,.97); box-shadow: 0 8px 25px rgba(0,0,0,.28); z-index: 10;
}
.brand-button { display: flex; align-items: center; padding: 0 16px; border: 0; background: transparent; cursor: pointer; }
.brand-button img { width: 104px; height: auto; image-rendering: auto; }
.main-nav { display: flex; justify-content: center; gap: clamp(14px,2.5vw,50px); min-width: 0; }
.nav-item {
  position: relative; padding: 0 2px; border: 0; background: transparent; color: #8d9ba7; font-size: 13px; white-space: nowrap; cursor: pointer;
}
.nav-item::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; transform: scaleX(0); background: #f5f8fa; transition: transform .18s; }
.nav-item:hover, .nav-item.active { color: #fff; }
.nav-item.active::after { transform: scaleX(1); }
.top-actions { display: flex; align-items: center; gap: 18px; padding: 0 20px; color: #7f8b94; font-size: 12px; white-space: nowrap; }
.top-icon { font-size: 17px; color: #a2adb4; }
.logout-button { border: 0; background: transparent; color: #6e7c86; cursor: pointer; }
.logout-button:hover { color: #fff; }
.workspace { height: calc(100vh - 55px); min-height: 565px; padding: 10px; overflow: auto; scrollbar-color: #264255 #0a1118; }
.workspace:has(.cockpit) { padding: 0; overflow: hidden; }

/* 通用大屏组件 */
.page { min-width: 1040px; min-height: 100%; animation: pageIn .24s ease; }
@keyframes pageIn { from { opacity: .3; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.dashboard-grid { display: grid; grid-template-columns: 252px minmax(0,1fr) 252px; gap: 10px; height: calc(100vh - 75px); min-height: 545px; }
.content-grid { display: grid; grid-template-columns: 242px minmax(0,1fr); gap: 10px; height: calc(100vh - 75px); min-height: 545px; }
.main-stack { display: grid; grid-template-rows: auto minmax(0,1fr); gap: 10px; min-width: 0; min-height: 0; }
.panel { min-width: 0; min-height: 0; overflow: hidden; border: 1px solid #1f2c37; background: rgba(18,26,35,.94); }
.panel-title {
  display: flex; align-items: center; min-height: 35px; padding: 0 12px; border-bottom: 1px solid #222f3a; color: #dce3e8; font-size: 13px; font-weight: 600;
}
.panel-title::before { content: ""; width: 5px; height: 5px; margin-right: 8px; background: var(--orange); box-shadow: 0 0 7px rgba(255,109,74,.7); }
.panel-title .title-actions { margin-left: auto; display: flex; gap: 8px; }
.panel-title .fault-title-actions { margin-left: 18px; }
.panel-title .compact-title-actions { margin-left: 18px; }
.panel-title .generation-title-actions { margin-left: 18px; }
.trend-key { display: inline-flex; align-items: center; gap: 4px; color: #7f909b; font-size: 10px; white-space: nowrap; }
.trend-key::before { content: ""; display: inline-block; width: 17px; border-top: 2px solid currentColor; }
.yellow-key { color: var(--yellow); }.yellow-key::before { border-top-style: dashed; }.cyan-key { color: var(--cyan); }
.trend-actions-spacer { flex: 1; min-width: 24px; }
.panel-title .trend-title-actions { flex: 1; }
.panel-title .trend-title-actions .dark-select { width: 86px; flex: 0 0 86px; }
.panel-filter-row { display: flex; justify-content: flex-end; padding: 8px 12px 0; background: rgba(18,26,35,.94); }
.kpi-grid { display: grid; grid-template-columns: repeat(var(--kpis,6),minmax(0,1fr)); gap: 10px; }
.kpi-card { position: relative; min-height: 74px; padding: 13px 15px; overflow: hidden; border: 1px solid #244050; background: linear-gradient(135deg,#19242d,#17212a); }
.kpi-card::after { content: ""; position: absolute; inset: auto -30px -45px auto; width: 100px; height: 80px; border-radius: 50%; background: rgba(40,184,255,.07); filter: blur(12px); }
.kpi-label { color: #6f8594; font-size: 11px; }
.kpi-value { margin-top: 7px; color: #8fdcff; font-size: 22px; letter-spacing: .3px; }
.kpi-unit { margin-left: 5px; color: #71828f; font-size: 10px; }
.delta { margin-left: 7px; font-size: 10px; }
.positive { color: var(--teal); }
.negative { color: var(--red); }
.muted { color: var(--muted); }
.accent { color: var(--cyan); }

.station-list { height: 100%; display: flex; flex-direction: column; }
.station-toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px; }
.station-search-row { grid-template-columns: minmax(0,1fr) auto; padding-top: 0; }
.dark-select, .dark-input { width: 100%; height: 30px; padding: 0 9px; border: 1px solid #263746; border-radius: 0; outline: 0; background: #111a22; color: #7f8e9a; font-size: 11px; }
.station-scroll { flex: 1; overflow: auto; scrollbar-width: thin; }
.station-row { width: 100%; padding: 10px 12px; text-align: left; border: 0; border-bottom: 1px solid #1d2832; background: transparent; cursor: pointer; }
.station-row:hover, .station-row.active { background: linear-gradient(90deg,rgba(31,91,124,.42),rgba(18,26,35,.12)); box-shadow: inset 3px 0 var(--cyan); }
.station-line { display: flex; justify-content: space-between; gap: 8px; color: #cbd5dc; font-size: 11px; }
.station-meta { margin-top: 6px; color: #66808f; font-size: 10px; }
.status-dot { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 7px currentColor; }
.mini-track { height: 3px; margin-top: 9px; background: #263440; }
.mini-track span { display: block; height: 100%; background: linear-gradient(90deg,#38ceff,#3587d5); }

.map-panel { position: relative; min-height: 0; background: radial-gradient(circle at 51% 47%,rgba(31,93,120,.19),transparent 59%),linear-gradient(180deg,#0d171f,#0b131a); }
.china-map { position: absolute; inset: 2.5% 3% 2%; width: 94%; height: 95.5%; overflow: visible; }
.province-shape { fill: #12232d; stroke: #426577; stroke-width: 1.15; vector-effect: non-scaling-stroke; transition: fill .2s ease,stroke .2s ease; }
.province-shape:hover { fill: #183744; stroke: #5ba1bd; }
.province-label { fill: #597481; font-size: 8.5px; text-anchor: middle; pointer-events: none; user-select: none; }
.map-station { cursor: pointer; outline: 0; }
.station-pulse { fill: rgba(40,184,255,.15); stroke: rgba(40,184,255,.38); stroke-width: 1; transform-box: fill-box; transform-origin: center; animation: mapPulse 2.4s ease-out infinite; }
.station-pin { filter: drop-shadow(0 0 5px rgba(100,211,255,.64)); transition: transform .18s ease; transform-box: fill-box; transform-origin: center bottom; }
.map-station:hover .station-pin,.map-station:focus .station-pin,.map-station.active .station-pin { transform: scale(1.22); }
.station-core { fill: #08141b; stroke: #66d8ff; stroke-width: 2.5; filter: url(#mapGlow); transition: r .18s ease; }
.map-station.hot .station-pulse { fill: rgba(255,96,75,.16); stroke: rgba(255,96,75,.42); }
.map-station.hot .station-core { stroke: #ff735e; }
.map-station:hover .station-core,.map-station:focus .station-core,.map-station.active .station-core { r: 6px; fill: #20aee8; }
.station-tooltip { opacity: 0; pointer-events: none; transform-box: fill-box; transform-origin: left center; transition: opacity .18s ease; }
.map-station:hover .station-tooltip,.map-station:focus .station-tooltip,.map-station.active .station-tooltip,.map-station.tooltip-open .station-tooltip { opacity: 1; }
.station-tooltip rect { fill: rgba(34,42,49,.95); stroke: rgba(87,104,114,.45); stroke-width: 1; filter: drop-shadow(0 8px 14px rgba(0,0,0,.35)); }
.station-tooltip > line { stroke: #2faef0; stroke-width: 2; }
.station-tooltip text { pointer-events: none; }
.tooltip-title { fill: #d8e0e4; font-size: 13px; font-weight: 600; }
.tooltip-type { fill: #7d8b92; font-size: 10px; }
.tooltip-coordinate { fill: #8b9aa2; font-size: 9px; }
.tooltip-capacity { fill: #a8dff8; font-size: 18px; }
.tooltip-capacity-label { fill: #83919a; font-size: 9px; }
.map-empty { display: grid; height: 100%; place-items: center; color: var(--muted); }
@keyframes mapPulse { 0% { transform: scale(.45); opacity: .9; } 75%,100% { transform: scale(1.45); opacity: 0; } }

/* 驾驶舱首页：地图为底层，业务面板悬浮在地图上方 */
.cockpit { position: relative; height: calc(100vh - 55px); min-height: 600px; overflow: hidden; border: 0; background: #0a1117; }
.cockpit::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(90deg,rgba(6,12,17,.8) 0,rgba(6,12,17,.13) 20%,transparent 38%,transparent 65%,rgba(6,12,17,.1) 80%,rgba(6,12,17,.76) 100%),linear-gradient(180deg,rgba(4,10,14,.25),transparent 26%,rgba(5,10,14,.1)); }
.cockpit-map { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(circle at 52% 48%,#16252d 0,#0c151c 54%,#080e13 100%); }
.cockpit-map::before { content: ""; position: absolute; inset: 0; opacity: .22; background-image: linear-gradient(rgba(94,126,143,.07) 1px,transparent 1px),linear-gradient(90deg,rgba(94,126,143,.07) 1px,transparent 1px); background-size: 36px 36px; transform: perspective(500px) rotateX(58deg) scale(1.45); transform-origin: center bottom; }
.cockpit-map .china-map { inset: -8% 6% -10%; width: 88%; height: 118%; filter: drop-shadow(0 0 16px rgba(135,175,193,.22)); }
.cockpit-map .province-shape { fill: #172128; stroke: #738590; stroke-width: .92; }
.cockpit-map .province-shape:hover { fill: #21343e; stroke: #a8c1cd; }
.cockpit-map .province-label { fill: #7b8990; opacity: .5; }
.overview-kpis { position: absolute; z-index: 4; top: 14px; left: 24px; right: 24px; }
.overview-kpis .kpi-grid { gap: 13px; }
.overview-kpis .kpi-card { min-height: 66px; padding: 11px 16px; border-color: rgba(49,87,107,.82); background: linear-gradient(105deg,rgba(27,42,52,.82),rgba(31,43,51,.68)); box-shadow: inset 1px 0 #3b6c85,0 5px 20px rgba(0,0,0,.12); backdrop-filter: blur(1.5px); }
.overview-kpis .kpi-value { margin-top: 5px; color: #a6dcf1; font-size: 19px; }
.cockpit-left,.cockpit-right { position: absolute; z-index: 5; top: 95px; bottom: 14px; display: grid; gap: 14px; width: 232px; }
.cockpit-left { left: 24px; grid-template-rows: minmax(0,1.08fr) minmax(210px,.92fr); }
.cockpit-right { right: 24px; grid-template-rows: minmax(0,1fr) 210px; }
.effect-panel { min-height: 0; overflow: hidden; border: 1px solid rgba(63,82,94,.38); background: linear-gradient(110deg,rgba(18,26,33,.78),rgba(18,26,33,.61)); box-shadow: 0 12px 28px rgba(0,0,0,.16); backdrop-filter: blur(2px); }
.effect-panel > .panel-title { position: relative; min-height: 34px; padding: 0 10px 0 16px; border: 0; background: url("./static/imgs/红点状态.png") left center / 168px 17px no-repeat;color: #e0e8ec; font-size: 13px; }
.effect-panel > .panel-title::before { display: none; }
.operation-panel { display: flex; flex-direction: column; }
.operation-head,.operation-row { display: grid; grid-template-columns: 1.25fr .72fr .88fr .62fr; align-items: center; column-gap: 5px; }
.operation-head { margin: 0 6px; padding: 8px 7px; color: #71838d; font-size: 10px; border-top: 1px solid #273640; border-bottom: 1px solid #273640; }
.operation-body { flex: 1; min-height: 0; overflow: hidden; padding: 2px 6px 5px; }
.operation-row { width: 100%; min-height: 31px; padding: 0 7px; border: 0; background: transparent; color: #8a9ba4; text-align: left; font-size: 10px; cursor: pointer; }
.operation-row:nth-child(odd) { background: rgba(119,137,148,.045); }
.operation-row:hover,.operation-row.active { background: rgba(73,117,141,.2); color: #c7d5dc; }
.operation-name { overflow: hidden; color: #9baab2; text-overflow: ellipsis; white-space: nowrap; }
.operation-status { white-space: nowrap; }
.operation-status i { display: inline-block; width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 5px currentColor; }
.operation-status.healthy { color: #20c8aa; }.operation-status.warn { color: #d7b43c; }.operation-status.danger { color: #ed655a; }
.overview-ranking { padding: 4px 6px 7px; }
.ranking-row { display: grid; grid-template-columns: 20px minmax(0,1fr); gap: 7px; width: 100%; padding: 7px 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
.ranking-index { display: grid; place-items: center; width: 17px; height: 17px; background: #576675; color: white; font-size: 10px; }.ranking-index.r1{background:#c35155}.ranking-index.r2{background:#c77a37}.ranking-index.r3{background:#b89f38}
.ranking-main span { display: flex; justify-content: space-between; gap: 6px; color: #9aa9b1; font-size: 10px; }.ranking-main strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:400}.ranking-main em{font-style:normal;white-space:nowrap;color:#81919a}
.ranking-main i { display: block; height: 5px; margin-top: 6px; background: #34414a; transform: skewX(-18deg); overflow: hidden; }.ranking-main b{display:block;height:100%;background:linear-gradient(90deg,#2c8cb7,#65c5ef)}
.recent-panel { display: flex; flex-direction: column; }
.recent-panel .event-list { flex: 1; max-height: none; overflow: hidden; padding: 1px 9px 6px; }
.recent-panel .event { padding: 9px 0 9px 12px; font-size: 10px; line-height: 1.5; }.recent-panel .event::before{top:13px;width:4px;height:4px}.recent-panel .event.alert::before{background:var(--orange)}
.recent-panel .event strong { color: #b8c4ca; }.recent-panel .event time{float:right;color:#6d808a;font-weight:400}
.overview-trend .chart-box { min-height: 0; padding: 7px 10px 5px; }
.overview-trend .axis-label { font-size: 11px; }
.map-legend { position: absolute; z-index: 5; right: 274px; bottom: 64px; display: grid; gap: 8px; width: 136px; padding: 10px 12px; background: rgba(16,25,32,.88); color: #83929a; font-size: 9px; box-shadow: 0 8px 22px rgba(0,0,0,.24); }
.map-legend strong { color: #c1cbd0; font-weight: 500; }.map-legend span::before{content:"";display:inline-block;width:6px;height:6px;margin-right:8px;border-radius:50%;background:currentColor;box-shadow:0 0 7px currentColor}.map-legend span b{float:right;color:#8d9ba2;font-weight:400}.map-legend .normal{color:#35a9ef}.map-legend .warning{color:#e35d59}.map-legend .repair{color:#cad2d6}
.side-stack { display: grid; grid-template-rows: minmax(0,1fr) 220px; gap: 10px; }
.event-list { max-height: calc(100% - 35px); overflow: auto; padding: 5px 12px 10px; }
.event { position: relative; padding: 8px 0 8px 12px; border-bottom: 1px dashed #26323b; color: #7f909b; font-size: 10px; line-height: 1.45; }
.event::before { content: ""; position: absolute; left: 0; top: 13px; width: 4px; height: 4px; background: var(--cyan); }
.event strong { display: block; color: #b9c3ca; font-weight: 500; }

.chart-panel { display: flex; flex-direction: column; }
.chart-box { position: relative; flex: 1; min-height: 185px; padding: 12px 14px 6px; }
.chart-box svg { width: 100%; height: 100%; overflow: visible; }
.grid-line { stroke: #28343e; stroke-width: 1; }
.chart-area { opacity: .14; }
.chart-point { cursor: pointer; }
.chart-hit { pointer-events: all; }
.chart-point:hover { r: 4px; }
.chart-tooltip { position: absolute; z-index: 4; min-width: 150px; padding: 9px 11px; border: 1px solid #38505d; background: rgba(22,34,43,.96); box-shadow: 0 8px 24px rgba(0,0,0,.35); color: #a9bac4; font-size: 10px; pointer-events: none; }
.chart-tooltip strong { display: block; margin-bottom: 6px; color: #e6eef2; font-size: 12px; }
.chart-tooltip div { display: flex; align-items: center; gap: 6px; line-height: 18px; }
.chart-tooltip i { width: 8px; height: 2px; display: inline-block; }
.chart-tooltip span { flex: 1; }
.chart-tooltip b { color: #dce8ed; font-weight: 600; }
.cost-breakdown { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 12px; min-height: 180px; padding: 8px 12px; }
.cost-donut { width: 128px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: var(--cost-gradient); box-shadow: 0 0 18px rgba(36,173,255,.14); transition: transform .18s ease, filter .18s ease; }
.cost-donut > div { width: 76px; aspect-ratio: 1; display: grid; place-items: center; align-content: center; border-radius: 50%; background: #131c24; text-align: center; }
.cost-donut strong { color: #e5edf1; font-size: 16px; }.cost-donut span { color: #8d9ca5; font-size: 9px; }
.cost-donut.focused { transform: scale(1.04); filter: brightness(1.1); }
.cost-legend { display: grid; grid-template-columns: 1fr; gap: 3px; }
.cost-legend-item { display: grid; grid-template-columns: 9px 1fr auto auto; align-items: center; gap: 5px; border: 0; padding: 3px 2px; background: transparent; color: #8998a1; font-size: 10px; text-align: left; cursor: pointer; }
.cost-legend-item i { width: 8px; height: 3px; background: var(--cost-color); }.cost-legend-item b { color: #aebbc3; font-weight: 500; }.cost-legend-item em { color: #81919a; font-style: normal; }.cost-legend-item:hover,.cost-legend-item.active { color: #e5edf1; background: rgba(40,184,255,.12); }
.cost-detail { margin-top: 8px; padding-top: 6px; border-top: 1px solid #263843; color: #a9bac4; font-size: 10px; }
.charging-breakdown { display: grid; grid-template-columns: 118px 1fr; align-items: center; gap: 8px; min-height: 170px; padding: 8px; }
.charger-overview { padding: 8px 10px; overflow: auto; max-height: 220px; }.charger-row { display: grid; grid-template-columns: 1fr auto; gap: 5px 8px; padding: 8px 0; border-bottom: 1px solid #263540; font-size: 10px; color: #8597a1; }.charger-row strong { color: #c4d1d8; }.charger-row em { color: #1ed5b3; font-style: normal; }.charger-row span { grid-column: 1 / -1; }
.axis-label { fill: #667782; font-size: 10px; }
.chart-legend { display: flex; gap: 18px; margin-left: auto; color: #7f8e99; font-size: 10px; }
.legend-item::before { content: ""; display: inline-block; width: 16px; height: 2px; margin-right: 6px; vertical-align: middle; background: var(--legend); }
.donut { display: grid; place-items: center; min-height: 155px; }
.donut-ring { width: 118px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--cyan) 0 56%,var(--orange) 56% 73%,var(--yellow) 73% 87%,#7758cc 87% 100%); box-shadow: 0 0 18px rgba(36,173,255,.15); }
.donut-ring::before { content: ""; width: 76px; aspect-ratio: 1; border-radius: 50%; background: #131c24; }
.donut-center { position: absolute; text-align: center; font-size: 11px; color: #82929d; }
.donut-center strong { display: block; color: #d4dde3; font-size: 16px; }
.fault-donut { display: grid; grid-template-columns: 132px minmax(0,1fr); align-items: center; gap: 12px; min-height: 185px; padding: 8px 14px; }
.fault-donut-ring { position: relative; width: 128px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; box-shadow: 0 0 18px rgba(36,173,255,.14); }
.fault-donut-ring::before { content: ""; width: 82px; aspect-ratio: 1; border-radius: 50%; background: #131c24; }
.fault-legend { display: grid; gap: 9px; min-width: 0; }
.fault-legend-row { display: grid; grid-template-columns: 8px minmax(0,1fr) 24px; align-items: center; gap: 7px; width: 100%; padding: 2px 3px; border: 0; background: transparent; color: #8999a4; font-size: 10px; text-align: left; cursor: pointer; }
.fault-legend-row:hover, .fault-legend-row.active { background: rgba(40,184,255,.12); color: #d5e8f2; }
.fault-legend-row i { width: 6px; height: 6px; border-radius: 1px; box-shadow: 0 0 7px currentColor; }
.fault-legend-row strong { color: #b9c5cc; text-align: right; font-weight: 500; }
.fault-filters { display: flex; align-items: center; gap: 7px; }
.fault-filters .dark-select { width: 86px; height: 28px; }
.fault-filters .archive-button { height: 28px; min-width: 48px; padding: 0 8px; }

.table-wrap { height: calc(100% - 35px); overflow: auto; padding: 8px 12px 12px; }
.data-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 10px; color: #758691; }
.data-table th { position: sticky; top: 0; z-index: 1; padding: 8px 9px; text-align: left; background: #222c36; color: #a9b5bd; font-weight: 500; white-space: nowrap; }
.data-table td { padding: 7px 9px; border-bottom: 1px solid #202b34; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-table tbody tr:hover, .data-table tbody tr.selected { background: #163b56; color: #c5d8e5; }
.tag { display: inline-block; padding: 2px 5px; border: 1px solid currentColor; color: var(--teal); font-size: 9px; }
.tag.warn { color: var(--yellow); }
.tag.danger { color: var(--red); }
.empty-state { display: grid; place-items: center; min-height: 220px; color: #60717e; }

.archive-layout { display: grid; grid-template-rows: auto minmax(0,1fr); gap: 10px; height: calc(100vh - 75px); }
.archive-detail { display: grid; grid-template-columns: 240px minmax(0,1fr); gap: 10px; min-height: 0; }
.archive-button { min-width: 62px; height: 30px; padding: 0 12px; border: 1px solid #35434e; background: #1b242c; color: #8998a2; font-size: 10px; cursor: pointer; transition: border-color .18s ease,color .18s ease,background .18s ease; }
.archive-button:hover,.archive-button:focus-visible { border-color: #3b8db5; background: #1c303b; color: #d5e8f2; outline: 0; }
.archive-button.primary { border-color: #2f7598; color: #9ddcf8; }
.archive-button.danger:hover,.archive-button.danger:focus-visible { border-color: #c95151; background: #392326; color: #ffaaa4; }
.archive-button:disabled { opacity: .5; cursor: wait; }
.archive-record > .panel-title { min-height: 45px; padding-left: 15px; background: #171f27; }
.archive-record > .panel-title .title-actions { align-self: stretch; align-items: center; }
.detail-body { height: calc(100% - 35px); overflow: auto; padding: 14px; }
.detail-section { margin-bottom: 10px; border: 1px solid #202c36; }
.detail-section h3 { margin: 0; padding: 9px 12px; border-bottom: 1px solid #25313a; color: #c9d3da; font-size: 12px; font-weight: 500; }
.detail-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 18px; padding: 16px 12px; }
.detail-item span { display: block; margin-bottom: 7px; color: #687b88; font-size: 10px; }
.detail-item strong { color: #9fdfff; font-size: 11px; font-weight: 500; }
.source-ledger { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; }
.source-card { padding: 12px; border-left: 2px solid var(--cyan); background: #17212a; }
.source-card strong { display: block; color: #aab8c1; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-card span { display: block; margin-top: 8px; color: #5f7684; font-size: 10px; }

.split-charts { display: grid; grid-template-columns: 1.45fr 1fr .92fr; gap: 10px; min-height: 225px; }
.score-row { display: grid; grid-template-columns: 90px repeat(4,1fr) 42px; align-items: center; gap: 14px; padding: 8px 10px; border-bottom: 1px solid #202a33; font-size: 10px; }
.score-track { height: 4px; background: #303943; }
.score-track span { display: block; height: 100%; background: var(--score-color,var(--cyan)); }
.rank { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-right: 8px; background: #49535c; color: white; font-size: 9px; }
.rank.r1 { background: #d14e54; } .rank.r2 { background: #d98c33; } .rank.r3 { background: #be9b35; }

.loading-state { height: 100%; display: grid; place-content: center; justify-items: center; gap: 12px; color: #6e808c; }
.loading-state span { width: 30px; height: 30px; border: 2px solid #233b4b; border-top-color: var(--cyan); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 50; padding: 10px 14px; border: 1px solid #2b5065; background: #10202b; color: #bfeaff; font-size: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.toast.error { border-color: #7f3939; background: #2a1719; color: #ffb1aa; }
.inspection-photo { width: 90px; height: 70px; margin: 5px 6px 0 0; object-fit: cover; border: 1px solid #315064; }
.station-multiselect { min-height: 132px; height: 132px; padding: 4px; }
.station-multiselect option { padding: 6px 8px; }
.field-hint { display: block; margin-top: 5px; color: #6f8490; font-size: 10px; }
.inspector-admin-row { display: flex; align-items: center; gap: 6px; padding: 8px 0; border-bottom: 1px solid #24323c; }
.inspector-admin-row span { flex: 1; color: #b9c8d0; }
.dialog-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; background: transparent; }
.station-dialog { width: min(620px,calc(100vw - 40px)); border: 1px solid #304754; background: #111a22; box-shadow: 0 24px 70px rgba(0,0,0,.58); }
.station-dialog > header { display: flex; align-items: center; justify-content: space-between; height: 48px; padding: 0 16px; border-bottom: 1px solid #293944; background: #18232c; }
.station-dialog h2 { margin: 0; color: #d7e2e8; font-size: 14px; font-weight: 500; }
.station-dialog > header button { width: 28px; height: 28px; border: 0; background: transparent; color: #82919a; font-size: 20px; cursor: pointer; }
.station-dialog form { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 18px; padding: 20px; }
.station-dialog label span { display: block; margin-bottom: 7px; color: #798b96; font-size: 10px; }
.station-dialog input,.station-dialog select { width: 100%; height: 34px; padding: 0 10px; border: 1px solid #2d414e; outline: 0; background: #0e171e; color: #c4d1d8; font-size: 11px; }
.station-dialog input:focus,.station-dialog select:focus { border-color: #358cb7; box-shadow: 0 0 0 2px rgba(40,184,255,.1); }
.station-dialog footer { grid-column: 1/-1; display: flex; justify-content: flex-end; gap: 10px; padding-top: 7px; }
.dialog-error { grid-column: 1/-1; min-height: 16px; margin: 0; color: #ff8178; font-size: 10px; }
.confirm-dialog { width: min(430px,calc(100vw - 40px)); }
.confirm-copy { padding: 22px 20px 8px; color: #94a4ad; font-size: 11px; line-height: 1.7; }.confirm-copy strong{display:block;margin-bottom:7px;color:#e1e9ed;font-size:14px}.confirm-copy p{margin:0}
.confirm-dialog > .dialog-error { margin: 0 20px; }.confirm-dialog > footer{display:flex;justify-content:flex-end;gap:10px;padding:15px 20px 20px}

@media (max-width: 1250px) {
  .topbar { grid-template-columns: 130px 1fr auto; }
  .brand-button img { width: 92px; }
  .main-nav { gap: 14px; }
  .top-actions { gap: 10px; padding-right: 10px; }
  .top-icon { display: none; }
}

@media (max-width: 700px) {
  body { overflow: auto; }
  .login-view { height: 100vh; height: 100dvh; }
  .login-version { top: 18px; left: 20px; color: rgba(220,232,248,.65); }
  .login-stage { width: 100%; min-height: 100%; background-position: 64% center; }
  .login-form { top: 29%; left: 9%; width: 82%; }
  .login-brand { margin-bottom: 42px; }
  .login-brand img { width: 124px; }
  .login-brand p { margin-top: 10px; font-size: 11px; }
  .login-field { width: min(100%,320px); height: 42px; margin-bottom: 16px; padding: 0 14px; }
  .login-field svg { width: 15px; height: 15px; margin-right: 10px; }
  .login-field input, .login-form > button { font-size: 13px; }
  .login-form > button { width: 128px; height: 40px; margin-top: 28px; }
  .login-error { top: calc(100% + 12px); font-size: 12px; }
  .app-view { min-height: 100vh; overflow: auto; }
  .topbar { position: sticky; top: 0; grid-template-columns: 110px 1fr; height: auto; min-height: 55px; }
  .main-nav { grid-column: 1/-1; justify-content: flex-start; gap: 20px; padding: 0 14px; overflow-x: auto; border-top: 1px solid #172732; }
  .nav-item { min-height: 42px; }
  .top-actions { justify-self: end; }
  .top-actions time, .top-actions .top-icon { display: none; }
  .workspace { height: auto; min-height: calc(100vh - 98px); overflow: visible; }
}

@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
