:root {
  color-scheme: dark;
  --bg: #070a0f;
  --panel: #0e141d;
  --panel-2: #121b26;
  --line: #263445;
  --text: #f4f7fb;
  --muted: #97a5b6;
  --cyan: #67e8f9;
  --blue: #60a5fa;
  --lime: #bef264;
  --orange: #fdba74;
  --red: #fda4af;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
}
a { color: inherit; }
.skip-link {
  position: fixed;
  z-index: 10;
  top: 12px;
  left: 12px;
  transform: translateY(-160%);
  padding: 10px 14px;
  color: var(--bg);
  background: var(--cyan);
  font-weight: 800;
}
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.hero {
  min-height: 680px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 75% 25%, rgba(96,165,250,.18), transparent 32%),
    linear-gradient(rgba(103,232,249,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(103,232,249,.035) 1px, transparent 1px);
  background-size: auto, 40px 40px, 40px 40px;
}
.nav, .hero-grid, main, footer { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }
.nav { height: 84px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { font-weight: 900; letter-spacing: .14em; text-decoration: none; }
.nav-links { display: flex; gap: 28px; }
.nav-links a { color: var(--muted); text-decoration: none; }
.nav-links a:hover, .nav-links a:focus-visible { color: var(--text); }
.hero-grid { display: grid; grid-template-columns: 1.65fr .75fr; gap: 80px; align-items: end; padding: 100px 0 90px; }
.eyebrow { color: var(--cyan); font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
h1 { margin: 18px 0 24px; font-size: clamp(52px, 8vw, 96px); line-height: .96; letter-spacing: -.055em; }
h2 { margin: 8px 0 10px; font-size: clamp(30px, 4vw, 48px); letter-spacing: -.035em; }
.lede { max-width: 720px; color: var(--muted); font-size: 20px; line-height: 1.7; }
.status-line { display: flex; align-items: center; gap: 10px; margin-top: 34px; color: var(--muted); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 18px var(--lime); }
.status-dot.stale { background: var(--orange); box-shadow: 0 0 18px var(--orange); }
.status-dot.error { background: var(--red); box-shadow: 0 0 18px var(--red); }
.hero-aside { border-left: 1px solid var(--line); padding-left: 32px; }
.hero-aside p { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.hero-aside strong { display: block; margin-bottom: 34px; font-size: 19px; line-height: 1.5; }
main { padding: 46px 0 100px; }
.metrics { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.metrics article { min-height: 150px; padding: 24px; border: 1px solid var(--line); background: var(--panel); }
.metrics span { display: block; color: var(--muted); font-size: 13px; }
.metrics strong { display: block; margin-top: 22px; font-size: 48px; letter-spacing: -.04em; }
.metrics .date-metric { font-size: 21px; line-height: 1.4; }
.metrics .location-metric strong { font-size: 34px; }
.metrics small { display: block; margin-top: 10px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.section { padding: 105px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 24px; }
.section-head { display: flex; justify-content: space-between; gap: 40px; align-items: end; margin-bottom: 32px; }
.section-head p, .section > p, .split p { color: var(--muted); }
.section-head .translation-note { margin-bottom: 0; color: var(--cyan); font-size: 12px; }
.controls { display: flex; gap: 12px; flex-wrap: wrap; }
.controls label { color: var(--muted); font-size: 12px; }
input, select { display: block; min-width: 190px; min-height: 40px; margin-top: 7px; padding: 10px 12px; color: var(--text); border: 1px solid var(--line); background: var(--panel); }
input:hover, select:hover { border-color: #3b536c; }
.ranking-meta { display: flex; justify-content: space-between; gap: 24px; margin: -12px 0 12px; color: var(--muted); font-size: 12px; }
.ranking-meta p { margin: 0; }
.table-scroll-note { display: none; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); scrollbar-color: var(--line) var(--panel); }
.ranking-frame { overflow: hidden; border: 1px solid var(--line); border-bottom-color: rgba(103, 232, 249, .55); background: var(--panel); box-shadow: 0 26px 70px rgba(0, 0, 0, .22); }
.ranking-frame-bar { display: flex; justify-content: space-between; gap: 24px; align-items: center; min-height: 54px; padding: 11px 15px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, rgba(103, 232, 249, .07), transparent 42%), var(--panel-2); }
.ranking-frame-status { display: flex; flex: 0 0 auto; align-items: center; gap: 9px; font-size: 12px; }
.ranking-frame-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 14px rgba(103, 232, 249, .8); }
.ranking-frame-actions { display: flex; justify-content: flex-end; align-items: center; gap: 14px; color: var(--muted); font-size: 11px; line-height: 1.45; text-align: right; }
.ranking-frame-buttons { display: inline-flex; flex: 0 0 auto; gap: 8px; }
#ranking-scroll-next, #ranking-scroll-top { flex: 0 0 auto; min-height: 32px; padding: 6px 10px; color: var(--cyan); border: 1px solid rgba(103, 232, 249, .35); background: transparent; font: inherit; font-weight: 750; cursor: pointer; }
#ranking-scroll-next:hover:not(:disabled), #ranking-scroll-next:focus-visible, #ranking-scroll-top:hover:not(:disabled), #ranking-scroll-top:focus-visible { color: var(--bg); border-color: var(--cyan); background: var(--cyan); }
#ranking-scroll-next:disabled, #ranking-scroll-top:disabled { cursor: default; opacity: .35; }
.ranking-progress { height: 3px; overflow: hidden; background: rgba(38, 52, 69, .55); }
.ranking-progress span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--blue), var(--cyan)); box-shadow: 0 0 14px rgba(103, 232, 249, .55); transition: width .12s linear; }
.ranking-viewport { height: clamp(360px, 48vh, 460px); overflow: auto; border: 0; outline-offset: -3px; scrollbar-gutter: stable; }
.ranking-viewport::-webkit-scrollbar { width: 10px; height: 10px; }
.ranking-viewport::-webkit-scrollbar-track { background: var(--panel); }
.ranking-viewport::-webkit-scrollbar-thumb { border: 2px solid var(--panel); border-radius: 999px; background: #34465b; }
.ranking-viewport::-webkit-scrollbar-thumb:hover { background: #49627d; }
.ranking-viewport thead th { position: sticky; z-index: 4; top: 0; background: var(--panel-2); box-shadow: 0 1px 0 var(--line), 0 12px 22px rgba(7, 10, 15, .32); }
.ranking-viewport tbody tr { transition: background-color .16s ease; }
.ranking-viewport tbody tr:hover { background: rgba(103, 232, 249, .025); }
table { width: 100%; min-width: 1240px; table-layout: fixed; border-collapse: collapse; background: var(--panel); }
caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.col-rank { width: 6%; }
.col-project { width: 34%; }
.col-region { width: 12%; }
.col-category { width: 15%; }
.col-number { width: 7%; }
.col-score { width: 8%; }
.col-delta { width: 9%; }
th, td { padding: 17px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
td { font-size: 14px; }
td:first-child { color: var(--cyan); font-weight: 800; }
.repo-link { font-weight: 750; text-decoration: none; }
.repo-link:hover, .repo-link:focus-visible { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
.repo-desc { max-width: 440px; margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.original-desc { max-width: 440px; margin-top: 7px; color: var(--muted); font-size: 11px; }
.original-desc summary { width: max-content; cursor: pointer; color: var(--blue); }
.original-desc p { margin: 7px 0 0; line-height: 1.5; }
.region-badge { display: inline-flex; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 11px; font-weight: 750; text-decoration: none; }
.region-badge:hover, .region-badge:focus-visible { border-color: var(--cyan); color: var(--text); }
.region-mainland_china { border-color: rgba(190, 242, 100, .45); color: var(--lime); }
.region-greater_china { border-color: rgba(96, 165, 250, .5); color: var(--blue); }
.region-overseas { border-color: rgba(103, 232, 249, .45); color: var(--cyan); }
.region-location { margin-top: 7px; overflow-wrap: anywhere; color: var(--muted); font-size: 11px; line-height: 1.4; }
.numeric { font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty-state { padding: 42px 18px; color: var(--muted); text-align: center; }
.empty-state span { display: block; }
.delta-up { color: var(--lime); }
.delta-down { color: var(--orange); }
.sort-tabs { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.sort-tab { min-height: 40px; padding: 9px 14px; color: var(--muted); border: 1px solid var(--line); background: var(--panel); cursor: pointer; }
.sort-tab:hover:not(:disabled), .sort-tab:focus-visible { color: var(--text); border-color: var(--cyan); }
.sort-tab[aria-pressed="true"] { color: var(--bg); border-color: var(--cyan); background: var(--cyan); font-weight: 800; }
.sort-tab:disabled { cursor: not-allowed; opacity: .45; }
.category-podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 8px 0 28px; }
.category-card { position: relative; min-height: 315px; padding: 26px; overflow: hidden; border: 1px solid var(--line); background: linear-gradient(145deg, var(--panel-2), var(--panel)); }
.category-card::after { content: ''; position: absolute; right: -55px; bottom: -75px; width: 160px; height: 160px; border: 1px solid rgba(103, 232, 249, .14); border-radius: 50%; }
.category-card-rank { display: block; color: var(--cyan); font-size: 12px; font-weight: 900; letter-spacing: .18em; }
.category-card > p { min-height: 48px; margin: 14px 0 5px; color: var(--text); font-size: 19px; font-weight: 800; line-height: 1.35; }
.category-card > strong { display: block; font-size: 38px; letter-spacing: -.04em; }
.category-card > small { display: block; margin-top: 3px; color: var(--muted); }
.category-card ol { position: relative; z-index: 1; margin: 22px 0 18px; padding: 0; list-style: none; }
.category-card li { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-bottom: 1px solid rgba(38, 52, 69, .7); color: var(--muted); font-size: 11px; }
.category-card li a { min-width: 0; overflow-wrap: anywhere; color: var(--text); text-decoration: none; }
.category-card li a:hover, .category-card li a:focus-visible { color: var(--cyan); }
.category-card li span { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.category-jump, .category-name-button { position: relative; z-index: 1; padding: 0; color: var(--cyan); border: 0; background: transparent; font: inherit; font-weight: 750; text-align: left; cursor: pointer; }
.category-jump:hover, .category-jump:focus-visible, .category-name-button:hover, .category-name-button:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.category-table { min-width: 960px; }
.category-table th:nth-child(1) { width: 6%; }
.category-table th:nth-child(2) { width: 23%; }
.category-table th:nth-child(7) { width: 27%; }
.category-boundary { margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 70px; }
.movers { margin: 28px 0 0; padding: 0; list-style: none; }
.movers li { display: grid; grid-template-columns: 38px 1fr auto; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.movers .index { color: var(--cyan); font-weight: 800; }
.movers small { color: var(--muted); }
.category-bars { margin-top: 32px; }
.bar-row { margin-bottom: 20px; }
.bar-label { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.bar-progress { width: 100%; height: 9px; appearance: none; border: 0; background: var(--panel-2); }
.bar-progress::-webkit-progress-bar { background: var(--panel-2); }
.bar-progress::-webkit-progress-value { background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.bar-progress::-moz-progress-bar { background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.method { padding-bottom: 70px; }
.method-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 34px; }
.method-grid article { padding: 28px; border: 1px solid var(--line); background: var(--panel); }
.method-grid strong { color: var(--cyan); font-size: 22px; }
.method-grid p { color: var(--muted); line-height: 1.7; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 28px 0 50px; color: var(--muted); font-size: 12px; }
.footer-link { color: var(--cyan); text-underline-offset: 3px; }
.noscript { width: min(calc(100% - 40px), var(--max)); margin: -30px auto 40px; color: var(--orange); }

@media (max-width: 800px) {
  .nav { height: 72px; }
  .nav-links { gap: 14px; font-size: 12px; }
  .hero-grid, .split { grid-template-columns: 1fr; }
  .hero-grid { padding: 58px 0 66px; gap: 30px; }
  .hero-aside { border-left: 0; border-top: 1px solid var(--line); padding: 25px 0 0; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .section-head { align-items: start; flex-direction: column; }
  .ranking-viewport { height: clamp(280px, 34vh, 320px); }
  .category-podium { grid-template-columns: 1fr; }
  .category-card { min-height: 0; }
  .section { padding: 76px 0; }
  .table-scroll-note { display: block; }
  .empty-state { text-align: left; }
  .empty-state span {
    position: sticky;
    left: 18px;
    width: min(620px, calc(100vw - 80px));
  }
  .method-grid { grid-template-columns: 1fr; }
  footer { flex-direction: column; }
}

@media (max-width: 480px) {
  .brand { font-size: 13px; }
  .nav-links { gap: 10px; font-size: 11px; }
  h1 { font-size: clamp(45px, 13.3vw, 52px); }
  .lede { font-size: 18px; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metrics article { min-height: 122px; padding: 18px; }
  .metrics strong { margin-top: 16px; font-size: 38px; }
  .metrics .date-metric { font-size: 15px; }
  .controls label { width: 100%; }
  .controls, input, select { width: 100%; }
  .sort-tabs, .sort-tab { width: 100%; }
  .ranking-meta { flex-direction: column; gap: 4px; }
  .ranking-frame-bar { align-items: flex-start; flex-direction: column; gap: 8px; }
  .ranking-frame-actions { align-items: flex-start; flex-direction: column; }
  .ranking-frame-buttons { width: 100%; }
  #ranking-scroll-next, #ranking-scroll-top { flex: 1 1 50%; }
  table { min-width: 1160px; }
  .category-table { min-width: 900px; }
  th, td { padding: 15px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ranking-progress span, .ranking-viewport tbody tr { transition: none; }
}
