:root{
  color-scheme:dark;
  --ink:#071019;
  --ink-2:#0d1923;
  --mist:#dce4e8;
  --muted:#9eabb3;
  --amber:#d89b48;
  --gold:#f1b65f;
  --line:rgb(220 228 232/.2);
  --ease:cubic-bezier(.16,1,.3,1);
  font-family:"Avenir Next","Noto Sans",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--ink);color:var(--mist)}
body{overflow:hidden}
button,a{font:inherit}
button{color:inherit}
button:focus-visible,a:focus-visible{outline:2px solid var(--amber);outline-offset:4px}
img{display:block;max-width:100%;-webkit-user-drag:none;user-select:none}

.loader,.error-state{
  position:fixed;z-index:30;inset:0;
  display:grid;place-content:center;gap:18px;text-align:center;
  background:var(--ink);
  transition:opacity .5s var(--ease),visibility .5s;
}
.loader[hidden],.error-state[hidden]{display:none!important}
.loader p,.error-state p{
  margin:0;color:var(--muted);font-size:12px;letter-spacing:.12em;text-transform:uppercase
}
.loader-ring{
  width:78px;aspect-ratio:1;
  border:1px solid var(--line);border-radius:50%;
  background:radial-gradient(circle,var(--amber) 0 4px,transparent 5px);
  animation:pulse 1.8s ease-in-out infinite;
  justify-self:center;
}
.loader-progress{
  width:min(200px,60vw);height:3px;
  border-radius:999px;
  background:var(--line);
  overflow:hidden;
  justify-self:center;
}
.loader-progress span{
  display:block;height:100%;width:0%;
  background:linear-gradient(90deg,var(--amber),var(--gold));
  border-radius:999px;
}
.error-state button{
  justify-self:center;padding:12px 18px;
  border:1px solid var(--line);border-radius:999px;background:transparent;
  color:var(--mist);cursor:pointer;
}
.error-state button:hover{border-color:var(--amber);color:var(--amber)}
body:not(.is-loading) .loader{opacity:0;visibility:hidden}

.topbar{
  position:fixed;z-index:20;top:0;left:50%;
  width:min(calc(100% - 48px),1320px);height:72px;
  display:flex;align-items:center;justify-content:space-between;
  transform:translateX(-50%);
  border-bottom:1px solid var(--line);
}
.brand{
  display:grid;color:var(--mist);text-decoration:none
}
.brand b{font-size:13px;letter-spacing:.12em}
.brand span{margin-top:2px;color:var(--muted);font-size:7px;letter-spacing:.18em}

.language{position:relative}
.language-trigger{
  height:38px;max-width:160px;
  display:flex;align-items:center;gap:9px;
  padding:0 12px;
  border:1px solid var(--line);border-radius:999px;
  background:rgb(7 16 25/.58);backdrop-filter:blur(14px);
  color:var(--mist);cursor:pointer;
}
.language-trigger span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
.language-trigger i{
  width:7px;height:7px;
  border-right:1px solid;border-bottom:1px solid;
  transform:rotate(45deg) translateY(-2px)
}
.language-menu{
  position:absolute;top:46px;inset-inline-end:0;
  width:186px;max-height:min(70vh,430px);
  display:grid;padding:8px 0;
  border:1px solid var(--line);border-radius:16px;
  background:rgb(7 16 25/.9);backdrop-filter:blur(18px);
  opacity:0;visibility:hidden;transform:translateY(-8px);
  transition:opacity .2s var(--ease),transform .2s var(--ease),visibility .2s;
}
.language.is-open .language-menu{opacity:1;visibility:visible;transform:none}
.language-menu button{
  padding:10px 16px;text-align:start;
  background:transparent;border:none;
  color:var(--muted);cursor:pointer;
}
.language-menu button[aria-selected="true"]{color:var(--amber)}
.language-menu button:hover{color:var(--mist);background:rgb(255 255 255/.05)}

.cover{
  position:fixed;inset:0;
  display:grid;place-items:end start;
  overflow:hidden;
}
.cover-media{position:absolute;inset:0}
.cover-media img{
  width:100%;height:100%;object-fit:cover;object-position:center;
  animation:settle 1.7s var(--ease) both;
}
.cover-scrim{
  position:absolute;inset:0;
  background:linear-gradient(0deg,rgb(7 16 25/.96) 0,rgb(7 16 25/.76) 35%,rgb(7 16 25/.28) 70%,rgb(7 16 25/.45));
}
.cover-copy{
  position:relative;z-index:10;
  width:min(680px,100%);padding:0 48px 72px;
}
.kicker{
  margin:0 0 14px;
  color:var(--amber);font-size:11px;font-weight:700;letter-spacing:.18em;text-transform:uppercase;
}
.cover h1{
  margin:0;max-width:14ch;
  font-size:clamp(48px,5.2vw,72px);line-height:1.05;font-weight:800;letter-spacing:-.02em;
}
.cover-copy>p:not(.kicker){
  margin:18px 0 22px;max-width:46ch;
  color:var(--muted);font-size:17px;line-height:1.55;
}

.meta-badges{
  display:flex;gap:10px;margin:24px 0 26px;flex-wrap:wrap;
}
.badge{
  display:grid;gap:2px;
  padding:8px 14px;
  border:1px solid var(--line);border-radius:999px;
  background:rgb(7 16 25/.52);backdrop-filter:blur(10px);
  text-align:center;
}
.badge b{color:var(--mist);font-size:13px;font-weight:700}
.badge small{color:var(--muted);font-size:9px;letter-spacing:.06em}

.listen-button{
  position:relative;
  min-width:330px;min-height:76px;
  display:inline-flex;align-items:center;gap:18px;
  padding:9px 28px 9px 10px;
  border:1px solid var(--amber);border-radius:999px;
  background:var(--amber);color:#101820;
  font-size:17px;font-weight:800;
  box-shadow:0 16px 48px rgb(216 155 72/.2);
  animation:ctaBreathe 2.4s ease-in-out infinite;
  cursor:pointer;
}
.listen-button::before{
  content:"";position:absolute;inset:-12px;border-radius:999px;
}
.listen-button:hover{
  background:#e4aa5b;transform:translateY(-2px);
  box-shadow:0 20px 58px rgb(216 155 72/.3);
}
.receiver{
  position:relative;width:56px;aspect-ratio:1;flex:0 0 56px;
  display:grid;place-items:center;
  border:1px solid rgb(7 16 25/.44);border-radius:50%;
  background:rgb(7 16 25/.9);
}
.receiver i{
  width:16px;height:16px;border-radius:50%;background:var(--gold);
  animation:signal 1.8s ease-in-out infinite;
}
.receiver b{
  position:absolute;inset:-5px;
  border:1px solid rgb(7 16 25/.28);border-radius:50%;
}
.listen-button>span:last-child{white-space:nowrap}

.story{
  position:fixed;inset:0;z-index:5;
  display:grid;
  touch-action:none;overscroll-behavior:none;
  user-select:none;-webkit-user-select:none;
  visibility:hidden;opacity:0;
  transition:opacity .6s var(--ease),visibility .6s;
}
.story.is-active{visibility:visible;opacity:1}
.story-track{
  display:flex;height:100%;width:100%;
  transition:transform .7s var(--ease);
}
.scene{
  position:relative;flex:0 0 100%;height:100%;
  display:grid;place-items:end start;
  overflow:hidden;
}
.scene>img{
  position:absolute;inset:0;width:100%;height:100%;object-fit:cover;
  animation:settle 1.5s var(--ease) both;
}
.scene-shade{
  position:absolute;inset:0;
  background:linear-gradient(0deg,var(--ink) 0,rgb(7 16 25/.88) 30%,rgb(7 16 25/.2) 65%,rgb(7 16 25/.35));
}
.fire-fx{
  position:absolute;inset:0;z-index:2;
  pointer-events:none;overflow:hidden;
}
.flame{
  position:absolute;
  width:84px;height:120px;
  border-radius:50% 50% 50% 50% / 60% 60% 40% 40%;
  background:radial-gradient(ellipse at 50% 75%,rgb(255 220 100/.95) 0 10%,rgb(255 150 40/.7) 30%,rgb(220 80 20/.35) 55%,transparent 70%);
  filter:blur(1.5px) drop-shadow(0 0 8px rgb(255 140 0/.55));
  transform-origin:50% 90%;
  animation:flameFlicker 1.1s ease-in-out infinite alternate;
  opacity:.85;
}
.flame-a{left:19%;top:23%;width:66px;height:96px;animation-duration:1.2s}
.flame-b{left:56%;top:27%;width:48px;height:70px;animation-duration:1s;animation-delay:-.4s}
.flame-c{left:37%;top:33%;width:40px;height:58px;animation-duration:1.15s;animation-delay:-.7s;opacity:.65}
.flame-d{left:76%;top:36%;width:42px;height:62px;animation-duration:.95s;animation-delay:-.2s;opacity:.6}
.flame-e{left:8%;top:41%;width:36px;height:52px;animation-duration:1.05s;animation-delay:-.9s;opacity:.5}
.ember{
  position:absolute;
  width:3px;height:3px;border-radius:50%;
  background:radial-gradient(circle,rgb(255 200 80) 0 30%,transparent 70%);
  box-shadow:0 0 6px rgb(255 140 0/.8);
  opacity:0;
  animation:emberRise 3s linear infinite;
}
.ember.e1{left:21%;top:27%;animation-delay:0s}
.ember.e2{left:24%;top:29%;animation-delay:.4s}
.ember.e3{left:57%;top:31%;animation-delay:.9s}
.ember.e4{left:55%;top:28%;animation-delay:1.5s}
.ember.e5{left:39%;top:37%;animation-delay:2.1s}
.ember.e6{left:78%;top:40%;animation-delay:2.6s}
.ember.e7{left:10%;top:45%;animation-delay:1.2s}
.ember.e8{left:74%;top:38%;animation-delay:.2s}
@keyframes flameFlicker{
  0%{transform:scale(1) translateY(0);opacity:.75}
  25%{transform:scale(1.06) translateY(-4px);opacity:.9}
  50%{transform:scale(.96) translateY(2px);opacity:.8}
  75%{transform:scale(1.08) translateY(-3px);opacity:.92}
  100%{transform:scale(1) translateY(0);opacity:.78}
}
@keyframes emberRise{
  0%{transform:translateY(0) scale(1);opacity:0}
  10%{opacity:.85}
  60%{opacity:.6}
  100%{transform:translateY(-130px) scale(.4);opacity:0}
}

/* 第二页：风暴闪电特效 */
.storm-fx{
  position:absolute;inset:0;z-index:2;
  pointer-events:none;overflow:hidden;
}
.storm-fx .flash{
  position:absolute;inset:0;
  background:radial-gradient(ellipse 70% 55% at 50% 6%,rgb(200 226 255/.85) 0,rgb(150 190 255/.35) 38%,transparent 68%);
  opacity:0;
  animation:flashBurst 7s linear infinite;
}
.storm-fx .bolt{
  position:absolute;
  fill:rgb(238 247 255);
  filter:drop-shadow(0 0 8px rgb(160 205 255/.9)) drop-shadow(0 0 22px rgb(90 150 255/.6));
  opacity:0;
  transform-origin:top center;
  animation:boltStrike 7s linear infinite;
}
.storm-fx .bolt-1{left:30%;top:-3%;height:170px;width:70px}
.storm-fx .bolt-2{left:57%;top:-1%;height:132px;width:54px;animation-delay:.2s}
.storm-fx .bolt-3{left:11%;top:1%;height:104px;width:44px;animation-delay:.36s}
@keyframes flashBurst{
  0%,87%,100%{opacity:0}
  88%{opacity:.9}
  89%{opacity:.12}
  90%{opacity:.72}
  91.5%{opacity:.06}
  93%{opacity:0}
}
@keyframes boltStrike{
  0%,87%,100%{opacity:0;transform:scaleY(.85)}
  88%{opacity:1;transform:scaleY(1)}
  89%{opacity:.2}
  90%{opacity:.95}
  91.5%{opacity:.1}
  93%{opacity:0}
}
.scene-copy{
  position:relative;z-index:10;
  width:min(680px,100%);padding:0 48px 108px;
  max-height:100%;
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-width:none;
}
.scene-copy::-webkit-scrollbar{display:none}
.scene-copy h2{
  margin:0;max-width:18ch;
  font-size:clamp(40px,4.4vw,62px);line-height:1.08;font-weight:800;letter-spacing:-.02em;
}
.scene-copy>p:not(.kicker):not(.choice-result){
  margin:16px 0 0;max-width:48ch;
  color:var(--muted);font-size:16px;line-height:1.55;
}

.route-choice{
  display:flex;gap:12px;margin-top:22px;flex-wrap:wrap;
}
.route-choice button{
  min-width:220px;min-height:88px;
  display:flex;flex-direction:column;justify-content:center;gap:4px;
  padding:16px 18px;
  border:1px solid var(--line);border-radius:16px;
  background:rgb(7 16 25/.42);backdrop-filter:blur(10px);
  color:var(--mist);text-align:start;cursor:pointer;
  transition:border-color .2s,background .2s,transform .2s;
}
.route-choice button:hover,.route-choice button.is-selected{
  border-color:var(--amber);background:rgb(7 16 25/.7);transform:translateY(-2px);
}
.route-choice button b{font-size:15px;font-weight:700}
.route-choice button span{color:var(--muted);font-size:12px;line-height:1.4}
.choice-result{
  margin:14px 0 0;min-height:1.5em;
  color:var(--gold);font-size:14px;font-style:italic;
}
.route-choice.needs-choice{animation:shake .5s ease-in-out}
.next-hint{
  margin:10px 0 0;
  color:var(--amber);font-size:13px;font-style:italic;
  opacity:0;transform:translateY(-6px);
  transition:opacity .3s,transform .3s;
}
.next-hint.is-visible{opacity:1;transform:none}
@keyframes shake{0%,100%{transform:translateX(0)}20%{transform:translateX(-8px)}40%{transform:translateX(8px)}60%{transform:translateX(-4px)}80%{transform:translateX(4px)}}

.last-turn{
  margin-top:24px;
  padding:16px 32px;
  border:1px solid var(--amber);border-radius:999px;
  background:var(--amber);color:#101820;
  font-size:16px;font-weight:800;
  cursor:pointer;
  box-shadow:0 12px 36px rgb(216 155 72/.2);
  transition:transform .2s,background .2s,box-shadow .2s;
}
.last-turn:hover{transform:translateY(-2px);box-shadow:0 16px 44px rgb(216 155 72/.3)}

.final-copy .resolution{display:none}
.final-copy.is-resolved .story-ending{display:none}
.final-copy.is-resolved .resolution{display:block;animation:settle .7s var(--ease) both}

.preview-card{
  margin:22px 0;
  max-width:360px;
  border:1px solid var(--line);border-radius:18px;
  overflow:hidden;background:rgb(7 16 25/.6);
}
.preview-card img{width:100%;height:auto;display:block}

.final-actions{
  display:flex;gap:12px;margin-top:20px;align-items:center;
}
.final-actions a,.final-actions button{
  min-height:50px;
  display:inline-flex;align-items:center;justify-content:center;
  padding:0 28px;
  border-radius:999px;
  font-size:15px;font-weight:700;text-decoration:none;
  cursor:pointer;transition:transform .2s;
}
.final-actions a{
  border:1px solid var(--amber);
  background:var(--amber);color:#101820;
}
.final-actions button{
  border:1px solid var(--line);
  background:transparent;color:var(--mist);
}
.final-actions a:hover,.final-actions button:hover{transform:translateY(-2px)}
.resolution small{
  display:block;margin-top:16px;
  color:var(--muted);font-size:11px;line-height:1.5;
}

.story-controls{
  position:fixed;z-index:15;left:50%;bottom:28px;
  width:min(calc(100% - 96px),620px);height:56px;
  display:grid;grid-template-columns:96px 1fr 96px;align-items:center;gap:16px;
  transform:translateX(-50%);
  border:1px solid var(--line);border-radius:999px;
  background:rgb(7 16 25/.72);backdrop-filter:blur(16px);
  padding:0 8px;
}
.story-controls button{
  height:40px;
  border:1px solid var(--line);border-radius:999px;
  background:transparent;color:var(--mist);
  font-size:12px;font-weight:700;letter-spacing:.04em;
  cursor:pointer;transition:background .2s,border-color .2s;
}
.story-controls button:hover{border-color:var(--amber);color:var(--amber)}
.story-controls button:disabled{opacity:.35;cursor:not-allowed}
.story-controls button.is-locked{
  border-color:var(--amber);color:var(--amber);
  animation:lockPulse 1.8s ease-in-out infinite;
}
@keyframes lockPulse{50%{box-shadow:0 0 0 6px rgb(216 155 72/.12)}}
.chapter-marks{
  display:flex;justify-content:center;gap:10px;
}
.chapter-marks button{
  width:28px;height:4px;padding:0;border:none;border-radius:2px;
  background:var(--line);cursor:pointer;transition:background .3s,height .2s;
}
.chapter-marks button[aria-current="true"]{background:var(--amber);height:6px}

.story-hint{
  position:fixed;z-index:14;left:50%;bottom:92px;
  transform:translateX(-50%);
  display:flex;align-items:center;gap:8px;
  color:var(--muted);font-size:11px;letter-spacing:.06em;
  opacity:0;transition:opacity .4s;
}
.story-hint i{
  width:18px;height:18px;border:1px solid var(--line);border-radius:50%;
  display:grid;place-items:center;
  animation:nudge 1.6s ease-in-out infinite;
}
.story-hint i::before{
  content:"";width:5px;height:5px;border-right:1px solid;border-bottom:1px solid;
  transform:rotate(-45deg) translate(-1px,-1px);
}
.story.is-idle .story-hint{opacity:1}

@keyframes pulse{50%{transform:scale(1.08);border-color:rgb(216 155 72/.55)}}
@keyframes signal{70%{box-shadow:0 0 0 12px rgb(216 155 72/0)}}
@keyframes settle{from{opacity:.25;transform:scale(1.04)}to{opacity:1;transform:none}}
@keyframes nudge{50%{transform:translateX(8px)}}
@keyframes ctaBreathe{50%{box-shadow:0 16px 48px rgb(216 155 72/.2),0 0 0 8px rgb(216 155 72/.1)}}

@media(max-width:760px){
  .topbar{width:calc(100% - 32px);height:62px}
  .brand span{display:none}
  .cover-scrim{
    background:linear-gradient(0deg,rgb(7 16 25/.98) 0,rgb(7 16 25/.82) 38%,transparent 72%);
  }
  .cover-media img{object-position:53% 24%}
  .cover-copy{
    top:auto;left:16px;right:16px;bottom:max(34px,env(safe-area-inset-bottom));
    width:auto;padding:0;transform:none;
  }
  .cover h1{max-width:12ch;font-size:clamp(40px,12.2vw,53px)}
  .cover-copy>p:not(.kicker){margin:17px 0 20px;font-size:14px;line-height:1.5}
  .meta-badges{margin:18px 0 22px}
  .listen-button{width:96%;min-width:0;min-height:72px;justify-content:center;gap:14px;padding:8px 14px 8px 8px;font-size:16px}
  .listen-button .receiver{width:50px;flex:0 0 50px}

  .scene{display:block}
  .scene>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
  .scene-shade{
    background:linear-gradient(0deg,var(--ink) 0,rgb(7 16 25/.91) 32%,rgb(7 16 25/.15) 68%,rgb(7 16 25/.28));
  }
  .scene-copy{
    position:absolute;left:0px;right:0px;bottom:92px;padding:0;
    max-height:calc(100% - 92px - 16px);
    padding-bottom:16px;
    padding: 0 10px;

  }
  .scene-copy h2{max-width:13ch;font-size:clamp(32px,9vw,42px)}
  .scene-copy>p:not(.kicker):not(.choice-result){margin-top:12px;font-size:13px;line-height:1.48}
  .route-choice{gap:8px;margin-top:17px}
  .route-choice button{min-height:84px;padding:13px;min-width:0;flex:1}
  .route-choice span{margin-top:5px}
  .choice-result{margin-top:8px}
  .last-turn{margin-top:19px}
  .final-actions{align-items:stretch;flex-direction:column;gap:9px;margin-top:18px}
  .final-actions a,.final-actions button{width:100%;min-height:46px}
  .preview-card{max-width:100%}
  .resolution small{margin-top:12px}
  .story-controls{width:calc(100% - 32px);height:50px;grid-template-columns:82px 1fr 82px}
  .story-hint{bottom:77px}
  .flame-a{width:52px;height:76px;left:21%;top:25%}
  .flame-b{width:38px;height:56px;left:59%;top:29%}
  .flame-c{width:32px;height:46px;left:38%;top:35%}
  .flame-d{width:34px;height:50px;left:78%;top:38%}
  .flame-e{width:28px;height:42px;left:9%;top:43%}
  .ember{width:2px;height:2px}
  .storm-fx .bolt-1{height:120px;width:52px;left:32%}
  .storm-fx .bolt-2{height:96px;width:40px;left:58%}
  .storm-fx .bolt-3{height:78px;width:34px;left:13%}
}

@media(max-width:370px){
  .cover h1{font-size:39px}
  .cover-copy>p:not(.kicker){font-size:13px}
  .route-choice button{min-height:76px}
  .scene-copy h2{font-size:34px}
  .story-controls{grid-template-columns:72px 1fr 72px}
  .chapter-marks button{width:20px}
}

@media(max-height:720px) and (max-width:760px){
  .cover-copy{bottom:21px}
  .cover h1{font-size:37px}
  .cover-copy>p:not(.kicker){margin:12px 0 15px}
  .scene-copy{bottom:78px;max-height:calc(100% - 78px - 10px)}
  .scene-copy h2{font-size:32px}
  .scene-copy>p:not(.kicker):not(.choice-result){margin-top:10px}
  .route-choice{margin-top:10px}
  .route-choice button{min-height:70px}
  .kicker{margin-bottom:10px}
  .story-controls{bottom:10px}
}

@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
  .loader-ring,.receiver i,.story-hint i{animation:none}
}
