/* ============================================================
   PIXEL TYPING · 复古 8-bit 像素风
   所有颜色集中在 :root，换皮只改这里
   ============================================================ */

:root {
  --bg:        #120e26;
  --bg2:       #1a1440;
  --panel:     #221a4d;
  --panel2:    #2b2160;
  --line:      #6a4fd4;
  --line-soft: #3a2d78;
  --ink:       #ece6ff;
  --dim:       #9a8fc7;
  --gold:      #ffd23f;
  --cyan:      #4ad9ff;
  --pink:      #ff5ca8;
  --green:     #6bff9e;
  --red:       #ff5f6d;
  --shadow:    #0b0819;
  --font: ui-monospace, "Cascadia Mono", Consolas, "Courier New", "Microsoft YaHei", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: none;
  image-rendering: pixelated;
}

/* 像素网格底纹 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(106, 79, 212, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(106, 79, 212, .07) 1px, transparent 1px);
  background-size: 16px 16px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 78%);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- 通用像素框 ---------- */
.px {
  border: 3px solid var(--line);
  box-shadow: 0 0 0 3px var(--shadow), 6px 6px 0 var(--shadow);
  background: var(--panel);
}

/* ============================================================
   主页
   ============================================================ */
.page {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 42px 24px 28px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.hero { text-align: center; margin-bottom: 34px; }

.hero-mark {
  font-size: 26px;
  color: var(--gold);
  text-shadow: 3px 3px 0 var(--shadow);
  margin-bottom: 10px;
  animation: blink 1.6s steps(1) infinite;
}

.logo {
  font-size: 44px;
  letter-spacing: 6px;
  color: var(--ink);
  text-shadow:
     3px 0 0 var(--pink),
    -3px 0 0 var(--cyan),
     0 3px 0 var(--shadow),
     0 0 22px rgba(106, 79, 212, .55);
  margin-bottom: 12px;
}

.hero-sub {
  color: var(--dim);
  font-size: 13px;
  letter-spacing: 1px;
}
.hero-sub .hl { color: var(--gold); }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  margin-bottom: 34px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 3px solid var(--line);
  box-shadow: 0 0 0 3px var(--shadow), 6px 6px 0 var(--shadow);
  transition: transform .08s steps(2), box-shadow .08s steps(2), border-color .1s;
}
.card:hover, .card:focus-visible, .card.sel {
  transform: translate(-3px, -3px);
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--shadow), 9px 9px 0 var(--shadow), 0 0 24px rgba(255, 210, 63, .25);
  outline: none;
}

/* ---------- 卡片缩略像素场景 ---------- */
.thumb {
  position: relative;
  height: 132px;
  overflow: hidden;
  background:
    linear-gradient(var(--bg2), #0e0a22);
  border-bottom: 3px solid var(--line-soft);
}
.t-floor {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 20px;
  background:
    repeating-linear-gradient(90deg, #3a2d78 0 12px, #2a2058 12px 24px);
  border-top: 3px solid #4a3a92;
}
.t-hero {
  position: absolute;
  left: 34px; bottom: 20px;
  width: 26px; height: 34px;
  display: flex; flex-direction: column; align-items: center;
  font-size: 11px; line-height: 12px;
  color: var(--cyan);
}
.t-hero b { color: var(--cyan); font-size: 15px; }
.t-mob {
  position: absolute;
  bottom: 20px;
  width: 24px; height: 24px;
  display: flex; flex-direction: column; align-items: center;
  font-size: 10px; line-height: 10px;
  color: var(--pink);
}
.t-mob b { color: var(--pink); font-size: 13px; }
.t-mob.m1 { left: 128px; animation: float 2.4s steps(2) infinite; }
.t-mob.m2 { left: 186px; bottom: 44px; animation: float 2.4s steps(2) infinite .6s; }
.t-word {
  position: absolute;
  left: 50%; top: 18px;
  transform: translateX(-50%);
  padding: 3px 8px;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--gold);
  background: #171132;
  border: 2px solid var(--line-soft);
}
.t-timer {
  position: absolute;
  left: 12px; right: 12px; top: 8px;
  height: 5px;
  background: var(--line-soft);
}
.t-timer::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 62%;
  background: var(--gold);
  animation: drain 3.4s linear infinite;
}
.thumb-tower .t-hero { left: 50%; margin-left: -13px; }
.thumb-tower .t-floor { height: 26px; }

.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card-body h2 {
  font-size: 21px;
  letter-spacing: 3px;
  margin-bottom: 8px;
  color: var(--gold);
  text-shadow: 2px 2px 0 var(--shadow);
}
.card-sub { font-size: 12px; color: var(--dim); line-height: 1.7; margin-bottom: 12px; }

.tags { list-style: none; display: flex; gap: 8px; margin-bottom: 16px; }
.tags li {
  font-size: 10px;
  padding: 3px 7px;
  color: var(--cyan);
  border: 2px solid var(--line-soft);
  background: #171132;
}

.btn {
  margin-top: auto;
  align-self: flex-start;
  padding: 9px 16px;
  font-size: 13px;
  letter-spacing: 2px;
  color: #171132;
  background: var(--gold);
  border: 3px solid var(--shadow);
  box-shadow: 3px 3px 0 var(--shadow);
}
.card:hover .btn, .card.sel .btn { background: #ffe37a; }

/* ---------- 记录条 ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  padding: 16px;
  background: var(--panel);
  border: 3px solid var(--line-soft);
  box-shadow: 0 0 0 3px var(--shadow), 6px 6px 0 var(--shadow);
  margin-bottom: 22px;
}
.stat { text-align: center; }
.stat-k { display: block; font-size: 10px; color: var(--dim); margin-bottom: 6px; letter-spacing: 1px; }
.stat-v { display: block; font-size: 20px; color: var(--green); text-shadow: 2px 2px 0 var(--shadow); }

.foot { text-align: center; font-size: 11px; color: var(--dim); line-height: 1.9; margin-top: auto; }
.foot .dim { color: #655c8f; }

@keyframes blink { 50% { opacity: .35; } }
@keyframes float { 50% { transform: translateY(-4px); } }
@keyframes drain { from { width: 100%; } to { width: 0%; } }

/* ============================================================
   游戏页
   ============================================================ */
.game {
  position: relative;
  z-index: 1;
  max-width: 940px;
  margin: 0 auto;
  padding: 18px 20px 22px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.topbar { display: flex; align-items: center; gap: 14px; }
.back {
  padding: 6px 12px;
  font-size: 12px;
  color: var(--dim);
  background: var(--panel);
  border: 3px solid var(--line-soft);
  box-shadow: 3px 3px 0 var(--shadow);
}
.back:hover { color: var(--ink); border-color: var(--line); }
.mode-name { font-size: 16px; letter-spacing: 3px; color: var(--gold); text-shadow: 2px 2px 0 var(--shadow); }
.metrics { margin-left: auto; display: flex; gap: 18px; font-size: 12px; color: var(--dim); }
.metrics b { color: var(--ink); font-size: 15px; margin-left: 4px; }
.metrics .wpm b { color: var(--cyan); }
.metrics .acc b { color: var(--green); }
.metrics .combo b { color: var(--gold); }

/* 状态条 */
.bars { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bar-wrap { }
.bar-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--dim); margin-bottom: 5px; }
.bar-label b { color: var(--ink); }
.bar {
  height: 14px;
  background: #0d0a1e;
  border: 3px solid var(--line-soft);
  position: relative;
}
.bar > i {
  position: absolute; inset: 0; right: auto;
  background: var(--green);
  transition: width .12s steps(3);
}
.bar.hp > i { background: linear-gradient(90deg, #ff5f6d, #ff9a5c); }
.bar.time > i { background: linear-gradient(90deg, var(--cyan), #7f8bff); }
.bar.enemy > i { background: linear-gradient(90deg, var(--pink), #b45cff); }
.bar.low > i { animation: barblink .4s steps(1) infinite; }
@keyframes barblink { 50% { opacity: .35; } }

/* 舞台 */
.stage {
  position: relative;
  flex: 1;
  min-height: 260px;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.28) 0 2px, transparent 2px 26px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.22) 0 2px, transparent 2px 34px),
    linear-gradient(#150c26, #22102e 60%, #120a1c);
  border: 3px solid var(--line-soft);
  box-shadow: 0 0 0 3px var(--shadow), 6px 6px 0 var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
}
.stage::after {
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 3px);
}

.enemy-row {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 46px;
  min-height: 96px;
}

.enemy {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: filter .1s;
}
.enemy.hit { animation: shake .18s steps(2); }
.enemy.dying { animation: die .4s steps(4) forwards; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes die { to { transform: translateY(-14px) scale(.7); opacity: 0; filter: brightness(3); } }

/* 敌人：用 CSS 拼的像素小怪 */
.sprite {
  width: 46px; height: 42px;
  position: relative;
  image-rendering: pixelated;
}
.sprite::before, .sprite::after {
  content: "";
  position: absolute;
  background: var(--ec, var(--pink));
  box-shadow:
    8px 0 0 var(--ec, var(--pink)), 0 8px 0 var(--ec, var(--pink)), 8px 8px 0 var(--ec, var(--pink)),
    0 16px 0 var(--ec, var(--pink)), 8px 16px 0 var(--ec, var(--pink)),
    -8px 8px 0 var(--ec, var(--pink)), 16px 8px 0 var(--ec, var(--pink));
}
.sprite::before { left: 18px; top: 10px; width: 8px; height: 8px; box-shadow: 0 8px 0 #120e26, 0 16px 0 var(--ec, var(--pink)); }
.sprite::after { left: 14px; top: 6px; width: 4px; height: 4px; background: #fff; box-shadow: 14px 0 0 #fff; }

.enemy .ename { font-size: 10px; color: var(--dim); letter-spacing: 1px; }
.enemy .eword {
  font-size: 15px;
  letter-spacing: 1px;
  color: var(--ink);
  background: #171132;
  border: 2px solid var(--line-soft);
  padding: 2px 8px;
  white-space: nowrap;
}
.enemy .eword .ok { color: var(--green); }
.enemy .eword .bad { color: var(--red); background: #3a1020; }
.enemy .eword .cur { color: var(--gold); text-decoration: underline; }
.enemy .ehp { width: 66px; height: 6px; background: #0d0a1e; border: 2px solid var(--line-soft); }
.enemy .ehp i { display: block; height: 100%; background: var(--pink); transition: width .15s steps(3); }

.hero-row { display: flex; justify-content: center; align-items: flex-end; min-height: 54px; }
.hero-sprite {
  width: 40px; height: 46px;
  position: relative;
}
.hero-sprite::before {
  content: "";
  position: absolute;
  left: 8px; top: 0;
  width: 24px; height: 24px;
  background: var(--cyan);
  box-shadow:
    0 24px 0 var(--cyan),
    -8px 8px 0 #2b2160, 32px 8px 0 #2b2160,
    -8px 32px 0 var(--cyan), 32px 32px 0 var(--cyan);
}
.hero-sprite::after {
  content: "";
  position: absolute;
  left: 13px; top: 8px;
  width: 4px; height: 4px;
  background: var(--shadow);
  box-shadow: 10px 0 0 var(--shadow);
}
.hero-sprite.attack { animation: lunge .16s steps(2); }
@keyframes lunge { 50% { transform: translateY(-10px) } }

/* 底部输入区 */
.input-area { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.word-display {
  font-size: 32px;
  letter-spacing: 5px;
  padding: 10px 22px;
  background: #171132;
  border: 3px solid var(--line);
  box-shadow: 0 0 0 3px var(--shadow), 5px 5px 0 var(--shadow);
  min-width: 300px;
  text-align: center;
  white-space: pre;
  text-shadow: 2px 2px 0 var(--shadow);
}
.word-display .ok { color: var(--green); }
.word-display .bad { color: var(--red); background: #3a1020; }
.word-display .cur { color: var(--gold); border-bottom: 4px solid var(--gold); }
.word-display .todo { color: #5d5488; }
.hint { font-size: 11px; color: var(--dim); letter-spacing: 1px; min-height: 16px; }
.hint .k { color: var(--gold); }

/* 学习提示 */
.learn {
  position: absolute;
  left: 50%; bottom: 96px;
  transform: translateX(-50%);
  min-width: 200px;
  text-align: center;
  padding: 8px 14px;
  background: #0d0a1e;
  border: 2px solid var(--gold);
  font-size: 12px;
  color: var(--gold);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.learn.show { opacity: 1; }
.learn .w { font-size: 13px; color: var(--ink); }
.learn .cn { color: var(--dim); }

/* 覆盖层：开始 / 结束 / 过关 */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 6, 20, .84);
  padding: 24px;
}
.overlay.hidden { display: none; }
.panel {
  max-width: 460px;
  width: 100%;
  background: var(--panel);
  border: 3px solid var(--line);
  box-shadow: 0 0 0 4px var(--shadow), 10px 10px 0 var(--shadow);
  padding: 26px 28px;
  text-align: center;
}
.panel h2 { font-size: 22px; letter-spacing: 4px; color: var(--gold); margin-bottom: 12px; text-shadow: 2px 2px 0 var(--shadow); }
.panel p { font-size: 13px; color: var(--dim); line-height: 2; }
.panel p b { color: var(--ink); }
.panel .big { font-size: 34px; color: var(--cyan); text-shadow: 2px 2px 0 var(--shadow); margin: 10px 0; }
.panel .actions { margin-top: 20px; display: flex; gap: 12px; justify-content: center; }
.panel .kbd { display: inline-block; padding: 1px 6px; border: 2px solid var(--line-soft); color: var(--ink); font-size: 12px; }
.panel .btn { margin-top: 0; }
.panel .btn.ghost { background: var(--panel2); color: var(--dim); border-color: var(--shadow); }
.panel .btn.ghost:hover { color: var(--ink); }

/* 单词释义卡（过关/结束时的回顾） */
.wordlist { text-align: left; max-height: 180px; overflow-y: auto; margin: 12px 0; font-size: 12px; line-height: 1.9; }
.wordlist div { display: flex; justify-content: space-between; gap: 12px; color: var(--dim); border-bottom: 1px dashed var(--line-soft); padding: 2px 0; }
.wordlist b { color: var(--gold); font-weight: normal; }

/* 消息飘字 */
.float-msg {
  position: absolute;
  font-size: 13px;
  color: var(--gold);
  pointer-events: none;
  animation: floatup .7s steps(5) forwards;
  z-index: 10;
  text-shadow: 2px 2px 0 var(--shadow);
}
@keyframes floatup {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(-34px); opacity: 0; }
}

.enemy.target .eword {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(255, 210, 63, .35);
}
.enemy.target .sprite { filter: drop-shadow(0 0 8px rgba(255, 210, 63, .55)); }
/* 非当前目标的敌人不显示词框：避免玩家以为能打 */
.enemy:not(.target) .eword { display: none; }
.enemy:not(.target) .ehp { opacity: .4; }

.learn .w { font-weight: normal; }

a.btn { display: inline-block; }

/* 屏幕闪红 */
.flash { animation: flashred .22s steps(2); }
@keyframes flashred {
  50% { box-shadow: inset 0 0 0 999px rgba(255, 95, 109, .16); }
}

@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .logo { font-size: 30px; letter-spacing: 2px; }
  .word-display { font-size: 24px; letter-spacing: 2px; min-width: 0; }
  .metrics { gap: 10px; font-size: 11px; }
  .banner span { font-size: 20px; letter-spacing: 3px; }
}

/* ============================================================
   战斗特效层
   ============================================================ */

/* 层数标签 */
.floor-tag {
  position: absolute;
  left: 10px; top: 8px;
  z-index: 6;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--cyan);
  background: #0d0a1e;
  border: 2px solid var(--line-soft);
  padding: 2px 8px;
  text-shadow: 1px 1px 0 var(--shadow);
}

/* 场景随深度变"危险" */
.stage { --dv: 0; }
.stage::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: calc(var(--dv) * 0.1);
  transition: opacity .5s;
  background: radial-gradient(ellipse at 50% 115%, #ff2d55 0%, #b02a6a 45%, transparent 72%);
}

/* 震屏 */
.shake { animation: shakeS .2s steps(2); }
.shake-hard { animation: shakeH .32s steps(3); }
@keyframes shakeS {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-4px, 2px); }
  75% { transform: translate(4px, -2px); }
}
@keyframes shakeH {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-8px, 4px); }
  40% { transform: translate(7px, -5px); }
  60% { transform: translate(-5px, -3px); }
  80% { transform: translate(5px, 4px); }
}

/* 飞弹 */
.proj {
  position: absolute;
  width: 8px; height: 8px;
  margin: -4px 0 0 -4px;
  background: var(--gold);
  z-index: 9;
  pointer-events: none;
  box-shadow: 0 0 9px currentColor, 0 0 18px currentColor;
  animation: flight .16s linear forwards;
}
@keyframes flight {
  from { transform: translate(0, 0) scale(1); opacity: 1; }
  to { transform: translate(var(--dx), var(--dy)) scale(.6); opacity: .25; }
}

/* 粒子爆裂 */
.particle {
  position: absolute;
  width: 5px; height: 5px;
  margin: -2.5px 0 0 -2.5px;
  background: var(--gold);
  z-index: 9;
  pointer-events: none;
  animation: burst .55s cubic-bezier(.2, .8, .3, 1) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes burst {
  from { transform: translate(0, 0) scale(1); opacity: 1; }
  to { transform: translate(var(--dx), var(--dy)) scale(.4); opacity: 0; }
}

/* 伤害数字 */
.dmg {
  position: absolute;
  font-size: 20px;
  font-weight: bold;
  color: var(--gold);
  z-index: 10;
  pointer-events: none;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  text-shadow:
    2px 2px 0 var(--shadow), -1px -1px 0 var(--shadow),
    1px -1px 0 var(--shadow), -1px 1px 0 var(--shadow);
  animation: dmgUp .72s steps(6) forwards;
}
@keyframes dmgUp {
  0% { transform: translate(-50%, -50%) scale(.6); opacity: 0; }
  18% { transform: translate(-50%, -60%) scale(1.25); opacity: 1; }
  40% { transform: translate(-50%, -78%) scale(1); }
  100% { transform: translate(-50%, -140%) scale(.9); opacity: 0; }
}

/* 层横幅 */
.banner {
  position: absolute;
  left: 50%; top: 36%;
  transform: translate(-50%, -50%);
  z-index: 12;
  pointer-events: none;
  text-align: center;
  white-space: nowrap;
  animation: bannerIn 1.2s steps(8) forwards;
}
.banner span {
  display: block;
  font-size: 30px;
  letter-spacing: 6px;
  color: currentColor;
  text-shadow: 3px 3px 0 var(--shadow), 0 0 24px currentColor;
}
.banner em {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  letter-spacing: 3px;
  font-style: normal;
  color: var(--dim);
}
@keyframes bannerIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(1.6); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  75% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -92%) scale(.95); }
}

/* 连击 */
.combo-pop {
  position: absolute;
  right: 14px; top: 44%;
  z-index: 11;
  font-size: 18px;
  letter-spacing: 2px;
  color: var(--gold);
  pointer-events: none;
  text-shadow: 2px 2px 0 var(--shadow), 0 0 14px rgba(255, 210, 63, .8);
  animation: comboIn .8s steps(6) forwards;
}
@keyframes comboIn {
  0% { opacity: 0; transform: translateX(30px) scale(.6); }
  20% { opacity: 1; transform: translateX(0) scale(1.15); }
  60% { opacity: 1; transform: translateX(0) scale(1); }
  100% { opacity: 0; transform: translateX(-14px) scale(.9); }
}

/* 全屏闪光 */
.hit-flash {
  position: absolute;
  inset: 0;
  z-index: 13;
  pointer-events: none;
  background: rgba(255, 255, 255, .5);
  animation: flashOut .3s steps(4) forwards;
}
@keyframes flashOut { from { opacity: 1; } to { opacity: 0; } }

/* 打字反馈 */
.word-display .pop { display: inline-block; animation: charPop .12s steps(2); }
@keyframes charPop { 50% { transform: translateY(-4px) scale(1.25); } }

.word-wrong { animation: wordWrong .2s steps(2); border-color: var(--red) !important; }
@keyframes wordWrong {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  75% { transform: translateX(7px); }
}

/* 敌人受击闪白 + 待机浮动 */
.enemy.hit .sprite { filter: brightness(2.6) saturate(.2); }
.enemy .sprite { animation: bob 1.8s steps(2) infinite; }
@keyframes bob { 50% { transform: translateY(-3px); } }

/* 音效开关 */
.mute-btn {
  background: var(--panel);
  border: 2px solid var(--line-soft);
  color: var(--dim);
  font-size: 12px;
  padding: 2px 7px;
  line-height: 1.2;
  box-shadow: 2px 2px 0 var(--shadow);
}
.mute-btn:hover { border-color: var(--line); }

/* ============================================================
   打字地牢 · 地图 / 战斗 / 装备 / 整句
   ============================================================ */

/* 主页单卡 */
.grid.single { grid-template-columns: 1fr; max-width: 660px; margin-left: auto; margin-right: auto; }
.card-main .thumb { height: 190px; }

.floor-chip {
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 1px;
  border: 2px solid var(--line-soft);
  background: #171132;
  padding: 2px 8px;
}
.floor-tag.boss { color: var(--pink); }

/* ---------- 地图 ---------- */
.map-view {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.map-view.hidden, .battle-view.hidden { display: none; }
.map-title { font-size: 13px; color: var(--dim); letter-spacing: 2px; }
.map-title b { color: var(--gold); }
.map-hint { font-size: 11px; color: #655c8f; letter-spacing: 1px; }

.room-row { display: flex; gap: 14px; justify-content: center; width: 100%; flex-wrap: wrap; }
.room {
  position: relative;
  width: 164px;
  padding: 14px 12px 16px;
  text-align: center;
  background: var(--panel);
  border: 3px solid var(--line-soft);
  box-shadow: 4px 4px 0 var(--shadow);
  cursor: pointer;
  transition: transform .08s steps(2), border-color .1s;
}
.room.sel {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: 4px 4px 0 var(--shadow), 0 0 20px rgba(255, 210, 63, .28);
}
.room.boss { border-color: var(--pink); }
.room.boss.sel { border-color: var(--gold); }
.room-icon { font-size: 26px; line-height: 1.2; color: var(--gold); }
.room.boss .room-icon { color: var(--pink); }
.room-name { font-size: 15px; letter-spacing: 2px; color: var(--ink); margin: 4px 0; }
.room-desc { font-size: 11px; color: var(--dim); line-height: 1.6; }
.room-key { position: absolute; right: 6px; top: 4px; font-size: 10px; color: #655c8f; }

/* ---------- 战斗 ---------- */
.battle-view {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.etag { font-size: 10px; color: var(--dim); letter-spacing: 1px; text-align: center; max-width: 210px; line-height: 1.5; }
.atk-bar { width: 96px; height: 5px; background: #0d0a1e; border: 2px solid var(--line-soft); margin-top: 2px; }
.atk-bar i { display: block; height: 100%; width: 100%; background: var(--red); transition: width .1s linear; }
.atk-bar i.soon { background: var(--gold); animation: barblink .3s steps(1) infinite; }
@keyframes barblink { 50% { opacity: .35; } }
.atk-label { font-size: 10px; color: var(--dim); }
.enemy.lunge { animation: mobLunge .2s steps(2); }
@keyframes mobLunge { 50% { transform: translateY(14px) scale(1.08); } }
.hero-sprite.attack { animation: heroAtk .18s steps(2); }
@keyframes heroAtk { 50% { transform: translateY(-10px); } }

/* ---------- 技能 ---------- */
.skill-bar { display: flex; justify-content: center; }
.skill-chip {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--cyan);
  background: #171132;
  border: 2px solid var(--line-soft);
  padding: 2px 8px;
}
.skill-chip.off { color: #655c8f; border-color: #2a2058; }

/* ---------- 装备栏 ---------- */
.gear-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gear-slot {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 10px;
  background: var(--panel);
  border: 2px solid var(--line-soft);
  min-height: 54px;
}
.gear-slot.filled { border-color: var(--gold); }
.gs-label { font-size: 10px; color: #655c8f; letter-spacing: 1px; }
.gs-name { font-size: 12px; color: var(--ink); }
.gs-affix { font-size: 10px; color: var(--cyan); }
.gs-empty { font-size: 12px; color: #655c8f; }

/* ---------- 整句输入 ---------- */
.word-display.sentence {
  font-size: 17px;
  letter-spacing: 1px;
  line-height: 1.75;
  max-width: 100%;
  white-space: normal;
  padding: 10px 16px;
  text-align: center;
}
.word-display.fog { filter: blur(4px); }

/* ---------- 掉落卡 ---------- */
.gc {
  margin-top: 10px;
  text-align: left;
  padding: 10px 12px;
  background: #171132;
  border: 2px solid var(--line-soft);
}
.gc-tag { font-size: 10px; color: #655c8f; letter-spacing: 1px; }
.gc-name { font-size: 16px; color: var(--gold); margin: 2px 0 6px; }
.gc-affixes { list-style: none; }
.gc-affixes li { font-size: 11px; color: var(--dim); line-height: 1.7; }
.gc-affixes b { color: var(--cyan); font-weight: normal; }
.panel .dim { color: #655c8f; }
.panel .dim b { color: var(--gold); }
.panel .big { font-size: 28px; color: var(--gold); letter-spacing: 3px; margin: 6px 0; }

/* ============================================================
   学习系统扩展 · 偏选择 / 释义房 / 复盘 / 词典
   ============================================================ */

.pref-bar {
  margin: 18px auto 0; max-width: 660px; display: flex; flex-wrap: wrap;
  align-items: center; gap: 8px; padding: 12px 14px;
  background: #171132; border: 2px solid var(--line-soft);
}
.pref-label { font-size: 11px; letter-spacing: 2px; color: #655c8f; }
.pref-btn {
  font-family: inherit; font-size: 12px; cursor: pointer;
  padding: 7px 12px; color: #9a8fc7; background: #120e26;
  border: 2px solid var(--line-soft);
}
.pref-btn:hover { color: var(--cyan); border-color: var(--cyan); }
.pref-btn.on { color: #120e26; background: var(--gold); border-color: var(--gold); }
.pref-note { font-size: 11px; color: #655c8f; margin-left: auto; }

.skill-chip.lookup { color: var(--cyan); border-color: rgba(74, 217, 255, .4); }
.skill-chip.lookup.off { opacity: .35; }

/* 释义挑战房：中文在上，字母进度在下 */
.word-display .meaning {
  display: block; font-size: 26px; color: var(--gold);
  letter-spacing: 2px; margin-bottom: 6px;
}
.word-display .prog { display: block; font-size: 20px; letter-spacing: 3px; }
.word-display.trace {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(255, 210, 63, .22) inset;
}

/* lookup 放大的释义卡 */
.learn.big { transform: translateX(-50%) scale(1.12); transition: transform .15s; }
.learn.big .cn { color: var(--cyan); }

.room.meaning .room-icon { color: var(--cyan); }
.room.root .room-icon { color: var(--gold); }

/* ============================================================
   顶栏（左：生命 / 主题 / 进度 / 学习 · 右：WPM / 准确 / 连击）
   ============================================================ */

.topbar { align-items: center; gap: 12px; }
.tb-left, .tb-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tb-left { flex: 1 1 auto; flex-wrap: wrap; row-gap: 5px; }
.tb-right { flex: 0 0 auto; gap: 14px; }

.hp-inline { display: flex; align-items: center; gap: 6px; }
.hp-inline .bar { width: 110px; height: 12px; }
.hp-inline b { font-size: 11px; color: #cfc6ee; }

.learn-stats { font-size: 10px; color: #6b5f94; letter-spacing: .5px; white-space: nowrap; }

.badges { display: flex; gap: 6px; }
.badge {
  font-family: inherit; font-size: 10px; letter-spacing: 1px;
  padding: 3px 9px; cursor: pointer; border-radius: 3px;
  background: transparent; border: 1px solid; transition: .18s;
}
.badge.boon { color: var(--green); border-color: rgba(107, 255, 158, .45); }
.badge.boon:hover { background: rgba(107, 255, 158, .14); }
.badge.curse { color: var(--pink); border-color: rgba(255, 92, 168, .45); }
.badge.curse:hover { background: rgba(255, 92, 168, .14); }

.mtr { display: flex; align-items: baseline; gap: 5px; }
.mtr i { font-style: normal; font-size: 10px; color: #6b5f94; letter-spacing: 1px; }
.mtr b { font-size: 15px; color: var(--ink); }

.mod-list { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 4px; }
.mod-card { border: 1px solid; padding: 10px 12px; text-align: left; }
.mod-card b { display: block; margin: 4px 0; font-size: 14px; }
.mod-card p { font-size: 12px; color: #a99ccd; margin: 0; }
.mod-card.boon { border-color: rgba(107, 255, 158, .35); background: rgba(107, 255, 158, .05); }
.mod-card.curse { border-color: rgba(255, 92, 168, .35); background: rgba(255, 92, 168, .05); }
.mod-tag { font-size: 10px; letter-spacing: 2px; color: #7a6fa8; }

/* ============================================================
   节点地图（横向分支 + 迷雾 + 拖拽平移）
   ============================================================ */

.map-view { padding: 8px 10px 4px; gap: 0; justify-content: flex-start; min-height: 0; }
.runmap { display: flex; flex-direction: column; width: 100%; flex: 1 1 auto; min-height: 0; --tint: #4ad9ff; }

.rm-flavor {
  flex: 0 0 auto; padding: 0 4px 6px;
  font-size: 11px; font-style: italic; letter-spacing: .5px; color: #5b4f85;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.rm-viewport {
  position: relative; flex: 1 1 auto; overflow: hidden;
  cursor: grab; touch-action: none;
}
.rm-viewport.grabbing { cursor: grabbing; }

.rm-canvas {
  position: absolute; left: 0; top: 0; will-change: transform;
  background:
    linear-gradient(rgba(90, 76, 140, .07) 1px, transparent 1px) 0 0 / 100% 34px,
    linear-gradient(90deg, rgba(90, 76, 140, .07) 1px, transparent 1px) 0 0 / 34px 100%,
    radial-gradient(ellipse 60% 50% at 18% 50%, rgba(74, 217, 255, .05), transparent 72%);
}

.rm-links { position: absolute; left: 0; top: 0; z-index: 1; overflow: visible; }
.rm-links .edge { fill: none; stroke-linecap: round; }
.rm-links .edge.dim { stroke: rgba(88, 74, 132, .4); stroke-width: 2; }
.rm-links .edge.done { stroke: rgba(96, 150, 110, .78); stroke-width: 3; }
.rm-links .edge.open {
  stroke: #7fdcff; stroke-width: 3.4;
  filter: drop-shadow(0 0 5px rgba(127, 220, 255, .55));
}
.rm-links .edge.flow {
  stroke: rgba(255, 255, 255, .85); stroke-width: 2.2;
  stroke-dasharray: 4 12;
  animation: edgeFlow 1.15s linear infinite;
}
@keyframes edgeFlow { to { stroke-dashoffset: -16; } }

.rm-node {
  position: absolute; z-index: 2;
  font-family: inherit; font-size: 20px; line-height: 1;
  background: #120e26; border: 2px solid var(--line-soft);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  opacity: .34; cursor: not-allowed; padding: 0;
  transition: opacity .25s, border-color .2s, transform .15s;
}
.rm-node.done { opacity: .5; border-color: rgba(107, 255, 158, .5); }
.rm-node.done .rm-ic { filter: grayscale(1); }
.rm-node.missed { opacity: .16; }
.rm-node.noavail { opacity: .3; }
.rm-node.fog { opacity: .18; }
.rm-node.avail {
  opacity: 1; cursor: pointer; border-color: var(--cyan);
  animation: nodePulse 1.7s ease-in-out infinite;
}
.rm-node.avail:hover { transform: translateY(-2px); border-color: var(--gold); }
.rm-node.avail.sel {
  border-color: var(--gold); animation: none;
  box-shadow: 0 0 0 3px rgba(255, 210, 63, .3), 0 0 16px rgba(255, 210, 63, .45);
}
.rm-node.boss { font-size: 26px; border-color: rgba(255, 92, 168, .6); transform: scale(1.18); }
.rm-node.boss.avail:hover { transform: scale(1.18) translateY(-2px); }
.rm-node.boss.peek {
  z-index: 5; opacity: .2;
  border-color: rgba(197, 139, 255, .32);
  animation: bossPulse 2.8s ease-in-out infinite;
}
.rm-node.secret { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255, 210, 63, .16); }
.rm-tick {
  position: absolute; right: -7px; top: -9px; font-size: 13px;
  color: var(--green); text-shadow: 0 0 6px rgba(107, 255, 158, .7);
}

/* 迷雾：暗紫渐变 + 左缘羽化 + 网格微透 */
.rm-fog {
  position: absolute; top: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(100deg,
    rgba(46, 17, 76, .88) 0%,
    rgba(38, 13, 66, .84) 34%,
    rgba(31, 11, 56, .78) 66%,
    rgba(24, 8, 42, .62) 90%,
    rgba(19, 6, 34, .28) 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 100%);
  -webkit-backdrop-filter: blur(1.4px);
  backdrop-filter: blur(1.4px);
  animation: fogIn .45s ease-out;
}
.rm-fog.deep {
  background: linear-gradient(100deg,
    rgba(34, 8, 58, .96) 0%,
    rgba(27, 6, 48, .93) 40%,
    rgba(21, 5, 38, .88) 78%,
    rgba(15, 3, 28, .7) 100%);
}

@keyframes fogIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes nodePulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(74, 217, 255, .12), 0 0 8px rgba(74, 217, 255, .18); }
  50%      { box-shadow: 0 0 0 2px rgba(74, 217, 255, .32), 0 0 18px rgba(74, 217, 255, .38); }
}
@keyframes bossPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(197, 139, 255, .18); }
  50%      { box-shadow: 0 0 24px rgba(197, 139, 255, .42); }
}

/* 固定右上角提示 */
.rm-tip {
  position: absolute; right: 10px; top: 8px; z-index: 8;
  max-width: 250px; padding: 7px 10px;
  font-size: 11px; line-height: 1.5; text-align: left; color: #d8d0f2;
  background: rgba(16, 10, 34, .94);
  border: 1px solid rgba(120, 90, 190, .4); border-radius: 4px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
  opacity: 0; transform: translateY(-4px);
  transition: opacity .18s, transform .18s;
  pointer-events: none;
}
.rm-tip.show { opacity: 1; transform: none; }

/* ============================================================
   装备栏 + 词条详情面板
   ============================================================ */

.gear-dock {
  display: flex; gap: 10px; align-items: stretch;
  padding: 8px 10px;
  background: linear-gradient(180deg, #1b1330, #150f27);
  border: 2px solid var(--line-soft);
  border-top-color: rgba(140, 110, 210, .45);
}
.gear-bar {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px; flex: 1 1 auto;
}
.gear-slot {
  font-family: inherit; text-align: left; cursor: pointer;
  min-height: 62px; padding: 6px 9px;
  background: #140e26; color: var(--ink);
  border: 2px dashed rgba(140, 110, 210, .42); border-radius: 5px;
  display: grid; grid-template-columns: auto 1fr;
  grid-template-rows: auto auto; align-items: center; column-gap: 8px;
  transition: background .18s, border-color .18s, box-shadow .18s;
}
.gear-slot:hover { background: #1b1332; border-color: rgba(180, 150, 240, .72); }
.gear-slot.filled {
  border-style: solid; border-color: rgba(197, 139, 255, .85); background: #1a1030;
  box-shadow: inset 0 0 0 1px rgba(197, 139, 255, .18), 0 0 14px rgba(197, 139, 255, .14);
}
.gear-slot.active { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255, 210, 63, .3); }
.gs-label { grid-column: 1 / -1; font-size: 10px; letter-spacing: 2px; color: #7a6fa8; }
.gs-ic { grid-row: 2; font-size: 20px; line-height: 1; }
.gear-slot.filled .gs-ic { color: var(--gold); filter: drop-shadow(0 0 6px rgba(255, 210, 63, .5)); }
.gear-slot:not(.filled) .gs-ic { color: rgba(140, 110, 210, .5); }
.gs-name {
  grid-row: 2; font-size: 12px; color: #e8e0ff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gs-empty { grid-row: 2; font-size: 12px; color: #5b4f85; }

.gear-info {
  flex: 0 0 300px; max-width: 300px; overflow-y: auto;
  padding: 8px 11px; text-align: left;
  background: rgba(28, 20, 52, .92);
  border: 1px solid rgba(140, 110, 210, .35); border-radius: 5px;
}
.gi-head { font-size: 10px; letter-spacing: 2px; color: #7a6fa8; }
.gi-name { font-size: 13px; color: #efe8ff; margin: 4px 0 6px; }
.gi-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.gi-list li { font-size: 11px; line-height: 1.5; color: #b9aede; }
.gi-list b { color: var(--gold); font-weight: normal; margin-right: 6px; }
.gi-list em {
  font-style: normal; color: #7df3ff;
  text-shadow: 0 0 8px rgba(125, 243, 255, .45);
}
.gi-empty { font-size: 11px; color: #5b4f85; padding: 6px 0; }

.bars.hidden, .hidden { display: none !important; }

.rm-hint {
  position: absolute; left: 10px; bottom: 6px; z-index: 6;
  font-size: 10px; letter-spacing: 1px; color: #4a3f72;
  pointer-events: none;
}
/* ============================================================
   地牢主题换肤 · 由 js/themes.js 写入 CSS 变量
   硬性识别色不变：选中黄 / 通关绿勾 / 正向数值亮青 / 诅咒红 / 问号浅灰
   ============================================================ */
.theme-fx {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .8;
}

/* 舞台底色与环境光跟随主题 */
.stage { background: var(--t-stage-bg, #120a1c); }
.stage::before {
  background: radial-gradient(ellipse at 50% 118%,
    var(--t-ambient, rgba(255, 45, 85, .5)) 0%, transparent 70%);
}

/* 地图网格与迷雾材质 */
.rm-canvas { background: var(--t-canvas-bg, none); }
.rm-fog { background: var(--t-fog, rgba(38, 13, 66, .84)); }
.rm-fog.deep { filter: brightness(.7) saturate(1.08); }

/* 连线：可走跟随主题，流动光效跟随主题 */
.rm-links .edge.dim { stroke: rgba(88, 74, 132, .34); }
.rm-links .edge.open {
  stroke: var(--t-flow, #7fdcff);
  filter: drop-shadow(0 0 5px var(--t-glow, rgba(127, 220, 255, .55)));
}
.rm-links .edge.flow { stroke: rgba(255, 255, 255, .85); }

/* 可选节点边框跟随主题，选中一律固定黄光 */
.rm-node.avail { border-color: var(--t-node, var(--cyan)); }
.rm-node.unk .rm-ic { color: #c9c9d6; }

/* 呼吸光 / Boss 紫光跟随主题 */
@keyframes nodePulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--t-glow-weak, rgba(74,217,255,.12)), 0 0 8px var(--t-glow-weak, rgba(74,217,255,.18)); }
  50%      { box-shadow: 0 0 0 2px var(--t-glow, rgba(74,217,255,.32)), 0 0 18px var(--t-glow, rgba(74,217,255,.38)); }
}
@keyframes bossPulse {
  0%, 100% { box-shadow: 0 0 8px var(--t-glow-weak, rgba(197,139,255,.18)); }
  50%      { box-shadow: 0 0 26px var(--t-boss, rgba(197,139,255,.35)); }
}

/* 技能条发光跟随主题 */
.skill-chip { border-color: var(--t-node, rgba(74,217,255,.4)); box-shadow: 0 0 7px var(--t-glow-weak); }

/* 固定识别色：正向亮青 / 诅咒红 */
.badge.boon { color: #7df3ff; border-color: rgba(125, 243, 255, .42); }
.badge.boon:hover { background: rgba(125, 243, 255, .12); }
.badge.curse { color: #ff5f6d; border-color: rgba(255, 95, 109, .46); }
.badge.curse:hover { background: rgba(255, 95, 109, .12); }
.mod-card.curse { border-color: rgba(255, 95, 109, .4); }
.mod-card.curse b { color: #ff5f6d; }
.mod-card.boon b { color: #7df3ff; }
.gi-list em, .gi-list b em { color: #7df3ff; }

/* 主题徽章 */
.theme-badge { display: flex; }
.theme-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: inherit; font-size: 11px; letter-spacing: .06em;
  color: #cfd6ff; background: rgba(70, 60, 120, .3);
  border: 1px solid rgba(120, 110, 190, .5); border-radius: 6px;
  padding: 3px 7px; cursor: pointer; transition: .15s;
}
.theme-chip:hover { border-color: var(--t-flow, #7fdcff); color: #fff; }
.theme-chip .tc-ic { font-size: 13px; color: var(--t-flow, #7fdcff); }
.theme-flavor { font-style: italic; letter-spacing: .04em; margin-top: 10px; }

/* 五套主题的节点质感差异 */
.theme-tech .rm-node { box-shadow: inset 0 0 6px rgba(65, 153, 187, .22); }
.theme-ocean .rm-node { border-radius: 12px; box-shadow: 0 0 12px rgba(115, 215, 240, .2); }
.theme-desert .rm-node { border-style: double; border-width: 3px; border-radius: 4px; }
.theme-forest .rm-node { border-radius: 14px 6px 14px 6px; }
.theme-void .rm-node { border-radius: 50%; box-shadow: 0 0 12px rgba(200, 200, 255, .18); }

/* 海洋主题：整屏轻微上下摆动 */
.theme-ocean .map-view { animation: themeSway 9s ease-in-out infinite; }
@keyframes themeSway {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); }
}
/* ============================================================
   战斗反馈强化：分级光刃 / 连击 / 预警 / 打字手感
   识别色固定：伤害青 #7df3ff、暴击金 #ffd23f、掉血红 #ff5f6d、回血绿 #6bff9e
   ============================================================ */
.proj.blade { height: var(--bw, 8px); border-radius: 3px; box-shadow: 0 0 8px currentColor; }
.proj.blade.lv2 { box-shadow: 0 0 12px currentColor, 0 0 24px currentColor; }
.proj.blade.lv3 { box-shadow: 0 0 16px currentColor, 0 0 36px currentColor; }

.trail {
  position: absolute; width: 4px; height: 4px; margin: -2px 0 0 -2px;
  border-radius: 50%; pointer-events: none; opacity: .8; z-index: 6;
  animation: trailFade .32s ease-out forwards;
}
@keyframes trailFade { from { opacity: .85; transform: scale(1); } to { opacity: 0; transform: scale(.2); } }

.pulse-ring {
  position: absolute; border: 2px solid #7df3ff; border-radius: 50%;
  pointer-events: none; z-index: 7;
  transform: translate(-50%, -50%) scale(.2);
  animation: ringPulse .55s ease-out forwards;
}
@keyframes ringPulse {
  0% { opacity: .95; transform: translate(-50%, -50%) scale(.2); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.7); }
}

.shock {
  position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px;
  border: 3px solid #7df3ff; border-radius: 50%; opacity: .9;
  pointer-events: none; z-index: 7;
  animation: shockOut .6s ease-out forwards;
}
@keyframes shockOut { 0% { transform: scale(.4); opacity: .95; } 100% { transform: scale(7); opacity: 0; } }

.edge-flash {
  position: absolute; inset: 0; pointer-events: none; z-index: 9;
  box-shadow: inset 0 0 70px 14px var(--ec, rgba(255, 60, 80, .55));
  animation: edgeFade .55s ease-out forwards;
}
@keyframes edgeFade { 0% { opacity: 0; } 18% { opacity: 1; } 100% { opacity: 0; } }

/* 连击弹出：3 发光 / 6 放大+脉动 / 10+ 超连击 */
.combo-pop { z-index: 8; transform: translate(-50%, 0); }
.combo-pop.lv2 {
  font-size: 22px; color: #fff; letter-spacing: 1px;
  text-shadow: 0 0 10px currentColor, 0 0 22px var(--t-glow, rgba(127, 220, 255, .6));
  animation: comboPop .9s ease-out forwards, comboPulse .45s ease-in-out infinite alternate;
}
.combo-pop.lv3 {
  font-size: 28px; color: #fff; letter-spacing: 3px;
  text-shadow: 0 0 12px #fff, 0 0 30px var(--t-glow, rgba(127, 220, 255, .8));
  animation: comboPop 1.1s ease-out forwards, comboPulse .4s ease-in-out infinite alternate;
}
@keyframes comboPulse { from { opacity: .8; } to { opacity: 1; } }

/* 击杀：图标炸开消散 */
.enemy.dying .sprite { animation: mobDie .6s ease-out forwards; }
@keyframes mobDie {
  0% { transform: scale(1); filter: brightness(2); }
  45% { transform: scale(1.25); filter: brightness(3) blur(1px); }
  100% { transform: scale(.2); opacity: 0; filter: brightness(1) blur(2px); }
}

/* 攻击预警：最后 0.5 秒怪物红光脉动 */
.enemy.danger .sprite { animation: dangerPulse .34s ease-in-out infinite alternate; }
@keyframes dangerPulse {
  from { filter: drop-shadow(0 0 0 rgba(255, 60, 80, 0)); }
  to { filter: drop-shadow(0 0 12px rgba(255, 60, 80, .95)); }
}

/* 倒计时条：白 → 橙 → 红 */
.atk-bar i.warn { background: linear-gradient(90deg, #ff9f43, #ff7b2e); }
.atk-bar i.danger { background: linear-gradient(90deg, #ff5f6d, #ff2d55); animation: barblink .24s steps(1) infinite; }

/* 受击：玩家抖动 */
.hero-sprite.hurt { animation: heroHurt .3s steps(2); }
@keyframes heroHurt {
  0% { transform: translateX(0); filter: brightness(1); }
  30% { transform: translateX(-6px); filter: brightness(2) saturate(.4); }
  60% { transform: translateX(5px); filter: brightness(1.4); }
  100% { transform: translateX(0); }
}

/* 连击中断：整块舞台淡红内闪 */
.stage.combo-break { animation: breakFlash .4s ease-out; }
@keyframes breakFlash {
  0% { box-shadow: inset 0 0 0 rgba(255, 95, 109, 0); }
  30% { box-shadow: inset 0 0 60px 10px rgba(255, 95, 109, .35); }
  100% { box-shadow: inset 0 0 0 rgba(255, 95, 109, 0); }
}

/* 打字手感 */
.word-display span.ok.pop { animation: keyPop .14s ease-out; }
@keyframes keyPop { from { transform: translateY(-2px) scale(1.18); color: #fff; } to { transform: none; } }
.word-display .cur.miss { color: #ff5f6d; text-shadow: 0 0 8px #ff5f6d; animation: missBlink .22s steps(2) infinite; }
@keyframes missBlink { 50% { opacity: .25; } }
.word-display.word-wrong { animation: wordShake .2s steps(2); }
@keyframes wordShake {
  0% { transform: translateX(0); }
  33% { transform: translateX(-4px); }
  66% { transform: translateX(4px); }
  100% { transform: translateX(0); }
}
.word-display.near {
  border-color: var(--t-flow, #7df3ff);
  animation: nearGlow 1s ease-in-out infinite alternate;
}
@keyframes nearGlow {
  from { box-shadow: 0 0 0 rgba(127, 243, 255, 0); }
  to { box-shadow: 0 0 14px rgba(127, 243, 255, .55), inset 0 0 8px rgba(127, 243, 255, .18); }
}

/* 粒子形态跟随主题 */
body.theme-ocean .particle { border-radius: 50%; }
body.theme-forest .particle { border-radius: 1px; width: 5px; height: 3px; }
body.theme-desert .particle { border-radius: 50%; opacity: .85; }
body.theme-void .particle { border-radius: 50%; box-shadow: 0 0 6px currentColor; }
body.theme-tech .particle { border-radius: 0; }
/* 光刃本体：分级宽度 */
.slash {
  position: absolute; height: 3px; transform-origin: 0 50%;
  pointer-events: none; z-index: 6; opacity: .95;
  box-shadow: 0 0 10px currentColor, 0 0 22px currentColor;
  animation: slashOut .28s ease-out forwards;
}
.slash.lv2 { height: 6px; box-shadow: 0 0 14px currentColor, 0 0 30px currentColor; }
.slash.lv3 { height: 10px; box-shadow: 0 0 18px currentColor, 0 0 44px currentColor; }
@keyframes slashOut { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }
/* ============================================================
   极简方块像素美术（js/art.js 生成）/ 随主题换材质
   ============================================================ */
.art-grid { display: inline-grid; gap: 0; line-height: 0; }
.art-grid b { display: block; background: transparent; }
.art-grid b[style] { background: var(--c); }

.hero-sprite.art, .sprite.art { width: auto; height: auto; line-height: 0; }
.hero-sprite.art::before, .hero-sprite.art::after,
.sprite.art::before, .sprite.art::after { content: none; display: none; }

/* BOSS 更大、带持续动作 */
.sprite.art-boss .art-grid { animation: bossFloat 2.8s ease-in-out infinite alternate; filter: drop-shadow(0 6px 10px rgba(0,0,0,.5)); }
@keyframes bossFloat { from { transform: translateY(0); } to { transform: translateY(-6px); } }
body.theme-void .sprite.art-boss .art-grid { animation: bossSpin 14s linear infinite; }
@keyframes bossSpin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

/* 主角材质：同一轮廓，不同质感 */
body.theme-tech .hero-sprite.art .art-grid b[style] {
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.18) 0 1px, transparent 1px 4px);
}
body.theme-ocean .hero-sprite.art .art-grid b[style] { opacity: .88; }
body.theme-ocean .hero-sprite.art .art-grid { filter: drop-shadow(0 0 6px rgba(95,215,232,.75)); }
body.theme-desert .hero-sprite.art .art-grid b[style] {
  background-image: repeating-linear-gradient(45deg, rgba(90,50,10,.35) 0 1px, transparent 1px 5px);
}
body.theme-forest .hero-sprite.art .art-grid b[style] {
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.16) 0 1px, transparent 1px 3px);
}
body.theme-forest .hero-sprite.art .art-grid { filter: drop-shadow(0 0 8px rgba(107,255,158,.7)); }
body.theme-void .hero-sprite.art .art-grid { filter: drop-shadow(0 0 8px rgba(197,139,255,.85)); }
body.theme-void .hero-sprite.art .art-grid b[style] { opacity: .92; }

/* 主角微动 */
.hero-sprite.art .art-grid { animation: heroIdle 1.6s steps(2) infinite; }
@keyframes heroIdle { 50% { transform: translateY(-1px); } }

/* 战斗背景：低强度氛围，不抢焦点 */
.battle-view { isolation: isolate; }
.battle-view::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  pointer-events: none; opacity: .6;
}
.battle-view > * { position: relative; }

body.theme-tech .battle-view::before {
  background:
    radial-gradient(circle at 70% 30%, rgba(74,217,255,.10), transparent 55%),
    repeating-linear-gradient(0deg, rgba(120,150,200,.10) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(90deg, rgba(120,150,200,.10) 0 1px, transparent 1px 32px),
    linear-gradient(#140f2b, #1a1233 60%, #120d24);
}
body.theme-ocean .battle-view::before {
  background:
    radial-gradient(ellipse 70% 40% at 50% 105%, rgba(20,60,90,.85), transparent 70%),
    repeating-linear-gradient(0deg, rgba(120,220,255,.07) 0 2px, transparent 2px 18px),
    radial-gradient(circle at 30% 20%, rgba(95,215,232,.12), transparent 60%),
    linear-gradient(#071a2b, #0a2338 60%, #06131f);
  animation: seaSway 9s ease-in-out infinite alternate;
}
@keyframes seaSway { from { background-position: 0 0, 0 0, 0 0, 0 0; } to { background-position: 0 0, 6px 18px, 0 0, 0 0; } }
body.theme-desert .battle-view::before {
  background:
    radial-gradient(ellipse 80% 30% at 50% 100%, rgba(140,95,40,.55), transparent 70%),
    repeating-linear-gradient(125deg, rgba(255,200,120,.06) 0 2px, transparent 2px 26px),
    linear-gradient(#1b1510, #241a12 60%, #150f0b);
}
body.theme-forest .battle-view::before {
  background:
    radial-gradient(circle at 18% 82%, rgba(30,90,50,.55), transparent 45%),
    radial-gradient(circle at 82% 88%, rgba(20,70,40,.5), transparent 45%),
    repeating-linear-gradient(60deg, rgba(120,255,160,.05) 0 1px, transparent 1px 24px),
    linear-gradient(#0a1410, #0e1c15 60%, #070f0b);
}
body.theme-void .battle-view::before {
  background:
    radial-gradient(1px 1px at 20% 30%, #fff, transparent),
    radial-gradient(1px 1px at 68% 18%, #cfd6ff, transparent),
    radial-gradient(1px 1px at 42% 72%, #fff, transparent),
    radial-gradient(1px 1px at 86% 62%, #b9a8ff, transparent),
    radial-gradient(1.5px 1.5px at 12% 62%, #fff, transparent),
    linear-gradient(#05050c, #0a0817 60%, #04040a);
  background-size: 180px 140px, 240px 200px, 200px 180px, 220px 160px, 300px 260px, 100% 100%;
  background-repeat: repeat, repeat, repeat, repeat, repeat, no-repeat;
}
/* ============================================================
   攻击预警三段式（safe >50% / warn 20~50% / danger <20%）
   ============================================================ */
.atk-bar i { background: #7ff0c0; }
.atk-bar i.warn { background: #ff9f43; }
.atk-bar i.danger { background: #ff2d55; animation: barblink .22s steps(1) infinite; }

.enemy.safe .sprite { animation: safeBreath 2.2s ease-in-out infinite alternate; }
.enemy.warn .sprite { animation: warnAura 1.2s ease-in-out infinite alternate; }
.enemy.danger .sprite { animation: dangerPulse .26s ease-in-out infinite alternate; }

@keyframes safeBreath {
  from { filter: drop-shadow(0 0 0 rgba(120, 255, 190, 0)); }
  to { filter: drop-shadow(0 0 8px rgba(120, 255, 190, .55)); }
}
@keyframes warnAura {
  from { filter: drop-shadow(0 0 4px rgba(255, 160, 60, .25)); }
  to { filter: drop-shadow(0 0 13px rgba(255, 160, 60, .85)); }
}

/* 倒计时文字：危险阶段变红加粗 */
.atk-label { font-size: 10px; color: var(--dim); letter-spacing: 1px; }
.atk-label.danger {
  color: #ff5f6d; font-weight: 700; letter-spacing: 1px;
  text-shadow: 0 0 8px rgba(255, 95, 109, .6);
}

/* 单词判定失败提示：输入框上方淡红浮字 */
.input-area { position: relative; }
.word-err {
  position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%);
  margin-bottom: 6px; white-space: nowrap;
  font-size: 13px; letter-spacing: 1px; color: #ffb3bb;
  text-shadow: 0 0 10px rgba(255, 95, 109, .45);
  pointer-events: none;
  animation: wordErrFade 1.3s ease-out forwards;
}
@keyframes wordErrFade {
  0% { opacity: 0; transform: translate(-50%, 6px); }
  18% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -8px); }
}