:root {
  color-scheme: dark;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --bg: #090d0e;
  --surface: #111617;
  --surface-deep: #0b1010;
  --surface-hover: #182121;
  --line: #293432;
  --line-strong: #374643;
  --text: #eef4f0;
  --muted: #a3b1ac;
  --quiet: #788781;
  --brand: #73f87e;
  --brand-hover: #9aff9f;
  --signal: #6fdfc4;
  --active: #8de99f;
  --expired: #ffa69f;
  --unknown: #f3d793;
  --radius: 3px;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-size: 1rem; }
a { color: inherit; text-decoration: none; }
button,input,select { font: inherit; }
button,a.action { cursor: pointer; }
button:disabled,select:disabled { cursor: default; opacity: .53; }
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
[hidden] { display: none !important; }
h1,h2,p { margin: 0; }
h1 { font-size: clamp(1.65rem, 3vw, 2.26rem); font-weight: 720; letter-spacing: .015em; }
h2 { font-size: 1rem; font-weight: 660; }
small,.muted { color: var(--muted); }
.topbar { min-height: 57px; padding: 0 clamp(16px,2.5vw,38px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 29px; background: var(--surface-deep); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 720; letter-spacing: .075em; white-space: nowrap; }
.brand-mark { width: 18px; height: 18px; border: 1px solid var(--signal); position: relative; transform: rotate(45deg); margin: 3px; }
.brand-mark::after { content: ""; position: absolute; inset: 4px; background: var(--brand); }
.topbar nav { display: flex; align-self: stretch; gap: 4px; }
.topbar nav a { display: flex; align-items: center; padding: 0 15px; color: var(--muted); white-space: nowrap; border-bottom: 2px solid transparent; font-size: .9rem; }
.topbar nav a:hover { background: var(--surface-hover); color: var(--text); }
.topbar nav a[aria-current=page] { color: var(--brand); border-color: var(--brand); background: #73f87e0d; }
.account { margin-left: auto; display: flex; align-items: center; gap: 11px; color: var(--muted); font-size: .88rem; }
.primary,.quiet { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 8px 13px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; font-size: .875rem; font-weight: 650; transition: background-color .14s, border-color .14s; }
.primary { background: var(--brand); border-color: var(--brand); color: #0a170a; }
.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.quiet { background: var(--surface); color: var(--text); }
.quiet:hover { background: var(--surface-hover); border-color: #607972; }
.console,.admin-shell { width: min(1800px,100%); margin: 0 auto; padding: 18px clamp(14px,2.5vw,38px) 24px; }
.console-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding-bottom: 13px; }
.heading-tools { display: flex; align-items: center; gap: 12px; }
.connection { display: inline-flex; gap: 7px; align-items: center; color: var(--muted); font-size: .86rem; }
.connection::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.connection[data-state=ready] { color: var(--active); }
.connection[data-state=error] { color: var(--unknown); }
.metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); padding: 5px 0; margin-bottom: 10px; border: 1px solid var(--line); background: var(--surface-deep); border-radius: var(--radius); }
.metric { display: flex; min-height: 58px; padding: 7px clamp(11px,1.5vw,21px); gap: 4px; flex-direction: column; }
.metric + .metric { border-left: 1px solid var(--line); }
.metric span { font-size: .84rem; color: var(--muted); }
.metric strong { font-size: clamp(1.35rem,2.1vw,1.9rem); line-height: 1.08; font-weight: 700; font-variant-numeric: tabular-nums; }
.metric.all { color: var(--text); }
.aggregate { color: var(--signal); }
.active { color: var(--active); }
.expired { color: var(--expired); }
.unknown { color: var(--unknown); }
.map-controls { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin-bottom: 11px; padding: 9px 11px 10px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); }
label { display: grid; gap: 5px; color: var(--muted); font-size: .875rem; font-weight: 620; }
.map-controls label { flex: 1 1 106px; min-width: 100px; }
input,select { min-width: 0; min-height: 36px; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #151a1a; color: var(--text); }
input::placeholder { color: var(--quiet); }
input:focus,select:focus { border-color: var(--signal); }
select { appearance: none; padding-right: 25px; background-image: linear-gradient(45deg,transparent 50%,#a7b6ad 50%),linear-gradient(135deg,#a7b6ad 50%,transparent 50%); background-size: 5px 5px; background-position: calc(100% - 14px) 52%,calc(100% - 9px) 52%; background-repeat: no-repeat; }
.export-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.operations-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(245px,290px); gap: 11px; }
.map-panel,.detail-panel { position: relative; height: clamp(440px,calc(100dvh - 310px),760px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-deep); overflow: hidden; }
#map,.map-fallback { position: absolute; inset: 0; }
.map-fallback { display: grid; place-items: center; background: #0c1516; }
.map-fallback p { margin: 16px; padding: 10px 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); }
.map-overlay { position: absolute; left: 12px; right: 12px; top: 12px; z-index: 10; display: flex; justify-content: space-between; align-items: start; gap: 8px; pointer-events: none; }
.map-overlay > * { pointer-events: auto; }
.map-legend { display: flex; flex-wrap: wrap; gap: 7px 12px; padding: 8px 10px; border: 1px solid #3a4a45; border-radius: var(--radius); background: #101717ed; font-size: .82rem; }
.legend-dot::before { content: ""; display: inline-block; margin-right: 5px; width: 6px; height: 6px; border-radius: 50%; background: currentColor; vertical-align: 1px; }
.detail-panel { display: flex; flex-direction: column; background: var(--surface); }
.detail-panel header,.detail-panel footer { min-height: 48px; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.detail-panel header p { margin-top: 4px; font-size: .85rem; }
.detail-panel footer { border: 0; border-top: 1px solid var(--line); display: flex; gap: 5px; justify-content: space-between; align-items: center; }
.items { flex: 1; overflow-y: auto; overflow-x: hidden; scrollbar-color: #46615a #151919; }
.region-row,.point-row { width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; }
.region-row:hover,.point-row:hover { background: var(--surface-hover); }
.region-row { display: flex; justify-content: space-between; gap: 10px; line-height: 1.35; }
.region-row strong { color: var(--signal); font-weight: 650; font-variant-numeric: tabular-nums; }
.point-row { display: grid; gap: 5px; }
.point-row > span { overflow-wrap: anywhere; }
.point-row .point-meta { display: flex; gap: 7px; flex-wrap: wrap; }
.point-row small,.status-label { font-size: .83rem; }
.empty { color: var(--muted); padding: 15px 12px; }
.map-info { max-width: 290px; padding: 10px 12px; border: 1px solid #467166; border-radius: var(--radius); background: #111b19; color: var(--text); display: grid; gap: 5px; font-size: .89rem; }
.admin-shell { max-width: 1370px; }
.admin-card { background: var(--surface); border: 1px solid var(--line); padding: 15px; border-radius: var(--radius); margin: 0 0 12px; }
.admin-card h2 { margin-bottom: 11px; }
.admin-grid { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.admin-grid label,.account-row > div { flex: 1; min-width: 126px; }
.account-row { padding: 10px 0; border-top: 1px solid var(--line); }
.account-row small,table small { display: block; padding-top: 4px; }
.table-scroll { overflow-x: auto; margin-top: 13px; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
td,th { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-deep); color: var(--muted); font-weight: 640; }
tbody tr:hover { background: var(--surface-hover); }
td:first-child,td:nth-child(3),td:nth-child(4),td:nth-child(5) { white-space: nowrap; }
td:last-child { min-width: 195px; overflow-wrap: anywhere; }
.pager { display: flex; align-items: center; gap: 9px; padding-top: 12px; color: var(--muted); }
.notices { position: relative; z-index: 2; width: min(680px,94vw); padding: 8px 12px; margin: 9px auto; text-align: center; border: 1px solid #426e61; border-radius: var(--radius); background: #15231d; }
.access-page { background-color: #070a09; background-image: linear-gradient(90deg,#060a09b8 5%,#07100c42 72%,#060908ba), url("access-terrain.webp"); background-size: cover; background-position: center; }
.access-layout { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(300px,.7fr); align-items: center; gap: clamp(26px,6vw,112px); width: min(1440px,100%); min-height: 100dvh; margin: auto; padding: 42px clamp(22px,7vw,108px); }
.access-identity { align-self: center; max-width: 570px; padding-bottom: 16px; }
.access-identity .brand { color: var(--signal); font-size: .88rem; font-weight: 650; margin-bottom: 16px; }
.access-identity h1 { font-size: clamp(2.5rem,6.3vw,5.1rem); line-height: 1.15; font-weight: 760; letter-spacing: .065em; }
.access-identity p { max-width: 350px; margin-top: 19px; color: #c3d0c9; line-height: 1.8; }
.access-card { position: relative; width: 100%; max-width: 390px; justify-self: end; border: 1px solid #5f9783; border-top-color: #84c2aa; border-radius: 2px; background: #0a100fee; padding: 22px clamp(18px,2.1vw,30px) 24px; box-shadow: 0 16px 60px #000a; }
.access-card header { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 20px; }
.access-card h2 { font-size: 1.42rem; color: var(--text); }
.stacked-form { display: grid; gap: 14px; }
.stacked-form input,.stacked-form .primary { min-height: 42px; }
.stacked-form .primary { margin-top: 4px; }
.inline-link { display: inline-block; color: var(--signal); margin-top: 13px; font-size: .9rem; }
@media(max-width: 870px) {
  .topbar { gap: 7px; padding: 0 10px; flex-wrap: wrap; }
  .topbar nav a { padding: 8px; }
  .operations-grid { grid-template-columns: 1fr; }
  .detail-panel { min-height: 280px; height: 50vh; }
  .map-panel { min-height: 360px; height: 56vh; }
}
@media(max-width: 620px) {
  .topbar .account > span { display: none; }
  .topbar .brand,.topbar nav a { font-size: .83rem; }
  .topbar nav a { padding: 8px 4px; }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric:nth-child(3) { border-left: 0; }
  .metric:nth-child(n+3) { border-top: 1px solid var(--line); }
  .heading-tools { align-items: flex-end; flex-direction: column; gap: 4px; }
  .access-layout { display: flex; flex-direction: column; align-items: stretch; justify-content: center; min-height: 100dvh; padding: 25px 18px; gap: 19px; }
  .access-identity { align-self: stretch; padding: 0; }
  .access-identity h1 { font-size: clamp(2rem,8vw,3rem); }
  .access-identity p { margin-top: 8px; }
  .access-card { align-self: center; }
}
@media(prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Map workspace and fullscreen presentation */
.dashboard-page {
  --signal:#55eccc;
  --brand:#81ff88;
  --brand-hover:#a7ffac;
  --active:#8cff9f;
  --expired:#ffce68;
  --unknown:#b4c5d4;
}
.dashboard-page .console-heading {
  position:relative;
  padding:0 0 12px 14px;
}
.dashboard-page .console-heading::before {
  content:"";
  position:absolute;
  inset:3px auto 12px 0;
  width:2px;
  background:#6dff8e;
  box-shadow:0 0 13px #60ff8e91;
}
.dashboard-page .heading-tools { flex-wrap:wrap;justify-content:end; }
.dashboard-page .metric-grid { padding:3px 0; }
.dashboard-page .metric { min-height:50px; }
.dashboard-page .metric strong { font-size:clamp(1.25rem,2vw,1.8rem); }
.dashboard-page .map-controls { background:#111917; }
.dashboard-page .operations-grid { grid-template-columns:minmax(0,1fr) minmax(225px,257px); }
.dashboard-page .map-panel,.dashboard-page .detail-panel { height:clamp(450px,calc(100dvh - 295px),930px); }
.dashboard-page .map-panel {
  border-color:#335a4c;
  box-shadow:0 0 0 1px #5ee7b510, inset 0 0 22px #0f624124;
}
.dashboard-page #map { background:#0b1114; }
.dashboard-page .detail-panel { background:#0e1514; }
.map-status {
  position:absolute;
  bottom:14px;
  right:12px;
  display:flex;
  flex-wrap:wrap;
  justify-content:end;
  gap:7px 11px;
  max-width:75%;
  padding:6px 9px;
  border:1px solid #385a50;
  background:#0b1614e8;
  color:#c7f0e2;
  font-size:.82rem;
  z-index:10;
  pointer-events:none;
}
.detail-heading { display:flex;align-items:center;justify-content:space-between;gap:10px; }
.detail-heading .quiet { padding:4px 7px; min-height:29px; }
.dashboard-page .point-row:where(div) { cursor:default; }
.export-dialog {
  width:min(430px,calc(100vw - 30px));
  padding:19px;
  background:#101a17;color:var(--text);
  border:1px solid #487967;border-radius:6px;
}
.export-dialog::backdrop { background:#030907bf; }
.coord-card p { margin:8px 0; }
.coord-card .admin-grid { margin:12px 0; }
#situation-view:fullscreen,#situation-view.fullscreen-fallback {
  max-width:none;width:100%;height:100%;
  padding:16px 19px;overflow:auto;
  background:#08110d;
  display:grid;grid-template-rows:auto auto auto minmax(350px,1fr);
}
#situation-view.fullscreen-fallback { position:fixed;inset:0;z-index:5000; }
#situation-view:fullscreen .operations-grid,
#situation-view.fullscreen-fallback .operations-grid { min-height:0; }
#situation-view:fullscreen .map-panel,
#situation-view:fullscreen .detail-panel,
#situation-view.fullscreen-fallback .map-panel,
#situation-view.fullscreen-fallback .detail-panel { height:100%;min-height:0; }
#situation-view:fullscreen .console-heading h1,
#situation-view.fullscreen-fallback .console-heading h1 { letter-spacing:.115em; }
@media(max-width:870px) {
  .dashboard-page .operations-grid { grid-template-columns:1fr; }
  .dashboard-page .map-panel { height:58vh;min-height:355px; }
  .dashboard-page .detail-panel { height:49vh;min-height:300px; }
  #situation-view:fullscreen,#situation-view.fullscreen-fallback { display:block; }
  #situation-view:fullscreen .map-panel,#situation-view.fullscreen-fallback .map-panel { height:62vh; }
  #situation-view:fullscreen .detail-panel,#situation-view.fullscreen-fallback .detail-panel { height:46vh; }
}
