:root {
  color-scheme: light;
  --bg: #eef0f1;
  --surface: #f8f9f9;
  --surface-2: #e3e6e7;
  --ink: #1e2426;
  --muted: #626b6e;
  --line: #c8ced0;
  --accent: #913b47;
  --accent-strong: #722b36;
  --accent-soft: #ead7da;
  --on-accent: #fff8f7;
  --shadow: 0 24px 80px rgba(35, 45, 48, .14);
  --radius: 16px;
  --header-height: 68px;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171b1d;
  --surface: #202629;
  --surface-2: #2b3235;
  --ink: #f0f1f1;
  --muted: #aab1b3;
  --line: #3a4447;
  --accent: #cb6c79;
  --accent-strong: #dd8390;
  --accent-soft: #492b31;
  --on-accent: #211416;
  --shadow: 0 24px 80px rgba(0, 0, 0, .32);
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100dvh; background: var(--bg); color: var(--ink); }
button, input { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.site-header { position: sticky; top: 0; z-index: 2; height: var(--header-height); display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(18px, 4vw, 48px); border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(18px); }
.brand { color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 750; letter-spacing: .05em; }
nav { display: flex; align-items: center; gap: 6px; }
.text-button, .icon-button { border: 0; background: transparent; cursor: pointer; }
.text-button { padding: 10px 12px; font-size: 13px; color: var(--muted); }
.icon-button { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; }
.text-button:hover, .icon-button:hover { background: var(--surface-2); color: var(--ink); }
.page { min-height: calc(100dvh - var(--header-height)); }
.welcome { display: grid; grid-template-columns: minmax(0, .9fr) minmax(340px, 1.1fr); max-width: 1220px; margin: 0 auto; min-height: calc(100dvh - var(--header-height)); padding: clamp(20px, 3vw, 44px) clamp(18px, 4vw, 48px); gap: clamp(28px, 5vw, 68px); align-items: center; }
.hero-copy { max-width: 550px; }
.eyebrow { margin: 0 0 18px; color: var(--accent); font-size: 12px; font-weight: 750; letter-spacing: .2em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 22px; max-width: 9.6em; font-size: clamp(40px, 4.4vw, 64px); line-height: 1.04; letter-spacing: -.06em; font-weight: 790; }
.lead { max-width: 20em; margin-bottom: 30px; color: var(--muted); font-size: clamp(17px, 1.7vw, 21px); line-height: 1.7; }
.primary-button, .secondary-button { min-height: 52px; border: 1px solid transparent; border-radius: var(--radius); padding: 0 24px; cursor: pointer; font-weight: 720; white-space: nowrap; transition: transform .2s ease, background .2s ease, border-color .2s ease; }
.primary-button { background: var(--accent-strong); color: var(--on-accent); box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 24%, transparent); }
.primary-button:hover { background: var(--accent); transform: translateY(-2px); }
.primary-button:active, .secondary-button:active, .option:active { transform: scale(.98); }
.secondary-button { border-color: var(--line); background: transparent; color: var(--ink); }
.secondary-button:hover { border-color: var(--accent); }
.microcopy { margin: 16px 0 0; color: var(--muted); font-size: 12px; }
.hero-visual { position: relative; justify-self: end; width: min(100%, 550px); }
.hero-image { display: block; width: 100%; height: min(72dvh, 650px); object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.hero-caption { position: absolute; left: -42px; bottom: 32px; width: 196px; margin: 0; padding: 18px; border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(15px); box-shadow: var(--shadow); font-size: 14px; line-height: 1.55; }
.proof { max-width: 1220px; margin: 0 auto; padding: 18px clamp(18px, 4vw, 48px) 90px; }
.proof-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; padding-top: 40px; border-top: 1px solid var(--line); }
.proof h2 { max-width: 12em; font-size: clamp(28px, 3vw, 44px); line-height: 1.15; letter-spacing: -.04em; }
.proof p { max-width: 42em; color: var(--muted); line-height: 1.8; }
.method-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.method-item { padding: 20px; border-radius: var(--radius); background: var(--surface); }
.method-item strong { display: block; font-size: 22px; color: var(--accent); margin-bottom: 8px; }
.method-item span { color: var(--muted); font-size: 13px; line-height: 1.6; }

.quiz-shell { width: min(100%, 820px); min-height: calc(100dvh - var(--header-height)); margin: 0 auto; padding: 28px clamp(18px, 5vw, 56px) 48px; display: flex; flex-direction: column; }
.quiz-top { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; }
.back-button { border: 0; background: transparent; cursor: pointer; color: var(--muted); padding: 8px 0; }
.progress-line { height: 3px; overflow: hidden; background: var(--surface-2); border-radius: 99px; }
.progress-line span { display: block; height: 100%; width: var(--progress); background: var(--accent); border-radius: inherit; transition: width .35s cubic-bezier(.16,1,.3,1); }
.count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.question-panel { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: clamp(36px, 8vh, 76px) 0; }
.chapter { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .12em; }
.question-panel h2 { max-width: 19em; margin: 14px 0 10px; font-size: clamp(25px, 4vw, 38px); line-height: 1.35; letter-spacing: -.025em; }
.question-note { color: var(--muted); line-height: 1.65; font-size: 14px; }
.options { display: grid; gap: 12px; margin-top: 32px; }
.option { display: grid; grid-template-columns: 38px 1fr; gap: 13px; align-items: center; width: 100%; padding: 17px 18px; text-align: left; border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 88%, transparent); cursor: pointer; line-height: 1.55; transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.option:hover { border-color: var(--accent); background: var(--surface); transform: translateY(-2px); }
.option-key { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; }
.option.selected { border-color: var(--accent); background: var(--accent-soft); }

.loading-page { display: grid; place-items: center; min-height: calc(100dvh - var(--header-height)); padding: 24px; }
.loading-card { width: min(100%, 540px); text-align: center; }
.pulse-mark { width: 84px; height: 84px; margin: 0 auto 26px; border: 1px solid var(--accent); border-radius: 50%; position: relative; }
.pulse-mark::before, .pulse-mark::after { content: ""; position: absolute; inset: 17px; border: 1px solid var(--accent); border-radius: 50%; }
.pulse-mark::after { inset: 33px; background: var(--accent); }
.loading-card h2 { font-size: 28px; }
.loading-card p { color: var(--muted); }

.result-page { width: min(100%, 980px); margin: 0 auto; padding: 40px clamp(18px, 5vw, 64px) 100px; }
.result-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(280px, .95fr); gap: 42px; align-items: center; min-height: 580px; }
.result-label { color: var(--accent); font-weight: 750; font-size: 13px; letter-spacing: .16em; }
.result-hero h1 { max-width: none; margin: 16px 0; font-size: clamp(48px, 7vw, 84px); }
.tagline { max-width: 22em; font-size: clamp(20px, 2.4vw, 28px); line-height: 1.5; }
.result-intro { color: var(--muted); line-height: 1.85; }
.result-art { aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); position: relative; }
.result-art img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.82) contrast(1.04); }
.result-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(26,20,21,.5)); }
.report-section { padding: 52px 0; border-top: 1px solid var(--line); }
.report-section h2 { max-width: 16em; font-size: clamp(27px, 3.4vw, 40px); letter-spacing: -.035em; }
.report-section > p { max-width: 47em; color: var(--muted); line-height: 1.85; }
.tension { display: grid; grid-template-columns: 1fr auto 1fr; gap: 24px; align-items: center; }
.tension-side { min-height: 170px; padding: 24px; border-radius: var(--radius); background: var(--surface); }
.tension-side small { color: var(--muted); }
.tension-side strong { display: block; margin: 16px 0 8px; font-size: 25px; }
.tension-side p { color: var(--muted); line-height: 1.65; margin-bottom: 0; }
.tension-mark { color: var(--accent); font-size: 28px; }
.radar-wrap { display: grid; grid-template-columns: minmax(260px, .8fr) 1.2fr; gap: 48px; align-items: center; }
#radarCanvas { width: 100%; max-width: 380px; aspect-ratio: 1; }
.dimension-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; }
.dimension strong { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 14px; }
.dimension span { color: var(--accent); font-variant-numeric: tabular-nums; }
.dimension p { margin-bottom: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.situations { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.situation { padding: 24px; border-radius: var(--radius); background: var(--surface); }
.situation:nth-child(2) { background: var(--accent-soft); }
.situation h3 { margin-bottom: 12px; font-size: 18px; }
.situation p { margin-bottom: 0; color: var(--muted); line-height: 1.75; }
.advice-list { counter-reset: advice; display: grid; gap: 0; }
.advice { counter-increment: advice; display: grid; grid-template-columns: 56px 1fr; gap: 18px; padding: 23px 0; border-bottom: 1px solid var(--line); }
.advice::before { content: "0" counter(advice); color: var(--accent); font-weight: 750; }
.advice strong { display: block; margin-bottom: 8px; }
.advice p { margin: 0; color: var(--muted); line-height: 1.7; }
.result-actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 38px; }
.disclaimer { margin-top: 34px; color: var(--muted); font-size: 12px; line-height: 1.7; }

.dialog-backdrop { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 18px; background: rgba(15, 19, 20, .55); backdrop-filter: blur(7px); }
.dialog-backdrop[hidden] { display: none; }
.dialog { width: min(100%, 540px); max-height: min(78dvh, 680px); overflow: auto; padding: 24px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.dialog-head h2 { margin: 0; }
.history-empty { padding: 34px 0; text-align: center; color: var(--muted); }
.history-item { width: 100%; display: flex; justify-content: space-between; gap: 18px; padding: 17px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.history-item strong { display: block; margin-bottom: 5px; }
.history-item span { color: var(--muted); font-size: 12px; }
.history-item b { color: var(--accent); font-size: 13px; white-space: nowrap; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 28px; transform: translate(-50%, 12px); padding: 12px 18px; border-radius: var(--radius); background: var(--ink); color: var(--bg); opacity: 0; pointer-events: none; transition: .25s ease; font-size: 13px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 767px) {
  .site-header { padding-inline: 16px; }
  .welcome { grid-template-columns: 1fr; padding: 34px 18px 68px; gap: 34px; align-items: start; }
  h1 { font-size: clamp(42px, 13vw, 62px); }
  .lead { font-size: 17px; }
  .hero-visual { width: 92%; justify-self: end; }
  .hero-image { height: auto; aspect-ratio: 4 / 5; }
  .hero-caption { left: -9%; bottom: 20px; width: 178px; }
  .proof { padding: 16px 18px 64px; }
  .proof-grid, .result-hero, .radar-wrap { grid-template-columns: 1fr; }
  .proof-grid { gap: 24px; }
  .method-list { grid-template-columns: 1fr 1fr; gap: 10px; }
  .method-item { padding: 16px; }
  .quiz-shell { padding: 20px 18px 36px; }
  .question-panel { justify-content: flex-start; padding-top: 10vh; }
  .option { padding: 15px; }
  .result-page { padding: 26px 18px 72px; }
  .result-hero { gap: 24px; min-height: 0; padding-bottom: 52px; }
  .result-copy { order: 2; }
  .result-art { order: 1; aspect-ratio: 16 / 10; }
  .result-hero h1 { font-size: clamp(48px, 15vw, 70px); }
  .tension { grid-template-columns: 1fr; }
  .tension-mark { transform: rotate(90deg); justify-self: center; }
  .dimension-list, .situations { grid-template-columns: 1fr; }
  .result-actions > * { width: 100%; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { opacity: 0; transform: translateY(18px); animation: enter .75s cubic-bezier(.16,1,.3,1) forwards; }
  .hero-copy > :nth-child(2) { animation-delay: .08s; }
  .hero-copy > :nth-child(3) { animation-delay: .16s; }
  .hero-copy > :nth-child(4) { animation-delay: .24s; }
  .hero-visual { opacity: 0; transform: translateY(22px); animation: enter .9s .12s cubic-bezier(.16,1,.3,1) forwards; }
  .question-panel { animation: questionIn .38s cubic-bezier(.16,1,.3,1); }
  .pulse-mark { animation: breathe 1.35s ease-in-out infinite; }
  @keyframes enter { to { opacity: 1; transform: translateY(0); } }
  @keyframes questionIn { from { opacity: 0; transform: translateX(16px); } }
  @keyframes breathe { 50% { transform: scale(1.08); opacity: .68; } }
}

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

@media print {
  .site-header, .result-actions, .disclaimer { display: none !important; }
  body { background: white; color: #202527; }
  .result-page { max-width: 850px; padding: 0; }
}
