:root {
  --bg: #090510;
  --bg-soft: #13061f;
  --card: rgba(23, 14, 37, 0.82);
  --card-strong: rgba(28, 16, 45, 0.92);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(205, 174, 255, 0.22);
  --text: #f9f3ff;
  --text-soft: rgba(249, 243, 255, 0.72);
  --text-dim: rgba(249, 243, 255, 0.48);
  --accent: #d78cff;
  --accent-strong: #9f57ff;
  --accent-cyan: #8ce7ff;
  --button-text: #1b0a26;
  --shadow: 0 24px 80px rgba(7, 3, 15, 0.45);
  --font-body: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC",
    "Microsoft YaHei", sans-serif;
  --font-display: "Baskerville", "Times New Roman", "Songti SC", serif;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(circle at top, rgba(143, 80, 255, 0.22), transparent 36%),
    radial-gradient(circle at 80% 18%, rgba(83, 213, 255, 0.14), transparent 24%),
    linear-gradient(180deg, #090510 0%, #13061f 42%, #08050f 100%);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
}

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

.page-aura {
  position: fixed;
  width: 56vw;
  height: 56vw;
  border-radius: 999px;
  filter: blur(18px);
  pointer-events: none;
  z-index: 0;
}

.page-aura-left {
  top: -10vw;
  left: -16vw;
  background: radial-gradient(circle, rgba(187, 104, 255, 0.24), transparent 68%);
}

.page-aura-right {
  right: -20vw;
  bottom: 10vh;
  background: radial-gradient(circle, rgba(121, 111, 255, 0.16), transparent 68%);
}

.app {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
}

.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  width: min(100%, 560px);
  margin: 0 auto;
  padding:
    max(20px, env(safe-area-inset-top))
    18px
    max(24px, env(safe-area-inset-bottom) + 14px);
}

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: 20px 0 8px;
}

.hero-badges,
.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill,
.progress-pill,
.result-chip,
.result-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.hero-card,
.quiz-card,
.result-card,
.share-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(36, 21, 56, 0.92), rgba(15, 10, 28, 0.88));
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card::before,
.quiz-card::before,
.result-card::before,
.share-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(215, 140, 255, 0.16), transparent 32%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent 48%);
  pointer-events: none;
}

.hero-card,
.quiz-card,
.result-card {
  padding: 24px 20px;
}

.hero-card h1,
.result-name {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1;
  letter-spacing: 0.03em;
}

.hero-card h1 {
  font-size: clamp(42px, 12vw, 68px);
}

.hero-subtitle {
  margin: 0;
  font-size: 20px;
  line-height: 1.4;
  color: var(--text);
}

.hero-description,
.result-description,
.share-text,
.footer-note,
.intro-note {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.7;
  font-size: 14px;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.hero-grid-item {
  padding: 14px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.04);
}

.hero-grid-item strong,
.mini-label {
  display: block;
  color: var(--text);
  font-size: 13px;
}

.hero-grid-item span,
.question-hint {
  display: block;
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.5;
}

.cta-button,
.option-button,
.action-button,
.secondary-button {
  width: 100%;
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  font-family: inherit;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.cta-button,
.action-button {
  padding: 18px 20px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent));
  color: var(--button-text);
  font-size: 17px;
  font-weight: 800;
  box-shadow: 0 18px 42px rgba(159, 87, 255, 0.24);
}

.cta-button:active,
.option-button:active,
.action-button:active,
.secondary-button:active {
  transform: scale(0.985);
}

.cta-note {
  margin: 2px 0 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
}

.quiz-header {
  padding-top: 8px;
}

.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.progress-pill {
  color: var(--text);
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-cyan));
  box-shadow: 0 0 24px rgba(215, 140, 255, 0.55);
  transition: width 260ms ease;
}

.quiz-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: 18px 0 10px;
}

.question-index {
  margin: 0 0 6px;
  color: var(--accent-cyan);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.question-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.35;
}

.option-list {
  display: grid;
  gap: 12px;
}

.option-button {
  text-align: left;
  padding: 18px 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.option-button:hover,
.option-button:focus-visible {
  border-color: rgba(215, 140, 255, 0.42);
  background: linear-gradient(180deg, rgba(215, 140, 255, 0.16), rgba(255, 255, 255, 0.04));
  outline: none;
}

.option-tag {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-cyan);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.option-inner {
  display: flex;
  align-items: flex-start;
}

.option-text {
  flex: 1;
  font-size: 15px;
  line-height: 1.65;
}

.result-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 0 8px;
}

.result-card {
  padding-top: 26px;
}

.result-kicker {
  margin-bottom: 14px;
}

.result-title {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.6;
}

.result-name {
  margin-top: 10px;
  font-size: clamp(38px, 11vw, 58px);
}

.result-chip {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.result-body {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.section-title {
  margin: 0 0 8px;
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.share-card {
  padding: 18px 18px 16px;
}

.share-text {
  position: relative;
  padding-left: 16px;
}

.share-text::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-cyan));
}

.action-group {
  display: grid;
  gap: 12px;
}

.secondary-button {
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.secondary-button:hover,
.secondary-button:focus-visible {
  border-color: rgba(215, 140, 255, 0.32);
  outline: none;
}

.brand-footer {
  margin-top: auto;
  padding: 26px 4px 6px;
  text-align: center;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(249, 243, 255, 0.62);
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: opacity 180ms ease, color 180ms ease;
}

.brand-link::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(140, 231, 255, 0.8), rgba(215, 140, 255, 0.8));
  box-shadow: 0 0 14px rgba(215, 140, 255, 0.3);
}

.brand-link:hover,
.brand-link:focus-visible {
  color: rgba(249, 243, 255, 0.88);
  outline: none;
}

.footer-note {
  margin-top: 8px;
  font-size: 11px;
  color: rgba(249, 243, 255, 0.38);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 28px);
  z-index: 20;
  min-width: 132px;
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(20, 10, 31, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  text-align: center;
  font-size: 13px;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition:
    opacity 200ms ease,
    transform 200ms ease;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.fade-up {
  animation: fadeUp 420ms ease both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

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

@media (min-width: 720px) {
  .screen {
    padding-left: 24px;
    padding-right: 24px;
  }

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

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

  .action-group .secondary-button:last-child {
    grid-column: 1 / -1;
  }
}
