:root {
  color-scheme: light;
  --ink: #18231f;
  --muted: #5e6964;
  --line: #dce3df;
  --soft: #f4f7f5;
  --paper: #ffffff;
  --green: #176b52;
  --green-dark: #10533f;
  --green-soft: #e8f3ee;
  --amber: #9b5d05;
  --amber-soft: #fff4df;
  --coral: #a23b31;
  --coral-soft: #fcecea;
  --blue: #25658c;
  --blue-soft: #e9f3f8;
  --shadow: 0 14px 40px rgba(24, 35, 31, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  background: #edf2ef;
  letter-spacing: 0;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(23, 107, 82, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(23, 107, 82, 0.035) 1px, transparent 1px),
    #edf2ef;
  background-size: 24px 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

button,
input {
  font: inherit;
}

button {
  letter-spacing: 0;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(37, 101, 140, 0.32);
  outline-offset: 3px;
}

.app-shell {
  width: min(100%, 760px);
  min-height: 100svh;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  min-height: 64px;
  padding: max(8px, env(safe-area-inset-top)) 18px 8px;
  border-bottom: 1px solid rgba(220, 227, 223, 0.9);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  color: white;
  border-radius: 50%;
  background: var(--green);
}

.brand-mark svg {
  width: 16px;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  color: var(--muted);
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.icon-button:hover {
  color: var(--ink);
  background: var(--soft);
}

.icon-button svg {
  width: 20px;
}

.is-hidden {
  visibility: hidden;
}

main {
  min-height: calc(100svh - 64px);
}

.intro-screen,
.question-screen,
.result-screen {
  padding: 42px 28px max(42px, env(safe-area-inset-bottom));
}

.intro-copy {
  max-width: 620px;
}

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

h1,
h2,
p {
  overflow-wrap: anywhere;
}

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

h2 {
  margin: 0;
  font-size: 25px;
  line-height: 1.3;
  letter-spacing: 0;
}

.lede {
  max-width: 570px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.profile-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 34px 0 26px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.profile-band div {
  padding: 17px 10px;
  text-align: center;
}

.profile-band div + div {
  border-left: 1px solid var(--line);
}

.profile-band span,
.profile-band strong {
  display: block;
}

.profile-band span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.profile-band strong {
  font-size: 15px;
}

.method-note {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 13px;
  margin-bottom: 26px;
  padding: 18px;
  border-left: 4px solid var(--blue);
  background: var(--blue-soft);
}

.method-note > svg {
  width: 24px;
  color: var(--blue);
}

.method-note strong {
  display: block;
  margin-bottom: 3px;
}

.method-note p {
  margin: 0;
  color: #405d6d;
  font-size: 14px;
}

.primary-button,
.secondary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  gap: 9px;
  border: 0;
  border-radius: 6px;
  font-weight: 750;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, opacity 150ms ease;
}

.primary-button {
  color: white;
  background: var(--green);
}

.primary-button:hover:not(:disabled) {
  background: var(--green-dark);
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.primary-button svg,
.secondary-button svg {
  width: 19px;
}

.text-button {
  display: block;
  margin: 10px auto 0;
  padding: 8px 12px;
  color: var(--green);
  border: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 25px 0 0;
  color: #7b8580;
  font-size: 12px;
}

.privacy-note svg {
  width: 14px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.progress-track {
  height: 5px;
  margin: 9px 0 38px;
  overflow: hidden;
  background: #e4e9e6;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green);
  transition: width 240ms ease;
}

.question-heading {
  min-height: 150px;
}

.question-heading h1 {
  max-width: 610px;
  font-size: 30px;
}

.question-heading > p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.option-list {
  display: grid;
  gap: 10px;
  margin: 22px 0 28px;
}

.option-card {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 13px;
  width: 100%;
  min-height: 78px;
  padding: 16px 17px;
  color: var(--ink);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  cursor: pointer;
  transition: border-color 130ms ease, background 130ms ease;
}

.option-card:hover {
  border-color: #9db8ad;
  background: #fbfdfc;
}

.option-card.is-selected {
  border-color: var(--green);
  background: var(--green-soft);
}

.radio-mark {
  display: grid;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  place-items: center;
  border: 2px solid #9ca8a2;
  border-radius: 50%;
}

.is-selected .radio-mark {
  border-color: var(--green);
}

.is-selected .radio-mark::after {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  content: "";
}

.option-copy strong {
  display: block;
  margin-bottom: 3px;
  font-size: 16px;
}

.option-copy small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.result-screen {
  padding-top: 34px;
}

.result-hero {
  padding: 0 0 28px;
  border-bottom: 1px solid var(--line);
}

.result-hero h1 {
  max-width: 620px;
  font-size: 34px;
}

.result-hero > p:last-of-type {
  max-width: 620px;
  margin: 14px 0 0;
  color: var(--muted);
}

.confidence-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.signal-chip {
  padding: 6px 9px;
  color: #315347;
  border: 1px solid #b9d5ca;
  border-radius: 4px;
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 700;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 20px 0 44px;
}

.secondary-button {
  min-height: 46px;
  color: var(--green);
  border: 1px solid #b7cbc3;
  background: white;
}

.secondary-button:hover {
  background: var(--green-soft);
}

.result-section {
  margin-top: 46px;
}

.section-title {
  margin-bottom: 18px;
}

.recommendation {
  border-top: 1px solid var(--line);
  padding: 24px 0 30px;
}

.recommendation:last-child {
  border-bottom: 1px solid var(--line);
}

.recommendation-head {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 13px;
  align-items: start;
}

.rank-number {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: white;
  border-radius: 5px;
  background: var(--green);
  font-size: 17px;
  font-weight: 850;
}

.recommendation h3 {
  margin: 0 0 3px;
  font-size: 20px;
  line-height: 1.35;
}

.recommendation-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.fit-score {
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.fit-score strong {
  font-size: 23px;
}

.verdict {
  margin: 17px 0;
  padding: 13px 15px;
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
  color: #654417;
  font-size: 14px;
  font-weight: 650;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
}

.detail-item {
  min-height: 96px;
  padding: 13px;
  background: white;
}

.detail-item span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.detail-item p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.tag {
  padding: 4px 8px;
  border-radius: 3px;
  background: var(--soft);
  color: #4e5b55;
  font-size: 12px;
  font-weight: 700;
}

.plan-panel {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid #bfd4cb;
  background: #f7fbf9;
}

.plan-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.plan-panel-head > div {
  min-width: 0;
}

.plan-panel-head strong {
  display: block;
  font-size: 15px;
}

.plan-panel-head > svg {
  width: 21px;
  flex: 0 0 auto;
  color: var(--green);
}

.plan-label {
  display: block;
  margin-bottom: 4px;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.segment-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  margin: 16px 0 10px;
  padding: 3px;
  background: #e6eeea;
}

.segment-control button {
  min-height: 36px;
  color: var(--muted);
  border: 0;
  border-radius: 3px;
  background: transparent;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.segment-control button.is-active {
  color: var(--green-dark);
  background: white;
  box-shadow: 0 1px 4px rgba(24, 35, 31, 0.1);
}

.school-options {
  display: grid;
  gap: 8px;
}

.school-option {
  position: relative;
  padding: 13px;
  border: 1px solid #d9e4df;
  background: white;
}

.school-option-main {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  align-items: start;
  padding-right: 52px;
}

.school-option-main strong {
  display: block;
  font-size: 14px;
  line-height: 1.4;
}

.school-option-main p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.risk-badge {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 850;
}

.risk-chong {
  color: #963a30;
  background: var(--coral-soft);
}

.risk-wen {
  color: #19604b;
  background: var(--green-soft);
}

.risk-bao {
  color: #79500f;
  background: var(--amber-soft);
}

.school-option dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 11px 0 0 40px;
}

.school-option dl > div + div {
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.school-option dt {
  color: #78827d;
  font-size: 10px;
}

.school-option dd {
  margin: 1px 0 0;
  font-size: 11px;
  font-weight: 750;
}

.new-label {
  position: absolute;
  top: 13px;
  right: 11px;
  padding: 3px 5px;
  color: var(--blue);
  border: 1px solid #b9d5e3;
  background: var(--blue-soft);
  font-size: 9px;
  font-weight: 800;
}

.plan-disclaimer,
.empty-options {
  margin: 12px 0 0;
  color: #6b7671;
  font-size: 11px;
}

.empty-options {
  padding: 14px;
  text-align: center;
  background: white;
}

.check-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.check-list li {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.check-list li > span {
  color: var(--green);
  font-size: 14px;
  font-weight: 850;
}

.check-list p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.check-list strong {
  display: block;
  color: var(--ink);
}

.caution-list {
  display: grid;
  gap: 8px;
}

.caution-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 11px;
  padding: 14px;
  color: #75392f;
  border-left: 3px solid var(--coral);
  background: var(--coral-soft);
  font-size: 14px;
}

.caution-item svg {
  width: 19px;
  margin-top: 2px;
}

.caution-item p {
  margin: 0;
}

.sources-section details {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.sources-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 0;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}

.sources-section summary::-webkit-details-marker {
  display: none;
}

.sources-section summary svg {
  width: 18px;
  transition: transform 180ms ease;
}

.sources-section details[open] summary svg {
  transform: rotate(180deg);
}

.source-copy {
  padding: 0 0 18px;
}

.source-copy p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.source-copy a {
  display: block;
  margin-top: 8px;
  color: var(--blue);
  font-size: 13px;
}

.final-actions {
  margin-top: 38px;
}

.toast {
  position: fixed;
  right: 50%;
  bottom: 24px;
  z-index: 30;
  width: max-content;
  max-width: calc(100vw - 36px);
  padding: 10px 15px;
  color: white;
  border-radius: 5px;
  background: #202b27;
  box-shadow: var(--shadow);
  font-size: 13px;
  transform: translateX(50%);
}

@media (max-width: 560px) {
  .app-shell {
    box-shadow: none;
  }

  .intro-screen,
  .question-screen,
  .result-screen {
    padding-right: 20px;
    padding-left: 20px;
  }

  .intro-screen {
    padding-top: 32px;
  }

  h1 {
    font-size: 31px;
  }

  .question-heading {
    min-height: 138px;
  }

  .question-heading h1 {
    font-size: 26px;
  }

  .profile-band {
    grid-template-columns: 1fr 1fr;
  }

  .profile-band div:nth-child(3),
  .profile-band div:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .profile-band div:nth-child(3) {
    border-left: 0;
  }

  .recommendation-head {
    grid-template-columns: 42px 1fr;
  }

  .fit-score {
    grid-column: 2;
  }

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

  .plan-panel {
    padding: 14px;
  }

  .school-option dl {
    grid-template-columns: 1fr 1fr;
    gap: 8px 0;
  }

  .school-option dl > div:nth-child(3) {
    grid-column: 1 / -1;
    padding: 7px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media print {
  body {
    background: white;
  }

  .app-shell {
    width: 100%;
    box-shadow: none;
  }

  .topbar,
  .result-actions,
  .final-actions,
  .sources-section {
    display: none;
  }

  .result-screen {
    padding: 0;
  }

  .result-section {
    break-inside: avoid;
  }

  .recommendation {
    break-inside: avoid;
  }
}
