:root {
  color-scheme: light;
  --paper: #efede8;
  --paper-deep: #e5e3de;
  --card: #fbfaf6;
  --ink: #2e2c2b;
  --ink-soft: #504d49;
  --muted: #716b65;
  --blue: #3e5a65;
  --blue-dark: #263f49;
  --blue-pale: #dfe7e6;
  --sage: #7c9a8b;
  --line: #d8d4cd;
  --line-strong: #c4c0b9;
  --shadow: 0 22px 70px rgba(49, 55, 54, .10);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); scroll-behavior: smooth; }
body {
  min-height: 100%; margin: 0; color: var(--ink);
  background:
    radial-gradient(ellipse at 13% 5%, rgba(62, 90, 101, .12), transparent 28rem),
    radial-gradient(ellipse at 95% 38%, rgba(124, 154, 139, .10), transparent 24rem),
    linear-gradient(180deg, #f4f2ed 0, var(--paper) 48%, #e9e7e2 100%);
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(62, 90, 101, .25); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

#app { min-height: 100dvh; }
.scene { position: relative; min-height: 100dvh; width: min(100%, 470px); margin: 0 auto; padding: max(24px, env(safe-area-inset-top)) 18px max(44px, env(safe-area-inset-bottom)); overflow: hidden; }
.page-ornament { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.page-ornament i { position: absolute; border-radius: 47% 53% 61% 39%; filter: blur(1px); }
.page-ornament i:nth-child(1) { width: 260px; height: 190px; top: -110px; left: calc(50% - 330px); border: 1px solid rgba(62, 90, 101, .13); transform: rotate(18deg); }
.page-ornament i:nth-child(2) { width: 240px; height: 240px; top: 37%; right: calc(50% - 340px); background: radial-gradient(circle, rgba(62,90,101,.055), transparent 67%); }
.page-ornament i:nth-child(3) { width: 310px; height: 120px; bottom: -70px; left: calc(50% - 245px); border-top: 1px solid rgba(124,154,139,.18); transform: rotate(-8deg); }

.cover-card, .paper-card, .question-card, .result-section, .result-hero, .transition-card {
  background: rgba(251, 250, 246, .94);
  border: 1px solid rgba(62, 90, 101, .16);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.gate-scene, .intro-scene, .transition-scene { display: grid; align-items: center; }
.gate-card { position: relative; padding: 47px 25px 31px; overflow: hidden; text-align: center; }
.gate-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(circle at 50% 7%, rgba(62,90,101,.12), transparent 34%), linear-gradient(180deg, rgba(255,255,255,.36), transparent 52%); }
.gate-card::after { content: ""; position: absolute; width: 190px; height: 130px; right: -100px; bottom: 70px; border-radius: 50%; background: radial-gradient(ellipse, rgba(46,44,43,.06), transparent 68%); transform: rotate(-18deg); }
.cover-whorl { position: absolute; top: -60px; left: 50%; width: 210px; height: 180px; transform: translateX(-50%); opacity: .38; }
.cover-whorl i { position: absolute; left: 50%; top: 50%; border: 1px solid var(--blue); border-radius: 50%; transform: translate(-50%, -50%) rotate(-7deg); }
.cover-whorl i:nth-child(1) { width: 186px; height: 122px; }
.cover-whorl i:nth-child(2) { width: 138px; height: 92px; opacity: .62; }
.cover-whorl i:nth-child(3) { width: 82px; height: 55px; opacity: .42; }
.seal { position: relative; width: 53px; height: 53px; margin: 0 auto 19px; display: grid; place-items: center; border: 2px solid var(--blue); color: var(--blue); font: 700 28px/1 "Kaiti SC", "STKaiti", "Songti SC", serif; transform: rotate(-3deg); }
.eyebrow { margin: 0 0 12px; color: var(--blue); font-size: 12px; font-weight: 750; letter-spacing: .2em; }
.cover-card h1, .intro-card h1, .transition-card h1 { margin: 0; font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif; font-weight: 700; letter-spacing: .055em; }
.cover-card h1 { font-size: clamp(37px, 10vw, 47px); line-height: 1.28; }
.cover-hook { margin: 21px 0 17px; color: var(--ink-soft); font: 17px/1.85 "Kaiti SC", "STKaiti", "Songti SC", serif; }
.truth-teasers { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.truth-teasers span { padding: 6px 9px; border: 1px solid rgba(62,90,101,.14); border-radius: 99px; color: #5f6f70; background: rgba(255,255,255,.52); font-size: 11px; }
.lotus-divider { display: flex; align-items: center; gap: 10px; margin: 23px auto; color: var(--sage); font: 13px "Songti SC", serif; }
.lotus-divider span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(124,154,139,.62)); }
.lotus-divider span:last-child { background: linear-gradient(90deg, rgba(124,154,139,.62), transparent); }
.code-field { display: block; }
.code-field input { width: 100%; min-height: 54px; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: 13px; color: var(--ink); background: rgba(255,255,255,.82); text-align: center; letter-spacing: .08em; text-transform: uppercase; }
.code-field input::placeholder { color: #96918b; letter-spacing: .02em; }
.primary-button, .outline-button { width: 100%; min-height: 54px; border-radius: 13px; padding: 14px 18px; cursor: pointer; font-weight: 750; letter-spacing: .035em; }
.primary-button { margin-top: 12px; border: 1px solid var(--blue-dark); color: #fff; background: linear-gradient(135deg, #526f79, var(--blue-dark)); box-shadow: 0 12px 30px rgba(38,63,73,.22); }
.primary-button:active { transform: translateY(1px); }
.primary-button:disabled { opacity: .55; cursor: wait; }
.outline-button { border: 1px solid rgba(62,90,101,.48); color: var(--blue-dark); background: rgba(255,255,255,.58); }
.micro-copy, .disclaimer, .result-disclaimer { color: var(--muted); font-size: 12px; line-height: 1.7; }
.micro-copy { margin: 13px 0 0; }

.intro-card { padding: 33px 25px 27px; text-align: center; }
.intro-card h1 { font-size: 29px; line-height: 1.5; }
.intro-card > p:not(.eyebrow):not(.soft-note):not(.disclaimer) { color: #5f5b56; line-height: 1.88; }
.intro-notes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 26px 0; }
.intro-notes div { padding: 14px 4px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.66); }
.intro-notes b { display: block; color: var(--blue); font: 700 24px "Songti SC", serif; }
.intro-notes span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.soft-note { padding: 13px 14px; border-left: 3px solid var(--sage); border-radius: 5px; color: #596460; background: rgba(124,154,139,.10); font-size: 13px; line-height: 1.75; text-align: left; }
.text-button { display: block; margin: 13px auto 0; padding: 8px 10px; border: 0; color: var(--blue); background: transparent; cursor: pointer; }
.muted-button { color: var(--muted); }
.disclaimer { margin: 19px 0 0; }

.quiz-scene { padding-top: max(15px, env(safe-area-inset-top)); }
.quiz-shell { min-height: calc(100dvh - 58px); }
.quiz-header { display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; gap: 8px; }
.back-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; color: var(--blue); background: rgba(255,255,255,.68); cursor: pointer; }
.back-button:disabled { opacity: .25; cursor: default; }
.progress-meta { display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--muted); font-size: 13px; }
.progress-meta b { color: var(--ink); font-weight: 650; }
.progress-track { height: 4px; margin: 14px 2px 25px; border-radius: 99px; background: #dcd9d3; overflow: hidden; }
.progress-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--sage), var(--blue)); transition: width .34s ease; }
.question-card { position: relative; padding: 38px 20px 23px; }
.question-number { position: absolute; top: -18px; left: 22px; width: 39px; height: 39px; display: grid; place-items: center; border: 1px solid var(--blue); border-radius: 50%; color: var(--blue); background: var(--paper); font: 18px "Songti SC", serif; }
.question-lead { margin: 0 0 8px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.question-card h1 { margin: 0 0 23px; font: 700 22px/1.55 "Songti SC", "STSong", serif; }
.options { display: grid; gap: 10px; }
.option-button { width: 100%; min-height: 58px; display: grid; grid-template-columns: 18px 28px 1fr; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: rgba(255,255,255,.79); text-align: left; cursor: pointer; transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.option-radio { width: 15px; height: 15px; border: 1px solid #9aa8a6; border-radius: 50%; transition: inherit; }
.option-letter { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid rgba(62,90,101,.22); border-radius: 8px; color: var(--blue); background: var(--blue-pale); font: 750 13px/1 Georgia, "Times New Roman", serif; font-style: normal; transition: inherit; }
.option-button b { font-size: 15px; font-weight: 500; line-height: 1.58; }
.option-button:hover { transform: translateY(-1px); border-color: rgba(62,90,101,.45); }
.option-button.selected { color: #fff; border-color: var(--blue); background: var(--blue); box-shadow: 0 9px 25px rgba(38,63,73,.18); }
.option-button.selected .option-radio { border: 4px solid rgba(255,255,255,.9); background: var(--sage); }
.option-button.selected .option-letter { border-color: rgba(255,255,255,.42); color: #fff; background: rgba(255,255,255,.14); }

.transition-card { padding: 57px 24px; text-align: center; }
.transition-card h1 { font-size: 24px; line-height: 1.75; }
.mind-loader { position: relative; width: 88px; height: 88px; margin: 0 auto 22px; }
.mind-loader i { position: absolute; left: 50%; top: 50%; border: 1px solid var(--blue); border-radius: 48% 52% 44% 56%; transform: translate(-50%, -50%); animation: mind-pulse 1.4s ease-in-out infinite alternate; }
.mind-loader i:nth-child(1) { width: 82px; height: 63px; }
.mind-loader i:nth-child(2) { width: 57px; height: 44px; animation-delay: .18s; }
.mind-loader i:nth-child(3) { width: 30px; height: 23px; animation-delay: .36s; }
.ink-dots { display: flex; justify-content: center; gap: 7px; margin-top: 26px; }
.ink-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--sage); animation: dot 1s infinite alternate; }
.ink-dots i:nth-child(2) { animation-delay: .2s; }.ink-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes mind-pulse { to { opacity: .35; transform: translate(-50%, -50%) scale(.91) rotate(5deg); } }
@keyframes dot { to { opacity: .2; transform: translateY(-4px); } }

.result-scene { width: min(100%, 540px); padding-inline: 13px; }
.result-scroll { display: grid; gap: 14px; }
.result-hero { padding: 38px 22px 28px; text-align: center; background: linear-gradient(180deg, rgba(223,231,230,.88), rgba(251,250,246,.97) 66%); }
.type-sigil { width: 92px; height: 92px; display: block; margin: 2px auto 5px; fill: none; stroke: var(--blue); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.type-B { stroke: #475963; }.type-C { stroke: #60747b; }.type-D { stroke: #718b7e; }.type-E { stroke: #354e58; }.type-F { stroke: #7c8784; }
.result-hero h1 { margin: 3px 0 7px; color: var(--blue-dark); font: 700 clamp(34px, 9vw, 45px) "Songti SC", serif; letter-spacing: .08em; }
.subtype-tag { display: inline-block; margin: 0; padding: 5px 14px; border: 1px solid rgba(62,90,101,.35); border-radius: 99px; color: var(--blue); background: rgba(255,255,255,.57); font-size: 13px; }
.result-kicker { margin: 18px auto 0; max-width: 360px; color: #41545a; font: 17px/1.7 "Kaiti SC", "STKaiti", serif; }
.tie-note { margin: 15px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.easter-note { display: grid; gap: 8px; margin: 20px 0 0; padding: 15px 16px; border: 1px solid rgba(124,154,139,.44); border-radius: 13px; color: #4e625a; background: rgba(241,247,243,.75); text-align: left; }
.easter-note b { color: #567365; font-size: 13px; text-align: center; letter-spacing: .06em; }
.easter-note span { font-size: 13px; line-height: 1.78; }
.result-section { padding: 23px 20px; }
.section-mark { margin: 0 0 12px; color: var(--blue); font-size: 12px; font-weight: 750; letter-spacing: .16em; }
.verdict-card blockquote { margin: 0; color: #41413f; font: 18px/1.95 "Kaiti SC", "STKaiti", "Songti SC", serif; }
.subtype-copy { margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); }
.subtype-copy b { color: var(--blue-dark); font-family: "Songti SC", serif; }
.subtype-copy p { margin: 8px 0 0; color: #5e5b57; font-size: 14px; line-height: 1.88; }
.radar-card { display: grid; grid-template-columns: 1fr 190px; align-items: center; gap: 6px; }
.radar-card h2 { margin: 0; font: 700 19px/1.55 "Songti SC", serif; }
.radar-note { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.radar { width: 100%; overflow: visible; }
.radar polygon, .radar line { vector-effect: non-scaling-stroke; }
.radar-grid { fill: rgba(124,154,139,.055); stroke: rgba(62,90,101,.35); stroke-width: 1; }
.radar-grid.inner { fill: none; stroke-dasharray: 3 3; }
.radar line { stroke: rgba(62,90,101,.18); }
.radar-value { fill: rgba(62,90,101,.16); stroke: var(--blue); stroke-width: 2; }
.radar text { fill: var(--muted); font-size: 10px; font-family: system-ui, sans-serif; }
.dimension-list { display: grid; grid-template-columns: 1fr; gap: 10px; }
.dimension-card { padding: 17px 16px; border: 1px solid var(--line); border-radius: 16px; background: rgba(251,250,246,.94); box-shadow: 0 10px 28px rgba(49,55,54,.055); }
.state-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.state-row span { font-size: 14px; font-weight: 700; }
.state-row strong { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--blue); font-size: 12px; }
.meter { height: 6px; margin: 12px 0; border-radius: 99px; background: #dfe0dc; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--sage), var(--blue)); }
.dimension-card p { margin: 0; color: #5e5c58; font-size: 13px; line-height: 1.8; }
.advice-card ol { display: grid; gap: 15px; margin: 0; padding: 0; list-style: none; counter-reset: advice; }
.advice-card li { display: grid; grid-template-columns: 25px 1fr; gap: 10px; align-items: start; counter-increment: advice; }
.advice-card li span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--blue); }
.advice-card li span::after { content: counter(advice); font-size: 11px; }
.advice-card li p { margin: 0; color: #55534f; font-size: 14px; line-height: 1.82; }
.result-actions { display: grid; gap: 10px; padding: 6px 4px; }
.result-actions .primary-button { margin: 0; }
.result-actions .text-button { margin: 0 auto; }
.support-note { margin: 1px 3px; padding: 14px 16px; border-left: 3px solid var(--sage); border-radius: 6px; color: #54615c; background: rgba(124,154,139,.10); font-size: 13px; line-height: 1.75; }
.result-disclaimer { margin: 2px 13px 18px; text-align: center; }
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .4s ease, transform .4s ease; }
.reveal.visible { opacity: 1; transform: none; }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(36,43,44,.58); backdrop-filter: blur(7px); }
.contact-modal { position: relative; width: min(100%, 360px); padding: 30px 24px 25px; border: 1px solid var(--line); border-radius: 23px; background: var(--card); box-shadow: 0 28px 80px rgba(31,38,39,.32); text-align: center; }
.modal-close { position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; border: 0; color: var(--muted); background: transparent; font-size: 28px; cursor: pointer; }
.contact-modal h2 { margin: 0 0 17px; font: 700 24px "Songti SC", serif; }
.contact-modal img { width: 180px; height: 180px; display: block; margin: 0 auto; border: 8px solid #fff; border-radius: 11px; object-fit: cover; box-shadow: 0 8px 28px rgba(49,55,54,.13); }
.contact-modal p { margin: 17px 0 7px; color: var(--muted); font-size: 13px; }
.contact-code { display: block; color: var(--blue); font-size: 18px; }
.contact-modal small { display: block; margin-top: 12px; color: var(--muted); font-size: 12px; }
.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 80; max-width: calc(100% - 36px); padding: 11px 16px; border-radius: 99px; color: #fff; background: #505957; box-shadow: 0 10px 35px rgba(0,0,0,.18); opacity: 0; transform: translate(-50%, 16px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; font-size: 13px; text-align: center; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #704943; }

@media (max-width: 390px) {
  .scene { padding-inline: 11px; }
  .gate-card, .intro-card { padding-inline: 20px; }
  .question-card { padding-inline: 15px; }
  .option-button { padding-inline: 12px; }
  .radar-card { grid-template-columns: 1fr 158px; }
  .intro-notes b { font-size: 21px; }
}

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