:root {
  color-scheme: dark;
  --bg: #0b0d14;
  --surface: rgba(24, 27, 39, 0.82);
  --surface-strong: #202333;
  --text: #f6f2ff;
  --muted: #aaa7b6;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #bd9cff;
  --accent-strong: #9b72f2;
  --accent-soft: rgba(189, 156, 255, 0.14);
  --danger: #ff9ca7;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 90% 5%, rgba(122, 89, 190, 0.28), transparent 34rem),
    radial-gradient(circle at -10% 82%, rgba(43, 139, 148, 0.16), transparent 30rem),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  width: min(100%, 640px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 20px
    max(28px, env(safe-area-inset-bottom));
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #ded6ed;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(189, 156, 255, 0.5);
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 17px;
  letter-spacing: 0;
}

.brand.compact {
  font-size: 11px;
}

.brand.compact .brand-mark {
  width: 28px;
  height: 28px;
  font-size: 14px;
}

.home-shell {
  display: flex;
  flex-direction: column;
}

.hero {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  padding: 54px 0 46px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(36px, 11vw, 62px);
  font-weight: 760;
  letter-spacing: -0.055em;
  line-height: 1.05;
}

.hero-lead {
  margin: 18px 0 0;
  color: #d3cfdb;
  font-size: 18px;
  line-height: 1.7;
}

.hero-quote {
  margin: 52px 0 36px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 18px;
  padding: 0 24px;
  cursor: pointer;
  font-weight: 700;
}

.primary-button {
  color: #120d1d;
  background: linear-gradient(135deg, #d4bdff, #a986f0);
  box-shadow: 0 16px 40px rgba(130, 86, 216, 0.22);
}

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

.secondary-button {
  border: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
}

.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.disclaimer,
.page-footer {
  color: #7f7c89;
  font-size: 12px;
  line-height: 1.7;
}

.disclaimer {
  margin: 16px 0 0;
  text-align: center;
}

.page-footer {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.quiz-shell {
  display: flex;
  flex-direction: column;
}

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.progress-label {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

.progress-track {
  height: 3px;
  margin: 22px 0 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-track span {
  display: block;
  width: 8.333%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-strong), #d6c4ff);
  transition: width 280ms ease;
}

.question-panel {
  flex: 1;
  min-height: 520px;
  padding: 58px 0 22px;
  transition: opacity 150ms ease, transform 150ms ease;
}

.question-panel.is-changing {
  opacity: 0;
  transform: translateX(-8px);
}

.question-panel h1 {
  max-width: 560px;
  font-size: clamp(27px, 7.8vw, 42px);
  line-height: 1.22;
}

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

.option-button {
  display: grid;
  min-height: 68px;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.option-button:active {
  transform: scale(0.99);
}

.option-letter {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.option-text {
  font-size: 15px;
  line-height: 1.55;
}

.option-button.is-selected {
  border-color: rgba(189, 156, 255, 0.72);
  background: var(--accent-soft);
}

.option-button.is-selected .option-letter {
  border-color: var(--accent);
  color: #171020;
  background: var(--accent);
}

.quiz-actions {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.text-button {
  min-height: 48px;
  border: 0;
  padding: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.text-button:disabled {
  visibility: hidden;
}

.compact-button {
  min-height: 50px;
  padding-inline: 20px;
}

.form-error {
  min-height: 20px;
  margin: 0 0 8px;
  color: var(--danger);
  font-size: 13px;
  text-align: center;
}

.result-shell {
  padding-bottom: max(36px, env(safe-area-inset-bottom));
}

.result-shell main {
  padding-top: 54px;
}

.result-card,
.empty-result {
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 30px 24px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

.result-card h1,
.empty-result h1 {
  font-size: clamp(36px, 11vw, 56px);
}

.result-subtitle {
  margin: 18px 0 0;
  color: #e0d8eb;
  font-size: 18px;
  line-height: 1.65;
}

.keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0;
}

.keyword-list span {
  border: 1px solid rgba(189, 156, 255, 0.3);
  border-radius: 999px;
  padding: 7px 12px;
  color: #d8c9f4;
  background: var(--accent-soft);
  font-size: 12px;
}

.result-description {
  margin: 0;
  color: #bbb7c5;
  font-size: 15px;
  line-height: 1.85;
}

.recommendation,
.secondary-result {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.recommendation > span,
.secondary-result > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.recommendation p,
.secondary-result p {
  margin: 10px 0 0;
  color: #d0ccd7;
  font-size: 14px;
  line-height: 1.7;
}

.secondary-result strong {
  display: block;
  margin-top: 9px;
  color: var(--accent);
  font-size: 22px;
}

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

.empty-result p + h1 {
  margin-bottom: 34px;
}

:focus-visible {
  outline: 3px solid rgba(189, 156, 255, 0.8);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

@media (min-width: 700px) {
  .page-shell {
    padding-inline: 28px;
  }

  .hero .primary-button {
    width: 260px;
  }

  .question-panel,
  .result-shell main {
    padding-top: 72px;
  }

  .result-card,
  .empty-result {
    padding: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
