:root {
  --bg: #f5f6f8;
  --bg-strong: #eef2f7;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --surface: #ffffff;
  --ink: #111827;
  --muted: #667085;
  --line: rgba(17, 24, 39, 0.08);
  --line-strong: rgba(17, 24, 39, 0.12);
  --shadow: 0 18px 60px rgba(15, 23, 42, 0.08);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --anchor: #d4a153;
  --edge: #e26d57;
  --connect: #62b19a;
  --growth: #7ea063;
  --accent: rgb(165, 133, 219);
  --result-accent: rgb(165, 133, 219);
  --pale-purple: rgb(165, 133, 219);
  --pale-purple-soft: rgba(165, 133, 219, 0.12);
    --font-sans: "Optima", "Candara", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: "Palatino", "Georgia", "STSong", "Songti SC", "Source Han Serif SC", "Source Han Serif CN", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(165, 133, 219, 0.22), transparent 35%),
    radial-gradient(circle at top right, rgba(191, 219, 254, 0.25), transparent 40%),
    linear-gradient(180deg, #fbfbfc 0%, #f8f6fa 50%, #f4f1f7 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

.page-glow {
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(56px);
  opacity: 0.5;
}

/* --- Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-up {
  opacity: 0;
  animation: fadeInUp 1.2s cubic-bezier(0.21, 0.6, 0.35, 1) forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.25s; }
.delay-3 { animation-delay: 0.4s; }
.delay-4 { animation-delay: 0.55s; }
.delay-5 { animation-delay: 0.7s; }

.page-glow--one {
  top: 4rem;
  left: -5rem;
  width: 16rem;
  height: 16rem;
  background: rgba(165, 133, 219, 0.28);
}

.page-glow--two {
  right: -4rem;
  bottom: 10rem;
  width: 18rem;
  height: 18rem;
  background: rgba(191, 219, 254, 0.25);
}

.app-shell {
  width: min(calc(100% - 1.5rem), 860px);
  margin: 0 auto;
  padding: 0.5rem 0 calc(2.5rem + env(safe-area-inset-bottom));
}

.screen {
  animation: rise 260ms ease;
}

.hidden {
  display: none;
}

.card {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(28px);
}

.eyebrow {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #8b95a7;
}

.hero-card {
  padding: 1.7rem;
  background: rgba(248, 246, 255, 0.45);
  backdrop-filter: blur(20px);
}

.hero-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 10vw, 4.2rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: rgb(165, 133, 219);
}

.hero-copy {
  margin: 1.5rem 0 0;
  max-width: 34rem;
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.hero-metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 3.5rem 0 1.5rem;
  padding: 1.8rem 0;
  border-top: 1px solid rgba(165, 133, 219, 0.15);
  border-bottom: 1px solid rgba(165, 133, 219, 0.15);
}

.metric {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  text-align: center;
  position: relative;
}

.metric:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 10%;
  height: 80%;
  width: 1px;
  background: rgba(165, 133, 219, 0.12);
}

.metric__value {
  display: block;
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 500;
  line-height: 1;
  color: rgb(165, 133, 219);
}

.metric__label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: #8b95a7;
  letter-spacing: 0.05em;
}

.hero-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.92rem 1.6rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition:
    transform 180ms ease,
    opacity 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

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

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

.button--primary {
  background: rgb(165, 133, 219);
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(165, 133, 219, 0.2);
}

.button--secondary {
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.06);
}

.button--ghost {
  background: rgba(255, 255, 255, 0.56);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.08);
}

.button--small {
  padding: 0.72rem 1rem;
}

.quiz-topbar {
  position: sticky;
  top: calc(0.5rem + env(safe-area-inset-top));
  z-index: 5;
  display: grid;
  gap: 0.8rem;
  margin-bottom: 0.4rem;
}

.progress-panel {
  padding: 0.75rem 1rem;
  margin-bottom: 0;
  background: rgba(248, 246, 255, 0.4);
  backdrop-filter: blur(12px);
  border-radius: 16px;
}

.progress-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.progress-panel__label {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-weight: 500;
  color: rgb(165, 133, 219);
}

.progress-panel__meta {
  font-size: 0.75rem;
  color: #8b95a7;
  letter-spacing: 0.02em;
}

.progress-track {
  height: 4px;
  background: rgba(165, 133, 219, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.progress-track__fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgb(165, 133, 219), rgba(165, 133, 219, 0.6));
  transition: width 220ms ease;
}

.question-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: auto;
  padding: 1.25rem;
}

.question-card__header {
  max-width: 36rem;
  margin-bottom: 1.25rem;
}

.question-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 4.5vw, 1.75rem);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.options {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.option-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  min-height: 4rem;
  padding: 0.85rem 1rem;
  border: 0;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--ink);
  text-align: left;
  font-size: 0.95rem;
  line-height: 1.45;
  cursor: pointer;
  transition:
    transform 150ms ease,
    background-color 150ms ease,
    box-shadow 150ms ease;
  box-shadow:
    inset 0 0 0 1px rgba(17, 24, 39, 0.06),
    0 8px 16px rgba(15, 23, 42, 0.04);
}

.option-card:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.96);
}

.option-card.is-selected {
  background: linear-gradient(135deg, rgb(165, 133, 219), rgba(165, 133, 219, 0.8));
  color: #ffffff;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 18px 32px rgba(165, 133, 219, 0.22);
}

.option-card__key {
  flex: 0 0 auto;
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.08);
  font-size: 0.85rem;
  font-weight: 700;
}

.option-card.is-selected .option-card__key {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.option-card__text {
  line-height: 1.78;
}

.question-footer {
  margin-top: 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}

.question-tip {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

#result-screen {
  padding: 1.25rem;
  border-radius: var(--radius-xl);
  background: var(--panel-strong);
  border: 1px solid rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow);
  backdrop-filter: blur(30px);
}

.result-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.result-title {
  margin: 0.15rem 0 0;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 8vw, 3.2rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: rgb(165, 133, 219);
}

.result-code {
  margin: 0.6rem 0 0;
  color: var(--muted);
}

.result-hero {
  display: grid;
  gap: 1.5rem;
  margin-top: 0.5rem;
  padding: 1rem 0 1.5rem;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.result-hero__type {
  margin: 0;
  color: #8b95a7;
  letter-spacing: 0.12em;
}

.result-hero__headline {
  margin: 0.55rem 0 0;
  font-size: clamp(1.45rem, 6vw, 2.1rem);
  line-height: 1.3;
  letter-spacing: -0.03em;
}

.result-hero__summary {
  margin-top: 0.8rem;
  color: var(--muted);
  line-height: 1.8;
}

.result-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.pill {
  padding: 0.82rem 0.95rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.05);
  font-size: 0.95rem;
  font-weight: 700;
}

.pill small {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.55;
}

.result-grid {
  display: grid;
  gap: 0;
  margin-top: 0.25rem;
}

.content-card {
  padding: 1.25rem 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.content-card + .content-card {
  border-top: 1px solid var(--line);
}

.content-card--accent {
  background: transparent;
}

.scoreboard {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}

.score-row {
  display: grid;
  grid-template-columns: 5.8rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
}

.score-row__label {
  font-size: 0.94rem;
  font-weight: 700;
}

.score-row__bar {
  position: relative;
  height: 0.48rem;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.08);
  overflow: hidden;
}

.score-row__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
}

.score-row__value {
  font-size: 0.94rem;
  font-weight: 700;
}

.copy-stack {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}

.copy-stack p,
.long-copy {
  line-height: 1.82;
}

.tag-list {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.tag-list li,
.companion-card {
  padding: 0.95rem 1rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.05);
}

.companion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.companion-card__role {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.06);
  color: #526072;
  font-size: 0.8rem;
  font-weight: 600;
}

.companion-card h4 {
  margin: 0.75rem 0 0;
  font-size: 1.03rem;
}

.companion-card p {
  margin-top: 0.45rem;
}

.power-quote {
  margin: 1rem 0 0;
  padding-left: 1rem;
  border-left: 2px solid var(--result-accent);
  font-size: 1.08rem;
  line-height: 1.8;
  color: var(--ink);
}

.hashtags {
  font-size: 0.92rem;
}

.result-footer {
  margin-top: 3rem;
  padding: 2rem 0;
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(1rem);
  padding: 0.78rem 1rem;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.92);
  color: #f8fafc;
  font-size: 0.92rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

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

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

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

@media (max-width: 560px) {
  .metric {
    gap: 0.25rem;
  }

  .progress-panel__head,
  .question-footer,
  .result-topbar,
  .result-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .question-tip {
    text-align: left;
    margin-top: 0.5rem;
  }

  .hero-actions .button,
  .result-actions .button,
  .question-footer .button {
    width: 100%;
  }

  .score-row {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .result-title {
    font-size: clamp(2.4rem, 12vw, 3.5rem);
  }
}

@media (min-width: 800px) {
  .app-shell {
    width: min(calc(100% - 3rem), 1160px);
  }

  .result-hero {
    padding: 1.5rem 0 2rem;
  }

  .result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 3rem;
  }

  .content-card:nth-child(2) {
    border-top: 0;
  }
}

@media (min-width: 1200px) {
  .app-shell {
    max-width: 1200px;
  }
}
