:root {
  --bg: #020a1d;
  --bg2: #041732;
  --text: #d8ecff;
  --muted: #88afd4;
  --cyan: #41deff;
  --blue: #72bfff;
  --green: #56f0a0;
  --warn: #ffc15b;
  --risk: #ff6f8a;
  --font-cn: "PingFang SC", "Microsoft YaHei UI", "HarmonyOS Sans SC", "Noto Sans SC", "Source Han Sans SC", "Segoe UI", sans-serif;
  --font-digi: "Bahnschrift", "DIN", "Segoe UI", "Tahoma", "Arial", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--text);
  font-family: var(--font-cn);
  font-weight: 500;
  background:
    radial-gradient(circle at 50% 52%, #29b6ff1f 0, transparent 40%),
    radial-gradient(circle at 50% 12%, #0c2f591a 0, transparent 55%),
    linear-gradient(180deg, #06132b 0%, #030c1f 100%);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
}

.bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, #4dd8ff1c 0, transparent 42%),
    linear-gradient(90deg, #0a2f5308 0, transparent 20%, transparent 80%, #0a2f5308 100%);
}

.topbar {
  height: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
}

.single-btn {
  color: #d4ecff;
  text-decoration: none;
  font-size: 12px;
  background: #0a2b4d;
  border-radius: 7px;
  padding: 7px 14px;
  box-shadow: inset 0 0 0 1px #3f709e;
}
.map-actions {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 9;
  display: flex;
  gap: 8px;
}

.screen {
  height: calc(100vh - 4px);
  padding: 4px 14px 14px;
  display: grid;
  grid-template-columns: 360px 1fr 360px;
  gap: 12px;
}

.col {
  min-height: 0;
  display: grid;
  gap: 12px;
}
.left-col { grid-template-rows: 1.22fr 1fr 1fr; }
.center-col { grid-template-rows: 1fr 70px 56px; }
.right-col { grid-template-rows: 0.95fr 0.95fr 1.1fr; }

.panel {
  min-height: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, #061931de, #041327d9);
  box-shadow: 0 0 0 1px #224f781a, 0 0 24px #38b6ff12 inset;
}

.panel h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: #e8f3ff;
  text-shadow: 0 1px 10px #58a9ff1f;
}

.panel-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.15px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.range-tabs {
  display: flex;
  gap: 6px;
}
.range-tabs button {
  border: 0;
  background: #0a2950;
  color: #9ec4e9;
  border-radius: 999px;
  font-size: 11px;
  padding: 4px 10px;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px #2e658f;
}
.range-tabs button.active {
  background: #24d9ea;
  color: #083152;
  box-shadow: none;
}

.alarm-ticker {
  height: calc(100% - 44px);
  overflow: hidden;
  margin-top: 8px;
  position: relative;
}
.alarm-track {
  position: absolute;
  inset: 0;
  display: grid;
  grid-auto-rows: 31px;
  transition: transform 0.7s ease;
}
.alarm-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
  font-size: 15px;
  font-weight: 500;
  border-bottom: 1px dashed #2a4f741f;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.2s ease;
  color: inherit;
  text-decoration: none;
}
.alarm-item:hover {
  background: #0a2a4f66;
}
.alarm-level {
  display: none;
}
.alarm-item b { color: #ffbf6c; font-size: 22px; font-weight: 700; font-family: var(--font-digi); }
.alarm-item small { color: #9fc6eb; font-weight: 500; }

.map-stage {
  position: relative;
  min-height: 0;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 48%, #56d4ff18 0, #183f6808 48%, transparent 68%),
    linear-gradient(180deg, #061b37aa, #05162dcc);
}

.map-chart {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 68px;
}

.center-title-wrap {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  text-align: center;
  pointer-events: none;
  min-width: 520px;
  max-width: calc(100% - 20px);
  padding: 2px 10px 4px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.center-title {
  font-size: clamp(34px, 2.2vw, 44px);
  font-weight: 700;
  letter-spacing: 1.6px;
  line-height: 1.05;
  color: #f5f9ff;
  font-family: var(--font-cn);
  text-shadow: 0 0 14px #9cc8ff66;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.center-date {
  margin-top: 1px;
  color: #c5d9ff;
  font-size: 20px;
  line-height: 1.1;
  font-family: var(--font-digi);
  font-weight: 500;
  letter-spacing: 2.1px;
  text-shadow: 0 0 8px #7fb5ff4d;
  font-variant-numeric: tabular-nums;
}
.center-time {
  margin-top: 0;
  color: #73f7ff;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: 2.4px;
  font-family: var(--font-digi);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 10px #33f1ff70;
}

#updatedAt,
#pageSub {
  font-family: var(--font-digi);
  letter-spacing: 1.2px;
  font-variant-numeric: tabular-nums;
}

.kpi-block {
  display: grid;
  gap: 10px;
  align-items: center;
}
.kpi-big { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi-small { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-block div {
  background: transparent;
  border-radius: 8px;
  padding: 3px 2px;
  text-align: center;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}
.kpi-block div:hover {
  background: #0a2a4f66;
  box-shadow: inset 0 0 0 1px #2f6792aa;
}
.kpi-block span { display: block; font-size: 12px; color: #9cc4e8; font-weight: 500; }
.kpi-big b { display: block; font-size: 34px; line-height: 1; margin-top: 4px; color: #e8f5ff; font-weight: 700; font-family: var(--font-digi); }
.kpi-small b { display: block; font-size: 27px; line-height: 1; margin-top: 2px; color: #ffc963; font-weight: 700; font-family: var(--font-digi); }
.kpi-block small { font-size: 12px; color: #8aaed2; }

.chart {
  width: 100%;
  height: calc(100% - 48px);
  min-height: 0;
}

.stat-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.stat-cell {
  display: block;
  min-height: 62px;
  border-radius: 10px;
  background: linear-gradient(180deg, #0a2648, #071c34);
  box-shadow: inset 0 0 0 1px #2d5f8c55;
  padding: 8px 10px;
  transition: transform 0.16s ease, box-shadow 0.2s ease, background 0.2s ease;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
}
.stat-cell:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px #4f95c8aa, 0 6px 16px #0d396030;
  background: linear-gradient(180deg, #103057, #0a2443);
}
.stat-cell span {
  display: block;
  font-size: 13px;
  color: #93bae0;
  font-weight: 500;
}
.stat-cell b {
  display: block;
  margin-top: 4px;
  font-size: 28px;
  line-height: 1;
  font-family: var(--font-digi);
  font-weight: 700;
}

.saving-text {
  margin-top: 8px;
  color: #b5d8f7;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
}
.saving-text b { color: #7af5b3; }
.saving-text em { color: #ffca72; font-style: normal; }

@media (max-width: 1600px) {
  .screen { grid-template-columns: 320px 1fr 320px; }
  .center-title-wrap { min-width: 440px; }
  .center-title { font-size: 34px; }
  .center-date { font-size: 16px; }
  .center-time { font-size: 26px; }
  .map-chart { top: 62px; }
  .kpi-big b { font-size: 28px; }
  .kpi-small b { font-size: 22px; }
}

@media (max-width: 1200px) {
  body {
    overflow: auto;
  }

  .topbar {
    height: auto;
    padding: 8px 10px 2px;
  }

  .screen {
    height: auto;
    min-height: calc(100vh - 4px);
    padding: 6px 10px 12px;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .left-col,
  .center-col,
  .right-col {
    grid-template-rows: none;
    display: grid;
    gap: 10px;
  }

  .map-stage {
    min-height: 520px;
  }

  .map-chart {
    top: 100px;
  }

  .center-title-wrap {
    min-width: 0;
    width: calc(100% - 18px);
    top: 6px;
  }

  .center-title {
    font-size: 30px;
    letter-spacing: 1.2px;
  }

  .center-date {
    font-size: 15px;
    letter-spacing: 1.6px;
  }

  .center-time {
    font-size: 24px;
    letter-spacing: 1.8px;
  }

  .kpi-big {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .kpi-small {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .panel {
    padding: 10px;
    border-radius: 10px;
  }

  .panel h3 {
    font-size: 22px;
  }

  .panel-sub {
    font-size: 13px;
  }

  .map-stage {
    min-height: 460px;
  }

  .map-chart {
    top: 90px;
  }

  .center-title {
    font-size: 26px;
  }

  .center-date {
    font-size: 14px;
  }

  .center-time {
    font-size: 22px;
  }

  .map-actions {
    left: 10px;
    right: 10px;
    bottom: 10px;
    justify-content: stretch;
  }

  .single-btn {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
    font-size: 13px;
  }

  .kpi-big {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-small {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-big b {
    font-size: 30px;
  }

  .kpi-small b {
    font-size: 24px;
  }
}
