:root {
  --bg: #fff7fa;
  --bg-2: #f4f7fb;
  --card: rgba(255, 255, 255, 0.86);
  --text: #263241;
  --muted: #738093;
  --line: rgba(117, 95, 119, 0.16);
  --primary: #b64863;
  --primary-2: #e96e8e;
  --primary-soft: #fde8ee;
  --shadow: 0 24px 80px rgba(95, 46, 69, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 18px);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 207, 223, 0.95), transparent 27rem),
    radial-gradient(circle at 82% 12%, rgba(211, 233, 255, 0.92), transparent 26rem),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}

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

button {
  cursor: pointer;
}

.page-shell {
  width: min(100%, 860px);
  margin: 0 auto;
  padding: 14px 16px calc(34px + var(--safe-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 76px;
  padding: 10px 0;
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(145deg, #fff, #f6dce4);
  box-shadow: inset 0 -8px 18px rgba(182, 72, 99, 0.12), 0 8px 22px rgba(55, 39, 50, 0.1);
}

.brand-kicker {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(18px, 4.6vw, 24px);
  line-height: 1.1;
}

.icon-btn,
.ghost-btn,
.primary-btn,
.secondary-btn,
.option-btn {
  border: 0;
  -webkit-tap-highlight-color: transparent;
}

.icon-btn {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  color: var(--text);
  font-size: 34px;
  line-height: 1;
  background: transparent;
}

.ghost-btn {
  flex: 0 0 auto;
  padding: 10px 16px;
  border: 1px solid rgba(182, 72, 99, 0.34);
  border-radius: 999px;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.6);
}

.glass {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.screen {
  display: none;
  animation: fadeIn 0.28s ease both;
}

.screen.active {
  display: block;
}

.hero-card,
.result-hero,
.question-card,
.progress-card,
.radar-card,
.interpret-card,
.advice-card,
.top-three {
  margin-top: 16px;
  padding: clamp(18px, 4vw, 30px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-card h2,
.result-hero h2,
.question-card h2 {
  margin: 0;
  font-size: clamp(28px, 9vw, 56px);
  line-height: 1.06;
  letter-spacing: -0.04em;
}

.hero-card h2,
.result-hero h2 {
  color: var(--primary);
}

.hero-desc,
.result-subtitle,
.fine-print {
  color: var(--muted);
  line-height: 1.8;
}

.hero-desc {
  margin: 16px 0 20px;
  font-size: 16px;
}

.fine-print {
  margin: 14px 0 0;
  font-size: 12px;
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 22px;
}

.stat-row span,
.badge,
.dimension-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
}

.stat-row span {
  padding: 9px 13px;
  font-size: 13px;
}

.primary-btn,
.secondary-btn {
  min-height: 50px;
  padding: 13px 20px;
  border-radius: 18px;
  font-weight: 850;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 12px 26px rgba(182, 72, 99, 0.27);
}

.secondary-btn {
  color: var(--primary);
  border: 1px solid rgba(182, 72, 99, 0.25);
  background: rgba(255, 255, 255, 0.7);
}

.primary-btn:hover,
.secondary-btn:hover,
.option-btn:hover {
  transform: translateY(-1px);
}

.primary-btn:disabled,
.secondary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  transform: none;
  box-shadow: none;
}

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

.dimension-card {
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.62);
}

.dimension-card strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 18px;
}

.dimension-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-weight: 700;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(182, 72, 99, 0.12);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  transition: width 0.25s ease;
}

.dimension-pill {
  margin-bottom: 14px;
  padding: 8px 12px;
  font-size: 13px;
}

.options {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.option-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 14px 16px;
  border: 1px solid rgba(117, 95, 119, 0.14);
  border-radius: 18px;
  color: var(--text);
  text-align: left;
  background: rgba(255, 255, 255, 0.72);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.option-btn.active {
  border-color: rgba(182, 72, 99, 0.56);
  background: linear-gradient(135deg, rgba(253, 232, 238, 0.95), rgba(255, 255, 255, 0.78));
}

.option-index {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  background: var(--primary-soft);
}

.quiz-actions,
.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 22px;
}

.result-actions {
  grid-template-columns: 1fr 1fr 1fr;
}

.score-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.score-strip > div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.62);
}

.score-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
}

.score-strip strong {
  color: var(--primary);
  font-size: 23px;
}

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

h3 {
  margin: 0;
  font-size: 20px;
}

.badge {
  padding: 8px 12px;
  font-size: 13px;
}

.radar-wrap {
  width: min(100%, 620px);
  margin: 0 auto;
}

#radarCanvas {
  display: block;
  width: 100%;
  height: auto;
}

.dimension-bars {
  display: grid;
  gap: 13px;
  margin-top: 18px;
}

.bar-row {
  display: grid;
  gap: 8px;
}

.bar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 800;
}

.bar-meta span:last-child {
  color: var(--primary);
}

.bar-bg {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(117, 95, 119, 0.12);
}

.bar-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
}

.bar-desc {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.top-three-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.top-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
}

.top-card small {
  color: var(--muted);
  font-weight: 800;
}

.top-card strong {
  display: block;
  margin-top: 8px;
  color: var(--primary);
  font-size: 22px;
}

.advice-card ul {
  padding-left: 1.2em;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(26px + var(--safe-bottom));
  z-index: 99;
  max-width: calc(100% - 32px);
  padding: 12px 16px;
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
  background: rgba(31, 37, 45, 0.92);
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

@media (max-width: 640px) {
  .page-shell {
    padding-inline: 12px;
  }

  .topbar {
    gap: 6px;
  }

  .brand-logo {
    width: 40px;
    height: 40px;
  }

  .brand-kicker {
    display: none;
  }

  .dimension-grid,
  .score-strip,
  .top-three-grid,
  .result-actions {
    grid-template-columns: 1fr;
  }

  .hero-card,
  .result-hero,
  .question-card,
  .progress-card,
  .radar-card,
  .interpret-card,
  .advice-card,
  .top-three {
    border-radius: 24px;
  }
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
