/* ============================================================
   肥鱼寻仙 · 视觉样式
   ============================================================ */
:root {
  --bg: #06110c;
  --bg2: #0a1a13;
  --panel: rgba(11, 28, 20, 0.78);
  --panel2: rgba(17, 40, 28, 0.92);
  --line: rgba(150, 205, 165, 0.13);
  --line2: rgba(160, 220, 175, 0.26);
  --gold: #f2d79a;
  --gold2: #c9a45f;
  --txt: #dcece0;
  --dim: #83a292;
  --dim2: #5f7a6c;
  --rc: #6fd3a3;
  --r: 14px;
  --sh: 0 8px 28px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--txt);
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(40, 110, 78, 0.22), transparent 62%),
    radial-gradient(80% 60% at 90% 100%, rgba(30, 80, 60, 0.16), transparent 60%),
    linear-gradient(180deg, #071510, #040c09);
  z-index: -1;
}

.serif { font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", SimSun, serif; }

#app {
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
  padding: 8px;
}

/* ============================================================
   顶栏
   ============================================================ */
.topbar {
  height: 52px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  border-radius: var(--r);
  background: linear-gradient(180deg, rgba(20, 46, 32, 0.9), rgba(9, 24, 17, 0.86));
  border: 1px solid var(--line);
  box-shadow: var(--sh), inset 0 1px 0 rgba(190, 240, 200, 0.08);
  position: relative;
  z-index: 20;
  flex: none;
}

.topbar::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(230, 200, 140, 0.35), transparent);
}

.brand {
  font-family: "Noto Serif SC", "Songti SC", SimSun, serif;
  font-size: 19px;
  letter-spacing: 3px;
  font-weight: 700;
  background: linear-gradient(180deg, #fff6dd, #d8b273 60%, #a8834a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 18px rgba(230, 190, 120, 0.25);
  white-space: nowrap;
}
.brand em { font-style: normal; opacity: 0.55; }
.brandLogo {
  width: 34px;
  height: 34px;
  margin-right: 9px;
  vertical-align: -11px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, rgba(64, 104, 82, 0.9), rgba(10, 26, 18, 0.95) 72%);
  border: 1px solid rgba(230, 200, 140, 0.45);
  box-shadow: 0 0 12px -2px rgba(255, 214, 122, 0.5);
  object-fit: contain;
}

.realmBadge {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border-radius: 15px;
  border: 1px solid var(--rc);
  background: color-mix(in srgb, var(--rc) 12%, rgba(6, 20, 14, 0.7));
  box-shadow: 0 0 16px -4px var(--rc), inset 0 0 14px -6px var(--rc);
  transition: border-color 0.5s, box-shadow 0.5s, background 0.5s;
  white-space: nowrap;
}
.rbGlyph { font-size: 11px; color: var(--rc); opacity: 0.9; }
.rbName {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--rc);
  font-weight: 700;
  text-shadow: 0 0 12px var(--rc);
}
.rbLv {
  font-size: 10px;
  color: var(--dim);
  padding-left: 6px;
  border-left: 1px solid var(--line2);
}

/* 桌面端这层不参与布局（display:contents），战力照样绝对居中；
   窄屏才变成一行，把战力和资源一起居中 */
.resGroup { display: contents; }
.res { display: flex; gap: 6px; margin-left: auto; }

/* ============================================================
   顶栏战力：绝对居中，两侧内容再多也不会把它挤偏
   ============================================================ */
.powerBox {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px 0 0;   /* 左侧留给满圆 logo，不要第二圈描边 */
  border-radius: 20px;
  overflow: hidden;      /* logo 与框共享同一条外缘，合成一个整体 */
  border: 1px solid rgba(255, 214, 122, 0.55);
  background: linear-gradient(180deg, rgba(58, 44, 16, 0.95), rgba(24, 18, 8, 0.92));
  box-shadow:
    0 0 26px -6px rgba(255, 214, 122, 0.95),
    inset 0 1px 0 rgba(255, 238, 190, 0.22);
  white-space: nowrap;
  pointer-events: auto;
  z-index: 3;
}
.powerBox .ic { width: 24px; height: 24px; border-radius: 7px; }
/* 战斗力前的游戏 logo（肥鱼持斧）：与徽标框等高、共享外缘，视觉上一个圈 */
.pwLogo {
  width: 40px;
  height: 40px;
  margin: 0 6px 0 -1px;   /* -1px 吃掉框左边 1px 的描边缝隙 */
  border: none;
  box-shadow: none;
  background: none;
  border-radius: 50%;
  object-fit: cover;
  transform: scale(1.06); /* 微放大，把补边留白顶出圆形裁剪区 */
  flex: 0 0 auto;
}
.pwLabel {
  font-family: "Noto Serif SC", serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255, 226, 158, 0.92);
  text-shadow: 0 0 10px rgba(255, 214, 122, 0.5);
}
.powerBox b {
  font-family: "Noto Serif SC", serif;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.5px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #ffd15c;
  text-shadow: 0 0 12px rgba(255, 200, 80, 0.7);
  min-width: 16px;
}
/* 支持渐变文字的浏览器再上金色渐变 + 发光（不支持时自动回落到上面的实色） */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .powerBox b {
    background: linear-gradient(180deg, #fff6d8 0%, #ffd15c 55%, #ffab3d 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 0 10px rgba(255, 205, 90, 0.75));
  }
}
/* 战力跳变时闪一下（renderTop 里加类名触发） */
.powerBox.up b { animation: pwUp 0.5s ease-out; }
@keyframes pwUp {
  0% { filter: drop-shadow(0 0 22px rgba(255, 236, 170, 1)); transform: scale(1.14); }
  100% { filter: drop-shadow(0 0 10px rgba(255, 205, 90, 0.75)); transform: scale(1); }
}
.resItem {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 5px;
  border-radius: 10px;
  background: rgba(6, 20, 14, 0.55);
  border: 1px solid var(--line);
}
.resItem b {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
  color: #eaf6ea;
  min-width: 12px;
}
.resItem.warn b { color: #ff9d7a; }

.ic {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  color: #06110c;
  font-family: "Noto Serif SC", serif;
  flex: none;
}
.icWood { background: linear-gradient(160deg, #d8b483, #a87c47); }
.icStone { background: linear-gradient(160deg, #9fe6ff, #4fa8d8); }
.icPower { background: linear-gradient(160deg, #ffd97a, #d99a3a); }

.icWood::after { content: "木"; }
.icStone::after { content: "灵"; }
.icPower::after { content: "力"; }

.tools { display: flex; gap: 6px; }
.tBtn {
  flex: none;
  white-space: nowrap;
  height: 30px;
  min-width: 42px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--line2);
  background: rgba(10, 26, 19, 0.8);
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: 0.2s;
  font-family: inherit;
}
.tBtn:hover { color: var(--gold); border-color: var(--gold2); box-shadow: 0 0 14px -4px var(--gold2); }
.tBtn.on {
  color: #0a1a12;
  background: linear-gradient(180deg, #e7c98a, #b8914f);
  border-color: #e7c98a;
  font-weight: 700;
  box-shadow: 0 0 16px -3px rgba(240, 200, 130, 0.55);
}
/* 兑换码入口：常驻微亮，让人一眼看得到这里有礼包 */
#cdkBtn {
  color: #ffe6a8;
  border-color: rgba(255, 214, 122, 0.55);
  background: linear-gradient(180deg, rgba(72, 54, 22, 0.9), rgba(30, 22, 10, 0.9));
  box-shadow: 0 0 12px -4px rgba(255, 214, 122, 0.8);
}
#cdkBtn:hover { color: #fff8dc; box-shadow: 0 0 18px -3px rgba(255, 214, 122, 0.95); }

/* ============================================================
   主区
   ============================================================ */
.main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 306px;
  gap: 8px;
  min-height: 0;
}

.stage {
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
  background: #061512;
  border: 1px solid var(--line);
  box-shadow: var(--sh);
  cursor: crosshair;
  min-height: 0;
}
.stage:active { cursor: grabbing; }
#game { display: block; width: 100%; height: 100%; }

/* 舞台顶部信息 */
.stageTop {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  pointer-events: none;
  z-index: 5;
}
.treeHead { flex: none; }
.treeLv {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 13px;
  letter-spacing: 2px;
  color: #dff0e2;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}
.treeLv b { font-size: 17px; color: var(--gold); margin: 0 2px; }
.treeKind {
  font-size: 10.5px;
  letter-spacing: 3px;
  color: #ffd27a;
  text-shadow: 0 0 10px rgba(255, 190, 90, 0.7);
  height: 14px;
}
.treeKind.boss { color: #ff8a7a; text-shadow: 0 0 12px rgba(255, 90, 70, 0.8); }

.hpWrap { flex: 1; min-width: 0; max-width: 470px; }
.hpLine { display: flex; align-items: center; gap: 9px; }
.hpBar {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 11px;
  border-radius: 6px;
  background: rgba(4, 16, 10, 0.72);
  border: 1px solid rgba(170, 220, 180, 0.18);
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
}
.hpFill {
  position: absolute;
  inset: 1px;
  width: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, #3f9e6a, #79cc86 62%, #b8e59a);
  transition: width 0.16s cubic-bezier(0.3, 0.9, 0.4, 1);
  transform-origin: left;
  box-shadow: 0 0 10px rgba(110, 200, 140, 0.4);
}
.hpFill.boss { background: linear-gradient(90deg, #b03a4a, #f0724f 65%, #ffb26b); box-shadow: 0 0 14px rgba(255, 110, 90, 0.55); }
.hpShine {
  position: absolute;
  inset: 1px;
  border-radius: 5px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent 56%);
  pointer-events: none;
}
.hpText {
  flex: none;
  font-size: 11px;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
  color: rgba(240, 252, 240, 0.92);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
  min-width: 78px;
  text-align: right;
}
.hpSub {
  font-size: 10px;
  color: #8fb9a0;
  letter-spacing: 1px;
  margin-top: 3px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  height: 12px;
}

/* 连击 */
.combo {
  position: absolute;
  left: 16px;
  top: 106px;
  display: flex;
  align-items: baseline;
  gap: 5px;
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  z-index: 5;
}
.combo.on { opacity: 1; transform: none; }
.combo b {
  font-family: "Noto Serif SC", serif;
  font-size: 40px;
  line-height: 0.9;
  font-weight: 900;
  color: #fff3c8;
  text-shadow: 0 0 18px rgba(255, 190, 90, 0.9), 0 3px 10px rgba(0, 0, 0, 0.8);
  font-variant-numeric: tabular-nums;
}
.combo span {
  font-size: 11px;
  letter-spacing: 3px;
  color: #ffd9a0;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}
.combo i {
  font-style: normal;
  font-size: 12px;
  color: #ffb86b;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(60, 20, 0, 0.5);
  border: 1px solid rgba(255, 170, 90, 0.35);
}

/* 技能条 */
.skills {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 6;
}
.skill {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  border: 1px solid var(--line2);
  background: linear-gradient(180deg, rgba(24, 52, 38, 0.92), rgba(8, 22, 15, 0.94));
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: 0.18s;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(200, 240, 210, 0.1);
}
.skill .sIcon {
  font-family: "Noto Serif SC", serif;
  font-size: 21px;
  font-weight: 700;
  color: var(--sc, #dff0e2);
  text-shadow: 0 0 14px var(--sc, #fff);
  transition: 0.2s;
}
.skill .sKey {
  position: absolute;
  right: 4px;
  bottom: 3px;
  font-size: 9px;
  color: var(--dim);
  letter-spacing: 0.5px;
}
.skill .sCd {
  position: absolute;
  inset: 0;
  background: conic-gradient(rgba(4, 14, 10, 0.86) var(--p, 0%), transparent 0);
  pointer-events: none;
}
.skill.ready { border-color: var(--sc); box-shadow: 0 0 18px -3px var(--sc), inset 0 0 16px -8px var(--sc); }
.skill.ready .sIcon { transform: scale(1.04); }
.skill.locked { opacity: 0.5; filter: grayscale(0.65); }
.skill:active { transform: scale(0.94); }
.skill .sTip {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  width: 168px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(6, 18, 12, 0.96);
  border: 1px solid var(--line2);
  font-size: 11px;
  line-height: 1.6;
  color: var(--txt);
  opacity: 0;
  pointer-events: none;
  transition: 0.16s;
  text-align: left;
}
.skill:hover .sTip { opacity: 1; }
.sTip b { color: var(--sc); display: block; letter-spacing: 1px; margin-bottom: 2px; }
.sTip em { font-style: normal; color: var(--dim); }

/* 提示 */
.hint {
  position: absolute;
  left: 16px;
  bottom: 16px;
  font-size: 11.5px;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  transition: opacity 0.7s;
  pointer-events: none;
  z-index: 5;
  animation: hintPulse 2.6s ease-in-out infinite;
}
@keyframes hintPulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

.fps {
  position: absolute;
  right: 10px;
  bottom: 8px;
  font-size: 10px;
  color: rgba(200, 230, 210, 0.35);
  font-variant-numeric: tabular-nums;
  z-index: 5;
  pointer-events: none;
}

/* toast */
.toasts {
  position: absolute;
  right: 14px;
  top: 92px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  pointer-events: none;
  z-index: 7;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 9px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(8, 22, 15, 0.94), rgba(16, 38, 26, 0.9));
  border: 1px solid var(--tc, #9fb0a8);
  border-left-width: 3px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 18px -8px var(--tc);
  animation: toastIn 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  max-width: 300px;
}
.toast.out { animation: toastOut 0.36s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px) scale(0.94); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px) scale(0.96); } }
.toast .tName {
  font-family: "Noto Serif SC", serif;
  font-size: 12.5px;
  color: var(--tc);
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast .tAttr { font-size: 10px; color: var(--dim); white-space: nowrap; }
.toast .tTag {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--tc);
  color: #06110c;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* ============================================================
   侧栏
   ============================================================ */
.side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
}

.panel {
  background: linear-gradient(180deg, rgba(16, 38, 27, 0.86), rgba(8, 22, 15, 0.9));
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px;
  box-shadow: var(--sh), inset 0 1px 0 rgba(190, 240, 200, 0.06);
  position: relative;
}
.panel::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(230, 200, 140, 0.3), transparent);
}
.pHead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.pHead h3 {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--gold);
  text-shadow: 0 0 14px rgba(230, 190, 120, 0.3);
}
.pSub { font-size: 10px; color: var(--dim2); letter-spacing: 0.5px; }

/* 装备格 */
.equipGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.slot {
  position: relative;
  height: 54px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(5, 16, 11, 0.6);
  padding: 6px 7px;
  cursor: pointer;
  overflow: hidden;
  transition: 0.18s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.slot:hover { border-color: var(--line2); background: rgba(10, 26, 18, 0.8); }
.slot.empty { border-style: dashed; opacity: 0.55; }
.slot .sName {
  font-family: "Noto Serif SC", serif;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--sc, #cdd);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.slot .sAttr {
  font-size: 9.5px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.slot .sTag {
  position: absolute;
  right: 5px;
  top: 4px;
  font-size: 8.5px;
  color: var(--sc);
  opacity: 0.85;
  letter-spacing: 0.5px;
}
.slot.filled { border-color: color-mix(in srgb, var(--sc) 45%, transparent); box-shadow: inset 0 0 16px -10px var(--sc); }
.slot.up { animation: slotUp 0.6s ease; }
@keyframes slotUp {
  0% { box-shadow: 0 0 0 0 var(--sc); }
  30% { box-shadow: 0 0 22px 2px var(--sc); }
  100% { box-shadow: inset 0 0 16px -10px var(--sc); }
}

.breakBtn {
  margin-top: 8px;
  width: 100%;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line2);
  background: linear-gradient(180deg, rgba(40, 74, 54, 0.9), rgba(14, 34, 24, 0.95));
  color: var(--dim);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  transition: 0.2s;
  position: relative;
  overflow: hidden;
  font-family: inherit;
}
.breakBtn .bkName {
  font-family: "Noto Serif SC", serif;
  font-size: 13px;
  letter-spacing: 4px;
}
.breakBtn .bkCost { font-size: 9.5px; color: var(--dim2); letter-spacing: 0.5px; }
.breakBtn.can {
  border-color: #e7c98a;
  color: #1b1206;
  background: linear-gradient(180deg, #f4dda4, #c9a45f);
  box-shadow: 0 0 22px -6px rgba(240, 200, 130, 0.8);
  animation: breakPulse 2s ease-in-out infinite;
}
.breakBtn.can .bkName { font-weight: 700; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35); }
.breakBtn.can .bkCost { color: rgba(40, 26, 8, 0.75); }
.breakBtn.can:hover { filter: brightness(1.08); }
@keyframes breakPulse { 0%, 100% { box-shadow: 0 0 18px -6px rgba(240, 200, 130, 0.7); } 50% { box-shadow: 0 0 28px -2px rgba(240, 200, 130, 0.95); } }
.breakBtn[aria-disabled="true"] { cursor: not-allowed; }
.breakBtn.rebirth {
  border-color: #7fffe0;
  background: linear-gradient(180deg, rgba(20, 66, 60, 0.95), rgba(8, 30, 28, 0.98));
  box-shadow: 0 0 18px -8px rgba(127, 255, 224, 0.7);
}
.breakBtn.rebirth .bkName { color: #bff6ea; letter-spacing: 3px; }
.breakBtn.rebirth.can {
  background: linear-gradient(180deg, #b8ffe9, #58c7b3);
  border-color: #d8fff6;
  color: #06231f;
  box-shadow: 0 0 26px -4px rgba(127, 255, 224, 0.9);
  animation: rebPulse 2.4s ease-in-out infinite;
}
.breakBtn.rebirth.can .bkName { color: #06231f; }
.breakBtn.rebirth.can .bkCost { color: rgba(6, 35, 31, 0.7); }
@keyframes rebPulse {
  0%, 100% { box-shadow: 0 0 20px -6px rgba(127, 255, 224, 0.7); }
  50% { box-shadow: 0 0 32px 0 rgba(127, 255, 224, 1); }
}
.breakBtn.shake { animation: bkShake 0.36s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes bkShake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-5px); }
  30% { transform: translateX(5px); }
  45% { transform: translateX(-4px); }
  60% { transform: translateX(3px); }
  80% { transform: translateX(-2px); }
}

/* 属性 */
.statPanel { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.statGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
  overflow-y: auto;
  padding-right: 2px;
  flex: 1;
  min-height: 0;
}
.statRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 22px;
  font-size: 11px;
  border-bottom: 1px solid rgba(150, 205, 165, 0.07);
}
.statRow span { color: var(--dim); letter-spacing: 1px; }
.statRow b { color: #e6f4e8; font-variant-numeric: tabular-nums; font-weight: 600; }
.statRow b.up { color: #9fe08a; }

/* ============================================================
   底部
   ============================================================ */
.bottom {
  height: 244px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  flex: none;
  /* 高度对所有页签恒定：不随页签切换变化，上面的游戏画面不会被拉伸缩放 */
}
/* min-height 锁 30px：右侧工具栏换内容（按钮 30 / 装扮摘要 24）时不再把整行顶高 */
.tabs { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; row-gap: 4px; min-height: 30px; }
.tab {
  flex: none;
  white-space: nowrap;
  height: 30px;
  padding: 0 11px;
  border-radius: 9px 9px 0 0;
  border: 1px solid var(--line);
  border-bottom: none;
  background: rgba(8, 22, 15, 0.7);
  color: var(--dim);
  font-size: 11.5px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: 0.16s;
  font-family: inherit;
  position: relative;
  top: 1px;
}
.tab:hover { color: var(--txt); }
.tab.on {
  background: linear-gradient(180deg, rgba(24, 52, 38, 0.95), rgba(12, 30, 21, 0.95));
  color: var(--gold);
  border-color: var(--line2);
  box-shadow: 0 -4px 16px -8px rgba(230, 200, 140, 0.5);
  /* 浮到面板之上：让选中标签的底部盖住面板顶边框，和面板连成一体（标签页的正常衔接） */
  z-index: 1;
}
.tab.on::after {
  /* 再垫一小条与面板顶面同色，彻底盖掉被切断的那 1px 缝 */
  content: '';
  position: absolute;
  left: 1px;
  right: 1px;
  bottom: -2px;
  height: 3px;
  background: linear-gradient(180deg, rgba(14, 34, 24, 0.95), rgba(14, 34, 24, 0.86));
  pointer-events: none;
}
.tab i {
  font-style: normal;
  font-size: 9.5px;
  padding: 0 4px;
  border-radius: 5px;
  background: rgba(120, 200, 150, 0.18);
  color: #9fe0b0;
  margin-left: 3px;
}
.tabSep {
  width: 1px;
  height: 16px;
  margin: 0 3px;
  align-self: center;
  background: linear-gradient(180deg, transparent, var(--line2), transparent);
  opacity: 0.65;
}
.tabTools { margin-left: auto; display: flex; gap: 6px; padding-right: 2px; flex-wrap: wrap; row-gap: 4px; justify-content: flex-end; }

.pane {
  flex: 1;
  min-height: 0;
  border-radius: 0 10px 10px 10px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(14, 34, 24, 0.86), rgba(7, 20, 14, 0.9));
  padding: 8px;
  overflow-y: auto;
  box-shadow: var(--sh);
}

/* 背包 */
.bagGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(184px, 1fr));
  gap: 6px;
}
.card {
  position: relative;
  border-radius: 9px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--sc, #9fb0a8);
  background: linear-gradient(90deg, rgba(18, 40, 29, 0.9), rgba(9, 24, 17, 0.85));
  padding: 6px 8px 6px 9px;
  cursor: pointer;
  transition: 0.16s;
  overflow: hidden;
}
.card:hover { background: rgba(26, 54, 38, 0.95); transform: translateY(-1px); }
.card.sel { border-color: var(--sc); box-shadow: 0 0 0 1px var(--sc), 0 0 16px -6px var(--sc); }
.card .cName {
  font-family: "Noto Serif SC", serif;
  font-size: 11.5px;
  color: var(--sc);
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .cAttr { font-size: 10px; color: var(--dim); margin-top: 2px; line-height: 1.45; }
.card.locked { opacity: 0.62; border-left-color: #6d5a5a; }
.card .cLock {
  position: absolute;
  left: 9px;
  bottom: 3px;
  font-size: 9px;
  letter-spacing: 0.5px;
  color: #ff9d7a;
  background: rgba(60, 22, 18, 0.72);
  border: 1px solid rgba(255, 140, 110, 0.35);
  border-radius: 4px;
  padding: 0 4px;
}
.tSel {
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--line2);
  background: rgba(12, 30, 22, 0.95);
  color: #b8d6c4;
  font-size: 10.5px;
  font-family: inherit;
  padding: 0 4px;
  outline: none;
  cursor: pointer;
}
.tSel:hover { border-color: var(--gold2); color: var(--gold); }
.card .cScore {
  position: absolute;
  right: 7px;
  top: 5px;
  font-size: 9.5px;
  color: var(--dim2);
  font-variant-numeric: tabular-nums;
}
.card .cNew {
  position: absolute;
  right: 6px;
  bottom: 4px;
  font-size: 8.5px;
  color: #06110c;
  background: var(--sc);
  border-radius: 3px;
  padding: 0 4px;
  font-weight: 700;
}

.emptyTip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  color: var(--dim2);
  font-size: 12px;
  letter-spacing: 2px;
  text-align: center;
}
.emptyTip .etIcon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line2);
  display: grid;
  place-items: center;
  font-family: "Noto Serif SC", serif;
  font-size: 17px;
  color: #7f9a8b;
  background: radial-gradient(circle at 50% 35%, rgba(60, 110, 84, 0.5), rgba(8, 22, 15, 0.6));
}
.emptyTip .etSub { font-size: 10.5px; letter-spacing: 1px; color: #58705f; }

/* 商店 */
/* 灵石阁：一格一个增益，横向排列（和背包同一种网格） */
.buffGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 8px;
  align-content: start;
}
.buffCard {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 9px 9px;
  border-radius: 10px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--bc, #9fb0a8);
  background: linear-gradient(180deg, rgba(18, 40, 29, 0.92), rgba(9, 24, 17, 0.9));
  transition: 0.16s;
  overflow: hidden;
}
.buffCard::after {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 80px;
  background: radial-gradient(140px 70px at 20% 0%, var(--bc, #9fb0a8), transparent 70%);
  opacity: 0.14;
  pointer-events: none;
}
.buffCard:hover { border-color: var(--line2); transform: translateY(-1px); }
.buffCard.maxed { opacity: 0.82; }

.buffCard .bcHead {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.buffCard .bcIcon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-family: "Noto Serif SC", serif;
  font-size: 13px;
  color: var(--bc, var(--gold));
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(8, 22, 15, 0.55);
  flex: none;
}
.buffCard .bcLv {
  font-size: 9.5px;
  color: var(--dim);
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.buffCard .bcLv i { font-style: normal; opacity: 0.55; }
.buffCard .bcName {
  position: relative;
  font-family: "Noto Serif SC", serif;
  font-size: 12.5px;
  color: #eaf6ea;
  letter-spacing: 0.8px;
  margin-top: 1px;
}
.buffCard .bcDesc {
  position: relative;
  font-size: 9.5px;
  line-height: 1.45;
  color: var(--dim);
}
.buffCard .bcVal {
  position: relative;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px;
  font-size: 10.5px;
  color: #8fa89a;
  margin-top: 1px;
}
.buffCard .bcVal em { font-style: normal; opacity: 0.45; }
.buffCard .bcVal b { color: #9be8b0; font-weight: 600; }

.bcBuy {
  position: relative;
  margin-top: 4px;
  width: 100%;
  height: 27px;
  border-radius: 8px;
  border: 1px solid var(--line2);
  background: linear-gradient(180deg, rgba(40, 74, 54, 0.9), rgba(14, 34, 24, 0.95));
  color: var(--txt);
  font-size: 10.5px;
  font-family: inherit;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: 0.16s;
  -webkit-tap-highlight-color: transparent;
}
.bcBuy:hover:not(:disabled) { border-color: var(--gold2); color: var(--gold); }
.bcBuy:active:not(:disabled) { transform: scale(0.98); }
.bcBuy:disabled { opacity: 0.4; cursor: default; }
.bcBuy.max { color: var(--gold2); border-color: rgba(230, 200, 140, 0.35); opacity: 1; }

/* ============================================================
   装扮三栏（独立页签）：人物立绘 / 神兵 / 配色
   每个页签只放一类，网格铺满整栏，不再纵向堆三段
   ============================================================ */
/* 页签行右侧：在用小字（不占 pane 高度，网格能多露一行） */
.lookNow {
  display: flex;
  align-items: baseline;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(8, 22, 15, 0.62);
  font-size: 9.5px;
  color: var(--dim);
  white-space: nowrap;
}
.lookNow b {
  font-family: "Noto Serif SC", serif;
  font-size: 12px;
  letter-spacing: 0.6px;
}
.lnK { font-size: 9px; letter-spacing: 1.5px; opacity: 0.85; }
.lnSub { font-size: 9px; opacity: 0.66; }
.lookNow i {
  font-style: normal;
  font-size: 9px;
  opacity: 0.75;
  padding-left: 5px;
  border-left: 1px solid var(--line2);
}

.lookGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
}
/* 单栏展示后空间更宽，三类各自给一档更合适的尺寸 */
/* 人物卡要能整张塞进固定高度（244）的底栏里：缩略图与描述都按这个预算给 */
.lgChar { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 9px; }
.lgChar .lkThumb { height: 96px; }
.lgChar .lkThumb img { height: 88px; }
.lgChar .lkTag { min-height: 20px; }
.lgWp {
  grid-template-columns: repeat(auto-fill, minmax(126px, 170px));
  justify-content: center;
  gap: 8px;
}
.lgWp .lkIcon { height: 54px; font-size: 23px; }
.lgSk {
  grid-template-columns: repeat(auto-fill, minmax(112px, 148px));
  justify-content: center;
  gap: 8px;
}
.lgSk .lkIcon.dot { width: 50px; height: 50px; margin: 12px auto 2px; }

.lookCard {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--lk, #9fb0a8);
  background: linear-gradient(180deg, rgba(18, 40, 29, 0.92), rgba(9, 24, 17, 0.9));
  overflow: hidden;
  transition: 0.16s;
}
.lookCard:not(.owned) { opacity: 0.86; }
.lookCard.on {
  box-shadow: 0 0 0 1px var(--lk, #9fb0a8), 0 0 20px -6px var(--lk, #9fb0a8);
}

/* 立绘缩略图 */
.lkThumb {
  position: relative;
  height: 118px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 92%, rgba(120, 200, 150, 0.16), transparent 72%),
    linear-gradient(180deg, rgba(6, 18, 12, 0.5), rgba(6, 18, 12, 0.1));
}
.lkThumb img {
  height: 106px;
  width: auto;
  max-width: 96%;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.55));
  transition: 0.18s;
}
.lookCard.on .lkThumb img { filter: drop-shadow(0 0 12px var(--lk, #ffe6a8)); }
.lookCard:hover .lkThumb img { transform: translateY(-2px); }

/* 神兵 / 衣色的色块图标 */
.lkIcon {
  height: 52px;
  margin: 8px 8px 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-family: "Noto Serif SC", serif;
  font-size: 21px;
  font-weight: 700;
  color: #07120c;
  letter-spacing: 0;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.45), 0 0 14px -6px var(--lk, #9fb0a8);
}
.lkIcon.dot {
  width: 40px;
  height: 40px;
  margin: 12px auto 0;
  border-radius: 50%;
  font-size: 0;
}

.lkBody {
  padding: 6px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.lkNameRow { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.lkName {
  font-family: "Noto Serif SC", serif;
  font-size: 12.5px;
  color: #eaf6ee;
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lkBadge { font-size: 8.5px; color: var(--dim); letter-spacing: 0.3px; white-space: nowrap; }
.lookCard.on .lkBadge { color: var(--lk, var(--gold)); }
.lkTag {
  font-size: 9px;
  line-height: 1.35;
  color: var(--dim);
  min-height: 24px;
}
.lkBody .bcBuy { margin-top: 3px; height: 26px; font-size: 10.5px; }

/* 日志 */
.logList { display: flex; flex-direction: column; gap: 1px; }
.logLine {
  display: flex;
  gap: 8px;
  font-size: 11px;
  line-height: 1.65;
  padding: 1px 4px;
  border-radius: 4px;
}
.logLine:hover { background: rgba(120, 200, 150, 0.06); }
.logLine time { color: var(--dim2); font-variant-numeric: tabular-nums; flex: none; }
.logLine span { color: #b8cabd; }

/* 图鉴 */
.codex { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 6px; }
.codexCard {
  border-radius: 9px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--rc, #9fb0a8);
  background: rgba(10, 26, 18, 0.72);
  padding: 7px 9px;
}
.codexCard h4 {
  font-family: "Noto Serif SC", serif;
  font-size: 12px;
  color: var(--rc);
  letter-spacing: 2px;
  font-weight: 700;
  display: flex;
  align-items: baseline;
  gap: 5px;
}
/* 境序号（00~30）与境界别称 */
.codexCard .cIdx {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 9px;
  letter-spacing: 0;
  color: #4f6a5c;
  font-weight: 400;
}
.codexCard .cT {
  margin-left: auto;
  font-size: 9px;
  letter-spacing: 1px;
  font-weight: 400;
  color: var(--dim);
}
.codexCard .cNow { color: #f2d79a; }
.codexCard p { font-size: 10px; color: var(--dim); margin-top: 2px; line-height: 1.6; }
.codexCard .cv { color: #d8e8dc; }

/* ============================================================
   弹窗
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 8, 5, 0.72);
  backdrop-filter: blur(6px);
  display: none;
  place-items: center;
  z-index: 100;
}
.modal.on { display: grid; }
@keyframes fadeIn { from { opacity: 0; } }
.modalBox {
  width: min(440px, 88vw);
  /* 转生弹窗行数较多，小屏时允许内部滚动，别把按钮挤出屏幕 */
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 16px;
  border: 1px solid var(--line2);
  background: linear-gradient(180deg, rgba(22, 48, 34, 0.98), rgba(8, 22, 15, 0.99));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(230, 200, 140, 0.12);
  padding: 22px;
  animation: modalIn 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}
/* 只做位移缩放，不用透明度：动画被暂停时内容依然可见 */
@keyframes modalIn { from { transform: translateY(14px) scale(0.97); } }
.modalBox h2 {
  font-family: "Noto Serif SC", serif;
  font-size: 18px;
  letter-spacing: 4px;
  color: var(--gold);
  text-align: center;
  margin-bottom: 12px;
  text-shadow: 0 0 20px rgba(230, 190, 120, 0.35);
}
.modalBox p { font-size: 12px; line-height: 1.85; color: var(--txt); }
.modalBox .mRow {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid rgba(150, 205, 165, 0.1);
  font-size: 12px;
}
.modalBox .mRow span { color: var(--dim); }
.modalBox .mRow b { color: #eaf6ea; }
.modalBox .mBtns { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.mBtn {
  flex: 1 1 96px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line2);
  background: rgba(14, 34, 24, 0.9);
  color: var(--txt);
  font-size: 12px;
  letter-spacing: 2px;
  cursor: pointer;
  font-family: inherit;
  transition: 0.18s;
}
.mBtn:hover { border-color: var(--gold2); color: var(--gold); }
.mBtn.primary {
  background: linear-gradient(180deg, #f0d9a0, #c9a45f);
  color: #1b1206;
  border-color: #e7c98a;
  font-weight: 700;
}
.mBtn.primary:hover { filter: brightness(1.08); }
.mBtn.danger { border-color: rgba(255, 120, 100, 0.4); color: #ff9d8a; }
.mBtn:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.4); }
.modalBox .mNote {
  margin-top: 12px;
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--dim2);
  text-align: center;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}

/* 账号弹窗 */
.modalBox .mTip {
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--dim2);
  text-align: center;
  margin-bottom: 4px;
}
/* 兑换码弹窗 */
.cdkList {
  margin-top: 8px;
  max-height: 260px;
  overflow: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
/* 窄屏放不下一行两卡时自动回落成单列 */
@media (max-width: 560px) {
  .cdkList { grid-template-columns: 1fr; max-height: 220px; }
}
.cdkCard {
  border: 1px solid var(--line2);
  border-radius: 10px;
  padding: 7px 10px;
  background: linear-gradient(180deg, rgba(38, 56, 44, 0.9), rgba(16, 28, 22, 0.92));
  cursor: pointer;
  transition: border-color 0.16s, transform 0.16s;
}
.cdkCard:hover { border-color: var(--gold2); transform: translateY(-1px); }
.cdkCard.done { opacity: 0.5; cursor: default; }
.cdkCard.done:hover { transform: none; border-color: var(--line2); }
.cdkHead {
  margin-top: 10px;
  font-size: 10.5px;
  color: var(--dim);
  letter-spacing: 0.5px;
}
.cdkHead:empty { display: none; }
.cdkCode {
  font-family: Consolas, Menlo, monospace;
  font-size: 13px;
  letter-spacing: 1.5px;
  color: #ffe6a8;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cdkCode i {
  font-style: normal;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 6px;
  color: #0f1a15;
  background: linear-gradient(180deg, #ffe28a, #f0b74e);
}
.cdkName { font-size: 12px; font-weight: 700; color: #dceee2; margin-top: 2px; }
.cdkDesc { font-size: 11px; color: var(--dim); }
.mini { font-size: 10.5px; color: var(--dim2); text-align: center; padding: 6px 0; }

.mInput {
  width: 100%;
  height: 34px;
  margin-top: 8px;
  border-radius: 9px;
  border: 1px solid var(--line2);
  background: rgba(8, 22, 15, 0.92);
  color: #eaf6ea;
  padding: 0 10px;
  font-family: inherit;
  font-size: 12px;
  outline: none;
  letter-spacing: 1px;
}
.mInput:focus { border-color: var(--gold2); }
.mInput::placeholder { color: #5f7a6c; }
.mCode {
  width: 100%;
  height: 62px;
  margin-top: 6px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(6, 18, 12, 0.94);
  color: #9fd8bd;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10px;
  line-height: 1.5;
  padding: 6px;
  resize: none;
  outline: none;
  word-break: break-all;
}
.mCodeIn { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }

/* 滚动条 */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(140, 190, 160, 0.22);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(160, 210, 180, 0.4); }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1080px) {
  .main { grid-template-columns: minmax(0, 1fr) 268px; }
}

@media (max-width: 860px) {
  html, body { overflow-y: auto; overflow-x: hidden; }
  #app { height: auto; min-height: 100vh; grid-template-rows: auto auto auto auto; }
  .topbar { flex-wrap: wrap; height: auto; padding: 8px 10px; gap: 8px; }
  .brand { font-size: 16px; letter-spacing: 2px; }
  /* 窄屏不再绝对居中，跟资源栏挤在同一行，省一行高度 */
  .resGroup {
    display: flex;
    flex: 1 1 100%;
    order: 4;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
  }
  .powerBox { position: static; transform: none; order: 0; height: 34px; padding: 0 14px 0 0; margin: 0; }
  .powerBox b { font-size: 20px; }
  .powerBox .ic { width: 18px; height: 18px; }
  .pwLogo { width: 34px; height: 34px; margin-right: 4px; }
  .pwLabel { font-size: 11px; letter-spacing: 0; }
  .res { margin: 0; width: auto; flex: 0 0 auto; order: 0; }
  .resItem { flex: 1; justify-content: center; }
  .main { grid-template-columns: minmax(0, 1fr); }
  .stage { aspect-ratio: 1.42; min-height: 250px; }
  .side { flex-direction: column; overflow: visible; gap: 8px; }
  .side .panel { min-width: 0; width: 100%; }
  .statPanel { min-height: 0; max-height: 220px; }
  /* 底栏高度不随页签变化（lookMode 加高已废弃），上面的画面才不会被拉伸 */
  .bottom { height: 288px; }
  .tabs { flex-wrap: wrap; row-gap: 4px; }
  .tab { padding: 0 10px; letter-spacing: 1px; font-size: 11px; }
  .tabTools { flex: 1 1 100%; justify-content: flex-end; margin: 0; padding: 0; }
  .tabTools .tBtn { font-size: 10px; padding: 0 7px; letter-spacing: 0; height: 26px; }
  .pane { border-radius: 10px; }
  .buffGrid { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 6px; }
  .lookGrid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
  .lgChar { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); }
  .lgChar .lkThumb { height: 112px; }
  .lgChar .lkThumb img { height: 102px; }
  .lgWp .lkIcon { height: 48px; font-size: 20px; }
  .lnSub { display: none; }
  .lkThumb { height: 96px; }
  .lkThumb img { height: 86px; }
  .lkIcon { height: 44px; margin: 6px 6px 0; font-size: 18px; }
  .lkBody { padding: 5px 7px 7px; }
  .lkName { font-size: 12px; }
  .lkTag { font-size: 8.5px; min-height: 22px; }
  .buffCard { padding: 7px 8px 8px; }
  .bcBuy { height: 32px; font-size: 11px; }
  .equipGrid { grid-template-columns: 1fr 1fr 1fr; }
  .slot { height: 62px; }
  .skills { gap: 7px; bottom: 10px; }
  .skill { width: 46px; height: 46px; border-radius: 12px; }
  .skill .sIcon { font-size: 18px; }
  .skill .sKey { font-size: 8px; }
  .toasts { top: 70px; right: 8px; }
  .combo b { font-size: 32px; }
}

@media (max-width: 560px) {
  .buffGrid { grid-template-columns: 1fr 1fr; }
  /* 手机上下留白更金贵：底栏给高一点，一屏能看到两排增益（高度同样恒定） */
  .bottom { height: 332px; }
  /* 提示文字挪到技能条上方，避免和 QWERT 图标叠住 */
  .hint { bottom: 68px; left: 10px; font-size: 10.5px; letter-spacing: 0; }
  .buffCard .bcName { font-size: 12px; letter-spacing: 0.4px; }
  .buffCard .bcDesc { font-size: 9px; }
  .buffCard .bcVal { font-size: 10px; }
  .buffCard .bcIcon { width: 24px; height: 24px; font-size: 12px; }
  .bcBuy { height: 34px; }
  .pane { padding: 8px; }
  .tabs { gap: 2px; }
  .tab { padding: 0 8px; }
}

/* ============================================================
   启动门：进入游戏前必须立道号
   ============================================================ */
.gate {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(1100px 620px at 50% 22%, rgba(34, 92, 68, 0.55), transparent 68%),
    radial-gradient(800px 500px at 50% 100%, rgba(20, 52, 38, 0.6), transparent 70%),
    linear-gradient(180deg, #07120d 0%, #040b08 100%);
}
.gate::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(120, 190, 150, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 190, 150, 0.045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 45%, #000 30%, transparent 78%);
  pointer-events: none;
}
.gate.out { animation: gateOut 0.2s ease both; }
@keyframes gateOut { to { opacity: 0; } }

.gateCard {
  position: relative;
  width: min(392px, 92vw);
  padding: 26px 24px 18px;
  border-radius: 16px;
  border: 1px solid rgba(150, 205, 165, 0.18);
  background:
    linear-gradient(180deg, rgba(21, 46, 33, 0.97), rgba(8, 22, 15, 0.98));
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.62),
    inset 0 1px 0 rgba(200, 240, 210, 0.09);
  animation: gateIn 0.26s cubic-bezier(0.2, 0.9, 0.3, 1.1) both;
}
@keyframes gateIn {
  from { transform: translateY(14px) scale(0.975); }
}
.gateCard.shake { animation: gateShake 0.32s ease; }
@keyframes gateShake {
  0%, 100% { transform: translateX(0); }
  22% { transform: translateX(-6px); }
  48% { transform: translateX(5px); }
  72% { transform: translateX(-3px); }
}

.gateBrand {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 26px;
  letter-spacing: 5px;
  text-align: center;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(242, 215, 154, 0.28);
}
.gateBrand em {
  font-style: normal;
  color: var(--gold2);
  margin: 0 1px;
  opacity: 0.85;
}
.gateSub {
  margin: 8px 0 18px;
  text-align: center;
  font-size: 10.5px;
  letter-spacing: 3px;
  color: #6e8a7b;
}

.gateTabs {
  display: flex;
  gap: 6px;
  padding: 3px;
  margin-bottom: 4px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(6, 18, 12, 0.7);
}
.gateTab {
  flex: 1;
  height: 30px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--dim);
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: background 0.16s, color 0.16s;
}
.gateTab.on {
  background: linear-gradient(180deg, rgba(64, 120, 90, 0.55), rgba(30, 66, 46, 0.55));
  color: #eaf6e4;
  box-shadow: inset 0 1px 0 rgba(210, 245, 220, 0.12);
}

.gateErr {
  min-height: 16px;
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: 0.6px;
  color: #ff9d7a;
  text-align: center;
}

.gateGo {
  width: 100%;
  height: 38px;
  margin-top: 8px;
  font-size: 13px;
  letter-spacing: 2px;
}

.gateFoot {
  margin-top: 14px;
  font-size: 10px;
  line-height: 1.85;
  color: #5f7a6c;
  text-align: center;
  letter-spacing: 0.4px;
}

.gateSkip {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 7px 0;
  border: 0;
  border-top: 1px dashed rgba(150, 205, 165, 0.14);
  background: transparent;
  color: #7b9486;
  font-family: inherit;
  font-size: 10.5px;
  letter-spacing: 0.6px;
  cursor: pointer;
}
.gateSkip:hover { color: var(--gold); }
.gateSkip[hidden] { display: none; }

/* ---------------- 载入遮罩（登录后、画面就绪前） ---------------- */
.bootMask {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 42%, #0d2118 0%, var(--bg) 70%);
  transition: opacity 0.35s ease;
}
.bootMask.off { opacity: 0; pointer-events: none; }
.bmInner { text-align: center; }
.bmInner b {
  display: block;
  font-size: 22px;
  letter-spacing: 5px;
  color: var(--gold);
  text-shadow: 0 0 22px rgba(242, 215, 154, 0.35);
}
.bmInner span {
  display: block;
  margin-top: 12px;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--dim);
  animation: bmBreath 1.6s ease-in-out infinite;
}
@keyframes bmBreath {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}
