:root {
  color-scheme: dark;
  --ink: #090708;
  --wine: #6f1c29;
  --wine-bright: #a4343d;
  --gold: #d0a45f;
  --gold-soft: #ead1a1;
  --paper: #f5ead8;
  --muted: #b6a996;
  --panel: rgba(24, 15, 17, .90);
  --panel-strong: rgba(15, 10, 12, .96);
  --line: rgba(213, 173, 105, .28);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 78% 12%, rgba(100, 22, 32, .30), transparent 34rem),
    radial-gradient(circle at 8% 70%, rgba(91, 46, 24, .17), transparent 28rem),
    linear-gradient(155deg, #10090b 0%, #080708 56%, #12090b 100%);
  color: var(--paper);
  font: 16px/1.72 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -3;
  content: "";
  opacity: .28;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.014) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, #000, transparent 82%);
}

button, input { font: inherit; }

button { color: inherit; }

#imprint-field {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#app { min-height: 100vh; }

.scene {
  width: min(780px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) clamp(18px, 4vw, 34px) calc(54px + var(--safe-bottom));
}

.scene.result { width: min(860px, 100%); }

.scene-enter { animation: scene-in .58s cubic-bezier(.2,.75,.2,1) both; }

.stagger { animation: rise-in .7s cubic-bezier(.2,.75,.2,1) both; }
.stagger:nth-child(2) { animation-delay: .08s; }
.stagger:nth-child(3) { animation-delay: .16s; }
.stagger:nth-child(4) { animation-delay: .24s; }
.stagger:nth-child(5) { animation-delay: .32s; }
.stagger:nth-child(6) { animation-delay: .40s; }
.stagger:nth-child(7) { animation-delay: .48s; }
.stagger:nth-child(8) { animation-delay: .56s; }

@keyframes scene-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.landing-hero { position: relative; padding-top: clamp(24px, 7vh, 80px); }

.landing-hero h1,
.intro-panel h1,
.reveal-panel h1,
.error-panel h1 {
  margin: 0;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: clamp(54px, 13vw, 98px);
  font-weight: 750;
  line-height: .96;
  letter-spacing: -.055em;
}

.landing-hero h1 em,
.intro-panel h1 em {
  color: var(--gold-soft);
  font-style: normal;
  text-shadow: 0 0 36px rgba(207, 142, 68, .16);
}

.hero-copy {
  margin: 24px 0 0;
  color: #d7c8b6;
  font-family: "Songti SC", serif;
  font-size: clamp(18px, 4.4vw, 24px);
  line-height: 1.75;
}

.mark-orbit {
  position: relative;
  width: min(82vw, 410px);
  aspect-ratio: 1;
  margin: clamp(26px, 7vh, 62px) auto 18px;
  border: 1px solid rgba(213,173,105,.22);
  border-radius: 50%;
  box-shadow: inset 0 0 80px rgba(114,25,34,.19), 0 0 80px rgba(121,28,37,.12);
  animation: orbit-breathe 4.8s ease-in-out infinite;
}

.mark-orbit::before,
.mark-orbit::after {
  position: absolute;
  inset: 12%;
  content: "";
  border: 1px solid rgba(213,173,105,.17);
  transform: rotate(22deg);
}

.mark-orbit::after { inset: 28%; transform: rotate(45deg); border-radius: 50%; }

.orbit-core {
  position: absolute;
  inset: 35%;
  z-index: 2;
  display: grid;
  place-content: center;
  border: 1px solid rgba(232, 201, 142, .36);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(128,31,41,.62), rgba(21,12,14,.92) 64%);
  text-align: center;
  box-shadow: 0 0 46px rgba(153,41,49,.3);
}

.orbit-core span { font: 700 clamp(30px, 8vw, 48px)/1 "Times New Roman", serif; color: var(--gold-soft); }
.orbit-core i { margin-top: 7px; color: #aa9270; font-size: 8px; font-style: normal; letter-spacing: .2em; }

.orbit-mark {
  position: absolute;
  z-index: 3;
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 1px solid rgba(215,174,105,.35);
  border-radius: 50%;
  background: #160d0f;
  color: #e6c98f;
  font: 28px/1 Georgia, serif;
  box-shadow: 0 0 20px rgba(138,34,44,.28);
}

.orbit-1 { top: -25px; left: calc(50% - 25px); }
.orbit-2 { top: 14%; right: 1%; }
.orbit-3 { top: 54%; right: -5%; }
.orbit-4 { right: 17%; bottom: -1%; }
.orbit-5 { left: 17%; bottom: -1%; }
.orbit-6 { top: 54%; left: -5%; }
.orbit-7 { top: 14%; left: 1%; }

@keyframes orbit-breathe {
  50% { box-shadow: inset 0 0 100px rgba(133,28,40,.28), 0 0 100px rgba(121,28,37,.18); transform: scale(1.018); }
}

.gate-card,
.report-card,
.intro-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(31,19,22,.96), rgba(13,10,11,.93));
  box-shadow: 0 24px 70px rgba(0,0,0,.32), inset 0 1px rgba(255,255,255,.025);
}

.gate-card { padding: clamp(24px, 6vw, 40px); }

.gate-card::before,
.report-card::before,
.intro-panel::before {
  position: absolute;
  top: 0;
  left: 10%;
  width: 45%;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.gate-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: .12em;
}

.gate-state::before { width: 18px; height: 1px; content: ""; background: currentColor; }

.gate-card h2 {
  margin: 12px 0 8px;
  font: 700 clamp(24px, 6vw, 34px)/1.35 "Songti SC", serif;
}

.gate-card > p { margin: 0 0 20px; color: var(--muted); }

.code-field { display: block; margin: 22px 0 14px; }
.code-field span { display: block; margin-bottom: 8px; color: #d8c7b0; font-size: 14px; font-weight: 650; }
.code-field input {
  width: 100%;
  min-height: 62px;
  border: 1px solid rgba(230,202,151,.46);
  border-radius: 14px;
  outline: none;
  background: rgba(4,3,4,.58);
  color: #fff8ea;
  padding: 14px 16px;
  font-size: 17px;
  letter-spacing: .045em;
}
.code-field input:focus { border-color: #e7bc73; box-shadow: 0 0 0 3px rgba(208,164,95,.13); }
.code-field input::placeholder { color: #766d68; letter-spacing: 0; }

.primary,
.secondary,
.ghost {
  width: 100%;
  min-height: 58px;
  border-radius: 14px;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, filter .2s ease, background .2s ease;
}

.primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #e2b56d;
  background: linear-gradient(110deg, #9b2d37, #7a1e2b 55%, #3e151b);
  color: #fff7e8;
  padding: 13px 17px;
  font-weight: 750;
  text-align: left;
  box-shadow: 0 12px 28px rgba(112,23,34,.24), inset 0 1px rgba(255,255,255,.1);
}
.primary small { color: #ead2a8; font-size: 11px; font-weight: 550; }
.primary:hover, .primary:focus-visible { transform: translateY(-2px); filter: brightness(1.12); }
.primary:disabled { cursor: wait; opacity: .68; transform: none; }

.secondary { border: 1px solid rgba(221,184,119,.42); background: rgba(30,18,20,.94); color: #e8d4b3; }
.ghost { border: 1px solid transparent; background: transparent; color: #a99b8a; }

.landing-note {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0;
}
.landing-note div { min-height: 96px; padding: 14px; border: 1px solid rgba(216,178,109,.14); border-radius: 16px; background: rgba(16,11,12,.58); }
.landing-note b, .landing-note span { display: block; }
.landing-note b { color: #e4cc9e; font-size: 14px; }
.landing-note span { margin-top: 5px; color: #91877b; font-size: 11px; line-height: 1.55; }

.disclaimer { margin: 28px auto 0; color: #82786d; font-size: 12px; text-align: center; }

.topbar {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  min-height: 56px;
  margin: -5px 0 24px;
  border-bottom: 1px solid rgba(214,177,111,.14);
  color: #ddd0be;
}
.topbar span { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-align: center; }
.topbar button {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(220,185,124,.2);
  border-radius: 50%;
  background: rgba(13,9,10,.74);
  color: #eee0ca;
  cursor: pointer;
  font-size: 20px;
}

.intro-panel { padding: clamp(28px, 7vw, 52px); }
.intro-panel h1 { font-size: clamp(42px, 11vw, 72px); line-height: 1.08; }
.intro-panel > p:not(.eyebrow) { margin: 24px 0; color: #c6b9a8; }
.chapter-list { display: grid; gap: 10px; margin: 26px 0 30px; }
.chapter-list div { display: flex; align-items: center; gap: 15px; min-height: 70px; padding: 12px 16px; border: 1px solid rgba(216,178,109,.17); border-radius: 14px; background: rgba(7,5,6,.38); }
.chapter-list i { color: var(--gold); font: italic 22px/1 Georgia, serif; }
.chapter-list span, .chapter-list b, .chapter-list small { display: block; }
.chapter-list b { color: #f1e4d1; }
.chapter-list small { margin-top: 2px; color: #94887b; }

.progress { margin: 0 0 28px; }
.progress > div { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 12px; margin-bottom: 11px; }
.progress span { color: var(--gold); font-size: 12px; font-weight: 750; letter-spacing: .08em; }
.progress strong { color: #e8dccb; font-size: 14px; }
.progress em { color: #8e8277; font-size: 12px; font-style: normal; }
.progress > i { display: grid; grid-template-columns: repeat(28, 1fr); gap: 3px; height: 4px; }
.progress > i b { border-radius: 999px; background: rgba(221,198,160,.12); }
.progress > i b.done { background: rgba(154,49,57,.72); }
.progress > i b.current { background: #f2d39b; box-shadow: 0 0 12px rgba(238,196,123,.68); }

.question-card { min-height: 280px; padding: clamp(25px, 7vw, 48px); border: 1px solid rgba(216,178,109,.24); border-radius: 24px; background: linear-gradient(145deg, rgba(38,20,24,.95), rgba(12,9,10,.95)); box-shadow: 0 22px 65px rgba(0,0,0,.3); animation: question-in .55s both; }
.scene-tag { display: inline-flex; padding: 5px 11px; border: 1px solid rgba(212,170,98,.26); border-radius: 999px; color: #d2af73; font-size: 12px; letter-spacing: .08em; }
.scene-lead { margin: 25px 0 16px; color: #eee0cc; font-family: "Songti SC", serif; font-size: clamp(19px, 4.8vw, 25px); line-height: 1.75; }
.question-card h1 { margin: 0; color: #aa9b89; font-size: 15px; font-weight: 550; }

@keyframes question-in { from { opacity: 0; transform: translateY(16px) scale(.99); } to { opacity: 1; transform: none; } }

.answer-list { display: grid; gap: 12px; margin-top: 18px; }
.answer {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr 22px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 84px;
  padding: 14px 15px;
  overflow: hidden;
  border: 1px solid rgba(232,213,183,.34);
  border-radius: 17px;
  background: rgba(17,12,13,.91);
  color: #f2e8da;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 10px 24px rgba(0,0,0,.15);
  animation: answer-in .5s both;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.answer:nth-child(2) { animation-delay: .06s; }
.answer:nth-child(3) { animation-delay: .12s; }
.answer:nth-child(4) { animation-delay: .18s; }
.answer i { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid rgba(221,186,126,.44); border-radius: 50%; color: #d9bd8d; font-style: normal; font-weight: 750; }
.answer span { font-size: clamp(15px, 3.8vw, 17px); line-height: 1.65; }
.answer em { color: #967e60; font-size: 18px; font-style: normal; }
.answer:hover, .answer:focus-visible { transform: translateY(-2px); border-color: #d8aa65; background: rgba(55,25,30,.92); }
.answer.selected { border-color: #f0c77f; background: linear-gradient(120deg, rgba(115,29,40,.88), rgba(36,17,21,.95)); }
.answer:disabled { cursor: default; opacity: .58; transform: none; }
.answer.selected:disabled { opacity: 1; }

@keyframes answer-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }

.answer-hint { margin: 16px 0 0; color: #8c8175; font-size: 12px; text-align: center; }

.reveal-panel,
.error-panel { display: grid; min-height: calc(100vh - 80px); place-content: center; text-align: center; }
.reveal-panel h1, .error-panel h1 { font-size: clamp(48px, 13vw, 84px); }
.reveal-panel > p:last-child, .error-panel p { color: #a89a89; }
.seal-reveal { position: relative; width: 310px; max-width: 78vw; aspect-ratio: 1; margin: 0 auto 36px; border: 1px solid rgba(218,178,108,.28); border-radius: 50%; animation: reveal-turn 9s linear infinite; }
.seal-reveal::before { position: absolute; inset: 18%; content: ""; border: 1px solid rgba(170,52,57,.34); transform: rotate(45deg); }
.seal-reveal b { position: absolute; inset: 36%; display: grid; place-items: center; border: 1px solid rgba(232,196,132,.4); border-radius: 50%; background: radial-gradient(circle, #681e29, #140b0d 70%); color: #ebd29d; font: 700 42px/1 Georgia,serif; }
.seal-reveal i { position: absolute; display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid rgba(216,178,109,.32); border-radius: 50%; background: #140c0e; color: #e3c48b; font-size: 23px; font-style: normal; animation: reveal-pulse 1.8s ease-in-out infinite alternate; }
.seal-1 { top: -21px; left: calc(50% - 21px); }
.seal-2 { top: 15%; right: 0; animation-delay: .1s !important; }
.seal-3 { right: -4%; bottom: 25%; animation-delay: .2s !important; }
.seal-4 { right: 24%; bottom: -10px; animation-delay: .3s !important; }
.seal-5 { left: 24%; bottom: -10px; animation-delay: .4s !important; }
.seal-6 { left: -4%; bottom: 25%; animation-delay: .5s !important; }
.seal-7 { top: 15%; left: 0; animation-delay: .6s !important; }
@keyframes reveal-turn { to { transform: rotate(360deg); } }
@keyframes reveal-pulse { to { color: #fff1ce; box-shadow: 0 0 24px rgba(177,56,61,.58); transform: scale(1.08); } }

.result-hero { padding: clamp(38px, 8vh, 76px) 12px 28px; text-align: center; }
.hero-seal { display: grid; width: 104px; height: 104px; margin: 14px auto 18px; place-items: center; border: 1px solid #c59b59; border-radius: 50%; background: radial-gradient(circle, #7b2530, #211014 63%, #0e090a 64%); box-shadow: 0 0 60px rgba(141,35,45,.38), inset 0 0 24px rgba(224,179,99,.15); }
.hero-seal span { color: #f0d49d; font: 44px/1 Georgia,serif; }
.result-hero > small { color: #c69f66; font-weight: 650; letter-spacing: .08em; }
.result-hero h1 { margin: 12px 0; font: 750 clamp(40px, 10vw, 72px)/1.1 "Songti SC",serif; letter-spacing: -.04em; }
.result-hero > p:not(.eyebrow) { max-width: 640px; margin: 0 auto 18px; color: #d8c9b5; font: 19px/1.8 "Songti SC",serif; }
.result-hero > em { color: #786f67; font-size: 11px; font-style: normal; letter-spacing: .08em; }

.report-card { margin: 16px 0; padding: clamp(22px, 6vw, 38px); }
.report-card > p { margin: 16px 0 0; color: #d6cab9; font-size: 16px; line-height: 2; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 13px; border-bottom: 1px solid rgba(216,178,109,.15); }
.section-heading span { color: #f0dfc5; font: 700 clamp(20px, 5vw, 27px)/1.35 "Songti SC",serif; }
.section-heading small { color: #9d815b; font-size: 11px; letter-spacing: .08em; }

.radar-card canvas { display: block; width: 100%; height: auto; min-height: 340px; margin: 12px auto 0; }
.radar-legend { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.radar-legend span { display: grid; min-width: 0; padding: 9px 3px; place-items: center; border: 1px solid rgba(218,182,118,.11); border-radius: 10px; background: rgba(7,5,6,.38); }
.radar-legend span.primary-mark { border-color: #c99955; background: rgba(111,28,41,.35); }
.radar-legend span.shadow-mark { border-color: rgba(205,152,81,.45); }
.radar-legend i { color: #c7a36b; font-size: 18px; font-style: normal; }
.radar-legend b { overflow: hidden; color: #dfd0bb; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.radar-legend em { color: #81766b; font-size: 9px; font-style: normal; }

.quote-card,
.mature-force { margin-top: 24px; padding: 18px 19px; border-left: 3px solid #a7343e; background: linear-gradient(90deg, rgba(112,28,40,.24), rgba(45,23,27,.16)); }
.quote-card small, .mature-force small, blockquote small { color: #c49f6a; font-size: 12px; font-weight: 750; letter-spacing: .08em; }
.quote-card > p, .mature-force > p { margin: 9px 0 0; color: #eee0cc; line-height: 1.9; }

.shadow-card h2 { margin: 22px 0 5px; color: #e2bd78; font: 700 28px/1.4 "Songti SC",serif; }
.dual-copy { display: grid; gap: 12px; margin-top: 18px; }
.dual-copy > div { padding: 15px; border: 1px solid rgba(216,178,109,.15); border-radius: 13px; background: rgba(6,5,5,.33); }
.dual-copy b { color: #d7b77d; font-size: 13px; }
.dual-copy p { margin: 7px 0 0; color: #d5c9b8; line-height: 1.85; }

.trigger-grid { display: grid; gap: 12px; margin-top: 20px; }
.trigger-card { padding: 17px; border: 1px solid rgba(214,177,111,.15); border-radius: 15px; background: rgba(8,6,7,.38); }
.trigger-card.strongest { border-color: rgba(214,165,88,.48); box-shadow: inset 0 0 30px rgba(118,28,39,.16); }
.trigger-card > div { display: flex; justify-content: space-between; gap: 12px; }
.trigger-card span { color: #e5d8c4; font-weight: 700; }
.trigger-card b { color: #d6aa64; font-size: 12px; }
.trigger-card > i { display: block; height: 4px; margin: 10px 0 12px; overflow: hidden; border-radius: 999px; background: rgba(230,207,169,.10); }
.trigger-card > i em { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7a2731, #e2b468); }
.band-low { width: 32%; }
.band-mid { width: 66%; }
.band-high { width: 100%; }
.trigger-card p { margin: 0; color: #a99e90; font-size: 13px; line-height: 1.75; }

.action-card blockquote { margin: 26px 0 0; padding: 22px; border: 1px solid rgba(218,178,109,.22); border-radius: 16px; background: radial-gradient(circle at top left, rgba(124,31,42,.28), rgba(12,8,9,.56)); }
.action-card blockquote span { display: block; margin-top: 11px; color: #fff0d7; font: 21px/1.8 "Songti SC",serif; }
.result-actions { display: grid; gap: 10px; margin: 22px 0; }

.error-panel .primary { max-width: 360px; margin: 20px auto 0; justify-content: center; }

.toast {
  position: fixed;
  right: 16px;
  bottom: calc(18px + var(--safe-bottom));
  z-index: 100;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 1px solid rgba(231,194,131,.34);
  border-radius: 12px;
  background: rgba(30,20,17,.96);
  color: #f3dfba;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  transition: opacity .2s ease, transform .2s ease;
  box-shadow: 0 16px 45px rgba(0,0,0,.42);
}
.toast.shown { opacity: 1; transform: none; }
.toast.error { border-color: rgba(226,90,94,.42); background: rgba(70,21,27,.96); color: #ffd8d5; }

@media (max-width: 620px) {
  .scene { padding-inline: 16px; }
  .landing-note { grid-template-columns: 1fr; }
  .landing-note div { min-height: auto; }
  .mark-orbit { width: min(77vw, 360px); }
  .orbit-mark { width: 42px; height: 42px; font-size: 23px; }
  .orbit-1 { top: -21px; left: calc(50% - 21px); }
  .question-card { min-height: 250px; }
  .radar-legend { grid-template-columns: repeat(4, 1fr); }
  .radar-card canvas { min-height: 300px; }
}

@media (max-width: 380px) {
  .answer { grid-template-columns: 36px 1fr 16px; gap: 8px; padding: 12px; }
  .answer i { width: 34px; height: 34px; }
  .progress > i { gap: 2px; }
  .result-hero h1 { font-size: 38px; }
}

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

.reduce-motion *,
.reduce-motion *::before,
.reduce-motion *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
