:root {
  color-scheme: light;
  --ink: #16211f;
  --muted: #5b6965;
  --line: #d8e1dc;
  --paper: #f8faf7;
  --panel: #ffffff;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --accent: #b45309;
  --blue: #1d4ed8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: var(--brand-dark);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 247, 0.95);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.link-button,
.lang-toggle,
.card-actions a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--panel);
  text-decoration: none;
  font-weight: 700;
}

.lang-toggle {
  color: var(--brand-dark);
  cursor: pointer;
  font: inherit;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.search-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: clamp(20px, 5vw, 56px);
  align-items: start;
  padding: clamp(32px, 7vw, 76px) 0 26px;
}

.intro h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: 0;
}

.intro p {
  max-width: 650px;
  color: var(--muted);
  font-size: 18px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.filters {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

input[type="range"] {
  padding: 0;
}

.check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.check input {
  width: 18px;
  min-height: 18px;
}

.results-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.results-head h2,
.band h2 {
  margin: 0;
  font-size: 24px;
}

.results-head p,
.muted {
  color: var(--muted);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  padding-bottom: 30px;
}

.school-card,
.record,
.evidence-grid article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.school-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.school-card:hover,
.school-card:focus-visible {
  border-color: #9bc9c2;
  box-shadow: 0 10px 28px rgba(15, 94, 89, 0.12);
  outline: none;
  transform: translateY(-1px);
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.school-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.school-logo {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef7f5;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 900;
}

.school-logo img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.card-head h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.card-head p,
.school-card p {
  margin: 0;
  color: var(--muted);
}

.card-head strong {
  white-space: nowrap;
  color: var(--brand-dark);
}

.badges,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badges span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.badges span {
  background: #e6f4f1;
  color: #0f5d56;
}

.mini-metrics {
  display: grid;
  gap: 10px;
}

.score-row {
  display: grid;
  gap: 5px;
}

.score-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.score-label strong {
  color: var(--blue);
  white-space: nowrap;
}

.score-track {
  width: 100%;
  height: 12px;
  overflow: hidden;
  background: #e8edf5;
  border-radius: 999px;
}

.score-fill {
  display: block;
  height: 100%;
  min-width: 2px;
  background: #2474ea;
  border-radius: inherit;
}

.score-value {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  background: #eef2ff;
  border-radius: 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.score-value strong {
  white-space: nowrap;
}

.outcome-visuals {
  display: grid;
  gap: 14px;
  max-width: 680px;
  margin: 14px 0;
}

.score-row-large .score-label {
  font-size: 14px;
}

.score-row-large .score-track {
  height: 18px;
  border-radius: 0;
}

.compact-metrics {
  grid-template-columns: repeat(auto-fit, minmax(210px, 260px));
}

.detail {
  padding-bottom: 40px;
}

.detail-hero {
  padding: clamp(32px, 6vw, 64px) 0 24px;
}

.detail-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(34px, 6vw, 68px);
  line-height: 1.04;
  letter-spacing: 0;
}

.detail-hero p {
  color: var(--muted);
}

.band {
  padding: 26px 0;
  border-top: 1px solid var(--line);
}

.metrics,
.evidence-grid,
.source-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.metrics div {
  min-height: 92px;
  display: grid;
  gap: 4px;
  align-content: center;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metrics strong {
  color: var(--brand-dark);
  font-size: 24px;
}

.metrics span {
  color: var(--muted);
}

.record,
.evidence-grid article {
  padding: 16px;
  margin-top: 12px;
}

.record h3,
.evidence-grid h3 {
  margin: 0 0 6px;
  font-size: 17px;
}

.sources a + a {
  margin-left: 8px;
}

.excerpt {
  border-left: 3px solid var(--line);
  padding-left: 12px;
  color: var(--muted);
}

.zh {
  font-family: inherit;
}

.footer {
  padding: 24px clamp(16px, 4vw, 48px);
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.empty {
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

@media (max-width: 760px) {
  .search-shell,
  .results-head {
    grid-template-columns: 1fr;
    display: grid;
  }

  .card-head {
    display: grid;
  }

  .topbar {
    position: static;
  }
}
