:root {
  --bg: #f3f1f8;
  --card: #ffffff;
  --ink: #2d2942;
  --muted: #858094;
  --line: #e4dfed;
  --accent: #7763c8;
  --accent-dark: #58469c;
  --accent-soft: #f0ecf9;
  --option: #f8f6fc;
  --warm: #efebf5;
  --white: #ffffff;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; }
button:focus-visible, summary:focus-visible { outline: 3px solid rgba(119, 99, 200, .22); outline-offset: 3px; }
.hidden { display: none !important; }
.app-shell { width: 100%; max-width: 500px; min-height: 100vh; margin: 0 auto; }
.screen { min-height: 100vh; padding: 18px 16px calc(26px + env(safe-area-inset-bottom)); }
.topline { display: flex; align-items: center; justify-content: space-between; min-height: 36px; margin-bottom: 14px; padding: 0 4px; color: #625c75; font-size: 13px; }
.pill { padding: 4px 10px; color: var(--muted); background: rgba(255,255,255,.65); border: 1px solid var(--line); border-radius: 999px; font-size: 11px; }
.welcome-card, .result-head, .report-module, .quiz-header, .question-wrap {
  background: var(--card); border: 1px solid rgba(228,223,237,.75); border-radius: 24px; box-shadow: 0 10px 28px rgba(61,47,98,.045);
}
.welcome-card { padding: 32px 22px 24px; text-align: center; }
.app-icon, .result-icon { display: flex; align-items: center; justify-content: center; color: var(--white); background: var(--accent); }
.app-icon { width: 74px; height: 74px; margin: 0 auto 20px; border-radius: 22px; }
.app-icon svg { width: 42px; height: 42px; }
.eyebrow { margin: 0 0 12px; color: #9587bd; font-size: 10px; font-weight: 500; letter-spacing: .14em; }
h1 { margin: 0; font-size: 32px; line-height: 1.32; font-weight: 600; letter-spacing: -.03em; }
.hero-copy { margin: 16px auto 24px; max-width: 340px; color: var(--muted); font-size: 14px; line-height: 1.85; }
.feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.feature-grid div { display: flex; flex-direction: column; gap: 5px; padding: 15px 8px; background: var(--option); border-radius: 14px; }
.feature-grid strong { color: #6d589f; font-size: 14px; font-weight: 500; }
.feature-grid span { color: var(--muted); font-size: 11px; }
.test-note { margin-bottom: 22px; padding: 16px; background: #faf9fc; border-left: 3px solid #a692d7; border-radius: 4px 12px 12px 4px; text-align: left; }
.test-note strong { font-size: 13px; font-weight: 500; }
.test-note p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.75; }
.primary-btn, .secondary-btn { width: 100%; min-height: 54px; padding: 14px 18px; border-radius: 15px; font-size: 15px; font-weight: 500; cursor: pointer; }
.primary-btn { color: var(--white); background: var(--accent); border: 1px solid var(--accent); box-shadow: 0 7px 16px rgba(119,99,200,.18); }
.primary-btn:active { background: var(--accent-dark); }
.secondary-btn { color: var(--accent-dark); background: var(--card); border: 1px solid #d8d0e8; }
.text-btn { display: block; margin: 6px auto 0; padding: 12px; color: var(--muted); background: transparent; border: 0; font-size: 13px; cursor: pointer; }
.fine-print { margin: 14px auto 0; max-width: 360px; color: #a09aaa; font-size: 10px; line-height: 1.7; text-align: center; }

.exit-btn { width: 32px; height: 32px; padding: 0; color: var(--muted); background: rgba(255,255,255,.65); border: 1px solid var(--line); border-radius: 50%; font-size: 19px; line-height: 1; cursor: pointer; }
.quiz-header { padding: 18px 18px 16px; }
.progress-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.progress-label { color: #81729f; font-size: 13px; font-weight: 500; }
.progress-number { display: flex; gap: 12px; color: var(--accent); font-size: 12px; }
.progress-track { height: 7px; overflow: hidden; background: #e9e4f2; border-radius: 999px; }
.progress-bar { width: 4.17%; height: 100%; background: var(--accent); border-radius: inherit; transition: width .2s ease; }
.question-wrap { margin-top: 16px; padding: 26px 20px 20px; }
.question-kicker { margin: 0 0 12px; color: #8b78b2; font-size: 12px; font-weight: 500; }
#question-text { margin: 0 0 24px; font-size: 21px; line-height: 1.55; font-weight: 600; letter-spacing: -.01em; outline: none; }
.options { display: grid; gap: 11px; }
.option-btn { display: flex; align-items: center; gap: 13px; width: 100%; min-height: 62px; padding: 14px 15px; color: var(--ink); background: var(--option); border: 1px solid var(--line); border-radius: 15px; text-align: left; font-size: 14px; line-height: 1.55; cursor: pointer; transition: border-color .12s ease, background .12s ease; }
.option-btn:hover { border-color: #b7a8d6; }
.option-btn.selected { color: var(--accent-dark); background: var(--accent-soft); border-color: var(--accent); }
.option-letter { position: relative; display: inline-flex; flex: 0 0 22px; align-items: center; justify-content: center; width: 22px; height: 22px; color: transparent; background: var(--white); border: 1.5px solid #cfc6df; border-radius: 50%; font-size: 0; }
.option-btn.selected .option-letter { color: transparent; background: var(--white); border-color: var(--accent); }
.option-btn.selected .option-letter::after { content: ""; width: 10px; height: 10px; background: var(--accent); border-radius: 50%; }
.multi-options .option-letter { border-radius: 6px; }
.multi-options .option-btn.selected .option-letter::after { width: 10px; height: 6px; background: transparent; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); border-radius: 0; transform: translateY(-1px) rotate(-45deg); }
.question-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; }
.nav-btn { min-width: 86px; padding: 10px 16px; color: #716783; background: var(--card); border: 1px solid #d9d1e5; border-radius: 12px; font-size: 13px; cursor: pointer; }
.nav-btn:disabled { opacity: .35; cursor: default; }
.next-btn { min-width: 96px; color: var(--white); background: var(--accent); border-color: var(--accent); }
.answer-hint { flex: 1; margin: 0; color: #aaa3b4; font-size: 10px; text-align: center; }

.result-head { padding: 28px 22px 24px; text-align: center; }
.result-icon { width: 52px; height: 52px; margin: 0 auto 16px; border-radius: 16px; }
.result-icon svg { width: 32px; height: 32px; }
.result-head h1 { color: var(--accent-dark); font-size: 32px; }
.result-summary { margin: 14px 0 16px; color: #625c70; font-size: 14px; line-height: 1.85; text-align: left; }
.tag-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tag { padding: 5px 11px; color: var(--accent-dark); background: var(--accent-soft); border-radius: 999px; font-size: 11px; }
.secondary-note { margin: 14px 0 0; padding: 11px 12px; color: var(--muted); background: var(--option); border-radius: 10px; font-size: 11px; line-height: 1.65; text-align: left; }
.report-card { margin-top: 16px; }
.report-module { margin-bottom: 14px; padding: 20px; }
.report-module h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 15px; font-weight: 500; }
.report-module h2 span { color: #9b8ebd; font-size: 12px; font-weight: 500; }
.report-module p { margin: 0; font-size: 13px; line-height: 1.85; }
.soft-block { background: #faf9fc; }
.accent-block { background: var(--accent-soft); }
.accent-block h2, .accent-block p { color: var(--accent-dark); }
.cycle-text { padding: 12px; color: #65547e; background: var(--accent-soft); border-radius: 10px; font-weight: 500; }
.muted-copy { margin-top: 9px !important; color: var(--muted); font-size: 11px !important; }
.module-caption { margin: -4px 0 14px !important; color: var(--muted); font-size: 11px !important; }
.score-row { display: grid; grid-template-columns: 64px 1fr 24px; align-items: center; gap: 9px; margin: 13px 0; color: #716a7e; font-size: 11px; }
.score-row > span:last-child { color: #92899e; text-align: right; }
.score-track { height: 7px; overflow: hidden; background: #ece7f2; border-radius: 999px; }
.score-fill { height: 100%; background: var(--accent); border-radius: inherit; }
.closing-line { margin: 4px 4px 18px; padding: 4px 0 4px 13px; border-left: 2px solid var(--accent); }
.closing-line p { margin: 0; color: #625876; font-size: 13px; line-height: 1.8; }
.result-actions { display: grid; gap: 10px; margin-top: 18px; }
.toast { position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom)); z-index: 10; max-width: calc(100vw - 40px); padding: 10px 16px; color: var(--white); background: #494154; border-radius: 999px; font-size: 13px; transform: translateX(-50%); }

@media (min-width: 600px) {
  .screen { padding: 24px 20px 30px; }
  .welcome-card { padding: 36px 28px 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
