@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  color-scheme: light;
  --bg: #f2f5fa;
  --surface: #ffffff;
  --surface-soft: #f6f8fc;
  --surface-raised: #ffffff;
  --text: #0f1c30;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --brand-soft: #eff6ff;
  --brand-on: #ffffff;
  --gold: #b45309;
  --gold-bg: #fef3c7;
  --gold-border: #f59e0b;
  --silver: #475569;
  --silver-bg: #f1f5f9;
  --silver-border: #94a3b8;
  --bronze: #9a3412;
  --bronze-bg: #ffedd5;
  --bronze-border: #f97316;
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.05);
  --shadow-card-hover: 0 4px 12px rgba(15, 23, 42, 0.08), 0 12px 28px rgba(15, 23, 42, 0.08);
  --shadow-float: 0 20px 60px rgba(15, 23, 42, 0.18);
  --focus: #2563eb;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-pill: 999px;
  --font-xs: 12px;
  --font-sm: 13px;
  --font-md: 14px;
  --font-base: 16px;
  --font-lg: 18px;
  --font-xl: 22px;
  --font-2xl: 28px;
  --font-3xl: 36px;
  --content-width: 1240px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #090e17;
  --surface: #0e1726;
  --surface-soft: #142034;
  --surface-raised: #1a2a44;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --line: #1e293b;
  --line-strong: #334155;
  --brand: #3b82f6;
  --brand-strong: #60a5fa;
  --brand-soft: #172554;
  --brand-on: #ffffff;
  --gold: #fcd34d;
  --gold-bg: #451a03;
  --gold-border: #d97706;
  --silver: #e2e8f0;
  --silver-bg: #1e293b;
  --silver-border: #64748b;
  --bronze: #fdba74;
  --bronze-bg: #431407;
  --bronze-border: #ea580c;
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.28), 0 8px 32px rgba(0, 0, 0, 0.28);
  --shadow-card-hover: 0 6px 16px rgba(0, 0, 0, 0.38), 0 16px 48px rgba(0, 0, 0, 0.38);
  --shadow-float: 0 24px 72px rgba(0, 0, 0, 0.6);
  --focus: #60a5fa;
}

/* Custom modern scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: var(--radius-pill); border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background: var(--bg);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: var(--font-base);
  font-variant-numeric: tabular-nums;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select { font: inherit; }
button, select { color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-strong); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
::selection { color: var(--brand-on); background: var(--brand-strong); }

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
}
.header-inner {
  width: 100%;
  max-width: var(--content-width);
  min-height: 72px;
  margin: 0 auto;
  padding: 10px 32px;
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.brand { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 12px; color: var(--text); }
.brand:hover { color: var(--text); text-decoration: none; }
.brand-mark { display: inline-flex; width: 40px; height: 40px; flex: 0 0 40px; }
.brand-mark svg { width: 100%; height: 100%; }
.brand-mark-bg { fill: var(--brand); }
.brand-mark-line { fill: none; stroke: var(--brand-on); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark-dot { fill: var(--brand-on); stroke: var(--brand); stroke-width: 1.5; }
.brand-copy { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.brand-copy strong { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.brand-copy small { margin-top: 2px; color: var(--text-muted); font-size: 11px; letter-spacing: .05em; white-space: nowrap; }
.site-nav { position: relative; margin-left: auto; }
.site-menu { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; }
.site-menu a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.site-menu a:hover { color: var(--brand); background: var(--brand-soft); text-decoration: none; }
.site-menu a[aria-current="page"] { color: var(--brand); background: var(--brand-soft); font-weight: 700; }
.menu-button, .theme-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}
.menu-button { display: none; padding: 0 10px; }
.menu-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme-button { flex: 0 0 auto; padding: 0 11px; }
[data-embed="1"] .theme-button { display: none; }
.theme-button:hover, .menu-button:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 10%, transparent); }
.theme-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.theme-button svg > g { display: none; }
[data-theme-mode="system"] .theme-button .icon-system,
[data-theme-mode="light"] .theme-button .icon-light,
[data-theme-mode="dark"] .theme-button .icon-dark { display: initial; }
.site-switcher { position: relative; flex: 0 0 auto; }
.site-switcher-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}
.site-switcher-button:hover, .site-switcher-button[aria-expanded="true"] {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 10%, transparent);
}
.site-switcher-button svg { width: 17px; height: 17px; fill: currentColor; }
.site-switcher-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 10px);
  right: 0;
  width: min(250px, calc(100vw - 24px));
  display: grid;
  gap: 4px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-float);
}
.site-switcher-menu[hidden] { display: none; }
.site-switcher-menu a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: background .15s ease, color .15s ease;
}
.site-switcher-menu a:hover, .site-switcher-menu a:focus-visible { background: var(--brand-soft); color: var(--brand-strong); text-decoration: none; }
.site-switcher-menu strong { font-size: 12px; font-weight: 750; }
.site-switcher-menu small { color: var(--text-muted); font-size: 10px; }

.page-container {
  width: 100%;
  max-width: var(--content-width);
  flex: 1 0 auto;
  margin: 32px auto 72px;
  padding: 0 32px;
}
.card {
  min-width: 0;
  margin-bottom: var(--space-5);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: box-shadow .2s ease;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .12em;
  line-height: 1.4;
  text-transform: uppercase;
}
.page-heading { margin: 0 0 var(--space-5); padding: 2px 2px 0; }
.page-heading h1 { margin: 0; font-size: clamp(26px, 3vw, 34px); font-weight: 760; letter-spacing: -.035em; line-height: 1.2; }
.page-description { max-width: 720px; margin: 9px 0 0; color: var(--text-secondary); font-size: 14px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-size: 20px; font-weight: 740; letter-spacing: -.02em; line-height: 1.3; }
.section-description { margin: 7px 0 0; color: var(--text-muted); font-size: 12px; }
.text-link { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; color: var(--brand-strong); font-size: 13px; font-weight: 700; }
.text-link:hover { text-decoration: underline; }

.hero-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, .95fr);
  align-items: center;
  gap: 36px;
  min-height: 240px;
  margin-bottom: var(--space-5);
  padding: 38px 44px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #0b1e3f 0%, #102a5c 38%, #173b7d 72%, #1d4ed8 100%);
  box-shadow: 0 12px 36px rgba(15, 30, 60, 0.22), 0 2px 8px rgba(15, 30, 60, 0.12);
  color: #fff;
}
:root[data-theme="dark"] .hero-panel {
  border-color: rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, #070e1b 0%, #0c1830 42%, #112447 75%, #183363 100%);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
}
/* Micro grid pattern overlay */
.hero-panel::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 50%, black 40%, transparent 100%);
}
/* Ambient glow orb decoration */
.hero-panel::after {
  position: absolute;
  right: -40px;
  top: -40px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  content: "";
  pointer-events: none;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.25) 0%, rgba(59, 130, 246, 0.05) 50%, transparent 70%);
}
.hero-copy, .hero-stats { position: relative; z-index: 1; min-width: 0; }
.hero-panel .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 4px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
}
.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #60a5fa;
  box-shadow: 0 0 8px #60a5fa;
}
.hero-copy h1 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(30px, 3.8vw, 42px);
  font-weight: 900;
  letter-spacing: -.035em;
  line-height: 1.16;
  color: #fff;
}
.hero-description {
  max-width: 550px;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14.5px;
  line-height: 1.65;
}
.hero-scope {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 20px 0 0;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
}
.hero-scope strong { color: #93c5fd; font-size: 13px; font-weight: 700; }
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.hero-stat {
  min-width: 0;
  min-height: 104px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px 16px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.hero-stat:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.3);
}
:root[data-theme="dark"] .hero-stat {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}
.hero-stat span { color: rgba(255, 255, 255, 0.72); font-size: 11px; font-weight: 600; letter-spacing: .04em; }
.hero-stat strong {
  margin: 5px 0 2px;
  color: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: clamp(24px, 2.7vw, 32px);
  font-weight: 850;
  letter-spacing: -.03em;
  line-height: 1.1;
}
.hero-stat small { color: rgba(255, 255, 255, 0.52); font-size: 10px; }

.selection-panel { padding: 26px 28px 28px; }
.selection-block { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 20px 0; }
.field-label { min-width: 64px; color: var(--text-secondary); font-size: 12px; font-weight: 750; letter-spacing: .02em; }
.segmented-control {
  display: inline-flex;
  max-width: 100%;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}
.segmented-control button {
  min-height: 34px;
  padding: 6px 16px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  transition: all .16s ease;
}
.segmented-control button:hover { color: var(--text); }
.segmented-control button[aria-pressed="true"] {
  background: var(--surface-raised);
  color: var(--brand);
  font-weight: 750;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}
.category-chips { display: flex; flex: 1 1 100%; flex-wrap: wrap; gap: 8px; }
.category-chip {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
  transition: all .15s ease;
}
.category-chip b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.category-chip:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }
.category-chip.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.28);
}
.category-chip.is-active b {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.filter-grid { display: grid; gap: 14px 12px; }
.contest-filters { grid-template-columns: 1.15fr 1.15fr 1.15fr 0.9fr 1.8fr; margin-top: 22px; }
.form-field { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.form-field > span:first-child { color: var(--text-secondary); font-size: 11.5px; font-weight: 700; letter-spacing: .02em; }
.form-field select, .form-field input, .search-input-wrap input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-field select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
}
:root[data-theme="dark"] .form-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
.form-field input::placeholder, .search-input-wrap input::placeholder { color: var(--text-muted); opacity: 0.85; }
.form-field select:focus, .form-field input:focus, .search-input-wrap input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent);
}
.search-input-wrap { position: relative; min-width: 0; display: flex; align-items: center; }
.search-input-wrap > svg {
  position: absolute;
  z-index: 1;
  left: 12px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}
.search-input-wrap input { padding-left: 36px; }
.search-field { min-width: 0; }

.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin: 0 0 var(--space-5); }
.metric-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 18px 20px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: all .2s ease;
}
.metric-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
  border-color: var(--line-strong);
}
.metric-card span { color: var(--text-secondary); font-size: 11.5px; font-weight: 650; letter-spacing: .02em; }
.metric-card strong {
  overflow: hidden;
  margin: 6px 0 2px;
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 26px;
  font-weight: 850;
  letter-spacing: -.035em;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.metric-card small { color: var(--text-muted); font-size: 10px; }
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: box-shadow .18s ease, transform .18s ease;
}
.metric-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-1px); }
.metric-card span { color: var(--text-secondary); font-size: 11px; font-weight: 600; letter-spacing: .02em; }
.metric-card strong { overflow: hidden; margin: 7px 0 3px; color: var(--text); font-size: 26px; font-weight: 800; letter-spacing: -.04em; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.metric-card small { color: var(--text-muted); font-size: 10px; }
.results-panel { padding: 23px 24px 18px; }
.result-heading { align-items: center; margin-bottom: 18px; }
.result-heading .eyebrow { margin-bottom: 5px; }
.result-count, .heading-count { display: inline-flex; align-items: center; padding: 5px 10px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface-soft); color: var(--text-secondary); font-size: 11px; font-weight: 700; white-space: nowrap; }
.table-scroll { width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; }
.mobile-sort { display: none; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; color: var(--text); font-size: var(--font-sm); }
.data-table th, .data-table td { padding: 11px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.data-table th { background: var(--surface-soft); color: var(--text-secondary); font-size: var(--font-xs); font-weight: 720; white-space: nowrap; }
.data-table thead th:first-child { border-radius: 8px 0 0 8px; }
.data-table thead th:last-child { border-radius: 0 8px 8px 0; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: color-mix(in srgb, var(--brand-soft) 46%, var(--surface)); }
.data-table .numeric, .numeric { text-align: right; font-variant-numeric: tabular-nums; }
.data-table th.numeric button { justify-content: flex-end; }
.data-table th button { width: 100%; display: inline-flex; align-items: center; justify-content: flex-start; gap: 5px; padding: 0; border: 0; background: transparent; color: inherit; font-size: inherit; font-weight: inherit; text-align: inherit; white-space: nowrap; cursor: pointer; }
.data-table th button:hover { color: var(--brand-strong); }
.data-table th.no-sort { cursor: default; }
.data-table th.no-sort button { cursor: default; }
.sort-indicator { color: var(--text-muted); font-size: 10px; }
.query-table { min-width: 980px; table-layout: fixed; }
.query-table th:nth-child(1), .query-table td:nth-child(1) { width: 9%; }
.query-table th:nth-child(2), .query-table td:nth-child(2) { width: 9%; }
.query-table th:nth-child(3), .query-table td:nth-child(3) { width: 6%; }
.query-table th:nth-child(4), .query-table td:nth-child(4) { width: 18%; }
.query-table th:nth-child(5), .query-table td:nth-child(5) { width: 7%; }
.query-table th:nth-child(6), .query-table td:nth-child(6) { width: 10%; }
.query-table th:nth-child(7), .query-table td:nth-child(7) { width: 9%; }
.query-table th:nth-child(8), .query-table td:nth-child(8) { width: 24%; }
.query-table th:nth-child(9), .query-table td:nth-child(9) { width: 8%; }
.data-table th.rank-heading { background: var(--brand-soft); color: var(--brand-strong); }
.data-table th.rank-heading button { justify-content: center; }
.query-table .school-cell, .school-cell { overflow-wrap: anywhere; white-space: normal; }
.rank-primary {
  background: var(--surface-soft);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  text-align: center !important;
  border-radius: 6px;
  transition: all .15s ease;
}
.rank-primary span, .rank-primary small { display: block; }
.rank-primary span { font-size: 16px; line-height: 1.2; font-family: 'Inter', system-ui, sans-serif; font-weight: 850; }
.rank-primary small { margin-top: 2px; color: var(--text-muted); font-size: 9.5px; font-weight: 600; }
.rank-primary.rank-top-1 {
  background: #fef9c3;
  color: #854d0e;
  box-shadow: inset 0 0 0 1px rgba(234, 179, 8, 0.35);
}
.rank-primary.rank-top-2 {
  background: #f1f5f9;
  color: #475569;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.4);
}
.rank-primary.rank-top-3 {
  background: #ffedd5;
  color: #9a3412;
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.35);
}

/* 深色模式：暗底柔和微光，彻底解决大亮块唐突刺眼问题 */
:root[data-theme="dark"] .rank-primary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
}
:root[data-theme="dark"] .rank-primary.rank-top-1 {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.3);
}
:root[data-theme="dark"] .rank-primary.rank-top-2 {
  background: rgba(148, 163, 184, 0.12);
  color: #e2e8f0;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.3);
}
:root[data-theme="dark"] .rank-primary.rank-top-3 {
  background: rgba(249, 115, 22, 0.12);
  color: #fdba74;
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.3);
}
.name-link {
  color: var(--brand);
  font-weight: 750;
  overflow-wrap: anywhere;
  transition: color .15s ease;
}
.name-link:hover { color: var(--brand-strong); text-decoration: underline; text-underline-offset: 3px; }
.award-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 2px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: 750;
  line-height: 1.25;
  white-space: nowrap;
  letter-spacing: .02em;
}
.award-gold {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
}
.award-silver {
  border-color: rgba(148, 163, 184, 0.4);
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  color: #334155;
}
.award-bronze {
  border-color: rgba(249, 115, 22, 0.4);
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  color: #9a3412;
}
:root[data-theme="dark"] .award-gold {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}
:root[data-theme="dark"] .award-silver {
  border-color: rgba(148, 163, 184, 0.5);
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
}
:root[data-theme="dark"] .award-bronze {
  border-color: rgba(249, 115, 22, 0.5);
  background: rgba(249, 115, 22, 0.15);
  color: #fdba74;
}
.award-plain { border-color: var(--line); background: var(--surface-soft); color: var(--text-secondary); }
.score-meter {
  display: block;
  overflow: hidden;
  width: 100%;
  height: 5px;
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
}
.score-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
}
.mobile-record-list { display: none; }
.result-card { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.result-card-top, .result-card-bottom, .result-person { display: flex; align-items: center; }
.result-card-top { justify-content: space-between; gap: 8px; }
.result-person { min-width: 0; gap: 10px; }
.mobile-rank { min-width: 42px; min-height: 40px; display: flex; flex-direction: column; justify-content: center; align-items: center; border-radius: 9px; background: var(--brand-soft); color: var(--brand-strong); font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.mobile-rank small { margin-top: 3px; color: var(--text-muted); font-size: 8px; font-weight: 650; }
.mobile-rank.rank-top-1 { background: #fef9c3; color: #854d0e; }
.mobile-rank.rank-top-2 { background: #f1f5f9; color: #475569; }
.mobile-rank.rank-top-3 { background: #ffedd5; color: #9a3412; }
:root[data-theme="dark"] .mobile-rank.rank-top-1 { background: rgba(245, 158, 11, 0.12); color: #fbbf24; }
:root[data-theme="dark"] .mobile-rank.rank-top-2 { background: rgba(148, 163, 184, 0.12); color: #e2e8f0; }
:root[data-theme="dark"] .mobile-rank.rank-top-3 { background: rgba(249, 115, 22, 0.12); color: #fdba74; }
.result-card .name-link { min-width: 0; font-size: 16px; }
.result-school { margin: 10px 0 12px 52px; color: var(--text); font-size: 12px; font-weight: 650; overflow-wrap: anywhere; }
.result-school span { display: block; margin-top: 3px; color: var(--text-muted); font-size: 11px; font-weight: 500; }
.result-card-bottom { justify-content: space-between; gap: 10px; margin-left: 52px; }
.mobile-score { width: min(180px, 56%); }
.mobile-score .score-cell { grid-template-columns: auto 1fr; align-items: center; gap: 8px; }
.mobile-score .score-meter { min-width: 40px; }
.mobile-score .score-cell small { font-size: 10px; }
.result-card .rank-set { margin-top: 12px; padding-top: 9px; border-top: 1px solid var(--line); justify-content: space-between; }
.result-card .rank-item { flex: 1 1 0; min-width: 0; }

.button, .text-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 730;
  line-height: 1.3;
  cursor: pointer;
  transition: transform .12s ease, border-color .15s ease, background .15s ease, color .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button-primary { border-color: var(--brand); background: var(--brand); color: var(--brand-on); }
.button-primary:hover { border-color: var(--brand-strong); background: var(--brand-strong); color: var(--brand-on); }
.button-secondary { border-color: var(--line); background: var(--surface); color: var(--text-secondary); }
.button-secondary:hover { border-color: var(--line-strong); background: var(--surface-soft); color: var(--text); }
.button-quiet { border-color: transparent; background: transparent; color: var(--brand-strong); }
.button-quiet:hover { background: var(--brand-soft); color: var(--brand-strong); }
.button-small { min-height: 31px; padding: 6px 10px; font-size: 11px; }
.text-button { min-height: 30px; padding: 4px 7px; border: 0; background: transparent; color: var(--brand-strong); }
.text-button:hover { text-decoration: underline; }
.list-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.pager-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.list-count { margin: 14px 0 0; color: var(--text-muted); font-size: 11px; }
.small { font-size: 11px; }
.muted { color: var(--text-muted); }

.list-panel { padding: 22px 24px; }
.list-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.list-search { width: min(100%, 310px); }
.school-table { min-width: 900px; }
.school-table th:nth-child(1), .school-table td:nth-child(1) { width: 60px; }
.school-table th:nth-child(2), .school-table td:nth-child(2) { min-width: 200px; }
.school-table th:nth-child(5), .school-table td:nth-child(5) { min-width: 140px; }
.school-table td.numeric { font-variant-numeric: tabular-nums; }
.bar-value { min-width: 120px; display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.bar-value > span:first-child { min-width: 30px; text-align: right; }
.mini-bar { overflow: hidden; width: 76px; height: 6px; display: inline-flex; border-radius: var(--radius-pill); background: var(--brand-soft); }
.mini-bar i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.school-card, .player-card, .contest-card, .history-card { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.school-card-title, .player-card-heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.list-rank { width: 30px; height: 30px; flex: 0 0 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--surface-soft); color: var(--text-secondary); font-size: 11px; font-weight: 760; font-variant-numeric: tabular-nums; }
.school-card-title .name-link, .player-card-heading > .name-link { min-width: 0; flex: 1 1 auto; font-size: 14px; }
.school-location { margin: 6px 0 12px 40px; color: var(--text-muted); font-size: 11px; overflow-wrap: anywhere; }
.school-bar-row { display: grid; grid-template-columns: auto auto minmax(60px, 1fr); align-items: center; gap: 8px; color: var(--text-muted); font-size: 10px; }
.school-bar-row b { color: var(--text); font-size: 11px; font-variant-numeric: tabular-nums; }
.school-bar-row .mini-bar { width: 100%; }
.school-card-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-top: 13px; padding-top: 10px; border-top: 1px solid var(--line); }
.school-card-stats span { display: flex; flex-direction: column; color: var(--text-muted); font-size: 9px; text-align: center; }
.school-card-stats b { margin-bottom: 2px; color: var(--text); font-size: 12px; font-variant-numeric: tabular-nums; }

.player-filters { justify-content: flex-start; }
.grade-filter { width: 142px; }
.player-card-heading .name-link { font-size: 15px; }
.player-points { display: flex; flex-direction: column; align-items: flex-end; color: var(--text); font-size: 17px; font-weight: 780; font-variant-numeric: tabular-nums; }
.player-points small { color: var(--text-muted); font-size: 9px; font-weight: 550; }
.player-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 12px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--text-muted); font-size: 10px; }
.player-card-meta > span:last-child { flex-basis: 100%; }
.best-contest { display: block; margin-top: 4px; color: var(--text-muted); font-size: 10px; font-weight: 500; white-space: normal; }
.active-filter { display: inline-flex; align-items: center; gap: 8px; margin: -4px 0 17px; padding: 5px 9px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface-soft); color: var(--text-secondary); font-size: 11px; }
.active-filter strong { color: var(--text); }

.profile-card { display: grid; grid-template-columns: minmax(240px, .9fr) minmax(0, 1.5fr); align-items: center; gap: 28px; margin-bottom: var(--space-5); padding: 26px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-card); }
.profile-back { margin: 0 0 var(--space-3); }
.profile-identity { min-width: 0; display: flex; align-items: center; gap: 16px; }
.profile-avatar { width: 68px; height: 68px; flex: 0 0 68px; display: flex; align-items: center; justify-content: center; border: 1px solid color-mix(in srgb, var(--brand) 26%, var(--line)); border-radius: 20px; background: var(--brand-soft); color: var(--brand-strong); font-size: 30px; font-weight: 800; }
.profile-identity .eyebrow { margin-bottom: 4px; }
.profile-identity h1 { margin: 0; font-size: 26px; font-weight: 780; letter-spacing: -.035em; line-height: 1.25; }
.profile-gender { margin-left: 8px; color: var(--text-muted); font-size: 12px; font-weight: 600; letter-spacing: 0; }
.profile-school { display: inline-block; max-width: 100%; margin-top: 6px; color: var(--text-secondary); font-size: 12px; font-weight: 620; overflow-wrap: anywhere; }
.profile-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.profile-stats article { min-width: 0; min-height: 70px; display: flex; flex-direction: column; justify-content: center; padding: 10px 12px; border-left: 1px solid var(--line); }
.profile-stats article > span { color: var(--text-muted); font-size: 10px; }
.profile-stats article > strong { overflow-wrap: anywhere; margin-top: 5px; color: var(--text); font-size: 17px; font-weight: 760; line-height: 1.3; }
.profile-stats article.best-profile-stat > strong { font-size: 12px; }
.profile-stats article > small { margin-top: 3px; color: var(--text-muted); font-size: 9px; overflow-wrap: anywhere; }
.chart-panel { padding-bottom: 20px; }
.chart-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 9px 16px; margin-bottom: 10px; }
.chart-toolbar p { margin: 0; color: var(--text-muted); font-size: 11px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; color: var(--text-secondary); font-size: 10px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i { width: 9px; height: 9px; display: inline-block; border-radius: 50%; }
.chart-legend i.gold, .chart-single-mark.gold { background: #a96c12; }
.chart-legend i.silver, .chart-single-mark.silver { background: #65748a; }
.chart-legend i.bronze, .chart-single-mark.bronze { background: #a96b45; }
:root[data-theme="dark"] .chart-legend i.gold, :root[data-theme="dark"] .chart-single-mark.gold { background: #f2ca63; }
:root[data-theme="dark"] .chart-legend i.silver, :root[data-theme="dark"] .chart-single-mark.silver { background: #aebbd0; }
:root[data-theme="dark"] .chart-legend i.bronze, :root[data-theme="dark"] .chart-single-mark.bronze { background: #e0a17b; }
.growth-chart { width: 100%; min-width: 0; }
.growth-svg { width: 100%; height: auto; overflow: visible; display: block; }
.chart-grid line { stroke: var(--line); stroke-width: 1; }
.chart-grid text { fill: var(--text-muted); font-size: 10px; font-family: inherit; font-variant-numeric: tabular-nums; }
.chart-x-label { fill: var(--text-secondary); font-size: 10px; font-family: inherit; }
.growth-line { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-hit { fill: transparent; cursor: pointer; }
.chart-marker { stroke: var(--surface); stroke-width: 2.5; transition: transform .15s ease; transform-box: fill-box; transform-origin: center; }
.chart-marker.gold { fill: #a96c12; }
.chart-marker.silver { fill: #65748a; }
.chart-marker.bronze { fill: #a96b45; }
.chart-marker.plain { fill: var(--brand); }
:root[data-theme="dark"] .chart-marker.gold { fill: #f2ca63; }
:root[data-theme="dark"] .chart-marker.silver { fill: #aebbd0; }
:root[data-theme="dark"] .chart-marker.bronze { fill: #e0a17b; }
.chart-point:hover .chart-marker, .chart-point:focus .chart-marker, .chart-point.is-selected .chart-marker { transform: scale(1.35); }
.chart-point:focus { outline: none; }
.chart-point:focus .chart-hit { stroke: var(--focus); stroke-width: 2; }
.chart-detail { min-height: 50px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 18px; margin-top: 6px; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); }
.chart-detail strong { color: var(--text); font-size: 12px; }
.chart-detail span { color: var(--text-secondary); font-size: 11px; }
.chart-single { display: flex; align-items: center; gap: 14px; min-height: 128px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-soft); }
.chart-single-mark { width: 14px; height: 14px; flex: 0 0 14px; border: 2px solid var(--surface); border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.chart-single > div { display: flex; flex-direction: column; }
.chart-single p { margin: 0; color: var(--text-secondary); font-size: 12px; }
.chart-single strong { margin: 2px 0; color: var(--text); font-size: 24px; font-weight: 780; }
.chart-single small { color: var(--text-muted); font-size: 10px; }
.chart-empty { display: grid; justify-items: center; padding: 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); text-align: center; }
.chart-empty h3 { margin: 6px 0 3px; font-size: 14px; }
.chart-empty p { margin: 0; color: var(--text-muted); font-size: 11px; }
.history-panel { padding-bottom: 18px; }
.heading-count { margin-left: 7px; vertical-align: 2px; font-size: 10px; }
.history-table { min-width: 880px; }
.history-table th:nth-child(1) { min-width: 90px; }
.history-table th:nth-child(2) { min-width: 170px; }
.profile-ranks, .history-ranks { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.profile-ranks > span, .history-ranks > span { display: inline-flex; align-items: center; gap: 3px; color: var(--text); font-size: 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.profile-ranks small, .history-ranks small { color: var(--text-muted); font-size: 9px; }
.rank-total { color: var(--text-muted); font-size: 10px; }
.history-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.history-year { color: var(--text-muted); font-size: 10px; font-weight: 650; }
.history-card h3 { margin: 8px 0; font-size: 13px; }
.history-score { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px; margin-bottom: 10px; color: var(--text-secondary); font-size: 10px; }
.history-score strong { color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.history-score > span:last-child { margin-left: auto; }
.history-ranks { padding-top: 9px; border-top: 1px solid var(--line); }
.table-note { margin: 13px 0 0; color: var(--text-muted); font-size: 10px; }

.notice-banner, .insight-note { display: flex; align-items: flex-start; gap: 9px; padding: 11px 13px; border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line)); border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--text-secondary); }
.notice-banner { margin-bottom: 16px; }
.notice-banner p, .insight-note p { margin: 0; font-size: 11px; }
.note-icon { width: 17px; height: 17px; flex: 0 0 17px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--brand); border-radius: 50%; color: var(--brand-strong); font-size: 10px; font-weight: 800; font-style: normal; }
.contest-table { min-width: 1060px; }
.contest-table th, .contest-table td { padding: 10px 8px; }
.contest-table td:nth-child(2) { min-width: 150px; }
.contest-table td:nth-child(5) { min-width: 210px; }
.contest-cuts { display: flex; flex-wrap: wrap; gap: 5px; }
.cut-pill { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.cut-pill .award-badge { min-height: 19px; padding: 1px 6px; font-size: 9px; }
.cut-pill b { color: var(--text); font-size: 11px; font-variant-numeric: tabular-nums; }
.type-pill { display: inline-flex; align-items: center; padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface-soft); color: var(--text-secondary); font-size: 10px; font-weight: 680; white-space: nowrap; }
.contest-card { padding: 15px; }
.contest-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-muted); font-size: 10px; }
.contest-card h3 { margin: 10px 0 12px; font-size: 15px; }
.contest-card-cuts { padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.contest-card-cuts > strong { display: block; margin-bottom: 7px; color: var(--text-secondary); font-size: 10px; }
.contest-card-cuts .contest-cuts { gap: 6px 12px; }
.contest-counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin: 12px 0; }
.contest-counts span { display: flex; flex-direction: column; color: var(--text-muted); font-size: 9px; text-align: center; }
.contest-counts b { color: var(--text); font-size: 12px; font-variant-numeric: tabular-nums; }
.contest-card > .button { width: 100%; }

.about-grid { max-width: 960px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.about-card { margin: 0; padding: var(--space-6); }
.about-card h2 { margin: 0 0 var(--space-2); font-size: var(--font-lg); }
.about-card p { max-width: 68ch; margin: 0; color: var(--text-secondary); font-size: var(--font-md); line-height: 1.85; }
.about-card p a { text-decoration: underline; text-underline-offset: .2em; }
.about-card p + p { margin-top: 9px; }
.about-wide { grid-column: 1 / -1; min-height: 0; }
.about-disclaimer { padding-top: 10px; border-top: 1px solid var(--line); color: var(--text-muted) !important; }

.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 220px; padding: 26px; text-align: center; }
.empty-state h1, .empty-state h3 { margin: 7px 0 5px; font-size: 17px; }
.empty-state p { max-width: 440px; margin: 0 0 15px; color: var(--text-muted); font-size: 12px; }
.empty-mark { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong); font-size: 22px; }
.error-card { display: flex; align-items: flex-start; gap: 12px; min-height: 100px; }
.error-card h1 { margin: 0 0 4px; font-size: 16px; }
.error-card p { margin: 0; color: var(--text-secondary); font-size: 12px; overflow-wrap: anywhere; }
.status-icon { width: 24px; height: 24px; flex: 0 0 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--bronze-bg); color: var(--bronze); font-weight: 800; }
.loading-card { display: flex; align-items: center; gap: 12px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); color: var(--text-secondary); }
.spinner { width: 20px; height: 20px; flex: 0 0 20px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { width: 100%; max-width: var(--content-width); margin: 0 auto; padding: 26px 32px 22px; }
.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.footer-brand { display: flex; align-items: baseline; gap: 10px; }
.footer-brand strong { color: var(--text); font-size: 13px; font-weight: 750; }
.footer-brand span { color: var(--text-muted); font-size: 11px; }
.footer-ecosystem {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.footer-ecosystem-title {
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 650;
}
.footer-eco-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  transition: all .15s ease;
}
.footer-eco-link:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
  text-decoration: none;
  transform: translateY(-1px);
}
.eco-icon {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.footer-eco-sep {
  color: var(--line-strong);
  font-size: 11px;
}
.footer-meta, .footer-note { color: var(--text-muted); font-size: 11px; }
.footer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 16px; }
.footer-meta a { color: var(--text-secondary); text-decoration: underline; text-underline-offset: 2px; }
.footer-note { margin: 10px 0 0; font-size: 10.5px; }

.insight-dialog { width: min(620px, calc(100% - 24px)); max-width: 620px; max-height: min(86vh, 760px); overflow: auto; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-float); }
.insight-dialog::backdrop { background: rgba(5, 12, 24, .62); backdrop-filter: blur(3px); }
.dialog-header { position: sticky; z-index: 1; top: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 21px 23px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.dialog-header .eyebrow { margin-bottom: 4px; }
.dialog-header h2 { margin: 0; font-size: 19px; overflow-wrap: anywhere; }
.icon-button { width: 36px; height: 36px; flex: 0 0 36px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--text-secondary); cursor: pointer; }
.icon-button:hover { background: var(--surface-soft); color: var(--text); }
.icon-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.dialog-body { padding: 18px 23px 23px; }
.dialog-body h3 { margin: 18px 0 9px; font-size: 13px; }
.insight-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 10px; color: var(--text-secondary); font-size: 11px; }
.insight-rank-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.insight-rank { min-width: 0; display: flex; flex-direction: column; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); }
.insight-rank > span { color: var(--text-muted); font-size: var(--font-xs); }
.insight-rank strong { margin: 4px 0 2px; color: var(--text); font-size: var(--font-base); }
.insight-rank small { color: var(--text-secondary); font-size: var(--font-xs); }
.insight-rank strong small { white-space: nowrap; }
.insight-note { margin-top: 11px; }
.cut-list { display: flex; flex-wrap: wrap; gap: 7px; }
.cut-list > span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); color: var(--text-secondary); font-size: 10px; }
.cut-list b { color: var(--text); font-size: 12px; font-variant-numeric: tabular-nums; }
.band-explanation { margin: 9px 0 0; color: var(--text-secondary); font-size: 11px; }
.rate-card { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px 11px; margin-top: 18px; padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--brand-soft); }
.rate-card > span { color: var(--text-secondary); font-size: 11px; font-weight: 700; }
.rate-card strong { color: var(--brand-strong); font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rate-card small { color: var(--text-muted); font-size: 10px; }

@media (max-width: 1000px) {
  .header-inner { gap: 10px; padding-inline: 20px; }
  .site-menu a { padding-inline: 8px; font-size: 12px; }
  .brand-copy strong { font-size: 14px; }
  .theme-button { padding-inline: 9px; }
  .site-switcher-button { padding-inline: 9px; }
  .hero-panel { grid-template-columns: minmax(0, 1fr) minmax(300px, .9fr); gap: 24px; padding: 28px 32px; }
  .contest-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric-card:last-child:nth-child(3n + 1) { grid-column: span 1; }
  .profile-card { grid-template-columns: minmax(200px, .8fr) minmax(0, 1.2fr); gap: 18px; }
  .profile-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-stats article:nth-child(odd) { border-left: 0; }
}

@media (max-width: 900px) {
  .menu-button { display: inline-flex; }
  .site-menu { position: fixed; top: 74px; right: 12px; left: 12px; width: auto; display: none; flex-direction: column; align-items: stretch; gap: 3px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-float); }
  .site-menu:not([hidden]) { display: flex; }
  .site-menu a { padding: 11px 12px; font-size: 13px; }
  .theme-button { margin-left: auto; }
}

@media (max-width: 720px) {
  .header-inner { min-height: 60px; padding: 8px 16px; gap: 8px; }
  .site-menu { top: 60px; }
  .brand { gap: 8px; }
  .brand-mark { width: 36px; height: 36px; flex-basis: 36px; }
  .brand-copy strong { font-size: 14px; }
  .brand-copy small { font-size: 10px; }
  .menu-button, .theme-button, .site-switcher-button { min-height: 36px; }
  .menu-button { padding-inline: 8px; font-size: 11px; }
  .theme-button, .site-switcher-button { padding-inline: 9px; font-size: 11px; }
  .page-container { margin: 20px auto 48px; padding: 0 16px; }
  .card { margin-bottom: 14px; padding: 18px; border-radius: var(--radius-md); }
  .page-heading { margin-bottom: 15px; }
  .page-heading h1 { font-size: 27px; }
  .page-description { margin-top: 6px; font-size: 12px; }
  .hero-panel { grid-template-columns: minmax(0, 1fr); gap: 16px; min-height: 0; padding: 24px 20px 20px; border-radius: var(--radius-lg); }
  .hero-panel::after { right: -120px; bottom: -120px; width: 300px; height: 300px; }
  .hero-copy h1 { max-width: 100%; font-size: clamp(24px, 7vw, 30px); }
  .hero-description { margin-top: 8px; font-size: 13px; }
  .hero-scope { margin-top: 10px; }
  .hero-stats { gap: 8px; }
  .hero-stat { min-height: 72px; padding: 10px 10px; }
  .hero-stat span { font-size: 10px; }
  .hero-stat strong { font-size: clamp(22px, 6vw, 28px); }
  .hero-stat small { font-size: 9px; }
  .selection-panel { padding: 18px; }
  .section-heading { gap: 10px; margin-bottom: 15px; }
  .section-heading h2 { font-size: 18px; }
  .section-description { font-size: var(--font-xs); }
  .text-link { font-size: 11px; }
  .selection-block { align-items: flex-start; flex-direction: column; gap: 8px; margin: 16px 0; }
  .field-label { min-width: 0; }
  .segmented-control { width: 100%; }
  #category-tabs { max-width: 100%; flex-wrap: wrap; }
  .segmented-control button { flex: 1 1 0; padding-inline: 6px; font-size: 11px; }
  .category-chips { gap: 6px; }
  .category-chip { min-height: 33px; gap: 6px; padding: 5px 9px; font-size: 10px; }
  .category-chip b { min-width: 16px; font-size: 9px; }
  .contest-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 17px; }
  .contest-filters .form-field { grid-column: span 1; }
  .contest-filters .search-field { grid-column: 1 / -1; }
  .form-field select, .form-field input, .search-input-wrap input { height: 40px; font-size: 12px; }
  .metric-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
  .metric-card { grid-column: span 2; padding: 12px; }
  .metric-card:nth-child(n + 4) { grid-column: span 3; }
  .metric-card span { font-size: 10px; }
  .metric-card strong { margin: 5px 0 2px; font-size: 21px; }
  .metric-card small { font-size: 9px; }
  .results-panel, .list-panel { padding: 17px; }
  .result-heading { align-items: flex-start; }
  .result-count { padding: 4px 7px; font-size: 9px; }
  .result-heading h2 { font-size: 16px; }
  .result-heading .section-description { max-width: 230px; }
  .mobile-sort { display: flex; gap: 6px; margin: -4px 0 12px; }
  .mobile-sort button { flex: 1 1 0; min-height: 34px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-soft); color: var(--text-secondary); font-size: 11px; font-weight: 700; }
  .mobile-sort button[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }
  .table-scroll { display: none; }
  .mobile-record-list { display: grid; gap: 9px; }
  .list-pager { align-items: flex-start; flex-direction: column; }
  .pager-actions { width: 100%; }
  .pager-actions .button { flex: 1 1 auto; }
  .list-toolbar { align-items: stretch; flex-direction: column; gap: 11px; }
  .list-search { width: 100%; }
  .school-card, .player-card, .contest-card, .history-card { padding: 13px; }
  .school-card-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .player-filters { align-items: stretch; }
  .player-filters > div:first-child { width: 100%; }
  .player-filters .grade-filter { width: 100%; }
  .grade-filter { width: 100%; }
  .active-filter { margin-top: -3px; }
  .profile-card { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 18px; }
  .profile-avatar { width: 58px; height: 58px; flex-basis: 58px; border-radius: 17px; font-size: 26px; }
  .profile-identity h1 { font-size: 23px; }
  .profile-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 0; }
  .profile-stats article { min-height: 58px; padding: 7px 10px; }
  .profile-stats article:nth-child(odd) { border-left: 0; }
  .profile-stats article > strong { font-size: 15px; }
  .chart-panel { padding: 17px 14px; }
  .chart-toolbar { align-items: flex-start; flex-direction: column; }
  .chart-legend { gap: 8px; font-size: var(--font-xs); }
  .chart-detail { align-items: flex-start; flex-direction: column; gap: 4px; }
  .chart-single { align-items: flex-start; flex-wrap: wrap; gap: 10px; padding: 14px; }
  .history-panel { padding: 17px; }
  .table-note { line-height: 1.7; }
  .contest-panel .notice-banner { margin-bottom: 12px; }
  .about-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .about-card { margin: 0; padding: 18px; }
  .about-wide { grid-column: auto; }
  .footer-inner { padding: 20px 16px; }
  .footer-brand { align-items: flex-start; flex-direction: column; gap: 2px; }
  .footer-meta { align-items: flex-start; flex-direction: column; gap: 6px; }
  .insight-dialog { max-height: 88vh; border-radius: 16px; }
  .dialog-header { padding: 17px 17px 13px; }
  .dialog-body { padding: 15px 17px 19px; }
  .insight-rank-grid { gap: 6px; }
  .insight-rank { padding: 9px; }
}

@media (max-width: 420px) {
  .header-inner { padding-inline: 12px; }
  .brand-copy strong { font-size: 13px; }
  .brand-copy small { font-size: 9px; }
  .theme-button, .site-switcher-button { width: 36px; padding: 0; }
  .theme-button span, .site-switcher-button span { display: none; }
  .menu-button { gap: 4px; padding-inline: 7px; }
  .menu-button svg { width: 16px; }
  .page-container { padding-inline: 12px; }
  .hero-panel { padding-inline: 16px; }
  .hero-stats { gap: 5px; }
  .hero-stat { padding-inline: 7px; }
  .hero-stat strong { font-size: 20px; }
  .selection-panel, .results-panel, .list-panel { padding-inline: 13px; }
  .result-card { padding: 12px; }
  .result-school, .result-card-bottom { margin-left: 45px; }
  .result-card .rank-set { gap: 2px; }
  .result-card .rank-item { padding-inline: 2px; }
  .pager-actions { align-items: stretch; flex-direction: column; }
  .contest-counts { gap: 2px; }
  .history-ranks { column-gap: 8px; }
  .insight-summary { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
