/**
 * 《残响熔炉》(Echo Forger) - 核心视觉样式系统
 * 严格落地 Art Bible 视觉规范：
 * “黑曜石构装与以太秘银流光 (Obsidian & Luminescent Ether)”
 */

:root {
  --bg-deep-basalt: #080b10;
  --panel-obsidian: #101622;
  --panel-obsidian-trans: rgba(16, 22, 34, 0.92);
  --border-forged-iron: #1e293b;
  --border-mithril: #334155;
  --highlight-mithril: #cbd5e1;
  --gold-kintsugi: #f59e0b;
  --gold-highlight: #fde047;
  --flame-red: #ef4444;
  --flame-orange: #f97316;
  --frost-cyan: #06b6d4;
  --frost-ice: #67e8f9;
  --void-purple: #a855f7;
  --void-light: #c084fc;
  --chrono-amber: #d97706;
  --chrono-gold: #fbbf24;
  --attract-blue: #38bdf8;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

body {
  background-color: #030508;
  color: #f8fafc;
  font-family: var(--font-family);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 主游戏容器：780×1688 移动竖屏优先比例，自适应屏幕居中 */
#game-container {
  position: relative;
  width: 100%;
  max-width: 440px;
  height: 100vh;
  height: 100dvh;
  max-height: 960px;
  background-color: var(--bg-deep-basalt);
  background-image: 
    radial-gradient(circle at 50% 30%, rgba(168, 85, 247, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 50% 80%, rgba(217, 119, 6, 0.06) 0%, transparent 50%),
    linear-gradient(180deg, #05070a 0%, #080b10 100%);
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.9), 0 0 1px 1px rgba(203, 213, 225, 0.15);
  border-left: 1px solid rgba(51, 65, 85, 0.4);
  border-right: 1px solid rgba(51, 65, 85, 0.4);
  overflow: hidden;
  overflow-x: hidden;
}

/* 移动端默认隐藏桌面侧边栏，中栏核心舞台撑开纵向流 */
.desktop-side-panel {
  display: none;
}

.center-stage-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ================= 1. TOP HUD (同心以太环) ================= */
#top-hud {
  height: 64px;
  background: linear-gradient(180deg, rgba(16, 22, 34, 0.95) 0%, rgba(16, 22, 34, 0.75) 100%);
  border-bottom: 1px solid var(--border-forged-iron);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 10;
  backdrop-filter: blur(8px);
}

.vitality-orb-container {
  position: relative;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.concentric-ring-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
}
.outer-ring-bg {
  stroke-width: 4;
}
.inner-ring-bg {
  stroke-width: 6;
}

.ring-bar {
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.armor-ring {
  stroke: var(--frost-cyan);
  stroke-width: 4;
  stroke-dasharray: 251.3;
  stroke-dashoffset: 251.3;
  filter: drop-shadow(0 0 4px var(--frost-cyan));
}

.hp-ring {
  stroke: var(--flame-red);
  stroke-width: 6;
  stroke-dasharray: 201.0;
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 4px var(--flame-red));
}

.vitality-center-label {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.hp-current {
  color: #fff;
  font-size: 13px;
}
.hp-divider {
  display: none;
}
.hp-max {
  color: #94a3b8;
  font-size: 9px;
}

.armor-badge {
  position: absolute;
  bottom: -2px;
  right: -14px;
  background: rgba(6, 182, 212, 0.25);
  border: 1px solid var(--frost-cyan);
  border-radius: 10px;
  padding: 1px 5px;
  font-size: 10px;
  color: #e0f2fe;
  display: flex;
  align-items: center;
  gap: 2px;
  box-shadow: 0 0 6px rgba(6, 182, 212, 0.5);
  z-index: 4;
  pointer-events: none;
}

.hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stage-badge {
  display: flex;
  align-items: center;
  gap: 4px;
}

.stage-tag {
  font-size: 10px;
  color: var(--gold-highlight);
  letter-spacing: 1px;
  background: rgba(245, 158, 11, 0.15);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.stage-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--highlight-mithril);
}

.turn-badge {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

.turn-val {
  color: var(--chrono-gold);
  font-weight: 700;
  margin: 0 2px;
}

.hud-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.hud-right-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud-help-btn {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid var(--gold-kintsugi);
  color: var(--gold-highlight);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  min-height: 44px;
  min-width: 44px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

.hud-help-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(253, 224, 71, 0.3), transparent);
  animation: shine-button 4s infinite ease-in-out;
}

@keyframes shine-button {
  0% { left: -100%; }
  25% { left: 100%; }
  100% { left: 100%; }
}

.hud-help-btn:hover {
  background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
  border-color: var(--gold-highlight);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.hud-help-btn:active {
  transform: translateY(1px);
}

.gold-badge {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 7px;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.25);
  font-size: 11px;
  color: #fbbf24;
  font-weight: 600;
}

.player-buffs-row {
  display: flex;
  gap: 4px;
}

.buff-chip {
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-mithril);
}

/* ================= 2. BATTLEFIELD AREA (战场) ================= */
#battlefield-area {
  position: relative;
  flex: 1;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  overflow: hidden;
}

.alchemy-circle-bg {
  position: absolute;
  width: 320px;
  height: 320px;
  pointer-events: none;
  opacity: 0.7;
  animation: rotateAlchemy 60s linear infinite;
}

@keyframes rotateAlchemy {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.alchemy-svg {
  width: 100%;
  height: 100%;
}

#enemies-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
  z-index: 2;
}

/* 敌人实体卡槽 */
.enemy-card {
  position: relative;
  width: 140px;
  background: linear-gradient(145deg, rgba(26, 35, 51, 0.85) 0%, rgba(16, 22, 34, 0.95) 100%);
  border: 1.5px solid var(--border-mithril);
  border-radius: 10px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
  transition: transform 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}

.enemy-card.targeted {
  border-color: var(--flame-red);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.6);
  transform: scale(1.04);
}

.enemy-card.dead {
  opacity: 0.3;
  filter: grayscale(1);
  pointer-events: none;
}

/* 敌人意图指示牌 */
.enemy-intent-badge {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(203, 213, 225, 0.3);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.enemy-intent-badge.attack {
  border-color: var(--flame-red);
  color: #fca5a5;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

.enemy-intent-badge.defend {
  border-color: var(--frost-cyan);
  color: #bae6fd;
}

.enemy-intent-badge.buff {
  border-color: var(--gold-kintsugi);
  color: #fde68a;
}

/* 构装体视觉图形 */
.enemy-visual-wrapper {
  width: 80px;
  height: 80px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.enemy-svg-graphic {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.4));
  animation: floatIdle 3s ease-in-out infinite;
}

@keyframes floatIdle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.enemy-name-label {
  font-size: 12px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 4px;
  text-align: center;
}

/* 敌人血条与护甲条 */
.enemy-bars-container {
  width: 100%;
  margin-top: 4px;
}

.enemy-hp-bar-track {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.5);
}

.enemy-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #dc2626 0%, #ef4444 100%);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

.enemy-armor-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, #0891b2 0%, #06b6d4 100%);
  opacity: 0.85;
  transition: width 0.3s ease;
}

.enemy-hp-values {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #cbd5e1;
  margin-top: 2px;
  font-weight: 600;
}

.enemy-buff-icons {
  display: flex;
  gap: 3px;
  margin-top: 4px;
  min-height: 14px;
}

.enemy-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: center;
  align-items: center;
  margin-top: 4px;
  min-height: 16px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-mithril);
  color: #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.status-badge.vulnerable {
  border-color: #f59e0b;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.2);
}

.status-badge.weak {
  border-color: #38bdf8;
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.2);
}

.status-badge.stasis {
  border-color: #06b6d4;
  color: #67e8f9;
  background: rgba(6, 182, 212, 0.2);
}

.status-badge.thorns {
  border-color: #f97316;
  color: #fdba74;
  background: rgba(249, 115, 22, 0.2);
}

/* 飘字与特效层 */
#vfx-damage-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
}

.damage-floater {
  position: absolute;
  font-size: 18px;
  font-weight: 900;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 4px #000;
  animation: floatUpFade 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  pointer-events: none;
  white-space: nowrap;
}

.damage-floater.fire { color: #f97316; filter: drop-shadow(0 0 6px #ef4444); }
.damage-floater.frost { color: #67e8f9; filter: drop-shadow(0 0 6px #06b6d4); }
.damage-floater.void { color: #c084fc; filter: drop-shadow(0 0 6px #a855f7); }
.damage-floater.kinetic { color: #f8fafc; filter: drop-shadow(0 0 6px #94a3b8); }
.damage-floater.heal { color: #34d399; filter: drop-shadow(0 0 6px #10b981); }
.damage-floater.armor { color: #38bdf8; filter: drop-shadow(0 0 6px #0284c7); }

@keyframes floatUpFade {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.6); }
  20% { opacity: 1; transform: translate(-50%, -15px) scale(1.2); }
  60% { opacity: 1; transform: translate(-50%, -35px) scale(1.0); }
  100% { opacity: 0; transform: translate(-50%, -60px) scale(0.8); }
}

/* 屏幕震动 */
.shake {
  animation: screenShake 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes screenShake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(3px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* ================= 3. MID GAUGE (熔炉负荷与共振提示) ================= */
#mid-gauge-area {
  height: 38px;
  background: rgba(16, 22, 34, 0.6);
  border-top: 1px solid var(--border-forged-iron);
  border-bottom: 1px solid var(--border-forged-iron);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
}

.overheat-gauge-container {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gauge-title {
  font-size: 10px;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.overheat-slots {
  display: flex;
  gap: 3px;
}

.overheat-bar {
  width: 12px;
  height: 8px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-mithril);
  transition: all 0.3s ease;
}

.overheat-bar.active {
  background: var(--flame-red);
  border-color: #fca5a5;
  box-shadow: 0 0 6px var(--flame-red);
}

.overheat-bar.danger {
  animation: pulseOverheat 0.8s infinite alternate;
}

@keyframes pulseOverheat {
  from { box-shadow: 0 0 2px var(--flame-red); opacity: 0.6; }
  to { box-shadow: 0 0 10px #dc2626; opacity: 1; }
}

.overheat-label {
  font-size: 10px;
  font-weight: 600;
  color: #cbd5e1;
}

.resonance-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--chrono-gold);
}

.resonance-indicator.active {
  color: var(--gold-highlight);
  animation: glowResonance 1s infinite alternate;
}

@keyframes glowResonance {
  from { text-shadow: 0 0 2px var(--chrono-amber); }
  to { text-shadow: 0 0 8px var(--gold-highlight); }
}

/* ================= 4. ECHO RAIL (4 槽金珀琉璃残响回溯轨) ================= */
#echo-rail-area {
  min-height: 105px;
  background: linear-gradient(180deg, rgba(26, 35, 51, 0.6) 0%, rgba(16, 22, 34, 0.8) 100%);
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  position: relative;
  border-bottom: 1px solid var(--border-forged-iron);
}

.echo-rail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.rail-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--chrono-gold);
  letter-spacing: 0.5px;
}

.rail-subtitle {
  font-size: 9px;
  color: #64748b;
}

.echo-slots-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  position: relative;
  flex: 1;
}

/* 单个金珀琉璃时钟槽位 */
.echo-slot {
  flex: 1;
  height: 72px;
  background: rgba(16, 22, 34, 0.7);
  border: 1.5px dashed rgba(217, 119, 6, 0.35);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 4px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.echo-slot.occupied {
  border-style: solid;
  border-color: var(--chrono-amber);
  background: linear-gradient(145deg, rgba(30, 20, 10, 0.85) 0%, rgba(16, 22, 34, 0.95) 100%);
  box-shadow: 0 0 10px rgba(217, 119, 6, 0.25);
}

.echo-slot.highlight-resonance {
  border-color: var(--gold-highlight);
  box-shadow: 0 0 16px var(--gold-highlight);
  animation: pulseSlotResonance 1s infinite alternate;
}

@keyframes pulseSlotResonance {
  from { transform: scale(1); }
  to { transform: scale(1.03); }
}

.echo-slot-number {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 9px;
  color: #64748b;
  font-weight: 700;
}

.echo-slot-empty-label {
  font-size: 9px;
  color: #475569;
  letter-spacing: 0.5px;
}

.echo-card-name {
  font-size: 10px;
  font-weight: 700;
  color: #fef08a;
  text-align: center;
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.echo-card-element {
  font-size: 9px;
  margin-top: 2px;
  padding: 0 4px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.5);
}

.echo-card-hint {
  font-size: 8px;
  color: #cbd5e1;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 2px;
}

/* 槽间流光导管 */
.echo-slot-conduit {
  position: absolute;
  height: 2px;
  background: rgba(203, 213, 225, 0.15);
  top: 50%;
  z-index: 1;
}

/* ================= 4b. 新手提示条 (BEGINNER TIP BANNER) ================= */
.beginner-tip-banner {
  margin: 0 10px 4px 10px;
  padding: 5px 10px;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.16) 0%, rgba(16, 22, 34, 0.9) 50%, rgba(6, 182, 212, 0.16) 100%);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4), inset 0 0 10px rgba(245, 158, 11, 0.08);
  z-index: 15;
  animation: banner-subtle-glow 4s ease-in-out infinite alternate;
}

@keyframes banner-subtle-glow {
  0% {
    border-color: rgba(245, 158, 11, 0.3);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  }
  100% {
    border-color: rgba(245, 158, 11, 0.6);
    box-shadow: 0 2px 14px rgba(245, 158, 11, 0.25);
  }
}

.beginner-tip-banner .tip-content {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.beginner-tip-banner .tip-icon {
  font-size: 13px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px #fbbf24);
}

.beginner-tip-banner .tip-text {
  font-size: 11px;
  line-height: 1.35;
  color: #f1f5f9;
  letter-spacing: 0.2px;
}

.beginner-tip-banner .tip-text b {
  color: var(--gold-highlight);
  font-weight: 700;
}

.beginner-tip-banner .tip-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.beginner-tip-banner .tip-close-btn:hover {
  color: #fde047;
  background: rgba(255, 255, 255, 0.1);
}

/* ================= 5. HAND CARDS AREA (手牌与双卡碰撞熔铸) ================= */
#hand-cards-area {
  position: relative;
  min-height: 210px;
  flex: 1.2;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

#cards-container {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: relative;
  padding-bottom: 8px;
}

/* 标准黑曜石构装卡牌 */
.game-card {
  position: relative;
  width: 98px;
  height: 148px;
  background: linear-gradient(160deg, #182232 0%, #101622 100%);
  border: 1.5px solid var(--border-mithril);
  border-radius: 7px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  padding: 4px 5px;
  cursor: grab;
  touch-action: none;
  transition: transform 0.15s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.15s ease, border-color 0.15s ease;
  user-select: none;
  margin-left: -12px; /* 扇形重叠 */
}

.game-card:first-child {
  margin-left: 0;
}

.game-card:hover {
  transform: translateY(-12px) scale(1.05);
  z-index: 10;
  border-color: var(--highlight-mithril);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.8), 0 0 10px rgba(203, 213, 225, 0.2);
}

.game-card.selected {
  transform: translateY(-20px) scale(1.08);
  border-color: var(--gold-highlight);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.9), 0 0 16px var(--gold-highlight);
  z-index: 15;
}

/* 拖拽吸附态 */
.game-card.attract-target {
  border-color: var(--attract-blue) !important;
  box-shadow: 0 0 20px var(--attract-blue), inset 0 0 12px var(--attract-blue) !important;
  transform: translateY(-15px) scale(1.1) !important;
  z-index: 20;
  animation: attractPulse 0.6s infinite alternate;
}

@keyframes attractPulse {
  from { filter: brightness(1.0); }
  to { filter: brightness(1.3); }
}

.game-card.dragging {
  opacity: 0.92;
  cursor: grabbing;
  z-index: 30;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.9), 0 0 15px var(--gold-kintsugi);
  pointer-events: none;
}

/* 熔铸复合卡金缮高光 */
.game-card.fused-hypercard {
  border-color: var(--gold-kintsugi);
  background: linear-gradient(160deg, #2a2015 0%, #121824 100%);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

/* 元素特定色调边框 */
.game-card[data-element*="fire"] { border-top-color: var(--flame-red); }
.game-card[data-element*="frost"] { border-top-color: var(--frost-cyan); }
.game-card[data-element*="void"] { border-top-color: var(--void-purple); }
.game-card[data-element*="kinetic"] { border-top-color: var(--highlight-mithril); }

/* 卡牌内部解剖结构 */
.card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 18px;
}

.card-cost-gem {
  width: 17px;
  height: 17px;
  background: radial-gradient(circle, #c084fc 0%, #9333ea 100%);
  border: 1px solid #f8fafc;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 4px #a855f7;
}

.card-element-tag {
  font-size: 11px;
}

.card-visual-glyph {
  height: 38px;
  margin: 2px 0;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.glyph-svg {
  width: 28px;
  height: 28px;
}

.card-title-banner {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  color: #f8fafc;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 1px 0;
  border-bottom: 1px solid rgba(203, 213, 225, 0.15);
}

.card-play-desc {
  font-size: 8.5px;
  color: #e2e8f0;
  line-height: 1.15;
  margin-top: 2px;
  flex: 1;
}

.card-echo-box {
  background: rgba(217, 119, 6, 0.15);
  border: 1px solid rgba(217, 119, 6, 0.3);
  border-radius: 3px;
  padding: 1px 3px;
  font-size: 8px;
  color: #fde68a;
  line-height: 1.1;
  margin-top: 2px;
}

.card-affix-tag {
  font-size: 7.5px;
  color: #94a3b8;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 实时双卡碰撞预览悬浮窗 */
.fusion-preview-card {
  position: absolute;
  bottom: 180px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  background: linear-gradient(160deg, rgba(30, 24, 18, 0.95) 0%, rgba(16, 22, 34, 0.98) 100%);
  border: 2px solid var(--gold-kintsugi);
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.9), 0 0 20px rgba(245, 158, 11, 0.5);
  padding: 10px 12px;
  z-index: 50;
  backdrop-filter: blur(12px);
  animation: popInPreview 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes popInPreview {
  from { opacity: 0; transform: translate(-50%, 15px) scale(0.9); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

.preview-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(245, 158, 11, 0.3);
  padding-bottom: 4px;
  margin-bottom: 6px;
}

.preview-fused-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--gold-highlight);
}

.preview-cost-badge {
  background: var(--void-purple);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}

.preview-body-text {
  font-size: 10px;
  color: #f1f5f9;
  line-height: 1.3;
  margin-bottom: 4px;
}

.preview-echo-text {
  font-size: 9px;
  color: #fef08a;
  background: rgba(217, 119, 6, 0.2);
  padding: 3px 6px;
  border-radius: 4px;
}

.preview-hint {
  font-size: 9px;
  color: var(--attract-blue);
  text-align: center;
  margin-top: 6px;
  font-weight: 600;
}

/* ================= 6. BOTTOM CONTROLS (底部控制栏) ================= */
#bottom-controls {
  height: 64px;
  background: linear-gradient(180deg, rgba(16, 22, 34, 0.85) 0%, rgba(10, 14, 22, 0.98) 100%);
  border-top: 1px solid var(--border-forged-iron);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  z-index: 10;
}

.energy-crystals-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.energy-crystals-row {
  display: flex;
  gap: 4px;
}

/* 八面体以太晶核 */
.energy-crystal-octa {
  width: 14px;
  height: 20px;
  background: linear-gradient(135deg, #c084fc 0%, #9333ea 50%, #6b21a8 100%);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.6);
  transition: all 0.3s ease;
}

.energy-crystal-octa.empty {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
  opacity: 0.3;
}

.energy-text-label {
  display: flex;
  align-items: baseline;
  font-size: 12px;
  font-weight: 800;
  color: #e2e8f0;
}

.energy-num {
  font-size: 16px;
  color: #c084fc;
}

.energy-divider {
  margin: 0 2px;
  color: #64748b;
}

.energy-max {
  color: #94a3b8;
}

.energy-name {
  font-size: 10px;
  margin-left: 3px;
  color: #a855f7;
}

.deck-piles-info {
  display: flex;
  gap: 8px;
}

.pile-badge {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-mithril);
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 11px;
  color: #cbd5e1;
}

/* 黑曜石切角行动按钮 */
.btn-forge-action {
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  border: 1.5px solid var(--gold-kintsugi);
  border-radius: 6px;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  padding: 6px 14px;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 8px rgba(245, 158, 11, 0.25);
  transition: all 0.2s ease;
  min-width: 90px;
}

.btn-forge-action:hover {
  background: linear-gradient(145deg, #334155 0%, #1e293b 100%);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.7), 0 0 14px rgba(245, 158, 11, 0.5);
  transform: translateY(-2px);
}

.btn-forge-action:active {
  transform: translateY(1px);
}

.btn-text {
  font-size: 12px;
  font-weight: 800;
  color: var(--gold-highlight);
  letter-spacing: 0.5px;
}

.btn-subtext {
  font-size: 9px;
  color: #cbd5e1;
}

/* ================= 7. MODALS (结算与战利品三选一) ================= */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 11000;
  padding: 16px;
}

.modal-card {
  width: 100%;
  max-width: 380px;
  background: linear-gradient(160deg, #1a2333 0%, #101622 100%);
  border: 2px solid var(--gold-kintsugi);
  border-radius: 12px;
  padding: 18px 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.9), 0 0 24px rgba(245, 158, 11, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--gold-highlight);
  margin-bottom: 6px;
}

.modal-desc {
  font-size: 12px;
  color: #cbd5e1;
  margin-bottom: 14px;
}

.reward-cards-container {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  width: 100%;
  justify-content: center;
}

.reward-card-choice {
  flex: 1;
  max-width: 105px;
  height: 155px;
  background: linear-gradient(160deg, #182232 0%, #101622 100%);
  border: 1.5px solid var(--border-mithril);
  border-radius: 6px;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reward-card-choice:hover {
  transform: translateY(-6px) scale(1.05);
  border-color: var(--gold-kintsugi);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.8), 0 0 12px var(--gold-kintsugi);
}

.btn-modal-action {
  background: linear-gradient(145deg, #d97706 0%, #b45309 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 24px;
  border: 1px solid var(--gold-highlight);
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.4);
  transition: all 0.2s ease;
}

.btn-modal-action:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
}

/* ================= 8. GUIDE MODAL (玩法指南模态弹窗) ================= */
.guide-modal-overlay {
  z-index: 11100;
}

.guide-modal-card {
  max-width: 410px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  background: linear-gradient(170deg, #161e2e 0%, #0d121c 100%);
  border: 2px solid var(--gold-kintsugi);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85), 0 0 25px rgba(245, 158, 11, 0.25);
  text-align: left;
}

.guide-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.7) 0%, rgba(16, 22, 34, 0.85) 100%);
  border-bottom: 1px solid rgba(245, 158, 11, 0.3);
  width: 100%;
}

.guide-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.guide-title-icon {
  font-size: 18px;
}

.guide-modal-header .modal-title {
  margin-bottom: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--gold-highlight);
  letter-spacing: 0.5px;
}

.guide-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(203, 213, 225, 0.2);
  color: #94a3b8;
  font-size: 20px;
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.guide-close-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: var(--flame-red);
  color: #fff;
}

.guide-modal-body {
  padding: 12px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  width: 100%;
  flex: 1;
}

.guide-modal-body::-webkit-scrollbar {
  width: 5px;
}
.guide-modal-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
.guide-modal-body::-webkit-scrollbar-thumb {
  background: var(--gold-kintsugi);
  border-radius: 3px;
}

.guide-card-item {
  background: rgba(22, 30, 46, 0.65);
  border: 1px solid rgba(51, 65, 85, 0.7);
  border-left: 3px solid var(--gold-kintsugi);
  border-radius: 8px;
  padding: 10px 12px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.guide-card-item:hover {
  border-color: rgba(245, 158, 11, 0.6);
  background: rgba(28, 38, 58, 0.8);
}

.guide-card-item.warning-card {
  border-left-color: var(--flame-red);
  background: rgba(36, 18, 22, 0.55);
}

.guide-card-item.warning-card:hover {
  border-color: rgba(239, 68, 68, 0.6);
  background: rgba(45, 22, 28, 0.75);
}

.guide-step-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--gold-kintsugi);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.guide-step-tag.warning-tag {
  color: #f87171;
}

.guide-step-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 5px;
}

.guide-elem-icon {
  font-size: 16px;
}

.guide-step-desc {
  font-size: 11.5px;
  line-height: 1.5;
  color: #cbd5e1;
}

.guide-step-desc b {
  color: var(--gold-highlight);
}

.guide-step-tip {
  margin-top: 6px;
  font-size: 10.5px;
  color: #94a3b8;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px 8px;
  border-radius: 4px;
  border-left: 2px solid var(--frost-cyan);
}

.guide-step-resonance {
  margin-top: 6px;
  font-size: 10.5px;
  line-height: 1.45;
  color: #fef08a;
  background: rgba(245, 158, 11, 0.12);
  padding: 5px 8px;
  border-radius: 4px;
  border: 1px dashed rgba(245, 158, 11, 0.4);
}

.guide-modal-footer {
  padding: 10px 16px 14px 16px;
  background: rgba(16, 22, 34, 0.95);
  border-top: 1px solid rgba(51, 65, 85, 0.5);
  display: flex;
  justify-content: center;
  width: 100%;
}

.guide-modal-footer .btn-modal-action {
  width: 100%;
  padding: 10px 16px;
  font-size: 13px;
  letter-spacing: 1px;
}

/* ================= 真实物理资产 (Physical Assets) 样式规约 ================= */
.hud-icon-inline {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  object-fit: contain;
  margin-right: 3px;
  display: inline-block;
}

.hud-btn-icon {
  width: 15px;
  height: 15px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 3px;
}

.panel-title-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 6px;
}

.gauge-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 4px;
}

.rail-header-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 4px;
}

.tip-icon-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 6px;
}

.pile-icon-img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 4px;
}

.btn-action-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  margin-right: 6px;
}

.guide-title-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  margin-right: 8px;
}

.guide-elem-icon-img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 4px;
}

.enemy-avatar {
  width: 100%;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
  transition: transform 0.25s ease;
}

.enemy-card:hover .enemy-avatar {
  transform: scale(1.05);
}

.intent-icon-img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 2px;
}

.status-icon-img {
  width: 13px;
  height: 13px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 3px;
}

.card-elem-img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  vertical-align: middle;
}

.btn-forge-action {
  background-image: linear-gradient(135deg, rgba(245, 158, 11, 0.9) 0%, rgba(217, 119, 6, 0.95) 100%);
  min-height: 48px;
  min-width: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ================= ONBOARDING OVERLAY STYLES (Teach by Doing) ================= */
.onboarding-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  pointer-events: none;
  overflow: hidden;
  transition: opacity 0.4s ease;
}

.onboarding-mask-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.spotlight-focused-element {
  position: relative !important;
  z-index: 10005 !important;
  pointer-events: auto !important;
}

/* 镂空边缘金缮流光边框 */
.spotlight-focus-border {
  position: absolute;
  pointer-events: none;
  border: 2px solid var(--gold-kintsugi, #f59e0b);
  border-radius: 12px;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.7), inset 0 0 12px rgba(245, 158, 11, 0.35);
  animation: spotlightPulse 1.8s ease-in-out infinite alternate;
  transition: all 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: none;
  z-index: 10000;
}

@keyframes spotlightPulse {
  0% { transform: scale(1); box-shadow: 0 0 10px rgba(245, 158, 11, 0.4); }
  100% { transform: scale(1.02); box-shadow: 0 0 24px rgba(253, 224, 71, 0.95); }
}

/* 引导气泡：黑曜石秘银质感 */
.onboarding-dialog-bubble {
  position: absolute;
  width: min(340px, 88vw);
  background: linear-gradient(135deg, rgba(16, 22, 34, 0.98) 0%, rgba(26, 35, 51, 0.98) 100%);
  border: 1.5px solid var(--gold-kintsugi, #f59e0b);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.85), 0 0 18px rgba(245, 158, 11, 0.3);
  border-radius: 14px;
  padding: 16px;
  color: #f8fafc;
  z-index: 10001;
  pointer-events: auto;
  transition: all 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bubble-header {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}

.bubble-step-badge {
  font-size: 11px;
  font-weight: 700;
  color: #080b10;
  background: var(--gold-kintsugi, #f59e0b);
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  margin-right: 8px;
}

.bubble-title {
  font-size: 15px;
  font-weight: 700;
  color: #fde047;
}

.bubble-body {
  font-size: 13px;
  line-height: 1.55;
  color: #cbd5e1;
}

.bubble-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.btn-ob-action {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  border: 1px solid var(--gold-highlight, #fde047);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  min-height: 44px;
  min-width: 90px;
  transition: all 0.2s ease;
}

.btn-ob-action:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
}

/* 虚拟拖拽手势动效 */
.virtual-hand-pointer {
  position: absolute;
  z-index: 10002;
  pointer-events: none;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.8));
  transition: opacity 0.3s;
}

@keyframes handDragGesture {
  0% { transform: translate(0, 0) scale(1); opacity: 0; }
  15% { opacity: 1; transform: translate(0, 0) scale(1.1); }
  75% { transform: translate(var(--drag-x, 80px), var(--drag-y, 0px)) scale(0.95); opacity: 1; }
  100% { transform: translate(var(--drag-x, 80px), var(--drag-y, 0px)) scale(0.9); opacity: 0; }
}

.hand-animating {
  animation: handDragGesture 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* 常驻跳过按钮 */
.btn-onboarding-skip {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 18px;
  cursor: pointer;
  z-index: 10003;
  backdrop-filter: blur(6px);
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-onboarding-skip:hover {
  background: rgba(51, 65, 85, 0.95);
  color: #fff;
  border-color: #fde047;
}

/* ================= 移动端安全区支持 ================= */
@supports (padding-top: env(safe-area-inset-top)) {
  #top-hud {
    padding-top: max(6px, env(safe-area-inset-top));
    height: calc(64px + env(safe-area-inset-top));
  }
  #bottom-controls {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    min-height: calc(64px + env(safe-area-inset-bottom));
  }
}

/* ================= 桌面端三栏战术工作台 (>= 1024px) ================= */
@media (min-width: 1024px) {
  body {
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at 50% 50%, #101622 0%, #030508 100%);
    overflow: hidden;
  }

  #game-container {
    max-width: 1640px;
    width: 95vw;
    height: 92vh;
    max-height: 1000px;
    border-radius: 16px;
    border: 1px solid var(--border-mithril, #334155);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.95), 0 0 20px rgba(168, 85, 247, 0.15);
    display: grid;
    grid-template-columns: 310px 1fr 330px;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
      "left-panel top-hud      right-panel"
      "left-panel center-stage right-panel"
      "left-panel bottom-bar   right-panel";
    overflow: hidden;
  }

  /* 展开桌面侧边栏 */
  .desktop-side-panel {
    display: flex;
    flex-direction: column;
    background: rgba(16, 22, 34, 0.95);
    backdrop-filter: blur(12px);
    border-color: var(--border-forged-iron, #1e293b);
    padding: 16px;
    gap: 14px;
    overflow-y: auto;
    z-index: 15;
  }

  #tactics-left-panel {
    grid-area: left-panel;
    border-right: 1px solid var(--border-mithril, #334155);
  }

  #tactics-right-panel {
    grid-area: right-panel;
    border-left: 1px solid var(--border-mithril, #334155);
  }

  #top-hud {
    grid-area: top-hud;
    border-bottom: 1px solid var(--border-forged-iron, #1e293b);
  }

  .center-stage-wrapper {
    grid-area: center-stage;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
  }

  #bottom-controls {
    grid-area: bottom-bar;
    border-top: 1px solid var(--border-forged-iron, #1e293b);
  }

  /* 左侧边栏内容 */
  .panel-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--highlight-mithril, #cbd5e1);
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(51, 65, 85, 0.4);
    padding-bottom: 6px;
  }

  .desktop-vitals-box {
    display: flex;
    justify-content: center;
    padding: 10px 0;
  }

  .desktop-orb {
    width: 90px;
    height: 90px;
  }

  .desktop-subcard {
    background: rgba(11, 16, 26, 0.8);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 8px;
    padding: 10px 12px;
  }

  .passive-subcard {
    border-left: 3px solid var(--gold-kintsugi, #f59e0b);
  }

  .passive-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--gold-highlight, #fde047);
    margin-bottom: 4px;
  }

  .passive-desc {
    font-size: 11px;
    line-height: 1.5;
    color: #94a3b8;
  }

  .deck-stat-row {
    font-size: 12px;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    margin-bottom: 6px;
  }
  .deck-stat-row:last-child {
    margin-bottom: 0;
  }

  .pc-energy-display {
    font-size: 13px;
    color: #f8fafc;
  }

  /* 右侧边栏内容 */
  .pc-tactics-card {
    background: rgba(11, 16, 26, 0.8);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12px;
    min-height: 70px;
  }

  .scan-empty-hint {
    color: #64748b;
    font-style: italic;
    font-size: 11px;
    text-align: center;
    padding: 14px 0;
  }

  .pc-target-name {
    font-size: 13px;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 4px;
  }

  .pc-target-intent {
    color: #fbbf24;
    font-size: 11.5px;
    margin-bottom: 4px;
  }

  .pc-target-status {
    font-size: 11px;
    color: #94a3b8;
  }

  .fusion-recipes-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 150px;
    overflow-y: auto;
  }

  .recipe-item {
    font-size: 11px;
    background: rgba(30, 41, 59, 0.5);
    border-left: 2px solid var(--frost-cyan, #06b6d4);
    padding: 4px 6px;
    border-radius: 3px;
    color: #e2e8f0;
  }

  .recipe-name {
    color: var(--gold-highlight, #fde047);
    font-weight: 600;
  }

  .pc-combat-log-stream {
    background: rgba(8, 11, 16, 0.9);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 8px;
    padding: 8px 10px;
    font-family: monospace;
    font-size: 10.5px;
    max-height: 140px;
    overflow-y: auto;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .log-entry.system {
    color: #60a5fa;
  }

  /* 宽屏下手牌平铺舒展 */
  #cards-container {
    display: flex;
    justify-content: center;
    gap: 14px;
    padding: 10px 20px;
    overflow-x: visible;
  }

  .game-card {
    width: 108px;
    height: 154px;
    transform-origin: bottom center;
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s;
  }

  .game-card:hover {
    transform: translateY(-16px) scale(1.08);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.8), 0 0 18px var(--gold-kintsugi, #f59e0b);
    z-index: 50;
  }

  /* 宽屏下残响轨更舒展 */
  #echo-rail-area {
    padding: 10px 20px;
  }
  .echo-slots-container {
    justify-content: center;
    gap: 16px;
  }
  .echo-slot {
    width: 68px;
    height: 86px;
  }
}

/* 1600+ 高清大屏适配 */
@media (min-width: 1600px) {
  #game-container {
    grid-template-columns: 350px 1fr 380px;
  }
  .game-card {
    width: 120px;
    height: 170px;
  }
  .echo-slot {
    width: 80px;
    height: 100px;
  }
}
