:root {
  color-scheme: light;
  --bg: #f4f0e8;
  --paper: #fffdf8;
  --ink: #20201d;
  --muted: #6e6a61;
  --line: #ded6c8;
  --soft: #ece4d6;
  --blue: #2f6fba;
  --green: #2f8c69;
  --clay: #b85f38;
  --gold: #d09b2f;
  --purple: #77528f;
  --shadow: 0 18px 48px rgba(36, 31, 22, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  letter-spacing: 0;
}

button {
  font: inherit;
}

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

.intro-screen,
.quiz-screen,
.result-screen {
  width: 100%;
}

.intro-screen {
  min-height: calc(100vh - 90px);
  display: grid;
  align-content: center;
  gap: 38px;
}

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

.kicker {
  margin: 0 0 18px;
  color: var(--clay);
  font-size: 14px;
  font-weight: 700;
}

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

h1 {
  max-width: 860px;
  margin-bottom: 22px;
  font-size: clamp(42px, 7.2vw, 86px);
  line-height: 1.02;
  font-weight: 760;
  letter-spacing: 0;
}

.lede {
  max-width: 680px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.75;
}

.intro-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 32px;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  min-height: 48px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 22px;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.primary-btn {
  background: var(--ink);
  color: #fffdf8;
  box-shadow: 0 12px 28px rgba(32, 32, 29, 0.18);
}

.secondary-btn {
  width: 100%;
  background: var(--green);
  color: #fff;
}

.ghost-btn {
  background: rgba(255, 253, 248, 0.54);
  border-color: var(--line);
  color: var(--ink);
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
}

.primary-btn:disabled,
.ghost-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  box-shadow: none;
}

.time-note {
  color: var(--muted);
  font-size: 15px;
}

.type-strip {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 8px;
}

.type-strip span {
  min-height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.62);
  color: #3b3832;
  font-weight: 700;
}

.is-hidden {
  display: none;
}

.quiz-screen {
  max-width: 820px;
  margin: 0 auto;
  padding-top: 36px;
}

.quiz-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.quiz-header h2,
.result-hero h2 {
  margin-bottom: 0;
  font-size: clamp(32px, 5vw, 60px);
  line-height: 1.1;
  letter-spacing: 0;
}

.quiz-rule {
  max-width: 620px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.progress-count {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid var(--line);
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--green), var(--clay));
  transition: width 0.22s ease;
}

.question-card {
  margin-top: 24px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.question-text {
  min-height: 112px;
  margin-bottom: 28px;
  font-size: clamp(23px, 3vw, 34px);
  line-height: 1.34;
  font-weight: 740;
}

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

.option-btn {
  min-height: 86px;
  padding: 12px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf6ec;
  color: var(--ink);
  cursor: pointer;
}

.option-btn strong {
  display: block;
  margin-bottom: 7px;
  font-size: 22px;
}

.option-btn span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.option-btn.is-selected {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.option-btn.is-selected span {
  color: rgba(255, 255, 255, 0.72);
}

.quiz-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

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

.result-hero {
  min-height: 280px;
  display: grid;
  align-content: end;
  padding: 34px;
  border-radius: 8px;
  border: 1px solid rgba(32, 32, 29, 0.16);
  background:
    linear-gradient(130deg, rgba(255, 253, 248, 0.88), rgba(255, 253, 248, 0.64)),
    var(--result-color, var(--green));
  box-shadow: var(--shadow);
}

.result-headline {
  max-width: 780px;
  margin: 18px 0 0;
  color: #3f3b34;
  font-size: 21px;
  line-height: 1.65;
}

.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.6fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.report-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 12px 32px rgba(36, 31, 22, 0.08);
}

.main-report {
  padding: 30px;
}

.score-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.score-row > div {
  min-height: 96px;
  padding: 18px;
  border-radius: 8px;
  background: var(--soft);
}

.panel-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.score-row strong {
  display: block;
  font-size: 26px;
  line-height: 1.1;
}

.report-block {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.report-note {
  padding-top: 0;
  border-top: 0;
}

.report-block h3,
.cta-panel h3,
.rank-section h3 {
  margin-bottom: 10px;
  font-size: 21px;
  line-height: 1.25;
}

.report-block p,
.cta-panel p,
.fine-print {
  color: #4f4a43;
  font-size: 16px;
  line-height: 1.85;
}

.cta-panel {
  position: sticky;
  top: 18px;
  padding: 18px;
}

.qr-card {
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.qr-card img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
}

.rank-section {
  margin-top: 18px;
  padding: 26px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.68);
}

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

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

.rank-item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 12px;
}

.rank-name {
  font-weight: 700;
}

.rank-bar {
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5dccd;
}

.rank-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--item-color, var(--green));
}

.rank-score {
  color: var(--muted);
  font-weight: 700;
  text-align: right;
}

.fine-print {
  margin-top: 18px;
  font-size: 13px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 20;
  max-width: min(420px, calc(100% - 32px));
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 22px, 720px);
    padding-top: 22px;
  }

  .intro-screen {
    min-height: calc(100vh - 62px);
    gap: 26px;
  }

  h1 {
    font-size: clamp(42px, 12vw, 62px);
  }

  .lede {
    font-size: 17px;
  }

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

  .type-strip span {
    min-height: 56px;
  }

  .quiz-header {
    align-items: flex-end;
  }

  .question-card {
    padding: 22px;
  }

  .question-text {
    min-height: 116px;
  }

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

  .option-btn {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 0 16px;
    text-align: left;
  }

  .option-btn strong,
  .option-btn span {
    margin: 0;
  }

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

  .cta-panel {
    position: static;
  }

  .score-row,
  .rank-item {
    grid-template-columns: 1fr;
  }

  .rank-score {
    text-align: left;
  }

  .section-title-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .app-shell {
    width: min(100% - 18px, 430px);
  }

  .intro-actions,
  .quiz-nav {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-btn,
  .secondary-btn,
  .ghost-btn {
    width: 100%;
  }

  .result-hero,
  .main-report,
  .rank-section {
    padding: 20px;
  }
}
