/* ============================================================
   人类防线 HUMAN FRONT — OREN 终端视觉系统
   深色基底 + 电子青(OREN/AI) + 暖琥珀(人类/抵抗军)
   ============================================================ */

:root {
  /* 基底 */
  --bg-0: #06090e;
  --bg-1: #0a0e14;
  --bg-2: #0d131c;
  --bg-3: #111a26;
  --bg-panel: rgba(13, 19, 28, 0.92);
  --bg-panel-solid: #0d131c;

  /* OREN / AI 冷色 */
  --cyan: #37e5ff;
  --cyan-dim: #1a8ba0;
  --cyan-dark: #0c3d49;
  --cyan-glow: rgba(55, 229, 255, 0.35);
  --cyan-faint: rgba(55, 229, 255, 0.08);

  /* 人类 / 抵抗军 暖色 */
  --amber: #ffb347;
  --amber-dim: #b37a28;
  --amber-dark: #4a320f;
  --amber-glow: rgba(255, 179, 71, 0.3);
  --amber-faint: rgba(255, 179, 71, 0.08);

  /* 语义色 */
  --red: #ff4d5e;
  --red-glow: rgba(255, 77, 94, 0.4);
  --green: #5dff9d;
  --violet: #b06bff;         /* 史诗 */
  --rare: #4da6ff;           /* 稀有 */
  --common: #9aa7b5;         /* 普通 */
  --text: #cfe3ee;
  --text-dim: #6d8093;
  --text-faint: #3d4c5c;

  /* 字体 */
  --font-mono: 'Share Tech Mono', 'SF Mono', 'Menlo', 'Consolas', monospace;
  --font-ui: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;

  /* 线条 */
  --line-cyan: 1px solid rgba(55, 229, 255, 0.25);
  --line-amber: 1px solid rgba(255, 179, 71, 0.3);
  --line-dim: 1px solid rgba(120, 150, 175, 0.15);

  --rad: 4px;
}

/* ---------- 基础 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--bg-1);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select { font-family: inherit; }
::selection { background: rgba(55, 229, 255, 0.3); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: var(--cyan-dark); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan-dim); }

.mono { font-family: var(--font-mono); }

/* ---------- 全局终端质感层 ---------- */
.fx-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(55, 229, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(55, 229, 255, 0.03) 1px, transparent 1px);
  background-size: 44px 44px;
}
.fx-scanlines {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom, transparent 0 2px, rgba(0, 0, 0, 0.12) 2px 4px);
  mix-blend-mode: multiply;
}
.fx-vignette {
  position: fixed; inset: 0; z-index: 59; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(3, 5, 8, 0.65) 100%);
}

/* ---------- 数据侵蚀：人性值越低越重（body[data-humanity] 驱动） ---------- */
.fx-erosion { position: fixed; inset: 0; z-index: 55; pointer-events: none; opacity: 0; transition: opacity 1.2s; }
.erosion-layer { position: absolute; inset: 0; }
.erosion-layer.e1 {
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(55, 229, 255, 0.14), transparent 34%),
    radial-gradient(120% 90% at 100% 0%, rgba(55, 229, 255, 0.12), transparent 32%),
    radial-gradient(120% 90% at 0% 100%, rgba(55, 229, 255, 0.13), transparent 33%),
    radial-gradient(120% 90% at 100% 100%, rgba(55, 229, 255, 0.15), transparent 35%);
}
.erosion-layer.e2 {
  background-image:
    repeating-linear-gradient(90deg, rgba(55, 229, 255, 0.10) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(0deg, rgba(55, 229, 255, 0.07) 0 1px, transparent 1px 13px);
  -webkit-mask-image: radial-gradient(ellipse at center, transparent 52%, #000 100%);
  mask-image: radial-gradient(ellipse at center, transparent 52%, #000 100%);
  animation: erosion-crawl 7s linear infinite;
}
.erosion-layer.e3 {
  background:
    linear-gradient(90deg, rgba(55, 229, 255, 0.22), transparent 12%),
    linear-gradient(-90deg, rgba(55, 229, 255, 0.22), transparent 12%),
    linear-gradient(0deg, rgba(55, 229, 255, 0.2), transparent 10%),
    linear-gradient(180deg, rgba(55, 229, 255, 0.2), transparent 10%);
  animation: erosion-flicker 2.4s steps(3) infinite;
}
@keyframes erosion-crawl { to { transform: translate(9px, 13px); } }
@keyframes erosion-flicker { 0%,100% { opacity: .8; } 50% { opacity: .35; } }
/* 强度档位：≤3 开始出现，越低越重 */
body[data-humanity="3"] .fx-erosion { opacity: .35; }
body[data-humanity="2"] .fx-erosion { opacity: .6; }
body[data-humanity="1"] .fx-erosion { opacity: .85; }
body[data-humanity="0"] .fx-erosion { opacity: 1; }

/* ---------- 通用组件 ---------- */
#app { position: relative; z-index: 2; min-height: 100vh; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 28px;
  font-family: var(--font-mono); font-size: 15px; letter-spacing: 2px;
  color: var(--cyan);
  background: linear-gradient(180deg, rgba(55, 229, 255, 0.10), rgba(55, 229, 255, 0.03));
  border: var(--line-cyan); border-radius: var(--rad);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: all .18s; position: relative; text-transform: uppercase;
}
.btn:hover:not(:disabled) {
  background: rgba(55, 229, 255, 0.2);
  box-shadow: 0 0 18px var(--cyan-glow), inset 0 0 12px rgba(55, 229, 255, 0.1);
  color: #eafcff;
}
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn.amber {
  color: var(--amber); border: var(--line-amber);
  background: linear-gradient(180deg, rgba(255, 179, 71, 0.12), rgba(255, 179, 71, 0.03));
}
.btn.amber:hover:not(:disabled) { background: rgba(255, 179, 71, 0.22); box-shadow: 0 0 18px var(--amber-glow); color: #fff3e0; }
.btn.danger { color: var(--red); border-color: rgba(255, 77, 94, 0.4); }
.btn.danger:hover:not(:disabled) { background: rgba(255, 77, 94, 0.15); box-shadow: 0 0 18px var(--red-glow); }
.btn.big { padding: 18px 48px; font-size: 19px; letter-spacing: 4px; }
.btn.small { padding: 6px 14px; font-size: 12px; letter-spacing: 1px; }

.panel {
  background: var(--bg-panel);
  border: var(--line-dim); border-radius: var(--rad);
  position: relative;
}
.panel::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(55, 229, 255, 0.4), transparent);
}

.tag {
  display: inline-block; padding: 2px 10px; font-size: 11px; letter-spacing: 1.5px;
  font-family: var(--font-mono);
  border: var(--line-dim); border-radius: 2px; color: var(--text-dim);
}
.tag.cyan { color: var(--cyan); border-color: rgba(55, 229, 255, 0.4); background: var(--cyan-faint); }
.tag.amber { color: var(--amber); border-color: rgba(255, 179, 71, 0.4); background: var(--amber-faint); }
.tag.red { color: var(--red); border-color: rgba(255, 77, 94, 0.45); background: rgba(255, 77, 94, 0.08); }
.tag.violet { color: var(--violet); border-color: rgba(176, 107, 255, 0.4); background: rgba(176, 107, 255, 0.08); }

/* 顶部条 */
.topbar {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 10px 22px;
  background: linear-gradient(180deg, rgba(6, 9, 14, 0.96), rgba(10, 14, 20, 0.85));
  border-bottom: var(--line-cyan);
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(6px);
}
.topbar .tb-logo {
  font-family: var(--font-mono); font-size: 15px; letter-spacing: 3px; color: var(--amber);
  text-shadow: 0 0 12px var(--amber-glow); white-space: nowrap; cursor: pointer;
}
.topbar .tb-logo small { color: var(--text-dim); letter-spacing: 1px; font-size: 10px; display: block; }
.tb-stat { display: flex; flex-direction: column; min-width: 74px; }
.tb-stat .k { font-size: 10px; color: var(--text-dim); letter-spacing: 1.5px; }
.tb-stat .v { font-family: var(--font-mono); font-size: 15px; color: var(--text); }
.tb-stat .v.cyan { color: var(--cyan); } .tb-stat .v.amber { color: var(--amber); }
.tb-spacer { flex: 1; }

/* XP 条 */
.xpbar { width: 130px; height: 6px; background: var(--bg-3); border: var(--line-dim); border-radius: 3px; overflow: hidden; }
.xpbar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--amber-dim), var(--amber)); box-shadow: 0 0 8px var(--amber-glow); transition: width .6s; }

/* 进度条（全球 HP / 连接 / 防御） */
.hpbar { position: relative; height: 14px; background: var(--bg-3); border: var(--line-dim); border-radius: 2px; overflow: hidden; }
.hpbar > i {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--cyan-dark), var(--cyan-dim) 60%, var(--cyan));
  box-shadow: 0 0 10px var(--cyan-glow);
  transition: width .5s cubic-bezier(.2,.8,.3,1);
}
.hpbar.amber > i { background: linear-gradient(90deg, var(--amber-dark), var(--amber-dim) 60%, var(--amber)); box-shadow: 0 0 10px var(--amber-glow); }
.hpbar.red > i { background: linear-gradient(90deg, #5c1620, #a32433 60%, var(--red)); box-shadow: 0 0 10px var(--red-glow); }
.hpbar .hpbar-text {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; color: #eaf6ff;
  text-shadow: 0 1px 2px #000;
}

/* ---------- toast ---------- */
#toast-root {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  padding: 10px 22px; background: rgba(10, 16, 24, 0.95);
  border: var(--line-cyan); border-radius: var(--rad);
  color: var(--cyan); font-size: 14px; letter-spacing: 1px;
  box-shadow: 0 0 20px rgba(55, 229, 255, 0.15), 0 4px 16px rgba(0,0,0,.6);
  animation: toast-in .25s cubic-bezier(.2,.9,.3,1.2), toast-out .3s ease-in 2.6s forwards;
  max-width: 80vw; text-align: center;
}
.toast.error { color: var(--red); border-color: rgba(255, 77, 94, 0.5); box-shadow: 0 0 20px rgba(255, 77, 94, 0.15), 0 4px 16px rgba(0,0,0,.6); }
.toast.amber { color: var(--amber); border-color: rgba(255, 179, 71, 0.5); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px); } }

/* ---------- 全局 HUD（静音） ---------- */
#global-hud { position: fixed; right: 14px; bottom: 14px; z-index: 210; display: flex; gap: 8px; }
.hud-btn {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 16, 24, 0.9); border: var(--line-cyan); border-radius: var(--rad);
  color: var(--cyan); transition: all .2s;
}
.hud-btn:hover { box-shadow: 0 0 12px var(--cyan-glow); }
.hud-btn svg { width: 20px; height: 20px; }
.hud-btn.muted { color: var(--text-faint); border-color: var(--line-dim); }

/* ---------- 覆盖层 / 弹窗 ---------- */
#overlay-root { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(4, 7, 11, 0.78); backdrop-filter: blur(4px);
  pointer-events: auto; animation: fade-in .3s;
  padding: 20px; overflow-y: auto;
}
@keyframes fade-in { from { opacity: 0; } }
.modal {
  width: min(680px, 94vw); max-height: 92vh; overflow-y: auto;
  background: linear-gradient(180deg, #0e1520, #0a0f16);
  border: var(--line-cyan); border-radius: 6px;
  box-shadow: 0 0 40px rgba(55, 229, 255, 0.12), 0 20px 60px rgba(0, 0, 0, 0.8);
  animation: modal-in .35s cubic-bezier(.2,.9,.3,1.1);
  position: relative;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(24px) scale(.97); } }
.modal-head {
  padding: 14px 22px; border-bottom: var(--line-dim);
  display: flex; align-items: center; gap: 12px;
}
.modal-head .mh-title { font-family: var(--font-mono); font-size: 16px; letter-spacing: 3px; color: var(--cyan); flex: 1; }
.modal-head .mh-title.amber { color: var(--amber); }
.modal-head .mh-title.red { color: var(--red); }
.modal-body { padding: 20px 22px; }
.modal-foot { padding: 14px 22px; border-top: var(--line-dim); display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }
.modal-close { color: var(--text-dim); font-size: 20px; line-height: 1; padding: 2px 8px; }
.modal-close:hover { color: var(--cyan); }

/* ============================================================
   卡牌组件（通用：手牌 / 收藏 / 卡册 / 战利品）
   ============================================================ */
.card {
  --w: 150px;
  width: var(--w); height: calc(var(--w) * 1.42);
  border-radius: 8px; position: relative; flex-shrink: 0;
  display: flex; flex-direction: column;
  font-size: calc(var(--w) * 0.085);
  transition: transform .16s, box-shadow .16s, filter .16s;
  user-select: none;
  overflow: hidden;
}
/* 人类卡：粗糙混凝土 + 暖色 */
.card.human {
  background:
    radial-gradient(140% 100% at 20% 0%, rgba(255, 179, 71, 0.10), transparent 50%),
    repeating-linear-gradient(63deg, rgba(255,255,255,0.018) 0 2px, transparent 2px 5px),
    linear-gradient(165deg, #2a2419 0%, #1c1811 55%, #15110c 100%);
  border: 1px solid rgba(255, 179, 71, 0.45);
  box-shadow: 0 2px 10px rgba(0,0,0,.55), inset 0 0 22px rgba(255, 179, 71, 0.05);
}
/* AI 卡：抛光金属 + 冷色 */
.card.ai {
  background:
    radial-gradient(140% 100% at 80% 0%, rgba(55, 229, 255, 0.13), transparent 55%),
    repeating-linear-gradient(117deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 7px),
    linear-gradient(195deg, #18242e 0%, #0e1620 55%, #0a1018 100%);
  border: 1px solid rgba(55, 229, 255, 0.45);
  box-shadow: 0 2px 10px rgba(0,0,0,.55), inset 0 0 22px rgba(55, 229, 255, 0.06);
}
.card .c-cost {
  position: absolute; top: -7px; left: -7px; z-index: 3;
  width: calc(var(--w) * 0.24); height: calc(var(--w) * 0.24);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: calc(var(--w) * 0.125); font-weight: 700;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #1d2c3a, #0b121a);
  border: 1px solid var(--cyan-dim); color: var(--cyan);
  box-shadow: 0 0 10px rgba(55, 229, 255, 0.35);
}
.card.human .c-cost { border-color: var(--amber-dim); color: var(--amber); box-shadow: 0 0 10px rgba(255, 179, 71, 0.3); }
/* 卡面图片铺满整张卡 */
.card .c-art {
  position: absolute; inset: 0; z-index: 0; overflow: hidden; border-radius: 7px;
}
.card .c-art img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
/* 底部渐变遮罩：保证文字可读 */
.card .c-art::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: 7px;
  background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, transparent 35%, transparent 50%, rgba(0,0,0,.82) 100%);
}
/* 卡名：叠加在图片上方区域 */
.card .c-name {
  position: relative; z-index: 2; text-align: center; padding: 5% 6% 0; font-weight: 700; letter-spacing: 1px;
  font-size: calc(var(--w) * 0.095); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 4px rgba(0,0,0,.9), 0 0 8px rgba(0,0,0,.6);
}
/* 卡牌说明：叠加在图片下半部 */
.card .c-text {
  position: relative; z-index: 2; flex: 1; margin: auto 7% 2%; padding: 4% 5%;
  font-size: calc(var(--w) * 0.078); line-height: 1.4; color: #e8eef5;
  background: rgba(0, 0, 0, 0.55); border-radius: 3px; overflow: hidden;
  text-shadow: 0 1px 2px rgba(0,0,0,.8);
}
.card .c-stats { position: relative; z-index: 2; display: flex; justify-content: space-between; padding: 0 6% 5%; }
.card .c-atk, .card .c-hp {
  width: calc(var(--w) * 0.22); height: calc(var(--w) * 0.22);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: calc(var(--w) * 0.125); font-weight: 700;
  border-radius: 50%;
}
.card .c-atk { color: var(--amber); background: radial-gradient(circle at 35% 30%, #3a2c12, #171006); border: 1px solid var(--amber-dim); text-shadow: 0 0 8px var(--amber-glow); }
.card .c-hp { color: #ff8896; background: radial-gradient(circle at 35% 30%, #3a1418, #170a0c); border: 1px solid #8a3038; text-shadow: 0 0 8px rgba(255,77,94,.4); }
/* 稀有度宝石 */
.card .c-rarity {
  position: absolute; top: 2%; right: 3%; z-index: 3;
  width: calc(var(--w) * 0.07); height: calc(var(--w) * 0.07);
  transform: rotate(45deg); border-radius: 2px;
  background: var(--common); box-shadow: 0 0 6px rgba(154,167,181,.5);
}
.card.rare .c-rarity { background: var(--rare); box-shadow: 0 0 8px rgba(77,166,255,.8); }
.card.epic .c-rarity { background: var(--violet); box-shadow: 0 0 10px rgba(176,107,255,.9); }
.card .c-type-tag {
  position: absolute; bottom: 1.5%; left: 50%; transform: translateX(-50%); z-index: 2;
  font-size: calc(var(--w) * 0.062); letter-spacing: 1px; color: rgba(255,255,255,.7); text-shadow: 0 1px 3px rgba(0,0,0,.9);
}
.card.playable { cursor: pointer; }
.card.playable:hover { transform: translateY(-6px) scale(1.03); z-index: 5; }
.card.selected { outline: 2px solid var(--amber); outline-offset: 2px; box-shadow: 0 0 24px var(--amber-glow); }
.card.dim { filter: grayscale(.7) brightness(.55); }
.card .c-count {
  position: absolute; bottom: -6px; right: -6px; z-index: 4;
  min-width: 24px; height: 24px; padding: 0 6px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-3); border: var(--line-amber); border-radius: 12px;
  font-family: var(--font-mono); font-size: 12px; color: var(--amber);
}
/* 构筑页：已选卡高亮描边 */
.card.in-deck { outline: 2px solid var(--amber); outline-offset: 2px; box-shadow: 0 0 22px rgba(255, 179, 71, 0.28); }
/* 左上角已选数量标签 */
.card .c-indeck {
  position: absolute; top: -7px; left: -7px; z-index: 4;
  min-width: 24px; height: 24px; padding: 0 6px;
  display: flex; align-items: center; justify-content: center;
  background: var(--amber); border-radius: 12px;
  font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: #1a1410;
  box-shadow: 0 2px 8px rgba(255, 179, 71, 0.5);
}
/* 右上角醒目移除按钮 */
.card .c-remove {
  position: absolute; top: -8px; right: -8px; z-index: 5;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 60, 70, 0.92); border: 2px solid #fff; border-radius: 50%;
  font-size: 15px; font-weight: 700; color: #fff; cursor: pointer; line-height: 1;
  box-shadow: 0 2px 10px rgba(255, 60, 70, 0.55);
  transition: transform .12s, background .12s;
}
.card .c-remove:hover { background: rgba(255, 30, 40, 1); transform: scale(1.15); }
/* 卡背（未知协议） */
.card-back {
  width: var(--w, 150px); height: calc(var(--w, 150px) * 1.42); border-radius: 8px;
  background:
    repeating-linear-gradient(45deg, rgba(55,229,255,0.06) 0 3px, transparent 3px 8px),
    linear-gradient(160deg, #101b26, #080d14);
  border: 1px solid rgba(55, 229, 255, 0.35);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--cyan-dim); font-family: var(--font-mono); letter-spacing: 2px; font-size: 12px;
  animation: cardback-pulse 2.2s ease-in-out infinite;
}
@keyframes cardback-pulse { 50% { box-shadow: 0 0 18px rgba(55,229,255,0.25); border-color: rgba(55,229,255,0.7); } }

/* ============================================================
   Landing
   ============================================================ */
.landing {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  position: relative; overflow: hidden; padding: 40px 20px 60px;
}
.landing-bg {
  position: absolute; inset: 0; z-index: -1;
  background-size: cover; background-position: center;
  /* 无图时的程序化回退：城市废墟 + 数据天幕渐变 */
  background-image:
    radial-gradient(90% 60% at 50% -10%, rgba(55, 229, 255, 0.16), transparent 60%),
    radial-gradient(70% 50% at 50% 115%, rgba(255, 179, 71, 0.10), transparent 60%),
    linear-gradient(180deg, #05080d 0%, #0a1119 45%, #060a10 100%);
}
.landing-bg.has-img::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(5,8,13,.55), rgba(6,10,16,.82) 70%, #0a0e14);
}
.landing-oren-eye {
  width: 110px; height: 110px; margin-bottom: 26px; position: relative;
  animation: eye-float 5s ease-in-out infinite;
}
@keyframes eye-float { 50% { transform: translateY(-10px); } }
.landing h1 {
  font-size: clamp(44px, 8vw, 92px); font-weight: 900; letter-spacing: 12px;
  color: #f4f9fc; line-height: 1.1;
  text-shadow: 0 0 30px rgba(255, 179, 71, 0.35), 0 0 80px rgba(255, 179, 71, 0.15);
  animation: title-glitch 7s infinite;
}
.landing h1 .en {
  display: block; font-family: var(--font-mono); font-weight: 400;
  font-size: clamp(15px, 2.4vw, 26px); letter-spacing: 14px; color: var(--cyan);
  text-shadow: 0 0 18px var(--cyan-glow); margin-top: 10px;
}
@keyframes title-glitch {
  0%, 93%, 100% { transform: none; opacity: 1; }
  94% { transform: translateX(2px) skewX(2deg); opacity: .9; }
  95% { transform: translateX(-3px); }
  96% { transform: none; opacity: 1; }
}
.landing .lore {
  max-width: 640px; margin: 30px auto 8px; color: var(--text); font-size: 16px; line-height: 2;
}
.landing .lore .hl-cyan { color: var(--cyan); }
.landing .lore .hl-amber { color: var(--amber); }
.landing .question {
  margin: 22px 0 34px; font-size: clamp(17px, 2.4vw, 22px); color: var(--amber);
  letter-spacing: 2px; font-weight: 500;
  text-shadow: 0 0 16px var(--amber-glow);
}
.landing-features {
  display: flex; gap: 16px; flex-wrap: wrap; justify-content: center;
  margin-bottom: 44px; max-width: 900px;
}
.feature {
  width: 260px; padding: 18px 20px; text-align: left;
  background: rgba(13, 19, 28, 0.75); border: var(--line-dim); border-radius: 6px;
  transition: all .25s;
}
.feature:hover { border-color: rgba(55, 229, 255, 0.4); transform: translateY(-4px); box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.feature svg { width: 30px; height: 30px; color: var(--cyan); margin-bottom: 10px; }
.feature h3 { font-size: 15px; color: #eef5fa; letter-spacing: 2px; margin-bottom: 6px; }
.feature p { font-size: 12.5px; color: var(--text-dim); line-height: 1.7; }
.landing-foot {
  position: absolute; bottom: 18px; left: 0; right: 0;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px; color: var(--text-faint);
}
/* 打字机光标 */
.tw-caret::after { content: '▌'; color: var(--cyan); animation: caret-blink 1s steps(1) infinite; }
@keyframes caret-blink { 50% { opacity: 0; } }

/* ============================================================
   基地 / 节点地图
   ============================================================ */
.base { position: fixed; inset: 0; z-index: -1; }
.base-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  background-image:
    radial-gradient(80% 55% at 50% 0%, rgba(255, 179, 71, 0.07), transparent 60%),
    radial-gradient(90% 70% at 50% 110%, rgba(55, 229, 255, 0.07), transparent 65%),
    linear-gradient(180deg, #070a10, #0a0f16 50%, #070a0f);
}
.base-bg.has-img::after { content: ''; position: absolute; inset: 0; background: rgba(6, 9, 14, 0.82); }
.base-inner { max-width: 1280px; margin: 0 auto; padding: 26px 24px 60px; }
.base-title { display: flex; align-items: baseline; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.base-title h2 { font-size: 26px; letter-spacing: 6px; color: #eef5fa; }
.base-title .sub { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); letter-spacing: 2px; }

.node-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px;
}
.node-card {
  background: linear-gradient(180deg, rgba(15, 22, 32, 0.92), rgba(9, 13, 19, 0.94));
  border: var(--line-dim); border-radius: 8px; overflow: hidden;
  transition: border-color .25s, box-shadow .25s, transform .25s;
}
.node-card:hover { border-color: rgba(55, 229, 255, 0.45); box-shadow: 0 6px 30px rgba(0,0,0,.55), 0 0 20px rgba(55,229,255,.08); transform: translateY(-3px); }
.node-visual {
  height: 120px; position: relative; overflow: hidden;
  background-size: cover; background-position: center;
  display: flex; align-items: flex-end;
}
/* 程序化节点视觉回退 */
.node-visual { background-color: #0c121b; }
.node-visual::before {
  content: ''; position: absolute; inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(55,229,255,0.05) 0 1px, transparent 1px 26px),
    radial-gradient(70% 90% at 50% 120%, rgba(55, 229, 255, 0.14), transparent 60%);
}
.node-visual.has-img::before { background: linear-gradient(180deg, transparent 30%, rgba(9, 13, 19, 0.92)); }
.node-visual .nv-name {
  position: relative; z-index: 2; padding: 10px 16px;
  display: flex; align-items: baseline; gap: 10px; width: 100%;
}
.node-visual .nv-name b { font-size: 19px; letter-spacing: 3px; color: #f0f6fa; text-shadow: 0 2px 8px #000; }
.node-visual .nv-name span { font-family: var(--font-mono); font-size: 11px; color: var(--cyan); letter-spacing: 1px; }
.node-body { padding: 14px 16px 16px; }
.node-persona { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.node-persona .np-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan-glow); animation: caret-blink 1.6s infinite; }
.node-persona .np-name { font-size: 13px; color: var(--cyan); letter-spacing: 1px; }
.node-persona .np-style { margin-left: auto; }
.node-power-desc { font-size: 12.5px; color: var(--text-dim); line-height: 1.6; margin-bottom: 12px; min-height: 40px; }
.node-power-desc b { color: var(--text); font-weight: 500; }
.node-global { margin-bottom: 12px; }
.node-global .ng-row { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-dim); font-family: var(--font-mono); margin-bottom: 4px; letter-spacing: 1px; }
.node-global .ng-row .warn { color: var(--red); }
.node-global .ng-row .assim { color: var(--violet); }
.node-diff { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.diff-btn {
  padding: 8px 4px; text-align: center; border: var(--line-dim); border-radius: 4px;
  transition: all .18s; position: relative;
}
.diff-btn .d-name { display: block; font-size: 12px; letter-spacing: 1px; color: var(--text); }
.diff-btn .d-fee { display: block; font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); margin-top: 2px; }
.diff-btn:not(.locked):hover { border-color: var(--amber-dim); background: var(--amber-faint); }
.diff-btn:not(.locked):hover .d-name { color: var(--amber); }
.diff-btn.boss:not(.locked) .d-name { color: var(--red); }
.diff-btn.locked { opacity: .4; cursor: not-allowed; }
.diff-btn.locked .d-lock { display: block; font-size: 9px; color: var(--text-faint); margin-top: 2px; letter-spacing: 0; }
.diff-btn .d-rage {
  position: absolute; top: -8px; right: -4px; padding: 1px 6px;
  font-size: 9px; background: rgba(255, 77, 94, 0.16); color: var(--red);
  border: 1px solid rgba(255, 77, 94, 0.5); border-radius: 2px; letter-spacing: 0;
}

/* ============================================================
   构筑界面
   ============================================================ */
.deckbuild { max-width: 1340px; margin: 0 auto; padding: 22px 24px 80px; }
.deckbuild-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.deckbuild-head h2 { font-size: 22px; letter-spacing: 4px; color: #eef5fa; }
.deckbuild-head .db-info { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); letter-spacing: 1px; }
.deckbuild-cols { display: grid; grid-template-columns: 1fr 360px; gap: 20px; }
.deckbuild-cols > div:first-child { align-self: start; }
.collection-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; }
.collection-list .card { --w: 128px; cursor: pointer; }
.collection-list .card:hover { transform: translateY(-4px); }
.deck-panel-col { position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow-y: auto; }
.deck-panel-col::-webkit-scrollbar { width: 4px; }
.deck-panel { }
.deck-panel .dp-count { font-family: var(--font-mono); font-size: 30px; color: var(--amber); text-shadow: 0 0 14px var(--amber-glow); }
.deck-panel .dp-count small { font-size: 14px; color: var(--text-dim); }
/* 紧凑费用曲线（替代原卡组列表的曲线参考） */
.dp-curve { margin: 12px 0; display: flex; align-items: flex-end; gap: 6px; height: 56px; padding: 0 2px; }
.dp-curve .dc-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; height: 100%; }
.dp-curve .dc-col i {
  width: 100%; max-width: 22px; border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, rgba(255, 179, 71, 0.75), rgba(255, 179, 71, 0.18));
}
.dp-curve .dc-col span { font-family: var(--font-mono); font-size: 9px; color: var(--text-faint); }
.deck-row {
  display: flex; align-items: center; gap: 8px; padding: 5px 10px;
  background: var(--bg-3); border: var(--line-dim); border-radius: 3px;
  font-size: 13px; cursor: pointer; transition: all .15s;
}
.deck-row:hover { border-color: rgba(255, 77, 94, 0.5); background: rgba(255, 77, 94, 0.06); }
.deck-row .dr-cost { font-family: var(--font-mono); color: var(--cyan); width: 18px; text-align: center; }
.deck-row .dr-name { flex: 1; color: var(--text); }
.deck-row .dr-n { font-family: var(--font-mono); color: var(--amber); }
.power-select { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.power-opt {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border: var(--line-dim); border-radius: 4px; cursor: pointer; transition: all .18s; text-align: left;
}
.power-opt:hover:not(.locked) { border-color: rgba(255, 179, 71, 0.4); }
.power-opt.active { border-color: var(--amber); background: var(--amber-faint); box-shadow: 0 0 14px rgba(255,179,71,.12); }
.power-opt.locked { opacity: .42; cursor: not-allowed; }
.power-opt .po-name { font-size: 14px; color: #eef5fa; letter-spacing: 1px; }
.power-opt .po-desc { font-size: 11.5px; color: var(--text-dim); }
.power-opt .po-lock { margin-left: auto; font-size: 10px; color: var(--red); font-family: var(--font-mono); }
.power-opt .po-check { margin-left: auto; color: var(--amber); font-family: var(--font-mono); }

/* ============================================================
   战斗界面（终端化炉石布局）
   ============================================================ */
.battle {
  height: 100vh; display: grid; overflow: hidden;
  grid-template-columns: 1fr 320px;
  grid-template-rows: auto 1fr auto;
  grid-template-areas: "ai side" "mid side" "me side";
  background:
    radial-gradient(75% 50% at 50% 0%, rgba(55, 229, 255, 0.05), transparent 60%),
    radial-gradient(75% 50% at 50% 100%, rgba(255, 179, 71, 0.05), transparent 60%),
    var(--bg-1);
}
/* --- 顶部 AI 区 --- */
.b-ai {
  grid-area: ai; display: flex; align-items: center; gap: 16px;
  padding: 10px 20px; border-bottom: 1px solid rgba(55, 229, 255, 0.14);
  background: linear-gradient(180deg, rgba(8, 13, 20, 0.9), transparent);
}
.b-portrait {
  width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--cyan-dim); position: relative; overflow: hidden;
  box-shadow: 0 0 18px rgba(55, 229, 255, 0.25);
  background: radial-gradient(circle at 50% 35%, #16242f, #080d13);
  background-size: cover; background-position: center;
}
.b-portrait .p-eye {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle, var(--cyan) 0%, var(--cyan-dark) 65%, transparent 75%);
  box-shadow: 0 0 16px var(--cyan-glow);
  animation: eye-scan 3.4s ease-in-out infinite;
}
@keyframes eye-scan { 0%,100% { transform: translate(-50%,-50%) scale(1); } 30% { transform: translate(-58%,-50%) scale(.92); } 65% { transform: translate(-42%,-52%) scale(1.05); } }
.b-ai-info { flex: 1; min-width: 0; }
.b-ai-name { font-size: 15px; letter-spacing: 2px; color: var(--cyan); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.b-ai-name .node-tag { font-size: 10px; color: var(--text-dim); font-family: var(--font-mono); }
.b-ai-hp { margin-top: 5px; max-width: 380px; }
.b-ai-meta { display: flex; gap: 16px; align-items: center; font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); }
.b-ai-meta .mana { color: var(--cyan); }
.b-hero-power {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 12px; border: var(--line-cyan); border-radius: 6px; max-width: 200px;
  background: var(--cyan-faint);
}
.b-hero-power .hp-name { font-size: 12px; color: var(--cyan); letter-spacing: 1px; }
.b-hero-power .hp-desc { font-size: 10px; color: var(--text-dim); text-align: center; line-height: 1.4; }
.b-hero-power.used { opacity: .45; }
.b-revealed { display: flex; gap: 6px; align-items: center; }
/* 紧凑徽标按钮：点击弹出浮层查看全部被揭示手牌 */
.revealed-badge {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 1px;
  color: var(--cyan); padding: 3px 10px;
  border: 1px solid rgba(55, 229, 255, 0.4); border-radius: 4px;
  background: rgba(55, 229, 255, 0.08);
  cursor: pointer; transition: all .15s;
  white-space: nowrap;
}
.revealed-badge:hover {
  background: rgba(55, 229, 255, 0.18);
  box-shadow: 0 0 12px rgba(55, 229, 255, 0.3);
}
/* 被揭示手牌浮层：全尺寸卡牌横排 */
.revealed-hand-grid {
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
  padding: 8px 0;
}
.revealed-hand-grid .card { --w: 130px; cursor: pointer; }

/* --- 中央战场 --- */
.b-mid { grid-area: mid; display: flex; flex-direction: column; min-height: 0; position: relative; }
.b-board-row {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 6px 16px; min-height: 0;
}
.b-board-row.ai-row { border-bottom: 1px dashed rgba(55, 229, 255, 0.12); }
.board-empty { font-family: var(--font-mono); font-size: 11px; letter-spacing: 3px; color: var(--text-faint); }

/* 随从单位 */
.minion {
  --mw: 92px;
  width: var(--mw); height: calc(var(--mw) * 1.3);
  border-radius: 8px; position: relative; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center;
  transition: transform .16s, box-shadow .16s, opacity .3s, filter .2s;
  animation: minion-in .3s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes minion-in { from { transform: scale(.6); opacity: 0; } }
.minion.human {
  background: linear-gradient(170deg, #2b2418, #17120b 70%);
  border: 1px solid rgba(255, 179, 71, 0.5);
  box-shadow: 0 3px 12px rgba(0,0,0,.5), inset 0 0 16px rgba(255,179,71,.06);
}
.minion.ai {
  background: linear-gradient(190deg, #17242f, #0a121a 70%);
  border: 1px solid rgba(55, 229, 255, 0.5);
  box-shadow: 0 3px 12px rgba(0,0,0,.5), inset 0 0 16px rgba(55,229,255,.07);
}
.minion .m-name {
  margin-top: 8%; font-size: 11.5px; font-weight: 700; letter-spacing: 1px; color: #eef4f9;
  max-width: 90%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.minion .m-art {
  width: 62%; aspect-ratio: 1; margin-top: 4%; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 15px; letter-spacing: 0; color: rgba(255,255,255,.75);
}
.minion.human .m-art { background: radial-gradient(circle at 40% 35%, #4a3a1c, #1d150a); box-shadow: inset 0 0 12px rgba(255,179,71,.2); }
.minion.ai .m-art { background: radial-gradient(circle at 40% 35%, #14303c, #08121a); box-shadow: inset 0 0 12px rgba(55,229,255,.22); }
.minion .m-badges { display: flex; gap: 3px; margin-top: 4%; min-height: 14px; }
.minion .m-badge {
  font-size: 9px; padding: 0 5px; border-radius: 2px; letter-spacing: 1px; line-height: 14px;
  font-family: var(--font-ui);
}
.m-badge.taunt { color: var(--cyan); border: 1px solid rgba(55,229,255,.5); background: rgba(55,229,255,.1); }
.m-badge.charge { color: var(--amber); border: 1px solid rgba(255,179,71,.5); background: rgba(255,179,71,.1); }
.m-badge.sleep { color: var(--text-dim); border: 1px solid var(--line-dim); }
/* 待命随从整牌置灰：比小徽标更醒目 */
.card.minion.sleeping { filter: grayscale(.55) brightness(.5); }
.card.minion.sleeping:hover { filter: grayscale(.2) brightness(.75); }
.m-badge.silenced { color: var(--violet); border: 1px solid rgba(176,107,255,.5); }
.minion .m-stats { position: absolute; bottom: -8px; left: 0; right: 0; display: flex; justify-content: space-between; padding: 0 -6px; }
.minion .m-atk, .minion .m-hp {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 14px; font-weight: 700;
  position: relative; z-index: 3;
}
.minion .m-atk { margin-left: -8px; color: var(--amber); background: radial-gradient(circle at 35% 30%, #3d2f13, #181006); border: 1px solid var(--amber-dim); text-shadow: 0 0 8px var(--amber-glow); }
.minion .m-hp { margin-right: -8px; color: #ff98a4; background: radial-gradient(circle at 35% 30%, #3d151b, #180a0d); border: 1px solid #93343c; text-shadow: 0 0 8px rgba(255,77,94,.5); }
.minion .m-atk.buffed { color: var(--green); } .minion .m-hp.buffed { color: var(--green); }
.minion .m-hp.damaged { color: var(--red); animation: hp-shake .3s; }
@keyframes hp-shake { 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }
/* 嘲讽盾框 */
.minion.has-taunt::before {
  content: ''; position: absolute; inset: -7px; border-radius: 12px; z-index: -1;
  border: 2px solid rgba(55, 229, 255, 0.55);
  clip-path: polygon(0 18%, 8% 0, 92% 0, 100% 18%, 100% 82%, 92% 100%, 8% 100%, 0 82%);
  box-shadow: 0 0 14px rgba(55, 229, 255, 0.25);
}
/* 可攻击辉光 */
.minion.can-attack { cursor: pointer; }
.minion.can-attack::after {
  content: ''; position: absolute; inset: -4px; border-radius: 10px;
  border: 1px solid var(--green); box-shadow: 0 0 14px rgba(93, 255, 157, 0.35);
  animation: attack-glow 1.4s ease-in-out infinite; pointer-events: none;
}
@keyframes attack-glow { 50% { opacity: .35; } }
.minion.attacker-selected { outline: 2px solid var(--green); outline-offset: 3px; transform: translateY(-6px); }
.minion.targetable { cursor: crosshair; }
.minion.targetable::after {
  content: ''; position: absolute; inset: -4px; border-radius: 10px;
  border: 2px solid var(--red); box-shadow: 0 0 16px var(--red-glow);
  animation: attack-glow .9s ease-in-out infinite; pointer-events: none;
}
/* 非操作目标：点击查看详情 */
.minion.inspectable { cursor: help; }

/* 卡牌详情弹层（随从/日志亮出牌共用） */
.card-detail { display: flex; gap: 18px; align-items: flex-start; }
.card-detail .card { --w: 168px; flex-shrink: 0; pointer-events: none; }
.card-detail .cd-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.cd-row { display: flex; gap: 10px; font-size: 13px; line-height: 1.6; }
.cd-row .cd-k { flex-shrink: 0; width: 52px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px; color: var(--text-faint); padding-top: 2px; }
.cd-row .cd-v { color: #e8eef5; }

/* 随从悬停详情浮层 */
.minion-tip {
  position: fixed; z-index: 30; width: 220px; pointer-events: none;
  padding: 10px 12px; border-radius: 6px;
  background: rgba(8, 12, 18, 0.94); border: 1px solid rgba(55, 229, 255, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 18px rgba(55, 229, 255, 0.12);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: fade-in .18s;
}
.minion-tip .mt-name { font-size: 13px; font-weight: 700; letter-spacing: 1px; color: #eef4f9; }
.minion-tip .mt-stats { font-family: var(--font-mono); font-size: 11px; color: var(--amber); margin-top: 3px; }
.minion-tip .mt-kw { font-size: 10px; letter-spacing: 1px; color: var(--cyan); margin-top: 3px; }
.minion-tip .mt-text { font-size: 12px; line-height: 1.6; color: var(--text-dim); margin-top: 5px; }
.minion.dying { animation: minion-shatter .5s forwards; }
@keyframes minion-shatter {
  30% { transform: scale(1.12); filter: brightness(2); }
  100% { transform: scale(.2) rotate(14deg); opacity: 0; filter: brightness(3) blur(3px); }
}
.minion.hit { animation: minion-hit .32s; }
@keyframes minion-hit { 30% { transform: translateX(-6px); filter: brightness(1.8); } 60% { transform: translateX(4px); } }
.minion.buffed-anim { animation: buff-flash .6s; }
@keyframes buff-flash { 30% { filter: brightness(1.9) drop-shadow(0 0 12px rgba(93,255,157,.7)); } }

/* ---- 场上随从以卡牌形式展示：覆盖 .minion 与 .card 冲突的属性 ---- */
.card.minion {
  --w: 80px;
  width: var(--w); height: calc(var(--w) * 1.42);
  align-items: stretch;
  overflow: visible; /* 允许 ::after / ::before 伪元素（攻击/嘲讽辉光）超出边界 */
}
.card.minion.human {
  background:
    radial-gradient(140% 100% at 20% 0%, rgba(255, 179, 71, 0.10), transparent 50%),
    repeating-linear-gradient(63deg, rgba(255,255,255,0.018) 0 2px, transparent 2px 5px),
    linear-gradient(165deg, #2a2419 0%, #1c1811 55%, #15110c 100%);
  border: 1px solid rgba(255, 179, 71, 0.45);
  box-shadow: 0 2px 10px rgba(0,0,0,.55), inset 0 0 22px rgba(255, 179, 71, 0.05);
}
.card.minion.ai {
  background:
    radial-gradient(140% 100% at 80% 0%, rgba(55, 229, 255, 0.13), transparent 55%),
    repeating-linear-gradient(117deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 7px),
    linear-gradient(195deg, #18242e 0%, #0e1620 55%, #0a1018 100%);
  border: 1px solid rgba(55, 229, 255, 0.45);
  box-shadow: 0 2px 10px rgba(0,0,0,.55), inset 0 0 22px rgba(55, 229, 255, 0.06);
}
/* 场上卡牌鼠标悬停放大，方便查看牌面信息 */
.card.minion { transition: transform .18s, box-shadow .18s, filter .2s, opacity .3s; }
.card.minion:hover {
  transform: scale(1.6);
  z-index: 20;
  box-shadow: 0 14px 36px rgba(0,0,0,.7);
}
/* 场上随从的攻血状态指示（复用卡牌 c-atk / c-hp 结构） */
.card.minion .c-atk.buffed { color: var(--green); text-shadow: 0 0 8px rgba(93,255,157,.6); }
.card.minion .c-hp.buffed { color: var(--green); text-shadow: 0 0 8px rgba(93,255,157,.6); }
.card.minion .c-hp.damaged { color: var(--red); animation: hp-shake .3s; }
/* 场上随从的状态徽标定位 */
.card.minion .m-badges {
  position: absolute; top: 3%; left: 50%; transform: translateX(-50%); z-index: 4;
  display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; max-width: 90%;
}

/* AI 攻击动作高亮（2D 模式）：攻击者发红光、目标被红圈锁定 */
.minion.attacking { animation: minion-attack-lunge .5s; filter: drop-shadow(0 0 14px rgba(255, 60, 60, .85)); z-index: 8; }
@keyframes minion-attack-lunge { 25% { transform: scale(1.18) translateY(-6px); } 55% { transform: scale(1.05); } }
.minion.targeted, .hero-target.targeted .b-portrait, .hero-target.targeted .me-portrait,
.b-portrait.targeted, .me-portrait.targeted {
  animation: target-lock .5s; filter: drop-shadow(0 0 12px rgba(255, 40, 40, .9));
}
@keyframes target-lock { 0%,100% { box-shadow: 0 0 0 2px rgba(255,40,40,.3); } 50% { box-shadow: 0 0 0 4px rgba(255,40,40,.85); } }

/* AI 出牌预览浮层（2D 模式）：卡牌从 AI 头像弹出，悬停后淡出 */
.ai-play-preview {
  position: fixed; z-index: 240; pointer-events: none;
  width: 150px; animation: ai-preview-in .3s ease-out;
  transition: opacity .4s ease-in, transform .4s ease-in;
}
.ai-play-preview .preview-card { --w: 150px; }
.ai-play-preview.out { opacity: 0; transform: translateY(-20px) scale(.9); }
@keyframes ai-preview-in { 0% { opacity: 0; transform: translateY(-16px) scale(.7); } 100% { opacity: 1; transform: translateY(0) scale(1); } }

/* 玩家出牌预览浮层（2D 模式）：卡牌在玩家头像上方弹出，悬停后淡出 */
.player-play-preview {
position: fixed; z-index: 240; pointer-events: none;
width: 150px; animation: player-preview-in .3s ease-out;
transition: opacity .4s ease-in, transform .4s ease-in;
}
.player-play-preview .preview-card { --w: 150px; }
.player-play-preview.out { opacity: 0; transform: translateY(20px) scale(.9); }
@keyframes player-preview-in { 0% { opacity: 0; transform: translateY(16px) scale(.7); } 100% { opacity: 1; transform: translateY(0) scale(1); } }

/* 英雄头像（可被攻击目标） */
.hero-target { position: relative; }
.hero-target.targetable { cursor: crosshair; }
.hero-target.targetable .b-portrait, .hero-target.targetable .me-portrait {
  outline: 2px solid var(--red); outline-offset: 3px; animation: attack-glow .9s infinite;
}

/* --- 右侧 OREN 终端面板 --- */
.b-side {
  grid-area: side; border-left: 1px solid rgba(55, 229, 255, 0.16);
  background: linear-gradient(180deg, rgba(9, 14, 21, 0.96), rgba(7, 11, 17, 0.98));
  display: flex; flex-direction: column; min-height: 0;
}
.side-head {
  padding: 10px 16px; border-bottom: var(--line-dim);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 3px; color: var(--cyan);
  display: flex; align-items: center; gap: 8px;
}
.side-head .pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan-glow); animation: caret-blink 1.2s infinite; }
.oren-terminal { flex: 1.2; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; min-height: 120px; }
.taunt-line { font-size: 13px; line-height: 1.7; animation: fade-in .4s; }
.taunt-line .speaker { font-family: var(--font-mono); font-size: 11px; letter-spacing: 1px; color: var(--cyan); display: block; margin-bottom: 2px; }
.taunt-line .speaker.human { color: var(--amber); }
.taunt-line .txt { color: #d8ecf5; }
.taunt-line .txt.typing::after { content: '▌'; color: var(--cyan); animation: caret-blink .8s steps(1) infinite; }
/* "OREN 正在计算…" 骨架 */
.oren-thinking { padding: 10px 14px; border: 1px dashed rgba(55, 229, 255, 0.3); border-radius: 4px; background: var(--cyan-faint); }
.oren-thinking .ot-title { font-family: var(--font-mono); font-size: 12px; color: var(--cyan); letter-spacing: 2px; margin-bottom: 8px; }
.oren-thinking .ot-title::after { content: '…'; animation: think-dots 1.2s steps(4) infinite; }
@keyframes think-dots { 0% { content: ''; } 25% { content: '·'; } 50% { content: '··'; } 75% { content: '···'; } }
.skeleton-bar { height: 8px; border-radius: 2px; margin: 6px 0; background: linear-gradient(90deg, rgba(55,229,255,.06) 25%, rgba(55,229,255,.22) 50%, rgba(55,229,255,.06) 75%); background-size: 200% 100%; animation: skeleton-sweep 1.1s linear infinite; }
.skeleton-bar.w60 { width: 60%; } .skeleton-bar.w80 { width: 80%; } .skeleton-bar.w40 { width: 40%; }
@keyframes skeleton-sweep { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.side-log-head { padding: 8px 16px; border-top: var(--line-dim); border-bottom: var(--line-dim); font-family: var(--font-mono); font-size: 10px; letter-spacing: 2px; color: var(--text-dim); }
.b-log { flex: 1; overflow-y: auto; padding: 10px 16px; font-size: 12px; color: var(--text-dim); line-height: 1.8; min-height: 80px; }
.b-log .lg:last-child { animation: fade-in .3s; } /* 仅最新行淡入：sync 重渲染不再整列闪动 */
.b-log .lg .lg-card { color: var(--cyan); cursor: pointer; border-bottom: 1px dashed rgba(55, 229, 255, 0.45); }
.b-log .lg .lg-card:hover { color: #9ff0ff; border-bottom-style: solid; }
.b-log .lg.dmg { color: #ffb3ba; } .b-log .lg.heal { color: var(--green); }
.b-log .lg.hum-plus { color: var(--amber); } .b-log .lg.hum-minus { color: var(--cyan); }

/* --- 底部玩家区 --- */
.b-me { grid-area: me; border-top: 1px solid rgba(255, 179, 71, 0.16); background: linear-gradient(0deg, rgba(16, 12, 6, 0.6), transparent); padding: 6px 16px 10px; }
.b-me-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.me-portrait {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--amber-dim); overflow: hidden; position: relative;
  box-shadow: 0 0 16px rgba(255, 179, 71, 0.22);
  background: radial-gradient(circle at 50% 35%, #2c2212, #120d06);
  background-size: cover; background-position: center;
}
.me-portrait .p-sig {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); color: var(--amber); font-size: 18px; text-shadow: 0 0 10px var(--amber-glow);
}
.me-bars { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 5px; }
.me-bars .hpbar { max-width: 400px; }
/* 法力水晶 */
.mana-crystals { display: flex; gap: 4px; align-items: center; }
.mana-crystals .mc-label { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); margin-right: 4px; }
.crystal {
  width: 15px; height: 15px; transform: rotate(45deg); border-radius: 2px;
  background: var(--bg-3); border: 1px solid rgba(55, 229, 255, 0.25);
  transition: all .3s;
}
.crystal.full { background: linear-gradient(135deg, var(--cyan-dim), var(--cyan)); box-shadow: 0 0 8px var(--cyan-glow); }
.crystal.spent { background: rgba(55, 229, 255, 0.12); border-color: rgba(55, 229, 255, 0.15); }
/* 人性值计量器 */
.humanity-meter {
  display: flex; align-items: center; gap: 10px; padding: 6px 14px;
  border: 1px solid rgba(255, 179, 71, 0.35); border-radius: 6px;
  background: linear-gradient(180deg, rgba(255, 179, 71, 0.08), rgba(255, 179, 71, 0.02));
  transition: all .5s;
}
.humanity-meter .hm-label { font-size: 11px; letter-spacing: 2px; color: var(--text-dim); writing-mode: horizontal-tb; }
.humanity-meter .hm-value { font-family: var(--font-mono); font-size: 26px; font-weight: 700; color: var(--amber); text-shadow: 0 0 14px var(--amber-glow); transition: color .5s; }
.humanity-meter .hm-value small { font-size: 13px; color: var(--text-dim); font-weight: 400; }
.humanity-meter .hm-pips { display: flex; gap: 3px; }
.humanity-meter .hm-pip { width: 7px; height: 16px; border-radius: 1px; background: var(--amber); box-shadow: 0 0 6px var(--amber-glow); transition: all .4s; }
.humanity-meter .hm-pip.off { background: var(--bg-3); box-shadow: none; }
.humanity-meter.low { border-color: rgba(55, 229, 255, 0.55); background: linear-gradient(180deg, rgba(55, 229, 255, 0.1), rgba(55, 229, 255, 0.03)); }
.humanity-meter.low .hm-value { color: var(--cyan); text-shadow: 0 0 14px var(--cyan-glow); }
.humanity-meter.low .hm-pip { background: var(--cyan); box-shadow: 0 0 6px var(--cyan-glow); }
.humanity-meter.critical { animation: hm-alarm 1s ease-in-out infinite; }
@keyframes hm-alarm { 50% { box-shadow: 0 0 22px rgba(55, 229, 255, 0.4); } }
/* 人性值浮动提示 */
.hm-float {
  position: fixed; z-index: 220; pointer-events: none;
  font-family: var(--font-mono); font-size: 17px; letter-spacing: 1px;
  animation: hm-float-up 1.8s ease-out forwards;
}
.hm-float.plus { color: var(--amber); text-shadow: 0 0 12px var(--amber-glow); }
.hm-float.minus { color: var(--cyan); text-shadow: 0 0 12px var(--cyan-glow); }
@keyframes hm-float-up { from { opacity: 0; transform: translateY(12px); } 20% { opacity: 1; } to { opacity: 0; transform: translateY(-46px); } }

/* 手牌 */
.b-hand { display: flex; justify-content: center; align-items: flex-end; gap: 6px; padding: 12px 10px 2px; min-height: 150px; }
.b-hand .card { --w: 108px; cursor: pointer; }
.b-hand .card:hover { transform: translateY(-22px) scale(1.12); z-index: 10; box-shadow: 0 14px 34px rgba(0,0,0,.7); }
.b-hand .card.unaffordable { filter: grayscale(.55) brightness(.6); }
.b-hand .card.selected { transform: translateY(-22px) scale(1.12); z-index: 10; }
/* 结束回合 & 英雄技能按钮 */
.b-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.btn-endturn {
  padding: 12px 26px; font-family: var(--font-mono); font-size: 15px; letter-spacing: 3px;
  color: #0a0e14; font-weight: 700;
  background: linear-gradient(180deg, #ffd28f, var(--amber) 60%, #d18f2b);
  border-radius: 5px; border: 1px solid #ffe0ae;
  box-shadow: 0 0 20px rgba(255, 179, 71, 0.35), 0 3px 0 #7a5216;
  transition: all .15s;
}
.btn-endturn:hover:not(:disabled) { filter: brightness(1.12); box-shadow: 0 0 30px rgba(255, 179, 71, 0.55), 0 3px 0 #7a5216; }
.btn-endturn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 0 14px rgba(255,179,71,.3), 0 1px 0 #7a5216; }
.btn-endturn:disabled { filter: grayscale(.8) brightness(.5); cursor: not-allowed; box-shadow: none; }
.btn-power {
  padding: 8px 16px; font-size: 12px; letter-spacing: 1px;
  color: var(--amber); border: var(--line-amber); border-radius: 5px;
  background: rgba(255, 179, 71, 0.07); transition: all .18s;
}
.btn-power:hover:not(:disabled) { background: rgba(255, 179, 71, 0.18); box-shadow: 0 0 14px var(--amber-glow); }
.btn-power:disabled { opacity: .4; cursor: not-allowed; }
.btn-power .cost { font-family: var(--font-mono); }
/* 伤害飘字 */
.dmg-float {
  position: fixed; z-index: 230; pointer-events: none;
  font-family: var(--font-mono); font-size: 26px; font-weight: 700;
  animation: dmg-pop 1.1s ease-out forwards;
  text-shadow: 0 2px 6px #000;
}
.dmg-float.dmg { color: var(--red); } .dmg-float.heal { color: var(--green); }
@keyframes dmg-pop { 0% { opacity: 0; transform: translateY(6px) scale(.6); } 25% { opacity: 1; transform: translateY(-4px) scale(1.25); } 100% { opacity: 0; transform: translateY(-44px) scale(1); } }
/* 对手盖伏指示 */
.secret-indicator {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
  border: 1px dashed rgba(176, 107, 255, 0.55); border-radius: 3px;
  color: var(--violet); font-size: 11px; letter-spacing: 1px;
  animation: cardback-pulse 2.4s infinite;
}

/* ============================================================
   换牌 / 弃牌 / 事件 / 休整 / 战利品 / 结算 / 结局
   ============================================================ */
.mulligan-cards { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 18px 0; }
.mulligan-cards .card { --w: 130px; cursor: pointer; }
.mulligan-cards .card.marked { filter: grayscale(.8) brightness(.5); transform: rotate(3deg); }
.mulligan-cards .card.marked::after {
  content: '替换'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 16px; letter-spacing: 4px; color: var(--red); font-weight: 700; background: rgba(6,9,14,.45);
}
.pending-cards { display: flex; gap: 12px; justify-content: center; margin: 14px 0; flex-wrap: wrap; }
.pending-cards .card { --w: 110px; pointer-events: none; }
.discard-hand { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.discard-hand .card { --w: 96px; cursor: pointer; }
.discard-hand .card:hover { transform: translateY(-8px); box-shadow: 0 0 20px var(--red-glow); }

/* 事件弹窗 */
.event-icon { width: 54px; height: 54px; margin: 0 auto 14px; color: var(--amber); }
.event-icon svg { width: 100%; height: 100%; }
.event-desc { text-align: center; font-size: 15px; line-height: 2; color: var(--text); margin-bottom: 8px; }
.event-desc b { color: var(--amber); }

/* 休整 */
.rest-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.rest-opt {
  padding: 16px 12px; text-align: center; border: var(--line-dim); border-radius: 6px;
  transition: all .2s; cursor: pointer; background: var(--bg-2);
}
.rest-opt:hover:not(.disabled) { border-color: var(--amber-dim); background: var(--amber-faint); transform: translateY(-3px); }
.rest-opt.disabled { opacity: .4; cursor: not-allowed; }
.rest-opt .ro-name { font-size: 14px; color: #eef5fa; letter-spacing: 1px; margin-bottom: 6px; }
.rest-opt .ro-cost { font-family: var(--font-mono); font-size: 12px; color: var(--amber); margin-bottom: 6px; }
.rest-opt .ro-desc { font-size: 11.5px; color: var(--text-dim); line-height: 1.6; }
.rest-stats { display: flex; gap: 18px; justify-content: center; font-family: var(--font-mono); font-size: 13px; color: var(--text-dim); flex-wrap: wrap; }
.rest-stats b { color: var(--amber); font-weight: 400; }
.rest-stats b.cyan { color: var(--cyan); }
.boss-deck-list { display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow-y: auto; margin-top: 12px; }
.boss-deck-list .deck-row { cursor: default; }
.boss-deck-list .deck-row:hover { border-color: var(--line-dim); background: var(--bg-3); }

/* 战利品二选一 */
.loot-layout { display: flex; gap: 22px; align-items: stretch; justify-content: center; flex-wrap: wrap; }
.loot-card-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.loot-card-wrap .card { --w: 170px; pointer-events: none; }
.loot-warning { text-align: center; color: var(--cyan); font-size: 12px; max-width: 200px; line-height: 1.7; }
.loot-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.loot-choice {
  padding: 16px; border: var(--line-dim); border-radius: 6px; cursor: pointer;
  transition: all .2s; text-align: center; background: var(--bg-2);
}
.loot-choice:hover { transform: translateY(-3px); }
.loot-choice.temp:hover { border-color: var(--cyan); box-shadow: 0 0 20px rgba(55,229,255,.15); }
.loot-choice.perm:hover { border-color: var(--amber); box-shadow: 0 0 20px var(--amber-glow); }
.loot-choice h4 { font-size: 15px; letter-spacing: 2px; margin-bottom: 8px; }
.loot-choice.temp h4 { color: var(--cyan); } .loot-choice.perm h4 { color: var(--amber); }
.loot-choice p { font-size: 12px; color: var(--text-dim); line-height: 1.8; }
.loot-choice p b { color: var(--red); font-weight: 500; }

/* 战斗结算 */
.result-panel { text-align: center; padding: 10px 0; }
.result-panel .rp-title { font-size: 34px; font-weight: 900; letter-spacing: 10px; margin-bottom: 6px; }
.result-panel .rp-title.win { color: var(--amber); text-shadow: 0 0 30px var(--amber-glow); }
.result-panel .rp-title.lose { color: var(--red); text-shadow: 0 0 30px var(--red-glow); }
.result-panel .rp-sub { font-family: var(--font-mono); font-size: 12px; letter-spacing: 3px; color: var(--text-dim); margin-bottom: 18px; }
.result-stats { display: flex; gap: 26px; justify-content: center; margin: 14px 0 6px; flex-wrap: wrap; }
.result-stats .rs { display: flex; flex-direction: column; gap: 2px; }
.result-stats .rs .k { font-size: 11px; color: var(--text-dim); letter-spacing: 1px; }
.result-stats .rs .v { font-family: var(--font-mono); font-size: 20px; color: var(--text); }
.result-stats .rs .v.amber { color: var(--amber); } .result-stats .rs .v.cyan { color: var(--cyan); } .result-stats .rs .v.green { color: var(--green); }

/* 结局全屏 */
.ending {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  pointer-events: auto; padding: 30px; overflow-y: auto;
  background-size: cover; background-position: center;
}
.ending::before { content: ''; position: absolute; inset: 0; background: rgba(5, 8, 12, 0.72); }
.ending > * { position: relative; z-index: 2; }
.ending .end-kicker { font-family: var(--font-mono); font-size: 13px; letter-spacing: 6px; margin-bottom: 14px; }
.ending h2 { font-size: clamp(34px, 6vw, 58px); font-weight: 900; letter-spacing: 10px; margin-bottom: 18px; }
.ending .end-desc { max-width: 560px; font-size: 15px; line-height: 2.1; color: var(--text); margin-bottom: 22px; }
.ending .end-stats { display: flex; gap: 30px; margin-bottom: 30px; flex-wrap: wrap; justify-content: center; }
.ending .end-stats .rs { display: flex; flex-direction: column; gap: 4px; }
.ending .end-stats .k { font-size: 11px; letter-spacing: 2px; color: var(--text-dim); }
.ending .end-stats .v { font-family: var(--font-mono); font-size: 24px; }
/* 突破（好结局金） */
.ending.breakthrough { background-image: linear-gradient(180deg, rgba(20,14,4,.55), rgba(6,8,12,.9)), radial-gradient(60% 45% at 50% 30%, rgba(255,179,71,.22), transparent 70%); }
.ending.breakthrough .end-kicker { color: var(--amber); }
.ending.breakthrough h2 { color: #ffe9c4; text-shadow: 0 0 40px rgba(255, 179, 71, 0.5); }
.ending .medal {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 24px; margin-bottom: 22px;
  border: 1px solid var(--amber); border-radius: 30px; color: var(--amber);
  font-size: 15px; letter-spacing: 3px; box-shadow: 0 0 26px rgba(255, 179, 71, 0.3);
  background: rgba(255, 179, 71, 0.08);
  animation: medal-in 1s cubic-bezier(.2,.9,.3,1.3);
}
@keyframes medal-in { from { transform: scale(.4); opacity: 0; } }
/* 失败 */
.ending.failed { background-image: linear-gradient(180deg, rgba(20,6,8,.6), rgba(6,8,12,.92)), radial-gradient(60% 45% at 50% 30%, rgba(255,77,94,.14), transparent 70%); }
.ending.failed .end-kicker { color: var(--red); }
.ending.failed h2 { color: #ffc9ce; text-shadow: 0 0 40px rgba(255, 77, 94, 0.45); }
/* 坏结局：白转场 + 冷白 */
.ending.bad { background: #e8f4f8; animation: bad-whiteout 2.2s ease-out; }
.ending.bad::before { display: none; }
@keyframes bad-whiteout { 0% { background: #0a0e14; } 40% { background: #fff; } 100% { background: #e8f4f8; } }
.ending.bad .end-kicker { color: #5a7c8c; }
.ending.bad h2 { color: #12242e; text-shadow: none; letter-spacing: 6px; }
.ending.bad .end-desc { color: #2c4756; }
.ending.bad .end-stats .k { color: #6c8a98; }
.ending.bad .end-stats .v { color: #12242e; }
.ending.bad .btn { color: #0c6d84; border-color: rgba(12, 109, 132, 0.5); background: rgba(12, 109, 132, 0.06); }
.ending.bad .oren-line { font-family: var(--font-mono); font-size: 20px; letter-spacing: 4px; color: #0e5064; margin-bottom: 20px; }
.reward-card-show { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 20px; }
.reward-card-show .card { --w: 130px; pointer-events: none; }
.reward-card-show .rc-label { font-size: 12px; letter-spacing: 2px; color: var(--text-dim); }

/* ============================================================
   卡册
   ============================================================ */
.codex { max-width: 1340px; margin: 0 auto; padding: 22px 24px 80px; }
.codex-tabs { display: flex; gap: 10px; margin: 16px 0 20px; }
.codex-tab {
  padding: 9px 26px; font-family: var(--font-mono); font-size: 13px; letter-spacing: 2px;
  border: var(--line-dim); border-radius: 4px; color: var(--text-dim); transition: all .18s;
}
.codex-tab:hover { color: var(--text); }
.codex-tab.active.human { color: var(--amber); border-color: var(--amber-dim); background: var(--amber-faint); }
.codex-tab.active.ai { color: var(--cyan); border-color: var(--cyan-dim); background: var(--cyan-faint); }
.codex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.codex-grid .card { --w: 150px; }
.codex-grid .card.not-owned { filter: grayscale(.9) brightness(.45); }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1100px) {
  .battle { grid-template-columns: 1fr 260px; }
  .deckbuild-cols { grid-template-columns: 1fr 320px; }
}
@media (max-width: 860px) {
  .battle {
    grid-template-columns: 1fr; grid-template-rows: auto auto 1fr auto;
    grid-template-areas: "ai" "mid" "me" "side";
    overflow-y: auto; height: auto; min-height: 100vh;
  }
  .b-side { border-left: none; border-top: var(--line-dim); max-height: 260px; }
  .b-hand { flex-wrap: wrap; min-height: 0; }
  .b-hand .card { --w: 92px; }
  .deckbuild-cols { grid-template-columns: 1fr; }
  .deck-panel-col { position: static; max-height: none; overflow: visible; }
  .minion { --mw: 70px; }
  .minion .m-name { font-size: 10px; }
  .topbar { gap: 10px; padding: 8px 12px; }
  .landing h1 { letter-spacing: 6px; }
  .rest-grid { grid-template-columns: 1fr; }
  .loot-choices { grid-template-columns: 1fr; }
}

/* ============================================================
   3D 舞台 & CSS3D 竞技场（方案B：全 3D 战斗重构）
   ============================================================ */
#fx-canvas {
  position: fixed; inset: 0; z-index: 1;
  width: 100vw; height: 100vh; display: block;
}
/* 3D 舞台激活后：CSS 网格层退场，静态 JPG 背景弱化为氛围垫底 */
body.fx3d .fx-grid { display: none; }
body.fx3d .landing-bg { opacity: .22; }
body.fx3d .base-bg { opacity: .28; }
body.fx3d .battle { background: transparent; }

/* CSS3D 竞技场层：全屏 3D 战场（英雄/随从悬浮于其中） */
.fx-arena {
  position: fixed !important; inset: 0; z-index: 3;
  pointer-events: none;
}
.arena-item { pointer-events: none; }
.arena-item .minion, .arena-item .hero-target { pointer-events: auto; }

/* 3D 模式下的战场中央区：DOM 行只做空场提示，不拦截点击 */
body.arena3d .b-mid { pointer-events: none; z-index: 5; }
body.arena3d .b-ai, body.arena3d .b-side, body.arena3d .b-me { position: relative; z-index: 6; }

/* 英雄 medallion 升维：OREN 俯瞰战场，指挥官亲临阵前 */
.arena-hero-ai .b-portrait {
  width: 108px; height: 108px; border-width: 3px;
  box-shadow: 0 0 34px rgba(55, 229, 255, 0.5), 0 0 90px rgba(55, 229, 255, 0.18);
}
.arena-hero-me .me-portrait {
  width: 96px; height: 96px; border-width: 3px;
  box-shadow: 0 0 30px rgba(255, 179, 71, 0.5), 0 0 80px rgba(255, 179, 71, 0.16);
}
.arena-hero.targetable .b-portrait, .arena-hero.targetable .me-portrait {
  outline: 3px solid var(--red); outline-offset: 5px;
}

/* ---------- 玻璃拟态电影化（DOM HUD 浮于 3D 舞台之上） ---------- */
body.fx3d .b-ai {
  background: linear-gradient(180deg, rgba(8, 13, 20, 0.72), rgba(8, 13, 20, 0.28));
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
body.fx3d .b-side {
  background: linear-gradient(180deg, rgba(9, 14, 21, 0.78), rgba(7, 11, 17, 0.86));
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
body.fx3d .b-me {
  background: linear-gradient(0deg, rgba(14, 10, 5, 0.66), rgba(10, 8, 5, 0.18));
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
body.fx3d .panel {
  background: rgba(10, 16, 24, 0.78);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
body.fx3d .feature {
  background: rgba(10, 16, 24, 0.62);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
body.fx3d .node-card {
  background: linear-gradient(180deg, rgba(15, 22, 32, 0.82), rgba(9, 13, 19, 0.86));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
/* landing 标题增强：电影海报级光晕 */
body.fx3d .landing h1 {
  text-shadow: 0 0 24px rgba(255, 179, 71, 0.5), 0 0 90px rgba(255, 179, 71, 0.28), 0 4px 30px rgba(0, 0, 0, 0.8);
}

/* ============================================================
   电影化战斗场景（cine 布局：全屏战场 + 角标 HUD）
   ============================================================ */
.battle.cine { position: relative; height: 100vh; overflow: hidden; display: block; background: transparent; }
/* 节点战场背景（7 战线差异化）：铺底 + 中央暗化，保证卡牌/随从在中央的可读性 */
.b-battle-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-size: cover; background-position: center;
  opacity: .42; /* 整体压低亮度，避免与 3D 舞台和 HUD 抢层次 */
}
.b-battle-bg::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(62% 58% at 50% 46%, rgba(3, 5, 9, 0.78), rgba(3, 5, 9, 0.28) 70%, rgba(3, 5, 9, 0.05) 100%),
    linear-gradient(180deg, rgba(3, 5, 9, 0.55), transparent 22%, transparent 74%, rgba(3, 5, 9, 0.6));
}

/* 顶部 AI 窄条（固定高度：揭示手牌/盖伏指示出现不改变条高，不挤压其他区域） */
.b-topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 6; height: 64px; box-sizing: border-box;
  display: flex; align-items: center; gap: 18px; padding: 9px 22px;
  background: linear-gradient(180deg, rgba(7, 11, 18, 0.78), rgba(7, 11, 18, 0.30) 78%, transparent);
  border-bottom: 1px solid rgba(55, 229, 255, 0.10);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.bt-left { display: flex; align-items: center; gap: 12px; }
.b-topbar .b-portrait { width: 44px; height: 44px; border-width: 2px; }
.bt-name { font-size: 15px; letter-spacing: 2px; color: var(--cyan); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bt-name .node-tag { font-size: 10px; color: var(--text-dim); font-family: var(--font-mono); }
.bt-mid { flex: 1; max-width: 560px; display: flex; flex-direction: column; gap: 4px; }
.b-topbar .b-ai-meta { font-size: 11px; gap: 12px; }
.b-topbar .b-hero-power { max-width: 190px; padding: 5px 10px; }
.b-topbar .b-revealed { margin-left: auto; }

/* 中央战场：3D 模式只放空场提示；2D 回退正常摆随从行 */
.battle.cine .b-mid { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; justify-content: center; pointer-events: none; }
.battle.cine .b-board-row { flex: none; min-height: 120px; }

/* 角标 HUD */
.b-hud {
  position: absolute; bottom: 186px; z-index: 6;
  display: flex; align-items: center; gap: 14px; padding: 10px 16px;
  background: rgba(8, 12, 18, 0.55); border: var(--line-dim); border-radius: 8px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.b-hud.bl { left: 22px; max-width: 300px; }
.b-hud .bars { display: flex; flex-direction: column; gap: 5px; min-width: 180px; }
.b-hud .me-portrait { width: 46px; height: 46px; flex-shrink: 0; }

/* 右下角 HUD：垂直分栏，每组独占一行，整齐排列 */
.b-hud.br {
  right: 22px;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 300px;
  padding: 12px 14px;
}
.b-hud.br .humanity-meter {
  padding: 5px 10px;
  gap: 8px;
  justify-content: space-between;
}
.b-hud.br .humanity-meter .hm-label { font-size: 10px; letter-spacing: 1px; }
.b-hud.br .humanity-meter .hm-value { font-size: 20px; }
.b-hud.br .humanity-meter .hm-value small { font-size: 11px; }
.b-hud.br .humanity-meter .hm-pip { width: 5px; height: 12px; }
.b-hud.br .humanity-meter .hm-pips { gap: 2px; }

/* 操作按钮行：英雄技能 + 结束回合 */
.b-hud.br .b-actions {
  display: flex; flex-direction: row; gap: 8px; align-items: stretch;
}
.b-hud.br .b-actions .btn-power {
  flex: 1; padding: 8px 10px; font-size: 11px; letter-spacing: 0.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.b-hud.br .b-actions .btn-endturn {
  flex: 0 0 auto; padding: 8px 18px; font-size: 13px; letter-spacing: 2px;
}

/* 子操作行：撤退 + 断开 + 休整 + 倒计时 */
.b-hud.br .b-subactions {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end;
}
.b-hud.br .b-subactions .btn { padding: 4px 10px; font-size: 11px; }
.b-hud.br .b-subactions .mono { display: inline-block; min-width: 64px; text-align: right; font-size: 11px; }

/* 扇形手牌 */
.battle.cine .b-hand {
  position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%); z-index: 7;
  display: flex; align-items: flex-end; justify-content: center; padding: 0; min-height: 0;
}
.battle.cine .b-hand .card {
  --w: 112px; margin: 0 -16px; cursor: pointer;
  transform: rotate(var(--fr, 0deg)) translateY(var(--fy, 0px));
  transform-origin: 50% 130%;
  transition: transform .22s cubic-bezier(.2,.8,.3,1.2), box-shadow .2s, filter .2s;
}
.battle.cine .b-hand .card:hover {
  transform: rotate(0deg) translateY(-52px) scale(1.16); z-index: 20;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.75), 0 0 24px rgba(255, 179, 71, 0.18);
}
.battle.cine .b-hand .card.selected { transform: rotate(0deg) translateY(-52px) scale(1.16); z-index: 20; }
.battle.cine .b-hand .card.unaffordable { filter: grayscale(.55) brightness(.55); }

/* 战斗记录：芯片 + 抽屉 */
.b-logchip {
  position: absolute; left: 22px; bottom: 20px; z-index: 8;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px; color: var(--text-dim);
  border: var(--line-dim); padding: 7px 16px; border-radius: 4px;
  background: rgba(8, 12, 18, 0.6); backdrop-filter: blur(8px); transition: all .2s;
}
.b-logchip:hover { color: var(--cyan); border-color: rgba(55, 229, 255, 0.4); }
.b-logdrawer {
  position: absolute; left: 22px; bottom: 62px; z-index: 8;
  width: 430px; max-width: 84vw; max-height: 0; overflow: hidden;
  transition: max-height .35s cubic-bezier(.2,.8,.3,1);
  background: rgba(7, 11, 17, 0.92); border: var(--line-dim); border-radius: 8px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.b-logdrawer.open { max-height: 320px; }
.b-logdrawer .b-log { max-height: 260px; overflow-y: auto; }

/* OREN 信息面板：固定在右上（桌面）/ 顶部一行（移动），整合人格名+状态+最近嘲讽/推理+可展开历史 */
.b-oren-panel {
  position: absolute; top: 74px; right: 22px; z-index: 7;
  width: 340px; max-width: 40vw;
  background: rgba(8, 12, 18, 0.72); border: 1px solid rgba(55, 229, 255, 0.22); border-radius: 8px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
  transition: max-height .3s cubic-bezier(.2,.8,.3,1);
  max-height: 132px;
}
.b-oren-panel.open { max-height: 420px; }
.op-head {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border-bottom: 1px solid rgba(55, 229, 255, 0.12);
  font-family: var(--font-mono); font-size: 12px;
}
.op-kicker { color: var(--cyan); letter-spacing: 2px; font-size: 10px; opacity: .8; }
.op-name { color: var(--cyan); font-weight: 700; letter-spacing: 1px; }
.op-status {
  margin-left: auto; font-size: 10px; padding: 2px 8px; border-radius: 3px;
  color: var(--text-dim); border: 1px solid var(--line-dim);
}
.op-status[data-s="ai"] { color: var(--amber); border-color: rgba(255,179,71,.5); animation: caret-blink 1.4s infinite; }
.op-toggle {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; color: var(--text-dim);
  border: var(--line-dim); padding: 2px 8px; border-radius: 3px; background: transparent; transition: all .18s;
}
.op-toggle:hover { color: var(--cyan); border-color: rgba(55,229,255,.4); }
.op-latest { padding: 6px 12px 8px; height: 80px; overflow-y: auto; } /* 固定槽位+内部滚动：嘲讽/推理出现不推动版面 */
.op-line .op-speaker { display: block; font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; color: var(--cyan); margin-bottom: 4px; opacity: .9; }
.op-line.reason .op-speaker { color: var(--violet); }
.op-line .op-txt { font-size: 13px; line-height: 1.6; color: #e8eef5; display: block; }
.op-line.reason .op-txt { color: var(--text-dim); font-size: 12px; }
.op-history { display: none; border-top: 1px solid rgba(55, 229, 255, 0.12); max-height: 240px; overflow-y: auto; padding: 6px 12px 10px; }
.b-oren-panel.open .op-history { display: block; }
.op-hline { padding: 5px 0; border-bottom: 1px dashed rgba(55,229,255,.08); font-size: 12px; line-height: 1.5; }
.op-hline:last-child { border-bottom: none; }
.op-hline .op-hspeaker { font-family: var(--font-mono); font-size: 10px; color: var(--cyan); margin-right: 6px; opacity: .75; }
.op-hline.reason .op-hspeaker { color: var(--violet); }
.op-hline .op-htxt { color: var(--text-dim); }
.op-hline.reason .op-htxt { font-size: 11px; }

/* 2D 回退嘲讽浮层 / OREN 思考芯片 */
.b-taunt-dom { position: absolute; top: 86px; left: 50%; transform: translateX(-50%); z-index: 7; max-width: 480px; }

.b-taunt-dom .taunt-line {
  padding: 12px 18px; background: rgba(9, 14, 21, 0.88); border: 1px solid rgba(55, 229, 255, 0.35);
  border-left: 3px solid var(--cyan); border-radius: 2px 10px 10px 2px;
  box-shadow: 0 0 24px rgba(55, 229, 255, 0.15); backdrop-filter: blur(6px);
}
.b-thinking {
  position: absolute; top: 86px; left: 50%; transform: translateX(-50%); z-index: 7;
  display: flex; align-items: center; gap: 10px; padding: 8px 16px;
  border: 1px dashed rgba(55, 229, 255, 0.3); border-radius: 6px;
  background: rgba(9, 14, 21, 0.85); backdrop-filter: blur(8px);
  font-family: var(--font-mono); font-size: 12px; color: var(--cyan); letter-spacing: 1px;
}
.b-thinking .skeleton-bar { width: 56px; margin: 0; }

/* ---------- 世界内全息投影（3D 空间中的 OREN 嘲讽） ---------- */
.holo-taunt {
  max-width: 300px; padding: 12px 16px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, rgba(10, 20, 28, 0.82), rgba(8, 14, 22, 0.62));
  border: 1px solid rgba(55, 229, 255, 0.4); border-left: 3px solid var(--cyan);
  border-radius: 2px 10px 10px 2px;
  box-shadow: 0 0 26px rgba(55, 229, 255, 0.20), inset 0 0 30px rgba(55, 229, 255, 0.05);
  color: #d8ecf5; font-size: 13.5px; line-height: 1.8;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.holo-taunt::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(55, 229, 255, 0.07) 0 2px, transparent 2px 5px);
  animation: holo-scan 3s linear infinite;
}
.holo-taunt .ht-speaker { font-family: var(--font-mono); font-size: 10px; letter-spacing: 2px; color: var(--cyan); display: block; margin-bottom: 4px; }
.holo-taunt .ht-text.typing::after { content: '▌'; color: var(--cyan); animation: caret-blink .8s steps(1) infinite; }
.holo-taunt.fade { opacity: 0; transform: translateY(-16px); transition: opacity .6s, transform .6s; }
@keyframes holo-scan { to { transform: translateY(5px); } }

/* 攻击能量光束 */
.arena-beam {
  height: 5px; border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--amber) 30%, #fff 50%, var(--amber) 70%, transparent);
  box-shadow: 0 0 18px var(--amber-glow), 0 0 44px var(--amber-glow);
}
.arena-beam.ai {
  background: linear-gradient(90deg, transparent, var(--cyan) 30%, #fff 50%, var(--cyan) 70%, transparent);
  box-shadow: 0 0 18px var(--cyan-glow), 0 0 44px var(--cyan-glow);
}

/* 3D 伤害/治疗浮字 */
.arena-float {
  font-family: var(--font-mono); font-size: 34px; font-weight: 700;
  text-shadow: 0 2px 10px #000; transition: opacity .85s ease-in;
}
.arena-float.dmg { color: var(--red); text-shadow: 0 0 20px var(--red-glow), 0 2px 8px #000; }
.arena-float.heal { color: var(--green); text-shadow: 0 0 20px rgba(93, 255, 157, 0.5), 0 2px 8px #000; }
.arena-float.out { opacity: 0; }
.arena-ghost, .arena-proj-card { pointer-events: none !important; }

/* 屏幕转场：光束冲刷 */
#fx-flash {
  position: fixed; inset: 0; z-index: 70; pointer-events: none; opacity: 0;
  background: linear-gradient(100deg, transparent 22%, rgba(55, 229, 255, 0.5) 45%, rgba(255, 255, 255, 0.92) 50%, rgba(55, 229, 255, 0.5) 55%, transparent 78%);
  background-size: 320% 100%; background-position: 110% 0;
}
#fx-flash.run { animation: fx-flash-sweep .55s ease-in-out; }
@keyframes fx-flash-sweep {
  0% { opacity: 0; background-position: 110% 0; }
  12% { opacity: 1; }
  100% { opacity: 0; background-position: -10% 0; }
}

/* ---------- Landing 开机电影：逐行点亮 ---------- */
.landing > * { animation: boot-up .9s cubic-bezier(.2,.8,.3,1) backwards; }
.landing .landing-bg { animation: none; }
.landing .landing-oren-eye { animation: boot-up 1s .25s backwards, eye-float 5s 1.4s ease-in-out infinite; }
.landing h1 { animation: boot-up 1s .55s backwards, title-glitch 7s 2s infinite; }
.landing .lore { animation-delay: 1.0s; }
.landing .question { animation-delay: 1.45s; }
.landing .landing-features { animation-delay: 1.8s; }
.landing .btn { animation-delay: 2.1s; }
.landing .landing-foot { animation-delay: 2.4s; }
@keyframes boot-up {
  from { opacity: 0; transform: translateY(26px); filter: blur(8px); }
}

/* ---------- cine 布局移动端回退（2D） ---------- */
@media (max-width: 860px) {
  .battle.cine { display: flex; flex-direction: column; height: auto; min-height: 100vh; overflow-y: auto; }
  .b-topbar { position: static; flex-wrap: wrap; }
  .battle.cine .b-mid { position: static; pointer-events: auto; }
  .b-hud.bl, .b-hud.br { position: static; margin: 6px 12px; max-width: none; }
  .b-hud.br { width: auto; flex-direction: column; }
  .battle.cine .b-hand { position: static; transform: none; flex-wrap: wrap; padding: 8px; }
  .battle.cine .b-hand .card { --w: 92px; margin: 0 3px; transform: none; }
  .battle.cine .b-hand .card:hover { transform: translateY(-8px); }
  .b-logchip { position: fixed; bottom: 12px; left: 12px; }
  .b-logdrawer { position: fixed; left: 12px; bottom: 54px; }
  /* 嘲讽/思考芯片脱离文档流：出现时不推动其他区域位移 */
  .b-taunt-dom, .b-thinking { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); margin: 0; max-width: 92vw; z-index: 20; }
  /* OREN 面板：窄屏收缩为顶部一行，点"记录"展开历史 */
  .b-oren-panel { position: static; width: auto; max-width: none; margin: 6px 12px; max-height: 96px; }
  .b-oren-panel.open { max-height: 360px; }
  .op-latest { padding: 6px 12px 8px; height: 56px; }
  .op-line .op-txt { font-size: 12px; }
}

/* ============================================================
   统一电影化页面语言（base / deck / codex / landing）
   ============================================================ */
/* 页面头：kicker + 大标题 + 刻度线 */
.cine-head { position: relative; margin-bottom: 26px; padding-top: 4px; animation: boot-up .8s cubic-bezier(.2,.8,.3,1) backwards; }
.ck-kicker {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 5px;
  color: var(--cyan); opacity: .85; margin-bottom: 8px;
}
.ck-kicker::before { content: '▸ '; color: var(--amber); }
.cine-head h2 {
  font-size: clamp(26px, 3.4vw, 38px); font-weight: 900; letter-spacing: 8px; color: #f0f6fa;
  text-shadow: 0 0 24px rgba(55, 229, 255, 0.22), 0 2px 18px rgba(0, 0, 0, 0.7);
}
.ck-rule { height: 1px; margin: 12px 0 10px; background: linear-gradient(90deg, rgba(55, 229, 255, 0.5), rgba(55, 229, 255, 0.12) 40%, transparent); position: relative; }
.ck-rule i { position: absolute; left: 0; top: -2.5px; width: 34px; height: 6px; background: var(--cyan); box-shadow: 0 0 12px var(--cyan-glow); clip-path: polygon(0 0, 100% 0, 78% 100%, 0 100%); }
.cine-head .sub { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); letter-spacing: 2px; }
.cine-head .ck-back { position: absolute; right: 0; top: 6px; }

/* 全息面板：角括号 + 半透明 + 扫描 */
.holo-panel { position: relative; }
.holo-panel::before, .holo-panel::after {
  content: ''; position: absolute; width: 14px; height: 14px; pointer-events: none;
  transition: all .25s;
}
.holo-panel::before {
  top: -1px; left: -1px;
  border-top: 2px solid var(--nc, var(--cyan-dim)); border-left: 2px solid var(--nc, var(--cyan-dim));
}
.holo-panel::after {
  bottom: -1px; right: -1px;
  border-bottom: 2px solid var(--nc, var(--cyan-dim)); border-right: 2px solid var(--nc, var(--cyan-dim));
}

/* 基地：节点卡电影化 */
.node-card.holo-panel {
  background: linear-gradient(180deg, rgba(13, 20, 30, 0.86), rgba(8, 12, 19, 0.90));
  border: 1px solid rgba(120, 150, 175, 0.14);
  border-radius: 4px;
  animation: boot-up .7s cubic-bezier(.2,.8,.3,1) backwards;
}
.node-card.holo-panel:hover {
  border-color: color-mix(in srgb, var(--nc, var(--cyan)) 55%, transparent);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.6), 0 0 22px color-mix(in srgb, var(--nc, var(--cyan)) 18%, transparent);
  transform: translateY(-4px);
}
.node-card.holo-panel:hover::before, .node-card.holo-panel:hover::after { width: 22px; height: 22px; }
.node-visual { height: 138px; }
.node-visual::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.14) 0 2px, transparent 2px 5px);
  opacity: .5;
}
.base-note { margin-top: 24px; font-size: 12px; color: var(--text-faint); letter-spacing: 1px; border-left: 2px solid var(--amber-dim); padding-left: 12px; line-height: 1.8; }
.base-note b { color: var(--amber); font-weight: 500; }

/* 构筑：提示条 + 全息卡组面板 + 收藏入场节拍 */
.db-tip { font-size: 12.5px; color: var(--text-dim); margin-bottom: 14px; border-left: 2px solid var(--amber-dim); padding-left: 12px; line-height: 1.8; }
.db-tip b { color: var(--amber); font-weight: 500; }
.deck-panel.holo-panel { padding: 16px; border: 1px solid rgba(255, 179, 71, 0.22); --nc: var(--amber-dim); background: rgba(12, 10, 6, 0.55); }
.deck-panel .dp-head { display: flex; align-items: baseline; justify-content: space-between; letter-spacing: 3px; font-size: 14px; }
.deck-panel .dp-sec { margin: 12px 0 4px; font-size: 12px; letter-spacing: 2px; color: var(--text-dim); }
.collection-list .card { animation: boot-up .5s cubic-bezier(.2,.8,.3,1) backwards; }
.collection-list .card:nth-child(3n+1) { animation-delay: .05s; }
.collection-list .card:nth-child(3n+2) { animation-delay: .12s; }
.collection-list .card:nth-child(3n) { animation-delay: .19s; }
.codex-grid .card { animation: boot-up .5s cubic-bezier(.2,.8,.3,1) backwards; }
.codex-grid .card:nth-child(4n+1) { animation-delay: .04s; }
.codex-grid .card:nth-child(4n+2) { animation-delay: .09s; }
.codex-grid .card:nth-child(4n+3) { animation-delay: .14s; }
.codex-grid .card:nth-child(4n) { animation-delay: .19s; }

/* landing：kicker 行 + feature 全息面板 */
.landing-kicker {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 6px; color: var(--cyan);
  margin-bottom: 14px; opacity: .9;
}
.landing-kicker::before, .landing-kicker::after { content: ' — '; color: var(--text-faint); }
.feature.holo-panel { background: rgba(10, 16, 24, 0.62); border: 1px solid rgba(120, 150, 175, 0.16); border-radius: 4px; }
.feature.holo-panel:hover { border-color: rgba(55, 229, 255, 0.45); }
.feature.holo-panel:hover::before, .feature.holo-panel:hover::after { width: 20px; height: 20px; border-color: var(--cyan); }

/* ============================================================
   新手引导：电影式剧情导览
   ============================================================ */
.guide {
  position: relative; min-height: 100vh; overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column; justify-content: flex-end;
}
/* 影院黑边 */
.g-bar {
  position: absolute; left: 0; right: 0; height: 9vh; z-index: 8;
  background: #020407;
}
.g-bar.top { top: 0; border-bottom: 1px solid rgba(55, 229, 255, 0.14); }
.g-bar.bottom { bottom: 0; border-top: 1px solid rgba(55, 229, 255, 0.14); }
.g-skip {
  position: absolute; top: calc(9vh + 18px); right: 26px; z-index: 9;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 2px;
  color: var(--text-dim); border: var(--line-dim); padding: 8px 16px; border-radius: 4px;
  background: rgba(8, 12, 18, 0.5); backdrop-filter: blur(6px); transition: all .2s;
}
.g-skip:hover { color: var(--amber); border-color: var(--amber-dim); }
/* 字幕区 */
.g-text {
  position: relative; z-index: 7; max-width: 760px;
  margin: 0 auto 15vh; padding: 0 28px; text-align: center;
}
.g-kicker {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 6px;
  color: var(--cyan); margin-bottom: 12px;
}
.g-kicker::before { content: '▸ '; color: var(--amber); }
.g-title {
  font-size: clamp(28px, 4.6vw, 46px); font-weight: 900; letter-spacing: 10px;
  color: #f2f8fc; text-shadow: 0 0 30px rgba(55, 229, 255, 0.3), 0 3px 20px rgba(0, 0, 0, 0.8);
  margin-bottom: 18px;
}
.g-subtitle {
  min-height: 3.6em; font-size: clamp(15px, 2vw, 18px); line-height: 2;
  color: #d9e9f2; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}
.g-subtitle.typing::after { content: '▌'; color: var(--cyan); animation: caret-blink .8s steps(1) infinite; }
/* 中央演示道具 */
.g-visual {
  position: absolute; top: 20vh; left: 50%; transform: translateX(-50%);
  z-index: 7; display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.g-cards { display: flex; gap: 18px; }
.g-cards .card { --w: 128px; animation: boot-up .7s backwards; }
.g-cards .card:nth-child(2) { animation-delay: .12s; }
.g-cards .card:nth-child(3) { animation-delay: .24s; }
.g-battle-demo {
  display: flex; flex-direction: column; gap: 14px; padding: 18px 22px;
  background: rgba(8, 12, 18, 0.72); border: var(--line-dim); border-radius: 8px;
  backdrop-filter: blur(8px); animation: boot-up .6s backwards;
}
.gd-row { display: flex; align-items: center; gap: 12px; }
.gd-tag { font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px; color: var(--text-dim); }
.gd-chip { font-size: 11px; padding: 2px 10px; border-radius: 3px; }
.gd-chip.cyan { color: var(--cyan); border: 1px solid rgba(55, 229, 255, 0.5); background: var(--cyan-faint); }
.gd-chip.amber { color: var(--amber); border: 1px solid rgba(255, 179, 71, 0.5); background: var(--amber-faint); }
.gd-note { font-size: 11.5px; color: var(--text-dim); }
.g-humanity-demo { display: flex; flex-direction: column; align-items: center; gap: 12px; animation: boot-up .6s backwards; }
/* 进度点 + 提示 */
.g-dots { position: absolute; bottom: 4.6vh; left: 50%; transform: translateX(-50%); z-index: 9; display: flex; gap: 10px; }
.g-dot { width: 22px; height: 3px; background: rgba(120, 150, 175, 0.3); transition: all .3s; }
.g-dot.on { background: var(--cyan); box-shadow: 0 0 8px var(--cyan-glow); }
.g-hint {
  position: absolute; bottom: 4vh; right: 28px; z-index: 9;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px; color: var(--text-faint);
  animation: caret-blink 1.6s infinite;
}
.guide .btn.big { animation: boot-up .6s backwards; }

/* landing CTA 行 */
.landing-cta { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: center; }
.btn.ghost {
  padding: 12px 26px; letter-spacing: 2px; font-size: 15px;
  color: var(--cyan); border: 1px solid rgba(55, 229, 255, 0.45); border-radius: 5px;
  background: rgba(55, 229, 255, 0.05); transition: all .2s;
}
.btn.ghost:hover { background: rgba(55, 229, 255, 0.14); box-shadow: 0 0 20px rgba(55, 229, 255, 0.25); }

/* ============================================================
   光束传送（指挥室 → 战场）
   ============================================================ */
#fx-teleport { position: fixed; inset: 0; z-index: 80; pointer-events: none; }
#fx-teleport .tp-beam {
  position: absolute; top: -10vh; bottom: -10vh; left: 50%;
  width: 2px; transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.98) 30%, rgba(190, 245, 255, 1) 50%, rgba(255, 255, 255, 0.98) 70%, transparent);
  box-shadow: 0 0 30px rgba(55, 229, 255, 0.9), 0 0 90px rgba(55, 229, 255, 0.5);
  opacity: 0;
}
#fx-teleport .tp-streaks {
  position: absolute; inset: 0; opacity: 0;
  background: repeating-linear-gradient(180deg, transparent 0 14px, rgba(120, 230, 255, 0.10) 14px 16px);
}
#fx-teleport .tp-white { position: absolute; inset: 0; background: #eafcff; opacity: 0; }
#fx-teleport.run .tp-beam {
  animation: tp-beam-grow 0.62s cubic-bezier(.7, 0, .3, 1) forwards, tp-beam-out 0.7s 0.75s ease-in forwards;
}
#fx-teleport.run .tp-streaks { animation: tp-streaks-run 1.3s linear; }
#fx-teleport.run .tp-white { animation: tp-white-flash 1.35s ease-in-out; }
@keyframes tp-beam-grow {
  0% { opacity: 0; width: 2px; }
  35% { opacity: 1; width: 10px; }
  100% { opacity: 1; width: 120vw; }
}
@keyframes tp-beam-out { to { opacity: 0; } }
@keyframes tp-streaks-run {
  0% { opacity: 0; transform: translateY(0); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-46vh); }
}
@keyframes tp-white-flash {
  0%, 45% { opacity: 0; }
  55% { opacity: 0.96; }
  68% { opacity: 0.96; }
  100% { opacity: 0; }
}

/* 指挥室布局：顶部为全息作战模型留出演示区 */
.base-inner .cine-head { position: relative; z-index: 2; }
.base-inner .node-grid { margin-top: 34vh; }
.base-inner .base-note { margin-bottom: 40px; }
@media (max-width: 860px) {
  .base-inner .node-grid { margin-top: 16vh; }
}

/* 引导剧情插画：Ken Burns 推摇 + 章间交叉淡化 */
.g-img {
  position: absolute; inset: 0; z-index: 1;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1.4s ease;
  transform: scale(1.08);
}
.g-img.on { opacity: 1; animation: kenburns 16s ease-in-out infinite alternate; }
@keyframes kenburns {
  from { transform: scale(1.06) translate(0.6%, 0.4%); }
  to { transform: scale(1.16) translate(-0.8%, -0.6%); }
}
.g-shade {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(3, 6, 10, 0.55), transparent 30%, transparent 55%, rgba(3, 6, 10, 0.82) 92%),
    radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(3, 6, 10, 0.55) 100%);
}
.guide .g-text, .guide .g-visual, .guide .g-bar, .guide .g-skip, .guide .g-dots, .guide .g-hint { z-index: 7; }
.guide .g-bar { z-index: 8; }

/* ============================================================
   基地沙盘直选：全息详情面板 + 扫描提示条
   ============================================================ */
.sand-hint {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 26px; border: var(--line-dim); border-radius: 4px;
  background: rgba(8, 12, 18, 0.55); backdrop-filter: blur(8px);
  font-family: var(--font-mono); letter-spacing: 2px; white-space: nowrap;
  transition: border-color .25s, box-shadow .25s;
  pointer-events: none;
}
.sand-hint .sh-name { font-size: 15px; color: var(--cyan); letter-spacing: 3px; }
.sand-hint .sh-sub { font-size: 11px; color: var(--text-dim); }
.sand-hint.hot { border-color: rgba(55, 229, 255, 0.4); box-shadow: 0 0 18px rgba(55, 229, 255, 0.10); }

/* 悬浮 HUD 节点卡（跟随 3D 投影坐标，点击展开详情面板） */
.sand-huds { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
.sand-hud {
  position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer;
  width: 126px; padding: 0 0 6px; overflow: hidden;
  display: flex; flex-direction: column; gap: 5px;
  border: 1px solid color-mix(in srgb, var(--nc, var(--cyan)) 42%, transparent);
  border-radius: 4px;
  background: rgba(8, 13, 20, 0.74); backdrop-filter: blur(6px);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.5), 0 0 14px color-mix(in srgb, var(--nc, var(--cyan)) 12%, transparent);
  font-family: inherit; text-align: left;
  transition: border-color .2s, box-shadow .2s, filter .2s;
}
.sand-hud::before,
.sand-hud::after {
  content: ''; position: absolute; width: 10px; height: 10px; z-index: 2;
  transition: all .2s;
}
.sand-hud::before {
  top: -1px; left: -1px;
  border-top: 2px solid var(--nc, var(--cyan)); border-left: 2px solid var(--nc, var(--cyan));
}
.sand-hud::after {
  bottom: -1px; right: -1px;
  border-bottom: 2px solid var(--nc, var(--cyan)); border-right: 2px solid var(--nc, var(--cyan));
}
.sand-hud .sh-t { height: 54px; overflow: hidden; position: relative; background: #0c121b; }
.sand-hud .sh-t img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(0.9); }
.sand-hud .sh-t::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(8, 13, 20, 0.85));
}
.sand-hud .sh-n { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; padding: 0 8px; }
.sand-hud .sh-n b { font-size: 13px; letter-spacing: 2px; color: #eef4f9; white-space: nowrap; }
.sand-hud .sh-n i { font-style: normal; font-size: 9px; letter-spacing: 1px; font-family: var(--font-mono); color: var(--nc, var(--cyan)); opacity: .85; white-space: nowrap; }
.sand-hud:hover,
.sand-hud.on {
  border-color: color-mix(in srgb, var(--nc, var(--cyan)) 85%, transparent);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.55), 0 0 22px color-mix(in srgb, var(--nc, var(--cyan)) 30%, transparent);
  filter: brightness(1.18);
}
@media (max-width: 900px) {
  .sand-hud { width: 96px; }
  .sand-hud .sh-t { height: 40px; }
  .sand-hud .sh-n b { font-size: 11px; letter-spacing: 1px; }
}

.sand-panel {
  position: fixed; right: 22px; top: 50%; transform: translateY(-50%);
  width: min(350px, 92vw); z-index: 4;
  background: linear-gradient(180deg, rgba(13, 20, 30, 0.88), rgba(8, 12, 19, 0.93));
  border: 1px solid color-mix(in srgb, var(--nc, var(--cyan)) 32%, transparent);
  border-radius: 6px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6), 0 0 26px color-mix(in srgb, var(--nc, var(--cyan)) 12%, transparent);
  animation: sp-in .35s cubic-bezier(.2, .8, .3, 1);
}
@keyframes sp-in {
  from { opacity: 0; transform: translateY(-50%) translateX(26px); }
  to { opacity: 1; transform: translateY(-50%) translateX(0); }
}
.sp-close {
  position: absolute; top: 8px; right: 10px; z-index: 3;
  width: 30px; height: 30px; border: var(--line-dim); border-radius: 4px;
  color: var(--text-dim); font-size: 16px; line-height: 1;
  background: rgba(8, 12, 18, 0.6); transition: all .2s;
}
.sp-close:hover { color: var(--amber); border-color: var(--amber-dim); }
.sp-visual {
  height: 108px; position: relative;
  background-color: #0c121b; background-size: cover; background-position: center;
}
.sp-visual::before {
  content: ''; position: absolute; inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(55, 229, 255, 0.05) 0 1px, transparent 1px 26px),
    radial-gradient(70% 90% at 50% 120%, rgba(55, 229, 255, 0.14), transparent 60%);
}
.sp-visual.has-img::before { background: linear-gradient(180deg, transparent 30%, rgba(9, 13, 19, 0.94)); }
.sp-visual::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.14) 0 2px, transparent 2px 5px);
  opacity: .5;
}
.sp-body { padding: 14px 16px 16px; }
.sp-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.sp-title b { font-size: 20px; letter-spacing: 4px; color: #f0f6fa; }
.sp-persona { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; color: var(--cyan); letter-spacing: 1px; }
.sp-persona .np-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--nc, var(--cyan)); box-shadow: 0 0 8px var(--cyan-glow); animation: caret-blink 1.6s infinite; }
.sp-power { font-size: 12.5px; color: var(--text-dim); line-height: 1.6; margin-bottom: 12px; }
.sp-power b { color: var(--text); font-weight: 500; }
.sp-hp { margin-bottom: 14px; }
.sp-hp .ng-row { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-dim); font-family: var(--font-mono); margin-bottom: 4px; letter-spacing: 1px; }
.sp-hp .ng-row .warn { color: var(--red); }
.sp-hp .assim { display: block; margin-top: 4px; font-size: 11px; color: var(--violet); font-family: var(--font-mono); }
.sp-diffs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

/* 沙盘模式：说明条移至左下角，不遮挡沙盘 */
.sand-mode .base-note {
  position: fixed; left: 22px; bottom: 22px; z-index: 3; max-width: 300px;
  margin: 0; padding: 8px 12px; border-radius: 4px;
  background: rgba(8, 12, 18, 0.45); backdrop-filter: blur(6px);
}
/* 沙盘模式：隐藏页头标题（信息并入顶部栏与底部提示条），把顶部空间让给悬浮 HUD 节点卡 */
.sand-mode .cine-head { display: none; }
@media (max-width: 900px) {
  .sand-mode .base-note { display: none; }
  .sand-hint { max-width: 92vw; white-space: normal; text-align: center; }
  .sand-panel {
    left: 0; right: 0; top: auto; bottom: 0; transform: none;
    width: 100%; max-height: 62vh; overflow-y: auto;
    border-radius: 10px 10px 0 0;
    animation: sp-in-m .35s cubic-bezier(.2, .8, .3, 1);
  }
}
@keyframes sp-in-m {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 教学关「第一课」提示浮层（v12） ---------- */
.tutorial-hint {
  position: fixed; left: 50%; bottom: 148px; transform: translateX(-50%);
  width: min(560px, 92vw); padding: 10px 16px 8px; z-index: 40;
  background: rgba(6, 18, 26, .82); border: 1px solid rgba(55, 229, 255, .35);
  backdrop-filter: blur(6px); pointer-events: none;
}
.tutorial-hint .th-kicker { font-family: var(--font-mono); font-size: 10px; letter-spacing: 2px; color: var(--amber); }
.tutorial-hint .th-text { font-size: 13px; line-height: 1.8; color: #d8ecf5; margin-top: 3px; }
.tutorial-hint .th-note { font-size: 10px; color: var(--text-faint); margin-top: 4px; }

/* AI 公开理由（reason_public，GDD §12.3） */
.taunt-line.reason-line { margin-top: 6px; border-top: 1px dashed rgba(55, 229, 255, .25); padding-top: 6px; }
.taunt-line.reason-line .speaker { color: var(--amber); }

/* ---------- 叙事触发（v12.2 §19） ---------- */
.sp-briefing, .node-briefing {
  font-size: 11px; line-height: 1.7; color: var(--amber);
  border-left: 2px solid rgba(255, 176, 30, .4); padding-left: 8px; margin: 6px 0;
}
.sp-briefing b, .node-briefing b { color: var(--amber); font-weight: 600; }
.rest-dialogue {
  display: flex; gap: 8px; align-items: baseline; margin-bottom: 10px; padding: 8px 10px;
  background: rgba(255, 176, 30, .06); border: 1px solid rgba(255, 176, 30, .25);
}
.rest-dialogue .rd-speaker { font-family: var(--font-mono); font-size: 11px; color: var(--amber); letter-spacing: 1px; flex: none; }
.rest-dialogue .rd-text { font-size: 13px; line-height: 1.8; color: var(--text); }
.essence-block { margin: 0 0 16px; padding: 14px 18px; }
.essence-block .es-title { font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px; color: var(--cyan); margin-bottom: 8px; }
.essence-block .es-text { font-size: 13px; line-height: 2; color: var(--text); white-space: pre-wrap; }
