:root {
  --navy-950: #061426;
  --navy-900: #0a1f37;
  --navy-850: #0e2947;
  --navy-800: #123354;
  --panel: rgba(13, 40, 69, 0.78);
  --panel-strong: #102e4e;
  --line: rgba(151, 190, 222, 0.2);
  --text: #eef7ff;
  --muted: #9eb5ca;
  --cyan: #3cc9e8;
  --blue: #4a91ff;
  --green: #36c58d;
  --green-soft: #78ddb5;
  --red: #ff6675;
  --red-soft: #ff9aa4;
  --amber: #ffbf4b;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgba(47, 150, 207, 0.2), transparent 28rem),
    radial-gradient(circle at 88% 18%, rgba(51, 197, 141, 0.11), transparent 26rem),
    linear-gradient(160deg, var(--navy-950), #081b31 48%, #071526);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 4vw, 58px);
  border-bottom: 1px solid var(--line);
  background: rgba(6, 20, 38, 0.86);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 760;
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(60, 201, 232, 0.45);
  border-radius: 10px;
  color: var(--cyan);
  background: linear-gradient(135deg, rgba(60, 201, 232, 0.18), rgba(74, 145, 255, 0.08));
  box-shadow: inset 0 0 22px rgba(60, 201, 232, 0.12);
}

.header-meta {
  color: var(--muted);
  font-size: 13px;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.archive-picker {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 6px 8px 6px 12px;
  border: 1px solid rgba(60, 201, 232, 0.3);
  border-radius: 999px;
  background: rgba(60, 201, 232, 0.06);
}

.archive-picker-label {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.06em;
}

.archive-picker select {
  appearance: auto;
  min-width: 70px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 5px 7px;
  color: var(--text);
  background: var(--navy-850);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.archive-picker select:focus-visible {
  border-color: var(--cyan);
  outline: 2px solid rgba(60, 201, 232, 0.22);
}

.province-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 16px;
  border: 1px solid rgba(60, 201, 232, 0.65);
  border-radius: 999px;
  color: #061426;
  background: linear-gradient(135deg, #5fd8ee, #6da4ff);
  box-shadow: 0 8px 28px rgba(60, 201, 232, 0.22);
  font-size: 13px;
  font-weight: 800;
}

.province-back:hover,
.province-back:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.08);
  outline: none;
}

.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;
}

.action-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.action-button:hover,
.action-button:focus-visible {
  color: var(--text);
  border-color: rgba(60, 201, 232, 0.55);
  outline: none;
}

.adjustment-notice {
  display: grid;
  grid-template-columns: minmax(220px, 0.55fr) minmax(0, 1.45fr);
  gap: 24px;
  border-color: rgba(242, 176, 79, 0.55);
  background: linear-gradient(135deg, rgba(242, 176, 79, 0.12), rgba(255, 255, 255, 0.025));
}

.adjustment-notice h2 {
  margin-bottom: 0;
}

.adjustment-notice p {
  align-self: center;
  margin: 0;
  color: var(--muted);
  line-height: 1.85;
}

.page-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  padding: clamp(48px, 8vw, 94px) 0 30px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 32px;
  height: 1px;
  background: var(--cyan);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 980px;
  margin-bottom: 14px;
  font-size: clamp(40px, 6vw, 78px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.hero-lead {
  max-width: 880px;
  margin-bottom: 22px;
  color: #b8cadb;
  font-size: clamp(16px, 1.8vw, 21px);
}

.hero-chips,
.legend,
.city-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip,
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 12px;
}

.status-chip.good,
.positive {
  color: var(--green-soft);
}

.status-chip.risk,
.negative {
  color: var(--red-soft);
}

.status-chip.watch,
.warning {
  color: var(--amber);
}

.panel,
.metric-card,
.insight-card,
.table-wrap,
.city-hero-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(155deg, rgba(17, 51, 84, 0.88), rgba(9, 30, 53, 0.82));
  box-shadow: var(--shadow);
}

.panel {
  padding: clamp(18px, 3vw, 32px);
}

.map-panel {
  overflow: hidden;
  padding: 0;
}

.panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  padding: 28px 30px 8px;
}

.section-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.panel-heading h2,
.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 40px);
  letter-spacing: -0.025em;
}

.panel-heading p,
.section-heading p {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  min-height: 650px;
}

.map-shell {
  position: relative;
  min-height: 620px;
  background:
    linear-gradient(rgba(34, 87, 130, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 87, 130, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
}

#province-map {
  width: 100%;
  height: 100%;
  min-height: 620px;
}

.map-region {
  stroke: rgba(184, 223, 246, 0.65);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
  transition: filter 160ms ease, opacity 160ms ease, stroke 160ms ease;
}

.map-link:hover .map-region,
.map-link:focus-visible .map-region {
  filter: brightness(1.22) drop-shadow(0 0 12px rgba(60, 201, 232, 0.6));
  stroke: #ffffff;
  outline: none;
}

.map-label {
  fill: #f4fbff;
  font-size: 15px;
  font-weight: 760;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(6, 20, 38, 0.9);
  stroke-width: 4px;
  pointer-events: none;
}

.map-aside {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px;
  border-left: 1px solid var(--line);
  background: rgba(5, 20, 37, 0.52);
}

.map-stat {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.map-stat:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.map-stat strong {
  display: block;
  margin: 4px 0;
  font-size: 30px;
  letter-spacing: -0.025em;
}

.map-stat span,
.legend-item {
  color: var(--muted);
  font-size: 12px;
}

.legend {
  flex-direction: column;
}

.legend-dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 50%;
}

.map-tooltip {
  position: absolute;
  z-index: 10;
  min-width: 210px;
  padding: 14px 16px;
  border: 1px solid rgba(60, 201, 232, 0.42);
  border-radius: 14px;
  color: var(--text);
  background: rgba(5, 19, 35, 0.95);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.map-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.map-tooltip strong {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
}

.tooltip-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 16px;
  color: var(--muted);
  font-size: 12px;
}

.content {
  display: grid;
  gap: 22px;
  padding: 28px 0 72px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 18px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
}

.metric-card::after {
  content: "";
  position: absolute;
  right: -36px;
  bottom: -42px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(60, 201, 232, 0.08);
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
}

.metric-value {
  display: block;
  margin: 5px 0 4px;
  font-size: clamp(28px, 3.4vw, 46px);
  line-height: 1.1;
  font-weight: 780;
  letter-spacing: -0.045em;
}

.metric-foot {
  color: var(--muted);
  font-size: 12px;
}

.decision-strip {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  align-items: center;
  border-left: 4px solid var(--amber);
}

.decision-label {
  color: var(--amber);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.14em;
}

.decision-text {
  margin: 0;
  font-size: clamp(17px, 2vw, 24px);
  font-weight: 680;
  line-height: 1.45;
}

.section-grid {
  display: grid;
  gap: 22px;
}

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

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

.driver-list {
  display: grid;
  gap: 13px;
}

.driver-row {
  display: grid;
  grid-template-columns: minmax(112px, 0.9fr) minmax(130px, 2fr) 88px;
  gap: 12px;
  align-items: center;
}

.driver-name {
  overflow: hidden;
  color: #d4e5f2;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.bar-fill {
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
  background: linear-gradient(90deg, #298cb2, var(--cyan));
}

.bar-fill.negative {
  background: linear-gradient(90deg, #ba3f54, var(--red));
}

.bar-fill.warning {
  background: linear-gradient(90deg, #d89224, var(--amber));
}

.driver-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 720;
}

.table-wrap {
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
}

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

th,
td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 11px;
  font-weight: 720;
  letter-spacing: 0.05em;
}

tbody tr:hover {
  background: rgba(60, 201, 232, 0.04);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.rank-link {
  color: #d8efff;
  font-weight: 670;
}

.rank-link:hover,
.rank-link:focus-visible {
  color: var(--cyan);
  outline: none;
}

.curve-card {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  gap: 28px;
  align-items: center;
}

.curve-bars {
  height: 250px;
  display: flex;
  align-items: flex-end;
  gap: 5px;
  padding: 18px 10px 28px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.curve-bar {
  flex: 1;
  min-width: 5px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, var(--amber), #3ea4cc);
  opacity: 0.86;
}

.curve-bar:last-child {
  box-shadow: 0 0 18px rgba(255, 191, 75, 0.48);
}

.callout-list {
  display: grid;
  gap: 12px;
}

.callout-item {
  padding: 14px 16px;
  border-left: 2px solid var(--cyan);
  border-radius: 0 12px 12px 0;
  color: #c8d9e7;
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
}

.mechanism {
  display: grid;
  grid-template-columns: 1fr 42px 1fr 42px 1fr;
  align-items: stretch;
  gap: 10px;
}

.mechanism-step {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.mechanism-step strong {
  display: block;
  margin-bottom: 8px;
  color: var(--cyan);
}

.mechanism-step p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.mechanism-arrow {
  display: grid;
  place-items: center;
  color: var(--cyan);
  font-size: 24px;
}

.allocation-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.allocation-box {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.allocation-box span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.allocation-box strong {
  font-size: 22px;
}

.insight-card {
  padding: 20px;
}

.insight-index {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 10px;
  color: var(--cyan);
  background: rgba(60, 201, 232, 0.1);
  font-size: 12px;
  font-weight: 760;
}

.insight-card h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

.insight-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.footer {
  padding: 24px 0 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.city-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 22px;
  padding: 42px 0 22px;
}

.city-hero-card {
  padding: clamp(24px, 4vw, 44px);
}

.city-hero h1 {
  margin-bottom: 12px;
  font-size: clamp(42px, 6vw, 72px);
}

.city-summary {
  color: #c6d8e7;
  font-size: 17px;
}

.status-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.status-panel .big-status {
  font-size: 30px;
  font-weight: 780;
  letter-spacing: -0.03em;
}

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

.compare-bars {
  display: grid;
  gap: 16px;
}

.compare-row {
  display: grid;
  grid-template-columns: 84px minmax(120px, 1fr) 96px;
  gap: 12px;
  align-items: center;
}

.compare-row span {
  color: var(--muted);
  font-size: 12px;
}

.compare-bar-track {
  height: 34px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.compare-bar-fill {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 12%;
  padding-right: 10px;
  border-radius: inherit;
  background: linear-gradient(90deg, #25669c, #34b8dc);
  color: #f5fbff;
  font-size: 11px;
  font-weight: 720;
}

.allocation-bar {
  height: 46px;
  display: flex;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.allocation-operating,
.allocation-period {
  display: grid;
  place-items: center;
  min-width: 0;
  color: #f6fbff;
  font-size: 12px;
  font-weight: 720;
}

.allocation-operating {
  background: linear-gradient(90deg, #27739f, #3ca3c9);
}

.allocation-period {
  background: linear-gradient(90deg, #c98425, var(--amber));
  color: #2a1b03;
}

.city-nav a {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}

.city-nav a:hover,
.city-nav a:focus-visible,
.city-nav a.active {
  color: var(--text);
  border-color: var(--cyan);
  background: rgba(60, 201, 232, 0.08);
  outline: none;
}

.source-note {
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  font-size: 11px;
}

.light-theme {
  --navy-950: #eef5fa;
  --navy-900: #eaf2f8;
  --navy-850: #ffffff;
  --navy-800: #e4eef6;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: #ffffff;
  --line: rgba(33, 74, 108, 0.16);
  --text: #10293f;
  --muted: #59728a;
  --shadow: 0 18px 50px rgba(40, 68, 92, 0.12);
  background: #edf4f8;
}

.light-theme .site-header {
  background: rgba(245, 250, 253, 0.9);
}

.light-theme .panel,
.light-theme .metric-card,
.light-theme .insight-card,
.light-theme .table-wrap,
.light-theme .city-hero-card {
  background: rgba(255, 255, 255, 0.88);
}

.light-theme .hero-lead,
.light-theme .city-summary,
.light-theme .driver-name,
.light-theme .rank-link {
  color: #29475f;
}

@media (max-width: 980px) {
  .site-header {
    flex-wrap: wrap;
  }

  .archive-picker {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-left: 0;
    border-radius: 14px;
  }

  .map-layout,
  .curve-card,
  .city-hero {
    grid-template-columns: 1fr;
  }

  .map-aside {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .section-grid.two,
  .section-grid.three {
    grid-template-columns: 1fr;
  }

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

  .mechanism {
    grid-template-columns: 1fr;
  }

  .adjustment-notice {
    grid-template-columns: 1fr;
  }

  .mechanism-arrow {
    transform: rotate(90deg);
  }
}

@media (max-width: 640px) {
  .header-meta,
  .header-actions .action-button:first-child {
    display: none;
  }

  .brand span:last-child {
    display: none;
  }

  .archive-picker-label {
    display: none;
  }

  .archive-picker select {
    min-width: 0;
    flex: 1;
  }

  .province-back {
    margin-left: auto;
  }

  .page-shell {
    width: min(100% - 20px, 1440px);
  }

  .metric-grid,
  .map-aside,
  .allocation-summary {
    grid-template-columns: 1fr;
  }

  .map-shell,
  #province-map {
    min-height: 480px;
  }

  .panel-heading,
  .section-heading,
  .footer-grid {
    align-items: flex-start;
    flex-direction: column;
  }

  .decision-strip {
    grid-template-columns: 1fr;
  }

  .driver-row {
    grid-template-columns: 100px minmax(100px, 1fr) 70px;
    gap: 8px;
  }

  th,
  td {
    padding: 10px 12px;
  }
}

@media print {
  body {
    color: #152a3d;
    background: #ffffff;
  }

  .site-header,
  .header-actions {
    display: none;
  }

  .panel,
  .metric-card,
  .insight-card,
  .table-wrap,
  .city-hero-card {
    break-inside: avoid;
    color: #152a3d;
    background: #ffffff;
    box-shadow: none;
  }

  .map-label {
    fill: #ffffff;
  }
}
