:root{
  --blue:#7fc4ff; --amber:#ffb070; --green:#8fe0b0; --red:#ff6b6b;
  --ink:#04060a; --muted:rgba(205,222,242,.55);
}
*{box-sizing:border-box}
[hidden]{display:none!important}
html,body{margin:0;height:100%;background:var(--ink);color:#eaf3fc;overflow:hidden;
  font-family:"Noto Sans SC","PingFang SC","Hiragino Sans GB","Microsoft YaHei",system-ui,sans-serif;
  -webkit-font-smoothing:antialiased;}
#scene{position:fixed;inset:0;width:100%;height:100%;display:block;z-index:0;touch-action:none}
button{font:inherit;color:inherit;border:0;background:none;cursor:pointer}

/* HUD */
#hud{position:fixed;top:22px;left:26px;z-index:8;display:flex;flex-direction:column;gap:10px;
  pointer-events:none;filter:drop-shadow(0 2px 12px rgba(0,0,0,.8))}
.hudRow{display:grid;grid-template-columns:74px 38px 150px;align-items:center;gap:8px;
  font-size:11px;letter-spacing:.14em;color:rgba(205,222,242,.55)}
.hudRow b{font:600 15px/1 ui-monospace,Menlo,monospace;color:#eaf3fc;letter-spacing:0;text-align:right}
.hudRow i{height:2px;background:rgba(255,255,255,.12);border-radius:2px;overflow:hidden;display:block}
.hudRow em{display:block;height:100%;background:var(--blue);border-radius:2px;transition:width .55s cubic-bezier(.2,.8,.2,1)}
.hudRow[data-k="workload"] em{background:var(--amber)}
.hudRow[data-k="bonus"] em{background:var(--green)}
.hudRow.flash b{color:var(--amber)}
.hudRow.flash em{filter:brightness(1.8)}

/* subtitle */
#subtitle{position:fixed;left:50%;bottom:30px;transform:translateX(-50%);z-index:7;
  width:min(920px,92vw);text-align:center;pointer-events:none;
  padding:18px 20px 8px;}
#subtitle::before{content:"";position:absolute;inset:0;z-index:-1;
  background:linear-gradient(0deg,rgba(2,4,8,.9) 0%,rgba(2,4,8,.42) 48%,transparent 100%);
  -webkit-mask-image:linear-gradient(0deg,#000 60%,transparent);mask-image:linear-gradient(0deg,#000 60%,transparent);}
.spk{display:flex;align-items:baseline;justify-content:center;gap:14px;
  font-size:11px;letter-spacing:.16em;color:var(--blue);margin-bottom:8px}
.spk b{font-weight:700;font-size:12px}
.spk span{font:10px/1 ui-monospace,Menlo,monospace;color:rgba(205,222,242,.38);letter-spacing:.1em}
#line{margin:0;font-size:clamp(17px,1.9vw,24px);line-height:1.62;min-height:1.7em;white-space:pre-line;
  color:#f4f9ff;text-shadow:0 2px 22px rgba(0,0,0,.9);letter-spacing:.01em}
#line.typing::after{content:"▌";margin-left:3px;color:var(--blue);animation:blink .9s steps(1) infinite}
@keyframes blink{50%{opacity:0}}
#deltas{display:flex;justify-content:center;gap:8px;flex-wrap:wrap;margin-top:10px;min-height:0}
.delta{font:11px/1 ui-monospace,Menlo,monospace;padding:4px 8px;border-radius:4px;background:rgba(255,255,255,.06);color:rgba(220,235,250,.75)}
.delta.up{color:var(--green);background:rgba(143,224,176,.09)}
.delta.down{color:var(--red);background:rgba(255,107,107,.09)}

/* translation */
#translation{position:fixed;left:28px;bottom:170px;z-index:8;max-width:min(380px,46vw);
  padding:12px 15px;border-left:2px solid var(--amber);background:rgba(6,9,14,.82);
  backdrop-filter:blur(10px);border-radius:0 8px 8px 0;animation:rev .3s ease}
@keyframes rev{from{opacity:0;transform:translateY(5px)}}
#translation span{font-size:9px;letter-spacing:.18em;color:var(--amber)}
#translation p{margin:5px 0 0;font-size:12.5px;line-height:1.6;color:rgba(255,232,214,.9)}

/* mobile choices */
#mchoices{display:none}
@media (max-width:820px){
  #mchoices{display:flex;flex-direction:column;gap:7px;position:fixed;left:12px;right:12px;bottom:104px;z-index:8}
  .mchoice{display:flex;align-items:center;gap:10px;text-align:left;padding:10px 12px;
    border:1px solid rgba(127,196,255,.3);border-radius:10px;background:rgba(6,10,16,.9);
    backdrop-filter:blur(12px);color:#eaf4ff;font-size:13px;line-height:1.4}
  .mchoice .mtone{font-size:8px;letter-spacing:.1em;padding:2px 5px;border-radius:4px;
    border:1px solid rgba(255,255,255,.18);color:rgba(230,242,255,.75);white-space:nowrap}
  .mchoice[data-tone="顺着说"] .mtone{color:#ffb070;border-color:rgba(255,176,112,.35)}
  .mchoice[data-tone="挡一下"] .mtone{color:#7fc4ff;border-color:rgba(127,196,255,.4)}
  .mchoice[data-tone="顶回去"] .mtone{color:#ff8c8c;border-color:rgba(255,107,107,.4)}
}

/* tools */
#tools{position:fixed;right:26px;bottom:44px;z-index:9;display:flex;gap:9px;align-items:center}
.ghost{font-size:10px;letter-spacing:.1em;color:rgba(205,225,250,.62);padding:8px 12px;
  border:1px solid rgba(120,180,255,.18);border-radius:999px;background:rgba(4,7,11,.4);
  backdrop-filter:blur(8px);transition:all .2s}
.ghost:hover{border-color:rgba(140,205,255,.5);color:#eaf6ff}
.primary{background:var(--blue);color:#04121c;font-weight:700;font-size:12px;letter-spacing:.08em;
  padding:11px 20px;border-radius:7px;box-shadow:0 0 28px rgba(92,200,255,.22);transition:all .2s}
.primary:hover{background:#a8dcff}
.primary.big{padding:14px 30px;font-size:13px;margin-top:26px}

/* hint */
#hint{position:fixed;left:50%;bottom:142px;transform:translateX(-50%);z-index:7;
  font-size:10px;letter-spacing:.18em;color:rgba(205,225,250,.42);pointer-events:none;
  animation:breathe 2.6s ease-in-out infinite;transition:opacity .4s}
@keyframes breathe{0%,100%{opacity:.35}50%{opacity:.8}}

/* start */
#start{position:fixed;inset:0;z-index:30;display:flex;align-items:center;padding:0 6vw;
  transition:opacity .7s ease}
#start::before{content:"";position:absolute;inset:0;
  background:linear-gradient(90deg,rgba(2,4,8,.96) 0%,rgba(2,4,8,.78) 34%,rgba(2,4,8,.18) 66%,rgba(2,4,8,.5) 100%),
  linear-gradient(0deg,rgba(2,4,8,.9),transparent 46%);}
.startInner{position:relative;z-index:2;max-width:620px}
.kicker{font-size:10px;letter-spacing:.22em;color:var(--blue);margin:0 0 14px}
h1{font-family:"Noto Serif SC","Songti SC",Georgia,serif;font-size:clamp(56px,7.8vw,112px);
  line-height:.95;margin:0 0 24px;font-weight:800;letter-spacing:-.02em}
h1 em{font-style:normal;color:var(--blue);text-shadow:0 0 46px rgba(92,200,255,.35)}
.tagline{font-size:18px;line-height:1.7;color:rgba(230,241,252,.76);margin:0}
.fine{font-size:10px;line-height:1.6;color:rgba(220,235,250,.34);margin:22px 0 0;max-width:430px}
.startFoot{position:absolute;right:28px;bottom:22px;z-index:2;font-size:10px;letter-spacing:.16em;color:rgba(205,222,242,.35)}

/* end */
#end{position:fixed;inset:0;z-index:40;display:grid;place-items:center;padding:24px;
  background:rgba(2,4,8,.82);backdrop-filter:blur(16px)}
.endCard{width:100%;max-width:620px;max-height:88vh;overflow:auto;padding:36px 38px;
  border:1px solid rgba(120,180,255,.2);border-radius:14px;background:rgba(7,11,17,.95);
  box-shadow:0 40px 100px rgba(0,0,0,.65)}
.endCard h2{font-family:"Noto Serif SC","Songti SC",serif;font-size:clamp(32px,5vw,46px);margin:8px 0 14px;color:var(--blue)}
#endText{font-size:14.5px;line-height:1.85;color:rgba(230,241,252,.8);margin:0}
#endStats{display:flex;gap:22px;flex-wrap:wrap;margin:20px 0 6px;font-size:11px;color:var(--muted)}
#endStats b{display:block;font:600 19px/1.3 ui-monospace,Menlo,monospace;color:#eaf3fc;margin-top:3px}
#endSeen{font-size:10px;letter-spacing:.08em;color:rgba(205,222,242,.4)}
.endActions{display:flex;gap:10px;margin-top:22px;flex-wrap:wrap}
#dict{margin-top:20px;padding-top:14px;border-top:1px solid rgba(255,255,255,.08);max-height:36vh;overflow:auto}
.dictItem{margin:12px 0}
.dictItem .q{font-size:12.5px;line-height:1.6;color:#e6f0fa}
.dictItem .a{font-size:11.5px;line-height:1.5;color:var(--amber);margin-top:2px}

@media (max-width:820px){
  #hud{top:12px;left:12px;gap:6px}
  .hudRow{grid-template-columns:40px 24px 62px;gap:5px;font-size:8px;letter-spacing:.08em}
  .hudRow b{font-size:10px}
  #subtitle{bottom:10px;width:96vw;padding:22px 12px 8px}
  .spk{font-size:9px;margin-bottom:5px}
  .spk b{font-size:10px}
  #line{font-size:15px;line-height:1.5}
  #tools{right:10px;top:52px;bottom:auto;gap:6px}
  #next{position:fixed;left:50%;bottom:74px;transform:translateX(-50%);z-index:10;box-shadow:0 0 30px rgba(92,200,255,.35)}
  .ghost{font-size:9px;padding:6px 9px}
  .primary{padding:9px 15px;font-size:11px}
  #hint{bottom:124px;font-size:9px}
  #translation{left:12px;bottom:150px;max-width:calc(100vw - 24px)}
  #start{padding:0 22px;align-items:flex-end;padding-bottom:14vh}
  #start::before{background:linear-gradient(180deg,rgba(2,4,8,.28) 0%,rgba(2,4,8,.55) 38%,rgba(2,4,8,.96) 82%,#020408 100%)}
  h1{font-size:clamp(44px,13vw,64px);margin-bottom:16px}
  .tagline{font-size:14px}
  .primary.big{margin-top:20px;padding:12px 24px}
  .fine{font-size:9px;margin-top:16px}
  .startFoot{display:none}
  #end{padding:12px}
  .endCard{padding:24px 20px}
  .endActions{gap:8px}
}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
