:root {
  --paper: #f7f1e6;
  --paper-deep: #eadcc8;
  --card: rgba(255, 252, 244, 0.94);
  --card-strong: #fffaf0;
  --ink: #201b15;
  --muted: #776c5d;
  --line: rgba(48, 35, 19, 0.13);
  --sage: #687d5c;
  --sage-soft: #e4ead7;
  --gold: #b98c42;
  --rust: #9f563b;
  --shadow: 0 22px 54px rgba(65, 45, 19, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  font-family: "Outfit", "PingFang SC", "Hiragino Sans GB", sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(185, 140, 66, 0.2), transparent 28%),
    radial-gradient(circle at 90% 18%, rgba(104, 125, 92, 0.18), transparent 24%),
    linear-gradient(180deg, #fbf7ef 0%, var(--paper) 44%, var(--paper-deep) 100%);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.055;
  background-image:
    linear-gradient(rgba(32, 27, 21, 0.34) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 27, 21, 0.34) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at center, black 30%, transparent 86%);
}

.page-shell {
  width: min(100vw - 18px, 460px);
  margin: 0 auto;
  padding: 10px 0 44px;
}

.hero,
.quiz-layout {
  margin-top: 12px;
}

.quiz-layout {
  display: grid;
  gap: 14px;
}

.hero-copy,
.quiz-panel,
.result-card,
.result-share-panel,
.result-notes article {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero-copy {
  position: relative;
  min-height: calc(100svh - 24px);
  overflow: hidden;
  padding: 22px;
  border-radius: 30px;
  background:
    linear-gradient(160deg, rgba(255, 250, 240, 0.96), rgba(247, 241, 230, 0.82)),
    var(--card);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-copy::before,
.hero-copy::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 999px;
}

.hero-copy::before {
  width: 230px;
  height: 230px;
  top: -80px;
  right: -96px;
  background: rgba(104, 125, 92, 0.13);
}

.hero-copy::after {
  width: 170px;
  height: 170px;
  bottom: -72px;
  left: -70px;
  background: rgba(185, 140, 66, 0.14);
}

.hero-copy > * {
  position: relative;
  z-index: 1;
}

.personality-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.personality-strip span {
  min-height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: rgba(32, 27, 21, 0.72);
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(48, 35, 19, 0.08);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.personality-strip span:nth-child(2n) {
  background: rgba(228, 234, 215, 0.78);
}

.personality-strip span:nth-child(3n) {
  background: rgba(239, 219, 188, 0.8);
}

.personality-strip span:nth-child(5n) {
  background: rgba(232, 214, 221, 0.74);
}

.eyebrow,
.question-pill,
.share-label {
  margin: 0;
  color: var(--sage);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Noto Serif SC", serif;
}

h1 {
  margin-top: 10px;
  font-size: clamp(2.45rem, 11.5vw, 3.8rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.hero-lead,
.quiz-intro p,
.result-notes p,
.share-copy p {
  color: var(--muted);
  line-height: 1.7;
}

.hero-lead {
  margin: 14px 0 0;
  font-size: 1.05rem;
}

.quiz-intro {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.58);
}

.quiz-intro h2 {
  margin-top: 8px;
  font-size: 1.55rem;
  line-height: 1.28;
}

.hero-actions,
.result-actions {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.author-line {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

button {
  width: 100%;
  border: 0;
  border-radius: 18px;
  padding: 15px 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.primary-button {
  color: #fffaf0;
  background: linear-gradient(135deg, #242017, #5a3d28);
  box-shadow: 0 14px 28px rgba(32, 27, 21, 0.2);
}

.ghost-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.hidden {
  display: none !important;
}

.quiz-panel {
  min-height: calc(100svh - 20px);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  overflow: visible;
}

.quiz-stage {
  min-height: calc(100svh - 20px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.progress-bar {
  margin: 0 4px 14px;
}

.progress-track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(104, 125, 92, 0.16);
}

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

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.question-card {
  position: relative;
  overflow: hidden;
  padding: 22px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.96), rgba(255, 255, 255, 0.86)),
    var(--card-strong);
  box-shadow: var(--shadow);
}

.question-card::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  right: -76px;
  bottom: -86px;
  border-radius: 999px;
  background: rgba(185, 140, 66, 0.12);
}

.question-card > * {
  position: relative;
  z-index: 1;
}

.question-card h3 {
  margin-top: 14px;
  font-size: clamp(1.58rem, 7.2vw, 2.1rem);
  line-height: 1.42;
  letter-spacing: -0.03em;
}

.options {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.option-button {
  min-height: 70px;
  text-align: left;
  padding: 15px;
  border-radius: 20px;
  border: 1px solid rgba(48, 35, 19, 0.11);
  background: rgba(255, 255, 255, 0.82);
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.option-button:active {
  transform: translateY(1px);
}

.option-button strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 13px;
  color: var(--sage);
  background: var(--sage-soft);
  font-size: 1rem;
}

.option-button span {
  color: var(--ink);
  line-height: 1.58;
}

.result-panel {
  width: 100%;
  max-width: 460px;
  justify-self: center;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  overflow: visible;
}

.result-card {
  --result-bg: #e4ead7;
  --result-accent: #687d5c;
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: 32px;
  background-color: var(--card-strong);
  background:
    linear-gradient(180deg, var(--result-bg), #fffaf0 58%, #fff7e9),
    var(--card-strong);
  background:
    radial-gradient(circle at 74% 14%, color-mix(in srgb, var(--result-accent) 18%, transparent), transparent 30%),
    linear-gradient(180deg, color-mix(in srgb, var(--result-bg) 72%, white), #fffaf0 58%, #fff7e9),
    var(--card-strong);
  text-align: center;
}

.result-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(48, 35, 19, 0.08);
  border-radius: 25px;
  pointer-events: none;
}

.result-card::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  left: -92px;
  bottom: -104px;
  border-radius: 999px;
  background: rgba(104, 125, 92, 0.13);
  background: color-mix(in srgb, var(--result-accent) 15%, transparent);
  pointer-events: none;
}

.result-card > * {
  position: relative;
  z-index: 1;
}

.result-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
}

.result-mark {
  margin: 0;
  color: rgba(32, 27, 21, 0.48);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.result-label {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 800;
}

.result-portrait {
  width: min(68vw, 260px);
  aspect-ratio: 1;
  margin: 12px auto 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 30px;
  border: 1px solid rgba(48, 35, 19, 0.12);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(255, 250, 240, 0.28)),
    repeating-linear-gradient(135deg, rgba(48, 35, 19, 0.035) 0 8px, transparent 8px 16px);
  box-shadow: 0 16px 32px rgba(65, 45, 19, 0.12);
}

.result-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.result-card h2 {
  margin-top: 4px;
  font-size: clamp(2.05rem, 10.8vw, 3.35rem);
  line-height: 1.03;
  letter-spacing: -0.05em;
}

.result-meta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.result-code,
.result-match {
  margin: 0;
  border-radius: 999px;
  font-weight: 900;
}

.result-code {
  padding: 8px 14px;
  color: #fffaf0;
  background: var(--ink);
  font-size: 1.18rem;
  letter-spacing: 0.14em;
}

.result-match {
  padding: 8px 12px;
  color: var(--sage);
  color: color-mix(in srgb, var(--result-accent) 72%, #201b15);
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(48, 35, 19, 0.08);
  font-size: 0.84rem;
}

.result-summary {
  margin: 14px 0 0;
  padding: 14px;
  border-radius: 20px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(48, 35, 19, 0.08);
  font-size: 1.03rem;
  font-weight: 800;
  line-height: 1.58;
}

.result-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.result-tags span,
.dimension-item {
  border: 1px solid rgba(48, 35, 19, 0.08);
  background: rgba(255, 255, 255, 0.62);
}

.result-tags span {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 800;
}

.dimension-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.dimension-item {
  padding: 8px 9px;
  border-radius: 16px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.25;
}

.result-footer {
  margin: 16px 0 0;
  color: rgba(32, 27, 21, 0.52);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.result-share-panel {
  margin-top: 12px;
  padding: 16px;
  border-radius: 24px;
  background: rgba(255, 252, 244, 0.82);
}

.share-copy {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px dashed rgba(104, 125, 92, 0.42);
}

.share-copy p:last-child {
  margin-bottom: 0;
}

.result-notes {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.result-notes article {
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 252, 244, 0.82);
}

.result-notes h3 {
  font-size: 1.08rem;
}

.result-notes p {
  margin-bottom: 0;
}

@media (hover: hover) {
  button {
    transition:
      transform 180ms ease,
      box-shadow 180ms ease,
      background 180ms ease;
  }

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

@media (min-width: 860px) {
  .page-shell {
    width: min(1180px, calc(100vw - 32px));
    padding-top: 24px;
  }

  .hero-copy {
    min-height: 680px;
    padding: 34px;
  }

  .quiz-layout {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 460px);
    gap: 22px;
    align-items: start;
  }

  .quiz-stage {
    min-height: 680px;
  }

  .question-card {
    padding: 28px;
  }

  .result-card,
  .result-share-panel,
  .result-notes article {
    padding: 22px;
  }

  .result-panel {
    grid-column: 1 / -1;
  }

  .hero-actions,
  .result-actions {
    display: flex;
    flex-wrap: wrap;
  }

  .hero-actions button,
  .result-actions button {
    width: auto;
  }
}
