/* ==========================================================
 * pages.css — 应用外壳 / HUD / 导航 / 启动画面 / 各页面布局与动效
 * ========================================================== */
:root {
  --r-ink: #f2788a; /* 深色背景上可读的红色文字 */
}

b, strong, h1, h2, h3, th { font-weight: normal; }
html, body { height: 100%; }
body { overflow: hidden; }
button.chip { border: 0; font-family: inherit; }
:where(a, button, summary, [tabindex]):focus-visible { outline: 4px solid var(--y); outline-offset: 4px; }

b.good { color: var(--l); }
b.warn, b.y { color: var(--y); }
b.bad { color: var(--r-ink); }
b.o { color: var(--o); }
.cyan { color: var(--a); }
mark.hl {
  background: transparent;
  color: var(--y);
  box-shadow: 0 3px 0 0 var(--o);
}
.typing::after {
  content: '▌';
  margin-left: 2px;
  color: var(--y);
  animation: blink .6s steps(1) infinite;
}
.fly-coin { position: absolute; }

/* ---------- 通用像素描边：--bc 外框色，--in 底部暗边 ---------- */
.hud-chip, .hud-lv, .logo-icon, .nav-item, .quest, .node, .digit, .combo,
.lbox, .opt, .b-combo, .spk, .bw, .key, .tb-group, .ach, .seg, .switch, .dist,
.arena, .stage, .pc-stage, .boot-bar, .wr-clock, .g-track, .acc-track, .mcq,
.dot, .spk-face, .q-icon, .node-icon, .ach-icon, .pips, .meter, .play-btn {
  --bc: var(--k);
  --in: rgba(0, 0, 0, .25);
  box-shadow:
    0 -4px 0 0 var(--bc), 0 4px 0 0 var(--bc), -4px 0 0 0 var(--bc), 4px 0 0 0 var(--bc),
    inset 0 -4px 0 0 var(--in);
}

/* ==========================================================
 * 应用外壳
 * ========================================================== */
#app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-areas: "hud hud" "nav view";
  grid-template-columns: var(--nav-w) minmax(0, 1fr);
  grid-template-rows: var(--hud-h) minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
}
#app.booting { visibility: hidden; }
#app.enter #hud { animation: drop-in .5s steps(6) backwards; }
#app.enter #nav { animation: slide-in-l .5s steps(6) .15s backwards; }

#view {
  grid-area: view;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px max(24px, calc((100% - 1360px) / 2)) 64px;
  scroll-padding-top: 20px;
}
#view, .vocab-area, .listen-area, .read-area, .tr-area, .wr-area, .conv-body,
.wr-grid > .wr-main, .wr-side {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 16px;
  min-width: 0;
}
:where(.view) > * { animation: rise-in .4s steps(5) backwards; }
:where(.view > :nth-child(2)) { animation-delay: .06s; }
:where(.view > :nth-child(3)) { animation-delay: .12s; }
:where(.view > :nth-child(4)) { animation-delay: .18s; }
:where(.view > :nth-child(n+5)) { animation-delay: .24s; }

.grid { display: grid; gap: 16px; min-width: 0; }
.grid > * { min-width: 0; }
.home-top { grid-template-columns: 1.25fr 1fr; }
.home-mid, .prof-mid, .prof-bot, .tr-grid { grid-template-columns: 1fr 1fr; }
.read-grid { grid-template-columns: 1.25fr 1fr; align-items: start; }
.cloze-grid { grid-template-columns: 1.4fr 1fr; align-items: start; }
.conv-grid { grid-template-columns: 1fr 1.2fr; align-items: start; }
.wr-grid { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.prof-top { grid-template-columns: minmax(300px, 1fr) 1.6fr; }

/* ==========================================================
 * HUD
 * ========================================================== */
#hud {
  grid-area: hud;
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: rgba(26, 28, 44, .9);
  box-shadow: inset 0 -4px 0 0 var(--e), 0 4px 0 0 rgba(10, 10, 20, .45);
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  width: calc(var(--nav-w) - 20px);
}
.logo-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 4px;
  background: var(--n);
}
.logo-icon .spr { animation: float-y 2.4s steps(6) infinite; }
.logo-text { display: flex; flex-direction: column; gap: 6px; line-height: 1; }
.logo-text .l1 { font-size: 14px; color: var(--y); text-shadow: 3px 3px 0 var(--r); }
.logo-text .l2 { font-size: 10px; color: var(--a); letter-spacing: 4px; }
.logo:hover .l1 { animation: hue-cycle 1s steps(4) infinite; }

.hud-player {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 1 340px;
  min-width: 0;
}
.hud-lv {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin: 4px;
  background: var(--p);
  line-height: 1.2;
  transition: transform .1s steps(2);
}
.hud-lv span { font-size: 8px; color: var(--y); }
.hud-lv b { font-size: 16px; color: var(--w); text-shadow: 2px 2px 0 var(--k); }
.hud-player:hover .hud-lv { transform: translateY(-2px); --bc: var(--y); }
.hud-who { flex: 1; min-width: 0; }
.hud-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
  line-height: 1.3;
}
.hud-name { overflow: hidden; text-overflow: ellipsis; font-size: 16px; color: var(--w); }
.hud-title { font-size: 12px; color: var(--y); }
.hud-xp { display: flex; align-items: center; gap: 8px; }
.hud-xp .bar { flex: 1; height: 12px; }
.hud-xp-text { font-size: 8px; color: var(--s); white-space: nowrap; }
.bar.gain { animation: xp-gain .6s steps(3); }
#hud .bar { background: var(--e); }

.hud-stats { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.hud-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  margin: 4px;
  padding: 0 12px;
  background: var(--panel-2);
  white-space: nowrap;
  transition: transform .1s steps(2);
}
.hud-chip:hover { transform: translateY(-2px); --bc: var(--s); }
.hud-chip b { font-size: 12px; }
.hud-chip .dim { font-size: 13px; }
#hud-coin-icon { display: inline-flex; }
.hud-chip.exam b { color: var(--a); }
.hud-chip.exam.urgent { animation: urgent-pulse 1s steps(2) infinite; }
.hud-chip.streak { filter: grayscale(1); opacity: .7; }
.hud-chip.streak.lit { filter: none; opacity: 1; }
.hud-chip.streak.lit b { color: var(--o); }
.hud-chip.coin b { min-width: 3ch; color: var(--y); }
.hud-chip.coin.bump { animation: coin-bump .3s steps(3); }
.hud-chip.coin.spend { animation: shake-sm .35s steps(5); }
.hud-tools { display: flex; align-items: center; gap: 4px; }
.crt-btn span { font-size: 8px; }

/* ==========================================================
 * 侧边导航
 * ========================================================== */
#nav {
  grid-area: nav;
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 12px 20px 30px;
  overflow-x: hidden;
  overflow-y: auto;
  background: rgba(26, 28, 44, .72);
  box-shadow: inset -4px 0 0 0 var(--e);
}
.nav-cursor {
  position: absolute;
  left: 6px;
  top: calc(var(--cy, -100px) - 13px);
  z-index: 1;
  pointer-events: none;
  transition: top .2s steps(4);
}
.nav-cursor .spr { animation: nudge-x .6s steps(2) infinite; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px;
  padding: 8px 10px;
  background: var(--panel);
  color: var(--s);
  transition: transform .12s steps(3), background .12s steps(2);
}
.nav-item:hover { transform: translateX(4px); background: var(--panel-2); color: var(--w); }
.nav-item.active {
  --bc: var(--y);
  --in: rgba(0, 0, 0, .3);
  transform: translateX(6px);
  background: var(--n);
  color: var(--y);
}
.nav-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, .25);
}
.nav-item.active .nav-icon .spr { animation: var(--spr-anim, none), bob-sm .6s steps(2) infinite; }
.nav-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.35; }
.nav-label { font-size: 15px; white-space: nowrap; }
.nav-en { font-size: 8px; color: var(--d); }
.nav-item.active .nav-en { color: var(--c); }
.kbd {
  flex: none;
  padding: 3px 4px;
  background: rgba(0, 0, 0, .35);
  color: var(--d);
  font: 8px/1 var(--font-pixel);
}
.nav-item.active .kbd { color: var(--y); }

/* ==========================================================
 * 启动画面
 * ========================================================== */
#boot {
  position: fixed;
  inset: 0;
  z-index: 890;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(26, 28, 44, .55);
  text-align: center;
  cursor: var(--cursor-pointer);
}
.boot-inner { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.boot-sprites { display: flex; align-items: flex-end; gap: 28px; min-height: 120px; }
.boot-sprites .b-slime {
  transform-origin: 50% 100%;
  animation: var(--spr-anim, none), squish 1s steps(2) infinite, boot-drop .6s steps(6) .2s backwards;
}
.boot-sprites .b-hero { animation: var(--spr-anim, none), bob 1.2s steps(2) infinite, boot-drop .6s steps(6) .35s backwards; }
.boot-sprites .b-owl { animation: var(--spr-anim, none), float-y 2.4s steps(6) infinite, boot-drop .6s steps(6) .5s backwards; }
.boot-logo { display: flex; flex-direction: column; align-items: center; gap: 18px; margin: 4px 0 0; line-height: 1; }
.boot-logo .bl1 {
  font-size: clamp(36px, 8vw, 84px);
  color: var(--y);
  text-shadow: 6px 6px 0 var(--r), 12px 12px 0 var(--k);
}
.boot-logo .bl2 {
  margin-right: -.4em;
  font-size: clamp(18px, 4vw, 34px);
  color: var(--a);
  letter-spacing: .4em;
  text-shadow: 4px 4px 0 var(--n);
}
.boot-logo span span {
  display: inline-block;
  animation: letter-drop .5s steps(6) backwards, letter-wave 2.4s steps(4) infinite;
}
.boot-sub { font-size: 16px; color: var(--s); text-shadow: 2px 2px 0 var(--k); }
.boot-bar { display: flex; gap: 4px; margin: 8px; padding: 6px; background: var(--k); --bc: var(--s); --in: transparent; }
.boot-bar i { width: 16px; height: 20px; background: var(--e); }
.boot-bar i.on { background: var(--g); box-shadow: inset 0 4px 0 0 var(--l); }
.boot-load { min-height: 52px; font-size: 12px; color: var(--s); }
.boot-load::after { content: ''; display: inline-block; width: 3ch; text-align: left; animation: dots 1.2s steps(1) infinite; }
.boot-start { font: 16px/1.4 var(--font-pixel); animation: pop-in .35s steps(5) backwards, start-blink 1.1s steps(1) .4s infinite; }
.boot-start.pressed { animation: start-press .08s steps(1) 4; }
.boot-foot { font-size: 8px; }

/* ---------- 升级弹窗 ---------- */
.lvup-art { position: relative; display: inline-block; padding: 8px 44px; }
.lvup-star { position: absolute; animation: twinkle 1s steps(2) infinite; }
.lvup-star.s1 { left: 0; top: 12px; }
.lvup-star.s2 { right: 8px; top: 0; animation-delay: .3s; }
.lvup-star.s3 { right: 0; bottom: 14px; animation-delay: .6s; }
.lvup-num { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 12px; font-size: 14px; }
.lvup-num b {
  display: inline-block;
  font-size: 24px;
  color: var(--y);
  text-shadow: 3px 3px 0 var(--r);
  animation: pop-in .4s steps(5) .3s backwards;
}
.lvup-arrow { display: inline-block; color: var(--o); animation: nudge-x .5s steps(2) infinite; }
.lvup-title { margin-bottom: 8px; color: var(--w); }
.lvup-reward { margin-top: 8px; color: var(--y); }

/* ==========================================================
 * 通用部件
 * ========================================================== */
.view > .page-head { margin: 0 0 4px; }
.ph-icon { display: grid; place-items: center; flex: none; width: 72px; height: 72px; }
.page-head .page-title { flex-direction: column; align-items: flex-start; gap: 8px; }
.page-title > span::after { content: '_'; margin-left: 4px; animation: blink 1s steps(1) infinite; }
.ph-right { margin-left: auto; }

.panel { min-width: 0; padding: 18px 20px 20px; }
.mini-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 10px;
  font: 15px/1.4 var(--font-cn);
  color: var(--y);
}
.panel-note { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: -4px 0 12px; font-size: 14px; }
.notice {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px;
  padding: 10px 16px;
  background: rgba(239, 125, 87, .12);
  box-shadow: inset 4px 0 0 0 var(--o);
  color: var(--y);
  font-size: 15px;
}
.toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 4px; }

.seg { --in: transparent; display: inline-flex; gap: 4px; margin: 4px; padding: 4px; background: var(--k); }
.seg-btn {
  padding: 4px 10px;
  border: 0;
  background: transparent;
  color: var(--s);
  font: 14px/1.4 var(--font-cn);
  transition: background .1s steps(2);
}
.seg-btn:hover { color: var(--w); background: var(--e); }
.seg-btn.active { background: var(--c); color: var(--k); box-shadow: inset 0 -3px 0 0 var(--b); }

.switch {
  --in: rgba(0, 0, 0, .35);
  position: relative;
  flex: none;
  width: 56px;
  height: 28px;
  margin: 4px;
  padding: 0;
  border: 0;
  background: var(--e);
  transition: background .15s steps(2);
}
.switch i {
  position: absolute;
  left: 4px;
  top: 4px;
  width: 20px;
  height: 20px;
  background: var(--s);
  box-shadow: inset -4px -4px 0 0 var(--d);
  transition: left .15s steps(3);
}
.switch.on { background: var(--g); }
.switch.on i { left: 32px; background: var(--w); box-shadow: inset -4px -4px 0 0 var(--s); }

.data-table { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 14px; }
.data-table th { padding: 4px 10px; color: var(--y); font-size: 13px; text-align: left; }
.data-table td { padding: 6px 10px; background: var(--panel-2); }
.data-table td:first-child { font: 19px/1.2 var(--font-en); }

.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 10px; color: var(--s); font-size: 13px; }
.lg-item { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; flex: none; width: 12px; height: 12px; }
.sw.l0, .hm-cell.l0 { background: var(--panel-2); }
.sw.l1, .hm-cell.l1 { background: #1d4b39; }
.sw.l2, .hm-cell.l2 { background: #23704a; }
.sw.l3, .hm-cell.l3 { background: #38b764; }
.sw.l4, .hm-cell.l4 { background: #a7f070; }
.sw.m0, .dist .m0 { background: var(--e); }
.sw.m1, .dist .m1 { background: #23704a; }
.sw.m2, .dist .m2 { background: var(--g); }
.sw.m3, .dist .m3 { background: var(--l); }
.sw.ok { background: var(--l); }
.sw.miss { background: var(--r); }
.sw.extra { background: var(--o); }

.answer-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 12px; }
.answer-actions > .btn:last-child { margin-left: auto; }
.quiz-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 16px;
  padding-top: 14px;
  background: linear-gradient(90deg, var(--d) 50%, transparent 0) top / 12px 4px repeat-x;
}
.quiz-foot > .btn:last-child { margin-left: auto; }

.big-en { font-size: 28px; color: var(--y); }
.blank { color: var(--y); letter-spacing: 2px; }
.btn.on { --bg: var(--t); }
.icon-btn.sm { min-width: 32px; height: 32px; padding: 0 4px; }
.speak.on { background: var(--t); color: var(--w); }
.speak.on .spr { animation: bob .4s steps(2) infinite; }

.pips { --in: transparent; display: inline-flex; gap: 3px; margin: 4px; padding: 3px; background: var(--k); }
.pips i { width: 10px; height: 10px; background: var(--e); }
.pips i.on { background: var(--g); }
.pips.m3 i.on { background: var(--l); }

/* ---------- 单选题 ---------- */
.quiz { display: grid; gap: 14px; }
.mcq { margin: 4px; padding: 14px 16px 16px; background: var(--panel-2); }
.mcq.right { --bc: var(--g); }
.mcq.wrong { --bc: var(--r); }
.mcq-q { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; line-height: 1.25; }
.mcq-q .en { font-size: 21px; }
.mcq-n {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  margin-top: 1px;
  background: var(--y);
  color: var(--k);
  font-size: 10px;
}
.mcq-opts { display: grid; gap: 6px; }
.mcq-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 6px 10px;
  border: 0;
  background: var(--panel);
  color: var(--w);
  text-align: left;
  line-height: 1.25;
  box-shadow: inset 0 -3px 0 0 rgba(0, 0, 0, .3);
  transition: transform .1s steps(2), background .1s steps(2);
}
.mcq-opt .en { font-size: 19px; }
.mcq-opt:not([disabled]):hover { transform: translateX(4px); background: var(--e); }
.mcq-opt[disabled] { cursor: default; }
.mcq-l {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  background: var(--k);
  color: var(--s);
  font-size: 9px;
}
.mcq-opt.picked { background: var(--n); box-shadow: inset 4px 0 0 0 var(--y); }
.mcq-opt.picked .mcq-l { background: var(--y); color: var(--k); }
.mcq-opt.ok { background: #1d4b39; box-shadow: inset 4px 0 0 0 var(--l); }
.mcq-opt.ok .mcq-l { background: var(--l); color: var(--k); }
.mcq-opt.bad { background: #4a2433; box-shadow: inset 4px 0 0 0 var(--r); animation: shake-sm .35s steps(5); }
.mcq-opt.bad .mcq-l { background: var(--r); color: var(--w); }
.why {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-top: 10px;
  padding-top: 10px;
  background: linear-gradient(90deg, var(--e) 50%, transparent 0) top / 8px 2px repeat-x;
  color: var(--s);
  font-size: 14px;
  animation: rise-in .4s steps(5) backwards;
}

/* ==========================================================
 * 营地
 * ========================================================== */
.stage {
  position: relative;
  height: 210px;
  margin: 4px 4px 16px;
  overflow: hidden;
  background: linear-gradient(180deg,
    var(--k) 0 22%, #20243f 22% 40%, #262f5a 40% 58%, var(--n) 58% 74%, #31428f 74%);
}
.stage::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 2px;
  background: transparent;
  box-shadow:
    24px 18px var(--w), 70px 46px var(--s), 116px 12px var(--w), 168px 60px var(--s),
    214px 26px var(--w), 262px 70px var(--a), 304px 14px var(--s), 352px 44px var(--w),
    398px 80px var(--s), 446px 20px var(--w), 494px 56px var(--a), 540px 30px var(--s),
    588px 74px var(--w), 46px 88px var(--s), 140px 96px var(--w), 236px 104px var(--s),
    330px 100px var(--w), 520px 104px var(--s), 620px 12px var(--w), 680px 50px var(--s);
  animation: twinkle-sky 2.4s steps(1) infinite;
}
.stage::after {
  content: '';
  position: absolute;
  right: 40px;
  top: 22px;
  width: 28px;
  height: 28px;
  background: var(--y);
  box-shadow: inset -8px -4px 0 0 #e9b765;
  clip-path: polygon(8px 0, 20px 0, 20px 4px, 24px 4px, 24px 8px, 28px 8px, 28px 20px, 24px 20px, 24px 24px,
    20px 24px, 20px 28px, 8px 28px, 8px 24px, 4px 24px, 4px 20px, 0 20px, 0 8px, 4px 8px, 4px 4px, 8px 4px);
}
.stage-ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40px;
  background:
    linear-gradient(90deg, transparent 50%, rgba(26, 28, 44, .3) 50%) 0 20px / 8px 4px repeat-x,
    linear-gradient(90deg, transparent 50%, rgba(26, 28, 44, .3) 50%) 4px 28px / 8px 4px repeat-x,
    linear-gradient(180deg, var(--l) 0 4px, var(--g) 4px 14px, var(--t) 14px);
}
.stage-actors {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 34px;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 40px;
}
.actor {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
}
.actor .shadow { width: 70%; height: 6px; margin-top: -2px; background: rgba(0, 0, 0, .35); }
button.actor:hover .spr { filter: brightness(1.15); }
.actor.hero.jump .spr { animation: var(--spr-anim, none), hero-jump .5s steps(6); }
.actor.fire::after {
  content: '';
  width: 56px;
  height: 10px;
  margin-top: -4px;
  background: repeating-linear-gradient(90deg, var(--p) 0 12px, #431c43 12px 16px);
  box-shadow: inset 0 3px 0 0 #7d3a72, 0 4px 0 0 rgba(0, 0, 0, .3);
}
.actor .glow {
  position: absolute;
  left: 50%;
  bottom: -10px;
  z-index: -1;
  width: 150px;
  height: 56px;
  translate: -50% 0;
  background: radial-gradient(ellipse at center, rgba(239, 125, 87, .45) 0 30%, rgba(239, 125, 87, .2) 30% 55%, transparent 55%);
  pointer-events: none;
  animation: glow-flicker .6s steps(2) infinite;
}
.dialog:hover { --frame: var(--y); }
.dialog-text { flex: 1; min-width: 0; }

/* 考试倒计时 */
.countdown {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px 22px;
  padding: 6px 0 4px;
}
.cd-days, .cd-time { display: flex; align-items: flex-end; gap: 8px; }
.dgroup { display: flex; gap: 8px; }
.digit {
  --bc: var(--e);
  --in: rgba(255, 255, 255, .04);
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 60px;
  margin: 4px;
  background: var(--k);
  color: var(--y);
  font: 28px/1 var(--font-pixel);
  text-shadow: 3px 3px 0 var(--r);
}
.digit::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% - 1px);
  height: 2px;
  background: rgba(0, 0, 0, .6);
}
.digit.flip { animation: flip-digit .3s steps(3); }
.cd-time .digit { width: 28px; height: 40px; color: var(--w); font-size: 16px; text-shadow: 2px 2px 0 var(--r); }
.cd-unit { margin-bottom: 6px; color: var(--s); font-size: 18px; }
.cd-sep { margin-bottom: 12px; color: var(--s); font: 16px/1 var(--font-pixel); animation: blink 1s steps(1) infinite; }
.countdown.urgent .digit { --bc: var(--r); color: var(--r-ink); text-shadow: 3px 3px 0 var(--k); }
.countdown.over .digit { color: var(--d); text-shadow: none; }
.cd-status { margin: 10px 0 4px; color: var(--a); font-size: 15px; text-align: center; }
.cd-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--s);
}
.cd-when { font: 20px/1.2 var(--font-en); }
.exam-parts { display: grid; gap: 4px; }
.ep-row {
  display: grid;
  grid-template-columns: 28px 1fr auto minmax(60px, 1.2fr) 40px;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.ep-pct { color: var(--y); font-size: 9px; text-align: right; }

/* 每日任务 */
.quests { display: grid; gap: 10px; }
.quest {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  margin: 4px;
  padding: 8px 10px;
  background: var(--panel-2);
}
.q-icon { --in: transparent; display: grid; place-items: center; width: 48px; height: 48px; background: var(--k); box-shadow: none; }
.q-name { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 15px; }
.q-done { padding: 3px 5px; background: #1d4b39; color: var(--l); font-size: 8px; }
.q-count { color: var(--s); font-size: 10px; }
.q-chest {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border: 0;
  background: transparent;
}
.q-chest:hover .spr { filter: brightness(1.25); }
.q-rew { color: var(--y); font: 8px/1 var(--font-pixel); }
.quest.ready { --bc: var(--y); }
.quest.ready .q-chest .spr { animation: wiggle .8s steps(4) infinite; }
.quest.ready .q-chest::before {
  content: '!';
  position: absolute;
  top: -12px;
  right: -2px;
  color: var(--y);
  font: 10px/1 var(--font-pixel);
  text-shadow: 2px 2px 0 var(--k);
  animation: bob .6s steps(2) infinite;
}
.quest.claimed { opacity: .65; }
.quest.claimed .q-chest { cursor: default; }

/* 每日一词 */
.wotd-top { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.wotd-word { color: var(--y); font-size: 48px; line-height: 1; text-shadow: 4px 4px 0 var(--p); overflow-wrap: anywhere; }
.wotd-ph { color: var(--s); font-size: 20px; }
.wotd-cn { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 4px 0; font-size: 17px; }
.wotd-ex {
  margin: 12px 0 6px;
  padding: 10px 14px;
  background: var(--k);
  box-shadow: inset 4px 0 0 0 var(--p);
  font-size: 21px;
  line-height: 1.35;
}
.wotd-excn { margin: 0 0 8px; font-size: 14px; }
.wotd-col { display: flex; flex-wrap: wrap; }
.wotd-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 14px; }

/* 冒险地图 */
.map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  padding: 10px 4px 4px;
}
.map::before {
  content: '';
  position: absolute;
  left: 8%;
  right: 8%;
  top: 62px;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--y) 0 8px, transparent 8px 16px);
  opacity: .6;
  animation: march .6s steps(4) infinite;
}
.node {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 4px;
  padding: 16px 10px 12px;
  background: var(--panel-2);
  text-align: center;
  animation: drop-in .45s steps(6) backwards;
  transition: transform .12s steps(3);
}
.node:hover { --bc: var(--y); transform: translateY(-6px); }
.node:hover .node-icon .spr { animation: bob .5s steps(2) infinite; }
.node-no {
  position: absolute;
  top: -10px;
  left: -8px;
  padding: 4px 5px;
  background: var(--r);
  color: var(--w);
  font-size: 8px;
  box-shadow: 0 -2px 0 0 var(--k), 0 2px 0 0 var(--k), -2px 0 0 0 var(--k), 2px 0 0 0 var(--k);
}
.node-icon { --bc: var(--e); --in: transparent; display: grid; place-items: center; width: 72px; height: 64px; margin: 4px; background: var(--k); }
.node-name { margin-top: 6px; color: var(--w); font-size: 15px; line-height: 1.3; }
.node-en { color: var(--c); font-size: 8px; }
.node-desc { min-height: 2.8em; font-size: 12px; line-height: 1.4; }
.node .bar { align-self: stretch; }
.node-prog { font-size: 12px; }

/* ==========================================================
 * 单词森林
 * ========================================================== */
.summary {
  justify-self: center;
  width: min(520px, calc(100% - 16px));
  padding: 24px 24px 20px;
  text-align: center;
}
.sum-title { margin-bottom: 14px; color: var(--y); font-size: 20px; text-shadow: 3px 3px 0 var(--r); }
.sum-title span { display: inline-block; white-space: pre; animation: letter-drop .45s steps(5) backwards; }
.big-stars { justify-content: center; gap: 10px; margin-bottom: 14px; }
.big-stars .spr { animation: stamp-in .4s steps(5) backwards; }
.sum-rows { display: grid; gap: 6px; max-width: 320px; margin: 0 auto 16px; }
.sum-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; background: var(--panel-2); font-size: 15px; }
.sum-row b { font-size: 12px; }
.sum-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }

.flash, .spell { display: grid; gap: 16px; justify-self: center; width: 100%; max-width: 780px; }
.flash-hud { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.fh-prog { display: flex; align-items: center; flex: 1; gap: 12px; min-width: 200px; }
.fh-prog .bar { flex: 1; }
.fh-n { color: var(--y); font-size: 12px; white-space: nowrap; }
.combo { display: inline-flex; align-items: center; gap: 8px; margin: 4px; padding: 6px 12px; background: var(--panel); }
.combo .spr { filter: grayscale(1) brightness(.6); }
.combo .pixel { font-size: 10px; }
.combo > span:last-child { color: var(--w); font-size: 14px; }
.combo.hot { --bc: var(--o); }
.combo.hot .spr { filter: none; }
.combo.hot > span:last-child { color: var(--o); }
.combo.pop { animation: combo-pop .3s steps(3); }

.card-scene { position: relative; height: 360px; perspective: 1200px; }
.fcard {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform .5s steps(8);
  animation: card-in .45s steps(6) backwards;
  cursor: var(--cursor-pointer);
}
.fcard:focus-visible { outline: 4px dashed var(--y); outline-offset: 8px; }
.fcard.flipped { transform: rotateY(180deg); }
.fcard.out-left { animation: out-left .42s steps(6) forwards; }
.fcard.out-up { animation: out-up .42s steps(6) forwards; }
.fcard.out-right { animation: out-right .42s steps(6) forwards; }
.face {
  position: absolute;
  inset: 8px;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 24px;
  overflow: hidden;
  text-align: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.face.back { justify-content: flex-start; padding-top: 60px; transform: rotateY(180deg); }
.fc-top {
  position: absolute;
  top: 12px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.fc-word {
  color: var(--y);
  font-size: 64px;
  line-height: 1;
  text-shadow: 4px 4px 0 var(--k), 8px 8px 0 rgba(0, 0, 0, .25);
  overflow-wrap: anywhere;
}
.fc-ph { color: var(--s); font-size: 22px; }
.fc-hint { position: absolute; bottom: 14px; font-size: 13px; }
.fc-w { margin-right: auto; color: var(--y); font-size: 24px; }
.fc-cn { margin: 2px 0; color: var(--w); font-size: 26px; line-height: 1.3; text-shadow: 3px 3px 0 var(--k); }
.fc-ex { max-width: 580px; margin: 4px 0; font-size: 21px; line-height: 1.3; }
.fc-excn { margin: 0; font-size: 14px; }
.fc-col { display: flex; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.flash-ctrl { display: flex; align-items: center; justify-content: center; min-height: 76px; }
.grade-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; animation: pop-in .3s steps(5); }

/* 拼写 */
.spell-body { display: grid; }
.spell-card { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 24px 20px; text-align: center; }
.sp-cn { display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 8px; font-size: 22px; }
.sp-ex { max-width: 640px; margin: 4px 0 0; font-size: 22px; line-height: 1.35; }
.sp-excn { margin: 0; font-size: 14px; }
.sp-ph { display: flex; align-items: center; gap: 6px; color: var(--s); font-size: 20px; }
.lbox-wrap { position: relative; display: block; margin: 10px 0 4px; cursor: text; }
.lboxes { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.lbox {
  --bc: var(--e);
  --in: rgba(255, 255, 255, .05);
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 52px;
  margin: 4px;
  background: var(--k);
  color: var(--w);
  font: 32px/1 var(--font-en);
}
.lbox.cur { --bc: var(--y); }
.lbox.cur::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 8px;
  height: 4px;
  background: var(--y);
  animation: blink .8s steps(1) infinite;
}
.lbox.typed { animation: typed-pop .18s steps(3); }
.lbox.hinted { --bc: var(--c); color: var(--a); }
.lbox.ok { --bc: var(--g); background: #1d4b39; color: var(--l); animation: lbox-ok .4s steps(4) backwards; }
.lbox.bad { --bc: var(--r); background: #4a2433; color: var(--r-ink); animation: shake-sm .35s steps(5) backwards; }
.ghost-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  opacity: 0;
  font-size: 16px;
  cursor: text;
}
.sp-feedback { min-height: 40px; font-size: 16px; }
.sp-feedback b.good { font: 14px/1.5 var(--font-pixel); }
.sp-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }

/* 词库 */
.list-head { display: grid; gap: 10px; padding: 14px 16px; }
.list-tools { display: flex; align-items: center; gap: 14px; }
.list-tools .search { flex: 1; margin: 4px; }
.dist-wrap { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px 14px; font-size: 14px; }
.dist-wrap .legend { grid-column: 1 / -1; margin-top: 0; }
.dist { --in: transparent; display: flex; gap: 2px; height: 16px; margin: 4px; background: var(--k); }
.dist i { min-width: 4px; height: 100%; }
.dist i:hover { filter: brightness(1.25); }
.wlist { display: grid; gap: 8px; }
.wrow {
  display: grid;
  grid-template-columns: minmax(140px, 1.1fr) minmax(0, 2fr) auto auto auto;
  align-items: center;
  gap: 4px 12px;
  margin: 4px;
  padding: 6px 10px 6px 16px;
  background: var(--panel);
  box-shadow:
    0 -4px 0 0 var(--k), 0 4px 0 0 var(--k), -4px 0 0 0 var(--k), 4px 0 0 0 var(--k),
    inset 4px 0 0 0 var(--e);
  cursor: var(--cursor-pointer);
  transition: transform .1s steps(2);
}
.wrow:hover, .wrow.open {
  background: var(--panel-2);
  box-shadow:
    0 -4px 0 0 var(--k), 0 4px 0 0 var(--k), -4px 0 0 0 var(--k), 4px 0 0 0 var(--k),
    inset 4px 0 0 0 var(--y);
}
.wrow:hover { transform: translateX(4px); }
.wrow .wr-main { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 10px; min-width: 0; }
.wr-w { color: var(--y); font-size: 24px; line-height: 1.1; }
.wr-ph { font-size: 18px; }
.wr-cn { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 15px; }
.wr-cn > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wr-detail {
  display: none;
  grid-column: 1 / -1;
  margin-top: 4px;
  padding: 10px 4px 6px;
  background: linear-gradient(90deg, var(--e) 50%, transparent 0) top / 8px 2px repeat-x;
  cursor: default;
}
.wrow.open .wr-detail { display: block; animation: rise-in .25s steps(4); }
.wr-detail p.en { margin: 0 0 2px; font-size: 20px; line-height: 1.3; }
.wr-detail p.muted { margin: 0 0 6px; font-size: 14px; }
.wb .spr { filter: grayscale(1) brightness(.7); }
.wb.on { background: var(--r); }
.wb.on .spr { filter: none; }

/* ==========================================================
 * Boss 竞技场
 * ========================================================== */
.idle-slime { --idle: squish .9s steps(2) infinite; transform-origin: 50% 100%; }
.idle-golem { --idle: bob 1.4s steps(2) infinite; }
.idle-dragon { --idle: float-y 2s steps(6) infinite; }
.bc-sprite, .b-boss-spr { animation: var(--idle, none); }

.boss-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.boss-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 16px 18px;
  text-align: center;
  animation: drop-in .5s steps(6) backwards;
  transition: transform .12s steps(3);
}
.boss-card:not(.locked):hover { --frame: var(--y); transform: translateY(-6px); }
.bc-stage {
  position: relative;
  align-self: stretch;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 200px;
  margin: 0 -16px 8px;
  padding-bottom: 28px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .04) 50%, transparent 50%) 0 100% / 32px 34px repeat-x,
    linear-gradient(180deg, var(--k) 0 22%, #2b1f3f 22% 42%, #3e2350 42% 62%, var(--e) 62% 84%, #262b47 84%);
}
.bc-sprite { position: relative; z-index: 1; }
.bc-shadow {
  position: absolute;
  bottom: 22px;
  left: 50%;
  width: 112px;
  height: 10px;
  translate: -50% 0;
  background: rgba(0, 0, 0, .4);
}
.boss-card.locked .bc-sprite { filter: brightness(0); opacity: .75; }
.boss-card.locked .bc-name { color: var(--s); }
.bc-lock { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; background: rgba(26, 28, 44, .35); }
.bc-lock .spr { animation: bob 1.2s steps(2) infinite; }
.stamp {
  position: absolute;
  top: 18px;
  right: 14px;
  z-index: 3;
  padding: 6px 10px;
  border: 4px solid var(--l);
  background: rgba(26, 28, 44, .7);
  color: var(--l);
  font-size: 14px;
  transform: rotate(-12deg);
  animation: stamp .45s steps(5) .6s backwards;
}
.bc-name { color: var(--w); font-size: 20px; text-shadow: 2px 2px 0 var(--k); }
.bc-en { color: var(--r-ink); font-size: 9px; }
.boss-card.locked .bc-en { color: var(--d); }
.bc-diff { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.bc-desc { min-height: 3em; margin: 4px 0; font-size: 14px; }
.bc-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  width: 100%;
  margin: 4px 0 8px;
  padding: 10px 12px;
  background: var(--k);
  font-size: 13px;
  text-align: left;
}
.bc-stats span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.bc-stats b.cyan { font-size: 10px; }
.bc-beaten { font-size: 13px; }
.boss-card > .btn.block { margin-top: auto; }
.bc-req {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: auto;
  padding: 10px;
  background: var(--panel-2);
  color: var(--s);
  font-size: 13px;
}
.rules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rules li { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--panel-2); font-size: 14px; }
.rules b { color: var(--o); }
.rules b.y { color: var(--y); }
.kbd-inline { flex: none; padding: 4px 6px; background: var(--k); color: var(--y); font-size: 9px; }

/* 战斗 */
.battle { position: relative; display: grid; gap: 14px; justify-self: center; width: 100%; max-width: 980px; }
.b-top { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; padding: 10px 14px; }
.b-name { display: flex; align-items: center; gap: 10px; min-width: 0; line-height: 1.3; }
.b-name b { color: var(--w); font-size: 17px; }
.b-en { font-size: 8px; }
.b-hp { display: flex; align-items: center; flex: 1; gap: 10px; min-width: 200px; }
.b-hp .bar { flex: 1; height: 20px; }
.hp-text { min-width: 8ch; color: var(--w); font-size: 10px; text-align: right; white-space: nowrap; }
.arena {
  --in: transparent;
  position: relative;
  height: 280px;
  margin: 4px;
  overflow: hidden;
  container-type: inline-size;
  background: linear-gradient(180deg, var(--k) 0 18%, #231d3b 18% 36%, #2f2048 36% 52%, #3e2350 52% 64%, var(--p) 64%);
}
.arena-floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36%;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .05) 50%, transparent 50%) 0 8px / 64px 100%,
    linear-gradient(180deg, var(--d) 0 4px, var(--e) 4px 8px, #262b47 8px);
}
.arena .b-hero, .arena .b-boss {
  position: absolute;
  bottom: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-origin: 50% 100%;
}
.arena .b-hero { left: 16%; z-index: 2; }
.arena .b-boss { right: 14%; z-index: 1; }
.b-boss-spr { transform-origin: 50% 100%; }
.b-shadow { width: 64px; height: 8px; margin-top: -4px; background: rgba(0, 0, 0, .4); }
.b-shadow.wide { width: 140px; }
.b-hero.attack { animation: hero-attack .45s steps(6); }
.b-hero.hurt { animation: hurt .5s steps(5); }
.b-boss.lunge { animation: lunge .5s steps(5); }
.b-boss.enter { animation: boss-enter 1s steps(10) backwards; }
.b-boss-spr.hit { animation: var(--idle, none), boss-hit .35s steps(4); }
.b-hero.down { animation: down .6s steps(5) forwards; }
.b-boss-spr.die { animation: boss-die 1s steps(10) forwards; }
.slash {
  position: absolute;
  left: 50%;
  top: 42%;
  z-index: 3;
  width: 180px;
  height: 10px;
  margin: -5px 0 0 -90px;
  background: var(--w);
  box-shadow: 0 4px 0 0 var(--c), 0 -4px 0 0 var(--a);
  rotate: -35deg;
  pointer-events: none;
  animation: slash .35s steps(5) forwards;
}
.slash.crit { height: 14px; background: var(--y); box-shadow: 0 4px 0 0 var(--o), 0 -4px 0 0 var(--w); }
.slash.crit::after { content: ''; position: absolute; inset: 0; background: inherit; box-shadow: inherit; rotate: 70deg; }

.b-player { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 0 8px; }
.hearts { display: flex; gap: 6px; }
.heart-break { animation: heart-break .5s steps(5); }
.b-combo { display: flex; align-items: center; gap: 8px; margin: 4px; padding: 6px 12px; background: var(--panel); }
.b-combo span { font-size: 9px; }
.b-combo b { color: var(--w); font-size: 16px; }
.b-combo.hot { --bc: var(--o); }
.b-combo.hot b { animation: hue-cycle .8s steps(4) infinite; }
.b-combo.pop { animation: combo-pop .3s steps(3); }

.qwin { padding: 14px 18px 16px; }
.q-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.q-turn { font-size: 9px; }
.q-prompt {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100px;
  padding: 6px 0 8px;
  text-align: center;
}
.qp-word { color: var(--y); font-size: 52px; line-height: 1; text-shadow: 4px 4px 0 var(--k); overflow-wrap: anywhere; }
.qp-cn { color: var(--w); font-size: 26px; text-shadow: 3px 3px 0 var(--k); }
.qp-sent { font-size: 24px; line-height: 1.3; }
.qp-sub { margin-top: 4px; font-size: 15px; }
.qp-sub.en { font-size: 20px; }
.qwin .bar.time { margin: 6px 4px 14px; }
.bar.time > i { transition: none; }
.bar.time.low { --fill: var(--r); }
.bar.time.low > i { animation: blink .4s steps(1) infinite; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px;
  padding: 10px 14px;
  border: 0;
  background: var(--panel-2);
  color: var(--w);
  font: 17px/1.3 var(--font-cn);
  text-align: left;
  animation: pop-in .3s steps(5) backwards;
  transition: transform .1s steps(2), background .1s steps(2);
}
.opt:not([disabled]):hover { --bc: var(--y); transform: translateY(-2px); background: var(--n); }
.opt[disabled] { cursor: default; }
.opt-k { display: grid; place-items: center; flex: none; width: 26px; height: 26px; background: var(--k); color: var(--y); font-size: 10px; }
.opt-en { font-size: 24px; line-height: 1.1; }
.opt.ok { --bc: var(--l); background: var(--g); animation: press-pulse .5s steps(4); }
.opt.bad { background: var(--r); animation: shake-sm .35s steps(5); }
.opt.dim { opacity: .45; }
.b-log { min-height: 28px; margin-top: 10px; color: var(--s); font-size: 15px; text-align: center; }

.result {
  position: absolute;
  inset: -8px;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow-y: auto;
  background-color: rgba(26, 28, 44, .84);
  background-image: radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 6px 6px;
  animation: fade-in .3s steps(3);
}
.result-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(480px, 100%);
  padding: 22px 22px 18px;
  text-align: center;
  animation: pop-in .4s steps(6) backwards;
}
.result-title { color: var(--y); font-size: 26px; text-shadow: 4px 4px 0 var(--r); }
.result.defeat .result-title { color: var(--r-ink); text-shadow: 4px 4px 0 var(--k); }
.result-title span { display: inline-block; white-space: pre; animation: letter-drop .45s steps(5) backwards; }
.result-sub { font-size: 15px; }
.flawless { font-size: 9px; }
.result-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.result-rows > div { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: var(--panel-2); font-size: 14px; }
.result-rows b { color: var(--y); font-size: 12px; }
.result-wrong {
  display: grid;
  gap: 4px;
  width: 100%;
  max-height: 180px;
  overflow-y: auto;
  padding: 8px 10px;
  background: var(--k);
  text-align: left;
}
.rw { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.rw b { color: var(--y); font-size: 22px; }
.rw .muted { flex: 1; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 4px; }

/* ==========================================================
 * 回声山谷
 * ========================================================== */
.eq { display: flex; align-items: flex-end; gap: 3px; height: 40px; }
.eq i { width: 6px; height: 12%; background: var(--c); }
.eq.on i { animation: eq-bounce .5s steps(4) var(--d) infinite alternate; }

.dict { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); align-items: start; gap: 16px; }
.player { padding: 14px 18px 18px; }
.player-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.dots { display: flex; flex-wrap: wrap; gap: 6px; }
.dot {
  --bc: var(--e);
  --in: transparent;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin: 2px;
  padding: 0;
  border: 0;
  background: var(--k);
  color: var(--d);
  font: 9px/1 var(--font-pixel);
}
.dot:hover { color: var(--w); }
.dot.done { background: var(--g); color: var(--w); }
.dot.perfect { background: var(--l); color: var(--k); }
.dot.cur { --bc: var(--k); background: var(--y); color: var(--k); animation: bob .6s steps(2) infinite; }
.player-main { display: flex; align-items: center; gap: 18px; }
.play-btn {
  --in: rgba(0, 0, 0, .3);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: none;
  gap: 6px;
  width: 104px;
  height: 104px;
  margin: 8px;
  border: 0;
  background: var(--b);
  color: var(--w);
  transition: transform .1s steps(2);
}
.play-btn span { font-size: 10px; }
.play-btn:hover { transform: translateY(-2px); filter: brightness(1.12); }
.play-btn:active { transform: translateY(2px); }
.play-btn.on { background: var(--t); }
.play-btn.on::after { content: ''; position: absolute; inset: -4px; pointer-events: none; animation: pulse-ring 1s steps(4) infinite; }
.player-side { display: grid; flex: 1; gap: 10px; min-width: 0; }
.player-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 14px; }
.player-foot { display: grid; justify-items: start; gap: 8px; margin-top: 12px; }
.dict-cn { justify-self: stretch; padding: 8px 12px; background: var(--k); color: var(--s); font-size: 15px; animation: rise-in .3s steps(4); }
.answer { padding: 14px 18px 18px; }
.answer .mini-title { margin-top: 0; }
.dict-input { min-height: 110px; font-size: 24px; }
.answer-tip { font-size: 13px; }
.dict-result { display: grid; gap: 10px; }
.dict-result:empty { display: none; }
.dict-score { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.dict-pct { color: var(--y); font-size: 24px; text-shadow: 3px 3px 0 var(--k); }
.diff-block { padding: 8px 12px; background: var(--k); }
.diff-block > .dim { margin-bottom: 2px; font-size: 12px; }
.diff-block p { margin: 0; }
.diff, .diff-block p.en { font-size: 22px; line-height: 1.45; }
.dw { display: inline-block; animation: pop-in .25s steps(4) backwards; }
.dw.ok { color: var(--l); }
.dw.miss { padding: 0 3px; background: var(--r); color: var(--w); }
.dw.extra { margin-right: 8px; color: var(--o); text-decoration: line-through; }

.conv-pick { display: flex; flex-wrap: wrap; gap: 4px; }
.speakers { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 4px 0 14px; }
.spk {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 120px;
  margin: 4px;
  padding: 12px 8px 10px;
  background: var(--panel-2);
  transition: transform .15s steps(3);
}
.spk-face { --in: rgba(0, 0, 0, .2); display: grid; place-items: center; width: 56px; height: 56px; color: var(--k); font-size: 20px; }
.spk.w .spk-face { background: var(--o); }
.spk.m .spk-face { background: var(--c); }
.spk-name { color: var(--s); font-size: 14px; }
.spk .eq { height: 24px; }
.spk .eq i { width: 5px; }
.spk.w .eq i { background: var(--o); }
.spk.on { --bc: var(--y); transform: translateY(-6px); }
.spk.on .spk-face { animation: bob .4s steps(2) infinite; }
.vs { color: var(--y); font-size: 16px; animation: bob 1s steps(2) infinite; }
.conv-status { margin: 2px 0 8px; font-size: 14px; text-align: center; }
.conv-ctrl { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 10px; }
.transcript { display: grid; gap: 4px; max-height: 320px; margin-top: 14px; padding: 10px; overflow-y: auto; background: var(--k); animation: rise-in .3s steps(4); }
.tl { display: flex; align-items: baseline; gap: 10px; padding: 4px 8px; font-size: 19px; line-height: 1.3; }
.tl b { flex: none; width: 22px; padding: 3px 0; color: var(--k); font-size: 9px; text-align: center; }
.tl b.w { background: var(--o); }
.tl b.m { background: var(--c); }
.tl.cur { background: var(--n); box-shadow: inset 4px 0 0 0 var(--y); }
.conv-score { display: flex; align-items: center; gap: 10px; }
.conv-score b { color: var(--y); font-size: 18px; }

/* ==========================================================
 * 古卷图书馆
 * ========================================================== */
.scroll-win {
  --bg: #f2e6c9;
  --frame: #c9a46e;
  display: flex;
  flex-direction: column;
  margin-top: 22px;
  margin-bottom: 22px;
  padding: 0;
  color: var(--k);
}
.scroll-win::before, .scroll-win::after {
  content: '';
  position: absolute;
  left: -18px;
  right: -18px;
  z-index: 1;
  height: 12px;
  background: linear-gradient(180deg, #d9b47a 0 3px, #8b5e34 3px 9px, #5a3a22 9px);
  box-shadow: 0 -4px 0 0 var(--k), 0 4px 0 0 var(--k), -4px 0 0 0 var(--k), 4px 0 0 0 var(--k);
}
.scroll-win::before { top: -20px; }
.scroll-win::after { bottom: -20px; }
.scroll-win .muted, .scroll-win .dim { color: #6b5a44; }
.doc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 22px 12px;
  background: linear-gradient(90deg, #c9a46e 50%, transparent 0) bottom / 12px 3px repeat-x;
}
.doc-title { color: var(--p); font-size: 28px; line-height: 1.1; }
.doc-sub { margin-top: 4px; font-size: 13px; }
.doc-tools { display: flex; align-items: center; gap: 6px; }
.doc-tools .btn.ghost { --bg: #e3d2ac; --fg: var(--k); text-shadow: none; }
.stopwatch { padding: 4px 8px; background: rgba(0, 0, 0, .07); color: var(--t); font-size: 12px; }
.stopwatch.over { color: var(--r); animation: blink 1s steps(1) infinite; }
.doc { padding: 12px 22px 22px; }
.doc.en, .cloze-text {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.doc.pixel-font { font-family: var(--font-en); font-size: 22px; line-height: 1.45; -webkit-font-smoothing: none; }
.para { position: relative; margin: 0 0 14px; padding: 4px 8px 4px 34px; }
.pno {
  position: absolute;
  left: 0;
  top: 8px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  background: var(--p);
  color: var(--y);
  font-size: 9px;
  line-height: 1;
}
.para.locate { animation: locate 1.6s steps(1); }
.vw { border-bottom: 2px dashed #a0703a; cursor: help; }
.vw:hover { background: var(--y); }
@media (min-width: 1101px) {
  .read-grid .scroll-win {
    position: sticky;
    top: 28px;
    max-height: calc(100vh - var(--hud-h) - 60px);
    max-height: calc(100dvh - var(--hud-h) - 60px);
  }
  .read-grid .doc { flex: 1; min-height: 0; overflow-y: auto; }
}
.read-score { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 13px; }
.rs-main b { color: var(--y); font-size: 20px; }
.locate-btn { font-size: 12px; }

.cloze-text { padding: 12px 22px 22px; line-height: 2.4; }
.cloze-text p { margin: 0 0 12px; }
.slot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 120px;
  height: 34px;
  margin: 0 2px;
  padding: 0 8px 0 5px;
  border: 0;
  vertical-align: middle;
  background: rgba(0, 0, 0, .06);
  box-shadow: inset 0 -3px 0 0 #a0703a;
  color: var(--k);
  font: 20px/1 var(--font-en);
  text-align: left;
  transition: background .1s steps(2);
}
.slot:hover { background: rgba(255, 205, 117, .55); }
.slot-n { display: grid; place-items: center; flex: none; width: 20px; height: 20px; background: var(--p); color: var(--y); font-size: 8px; }
.slot-w { flex: 1; }
.slot.sel { animation: slot-pulse .8s steps(2) infinite; }
.slot.filled { background: var(--n); box-shadow: inset 0 -3px 0 0 var(--k); color: var(--y); }
.slot.land { animation: land .3s steps(3); }
.slot.ok { background: var(--g); color: var(--w); }
.slot.bad { background: var(--r); color: var(--w); animation: shake-sm .35s steps(5); }
.slot.ok .slot-n, .slot.bad .slot-n { background: var(--k); }
.bank-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 14px; }
.cloze-count { color: var(--y); font-size: 11px; }
.bank { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bw {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 4px;
  padding: 6px 8px;
  border: 0;
  background: var(--panel-2);
  color: var(--w);
  font: 19px/1.2 var(--font-en);
  text-align: left;
  transition: transform .1s steps(2), background .1s steps(2);
}
.bw:not(.used):hover { --bc: var(--y); transform: translateY(-2px); background: var(--n); }
.bw .en { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bw-l { display: grid; place-items: center; flex: none; width: 20px; height: 20px; background: var(--k); color: var(--y); font-size: 8px; }
.bw.used { opacity: .4; text-decoration: line-through; }
.cloze-why { display: grid; gap: 6px; margin-top: 12px; }
.cloze-why:empty { display: none; }
.cloze-res { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.cloze-res b { color: var(--y); font-size: 20px; }
.cw {
  display: grid;
  grid-template-columns: 28px auto 1fr;
  align-items: baseline;
  gap: 10px;
  padding: 6px 10px;
  background: var(--panel-2);
  box-shadow: inset 4px 0 0 0 var(--g);
  font-size: 14px;
}
.cw.bad { box-shadow: inset 4px 0 0 0 var(--r); }
.cw-n { color: var(--y); font-size: 9px; }
.cw-a b { color: var(--l); font-size: 19px; }
.cw.bad .cw-a b { color: var(--y); }
.cw-a s { margin-left: 6px; font-size: 17px; }
.cw-why { color: var(--s); }
.fly-word {
  position: fixed;
  z-index: 860;
  padding: 2px 10px;
  background: var(--y);
  color: var(--k);
  font-size: 20px;
  box-shadow: 0 -2px 0 0 var(--k), 0 2px 0 0 var(--k), -2px 0 0 0 var(--k), 2px 0 0 0 var(--k);
  pointer-events: none;
  transition: transform .36s steps(6);
}

/* ==========================================================
 * 译者之塔
 * ========================================================== */
.tr-cn {
  margin: 0 0 6px;
  padding: 12px 16px;
  background: var(--k);
  box-shadow: inset 4px 0 0 0 var(--y);
  color: var(--w);
  font-size: 16px;
  line-height: 1.9;
  text-indent: 2em;
}
.keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.key {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  margin: 4px;
  padding: 8px 30px 8px 10px;
  border: 0;
  background: var(--panel-2);
  color: var(--w);
  text-align: left;
  transition: transform .1s steps(2);
}
.key:hover { transform: translateY(-2px); }
.key-cn { font-size: 15px; line-height: 1.4; }
.key-en { color: var(--a); font-size: 19px; line-height: 1.1; overflow-wrap: anywhere; }
.key-mark {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  background: var(--k);
  color: var(--y);
  font: 9px/1 var(--font-pixel);
}
.key.locked {
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, .04) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, .04) 75%),
    linear-gradient(45deg, rgba(255, 255, 255, .04) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, .04) 75%);
  background-size: 8px 8px;
  background-position: 0 0, 4px 4px;
}
.key.locked .key-en { color: var(--d); letter-spacing: 2px; }
.key.locked .key-mark::before { content: '?'; }
.key.locked:hover { --bc: var(--y); }
.key.hit { --bc: var(--g); }
.key.hit .key-mark { background: var(--g); }
.key.hit .key-mark::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 2px;
  box-shadow: 2px 8px var(--w), 4px 10px var(--w), 6px 12px var(--w), 8px 10px var(--w),
    10px 8px var(--w), 12px 6px var(--w), 14px 4px var(--w),
    2px 6px var(--w), 4px 8px var(--w), 6px 10px var(--w), 8px 8px var(--w), 10px 6px var(--w), 12px 4px var(--w);
}
.key.unlocking { animation: key-unlock .6s steps(6); }
.meter-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 14px; }
.meter-row b { color: var(--y); font-size: 11px; }
.meter { --in: transparent; display: flex; flex: 1; gap: 3px; margin: 4px; padding: 3px; background: var(--k); }
.meter i { flex: 1; height: 12px; background: var(--e); }
.meter i.on { background: var(--g); box-shadow: inset 0 3px 0 0 var(--l); }
.tr-input { min-height: 260px; font-size: 21px; }
.saved { font-size: 13px; }
.tr-result:empty { display: none; }
.ref { padding: 16px 20px 18px; }
.ref .mini-title { margin-top: 0; }
.ref-text { margin: 0 0 14px; padding: 10px 14px; background: var(--k); font-size: 22px; line-height: 1.45; cursor: var(--cursor-pointer); }
.key-review { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.kr { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; background: var(--panel-2); font-size: 14px; }
.kr b { color: var(--a); font-size: 18px; }
.kr-mark { flex: none; width: 10px; height: 10px; background: var(--d); }
.kr.hit .kr-mark { background: var(--l); }
.kr.miss .kr-mark { background: var(--r); }
.rate-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; font-size: 14px; }
.rating { display: inline-flex; gap: 2px; }
.rate-star { padding: 2px; border: 0; background: none; transition: transform .1s steps(2); }
.rate-star .spr { filter: grayscale(1) brightness(.5); }
.rate-star.on .spr, .rating:hover .rate-star .spr { filter: none; }
.rate-star:hover ~ .rate-star .spr { filter: grayscale(1) brightness(.5); }
.rate-star:hover { transform: translateY(-4px) scale(1.1); }

/* ==========================================================
 * 羽毛笔工坊
 * ========================================================== */
.prompt { padding: 14px 18px 16px; }
.prompt-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.prompt p { margin: 8px 0 0; font-size: 21px; line-height: 1.35; }
.editor { padding: 14px 18px 18px; }
.editor-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.wr-timer { display: flex; align-items: center; gap: 8px; }
.wr-clock { --in: transparent; min-width: 6.5ch; margin: 4px; padding: 6px 10px; background: var(--k); color: var(--a); font-size: 18px; text-align: center; }
.wr-clock.running { color: var(--l); }
.wr-clock.urgent { --bc: var(--o); color: var(--y); animation: urgent-blink 1s steps(1) infinite; }
.wr-clock.over { --bc: var(--r); color: var(--r-ink); }
.editor-stat { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.editor-stat b { color: var(--y); font-size: 14px; }
.essay { min-height: 340px; font-size: 21px; line-height: 1.45; }
.gauge { position: relative; display: flex; align-items: center; gap: 12px; margin: 14px 4px 30px; }
.g-track { --in: transparent; position: relative; flex: 1; height: 18px; margin: 4px; background: var(--k); }
.g-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  background: repeating-linear-gradient(45deg, rgba(56, 183, 100, .45) 0 4px, transparent 4px 8px);
  box-shadow: inset 2px 0 0 0 var(--g), inset -2px 0 0 0 var(--g);
}
.g-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--o);
  box-shadow: inset 0 4px 0 0 rgba(255, 255, 255, .3);
  transition: width .3s steps(6), background .1s steps(1);
}
.gauge[data-zone="ok"] .g-fill { background: var(--g); }
.gauge[data-zone="high"] .g-fill { background: var(--r); }
.g-tick { position: absolute; top: 100%; width: 2px; height: 6px; margin: 6px 0 0 -1px; background: var(--d); }
.g-tick em { position: absolute; top: 9px; left: 50%; translate: -50% 0; color: var(--d); font: normal 8px/1 var(--font-pixel); }
.g-mark { min-width: 4ch; color: var(--w); font-size: 14px; text-align: right; }
.g-note { font-size: 14px; }
.g-note.low { color: var(--o); }
.g-note.ok { color: var(--l); }
.g-note.high { color: var(--r-ink); }
.sample-win { padding: 14px 18px; }
.sample-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sample-head .mini-title { margin: 0; }
.sample p { margin: 10px 0 0; font-size: 20px; line-height: 1.4; }
.toolbox { display: grid; gap: 8px; }
.tb-group { margin: 4px; background: var(--panel-2); }
.tb-group summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  list-style: none;
  cursor: var(--cursor-pointer);
  font-size: 15px;
}
.tb-group summary::-webkit-details-marker { display: none; }
.tb-group summary::before { content: '▶'; color: var(--y); font-size: 10px; transition: rotate .15s steps(2); }
.tb-group[open] summary::before { rotate: 90deg; }
.tb-group summary:hover { color: var(--y); }
.tb-en { color: var(--c); font-size: 8px; }
.tb-items { display: grid; gap: 4px; padding: 0 8px 10px; }
.tb-item {
  display: block;
  width: 100%;
  padding: 4px 8px;
  border: 0;
  background: var(--k);
  color: var(--w);
  font: 18px/1.25 var(--font-en);
  text-align: left;
  transition: transform .1s steps(2), background .1s steps(2);
}
.tb-item:hover { transform: translateX(4px); background: var(--n); color: var(--y); }
.fancy-chips { display: flex; flex-wrap: wrap; align-items: center; min-height: 40px; font-size: 14px; }
.fancy-chips .chip { font: 18px/1.2 var(--font-en); }
.score-modal { display: grid; justify-items: center; gap: 10px; }
.sm-total b { color: var(--y); font-size: 40px; text-shadow: 4px 4px 0 var(--r); }
.sm-parts { display: grid; gap: 6px; width: 100%; max-width: 360px; }
.sm-part { display: grid; grid-template-columns: 80px 1fr 40px; align-items: center; gap: 10px; color: var(--w); font-size: 14px; text-align: left; }
.sm-pips { display: flex; gap: 4px; }
.sm-pips i { flex: 1; height: 12px; background: var(--e); }
.sm-pips i.on { background: var(--y); }
.sm-part b { font-size: 10px; text-align: right; }
.sm-meta { font-size: 13px; }
.sm-note { margin: 0; font-size: 12px; }

/* ==========================================================
 * 冒险者档案
 * ========================================================== */
.pc { display: flex; align-items: center; gap: 18px; padding: 18px 20px; }
.pc-stage {
  --in: transparent;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex: none;
  width: 150px;
  height: 170px;
  margin: 4px;
  padding-bottom: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--k) 0 30%, #222a4a 30% 55%, var(--n) 55% 80%, var(--e) 80%);
}
.pc-hero { position: relative; z-index: 1; }
.pc-pedestal {
  position: absolute;
  bottom: 14px;
  left: 50%;
  width: 104px;
  height: 14px;
  translate: -50% 0;
  background: var(--d);
  box-shadow: inset 0 4px 0 0 var(--s), 0 4px 0 0 var(--k);
}
.pc-sparkles i {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--y);
  box-shadow: 4px 0 var(--y), -4px 0 var(--y), 0 4px var(--y), 0 -4px var(--y);
  animation: twinkle 1.6s steps(2) infinite;
  animation-delay: calc(var(--i) * .4s);
}
.pc-sparkles i:nth-child(1) { left: 18px; top: 24px; }
.pc-sparkles i:nth-child(2) { right: 22px; top: 40px; }
.pc-sparkles i:nth-child(3) { left: 28px; top: 92px; }
.pc-sparkles i:nth-child(4) { right: 16px; top: 104px; }
.pc-info { display: grid; flex: 1; gap: 6px; min-width: 0; }
.pc-name-row { display: flex; align-items: center; gap: 6px; }
.pc-name { color: var(--w); font-size: 22px; text-shadow: 3px 3px 0 var(--k); overflow-wrap: anywhere; }
.pc-input { font: 20px/1.4 var(--font-cn); }
.pc-lv { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.pc-lv b { color: var(--y); font-size: 14px; }
.pc-xp { font-size: 9px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: center; gap: 16px; }
.stat .label { display: flex; align-items: center; gap: 6px; }

.hm-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 12px; color: var(--s); font-size: 14px; }
.hm-summary b { color: var(--w); font-size: 12px; }
.hm-summary .btn { margin-left: auto; }
.hm { max-width: 480px; }
.hm-months { display: grid; grid-template-columns: 22px repeat(12, 1fr); gap: 2px; margin-bottom: 4px; color: var(--s); font-size: 11px; line-height: 1.2; }
.hm-months span { overflow: visible; white-space: nowrap; }
.hm-body { display: grid; grid-template-columns: 22px 1fr; gap: 2px; }
.hm-days { display: grid; grid-template-rows: repeat(7, 1fr); align-items: center; gap: 2px; color: var(--s); font-size: 11px; line-height: 1; }
.hm-cols { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; }
.hm-col { display: grid; grid-template-rows: repeat(7, 1fr); gap: 2px; }
.hm-cell { display: block; aspect-ratio: 1; background: var(--panel-2); animation: pop-in .3s steps(4) backwards; }
.hm-cell:not(.future):hover { box-shadow: inset 0 0 0 2px var(--w); }
.hm-cell.today { position: relative; z-index: 1; box-shadow: 0 0 0 2px var(--y); }
.hm-cell.future { background: transparent; box-shadow: inset 0 0 0 1px var(--e); }
.hm-legend { margin-top: 12px; }

.acc { display: grid; gap: 8px; }
.acc-row { display: grid; grid-template-columns: 96px 1fr 92px; align-items: center; gap: 12px; padding: 4px 6px; font-size: 14px; }
.acc-row:hover { background: var(--panel-2); }
.acc-label { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.acc-track { --in: transparent; height: 14px; margin: 4px; background: var(--k); }
.acc-track > i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--c);
  box-shadow: inset 0 3px 0 0 rgba(255, 255, 255, .3);
  transition: width .6s steps(8);
}
.acc-val { font-size: 12px; text-align: right; white-space: nowrap; }
.acc-val b { color: var(--w); font-size: 11px; }

.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.ach {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 4px;
  padding: 14px 10px 12px;
  background: var(--panel-2);
  text-align: center;
  animation: pop-in .35s steps(5) backwards;
  transition: transform .12s steps(3);
}
.ach.got { --bc: var(--y); background: linear-gradient(180deg, #3a3350 0 50%, var(--panel-2) 50%); }
.ach.got:hover, .ach.got:focus-visible { transform: translateY(-4px); }
.ach.got:hover .ach-icon .spr { animation: bob .5s steps(2) infinite; }
.ach-icon { --in: transparent; position: relative; display: grid; place-items: center; width: 64px; height: 56px; margin: 4px; background: var(--k); }
.ach.no .ach-icon > .spr { filter: brightness(0); opacity: .6; }
.ach-lock { position: absolute; right: -8px; bottom: -8px; }
.ach-name { color: var(--y); font-size: 15px; }
.ach.no .ach-name { color: var(--s); }
.ach-desc { font-size: 12px; line-height: 1.4; }
.ach-date { margin-top: 2px; color: var(--s); font-size: 8px; }

.wb-list { display: grid; gap: 6px; max-height: 360px; padding: 4px; overflow-y: auto; }
.wb-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 4px 14px;
  background: var(--panel-2);
  box-shadow: inset 4px 0 0 0 var(--r);
}
.wb-row b { color: var(--y); font-size: 22px; }
.wb-cn { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.wb-row.out { animation: wb-out .3s steps(4) forwards; }

.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 4px;
  background: linear-gradient(90deg, var(--e) 50%, transparent 0) bottom / 12px 2px repeat-x;
}
.set-row:last-child { background: none; }
.set-desc { font-size: 13px; }
.set-row .input { width: auto; max-width: 240px; font-size: 18px; }
.set-row.danger > div > div:first-child { color: var(--r-ink); }
input[type="datetime-local"] { color-scheme: dark; }

/* ==========================================================
 * 关键帧
 * ========================================================== */
@keyframes slide-in-l { from { transform: translateX(-110%); } to { transform: none; } }
@keyframes boot-drop {
  0% { translate: 0 -160px; opacity: 0; }
  70% { translate: 0 8px; opacity: 1; }
  100% { translate: 0 0; opacity: 1; }
}
@keyframes letter-drop {
  0% { translate: 0 -40px; opacity: 0; }
  60% { translate: 0 6px; opacity: 1; }
  100% { translate: 0 0; opacity: 1; }
}
@keyframes letter-wave {
  0%, 50%, 100% { transform: translateY(0); }
  20% { transform: translateY(-10px); }
  35% { transform: translateY(-4px); }
}
@keyframes start-blink { 50% { opacity: .45; } }
@keyframes start-press { 50% { filter: brightness(1.7); } }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
@keyframes twinkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .3; transform: scale(.6); }
}
@keyframes twinkle-sky { 50% { opacity: .55; } }
@keyframes hero-jump {
  0%, 100% { translate: 0 0; }
  35% { translate: 0 -36px; }
  65% { translate: 0 -28px; }
}
@keyframes glow-flicker { 50% { opacity: .6; transform: scale(.92); } }
@keyframes flip-digit {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(.1); filter: brightness(1.6); }
}
@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: translateY(-2px) rotate(-8deg); }
  75% { transform: translateY(-2px) rotate(8deg); }
}
@keyframes card-in {
  0% { transform: translateY(40px) rotate(4deg) scale(.9); opacity: 0; }
  100% { transform: none; opacity: 1; }
}
@keyframes out-left {
  from { transform: rotateY(180deg); opacity: 1; }
  to { transform: translateX(-120%) rotate(-12deg) rotateY(180deg); opacity: 0; }
}
@keyframes out-up {
  from { transform: rotateY(180deg); opacity: 1; }
  to { transform: translateY(-50%) scale(.8) rotateY(180deg); opacity: 0; }
}
@keyframes out-right {
  from { transform: rotateY(180deg); opacity: 1; }
  to { transform: translateX(120%) rotate(12deg) rotateY(180deg); opacity: 0; }
}
@keyframes combo-pop { 50% { transform: scale(1.18) rotate(-3deg); } }
@keyframes typed-pop { 0% { transform: scale(1.3); } 100% { transform: none; } }
@keyframes lbox-ok { 0% { transform: translateY(0); } 50% { transform: translateY(-10px); } 100% { transform: none; } }
@keyframes stamp-in {
  0% { transform: scale(2.6); opacity: 0; }
  70% { transform: scale(.85); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes hero-attack {
  0%, 100% { transform: none; }
  40%, 55% { transform: translateX(28cqw); }
}
@keyframes hurt {
  0%, 100% { transform: none; filter: none; }
  20%, 60% { transform: translateX(-14px); filter: brightness(1.6) sepia(1) hue-rotate(-50deg) saturate(6); }
  40% { transform: translateX(-8px); filter: none; }
}
@keyframes down { to { transform: rotate(-90deg) translateX(-8px); filter: grayscale(1) brightness(.7); } }
@keyframes lunge {
  0%, 100% { transform: none; }
  40%, 55% { transform: translateX(-28cqw); }
}
@keyframes boss-enter {
  0% { transform: translateY(-140%); opacity: 0; }
  60% { transform: translateY(0); opacity: 1; }
  70% { transform: scale(1.08, .88); }
  80%, 100% { transform: none; opacity: 1; }
}
@keyframes boss-hit {
  0%, 100% { translate: 0 0; filter: none; }
  25%, 75% { translate: 12px 0; filter: brightness(3) saturate(0); }
  50% { translate: -6px 0; filter: none; }
}
@keyframes boss-die {
  0% { transform: none; filter: brightness(3) saturate(0); opacity: 1; }
  30% { transform: translateX(6px); filter: none; }
  50% { transform: translateX(-6px); filter: brightness(2); }
  100% { transform: translateY(20px) scale(1.15, .1); filter: brightness(3) saturate(0); opacity: 0; }
}
@keyframes slash {
  0% { scale: 0 1; opacity: 1; }
  50% { scale: 1 1; opacity: 1; }
  100% { scale: 1.2 .2; opacity: 0; }
}
@keyframes heart-break {
  0% { scale: 1.6; filter: brightness(3); }
  50% { scale: 1.2; translate: 0 -6px; }
  100% { scale: 1; translate: 0 0; }
}
@keyframes press-pulse { 40% { transform: scale(1.05); } }
@keyframes eq-bounce { from { height: 12%; } to { height: var(--h); } }
@keyframes locate {
  0%, 40%, 80% { background: rgba(255, 205, 117, .8); }
  20%, 60%, 100% { background: transparent; }
}
@keyframes slot-pulse {
  50% { background: rgba(255, 205, 117, .8); box-shadow: inset 0 -3px 0 0 var(--o), 0 0 0 3px var(--o); }
}
@keyframes land { 0% { transform: scale(1.25); } 100% { transform: none; } }
@keyframes key-unlock {
  0% { transform: none; filter: brightness(2); }
  30% { transform: scale(1.12) rotate(-3deg); }
  60% { transform: scale(.96) rotate(2deg); }
  100% { transform: none; filter: none; }
}
@keyframes wb-out { to { transform: translateX(60px); opacity: 0; } }
@keyframes coin-bump { 50% { transform: translateY(-6px) scale(1.12); } }
@keyframes xp-gain { 30%, 70% { filter: brightness(1.8); } }
@keyframes urgent-pulse { 50% { background: var(--r); } }
@keyframes urgent-blink { 50% { color: var(--o); } }

/* ==========================================================
 * 响应式
 * ========================================================== */
@media (max-width: 1200px) {
  .map { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .map::before { display: none; }
}

@media (max-width: 1100px) {
  .home-top, .home-mid, .prof-top, .prof-mid, .prof-bot, .tr-grid, .read-grid,
  .cloze-grid, .conv-grid, .wr-grid, .dict {
    grid-template-columns: minmax(0, 1fr);
  }
  .hm { max-width: 560px; }
}

@media (max-width: 960px) {
  #app {
    grid-template-areas: "hud" "view" "nav";
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: var(--hud-h) minmax(0, 1fr) auto;
  }
  #app.enter #nav { animation: rise-in .4s steps(5) .15s backwards; }
  #nav {
    flex-direction: row;
    gap: 0;
    padding: 8px 8px 6px;
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: inset 0 4px 0 0 var(--e);
  }
  .nav-item { flex: 1 0 auto; flex-direction: column; gap: 2px; padding: 6px 8px; }
  .nav-item:hover, .nav-item.active { transform: translateY(-2px); }
  .nav-icon { width: 28px; height: 28px; background: none; }
  .nav-text { align-items: center; }
  .nav-label { font-size: 12px; }
  .nav-en, .nav-item .kbd, .nav-cursor { display: none; }
  .logo { width: auto; }
}

@media (max-width: 760px) {
  :root { --hud-h: 64px; }
  #hud { gap: 8px; padding: 0 10px; }
  .logo-text, .hud-xp-text, .hud-title, .hud-chip .dim, .crt-btn { display: none; }
  .logo-icon { width: 36px; height: 36px; }
  .hud-player { flex: 1 1 auto; gap: 8px; }
  .hud-lv { width: 44px; height: 44px; }
  .hud-stats { gap: 4px; }
  .hud-chip { height: 32px; padding: 0 8px; gap: 6px; }
  #toasts { top: 76px; right: 8px; left: 8px; align-items: stretch; }
  .toast { max-width: none; }
  #view { padding: 14px 10px 40px; }
  .boss-grid, .opts { grid-template-columns: minmax(0, 1fr); }
  .map, .stat-grid, .bank { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid { gap: 8px; }
  .card-scene { height: 380px; }
  .fc-word { font-size: 48px; }
  .wrow { grid-template-columns: minmax(0, 1fr) auto auto auto; }
  .wrow .wr-cn { order: 1; grid-column: 1 / -1; }
  .wr-detail { order: 2; }
  .player-main { flex-direction: column; align-items: stretch; }
  .play-btn { align-self: center; }
  .arena { height: 240px; }
  .b-boss-spr { scale: .75; }
  .arena .b-hero { left: 8%; }
  .arena .b-boss { right: 6%; }
  .result-rows { grid-template-columns: minmax(0, 1fr); }
  .pc { flex-direction: column; text-align: center; }
  .pc-info { justify-items: center; width: 100%; }
  .pc-info .bar { justify-self: stretch; }
  .acc-row { grid-template-columns: 80px 1fr 64px; gap: 8px; }
  .acc-val .dim { display: none; }
  .digit { width: 36px; height: 50px; font-size: 22px; }
  .speakers { gap: 8px; }
  .spk { width: 100px; }
  .set-row { flex-wrap: wrap; }
}

@media (max-width: 520px) {
  .hud-chip.streak, .hud-line { display: none; }
  .hud-who { min-width: 40px; }
  .page-title { font-size: 16px; }
  .ph-icon { width: 60px; height: 60px; }
  .digit { width: 30px; height: 44px; font-size: 18px; }
  .cd-time .digit { width: 22px; height: 32px; font-size: 12px; }
  .dgroup { gap: 4px; }
  .ep-row { grid-template-columns: 28px 1fr minmax(48px, 1fr) 36px; }
  .ep-min { display: none; }
  .wotd-word { font-size: 38px; }
  .qp-word { font-size: 40px; }
  .lbox { width: 30px; height: 42px; font-size: 26px; }
  .lboxes { gap: 2px; }
  .stage-actors { gap: 16px; }
  .quest { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .q-icon { width: 40px; height: 40px; }
  .q-count { display: none; }
  .boot-sprites { gap: 10px; scale: .8; }
  .stat .value { font-size: 16px; }
  .modal { padding: 20px 14px 16px; }
  .b-hp { min-width: 0; flex-basis: 100%; }
}
