:root {
  --paper: rgba(245, 244, 240, 0.9);
  --paper-deep: rgba(237, 236, 232, 0.92);
  --ink: #161514;
  --muted: #514d48;
  --line: rgba(28, 26, 24, 0.12);
  --accent: #2d3533;
  --accent-deep: #121514;
  --shadow: 0 20px 48px rgba(0, 0, 0, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 12%, rgba(0, 0, 0, 0.08), transparent 20%),
    radial-gradient(circle at 82% 10%, rgba(0, 0, 0, 0.06), transparent 18%),
    radial-gradient(circle at 10% 82%, rgba(0, 0, 0, 0.05), transparent 24%),
    radial-gradient(circle at 88% 78%, rgba(0, 0, 0, 0.04), transparent 20%),
    linear-gradient(180deg, #fcfcfa 0%, #f7f7f4 48%, #f3f3ef 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  filter: blur(70px);
}

body::before {
  top: -10vw;
  left: -16vw;
  width: 52vw;
  height: 52vw;
  background:
    radial-gradient(circle at 30% 30%, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.02) 42%, transparent 56%),
    radial-gradient(circle at 62% 58%, rgba(70, 70, 70, 0.24), transparent 40%);
  opacity: 0.42;
}

body::after {
  right: -18vw;
  bottom: -14vw;
  width: 56vw;
  height: 56vw;
  background:
    radial-gradient(circle at 45% 42%, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.015) 34%, transparent 52%),
    radial-gradient(circle at 60% 60%, rgba(82, 82, 82, 0.2), transparent 44%);
  opacity: 0.34;
}

.wrap {
  position: relative;
  z-index: 1;
  width: min(640px, calc(100vw - 16px));
  margin: 0 auto;
  padding: 8px 0 24px;
}

.panel {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 24px);
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(249, 249, 245, 0.88)),
    rgba(255, 255, 255, 0.84);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
}

.screen {
  display: none;
  flex: 1;
}

.screen.active {
  display: flex;
  overflow: auto;
}

.screen-shell {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 100%;
}

.screen-shell-home {
  justify-content: center;
  padding: 24px 0;
}

.screen-shell-quiz {
  justify-content: center;
  padding: 24px 0;
}

.screen-shell-result {
  justify-content: flex-start;
  padding: 0;
}

.home-stack {
  width: 100%;
  max-width: 520px;
  margin: auto;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 24px 16px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 248, 244, 0.82)),
    radial-gradient(circle at top right, rgba(0, 0, 0, 0.05), transparent 24%),
    linear-gradient(135deg, rgba(0, 0, 0, 0.02), rgba(255, 255, 255, 0));
}

.hero-wash {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0.22;
  filter: blur(10px);
}

.hero-wash-top {
  top: -22px;
  left: -28px;
  width: 180px;
  height: 110px;
  background:
    radial-gradient(circle at 30% 30%, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.05) 54%, transparent 62%);
}

.hero-wash-bottom {
  right: -30px;
  bottom: -24px;
  width: 210px;
  height: 128px;
  background:
    radial-gradient(circle at 60% 40%, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.04) 48%, transparent 62%);
}

.ink-mark {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.4;
  background:
    radial-gradient(circle at 30% 30%, rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.08) 36%, transparent 54%),
    radial-gradient(circle at 65% 58%, rgba(0, 0, 0, 0.16), transparent 42%);
}

.ink-mark-left {
  width: 96px;
  height: 96px;
  top: 12px;
  right: 8px;
}

.ink-mark-right {
  width: 56px;
  height: 56px;
  right: 68px;
  top: 84px;
}

.eyebrow {
  position: relative;
  z-index: 1;
  margin: 0 0 10px;
  color: rgba(22, 21, 20, 0.6);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 100%;
  white-space: nowrap;
  color: #171615;
  font-size: clamp(22px, 5.6vw, 40px);
  line-height: 1.2;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.intro {
  position: relative;
  z-index: 1;
  margin: 14px 0 0;
  max-width: 680px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.meta {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 16px;
}

.meta-item {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(6px);
}

.meta-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 16px;
}

.meta-item span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.content {
  padding: 16px;
}

.content-home,
.content-quiz {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
}

.content-result {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  min-height: auto;
}

.result-stack {
  width: 100%;
}

.result-shell {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background:
    radial-gradient(circle at 18% 14%, rgba(0, 0, 0, 0.06), transparent 18%),
    radial-gradient(circle at 82% 16%, rgba(0, 0, 0, 0.05), transparent 16%),
    radial-gradient(circle at 24% 34%, rgba(125, 22, 22, 0.05), transparent 20%),
    radial-gradient(circle at 70% 10%, rgba(0, 0, 0, 0.04), transparent 14%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.015) 20%, transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(249, 249, 245, 0.88)),
    rgba(255, 255, 255, 0.84);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
}

.result-shell::before {
  content: "";
  position: absolute;
  left: -6%;
  right: -6%;
  top: 112px;
  height: 140px;
  pointer-events: none;
  opacity: 0.42;
  background:
    radial-gradient(circle at 18% 16%, rgba(0, 0, 0, 0.14), transparent 24%),
    radial-gradient(circle at 50% 36%, rgba(0, 0, 0, 0.07), transparent 30%),
    radial-gradient(circle at 82% 18%, rgba(0, 0, 0, 0.12), transparent 22%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.045), transparent 72%);
  filter: blur(20px);
}

.result-shell::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 148px;
  height: 120px;
  pointer-events: none;
  opacity: 0.28;
  background:
    radial-gradient(circle at 20% 34%, rgba(125, 22, 22, 0.16), transparent 22%),
    radial-gradient(circle at 76% 26%, rgba(0, 0, 0, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 74%);
  filter: blur(26px);
}

.result-hero {
  position: relative;
  z-index: 1;
  border-bottom: none;
  background: transparent;
  box-shadow: none;
}

.result-stage {
  position: relative;
  z-index: 1;
  width: 100%;
  margin-top: -10px;
  padding: 18px 16px 30px;
  background: transparent;
}

.result-page-title {
  position: relative;
  z-index: 1;
  margin: 0;
  text-align: center;
  max-width: 100%;
  white-space: nowrap;
  font-size: clamp(22px, 5.6vw, 40px);
  line-height: 1.2;
  letter-spacing: 0.06em;
}

.home-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 24px 16px 32px;
  border-radius: 18px;
  border: 1px solid rgba(44, 37, 31, 0.08);
  background:
    radial-gradient(circle at top left, rgba(125, 22, 22, 0.05), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 241, 235, 0.9));
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.06);
}

.home-copy {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  width: 100%;
}

.start-btn {
  display: block;
  min-width: 168px;
  margin: 0 auto;
}

.toolbar {
  position: sticky;
  top: 8px;
  z-index: 3;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px;
  margin-bottom: 12px;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(10px);
}

.quiz-stage {
  width: 100%;
  max-width: 640px;
  margin: auto;
}

.progress-copy {
  min-width: 86px;
  color: var(--muted);
  font-size: 14px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(38, 45, 43, 0.92), rgba(92, 102, 98, 0.7));
  transition: width 220ms ease;
}

.quiz {
  display: flex;
  flex: 1;
  align-items: center;
  min-height: 0;
}

.question {
  max-width: 100%;
  width: 100%;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top right, rgba(0, 0, 0, 0.07), transparent 24%),
    linear-gradient(180deg, rgba(249, 248, 244, 0.96), rgba(235, 233, 228, 0.92));
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.08);
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.5s ease forwards;
}

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

.question-head {
  margin-bottom: 12px;
}

.question-title {
  margin: 0;
  font-size: clamp(22px, 5.2vw, 28px);
  line-height: 1.45;
}

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

.option {
  position: relative;
  display: block;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-card {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 0;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(50, 44, 39, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 244, 239, 0.92));
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.option:hover .option-card {
  transform: translateY(-2px);
  border-color: rgba(45, 53, 51, 0.24);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.07);
}

.option input:checked + .option-card {
  border-color: rgba(45, 53, 51, 0.42);
  background:
    radial-gradient(circle at 86% 10%, rgba(45, 53, 51, 0.08), transparent 22%),
    linear-gradient(135deg, rgba(221, 225, 222, 0.96), rgba(255, 255, 255, 0.96));
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.option-letter {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(45, 53, 51, 0.08);
  color: var(--accent-deep);
  font-size: 16px;
  font-weight: 700;
}

.option-text {
  display: flex;
  align-items: center;
  min-height: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
  justify-content: center;
}

button {
  min-height: 48px;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  letter-spacing: 0;
  transition: transform 180ms ease, opacity 180ms ease, background 180ms ease;
  -webkit-tap-highlight-color: transparent;
}

.actions button,
.home-card button {
  justify-self: center;
}

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

button:disabled {
  opacity: 0.45;
  transform: none;
  cursor: not-allowed;
}

.primary {
  color: #f7f4ee;
  border-color: rgba(70, 12, 12, 0.2);
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.1), transparent 24%),
    linear-gradient(135deg, #7d1616, #a02222 46%, #761111 100%);
  box-shadow: 0 8px 18px rgba(103, 18, 18, 0.18);
}

.secondary {
  color: var(--ink);
  border: 1px solid rgba(44, 37, 31, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(243, 240, 233, 0.9));
  backdrop-filter: blur(6px);
}

.ghost {
  border-style: solid;
  border-color: rgba(44, 37, 31, 0.16);
  background:
    linear-gradient(180deg, rgba(250, 248, 243, 0.84), rgba(240, 237, 230, 0.84));
}

.result {
  display: none;
  position: relative;
  width: min(100%, 560px);
  margin: 0 auto;
  margin-top: 0;
  padding: 18px 14px 14px;
  border-radius: 18px;
  border: 1px solid rgba(70, 54, 44, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 252, 245, 0.98), rgba(240, 234, 224, 0.97)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.02), transparent 14%, transparent 86%, rgba(0, 0, 0, 0.02));
  box-shadow: 0 26px 56px rgba(0, 0, 0, 0.12);
}

.result::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(112, 90, 70, 0.12);
  border-radius: 12px;
  pointer-events: none;
}

.result-seal {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(125, 22, 22, 0.9);
  color: rgba(255, 248, 240, 0.96);
  font-size: 20px;
  letter-spacing: 0.08em;
  box-shadow: 0 10px 18px rgba(125, 22, 22, 0.18);
}

.result.show {
  display: block;
  animation: rise 0.45s ease forwards;
}

.result-name {
  margin: 0;
  text-align: center;
  font-size: clamp(28px, 7vw, 38px);
  line-height: 1.2;
  letter-spacing: 0.08em;
}

.result-quote {
  margin: 14px 0 0;
  text-align: center;
  color: var(--accent-deep);
  font-size: 18px;
  line-height: 1.7;
  white-space: pre-line;
}

.result-tagline {
  margin: 14px 0 0;
  text-align: center;
  color: #7d1616;
  font-size: 18px;
  line-height: 1.6;
  letter-spacing: 0;
}

.result-copy {
  max-width: 30em;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
  font-weight: 700;
  text-indent: 2em;
}

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

@media (max-width: 520px) {
  .wrap {
    width: min(100vw - 16px, 640px);
    padding: 8px 0 20px;
  }

  .panel {
    min-height: calc(100dvh - 16px);
    border-radius: 18px;
  }

  .screen-shell-home,
  .screen-shell-quiz,
  .screen-shell-result {
    justify-content: flex-start;
    padding: 10px 0;
  }

  .hero {
    padding: 24px 16px 20px;
  }

  .eyebrow {
    margin-bottom: 10px;
    font-size: 10px;
    letter-spacing: 0.18em;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(20px, 5.8vw, 28px);
    line-height: 1.2;
  }

  .intro {
    margin-top: 14px;
    font-size: 15px;
    line-height: 1.6;
  }

  .meta {
    gap: 8px;
    margin-top: 16px;
  }

  .meta-item {
    padding: 16px;
    border-radius: 18px;
  }

  .content {
    padding: 16px;
  }

  .content-home,
  .content-quiz,
  .content-result {
    min-height: auto;
    gap: 0;
    padding: 12px 10px 14px;
  }

  .result-stage {
    padding: 22px 14px 24px;
  }

  .home-card {
    padding: 24px 16px 32px;
    border-radius: 18px;
  }

  .home-copy {
    margin-bottom: 16px;
    font-size: 15px;
    line-height: 1.6;
  }

  .start-btn {
    width: 100%;
    min-width: 0;
  }

  .toolbar {
    position: static;
    gap: 8px;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 18px;
  }

  .progress-copy {
    min-width: 72px;
    font-size: 12px;
  }

  .quiz {
    min-height: auto;
    align-items: stretch;
  }

  .question {
    padding: 18px;
    border-radius: 18px;
  }

  .question-head {
    margin-bottom: 10px;
  }

  .question-title {
    font-size: 22px;
    line-height: 1.45;
  }

  .options {
    gap: 8px;
  }

  .option-card {
    grid-template-columns: 36px 1fr;
    gap: 10px;
    min-height: 0;
    padding: 14px 16px;
    border-radius: 12px;
  }

  .option-letter {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .option-text {
    min-height: 0;
    font-size: 16px;
    line-height: 1.6;
  }

  .actions {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 14px;
  }

  button {
    width: 100%;
    min-height: 48px;
    padding: 14px 16px;
    font-size: 16px;
  }

  .result-page-title {
    max-width: 100%;
    font-size: clamp(20px, 5.8vw, 28px);
    line-height: 1.2;
  }

  .result {
    width: 100%;
    padding: 16px 12px 12px;
    border-radius: 18px;
  }

  .result::before {
    inset: 8px;
    border-radius: 12px;
  }

  .result-name {
    font-size: 30px;
    line-height: 1.2;
  }

  .result-quote {
    margin-top: 14px;
    font-size: 18px;
    line-height: 1.7;
  }

  .result-tagline {
    margin-top: 14px;
    font-size: 18px;
    line-height: 1.6;
    letter-spacing: 0;
  }

  .result-copy {
    max-width: none;
    margin-top: 14px;
    font-size: 15px;
    line-height: 1.7;
  }
}

@media (max-width: 420px) {
  .wrap {
    width: min(100vw - 16px, 640px);
    padding-bottom: 16px;
  }

  .panel {
    border-radius: 18px;
  }

  .hero {
    padding: 20px 14px 18px;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(18px, 5.6vw, 24px);
  }

  .intro,
  .home-copy,
  .result-copy,
  .option-text {
    font-size: 15px;
  }

  .question-title {
    font-size: 20px;
  }

  .content {
    padding: 14px 10px 16px;
  }

  .content-home,
  .content-quiz {
    min-height: auto;
  }

  .content-result {
    padding: 16px;
  }

  .result-shell {
    border-radius: 18px;
  }

  .result-stage {
    padding: 18px 12px 20px;
  }

  .result-shell::before {
    top: 96px;
    height: 118px;
    opacity: 0.36;
  }

  .result-shell::after {
    top: 128px;
    height: 92px;
    opacity: 0.22;
  }

  .question {
    padding: 16px;
    border-radius: 18px;
  }

  .option-card {
    grid-template-columns: 36px 1fr;
    gap: 10px;
    padding: 14px;
    min-height: 84px;
  }

  .option-letter {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }

  .actions {
    position: static;
    padding-top: 0;
    background: none;
  }

  button {
    min-height: 48px;
    padding: 14px 16px;
    font-size: 16px;
  }

  .toolbar {
    padding: 12px;
  }

  .progress-copy {
    min-width: 78px;
    font-size: 13px;
  }

  .result-page-title {
    font-size: clamp(18px, 5.6vw, 24px);
  }

  .result {
    padding: 14px 10px 10px;
  }

  .result-shell::before {
    top: 96px;
    height: 118px;
    opacity: 0.36;
  }

  .result-shell::after {
    top: 128px;
    height: 92px;
    opacity: 0.22;
  }
}

@media (max-width: 340px) {
  h1,
  .result-page-title {
    white-space: normal;
    text-wrap: balance;
  }
}

@media (min-width: 721px) {
  .wrap {
    width: min(760px, calc(100vw - 20px));
    padding-top: 14px;
  }

  .hero {
    padding: 40px 28px 26px;
  }

  .content-home,
  .content-quiz {
    min-height: 0;
  }

  .content-result {
    min-height: 0;
    padding: 24px 18px;
  }

  h1 {
    font-size: clamp(30px, 4.8vw, 42px);
  }

  .ink-mark-left {
    width: 112px;
    height: 112px;
    right: 22px;
  }

  .ink-mark-right {
    width: 68px;
    height: 68px;
    right: 94px;
    top: 90px;
  }

  .hero-wash-top {
    width: 240px;
    height: 140px;
  }

  .hero-wash-bottom {
    width: 260px;
    height: 150px;
  }

  .meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content {
    padding: 18px;
  }

  .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
  }

  .question {
    padding: 24px 20px;
  }

  .result {
    padding: 72px 36px 36px;
  }
}
