:root {
  --bg: #f4f1e8;
  --ink: #1d1d1f;
  --muted: #6d6a60;
  --card: #fffdf7;
  --line: #232323;
  --accent: #ff6b35;
  --accent-dark: #d84419;
  --green: #2f8f6f;
  --blue: #3867d6;
  --shadow: 8px 8px 0 #1f1f1f;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 199, 75, 0.34), transparent 28%),
    radial-gradient(circle at 90% 16%, rgba(58, 160, 141, 0.2), transparent 24%),
    linear-gradient(135deg, #faf6eb 0%, #eef6f1 58%, #f7efe4 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
}

.screen {
  display: none;
  width: 100%;
  min-height: 100vh;
}

.screen.active {
  display: block;
}

.hero-screen,
.loading-screen {
  min-height: 100vh;
  padding: 28px 18px;
  display: none;
  align-items: center;
  justify-content: center;
}

.hero-screen.active,
.loading-screen.active {
  display: flex;
}

.hero-card,
.loading-card,
.report-card,
.question-card,
.submit-panel {
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.hero-card {
  width: min(520px, 100%);
  padding: 28px 22px 24px;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 14px;
  padding: 6px 10px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #ffd75e;
  color: #222;
  font-size: 13px;
  font-weight: 800;
}

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

h1 {
  margin: 0;
  font-size: clamp(38px, 12vw, 66px);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-copy {
  margin: 20px auto 0;
  color: #2a2a2a;
  font-size: 18px;
  line-height: 1.75;
  font-weight: 700;
}

.notice {
  margin: 20px 0 24px;
  padding: 12px;
  border: 2px dashed #333;
  border-radius: 8px;
  color: #514b3d;
  background: #fff3c7;
  line-height: 1.65;
}

.primary-btn,
.secondary-btn {
  min-height: 48px;
  border: 2px solid var(--line);
  border-radius: 8px;
  font-weight: 900;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.primary-btn {
  width: 100%;
  padding: 13px 18px;
  color: #fff;
  background: var(--accent);
  box-shadow: 4px 4px 0 var(--line);
}

.secondary-btn {
  padding: 12px 14px;
  color: var(--ink);
  background: #fffdf7;
  box-shadow: 3px 3px 0 var(--line);
}

.primary-btn:hover,
.secondary-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--line);
}

.primary-btn:active,
.secondary-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--line);
}

.quiz-screen {
  padding: 96px 14px 28px;
}

.progress-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  padding: 12px 14px;
  border-bottom: 2px solid var(--line);
  background: rgba(255, 253, 247, 0.96);
  backdrop-filter: blur(10px);
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 820px;
  margin: 0 auto 8px;
  font-weight: 900;
}

.progress-meta span {
  color: var(--muted);
  font-size: 14px;
}

.progress-track {
  width: min(820px, 100%);
  height: 12px;
  margin: 0 auto;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #e6dfcf;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #ffd75e, var(--green));
  transition: width 0.2s ease;
}

.quiz-intro,
.question-list,
.submit-panel,
.result-screen,
.report-card,
.result-actions {
  width: min(820px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.quiz-intro {
  margin-bottom: 18px;
}

.quiz-intro h2 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.25;
}

.quiz-intro p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.question-list {
  display: grid;
  gap: 16px;
}

.question-card {
  padding: 16px;
}

.question-title {
  display: flex;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 17px;
  line-height: 1.55;
  font-weight: 900;
}

.question-number {
  flex: 0 0 auto;
  color: var(--accent-dark);
}

.options {
  display: grid;
  gap: 10px;
}

.option-btn {
  width: 100%;
  min-height: 52px;
  padding: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 2px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  line-height: 1.45;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.option-btn:hover {
  transform: translateY(-1px);
  box-shadow: 3px 3px 0 rgba(31, 31, 31, 0.9);
}

.option-btn.selected {
  background: #d7f5de;
  box-shadow: 4px 4px 0 var(--line);
}

.option-letter {
  display: inline-grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: #ffd75e;
  font-weight: 900;
}

.submit-panel {
  margin-top: 18px;
  padding: 16px;
}

.incomplete-tip {
  display: none;
  margin: 0 0 14px;
  padding: 12px;
  border: 2px dashed #d84419;
  border-radius: 8px;
  color: #702110;
  background: #fff1e9;
  line-height: 1.6;
  font-weight: 800;
}

.incomplete-tip.show {
  display: block;
}

.loading-card {
  width: min(520px, 100%);
  padding: 26px 20px;
  text-align: center;
}

.loading-card h2 {
  margin: 12px 0 12px;
  font-size: 25px;
}

.loading-card p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.7;
  font-weight: 700;
}

.spinner {
  width: 58px;
  height: 58px;
  margin: 0 auto;
  border: 5px solid #f1dcc8;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.result-screen {
  padding: 24px 14px 32px;
}

.report-card {
  overflow: hidden;
  background: #fffdf7;
}

.report-top {
  padding: 22px 18px 16px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(255, 215, 94, 0.7), rgba(47, 143, 111, 0.24)),
    #fff4cf;
}

.report-top h2 {
  margin: 0;
  font-size: clamp(34px, 11vw, 56px);
  line-height: 1;
}

.character-image {
  display: block;
  width: min(280px, 80vw);
  aspect-ratio: 1;
  margin: 10px auto 8px;
  object-fit: contain;
}

.quote {
  margin: 8px auto 0;
  max-width: 560px;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
  font-weight: 900;
  line-height: 1.55;
}

.detail-card {
  padding: 18px;
}

.detail-label {
  margin: 0;
  color: var(--muted);
  font-weight: 900;
}

.detail-card h3 {
  margin: 4px 0 12px;
  font-size: 28px;
}

.index-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #eef8f2;
  font-weight: 900;
}

.index-row strong {
  font-size: 30px;
  color: var(--accent-dark);
}

.detail-block {
  padding: 14px 0;
  border-top: 2px dashed #d5cbb8;
}

.detail-block h4 {
  margin: 0 0 6px;
  font-size: 15px;
}

.detail-block p {
  margin: 0;
  color: #343434;
  line-height: 1.75;
}

.easter-egg {
  display: none;
  margin: 10px 0 0;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #e9f4ff;
  color: #17456f;
  font-weight: 900;
  line-height: 1.55;
}

.easter-egg.show {
  display: block;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 18px;
}

.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 18px;
  width: min(92vw, 420px);
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 8px;
  color: #fff;
  background: rgba(29, 29, 31, 0.96);
  text-align: center;
  font-weight: 800;
  line-height: 1.5;
  transform: translate(-50%, 140%);
  transition: transform 0.2s ease;
}

.toast.show {
  transform: translate(-50%, 0);
}

@media (min-width: 720px) {
  .hero-card {
    padding: 36px 34px 30px;
  }

  .question-card,
  .submit-panel,
  .detail-card {
    padding: 22px;
  }

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

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