:root {
  --bg: #0d0f13;
  --bg2: #141821;
  --panel: #171c26;
  --line: #262d3a;
  --ink: #c9d1dc;
  --dim: #6b7787;
  --amber: #d8a24a;
  --amber-dim: #7a5c2a;
  --blood: #a8342f;
  --moss: #6f9a5a;
  --boss: #8a4fd0;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at 50% -20%, #1b2230 0%, var(--bg) 55%);
  color: var(--ink);
  font: 14px/1.55 "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#app { max-width: 1180px; margin: 0 auto; padding: 22px 20px 60px; }

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: .04em; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding-bottom: 14px; margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  min-height: 44px;
}
.brand { display: flex; align-items: center; }
/* 旧品牌图已弃用 */
.brand-fallback { font-size: 20px; color: var(--amber); font-weight: 600; letter-spacing: .1em; }
.topbar .tag { font-size: 12px; color: var(--dim); }
.topbar .spacer { flex: 1; }
.topbar .gold { font-size: 14px; color: var(--amber); font-variant-numeric: tabular-nums; }

/* ---------- 立绘 ---------- */
.portrait {
  height: 168px;
  margin: -4px -6px 8px;
  display: flex; align-items: flex-end; justify-content: center;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 88%, rgba(216,162,74,.16) 0%, transparent 62%);
}
.portrait img {
  height: 168px; width: auto; max-width: 100%;
  object-fit: contain; object-position: bottom center;
  display: block;
}
.portrait-fallback {
  font-size: 34px; color: #3a4557; font-weight: 600;
  align-self: center;
}
.portrait.small {
  height: 46px; width: 46px; margin: 0; flex: 0 0 46px;
  background: none;
}
.unit { display: flex; gap: 9px; align-items: center; }
.unit-info { flex: 1; min-width: 0; }

.hint { color: var(--dim); font-size: 12px; margin: 0 0 16px; }

/* ---------- 通用 ---------- */
button {
  font: inherit; color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 14px;
  cursor: pointer;
  transition: .12s;
}
button:hover:not(:disabled) { border-color: var(--amber-dim); color: #fff; }
button:disabled { opacity: .35; cursor: not-allowed; }
button.primary { border-color: var(--amber-dim); color: var(--amber); }
button.primary:hover:not(:disabled) { background: #221a0e; }
button.ghost { background: transparent; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- 营地 ---------- */
.roster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  position: relative;
  cursor: pointer;
  transition: .12s;
}
.card:hover { border-color: #3a4557; }
.card.picked { border-color: var(--amber); background: #1d1a12; }
.card.picked::after {
  content: "出阵"; position: absolute; top: 8px; right: 10px;
  font-size: 10px; color: var(--amber); letter-spacing: .1em;
}
.card .name { font-size: 15px; margin-bottom: 2px; }
.card .cls { font-size: 11px; color: var(--amber); letter-spacing: .08em; }
.card .stats {
  margin-top: 8px; font-size: 11px; color: var(--dim);
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px;
  font-variant-numeric: tabular-nums;
}
.card .vet { color: var(--moss); font-size: 11px; margin-top: 6px; }

.section-title {
  font-size: 12px; letter-spacing: .18em; color: var(--dim);
  margin: 26px 0 10px; text-transform: uppercase;
}

.hire {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.hire button { font-size: 12px; padding: 6px 11px; }

/* ---------- 战斗 ---------- */
.run {
  display: grid;
  grid-template-columns: 240px 1fr 190px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .run { grid-template-columns: 1fr; }
}

.unit {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 11px;
  margin-bottom: 8px;
}
.unit.dead { opacity: .34; border-color: var(--blood); }
.unit .head { display: flex; justify-content: space-between; font-size: 13px; }
.unit .head .hp { color: var(--dim); font-size: 11px; font-variant-numeric: tabular-nums; }

.bar { height: 5px; background: #0a0c10; border-radius: 3px; margin-top: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--moss); transition: width .18s linear; }
.bar.foe > i { background: var(--blood); }
.bar.boss > i { background: var(--boss); }

.rooms { display: flex; gap: 6px; margin-bottom: 14px; }
.rooms .r {
  flex: 1; height: 26px; border: 1px solid var(--line); border-radius: 5px;
  display: grid; place-items: center; font-size: 11px; color: var(--dim);
  background: #10141b;
}
.rooms .r.done { border-color: var(--moss); color: var(--moss); background: #141a12; }
.rooms .r.now { border-color: var(--amber); color: var(--amber); background: #1d1a12; }
.rooms .r.boss-now { border-color: var(--boss); color: var(--boss); }

.enemies { display: flex; gap: 10px; flex-wrap: wrap; min-height: 74px; }
.enemies .unit { flex: 1 1 150px; margin: 0; }

.log {
  margin-top: 14px; height: 300px; overflow-y: auto;
  background: #0a0c10; border: 1px solid var(--line); border-radius: 7px;
  padding: 10px 12px; font-size: 12px; line-height: 1.75;
  font-variant-numeric: tabular-nums;
}
.log div { color: var(--dim); }
.log .hit { color: #8f9aa8; }
.log .crit { color: var(--amber); }
.log .kill { color: var(--moss); }
.log .die { color: var(--blood); }
.log .sys { color: #46536b; letter-spacing: .06em; }
.log .boss { color: var(--boss); }

.stats { font-size: 12px; }
.stats .k { color: var(--dim); }
.stats .v { color: var(--ink); font-variant-numeric: tabular-nums; }
.stats ul { list-style: none; padding: 0; margin: 0; }
.stats li { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed #1e2530; }

/* ---------- 战报 ---------- */
.report {
  border: 34px solid transparent;
  border-image: url(assets/panel.webp) 24% fill / 34px / 0 stretch;
  background: none;
  padding: 26px 34px 30px;
}
.report h2 { font-size: 17px; color: var(--amber); margin-bottom: 4px; }
.report .sub { color: var(--dim); font-size: 12px; margin-bottom: 18px; }
.report table { width: 100%; border-collapse: collapse; font-size: 12px; margin: 8px 0 18px; }
.report th { text-align: left; color: var(--dim); font-weight: 400; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.report td { padding: 7px 8px; border-bottom: 1px solid #1c222c; }
.report .dead { color: var(--blood); }
.report .alive { color: var(--moss); }

/* ================= 新手指引 / 抽卡 / 战斗播片 ================= */

.big { padding: 12px 26px; font-size: 15px; }
.kicker {
  color: var(--dim); font-size: 13px; line-height: 1.9;
  max-width: 620px; margin: 0 auto 26px; text-align: center;
}
.big-brand { display: flex; justify-content: center; margin: 26px 0 6px; }
/* 旧品牌图已弃用 */

/* 创角 */
.create-wrap { max-width: 720px; margin: 0 auto; text-align: center; }
.pick-row { display: flex; gap: 22px; justify-content: center; margin-bottom: 26px; }
.pick-figure {
  width: 190px; padding: 14px 0 10px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--dim); transition: .16s;
}
.pick-figure:hover { border-color: #3a4557; }
.pick-figure.picked {
  border-color: var(--amber); color: var(--amber);
  box-shadow: 0 0 0 1px rgba(216,162,74,.25), 0 0 34px -10px rgba(216,162,74,.55);
}
.hood { width: 128px; height: 178px; display: block; }
.hood g { filter: drop-shadow(0 8px 18px rgba(0,0,0,.6)); }
.pick-figure.picked .hood ellipse { fill: #160d05; }

.name-row { margin: 0 auto 22px; max-width: 340px; }
.name-input {
  width: 100%; padding: 12px 16px; font: inherit; font-size: 15px;
  background: #0a0c10; color: var(--ink);
  border: 1px solid var(--line); border-radius: 7px; text-align: center;
  letter-spacing: .12em;
}
.name-input:focus { outline: none; border-color: var(--amber-dim); }

/* 剧情占位 */
.story-wrap {
  min-height: 70vh; display: grid; place-items: center;
}
.story-card {
  max-width: 560px; padding: 36px 40px; text-align: left;
  background: linear-gradient(180deg, rgba(23,28,38,.9), rgba(13,15,19,.9));
  border: 1px solid var(--line); border-radius: 10px;
}
.story-line { margin: 0 0 16px; font-size: 15px; line-height: 2; color: var(--ink); }
.story-line.dim { color: #4b5768; font-size: 13px; }
.story-card .big { margin-top: 12px; width: 100%; }

/* 抽卡 */
.gacha-wrap { max-width: 560px; margin: 0 auto; text-align: center; }
.gacha-box { min-height: 400px; display: grid; place-items: center; margin-bottom: 22px; }
.row.center { justify-content: center; }

.gcard {
  width: 260px; border-radius: 12px; padding: 2px;
  background: linear-gradient(160deg, #6f5a2e, #2a2333 55%, #4b3a63);
  transition: transform .45s cubic-bezier(.2,.9,.3,1), box-shadow .45s;
  box-shadow: 0 0 60px -18px rgba(216,162,74,.75);
}
.gcard.landed { box-shadow: 0 0 90px -14px rgba(216,162,74,.95); }
.gcard-inner {
  background: #0f1218; border-radius: 10px; padding: 16px 14px 14px;
  display: flex; flex-direction: column; align-items: center;
}
.gcard-art {
  height: 300px; width: 100%; display: flex; align-items: flex-end; justify-content: center;
  background: radial-gradient(ellipse at 50% 92%, rgba(216,162,74,.17), transparent 64%);
}
.gcard-art img { max-height: 100%; max-width: 100%; }
.gcard-meta { text-align: center; margin-top: 10px; }
.rarity { font-size: 11px; letter-spacing: .28em; color: var(--amber); }
.rarity.sr { color: #d8a24a; text-shadow: 0 0 14px rgba(216,162,74,.7); }
.gcard-name { font-size: 17px; margin: 6px 0 2px; }
.gcard-cls { font-size: 11px; color: var(--dim); }

/* 战斗播片 */
.battle-controls { display: flex; align-items: center; margin-bottom: 12px; }
.battle-host { position: relative; }
.stage {
  position: relative; height: 480px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(6,8,12,.30), rgba(6,8,12,.52)),
    var(--bg, url(assets/bg_battle.webp)) center 62% / cover no-repeat,
    linear-gradient(180deg, #0b0e13, #070809);
}
.stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 55%, transparent 46%, rgba(0,0,0,.55) 100%);
}
.side {
  position: absolute; bottom: 46px; width: 47%;
  display: flex; flex-direction: row; align-items: flex-end;
  z-index: 2;
}
.side.allies { left: 2%; justify-content: flex-start; }
.side.foes { right: 2%; justify-content: flex-end; }

.fighter {
  position: relative; width: 168px; text-align: center;
  transition: transform .2s cubic-bezier(.2,.9,.3,1), opacity .35s;
}
.fighter.attacking { transform: translateX(var(--lunge, 0)); }
.fighter.dead { opacity: .22; }

.fig { height: 156px; display: flex; align-items: flex-end; justify-content: center; }
.fig.has-art img { height: 156px; width: auto; max-width: 160px; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0,0,0,.7)); }
.fig.stand .glyph {
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; font-size: 20px;
  background: radial-gradient(circle at 35% 30%, #3a2222, #180d0d);
  border: 1px solid #4a2a2a; color: #c98a6a;
}
.fighter.enemy .fig.stand .glyph {
  background: radial-gradient(circle at 35% 30%, #2a1c2e, #120a16);
  border-color: #3a2a44; color: #a98ac0;
}
.fighter.boss .fig.stand .glyph {
  width: 76px; height: 76px; font-size: 28px;
  border-color: var(--boss); color: #c9a3f0;
  box-shadow: 0 0 30px -8px var(--boss);
}
.fig.struck { animation: struck .22s ease-out; }
@keyframes struck {
  0% { filter: brightness(2.6); transform: translateX(-4px); }
  100% { filter: none; transform: none; }
}

.fname { font-size: 11px; color: var(--dim); margin-top: 5px; }
.fighter.ally .fname { color: #93a0b1; }
.hpbar { height: 4px; background: #05070a; border-radius: 2px; margin-top: 4px; overflow: hidden; }
.hpbar i { display: block; height: 100%; background: var(--blood); transition: width .18s linear; }
.fighter.ally .hpbar i { background: var(--moss); }

.room-banner {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  font-size: 13px; letter-spacing: .3em; color: var(--amber);
  opacity: 0; z-index: 3;
}
.room-banner.show { animation: banner 1.5s ease-out; }
@keyframes banner {
  0% { opacity: 0; transform: translate(-50%, -8px); }
  18% { opacity: 1; transform: translate(-50%, 0); }
  72% { opacity: 1; }
  100% { opacity: 0; }
}

.fx { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.slash {
  position: absolute; width: 86px; height: 4px; margin: -2px 0 0 -43px;
  background: linear-gradient(90deg, transparent, #fff, #ffd79a, transparent);
  border-radius: 2px; transform-origin: center;
  animation: slash .26s ease-out forwards;
  filter: drop-shadow(0 0 6px rgba(255,220,160,.9));
}
@keyframes slash {
  0% { opacity: 0; transform: rotate(var(--r, 0deg)) scaleX(.3); }
  35% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--r, 0deg)) scaleX(1.4); }
}
.dmg {
  position: absolute; transform: translate(-50%, 0);
  font-size: 17px; font-weight: 600; color: #f0e2cc;
  text-shadow: 0 2px 6px #000, 0 0 12px rgba(0,0,0,.9);
  animation: floatUp .9s ease-out forwards;
  font-variant-numeric: tabular-nums;
}
.dmg.crit { color: #ffd34d; font-size: 22px; }
.dmg.heal { color: var(--moss); }
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, 6px) scale(.8); }
  20% { opacity: 1; transform: translate(-50%, 0) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -46px) scale(1); }
}

.shake { animation: shake .13s linear; }
@keyframes shake {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-3px, 2px); }
  50% { transform: translate(3px, -2px); }
  75% { transform: translate(-2px, -1px); }
  100% { transform: none; }
}
.stage.win::after { background: radial-gradient(ellipse at 50% 55%, rgba(216,162,74,.18), rgba(0,0,0,.55) 100%); }

/* ---------- 营地卡片（无交互） ---------- */
.card.flat { cursor: default; }
.card .name { display: flex; align-items: baseline; gap: 8px; }
.card .name .rarity { font-size: 10px; letter-spacing: .2em; }

/* ================= 全屏营地 ================= */

body { background: #07090c; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0;
  background-image: url(assets/bg_camp.webp);
  background-size: cover; background-position: center 42%;
  filter: saturate(.95) brightness(.95);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 44%, transparent 22%, rgba(5,7,10,.28) 62%, rgba(5,7,10,.62) 100%),
    linear-gradient(180deg, rgba(5,7,10,.55) 0%, transparent 26%, rgba(5,7,10,.72) 100%);
}
#app {
  position: relative; z-index: 1;
  max-width: 1440px;
  height: 100vh;
  overflow: hidden;
  padding: 20px 26px 26px;
  display: flex; flex-direction: column;
}

/* 对比度提上来 */
:root { --ink: #e4ebf5; --dim: #93a1b3; }

.topbar { border-bottom-color: rgba(120,140,170,.18); }

.camp {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: 84px minmax(0,1fr) 330px;
  gap: 18px;
  align-items: stretch;
}

/* 左侧名册 */
.camp-rail {
  display: flex; flex-direction: column; gap: 10px;
  padding: 10px 0; align-items: center;
}
.crest {
  width: 66px; height: 76px; padding: 0; border-radius: 9px;
  background: rgba(16,20,27,.72); border: 1px solid rgba(120,140,170,.22);
  display: flex; align-items: flex-end; justify-content: center;
  overflow: hidden; position: relative; cursor: pointer; transition: .15s;
}
.crest:hover { border-color: rgba(216,162,74,.5); }
.crest.on {
  border-color: var(--amber);
  box-shadow: 0 0 0 1px rgba(216,162,74,.35), 0 0 26px -6px rgba(216,162,74,.75);
  background: rgba(28,24,16,.8);
}
.crest-art { height: 70px; display: flex; align-items: flex-end; justify-content: center; }
.crest-art img { height: 70px; width: auto; max-width: none; }
.crest-tag {
  position: absolute; top: 3px; left: 0; right: 0; text-align: center;
  font-size: 9px; letter-spacing: .16em; color: rgba(216,162,74,.9);
}

/* 中间大立绘 */
.camp-stage {
  position: relative; display: flex; align-items: flex-end; justify-content: center;
  min-height: 0; overflow: hidden;
}
.camp-stage::after {
  content: ""; position: absolute; left: 50%; bottom: 4%; transform: translateX(-50%);
  width: 62%; height: 90px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(216,162,74,.20), transparent 70%);
  filter: blur(10px); pointer-events: none;
}
.hero-art { height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.hero-art img {
  height: 100%; width: auto; max-width: 100%;
  filter: drop-shadow(0 18px 34px rgba(0,0,0,.75));
}

/* 右侧信息 */
.camp-side {
  display: flex; flex-direction: column;
  padding: 20px 22px;
  background: linear-gradient(180deg, rgba(18,22,30,.86), rgba(10,13,18,.9));
  border: 1px solid rgba(120,140,170,.18);
  border-radius: 12px;
  backdrop-filter: blur(6px);
  min-height: 0;
}
.hero-head { margin-bottom: 6px; }
.hero-head h2 {
  font-size: 28px; color: #fff; margin: 6px 0 2px; letter-spacing: .06em;
  text-shadow: 0 2px 16px rgba(0,0,0,.8);
}
.hero-cls { font-size: 12px; color: var(--amber); letter-spacing: .16em; }
.hero-note { font-size: 13px; color: var(--dim); margin: 10px 0 18px; line-height: 1.9; }
.hero-stats { list-style: none; padding: 0; margin: 0; }
.hero-stats li {
  display: flex; justify-content: space-between; padding: 9px 0;
  border-bottom: 1px dashed rgba(120,140,170,.16); font-variant-numeric: tabular-nums;
}
.hero-stats .k { color: var(--dim); font-size: 12px; }
.hero-stats .v { color: #fff; font-size: 15px; }
.camp-side .spacer { flex: 1; }
.camp-side .big { width: 100%; padding: 14px; letter-spacing: .1em; }

.empty-camp { display: grid; place-items: center; flex: 1; }

@media (max-width: 1100px) {
  .camp { grid-template-columns: 72px minmax(0,1fr); grid-template-rows: 1fr auto; }
  .camp-side { grid-column: 1 / -1; }
}

.hero-art .portrait-fallback { font-size: 90px; opacity: .12; }
.crest-art .portrait-fallback { font-size: 26px; opacity: .5; }


/* ---------- 技能演出 ---------- */
.slash.oil { background: linear-gradient(90deg, transparent, #ffd08a, #ff9a3c, transparent); }
.slash.snuff { background: linear-gradient(90deg, transparent, #ece2ff, #b48cff, transparent); }
.dmg.burn { color: #ff8a4c; font-size: 15px; }
.fig.skill-oil img, .fig.skill-oil .glyph { filter: drop-shadow(0 0 16px rgba(255,150,60,.95)); }
.fig.skill-snuff img, .fig.skill-snuff .glyph { filter: drop-shadow(0 0 18px rgba(180,140,255,.95)); }

/* ---------- 人物面板 ---------- */
.camp-head { margin-bottom: 12px; }
.camp-head .title { font-size: 12px; color: var(--amber); letter-spacing: .18em; margin-top: 2px; }
.camp-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.camp-tabs button {
  flex: 1; padding: 7px 0; font-size: 12px; letter-spacing: .1em;
  background: transparent; border: 1px solid rgba(120,140,170,.2); border-radius: 6px;
  color: var(--dim);
}
.camp-tabs button.on { color: var(--amber); border-color: var(--amber-dim); background: rgba(216,162,74,.08); }
.camp-body { flex: 1; min-height: 0; overflow-y: auto; padding-right: 4px; }
.camp-body::-webkit-scrollbar { width: 6px; }
.camp-body::-webkit-scrollbar-thumb { background: rgba(120,140,170,.25); border-radius: 3px; }

.sheet-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed rgba(120,140,170,.14); font-size: 13px; }
.sheet-row .k { color: var(--dim); }
.sheet-row .v { color: var(--ink); }
.sheet-block { margin-top: 16px; }
.sheet-block h4 { font-size: 11px; letter-spacing: .2em; color: var(--dim); margin: 0 0 8px; font-weight: 400; }
.sheet-block p { margin: 0; font-size: 13px; line-height: 1.95; color: var(--ink); }
.line-row { font-size: 13px; line-height: 1.9; color: var(--ink); margin-bottom: 8px; }
.line-row .who { color: var(--dim); font-size: 11px; margin-right: 8px; }

.skill-item { display: flex; gap: 11px; padding: 10px 0; border-bottom: 1px dashed rgba(120,140,170,.14); }
.skill-ico {
  width: 46px; height: 46px; flex: 0 0 46px; border-radius: 7px;
  background: rgba(10,13,18,.9); border: 1px solid rgba(120,140,170,.22);
  display: grid; place-items: center; overflow: hidden;
}
.skill-ico img { width: 100%; height: 100%; object-fit: cover; }
.skill-ico.empty { color: var(--amber-dim); font-size: 18px; }
.skill-txt { min-width: 0; }
.skill-name { font-size: 14px; color: #fff; }
.skill-name .kind { font-size: 10px; color: var(--amber); letter-spacing: .12em; margin-left: 8px; }
.skill-desc { font-size: 12px; color: var(--dim); line-height: 1.8; margin-top: 3px; }

/* ---------- 战斗布阵：一排站开 + 纵深错位 ---------- */
.fighter {
  width: 138px;
  margin-bottom: calc(var(--lane, 0) * 26px);
  z-index: calc(3 - var(--lane, 0));
}
.fighter.ally { margin-right: -18px; }
.fighter.enemy { margin-left: -18px; }
.fig { height: 132px; }
.fig.has-art img { height: 132px; max-width: 128px; }
.fig.stand .glyph { width: 58px; height: 58px; font-size: 22px; }
.fighter.boss .fig.stand .glyph { width: 88px; height: 88px; font-size: 30px; }

/* 脚下投影，让人物"站"在地上而不是飘着 */
.fig::after {
  content: ""; position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%);
  width: 74px; height: 13px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0,0,0,.62), transparent 72%);
  z-index: -1;
}

/* 队伍底色带，区分敌我 */
.stage::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 132px;
  background: linear-gradient(180deg, transparent, rgba(5,7,10,.72));
  pointer-events: none; z-index: 1;
}

/* 名条更清楚 */
.fname {
  font-size: 12px; margin-top: 6px; color: #c3cddb;
  text-shadow: 0 1px 4px #000;
}
.fighter.enemy .fname { color: #d9b8b8; }
.hpbar { height: 5px; box-shadow: 0 1px 3px rgba(0,0,0,.8); }

/* 战斗时不要营地的背景透出来 */
body:has(.battle-host)::before { background-image: none; }
body:has(.battle-host)::after { display: none; }

/* 战斗站位往里收，人物放大 */
.side.allies { left: 7%; }
.side.foes { right: 7%; }
.fighter { width: 152px; }
.fig { height: 150px; }
.fig.has-art img { height: 150px; max-width: 146px; }
.stage::after {
  background: radial-gradient(ellipse at 50% 58%, transparent 34%, rgba(0,0,0,.62) 100%);
}

/* 战斗占满视口 */
.battle-host { flex: 1; min-height: 0; }
.stage { height: 100%; min-height: 360px; }
.side { bottom: 60px; }
.stage::before { height: 150px; }

/* 双方靠拢，正中留出交手区 */
.side.allies { left: 16%; }
.side.foes { right: 16%; }
.fighter { width: 182px; }
.fig { height: 196px; }
.fig.has-art img { height: 196px; max-width: 176px; }
.fig.stand .glyph { width: 74px; height: 74px; font-size: 26px; }
.side { bottom: 52px; }

/* 敌方立绘压一点，融进暗场景 */
.fighter.enemy .fig.has-art img { filter: brightness(.78) contrast(1.06) drop-shadow(0 10px 18px rgba(0,0,0,.8)); }
.fighter.enemy.dead .fig.has-art img { filter: brightness(.4) grayscale(.5); }

/* ---------- 技能横幅 / 房间进度 / 终结技 ---------- */
.skill-call {
  position: absolute; left: 34px; top: 42%;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px 10px 10px;
  background: linear-gradient(90deg, rgba(20,16,10,.92), rgba(20,16,10,.55));
  border-left: 3px solid var(--amber);
  border-radius: 4px;
  opacity: 0; transform: translateX(-24px);
  transition: opacity .22s, transform .22s cubic-bezier(.2,.9,.3,1);
  pointer-events: none; z-index: 6;
}
.skill-call.show { opacity: 1; transform: none; }
.skill-call img {
  width: 42px; height: 42px; border-radius: 5px;
  border: 1px solid rgba(216,162,74,.5); object-fit: cover;
}
.skill-call .sc-name {
  font-size: 18px; color: #ffe3b0; letter-spacing: .12em;
  text-shadow: 0 2px 12px rgba(0,0,0,.9), 0 0 18px rgba(216,162,74,.5);
  white-space: nowrap;
}
.skill-call.snuff { border-left-color: #b48cff; }
.skill-call.snuff .sc-name { color: #e8dcff; text-shadow: 0 2px 12px #000, 0 0 20px rgba(180,140,255,.75); }
.skill-call.snuff img { border-color: rgba(180,140,255,.6); }

.room-dots {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 3;
}
.room-dots .dot {
  width: 26px; height: 3px; border-radius: 2px;
  background: rgba(150,165,190,.22); transition: .25s;
}
.room-dots .dot.done { background: var(--moss); }
.room-dots .dot.now { background: var(--amber); box-shadow: 0 0 10px rgba(216,162,74,.9); }

/* 终结技：画面压暗、只留招式 */
.stage.ult::after {
  background: radial-gradient(ellipse at 50% 55%, rgba(120,90,190,.22), rgba(0,0,0,.92) 78%) !important;
}
.stage.ult .fighter:not(.attacking) { filter: brightness(.45) saturate(.6); }
.stage.ult .dmg { color: #e6dcff; }

/* ---------- 补刀按钮 ---------- */
.ult-btn {
  margin-right: 10px; padding: 8px 18px;
  background: rgba(24,18,32,.9); border: 1px solid rgba(150,120,210,.4);
  color: #b9a6d8; letter-spacing: .1em; border-radius: 6px;
  transition: .18s;
}
.ult-btn.armed {
  color: #efe4ff; border-color: #b48cff;
  background: linear-gradient(180deg, rgba(90,60,150,.55), rgba(40,26,60,.9));
  box-shadow: 0 0 18px -4px rgba(180,140,255,.9);
  animation: armedPulse 1.1s ease-in-out infinite;
}
.ult-btn:disabled { opacity: .4; }
@keyframes armedPulse {
  0%,100% { box-shadow: 0 0 14px -6px rgba(180,140,255,.8); }
  50% { box-shadow: 0 0 26px -2px rgba(180,140,255,1); }
}

/* ---------- 连击 ---------- */
.combo {
  position: absolute; right: 40px; top: 34%;
  font-size: 26px; font-weight: 700; color: #ffd9a0;
  letter-spacing: .06em; text-shadow: 0 2px 10px #000, 0 0 20px rgba(255,190,120,.7);
  opacity: 0; transform: scale(.8); transition: .16s;
  pointer-events: none; z-index: 5;
}
.combo.show { opacity: 1; transform: scale(1); }

/* ---------- 台词气泡 ---------- */
.bubble {
  position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, 6px);
  padding: 5px 12px; border-radius: 10px; font-size: 12px; white-space: nowrap;
  background: rgba(14,17,23,.94); border: 1px solid rgba(150,165,190,.3);
  color: #dfe6ee; opacity: 0; transition: .18s; pointer-events: none; z-index: 7;
}
.bubble.show { opacity: 1; transform: translate(-50%, -6px); }
.bubble.ally { border-color: rgba(216,162,74,.45); color: #ffe3b0; }
.bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%) rotate(45deg);
  width: 8px; height: 8px; background: inherit; border-right: 1px solid rgba(150,165,190,.3);
  border-bottom: 1px solid rgba(150,165,190,.3);
}

/* ---------- 受击后退 ---------- */
.fig { transform: translateX(0); }
.fig.struck { animation: struck .22s ease-out; }
@keyframes struck {
  0% { filter: brightness(2.6); transform: translateX(var(--kb, 6px)); }
  100% { filter: none; transform: none; }
}

/* ---------- 收尾慢镜 ---------- */
.stage.finish::after {
  background: radial-gradient(ellipse at 50% 55%, transparent 20%, rgba(0,0,0,.8) 90%);
  transition: background .3s;
}

/* ---------- 技能条 ---------- */
.skill-bar { display: flex; gap: 8px; align-items: center; }
.auto-toggle {
  height: 40px; padding: 0 12px; font-size: 12px; letter-spacing: .1em;
  border-radius: 7px; border: 1px solid rgba(120,140,170,.25);
  background: rgba(16,20,27,.9); color: var(--dim);
}
.auto-toggle.on { color: var(--amber); border-color: var(--amber-dim); background: rgba(216,162,74,.1); }

.skill-btn {
  position: relative; width: 62px; height: 62px; padding: 0;
  border-radius: 9px; overflow: hidden; cursor: pointer;
  border: 1px solid rgba(120,140,170,.25);
  background: rgba(10,13,18,.9);
  transition: box-shadow .18s, border-color .18s;
}
.skill-btn img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  opacity: .45; filter: grayscale(.55); transition: .2s;
}
.skill-btn.ready img { opacity: 1; filter: none; }
.skill-btn.ready { border-color: var(--amber); box-shadow: 0 0 16px -5px rgba(216,162,74,.95); }
.skill-btn.ready::after {
  content: ""; position: absolute; inset: 0; border-radius: 9px;
  box-shadow: inset 0 0 14px rgba(216,162,74,.45);
  animation: readyPulse 1.3s ease-in-out infinite;
}
@keyframes readyPulse { 0%,100% { opacity: .35 } 50% { opacity: 1 } }
.skill-btn .cd {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(5,7,10,.72); color: #cfd8e4;
  font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums;
  opacity: 0; transition: opacity .15s;
}
.skill-btn .cd.show { opacity: 1; }
.skill-btn .sname {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-size: 9px; color: #e2e9f2; letter-spacing: .04em;
  background: linear-gradient(transparent, rgba(0,0,0,.88));
  padding: 8px 2px 3px; white-space: nowrap; overflow: hidden;
}
.skill-btn:disabled { cursor: default; }

/* ---------- 构图：把角色抬起来，压掉下半空洞 ---------- */
.side { bottom: 148px; }
.stage { background-position: center 42%; }
.stage::before {
  height: 190px;
  background: linear-gradient(180deg, transparent, rgba(4,6,9,.86));
}
.stage .room-dots { top: 22px; }
.dmg.big { font-size: 30px; color: #ffd0ff; text-shadow: 0 2px 10px #000, 0 0 22px rgba(200,140,255,.9); }

/* ================= 打击感 ================= */

/* 冲击环 */
.impact-ring {
  position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border-radius: 50%; border: 2px solid rgba(255,238,210,.95);
  box-shadow: 0 0 12px rgba(255,220,150,.8);
  animation: ringOut .42s cubic-bezier(.2,.8,.3,1) forwards;
  pointer-events: none;
}
.impact-ring.crit { border-color: #ffd34d; border-width: 3px; box-shadow: 0 0 22px rgba(255,200,60,.95); }
.impact-ring.skill { border-color: #ffb066; border-width: 3px; }
@keyframes ringOut {
  0% { transform: scale(.2); opacity: 1; }
  100% { transform: scale(4.6); opacity: 0; }
}

/* 火星 */
.impact-spark {
  position: absolute; width: 3px; height: 3px; margin: -1.5px 0 0 -1.5px;
  border-radius: 50%; background: #ffe8c4;
  box-shadow: 0 0 7px rgba(255,205,130,.95);
  animation: sparkOut .38s ease-out forwards;
  pointer-events: none;
}
@keyframes sparkOut {
  0% { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(.25); opacity: 0; }
}

/* 待机呼吸：立绘不再像贴纸 */
.fig { animation: breathe 2.6s ease-in-out infinite; }
.fighter:nth-child(2) .fig { animation-delay: -.8s; }
.fighter:nth-child(3) .fig { animation-delay: -1.6s; }
.fighter.dead .fig { animation: none; }
@keyframes breathe {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50% { transform: translateY(-3px) scaleY(1.006); }
}

/* 冲锋：出去快、回来慢，幅度加大 */
.fighter { transition: transform .24s cubic-bezier(.2,.9,.3,1); }
.fighter.attacking { transition: transform .1s cubic-bezier(.4,0,1,1); }

/* 站位靠拢 */
.side.allies { left: 23%; }
.side.foes { right: 23%; }

/* 数字更重 */
.dmg {
  font-size: 21px;
  text-shadow:
    0 0 2px #000, 0 2px 4px #000, 0 0 14px rgba(0,0,0,.9);
  -webkit-text-stroke: .6px rgba(0,0,0,.65);
}
.dmg.crit { font-size: 32px; -webkit-text-stroke: 1px rgba(0,0,0,.7); }
.dmg.big { font-size: 38px; }

/* 暴击闪白 */
.stage.flash::after { animation: flashOut .13s ease-out; }
@keyframes flashOut {
  0% { box-shadow: inset 0 0 70px 0 rgba(255,232,190,.22); }
  100% { box-shadow: inset 0 0 0 0 transparent; }
}

/* ================= 战斗：全宽 + 底部角色条 ================= */
body[data-screen="battle"] #app {
  max-width: none;
  padding: 8px 20px 14px;
  height: 100vh;
  overflow: hidden;
}
body[data-screen="battle"] .topbar { margin-bottom: 10px; padding-bottom: 8px; min-height: 34px; }
/* 旧品牌图已弃用 */

.battle-controls { margin-bottom: 8px; }
.battle-host { flex: 1; min-height: 0; }
.stage { height: 100%; }

/* 角色更大、按视口高度缩放 */
.fighter { width: clamp(150px, 17vh, 250px); }
.fig { height: clamp(150px, 22vh, 290px); }
.fig.has-art img { height: clamp(150px, 22vh, 290px); max-width: clamp(140px, 16vh, 240px); }
.side { bottom: clamp(60px, 8vh, 120px); }
.side.allies { left: 26%; }
.side.foes { right: 26%; }

/* 底部角色条 */
.battle-hud {
  display: flex; gap: 12px; padding: 10px 0 4px;
  overflow-x: auto; flex: 0 0 auto;
}
.hud-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 11px;
  background: linear-gradient(180deg, rgba(22,27,36,.94), rgba(12,15,20,.96));
  border: 1px solid rgba(120,140,170,.22);
  box-shadow: 0 8px 24px -12px #000;
  transition: .2s;
}
.hud-card.down { opacity: .45; filter: grayscale(.7); }
.hud-art {
  width: 54px; height: 64px; flex: 0 0 54px;
  display: flex; align-items: flex-end; justify-content: center;
  overflow: hidden; border-radius: 7px;
  background: radial-gradient(ellipse at 50% 90%, rgba(216,162,74,.2), rgba(10,13,18,.9) 70%);
}
.hud-art img { height: 64px; width: auto; max-width: none; }
.hud-art .glyph { font-size: 24px; color: #3f4a5c; }
.hud-meta { min-width: 96px; }
.hud-name { font-size: 13px; color: #e4ebf5; margin-bottom: 5px; }
.hud-hp { height: 5px; background: #05070a; border-radius: 3px; overflow: hidden; min-width: 90px; }
.hud-hp i { display: block; height: 100%; background: var(--moss); transition: width .18s linear; }
.hud-skills { display: flex; gap: 7px; }
.hud-skills .skill-btn { width: 46px; height: 46px; border-radius: 8px; }
.hud-skills .skill-btn .sname { font-size: 8px; padding: 6px 1px 2px; }
.hud-skills .skill-btn .cd { font-size: 16px; }

.auto-toggle { height: 34px; padding: 0 14px; margin-right: 8px; }

/* 收口：两侧再靠拢，底部留出走道 */
.side.allies { left: 30%; }
.side.foes { right: 30%; }
body[data-screen="battle"] #app { padding-bottom: 18px; }
.battle-hud { padding: 8px 0 0; }
.hud-card { min-height: 78px; }

/* 人物再放大、整体上移，压掉下半空档 */
.fig { height: clamp(180px, 30vh, 380px); }
.fig.has-art img { height: clamp(180px, 30vh, 380px); max-width: clamp(170px, 22vh, 320px); }
.fighter { width: clamp(170px, 22vh, 320px); }
.side { bottom: clamp(90px, 13vh, 190px); }
.fighter .hpbar { max-width: 120px; margin-left: auto; margin-right: auto; }

/* ---------- 御三家选择 ---------- */
.starter-wrap { max-width: 1080px; margin: 10px auto 0; text-align: center; }
.starter-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.starter-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 14px; border-radius: 12px; cursor: pointer;
  background: linear-gradient(180deg, rgba(22,27,36,.92), rgba(11,14,19,.95));
  border: 1px solid rgba(120,140,170,.22);
  transition: .18s;
}
.starter-card:hover { border-color: rgba(216,162,74,.6); transform: translateY(-4px); }
.starter-art { height: 300px; display: flex; align-items: flex-end; justify-content: center; width: 100%; }
.starter-art img { height: 300px; width: auto; max-width: 100%; filter: drop-shadow(0 12px 22px rgba(0,0,0,.7)); }
.starter-meta { margin-top: 10px; }
.starter-el { font-size: 11px; letter-spacing: .22em; margin-bottom: 4px; }
.el-water { color: #5fb8e8; }
.el-grass { color: #6fbb5a; }
.el-fire  { color: #e8704a; }
.starter-name { font-size: 20px; color: #fff; }
.starter-title { font-size: 11px; color: var(--dim); margin-top: 2px; }
.starter-desc { font-size: 12px; color: var(--amber); margin-top: 8px; }

/* ---------- 进化链 ---------- */
.evo-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  margin: 12px 0 14px;
}
.evo-cell {
  border: 1px solid rgba(120,140,170,.18); border-radius: 8px;
  background: rgba(10,13,18,.7); overflow: hidden; position: relative;
}
.evo-cell.on { border-color: var(--amber); box-shadow: 0 0 14px -5px rgba(216,162,74,.9); }
.evo-cell.locked { opacity: .4; }
.evo-art { height: 74px; display: flex; align-items: flex-end; justify-content: center; }
.evo-art img { height: 74px; width: auto; max-width: 100%; }
.evo-lock { font-size: 20px; color: #3f4a5c; align-self: center; padding-top: 26px; }
.evo-name {
  font-size: 9px; text-align: center; color: var(--dim);
  background: rgba(0,0,0,.35); padding: 3px 0;
}
.evo-cell.on .evo-name { color: var(--amber); }

/* ================= 界面骨架 ================= */
.screen {
  display: flex; flex-direction: column;
  height: 100%; min-height: 0;
}
.page-head {
  display: flex; align-items: baseline; gap: 14px;
  padding: 2px 0 10px; flex: 0 0 auto;
}
.page-title {
  font-family: "Songti SC", "Noto Serif SC", serif;
  font-size: 24px; letter-spacing: .16em; color: #e8eef7; margin: 0; font-weight: 600;
}
.page-en {
  font-size: 10px; letter-spacing: .38em; color: rgba(140,165,195,.5);
  text-transform: uppercase;
}
.page-body { flex: 1; min-height: 0; position: relative; overflow: hidden; }

/* 底部导航 */
.nav-bar {
  display: flex; gap: 4px; flex: 0 0 auto;
  padding: 6px 0 2px; margin-top: 10px;
  border-top: 1px solid rgba(120,140,170,.14);
  background: linear-gradient(180deg, rgba(8,10,14,0), rgba(8,10,14,.6));
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 7px 0 5px; background: none; border: 0; cursor: pointer;
  color: rgba(150,168,192,.55); transition: .15s;
  border-radius: 8px;
}
.nav-item:hover { color: rgba(200,215,235,.9); background: rgba(255,255,255,.03); }
.nav-item.on { color: var(--amber); }
.nav-ico { font-size: 15px; line-height: 1; }
.nav-label { font-size: 12px; letter-spacing: .08em; }
.nav-en { font-size: 7.5px; letter-spacing: .2em; opacity: .45; }

/* 占位页 */
.placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; gap: 14px;
}
.ph-mark { font-size: 44px; color: rgba(120,140,170,.25); }
.ph-note { color: var(--dim); font-size: 13px; letter-spacing: .06em; }

/* 全局细网点（不覆盖既有背景层） */
#app::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 3; opacity: .05;
  background-image: radial-gradient(rgba(255,255,255,.85) .5px, transparent .5px);
  background-size: 3px 3px;
}

/* 营地三栏 */
.camp { display: grid; grid-template-columns: 84px 1fr 392px; gap: 16px; height: 100%; }
.camp-rail {
  display: flex; flex-direction: column; gap: 10px; overflow-y: auto; padding-right: 2px;
}
.camp-stage { position: relative; display: flex; align-items: flex-end; justify-content: center; min-width: 0; }
.camp-side {
  position: relative; display: flex; flex-direction: column;
  padding: 16px;
  background: linear-gradient(180deg, rgba(18,22,30,.82), rgba(10,13,18,.9));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(120,140,170,.18);
  border-radius: 14px;
  box-shadow: 0 30px 60px -30px #000;
  overflow-y: auto;
}
.camp-side .depart { margin-top: 10px; flex: 0 0 auto; }

/* 面板滚动渐变提示 */
.camp-body { mask-image: linear-gradient(180deg, #000 78%, transparent 100%); }
.evo-art { height: 62px; }
.evo-art img { height: 62px; }
.camp-side { padding: 14px 16px 12px; }
.page-head { padding-bottom: 6px; }

/* ================= 营地枢纽 ================= */
.camp-wrap { position: relative; height: 100%; display: flex; flex-direction: column; }
.hub-stage {
  flex: 1; min-height: 0; display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 8px;
}
.hub-stage.empty { align-items: center; }
.hub-art img { height: min(56vh, 520px); width: auto; filter: drop-shadow(0 20px 40px rgba(0,0,0,.75)); }
.hub-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; flex: 0 0 auto; }
.hub-card {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  padding: 14px 16px; cursor: pointer; text-align: left;
  background: linear-gradient(180deg, rgba(20,25,33,.85), rgba(10,13,18,.92));
  border: 1px solid rgba(120,140,170,.2); border-radius: 12px;
  box-shadow: 0 20px 40px -28px #000;
  transition: .16s;
}
.hub-card:hover { border-color: rgba(216,162,74,.55); transform: translateY(-3px); }
.hub-card.on { border-color: var(--amber); background: linear-gradient(180deg, rgba(216,162,74,.14), rgba(10,13,18,.92)); }
.hub-label { font-size: 17px; color: #e8eef7; letter-spacing: .1em; }
.hub-en { font-size: 8px; letter-spacing: .3em; color: rgba(150,170,195,.5); }
.hub-sub { font-size: 11px; color: var(--dim); margin-top: 6px; }

/* 浮窗 */
.hub-overlay {
  position: absolute; inset: -10px -6px 0;
  display: flex; align-items: stretch; justify-content: flex-end;
  background: rgba(4,6,9,.45);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  z-index: 5; border-radius: 12px;
}
.hub-panel {
  width: min(700px, 72%);
  display: flex; flex-direction: column;
  margin-left: auto;
  background: linear-gradient(180deg, rgba(18,22,30,.94), rgba(9,12,16,.97));
  border-left: 1px solid rgba(120,140,170,.22);
  border-radius: 12px 0 0 12px;
  box-shadow: -30px 0 60px -30px #000;
  animation: panelIn .22s cubic-bezier(.22,.8,.3,1);
}
@keyframes panelIn { from { transform: translateX(26px); opacity: .2; } to { transform: none; opacity: 1; } }
.panel-head { display: flex; align-items: center; padding: 14px 18px 10px; }
.panel-head h2 { margin: 0; font-size: 18px; letter-spacing: .12em; color: #e8eef7; }
.ghost.small { padding: 5px 12px; font-size: 12px; }
.panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 18px 16px; }

/* 人物面板 */
.roster-page { display: flex; flex-direction: column; gap: 10px; height: 100%; min-height: 0; }
.roster-wrap {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px 16px;
  flex: 1;
  min-height: 0;
}
.roster-wrap > .roster-grid { grid-column: 1; min-width: 0; }
.roster-wrap > .detail { grid-column: 2; min-width: 0; min-height: 0; }

/* 放生工具条（常驻在魔物娘面板顶部） */
.release-bar {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(28,36,48,.6);
  border: 1px solid rgba(216,162,74,.3);
  flex: 0 0 auto;
}
.release-bar-row { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.release-bar .iv-field { width: 62px; }
.release-bar .iv-input { height: 30px; font-size: 13px; }
.release-bar .release-head-title { align-self: center; margin-right: 4px; }
.roster-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; align-content: start; }
.roster-cell { position: relative; }
.roster-cell {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 4px; cursor: pointer; background: rgba(255,255,255,.03);
  border: 1px solid rgba(120,140,170,.18); border-radius: 9px;
}
/* 筛选命中：黄框 */
.roster-cell.match { border-color: rgba(216,162,74,.55); background: rgba(216,162,74,.08); }
/* 已勾选要放生：红框 + 勾 */
.roster-cell.picked {
  border-color: #e2645a;
  background: rgba(226,100,90,.16);
  box-shadow: 0 0 0 1px rgba(226,100,90,.5), 0 0 16px -6px rgba(226,100,90,.9);
}
.roster-cell.locked { opacity: .55; cursor: not-allowed; }
.roster-check {
  position: absolute; top: 3px; right: 4px;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; line-height: 1; color: #fff;
  background: #e2645a; box-shadow: 0 1px 4px rgba(0,0,0,.6);
}
.roster-iv { font-size: 10px; color: var(--dim); font-variant-numeric: tabular-nums; }
.roster-cell.match .roster-iv { color: #ffd9a0; }
.roster-cell.on { border-color: var(--amber); background: rgba(216,162,74,.1); }
.roster-art { height: 72px; display: flex; align-items: flex-end; justify-content: center; }
.roster-art img { height: 72px; width: auto; }
.roster-name { font-size: 10px; color: var(--dim); }
.detail { display: flex; flex-direction: column; min-height: 0; }

/* 编队 */
.party-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px; }
.party-slot {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  height: 150px; padding: 8px; border-radius: 10px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(120,140,170,.18);
}
.party-slot.empty { border-style: dashed; opacity: .6; }
.party-art { flex: 1; display: flex; align-items: flex-end; }
.party-art img { height: 110px; width: auto; }
.party-plus { font-size: 26px; color: #3f4a5c; margin: auto; }
.party-name { font-size: 11px; color: var(--dim); }

/* 仓库 */
.stash-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.stash-cell {
  aspect-ratio: 1; border-radius: 8px;
  background: rgba(255,255,255,.02); border: 1px solid rgba(120,140,170,.14);
}

/* 深渊 */
.abyss-wrap { display: flex; align-items: center; justify-content: center; height: 100%; }
.abyss-card {
  width: 420px; padding: 26px; text-align: center;
  background: linear-gradient(180deg, rgba(20,25,33,.9), rgba(10,13,18,.95));
  border: 1px solid rgba(120,140,170,.2); border-radius: 14px;
}
.abyss-layer { font-family: "Songti SC", serif; font-size: 22px; color: #e8eef7; letter-spacing: .18em; margin-bottom: 8px; }

/* 人物面板旁的立绘 */
.overlay-art {
  flex: 1; min-width: 0; display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 30px;
}
.overlay-art-img img {
  height: min(66vh, 620px); width: auto;
  filter: drop-shadow(0 24px 50px rgba(0,0,0,.85));
}
.hub-overlay { background: rgba(4,6,9,.28); }

.evo-cell:not(.locked) { cursor: pointer; transition: .15s; }
.evo-cell:not(.locked):hover { border-color: rgba(216,162,74,.6); transform: translateY(-2px); }
.overlay-art-img img { animation: artSwap .18s ease-out; }
@keyframes artSwap { from { opacity: .35; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ================= 看板娘 ================= */
.hub-cards.four { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.hub-stage.board {
  display: grid; grid-template-columns: repeat(3, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: end; gap: 8px; padding: 0 40px 8px;
  overflow: hidden; min-height: 0;
}
.board-pos { display: flex; align-items: flex-end; justify-content: center; min-height: 0; }
.board-pos.p0 img, .board-pos.p2 img { height: min(42vh, 400px); }
.board-pos.p1 img { height: min(58vh, 560px); }
.board-pos img { width: auto; filter: drop-shadow(0 20px 40px rgba(0,0,0,.8)); }

.board-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.board-slot {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px;
  height: 190px; padding: 10px; border-radius: 10px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(120,140,170,.18);
}
.board-slot.empty { border-style: dashed; opacity: .55; }
.board-slot-art { flex: 1; display: flex; align-items: flex-end; }
.board-slot-art img { height: 128px; width: auto; }
.board-slot-name { font-size: 12px; color: var(--dim); }
.board-list { display: flex; flex-direction: column; gap: 8px; }
.board-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 8px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(120,140,170,.14);
}
.board-row-name { font-size: 13px; color: #e8eef7; }
.slot-btn { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.slot-btn.on { border-color: var(--amber); color: var(--amber); background: rgba(216,162,74,.12); }

/* 看板三人等高 */
.board-pos.p0 img, .board-pos.p1 img, .board-pos.p2 img { height: min(52vh, 500px); }

/* 各页面底图 */
body[data-screen="abyss"]::before { background-image: url(assets/bg_abyss.webp); }
body[data-screen="market"]::before { background-image: url(assets/bg_market.webp); }
body[data-screen="codex"]::before { background-image: url(assets/bg_codex.webp); }
body[data-screen="settings"]::before { background-image: url(assets/bg_settings.webp); }
body[data-screen="abyss"]::before { filter: saturate(.9) brightness(.8); }

/* 战斗：站位拉开 */
.side { display: flex; align-items: flex-end; gap: 26px; }
.fighter.ally { margin-right: 0; }
.fighter.enemy { margin-left: 0; }
.side.allies { left: 5%; }
.side.foes { right: 5%; }

/* 击破 / 倒下 / 全灭 提示 */
.kill-text {
  position: absolute; left: 50%; top: 38%;
  transform: translate(-50%, -50%);
  font-family: "Songti SC", "Noto Serif SC", serif;
  font-size: 40px; letter-spacing: .3em;
  pointer-events: none; z-index: 30;
  animation: killPop 1s ease-out forwards;
}
.kill-text.break { color: #f0d29a; text-shadow: 0 0 26px rgba(216,162,74,.9), 0 4px 14px #000; }
.kill-text.down { color: #e2705f; text-shadow: 0 0 26px rgba(226,112,95,.8), 0 4px 14px #000; }
@keyframes killPop {
  0% { opacity: 0; transform: translate(-50%,-50%) scale(.7); }
  18% { opacity: 1; transform: translate(-50%,-50%) scale(1.08); }
  32% { transform: translate(-50%,-50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%,-80%) scale(1); }
}
.stage.lose::before { content: ""; position: absolute; inset: 0; background: rgba(120,20,20,.16); pointer-events: none; z-index: 20; }

/* ================= 战斗：上下排（宝可梦式） ================= */
.stage { perspective: none; }
.side {
  left: 0; right: 0; bottom: auto;
  display: flex; align-items: flex-end; justify-content: center;
  gap: 30px;
}
.side.foes {
  top: 9%; right: auto; left: 0;
  font-size: 0; /* 不影响子元素 */
}
.side.allies {
  bottom: 8%; left: 0; right: 0;
}
/* 敌人比己方小一号，形成纵深 */
.side.foes .fighter { width: 150px; transform-origin: bottom center; }
.side.foes .fig, .side.foes .fig.has-art img { height: clamp(120px, 17vh, 210px); }
.side.foes .fighter.enemy { margin-left: 0; }
.side.allies .fighter { width: 210px; }
.side.allies .fig, .side.allies .fig.has-art img { height: clamp(190px, 30vh, 330px); }
.side.allies .fighter.ally { margin-right: 0; }

/* 冲锋改为纵向 */
.fighter.attacking { transform: translateY(var(--lunge, 0)); }
.side.foes .fighter { margin-bottom: 0 !important; z-index: 3; }
.side.allies .fighter { margin-bottom: 0 !important; z-index: 4; }

/* 血条名字统一在脚下 */
.side.foes .fname { font-size: 11px; }

/* ================= 回合制战斗 ================= */
.stage.turn .side.foes { top: 8%; }
.stage.turn .side.allies { bottom: 15%; }

/* 行动顺序条 */
.turn-bar {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; z-index: 12;
}
.turn-chip {
  display: flex; align-items: center; padding: 5px 12px; border-radius: 20px;
  background: rgba(10,13,18,.8); border: 1px solid rgba(120,140,170,.25);
  font-size: 11px; color: #cfd8e4;
}
.turn-chip.ally { border-color: rgba(120,190,140,.5); color: #b9e4c6; }
.turn-chip.foe { border-color: rgba(200,120,120,.45); color: #e8c2c2; }
.turn-chip.now { background: rgba(216,162,74,.22); border-color: var(--amber); color: #ffe0a8; }

/* 指令菜单 */
.cmd-menu {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(10px);
  display: none; gap: 8px; z-index: 14;
}
.cmd-menu.show { display: flex; animation: cmdIn .16s ease-out forwards; }
@keyframes cmdIn { to { transform: translateX(-50%) translateY(0); } }
.cmd-btn {
  padding: 10px 18px; border-radius: 9px; cursor: pointer;
  background: linear-gradient(180deg, rgba(24,30,40,.95), rgba(12,16,22,.96));
  border: 1px solid rgba(120,140,170,.3); color: #dbe4ef; font-size: 13px;
  transition: .14s;
}
.cmd-btn:hover:not(:disabled) { border-color: var(--amber); color: #ffe0a8; transform: translateY(-2px); }
.cmd-btn:disabled { opacity: .35; cursor: not-allowed; }
.cmd-hint {
  position: absolute; left: 50%; bottom: 74px; transform: translateX(-50%);
  font-size: 12px; color: var(--amber); letter-spacing: .14em; z-index: 13;
}

/* 目标选择 */
.fighter.targetable { cursor: pointer; }
.fighter.targetable .fig::after {
  content: ''; position: absolute; inset: -8px; border-radius: 12px;
  border: 2px dashed rgba(216,162,74,.75);
  animation: tgtPulse .9s ease-in-out infinite;
}
@keyframes tgtPulse { 0%,100% { opacity: .45; } 50% { opacity: 1; } }
.fighter.targetable:hover .fig::after { border-style: solid; }

/* 反馈 */
.fighter.hurt .fig { animation: hurtShake .2s ease-out; }
@keyframes hurtShake { 0%,100% { transform: none; } 30% { transform: translateX(-5px); } 60% { transform: translateX(4px); } }
.fighter.guarding .fig { box-shadow: 0 0 0 3px rgba(120,170,230,.5) inset; }
.dmg {
  position: absolute; left: 50%; top: 18%; transform: translateX(-50%);
  font-size: 22px; font-weight: 700; color: #fff; text-shadow: 0 2px 8px #000;
  animation: dmgUp .7s ease-out forwards; pointer-events: none;
}
.dmg.crit { color: #ffd27a; font-size: 28px; }
.dmg.burn { color: #a8e07a; }
@keyframes dmgUp { 0% { opacity: 0; transform: translate(-50%, 8px); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -34px); } }

/* HUD 里的 SP */
.hud-sp { font-size: 10px; color: #8fa6bf; margin-top: 3px; letter-spacing: .08em; }
.hud-card.down { opacity: .4; filter: grayscale(.7); }

/* 战斗排版：铺满 */
.stage.turn .side { justify-content: space-evenly; padding: 0 6%; gap: 0; }
.stage.turn .side.foes { top: 6%; }
.stage.turn .side.allies { bottom: 14%; }
.side.foes .fighter { width: 200px; }
.side.foes .fig, .side.foes .fig.has-art img { height: clamp(170px, 24vh, 300px); }
.side.allies .fighter { width: 260px; }
.side.allies .fig, .side.allies .fig.has-art img { height: clamp(230px, 34vh, 400px); }
/* 脚下的一圈光，避免人浮在空里 */
.side .fighter::after {
  content: ''; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%);
  width: 78%; height: 16px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(216,180,120,.28), rgba(0,0,0,0) 70%);
  pointer-events: none;
}
.side.foes .fighter::after { background: radial-gradient(ellipse, rgba(120,150,190,.22), rgba(0,0,0,0) 70%); }

/* ===== 战斗排版：回到左右 ===== */
.stage.turn .side { justify-content: flex-start; align-items: flex-end; gap: 24px; padding: 0 3%; }
.stage.turn .side.allies { left: 3%; right: auto; bottom: 16%; top: auto; }
.stage.turn .side.foes { right: 3%; left: auto; bottom: 16%; top: auto; justify-content: flex-end; }
.stage.turn .side.foes .fighter { width: 210px; }
.stage.turn .side.foes .fig, .stage.turn .side.foes .fig.has-art img { height: clamp(200px, 28vh, 340px); }
.stage.turn .side.allies .fighter { width: 240px; }
.stage.turn .side.allies .fig, .stage.turn .side.allies .fig.has-art img { height: clamp(220px, 31vh, 380px); }

/* 目标点击区 */
.target-hit {
  position: absolute; z-index: 18; padding: 0; margin: 0;
  background: transparent; border: 2px dashed rgba(216,162,74,.85); border-radius: 10px;
  cursor: crosshair; animation: tgtPulse .9s ease-in-out infinite;
}
.target-hit:hover { background: rgba(216,162,74,.14); border-style: solid; }

/* 目标指示：细框 + 头顶小箭头，不要大虚线框 */
.target-hit {
  background: rgba(216,162,74,.05);
  border: 1px solid rgba(216,162,74,.55);
  border-radius: 8px;
  animation: none;
}
.target-hit:hover { background: rgba(216,162,74,.16); border-color: var(--amber); }
.target-hit::before {
  content: '▼'; position: absolute; left: 50%; top: -16px; transform: translateX(-50%);
  font-size: 12px; color: var(--amber); animation: tgtBob 1s ease-in-out infinite;
}
@keyframes tgtBob { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 4px); } }
.fighter.targetable .fig::after { display: none; }

/* 目标指示：完全不要框，只留头顶箭头 */
.target-hit {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.target-hit:hover { background: transparent !important; }
.target-hit:hover::before { color: #fff2d0; transform: translateX(-50%) scale(1.25); }
.target-hit::before {
  content: '▼'; position: absolute; left: 50%; top: -18px; transform: translateX(-50%);
  font-size: 13px; color: var(--amber); text-shadow: 0 0 10px rgba(216,162,74,.9);
  animation: tgtBob 1s ease-in-out infinite; transition: .12s;
}

/* ===== 战斗特效 ===== */
.stage .fx-layer { position: absolute; inset: 0; pointer-events: none; z-index: 16; }

.slash-fx {
  position: absolute; width: 96px; height: 3px; margin: -1.5px 0 0 -48px;
  background: linear-gradient(90deg, transparent, rgba(255,245,225,.95), transparent);
  box-shadow: 0 0 18px rgba(255,235,200,.9);
  transform: rotate(-28deg) scaleX(.2); transform-origin: center;
  animation: slashOut .26s cubic-bezier(.2,.9,.3,1) forwards;
}
.slash-fx.flip { transform: rotate(28deg) scaleX(.2); }
@keyframes slashOut {
  0% { opacity: 0; transform: rotate(-28deg) scaleX(.2); }
  35% { opacity: 1; transform: rotate(-28deg) scaleX(1.15); }
  100% { opacity: 0; transform: rotate(-28deg) scaleX(1.3) translateX(10px); }
}

.stage.shake { animation: stageShake .24s ease-out; }
@keyframes stageShake {
  0%, 100% { transform: none; }
  25% { transform: translate(-6px, 3px); }
  55% { transform: translate(5px, -3px); }
  80% { transform: translate(-3px, 1px); }
}

/* 浮尘，填补中间的空白 */
.motes { position: absolute; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.mote {
  position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: rgba(230,220,200,.55); box-shadow: 0 0 8px rgba(240,220,180,.6);
  animation: moteFloat linear infinite;
}
@keyframes moteFloat {
  0% { opacity: 0; transform: translate(0, 12px); }
  20% { opacity: .75; }
  80% { opacity: .5; }
  100% { opacity: 0; transform: translate(var(--mx, 10px), -70px); }
}

/* 中间的光带 */
.stage.turn::before {
  content: ''; position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  width: 62%; height: 46%; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(216,180,120,.10), rgba(0,0,0,0) 68%);
  pointer-events: none; z-index: 2;
}

/* 近战冲锋 */
.fighter.attacking { transform: translateX(var(--lunge, 0)); z-index: 9; }
.fighter.attacking .fig { filter: drop-shadow(0 0 16px rgba(255,220,160,.5)); }

/* ===== 冲刺 ===== */
.fighter { transition: transform .16s cubic-bezier(.4,0,.2,1); }
.fighter.dashing { transition: transform .15s cubic-bezier(.2,.9,.3,1); z-index: 19; }
.fighter.dashing .fig { filter: drop-shadow(0 0 22px rgba(255,225,170,.75)) brightness(1.08); }
.fighter.flashwhite .fig img { animation: hitWhite .16s steps(2); }
@keyframes hitWhite {
  0% { filter: brightness(3) saturate(0); }
  100% { filter: none; }
}

/* ===== 打击特效 ===== */
.hit-flash {
  position: absolute; width: 90px; height: 90px; margin: -45px 0 0 -45px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,245,.95), rgba(255,225,170,.5) 38%, transparent 70%);
  animation: flashOut .22s ease-out forwards;
  pointer-events: none;
}
.hit-flash.crit { width: 140px; height: 140px; margin: -70px 0 0 -70px; }
@keyframes flashOut { 0% { opacity: 1; transform: scale(.5); } 100% { opacity: 0; transform: scale(1.5); } }

.shock-ring {
  position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px;
  border-radius: 50%; border: 2px solid rgba(255,240,210,.9);
  animation: shockOut .5s cubic-bezier(.15,.8,.3,1) forwards;
  pointer-events: none;
}
.shock-ring.crit { border-color: rgba(255,200,90,1); border-width: 3px; }
@keyframes shockOut {
  0% { opacity: .95; transform: scale(.4); }
  100% { opacity: 0; transform: scale(3.4); }
}

.hit-ray {
  position: absolute; width: 54px; height: 2px; margin: -1px 0 0 0;
  background: linear-gradient(90deg, rgba(255,250,235,1), transparent);
  transform-origin: left center;
  animation: rayOut .3s ease-out forwards;
  pointer-events: none;
}
@keyframes rayOut { 0% { opacity: 1; scale: .3 1; } 100% { opacity: 0; scale: 1.5 1; } }

.debris {
  position: absolute; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px;
  background: rgba(255,225,180,.95); border-radius: 1px;
  animation: sparkOut .5s cubic-bezier(.2,.7,.4,1) forwards;
  pointer-events: none;
}

.slash-fx.crit { height: 5px; width: 130px; box-shadow: 0 0 26px rgba(255,200,90,1); }




.stage.turn .side .fighter {
  transition: transform .16s cubic-bezier(.2,.9,.3,1);
}


/* ===== 斜列站位：前贴后错开 ===== */
.stage.turn .side { gap: 4px; padding: 0 2%; }
.stage.turn .fighter { position: relative; top: calc(var(--lane, 0) * -30px); }
/* 人多时整队缩一档，避免横向挤压 */
.side.many .fighter { width: 78%; }
.side.many .fig, .side.many .fig.has-art img { height: 82%; }
.side.foes.many .fighter { width: 168px; }
.side.allies.many .fighter { width: 196px; }

/* 冲刺速度线 */
.speed-line {
  position: absolute; width: 40px; height: 1px;
  background: linear-gradient(90deg, rgba(255,245,225,.9), transparent);
  transform: scaleX(var(--dir, 1));
  animation: speedOut .28s ease-out forwards;
  pointer-events: none;
}
@keyframes speedOut { 0% { opacity: .1; } 30% { opacity: 1; } 100% { opacity: 0; } }

/* ===== 立绘放大 ===== */
.stage.turn .side.allies .fighter { width: 300px; }
.stage.turn .side.allies .fig,
.stage.turn .side.allies .fig.has-art img { height: clamp(260px, 42vh, 520px); }
.stage.turn .side.foes .fighter { width: 262px; }
.stage.turn .side.foes .fig,
.stage.turn .side.foes .fig.has-art img { height: clamp(220px, 34vh, 430px); }
.stage.turn .side.allies { bottom: 10%; }
.stage.turn .side.foes { bottom: 18%; }
.stage.turn .fighter { top: calc(var(--lane, 0) * -40px); }

/* 人多时缩回一档，避免挤压 */
.side.allies.many .fighter { width: 232px; }
.side.allies.many .fig, .side.allies.many .fig.has-art img { height: clamp(200px, 32vh, 400px); }
.side.foes.many .fighter { width: 208px; }
.side.foes.many .fig, .side.foes.many .fig.has-art img { height: clamp(170px, 26vh, 330px); }

/* ===== 新布局：敌居中，我贴底 ===== */
.stage.turn { overflow: hidden; }
.stage.turn .side { padding: 0 4%; }

/* 敌方：屏幕中心偏上 */
.stage.turn .side.foes {
  top: 12%; bottom: auto; left: 0; right: 0;
  justify-content: center; align-items: flex-end;
  gap: 28px;
}
.stage.turn .side.foes .fighter { width: 300px; top: 0; }
.stage.turn .side.foes .fig,
.stage.turn .side.foes .fig.has-art img { height: clamp(240px, 44vh, 520px); }

/* 我方：底部立绘，从下沿露出来 */
.stage.turn .side.allies {
  bottom: -14%; left: 0; right: 0; top: auto;
  justify-content: center; align-items: flex-end;
  gap: 40px;
  z-index: 8;
}
.stage.turn .side.allies .fighter { width: 330px; top: 0; }
.stage.turn .side.allies .fig,
.stage.turn .side.allies .fig.has-art img { height: clamp(280px, 50vh, 600px); }
.stage.turn .side.allies .fname,
.stage.turn .side.allies .hpbar { transform: translateY(-26px); }

/* 满编时收一档 */
.stage.turn .side.allies.many .fighter { width: 250px; }
.stage.turn .side.allies.many .fig,
.stage.turn .side.allies.many .fig.has-art img { height: clamp(220px, 40vh, 480px); }
.stage.turn .side.foes.many .fighter { width: 240px; }
.stage.turn .side.foes.many .fig,
.stage.turn .side.foes.many .fig.has-art img { height: clamp(190px, 34vh, 400px); }

/* 指令条压在最上面 */
.cmd-menu { bottom: 4%; z-index: 40; }
.cmd-hint { bottom: 13%; z-index: 40; }

/* ===== 布局微调 ===== */
/* 敌人上移，名字血条放头顶 */
.stage.turn .side.foes { top: 7%; }
.stage.turn .side.foes .fighter {
  display: flex; flex-direction: column; align-items: center;
}
.stage.turn .side.foes .fighter .fname { order: 1; margin-bottom: 3px; }
.stage.turn .side.foes .fighter .hpbar { order: 2; margin: 0 0 6px; width: 82%; max-width: 190px; }
.stage.turn .side.foes .fighter .fig { order: 3; }

/* 我方抬起来，名字和血条露出来 */
.stage.turn .side.allies { bottom: -3%; }
.stage.turn .side.allies .fname,
.stage.turn .side.allies .hpbar { transform: none; }
.stage.turn .side.allies .fighter { display: flex; flex-direction: column; align-items: center; }
.stage.turn .side.allies .fighter .hpbar { width: 78%; max-width: 180px; }

/* ===== 强制居中：把两侧容器拉满整行 ===== */
.stage.turn .side.allies,
.stage.turn .side.foes {
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  justify-content: center !important;
  align-items: flex-end !important;
}

/* ================= 战斗 UI 优化 ================= */
/* 顶栏：速度条做成一体 */
.battle-controls { margin-bottom: 6px; }
.battle-controls .row { gap: 6px; }
.battle-controls button {
  min-width: 46px; height: 30px; font-size: 12px; border-radius: 7px;
  letter-spacing: .05em;
}
.battle-controls button.primary {
  background: rgba(216,162,74,.18); border-color: var(--amber); color: #ffe3b0;
}

/* 行动顺序：胶囊 + 连接感 */
.turn-bar {
  top: 12px; gap: 4px; padding: 4px 10px;
  background: rgba(8,11,16,.55); border: 1px solid rgba(120,140,170,.16);
  border-radius: 999px; backdrop-filter: blur(6px);
}
.turn-chip {
  padding: 3px 10px; border-radius: 999px; font-size: 11px;
  background: transparent; border: 1px solid transparent;
  color: rgba(190,205,225,.75); letter-spacing: .06em;
}
.turn-chip.now {
  background: rgba(216,162,74,.22); border-color: rgba(216,162,74,.7);
  color: #ffe3b0; font-weight: 600;
}
.turn-chip.ally { color: #a8d8b6; }
.turn-chip.foe { color: #e0a8a8; }

/* 指令菜单：更大、更好点 */
.cmd-menu { gap: 10px; }
.cmd-btn {
  min-width: 96px; padding: 12px 20px; font-size: 14px; letter-spacing: .08em;
  border-radius: 11px;
  box-shadow: 0 14px 28px -18px #000, inset 0 1px 0 rgba(255,255,255,.06);
}
.cmd-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 18px 30px -16px #000, 0 0 0 1px rgba(216,162,74,.5);
}
.cmd-hint {
  font-size: 13px; letter-spacing: .18em; color: #ffd89a;
  text-shadow: 0 2px 10px #000;
}

/* 名字与血条 */
.fname { font-size: 12px; letter-spacing: .1em; color: #dbe4ef; text-shadow: 0 1px 4px #000; }
.hpbar {
  height: 5px; border-radius: 3px; background: rgba(0,0,0,.6);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.hpbar i { border-radius: 3px; }
.fighter.enemy .hpbar i { background: linear-gradient(90deg, #c9564a, #e8766a); }
.fighter.ally .hpbar i { background: linear-gradient(90deg, #4f9e6a, #74c98d); }

/* 底部状态卡 */
.battle-hud { padding-top: 8px; }
.hud-card { min-height: 64px; padding: 8px 14px 8px 10px; }
.hud-card.on { border-color: var(--amber); box-shadow: 0 0 0 1px rgba(216,162,74,.5), 0 12px 26px -18px #000; }
.hud-hp { height: 5px; }
.hud-sp { color: #ffd89a; letter-spacing: .12em; }

/* ===== 立绘按阶段缩放（--ss 由 JS 按阶段写入） ===== */
.stage.turn .side.allies .fig,
.stage.turn .side.allies .fig.has-art img {
  height: calc(clamp(280px, 50vh, 600px) * var(--ss, 1));
}
.stage.turn .side.allies.many .fig,
.stage.turn .side.allies.many .fig.has-art img {
  height: calc(clamp(220px, 40vh, 480px) * var(--ss, 1));
  max-height: 62vh;
}
.overlay-art-img img { height: calc(min(66vh, 620px) * var(--ss, 1)); }
.board-pos img { height: calc(min(52vh, 500px) * var(--ss, 1)); }
.side.allies .fighter { align-self: flex-end; }

/* ================= 魔物娘图鉴 ================= */
.codex-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(430px, 1fr));
  gap: 16px; height: 100%; overflow-y: auto; padding-right: 4px; align-content: start;
}
.codex-card {
  background: linear-gradient(180deg, rgba(20,25,33,.86), rgba(10,13,18,.92));
  border: 1px solid rgba(120,140,170,.2); border-radius: 14px;
  padding: 14px 16px 16px;
  box-shadow: 0 24px 48px -32px #000;
}
.codex-card.unknown { opacity: .75; }
.codex-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.codex-el {
  font-size: 11px; letter-spacing: .2em; padding: 2px 8px; border-radius: 5px;
  border: 1px solid currentColor; opacity: .85;
}
.codex-name { font-size: 17px; color: #e9eff8; letter-spacing: .1em; }
.codex-stages { display: flex; gap: 10px; }
.codex-stage { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.codex-stage.branch::before {
  content: '分支'; position: absolute; margin-top: -8px;
  font-size: 9px; letter-spacing: .2em; color: var(--amber);
}
.codex-cell {
  width: 100%; height: 150px; border-radius: 10px;
  display: flex; align-items: flex-end; justify-content: center;
  background: radial-gradient(ellipse at 50% 92%, rgba(120,150,190,.16), rgba(0,0,0,0) 70%);
  position: relative; overflow: hidden;
}
.codex-cell img { height: 150px; width: auto; max-width: 100%; filter: drop-shadow(0 10px 20px rgba(0,0,0,.7)); }
.codex-cell.locked { background: rgba(255,255,255,.025); border: 1px dashed rgba(120,140,170,.22); }
.codex-q { font-size: 30px; color: #344054; margin: auto; }
.codex-label { font-size: 10px; color: var(--dim); letter-spacing: .1em; }
.codex-cell.locked + .codex-label { color: #3b4453; }
.codex-stage { position: relative; }
.codex-stage.branch::before { top: -4px; }

/* 图鉴详情 */
.codex-wrap { position: relative; height: 100%; }
.codex-stage.clickable, .codex-cell.clickable { cursor: pointer; }
.codex-stage.clickable:hover .codex-cell { border-color: var(--amber); box-shadow: 0 0 0 1px rgba(216,162,74,.5); }
.codex-detail-art {
  flex: 1; min-width: 0; display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 30px;
}
.codex-detail-art img { height: min(62vh, 560px); width: auto; filter: drop-shadow(0 24px 50px rgba(0,0,0,.85)); }
.codex-panel { width: min(620px, 62%); }
.codex-minis { display: flex; gap: 8px; margin: 10px 0 14px; }
.codex-mini {
  width: 64px; height: 64px; border-radius: 8px; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(255,255,255,.04); border: 1px solid rgba(120,140,170,.2); overflow: hidden; cursor: pointer;
}
.codex-mini img { height: 64px; width: auto; }
.codex-mini.on { border-color: var(--amber); background: rgba(216,162,74,.12); }
.codex-mini.locked { cursor: default; color: #3b4453; align-items: center; }

/* 图鉴详情：全屏层 */
.codex-modal {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: stretch;
}
.codex-backdrop {
  position: absolute; inset: 0;
  background: rgba(4,6,9,.55);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
}
.codex-modal .codex-detail-art { position: relative; z-index: 1; pointer-events: none; }
.codex-modal .codex-panel { position: relative; z-index: 2; margin-left: auto; border-radius: 0; }

/* 我方名字与血条放到头顶，避免被下沿裁掉 */
.stage.turn .side.allies .fighter { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.stage.turn .side.allies .fighter .fname { order: 1; margin-bottom: 3px; }
.stage.turn .side.allies .fighter .hpbar { order: 2; width: 80%; max-width: 190px; margin: 0 0 6px; }
.stage.turn .side.allies .fighter .fig { order: 3; }

/* 图鉴详情立绘：居中 + 按阶段体型缩放 */
.codex-detail-art {
  align-items: center !important;
  justify-content: center !important;
  padding-bottom: 0 !important;
}
.codex-detail-art img {
  height: calc(min(80vh, 760px) * var(--ss, 1)) !important;
  width: auto;
  max-width: 88%;
  filter: drop-shadow(0 26px 54px rgba(0,0,0,.9));
}

/* ================= 开始界面 ================= */
.title-screen {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding-bottom: 8vh;
}
.title-bg {
  position: absolute; inset: 0;
  background: url(assets/title_bg.webp) center 38% / cover no-repeat;
}
.title-bg::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 30%, transparent 30%, rgba(4,6,10,.55) 78%, rgba(4,6,10,.85) 100%);
}
.title-menu {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; gap: 12px; width: 260px;
}
.title-btn {
  padding: 14px 18px; border-radius: 10px; cursor: pointer;
  font-size: 15px; letter-spacing: .22em;
  color: #f0e2c4;
  background: linear-gradient(180deg, rgba(28,24,18,.82), rgba(12,10,8,.9));
  border: 1px solid rgba(216,162,74,.45);
  box-shadow: 0 18px 40px -24px #000, inset 0 1px 0 rgba(255,220,160,.12);
  transition: .16s;
}
.title-btn:hover:not(.disabled) { transform: translateY(-2px); border-color: var(--amber); color: #fff0cf; }
.title-btn.primary { background: linear-gradient(180deg, rgba(216,162,74,.9), rgba(150,102,38,.95)); color: #1a1208; font-weight: 700; }
.title-btn.disabled { opacity: .35; cursor: not-allowed; }
.title-foot {
  position: relative; z-index: 2; margin-top: 22px;
  font-size: 9px; letter-spacing: .5em; color: rgba(200,180,150,.45);
}

/* 顶栏品牌 */
.brand { display: flex; align-items: baseline; gap: 4px; }
.brand-name {
  font-family: "Songti SC", "Noto Serif SC", serif;
  font-size: 19px; letter-spacing: .12em; color: #f2e3c2;
  text-shadow: 0 2px 10px rgba(0,0,0,.8);
}
.brand-go {
  font-size: 12px; font-weight: 800; font-style: italic;
  letter-spacing: .04em; color: var(--amber);
  transform: skewX(-8deg);
  text-shadow: 0 0 12px rgba(216,162,74,.6);
}

/* 标题页设置浮窗 */
.title-settings { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; }
.title-settings-mask { position: absolute; inset: 0; background: rgba(4,6,10,.72); backdrop-filter: blur(6px); }
.title-settings-panel {
  position: relative; z-index: 1; width: min(460px, 86vw);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(22,26,34,.97), rgba(10,13,18,.98));
  border: 1px solid rgba(216,162,74,.35); border-radius: 14px;
  box-shadow: 0 40px 80px -40px #000;
  max-height: 76vh; overflow: hidden;
}

/* 存档导入 / 导出 */
.save-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.save-text {
  width: 100%; box-sizing: border-box; min-height: 150px; resize: vertical;
  background: rgba(8, 10, 14, .85); color: var(--ink);
  border: 1px solid rgba(120, 140, 170, .28); border-radius: 8px;
  padding: 10px 12px; outline: none;
  font: 12px/1.6 ui-monospace, Consolas, monospace;
  word-break: break-all;
}
.save-text:focus { border-color: rgba(216, 162, 74, .55); }
.save-file { display: none; }

/* ================= 开始界面（MOSS 整图 + 透明点击区） ================= */
.title-screen {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: #05070a;
}
.title-stage {
  position: relative;
  aspect-ratio: 1536 / 1024;
  width: min(100vw, calc(100vh * 1.5));
  max-height: 100vh;
}
.title-art, .title-art img { width: 100%; height: 100%; display: block; }
.title-art img { object-fit: contain; }
.title-hit {
  position: absolute; padding: 0; border: 0; background: transparent;
  cursor: pointer; border-radius: 8px;
  transition: background .14s, box-shadow .14s;
}
.title-hit:hover:not(.disabled) {
  background: rgba(255, 225, 170, .1);
  box-shadow: inset 0 0 0 1px rgba(255, 215, 150, .55);
}
.title-hit.disabled { cursor: not-allowed; }

/* ===== 开始界面（纯背景 + HTML UI） ===== */
.title-screen {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #05070a;
}
.title-bg {
  position: absolute; inset: 0;
  background: url(assets/title_bg.webp) center 40% / cover no-repeat;
}
.title-bg::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 34%, transparent 24%, rgba(4,6,10,.5) 70%, rgba(4,6,10,.88) 100%),
    linear-gradient(180deg, rgba(4,6,10,.35), transparent 30%, rgba(4,6,10,.55));
}
.title-logo {
  position: relative; z-index: 2;
  display: flex; align-items: flex-end; gap: 10px;
  margin-bottom: 4px;
}
.logo-cn {
  font-family: "Songti SC", "Noto Serif SC", "SimSun", serif;
  font-size: clamp(44px, 6.2vw, 86px);
  font-weight: 800; letter-spacing: .12em;
  color: #f6e7c6;
  text-shadow:
    0 0 2px #2a1a06, 0 2px 0 #6b4a17, 0 4px 0 #4a3210,
    0 6px 18px rgba(0,0,0,.85), 0 0 46px rgba(216,162,74,.55);
}
.logo-go {
  font-family: "Arial Black", "Impact", sans-serif;
  font-size: clamp(30px, 4vw, 56px);
  font-weight: 900; font-style: italic; letter-spacing: .02em;
  color: var(--amber);
  transform: skewX(-10deg) translateY(-6px);
  text-shadow: 0 0 2px #3a2405, 0 3px 0 #7a5518, 0 6px 20px rgba(0,0,0,.9), 0 0 40px rgba(255,180,60,.7);
}
.logo-sub {
  position: relative; z-index: 2;
  font-size: 10px; letter-spacing: .62em; color: rgba(220,195,150,.6);
  margin-bottom: 8vh;
}
.title-menu {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; gap: 14px; width: min(300px, 62vw);
}

/* 创角页品牌放大 */
.brand-name.big {
  font-family: "Songti SC", "Noto Serif SC", serif;
  font-size: clamp(34px, 4.6vw, 62px); font-weight: 800;
  letter-spacing: .12em; color: #f6e7c6;
  text-shadow: 0 2px 0 #6b4a17, 0 5px 0 #422c0e, 0 8px 24px rgba(0,0,0,.9), 0 0 46px rgba(216,162,74,.5);
}
.brand-go.big {
  font-family: "Arial Black", "Impact", sans-serif;
  font-size: clamp(22px, 3vw, 40px); font-weight: 900; font-style: italic;
  color: var(--amber); transform: skewX(-10deg) translateY(-6px);
  text-shadow: 0 3px 0 #7a5518, 0 6px 20px rgba(0,0,0,.9), 0 0 36px rgba(255,180,60,.65);
}
.big-brand { display: flex; align-items: flex-end; gap: 10px; justify-content: center; margin-bottom: 18px; }

/* ===== 立绘基准放大（三处一起） ===== */
/* 营地看板：stage → board-pos → hub-art → img 每一层都要有确定高度，
   否则百分比落空、图片改按列宽撑开，就会顶出画面 */
.hub-stage.board {
  align-items: stretch;
  min-height: min(46vh, 420px);
}
.hub-stage.board .board-pos {
  height: 100%; min-height: 0;
  display: flex; align-items: flex-end; justify-content: center;
}
.hub-stage.board .board-pos > .hub-art {
  height: 100%; display: flex; align-items: flex-end; justify-content: center;
}
.hub-stage.board .board-pos.p0 > .hub-art,
.hub-stage.board .board-pos.p2 > .hub-art { height: 88%; }
.hub-stage.board .board-pos.p1 > .hub-art { height: 96%; }
.hub-stage.board .board-pos img {
  height: 100%; width: auto; max-width: 100%;
  object-fit: contain; object-position: bottom center;
}
/* 人物面板大立绘 */
.overlay-art-img img { height: calc(min(80vh, 760px) * var(--ss, 1)) !important; }
/* 图鉴详情 */
.codex-detail-art img { height: calc(min(94vh, 900px) * var(--ss, 1)) !important; max-width: 86%; }

/* ================= 伪 Live2D ================= */
.l2d { position: relative; display: inline-flex; align-items: flex-end; }
.l2d img { display: block; height: 100%; width: auto; }
.l2d-base {
  animation: l2dBreath 5.2s ease-in-out infinite;
  transform-origin: 50% 100%;
}
.l2d-hair {
  position: absolute; inset: 0;
  animation: l2dSway 6.8s ease-in-out infinite;
  transform-origin: 50% 14%;
  -webkit-mask-image: radial-gradient(ellipse 60% 38% at 50% 18%, #000 58%, transparent 100%);
  mask-image: radial-gradient(ellipse 60% 38% at 50% 18%, #000 58%, transparent 100%);
}
@keyframes l2dBreath {
  0%, 100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.014) translateY(-3px); }
}
@keyframes l2dSway {
  0%, 100% { transform: rotate(-1.2deg) translateX(-3px); }
  50% { transform: rotate(1.2deg) translateX(3px); }
}
/* 图鉴详情里用 liveArt 时保持尺寸 */
.codex-detail-art .l2d { height: calc(min(94vh, 900px) * var(--ss, 1)); }
.codex-detail-art .l2d img { height: 100%; }

/* canvas 版 */
.l2d { position: relative; display: inline-flex; align-items: flex-end; }
.l2d canvas { display: block; height: 100%; width: auto; }
.codex-detail-art .l2d { height: calc(min(94vh, 900px) * var(--ss, 1)); }

/* 图鉴立绘：CSS 呼吸（复用战斗那套，幅度略大） */
.codex-detail-art.idle img {
  animation: idleBreathe 3.6s ease-in-out infinite;
  transform-origin: 50% 100%;
  will-change: transform;
}
@keyframes idleBreathe {
  0%, 100% { transform: translateY(0) scaleY(1) rotate(0deg); }
  35%      { transform: translateY(-5px) scaleY(1.007) rotate(-0.22deg); }
  70%      { transform: translateY(-7px) scaleY(1.009) rotate(0.18deg); }
}

/* 图鉴立绘：与战斗同一套呼吸参数 */
.codex-detail-art.idle img {
  animation: breathe 2.6s ease-in-out infinite !important;
  transform-origin: 50% 100%;
}

/* 营地看板娘：同样呼吸，三人错开相位 */
.board-pos img {
  animation: breathe 2.6s ease-in-out infinite;
  transform-origin: 50% 100%;
  will-change: transform;
}
.board-pos.p0 img { animation-delay: -.6s; }
.board-pos.p1 img { animation-delay: -.6s; }
.board-pos.p2 img { animation-delay: -1.2s; }

/* 人物面板大立绘也一致 */
.overlay-art-img img {
  animation: breathe 2.6s ease-in-out infinite;
  transform-origin: 50% 100%;
}

/* ================= 地图 ================= */
.map-wrap { display: flex; flex-direction: column; height: 100%; gap: 12px; }
.map-grid {
  flex: 1; min-height: 0;
  display: grid; gap: 4px;
  padding: 10px; border-radius: 12px;
  background: rgba(8,11,16,.5);
  border: 1px solid rgba(120,140,170,.16);
}
.map-cell {
  position: relative; border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: filter .12s, transform .12s;
}
.map-cell:hover { filter: brightness(1.25); }
.map-cell.t-plain { background: linear-gradient(180deg, #3f4a32, #333d2a); }
.map-cell.t-grass { background: linear-gradient(180deg, #4d6b3a, #3a5230); box-shadow: inset 0 0 0 1px rgba(120,180,90,.25); }
.map-cell.t-tree { background: linear-gradient(180deg, #1e2a22, #16211b); }
.map-cell.t-path { background: linear-gradient(180deg, #5b4f3c, #4a4032); }
.map-cell.t-village { background: linear-gradient(180deg, #6b5330, #553f24); box-shadow: inset 0 0 0 2px rgba(216,162,74,.7); }
.map-cell.here { box-shadow: inset 0 0 0 2px rgba(255,220,150,.95), 0 0 18px rgba(255,200,120,.45); }
.map-me { font-size: 12px; color: #ffe3b0; text-shadow: 0 0 8px rgba(255,200,120,.9); }
.map-bar { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.map-steps { font-size: 11px; color: var(--dim); letter-spacing: .1em; }
.map-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 16px; }

/* 地图：底图 + 透明格子 */
.map-grid {
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
}
.map-cell { background: none; }
.map-cell.t-tree { background: rgba(10,20,14,.35); cursor: not-allowed; }
.map-cell.t-water { background: rgba(30,70,110,.28); cursor: not-allowed; }
.map-cell.t-grass { background: rgba(110,180,90,.13); box-shadow: inset 0 0 0 1px rgba(150,210,120,.22); }
.map-cell.t-village { background: rgba(216,162,74,.16); box-shadow: inset 0 0 0 2px rgba(216,162,74,.75); }
.map-cell.t-path, .map-cell.t-plain { background: none; }
.map-cell:hover { background: rgba(255,235,200,.12); }
.map-cell.here { box-shadow: inset 0 0 0 2px rgba(255,225,170,.95), 0 0 18px rgba(255,200,120,.45); background: rgba(255,220,160,.1); }

/* 地图：底图当背景，格子在上 */
.map-stage { position: relative; flex: 1; min-height: 0; }
.map-bg {
  position: absolute; inset: 0; border-radius: 12px;
  background-size: 100% 100%; background-position: center; background-repeat: no-repeat;
  opacity: .32; filter: saturate(.75) brightness(.8);
  pointer-events: none;
}
.map-grid { position: relative; }
.map-cell.t-tree { background: rgba(16,30,20,.72); }
.map-cell.t-water { background: rgba(26,70,110,.62); }
.map-cell.t-grass { background: rgba(96,150,70,.34); }
.map-cell.t-village { background: rgba(216,162,74,.42); }
.map-cell.t-plain, .map-cell.t-path { background: rgba(120,140,110,.10); }
.map-ico { font-size: 13px; color: rgba(220,235,210,.75); }

/* 图块集：每格取自己的贴图 */
.map-cell {
  background-size: 100% 100% !important;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #2f3a2a;
}
.map-cell.t-tree { background-color: #1b2a1f; cursor: not-allowed; }
.map-cell.t-water { background-color: #22546f; cursor: not-allowed; }
.map-cell:hover { filter: brightness(1.2); }
.map-cell.here { box-shadow: inset 0 0 0 2px rgba(255,225,170,.95), 0 0 16px rgba(255,200,120,.5); }
.map-ico { display: none; }

/* ===== 地图最终修正：格子必须有高度 ===== */
.map-wrap { display: flex; flex-direction: column; height: 100%; gap: 10px; }
.map-stage { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.map-grid {
  flex: 1; min-height: 0; height: 100%;
  display: grid; gap: 3px;
  grid-auto-rows: 1fr;
  padding: 8px;
  border-radius: 12px;
  background: rgba(6,9,13,.55);
  border: 1px solid rgba(120,140,170,.18);
}
.map-cell {
  position: relative; border-radius: 4px; cursor: pointer;
  background-size: 100% 100% !important;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #3a4a32;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.25);
  min-height: 24px;
}
.map-cell.t-tree { cursor: not-allowed; }
.map-cell.t-water { cursor: not-allowed; }
.map-cell.here::after {
  content: ''; position: absolute; inset: 0; border-radius: 4px;
  box-shadow: inset 0 0 0 2px rgba(255,232,180,1), 0 0 14px rgba(255,205,130,.7);
}
.map-cell:hover { filter: brightness(1.18); }
.map-ico { display: none; }
.map-me {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-size: 13px; color: #fff4d8; text-shadow: 0 0 8px rgba(255,210,140,1), 0 1px 3px #000;
}
.map-msg { font-size: 12px; color: #d8e2ee; letter-spacing: .04em; }
.map-cell.t-chest { box-shadow: inset 0 0 0 2px rgba(255,205,110,.9), 0 0 12px rgba(255,190,90,.5); }
.map-cell.t-chest .map-ico { display: block; color: #ffe1a0; font-size: 14px; }
.map-cell.t-rock { background-color: #4a463c; }
.map-cell.t-rock .map-ico { display: block; color: #b8b09c; }

/* ================= 市场 ================= */
.shop-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 14px; height: 100%; overflow-y: auto; align-content: start; padding-right: 4px;
}
.shop-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border-radius: 13px;
  background: linear-gradient(180deg, rgba(22,27,35,.9), rgba(10,13,18,.94));
  border: 1px solid rgba(120,140,170,.2);
  box-shadow: 0 22px 44px -30px #000;
}
.shop-glyph {
  flex: 0 0 54px; height: 54px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #ffe0a8;
  background: radial-gradient(circle at 50% 35%, rgba(216,162,74,.28), rgba(10,13,18,.9));
  border: 1px solid rgba(216,162,74,.35);
}
.shop-body { flex: 1; min-width: 0; }
.shop-name { font-size: 15px; color: #eaf1fa; letter-spacing: .08em; margin-bottom: 4px; }
.shop-own { font-size: 11px; color: var(--dim); margin-left: 10px; letter-spacing: .06em; }
.shop-desc { font-size: 12px; color: #9fb0c4; line-height: 1.65; margin: 0; }
.shop-buy {
  flex: 0 0 auto; padding: 10px 16px; border-radius: 9px; cursor: pointer;
  font-size: 13px; letter-spacing: .06em;
  color: #1c1408; font-weight: 700;
  background: linear-gradient(180deg, #e0b466, #b7863a);
  border: 1px solid rgba(255,220,160,.5);
}
.shop-buy.disabled { opacity: .35; cursor: not-allowed; filter: grayscale(.6); }
.stash-cell.filled {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(216,162,74,.35);
  border-radius: 8px; padding: 4px; position: relative;
}
.stash-icon { width: 100%; flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.stash-icon img { max-width: 100%; max-height: 100%; border-radius: 5px; }
.stash-name { font-size: 9px; color: #cfd8e4; }
.stash-count { position: absolute; right: 4px; bottom: 3px; font-size: 10px; color: var(--amber); }
.map-lobby { display: flex; flex-direction: column; gap: 12px; height: 100%; overflow-y: auto; }
.map-list-title { font-size: 12px; color: var(--dim); letter-spacing: .16em; margin-top: 6px; }
.map-list { display: flex; flex-direction: column; gap: 8px; }
.map-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 10px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(120,140,170,.2);
}
.map-row-main { flex: 1; min-width: 0; }
.map-row-name { font-size: 14px; color: #e8eff8; }
.map-row-meta { font-size: 11px; color: var(--dim); margin-top: 3px; }
.ghost.small.danger { border-color: rgba(200,110,100,.5); color: #e0a09a; }

/* 市场图标：约束图片本身 */
.shop-glyph { overflow: hidden; padding: 0; }
.shop-glyph img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  object-fit: cover;
  display: block;
  border-radius: 10px;
}
.shop-card { min-width: 0; }
.shop-body { min-width: 0; overflow: hidden; }
.shop-name { white-space: nowrap; }
.shop-desc { word-break: break-word; }
.shop-buy { white-space: nowrap; }
.evolve-btn { margin: 8px 0 10px; animation: evoPulse 1.6s ease-in-out infinite; }
@keyframes evoPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(216,162,74,.55); }
  50% { box-shadow: 0 0 0 8px rgba(216,162,74,0); }
}

/* 引导条 */
.camp-with-guide { display: flex; flex-direction: column; height: 100%; min-height: 0; gap: 10px; }
.camp-with-guide > .camp-wrap { flex: 1; min-height: 0; }
.guide-bar {
  display: flex; align-items: center; gap: 12px; flex: 0 0 auto;
  padding: 9px 14px; border-radius: 10px;
  background: linear-gradient(90deg, rgba(216,162,74,.16), rgba(20,25,33,.9));
  border: 1px solid rgba(216,162,74,.4);
  box-shadow: 0 12px 26px -20px #000;
}
.guide-tag { font-size: 11px; letter-spacing: .16em; color: var(--amber); }
.guide-text { font-size: 13px; color: #f0e6d2; letter-spacing: .04em; }
.guide-dots { display: flex; gap: 5px; }
.guide-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.16); }
.guide-dot.done { background: rgba(216,162,74,.75); }
.guide-dot.now { background: var(--amber); box-shadow: 0 0 8px rgba(216,162,74,.9); }
/* 扔契约符 */
.seal-throw {
  position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  object-fit: cover; border-radius: 6px;
  box-shadow: 0 0 18px rgba(255,215,150,.9);
  animation: sealFly .42s cubic-bezier(.3,.1,.5,1) forwards;
  pointer-events: none;
}
@keyframes sealFly {
  0% { transform: translate(0, 0) scale(.6) rotate(-20deg); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.1) rotate(220deg); opacity: 0; }
}
/* 提示条 */
.toast {
  position: fixed; left: 50%; bottom: 12%; transform: translateX(-50%);
  padding: 10px 20px; border-radius: 10px; z-index: 90;
  background: rgba(10,13,18,.94); border: 1px solid rgba(216,162,74,.5);
  color: #f2e6cc; font-size: 13px; letter-spacing: .06em;
  box-shadow: 0 18px 40px -22px #000;
  animation: toastIn .2s ease-out;
}
.toast.out { opacity: 0; transform: translate(-50%, 6px); transition: .4s; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
/* 战斗日志 */
.battle-log {
  position: absolute; left: 14px; bottom: 96px; z-index: 15;
  display: flex; flex-direction: column; gap: 3px;
  pointer-events: none; max-width: 44%;
}
.log-row {
  font-size: 12px; letter-spacing: .03em; padding: 2px 8px;
  border-radius: 5px; background: rgba(6,9,13,.62);
  color: #cfd8e4; transition: opacity .6s;
  animation: logIn .18s ease-out;
}
.log-row.ally { color: #a8d8b6; }
.log-row.foe { color: #e0b0a8; }
.log-row.crit { color: #ffd27a; }
.log-row.burn { color: #a8e07a; }
.log-row.dead { color: #ff9d8a; font-weight: 600; }
.log-row.old { opacity: .35; }
@keyframes logIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
/* 中毒伤害数字换个颜色区分 */
.dmg.burn { color: #a8e07a; }
.rename-input {
  margin: 6px 0 4px; width: 140px; padding: 5px 8px;
  font-size: 12px; color: #e8eff8;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(120,140,170,.3); border-radius: 6px;
  outline: none;
}
.rename-input:focus { border-color: var(--amber); }
/* 创建页：男主女主立绘 */
.pick-figure { overflow: hidden; }
.pick-figure img {
  width: 100%; height: 100%; object-fit: contain; object-position: bottom center;
  display: block;
}
/* ================= 进化演出 ================= */
.evo-scene {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 45%, rgba(28,22,14,.94), rgba(3,4,6,.985));
  overflow: hidden;
}
.evo-rays {
  position: absolute; width: 150vmax; height: 150vmax;
  background: conic-gradient(from 0deg,
    rgba(255,214,140,.16) 0deg, transparent 12deg,
    rgba(255,214,140,.12) 22deg, transparent 34deg,
    rgba(255,214,140,.16) 48deg, transparent 60deg);
  animation: evoSpin 9s linear infinite;
  opacity: .8;
}
@keyframes evoSpin { to { transform: rotate(360deg); } }
.evo-ring {
  position: absolute; width: 46vmin; height: 46vmin; border-radius: 50%;
  border: 1px solid rgba(255,215,150,.5);
  box-shadow: 0 0 60px rgba(255,190,110,.35), inset 0 0 80px rgba(255,190,110,.18);
  animation: evoPulseRing 2.6s ease-in-out infinite;
}
@keyframes evoPulseRing {
  0%, 100% { transform: scale(1); opacity: .7; }
  50% { transform: scale(1.06); opacity: 1; }
}
.evo-old, .evo-new {
  position: absolute; height: 78vh; object-fit: contain;
  filter: drop-shadow(0 0 40px rgba(0,0,0,.7));
}
.evo-old { animation: evoOldOut 1.1s ease-in forwards; }
@keyframes evoOldOut {
  0% { opacity: 0; transform: scale(.96); filter: brightness(1); }
  30% { opacity: 1; transform: scale(1); }
  70% { opacity: 1; transform: scale(1.01); filter: brightness(2.4) saturate(.4); }
  100% { opacity: 0; transform: scale(1.04); filter: brightness(6) saturate(0); }
}
.evo-new {
  opacity: 0;
  animation: evoNewIn .9s cubic-bezier(.2,.9,.3,1) 1.1s forwards;
}
@keyframes evoNewIn {
  0% { opacity: 0; transform: scale(.72); filter: brightness(3) blur(6px); }
  60% { opacity: 1; transform: scale(1.03); filter: brightness(1.4) blur(0); }
  100% { opacity: 1; transform: scale(1); filter: brightness(1); }
}
.evo-flash {
  position: absolute; inset: 0; background: #fff8e8; opacity: 0;
  animation: evoFlash .5s ease-out 1.05s forwards;
}
@keyframes evoFlash {
  0% { opacity: 0; }
  22% { opacity: .92; }
  100% { opacity: 0; }
}
.evo-txt {
  position: absolute; bottom: 9vh; display: flex; flex-direction: column;
  align-items: center; gap: 8px; opacity: 0;
  animation: evoTxtIn .8s ease-out 1.5s forwards;
}
@keyframes evoTxtIn { to { opacity: 1; } }
.evo-word { font-size: 13px; letter-spacing: .6em; color: #e2b978; }
.evo-name { font-size: 26px; letter-spacing: .14em; color: #fff3dc; text-shadow: 0 0 24px rgba(255,200,120,.6); }
.evo-scene.out { opacity: 0; transition: opacity .5s; }
/* 看板：物种行 + 形态选择 */
.board-row-main { display: flex; flex-direction: column; gap: 6px; }
.board-row-stages { display: flex; gap: 6px; }
.stage-chip {
  font-size: 11px; padding: 3px 9px; border-radius: 999px; cursor: pointer;
  color: #b9c7d8; background: rgba(255,255,255,.05);
  border: 1px solid rgba(120,140,170,.3);
}
.stage-chip.on { color: #1c1408; background: linear-gradient(180deg, #e0b466, #b7863a); border-color: rgba(255,220,160,.6); }
.log-row.weak { color: #8fa0b4; }
/* 技能面板 */
.move-pane { margin: 10px 0 6px; display: flex; flex-direction: column; gap: 6px; }
.move-head { font-size: 11px; letter-spacing: .16em; color: var(--dim); }
.move-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 8px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(120,140,170,.18);
}
.move-row.pending { border-style: dashed; border-color: rgba(216,162,74,.45); flex-wrap: wrap; }
.move-name { font-size: 13px; color: #e8eff8; min-width: 52px; }
.move-type { font-size: 10px; padding: 1px 7px; border-radius: 999px; }
.move-power { font-size: 11px; color: #ffd9a0; font-variant-numeric: tabular-nums; min-width: 38px; }
.move-type.t-water { background: rgba(80,150,230,.22); color: #9ccaff; }
.move-type.t-fire { background: rgba(230,110,80,.22); color: #ffb09c; }
.move-type.t-grass { background: rgba(110,200,110,.22); color: #a8e8a8; }
.move-type.t-none { background: rgba(180,180,180,.18); color: #cfd8e4; }
.move-sp { font-size: 11px; color: var(--amber); min-width: 44px; }
.move-desc { font-size: 11px; color: #9fb0c4; }
.move-swap { display: flex; gap: 4px; width: 100%; justify-content: flex-end; }
.move-learn { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.move-learn-title { font-size: 11px; color: var(--amber); letter-spacing: .14em; }
/* ================= 牧场 ================= */
.ranch-wrap { display: flex; flex-direction: column; height: 100%; gap: 12px; }
.ranch-tabs { display: flex; gap: 8px; flex: 0 0 auto; }
.ranch-tab {
  padding: 7px 18px; border-radius: 999px; cursor: pointer;
  font-size: 12px; letter-spacing: .12em; color: #b9c7d8;
  background: rgba(255,255,255,.05); border: 1px solid rgba(120,140,170,.25);
}
.ranch-tab.on { color: #1c1408; background: linear-gradient(180deg, #e0b466, #b7863a); border-color: rgba(255,220,160,.6); }
.ranch-body { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 14px; }
.ranch-fence {
  width: 70%; flex: 1; max-height: 46vh; border-radius: 12px;
  background:
    repeating-linear-gradient(90deg, rgba(120,90,50,.25) 0 2px, transparent 2px 28px),
    linear-gradient(180deg, rgba(60,80,50,.25), rgba(30,40,30,.35));
  border: 1px dashed rgba(150,170,140,.35);
}
/* 牧场格子 */
.pasture-body { justify-content: flex-start; }
.pasture-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  width: 100%; max-width: 780px; flex: 0 0 auto;
}
.pasture-cell {
  aspect-ratio: 3 / 4; border-radius: 12px; cursor: pointer; padding: 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  background: linear-gradient(180deg, rgba(40,55,40,.35), rgba(18,26,20,.6));
  border: 1px solid rgba(140,170,140,.28);
  overflow: hidden; position: relative;
}
.pasture-cell.empty { border-style: dashed; color: var(--dim); }
.pasture-plus { font-size: 26px; color: rgba(200,220,200,.4); }
.pasture-art { width: 100%; flex: 1; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.pasture-art img { max-height: 100%; object-fit: contain; }
.pasture-name { font-size: 11px; color: #dfe8df; margin-top: 4px; }
.pasture-picker {
  width: 100%; max-width: 780px; border-radius: 12px; padding: 12px;
  background: rgba(10,14,18,.9); border: 1px solid rgba(140,170,140,.3);
  display: flex; flex-direction: column; gap: 10px;
}
.pasture-picker-head { display: flex; align-items: center; font-size: 12px; color: #cfd8e4; }
.pasture-picker-list { display: flex; flex-wrap: wrap; gap: 10px; }
.pasture-pick {
  width: 92px; border-radius: 9px; cursor: pointer; padding: 6px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(120,140,170,.25);
  color: #dfe8df; font-size: 10px;
}
.pasture-pick-art { width: 100%; height: 70px; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.pasture-pick-art img { max-height: 100%; object-fit: contain; }
/* ================= 牧场场景 ================= */
.pasture-scene {
  position: relative; width: 100%; flex: 1; min-height: 0;
  border-radius: 14px; overflow: hidden;
  background-size: cover; background-position: center bottom;
  border: 1px solid rgba(140,170,140,.3);
  box-shadow: inset 0 0 80px rgba(0,0,0,.35);
}
.pet {
  position: absolute; left: 0; bottom: 0;
  transform-origin: bottom center;
  background: none; border: 0; padding: 0; cursor: pointer;
  animation: petWalk var(--dur, 10s) linear infinite;
  animation-delay: var(--delay, 0s);
}
.pet-lane0 { bottom: -2%; }
.pet-lane1 { bottom: 14%; }
.pet-lane2 { bottom: 28%; }
.pet-art {
  display: block; height: calc(38vh * var(--scale, 1));
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.45));
}
.pet-art img { height: 100%; width: auto; object-fit: contain; }
@keyframes petWalk {
  0%   { left: 4%; transform: scale(var(--scale, 1)) scaleX(1); }
  46%  { left: 78%; transform: scale(var(--scale, 1)) scaleX(1); }
  50%  { left: 78%; transform: scale(var(--scale, 1)) scaleX(-1); }
  96%  { left: 4%; transform: scale(var(--scale, 1)) scaleX(-1); }
  100% { left: 4%; transform: scale(var(--scale, 1)) scaleX(1); }
}
.pet-bubble {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  padding: 2px 8px; border-radius: 10px; font-size: 12px;
  background: rgba(255,255,255,.92); color: #2a2118;
  opacity: 0; animation: bubblePop 7s ease-in-out infinite;
  animation-delay: calc(var(--delay, 0s) + 2s);
  white-space: nowrap;
}
@keyframes bubblePop {
  0%, 72% { opacity: 0; transform: translate(-50%, 6px) scale(.8); }
  78% { opacity: 1; transform: translate(-50%, -2px) scale(1); }
  92% { opacity: 1; transform: translate(-50%, -6px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -10px) scale(.9); }
}
.pet-empty {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  font-size: 13px; color: rgba(255,255,255,.85); text-shadow: 0 2px 8px #000;
}
.pasture-add {
  position: absolute; right: 14px; bottom: 12px;
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
  font-size: 12px; color: #1c1408; font-weight: 600;
  background: linear-gradient(180deg, #e0b466, #b7863a);
  border: 1px solid rgba(255,220,160,.6);
}
/* 游走由 JS 控制，取消 CSS 往返 */
.pet { animation: none !important; transition: none; }
.pet-art { transition: filter .2s; }
.pet.walking .pet-art { filter: drop-shadow(0 6px 10px rgba(0,0,0,.45)); }
/* 走动平滑：腿脚起伏 + 去抖动 */
.pet { will-change: left, transform; }
.pet-art { transition: none; }
@keyframes petBob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-3px) rotate(-0.6deg); }
}
/* 牧场产出 */
.pet-yield {
  position: absolute; right: -4px; top: 18%;
  padding: 1px 7px; border-radius: 999px;
  font-size: 11px; color: #1c1408; font-weight: 700;
  background: linear-gradient(180deg, #ffe0a0, #d8a24a);
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.pasture-collect {
  position: absolute; right: 14px; bottom: 58px;
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
  font-size: 12px; color: #eaf1fa;
  background: rgba(12,18,24,.86);
  border: 1px solid rgba(150,180,210,.45);
}
/* 商店：出售材料 */
.shop-sell { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.shop-sell-title { font-size: 11px; letter-spacing: .16em; color: var(--dim); }
.material-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-radius: 10px; background: rgba(30,38,48,.92);
  border: 1px solid rgba(120,140,170,.2);
}
.material-icon { width: 44px; height: 44px; border-radius: 8px; overflow: hidden; flex: 0 0 auto; }
.material-icon img { width: 100%; height: 100%; object-fit: cover; }
.material-name { font-size: 13px; color: #e8eff8; }
.material-own { font-size: 11px; color: var(--dim); margin-left: 8px; }
/* 喂食模式 */
.pasture-scene.feeding { cursor: url("assets/item_feed.webp") 16 16, pointer; }
.pasture-feed {
  position: absolute; right: 14px; bottom: 100px;
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
  font-size: 12px; color: #eaf1fa;
  background: rgba(12,18,24,.86); border: 1px solid rgba(150,180,210,.45);
}
.pasture-feed.on { color: #1c1408; background: linear-gradient(180deg, #e0b466, #b7863a); border-color: rgba(255,220,160,.6); }
.feed-tray {
  position: absolute; right: 14px; bottom: 142px;
  display: flex; gap: 8px; padding: 8px; border-radius: 12px;
  background: rgba(10,14,18,.92); border: 1px solid rgba(150,180,210,.35);
}
.feed-chip {
  display: flex; align-items: center; gap: 6px; padding: 6px 10px;
  border-radius: 9px; cursor: pointer; font-size: 11px; color: #dfe8f2;
  background: rgba(255,255,255,.05); border: 1px solid rgba(120,140,170,.28);
}
.feed-chip.on { border-color: var(--amber); box-shadow: 0 0 12px rgba(216,162,74,.4); }
.feed-chip.none { opacity: .4; cursor: not-allowed; }
.feed-icon { width: 22px; height: 22px; border-radius: 5px; overflow: hidden; display: block; }
.feed-icon img { width: 100%; height: 100%; object-fit: cover; }
/* 互动气泡 */
.pet-say {
  position: absolute; left: 50%; top: -18px; transform: translate(-50%, 6px);
  padding: 3px 9px; border-radius: 10px; font-size: 12px; white-space: nowrap;
  background: rgba(255,255,255,.95); color: #241c14;
  opacity: 0; transition: opacity .18s, transform .18s;
}
.pet-say.show { opacity: 1; transform: translate(-50%, -4px); }
/* 产出倒计时 */
.pet-timer {
  position: absolute; left: 50%; top: -22px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px;
  padding: 1px 7px; border-radius: 999px; white-space: nowrap;
  font-size: 10px; color: #eaf1fa;
  background: rgba(8,12,16,.72); border: 1px solid rgba(150,180,210,.28);
}
.pet-timer .pt-icon { width: 12px; height: 12px; border-radius: 3px; overflow: hidden; }
.pet-timer .pt-icon img { width: 100%; height: 100%; object-fit: cover; }
.pet-timer.ready { color: #ffe3a8; border-color: rgba(255,210,140,.6); }
/* 翻转只作用在立绘上，气泡/倒计时保持正向 */
.pet-art { transform-origin: bottom center; }
.pet.walking .pet-art img { animation: petBob .46s ease-in-out infinite; }
.pet.walking .pet-art { animation: none; }
/* 材料说明卡 */
.mat-card-backdrop {
  position: fixed; inset: 0; z-index: 95;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4,6,9,.72);
}
.mat-card {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 22px; border-radius: 14px; max-width: 520px;
  background: linear-gradient(180deg, rgba(24,30,38,.98), rgba(12,16,21,.99));
  border: 1px solid rgba(216,162,74,.35);
  box-shadow: 0 30px 60px -30px #000;
}
.mat-card-icon { width: 84px; height: 84px; border-radius: 12px; overflow: hidden; flex: 0 0 auto; }
.mat-card-icon img { width: 100%; height: 100%; object-fit: cover; }
.mat-card-body { min-width: 0; }
.mat-card-name { font-size: 16px; color: #f2e7d2; margin-bottom: 4px; }
.mat-card-own { font-size: 11px; color: var(--amber); margin-bottom: 8px; }
.mat-card-desc { font-size: 12px; color: #b7c5d6; line-height: 1.7; margin: 0 0 6px; }
.mat-card-from { font-size: 11px; color: var(--dim); }
/* 倒计时可点 */
.pet-timer { cursor: pointer; }
.pet-bubble { top: -44px; }
.pet-say { top: -46px; }
/* 出售行：提亮 */
.material-row { border-color: rgba(150,175,205,.34); }
.material-name { color: #f0f6ff; }
.material-own { color: #b9c7d8; }
.material-row .hint { color: #9fb0c4; }
/* 地图难度条 */
.map-top { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.map-diff { font-size: 12px; color: var(--amber); letter-spacing: .08em; }
.map-goal { font-size: 11px; color: var(--dim); }
.map-region { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid rgba(120,140,170,.22); }
.map-region-name { font-size: 15px; color: #e8eff8; }
.map-region-diff { font-size: 11px; color: var(--amber); }
.map-region-tiers { display: flex; gap: 6px; flex-wrap: wrap; }
.map-pending { font-size: 11px; color: #ffe0a8; }
.primary.small { padding: 6px 14px; font-size: 12px; border-radius: 8px; }
.primary.small.disabled { opacity: .35; cursor: not-allowed; }
/* 章节 BOSS 行 */
.boss-row {
  display: flex; align-items: center; gap: 10px;
  margin-top: 8px; padding: 10px 12px; border-radius: 10px;
  background: linear-gradient(90deg, rgba(120,40,40,.35), rgba(20,20,26,.6));
  border: 1px solid rgba(220,120,110,.45);
}
.boss-tag { font-size: 10px; letter-spacing: .16em; color: #ffb3a4; }
.boss-name { font-size: 13px; color: #ffe7e2; }
.boss-tries { font-size: 11px; color: #9fb3c8; letter-spacing: .06em; }
/* 女王蛋 */
.egg-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.egg-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-radius: 10px; background: rgba(30,38,48,.92);
  border: 1px solid rgba(150,200,160,.35);
}
.egg-icon { width: 44px; height: 44px; border-radius: 8px; overflow: hidden; }
.egg-icon img { width: 100%; height: 100%; object-fit: cover; }
.egg-name { font-size: 13px; color: #eaf5ee; }
.map-tools { font-size: 11px; color: #b9c7d8; letter-spacing: .06em; }
/* 指令菜单挪到右下角，不再压住己方立绘 */
.cmd-menu {
  left: auto; right: 22px; bottom: 22px;
  transform: none;
  flex-wrap: wrap; justify-content: flex-end; max-width: 62%;
}
.cmd-menu.show { animation: cmdInRight .16s ease-out forwards; }
@keyframes cmdInRight {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
/* 己方站位抬高一点，给底部留空 */
.side.allies { bottom: 8%; }
/* 指令菜单挪到左侧，与战斗日志同列 */
.cmd-menu {
  left: 22px; right: auto; bottom: 22px;
  justify-content: flex-start; max-width: 46%;
}
@keyframes cmdInLeft {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.cmd-menu.show { animation: cmdInLeft .16s ease-out forwards; }

/* 战斗日志：放大、加宽，贴在菜单上方 */
.battle-log {
  left: 22px; bottom: 96px; max-width: 46%;
  gap: 5px;
}
.log-row {
  font-size: 13px; line-height: 1.5;
  padding: 4px 10px; border-radius: 6px;
  background: rgba(6,9,13,.72);
}
/* 预选目标：脚下光环 + 轻微放大 */
.fighter.enemy.selected .fig { filter: drop-shadow(0 0 12px rgba(255,190,120,.85)); }
.fighter.enemy.selected::after {
  content: ''; position: absolute; left: 50%; bottom: 2px; width: 62%; height: 12px;
  transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255,200,130,.45), transparent 70%);
  pointer-events: none;
}
.fighter.enemy:hover .fig { filter: drop-shadow(0 0 10px rgba(255,220,170,.6)); }

/* ======================================================================
   战斗特效 · 权威层（以后改 FX 只看这一段）
   —— 上面 .hit-flash / .shock-ring / .hit-ray / .impact-spark / .debris
      .slash-fx / .dmg 有过多处互相覆盖的定义，全部在这里收口：
      颜色一律走 --el / --el2 / --glow，元素类只负责赋这三个变量。
   ====================================================================== */
.el-fire  { --el: #ff7a3c; --el2: #ffd08a; --glow: rgba(255,120,50,.95); }
.el-water { --el: #58bdf7; --el2: #cfefff; --glow: rgba(80,190,255,.95); }
.el-grass { --el: #6fdc84; --el2: #d9ffb8; --glow: rgba(110,220,130,.95); }
.el-none  { --el: #ffe8c4; --el2: #ffffff; --glow: rgba(255,225,170,.95); }

.hit-flash {
  background: radial-gradient(circle, #fff 0%, var(--el2) 22%, var(--el) 46%, transparent 72%);
}
.hit-flash.crit { box-shadow: 0 0 46px 12px var(--glow); }

.shock-ring { border-color: var(--el2); box-shadow: 0 0 14px var(--glow); }
.shock-ring.strong { border-width: 3px; }
.shock-ring.crit { border-color: #fff; border-width: 3px; box-shadow: 0 0 28px var(--glow); }

.hit-ray { background: linear-gradient(90deg, var(--el2), var(--el) 55%, transparent); }
.impact-spark { background: var(--el2); box-shadow: 0 0 9px var(--glow); }
.debris { background: var(--el); box-shadow: 0 0 6px var(--glow); }
.slash-fx {
  background: linear-gradient(90deg, transparent, var(--el2), var(--el), transparent);
  box-shadow: 0 0 18px var(--glow);
}

/* 术法爆发：物理攻击拉刀光，属性攻击改用这个 */
.el-burst {
  position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, #fff 0%, var(--el2) 26%, var(--el) 52%, transparent 74%);
  animation: burstOut .46s cubic-bezier(.15,.75,.3,1) forwards;
}
@keyframes burstOut {
  0% { transform: scale(.25) rotate(0deg); opacity: 1; }
  60% { opacity: .9; }
  100% { transform: scale(4.2) rotate(24deg); opacity: 0; }
}

/* 冲锋残影 */
.dash-ghost {
  position: absolute; object-fit: contain; opacity: 0; pointer-events: none;
  filter: blur(1.2px) brightness(1.5) saturate(.7);
  animation: ghostFade .32s ease-out forwards; z-index: 18;
}
@keyframes ghostFade { 0% { opacity: .42; } 100% { opacity: 0; } }

/* 女王敕令：整屏压暗 + 扩张波 */
.decree-fx {
  position: absolute; inset: 0; z-index: 18; pointer-events: none;
  background: radial-gradient(circle at 50% 46%, rgba(196,130,255,.20), rgba(6,4,10,.74) 68%);
  animation: decreeIn 1.15s ease-out forwards;
}
@keyframes decreeIn { 0% { opacity: 0; } 12% { opacity: 1; } 78% { opacity: 1; } 100% { opacity: 0; } }
.decree-ring {
  position: absolute; left: 50%; top: 46%; width: 80px; height: 80px; margin: -40px 0 0 -40px;
  border: 2px solid rgba(220,170,255,.95); border-radius: 50%;
  box-shadow: 0 0 30px rgba(190,120,255,.9);
  animation: decreeRing 1s cubic-bezier(.1,.8,.25,1) forwards;
}
.decree-ring.late { animation-delay: .16s; }
@keyframes decreeRing {
  0% { transform: scale(.3); opacity: 1; }
  100% { transform: scale(9); opacity: 0; }
}

/* 全灭压暗 */
.stage.lose::after { background: radial-gradient(ellipse at 50% 55%, rgba(120,20,20,.22), rgba(0,0,0,.72) 100%); }

/* 伤害数字：367 / 829 / 1289 三处定义合并后的唯一版本 */
.dmg {
  position: absolute; left: 50%; top: 18%; transform: translateX(-50%);
  font-size: 22px; font-weight: 700; color: #fff;
  text-shadow: 0 0 2px #000, 0 2px 4px #000, 0 0 14px rgba(0,0,0,.9);
  -webkit-text-stroke: .6px rgba(0,0,0,.65);
  font-variant-numeric: tabular-nums;
  animation: dmgUp .7s ease-out forwards; pointer-events: none; z-index: 20;
}
.dmg.crit {
  color: #ffd27a; font-size: 32px; -webkit-text-stroke: 1px rgba(0,0,0,.7);
  animation: dmgCrit .8s ease-out forwards;
}
.dmg.big { font-size: 38px; }
.dmg.burn { color: #a8e07a; font-size: 15px; }
@keyframes dmgCrit {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(1.55); }
  22% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -40px) scale(1.05); }
}

/* 尺寸：原来 90px 的爆点在 1240px 宽的舞台上小得看不见，整体放大一档 */
.hit-flash { width: 140px; height: 140px; margin: -70px 0 0 -70px; }
.hit-flash.crit { width: 210px; height: 210px; margin: -105px 0 0 -105px; }
.shock-ring { width: 46px; height: 46px; margin: -23px 0 0 -23px; }
.hit-ray { width: 86px; height: 3px; margin: -1.5px 0 0 0; }
.impact-spark { width: 4.5px; height: 4.5px; margin: -2.25px 0 0 -2.25px; }
.debris { width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; }
.el-burst { width: 40px; height: 40px; margin: -20px 0 0 -20px; }
.slash-fx { width: 150px; height: 4px; margin: -2px 0 0 -75px; }
.slash-fx.crit { width: 200px; height: 6px; }

/* 特效时长跟随倍速：battle.js 的 setSpeed() 会写 --fx-speed */
.stage { --fx-speed: 1; }
.hit-flash { animation-duration: calc(.22s * var(--fx-speed, 1)); }
.shock-ring { animation-duration: calc(.5s * var(--fx-speed, 1)); }
.hit-ray { animation-duration: calc(.3s * var(--fx-speed, 1)); }
.impact-spark, .debris { animation-duration: calc(.5s * var(--fx-speed, 1)); }
.el-burst { animation-duration: calc(.46s * var(--fx-speed, 1)); }
.slash-fx { animation-duration: calc(.26s * var(--fx-speed, 1)); }
.dash-ghost { animation-duration: calc(.32s * var(--fx-speed, 1)); }
.decree-ring { animation-duration: calc(1s * var(--fx-speed, 1)); }
.dmg, .dmg.crit { animation-duration: calc(.72s * var(--fx-speed, 1)); }

/* ======================================================================
   探图 · 中途结算 / 地图券
   ====================================================================== */
.settle-mask {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 6, 10, .74); backdrop-filter: blur(5px);
}
.settle-panel {
  position: relative; width: min(470px, 88vw);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(22,26,34,.98), rgba(10,13,18,.99));
  border: 1px solid rgba(216, 162, 74, .38); border-radius: 14px;
  box-shadow: 0 40px 80px -40px #000;
  max-height: 82vh; overflow: hidden;
}
.settle-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px dashed rgba(120, 140, 170, .16);
  font-size: 13px;
}
.settle-row .k { color: var(--dim); }
.settle-row .v { color: var(--ink); }
.settle-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 10px; }

.map-ticket { font-size: 12px; color: var(--amber, #d8a24a); letter-spacing: .06em; }
.map-ticket-row {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px dashed rgba(120, 140, 170, .16);
  font-size: 13px; color: var(--ink);
}
.hint.warn { color: #e0855c; }

/* 设置里的音效音量滑块 */
.vol-row { align-items: center; gap: 12px; }
.vol-row .k { flex: 0 0 auto; }
.vol-num { flex: 0 0 46px; text-align: right; font-variant-numeric: tabular-nums; }
.vol-slider {
  flex: 1 1 auto; height: 3px; -webkit-appearance: none; appearance: none;
  background: rgba(120, 140, 170, .3); border-radius: 2px; outline: none; cursor: pointer;
}
.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--amber, #d8a24a);
  border: 2px solid rgba(10, 13, 18, .9);
  box-shadow: 0 0 10px rgba(216, 162, 74, .6);
}
.vol-slider::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--amber, #d8a24a); border: 2px solid rgba(10, 13, 18, .9);
}

/* 编队：候补列表 */.party-bench { margin-top: 14px; border-top: 1px dashed rgba(120, 140, 170, .16); padding-top: 10px; }
.party-bench-title { font-size: 11px; letter-spacing: .18em; color: var(--dim); margin-bottom: 8px; }
.party-bench-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0; border-bottom: 1px dashed rgba(120, 140, 170, .1);
}
.party-art-sm { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 6px; overflow: hidden; }
.party-art-sm img { width: 100%; height: 100%; object-fit: contain; object-position: center top; }
.party-bench-name { font-size: 13px; color: var(--ink); }
.party-bench-lv { font-size: 11px; color: var(--dim); }

/* 战斗血量数字 */
.hpnum {
  margin-top: 3px; font-size: 11px; letter-spacing: .04em;
  color: #a9b6c6; font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .9);
}
.fighter.enemy .hpnum { color: #c9a9a0; }
.hud-hpnum {
  margin-top: 2px; font-size: 10px; color: #8fa6bf;
  font-variant-numeric: tabular-nums; letter-spacing: .04em;
}

/* 邮件 */
.mail-wrap { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow: auto; }
.mail-card {
  display: flex; flex-direction: column; gap: 8px; padding: 12px 14px;
  border-radius: 10px; background: rgba(255,255,255,.03);
  border: 1px solid rgba(120,140,170,.18);
}
.mail-card.claimable { border-color: rgba(216,162,74,.55); background: rgba(216,162,74,.07); }
.mail-card.claimed { opacity: .62; }
.mail-card.expired, .mail-card.locked { opacity: .78; }
.mail-head { display: flex; align-items: center; gap: 10px; }
.mail-from { font-size: 11px; letter-spacing: .12em; color: var(--amber); }
.mail-time { font-size: 11px; color: var(--dim); }
.mail-badge {
  font-size: 10px; padding: 1px 8px; border-radius: 999px;
  background: rgba(120,140,170,.18); color: #a9b6c6;
}
.mail-badge.claimable { background: rgba(216,162,74,.22); color: #ffd9a0; }
.mail-badge.claimed { background: rgba(110,180,140,.2); color: #9fe0bd; }
.mail-title { font-size: 14px; color: #eaf1fa; }
.mail-body p { margin: 2px 0; font-size: 12px; line-height: 1.6; color: #b8c4d4; }
.mail-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mail-reward { font-size: 12px; color: #ffd9a0; }

/* 放生面板 */
.release-wrap { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.release-filter {
  display: flex; flex-direction: column; gap: 10px; padding: 12px 14px;
  border-radius: 10px; background: rgba(28,36,48,.55);
  border: 1px solid rgba(216,162,74,.28);
}
.release-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.release-head-title {
  font-size: 12px; letter-spacing: .14em; color: var(--amber);
  padding-left: 8px; border-left: 2px solid var(--amber); line-height: 1.1;
}
.release-head .ghost.on { border-color: var(--amber); color: #ffd9a0; }
.release-mode { display: flex; gap: 8px; }
.iv-fields { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.iv-field { display: flex; flex-direction: column; gap: 5px; font-size: 11px; color: #9fb3c8; }
.iv-input {
  width: 100%; height: 32px; padding: 0 8px; border-radius: 8px; box-sizing: border-box;
  background: rgba(6,9,13,.95); border: 1px solid rgba(140,165,200,.45);
  color: #eaf1fa; font-size: 14px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.iv-input:hover { border-color: rgba(216,162,74,.6); }
.iv-input:focus { outline: none; border-color: var(--amber); }
.release-bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.release-list {
  display: flex; flex-direction: column; gap: 6px;
  overflow: auto; min-height: 0; padding-right: 4px;
}
.release-row {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px;
  border-radius: 9px; background: rgba(255,255,255,.03);
  border: 1px solid rgba(120,140,170,.16);
}
.release-row.locked { opacity: .5; }
.release-row input[type="checkbox"] { flex: 0 0 auto; width: 15px; height: 15px; }
.release-art {
  width: 38px; height: 38px; flex: 0 0 auto; border-radius: 7px; overflow: hidden;
  display: flex; align-items: flex-end; justify-content: center;
}
.release-art img, .release-art > * { width: 100%; height: 100%; object-fit: contain; object-position: center top; }
.release-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.release-name { font-size: 13px; color: var(--ink); }
.release-iv { font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }

/* 首领群攻：整场的冲击环 */.shock-ring.wide {
  width: 120px; height: 120px; margin: -60px 0 0 -60px;
  border-width: 3px;
  animation: wideRing .72s cubic-bezier(.15,.8,.3,1) forwards;
}
@keyframes wideRing {
  0% { opacity: .95; transform: scale(.4); }
  100% { opacity: 0; transform: scale(6.5); }
}

/* 战败立绘切换：换图时淡入一下，别硬跳 */.fig img.art-swap { animation: artSwapIn .28s ease-out both; }
@keyframes artSwapIn {
  0% { opacity: 0; filter: brightness(1.6); }
  100% { opacity: 1; filter: none; }
}

/* ================= 手机端 UI（body[data-ui="mobile"]） ================= */
body[data-ui="mobile"] .screen { padding: 0 10px; height: 100%; }
body[data-ui="mobile"] .page-head { padding: 2px 0 6px; gap: 8px; }
body[data-ui="mobile"] .page-body { overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* 营地 */
body[data-ui="mobile"] .camp-wrap { height: auto; min-height: 100%; }
body[data-ui="mobile"] .hub-stage.board { min-height: 34vh; padding: 0 6px 4px; gap: 4px; }
body[data-ui="mobile"] .hub-cards,
body[data-ui="mobile"] .hub-cards.four { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px; }
body[data-ui="mobile"] .hub-card { padding: 10px 12px; border-radius: 10px; }
body[data-ui="mobile"] .hub-label { font-size: 14px; }

/* 弹层：整屏 */
body[data-ui="mobile"] .hub-overlay { inset: 0; border-radius: 0; }
body[data-ui="mobile"] .hub-panel { width: 100%; max-width: 100%; border-radius: 0; border-left: none; padding: 12px; }
body[data-ui="mobile"] .hub-panel .overlay-art { display: none; }

/* 魔物娘 / 放生 */
body[data-ui="mobile"] .roster-wrap { grid-template-columns: 1fr; gap: 10px; }
body[data-ui="mobile"] .roster-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body[data-ui="mobile"] .roster-art { height: 58px; }
body[data-ui="mobile"] .release-bar { padding: 8px; gap: 6px; }
body[data-ui="mobile"] .release-bar .iv-field { width: 52px; }
body[data-ui="mobile"] .release-bar .iv-input { height: 28px; font-size: 12px; }

/* 队伍 / 看板 / 仓库 */
body[data-ui="mobile"] .party-row, body[data-ui="mobile"] .board-slots { gap: 6px; }
body[data-ui="mobile"] .party-slot { height: 116px; }
body[data-ui="mobile"] .board-slot { height: 150px; }

/* 地图 */
body[data-ui="mobile"] .map-grid { padding: 6px; gap: 3px; }
body[data-ui="mobile"] .map-cell { border-radius: 4px; }
body[data-ui="mobile"] .map-bar, body[data-ui="mobile"] .map-top { flex-wrap: wrap; gap: 6px; }
body[data-ui="mobile"] .map-region-tiers { flex-wrap: wrap; }
body[data-ui="mobile"] .slot-btn { padding: 4px 8px; font-size: 11px; }

/* 战斗 */
body[data-ui="mobile"] .stage { height: 42vh; min-height: 240px; border-radius: 8px; }
body[data-ui="mobile"] .battle-hud { gap: 8px; padding: 6px 0 2px; }
body[data-ui="mobile"] .hud-card { padding: 6px 8px; gap: 6px; }
body[data-ui="mobile"] .hud-art { width: 34px; height: 34px; }
body[data-ui="mobile"] .hud-name { font-size: 11px; }
body[data-ui="mobile"] .cmd-btn { padding: 9px 12px; font-size: 13px; }
body[data-ui="mobile"] .fname { font-size: 10px; }
body[data-ui="mobile"] .hpnum { font-size: 9px; }

/* 商店 / 牧场 / 图鉴 */
body[data-ui="mobile"] .shop-wrap, body[data-ui="mobile"] .ranch-wrap { grid-template-columns: 1fr !important; }
body[data-ui="mobile"] .codex-grid { display: block; }
body[data-ui="mobile"] .codex-card { margin-bottom: 10px; }
body[data-ui="mobile"] .material-row, body[data-ui="mobile"] .release-row { flex-wrap: wrap; }

/* 底部导航 */
body[data-ui="mobile"] .nav-bar { position: sticky; bottom: 0; padding-bottom: 6px; }
body[data-ui="mobile"] .nav-item { font-size: 10px; padding: 4px 0; }

/* 设置面板 */
body[data-ui="mobile"] .title-settings-panel { width: 100%; max-width: 100%; height: 100%; border-radius: 0; }
body[data-ui="mobile"] .sheet-row { flex-wrap: wrap; gap: 6px; }
body[data-ui="mobile"] .ui-modes { gap: 6px; }

/* 界面模式按钮 */
.ui-modes { display: inline-flex; gap: 8px; }
.ui-row { align-items: center; }
/* 弹层改成贴视口整屏（覆盖任意父级的内缩） */
body[data-ui="mobile"] .hub-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(4,6,9,.94);
}
body[data-ui="mobile"] .title-settings { position: fixed; inset: 0; z-index: 70; }

/* 跨设备同步 */
.sync-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0 6px; }
.sync-input {
  flex: 1; min-width: 140px; height: 32px; padding: 0 10px;
  border-radius: 8px; box-sizing: border-box;
  background: rgba(6,9,13,.95); border: 1px solid rgba(140,165,200,.45);
  color: #eaf1fa; font-size: 13px; letter-spacing: .1em;
}
.sync-input:focus { outline: none; border-color: var(--amber); }
