:root {
  --bg: #f4fbf7;
  --paper: #ffffff;
  --ink: #101914;
  --muted: #607067;
  --line: #dbe9e0;
  --soft: #eaf5ee;
  --accent: #426d4d;
  --accent-2: #c85243;
  --shadow: 0 18px 46px rgba(19, 38, 27, 0.1);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.screen {
  display: none;
}

.screen.is-active {
  display: block;
  animation: rise .35s ease both;
}

.intro-layout {
  min-height: calc(100svh - 56px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  gap: 48px;
  align-items: center;
}

.intro-copy h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(46px, 8vw, 96px);
  line-height: .94;
  letter-spacing: 0;
}

.intro-sub {
  max-width: 540px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.intro-actions,
.result-actions,
.bottom-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.intro-actions {
  margin-top: 30px;
}

.tiny-note {
  max-width: 560px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.btn {
  min-height: 48px;
  padding: 0 18px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 800;
  transition: transform .16s ease, opacity .16s ease, box-shadow .16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: .5;
  transform: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 14px 26px rgba(66, 109, 77, .22);
}

.btn-secondary {
  background: var(--paper);
  color: var(--accent);
  border: 1px solid var(--line);
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--line);
}

.image-wall {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: end;
}

.image-wall img,
.poster-panel img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--paper);
}

.image-wall img:first-child {
  grid-column: span 2;
}

.test-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin: 14px 0 24px;
}

.test-header h2 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(28px, 5vw, 54px);
  line-height: 1.05;
  letter-spacing: 0;
}

.progress-wrap {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  background: rgba(244, 251, 247, .92);
  backdrop-filter: blur(14px);
}

.progress-bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfece4;
}

.progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .24s ease;
}

#progressText {
  color: var(--muted);
  font-weight: 800;
}

.question-stack {
  display: grid;
  gap: 14px;
}

.question {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 10px 24px rgba(19, 38, 27, .06);
}

.question legend {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
  padding: 0;
  font-weight: 800;
  line-height: 1.65;
}

.question-meta {
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.option {
  min-height: 58px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfb;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.option:hover {
  transform: translateY(-1px);
  border-color: #a9c5b1;
}

.option input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.option:has(input:checked) {
  border-color: var(--accent);
  background: var(--soft);
}

.bottom-actions {
  justify-content: space-between;
  margin-top: 22px;
  padding: 18px 0 0;
}

.bottom-actions p {
  margin: 0;
  color: var(--muted);
}

.result-layout {
  min-height: 62svh;
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 40px;
  align-items: center;
  padding: 22px 0;
}

.poster-panel {
  margin: 0;
}

.poster-panel figcaption {
  margin-top: 12px;
  color: var(--muted);
  text-align: center;
}

.result-copy h2 {
  margin: 0;
  font-size: clamp(42px, 7vw, 82px);
  line-height: .95;
  letter-spacing: 0;
}

.match-badge {
  display: inline-flex;
  margin: 18px 0 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent);
  font-weight: 800;
}

.result-desc {
  max-width: 680px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.9;
}

.result-actions {
  margin-top: 26px;
}

.score-section,
.note-section {
  margin-top: 26px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.score-section h3,
.note-section h3 {
  margin: 0 0 14px;
  font-size: 22px;
}

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

.score-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.score-item strong {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.score-item p,
.note-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 24px, 1120px);
    padding-top: 18px;
  }

  .intro-layout,
  .result-layout {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .intro-copy h1 {
    font-size: clamp(42px, 15vw, 72px);
  }

  .test-header {
    flex-direction: column;
  }

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

  .image-wall {
    grid-template-columns: repeat(3, 1fr);
  }

  .image-wall img:first-child {
    grid-column: span 1;
  }

  .bottom-actions {
    align-items: stretch;
  }

  .bottom-actions .btn {
    width: 100%;
  }
}
