/* =========================================================================
 * VOIDWEAVER · 虚空织者 — 界面样式
 * 深空玻璃拟态 / 青紫霓虹 / 渐变描边 / 噪点与暗角（纯 CSS + 内联 SVG）
 * 无外部图片、无外部字体。所有尺寸按 1920×1080 与 1366×768 双基准调校。
 * ========================================================================= */

/* ------------------------------ 设计变量 ------------------------------ */
:root {
  --void: #04050c;
  --void-2: #070a16;
  --panel-a: rgba(13, 19, 36, 0.72);
  --panel-b: rgba(7, 10, 22, 0.62);
  --glass: rgba(9, 12, 24, 0.55);
  --glass-2: rgba(12, 17, 32, 0.78);

  --cyan: #4de3ff;
  --cyan-dim: rgba(77, 227, 255, 0.42);
  --magenta: #ff3fa4;
  --violet: #9d6bff;
  --amber: #ffb347;
  --mint: #6dffc8;
  --danger: #ff5566;

  --text: #e9f3ff;
  --text-2: #c3d6ea;
  --text-dim: #93a9c2;
  --text-mute: #657a95;

  --line: rgba(122, 198, 255, 0.18);
  --line-soft: rgba(122, 198, 255, 0.1);

  --font-cn: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  --font-en: "Avenir Next", "Futura", "Century Gothic", "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Roboto Mono", "Menlo", "Consolas", monospace;

  --ease: cubic-bezier(0.2, 0.9, 0.25, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --cut: 14px;

  --shadow-panel: 0 18px 46px rgba(0, 0, 0, 0.5);
}

/* ------------------------------ 基础重置 ------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--void);
  color: var(--text);
  font-family: var(--font-cn);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

button, select, input { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, select:focus-visible {
  outline: 2px solid rgba(77, 227, 255, 0.9);
  outline-offset: 2px;
}
svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
b, strong { font-weight: 600; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 600; }
em { font-style: normal; }

.hidden { display: none !important; }
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: 0.01em;
}
.dim { color: var(--text-dim); }
.mini-dot { font-style: normal; color: var(--cyan); font-size: 0.82em; vertical-align: 1px; }

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(ellipse 70% 55% at 50% 62%, rgba(77, 227, 255, 0.075), transparent 62%),
    radial-gradient(circle at 18% 18%, rgba(157, 107, 255, 0.12), transparent 46%),
    radial-gradient(circle at 84% 76%, rgba(255, 63, 164, 0.085), transparent 48%),
    linear-gradient(180deg, #05060f 0%, #04050c 100%);
}

#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

/* ------------------------------ 画面氛围层 ------------------------------ */
#stage-fx {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}
.fx-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 78% 74% at 50% 48%, transparent 42%, rgba(2, 3, 8, 0.42) 78%, rgba(2, 3, 8, 0.82) 100%),
    linear-gradient(180deg, rgba(2, 3, 8, 0.5) 0%, transparent 18%, transparent 76%, rgba(2, 3, 8, 0.52) 100%);
}
.fx-grain {
  position: absolute;
  inset: -40px;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}
.fx-scan {
  position: absolute;
  inset: 0;
  opacity: 0.14;
  background: repeating-linear-gradient(180deg, rgba(190, 235, 255, 0.06) 0 1px, transparent 1px 3px);
  mix-blend-mode: soft-light;
}
.fx-edge {
  position: absolute;
  width: 44px;
  height: 44px;
  opacity: 0.55;
}
.fx-edge::before, .fx-edge::after { content: ""; position: absolute; background: linear-gradient(90deg, var(--cyan), transparent); }
.fx-edge::before { width: 100%; height: 1px; top: 0; }
.fx-edge::after { width: 1px; height: 100%; left: 0; background: linear-gradient(180deg, var(--cyan), transparent); }
.fxe-tl { top: 16px; left: 16px; }
.fxe-tr { top: 16px; right: 16px; transform: scaleX(-1); }
.fxe-bl { bottom: 16px; left: 16px; transform: scaleY(-1); }
.fxe-br { bottom: 16px; right: 16px; transform: scale(-1); }

#vw-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ------------------------------ 通用面板 ------------------------------ */
.panel {
  position: relative;
  border: 1px solid transparent;
  border-radius: 2px;
  background:
    linear-gradient(160deg, var(--panel-a), var(--panel-b)) padding-box,
    linear-gradient(135deg, rgba(77, 227, 255, 0.6), rgba(157, 107, 255, 0.2) 42%, rgba(255, 63, 164, 0.42)) border-box;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 0 26px rgba(77, 227, 255, 0.045),
    var(--shadow-panel);
  backdrop-filter: blur(9px) saturate(125%);
  -webkit-backdrop-filter: blur(9px) saturate(125%);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 26%);
}
.panel::after {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  width: 44%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(140, 238, 255, 0.9), transparent);
  opacity: 0.8;
}
.panel-sheen {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.panel-sheen::before {
  content: "";
  position: absolute;
  top: -30%;
  left: -20%;
  width: 60%;
  height: 160%;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.05) 48%, transparent 62%);
  transform: rotate(6deg);
}

/* ------------------------------ HUD 顶部 ------------------------------ */
#hud {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}
#hud button, #inspect-panel { pointer-events: auto; }

.hud-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: minmax(300px, 392px) 1fr minmax(300px, 372px);
  gap: clamp(14px, 2vw, 30px);
  padding: clamp(16px, 2vh, 26px) clamp(16px, 2vw, 30px) 0;
  align-items: start;
}

/* 核心面板 */
.panel-core { padding: 12px 16px 12px; }
.cap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--text-dim);
}
.cap-cn { color: #d8ecff; font-weight: 600; letter-spacing: 0.22em; }
.cap .en {
  font-family: var(--font-en);
  font-size: 9px;
  letter-spacing: 0.32em;
  color: var(--text-mute);
}
.cap-state {
  margin-left: auto;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--mint);
  opacity: 0.88;
}
.bar {
  position: relative;
  height: 10px;
  margin: 10px 0 8px;
  background: rgba(2, 5, 12, 0.82);
  border: 1px solid rgba(120, 200, 255, 0.16);
  overflow: hidden;
}
.bar > i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  display: block;
  transition: width 0.42s var(--ease-out);
  background: linear-gradient(90deg, rgba(77, 227, 255, 0.75), #7ff3ff 52%, #b9fdff);
  box-shadow: 0 0 14px rgba(77, 227, 255, 0.7), inset 0 0 8px rgba(255, 255, 255, 0.35);
}
.bar-ticks {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(2, 6, 14, 0.55) calc(10% - 1px) 10%);
  pointer-events: none;
}
.bar-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.32), transparent 45%);
  pointer-events: none;
}
.panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.panel-row > b {
  font-size: 15px;
  letter-spacing: 0.06em;
  color: #e8fbff;
  text-shadow: 0 0 12px rgba(77, 227, 255, 0.4);
}
.slots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
.slots b { color: #bfefff; }
.slots .dim { color: var(--text-mute); }
.slot-pips { display: inline-flex; gap: 3px; margin-left: 3px; }
.slot-pip {
  width: 5px;
  height: 9px;
  background: rgba(120, 200, 255, 0.16);
  border: 1px solid rgba(120, 200, 255, 0.24);
  transform: skewX(-16deg);
}
.slot-pip.used {
  background: linear-gradient(180deg, #9ff4ff, #4de3ff);
  border-color: rgba(180, 248, 255, 0.7);
  box-shadow: 0 0 8px rgba(77, 227, 255, 0.7);
}

/* 波次 */
.hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.panel-wave {
  width: clamp(212px, 22vw, 312px);
  padding: 10px 16px 11px;
  text-align: center;
}
.wave-cap {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 7px;
  line-height: 1;
}
.wave-cap .cap-en {
  font-family: var(--font-en);
  font-size: 9px;
  letter-spacing: 0.34em;
  color: var(--text-mute);
}
.wave-cap > b {
  font-size: 22px;
  color: #f0fbff;
  text-shadow: 0 0 14px rgba(77, 227, 255, 0.45);
}
.wave-cap .dim { font-size: 11px; color: var(--text-mute); }
.wave-name {
  margin-top: 4px;
  font-size: 12px;
  letter-spacing: 0.3em;
  padding-left: 0.3em;
  color: #cfe6f7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wave-sub {
  margin-top: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text-dim);
}
.wave-timer-wrap { display: inline-flex; align-items: center; gap: 6px; }
.timer-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  animation: softPulse 2s ease-in-out infinite;
}
#wave-timer { color: #d9f6ff; letter-spacing: 0.08em; font-size: 12px; }
#hud.phase-combat .timer-dot { background: var(--magenta); box-shadow: 0 0 8px var(--magenta); animation-duration: 0.8s; }
#wave-progress { font-size: 10px; color: var(--text-mute); }
/* HUD 关卡名（DESIGN 9.3）：小字，按关卡主题轻微变色 */
.wave-level-name {
  margin-top: 2px;
  font-family: var(--font-en);
  font-size: 8.5px;
  letter-spacing: 0.24em;
  color: rgba(150, 214, 242, 0.82);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 0 12px rgba(77, 227, 255, 0.25);
}
#hud[data-level-theme="tide"] .wave-level-name { color: rgba(140, 232, 255, 0.86); }
#hud[data-level-theme="echo"] .wave-level-name { color: rgba(196, 168, 255, 0.9); }
#hud[data-level-theme="ember"] .wave-level-name { color: rgba(255, 198, 128, 0.9); }
#hud[data-level-theme="eye"] .wave-level-name { color: rgba(255, 150, 202, 0.9); }

/* 提前召唤 */
.call-wave {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 29px;
  margin-top: 8px;
  padding: 0 14px 0 9px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #effcff;
  font-size: 11.5px;
  border: 1px solid rgba(77, 227, 255, 0.5);
  background: linear-gradient(180deg, rgba(24, 44, 66, 0.8), rgba(8, 15, 28, 0.72));
  box-shadow: 0 0 20px -8px rgba(77, 227, 255, 0.65), inset 0 0 14px rgba(77, 227, 255, 0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.15s var(--ease), color 0.2s;
  white-space: nowrap;
}
.call-wave .cw-icon { width: 14px; height: 14px; color: var(--cyan); filter: drop-shadow(0 0 5px rgba(77, 227, 255, 0.7)); }
.call-wave .cw-sub { font-size: 9px; color: rgba(170, 212, 234, 0.95); letter-spacing: 0.06em; }
.call-wave:hover {
  color: #ffffff;
  border-color: rgba(77, 227, 255, 0.7);
  box-shadow: 0 0 22px -4px rgba(77, 227, 255, 0.55), inset 0 0 14px rgba(77, 227, 255, 0.12);
  transform: translateY(-1px);
}
.call-wave:active { transform: translateY(0) scale(0.985); }
.call-wave.is-off { opacity: 0.4; color: var(--text-mute); }
.call-wave.is-off .cw-icon { color: var(--text-mute); filter: none; }
.call-wave.is-ready { animation: waveReady 2.4s ease-in-out infinite; }

/* HUD 右上 */
.hud-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
  min-width: 0;
}
.controls {
  display: flex;
  align-items: stretch;
  height: 34px;
  border: 1px solid rgba(122, 198, 255, 0.16);
  background: linear-gradient(180deg, rgba(12, 18, 32, 0.62), rgba(6, 9, 18, 0.58));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
}
.ico-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 37px;
  height: 100%;
  color: #a9c4da;
  border-right: 1px solid rgba(122, 198, 255, 0.1);
  transition: color 0.18s, background 0.18s, box-shadow 0.18s;
}
.ico-btn svg { width: 15px; height: 15px; }
.ico-btn.mono { font-size: 12px; letter-spacing: 0.04em; width: 41px; }
.ico-btn:hover { color: #ecfbff; background: rgba(77, 227, 255, 0.1); box-shadow: inset 0 0 16px rgba(77, 227, 255, 0.12); }
.ico-btn:active { background: rgba(77, 227, 255, 0.16); }
.ico-btn.is-on { color: var(--cyan); text-shadow: 0 0 10px rgba(77, 227, 255, 0.6); }
.ico-btn .ic-muted { display: none; }
.ico-btn.is-muted { color: var(--danger); }
.ico-btn.is-muted .ic-sound { display: none; }
.ico-btn.is-muted .ic-muted { display: block; }
.fps {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  font-size: 10px;
  color: var(--text-mute);
  border-right: 0;
}

/* 资源 */
.panel-res {
  width: clamp(220px, 20.5vw, 288px);
  padding: 8px 14px 10px;
}
.res {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 0;
}
.res + .res { border-top: 1px solid rgba(122, 198, 255, 0.08); }
.res-ico { width: 19px; height: 19px; flex: 0 0 19px; filter: drop-shadow(0 0 6px rgba(77, 227, 255, 0.4)); }
.res-essence .res-ico { color: var(--cyan); }
.res-flux .res-ico { color: var(--violet); filter: drop-shadow(0 0 6px rgba(157, 107, 255, 0.55)); }
.res-meta { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.res-meta em { font-style: normal; font-size: 10px; letter-spacing: 0.16em; color: var(--text-dim); }
.res-meta small { font-family: var(--font-en); font-size: 7.5px; letter-spacing: 0.22em; color: var(--text-mute); }
.res > b { margin-left: auto; font-size: 19px; font-weight: 500; color: #eafaff; letter-spacing: 0.03em; text-shadow: 0 0 14px rgba(120, 220, 255, 0.28); }
.res-flux > b { color: #e3dbff; text-shadow: 0 0 14px rgba(157, 107, 255, 0.35); }
.res-flux > b .dim { font-size: 11px; color: var(--text-mute); text-shadow: none; }
.flux-track {
  position: relative;
  height: 3px;
  margin: 6px 0 1px 29px;
  background: rgba(2, 5, 12, 0.8);
  overflow: hidden;
}
.flux-track i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, rgba(157, 107, 255, 0.8), #c9b6ff);
  box-shadow: 0 0 10px rgba(157, 107, 255, 0.7);
  transition: width 0.4s var(--ease-out);
}
#hud.flux-ready .res-flux .res-ico { animation: softPulse 1.6s ease-in-out infinite; }
#hud.flux-ready .flux-track i { box-shadow: 0 0 14px var(--violet); }

/* ------------------------------ Boss 血条 ------------------------------ */
#boss-bar {
  position: absolute;
  top: clamp(176px, 18.5vh, 214px);
  left: 50%;
  transform: translateX(-50%);
  width: min(560px, 44vw);
  padding: 9px 15px 10px;
  z-index: 12;
  animation: bossIn 0.6s var(--ease-out) both;
}
#boss-bar::after { left: 6%; width: 36%; }
.boss-line {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: #ffd6e6;
}
.boss-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-en);
  font-size: 9px;
  letter-spacing: 0.28em;
  color: var(--magenta);
  padding: 2px 7px;
  border: 1px solid rgba(255, 63, 164, 0.35);
  background: rgba(255, 63, 164, 0.08);
}
.boss-tag svg { width: 12px; height: 12px; }
#boss-name { font-weight: 600; text-shadow: 0 0 16px rgba(255, 63, 164, 0.5); }
#boss-hp { margin-left: auto; font-size: 10.5px; color: #ffc3da; letter-spacing: 0.05em; }
.boss-bar { height: 7px; margin: 0; border-color: rgba(255, 63, 164, 0.3); }
.boss-bar > i {
  background: linear-gradient(90deg, rgba(255, 63, 164, 0.7), #ff6bb5 60%, #ffd0e4);
  box-shadow: 0 0 16px rgba(255, 63, 164, 0.6), inset 0 0 8px rgba(255, 255, 255, 0.25);
}

/* ------------------------------ 选中检查面板 ------------------------------ */
#inspect-panel {
  position: absolute;
  right: clamp(16px, 2vw, 30px);
  bottom: clamp(158px, 19vh, 206px);
  width: clamp(238px, 19.5vw, 292px);
  padding: 13px 15px 14px;
  z-index: 12;
  animation: inspectIn 0.3s var(--ease-out) both;
}
.inspect-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(122, 198, 255, 0.12);
}
#inspect-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #e8f8ff;
  text-shadow: 0 0 14px rgba(77, 227, 255, 0.28);
}
#inspect-level { font-size: 10px; letter-spacing: 0.1em; color: var(--cyan); }
.inspect-stats { display: flex; flex-direction: column; gap: 3px; padding: 9px 0 10px; }
.istat { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--text-dim); }
.istat > b { font-weight: 500; font-size: 11.5px; color: #d9f0ff; }
.istat .up { color: var(--mint); font-size: 9px; margin-left: 4px; }
.inspect-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.ia-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 30px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #cfeaff;
  border: 1px solid rgba(77, 227, 255, 0.24);
  background: linear-gradient(180deg, rgba(30, 52, 78, 0.54), rgba(10, 18, 32, 0.5));
  transition: all 0.18s var(--ease);
  white-space: nowrap;
}
.ia-btn svg { width: 12px; height: 12px; }
.ia-btn:hover:not(:disabled) {
  color: #fff;
  border-color: rgba(77, 227, 255, 0.68);
  box-shadow: 0 0 18px -5px rgba(77, 227, 255, 0.7), inset 0 0 12px rgba(77, 227, 255, 0.12);
}
.ia-btn:active:not(:disabled) { transform: scale(0.975); }
.ia-btn:disabled { opacity: 0.32; cursor: not-allowed; }
.ia-btn.sell { border-color: rgba(255, 179, 71, 0.25); color: #ffd9a6; }
.ia-btn.sell:hover:not(:disabled) { border-color: rgba(255, 179, 71, 0.7); box-shadow: 0 0 18px -5px rgba(255, 179, 71, 0.55); }
.ia-btn.polarity { border-color: rgba(157, 107, 255, 0.3); color: #ded2ff; }
.ia-btn.polarity:hover:not(:disabled) { border-color: rgba(157, 107, 255, 0.75); box-shadow: 0 0 18px -5px rgba(157, 107, 255, 0.6); }
.ia-btn.wide { grid-column: 1 / -1; }

/* ------------------------------ 提示条 ------------------------------ */
.hint-bar {
  position: absolute;
  left: 50%;
  bottom: clamp(126px, 16.5vh, 186px);
  transform: translateX(-50%) translateY(6px);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(215, 240, 255, 0.86);
  background: rgba(7, 12, 24, 0.62);
  border: 1px solid rgba(77, 227, 255, 0.16);
  padding: 6px 14px;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}
.hint-bar.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.hint-bar kbd { margin: 0 2px; }
kbd {
  display: inline-block;
  min-width: 18px;
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-style: normal;
  text-align: center;
  color: #cfeaff;
  border: 1px solid rgba(122, 198, 255, 0.28);
  border-bottom-color: rgba(122, 198, 255, 0.42);
  background: linear-gradient(180deg, rgba(28, 44, 68, 0.55), rgba(8, 14, 26, 0.65));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ------------------------------ HUD 底部 ------------------------------ */
#hud-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 13;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(8px, 1vw, 14px);
  padding: 48px clamp(12px, 2vw, 28px) clamp(15px, 2vh, 26px);
  background: linear-gradient(180deg, transparent 0%, rgba(3, 5, 12, 0.2) 30%, rgba(3, 5, 12, 0.6) 62%, rgba(3, 5, 12, 0.88) 100%);
  pointer-events: none;
}
#build-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(7px, 0.7vw, 10px);
  width: clamp(640px, 58.5vw, 920px);
  pointer-events: auto;
}

/* 建造卡 */
.build-card {
  --acc: var(--cyan);
  position: relative;
  display: grid;
  grid-template-columns: clamp(30px, 2.7vw, 40px) minmax(0, 1fr);
  grid-template-rows: auto auto;
  grid-template-areas: "icon name" "icon cost";
  align-items: center;
  column-gap: 8px;
  height: clamp(72px, 8.3vh, 92px);
  padding: 12px 11px 9px 10px;
  text-align: left;
  border: 1px solid transparent;
  background:
    linear-gradient(165deg, rgba(14, 21, 38, 0.82), rgba(6, 10, 20, 0.78)) padding-box,
    linear-gradient(150deg, color-mix(in srgb, var(--acc) 46%, transparent), rgba(122, 198, 255, 0.12) 46%, rgba(255, 63, 164, 0.16)) border-box;
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 11px, 100% 100%, 0 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), 0 10px 26px rgba(0, 0, 0, 0.38);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease), filter 0.2s;
  overflow: hidden;
}
.build-card[data-build="mortar"] { --acc: var(--amber); }
.build-card[data-build="tesla"] { --acc: var(--violet); }
.build-card[data-build="stasis"] { --acc: var(--mint); }
.build-card[data-build="anchor"] { --acc: var(--magenta); }
.build-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--acc), transparent 66%);
  opacity: 0.7;
  transition: opacity 0.2s;
}
.build-card:hover {
  transform: translateY(-5px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 16px 34px rgba(0, 0, 0, 0.5),
    0 0 26px -6px color-mix(in srgb, var(--acc) 65%, transparent);
}
.build-card:hover::before { opacity: 1; }
.build-card:hover .bc-icon {
  color: #fff;
  box-shadow: 0 0 22px -4px color-mix(in srgb, var(--acc) 85%, transparent), inset 0 0 16px color-mix(in srgb, var(--acc) 28%, transparent);
}
.build-card:active { transform: translateY(-1px) scale(0.99); }
.build-card:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.build-card.is-active {
  transform: translateY(-7px);
  background:
    linear-gradient(165deg, color-mix(in srgb, var(--acc) 13%, rgba(13, 20, 36, 0.9)), rgba(6, 10, 20, 0.9)) padding-box,
    linear-gradient(150deg, var(--acc), color-mix(in srgb, var(--acc) 40%, var(--violet))) border-box;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--acc) 55%, transparent), 0 18px 40px rgba(0, 0, 0, 0.55), 0 0 34px -8px color-mix(in srgb, var(--acc) 90%, transparent), inset 0 0 26px color-mix(in srgb, var(--acc) 12%, transparent);
}
.build-card.is-active .bc-key { color: #051018; background: var(--acc); border-color: var(--acc); }
.build-card.is-broke .bc-cost { color: var(--danger); text-shadow: 0 0 10px rgba(255, 85, 102, 0.35); }
.build-card.is-broke .bc-cost i { color: var(--danger); }
.build-card.is-locked { filter: grayscale(0.7) brightness(0.72); }
.build-card.is-locked .bc-icon { opacity: 0.5; }
.bc-key {
  position: absolute;
  top: 5px;
  left: 5px;
  z-index: 3;
  min-width: 15px;
  height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #9fc4dd;
  background: rgba(4, 8, 16, 0.72);
  border: 1px solid rgba(122, 198, 255, 0.22);
  transition: all 0.2s;
}
.bc-count {
  position: absolute;
  top: 5px;
  right: 6px;
  z-index: 3;
  font-size: 9px;
  color: var(--text-mute);
  opacity: 0;
  transition: opacity 0.2s;
}
.bc-count.show { opacity: 1; color: color-mix(in srgb, var(--acc) 70%, #ffffff); }
.bc-icon {
  grid-area: icon;
  width: clamp(30px, 2.7vw, 40px);
  height: clamp(30px, 2.7vw, 40px);
  padding: clamp(7px, 0.62vw, 9px);
  color: color-mix(in srgb, var(--acc) 88%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--acc) 32%, transparent);
  background:
    radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--acc) 20%, transparent), transparent 72%),
    rgba(3, 7, 14, 0.55);
  box-shadow: inset 0 0 14px color-mix(in srgb, var(--acc) 12%, transparent);
  transition: color 0.2s, box-shadow 0.2s;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%);
}
.bc-name {
  grid-area: name;
  align-self: end;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  font-size: clamp(11px, 0.86vw, 13.5px);
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #e6f5ff;
  white-space: nowrap;
  overflow: hidden;
}
.bc-name em {
  font-family: var(--font-en);
  font-size: clamp(6.6px, 0.46vw, 7.8px);
  font-weight: 400;
  letter-spacing: 0.19em;
  color: var(--text-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bc-cost {
  grid-area: cost;
  align-self: start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  font-size: clamp(12px, 0.9vw, 14px);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #f0fbff;
}
.bc-cost i { font-style: normal; font-size: 0.72em; color: var(--cyan); opacity: 0.9; }
.bc-shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 36%, rgba(255, 255, 255, 0.11) 48%, transparent 60%);
  transform: translateX(-120%);
  transition: transform 0.55s var(--ease);
}
.build-card:hover .bc-shine, .build-card.is-active .bc-shine { transform: translateX(120%); }

/* 技能 */
#ability-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(7px, 0.7vw, 9px);
  width: clamp(228px, 19vw, 292px);
  pointer-events: auto;
}
.ability {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  justify-items: center;
  height: clamp(72px, 8.3vh, 92px);
  padding: 8px 6px 7px;
  overflow: hidden;
  border: 1px solid transparent;
  background:
    linear-gradient(170deg, rgba(18, 15, 40, 0.84), rgba(7, 8, 20, 0.8)) padding-box,
    linear-gradient(155deg, rgba(157, 107, 255, 0.5), rgba(77, 227, 255, 0.12) 48%, rgba(255, 63, 164, 0.3)) border-box;
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 26px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s, filter 0.2s;
}
.ability > * { position: relative; z-index: 2; }
.ability .ab-cd { position: absolute; z-index: 1; transition: background 0.18s linear; }
.ability .ab-cdtext { z-index: 4; }
.ability:hover {
  transform: translateY(-5px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 16px 34px rgba(0, 0, 0, 0.5), 0 0 28px -7px rgba(157, 107, 255, 0.8);
}
.ability:active { transform: translateY(-1px) scale(0.99); }
.ability:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.ab-key {
  position: absolute;
  top: 5px;
  left: 6px;
  font-size: 9px;
  color: #a99ae0;
}
.ab-icon {
  align-self: center;
  width: clamp(24px, 2.1vw, 30px);
  height: clamp(24px, 2.1vw, 30px);
  color: #c6b3ff;
  filter: drop-shadow(0 0 8px rgba(157, 107, 255, 0.55));
  transition: color 0.2s, filter 0.2s, transform 0.2s;
}
.ab-name {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  font-size: clamp(10px, 0.78vw, 12px);
  font-weight: 600;
  letter-spacing: 0.18em;
  padding-left: 0.18em;
  color: #e4e0ff;
  white-space: nowrap;
}
.ab-name em {
  font-family: var(--font-en);
  font-size: clamp(6px, 0.42vw, 7px);
  font-weight: 400;
  letter-spacing: 0.17em;
  color: var(--text-mute);
}
.ab-cost {
  position: absolute;
  top: 5px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: #cfc4ff;
}
.ab-cost i { font-style: normal; font-size: 0.75em; color: var(--violet); }
.ab-cd {
  inset: 0;
  background: conic-gradient(from -90deg, rgba(3, 5, 13, 0.84) calc(var(--cd, 0) * 1turn), rgba(3, 5, 13, 0) 0);
  pointer-events: none;
}
.ab-cdtext {
  position: absolute;
  left: 50%;
  top: 56%;
  transform: translate(-50%, -50%);
  font-size: 15px;
  color: #e6f6ff;
  text-shadow: 0 0 14px rgba(0, 0, 0, 0.9);
  opacity: 0;
}
.ability.is-cooling .ab-cdtext { opacity: 1; }
.ability.is-cooling .ab-icon { color: #6a6187; filter: none; }
.ability.is-cooling .ab-name { color: #8d86a8; }
.ability.is-ready { border-color: rgba(157, 107, 255, 0.62); }
.ability.is-ready .ab-icon { color: #efe9ff; filter: drop-shadow(0 0 12px rgba(157, 107, 255, 0.9)); animation: abilityReady 2.6s ease-in-out infinite; }
.ability.is-ready::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 22px rgba(157, 107, 255, 0.16);
}
.ability.is-broke .ab-cost { color: var(--danger); }
.ability.is-broke .ab-cost i { color: var(--danger); }
.ab-ready { display: none; }
#ability-bar .ability.is-idle {
  cursor: not-allowed;
  filter: saturate(0.55) brightness(0.82);
  opacity: 0.55;
}
#ability-bar #ability-bar .ability.is-idle:hover { transform: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 26px rgba(0, 0, 0, 0.4); }
.ability.is-idle .ab-icon { filter: none; color: #7d86a8; }
.ability.is-idle .ab-name { color: #98a2bf; }
.ability.is-idle .ab-cdtext {
  opacity: 1;
  font-family: var(--font-cn);
  font-size: 9.5px;
  letter-spacing: 0.28em;
  padding-left: 0.28em;
  color: #9fb0d0;
  text-shadow: none;
}
.ability.is-idle.is-cooling .ab-cdtext { font-family: var(--font-mono); letter-spacing: 0.02em; padding-left: 0; color: #e6f6ff; }

/* ------------------------------ 核心低血量 ------------------------------ */
#hud.low-core .panel-core {
  animation: coreWarn 1.05s ease-in-out infinite;
  background:
    linear-gradient(160deg, rgba(38, 13, 22, 0.78), rgba(16, 6, 12, 0.7)) padding-box,
    linear-gradient(135deg, rgba(255, 85, 102, 0.9), rgba(255, 63, 164, 0.5)) border-box;
}
#hud.low-core .core-bar > i {
  background: linear-gradient(90deg, rgba(255, 85, 102, 0.8), #ff8ca0 55%, #ffd2d8);
  box-shadow: 0 0 16px rgba(255, 85, 102, 0.75);
}
#hud.low-core .cap-state { color: var(--danger); }
#hud.core-flash .panel-core { animation: coreFlash 0.5s steps(2) 2; }
#app.low-core #stage-fx .fx-vignette {
  background:
    radial-gradient(ellipse 70% 70% at 50% 50%, transparent 44%, rgba(80, 4, 18, 0.34) 82%, rgba(60, 2, 12, 0.62) 100%),
    linear-gradient(180deg, rgba(2, 3, 8, 0.5), transparent 20%, transparent 74%, rgba(2, 3, 8, 0.55));
  transition: background 0.4s;
}

/* ------------------------------ 屏幕通用 ------------------------------ */
.screen {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 4vh, 52px) clamp(18px, 3vw, 48px);
  overflow: hidden;
}
.screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 72% at 50% 46%, rgba(2, 3, 9, 0.7), rgba(2, 3, 9, 0.92) 76%, rgba(2, 3, 9, 0.97) 100%);
  backdrop-filter: blur(4px) saturate(0.9);
  -webkit-backdrop-filter: blur(4px) saturate(0.9);
}
.screen > * { position: relative; z-index: 2; }
.screen.hidden { display: none; }

/* ------------------------------ 标题页 ------------------------------ */
#screen-title { align-items: center; z-index: 32; }
#screen-pause { z-index: 42; }
#screen-howto { z-index: 50; }
#screen-result { z-index: 60; }
#screen-title::before { display: none; }
.title-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 62% at 50% 50%, rgba(3, 5, 16, 0.7) 0%, rgba(3, 5, 16, 0.6) 40%, rgba(3, 5, 16, 0.34) 66%, rgba(2, 3, 9, 0.3) 82%, rgba(2, 3, 9, 0.72) 100%),
    linear-gradient(180deg, rgba(2, 3, 9, 0.93) 0%, rgba(2, 3, 9, 0.56) 13%, rgba(2, 3, 9, 0.14) 32%, transparent 50%, rgba(2, 3, 9, 0.34) 76%, rgba(2, 3, 9, 0.94) 100%);
  backdrop-filter: blur(2.4px) saturate(0.92);
  -webkit-backdrop-filter: blur(2.4px) saturate(0.92);
  pointer-events: none;
}
.title-wrap::before {
  content: "";
  position: absolute;
  inset: -6% -4%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse 58% 52% at 50% 36%, rgba(2, 4, 12, 0.55), rgba(2, 4, 12, 0.18) 58%, transparent 76%);
  filter: blur(10px);
}
.title-rings {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(92vh, 82vw);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0.7;
}
.title-rings i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(77, 227, 255, 0.1);
  animation: ringSpin 60s linear infinite;
}
.title-rings i:nth-child(1) { inset: 14%; border-color: rgba(157, 107, 255, 0.16); animation-duration: 46s; animation-direction: reverse; border-style: dashed; }
.title-rings i:nth-child(2) { inset: 4%; border-color: rgba(77, 227, 255, 0.1); animation-duration: 72s; }
.title-rings i:nth-child(3) { inset: -8%; border-color: rgba(255, 63, 164, 0.08); animation-duration: 96s; animation-direction: reverse; }
.title-rings b {
  position: absolute;
  inset: 32%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(77, 227, 255, 0.1), transparent 64%);
  filter: blur(10px);
  animation: ringBreath 8s ease-in-out infinite;
}
.title-wrap {
  position: relative;
  width: min(1340px, 94vw);
  text-align: center;
  animation: titleIn 1s var(--ease-out) both;
}
.title-kicker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-family: var(--font-en);
  font-size: clamp(9px, 0.8vw, 11px);
  letter-spacing: 0.52em;
  color: rgba(178, 224, 246, 0.92);
  text-transform: uppercase;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.9), 0 0 26px rgba(0, 0, 0, 0.65);
  animation: riseIn 0.9s 0.15s var(--ease-out) both;
}
.k-line {
  width: clamp(36px, 4vw, 70px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(77, 227, 255, 0.75));
}
.k-line:last-child { background: linear-gradient(90deg, rgba(77, 227, 255, 0.75), transparent); }
.k-text { white-space: nowrap; }
.title-logo {
  position: relative;
  margin: clamp(8px, 1.6vh, 20px) 0 0;
  font-family: var(--font-en);
  font-size: clamp(52px, 8vw, 156px);
  line-height: 0.94;
  font-weight: 800;
  letter-spacing: 0.075em;
  padding-left: 0.075em;
  background: linear-gradient(180deg, #ffffff 0%, #e6faff 22%, #9feaff 48%, #9d6bff 74%, #ff63b2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter:
    drop-shadow(0 0 26px rgba(77, 227, 255, 0.34))
    drop-shadow(0 10px 44px rgba(157, 107, 255, 0.3))
    drop-shadow(-1.5px 0 0 rgba(255, 63, 164, 0.28))
    drop-shadow(1.5px 0 0 rgba(77, 227, 255, 0.28));
  -webkit-text-stroke: 1.5px rgba(2, 4, 12, 0.32);
  animation: logoIn 0.95s 0.1s var(--ease-out) both;
}
.title-logo::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(100deg, transparent 36%, rgba(255, 255, 255, 0.95) 47%, rgba(255, 255, 255, 0.35) 51%, transparent 60%);
  background-size: 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  pointer-events: none;
  animation: logoSheen 7.5s 1.6s ease-in-out infinite;
}
.title-cn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2vw, 28px);
  margin-top: clamp(8px, 1.4vh, 16px);
  animation: riseIn 0.9s 0.42s var(--ease-out) both;
}
.title-cn span {
  font-size: clamp(17px, 1.62vw, 27px);
  font-weight: 500;
  letter-spacing: 0.62em;
  padding-left: 0.62em;
  color: #e2f7ff;
  text-shadow: 0 0 22px rgba(77, 227, 255, 0.42), 0 2px 8px rgba(0, 0, 0, 0.95), 0 0 34px rgba(0, 0, 0, 0.7);
}
.title-cn i {
  width: clamp(28px, 3.6vw, 62px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(157, 107, 255, 0.7));
}
.title-cn i:last-child { background: linear-gradient(90deg, rgba(157, 107, 255, 0.7), transparent); }
.title-tag {
  margin: clamp(14px, 2.4vh, 28px) auto 0;
  max-width: 720px;
  font-size: clamp(12px, 0.96vw, 15.5px);
  line-height: 2;
  letter-spacing: 0.1em;
  color: rgba(214, 231, 246, 0.96);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.98), 0 2px 16px rgba(0, 0, 0, 0.95), 0 0 40px rgba(0, 0, 0, 0.8);
  animation: riseIn 0.9s 0.56s var(--ease-out) both;
}
.title-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.2vw, 18px);
  margin-top: clamp(18px, 3vh, 36px);
  animation: riseIn 0.9s 0.7s var(--ease-out) both;
}
.title-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: clamp(16px, 2.4vh, 28px);
  font-size: 11px;
  color: #b9cee2;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9), 0 0 22px rgba(0, 0, 0, 0.7);
  animation: riseIn 0.9s 0.82s var(--ease-out) both;
}
.title-foot {
  margin-top: clamp(12px, 1.8vh, 20px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(160, 190, 216, 0.88);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
  animation: riseIn 0.9s 0.94s var(--ease-out) both;
}
.title-foot i { width: 3px; height: 3px; border-radius: 50%; background: rgba(122, 198, 255, 0.32); }
.title-version { font-size: 10px; letter-spacing: 0.14em; color: rgba(166, 194, 220, 0.9); text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9); }
.quality { text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9); }
.meta-sep { width: 1px; height: 14px; background: rgba(122, 198, 255, 0.18); }
.quality { display: inline-flex; align-items: center; gap: 9px; letter-spacing: 0.14em; }
.select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  padding: 0 30px 0 12px;
  height: 32px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #d6efff;
  background: linear-gradient(180deg, rgba(20, 32, 52, 0.72), rgba(7, 12, 24, 0.7));
  border: 1px solid rgba(77, 227, 255, 0.24);
  outline: none;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.select-wrap select:hover, .select-wrap select:focus-visible {
  border-color: rgba(77, 227, 255, 0.62);
  box-shadow: 0 0 18px -5px rgba(77, 227, 255, 0.6);
}
.select-wrap option { background: #0a0f1d; color: #d6efff; }
.select-wrap svg {
  position: absolute;
  right: 9px;
  width: 11px;
  height: 11px;
  color: var(--cyan);
  transform: rotate(90deg);
  pointer-events: none;
}
.title-corner {
  position: absolute;
  bottom: 34px;
  width: clamp(70px, 9vw, 150px);
  height: 1px;
  background: linear-gradient(90deg, rgba(77, 227, 255, 0.5), transparent);
}
.tc-l { left: 34px; }
.tc-r { right: 34px; transform: scaleX(-1); }
.title-corner::after {
  content: "";
  position: absolute;
  right: 0;
  top: -4px;
  width: 1px;
  height: 9px;
  background: rgba(77, 227, 255, 0.5);
}

/* ------------------------------ 按钮 ------------------------------ */
.btn {
  --btn-acc: var(--cyan);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: clamp(42px, 5vh, 52px);
  padding: 0 clamp(20px, 2.2vw, 32px);
  font-size: clamp(12px, 0.86vw, 14px);
  font-weight: 500;
  letter-spacing: 0.18em;
  color: #e9f9ff;
  border: 1px solid transparent;
  overflow: hidden;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  transition: transform 0.18s var(--ease), box-shadow 0.22s var(--ease), border-color 0.2s, filter 0.2s;
  white-space: nowrap;
}
.btn .btn-ic { width: 15px; height: 15px; flex: 0 0 15px; }
.btn .btn-arrow { width: 15px; height: 15px; flex: 0 0 15px; transition: transform 0.22s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(4px); }
.btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.btn-primary {
  background:
    linear-gradient(135deg, rgba(23, 52, 78, 0.86), rgba(18, 20, 52, 0.9) 55%, rgba(48, 14, 48, 0.88)) padding-box,
    linear-gradient(135deg, rgba(77, 227, 255, 0.95), rgba(157, 107, 255, 0.7) 54%, rgba(255, 63, 164, 0.85)) border-box;
  box-shadow: 0 0 32px -10px rgba(77, 227, 255, 0.75), inset 0 0 24px rgba(77, 227, 255, 0.09), 0 14px 30px rgba(0, 0, 0, 0.45);
  text-shadow: 0 0 14px rgba(77, 227, 255, 0.4);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 44px -8px rgba(77, 227, 255, 0.9), 0 0 26px -10px rgba(255, 63, 164, 0.7), inset 0 0 30px rgba(77, 227, 255, 0.16), 0 16px 34px rgba(0, 0, 0, 0.5);
}
.btn-primary:active { transform: translateY(0) scale(0.99); }
.btn-primary:disabled {
  cursor: wait;
  color: rgba(190, 220, 240, 0.6);
  filter: saturate(0.5) brightness(0.8);
  box-shadow: none;
}
.btn-primary:disabled .btn-arrow { display: none; }
.btn-glow {
  position: absolute;
  top: -60%;
  left: -30%;
  width: 50%;
  height: 220%;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.22) 50%, transparent 68%);
  transform: rotate(8deg);
  animation: btnGlow 5.5s ease-in-out infinite;
  pointer-events: none;
}
.btn-ghost {
  background:
    linear-gradient(160deg, rgba(14, 21, 38, 0.6), rgba(7, 10, 20, 0.55)) padding-box,
    linear-gradient(135deg, rgba(122, 198, 255, 0.34), rgba(157, 107, 255, 0.16)) border-box;
  color: #bcd6ea;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.btn-ghost:hover {
  transform: translateY(-2px);
  color: #f0fbff;
  box-shadow: 0 0 26px -10px rgba(77, 227, 255, 0.65), inset 0 0 18px rgba(77, 227, 255, 0.08);
}
.btn-ghost:active { transform: translateY(0) scale(0.99); }
.btn-sm { height: 34px; padding: 0 16px; font-size: 11px; letter-spacing: 0.12em; }
.btn-sm .btn-ic { transform: rotate(180deg); }

/* ------------------------------ 面板 / 弹层 ------------------------------ */
.sheet {
  position: relative;
  width: min(1080px, 92vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 3vh, 34px) clamp(22px, 3vw, 42px);
  border: 1px solid transparent;
  background:
    linear-gradient(165deg, rgba(11, 16, 31, 0.94), rgba(5, 8, 17, 0.93)) padding-box,
    linear-gradient(135deg, rgba(77, 227, 255, 0.55), rgba(157, 107, 255, 0.24) 46%, rgba(255, 63, 164, 0.42)) border-box;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 40px 90px rgba(0, 0, 0, 0.6);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
  animation: sheetIn 0.42s var(--ease-out) both;
}
.sheet::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8%;
  width: 40%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(150, 240, 255, 0.9), transparent);
}
.sheet-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(122, 198, 255, 0.12);
  flex: 0 0 auto;
}
.sheet-head h2 { margin-top: 5px; font-size: clamp(22px, 2vw, 32px); letter-spacing: 0.22em; color: #eefaff; text-shadow: 0 0 26px rgba(77, 227, 255, 0.28); }
.kicker {
  font-family: var(--font-en);
  font-size: 9.5px;
  letter-spacing: 0.42em;
  color: rgba(122, 200, 226, 0.8);
  text-transform: uppercase;
}
.howto-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 1.8vh, 22px) clamp(18px, 2.4vw, 30px);
  padding: clamp(16px, 2.6vh, 26px) 4px clamp(16px, 2.6vh, 24px) 0;
  overflow-y: auto;
  flex: 1 1 auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(77, 227, 255, 0.3) transparent;
}
.howto-grid section { position: relative; padding-left: 2px; }
.howto-grid h3 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 7px;
  font-size: 13.5px;
  letter-spacing: 0.08em;
  color: #dcf2ff;
}
.howto-grid h3 .num { font-size: 10px; color: var(--cyan); letter-spacing: 0.05em; opacity: 0.8; }
.howto-grid p { font-size: 12px; line-height: 1.95; color: var(--text-dim); }
.howto-grid strong { color: #d7f6ff; font-weight: 500; }
.howto-grid b { color: var(--mint); font-weight: 500; }
.howto-keys {
  flex: 0 0 auto;
  padding-top: clamp(14px, 2vh, 20px);
  border-top: 1px solid rgba(122, 198, 255, 0.12);
}
.keys-title {
  margin-bottom: 10px;
  font-size: 12px;
  letter-spacing: 0.22em;
  color: #cfe9fa;
}
.keys-title span { margin-left: 10px; font-family: var(--font-en); font-size: 8px; letter-spacing: 0.32em; color: var(--text-mute); }
.keys { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.keys > span { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-dim); }
.keys kbd { margin: 0 1px; }

/* 暂停 */
.pause-sheet { width: min(560px, 90vw); text-align: center; padding-bottom: 26px; }
.pause-sheet h2 { margin: 8px 0 6px; font-size: clamp(26px, 2.6vw, 38px); letter-spacing: 0.26em; padding-left: 0.26em; color: #eefaff; text-shadow: 0 0 30px rgba(77, 227, 255, 0.3); }
.pause-sheet .dim { font-size: 12px; letter-spacing: 0.06em; }
.pause-actions { display: flex; flex-direction: column; gap: 9px; margin: clamp(18px, 3vh, 28px) auto 0; width: min(360px, 100%); }
.pause-actions .btn { width: 100%; }
.pause-stats { display: flex; justify-content: center; gap: clamp(16px, 3vw, 34px); margin-top: clamp(16px, 2.6vh, 24px); padding-top: 16px; border-top: 1px solid rgba(122, 198, 255, 0.1); }
.pstat { display: flex; flex-direction: column; gap: 2px; }
.pstat em { font-style: normal; font-size: 9px; letter-spacing: 0.22em; color: var(--text-mute); }
.pstat b { font-size: 15px; font-weight: 500; color: #d9f2ff; }
.pause-stats > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: #cfe9ff;
  border: 1px solid rgba(122, 198, 255, 0.14);
  background: linear-gradient(180deg, rgba(18, 28, 46, 0.55), rgba(7, 11, 22, 0.5));
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 0 100%);
}
.pause-foot { margin-top: 16px; font-size: 9.5px; letter-spacing: 0.18em; color: var(--text-mute); }

/* ------------------------------ 战役关卡选择 ------------------------------ */
#screen-levels { z-index: 34; padding: clamp(18px, 3.2vh, 38px) clamp(18px, 3vw, 46px); }
#screen-levels::before {
  background:
    radial-gradient(ellipse 74% 60% at 50% 42%, rgba(3, 5, 14, 0.74), rgba(2, 3, 9, 0.94) 74%, rgba(2, 3, 9, 0.985) 100%),
    linear-gradient(180deg, rgba(2, 3, 9, 0.62) 0%, transparent 30%, transparent 68%, rgba(2, 3, 9, 0.72) 100%);
  backdrop-filter: blur(6px) saturate(0.85);
  -webkit-backdrop-filter: blur(6px) saturate(0.85);
}
.levels-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2.2vh, 24px);
  width: min(1560px, 96vw);
  max-height: 100%;
  margin: auto;
}
.levels-head { flex: 0 0 auto; text-align: center; animation: riseIn 0.6s var(--ease-out) both; }
.levels-kicker { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 1.4vw, 18px); }
.levels-kicker .kicker { color: rgba(158, 226, 250, 0.86); text-shadow: 0 0 18px rgba(77, 227, 255, 0.24); }
.levels-kicker .k-line { width: clamp(28px, 4vw, 72px); height: 1px; background: linear-gradient(90deg, transparent, rgba(77, 227, 255, 0.72)); }
.levels-kicker .k-line:last-child { background: linear-gradient(90deg, rgba(77, 227, 255, 0.72), transparent); }
.levels-head h2 {
  margin: clamp(6px, 1.1vh, 12px) 0 6px;
  font-size: clamp(25px, 3vw, 44px);
  font-weight: 700;
  letter-spacing: 0.24em;
  padding-left: 0.24em;
  background: linear-gradient(180deg, #ffffff, #e4fbff 34%, #9cebff 64%, #9d6bff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 30px rgba(77, 227, 255, 0.34));
}
.levels-head .dim { font-size: clamp(10.5px, 0.85vw, 12.5px); letter-spacing: 0.16em; color: var(--text-dim); text-shadow: 0 1px 10px rgba(0, 0, 0, 0.9); }

.level-cards {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 1.5vw, 22px);
  align-content: center;
}
.level-card {
  --lv: var(--cyan);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  height: clamp(292px, 43vh, 424px);
  padding: clamp(14px, 1.8vh, 20px) clamp(15px, 1.25vw, 22px) clamp(13px, 1.6vh, 18px);
  text-align: left;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: 2px;
  background:
    radial-gradient(ellipse 108% 52% at 50% -6%, color-mix(in srgb, var(--lv) 17%, transparent), transparent 70%),
    linear-gradient(168deg, rgba(15, 21, 42, 0.95), rgba(6, 9, 19, 0.93)) padding-box,
    linear-gradient(155deg, color-mix(in srgb, var(--lv) 74%, transparent), rgba(122, 198, 255, 0.13) 48%, color-mix(in srgb, var(--lv) 30%, transparent)) border-box;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 0 42px color-mix(in srgb, var(--lv) 5%, transparent),
    0 24px 54px rgba(0, 0, 0, 0.52);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
  overflow: hidden;
  cursor: pointer;
  animation: cardRise 0.62s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 70ms);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), filter 0.25s;
}
.level-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16%;
  width: 68%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--lv), transparent);
  opacity: 0.9;
}
.level-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 20%);
}
.level-card:hover, .level-card:focus-visible {
  transform: translateY(-9px);
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 0 54px color-mix(in srgb, var(--lv) 8%, transparent),
    0 36px 72px rgba(0, 0, 0, 0.62),
    0 0 52px -12px color-mix(in srgb, var(--lv) 82%, transparent);
}
.level-card:active { transform: translateY(-4px) scale(0.995); }
.level-card.is-locked { cursor: not-allowed; filter: saturate(0.56) brightness(0.84); }
.level-card.is-locked:hover {
  transform: translateY(-4px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 26px 54px rgba(0, 0, 0, 0.56);
}
.level-card.is-denied { animation: levelDeny 0.42s var(--ease) both; }
.level-card.is-locked .lc-glyph { filter: grayscale(0.7); }
.level-card.is-locked .lc-name { color: #c9d8e6; text-shadow: none; }
.level-card.is-locked .lc-desc { opacity: 0.78; }
.lc-mark {
  position: absolute;
  right: 2px;
  bottom: -18px;
  font-family: var(--font-mono);
  font-size: clamp(96px, 8vw, 152px);
  font-weight: 500;
  line-height: 0.8;
  letter-spacing: -0.06em;
  color: color-mix(in srgb, var(--lv) 8%, transparent);
  pointer-events: none;
}
.lc-deco {
  position: absolute;
  right: clamp(-42px, -2.4vw, -26px);
  top: 27%;
  width: clamp(150px, 13vw, 214px);
  height: clamp(150px, 13vw, 214px);
  pointer-events: none;
  opacity: 0.8;
}
.lc-deco i {
  position: absolute;
  inset: 0;
  border: 1px solid color-mix(in srgb, var(--lv) 13%, transparent);
  transform: rotate(45deg);
}
.lc-deco i:last-child {
  inset: 24%;
  border-color: color-mix(in srgb, var(--lv) 19%, transparent);
}
.lc-glow {
  position: absolute;
  left: -25%;
  bottom: -48%;
  width: 72%;
  height: 92%;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--lv) 22%, transparent), transparent 68%);
  filter: blur(18px);
  opacity: 0.7;
  pointer-events: none;
}
.lc-top { display: flex; align-items: center; gap: 8px; min-height: 16px; }
.lc-index {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--lv);
  text-shadow: 0 0 14px color-mix(in srgb, var(--lv) 60%, transparent);
}
.lc-theme {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-en);
  font-size: 8px;
  letter-spacing: 0.28em;
  color: color-mix(in srgb, var(--lv) 82%, #ffffff);
  opacity: 0.85;
  white-space: nowrap;
}
.lc-theme::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.lc-side { margin-left: auto; display: inline-flex; align-items: center; flex: 0 0 auto; }
.lv-stars { display: inline-flex; align-items: center; gap: 3px; }
.lv-stars i { display: block; width: 13px; height: 13px; color: rgba(122, 198, 255, 0.22); }
.lv-stars i svg { fill: currentColor; stroke: rgba(180, 230, 255, 0.32); stroke-width: 1; }
.lv-stars i.on { color: var(--amber); filter: drop-shadow(0 0 7px rgba(255, 179, 71, 0.72)); }
.lc-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  color: color-mix(in srgb, var(--lv) 52%, #ffffff);
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--lv) 55%, transparent));
}
.lc-head {
  display: flex;
  align-items: center;
  gap: clamp(10px, 0.9vw, 14px);
  margin: clamp(10px, 1.6vh, 18px) 0 clamp(8px, 1.2vh, 12px);
}
.lc-glyph {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(40px, 3.4vw, 52px);
  height: clamp(40px, 3.4vw, 52px);
  padding: clamp(9px, 0.8vw, 12px);
  color: color-mix(in srgb, var(--lv) 82%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--lv) 48%, transparent);
  background: radial-gradient(circle, color-mix(in srgb, var(--lv) 22%, transparent), transparent 72%);
  box-shadow: 0 0 26px -8px color-mix(in srgb, var(--lv) 72%, transparent), inset 0 0 18px color-mix(in srgb, var(--lv) 14%, transparent);
  transform: rotate(45deg);
}
.lc-glyph svg { transform: rotate(-45deg); }
.lc-titles { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lc-name {
  font-size: clamp(20px, 1.7vw, 27px);
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #f2fbff;
  text-shadow: 0 0 20px color-mix(in srgb, var(--lv) 46%, transparent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc-en {
  font-family: var(--font-en);
  font-style: normal;
  font-size: 8px;
  letter-spacing: 0.3em;
  color: var(--text-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc-sub {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: color-mix(in srgb, var(--lv) 50%, #dbeaf8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc-desc {
  flex: 1 1 auto;
  margin-top: 8px;
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--text-dim);
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.lc-mods { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; min-height: 18px; }
.lc-mod {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: color-mix(in srgb, var(--lv) 72%, #e8f8ff);
  border: 1px solid color-mix(in srgb, var(--lv) 32%, transparent);
  background: color-mix(in srgb, var(--lv) 8%, transparent);
  clip-path: polygon(0 0, calc(100% - 5px) 0, 100% 5px, 100% 100%, 0 100%);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc-mod-more { color: var(--text-mute); border-color: rgba(122, 198, 255, 0.18); background: rgba(122, 198, 255, 0.05); }
.lc-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: clamp(8px, 1.2vh, 12px);
  padding-top: clamp(8px, 1.2vh, 12px);
  border-top: 1px solid color-mix(in srgb, var(--lv) 16%, transparent);
}
.lc-diff { display: inline-flex; align-items: center; gap: 7px; }
.lc-diff em { font-style: normal; font-size: 8.5px; letter-spacing: 0.2em; color: var(--text-mute); }
.lc-dots { display: inline-flex; gap: 3px; }
.lc-dots i {
  width: 6px;
  height: 6px;
  transform: skewX(-18deg);
  background: rgba(122, 198, 255, 0.14);
  border: 1px solid rgba(122, 198, 255, 0.2);
}
.lc-dots i.on {
  background: var(--lv);
  border-color: color-mix(in srgb, var(--lv) 70%, #ffffff);
  box-shadow: 0 0 8px color-mix(in srgb, var(--lv) 70%, transparent);
}
.lc-waves { display: inline-flex; align-items: baseline; gap: 4px; color: var(--text-2); }
.lc-waves b { font-size: clamp(16px, 1.4vw, 21px); color: #e9faff; text-shadow: 0 0 16px color-mix(in srgb, var(--lv) 40%, transparent); }
.lc-waves em { font-style: normal; font-size: 9px; letter-spacing: 0.2em; color: var(--text-mute); }
.lc-status { display: block; margin-top: 7px; min-height: 14px; }
.lc-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--text-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc-state svg { width: 11px; height: 11px; flex: 0 0 11px; }
.lc-state.is-clear { color: color-mix(in srgb, var(--mint) 76%, #ffffff); }
.lc-state.is-clear b { color: #d8fff4; font-weight: 500; }
.lc-state.is-lock { color: rgba(255, 154, 194, 0.9); }
.lc-state.is-open { color: rgba(150, 210, 240, 0.86); }
.state-dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; flex: 0 0 4px; }
.levels-empty {
  grid-column: 1 / -1;
  padding: clamp(30px, 8vh, 70px) 20px;
  text-align: center;
  border: 1px dashed rgba(122, 198, 255, 0.18);
  background: linear-gradient(180deg, rgba(14, 20, 38, 0.55), rgba(7, 11, 22, 0.5));
}
.levels-empty p { margin-top: 8px; font-size: 12px; color: var(--text-dim); }
.levels-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: clamp(10px, 1.6vh, 16px);
  border-top: 1px solid var(--line-soft);
  animation: riseIn 0.6s 0.32s var(--ease-out) both;
}
.levels-progress-wrap { display: flex; align-items: center; gap: clamp(10px, 1.4vw, 18px); min-width: 0; }
#levels-progress { font-size: 11px; letter-spacing: 0.12em; color: var(--text-2); text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9); white-space: nowrap; }
.levels-bar {
  position: relative;
  display: block;
  width: clamp(110px, 15vw, 230px);
  height: 3px;
  background: rgba(122, 198, 255, 0.12);
  overflow: hidden;
}
.levels-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 22px, rgba(4, 5, 12, 0.9) 22px 24px);
  opacity: 0.6;
}
#levels-fill {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--violet) 58%, var(--magenta));
  box-shadow: 0 0 14px rgba(77, 227, 255, 0.6);
  transition: width 0.55s var(--ease);
}

/* ------------------------------ 织纹三选一 ------------------------------ */
#screen-weaving { flex-direction: column; gap: clamp(16px, 2.6vh, 28px); z-index: 46; }
.weaving-head { text-align: center; animation: riseIn 0.6s var(--ease-out) both; }
.weaving-head h2 { margin: 8px 0 6px; font-size: clamp(26px, 2.8vw, 40px); letter-spacing: 0.24em; padding-left: 0.24em; color: #eefaff; text-shadow: 0 0 34px rgba(157, 107, 255, 0.5); }
.weaving-head .dim { font-size: 12px; letter-spacing: 0.1em; }
.weaving-cards {
  display: flex;
  justify-content: center;
  gap: clamp(14px, 2vw, 28px);
  perspective: 1100px;
  width: min(1000px, 94vw);
}
.weaving-card {
  --rar: var(--cyan);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: clamp(230px, 21vw, 302px);
  min-height: clamp(300px, 39vh, 376px);
  padding: clamp(20px, 2.6vh, 30px) clamp(16px, 1.6vw, 24px) 18px;
  text-align: center;
  border: 1px solid transparent;
  background:
    radial-gradient(ellipse 90% 48% at 50% 0%, color-mix(in srgb, var(--rar) 13%, transparent), transparent 72%),
    linear-gradient(168deg, rgba(15, 20, 40, 0.94), rgba(6, 8, 18, 0.92)) padding-box,
    linear-gradient(160deg, color-mix(in srgb, var(--rar) 65%, transparent), rgba(122, 198, 255, 0.12) 48%, rgba(157, 107, 255, 0.3)) border-box;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 28px 60px rgba(0, 0, 0, 0.5);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s;
  animation: cardRise 0.55s var(--ease-out) both;
  cursor: pointer;
}
.weaving-card:nth-child(2) { animation-delay: 0.08s; }
.weaving-card:nth-child(3) { animation-delay: 0.16s; }
.weaving-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18%;
  width: 64%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--rar), transparent);
  opacity: 0.85;
}
.weaving-card:hover, .weaving-card:focus-visible {
  transform: translateY(-12px) rotateX(4deg) rotateY(-2.5deg) scale(1.018);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 40px 80px rgba(0, 0, 0, 0.6), 0 0 50px -12px color-mix(in srgb, var(--rar) 85%, transparent);
  outline: none;
}
.weaving-card.is-common { --rar: var(--cyan); }
.weaving-card.is-rare { --rar: var(--violet); }
.weaving-card.is-epic { --rar: var(--magenta); }
.weaving-card.is-legend { --rar: var(--amber); }
.weaving-card.is-picked { transform: scale(0.96); filter: brightness(1.3); }
.wc-rarity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-en);
  font-size: 8px;
  letter-spacing: 0.34em;
  color: color-mix(in srgb, var(--rar) 85%, #ffffff);
  margin-bottom: clamp(14px, 2.2vh, 22px);
}
.wc-rarity::before, .wc-rarity::after { content: ""; width: 16px; height: 1px; background: color-mix(in srgb, var(--rar) 55%, transparent); }
.wc-icon {
  width: clamp(52px, 4.6vw, 68px);
  height: clamp(52px, 4.6vw, 68px);
  padding: clamp(10px, 1vw, 14px);
  color: color-mix(in srgb, var(--rar) 80%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--rar) 45%, transparent);
  background: radial-gradient(circle, color-mix(in srgb, var(--rar) 20%, transparent), transparent 70%);
  box-shadow: 0 0 30px -8px color-mix(in srgb, var(--rar) 70%, transparent), inset 0 0 20px color-mix(in srgb, var(--rar) 14%, transparent);
  transform: rotate(45deg);
  margin-bottom: clamp(18px, 3vh, 28px);
}
.wc-icon svg { transform: rotate(-45deg); }
.wc-name { font-size: clamp(19px, 1.6vw, 24px); font-weight: 600; letter-spacing: 0.14em; color: #f2fbff; text-shadow: 0 0 22px color-mix(in srgb, var(--rar) 50%, transparent); }
.wc-en { margin-top: 4px; font-family: var(--font-en); font-size: 8.5px; letter-spacing: 0.3em; color: var(--text-mute); }
.wc-desc { margin-top: clamp(14px, 2.2vh, 22px); font-size: 12px; line-height: 1.95; color: var(--text-dim); max-width: 88%; }
.wc-take {
  margin-top: auto;
  padding-top: clamp(14px, 2vh, 20px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  letter-spacing: 0.24em;
  color: color-mix(in srgb, var(--rar) 80%, #ffffff);
  opacity: 0.55;
  transition: opacity 0.2s, gap 0.2s;
}
.wc-take svg { width: 13px; height: 13px; }
.weaving-card:hover .wc-take { opacity: 1; gap: 10px; }
.weaving-hint { font-size: 9.5px; letter-spacing: 0.24em; color: var(--text-mute); }

/* ------------------------------ 结算 ------------------------------ */
.result-wrap {
  width: min(900px, 94vw);
  text-align: center;
  animation: resultIn 0.7s var(--ease-out) both;
}
.result-rings { position: absolute; left: 50%; top: 46%; width: min(560px, 90vw); aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none; }
.result-rings i { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(255, 63, 164, 0.14); animation: ringSpin 40s linear infinite; }
.result-rings i:last-child { inset: 16%; border-style: dashed; border-color: rgba(77, 227, 255, 0.14); animation-direction: reverse; animation-duration: 30s; }
#result-kicker { color: rgba(255, 140, 180, 0.85); }
#result-title {
  margin: clamp(10px, 1.8vh, 18px) 0 clamp(8px, 1.4vh, 14px);
  font-size: clamp(40px, 5.4vw, 78px);
  font-weight: 700;
  letter-spacing: 0.16em;
  padding-left: 0.16em;
  background: linear-gradient(180deg, #ffffff, #ffe4ee 32%, #ff8cbb 62%, #ff3fa4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 34px rgba(255, 63, 164, 0.4));
}
#screen-result.is-win #result-title {
  background: linear-gradient(180deg, #ffffff, #dbfff6 34%, #7ff0d0 62%, #4de3ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 34px rgba(77, 227, 255, 0.45));
}
#screen-result.is-win #result-kicker { color: rgba(140, 255, 224, 0.9); }
#result-sub { font-size: 12px; letter-spacing: 0.12em; }
.result-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: clamp(22px, 4vh, 38px) 0 clamp(20px, 3vh, 30px);
}
.rstat {
  position: relative;
  padding: 16px 10px 14px;
  border: 1px solid rgba(122, 198, 255, 0.14);
  background: linear-gradient(180deg, rgba(14, 20, 38, 0.72), rgba(6, 9, 18, 0.66));
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%);
  animation: riseIn 0.5s var(--ease-out) both;
}
.rstat:nth-child(2) { animation-delay: 0.05s; }
.rstat:nth-child(3) { animation-delay: 0.1s; }
.rstat:nth-child(4) { animation-delay: 0.15s; }
.rstat:nth-child(5) { animation-delay: 0.2s; }
.rstat::after { content: ""; position: absolute; top: 0; left: 20%; width: 60%; height: 1px; background: linear-gradient(90deg, transparent, rgba(77, 227, 255, 0.55), transparent); }
.rstat em { display: block; font-style: normal; font-size: 9px; letter-spacing: 0.2em; color: var(--text-mute); margin-bottom: 8px; }
.rstat b { display: block; font-family: var(--font-mono); font-size: clamp(18px, 1.7vw, 26px); font-weight: 500; letter-spacing: 0.02em; color: #e8faff; text-shadow: 0 0 18px rgba(77, 227, 255, 0.25); }
.rstat small { display: block; margin-top: 5px; font-size: 8.5px; letter-spacing: 0.12em; color: var(--text-mute); }
.rstat.hl b { color: var(--mint); text-shadow: 0 0 18px rgba(109, 255, 200, 0.4); }
.result-level {
  margin-top: clamp(10px, 1.7vh, 16px);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  color: rgba(168, 216, 242, 0.92);
  text-shadow: 0 0 18px rgba(77, 227, 255, 0.22), 0 1px 8px rgba(0, 0, 0, 0.9);
}
.result-stars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(7px, 0.9vw, 12px);
  min-height: 32px;
  margin-top: clamp(8px, 1.4vh, 14px);
}
.rs-star {
  display: block;
  width: clamp(23px, 2.1vw, 31px);
  height: clamp(23px, 2.1vw, 31px);
  color: rgba(122, 198, 255, 0.18);
  animation: starPop 0.5s var(--ease-out) both;
  animation-delay: calc(0.12s + var(--k, 0) * 0.11s);
}
.rs-star svg { fill: currentColor; stroke: rgba(190, 235, 255, 0.34); stroke-width: 1.1; }
.rs-star.on {
  color: var(--amber);
  filter: drop-shadow(0 0 10px rgba(255, 179, 71, 0.72)) drop-shadow(0 0 26px rgba(255, 179, 71, 0.32));
}
.rs-star.on svg { stroke: rgba(255, 232, 190, 0.85); }
#screen-result.is-win .rs-label { color: rgba(180, 255, 232, 0.92); }
.rs-label { margin-left: 4px; font-size: 9px; letter-spacing: 0.22em; color: var(--text-mute); }
.result-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: clamp(9px, 1vw, 15px); }
.result-foot { margin-top: clamp(18px, 2.8vh, 28px); font-size: 9px; letter-spacing: 0.28em; color: rgba(110, 140, 170, 0.6); }

/* ------------------------------ Toast / Banner / Tooltip ------------------------------ */
#toast-layer {
  position: absolute;
  top: clamp(216px, 22vh, 258px);
  right: clamp(16px, 2vw, 30px);
  left: auto;
  transform: none;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  pointer-events: none;
  width: min(320px, 40vw);
}
.toast {
  --t-acc: var(--cyan);
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 8px 16px 8px 12px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: #e2f4ff;
  border: 1px solid color-mix(in srgb, var(--t-acc) 32%, transparent);
  border-left: 2px solid var(--t-acc);
  background: linear-gradient(120deg, rgba(12, 19, 34, 0.94), rgba(6, 10, 20, 0.9));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5), inset 0 0 18px color-mix(in srgb, var(--t-acc) 6%, transparent);
  animation: toastIn 0.35s var(--ease-out) both;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  line-height: 1.6;
}
.toast.out { animation: toastOut 0.32s var(--ease) both; }
.toast .t-ico { width: 13px; height: 13px; flex: 0 0 13px; color: var(--t-acc); margin-top: 2px; }
.toast .t-ico svg { width: 100%; height: 100%; }
.toast.good { --t-acc: var(--mint); }
.toast.bad { --t-acc: var(--danger); }
.toast.warn { --t-acc: var(--amber); }
.toast.ability { --t-acc: var(--violet); }
.toast.info { --t-acc: var(--cyan); }

#banner-layer {
  position: absolute;
  inset: 0;
  z-index: 65;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
#banner-layer.show { opacity: 1; }
.banner {
  position: relative;
  text-align: center;
  padding: 18px clamp(40px, 6vw, 110px);
  background: linear-gradient(90deg, transparent, rgba(3, 7, 15, 0.66) 22%, rgba(3, 7, 15, 0.66) 78%, transparent);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: bannerIn 0.55s var(--ease-out) both;
}
.banner::before, .banner::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(77, 227, 255, 0.55), rgba(157, 107, 255, 0.55), transparent);
}
.banner::before { top: 0; }
.banner::after { bottom: 0; }
.banner-kicker { font-family: var(--font-en); font-size: 9px; letter-spacing: 0.46em; color: rgba(140, 214, 238, 0.8); margin-bottom: 6px; }
.banner-title {
  font-size: clamp(24px, 3vw, 44px);
  font-weight: 700;
  letter-spacing: 0.2em;
  padding-left: 0.2em;
  color: #eefaff;
  text-shadow: 0 0 36px rgba(77, 227, 255, 0.45), 0 0 70px rgba(157, 107, 255, 0.3);
}
.banner-sub { margin-top: 4px; font-size: 11px; letter-spacing: 0.3em; color: var(--text-dim); }
.banner.boss .banner-title { color: #ffd7e7; text-shadow: 0 0 40px rgba(255, 63, 164, 0.55); }
.banner.good .banner-title { color: #d9fff4; text-shadow: 0 0 40px rgba(109, 255, 200, 0.5); }
.banner.bad .banner-title { color: #ffe0e4; text-shadow: 0 0 40px rgba(255, 85, 102, 0.5); }
#banner-layer.out .banner { animation: bannerOut 0.4s var(--ease) both; }

#tooltip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 90;
  width: max-content;
  max-width: 300px;
  padding: 11px 14px;
  font-size: 11.5px;
  line-height: 1.7;
  color: #d9edff;
  border: 1px solid transparent;
  background:
    linear-gradient(160deg, rgba(12, 18, 34, 0.97), rgba(6, 9, 18, 0.96)) padding-box,
    linear-gradient(135deg, rgba(77, 227, 255, 0.55), rgba(157, 107, 255, 0.32), rgba(255, 63, 164, 0.4)) border-box;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.14s var(--ease), transform 0.14s var(--ease);
}
#tooltip.show { opacity: 1; transform: translateY(0); }
#tooltip.hidden { display: none; }
#tooltip .tt-title { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; font-weight: 600; letter-spacing: 0.08em; color: #effbff; margin-bottom: 3px; }
#tooltip .tt-title em { font-family: var(--font-en); font-size: 7.5px; letter-spacing: 0.24em; color: var(--text-mute); font-style: normal; }
#tooltip .tt-cost { color: var(--cyan); font-family: var(--font-mono); font-size: 10px; margin-left: auto; }
#tooltip .tt-desc { color: var(--text-dim); font-size: 11px; }
#tooltip .tt-row { display: flex; justify-content: space-between; gap: 14px; font-size: 10.5px; color: var(--text-dim); }
#tooltip .tt-row b { color: #dff6ff; font-weight: 500; font-family: var(--font-mono); }
#tooltip .tt-sep { height: 1px; margin: 7px 0; background: linear-gradient(90deg, rgba(77, 227, 255, 0.22), transparent); }
#tooltip .tt-hot { margin-top: 6px; font-size: 9px; letter-spacing: 0.1em; color: var(--text-mute); }

/* ------------------------------ 滚动条 ------------------------------ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(77, 227, 255, 0.28); }
::-webkit-scrollbar-thumb:hover { background: rgba(77, 227, 255, 0.5); }

/* ------------------------------ 动画 ------------------------------ */
#hud.hud-in { animation: hudIn 0.55s var(--ease-out) both; }
#app.is-building #stage { cursor: crosshair; }
@keyframes hudIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes riseIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes titleIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes logoIn {
  0% { opacity: 0; transform: translateY(26px) scale(0.985); filter: blur(10px) drop-shadow(0 0 26px rgba(77, 227, 255, 0.34)); }
  55% { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0) drop-shadow(0 0 26px rgba(77, 227, 255, 0.34)) drop-shadow(0 10px 44px rgba(157, 107, 255, 0.3)) drop-shadow(-1.5px 0 0 rgba(255, 63, 164, 0.28)) drop-shadow(1.5px 0 0 rgba(77, 227, 255, 0.28)); }
}
@keyframes logoSheen {
  0%, 100% { background-position: 190% 0; }
  44% { background-position: -70% 0; }
  70% { background-position: -70% 0; }
}
@keyframes grainShift { 0% { transform: translate(0, 0); } 33% { transform: translate(-6px, 4px); } 66% { transform: translate(5px, -5px); } 100% { transform: translate(0, 0); } }
@keyframes softPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes ringSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes ringBreath { 0%, 100% { opacity: 0.55; transform: scale(1); } 50% { opacity: 0.95; transform: scale(1.04); } }
@keyframes btnGlow { 0%, 62% { transform: translateX(-120%) rotate(8deg); } 80%, 100% { transform: translateX(340%) rotate(8deg); } }
@keyframes screenIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetIn { from { opacity: 0; transform: translateY(20px) scale(0.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes inspectIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: translateX(0); } }
@keyframes bossIn { from { opacity: 0; transform: translateX(-50%) translateY(-10px) scaleX(0.96); } to { opacity: 1; transform: translateX(-50%) translateY(0) scaleX(1); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-8px); } }
@keyframes bannerIn { from { opacity: 0; transform: scale(0.96); letter-spacing: 0.5em; } to { opacity: 1; transform: scale(1); } }
@keyframes bannerOut { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(1.03); } }
@keyframes cardRise { from { opacity: 0; transform: translateY(26px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes resultIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes starPop { from { opacity: 0; transform: scale(0.45) rotate(-16deg); } to { opacity: 1; transform: scale(1) rotate(0deg); } }
@keyframes levelDeny {
  0%, 100% { transform: translateX(0); }
  16% { transform: translateX(-7px); }
  34% { transform: translateX(6px); }
  52% { transform: translateX(-4px); }
  70% { transform: translateX(3px); }
  86% { transform: translateX(-1px); }
}
@keyframes abilityReady { 0%, 100% { filter: drop-shadow(0 0 7px rgba(157, 107, 255, 0.7)); } 50% { filter: drop-shadow(0 0 16px rgba(157, 107, 255, 1)); } }
@keyframes waveReady { 0%, 100% { border-color: rgba(77, 227, 255, 0.3); } 50% { border-color: rgba(77, 227, 255, 0.72); box-shadow: 0 0 20px -4px rgba(77, 227, 255, 0.5); } }
@keyframes coreWarn {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), inset 0 0 26px rgba(255, 85, 102, 0.1), 0 18px 46px rgba(0, 0, 0, 0.5); }
  50% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 0 40px rgba(255, 85, 102, 0.26), 0 0 34px -8px rgba(255, 85, 102, 0.75), 0 18px 46px rgba(0, 0, 0, 0.5); }
}
@keyframes coreFlash { 0% { filter: brightness(1); } 100% { filter: brightness(1.7) saturate(1.4); } }

/* ------------------------------ 响应式 ------------------------------ */
@media (max-width: 1500px) {
  .hud-top { grid-template-columns: minmax(270px, 340px) 1fr minmax(270px, 330px); gap: 16px; }
  #build-bar { width: clamp(590px, 57vw, 800px); }
  #ability-bar { width: clamp(214px, 18.5vw, 256px); }
  .title-tag { max-width: 640px; }
}

@media (max-width: 1240px) {
  :root { --cut: 11px; }
  .hud-top { grid-template-columns: minmax(246px, 306px) 1fr minmax(238px, 292px); padding: 14px 16px 0; gap: 12px; }
  .cap .en { display: none; }
  .res-meta small { display: none; }
  .panel-res { width: 236px; }
  .panel-wave { width: 210px; }
  .panel-core { padding: 10px 12px; }
  .panel-row > b { font-size: 13.5px; }
  .slots { font-size: 10px; }
  #fps { width: 36px; }
  .ico-btn { width: 32px; }
  .ico-btn.mono { width: 36px; }
  #build-bar { width: clamp(540px, 56vw, 760px); gap: 6px; }
  #ability-bar { width: clamp(196px, 18vw, 224px); gap: 6px; }
  .build-card { padding: 10px 8px 8px 8px; column-gap: 6px; height: 74px; }
  .bc-name { font-size: 11px; letter-spacing: 0.04em; }
  .bc-name em { font-size: 6.2px; letter-spacing: 0.1em; }
  .bc-cost { font-size: 11.5px; }
  .ability { padding: 7px 4px 6px; }
  .ab-name { font-size: 10px; letter-spacing: 0.08em; }
  .ab-name em { display: none; }
  #inspect-panel { width: 230px; bottom: 150px; }
  .weaving-card { width: clamp(212px, 21vw, 260px); min-height: 300px; }
  .howto-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
  .rstat b { font-size: 18px; }
}

@media (max-height: 780px) {
  .hud-top { padding-top: 12px; }
  .panel-core { padding: 9px 12px 10px; }
  .bar { margin: 8px 0 6px; }
  #hud-bottom { padding-bottom: 10px; padding-top: 34px; }
  .build-card, .ability { height: 68px; }
  .bc-icon { width: 30px; height: 30px; padding: 7px; }
  .title-logo { font-size: clamp(54px, 9vw, 140px); }
  .title-cn { margin-top: 8px; }
  .title-tag { margin-top: 14px; line-height: 1.8; }
  .title-actions { margin-top: 18px; }
  .title-meta { margin-top: 14px; }
  .title-foot { margin-top: 10px; }
  .howto-grid { gap: 12px 22px; padding-top: 14px; padding-bottom: 14px; }
  .howto-grid p { line-height: 1.8; }
  .weaving-card { min-height: 280px; padding-top: 18px; }
  .wc-icon { margin-bottom: 16px; width: 46px; height: 46px; }
  .weaving-head h2 { font-size: 28px; }
  #boss-bar { top: 158px; }
}

@media (max-height: 700px) {
  .title-logo { font-size: clamp(48px, 8vw, 112px); }
  .title-kicker { display: none; }
  .title-tag { font-size: 11.5px; line-height: 1.7; margin-top: 10px; }
  .title-actions { margin-top: 14px; }
  .title-meta { margin-top: 12px; }
  .title-foot { display: none; }
  .title-cn span { font-size: 17px; }
  .sheet { max-height: 92vh; padding: 16px 22px; }
  .howto-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .howto-keys { display: none; }
  .pause-sheet { padding: 20px 24px; }
  .result-stats { margin: 16px 0; }
  #result-title { font-size: 34px; }
}

/* 关卡选择：1600 以下 2×2；900 以下单列（窄屏内部滚动，页面不溢出） */
@media (max-width: 1460px) {
  .levels-wrap { gap: 12px; }
  .level-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
  .level-card { height: auto; min-height: clamp(178px, 24vh, 210px); padding: 12px 15px 11px; }
  .lc-head { margin: 6px 0 4px; gap: 10px; }
  .lc-glyph { width: 36px; height: 36px; padding: 8px; }
  .lc-name { font-size: 20px; }
  .lc-sub { font-size: 10px; }
  .lc-desc { margin-top: 6px; font-size: 11px; line-height: 1.65; -webkit-line-clamp: 2; }
  .lc-mods { margin-top: 6px; min-height: 16px; gap: 4px; }
  .lc-foot { margin-top: 6px; padding-top: 7px; }
  .lc-waves b { font-size: 17px; }
  .lc-status { margin-top: 5px; }
  .levels-head h2 { font-size: clamp(24px, 2.8vw, 34px); }
}

@media (max-width: 900px) {
  #screen-levels { padding: 14px; }
  .levels-wrap { width: 100%; max-height: 100%; overflow-y: auto; gap: 10px; padding-right: 2px; scrollbar-width: thin; }
  .levels-head h2 { font-size: 24px; }
  .levels-head .dim { font-size: 10px; letter-spacing: 0.08em; }
  .levels-kicker .kicker { font-size: 8px; letter-spacing: 0.28em; }
  .level-cards { flex: 0 0 auto; grid-template-columns: 1fr; gap: 8px; align-content: start; }
  .level-card {
    height: auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "top side"
      "head head"
      "sub sub"
      "desc desc"
      "mods foot"
      "status status";
    row-gap: 3px;
    padding: 10px 14px;
  }
  .lc-top { grid-area: top; }
  .lc-side { grid-area: side; justify-self: end; }
  .lc-head { grid-area: head; margin: 3px 0 0; gap: 9px; }
  .lc-glyph { width: 30px; height: 30px; padding: 7px; }
  .lc-name { font-size: 17px; }
  .lc-sub { grid-area: sub; font-size: 9.5px; letter-spacing: 0.1em; }
  .lc-desc { grid-area: desc; margin-top: 2px; font-size: 10.5px; line-height: 1.55; -webkit-line-clamp: 2; }
  .lc-mods { grid-area: mods; margin-top: 4px; min-height: 0; gap: 4px; align-self: end; }
  .lc-foot { grid-area: foot; margin: 4px 0 0; padding: 0; border: 0; align-self: end; justify-self: end; }
  .lc-diff em { display: none; }
  .lc-waves b { font-size: 15px; }
  .lc-status { grid-area: status; margin-top: 2px; }
  .levels-foot {
    position: sticky;
    bottom: 0;
    padding: 9px 0;
    background: linear-gradient(180deg, transparent, rgba(3, 5, 12, 0.92) 40%);
  }
  .levels-bar { display: none; }
  .result-actions { gap: 8px; }
  .result-actions .btn { height: 40px; padding: 0 15px; font-size: 11.5px; }
  .result-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
  .rstat { padding: 10px 6px; }
  .rstat b { font-size: 15px; }
}

@media (max-height: 780px) and (min-width: 1461px) {
  .levels-wrap { gap: 12px; }
  .levels-head h2 { font-size: 32px; }
  .level-card { height: clamp(248px, 42vh, 330px); padding: 12px 15px; }
  .lc-head { margin: 7px 0 5px; gap: 10px; }
  .lc-glyph { width: 40px; height: 40px; padding: 9px; }
  .lc-name { font-size: 21px; }
  .lc-desc { margin-top: 5px; font-size: 11px; line-height: 1.65; -webkit-line-clamp: 2; }
  .lc-mods { margin-top: 6px; min-height: 16px; }
  .lc-foot { margin-top: 6px; padding-top: 7px; }
  .lc-status { margin-top: 4px; }
}

@media (max-height: 700px) {
  .levels-head .dim { display: none; }
  .levels-head h2 { margin: 4px 0; }
  .levels-kicker .kicker { font-size: 8px; }
  .levels-foot { padding-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
}
