:root {
  --bg-deep: #05080f;
  --bg-panel: rgba(11, 17, 28, 0.94);
  --bg-card: rgba(15, 23, 36, 0.9);
  --line-soft: rgba(182, 204, 228, 0.14);
  --line-gold: rgba(235, 194, 114, 0.52);
  --text-main: #eef4fb;
  --text-dim: #8da2ba;
  --gold: #efc772;
  --gold-bright: #ffe6a8;
  --jade: #4be8de;
  --crimson: #ff5d6c;
  --green: #4ee393;
  --violet: #b694ff;
  --radius: 10px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 50% 20%, rgba(28, 52, 82, 0.34), transparent 60%),
    #03060b;
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  overflow: hidden;
  user-select: none;
}

/* ==================== 统一全竖屏手游主容器（手机全屏 / PC 居中精致 440px 机壳） ==================== */
.phone-shell {
  position: relative;
  width: 100%;
  max-width: 440px;
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(28, 52, 78, 0.42), transparent 56%),
    linear-gradient(180deg, #070c15 0%, #05080f 100%);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.88), 0 0 0 1px rgba(239, 199, 114, 0.12);
  overflow: hidden;
}

.hidden {
  display: none !important;
}

/* SVG 图标统一尺度 */
.ui-ico {
  width: 15px;
  height: 15px;
  display: inline-block;
  vertical-align: -2.5px;
  flex-shrink: 0;
}
.ui-ico.xs {
  width: 12.5px;
  height: 12.5px;
  vertical-align: -2px;
}
.ui-ico.xxs {
  width: 10.5px;
  height: 10.5px;
  vertical-align: -1.5px;
}
.ui-ico.lg {
  width: 21px;
  height: 21px;
}
.star-lit {
  color: #ffd56b;
  filter: drop-shadow(0 0 5px rgba(255, 213, 107, 0.55));
}
.star-dim {
  color: rgba(130, 152, 178, 0.35);
}

/* ==================== 顶部紧凑资源与系统栏 ==================== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 10px;
  min-height: 48px;
  background: linear-gradient(180deg, rgba(8, 13, 22, 0.98), rgba(6, 10, 18, 0.94));
  border-bottom: 1px solid rgba(235, 194, 114, 0.22);
  flex-shrink: 0;
  z-index: 25;
}

.brand {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  flex-shrink: 0;
}
.brand-seal {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: linear-gradient(145deg, #c23535, #691418);
  border: 1.5px solid #f4cc7b;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 13px;
  color: #fff2d4;
  box-shadow: 0 0 10px rgba(212, 62, 62, 0.42);
}
.brand-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.12;
}
.brand-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #f9df9f;
}
.power-line {
  font-size: 9.5px;
  color: var(--text-dim);
}
.power-line strong {
  color: #6df2e7;
  font-size: 10.5px;
}

.top-right-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 0;
}
.res-strip {
  display: flex;
  align-items: center;
  gap: 4px;
}
.res-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
  background: rgba(16, 25, 40, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.res-pill.gold {
  color: #f8d784;
  border-color: rgba(240, 200, 116, 0.34);
}
.res-pill.jp {
  color: #6df2e7;
  border-color: rgba(75, 232, 222, 0.32);
}
.res-pill.exp {
  color: #79f2ad;
  border-color: rgba(78, 227, 147, 0.3);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.icon-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(16, 24, 38, 0.88);
  color: var(--text-main);
  border-radius: 5px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.icon-btn.on {
  border-color: var(--jade);
  color: var(--jade);
  background: rgba(21, 130, 124, 0.25);
}

/* ==================== 底部竖屏 5 标签导航 ==================== */
.bottom-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  padding: 6px 8px calc(7px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(8, 13, 22, 0.96), rgba(5, 8, 15, 0.99));
  border-top: 1px solid rgba(235, 194, 114, 0.22);
  flex-shrink: 0;
  z-index: 25;
}
.nav-btn {
  position: relative;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 5px 4px;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
}
.nav-btn.active {
  color: #ffe6a8;
  background: linear-gradient(180deg, rgba(239, 199, 114, 0.16), rgba(239, 199, 114, 0.04));
  border-color: rgba(239, 199, 114, 0.44);
}
.nav-dot {
  position: absolute;
  top: 4px;
  right: 16px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff5964;
  box-shadow: 0 0 6px #ff5964;
}

/* ==================== 主视口 ==================== */
.main-view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 10px 14px;
}
.main-view::-webkit-scrollbar {
  width: 4px;
}
.main-view::-webkit-scrollbar-thumb {
  background: rgba(180, 202, 228, 0.22);
  border-radius: 3px;
}
.main-view.battle-mode {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ==================== 竖屏主视觉封面 ==================== */
.title-splash {
  position: absolute;
  inset: 0;
  z-index: 90;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  padding: 40px 22px calc(30px + env(safe-area-inset-bottom, 0px));
  background: #04070d;
}
.title-splash-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  z-index: 0;
}
.title-splash-top,
.title-splash-bottom {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.title-chapter-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 13px;
  border-radius: 99px;
  background: rgba(10, 17, 30, 0.84);
  border: 1px solid rgba(239, 199, 114, 0.56);
  color: #ffe6a8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
}
.title-logo-main {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 4px;
  line-height: 1.14;
  background: linear-gradient(180deg, #fff6db 0%, #f1c66c 54%, #ba8630 100%);
  -webkit-background-clip: text;
  color: transparent;
  filter: drop-shadow(0 5px 14px rgba(0, 0, 0, 0.96));
}
.title-logo-sub {
  font-size: 12.5px;
  color: #c2d4e8;
  letter-spacing: 1px;
}
.title-enter-btn {
  width: 100%;
  max-width: 310px;
  padding: 13px 22px;
  border-radius: 8px;
  border: 1.5px solid #ffe4a0;
  background: linear-gradient(90deg, #e5b75a 0%, #bf7f28 100%);
  color: #160f04;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 1.8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: 0 8px 28px rgba(235, 185, 86, 0.36);
}
.title-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.title-feat-chip {
  font-size: 10px;
  color: #b4c8de;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(10, 17, 30, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* ==================== 竖屏视觉小说剧情对话层 ==================== */
.story-overlay {
  position: absolute;
  inset: 0;
  z-index: 85;
  background:
    radial-gradient(circle at 50% 38%, rgba(28, 44, 68, 0.42), rgba(4, 7, 13, 0.94) 76%),
    url('./assets/img/bg_arena_portrait.webp') center/cover no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 16px 14px calc(20px + env(safe-area-inset-bottom, 0px));
}
.story-skip-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(9, 14, 24, 0.85);
  color: #d6e4f4;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.story-stage-portrait {
  position: absolute;
  bottom: 168px;
  width: 280px;
  height: 360px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  animation: storyFadeIn 0.25s ease;
}
.story-stage-portrait.left {
  left: 6%;
}
.story-stage-portrait.right {
  right: 6%;
}
.story-stage-portrait img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.85));
}
@keyframes storyFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.story-box {
  position: relative;
  z-index: 4;
  width: 100%;
  background: linear-gradient(180deg, rgba(10, 17, 29, 0.95), rgba(6, 10, 18, 0.98));
  border: 1px solid rgba(239, 199, 114, 0.56);
  border-radius: 10px;
  padding: 14px 15px 11px;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.82);
  cursor: pointer;
}
.story-speaker {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 11px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(239, 199, 114, 0.24), rgba(239, 199, 114, 0.05));
  border: 1px solid rgba(239, 199, 114, 0.58);
  color: #ffe8ad;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
}
.story-text {
  font-size: 13.5px;
  line-height: 1.65;
  color: #edf4fc;
  min-height: 54px;
}
.story-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--text-dim);
}

/* ==================== 通用卡片、按钮、标签 ==================== */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 2px 7px;
}
.section-head h2 {
  margin: 0;
  font-size: 12.5px;
  font-weight: 800;
  color: #f8de9d;
  letter-spacing: 0.4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.section-head span {
  font-size: 10px;
  color: var(--text-dim);
}

.card {
  background: linear-gradient(165deg, rgba(16, 25, 39, 0.92), rgba(10, 16, 26, 0.96));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 10px 11px;
  margin-bottom: 9px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
}
.card.gold-edge {
  border-color: var(--line-gold);
}
.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}
.card-title {
  font-size: 13px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.badge {
  font-size: 9.5px;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.badge.gold {
  color: #ffe29c;
  border-color: rgba(239, 199, 114, 0.5);
  background: rgba(239, 199, 114, 0.13);
}
.badge.jade {
  color: #7df6ec;
  border-color: rgba(75, 232, 222, 0.48);
  background: rgba(75, 232, 222, 0.12);
}
.badge.red {
  color: #ff99a2;
  border-color: rgba(255, 93, 108, 0.5);
  background: rgba(255, 93, 108, 0.14);
}
.badge.green {
  color: #7cf2b2;
  border-color: rgba(78, 227, 147, 0.45);
  background: rgba(78, 227, 147, 0.13);
}
.badge.violet {
  color: #d4bcff;
  border-color: rgba(182, 148, 255, 0.45);
  background: rgba(182, 148, 255, 0.14);
}

.desc {
  font-size: 11.5px;
  line-height: 1.5;
  color: #c2d3e6;
  margin: 0 0 7px;
}
.muted {
  color: var(--text-dim);
  font-size: 10.5px;
}
.row {
  display: flex;
  align-items: center;
  gap: 7px;
}
.row.between {
  justify-content: space-between;
}
.row.wrap {
  flex-wrap: wrap;
}

.btn {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(20, 31, 48, 0.92);
  color: var(--text-main);
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.btn:active:not(:disabled) {
  transform: scale(0.97);
}
.btn.primary {
  background: linear-gradient(135deg, #ecc066, #bd7c24);
  border-color: #ffe6a8;
  color: #170f04;
}
.btn.jade {
  background: linear-gradient(135deg, #27a49d, #166564);
  border-color: #7df6ec;
  color: #ecfffe;
}
.btn.danger {
  background: linear-gradient(135deg, #b8333e, #791b24);
  border-color: #ff949c;
  color: #fff2f3;
}
.btn.sm {
  padding: 4px 9px;
  font-size: 10.5px;
  border-radius: 5px;
}
.btn.block {
  width: 100%;
}
.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

/* ==================== 1. 山海页（竖屏单栏：任务 + 彩绘地图 + 宝箱 + 关卡卡） ==================== */
.quest-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 9px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(24, 38, 60, 0.94), rgba(14, 24, 38, 0.9));
  border: 1px solid rgba(239, 199, 114, 0.44);
}
.quest-banner.ready {
  border-color: rgba(78, 227, 147, 0.72);
  background: linear-gradient(90deg, rgba(20, 62, 48, 0.9), rgba(12, 26, 36, 0.92));
}
.quest-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.quest-title {
  font-size: 11.5px;
  font-weight: 800;
  color: #fff2d4;
}
.quest-sub {
  font-size: 10px;
  color: #a9bfd6;
}

.chapter-map-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9.4;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(239, 199, 114, 0.36);
  margin-bottom: 8px;
  background: #07101c;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);
}
.chapter-map-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.chapter-map-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 9, 16, 0.54) 0%, transparent 28%, transparent 72%, rgba(5, 9, 16, 0.48) 100%);
  pointer-events: none;
}
.chapter-map-routes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}
.chapter-map-header {
  position: absolute;
  top: 7px;
  left: 8px;
  right: 8px;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}
.cm-badge {
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(7, 12, 22, 0.86);
  border: 1px solid rgba(239, 199, 114, 0.52);
  color: #ffe6a8;
  font-size: 10px;
  font-weight: 800;
}
.cm-hint {
  font-size: 9.5px;
  color: #d6e4f4;
  text-shadow: 0 1px 4px #000;
}

.map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 5;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.14s ease;
}
.map-pin.active {
  transform: translate(-50%, -50%) scale(1.12);
  z-index: 8;
}
.map-pin.locked {
  opacity: 0.65;
  filter: grayscale(0.45);
}
.pin-ring {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(135deg, #f3cd7a, #8d5c1e);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.82);
}
.map-pin.boss-pin .pin-ring {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #ff7078, #9c1a24);
  box-shadow: 0 0 14px rgba(255, 92, 108, 0.65);
}
.map-pin.active .pin-ring {
  box-shadow: 0 0 0 2.5px rgba(255, 232, 166, 0.6), 0 0 16px rgba(239, 199, 114, 0.85);
}
.pin-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #0d1624;
}
.pin-lock {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(5, 9, 16, 0.7);
  display: grid;
  place-items: center;
  color: #d6e4f4;
}
.pin-boss-tag {
  position: absolute;
  top: -6px;
  right: -7px;
  font-size: 8px;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 3px;
  background: #cc2836;
  color: #fff;
  border: 1px solid #ffd29c;
}
.pin-stars {
  display: flex;
  gap: 1px;
  margin-top: 2px;
  padding: 0 4px;
  border-radius: 99px;
  background: rgba(5, 9, 16, 0.86);
}
.pin-label {
  margin-top: 1px;
  font-size: 9px;
  font-weight: 800;
  color: #fff4dd;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(6, 11, 20, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
  white-space: nowrap;
}
.map-pin.active .pin-label {
  border-color: #f3cd7a;
  color: #ffe6a8;
}

.chest-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 9px;
}
.chest-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(13, 21, 34, 0.9);
  border-radius: 7px;
  padding: 6px 6px;
  color: #c5d6e8;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10px;
}
.chest-btn.claimable {
  border-color: #f3cd7a;
  background: linear-gradient(135deg, rgba(239, 199, 114, 0.22), rgba(20, 32, 48, 0.92));
  color: #ffe6a8;
}
.chest-btn.claimed {
  opacity: 0.56;
}

.stage-thumb-box {
  width: 72px;
  height: 82px;
  border-radius: 8px;
  background: radial-gradient(circle at 50% 72%, rgba(239, 199, 114, 0.2), rgba(8, 13, 22, 0.96));
  border: 1px solid rgba(239, 199, 114, 0.34);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.stage-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.loot-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 6px 0 9px;
}

/* ==================== 2. 修行页（竖屏：角色大立像 + 升级 + 5 槽 + 竖向 3×5 布阵） ==================== */
.roster-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 9px;
}
.roster-tab {
  border: 1px solid var(--line-soft);
  background: rgba(13, 21, 34, 0.9);
  color: var(--text-dim);
  border-radius: 8px;
  padding: 6px 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: left;
  min-width: 0;
}
.roster-tab.active {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(239, 199, 114, 0.16), rgba(16, 26, 42, 0.94));
  color: var(--text-main);
}
.rt-av {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
}
.roster-tab.active .rt-av {
  border-color: var(--gold);
}
.rt-name {
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rt-sub {
  font-size: 9px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-showcase {
  display: grid;
  grid-template-columns: 142px 1fr;
  gap: 10px;
  padding: 10px;
  margin-bottom: 9px;
  border-radius: 10px;
  background:
    radial-gradient(ellipse at 24% 80%, rgba(75, 232, 222, 0.16), transparent 58%),
    linear-gradient(145deg, rgba(16, 26, 42, 0.96), rgba(9, 14, 24, 0.98));
  border: 1px solid rgba(239, 199, 114, 0.36);
}
.hero-stage-art {
  position: relative;
  height: 192px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.hero-stage-pedestal {
  position: absolute;
  bottom: 4px;
  width: 114px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(239, 199, 114, 0.44), rgba(75, 232, 222, 0.12) 60%, transparent 78%);
  border: 1px solid rgba(239, 199, 114, 0.3);
}
.hero-stage-art img {
  position: relative;
  z-index: 2;
  max-height: 188px;
  max-width: 142px;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.78));
  animation: standeeBreath 3.2s ease-in-out infinite;
}
.hero-stage-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}
.hero-lv-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}
.realm-pill {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 4px;
  border: 1px solid currentColor;
  background: rgba(0, 0, 0, 0.35);
}

.equip-mini-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}
.equip-mini-slot {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(9, 15, 25, 0.85);
  border-radius: 6px;
  padding: 4px 4px;
  text-align: center;
  cursor: pointer;
  color: #cfe0f2;
  font-size: 9.5px;
}
.equip-mini-slot strong {
  display: block;
  font-size: 10px;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin: 5px 0;
}
.stat-cell {
  background: rgba(8, 14, 24, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 4px 7px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10.5px;
}
.stat-cell span {
  color: var(--text-dim);
}
.stat-delta {
  color: #6df2e7;
  font-size: 9px;
  font-style: normal;
}

.tpl-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.tpl-btn {
  border: 1px solid rgba(75, 232, 222, 0.3);
  background: rgba(12, 24, 38, 0.9);
  color: #dbf4f4;
  border-radius: 6px;
  padding: 6px 5px;
  font-size: 10.5px;
  cursor: pointer;
  text-align: center;
}
.tpl-btn strong {
  display: block;
  font-size: 11px;
  color: #ffe6a8;
}
.tpl-btn span {
  font-size: 9.5px;
  color: #8ab7c4;
}

.slot-group {
  margin-bottom: 9px;
}
.slot-label {
  font-size: 10.5px;
  color: #c2d3e6;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}
.chip-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
}
.chip-grid.three {
  grid-template-columns: repeat(3, 1fr);
}
.chip-grid.four {
  grid-template-columns: repeat(4, 1fr);
}
.chip {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(11, 18, 30, 0.92);
  color: #d6e4f2;
  border-radius: 6px;
  padding: 6px 7px;
  font-size: 10.5px;
  cursor: pointer;
  text-align: left;
}
.chip.center {
  text-align: center;
}
.chip.active {
  border-color: var(--gold);
  background: rgba(239, 199, 114, 0.16);
  color: #fff4d6;
}
.chip.locked {
  opacity: 0.45;
  border-style: dashed;
}
.chip-sub {
  display: block;
  font-size: 9px;
  color: var(--text-dim);
  margin-top: 2px;
  line-height: 1.3;
}

/* 战前竖向 3×5 布阵棋盘（上=前排迎敌，下=后排，与竖屏战斗完全一致） */
.prep-board-v {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(3, 52px);
  gap: 5px;
}
.prep-board-v .cell {
  position: relative;
  border-radius: 6px;
  background: rgba(12, 20, 34, 0.85);
  border: 1px solid rgba(170, 198, 226, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.prep-board-v .cell.front-row {
  border-color: rgba(239, 199, 114, 0.34);
  background: rgba(24, 24, 30, 0.82);
}
.prep-board-v .cell.formation-node {
  border-color: rgba(239, 199, 114, 0.72);
  box-shadow: inset 0 0 10px rgba(239, 199, 114, 0.18);
}
.prep-unit-pill {
  width: 94%;
  height: 44px;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(20, 32, 50, 0.96), rgba(10, 16, 26, 0.96));
  border: 1.5px solid var(--u-color, #4be8de);
  padding: 2px 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  text-align: center;
}
.prep-unit-pill.active-turn {
  box-shadow: 0 0 10px rgba(239, 199, 114, 0.55);
  border-color: #ffe6a8;
}
.prep-cell-av {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.side-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-dim);
  margin: 2px 2px 6px;
}

/* ==================== 3. 山海灵器页 ==================== */
.forge-card {
  background:
    radial-gradient(circle at 82% 20%, rgba(182, 148, 255, 0.2), transparent 55%),
    linear-gradient(155deg, rgba(22, 20, 44, 0.95), rgba(11, 16, 28, 0.96));
  border-color: rgba(182, 148, 255, 0.48);
}
.gear-grid {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.gear-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border-radius: 8px;
  background: rgba(12, 20, 34, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.gear-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  flex-shrink: 0;
}
.gear-body {
  flex: 1;
  min-width: 0;
}
.gear-name {
  font-size: 11.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.gear-stats {
  font-size: 10px;
  color: #b7d2e8;
  margin-top: 2px;
}
.gear-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

/* ==================== 5. 演武页 ==================== */
.code-box {
  width: 100%;
  min-height: 54px;
  background: #070d17;
  color: #8af7ed;
  border: 1px solid rgba(75, 232, 222, 0.34);
  border-radius: 6px;
  padding: 7px 9px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  resize: none;
}

/* ==================== 6. 全竖屏深渊 3×5 战斗舞台（宽敞纵深 × 卡厄思梦境极简高反差 HUD） ==================== */
.battle-stage {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #04070d;
}
.battle-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0.94;
  pointer-events: none;
}
.battle-bg-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 7, 13, 0.72) 0%, rgba(4, 7, 13, 0.08) 18%, rgba(4, 7, 13, 0.05) 68%, rgba(3, 5, 10, 0.94) 100%);
  pointer-events: none;
}

/* --- 顶部紧凑竖屏战局 HUD --- */
.battle-hud-top {
  position: relative;
  z-index: 32;
  padding: calc(6px + env(safe-area-inset-top, 0px)) 10px 4px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}
.battle-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

/* 左上小队血盾 + 角色眼部切片条 */
.squad-hud-top-left {
  flex: 1;
  max-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.squad-hp-header {
  display: flex;
  align-items: center;
  gap: 6px;
}
.squad-hp-bar-wrap {
  position: relative;
  flex: 1;
  height: 13px;
  background: rgba(8, 13, 22, 0.86);
  border: 1px solid rgba(110, 232, 165, 0.45);
  border-radius: 2px;
  overflow: hidden;
  transform: skewX(-10deg);
}
.squad-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #2fb86f, #69f2a8);
  transition: width 0.25s ease;
}
.squad-hp-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 3px #000;
  transform: skewX(10deg);
}
.squad-shield-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10.5px;
  font-weight: 800;
  color: #6fe4ff;
  text-shadow: 0 1px 3px #000;
  white-space: nowrap;
}
.squad-mini-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 4px;
}
.squad-mini-unit {
  position: relative;
  height: 22px;
  border-radius: 2px;
  overflow: hidden;
  background: rgba(8, 13, 22, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.16);
  transform: skewX(-8deg);
}
.squad-mini-unit.active {
  border-color: #ffe6a8;
  box-shadow: 0 0 8px rgba(255, 226, 152, 0.65);
}
.squad-mini-unit.dead {
  opacity: 0.32;
  filter: grayscale(1);
}
.squad-mini-unit img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  transform: skewX(8deg) scale(1.12);
}
.squad-mini-hp {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.5px;
  background: rgba(0, 0, 0, 0.72);
}
.squad-mini-hp > i {
  display: block;
  height: 100%;
  background: #5ef09b;
}

.battle-top-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.battle-top-controls .icon-btn {
  background: rgba(7, 12, 22, 0.78);
  padding: 4px 7px;
  font-size: 10px;
}

/* CT 行动序列轨 */
.ct-rail-bar {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ct-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 10px;
  color: #c2d4e8;
  text-shadow: 0 1px 3px #000;
}
.ct-stage-title {
  font-weight: 800;
  color: #ffe6a8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ct-track {
  position: relative;
  width: 100%;
  height: 22px;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(8, 14, 24, 0.78), rgba(14, 24, 40, 0.88) 88%, rgba(239, 199, 114, 0.28));
  border: 1px solid rgba(190, 214, 238, 0.18);
}
.ct-track::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 2px;
  bottom: 2px;
  width: 2px;
  background: #ffe298;
  box-shadow: 0 0 6px #ffe298;
}
.ct-marker {
  position: absolute;
  top: 1px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  transform: translateX(-50%);
  border: 1.5px solid var(--u-color, #4be8de);
  overflow: hidden;
  background: #0d1624;
  transition: left 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}
.ct-marker img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ct-marker.charging {
  border-color: #ff4d5d;
  box-shadow: 0 0 10px rgba(255, 77, 93, 0.95);
  animation: pulseCharge 0.75s ease-in-out infinite;
}
@keyframes pulseCharge {
  0%,
  100% {
    transform: translateX(-50%) scale(1);
  }
  50% {
    transform: translateX(-50%) scale(1.16);
  }
}

/* 左侧贴边技能播报轨（绝不遮挡战场中央） */
.cast-feed-left {
  position: absolute;
  left: 8px;
  top: 94px;
  z-index: 34;
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: none;
  max-width: 200px;
}
.cast-strip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 12px 3px 3px;
  background: linear-gradient(90deg, rgba(10, 17, 29, 0.92) 0%, rgba(10, 17, 29, 0.65) 75%, transparent 100%);
  border-left: 3px solid #6df2e7;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  animation: castSlideIn 1.25s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.cast-strip.enemy {
  border-left-color: #ff5966;
}
.cast-strip.gold {
  border-left-color: #ffd56b;
}
.cast-strip img {
  width: 26px;
  height: 26px;
  border-radius: 3px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.cast-strip-name {
  font-size: 12px;
  font-weight: 900;
  color: #f4f8ff;
  text-shadow: 0 1px 4px #000;
}
.cast-strip-sub {
  font-size: 9px;
  color: #9cb6cf;
}
@keyframes castSlideIn {
  0% {
    opacity: 0;
    transform: translateX(-18px);
  }
  12% {
    opacity: 1;
    transform: translateX(0);
  }
  82% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-10px);
  }
}

/* ==================== 宽敞竖向 3×5 + 3×5 动态战术棋盘 ==================== */
.arena-portrait-viewport {
  position: relative;
  flex: 1;
  min-height: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 10px 8px;
  perspective: 1050px;
}
.arena-portrait-plane {
  width: 100%;
  height: 100%;
  max-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  transform: rotateX(10deg);
  transform-origin: center 68%;
  transform-style: preserve-3d;
}

.board-half {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 4px;
  transform-style: preserve-3d;
}

.battle-frontline-h {
  position: relative;
  height: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  flex-shrink: 0;
}
.battle-frontline-h::before {
  content: "";
  width: 94%;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, rgba(125, 246, 236, 0.25) 20%, rgba(239, 199, 114, 0.52) 50%, rgba(255, 93, 108, 0.25) 80%, transparent);
  opacity: 0.5;
  transition: opacity 0.2s ease;
}
.battle-stage.player-turn .battle-frontline-h::before {
  opacity: 0.95;
}

/* 动态战术地面：平时极淡隐形，轮到玩家/选招/预警时清晰浮现 */
.board-half > .cell {
  position: relative;
  border-radius: 5px;
  border: 1px solid rgba(155, 196, 232, 0.05);
  background: rgba(8, 16, 28, 0.06);
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.battle-stage.player-turn .board-half > .cell {
  border-color: rgba(145, 200, 236, 0.13);
  background: rgba(10, 18, 32, 0.18);
}
.battle-stage.player-turn .board-half > .cell.front-row {
  border-color: rgba(239, 199, 114, 0.24);
}
.board-half > .cell.formation-node {
  border-color: rgba(239, 199, 114, 0.3);
}
.formation-ring {
  position: absolute;
  inset: 14% 12%;
  border-radius: 50%;
  border: 1px dashed rgba(239, 199, 114, 0.38);
  pointer-events: none;
}
.node-tag {
  position: absolute;
  bottom: 2px;
  left: 3px;
  font-size: 8px;
  font-weight: 800;
  color: rgba(255, 224, 152, 0.68);
  pointer-events: none;
}

/* 青玉可移动格 */
.board-half > .cell.movable {
  border: 1.5px solid rgba(75, 232, 222, 0.88);
  background: radial-gradient(ellipse at center, rgba(75, 232, 222, 0.3), rgba(20, 90, 96, 0.14));
  box-shadow: inset 0 0 12px rgba(75, 232, 222, 0.32), 0 0 8px rgba(75, 232, 222, 0.24);
}
/* 绯金可攻击目标格 */
.board-half > .cell.targetable {
  border: 1.5px solid rgba(255, 204, 96, 0.96);
  background: radial-gradient(ellipse at center, rgba(255, 198, 86, 0.34), rgba(140, 48, 36, 0.16));
  box-shadow: inset 0 0 14px rgba(255, 204, 96, 0.36), 0 0 12px rgba(255, 178, 72, 0.34);
}
.board-half > .cell.aoe-preview {
  border: 2px solid #ffe49a;
  background: rgba(255, 146, 72, 0.4);
  box-shadow: inset 0 0 16px rgba(255, 220, 120, 0.55);
}
/* 敌方蓄力红圈危险格 */
.board-half > .cell.danger-cell {
  border: 1.5px solid rgba(255, 77, 93, 0.92);
  background: repeating-linear-gradient(
    -45deg,
    rgba(255, 62, 82, 0.28),
    rgba(255, 62, 82, 0.28) 5px,
    rgba(120, 18, 30, 0.18) 5px,
    rgba(120, 18, 30, 0.18) 10px
  );
  animation: dangerPulse 1.1s ease-in-out infinite;
}
@keyframes dangerPulse {
  0%,
  100% {
    box-shadow: inset 0 0 8px rgba(255, 70, 88, 0.3);
  }
  50% {
    box-shadow: inset 0 0 18px rgba(255, 70, 88, 0.65);
  }
}

.danger-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 8px;
  font-weight: 900;
  color: #fff;
  background: #c82235;
  padding: 0 3px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 3;
}
.diag-badge {
  position: absolute;
  top: 2px;
  left: 2px;
  font-size: 8px;
  font-weight: 800;
  padding: 0 3px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 3;
}
.diag-badge.blocked {
  background: rgba(30, 42, 58, 0.92);
  color: #9cb4cd;
  border: 1px solid rgba(156, 180, 205, 0.35);
}
.diag-badge.far {
  background: rgba(74, 24, 34, 0.92);
  color: #ff9ea6;
  border: 1px solid rgba(255, 158, 166, 0.4);
}

/* ==================== 持久化 2.5D 立像层（3头身 SD 小人 vs 史诗巨像 Boss） ==================== */
.unit-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform-style: preserve-3d;
}
.unit-token {
  position: absolute;
  pointer-events: none;
  transition:
    left 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    top 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.3s ease,
    height 0.3s ease;
  will-change: left, top;
  transform-style: preserve-3d;
}
.unit-token.fast-glide {
  transition:
    left 0.24s cubic-bezier(0.16, 1, 0.3, 1),
    top 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.standee-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transform: rotateX(-10deg);
  transform-origin: center bottom;
}
.standee-shadow {
  position: absolute;
  bottom: 3px;
  width: 74%;
  max-width: 68px;
  height: 11px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.32) 56%, transparent 80%);
  z-index: 1;
}
.unit-token.is-boss .standee-shadow {
  width: 84%;
  max-width: 148px;
  height: 18px;
}

.active-ground-ring {
  position: absolute;
  bottom: 0;
  width: 82%;
  max-width: 74px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #74f7ec;
  box-shadow: 0 0 12px rgba(116, 247, 236, 0.85), inset 0 0 8px rgba(116, 247, 236, 0.4);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 2;
}
.unit-token.is-active .active-ground-ring {
  opacity: 1;
  transform: scale(1);
  animation: groundRingPulse 1.5s ease-in-out infinite;
}
@keyframes groundRingPulse {
  0%,
  100% {
    transform: scale(0.96);
    opacity: 0.78;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

.standee-body {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.standee-art {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: visible;
  pointer-events: none;
}
.standee-img {
  display: block;
  object-fit: contain;
  transform-origin: center bottom;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.85));
  animation: standeeBreath 2.9s ease-in-out infinite;
  animation-delay: var(--idle-delay, 0s);
}
.standee-img.sd-hero-img {
  height: 76px;
  width: auto;
  max-width: 84px;
  margin-bottom: 3px;
}
.standee-img.monster-img {
  height: 82px;
  width: auto;
  max-width: 88px;
  margin-bottom: 3px;
}
.standee-img.boss-img {
  height: 168px;
  width: auto;
  max-width: 196px;
  margin-bottom: 5px;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.92)) drop-shadow(0 0 18px rgba(255, 92, 74, 0.24));
}
.standee-img.flip-left {
  transform: scaleX(-1);
  animation: standeeBreathFlip 2.9s ease-in-out infinite;
  animation-delay: var(--idle-delay, 0s);
}

@keyframes standeeBreath {
  0%,
  100% {
    transform: translateY(0) scaleY(1);
  }
  50% {
    transform: translateY(-2.5px) scaleY(1.018);
  }
}
@keyframes standeeBreathFlip {
  0%,
  100% {
    transform: scaleX(-1) translateY(0) scaleY(1);
  }
  50% {
    transform: scaleX(-1) translateY(-2.5px) scaleY(1.018);
  }
}

/* 头顶极简 HUD + 猩红菱形蓄力倒计时 */
.unit-hud-slim {
  position: absolute;
  bottom: 78px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5px;
  z-index: 6;
  pointer-events: none;
}
.unit-token.is-monster .unit-hud-slim {
  bottom: 84px;
  min-width: 72px;
}
.unit-token.is-boss .unit-hud-slim {
  bottom: 166px;
  min-width: 136px;
}

.hud-top-line {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  font-size: 8.5px;
  font-weight: 800;
  text-shadow: 0 1px 3px #000, 0 0 5px #000;
}
.hud-unit-name {
  color: #eef5fc;
  white-space: nowrap;
}
.hud-hp-num {
  color: #fff;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hud-shield-tag {
  color: #6ce4ff;
  font-weight: 900;
  margin-left: 1px;
}

.hud-bar-row {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 3px;
}
.charge-diamond {
  position: relative;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  margin-right: 1px;
}
.charge-diamond::before {
  content: "";
  position: absolute;
  inset: 2px;
  background: linear-gradient(135deg, #ff385c, #990f2b);
  border: 1.5px solid #ffd2d8;
  transform: rotate(45deg);
  box-shadow: 0 0 10px rgba(255, 56, 92, 0.9);
}
.charge-diamond span {
  position: relative;
  z-index: 2;
  font-size: 8px;
  font-weight: 900;
  color: #fff;
}

.bar-track-slim {
  position: relative;
  flex: 1;
  height: 4.5px;
  border-radius: 1px;
  background: rgba(6, 10, 18, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.22);
  overflow: hidden;
}
.unit-token.is-boss .bar-track-slim {
  height: 6px;
  border-color: rgba(255, 118, 146, 0.55);
}
.bar-hp {
  height: 100%;
  background: linear-gradient(90deg, #32c97b, #73f5ae);
  transition: width 0.24s ease;
}
.unit-token.enemy-side .bar-hp {
  background: linear-gradient(90deg, #d82b57, #ff5f87);
}
.bar-shield {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: rgba(98, 224, 255, 0.72);
  transition: width 0.24s ease;
}

.standee-tags {
  display: flex;
  gap: 2px;
  justify-content: center;
  min-height: 11px;
}
.st-tag {
  font-size: 7.5px;
  font-weight: 800;
  padding: 0 3px;
  border-radius: 2px;
  line-height: 1.3;
  background: rgba(6, 12, 22, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.st-tag.buff {
  color: #84f7ef;
  border-color: rgba(132, 247, 239, 0.55);
}
.st-tag.break {
  color: #ffb29e;
  border-color: rgba(255, 130, 96, 0.6);
}
.st-tag.poison {
  color: #7df5b0;
  border-color: rgba(78, 227, 147, 0.55);
}
.st-tag.thunder {
  color: #d6bcff;
  border-color: rgba(182, 148, 255, 0.65);
}

.turn-chevron {
  position: absolute;
  bottom: 108px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid #ffe69c;
  filter: drop-shadow(0 0 7px rgba(255, 230, 156, 0.9));
  opacity: 0;
  pointer-events: none;
  z-index: 8;
}
.unit-token.is-active .turn-chevron {
  opacity: 1;
  animation: chevronBob 0.85s ease-in-out infinite;
}
@keyframes chevronBob {
  0%,
  100% {
    transform: translate(-50%, 0);
  }
  50% {
    transform: translate(-50%, -5px);
  }
}

/* ==================== 多帧动作动画 ==================== */
.standee-body.charging-pose .standee-art {
  filter: drop-shadow(0 0 16px rgba(255, 62, 92, 0.85));
  animation: chargeAura 0.7s ease-in-out infinite;
}
@keyframes chargeAura {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.035) translateY(-3px);
  }
}

.standee-body.anim-stride .standee-art {
  animation: strideHop 0.4s cubic-bezier(0.25, 0.9, 0.35, 1) forwards;
}
@keyframes strideHop {
  0% {
    transform: translateY(0) rotate(0deg) scale(1, 1);
  }
  25% {
    transform: translateY(-13px) rotate(var(--move-tilt, 6deg)) scale(0.95, 1.06);
  }
  50% {
    transform: translateY(-2px) rotate(0deg) scale(1.06, 0.94);
  }
  75% {
    transform: translateY(-9px) rotate(calc(var(--move-tilt, 6deg) * 0.6)) scale(0.97, 1.04);
  }
  100% {
    transform: translateY(0) rotate(0deg) scale(1, 1);
  }
}

.standee-body.anim-blink .standee-art {
  animation: blinkPhase 0.36s ease-out forwards;
}
@keyframes blinkPhase {
  0% {
    opacity: 0.25;
    transform: scaleX(1.36) scaleY(0.84);
    filter: brightness(2.2) drop-shadow(0 0 16px #6df2e7);
  }
  55% {
    opacity: 0.95;
    transform: scaleX(0.92) scaleY(1.08);
    filter: brightness(1.4) drop-shadow(0 0 10px #6df2e7);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: none;
  }
}

.standee-body.anim-dash-strike .standee-art {
  animation: dashStrike 0.46s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes dashStrike {
  0% {
    transform: translate(0, 0) scale(1);
  }
  20% {
    transform: translate(0, calc(var(--dash-y, -55px) * -0.18)) scale(1.08, 0.92);
  }
  48% {
    transform: translate(var(--dash-x, 0px), var(--dash-y, -55px)) scale(1.12, 0.94);
    filter: brightness(1.35) drop-shadow(0 0 14px rgba(255, 224, 130, 0.8));
  }
  100% {
    transform: translate(0, 0) scale(1);
  }
}

.standee-body.anim-cast-float .standee-art {
  animation: castFloat 0.46s ease-in-out forwards;
}
@keyframes castFloat {
  0% {
    transform: translateY(0) scale(1);
  }
  45% {
    transform: translateY(-14px) scale(1.07);
    filter: brightness(1.35) drop-shadow(0 0 16px rgba(196, 173, 255, 0.85));
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

.standee-body.anim-brace .standee-art {
  animation: bracePulse 0.42s ease-out forwards;
}
@keyframes bracePulse {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.12, 0.9);
    filter: brightness(1.35) drop-shadow(0 0 14px #72d6ff);
  }
  100% {
    transform: scale(1);
  }
}

.standee-body.anim-knockback .standee-art {
  animation: knockbackRebound 0.38s ease-out forwards;
}
@keyframes knockbackRebound {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  35% {
    transform: translateY(-14px) rotate(10deg);
    filter: brightness(1.8);
  }
  100% {
    transform: translateY(0) rotate(0deg);
  }
}

.standee-body.hit-flash .standee-art {
  animation: hitRecoil 0.34s ease-out forwards;
}
@keyframes hitRecoil {
  0% {
    transform: translateX(0);
    filter: brightness(2.4) saturate(0.2);
  }
  30% {
    transform: translateX(-6px) rotate(-4deg);
    filter: brightness(1.8) drop-shadow(0 0 10px #ff5966);
  }
  65% {
    transform: translateX(4px) rotate(3deg);
  }
  100% {
    transform: translateX(0);
    filter: none;
  }
}

.unit-token.anim-death {
  animation: unitDissolve 0.44s ease-in forwards;
}
@keyframes unitDissolve {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-16px) scale(0.75);
    filter: brightness(2.2) blur(3px);
  }
}

.battle-stage.shake {
  animation: stageShake 0.3s ease;
}
@keyframes stageShake {
  0%,
  100% {
    transform: translate(0, 0);
  }
  20% {
    transform: translate(-4px, 2px);
  }
  45% {
    transform: translate(4px, -2px);
  }
  70% {
    transform: translate(-2px, 2px);
  }
}

/* ==================== 底部竖屏斜切插画技能卡组 + 光环战术按钮 ==================== */
.battle-bottom-hud {
  position: relative;
  z-index: 35;
  flex-shrink: 0;
  padding: 6px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(6, 10, 18, 0.2) 0%, rgba(6, 10, 18, 0.94) 22%, rgba(4, 7, 13, 0.99) 100%);
  border-top: 1px solid rgba(190, 214, 238, 0.14);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.actor-bar-portrait {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.actor-left-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.actor-mini-av {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--u-color, #4be8de);
  flex-shrink: 0;
}
.actor-dock-name {
  font-size: 12px;
  font-weight: 900;
  color: #fff4da;
}
.actor-dock-hint {
  font-size: 9.5px;
  color: #9bb4cd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.actor-right-orbs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.orb-pill-btn {
  border: 1.5px solid rgba(92, 224, 255, 0.85);
  background: radial-gradient(circle at 30% 30%, rgba(28, 72, 118, 0.94), rgba(7, 16, 32, 0.96));
  color: #e8f8ff;
  border-radius: 99px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 0 12px rgba(92, 224, 255, 0.34);
}
.orb-pill-btn.confirm-mode {
  border-color: #ffe6a8;
  background: linear-gradient(135deg, #e5b24c, #aa6b1d);
  color: #160e03;
  box-shadow: 0 0 16px rgba(255, 204, 86, 0.65);
}

.skill-aim-pill {
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(10, 18, 32, 0.94);
  border: 1px solid rgba(239, 199, 114, 0.5);
  font-size: 10.5px;
  line-height: 1.4;
  color: #eef5fc;
}

/* 斜切插画技能手牌（横向紧凑排布，多卡自动顺滑横滑） */
.skill-hand {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 4px 2px;
  scrollbar-width: none;
}
.skill-hand::-webkit-scrollbar {
  display: none;
}
.skill-card {
  position: relative;
  flex: 1 0 88px;
  max-width: 104px;
  height: 100px;
  border-radius: 6px;
  border: 1.5px solid color-mix(in srgb, var(--card-accent, #4be8de) 48%, rgba(255, 255, 255, 0.16));
  background: #0a1220;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  text-align: left;
  color: #eef5fc;
  transform: skewX(-4deg);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.72), inset 0 0 14px color-mix(in srgb, var(--card-accent, #4be8de) 14%, transparent);
  transition: transform 0.15s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.15s ease, box-shadow 0.15s ease;
}
.skill-card.selected {
  transform: skewX(-4deg) translateY(-8px) scale(1.04);
  border-color: #ffe6a8;
  box-shadow: 0 0 18px rgba(255, 224, 140, 0.62), 0 10px 22px rgba(0, 0, 0, 0.85);
  z-index: 4;
}
.skill-card:disabled {
  opacity: 0.38;
  filter: grayscale(0.7);
  cursor: not-allowed;
}
.sk-card-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 12%;
  opacity: 0.7;
  transform: skewX(4deg) scale(1.16);
  pointer-events: none;
}
.sk-card-tint {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 18%, color-mix(in srgb, var(--card-accent, #4be8de) 28%, transparent), transparent 56%),
    linear-gradient(180deg, rgba(6, 11, 20, 0.7) 0%, rgba(10, 18, 32, 0.12) 45%, rgba(5, 9, 17, 0.95) 100%);
  pointer-events: none;
}
.sk-card-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 0;
  transform: skewX(4deg);
}
.sk-cost-badge {
  min-width: 18px;
  height: 17px;
  padding: 0 4px;
  border-radius: 3px;
  background: rgba(8, 14, 24, 0.92);
  border: 1px solid var(--card-accent, #4be8de);
  color: var(--card-accent, #4be8de);
  font-size: 9px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sk-card-ico {
  color: var(--card-accent, #ffe6a8);
  filter: drop-shadow(0 0 5px var(--card-accent, #ffe6a8));
}
.sk-card-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 5px 6px 6px;
  transform: skewX(4deg);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.sk-card-name {
  font-size: 11px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 4px #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sk-card-tags {
  font-size: 8.5px;
  color: #a9c3dc;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.battle-wait-banner {
  padding: 12px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: #b7cce2;
}

/* ==================== Canvas 特效层 & 飘字 / Boss 台词条 ==================== */
.fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 28;
}
.fx-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 30;
}

.float-num {
  position: absolute;
  transform: translate(-50%, -50%);
  font-weight: 900;
  font-size: 17px;
  pointer-events: none;
  text-shadow: 0 2px 5px #000, 0 0 8px rgba(0, 0, 0, 0.95);
  animation: floatUp 0.88s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.float-num.dmg {
  color: #ff9c82;
}
.float-num.crit {
  color: #ffe37a;
  font-size: 22px;
  text-shadow: 0 0 12px rgba(255, 168, 42, 0.95), 0 2px 5px #000;
}
.float-num.heal {
  color: #6df2a6;
}
.float-num.shield {
  color: #72e4ff;
  font-size: 14px;
}
@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translate(-50%, -20%) scale(0.72);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -55%) scale(1.12);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -140%) scale(0.95);
  }
}

.boss-taunt-bar {
  position: absolute;
  top: 92px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 7px;
  background: linear-gradient(90deg, rgba(64, 12, 22, 0.94), rgba(14, 16, 26, 0.94));
  border: 1px solid rgba(255, 96, 112, 0.72);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.78);
}
.boss-taunt-bar img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #ff7c88;
}

/* ==================== 弹窗、表格、Toast ==================== */
.modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 95;
  background: rgba(3, 6, 12, 0.78);
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
  padding: 14px;
}
.modal-card {
  width: 100%;
  max-width: 400px;
  max-height: 84dvh;
  overflow-y: auto;
  background: linear-gradient(165deg, #131e30, #0a111d);
  border: 1px solid rgba(239, 199, 114, 0.48);
  border-radius: 10px;
  padding: 14px 15px;
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.85);
}

.mvp-table {
  width: 100%;
  border-collapse: collapse;
  margin: 7px 0;
  font-size: 11px;
}
.mvp-table th,
.mvp-table td {
  padding: 5px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}
.mvp-table th {
  color: var(--text-dim);
  font-weight: 700;
}
.mvp-table td:first-child,
.mvp-table th:first-child {
  text-align: left;
}
.mvp-row {
  background: rgba(239, 199, 114, 0.12);
  color: #ffe6a8;
  font-weight: 800;
}

.star-check-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 6px 0;
}
.star-check-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}
.log-list {
  max-height: 340px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: #c8daec;
}
.guide-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 9px 0 12px;
}
.guide-item {
  background: rgba(8, 14, 24, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.5;
  color: #c4d7ea;
}
.guide-item strong {
  display: block;
  color: #ffe6a8;
  margin-bottom: 2px;
}

.toast {
  position: absolute;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 110;
  max-width: 90%;
  background: rgba(9, 16, 28, 0.96);
  border: 1px solid var(--gold);
  color: #fff2d4;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.75);
  text-align: center;
}
