/* 按钮与通用控件（克制无硬边框） */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 6px;
  border: none;
  background: var(--bg-elevated);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 140ms var(--ease-out), background-color 140ms ease, opacity 140ms ease;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:hover:not(:disabled) {
  background: var(--bg-card-hover);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary,
.btn-gold {
  background: linear-gradient(180deg, var(--accent-primary) 0%, color-mix(in srgb, var(--accent-primary) 84%, #1a0c08) 100%);
  color: var(--accent-primary-fg, #fbf7ef);
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 244, 214, 0.28), 0 2px 6px rgba(0, 0, 0, 0.16);
}

.btn-primary:hover:not(:disabled),
.btn-gold:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--accent-primary) 0%, color-mix(in srgb, var(--accent-primary) 84%, #1a0c08) 100%);
  filter: brightness(1.09);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 244, 214, 0.34), 0 4px 12px rgba(0, 0, 0, 0.22);
}

.btn-red {
  background: linear-gradient(180deg, var(--accent-vermilion) 0%, color-mix(in srgb, var(--accent-vermilion) 82%, #1c0806) 100%);
  color: #fdf8f0;
  box-shadow: inset 0 1px 0 rgba(255, 240, 220, 0.24), 0 2px 6px rgba(0, 0, 0, 0.16);
}

.btn-red:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--accent-vermilion) 0%, color-mix(in srgb, var(--accent-vermilion) 82%, #1c0806) 100%);
  filter: brightness(1.09);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 11px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(237, 230, 214, 0.08);
}

.tag-shiny {
  background: var(--accent-primary-soft);
  color: var(--accent-gold);
}

/* 进度条 */
.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 240ms var(--ease-out);
}

.fill-hp { background: var(--accent-green); }
.fill-hp.warn { background: var(--accent-gold); }
.fill-hp.low { background: var(--accent-red); }
.fill-xp { background: var(--accent-blue); }
.fill-step { background: var(--accent-primary); }

/* 极简路线刻度点（替代15个带框小方块） */
.route-stepper {
  display: flex;
  align-items: center;
  gap: 5px;
}

.step-node {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-strong);
  opacity: 0.45;
  transition: transform 160ms var(--ease-out), background-color 160ms ease, opacity 160ms ease;
}

.step-node.done {
  background: var(--accent-green);
  opacity: 1;
}

.step-node.current {
  width: 15px;
  border-radius: 999px;
  background: var(--accent-vermilion);
  opacity: 1;
}

/* 天气胶囊 */
.weather-pill-wrap {
  position: relative;
}

.weather-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--bg-elevated);
  border: none;
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.weather-forecast-popover {
  position: absolute;
  top: 34px;
  right: 0;
  transform-origin: top right;
  background: rgba(22, 20, 18, 0.96);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-float);
  border-radius: 8px;
  padding: 8px;
  display: none;
  grid-template-columns: repeat(4, minmax(66px, 1fr));
  gap: 5px;
  z-index: 30;
}

.weather-forecast-popover.open {
  display: grid;
}

.forecast-slot {
  padding: 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.04);
  text-align: center;
  font-size: 11px;
  color: var(--text-main);
}

.forecast-slot.now {
  background: var(--accent-primary-soft);
  color: var(--accent-gold);
}

/* 全景战斗画布（适配三栏中央 16:9 舞台，精准装裱融合 + GPU 渲染隔离） */
.battle-canvas {
  position: relative;
  min-height: 446px;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 16px 0;
  overflow: hidden;
  background-color: #141821;
  background-size: cover;
  background-position: center bottom;
  image-rendering: pixelated;
  border: 1px solid var(--border-subtle);
  box-shadow: none;
  contain: layout paint;
}

.battle-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

[data-theme="light"] .battle-canvas::after {
  background: linear-gradient(180deg, rgba(238, 222, 184, 0.13) 0%, rgba(238, 222, 184, 0.03) 48%, rgba(38, 26, 12, 0.12) 100%);
  box-shadow: inset 0 0 26px rgba(42, 30, 14, 0.28), inset 0 0 0 1px rgba(130, 102, 58, 0.24);
}

[data-theme="dark"] .battle-canvas::after {
  background: radial-gradient(ellipse at 50% 52%, rgba(8, 12, 18, 0.02) 44%, rgba(6, 9, 14, 0.52) 100%);
  box-shadow: inset 0 0 42px rgba(4, 6, 10, 0.72), inset 0 0 0 1px rgba(196, 164, 98, 0.18);
}

.bg-nanshan  { background-image: url('../assets/bg_nanshan.webp'); }
.bg-xishan   { background-image: url('../assets/bg_xishan.webp'); }
.bg-beishan  { background-image: url('../assets/bg_beishan.webp'); }
.bg-dongshan { background-image: url('../assets/bg_dongshan.webp'); }
.bg-nanshan-night  { background-image: url('../assets/bg_nanshan_night.webp'); }
.bg-xishan-night   { background-image: url('../assets/bg_xishan_night.webp'); }
.bg-beishan-night  { background-image: url('../assets/bg_beishan_night.webp'); }
.bg-dongshan-night { background-image: url('../assets/bg_dongshan_night.webp'); }

.weather-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
  transition: background 280ms ease;
}

.weather-fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 7;
}

.battle-fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 8;
}

.weather-overlay.is-night {
  /* 夜景已由真实月夜灯火原画承担，此处仅保留轻盈月华暗角 */
  background: radial-gradient(circle at 50% 58%, rgba(12, 20, 44, 0) 45%, rgba(6, 10, 24, 0.28) 100%);
}

.weather-overlay.is-rain {
  background: linear-gradient(180deg, rgba(16, 28, 48, 0.62) 0%, rgba(20, 34, 54, 0.44) 60%, rgba(12, 22, 38, 0.36) 100%);
  backdrop-filter: brightness(0.8) saturate(0.84);
}

.weather-overlay.is-storm {
  background: linear-gradient(180deg, rgba(8, 12, 26, 0.78) 0%, rgba(12, 18, 36, 0.58) 58%, rgba(8, 12, 24, 0.46) 100%);
  backdrop-filter: brightness(0.66) contrast(1.08);
}

/* 舞台顶部：左增益堆 + 右法宝图标条 */
.stage-top-bar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.stage-buff-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.stage-buff-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(14, 17, 22, 0.84);
  border: 1px solid rgba(229, 184, 75, 0.42);
  color: #fbe6a0;
  font-size: 11px;
  font-weight: 700;
}

.stage-preset-bar {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px;
  border-radius: 7px;
  background: var(--bg-inset);
  border: 1px solid var(--hairline);
}

.preset-mini-btn {
  min-width: 22px;
  height: 22px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.preset-mini-btn.active {
  background: var(--accent-primary);
  color: var(--accent-primary-fg);
}

.stage-bottom-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.dps-toggle-btn {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #dcd3c1;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.dps-toggle-btn.active {
  background: rgba(229, 184, 75, 0.25);
  border-color: rgba(229, 184, 75, 0.65);
  color: #ffe69a;
}

.dps-readout {
  font-size: 11px;
  font-weight: 700;
  color: #ffe69a;
  background: rgba(12, 14, 18, 0.68);
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.stage-ball-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(14, 15, 18, 0.82);
  border: 1px solid rgba(224, 194, 130, 0.22);
}

.ball-quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #e4dccb;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 140ms var(--ease-out), background-color 140ms ease;
}

.ball-quick-btn:active {
  transform: scale(0.95);
}

.ball-quick-btn.selected {
  background: rgba(226, 181, 64, 0.24);
  color: #ffdfa0;
  box-shadow: inset 0 0 0 1px rgba(226, 181, 64, 0.55);
}

/* 舞台中央：左极简出战头像条 + 敌我站位 */
.stage-arena {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex: 1;
  padding-bottom: 14px;
}

.party-dock {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 9;
}

.dock-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 6px;
  background: rgba(14, 16, 20, 0.78);
  border: 1px solid rgba(255, 240, 204, 0.12);
  cursor: pointer;
  transition: transform 140ms var(--ease-out), background-color 140ms ease;
}

.dock-slot:active {
  transform: scale(0.95);
}

.dock-slot.active {
  background: rgba(34, 29, 24, 0.84);
  box-shadow: inset 0 0 0 1.5px var(--accent-primary), 0 0 10px rgba(201, 151, 62, 0.25);
}

.dock-slot.fainted {
  opacity: 0.42;
  filter: grayscale(0.85);
}

.dock-mini-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dock-mini-icon img {
  image-rendering: pixelated;
}

.dock-hp-sliver {
  width: 30px;
  height: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

.combatants-stage {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: end;
  padding: 0 36px 0 64px;
}

.combatant-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
}

/* 极简血条铭牌（玉框墨琉璃 + 扣血残影条，去除昂贵实时模糊保 60fps） */
.combatant-hud {
  width: 100%;
  max-width: 190px;
  background: linear-gradient(180deg, rgba(16, 20, 26, 0.90), rgba(10, 13, 18, 0.84));
  border: 1px solid rgba(236, 204, 126, 0.30);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 245, 214, 0.12);
  border-radius: 7px;
  padding: 7px 10px;
  color: #f4ecdc;
}

.combatant-hud.is-shiny {
  box-shadow: 0 0 16px rgba(230, 184, 92, 0.38);
}

.combatant-hud-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
}

.combatant-title {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.combatant-title strong {
  font-family: var(--font-serif);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.elem-emblem {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.shiny-pip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-seal);
  font-size: 9px;
  line-height: 1;
  padding: 1px 3px;
  border-radius: 2px;
  background: rgba(236, 194, 92, 0.2);
  border: 1px solid rgba(236, 194, 92, 0.55);
  color: #f6dc8d;
  flex-shrink: 0;
}

.combatant-lv {
  font-size: 11px;
  font-weight: 700;
  color: #d6cbb6;
  flex-shrink: 0;
}

.hp-track {
  position: relative;
  height: 6px;
  background: rgba(0, 0, 0, 0.58);
}

.hp-ghost-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffd87a, #fff3c4);
  transition: width 680ms cubic-bezier(0.22, 1, 0.36, 1) 110ms;
  z-index: 1;
}

.hp-track .fill-hp {
  position: relative;
  z-index: 2;
  transition: width 150ms cubic-bezier(0.22, 1, 0.36, 1), background-color 220ms ease;
}

.xp-hairline {
  height: 2px;
  margin-top: 3px;
  background: rgba(0, 0, 0, 0.45);
}

.sprite-ground-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.ground-shadow {
  position: relative;
  z-index: 1;
  width: 82px;
  height: 11px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(10, 14, 10, 0.62) 0%, rgba(10, 14, 10, 0.34) 52%, rgba(10, 14, 10, 0) 76%);
  margin-top: -7px;
  pointer-events: none;
}

.sprite-stage-slot {
  width: 128px;
  height: 128px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  will-change: transform;
}

.sprite-stage-slot.is-player img,
.sprite-stage-slot.is-player .svg-silhouette {
  transform: scaleX(-1);
}

.sprite-stage-slot img {
  width: 128px;
  height: 128px;
  object-fit: contain;
  image-rendering: pixelated;
  transform-origin: 50% 98%;
  will-change: transform;
  animation: spriteBreathe 2.6s ease-in-out infinite;
}

.sprite-stage-slot.is-player img {
  animation: spriteBreatheMirror 2.6s ease-in-out infinite;
}

.sprite-stage-slot.hit-flash {
  animation: hitRecoil 0.28s var(--ease-out);
}

.sprite-stage-slot.hit-flash img {
  filter: brightness(2.05) contrast(1.1) drop-shadow(0 0 10px rgba(255, 232, 160, 0.85));
}

.sprite-stage-slot.beast-enter {
  animation: beastEnter 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

.battle-canvas.stage-shake {
  animation: stageShake 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.sprite-stage-slot.lunge-right {
  animation: lungeRight 0.26s var(--ease-out);
}

.sprite-stage-slot.lunge-left {
  animation: lungeLeft 0.26s var(--ease-out);
}

.shiny-aura {
  filter: hue-rotate(36deg) saturate(1.35) drop-shadow(0 0 10px #ffd369) !important;
}

/* 舞台底部自然渐变墨影条（无悬浮矩形框） */
.stage-bottom-bar {
  position: relative;
  z-index: 10;
  margin: 0 -18px;
  padding: 20px 18px 12px;
  background: linear-gradient(180deg, rgba(14, 13, 11, 0) 0%, rgba(14, 13, 11, 0.82) 55%, rgba(14, 13, 11, 0.94) 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.rpg-dialog-box {
  flex: 1;
  color: #f3ecdc;
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.speed-toggle {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.speed-btn {
  padding: 4px 10px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: #cfc6b4;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
}

.speed-btn.active {
  background: var(--accent-primary);
  color: var(--accent-primary-fg);
}

/* 捕获特效遮罩 */
.stage-fx-overlay {
  position: absolute;
  inset: 0;
  z-index: 24;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(12, 11, 10, 0.72);
  backdrop-filter: blur(4px);
  color: #f5efe2;
}

.stage-fx-overlay.active { display: flex; }

.talisman-orb {
  position: relative;
  z-index: 2;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(24, 22, 19, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px rgba(201, 151, 62, 0.4);
}

.talisman-orb.shaking {
  animation: ballShake 0.42s ease-in-out;
}

/* 下方开放式出没表与灵果条 */
.consumables-strip {
  margin-bottom: 14px;
}

.consumable-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.berry-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  font-size: 12px;
  cursor: pointer;
}

.berry-chip:hover {
  background: var(--bg-card-hover);
}

.encounters-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.encounter-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.encounter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.encounter-tile {
  padding: 6px 6px;
  border-radius: 7px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 7px;
  text-align: left;
  font-size: 11px;
  min-width: 0;
}

.encounter-tile-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.encounter-tile-name {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-main);
  word-break: keep-all;
}

.encounter-tile-rate {
  font-size: 10px;
  font-family: var(--font-num);
  color: var(--text-muted);
}

.encounter-tile.uncaught {
  opacity: 0.48;
  filter: grayscale(0.85);
}

/* 游历手札 */
.activity-feed {
  max-height: 170px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.feed-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--hairline);
}

.feed-row:last-child {
  border-bottom: none;
}

.feed-time {
  color: var(--text-dim);
  font-size: 11px;
  flex-shrink: 0;
}

/* 二级面板（丝滑翻卷入场） */
.subview-panel { display: none; }
.subview-panel.active {
  display: block;
  animation: panelReveal 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }

.pc-box-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 10px;
}

.pc-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: transform 140ms var(--ease-out), background-color 140ms ease;
}

.pc-card:hover { background: var(--bg-card-hover); }
.pc-card:active { transform: scale(0.97); }
.pc-card.is-shiny { box-shadow: inset 0 0 0 1px rgba(230, 184, 92, 0.55); }
.pc-card.in-team { border-color: var(--accent-primary); box-shadow: inset 0 0 0 1px var(--accent-primary); }

.filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.input-box, .select-box {
  background: var(--bg-elevated);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  outline: none;
}

/* 弹窗 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 7, 6, 0.72);
  backdrop-filter: blur(4px);
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.open { display: flex; }

.modal-backdrop.open .modal-box {
  animation: modalReveal 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-box {
  width: 100%;
  max-width: 660px;
  max-height: 86vh;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.62);
}

.modal-header {
  padding: 13px 18px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
}

.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
}

/* 开局入世卷轴（全屏山水画卷背景 + 古绢/黑漆一屏开卷台） */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(12, 20, 26, 0.36) 0%, rgba(8, 12, 18, 0.82) 100%),
    url('../assets/bg_nanshan_night.webp') center bottom / cover no-repeat;
  image-rendering: pixelated;
  color: var(--text-main);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}

.onboarding-overlay.open { display: flex; }

.onboarding-card {
  width: 100%;
  max-width: 760px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 22px 26px 24px;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.58), inset 0 0 0 4px var(--bg-surface), inset 0 0 0 5px var(--hairline);
  image-rendering: auto;
}

.onboard-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--hairline);
}

.onboard-brand {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent-primary);
  line-height: 1.2;
}

.onboard-tagline {
  font-family: var(--font-calli);
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  margin-top: 3px;
}

.onboard-identity-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.onboard-section-title {
  font-family: var(--font-serif);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-body);
  margin-bottom: 8px;
}

.onboard-avatar-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.onboard-avatar-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, transform 140ms var(--ease-out);
}

.onboard-avatar-pill:hover {
  border-color: var(--border-strong);
}

.onboard-avatar-pill.selected {
  background: var(--accent-primary-soft);
  border-color: var(--accent-primary);
  box-shadow: inset 0 0 0 1px var(--accent-primary);
}

.starter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0 0 18px;
}

.starter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  padding: 14px 12px;
  text-align: center;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.starter-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card);
}

.starter-card.selected {
  background: var(--accent-primary-soft);
  border-color: var(--accent-primary);
  box-shadow: inset 0 0 0 1.5px var(--accent-primary), var(--shadow-card);
}

.starter-card img {
  image-rendering: pixelated;
  animation: spriteBreathe 2.6s ease-in-out infinite;
}

.onboard-cta {
  width: 100%;
  padding: 11px 18px;
  font-family: var(--font-serif);
  font-size: 16px;
  letter-spacing: 0.18em;
}

/* 八卦炼宝炉、山海天骄榜、洞府仙童托管与纪元飞升 */
.furnace-hero {
  position: relative;
  padding: 18px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-card);
  margin-bottom: 14px;
}

.furnace-stage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.furnace-orb-btn {
  width: 82px;
  height: 82px;
  border-radius: 6px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-inset);
  cursor: pointer;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 150ms var(--ease-out), border-color 150ms ease, box-shadow 150ms ease;
}

.furnace-orb-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent-gold);
  box-shadow: var(--shadow-float);
}

.furnace-orb-btn:active {
  transform: scale(0.94);
}

.furnace-orb-btn.is-shaking {
  animation: furnaceShake 380ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
  border-color: var(--accent-gold);
  box-shadow: 0 0 22px rgba(235, 184, 72, 0.45);
}

.furnace-loot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(144px, 1fr));
  gap: 9px;
  margin-top: 14px;
}

.loot-card {
  position: relative;
  overflow: hidden;
  padding: 10px 10px;
  border-radius: 5px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-subtle);
  animation: lootFlipIn 320ms var(--ease-out) both;
  animation-delay: calc(var(--loot-idx, 0) * 42ms);
}

.loot-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.loot-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 4px;
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.loot-card.tier-spirit { border-color: rgba(68, 166, 214, 0.65); }
.loot-card.tier-immortal {
  border-color: rgba(212, 168, 72, 0.92);
  background: linear-gradient(180deg, rgba(212, 168, 72, 0.22), var(--bg-elevated));
  box-shadow: 0 0 16px rgba(212, 168, 72, 0.28);
}
.loot-card.tier-primordial {
  border-color: var(--accent-vermilion);
  background: linear-gradient(180deg, rgba(184, 66, 52, 0.28), var(--bg-elevated));
  box-shadow: 0 0 22px rgba(184, 66, 52, 0.38);
}
.loot-card.tier-immortal::after,
.loot-card.tier-primordial::after {
  content: "";
  position: absolute;
  inset: -40% -20%;
  background: linear-gradient(110deg, transparent 36%, rgba(255, 232, 150, 0.35) 50%, transparent 64%);
  animation: shimmerSweep 2.6s ease-in-out infinite;
  pointer-events: none;
}

.loot-pillar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
}
.loot-card.tier-spirit .loot-pillar { background: #4aa8d8; }
.loot-card.tier-immortal .loot-pillar { background: #e0b44c; box-shadow: 0 2px 10px rgba(224, 180, 76, 0.65); }
.loot-card.tier-primordial .loot-pillar { background: #d64b3a; box-shadow: 0 2px 14px rgba(214, 75, 58, 0.8); }

/* 灵气怒气槽 & 神通大招全屏像素切入横幅 & 流派词条 */
.rage-hairline {
  height: 3px;
  margin-top: 3px;
  background: rgba(12, 18, 22, 0.55);
  border-radius: 1px;
  overflow: hidden;
}
.fill-rage {
  height: 100%;
  background: linear-gradient(90deg, #c48e32, #f5cf64);
  transition: width 180ms ease-out;
}
.fill-rage.is-full {
  background: linear-gradient(90deg, #e86b3a, #ffe27a, #e86b3a);
  box-shadow: 0 0 8px rgba(255, 220, 110, 0.85);
}

.ult-cast-btn {
  padding: 4px 9px;
  border-radius: 3px;
  border: 1px solid rgba(196, 164, 98, 0.35);
  background: rgba(20, 26, 30, 0.72);
  color: rgba(235, 224, 198, 0.65);
  font-family: var(--font-serif);
  font-size: 11.5px;
  font-weight: 700;
  cursor: not-allowed;
  transition: transform 120ms ease, background 150ms ease, box-shadow 150ms ease;
}
.ult-cast-btn.is-ready {
  cursor: pointer;
  color: #1c1408;
  border-color: #ffe285;
  background: linear-gradient(180deg, #ffe285, #d49c36);
  box-shadow: 0 0 12px rgba(255, 212, 98, 0.65);
  animation: ultPulse 1.1s ease-in-out infinite;
}
.ult-cast-btn.is-ready:hover { transform: translateY(-1px) scale(1.03); }

.ult-cutin-banner {
  position: absolute;
  left: 0;
  right: 0;
  top: 40%;
  transform: translateY(-50%) scaleY(0);
  z-index: 26;
  pointer-events: none;
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 24px;
  background: linear-gradient(90deg, transparent 0%, rgba(16, 20, 26, 0.94) 18%, rgba(28, 22, 16, 0.96) 50%, rgba(16, 20, 26, 0.94) 82%, transparent 100%);
  border-top: 2px solid var(--ult-col, #f2cc68);
  border-bottom: 2px solid var(--ult-col, #f2cc68);
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms ease;
}
.ult-cutin-banner.show {
  opacity: 1;
  transform: translateY(-50%) scaleY(1);
}
.ult-cutin-sprite {
  width: 54px;
  height: 54px;
  image-rendering: pixelated;
  object-fit: contain;
  transform: scaleX(-1);
}
.ult-cutin-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--ult-col, #ffe388);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.85);
}
.ult-cutin-sub {
  font-size: 11.5px;
  color: rgba(242, 232, 208, 0.9);
  letter-spacing: 0.5px;
}

.affix-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid var(--border-strong);
  background: var(--bg-inset);
}
.affix-chip.tier-灵 { border-color: rgba(68, 166, 214, 0.65); color: #3688b8; }
.affix-chip.tier-仙 { border-color: rgba(204, 152, 46, 0.85); color: #b67d18; }
.affix-chip.tier-洪荒 { border-color: var(--accent-vermilion); color: var(--accent-vermilion); }
[data-theme="dark"] .affix-chip.tier-灵 { color: #78cbf2; }
[data-theme="dark"] .affix-chip.tier-仙 { color: #f2ca68; }
[data-theme="dark"] .affix-chip.tier-洪荒 { color: #ff826e; }

.sprite-stage-slot.hit-freeze {
  filter: brightness(2.1) contrast(1.15);
  transform: translateX(8px) skewX(-6deg) scale(0.95);
  transition: none !important;
}
.sprite-stage-slot.is-player.hit-freeze {
  transform: translateX(-8px) skewX(6deg) scale(0.95);
}
.sprite-stage-slot.ult-charge img {
  filter: drop-shadow(0 0 8px #ffe078) brightness(1.22);
}

@keyframes furnaceShake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  20% { transform: translate(-4px, -2px) rotate(-4deg); }
  45% { transform: translate(4px, 2px) rotate(4deg); }
  70% { transform: translate(-3px, 1px) rotate(-2deg); }
}

@keyframes lootFlipIn {
  0% { opacity: 0; transform: translateY(12px) scale(0.92); }
  65% { opacity: 1; transform: translateY(-2px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ultPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 212, 98, 0.55); }
  50% { box-shadow: 0 0 18px rgba(255, 224, 128, 0.95); }
}

/* 卷档与仙籍云存档中心 */
.cloud-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
  background: var(--text-muted);
  opacity: 0.55;
}
.cloud-dot.is-online { background: var(--accent-jade); opacity: 1; box-shadow: 0 0 6px var(--accent-jade); }
.cloud-dot.is-syncing { background: var(--accent-gold); opacity: 1; }
.cloud-dot.is-conflict { background: var(--accent-vermilion); opacity: 1; box-shadow: 0 0 6px var(--accent-vermilion); }

.save-center-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.save-tab-btn {
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-inset);
  color: var(--text-muted);
  font-family: var(--font-serif);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.save-tab-btn.active {
  background: var(--accent-primary);
  color: var(--accent-primary-fg);
  border-color: var(--accent-primary);
}

.save-slot-list {
  display: grid;
  gap: 9px;
  margin-bottom: 14px;
}
.save-slot-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  flex-wrap: wrap;
}
.save-slot-card.is-active {
  border-color: var(--accent-primary);
  background: var(--accent-primary-soft);
}
.save-slot-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.cloud-auth-box {
  padding: 14px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  display: grid;
  gap: 10px;
}
.cloud-form-row {
  display: grid;
  gap: 4px;
}
.cloud-form-row label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}
.hp-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.conflict-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}
.conflict-col {
  padding: 10px;
  border-radius: 6px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-card);
  display: grid;
  gap: 5px;
  font-size: 12px;
}
.conflict-col.is-cloud { border-color: var(--accent-primary); }
.conflict-col.is-local { border-color: var(--accent-gold); }

.security-shield-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 5px;
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  font-size: 11px;
  color: var(--text-muted);
}

/* 分享名帖链接工具栏 & 访客拜山 6v6 切磋弹窗 */
.share-toolbar-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  text-align: left;
  display: grid;
  gap: 10px;
}
.share-link-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.share-link-row .input-box {
  flex: 1;
  min-width: 180px;
  font-family: monospace;
  font-size: 11.5px;
}

.visitor-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 6px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-elevated);
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.visitor-team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.visitor-beast-tile {
  padding: 8px;
  border-radius: 5px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  text-align: center;
  font-size: 11.5px;
}
.visitor-beast-tile.is-shiny {
  border-color: var(--accent-gold);
  box-shadow: 0 0 10px rgba(212, 168, 72, 0.25);
}
.spar-report-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 6px;
  border: 1.5px solid var(--accent-primary);
  background: var(--accent-primary-soft);
  display: grid;
  gap: 6px;
  font-size: 12.5px;
}
.spar-report-box.is-loss {
  border-color: var(--accent-vermilion);
  background: rgba(184, 66, 52, 0.08);
}
@media (max-width: 600px) {
  .visitor-team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.tianjiao-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.tianjiao-row.is-beaten {
  border-color: var(--border-strong);
  background: var(--accent-primary-soft);
}

.tianjiao-row.is-next {
  border-color: var(--accent-gold);
  box-shadow: inset 0 0 0 1px var(--accent-gold);
}

.steward-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.steward-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.offline-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 14px;
}

.offline-stat-box {
  padding: 10px;
  border-radius: 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  text-align: center;
}

.offline-stat-box strong {
  display: block;
  font-family: var(--font-num);
  font-size: 18px;
  color: var(--accent-primary);
}

/* 游艺厅 */
.slot-reels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 300px;
  margin: 12px auto;
  padding: 12px;
  background: var(--bg-surface);
  border-radius: 10px;
}

.slot-cell {
  height: 58px;
  border-radius: 6px;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-msg {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 22, 28, 0.94);
  color: #f6e7c1;
  border: 1px solid rgba(229, 184, 75, 0.4);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  box-shadow: var(--shadow-float);
  transition: opacity 180ms ease;
}

.toast-msg.show { opacity: 1; }

/* 图鉴汇总环、培育屋实景与五大秘境玩法通用组件 */
.dex-summary-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}

.dex-ring-box {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dex-ring-label {
  position: absolute;
  text-align: center;
  line-height: 1.2;
}

.dex-region-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 14px;
}

.recent-catches-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 8px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

.daycare-live-scene {
  position: relative;
  height: 112px;
  border-radius: 10px;
  margin-bottom: 12px;
  background: url('../assets/bg_nanshan.webp') center bottom / cover no-repeat;
  image-rendering: pixelated;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 28px;
  padding-bottom: 10px;
}

.activity-hero {
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}

.raid-hp-shell {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  overflow: hidden;
  margin: 8px 0;
}

.raid-hp-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-vermilion), var(--accent-primary));
  transition: width 260ms var(--ease-out);
}

/* 顶部修仙境界玉牌、宗门悬赏条、阵法、天降灵匣与祥瑞卷轴 */
.realm-hud-chip {
  min-width: 126px;
  padding: 5px 11px;
  border-radius: 3px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  cursor: pointer;
  text-align: left;
  transition: transform 140ms var(--ease-out), border-color 140ms ease;
}

.realm-hud-chip:hover {
  border-color: var(--border-strong);
}

.realm-hud-chip.is-ready {
  border-color: var(--border-strong);
  box-shadow: none;
  animation: none;
}

.realm-hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.realm-seal-name {
  font-family: var(--font-serif);
  font-size: 13.5px;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--accent-primary);
}

.realm-break-tag {
  font-family: var(--font-seal);
  font-size: 10px;
  letter-spacing: 0.08em;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 2px;
  background: var(--accent-vermilion);
  color: #faf5e8;
}

.bounty-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 10px;
  margin-bottom: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  border-left: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
  box-shadow: none;
  font-family: var(--font-calli);
  font-size: 12px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.bounty-bar.is-claimable {
  border-color: var(--border-strong);
  background: var(--accent-primary-soft);
  border-radius: 3px;
}

.bounty-bar.is-claimable .bounty-reward-meta {
  display: none;
}

@media (max-width: 1380px) {
  .bounty-reward-meta,
  .bounty-prefix {
    display: none;
  }
  .route-stepper {
    gap: 3px;
  }
  .bounty-bar {
    padding: 2px 7px;
  }
}

.painting-mat {
  padding: var(--mat-pad);
  background: var(--mat-bg);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
}

.vertical-colophon {
  position: absolute;
  top: 52px;
  left: 64px;
  z-index: 6;
  writing-mode: vertical-rl;
  font-family: var(--font-calli);
  font-size: 12.5px;
  letter-spacing: 0.22em;
  color: rgba(250, 243, 224, 0.94);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
  padding: 6px 4px 10px;
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(12, 16, 20, 0.44) 0%, rgba(12, 16, 20, 0.18) 78%, rgba(12, 16, 20, 0) 100%);
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.colophon-seal {
  writing-mode: horizontal-tb;
  width: 17px;
  height: 17px;
  background: rgba(166, 52, 40, 0.88);
  border: 1px solid rgba(244, 210, 178, 0.35);
  color: #f8f0dc;
  font-family: var(--font-seal);
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
}

.combo-inline-note {
  font-family: var(--font-serif);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #e9cf8e;
  padding-right: 8px;
  border-right: 1px solid rgba(255, 240, 200, 0.22);
  white-space: nowrap;
}

.sprite-ground-wrap.is-pettable {
  cursor: pointer;
}

.mood-bubble {
  position: absolute;
  top: -36px;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  z-index: 16;
  padding: 4px 11px;
  border-radius: 3px;
  background: rgba(14, 18, 22, 0.92);
  border: 1px solid rgba(218, 192, 134, 0.48);
  color: #f5ecda;
  font-family: var(--font-calli);
  font-size: 12px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease, transform 220ms var(--ease-out);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.42);
}

.mood-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: rgba(14, 18, 22, 0.92);
  border-right: 1px solid rgba(218, 192, 134, 0.48);
  border-bottom: 1px solid rgba(218, 192, 134, 0.48);
}

.mood-bubble.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.stage-left-overlays {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.stage-formation-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.formation-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 5px;
  background: rgba(14, 22, 30, 0.86);
  border: 1px solid rgba(100, 212, 180, 0.5);
  color: #a8f5dd;
  font-family: var(--font-serif);
  font-size: 11px;
  font-weight: 700;
}

.sword-assist-btn {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(78, 230, 194, 0.55);
  background: rgba(20, 74, 68, 0.78);
  color: #b8fff0;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms var(--ease-out), filter 120ms ease;
}

.sword-assist-btn:active {
  transform: scale(0.94);
}

.sword-assist-btn:hover {
  filter: brightness(1.15);
}

.rare-banner {
  position: absolute;
  top: 52px;
  left: 50%;
  transform: translateX(-50%) translateY(-16px);
  z-index: 22;
  padding: 8px 22px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(40, 20, 56, 0.92), rgba(148, 52, 38, 0.94), rgba(40, 20, 56, 0.92));
  border: 1.5px solid #ffd56b;
  color: #fff3c4;
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55), 0 0 18px rgba(255, 213, 107, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease, transform 240ms var(--ease-out);
  white-space: nowrap;
}

.rare-banner.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.miracle-orb {
  position: absolute;
  right: 22px;
  top: 72px;
  z-index: 15;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1.5px solid #ffd56b;
  background: linear-gradient(135deg, rgba(164, 58, 36, 0.94), rgba(212, 138, 34, 0.94));
  color: #fff8df;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(229, 184, 75, 0.48);
  animation: miracleFloat 1.9s ease-in-out infinite;
}

.apt-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid currentColor;
}

.affix-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

/* v12 1000分国风修仙精修组件：战力玉牌、玄铁、红点、灵阵光环、法宝炼器与秘境派遣 */
.tab-badge {
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 600;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tab-badge.is-alert {
  background: transparent;
  color: var(--text-main);
  animation: none;
}

.tab-badge.is-alert::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-vermilion);
  box-shadow: 0 0 0 2px var(--accent-vermilion-soft);
}

[data-theme="dark"] .tab-badge.is-alert::after {
  background: var(--accent-green);
  box-shadow: 0 0 8px rgba(88, 201, 176, 0.75);
}

.power-hud-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 2px 4px;
  border-radius: 0;
  background: transparent;
  border: none;
  font-size: 12px;
  color: var(--text-main);
}

.power-hud-pill .power-label {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.power-hud-pill strong {
  font-family: var(--font-num);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-primary);
  font-variant-numeric: tabular-nums;
}

.xuantie-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 4px;
  background: #3d5266;
  border: 1px solid #7ea6c8;
  color: #e2f1ff;
  font-size: 10px;
  font-weight: 700;
}

.quiet-link.is-active-link {
  color: var(--accent-primary);
  font-weight: 700;
}

.combo-pill {
  position: absolute;
  right: 18px;
  bottom: 58px;
  z-index: 15;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(160, 42, 26, 0.92), rgba(206, 126, 28, 0.92));
  border: 1px solid #ffd872;
  color: #fff5d4;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 4px 16px rgba(214, 96, 36, 0.45);
  pointer-events: none;
}

.sprite-ground-wrap.aura-mythic::before,
.sprite-ground-wrap.aura-boss::before {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 112px;
  height: 24px;
  transform: translateX(-50%);
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
  animation: auraBreath 2.2s ease-in-out infinite;
}

.sprite-ground-wrap.aura-mythic::before {
  background: radial-gradient(ellipse at center, rgba(255, 215, 102, 0.52) 0%, rgba(92, 240, 200, 0.25) 55%, rgba(0, 0, 0, 0) 76%);
  border: 1.5px solid rgba(255, 216, 110, 0.72);
  box-shadow: 0 0 18px rgba(255, 214, 102, 0.55);
}

.sprite-ground-wrap.aura-boss::before {
  background: radial-gradient(ellipse at center, rgba(232, 74, 58, 0.48) 0%, rgba(168, 56, 214, 0.24) 55%, rgba(0, 0, 0, 0) 76%);
  border: 1.5px solid rgba(255, 118, 96, 0.74);
  box-shadow: 0 0 18px rgba(232, 74, 58, 0.52);
}

.cave-canvas-wrap,
.raid-canvas-wrap {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-card);
  margin-bottom: 12px;
  background: #0b131d;
}

[data-theme="light"] .cave-canvas-wrap,
[data-theme="light"] .raid-canvas-wrap {
  padding: 5px;
  background: var(--mat-bg);
}

.cave-canvas-wrap canvas,
.raid-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
  cursor: pointer;
}

.artifact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.artifact-card {
  position: relative;
  overflow: hidden;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  transition: border-color 180ms ease, transform 180ms var(--ease-out), box-shadow 180ms ease;
}

.artifact-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-float);
}

.artifact-card.is-unlocked {
  border-color: var(--border-strong);
}

[data-theme="dark"] .artifact-card.is-unlocked {
  background: linear-gradient(180deg, rgba(24, 30, 38, 0.96), rgba(16, 21, 28, 0.98));
  border-color: rgba(196, 164, 98, 0.24);
}

[data-theme="dark"] .artifact-icon-box {
  background: radial-gradient(circle at 50% 42%, rgba(196, 164, 98, 0.14), rgba(10, 14, 18, 0.8) 76%);
  border-color: rgba(196, 164, 98, 0.16);
}

.select-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  padding: 5px 10px;
  font-family: var(--font-serif);
  font-size: 12.5px;
  color: var(--text-main);
  cursor: pointer;
}

.select-box:focus {
  border-color: var(--accent-primary);
}

/* 4 类山海物种分型物理动作（飞禽滑翔+影子缩放、龙蛇游弋、灵体浮空、走兽蓄力）+ 抚摸蹦跳 + 弧线蓄力扑击 */
.sprite-stage-slot.motif-bird img { animation: birdGlide 3.1s ease-in-out infinite; }
.sprite-stage-slot.is-player.motif-bird img { animation: birdGlideMirror 3.1s ease-in-out infinite; }
.ground-shadow.motif-bird { animation: shadowGlide 3.1s ease-in-out infinite; }

.sprite-stage-slot.motif-serpent img { animation: serpentSway 3.4s ease-in-out infinite; }
.sprite-stage-slot.is-player.motif-serpent img { animation: serpentSwayMirror 3.4s ease-in-out infinite; }

.sprite-stage-slot.motif-spirit img { animation: spiritFloat 3.6s ease-in-out infinite; }
.sprite-stage-slot.is-player.motif-spirit img { animation: spiritFloatMirror 3.6s ease-in-out infinite; }
.ground-shadow.motif-spirit { animation: shadowGlide 3.6s ease-in-out infinite; }

.sprite-stage-slot.pet-hop {
  animation: petHop 0.56s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

@keyframes birdGlide {
  0%, 100% { transform: translateY(-6px) rotate(-1.5deg); }
  50% { transform: translateY(-16px) rotate(1.8deg) scaleY(1.02); }
}

@keyframes birdGlideMirror {
  0%, 100% { transform: scaleX(-1) translateY(-6px) rotate(-1.5deg); }
  50% { transform: scaleX(-1) translateY(-16px) rotate(1.8deg) scaleY(1.02); }
}

@keyframes shadowGlide {
  0%, 100% { transform: scaleX(0.88); opacity: 0.55; }
  50% { transform: scaleX(0.64); opacity: 0.32; }
}

@keyframes serpentSway {
  0%, 100% { transform: translateX(0) skewX(0deg) scaleY(1); }
  33% { transform: translateX(-3px) skewX(2.4deg) scaleY(1.03); }
  66% { transform: translateX(3px) skewX(-2.2deg) scaleY(0.99); }
}

@keyframes serpentSwayMirror {
  0%, 100% { transform: scaleX(-1) translateX(0) skewX(0deg) scaleY(1); }
  33% { transform: scaleX(-1) translateX(-3px) skewX(2.4deg) scaleY(1.03); }
  66% { transform: scaleX(-1) translateX(3px) skewX(-2.2deg) scaleY(0.99); }
}

@keyframes spiritFloat {
  0%, 100% { transform: translateY(-4px) scale(1); }
  50% { transform: translateY(-13px) scale(1.03); }
}

@keyframes spiritFloatMirror {
  0%, 100% { transform: scaleX(-1) translateY(-4px) scale(1); }
  50% { transform: scaleX(-1) translateY(-13px) scale(1.03); }
}

@keyframes petHop {
  0% { transform: translateY(0) scaleY(1); }
  18% { transform: translateY(2px) scaleY(0.88) scaleX(1.08); }
  45% { transform: translateY(-18px) scaleY(1.08) scaleX(0.95); }
  72% { transform: translateY(0) scaleY(0.93) scaleX(1.05); }
  88% { transform: translateY(-7px) scaleY(1.03); }
  100% { transform: translateY(0) scaleY(1); }
}

.artifact-card.is-unlocked::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 36%, rgba(255, 224, 132, 0.14) 50%, transparent 64%);
  transform: translateX(-120%);
  animation: shimmerSweep 5.2s ease-in-out infinite;
  pointer-events: none;
}

.pc-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-float);
}

.encounter-tile {
  transition: transform 160ms var(--ease-out), border-color 160ms ease;
}

.encounter-tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
}

.activity-hero {
  position: relative;
}

.activity-hero::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 6px;
  width: 12px;
  height: 12px;
  border-top: 1.5px solid var(--accent-primary);
  border-left: 1.5px solid var(--accent-primary);
  border-top-left-radius: 3px;
  opacity: 0.55;
  pointer-events: none;
}

.activity-hero::after {
  content: "";
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 12px;
  height: 12px;
  border-bottom: 1.5px solid var(--accent-primary);
  border-right: 1.5px solid var(--accent-primary);
  border-bottom-right-radius: 3px;
  opacity: 0.55;
  pointer-events: none;
}

@keyframes panelReveal {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modalReveal {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes beastEnter {
  0% { opacity: 0; transform: scale(0.76) translateY(-14px); filter: blur(2px) brightness(1.6); }
  70% { opacity: 1; transform: scale(1.04) translateY(2px); filter: none; }
  100% { opacity: 1; transform: scale(1) translateY(0); filter: none; }
}

@keyframes stageShake {
  0%, 100% { transform: translate3d(0, 0, 0); }
  20% { transform: translate3d(-4px, 2px, 0); }
  45% { transform: translate3d(4px, -2px, 0); }
  70% { transform: translate3d(-2px, 1px, 0); }
}

@keyframes shimmerSweep {
  0%, 62% { transform: translateX(-130%); }
  100% { transform: translateX(130%); }
}

.artifact-icon-box {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.artifact-icon-box img {
  width: 62px;
  height: 62px;
  object-fit: contain;
  image-rendering: pixelated;
}

.expedition-card {
  padding: 14px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
}

.expedition-card.is-ready {
  border-color: var(--accent-primary);
  background: var(--accent-primary-soft);
}

.star-pips {
  color: #e6a82e;
  font-size: 11px;
  letter-spacing: 1px;
  font-weight: 700;
}

@keyframes auraBreath {
  0%, 100% { transform: translateX(-50%) scale(0.96); opacity: 0.78; }
  50% { transform: translateX(-50%) scale(1.06); opacity: 1; }
}

@keyframes spriteBreathe {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(1.032) scaleX(0.985); }
}

@keyframes spriteBreatheMirror {
  0%, 100% { transform: scaleX(-1) scaleY(1); }
  50% { transform: scaleX(-0.985) scaleY(1.032); }
}

@keyframes realmPulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-primary-soft); }
  50% { box-shadow: 0 0 14px 2px var(--accent-primary-soft); }
}

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

@keyframes hitRecoil {
  0%, 100% { transform: translateX(0) scale(1); }
  20% { transform: translateX(-9px) skewX(-5deg) scale(0.95); }
  55% { transform: translateX(6px) skewX(3deg) scale(1.02); }
  80% { transform: translateX(-3px) scale(0.99); }
}

@keyframes lungeRight {
  0% { transform: translateX(0) scaleX(1) scaleY(1); }
  18% { transform: translateX(-14px) scaleX(0.90) scaleY(1.10); }
  48% { transform: translateX(46px) translateY(-14px) scaleX(1.10) scaleY(0.92); filter: drop-shadow(-14px 4px 0 rgba(255, 224, 130, 0.45)); }
  74% { transform: translateX(8px) scaleX(0.95) scaleY(1.04); filter: none; }
  100% { transform: translateX(0) scaleX(1) scaleY(1); filter: none; }
}

@keyframes lungeLeft {
  0% { transform: translateX(0) scaleX(1) scaleY(1); }
  18% { transform: translateX(14px) scaleX(0.90) scaleY(1.10); }
  48% { transform: translateX(-46px) translateY(-14px) scaleX(1.10) scaleY(0.92); filter: drop-shadow(14px 4px 0 rgba(255, 120, 110, 0.42)); }
  74% { transform: translateX(-8px) scaleX(0.95) scaleY(1.04); filter: none; }
  100% { transform: translateX(0) scaleX(1) scaleY(1); filter: none; }
}

@keyframes ballShake {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(-16deg); }
  50% { transform: rotate(16deg); }
  75% { transform: rotate(-10deg); }
  100% { transform: rotate(0deg); }
}

@media (max-width: 720px) {
  .battle-canvas { min-height: 360px; padding: 10px 10px 0; }
  .encounters-strip { grid-template-columns: 1fr; }
  .party-dock { position: static; transform: none; flex-direction: row; overflow-x: auto; margin-bottom: 6px; max-width: 100%; }
  .stage-arena { flex-direction: column-reverse; align-items: stretch; padding-bottom: 8px; }
  .combatants-stage { gap: 8px; padding: 0; }
  .combatant-box { gap: 14px; }
  .combatant-hud { max-width: 158px; padding: 5px 7px; }
  .sprite-stage-slot, .sprite-stage-slot img { width: 96px; height: 96px; }
  .vertical-colophon { display: none; }
  .stage-ball-bar { flex-wrap: wrap; gap: 3px; padding: 4px 6px; }
  .miracle-orb { position: static; margin: 0 auto 6px; align-self: center; padding: 5px 12px; font-size: 11px; }
  .stage-bottom-bar { flex-wrap: wrap; gap: 8px; margin: 0 -10px; padding: 12px 10px 10px; }
  .stage-bottom-controls { width: 100%; justify-content: flex-end; flex-wrap: wrap; gap: 5px; }
  .onboard-identity-row, .steward-grid, .grid-2, .conflict-grid { grid-template-columns: 1fr; }
  .save-slot-card { flex-direction: column; align-items: stretch; }
  .starter-grid, .grid-3, .grid-4, .offline-grid { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
