:root {
  color-scheme: light;
  --ink: #16202a;
  --muted: #5f6f7f;
  --line: #d8e1e8;
  --surface: #ffffff;
  --wash: #f5f8fb;
  --teal: #0f766e;
  --blue: #2563eb;
  --red: #b42318;
  --gold: #b7791f;
  --shadow: 0 18px 45px rgba(25, 45, 70, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #eef5f8 0, #f8fafc 420px, #ffffff 100%);
}

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid rgba(216, 225, 232, 0.86);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(16px);
}

.brand,
.top-actions,
.hero-stats,
.chips,
.card-actions,
.meta-row {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: white;
  background: var(--teal);
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.top-actions {
  gap: 18px;
}

.top-actions a,
.nav-compare {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.nav-compare {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}

main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 28px clamp(18px, 4vw, 48px) 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(360px, 0.96fr);
  min-height: 480px;
  gap: 34px;
  align-items: stretch;
  padding: clamp(24px, 4vw, 42px) 0 38px;
}

.hero-copy {
  align-self: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(38px, 5vw, 70px);
  line-height: 1.04;
  letter-spacing: 0;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 720px;
  color: #405365;
  font-size: 18px;
  line-height: 1.8;
}

.hero-stats {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.stat {
  min-width: 132px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

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

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

.hero-visual {
  position: relative;
  overflow: hidden;
  min-height: 440px;
  border: 1px solid rgba(216, 225, 232, 0.86);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.2)),
    url("assets/shenzhen-schools.png") center / cover;
  box-shadow: var(--shadow);
}

.score-ridge {
  position: absolute;
  right: 26px;
  bottom: 26px;
  left: 26px;
  display: grid;
  height: 150px;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  align-items: end;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 8px;
  background: rgba(12, 32, 48, 0.48);
  backdrop-filter: blur(8px);
}

.score-ridge span {
  display: block;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, #f8d066, #34d399);
}

.district-map {
  position: absolute;
  top: 24px;
  left: 24px;
  display: flex;
  max-width: calc(100% - 48px);
  flex-wrap: wrap;
  gap: 8px;
}

.district-pill {
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  color: white;
  background: rgba(11, 31, 46, 0.58);
  font-size: 13px;
  backdrop-filter: blur(8px);
}

.controls,
.school-list,
.admission-library {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.controls {
  display: grid;
  grid-template-columns: minmax(340px, 1.25fr) repeat(4, minmax(160px, 0.42fr));
  gap: 20px;
  align-items: end;
  padding: 16px;
  box-shadow: 0 10px 26px rgba(25, 45, 70, 0.06);
}

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

.search-wrap,
.filter-grid label {
  min-width: 0;
}

.search-wrap {
  display: grid;
  gap: 10px;
}

input,
select {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #ffffff;
  font-size: 15px;
  font-weight: 650;
  line-height: 1;
}

input {
  padding: 0 14px;
}

select {
  padding: 0 10px;
}

.filter-grid {
  display: contents;
}

@supports not (display: contents) {
  .filter-grid {
    grid-column: span 4;
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 20px;
  }
}

.school-list,
.admission-library {
  margin-top: 20px;
}

.school-list,
.admission-library {
  padding: 18px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

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

.section-head h2 {
  margin: 0;
  font-size: 24px;
}

.section-head.compact h2 {
  font-size: 20px;
}

.ghost-button,
.primary-button,
.icon-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
}

.ghost-button {
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
}

.primary-button {
  padding: 0 12px;
  color: white;
  border-color: var(--teal);
  background: var(--teal);
}

.icon-button {
  width: 38px;
  color: var(--muted);
  background: #fff;
  font-size: 24px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}

.school-card {
  display: grid;
  min-height: 318px;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.school-card > div:first-child {
  display: grid;
  gap: 12px;
}

.school-card h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.22;
}

.school-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.72;
}

.chips {
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 6px 9px;
  border-radius: 7px;
  color: #334155;
  background: #edf4f6;
  font-size: 12px;
  font-weight: 700;
}

.chip.blue {
  color: #16468c;
  background: #e7f0ff;
}

.chip.gold {
  color: #84520f;
  background: #fff3d6;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.admission-metrics {
  display: grid;
  gap: 8px;
}

.admission-row {
  display: grid;
  grid-template-columns: minmax(76px, 0.78fr) minmax(84px, 0.82fr) minmax(128px, 1.4fr);
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px;
  border-radius: 7px;
  background: var(--wash);
}

.admission-row span,
.admission-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.admission-row strong {
  font-size: 18px;
  line-height: 1.2;
}

.admission-row.compact strong {
  color: var(--teal);
}

.metric {
  min-height: 72px;
  padding: 10px;
  border-radius: 7px;
  background: var(--wash);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.card-actions {
  gap: 8px;
  align-self: end;
}

.card-actions button {
  flex: 1;
}

.admission-page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 34px 0 22px;
}

.admission-page-head h1 {
  max-width: 760px;
  margin-bottom: 12px;
  font-size: clamp(34px, 4vw, 56px);
}

.admission-page-head p:not(.eyebrow) {
  max-width: 760px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.admission-controls {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(150px, 0.22fr) minmax(150px, 0.22fr);
  gap: 14px;
  margin-bottom: 14px;
}

.admission-cards {
  display: grid;
  gap: 14px;
}

.admission-school-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admission-school-card[open] {
  box-shadow: 0 10px 26px rgba(25, 45, 70, 0.07);
}

.admission-school-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  list-style: none;
}

.admission-school-head::-webkit-details-marker {
  display: none;
}

.admission-school-head strong {
  min-width: 54px;
  padding: 6px 8px;
  border-radius: 7px;
  color: var(--teal);
  background: #e5f4f2;
  font-size: 14px;
  text-align: center;
}

.school-title-link {
  display: block;
  min-height: 0;
  margin-top: 8px;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 22px;
  font-weight: 850;
  line-height: 1.25;
  text-align: left;
}

.admission-school-actions {
  margin-top: -4px;
}

.inline-link {
  color: var(--teal);
  font-weight: 800;
  text-decoration: none;
}

.inline-link:hover {
  text-decoration: underline;
}

.admission-item-list {
  display: grid;
  gap: 10px;
}

.admission-item {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: var(--wash);
}

.admission-item-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.admission-item h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
}

.admission-item p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mini-metrics.four {
  grid-template-columns: repeat(4, 1fr);
}

.admission-mini-metrics {
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
}

.mini-metrics div {
  padding: 9px;
  border-radius: 7px;
  background: var(--wash);
}

.mini-metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.mini-metrics strong {
  display: block;
  margin-top: 3px;
  font-size: 17px;
}

.admission-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.detail-admission-list {
  display: grid;
  max-height: 430px;
  overflow: auto;
  gap: 10px;
  padding-right: 4px;
}

.detail-admission-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--wash);
}

.detail-admission-item strong,
.detail-admission-item span {
  display: block;
}

.detail-admission-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-admission-item p {
  margin: 8px 0 0;
}

.empty-state {
  padding: 18px;
  border-radius: 8px;
  color: var(--muted);
  background: var(--wash);
  line-height: 1.7;
}

.empty-state.compact {
  padding: 10px 12px;
  font-size: 13px;
}

.compare-table-wrap {
  overflow-x: auto;
  max-height: min(68vh, 720px);
}

.compare-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}

.segmented {
  display: inline-flex;
  gap: 0;
  padding: 5px;
  border: 1px solid #cbd8e2;
  border-radius: 10px;
  background: #eef3f7;
}

.segmented button {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  color: #334155;
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.segmented button:hover {
  color: var(--ink);
  background: #fff;
}

.segmented button.active {
  color: #fff;
  background: var(--teal);
  box-shadow: 0 6px 14px rgba(15, 118, 110, 0.22);
}

.compare-school-picker {
  min-width: 240px;
}

.compare-section + .compare-section {
  margin-top: 24px;
}

.compare-section h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.compare-year-table th:first-child,
.compare-year-table td:first-child {
  min-width: 80px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  min-width: 110px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th:first-child,
td:first-child {
  min-width: 92px;
  color: var(--muted);
  font-weight: 700;
}

dialog {
  width: min(960px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

#compareDialog {
  width: min(1180px, calc(100vw - 28px));
}

.detail {
  position: relative;
  padding: 26px;
}

.compare-modal {
  position: relative;
  padding: 26px;
}

.compare-modal .section-head {
  align-items: flex-start;
  padding-right: 78px;
}

.compare-modal .section-head h2 {
  line-height: 1.2;
}

.compare-modal .section-head .ghost-button {
  margin-top: 18px;
  white-space: nowrap;
}

.close-dialog {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
}

.detail h2 {
  max-width: calc(100% - 52px);
  margin-bottom: 8px;
  font-size: 30px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.detail-block {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.detail-block h3 {
  margin-bottom: 10px;
  font-size: 16px;
}

.detail-block p,
.detail-block li {
  color: #475569;
  line-height: 1.75;
}

.admission-table {
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admission-table > div {
  display: grid;
  grid-template-columns: minmax(92px, 0.8fr) minmax(130px, 1fr) minmax(170px, 1.25fr);
}

.admission-table > div:first-child {
  color: var(--muted);
  background: var(--wash);
  font-size: 12px;
  font-weight: 800;
}

.admission-table > div + div {
  border-top: 1px solid var(--line);
}

.admission-table span,
.admission-table strong {
  padding: 10px;
  line-height: 1.55;
}

.admission-table strong {
  font-size: 14px;
}

.year-table-wrap {
  overflow-x: auto;
}

.year-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 14px;
}

.year-table th,
.year-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.year-table th {
  color: var(--muted);
  background: var(--wash);
  font-size: 12px;
  font-weight: 800;
}

.detail-block.wide {
  grid-column: 1 / -1;
}

.detail-intro {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.detail-intro p {
  max-width: 92ch;
}

.mini-list {
  display: grid;
  gap: 8px;
  padding-left: 18px;
}

@media (max-width: 1060px) {
  .hero,
  .controls,
  .school-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions,
  .list-actions {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    min-height: auto;
  }

  .admission-page-head {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 320px;
  }

  .filter-grid,
  .detail-grid,
  .admission-controls {
    grid-template-columns: 1fr;
  }

  .compare-modal {
    padding: 20px;
  }

  .compare-modal .section-head {
    padding-right: 54px;
  }

  .compare-modal .section-head .ghost-button {
    margin-top: 0;
  }

  .compare-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .segmented,
  .compare-school-picker {
    width: 100%;
  }

  .segmented button {
    flex: 1;
    padding: 0 10px;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .metrics,
  .mini-metrics,
  .mini-metrics.four {
    grid-template-columns: 1fr;
  }

  .admission-row,
  .admission-table > div {
    grid-template-columns: 1fr;
  }

  .admission-table span,
  .admission-table strong {
    padding: 8px 10px;
  }
}
