:root {
  --ink: #17212f;
  --muted: #667085;
  --paper: #fff;
  --wash: #f4f7f5;
  --line: #d9e3de;
  --brand: #116149;
  --brand-strong: #073f33;
  --mint: #e7f3ed;
  --amber: #9a5b00;
  --amber-soft: #fff3d9;
  --red: #b83a2d;
  --red-soft: #fff0ec;
  --blue: #2455a6;
  --blue-soft: #eaf1ff;
  --radius: 12px;
  --shadow: 0 18px 50px rgba(7, 63, 51, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--wash);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
  padding: 11px max(24px, calc((100vw - 1240px) / 2));
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(217, 227, 222, 0.9);
  backdrop-filter: blur(16px);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--brand-strong);
  color: #fff;
  font-weight: 850;
}

.brand-copy strong,
.brand-copy small {
  display: block;
}

.brand-copy strong {
  white-space: nowrap;
}

.brand-copy strong span {
  margin-left: 4px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.brand-copy small {
  color: var(--muted);
  font-size: 12px;
}

.header-nav,
.degree-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}

.degree-switch {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--wash);
}

.degree-switch a,
.intelligence-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 720;
}

.degree-switch a.active {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 5px 14px rgba(17, 97, 73, 0.18);
}

.intelligence-link:hover,
.degree-switch a:not(.active):hover {
  color: var(--ink);
  background: #fff;
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 36px;
  align-items: end;
  padding: 76px 0 48px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.17em;
}

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

h1 {
  max-width: 780px;
  margin-bottom: 18px;
  font-size: clamp(38px, 4.7vw, 64px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.hero-lead {
  max-width: 790px;
  margin-bottom: 24px;
  color: #465469;
  font-size: 18px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-meta span,
.hero-meta time {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 720;
}

.cycle-note {
  padding: 26px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--brand-strong);
  box-shadow: var(--shadow);
}

.cycle-note-kicker {
  display: block;
  margin-bottom: 8px;
  color: #b9dfd1;
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0.12em;
}

.cycle-note strong {
  display: block;
  margin-bottom: 9px;
  font-size: 21px;
}

.cycle-note p {
  margin-bottom: 0;
  color: #d7ebe4;
  font-size: 14px;
}

.finder {
  margin-bottom: 48px;
}

.finder-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.finder-head h2,
.method h2 {
  margin-bottom: 0;
  font-size: clamp(27px, 3vw, 38px);
  letter-spacing: -0.03em;
}

.finder-updated {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 13px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) 1fr 1fr auto;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 8px 25px rgba(23, 33, 47, 0.05);
}

.filters label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.filters label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.filters input,
.filters select,
.reset-button {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.filters input,
.filters select {
  padding: 0 12px;
}

.filters input:focus,
.filters select:focus {
  outline: 3px solid rgba(17, 97, 73, 0.13);
  border-color: var(--brand);
}

.reset-button {
  align-self: end;
  padding: 0 16px;
  color: var(--brand);
  font-weight: 760;
  cursor: pointer;
}

.reset-button:hover {
  background: var(--mint);
}

.result-summary {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 2px 10px;
  color: var(--muted);
  font-size: 13px;
}

.result-summary p {
  margin-bottom: 0;
}

.school-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.school-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 17px;
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 8px 26px rgba(23, 33, 47, 0.045);
}

.school-card > * {
  min-width: 0;
}

.school-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

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

.school-code {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 10px;
  color: #fff;
  background: var(--brand-strong);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.school-name {
  min-width: 0;
}

.school-name h3 {
  margin: 0 0 2px;
  font-size: 20px;
  line-height: 1.25;
}

.school-name p {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.status-open {
  color: var(--brand);
  background: var(--mint);
}

.status-not_open,
.status-not_announced {
  color: var(--amber);
  background: var(--amber-soft);
}

.status-closed {
  color: var(--red);
  background: var(--red-soft);
}

.status-not_applicable,
.status-unknown {
  color: var(--muted);
  background: #eef1f4;
}

.route-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.route-pill,
.scope-pill {
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 750;
}

.route-pill {
  color: var(--blue);
  background: var(--blue-soft);
}

.scope-pill {
  color: var(--brand);
  background: var(--mint);
}

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

.fact {
  min-width: 0;
  padding: 10px;
  border: 1px solid #e7ece9;
  border-radius: 8px;
  background: #fafcfb;
}

.fact dt {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
}

.fact dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 780;
}

.requirements {
  display: grid;
  gap: 7px;
  padding-top: 2px;
}

.requirement {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  color: #465469;
  font-size: 13px;
}

.requirement strong {
  color: var(--ink);
  font-size: 12px;
}

.card-warning {
  margin: -3px 0 0;
  padding: 9px 11px;
  border-left: 3px solid #d79a22;
  background: #fff9e9;
  color: #765012;
  font-size: 12px;
}

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

.official-button,
.source-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 13px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 780;
}

.official-button {
  color: #fff;
  background: var(--brand);
}

.official-button:hover {
  background: var(--brand-strong);
}

.source-button {
  border: 1px solid var(--line);
  color: var(--brand);
  background: #fff;
}

.school-card details {
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.school-card summary {
  color: var(--brand);
  font-weight: 760;
  cursor: pointer;
}

.school-card details p {
  margin: 9px 0 0;
}

.school-card .alternate-routes ul {
  display: grid;
  gap: 6px;
  margin: 9px 0 0;
  padding-left: 18px;
}

.school-card .alternate-routes li {
  color: #465469;
}

.empty-state {
  padding: 56px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
  background: #fff;
}

.empty-state p {
  margin: 7px 0 0;
  color: var(--muted);
}

.method {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 48px;
  padding: 46px;
  margin-bottom: 52px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--brand-strong);
}

.method .eyebrow {
  color: #a8d5c6;
}

.method ol {
  display: grid;
  gap: 18px;
  margin: 0;
  padding-left: 22px;
}

.method li {
  padding-left: 6px;
  color: #d7ebe4;
}

.method li strong {
  color: #fff;
}

.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 15;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--brand);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.site-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
  padding: 34px max(24px, calc((100vw - 1240px) / 2));
  color: #cfe2dc;
  background: #101b23;
  font-size: 13px;
}

.site-footer strong {
  color: #fff;
}

.site-footer p {
  margin: 6px 0 0;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
}

.site-footer a:hover {
  color: #fff;
}

@media (max-width: 900px) {
  .hero,
  .method {
    grid-template-columns: 1fr;
  }

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

  .search-field {
    grid-column: 1 / -1;
  }

  .reset-button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  body {
    padding-bottom: 68px;
  }

  .site-header {
    min-height: 62px;
    padding: 10px 16px;
  }

  .brand-copy small {
    display: none;
  }

  .intelligence-link {
    display: none;
  }

  .degree-switch {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 25;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.97);
  }

  .degree-switch a {
    min-height: 44px;
  }

  main {
    width: min(100% - 28px, 1240px);
  }

  .hero {
    gap: 24px;
    padding: 46px 0 34px;
  }

  .hero-lead {
    font-size: 16px;
  }

  .cycle-note {
    padding: 20px;
  }

  .finder-head,
  .result-summary,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .filters,
  .school-list {
    grid-template-columns: 1fr;
  }

  .search-field,
  .reset-button {
    grid-column: auto;
  }

  .facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .method {
    gap: 24px;
    padding: 28px 22px;
  }

  .back-to-top {
    bottom: calc(82px + env(safe-area-inset-bottom));
  }

  .site-footer {
    padding: 28px 18px 98px;
  }

  .site-footer nav {
    justify-content: flex-start;
  }
}

@media (max-width: 460px) {
  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-copy strong {
    font-size: 15px;
  }

  .school-card {
    padding: 17px;
  }

  .school-name h3 {
    font-size: 18px;
  }

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

  .fact:first-child {
    grid-column: 1 / -1;
  }

  .requirement {
    grid-template-columns: 52px minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
