:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-muted: #f8fafc;
  --panel-translucent: rgba(255, 255, 255, 0.9);
  --header-bg: #ffffff;
  --header-top: #1f2937;
  --line: #dce4ef;
  --line-strong: #cbd7e8;
  --section-line: #eef2f7;
  --text: #071226;
  --copy: #42506a;
  --muted: #61708a;
  --nav: #526078;
  --link: #2563eb;
  --button: #111a32;
  --button-hover: #1d2b52;
  --button-text: #ffffff;
  --control-bg: #ffffff;
  --control-hover: #f3f6fb;
  --control-disabled-bg: #f7f9fc;
  --control-disabled-text: #9aa6ba;
  --input-bg: #ffffff;
  --input-text: #071226;
  --input-placeholder: #7a879a;
  --menu-bg: #ffffff;
  --menu-hover: #eef5ff;
  --table-head-bg: #ffffff;
  --table-head-text: #536584;
  --row: #f7f9fc;
  --row-alt: #ffffff;
  --focus: #8bb7ff;
  --focus-ring: rgba(37, 99, 235, 0.12);
  --danger: #ef4444;
  --danger-ring: rgba(239, 68, 68, 0.12);
  --warning-border: #f3d19c;
  --warning-bg: #fff7ed;
  --warning-text: #8a4b12;
  --info-border: #bfdbfe;
  --info-bg: #eff6ff;
  --info-text: #1d4ed8;
  --hero-bg:
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(14, 165, 233, 0.05) 42%, rgba(255, 255, 255, 0.96) 43%),
    var(--panel);
  --bili-border: #cfe8f8;
  --bili-bg:
    linear-gradient(135deg, rgba(0, 174, 236, 0.14), rgba(255, 255, 255, 0.88) 44%),
    var(--panel);
  --bili-soft-border: rgba(0, 174, 236, 0.22);
  --bili-chip-bg: rgba(255, 255, 255, 0.72);
  --shadow-soft: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-card: 0 8px 22px rgba(15, 23, 42, 0.06);
  --shadow-large: 0 12px 30px rgba(15, 23, 42, 0.08);
  --shadow-menu: 0 14px 30px rgba(15, 23, 42, 0.16);
  --tooltip-bg: #111827;
  --tooltip-text: #ffffff;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111318;
  --panel: #191c22;
  --panel-muted: #20242c;
  --panel-translucent: rgba(31, 35, 43, 0.9);
  --header-bg: #171a20;
  --header-top: #3b82f6;
  --line: #303640;
  --line-strong: #46505e;
  --section-line: #303640;
  --text: #f4f7fb;
  --copy: #c7d0df;
  --muted: #a8b3c3;
  --nav: #b6c0cf;
  --link: #7cc7ff;
  --button: #2563eb;
  --button-hover: #1d4ed8;
  --button-text: #ffffff;
  --control-bg: #20242c;
  --control-hover: #29313c;
  --control-disabled-bg: #171a20;
  --control-disabled-text: #6f7b8d;
  --input-bg: #15181e;
  --input-text: #f4f7fb;
  --input-placeholder: #7f8a9a;
  --menu-bg: #20242c;
  --menu-hover: #29313c;
  --table-head-bg: #20242c;
  --table-head-text: #c5cfdd;
  --row: #15191f;
  --row-alt: #1b2028;
  --focus: #77b7ff;
  --focus-ring: rgba(119, 183, 255, 0.18);
  --danger: #fb7185;
  --danger-ring: rgba(251, 113, 133, 0.18);
  --warning-border: #8d672d;
  --warning-bg: #2b2418;
  --warning-text: #ffd188;
  --info-border: #315f9c;
  --info-bg: #182335;
  --info-text: #9cc8ff;
  --hero-bg:
    linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(0, 174, 236, 0.08) 42%, rgba(25, 28, 34, 0.96) 43%),
    var(--panel);
  --bili-border: #24556a;
  --bili-bg:
    linear-gradient(135deg, rgba(0, 174, 236, 0.16), rgba(25, 28, 34, 0.9) 44%),
    var(--panel);
  --bili-soft-border: rgba(124, 199, 255, 0.24);
  --bili-chip-bg: rgba(32, 36, 44, 0.78);
  --shadow-soft: 0 2px 10px rgba(0, 0, 0, 0.24);
  --shadow-card: 0 8px 22px rgba(0, 0, 0, 0.28);
  --shadow-large: 0 12px 30px rgba(0, 0, 0, 0.34);
  --shadow-menu: 0 14px 30px rgba(0, 0, 0, 0.36);
  --tooltip-bg: #edf2fb;
  --tooltip-text: #111318;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  overflow-x: hidden;
}

.site-header {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 0 26px;
  border-top: 3px solid var(--header-top);
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 24px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.brand-link:hover {
  text-decoration: none;
}

.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  object-fit: cover;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  flex: 1;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--nav);
  font-size: 18px;
  text-decoration: none;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text);
  text-decoration: none;
}

.theme-toggle {
  height: 38px;
  min-width: 76px;
  margin-left: auto;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  background: var(--control-bg);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.theme-toggle:hover {
  background: var(--control-hover);
}

.shell {
  width: min(100%, 1824px);
  margin: 0 auto;
  padding: 12px 24px 40px;
}

.startup-loading {
  min-height: calc(100vh - 124px);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: var(--muted);
  text-align: center;
}

.startup-loading h1 {
  margin: 0;
  color: var(--text);
  font-size: 28px;
}

.startup-loading p {
  margin: 0;
}

.loading-spinner {
  width: 38px;
  height: 38px;
  border: 3px solid var(--line);
  border-top-color: var(--link);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.home-view {
  --home-accent: #155e75;
  --home-accent-soft: #e8f3f6;
  width: min(100%, 1120px);
  margin: 20px auto 0;
}
html[data-theme="dark"] .home-view { --home-accent: #7dd3e3; --home-accent-soft: #18333d; }
.promo-carousel { position: relative; overflow: hidden; border-radius: 16px; background: #193644; }
.promo-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.promo-track::-webkit-scrollbar { display: none; }
.promo-track:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: 16px; }
.promo-slide {
  position: relative; isolation: isolate; flex: 0 0 100%; min-width: 0; min-height: 132px;
  display: flex; align-items: center; gap: 24px; padding: 24px 32px;
  scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden;
  color: #fff; background: linear-gradient(110deg, #1a2e3c, #155366);
}
.promo-slide.promo-contest-slide { display: flex; padding: 0; background: #101e2e; }
.promo-contest-link { display: flex; align-items: center; width: 100%; height: 100%; }
.promo-contest-link picture { display: block; width: 100%; }
.promo-contest-link img { display: block; width: 100%; height: auto; }
.promo-contest-link:focus-visible { outline: 3px solid #f5bf77; outline-offset: -4px; }
.promo-symbol { width: 66px; height: 66px; flex-shrink: 0; display: grid; place-items: center; border: 1px solid #ffffff24; border-radius: 18px; background: #ffffff0a; transform: rotate(-6deg); }
.promo-symbol svg { width: 42px; height: 42px; fill: none; stroke: #8de5fa; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.promo-copy { min-width: 0; z-index: 1; }
.promo-kicker { font-size: 10px; font-weight: 700; color: #9cdae9; letter-spacing: 1.8px; }
.promo-copy h2 { margin: 7px 0 6px; font-size: 23px; letter-spacing: .3px; }
.promo-copy p { margin: 0; font-size: 12px; color: #c5dbe2; }
.promo-link { display: inline-flex; align-items: center; gap: 22px; flex-shrink: 0; margin-left: auto; padding: 12px 18px; border: 1px solid #ffffff40; border-radius: 10px; background: #ffffff0d; color: #fff; font-size: 13px; font-weight: 600; z-index: 1; text-decoration: none; }
.promo-link:hover { background: #ffffff20; text-decoration: none; }
.promo-link span { font-size: 20px; }
.promo-decoration { position: absolute; right: 125px; top: -56px; z-index: -1; color: #ffffff05; font-size: 190px; font-family: Consolas, monospace; font-weight: 700; transform: rotate(-12deg); }
.promo-navigation { position: absolute; display: flex; align-items: center; gap: 9px; right: 22px; bottom: 8px; }
.promo-navigation > button { width: 24px; height: 20px; padding: 0; border-radius: 4px; background: transparent; color: #d3ecf2; font-size: 14px; }
.promo-navigation > button:hover { background: #ffffff22; }
.promo-dots { display: flex; gap: 6px; }
.promo-dots button { display: grid; place-items: center; width: 20px; height: 20px; background: transparent; padding: 0; }
.promo-dots button::after { content: ''; width: 5px; height: 5px; border-radius: 5px; background: #ffffff50; transition: width .2s; }
.promo-dots button[aria-current="true"]::after { width: 16px; background: #a4e7f2; }
.home-intro { padding: 30px 2px 26px; }
.home-eyebrow { display: flex; align-items: center; gap: 9px; margin: 0 0 15px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 1.8px; }
.home-eyebrow span { width: 6px; height: 6px; background: #45acba; border-radius: 50%; }
.home-intro h1 { font-size: clamp(28px, 3vw, 38px); font-weight: 760; line-height: 1.4; letter-spacing: -1.6px; }
.home-heading-dot { color: #2f99a9; }
.home-intro > p:last-child { margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.home-query-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.home-query-card { min-width: 0; padding: 25px 26px 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: 0 5px 22px #0f172a03; }
.home-card-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 22px; }
.home-card-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0; }
.home-card-icon svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.home-person-icon { color: var(--home-accent); background: var(--home-accent-soft); }
.home-school-icon { color: #89704c; background: #f7f1e7; }
.home-competition-icon { color: #65609c; background: #f1effb; }
html[data-theme="dark"] .home-school-icon { color: #e3c695; background: #342d23; }
html[data-theme="dark"] .home-competition-icon { color: #c4b5fd; background: #302943; }
.home-card-heading h2 { margin: 0; color: var(--text); font-size: 17px; font-weight: 700; }
.home-card-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.home-card-number { align-self: flex-start; margin-left: auto; color: var(--line-strong); font-family: Consolas, monospace; font-size: 12px; padding-top: 2px; }
.home-search-field { display: flex; align-items: center; gap: 11px; padding: 6px 6px 6px 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-muted); transition: border-color .2s, box-shadow .2s; }
.home-search-field:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-ring); }
.home-search-field > svg { width: 19px; height: 19px; flex-shrink: 0; stroke: var(--muted); stroke-width: 1.5; fill: none; }
.home-search-field input { height: 42px; padding: 0; border: 0; background: transparent; box-shadow: none; outline: none; font-size: 14px; }
.home-search-field input:focus { box-shadow: none; }
.home-search-field button { width: 44px; height: 44px; flex-shrink: 0; border-radius: 9px; font-size: 24px; background: var(--home-accent); color: var(--panel); transition: transform .2s; }
.home-search-field button:hover { transform: translateX(1px); filter: brightness(1.12); }
.home-card-hint { margin: 12px 0 0; color: var(--muted); font-size: 11px; }
.home-competition-card { grid-column: 1 / -1; position: relative; }
.home-competition-card .home-card-heading { margin-bottom: 18px; }
.home-competition-fields { display: flex; gap: 12px; align-items: stretch; }
.home-competition-fields > select { width: auto; min-width: 150px; height: 52px; border-radius: 10px; font-size: 14px; background-color: var(--panel-muted); }
.home-competition-fields > select[disabled] { opacity: .5; }
.home-competition-picker { flex: 1; min-width: 0; }
.home-competition-picker > summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 52px; padding: 0 17px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-muted); color: var(--text); font-size: 14px; list-style: none; cursor: pointer; }
.home-competition-picker > summary::-webkit-details-marker { display: none; }
.home-competition-picker > summary svg { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.5; }
.home-competition-picker > summary span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-competition-picker[open] > summary { border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-ring); }
.home-competition-menu { position: fixed; z-index: 1002; padding: 20px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--menu-bg); box-shadow: var(--shadow-menu); overflow: auto; overscroll-behavior: contain; }
.home-picker-heading { display: flex; justify-content: space-between; color: var(--text); font-size: 15px; }
.home-picker-heading > span { color: var(--muted); font-size: 12px; }
.home-competition-menu fieldset { position: relative; margin: 20px 0 0; padding: 0; border: 0; }
.home-competition-menu legend { margin-bottom: 10px; padding: 0; color: var(--muted); font-size: 12px; }
.home-choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.home-edition-choices { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.home-choice-grid label { display: flex; align-items: center; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--copy); font-size: 12px; cursor: pointer; }
.home-choice-grid label:has(input:checked) { border-color: var(--focus); background: var(--menu-hover); color: var(--text); }
.home-choice-grid input { width: 14px; height: 14px; margin: 0; padding: 0; accent-color: var(--home-accent); flex-shrink: 0; }
.home-edition-shortcuts { display: flex; gap: 10px; position: absolute; right: 0; top: -29px; }
.home-edition-shortcuts button { height: 24px; padding: 0 5px; font-size: 11px; background: transparent; color: var(--link); }
.home-picker-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.home-picker-footer span { color: var(--muted); font-size: 11px; }
.home-picker-footer span.is-invalid { color: var(--danger); }
.home-picker-footer button { height: 36px; min-width: 70px; padding: 0 16px; font-size: 13px; }
.home-competition-submit { height: 52px; padding: 0 22px; border-radius: 10px; background: var(--home-accent); color: var(--panel); font-size: 14px; white-space: nowrap; }
.home-competition-submit span { margin-left: 20px; font-size: 18px; }
.home-competition-submit:hover { background: var(--home-accent); filter: brightness(1.12); }
.home-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 22px 2px 4px; font-size: 11px; color: var(--muted); }
.home-footer p { margin: 0; }
.home-footer > div { display: flex; gap: 20px; flex-wrap: wrap; }
.home-community strong { font-weight: 500; color: var(--copy); }
.home-data-note::before { content: ''; display: inline-block; margin-right: 6px; width: 5px; height: 5px; vertical-align: 2px; border-radius: 50%; background: #bc9774; }
@media (prefers-reduced-motion: reduce) { .promo-track { scroll-behavior: auto; } }

.search-panel {
  position: relative;
  z-index: 20;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  overflow: visible;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 84px;
  padding: 0 24px;
  border-bottom: 1px solid var(--section-line);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-title svg,
.back-button svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
}

.meta-line {
  color: var(--muted);
  font-size: 14px;
  min-height: 20px;
  text-align: right;
}

.search-grid,
.competition-grid,
.school-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) 90px;
  gap: 12px;
  padding: 24px;
}

.search-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(150px, 0.65fr);
}

.competition-grid {
  grid-template-columns: 150px minmax(190px, 1fr) 140px 160px 160px minmax(170px, 1fr) minmax(190px, 1fr) 90px;
}

.school-grid {
  grid-template-columns: minmax(240px, 1fr) 90px;
}

input,
select,
button {
  height: 60px;
  border-radius: 8px;
  font: inherit;
}

input,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--input-text);
  padding: 0 18px;
  outline: none;
}

input::placeholder {
  color: var(--input-placeholder);
}

select {
  color: var(--text);
}

input:focus,
select:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

input.is-invalid,
select.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-ring);
}

.combo-field {
  position: relative;
}

.combo-field[data-disabled="true"] {
  opacity: 0.72;
}

.combo-menu {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--menu-bg);
  box-shadow: var(--shadow-menu);
}

.combo-option {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border-radius: 0;
  background: var(--menu-bg);
  color: var(--text);
  text-align: left;
}

.combo-option:hover {
  background: var(--menu-hover);
}

.combo-option small,
.combo-empty {
  color: var(--muted);
  font-size: 13px;
}

.combo-empty {
  padding: 16px;
  text-align: center;
}

button {
  border: 0;
  background: var(--button);
  color: var(--button-text);
  cursor: pointer;
}

button:hover {
  background: var(--button-hover);
}

.person-edition-filter { position: relative; min-width: 0; }
.person-edition-button {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 0 18px; border: 1px solid var(--line);
  background: var(--input-bg); color: var(--input-text); text-align: left;
}
.person-edition-button:hover { background: var(--menu-hover); }
.person-edition-button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-edition-button svg { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; }
.person-edition-button:focus-visible { outline: 3px solid var(--focus-ring); border-color: var(--focus); }
.person-edition-button[aria-invalid="true"] { border-color: var(--danger); }
.person-edition-menu {
  position: fixed; z-index: 1001; padding: 14px; overflow-y: auto;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--menu-bg); color: var(--text); box-shadow: var(--shadow-menu);
}
.person-edition-actions { display: flex; gap: 8px; margin-bottom: 12px; }
.person-edition-actions button {
  height: 34px; padding: 0 10px; font-size: 13px;
  color: var(--text); background: var(--input-bg); border: 1px solid var(--line);
}
.person-edition-actions button:hover { background: var(--menu-hover); }
.person-edition-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.person-edition-options label {
  display: flex; align-items: center; gap: 8px; padding: 10px 6px;
  font-size: 14px; white-space: nowrap; border-radius: 6px; cursor: pointer;
}
.person-edition-options label:hover, .person-edition-options label:has(input:checked) { background: var(--menu-hover); }
.person-edition-options input { width: 17px; height: 17px; padding: 0; margin: 0; accent-color: var(--button); }
.person-edition-apply { width: 100%; height: 42px; margin-top: 12px; font-size: 14px; }
.person-filter-help { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 13px; }
.person-filter-help.is-invalid { color: var(--danger); }

.table-wrap {
  position: relative;
  z-index: 1;
  margin-top: 24px;
  border: 1px solid var(--line);
  background: var(--panel);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
  height: 78px;
  text-align: center;
  vertical-align: middle;
}

th:last-child,
td:last-child {
  border-right: 0;
}

th {
  height: 70px;
  color: var(--table-head-text);
  font-weight: 500;
  background: var(--table-head-bg);
}

tbody tr:nth-child(odd) {
  background: var(--row);
}

tbody tr:nth-child(even) {
  background: var(--row-alt);
}

.result-table th:nth-child(1),
.result-table td:nth-child(1) {
  width: 96px;
}

.result-table th:nth-child(2),
.result-table td:nth-child(2) {
  width: 190px;
}

.result-table th:nth-child(3),
.result-table td:nth-child(3) {
  width: 360px;
}

.result-table th:nth-child(n+4),
.result-table td:nth-child(n+4) {
  width: 126px;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.name-with-badges {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  vertical-align: middle;
}

.champion-badge {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.22), 0 1px 4px rgba(15, 23, 42, 0.18);
}

.champion-badge-image {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  object-fit: cover;
}

.champion-blue {
  background: linear-gradient(135deg, #4da3ff, #1664df);
}

.champion-gold {
  background: linear-gradient(135deg, #ffd66b, #d79512);
}

.champion-badge::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  z-index: 20;
  width: max-content;
  max-width: 180px;
  padding: 7px 10px;
  border-radius: 6px;
  background: var(--tooltip-bg);
  color: var(--tooltip-text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 120ms ease, transform 120ms ease;
}

.champion-badge:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

.empty {
  display: none;
  padding: 40px;
  color: var(--muted);
  text-align: center;
}

.table-wrap.is-empty table {
  display: none;
}

.table-wrap.is-empty .empty {
  display: block;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--panel);
}

.pagination-summary,
.page-total {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.pagination-button {
  height: 38px;
  min-width: 74px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  background: var(--control-bg);
  color: var(--text);
}

.pagination-button:hover {
  background: var(--control-hover);
}

.pagination-button:disabled {
  border-color: var(--line);
  background: var(--control-disabled-bg);
  color: var(--control-disabled-text);
  cursor: not-allowed;
}

.page-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.page-jump input {
  width: 74px;
  height: 38px;
  padding: 0 10px;
  text-align: center;
}

.detail-head {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px 24px;
}

.back-button {
  width: 108px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.detail-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(96px, 1fr));
  gap: 1px;
  margin-top: 18px;
  border: 1px solid var(--line);
  background: var(--line);
  overflow: hidden;
}

.stat-cell {
  background: var(--panel);
  min-height: 82px;
  display: grid;
  place-items: center;
}

.stat-cell strong {
  display: block;
  font-size: 22px;
}

.stat-cell span {
  color: var(--muted);
  font-size: 14px;
}

.detail-table th:nth-child(1),
.detail-table td:nth-child(1) {
  width: 120px;
}

.detail-table th:nth-child(2),
.detail-table td:nth-child(2),
.detail-table th:nth-child(3),
.detail-table td:nth-child(3) {
  width: 110px;
}

.detail-table th:nth-child(4),
.detail-table td:nth-child(4) {
  width: 100px;
}

.detail-table th:nth-child(5),
.detail-table td:nth-child(5) {
  width: 360px;
}

.detail-table th:nth-child(6),
.detail-table td:nth-child(6) {
  width: 120px;
}

.competition-table {
  min-width: 1280px;
}

.competition-table th:nth-child(1),
.competition-table td:nth-child(1),
.competition-table th:nth-child(2),
.competition-table td:nth-child(2),
.competition-table th:nth-child(3),
.competition-table td:nth-child(3),
.competition-table th:nth-child(4),
.competition-table td:nth-child(4) {
  width: 100px;
}

.competition-table th:nth-child(5),
.competition-table td:nth-child(5) {
  width: 260px;
}

.competition-table th:nth-child(6),
.competition-table td:nth-child(6) {
  width: 130px;
}

.competition-table th:nth-child(7),
.competition-table td:nth-child(7) {
  width: 260px;
}

.competition-table th:nth-child(8),
.competition-table td:nth-child(8) {
  width: 120px;
}

.school-table {
  min-width: 1120px;
}

.school-table th:nth-child(1),
.school-table td:nth-child(1) {
  width: 96px;
}

.school-table th:nth-child(2),
.school-table td:nth-child(2) {
  width: 360px;
}

.school-table th:nth-child(3),
.school-table td:nth-child(3) {
  width: 140px;
}

.school-table th:nth-child(n+4),
.school-table td:nth-child(n+4) {
  width: 112px;
}

.school-detail-table {
  min-width: 980px;
}

.school-detail-table th:nth-child(1),
.school-detail-table td:nth-child(1) {
  width: 96px;
}

.school-detail-table th:nth-child(2),
.school-detail-table td:nth-child(2) {
  width: 220px;
}

.school-detail-table th:nth-child(n+3),
.school-detail-table td:nth-child(n+3) {
  width: 112px;
}

@media (max-width: 760px) {
  .site-header {
    height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
    padding: 14px 16px 10px;
  }

  .brand-link {
    font-size: 22px;
  }

  .main-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    gap: 24px;
  }

  .theme-toggle {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    min-width: 60px;
    margin-left: 0;
    height: 34px;
    font-size: 13px;
  }

  .nav-link {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 0 2px;
    font-size: 17px;
  }

  .shell {
    padding: 12px;
  }

  .home-view { margin-top: 4px; }
  .promo-slide { display: grid; grid-template-columns: 46px minmax(0, 1fr); min-height: 120px; padding: 20px; gap: 10px 14px; }
  .promo-symbol { width: 46px; height: 46px; border-radius: 13px; }
  .promo-symbol svg { width: 30px; height: 30px; }
  .promo-copy { grid-column: 2; }
  .promo-kicker { font-size: 8px; letter-spacing: 1.2px; }
  .promo-copy h2 { font-size: 17px; margin: 5px 0; }
  .promo-copy p { font-size: 10px; line-height: 1.6; }
  .promo-link { grid-column: 2; justify-self: start; padding: 7px 12px; font-size: 11px; gap: 12px; margin: 0; }
  .promo-link span { font-size: 14px; }
  .home-intro { padding: 30px 4px 24px; }
  .home-intro h1 { font-size: 28px; letter-spacing: -1px; }
  .home-title-detail { display: block; }
  .home-intro > p:last-child { max-width: 300px; font-size: 12px; }
  .home-eyebrow { font-size: 8px; letter-spacing: 1.3px; }
  .home-query-grid { grid-template-columns: 1fr; gap: 12px; }
  .home-query-card { padding: 20px; border-radius: 14px; }
  .home-card-heading { margin-bottom: 17px; }
  .home-card-heading h2 { font-size: 16px; }
  .home-card-heading p { font-size: 11px; }
  .home-search-field input { font-size: 16px; }
  .home-competition-fields { flex-wrap: wrap; gap: 10px; }
  .home-competition-fields > select { min-width: 0; flex: 1; height: 48px; font-size: 14px; }
  .home-competition-picker { flex-basis: 100%; order: 2; }
  .home-competition-picker > summary { font-size: 13px; min-height: 48px; }
  .home-competition-submit { flex-basis: 100%; order: 3; height: 46px; }
  .home-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-edition-choices { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .home-competition-menu { padding: 16px; }
  .home-footer { padding: 18px 4px 10px; font-size: 10px; line-height: 1.8; }
  .home-footer > div { gap: 8px 18px; }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
  }

  h1 {
    font-size: 24px;
  }

  .meta-line {
    text-align: left;
  }

  .search-grid,
  .school-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 16px;
  }

  .competition-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 16px;
  }

  .combo-menu {
    border-radius: 10px;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.24);
  }

  .combo-option {
    height: 46px;
    padding: 0 12px;
  }

  .pagination-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }

  .pagination-controls {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }

  .pagination-button {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
    padding: 0 8px;
  }

  .page-jump {
    flex: 1 1 100%;
  }

  .page-jump input {
    width: 86px;
  }

  input,
  select,
  button {
    height: 54px;
    font-size: 16px;
  }

  .table-wrap {
    margin-top: 16px;
    border-radius: 8px;
  }

  .detail-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats-strip {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  th,
  td {
    height: 58px;
    padding: 0 12px;
    font-size: 15px;
  }
}

@media (hover: none) {
  button:hover {
    background: var(--button);
  }

  .theme-toggle:hover,
  .pagination-button:hover {
    background: var(--control-bg);
  }

  .combo-option:hover {
    background: var(--menu-bg);
  }
}
