:root {
  color-scheme: light;
  --ink: #1e313a;
  --muted: #53666f;
  --teal: #34606b;
  --teal-strong: #234953;
  --teal-soft: #e5eff1;
  --line: #d9e3e7;
  --line-subtle: #ebf0f2;
  --line-control: #cbd8dd;
  --paper: #f6f8fa;
  --surface: #ffffff;
  --header-content-height: 58px;
  --header-height: calc(var(--header-content-height) + 1px);
  --wash: #edf3f5;
  --focus: #3b6f7d;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-card: 0 1px 2px rgba(24, 42, 50, .04), 0 8px 24px -14px rgba(24, 42, 50, .09);
  --shadow-pop: 0 12px 32px rgba(24, 42, 50, .14), 0 2px 6px rgba(24, 42, 50, .06);
  --serif: "STIX Two Text", Georgia, "Songti SC", "Noto Serif CJK SC", serif;
  --sans-zh-head: "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "IBM Plex Mono", Consolas, "SFMono-Regular", monospace;
  --ease: cubic-bezier(.2, .65, .3, 1);
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
h2 { font-family: var(--serif); }
:root:lang(zh-CN) :is(h1, h2, .fc-heading h2, .ds-heading h2) {
  font-family: var(--sans-zh-head);
  font-weight: 700;
  letter-spacing: -.015em;
}
.wrap { width: min(1200px, calc(100% - clamp(32px, 8vw, 120px))); margin-inline: auto; }
.icon { display: block; width: 17px; height: 17px; flex: none; }
:is(a, button, select, input, summary):focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.skip {
  position: fixed; z-index: 20; top: -70px; left: 10px;
  background: #fff; padding: 9px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); box-shadow: var(--shadow-pop);
}
.skip:focus { top: 8px; }

/* Header */
.topbar {
  position: sticky; top: 0; z-index: 8;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(24, 42, 50, .03);
}
.header-inner, .header-actions, .brand, .primary-nav, .repo-link, .contents summary {
  display: flex; align-items: center;
}
.header-inner { height: var(--header-content-height); justify-content: space-between; gap: 18px; }
.header-actions { gap: 12px; }
.brand {
  gap: 9px; white-space: nowrap;
  font: 600 23px/1 var(--serif); letter-spacing: -.04em; color: var(--ink);
}
.brand img { border-radius: 7px; }
.primary-nav { gap: 4px; margin-inline: auto 0; }
.primary-nav a {
  padding: 6px 11px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap;
}
.primary-nav a:hover { background: var(--wash); color: var(--ink); }
.primary-nav a[aria-current="location"] {
  background: var(--teal-soft); color: var(--teal-strong); font-weight: 600;
}
.lang-switch {
  display: inline-flex; align-items: center; gap: 2px; padding: 2px;
  border: 1px solid var(--line); border-radius: 7px; background: #f4f7f8;
}
.lang-switch button {
  border: 0; border-radius: 5px; background: transparent; color: var(--muted);
  padding: 4px 8px; font-size: 12px; font-weight: 500; line-height: 1.45; white-space: nowrap;
}
.lang-switch button:hover { background: var(--wash); color: var(--ink); }
.lang-switch button[aria-pressed="true"] {
  background: #fff; color: var(--teal-strong); font-weight: 600;
  box-shadow: 0 1px 2px rgba(24, 42, 50, .08);
}
.repo-link, .contents summary {
  gap: 6px; padding: 6px 9px; border-radius: var(--radius-sm);
  color: #465b64; font-size: 13px; font-weight: 500;
}
.repo-link { border: 1px solid transparent; }
.repo-link:hover { border-color: var(--line); }
.repo-arrow .icon { width: 12px; height: 12px; opacity: .75; }
.contents { position: relative; display: none; }
.contents summary { list-style: none; cursor: pointer; }
.contents summary::-webkit-details-marker { display: none; }
.menu-symbol .icon { width: 15px; height: 15px; }
.contents nav {
  position: absolute; z-index: 2; right: 0; top: calc(100% + 6px); width: 164px;
  padding: 5px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; box-shadow: var(--shadow-pop);
}
.contents nav a { display: block; padding: 8px 10px; border-radius: 5px; font-size: 13px; font-weight: 500; }
:is(.repo-link, .contents summary, .contents nav a):hover, .contents[open] summary {
  background: var(--wash); color: var(--ink);
}

/* Main & Hero */
.main-wrap { flex: 1; padding-bottom: 56px; }
main:focus, .page-section:focus { outline: none; }
#overview, .page-section { scroll-margin-top: 76px; }
.hero {
  display: grid; grid-template-columns: minmax(330px, .94fr) minmax(0, 1.12fr);
  align-items: center; gap: clamp(24px, 4vw, 56px);
  padding-block: clamp(28px, 3.4vw, 48px);
  border-bottom: 1px solid var(--line);
}
.hero h1 {
  font: 600 clamp(32px, 3.2vw, 46px)/1.18 var(--serif);
  letter-spacing: -.035em; color: var(--ink);
}
.hero-copy p {
  max-width: 500px; margin-top: 14px;
  color: var(--muted); font-size: 14.5px; line-height: 1.75;
}
.hero-stats {
  display: flex; flex-wrap: wrap; gap: 14px 0;
  margin-top: 24px; padding-top: 18px;
  border-top: 1px solid var(--line-subtle);
}
.hero-stats div { display: flex; flex-direction: column-reverse; gap: 3px; }
.hero-stats div + div {
  margin-left: clamp(20px, 2.8vw, 36px);
  padding-left: clamp(20px, 2.8vw, 36px);
  border-left: 1px solid var(--line);
}
.hero-stats dt { font-size: 12px; font-weight: 500; color: var(--muted); }
.hero-stats dd {
  font: 600 clamp(24px, 2.3vw, 31px)/1.1 var(--serif);
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--ink);
}
.hero-map {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px 10px;
  box-shadow: var(--shadow-card);
  display: grid; gap: 8px;
}
.atlas-map {
  display: block; width: 100%; height: auto; aspect-ratio: 720 / 300;
  background: #f5f9fa; border-radius: 6px;
}
.atlas-key {
  display: flex; justify-content: center; align-items: center; gap: 7px;
  color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.4;
}
.map-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #2c6775; box-shadow: 0 0 0 2.5px rgba(44, 103, 117, .16);
}
.grid-lines { fill: none; stroke: #c5d4d9; stroke-width: .75; stroke-dasharray: 2.5 4; }
.grid-labels { fill: #506670; font: 500 13.5px var(--mono); text-anchor: middle; }
.station-core { fill: none; stroke: #2c6775; stroke-linecap: round; stroke-width: 2.1; opacity: .92; }

/* Sections & Shared Panel */
.page-section { margin-top: clamp(32px, 3.8vw, 52px); min-width: 0; }
.section-heading {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 16px;
}
.section-heading h2 {
  font: 600 clamp(24px, 2.4vw, 30px)/1.28 var(--serif);
  letter-spacing: -.025em; color: var(--ink);
}
.section-heading p { margin-top: 6px; font-size: 14px; line-height: 1.7; color: var(--muted); }
.panel {
  overflow: hidden; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

/* Leaderboard Controls */
.rank-tools, .board-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 13px 16px;
}
.horizon-group, .search, .secondary-btn { display: inline-flex; align-items: center; gap: 8px; }
.horizon-group { color: var(--muted); font-size: 13px; font-weight: 500; gap: 10px; }
.horizon-pills {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px;
  border: 1px solid var(--line-control); border-radius: 7px; background: #f3f7f8;
}
.horizon-pills button {
  border: 0; border-radius: 5px; background: transparent; color: var(--muted);
  padding: 5px 10px; min-height: 28px;
  font: 500 12px/1.3 var(--mono); white-space: nowrap;
}
.horizon-pills button:hover { color: var(--ink); background: #e8f0f2; }
.horizon-pills button[aria-pressed="true"] {
  background: #fff; color: var(--teal-strong); font-weight: 600;
  box-shadow: 0 1px 2px rgba(24, 42, 50, .1);
}
.secondary-btn, .search, .expand-rows {
  border: 1px solid var(--line-control); border-radius: var(--radius-sm);
  color: var(--teal-strong); background: #f4f8f9;
  font-size: 13px; font-weight: 500;
}
.secondary-btn { min-height: 36px; padding: 6px 12px; white-space: nowrap; }
.search { min-width: 0; padding: 6px 10px; min-height: 36px; background: #fff; }
.search .icon, .secondary-btn .icon { width: 15px; height: 15px; color: var(--muted); }
.secondary-btn .icon { color: currentColor; }
.search input { min-width: 0; width: 150px; border: 0; background: transparent; font-size: 13px; color: var(--ink); }
.search input::placeholder { color: #748790; }
.search input:focus-visible { outline: none; }
.search:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(59, 111, 125, .14); }
.table-scroll { overflow-x: auto; scrollbar-width: thin; }
.origin-note {
  padding: 8px 16px; border-top: 1px solid var(--line-subtle);
  background: #fafcfd; color: var(--muted); font-size: 12px; line-height: 1.55;
}

/* Leaderboard Table */
.model-toggle {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 0; border: 0;
  background: transparent; color: inherit; font: inherit; text-align: left;
}
.model-toggle::before {
  content: ''; flex: none; width: 6px; height: 6px; margin-inline: 2px 3px;
  border: solid var(--teal); border-width: 1.5px 1.5px 0 0; transform: rotate(45deg);
}
.model-toggle[aria-expanded="true"]::before { transform: rotate(135deg); }
.model-toggle:hover, .model-toggle[aria-expanded="true"] { color: var(--teal); }
.model-row.is-open { background: #f3f8f9; box-shadow: inset 3px 0 0 var(--teal); }
.board-table .detail-row td {
  width: auto; padding: 14px 18px 16px; white-space: normal;
  background: #f8fbfc; box-shadow: inset 3px 0 0 var(--teal);
}
.detail-row h3 { font-size: 12.5px; font-weight: 600; color: var(--teal-strong); letter-spacing: .01em; }
.detail-row p { color: var(--muted); font-size: 12px; line-height: 1.6; margin-top: 10px; }
.pollutant-values, .mobile-counts {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px 10px; margin: 10px 0 0;
}
.pollutant-values > div, .mobile-counts > div {
  background: #fff; border: 1px solid #e2eaed; border-radius: var(--radius-sm);
  padding: 8px 11px;
}
.detail-row dt { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.detail-row dd {
  margin-top: 3px; font: 500 13.5px var(--mono); color: var(--ink);
  overflow-wrap: anywhere;
}
.mobile-counts { display: none; }
.download:disabled { opacity: .55; cursor: default; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; font-variant-numeric: tabular-nums; }
th, td { padding: 0 14px; }
thead { background: #f2f6f7; }
thead th {
  height: 38px; color: #4b606a; font-size: 12px; font-weight: 600;
  border-block: 1px solid var(--line);
}
tbody tr { border-bottom: 1px solid var(--line-subtle); }
tbody tr:last-child { border-bottom: 0; }
tbody :is(th, td) { height: 46px; font-size: 14px; }
tbody th { font-weight: 500; }
tbody tr.model-row:hover { background: #f6fafa; }
tbody tr.model-row.is-open:hover { background: #eff6f8; }
th:first-child, td:first-child { width: 68px; padding-left: 16px; }
.num { text-align: right; }
td.num { font: 400 13px var(--mono); }
.main-score { color: var(--teal-strong); font-weight: 600; }
.score-cell { display: inline-flex; align-items: center; justify-content: flex-end; gap: 10px; }
.score-bar {
  width: 54px; height: 5px; border-radius: 999px;
  background: #e9eff1; overflow: hidden; flex: none;
}
.score-bar > span {
  display: block; height: 100%; border-radius: 999px; background: #7aa0ab;
}
.rank-1 .score-bar > span { background: var(--teal); }
.sub-score { color: var(--muted); }
.position {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 24px; padding-inline: 6px; border-radius: 999px;
  font: 500 12.5px var(--mono); color: var(--muted);
}
.pos-1 { background: #dfeef1; color: var(--teal-strong); font-weight: 700; }
.pos-2, .pos-3 { background: #edf2f4; color: #364e58; font-weight: 600; }
.board-foot {
  min-height: 48px; border-top: 1px solid var(--line);
  background: #fafcfd; color: var(--muted); font-size: 12.5px;
}
.expand-rows { padding: 6px 11px; }
:is(.secondary-btn, .expand-rows):hover { background: #e8f0f2; border-color: #aebfc6; }
:is(.secondary-btn, .expand-rows):active { background: #dfeaed; }

/* Footer */
footer { border-top: 1px solid var(--line); background: #fff; }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 56px; font-size: 12px; color: #526670;
}
.footer-inner > span:first-child { font: 600 15px var(--serif); color: var(--ink); }
.footer-inner i { margin: 0 5px; font-style: normal; opacity: .6; }
.footer-inner a { color: var(--teal); font-weight: 500; }
.footer-inner a:hover { text-decoration: underline; text-underline-offset: 2px; }
.empty, .load { padding: 28px 12px; color: var(--muted); font-size: 14px; text-align: center; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  :is(.primary-nav a, .lang-switch button, .contents summary, .contents nav a, .repo-link, .secondary-btn, .expand-rows, .horizon-pills button, .search, tbody tr, .model-toggle::before) {
    transition: background-color 160ms var(--ease), color 160ms var(--ease), border-color 160ms var(--ease), box-shadow 160ms var(--ease), transform 160ms var(--ease);
  }
}

@media (max-width: 860px) {
  .primary-nav { display: none; }
  .contents { display: block; }
}

@media (max-width: 760px) {
  .board-table table { table-layout: fixed; width: 100%; }
  .board-table thead th:first-child, .board-table .model-row td:first-child { width: 52px; padding: 0 6px 0 12px; }
  .board-table thead th:nth-child(2) { width: auto; }
  .board-table thead th:nth-child(3), .board-table .model-row td:nth-child(3) { width: 112px; padding-right: 12px; }
  .board-table .model-row > *, .board-table thead th { padding-inline: 8px; }
  .board-table thead th:nth-child(n+4), .board-table .model-row > :nth-child(n+4) { display: none; }
  .score-bar { display: none; }
  .model-toggle { white-space: normal; line-height: 1.35; }
  .board-table .detail-row td { padding: 12px; }
  .pollutant-values, .mobile-counts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .mobile-counts { display: grid; margin: 10px 0 0; }
  .hero { grid-template-columns: minmax(240px, .96fr) minmax(0, 1.04fr); gap: 18px; }
  .hero h1 { font-size: 30px; }
  .hero-stats { margin-top: 18px; padding-top: 14px; }
}

@media (max-width: 610px) {
  :root { --header-content-height: 52px; }
  .wrap { width: calc(100% - 28px); }
  .header-actions { gap: 4px; }
  .brand { font-size: 20px; gap: 7px; }
  .brand img { width: 25px; height: 25px; }
  .repo-arrow, .repo-name, .contents-label { display: none; }
  .menu-symbol .icon { width: 17px; height: 17px; }
  .contents summary, .repo-link { min-height: 34px; min-width: 32px; justify-content: center; padding: 6px; }
  .hero { grid-template-columns: 1fr; gap: 16px; padding: 22px 0 18px; }
  .hero h1 { font-size: clamp(27px, 7vw, 34px); }
  .hero-copy p { font-size: 13.5px; margin-top: 8px; }
  .hero-stats { gap: 14px 0; margin-top: 14px; padding-top: 14px; }
  .hero-stats div + div { margin-left: 18px; padding-left: 18px; }
  .hero-map { padding: 10px 10px 8px; }
  .station-core { stroke-width: 2.85; }
  .mobile-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mobile-counts > div:last-child { grid-column: 1 / -1; }
  .detail-row dd { font-size: 12.5px; }
  .page-section, #overview { scroll-margin-top: 64px; }
  .section-heading { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
  .section-heading p { font-size: 13px; }
  .rank-tools { flex-wrap: wrap; padding: 11px 12px; gap: 10px; }
  .horizon-group { width: 100%; justify-content: space-between; }
  .horizon-pills { flex: 1; max-width: 248px; }
  .horizon-pills button { flex: 1; padding: 5px 6px; text-align: center; }
  .search { width: 100%; }
  .search input { width: 100%; flex: 1; }
  .origin-note { padding: 8px 12px; }
  .board-foot { padding: 10px 12px; }
  .footer-inner { min-height: 50px; flex-wrap: wrap; padding-block: 8px; }
}

@media (max-width: 450px) {
  .brand { font-size: 18px; gap: 6px; }
  .brand img { width: 22px; height: 22px; }
  .header-inner { gap: 6px; }
  .lang-switch button { padding: 4px 6px; }
}

@media (max-width: 350px) {
  .wrap { width: calc(100% - 22px); }
  .brand img { display: none; }
  .brand { font-size: 17px; }
  .header-actions .repo-link, .contents summary { padding-inline: 5px; font-size: 12px; }
  .lang-switch button { padding-inline: 5px; }
  .header-inner { gap: 4px; }
}
