:root {
  --ink: #18241f;
  --green-950: #0f2f26;
  --green-800: #174937;
  --green-650: #2f6a50;
  --green-300: #9bb9a6;
  --paper: #f6f2e8;
  --paper-strong: #fffaf0;
  --line: rgba(15, 47, 38, 0.18);
  --gold: #b99045;
  --rust: #9a4f35;
  --shadow: 0 24px 70px rgba(12, 30, 25, 0.22);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #eef4ea;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(180deg, rgba(251, 249, 241, 0.74), rgba(230, 239, 226, 0.92)),
    url("assets/school-bg.jpg") center / cover fixed,
    url("assets/campus-quiet.png") center / cover fixed;
}

button {
  font: inherit;
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.screen {
  display: none;
  min-height: 100vh;
  padding: 36px 20px;
}

.screen.is-active {
  display: grid;
}

.home-screen {
  place-items: center;
  align-content: center;
  gap: 18px;
  position: relative;
}

.campus-visual {
  width: min(780px, 92vw);
  aspect-ratio: 16 / 7;
  overflow: hidden;
  border: 1px solid rgba(246, 242, 232, 0.34);
  border-radius: var(--radius);
  box-shadow: 0 18px 46px rgba(45, 68, 55, 0.18);
  opacity: 0.98;
}

.campus-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.school-brand {
  display: grid;
  place-items: center;
  gap: 10px;
}

.school-logo {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(23, 73, 55, 0.16);
  border-radius: var(--radius);
  box-shadow: 0 14px 32px rgba(45, 68, 55, 0.2);
}

.school-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.school-mark {
  color: var(--green-950);
  font-size: 1.25rem;
  font-weight: 800;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.78);
}

.title-frame {
  width: min(620px, calc(100vw - 40px));
  padding: 28px 28px 30px;
  text-align: center;
  color: var(--green-950);
  border: 1px solid rgba(23, 73, 55, 0.24);
  outline: 1px solid rgba(185, 144, 69, 0.32);
  outline-offset: -9px;
  background: rgba(255, 250, 240, 0.9);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(45, 68, 55, 0.18);
  backdrop-filter: blur(6px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 800;
}

.title-frame h1 {
  margin: 0;
  font-size: 2.6rem;
  line-height: 1.18;
}

.title-frame p:last-child {
  margin: 14px 0 0;
  color: rgba(24, 36, 31, 0.68);
  font-size: 1rem;
}

.identity-block {
  width: min(520px, calc(100vw - 40px));
}

.identity-block h2 {
  margin: 0 0 14px;
  color: var(--green-950);
  font-size: 1rem;
  text-align: center;
  font-weight: 800;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.82);
}

.identity-block h2::before,
.identity-block h2::after {
  content: "";
  display: inline-block;
  width: 56px;
  height: 1px;
  margin: 0 12px 4px;
  background: rgba(23, 73, 55, 0.26);
}

.identity-grid {
  display: grid;
  gap: 12px;
}

.identity-card {
  width: 100%;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  text-align: left;
  background: rgba(255, 250, 240, 0.92);
  border: 1px solid rgba(23, 73, 55, 0.12);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(45, 68, 55, 0.14);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.identity-card:hover,
.identity-card:focus-visible,
.identity-card.is-selected {
  transform: translateY(-2px) scale(1.015);
  border-color: var(--gold);
  box-shadow: 0 16px 34px rgba(45, 68, 55, 0.2);
  outline: none;
}

.identity-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--paper-strong);
  font-weight: 900;
  background: var(--green-800);
  border-radius: 50%;
}

.identity-card strong {
  display: block;
  font-size: 1rem;
  line-height: 1.35;
}

.identity-card small {
  display: block;
  margin-top: 4px;
  color: rgba(24, 36, 31, 0.66);
  font-size: 0.83rem;
  line-height: 1.35;
}

.home-signoff {
  width: min(620px, calc(100vw - 40px));
  margin: 4px 0 0;
  color: rgba(15, 47, 38, 0.82);
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.72;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.84);
}

.quiz-screen,
.result-screen {
  place-items: center;
}

.back-button {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 250, 240, 0.38);
  border-radius: 50%;
  color: var(--paper-strong);
  background: rgba(15, 47, 38, 0.72);
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.back-button:hover,
.back-button:focus-visible {
  background: rgba(47, 106, 80, 0.95);
  outline: none;
}

.quiz-panel,
.result-panel {
  width: min(760px, calc(100vw - 40px));
  padding: 30px;
  background: rgba(255, 250, 240, 0.96);
  border: 1px solid rgba(255, 250, 240, 0.7);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.quiz-topline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  color: var(--green-800);
  font-weight: 800;
}

.quiz-topline span:last-child {
  color: var(--rust);
}

.progress-track {
  height: 8px;
  margin: 16px 0 28px;
  overflow: hidden;
  background: rgba(24, 36, 31, 0.1);
  border-radius: 999px;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--green-650), var(--gold));
  border-radius: inherit;
  transition: width 220ms ease;
}

.question-kicker {
  margin: 0 0 12px;
  color: var(--gold);
  font-weight: 900;
}

.question-area h2 {
  margin: 0 0 24px;
  font-size: 1.55rem;
  line-height: 1.55;
  white-space: pre-line;
}

.options-list {
  display: grid;
  gap: 12px;
}

.option-button {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  align-items: start;
  width: 100%;
  padding: 16px;
  text-align: left;
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.option-button:hover,
.option-button:focus-visible {
  transform: translateY(-1px);
  border-color: var(--green-650);
  background: #fff8e7;
  outline: none;
}

.option-letter {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--paper-strong);
  font-weight: 900;
  background: var(--green-800);
  border-radius: 50%;
}

.option-text {
  line-height: 1.65;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 24px;
}

.modal.is-open {
  display: grid;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 18, 13, 0.52);
  backdrop-filter: blur(10px);
}

.modal-card {
  position: relative;
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 30px;
  background: rgba(255, 250, 240, 0.96);
  border: 1px solid rgba(255, 250, 240, 0.78);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.modal-card h2 {
  margin: 0 0 18px;
  color: var(--green-950);
  font-size: 1.6rem;
}

.welcome-copy p,
.welcome-reminder {
  margin: 0 0 14px;
  line-height: 1.78;
}

.welcome-reminder {
  padding: 14px 16px;
  color: var(--green-950);
  background: rgba(185, 144, 69, 0.12);
  border-left: 3px solid var(--gold);
}

.primary-action,
.secondary-action {
  min-height: 46px;
  padding: 0 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 900;
  cursor: pointer;
}

.primary-action {
  color: var(--paper-strong);
  background: var(--green-800);
}

.primary-action:hover,
.primary-action:focus-visible {
  background: var(--green-650);
  outline: none;
}

.secondary-action {
  color: var(--green-950);
  background: transparent;
  border-color: rgba(15, 47, 38, 0.24);
}

.secondary-action:hover,
.secondary-action:focus-visible {
  border-color: var(--green-650);
  outline: none;
}

.result-panel {
  width: min(840px, calc(100vw - 40px));
  display: grid;
  gap: 22px;
}

.result-hero {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 18px;
  align-items: center;
}

.result-icon {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  color: var(--paper-strong);
  font-size: 1.65rem;
  font-weight: 900;
  background: var(--green-800);
  border-radius: 50%;
  box-shadow: 0 10px 28px rgba(15, 47, 38, 0.22);
}

.result-hero h2 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.25;
}

.result-hero p:last-child {
  margin: 8px 0 0;
  color: rgba(24, 36, 31, 0.68);
}

.match-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 16px 18px;
  background: rgba(47, 106, 80, 0.08);
  border: 1px solid rgba(47, 106, 80, 0.18);
  border-radius: var(--radius);
}

.match-row p {
  margin: 0;
  color: rgba(24, 36, 31, 0.68);
  text-align: right;
}

.match-score {
  display: block;
  color: var(--green-950);
  font-size: 2rem;
  font-weight: 900;
}

.match-label {
  color: var(--rust);
  font-weight: 900;
}

.portrait-box {
  padding: 18px 20px;
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.portrait-box p {
  margin: 0;
  line-height: 1.75;
}

.result-section h3 {
  margin: 0 0 12px;
  font-size: 1.08rem;
  color: var(--green-950);
}

.dimension-list {
  display: grid;
  gap: 12px;
}

.dimension-item {
  padding: 16px 18px;
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.dimension-name {
  display: block;
  margin-bottom: 8px;
  color: var(--green-950);
  font-weight: 900;
}

.dimension-item p,
.long-copy {
  margin: 0;
  color: rgba(24, 36, 31, 0.78);
  line-height: 1.85;
}

.long-copy {
  padding: 18px 20px;
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.seat-box {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  background: rgba(47, 106, 80, 0.08);
  border: 1px solid rgba(47, 106, 80, 0.18);
  border-radius: var(--radius);
}

.seat-box span {
  color: var(--green-950);
  font-weight: 900;
}

.seat-box p {
  margin: 0;
  line-height: 1.7;
}

.score-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px;
}

.score-card {
  padding: 14px 12px;
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.score-card.is-top {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(185, 144, 69, 0.32);
}

.score-card strong {
  display: block;
  font-size: 1.3rem;
  color: var(--green-950);
}

.score-card span {
  display: block;
  margin-top: 4px;
  color: rgba(24, 36, 31, 0.66);
  font-size: 0.82rem;
  line-height: 1.35;
}

.hit-details {
  margin: 12px 0 0;
  line-height: 1.7;
  color: rgba(24, 36, 31, 0.72);
}

.classic-quote {
  margin: 0;
  padding: 18px 20px;
  color: var(--green-950);
  line-height: 1.75;
  background: rgba(185, 144, 69, 0.12);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.toast {
  min-height: 22px;
  margin: -8px 0 0;
  color: var(--rust);
  font-size: 0.9rem;
  font-weight: 800;
}

@media (max-width: 720px) {
  .screen {
    padding: 24px 14px;
  }

  .campus-visual {
    aspect-ratio: 16 / 9;
  }

  .title-frame {
    padding: 24px 18px 26px;
  }

  .title-frame h1 {
    font-size: 2rem;
  }

  .identity-block h2::before,
  .identity-block h2::after {
    width: 34px;
    margin-left: 8px;
    margin-right: 8px;
  }

  .quiz-panel,
  .result-panel,
  .modal-card {
    width: calc(100vw - 28px);
    padding: 22px;
  }

  .question-area h2 {
    font-size: 1.25rem;
  }

  .match-row,
  .result-hero {
    align-items: start;
  }

  .match-row {
    display: grid;
  }

  .match-row p {
    text-align: left;
  }

  .score-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .dimension-item {
    grid-template-columns: 88px 1fr 42px;
    gap: 8px;
  }
}

@media (max-width: 430px) {
  .campus-visual {
    width: calc(100vw - 28px);
  }

  .title-frame h1 {
    font-size: 1.62rem;
  }

  .identity-card,
  .option-button {
    grid-template-columns: 38px 1fr;
    padding: 14px;
  }

  .result-hero {
    grid-template-columns: 1fr;
  }

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

  .dimension-item {
    grid-template-columns: 1fr 42px;
  }

  .dimension-name {
    grid-column: 1 / -1;
  }
}
