/* v273：只用自带 OFL 字体 —— 禁止 微软雅黑 / 苹方 / 冬青黑 等无授权系统字体 */
@font-face {
  font-family: "SanguoNoto";
  src: url("../assets_fonts/NotoSansSC-Light.subset.ttf") format("truetype");
  font-weight: 200 350;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "SanguoNoto";
  src: url("../assets_fonts/NotoSansSC-Regular.subset.ttf") format("truetype");
  font-weight: 351 550;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "SanguoNoto";
  src: url("../assets_fonts/NotoSansSC-Bold.subset.otf") format("opentype");
  font-weight: 551 900;
  font-style: normal;
  font-display: swap;
}
﻿/* ===========================================================
   三国回响 · 样式
   =========================================================== */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: #0b0e14;
  color: #e8edf5;
  font-family: "SanguoNoto", "Noto Sans SC", system-ui, sans-serif;
  font-size: 14px;
  overflow-x: hidden;
}
#app { min-height: 100vh; }
.screen { min-height: 100vh; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
b, strong { font-weight: 700; }
small { font-weight: 400; }

/* ---------- 通用按钮 ---------- */
.primary {
  background: linear-gradient(135deg, #7c5cff, #5b3fd6);
  color: #fff; border: 0; border-radius: 10px;
  padding: 11px 22px; font-size: 14px; font-weight: 700;
  box-shadow: 0 6px 20px rgba(124, 92, 255, .3);
  transition: transform .12s, box-shadow .12s;
}
.primary:hover { transform: translateY(-2px); box-shadow: 0 8px 26px rgba(124, 92, 255, .45); }
.primary.big { padding: 15px 40px; font-size: 17px; letter-spacing: 1px; }
.ghost {
  background: rgba(255, 255, 255, .06); color: #c9d2df;
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 9px;
  padding: 9px 15px; font-size: 13px;
}
.ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.panel {
  background: #131822; border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 14px; padding: 18px;
}
.panel h2 { margin: 0 0 14px; font-size: 16px; letter-spacing: .5px; }
.panel h2 small { color: #7e8b9c; font-size: 12px; font-weight: 400; margin-left: 8px; }

/* ---------- 主菜单 ---------- */
.homehead { text-align: center; padding: 34px 16px 20px; }
.logo {
  width: 62px; height: 62px; line-height: 62px; margin: 0 auto 10px;
  border-radius: 50%; font-size: 34px; color: #fff;
  background: radial-gradient(circle at 35% 30%, #b9a4ff, #6a43e8 60%, #2d1a75);
  box-shadow: 0 0 34px rgba(124, 92, 255, .55), inset 0 -6px 14px rgba(0, 0, 0, .3);
}
.homehead h1 { margin: 0; font-size: 38px; letter-spacing: 6px; font-weight: 800; }
.homehead h1 span { color: #a78bff; }
.tagline { color: #7e8b9c; font-size: 12px; letter-spacing: 2.5px; margin-top: 8px; }
.homesave { margin-top: 14px; color: #ffd54f; font-size: 13px; font-weight: 700; }
.homesave .dot { color: #4a5568; margin: 0 10px; }
.homegrid {
  max-width: 1080px; margin: 0 auto; padding: 0 16px;
  display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px;
}
.mapcards { display: grid; gap: 12px; }
.mapcard {
  position: relative; padding: 14px 16px; border-radius: 12px; cursor: pointer;
  background: linear-gradient(135deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015));
  border: 1px solid rgba(255, 255, 255, .09);
  transition: .15s; overflow: hidden;
}
.mapcard::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--mc, #7c5cff); opacity: .55;
}
.mapcard:hover { border-color: var(--mc, #7c5cff); transform: translateX(2px); }
.mapcard.on { border-color: var(--mc, #7c5cff); background: linear-gradient(135deg, rgba(124, 92, 255, .14), rgba(255, 255, 255, .02)); box-shadow: 0 0 0 1px var(--mc, #7c5cff) inset; }
.mapcard.locked { opacity: .45; filter: grayscale(.6); }
.mapcard-top { display: flex; align-items: center; gap: 10px; }
.mapicon { font-size: 24px; }
.mapname { font-size: 16px; font-weight: 700; }
.clear { font-size: 10px; color: #69f0ae; border: 1px solid #69f0ae; border-radius: 4px; padding: 1px 5px; font-style: normal; margin-left: 6px; }
.mapsub { color: var(--mc, #a78bff); font-size: 10px; letter-spacing: 2px; margin-top: 3px; }
.mapcard p { margin: 8px 0; color: #9aa7b8; font-size: 12px; line-height: 1.65; }
.mech { font-size: 11.5px; color: #c9d2df; background: rgba(0, 0, 0, .25); border-radius: 7px; padding: 7px 9px; line-height: 1.6; }
.mech b { color: #ffd54f; margin-right: 5px; }
.locknote { color: #ff8a80; font-size: 11px; margin-top: 7px; }

.talentlist { display: grid; gap: 7px; }
.talent {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: rgba(255, 255, 255, .035); border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .05);
}
.talent.maxed { border-color: rgba(105, 240, 174, .3); }
.ticon { font-size: 19px; width: 24px; text-align: center; }
.tinfo { flex: 1; min-width: 0; }
.tinfo b { font-size: 13px; }
.tinfo small { color: #7e8b9c; font-size: 11px; margin-left: 6px; }
.tdesc { color: #9aa7b8; font-size: 11px; margin-top: 2px; }
.tbuy {
  background: rgba(255, 213, 79, .14); color: #ffd54f;
  border: 1px solid rgba(255, 213, 79, .35); border-radius: 7px;
  padding: 6px 10px; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.tbuy:hover { background: rgba(255, 213, 79, .26); }
.tbuy.poor { opacity: .4; }
.tmax { color: #69f0ae; font-size: 11px; white-space: nowrap; }
.homefoot { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 22px 16px 8px; }
.homefoot2 { text-align: center; color: #58647a; font-size: 11px; padding-bottom: 26px; }

/* ---------- 版本标签与开发日志 ---------- */
.vertag {
  display: inline-block; margin-left: 8px; vertical-align: middle;
  background: rgba(167, 139, 255, .12); color: #a78bff;
  border: 1px solid rgba(167, 139, 255, .35); border-radius: 999px;
  padding: 2px 10px; font-size: 11px; cursor: pointer;
}
.vertag:hover { background: rgba(167, 139, 255, .26); }
.verhero {
  padding: 18px; margin-bottom: 16px; border-radius: 12px;
  background: linear-gradient(135deg, #1b2130, #121822);
  border: 1px solid rgba(167, 139, 255, .3);
}
.verbig { font-size: 34px; font-weight: 800; color: #a78bff; letter-spacing: 2px; }
.vermeta { color: #9aa7b8; font-size: 12px; margin: 4px 0 10px; }
.verhero p { margin: 0; color: #9aa7b8; font-size: 12px; line-height: 1.8; }
.verhero b { color: #a78bff; }
.verlog { display: flex; flex-direction: column; gap: 10px; }
.veritem { padding: 12px 14px; background: #131822; border: 1px solid rgba(255, 255, 255, .07); border-radius: 10px; }
.veritem.cur { border-color: rgba(167, 139, 255, .5); background: #1a1b2c; }
.verhead { display: flex; align-items: center; gap: 10px; }
.verhead b { color: #a78bff; font-size: 14px; }
.verhead span { color: #6b7789; font-size: 11px; }
.verhead i { color: #69f0ae; font-size: 10px; font-style: normal; border: 1px solid rgba(105, 240, 174, .4); border-radius: 999px; padding: 1px 8px; }
.vertitle { margin: 6px 0 4px; color: #dbe3f0; font-size: 12.5px; font-weight: 700; }
.veritem ul { margin: 0; padding-left: 18px; color: #9aa7b8; font-size: 11.5px; line-height: 1.75; }

/* ---------- 顶栏 ---------- */
.bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 16px; background: #10151f;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  position: sticky; top: 0; z-index: 20;
}
.bartitle { flex: 1; min-width: 180px; }
.bartitle b { display: block; font-size: 15px; }
.bartitle small { display: block; color: #7e8b9c; font-size: 11px; margin-top: 2px; line-height: 1.4; }
.runstat { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: #9aa7b8; }
.st b { color: #fff; font-size: 13px; }

/* ---------- 路线图 ---------- */
.mapbody { max-width: 940px; margin: 0 auto; padding: 18px 16px 40px; display: flex; gap: 20px; align-items: flex-start; }
.mapwrap { position: relative; width: 420px; min-width: 420px; margin: 0 auto; }
.maplines { position: absolute; left: 0; top: 0; pointer-events: none; }
.mlink { stroke: rgba(255, 255, 255, .12); stroke-width: 2; stroke-dasharray: 4 5; }
.mlink.hot { stroke: rgba(167, 139, 255, .85); stroke-width: 2.5; stroke-dasharray: none; }
.mapnodes { position: absolute; left: 0; top: 0; width: 420px; height: 100%; }
.floorlabel { position: absolute; left: 0; width: 56px; text-align: right; color: #58647a; font-size: 10px; letter-spacing: 1px; }
.node {
  position: absolute; width: 60px; height: 44px; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #1a2130; border: 1px solid rgba(255, 255, 255, .1);
  font-size: 10px; color: #9aa7b8; transition: .15s;
}
.node .nicon { font-size: 17px; line-height: 1.1; }
.node .nname { margin-top: 2px; }
.node.dim { opacity: .28; }
.node.done { opacity: .6; border-color: rgba(105, 240, 174, .4); }
.node.avail {
  cursor: pointer; opacity: 1; color: #fff;
  border-color: #a78bff; background: #2a2246;
  box-shadow: 0 0 0 2px rgba(167, 139, 255, .2), 0 0 18px rgba(124, 92, 255, .45);
  animation: pulse 1.8s infinite;
}
.node.avail:hover { transform: scale(1.12); background: #3a2d63; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 2px rgba(167, 139, 255, .2), 0 0 14px rgba(124, 92, 255, .35); } 50% { box-shadow: 0 0 0 3px rgba(167, 139, 255, .35), 0 0 24px rgba(124, 92, 255, .65); } }
.node.boss { border-color: #ff5252; }
.node.boss.avail { border-color: #ff5252; background: #40202a; box-shadow: 0 0 18px rgba(255, 82, 82, .5); }
.node.elite { border-color: #ff8a80; }
.node.shop { border-color: #ffd54f; }
.node.rest { border-color: #69f0ae; }
.node.treasure { border-color: #64d8ff; }
.node.event { border-color: #b388ff; }
.sidebar { flex: 1; min-width: 220px; }
.bag { background: #131822; border: 1px solid rgba(255, 255, 255, .07); border-radius: 12px; padding: 14px; }
.bagtitle { font-size: 12px; color: #9aa7b8; margin: 4px 0 8px; letter-spacing: 1px; }
.bagtitle small { color: #58647a; }
.baglist { display: flex; flex-wrap: wrap; gap: 6px; }
.bagitem {
  width: 74px; padding: 7px 5px; text-align: center; border-radius: 8px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--bc, #7c5cff);
}
.bagitem .bicon { display: block; font-size: 19px; color: var(--bc, #7c5cff); }
.bagitem b { display: block; font-size: 10.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bagitem small { display: block; font-size: 9px; color: #7e8b9c; }
.relicbar { display: flex; flex-wrap: wrap; gap: 5px; }
.relicchip { font-size: 10.5px; padding: 4px 7px; border-radius: 6px; background: rgba(255, 213, 79, .1); border: 1px solid rgba(255, 213, 79, .3); color: #ffd54f; }
.blessline { margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .07); color: #7e8b9c; font-size: 10.5px; line-height: 1.6; }
.maptip { margin-top: 12px; color: #7e8b9c; font-size: 11px; line-height: 1.7; background: rgba(255, 255, 255, .03); border-radius: 9px; padding: 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.lg { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: #9aa7b8; }
.lg i { font-style: normal; font-size: 13px; }

/* ---------- 战斗 ---------- */
#scBattle { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.battlebar { gap: 18px; padding: 10px 22px; flex: 0 0 auto; }
.hstat { display: flex; flex-direction: column; min-width: 52px; }
.hstat span { color: #7e8b9c; font-size: 10px; letter-spacing: 1px; }
.hstat b { font-size: 16px; color: #fff; }
.barbtns { margin-left: auto; display: flex; gap: 8px; }
.canvaswrap {
  position: relative;
  display: flex; justify-content: center; align-items: center;
  flex: 1 1 auto; min-height: 0; padding: 8px;
}
#game { display: block; border-radius: 12px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); touch-action: none; }
.skillbtn b { display: block; font-size: 22px; line-height: 1.1; }
.skillbtn small { display: block; font-size: 10px; line-height: 1.2; margin-top: 1px; }
.skillbtn.ready b { font-size: 26px; }
.skilldock { position: absolute; left: 14px; bottom: 14px; z-index: 5; pointer-events: none; }
.skilldock .skillbtn { pointer-events: auto; }

/* ---------- 通用面板 ---------- */
.panelwrap { max-width: 1000px; margin: 0 auto; padding: 22px 16px 40px; }
.panelbody { min-height: 200px; }
.panelfoot { margin-top: 20px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.footnote { color: #7e8b9c; font-size: 11.5px; text-align: center; }

/* ---------- 三国武将 ---------- */
.generalgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.generalcard {
  position: relative; padding: 15px 14px; border-radius: 13px; cursor: pointer;
  background: linear-gradient(160deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .015));
  border: 1px solid rgba(255, 255, 255, .1); transition: .16s; overflow: hidden;
}
.generalcard::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--gc, #ffd54f);
}
.generalcard:hover { transform: translateY(-3px); border-color: var(--gc, #ffd54f); }
.generalcard.on {
  border-color: var(--gc, #ffd54f); box-shadow: 0 0 0 1px var(--gc, #ffd54f) inset;
  background: linear-gradient(160deg, rgba(255, 213, 79, .12), rgba(255, 255, 255, .02));
}
.generalcard.locked { opacity: .55; filter: grayscale(.5); }
.ghead { display: flex; align-items: center; gap: 10px; }
.gicon { font-size: 28px; color: var(--gc, #ffd54f); line-height: 1; }
.gname b { display: block; font-size: 15px; }
.gname small { display: block; color: #7e8b9c; font-size: 10.5px; margin-top: 2px; }
.gskill { margin: 10px 0 6px; font-size: 13px; color: var(--gc, #ffd54f); font-weight: 700; }
.gdesc { color: #9aa7b8; font-size: 11.5px; line-height: 1.7; margin: 0 0 8px; min-height: 38px; }
.gsdesc { color: #c9d2df; font-size: 11.5px; line-height: 1.7; margin: 0 0 10px; }
/* v134：技能2 的名称与说明（青色区分技能1） */
.gskill.gskill2 { color: #7fd7ef; margin-top: 2px; }
.gskill.gskill2 + .gsdesc { margin-bottom: 10px; }
.gfoot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.grage { color: #7e8b9c; font-size: 10.5px; }
.gbtn {
  background: rgba(255, 213, 79, .14); color: #ffd54f;
  border: 1px solid rgba(255, 213, 79, .4); border-radius: 7px;
  padding: 6px 10px; font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.gbtn:hover { background: rgba(255, 213, 79, .26); }
.gbtn.poor { opacity: .45; }
.gbtn.on { background: rgba(105, 240, 174, .16); color: #69f0ae; border-color: rgba(105, 240, 174, .4); }

/* ---------- 怒气 / 技能键 ---------- */
.ragehud { min-width: 92px; }
.ragehud span b { color: #ffd54f; font-size: 11px; }
.ragebar { width: 100%; height: 6px; margin-top: 4px; border-radius: 4px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.ragebar i { display: block; height: 100%; width: 0%; border-radius: 4px; background: linear-gradient(90deg, #ff8a65, #ffd54f); transition: width .12s; }
.ragebar.full i { background: linear-gradient(90deg, #ffd54f, #fff); box-shadow: 0 0 10px #ffd54f; }
.skillbtn {
  background: linear-gradient(135deg, rgba(124, 92, 255, .35), rgba(255, 213, 79, .22));
  color: #c9d2df; border: 2px solid rgba(167, 139, 255, .6); border-radius: 50%;
  width: 74px; height: 74px; padding: 0; font-size: 12px; font-weight: 800; line-height: 1.2;
  white-space: normal; text-align: center; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .5); touch-action: manipulation;
}
.skillbtn.ready {
  color: #fff; border-color: #ffd54f;
  background: linear-gradient(135deg, #ff8a65, #ffd54f);
  box-shadow: 0 0 18px rgba(255, 213, 79, .6);
  animation: skillPulse 1.1s infinite;
}
.skillbtn.active { color: #fff; border-color: #a78bff; background: linear-gradient(135deg, #7c5cff, #5b3fd6); }
@keyframes skillPulse { 0%, 100% { box-shadow: 0 0 10px rgba(255, 213, 79, .35); } 50% { box-shadow: 0 0 22px rgba(255, 213, 79, .8); } }

/* ---------- 战后奖励 ---------- */
.rewardgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.reward {
  padding: 20px 16px; border-radius: 13px; cursor: pointer; text-align: center;
  background: linear-gradient(160deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .015));
  border: 1px solid rgba(255, 255, 255, .1); transition: .16s;
}
.reward:hover { transform: translateY(-4px); border-color: var(--rc, #a78bff); box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
.reward.fusion { border-color: rgba(255, 213, 79, .5); background: linear-gradient(160deg, rgba(255, 213, 79, .12), rgba(255, 255, 255, .02)); }
.ricon { font-size: 36px; color: var(--rc, #a78bff); text-shadow: 0 0 20px var(--rc, #a78bff); margin-bottom: 8px; }
.reward b { display: block; font-size: 15px; margin-bottom: 8px; }
.reward p { color: #9aa7b8; font-size: 12px; line-height: 1.7; margin: 0 0 12px; min-height: 60px; }
.rkind { font-size: 10.5px; color: var(--rc, #a78bff); border: 1px solid currentColor; border-radius: 20px; padding: 3px 10px; }
.rewardutil { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.rewardutil button[disabled] { opacity: .45; cursor: default; }

/* 商店指定删除弹珠 */
.delpick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.delitem {
  padding: 12px 10px; border-radius: 10px; cursor: pointer; text-align: center;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .1); transition: .15s;
}
.delitem:hover { transform: translateY(-2px); border-color: var(--dc, #ff8a80); }
.delitem .dicon { display: block; font-size: 26px; color: var(--dc, #ff8a80); }
.delitem b { display: block; font-size: 12.5px; margin: 4px 0 2px; }
.delitem small { display: block; color: #7e8b9c; font-size: 10px; }
.delitem .delbtn { display: inline-block; margin-top: 8px; font-size: 10.5px; color: #ff8a80; border: 1px solid rgba(255, 138, 128, .5); border-radius: 6px; padding: 2px 10px; }

/* ---------- 商店 / 选择 ---------- */
.shopgrid, .choicegrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.shopitem, .choice {
  padding: 16px; border-radius: 12px; text-align: center; cursor: pointer;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .1);
  transition: .15s;
}
.shopitem:hover, .choice:hover { transform: translateY(-3px); border-color: var(--sc, #a78bff); }
.sicon, .cicon2 { font-size: 30px; color: var(--sc, #ffd54f); margin-bottom: 8px; }
.choice .cicon2 { color: #a78bff; }
.shopitem b, .choice b { display: block; font-size: 13.5px; margin-bottom: 6px; }
.shopitem p, .choice p { color: #9aa7b8; font-size: 11.5px; line-height: 1.6; margin: 0 0 10px; min-height: 38px; }
.price { color: #ffd54f; font-size: 12px; font-weight: 700; }
.shopitem.sold { opacity: .35; cursor: default; }
.shopitem.sold:hover { transform: none; }
.shopitem.poor .price { color: #ff8a80; }

/* ---------- 宝箱 / 事件 / 结算 ---------- */
.treasurebox, .eventbox, .resultbox, .eventresult { text-align: center; padding: 22px; background: #131822; border: 1px solid rgba(255, 255, 255, .08); border-radius: 14px; }
.ticon2, .evicon, .ericon { font-size: 50px; margin-bottom: 10px; }
.treasurebox h3 { margin: 0 0 14px; }
.tline { color: #c9d2df; font-size: 13px; margin: 6px 0; }
.tline b { color: #ffd54f; }
.evtext { color: #c9d2df; font-size: 14px; line-height: 1.9; max-width: 620px; margin: 0 auto 20px; }
.evopts { display: grid; gap: 9px; max-width: 560px; margin: 0 auto; }
.evopt {
  padding: 12px 16px; border-radius: 10px; cursor: pointer; text-align: left;
  background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .1);
  transition: .15s;
}
.evopt:hover { border-color: #a78bff; background: rgba(124, 92, 255, .12); transform: translateX(3px); }
.evopt b { display: block; font-size: 13.5px; }
.evopt small { display: block; color: #9aa7b8; font-size: 11.5px; margin-top: 3px; }
.evopt.disabled { opacity: .35; cursor: not-allowed; }
.evopt.disabled:hover { transform: none; border-color: rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .045); }
.eventresult p { font-size: 14px; line-height: 1.9; color: #c9d2df; max-width: 560px; margin: 0 auto; }
.resultbox.win { border-color: rgba(255, 213, 79, .4); background: linear-gradient(160deg, rgba(255, 213, 79, .09), #131822); }
.resultbox.lose { border-color: rgba(255, 82, 82, .3); }
.rbig { font-size: 30px; font-weight: 800; letter-spacing: 2px; }
.rsub { color: #9aa7b8; font-size: 13px; margin: 6px 0 20px; }
.rstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 480px; margin: 0 auto 18px; }
.rstats > div { background: rgba(255, 255, 255, .04); border-radius: 9px; padding: 10px; }
.rstats b { display: block; font-size: 19px; color: #fff; }
.rstats span { color: #7e8b9c; font-size: 10.5px; }
.rgain { font-size: 15px; color: #ffd54f; }
.runlock { margin-top: 12px; color: #69f0ae; font-size: 13px; }

/* ---------- 图鉴 / 帮助 ---------- */
.codexgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 9px; }
.codexitem { padding: 12px 10px; border-radius: 10px; text-align: center; background: rgba(255, 255, 255, .04); border: 1px solid var(--cc, #7c5cff); }
.codexitem.unseen { opacity: .34; filter: grayscale(1); border-color: rgba(255, 255, 255, .1); }
.cicon { font-size: 26px; color: var(--cc, #7c5cff); }
.codexitem b { display: block; font-size: 12.5px; margin: 4px 0; }
.codexitem small { display: block; color: #9aa7b8; font-size: 10.5px; line-height: 1.5; min-height: 32px; }
.rarer { display: inline-block; margin-top: 6px; font-size: 9.5px; padding: 2px 7px; border-radius: 10px; border: 1px solid currentColor; }
.rarer0 { color: #9aa7b8; } .rarer1 { color: #64d8ff; } .rarer2 { color: #ffd54f; } .rarer3 { color: #ff8a80; }
.sect { font-size: 14px; margin: 24px 0 10px; color: #c9d2df; }
.fusionlist, .reliclist { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.fusion, .relicitem { padding: 9px 12px; background: rgba(255, 255, 255, .04); border-radius: 8px; font-size: 12px; }
.fusion span { color: #7e8b9c; margin: 0 4px; }
.relicitem span { font-size: 17px; margin-right: 6px; }
.relicitem b { font-size: 12px; }
.relicitem small { display: block; color: #9aa7b8; font-size: 10.5px; margin-top: 3px; line-height: 1.5; }
.helpgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.helpbox { padding: 16px; background: #131822; border: 1px solid rgba(255, 255, 255, .07); border-radius: 12px; }
.helpbox h3 { margin: 0 0 8px; font-size: 14px; }
.helpbox p { margin: 0; color: #9aa7b8; font-size: 12px; line-height: 1.85; }
.helpbox b { color: #a78bff; }

/* ---------- 音量控制 ---------- */
.audiobox {
  position: fixed; right: 10px; bottom: 10px; z-index: 90;
  display: flex; align-items: center; gap: 8px;
  max-width: calc(100vw - 20px); padding: 6px 8px;
  background: rgba(16, 21, 31, .88); border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 12px; box-shadow: 0 6px 24px rgba(0, 0, 0, .5);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: 11px; color: #9aa7b8;
}
.audiobox .afold {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px;
  background: rgba(124, 92, 255, .16); border: 1px solid rgba(167, 139, 255, .4);
  font-size: 17px; line-height: 1; color: #fff; padding: 0;
}
.audiobox .audiocontrols { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.audiobox.folded .audiocontrols { display: none; }
.audiobox .atitle { color: #ffd54f; font-weight: 700; white-space: nowrap; }
.audiobox label { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.audiobox .avoicelabel { color: #ffd54f; cursor: pointer; }
.audiobox input[type="checkbox"] { width: 14px; height: 14px; accent-color: #ffd54f; cursor: pointer; }
.audiobox input[type="range"] {
  width: 74px; height: 4px; accent-color: #a78bff; cursor: pointer;
}
.audiobox .aval { color: #c9d2df; min-width: 30px; text-align: right; font-variant-numeric: tabular-nums; }
.audiobox .amute {
  background: rgba(255, 82, 82, .14); color: #ff8a80;
  border: 1px solid rgba(255, 82, 82, .4); border-radius: 7px;
  padding: 6px 9px; font-size: 11px; white-space: nowrap;
}
.audiobox .amute:hover { background: rgba(255, 82, 82, .26); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px);
  background: #232b3b; color: #fff; padding: 11px 20px; border-radius: 10px;
  font-size: 13px; box-shadow: 0 8px 30px rgba(0, 0, 0, .55);
  border: 1px solid rgba(255, 255, 255, .12);
  opacity: 0; pointer-events: none; transition: .25s; z-index: 99; max-width: 88vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.good { border-color: rgba(105, 240, 174, .6); }
.toast.bad { border-color: rgba(255, 82, 82, .6); }

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  .homegrid { grid-template-columns: 1fr; }
  .homehead { padding: 22px 14px 14px; }
  .homehead h1 { font-size: 30px; }
  .logo { width: 52px; height: 52px; line-height: 52px; font-size: 28px; }
  .mapbody { flex-direction: column; gap: 12px; padding: 12px 10px 30px; }
  .mapwrap { min-width: 0; width: 100%; max-width: 420px; margin: 0 auto; }
  .mapnodes { height: 100%; }
  .floorlabel { width: 40px; font-size: 9px; }
  .sidebar { width: 100%; min-width: 0; }
  .bagitem { width: 70px; }

  /* 战斗：HUD 压缩为两行，画布尽量占满，按钮加大好点 */
  .battlebar { gap: 6px 10px; padding: 7px 10px; }
  .hstat { min-width: 0; flex: 1 1 auto; }
  .hstat span { font-size: 9px; letter-spacing: 0; }
  .hstat b { font-size: 14px; }
  .battlebar #hJamWrap, .battlebar .ragehud { flex-basis: 100%; }  /* 干扰条与怒气条各占一行 */
  .barbtns { width: 100%; margin-left: 0; gap: 8px; }
  .barbtns button { flex: 1; padding: 9px 6px; font-size: 12px; }
  .skilldock { left: 10px; bottom: 10px; }
  .skilldock .skillbtn { width: 78px; height: 78px; font-size: 12px; }
  #hJamWrap b { font-size: 11px; line-height: 1.3; }
  .canvaswrap { padding: 4px; }
  .rstats { grid-template-columns: repeat(3, 1fr); }

  /* 面板卡片触控友好 */
  .reward, .shopitem, .choice, .evopt { padding: 14px; }
  .primary, .ghost, .tbuy, .amute { min-height: 40px; }

  /* 音量面板：收起态只显示喇叭，展开态横排不超屏 */
  .audiobox { right: 8px; bottom: 8px; left: 8px; justify-content: flex-end; padding: 6px; }
  .audiobox .audiocontrols { gap: 7px; }
  .audiobox input[type="range"] { width: 56px; }
  .audiobox.folded { left: auto; }
}

@media (max-width: 380px) {
  .hstat b { font-size: 12.5px; }
  .audiobox input[type="range"] { width: 44px; }
}

/* 横屏矮屏：压缩顶部，给画布留高度 */
@media (max-height: 480px) and (orientation: landscape) {
  .battlebar { padding: 5px 10px; }
  .hstat span { display: none; }
}


/* ================= v33 首页四大按钮 / 难度 / 设置 ================= */
.homebuttons { display: grid; gap: 12px; max-width: 520px; margin: 0 auto; padding: 8px 16px 20px; }
.bigbtn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 16px 20px; border-radius: 14px; cursor: pointer; text-align: left;
  background: linear-gradient(135deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.12); color: #e8eefc;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.bigbtn b { font-size: 19px; letter-spacing: 2px; }
.bigbtn small { color: #8e9bb0; font-size: 12px; }
.bigbtn:hover { transform: translateY(-1px); border-color: rgba(167,139,255,.55); }
.bigbtn.primarybig {
  background: linear-gradient(135deg, rgba(124,92,255,.30), rgba(255,213,79,.12));
  border-color: rgba(167,139,255,.75);
  box-shadow: 0 0 0 1px rgba(167,139,255,.18) inset, 0 6px 24px rgba(90,60,200,.25);
}
.bigbtn.primarybig b { font-size: 21px; }

.diffgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .diffgrid { grid-template-columns: 1fr; } }
.diffcard {
  padding: 16px; border-radius: 12px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.03);
  transition: border-color .12s ease, transform .12s ease;
}
.diffcard .dicon { font-size: 26px; }
.diffcard b { display: block; margin: 6px 0 4px; font-size: 16px; }
.diffcard p { margin: 0; color: #9aa7b8; font-size: 12px; line-height: 1.7; }
.diffcard:hover { transform: translateY(-1px); border-color: var(--dc, #7c5cff); }
.diffcard.on { border-color: var(--dc, #7c5cff); background: rgba(124,92,255,.14); box-shadow: 0 0 0 1px var(--dc, #7c5cff) inset; }
.progline { margin-top: 16px; padding: 10px 12px; border-radius: 10px; background: rgba(255,213,79,.08); border: 1px solid rgba(255,213,79,.25); color: #ffd54f; font-size: 12.5px; }

.setbox { margin-bottom: 18px; padding: 14px 16px; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.1); }
.setbox h3 { margin: 0 0 10px; font-size: 14px; }
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed rgba(255,255,255,.08); }
.setrow:last-child { border-bottom: 0; }
.setrow b { font-size: 13px; font-weight: 600; }
.keycap { min-width: 96px; text-align: center; padding: 6px 10px; border-radius: 8px; cursor: pointer; font-size: 12px; color: #ffd54f; background: rgba(255,213,79,.10); border: 1px solid rgba(255,213,79,.35); }
.keycap.wait { color: #69f0ae; border-color: rgba(105,240,174,.6); background: rgba(105,240,174,.12); }
.settip { color: #7e8b9c; font-size: 12px; line-height: 1.7; margin: 10px 0; }
.setvol { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.setvol label { flex: 0 0 74px; font-size: 13px; }
.setvol input[type=range] { flex: 1; }
.setvol span { flex: 0 0 46px; text-align: right; font-size: 12px; color: #9aa7b8; }


/* ================= v34 出征前选将 ================= */
.pickgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pickcard {
  position: relative; padding: 12px 10px 10px; border-radius: 12px; cursor: pointer; text-align: center;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.12);
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.pickcard:hover { transform: translateY(-2px); border-color: var(--pc, #7c5cff); }
.pickcard.on { border-color: var(--pc, #7c5cff); background: rgba(124,92,255,.14); box-shadow: 0 0 0 1px var(--pc, #7c5cff) inset; }
.pickface { width: 84px; height: 84px; margin: 0 auto 8px; border-radius: 50%; overflow: hidden; background: #0c1220; border: 2px solid var(--pc, #7c5cff); }
.pickface img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pickcard b { display: block; font-size: 15px; letter-spacing: 1px; }
.pickcard small { display: block; margin-top: 3px; color: #b9c6da; font-size: 12px; }
.pickcard .picksub { display: block; margin-top: 4px; color: #7e8b9c; font-size: 11px; }
.picktimer { margin-top: 14px; text-align: center; color: #9aa7b8; font-size: 13px; }
.picktimer b { color: #ffd54f; font-size: 18px; margin: 0 2px; }


/* ================= v41 设置分页 ================= */
.setTabs { display: flex; gap: 8px; margin: 0 0 14px; flex-wrap: wrap; }
.setTab {
  padding: 9px 14px; border-radius: 10px; cursor: pointer; font-size: 13px;
  color: #b9c6da; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12);
  transition: color .12s ease, border-color .12s ease, background .12s ease;
}
.setTab:hover { color: #fff; border-color: rgba(167,139,255,.5); }
.setTab.on {
  color: #fff; border-color: rgba(167,139,255,.85); background: rgba(124,92,255,.22);
  box-shadow: 0 0 0 1px rgba(167,139,255,.25) inset;
}


/* ================= v47 键位提示 / 起点选择 ================= */
.keyhint {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: 6px; font-size: 11px; color: rgba(220,230,245,.55);
  background: rgba(6,10,18,.55); padding: 3px 10px; border-radius: 8px;
  pointer-events: none; white-space: nowrap; letter-spacing: .5px;
}
.startpick { display: flex; gap: 10px; align-items: center; margin: 14px 0 4px; color: #b9c6da; font-size: 13px; flex-wrap: wrap; }
.startbtn {
  padding: 8px 14px; border-radius: 10px; cursor: pointer; font-size: 13px;
  color: #b9c6da; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.14);
}
.startbtn:hover { color: #fff; border-color: rgba(167,139,255,.55); }
.startbtn.on { color: #fff; border-color: rgba(167,139,255,.85); background: rgba(124,92,255,.22); }

/* ---- v66 敌军兵种 ---- */
.troopline { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; font-size: 11px; color: #9fb3c8; }
.troopchip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 999px;
  font-size: 10.5px; color: var(--tc, #cfd8dc); background: rgba(255,255,255,.05);
  border: 1px solid color-mix(in srgb, var(--tc, #cfd8dc) 45%, transparent); }

/* ---- v74 晶核余额条 ---- */
.crystalbar { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 10px 16px;
  border-radius: 12px; background: linear-gradient(90deg, rgba(124,77,255,.24), rgba(0,229,255,.10));
  border: 1px solid rgba(180,160,255,.45); box-shadow: inset 0 0 18px rgba(124,77,255,.22); }
.crystalbar .cbaricon { font-size: 24px; line-height: 1; filter: drop-shadow(0 0 8px #b388ff); }
.crystalbar .cbarlabel { font-size: 13px; letter-spacing: .12em; color: #cfc6ff; }
.crystalbar .cbarnum { margin-left: auto; font-size: 26px; font-weight: 800; color: #fff;
  font-variant-numeric: tabular-nums; text-shadow: 0 0 10px rgba(179,136,255,.95), 0 0 22px rgba(0,229,255,.5); }


/* v133：双技能按钮 —— 手机版分置底部左右，避免挤在一起误点 */
.skilldock {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 92px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
  z-index: 40;
}
.skilldock .skillbtn { width: 62px; height: 62px; font-size: 12px; }
.skillbtn2 { background: linear-gradient(160deg, #2b3a55, #16202f); border-color: #7fd7ef; }
.skillbtn2.ready { box-shadow: 0 0 12px #7fd7ef, 0 0 24px rgba(127,215,239,.5); }


/* v106：确保鼠标可点 */
.skilldock { pointer-events: none !important; z-index: 80 !important; }
.skilldock .skillbtn { pointer-events: auto !important; cursor: pointer; touch-action: manipulation; }

/* v135：应用内确认弹窗（替代系统 window.confirm） */
.uiconfirm { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center;
  background: rgba(4, 8, 16, .62); backdrop-filter: blur(2px); }
.uiconfirm.hidden { display: none; }
.uiconfirm .ucbox { width: min(84vw, 380px); padding: 18px 18px 14px; border-radius: 16px;
  background: linear-gradient(160deg, #1b2437, #131a28); border: 1px solid rgba(140,170,220,.35);
  box-shadow: 0 18px 48px rgba(0,0,0,.55); text-align: center; }
.uiconfirm .ucic { font-size: 26px; line-height: 1; margin-bottom: 8px; }
.uiconfirm .ucmsg { color: #dfe7f3; font-size: 14px; line-height: 1.7; margin-bottom: 16px; }
.uiconfirm .ucbtns { display: flex; gap: 10px; }
.uiconfirm .ucbtns button { flex: 1; padding: 11px 0; border-radius: 10px; font-size: 14px; font-weight: 700;
  border: 1px solid rgba(160,180,210,.4); background: rgba(255,255,255,.06); color: #cfd8e6; cursor: pointer;
  touch-action: manipulation; }
.uiconfirm .ucbtns .ucyes { background: linear-gradient(135deg, #3a7bff, #6a5bff); border-color: #8298ff; color: #fff; }
.uiconfirm .ucbtns button:active { transform: scale(.97); }

/* ================= v136：像素三国风 UI（主菜单） ================= */
:root {
  --px-ink: #0b0f1a;
  --px-ink2: #141c2e;
  --px-red: #c8402f;
  --px-gold: #e8c15a;
  --px-jade: #4fd1c5;
  --px-line: #2a3752;
}

/* 主菜单：像素网格底纹 + 暗角 */
#scHome {
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.022) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.022) 0 1px, transparent 1px 8px),
    radial-gradient(120% 80% at 50% 0%, #17223a 0%, #0b0f1a 62%) !important;
}
.pxhead { padding-top: 18px; }
.pxlogo {
  width: 96px; height: 96px; image-rendering: pixelated;
  filter: drop-shadow(0 6px 0 rgba(0,0,0,.55));
  margin-bottom: 4px;
}
/* 标题：无模糊的硬阴影 = 像素描边感 */
.pxtitle {
  margin: 6px 0 6px !important;
  font-size: 40px !important;
  letter-spacing: .16em !important;
  color: #f6f9ff !important;
  text-shadow:
    4px 0 0 #0b0f1a, -4px 0 0 #0b0f1a, 0 4px 0 #0b0f1a, 0 -4px 0 #0b0f1a,
    4px 4px 0 #0b0f1a, -4px 4px 0 #0b0f1a, 4px -4px 0 #0b0f1a, -4px -4px 0 #0b0f1a,
    0 10px 0 rgba(0,0,0,.45) !important;
  -webkit-text-stroke: 1px #0b0f1a;
}
.pxtitle span {
  color: var(--px-gold) !important;
  text-shadow:
    4px 0 0 #0b0f1a, -4px 0 0 #0b0f1a, 0 4px 0 #0b0f1a, 0 -4px 0 #0b0f1a,
    0 10px 0 rgba(0,0,0,.45) !important;
}
.pxcap {
  font-size: 11px !important;
  letter-spacing: .22em !important;
  color: #8fa2bd !important;
  text-transform: uppercase;
}
/* 存档信息：像素胶囊 */
.pxchips { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 10px; }
.pxchips span {
  padding: 5px 10px;
  font-size: 12px; font-weight: 700; letter-spacing: .06em;
  color: var(--px-gold);
  background: var(--px-ink2);
  border: 2px solid var(--px-line);
  box-shadow: 0 3px 0 #070a12;
  border-radius: 2px;
}
.pxchips .dot { display: none; }

/* 主按钮：像素边框 + 硬阴影，去掉圆角渐变 */
#scHome .bigbtn {
  border-radius: 2px !important;
  border: 3px solid var(--px-line) !important;
  background: linear-gradient(180deg, #1b2540 0%, #141c2e 100%) !important;
  box-shadow: 0 5px 0 #070a12 !important;
  padding: 12px 14px !important;
  text-align: left !important;
  transition: transform .06s linear, box-shadow .06s linear;
}
#scHome .bigbtn b { font-size: 17px !important; letter-spacing: .08em; color: #eaf1ff; }
#scHome .bigbtn small { color: #7f90ab !important; font-size: 11px !important; letter-spacing: .04em; }
#scHome .bigbtn:active { transform: translateY(4px); box-shadow: 0 1px 0 #070a12 !important; }
#scHome .bigbtn.primarybig {
  border-color: var(--px-gold) !important;
  background: linear-gradient(180deg, #3a2f18 0%, #241c10 100%) !important;
  box-shadow: 0 5px 0 #070a12, inset 0 0 0 2px rgba(232,193,90,.18) !important;
}
#scHome .bigbtn.primarybig b { color: var(--px-gold); }
/* 底部小按钮 */
#scHome .vertag {
  border-radius: 2px !important;
  border: 2px solid var(--px-line) !important;
  background: var(--px-ink2) !important;
  box-shadow: 0 3px 0 #070a12 !important;
}

/* v136：像素徽记（覆盖旧的紫色圆环 logo 样式） */
.homehead .logo.pxlogo {
  width: 112px; height: 112px;
  border-radius: 0;
  background: none;
  box-shadow: none;
  line-height: 0;
  margin: 0 auto 6px;
  image-rendering: pixelated;
  filter: drop-shadow(0 6px 0 rgba(0,0,0,.55));
}

/* ================= v137：Kenney micro-roguelike 素材版 UI ================= */
body.ui-b #scHome {
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.03) 0 1px, transparent 1px 8px),
    #0a0d14 !important;
}
body.ui-b .pxtitle { color: #f2f6ff !important; }
body.ui-b .pxtitle span { color: #f4c752 !important; }
/* 按钮：Kenney 墙砖九宫格边框 */
body.ui-b #scHome .bigbtn {
  position: relative;
  border: 8px solid transparent;
  border-image: url(../img/ui/kenney/frame_mono.png) 8 repeat;
  border-radius: 0 !important;
  background: #10131c !important;
  box-shadow: none !important;
  padding: 6px 10px 6px 52px !important;
  min-height: 56px;
  text-align: left !important;
}
body.ui-b #scHome .bigbtn::before {
  content: '';
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px;
  background-repeat: no-repeat; background-size: 32px 32px;
  image-rendering: pixelated;
}
body.ui-b #btnAdventure::before { background-image: url(../img/ui/kenney/icons/adv.png); }
body.ui-b #btnGrowth::before { background-image: url(../img/ui/kenney/icons/grow.png); }
body.ui-b #btnCodexHome::before { background-image: url(../img/ui/kenney/icons/codex.png); }
body.ui-b #btnSettings::before { background-image: url(../img/ui/kenney/icons/settings.png); }
body.ui-b #scHome .bigbtn:active { transform: translateY(2px); }
body.ui-b #scHome .bigbtn.primarybig {
  border-image: url(../img/ui/kenney/frame_color.png) 8 repeat;
  background: #171208 !important;
}
body.ui-b #scHome .bigbtn.primarybig b { color: #ffd76a; }
body.ui-b #scHome .bigbtn b { font-size: 16px !important; }
body.ui-b #scHome .bigbtn small { color: #93a3bb !important; }
body.ui-b .pxchips span { border: 4px solid transparent; border-image: url(../img/ui/kenney/frame_mono.png) 8 repeat;
  background: #10131c; box-shadow: none; border-radius: 0; }
body.ui-b #scHome .vertag { border: 4px solid transparent; border-image: url(../img/ui/kenney/frame_mono.png) 8 repeat;
  background: #10131c !important; box-shadow: none !important; }

/* v137 修正：Kenney 版的存档胶囊不要用 border-image（会盖住文字） */
body.ui-b .pxchips span {
  border: 2px solid #3b4a63 !important;
  border-image: none !important;
  background: #10131c !important;
  box-shadow: 0 3px 0 #070a12 !important;
  color: #f4c752 !important;
}

/* ================= v138：Kenney B2（更厚边框 + 图标框 + 装饰条） ================= */
body.ui-b2 #scHome {
  background:
    repeating-linear-gradient(0deg, rgba(120,180,255,.045) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(90deg, rgba(120,180,255,.045) 0 1px, transparent 1px 8px),
    radial-gradient(120% 70% at 50% 0%, #131a26 0%, #080b12 70%) !important;
}
body.ui-b2 .pxlogo { width: 104px; height: 104px; filter: drop-shadow(0 5px 0 rgba(0,0,0,.6)); }
body.ui-b2 .pxhead { padding-top: 14px; }
/* 装饰条 */
body.ui-b2 .pxhead::after {
  content: ''; display: block; width: 96px; height: 16px; margin: 10px auto 0;
  background: url(../img/ui/kenney/strip.png) no-repeat center/96px 16px;
  image-rendering: pixelated; opacity: .95;
}
/* 主按钮：16px 切片的厚边框 */
body.ui-b2 #scHome .bigbtn {
  position: relative;
  border: 16px solid transparent;
  border-image: url(../img/ui/kenney/frame_2x.png) 16 repeat;
  border-radius: 0 !important;
  background: #0f1420 !important;
  box-shadow: 0 4px 0 #05070c !important;
  padding: 2px 12px 2px 60px !important;
  min-height: 64px;
  text-align: left !important;
}
body.ui-b2 #scHome .bigbtn b { font-size: 17px !important; color: #f2f6ff; letter-spacing: .1em; }
body.ui-b2 #scHome .bigbtn small { color: #9fb1c9 !important; font-size: 11px !important; }
/* 图标：加深色底框 */
body.ui-b2 #scHome .bigbtn::before {
  content: '';
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px;
  background-repeat: no-repeat; background-size: 32px 32px;
  image-rendering: pixelated;
  box-shadow: 0 0 0 2px #0a0e16, 0 0 0 4px #2b3550;
}
body.ui-b2 #scHome .bigbtn:active { transform: translateY(2px); box-shadow: 0 1px 0 #05070c !important; }
body.ui-b2 #btnAdventure::before { background-image: url(../img/ui/kenney/icons/adv.png); }
body.ui-b2 #btnGrowth::before { background-image: url(../img/ui/kenney/icons/grow.png); }
body.ui-b2 #btnCodexHome::before { background-image: url(../img/ui/kenney/icons/codex.png); }
body.ui-b2 #btnSettings::before { background-image: url(../img/ui/kenney/icons/settings.png); }
body.ui-b2 #scHome .bigbtn.primarybig {
  border-image: url(../img/ui/kenney/frame_2x_hot.png) 16 repeat;
  background: #191207 !important;
}
body.ui-b2 #scHome .bigbtn.primarybig b { color: #ffd76a; }
body.ui-b2 .pxchips span {
  border: 8px solid transparent;
  border-image: url(../img/ui/kenney/frame_2x.png) 16 repeat;
  background: #0f1420; box-shadow: none; border-radius: 0; color: #ffd76a; font-size: 11px;
  padding: 0 6px;
}
body.ui-b2 #scHome .vertag {
  border: 8px solid transparent; border-image: url(../img/ui/kenney/frame_2x.png) 16 repeat;
  background: #0f1420 !important; box-shadow: none !important; border-radius: 0;
}

/* v138 修正：B2 的胶囊不要 border-image（会盖住文字）；装饰条下移并降低存在感 */
body.ui-b2 .pxchips { margin-top: 12px; }
body.ui-b2 .pxchips span {
  border: 2px solid #3b4a63 !important;
  border-image: none !important;
  background: #0f1420 !important;
  box-shadow: 0 3px 0 #05070c !important;
  border-radius: 0 !important;
  padding: 5px 10px !important;
  color: #ffd76a !important;
  font-size: 12px !important;
}
body.ui-b2 .pxhead::after {
  margin: 14px auto 0 !important;
  width: 112px !important;
  height: 16px !important;
  background-size: 112px 16px !important;
  opacity: .8 !important;
}

/* ================= v139：B（Kenney）全局统一 ================= */
body.ui-b .pxtitle-img { margin: 2px 0 2px !important; }
body.ui-b .pxtitle-img img {
  display: block; margin: 0 auto;
  width: min(80vw, 300px); height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 5px 0 rgba(0,0,0,.5));
}
/* 面板 */
body.ui-b .panel {
  border: 16px solid transparent;
  border-image: url(../img/ui/kenney/frame_2x.png) 16 repeat;
  border-radius: 0 !important;
  background: #0e1219 !important;
  box-shadow: none !important;
}
body.ui-b .panel h2 { letter-spacing: .14em; }
/* 选择卡（成长/图鉴入口） */
body.ui-b .choice {
  border: 16px solid transparent;
  border-image: url(../img/ui/kenney/frame_2x.png) 16 repeat;
  border-radius: 0 !important;
  background: #10141d !important;
  box-shadow: none !important;
}
body.ui-b .choice:hover { transform: translateY(-2px); }
/* 武将卡 */
body.ui-b .generalcard {
  border: 16px solid transparent;
  border-image: url(../img/ui/kenney/frame_2x.png) 16 repeat;
  border-radius: 0 !important;
  background: #10141d !important;
  box-shadow: none !important;
}
body.ui-b .generalcard.on { border-image: url(../img/ui/kenney/frame_color.png) 8 repeat; }
/* 面板底部按钮 */
body.ui-b .panelfoot button, body.ui-b .panel .primary, body.ui-b .panel .gbtn {
  border: 6px solid transparent;
  border-image: url(../img/ui/kenney/frame_mono.png) 8 repeat;
  border-radius: 0 !important;
  background: #161c28 !important;
  color: #dfe7f3 !important;
  box-shadow: none !important;
  padding: 6px 12px !important;
}
body.ui-b .panel .primary, body.ui-b .panel .gbtn:not(.poor) {
  border-image: url(../img/ui/kenney/frame_color.png) 8 repeat;
  color: #ffd76a !important;
}
/* 路线图节点 */
body.ui-b .node {
  border-radius: 0 !important;
  border: 4px solid transparent;
  border-image: url(../img/ui/kenney/frame_mono.png) 8 repeat;
  background: #10141d;
}
body.ui-b .node.avail { border-image: url(../img/ui/kenney/frame_color.png) 8 repeat; }

/* v139：B 风格覆盖更多界面（奖励/商店/图鉴/设置/按钮/输入） */
body.ui-b .reward, body.ui-b .shopitem, body.ui-b .codexitem {
  border: 16px solid transparent;
  border-image: url(../img/ui/kenney/frame_2x.png) 16 repeat;
  border-radius: 0 !important;
  background: #10141d !important;
  box-shadow: none !important;
}
body.ui-b .reward:hover, body.ui-b .shopitem:hover, body.ui-b .codexitem:hover {
  border-image: url(../img/ui/kenney/frame_color.png) 8 repeat;
  transform: translateY(-2px);
}
body.ui-b .codexitem.unseen {
  border-image: none !important;
  border: 2px solid #232d42 !important;
  background: #0c1017 !important;
}
body.ui-b .rewardutil button, body.ui-b button.ghost, body.ui-b .panel button {
  border: 6px solid transparent;
  border-image: url(../img/ui/kenney/frame_mono.png) 8 repeat;
  border-radius: 0 !important;
  background: #161c28 !important;
  color: #dfe7f3 !important;
  box-shadow: none !important;
}
body.ui-b select, body.ui-b input[type="number"], body.ui-b input[type="range"] {
  border-radius: 0 !important;
  border: 2px solid #3b4a63 !important;
  background: #0f1522 !important;
  color: #e6eefc !important;
}
body.ui-b .setrow { border-bottom: 2px dotted rgba(140,170,210,.16) !important; }
body.ui-b .legend .lg, body.ui-b .legend span {
  border: 4px solid transparent;
  border-image: url(../img/ui/kenney/frame_mono.png) 8 repeat;
  border-radius: 0 !important;
  background: #10141d;
  padding: 3px 8px;
}

/* ================= v136：全量统一 B 风格（按钮 / HUD / 血条 / 提示） ================= */
/* 通用按钮 */
body.ui-b button,
body.ui-b .ghost,
body.ui-b .tbuy,
body.ui-b .vertag,
body.ui-b .gbtn {
  border: 6px solid transparent !important;
  border-image: url(../img/ui/kenney/frame_mono.png) 8 repeat !important;
  border-radius: 0 !important;
  background: #161c28 !important;
  color: #dfe7f3 !important;
  box-shadow: none !important;
  letter-spacing: .06em;
  transition: transform .05s linear;
}
body.ui-b button:active { transform: translateY(2px); }
body.ui-b button:hover,
body.ui-b .ghost:hover,
body.ui-b .tbuy:hover,
body.ui-b .gbtn:hover {
  border-image: url(../img/ui/kenney/frame_color.png) 8 repeat !important;
  color: #ffd76a !important;
}
/* 顶部栏 */
body.ui-b .bar {
  background: #0c111a !important;
  border: 0 !important;
  border-bottom: 4px solid #1d2738 !important;
  box-shadow: none !important;
}
body.ui-b .bartitle b { letter-spacing: .1em; color: #eef4ff; }
body.ui-b .bartitle small { color: #8fa2bd !important; letter-spacing: .04em; }
body.ui-b .runstat {
  border: 6px solid transparent;
  border-image: url(../img/ui/kenney/frame_mono.png) 8 repeat;
  background: #10141d;
  padding: 3px 10px;
  color: #cfd8e6;
}
/* 战斗 HUD 数值格 */
body.ui-b .hstat {
  border: 4px solid transparent;
  border-image: url(../img/ui/kenney/frame_mono.png) 8 repeat;
  background: #10141d;
  padding: 2px 8px;
  min-width: 62px;
}
body.ui-b .hstat span { color: #7f90ab !important; letter-spacing: .04em; }
body.ui-b .hstat b { color: #f2f6ff !important; font-variant-numeric: tabular-nums; }
body.ui-b .ragehud { min-width: 132px; }
/* 怒气条：方角、纯色 */
body.ui-b .ragebar {
  height: 8px !important;
  border-radius: 0 !important;
  border: 2px solid #2b3550;
  border-color: #2b3550 !important;
  background: #0a0e16 !important;
  overflow: hidden;
}
body.ui-b .ragebar i {
  border-radius: 0 !important;
  background: #e8c15a !important;
  box-shadow: none !important;
  transition: width .12s linear;
}
body.ui-b .ragebar.full i { background: #ffe9a3 !important; }
/* 技能按钮：方形砖框 */
body.ui-b .skillbtn {
  width: 64px !important; height: 64px !important;
  border: 8px solid transparent !important;
  border-image: url(../img/ui/kenney/frame_mono.png) 8 repeat !important;
  border-radius: 0 !important;
  background: #12161f !important;
  box-shadow: none !important;
  color: #cfd8e6 !important;
}
body.ui-b .skillbtn.skillbtn2 {
  border-image: url(../img/ui/kenney/frame_color.png) 8 repeat !important;
  background: #101822 !important;
  color: #bfe9f5 !important;
}
body.ui-b .skillbtn.ready {
  border-image: url(../img/ui/kenney/frame_2x_hot.png) 8 repeat !important;
  background: #1a1408 !important;
  color: #ffd76a !important;
  box-shadow: none !important;
}
body.ui-b .skillbtn.skillbtn2.ready {
  border-image: url(../img/ui/kenney/frame_color.png) 8 repeat !important;
  background: #0b1a22 !important;
  color: #8ff0ff !important;
}
body.ui-b .skillbtn.active {
  border-image: url(../img/ui/kenney/frame_2x_hot.png) 8 repeat !important;
  background: #1a1408 !important;
}
/* 提示条 / 金色胶囊 / 图例 */
body.ui-b .keyhint {
  border: 6px solid transparent;
  border-image: url(../img/ui/kenney/frame_mono.png) 8 repeat;
  background: #0c111a !important;
  border-radius: 0 !important;
  color: #9fb1c9 !important;
}
body.ui-b .toast {
  border: 8px solid transparent;
  border-image: url(../img/ui/kenney/frame_mono.png) 8 repeat;
  background: #10141d !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
body.ui-b .toast.good { border-image: url(../img/ui/kenney/frame_color.png) 8 repeat; }
body.ui-b .bag, body.ui-b .maptip {
  border: 8px solid transparent;
  border-image: url(../img/ui/kenney/frame_mono.png) 8 repeat;
  background: #10141d !important;
  border-radius: 0 !important;
}

/* v138：开始冒险（难度选择）与帮助框等剩余部件 */
body.ui-b .diffcard {
  border: 16px solid transparent;
  border-image: url(../img/ui/kenney/frame_2x.png) 16 repeat;
  border-radius: 0 !important;
  background: #10141d !important;
  box-shadow: none !important;
  color: #dfe7f3;
}
body.ui-b .diffcard.on {
  border-image: url(../img/ui/kenney/frame_2x_hot.png) 16 repeat;
  background: #171208 !important;
}
body.ui-b .diffcard b { letter-spacing: .08em; }
body.ui-b .diffcard p { color: #9fb1c9 !important; }
body.ui-b .progline {
  border: 8px solid transparent;
  border-image: url(../img/ui/kenney/frame_color.png) 8 repeat;
  border-radius: 0 !important;
  background: #141005 !important;
  color: #ffd76a !important;
  padding: 8px 12px;
  box-shadow: none !important;
}
body.ui-b .startbtn {
  border: 8px solid transparent !important;
  border-image: url(../img/ui/kenney/frame_mono.png) 8 repeat !important;
  border-radius: 0 !important;
  background: #161c28 !important;
  color: #cfd8e6 !important;
  box-shadow: none !important;
}
body.ui-b .startbtn.on {
  border-image: url(../img/ui/kenney/frame_2x_hot.png) 8 repeat !important;
  background: #171208 !important;
  color: #ffd76a !important;
}
body.ui-b .footnote { color: #8296b0 !important; }
body.ui-b .helpbox {
  border: 16px solid transparent;
  border-image: url(../img/ui/kenney/frame_2x.png) 16 repeat;
  border-radius: 0 !important;
  background: #10141d !important;
  box-shadow: none !important;
}
body.ui-b .helpbox h3 { color: #ffd76a; letter-spacing: .08em; }

/* v139：选择武将界面（pickcard / 头像 / 倒计时） */
body.ui-b .pickcard {
  border: 16px solid transparent;
  border-image: url(../img/ui/kenney/frame_2x.png) 16 repeat;
  border-radius: 0 !important;
  background: #10141d !important;
  box-shadow: none !important;
  padding: 10px 8px 12px;
}
body.ui-b .pickcard:hover { transform: translateY(-2px); }
body.ui-b .pickcard.on {
  border-image: url(../img/ui/kenney/frame_2x_hot.png) 16 repeat;
  background: #171208 !important;
}
body.ui-b .pickcard b { letter-spacing: .06em; color: #eef4ff; }
body.ui-b .pickcard.on b { color: #ffd76a; }
body.ui-b .pickcard small { color: #9fb1c9 !important; }
body.ui-b .pickface {
  border: 4px solid #2b3550 !important;
  border-radius: 2px !important;
  background: #0b0f18 !important;
  box-shadow: none !important;
  overflow: hidden;
}
body.ui-b .pickcard.on .pickface { border-color: #e8c15a !important; }
body.ui-b .pickface img { border-radius: 0 !important; image-rendering: auto; }
body.ui-b .picksub { color: #7f90ab !important; font-size: 10.5px; }
body.ui-b .picktimer {
  border: 8px solid transparent;
  border-image: url(../img/ui/kenney/frame_mono.png) 8 repeat;
  border-radius: 0 !important;
  background: #10141d !important;
  color: #cfd8e6 !important;
  padding: 6px 10px;
  box-shadow: none !important;
}

/* v139：窄屏隐藏顶部右侧统计，避免挤压/裁切 */
@media (max-width: 560px) {
  body.ui-b .runstat { display: none !important; }
}

/* ================= A 版：自绘像素风（纯 CSS，无素材图） ================= */
body.ui-a {
  --a-ink: #0b0f1a;
  --a-panel: #141c2e;
  --a-line: #2f3d5c;
  --a-line2: #1b2437;
  --a-gold: #e8c15a;
  --a-jade: #4fd1c5;
  --a-red: #c8402f;
}
/* 背景：像素网格 */
body.ui-a #scHome, body.ui-a .mapbody, body.ui-a .panelwrap, body.ui-a .canvaswrap {
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.022) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.022) 0 1px, transparent 1px 8px),
    radial-gradient(120% 70% at 50% 0%, #17223a 0%, #0b0f1a 65%) !important;
}
/* 通用：双描边像素框 */
body.ui-a .panel,
body.ui-a .choice,
body.ui-a .generalcard,
body.ui-a .reward,
body.ui-a .shopitem,
body.ui-a .codexitem,
body.ui-a .diffcard,
body.ui-a .pickcard,
body.ui-a .helpbox {
  border: 3px solid var(--a-line) !important;
  border-radius: 2px !important;
  background: var(--a-panel) !important;
  box-shadow: 0 0 0 3px var(--a-ink), 0 5px 0 #06090f !important;
}
body.ui-a .generalcard.on,
body.ui-a .diffcard.on,
body.ui-a .pickcard.on {
  border-color: var(--a-gold) !important;
  background: #241c0e !important;
  box-shadow: 0 0 0 3px var(--a-ink), 0 5px 0 #06090f, inset 0 0 0 2px rgba(232,193,90,.25) !important;
}
body.ui-a .pickface {
  border: 3px solid var(--a-line2) !important;
  border-radius: 0 !important;
  background: #0b0f18 !important;
}
body.ui-a .pickcard.on .pickface { border-color: var(--a-gold) !important; }
/* 按钮 */
body.ui-a button,
body.ui-a .ghost,
body.ui-a .tbuy,
body.ui-a .vertag,
body.ui-a .gbtn,
body.ui-a .startbtn {
  border: 3px solid var(--a-line) !important;
  border-radius: 2px !important;
  background: #16203a !important;
  color: #dfe7f3 !important;
  box-shadow: 0 0 0 3px var(--a-ink), 0 4px 0 #06090f !important;
  letter-spacing: .06em;
}
body.ui-a button:hover, body.ui-a .ghost:hover, body.ui-a .tbuy:hover, body.ui-a .gbtn:hover { color: var(--a-gold) !important; border-color: var(--a-gold) !important; }
body.ui-a button:active, body.ui-a .startbtn:active { transform: translateY(2px); box-shadow: 0 0 0 3px var(--a-ink), 0 1px 0 #06090f !important; }
body.ui-a .startbtn.on, body.ui-a .gbtn.on { border-color: var(--a-gold) !important; background: #241c0e !important; color: var(--a-gold) !important; }
/* 顶部栏与 HUD */
body.ui-a .bar {
  background: #0c111a !important;
  border-bottom: 3px solid var(--a-line2) !important;
  box-shadow: 0 3px 0 #06090f !important;
}
body.ui-a .hstat {
  border: 2px solid var(--a-line2) !important;
  border-radius: 2px !important;
  background: #101828 !important;
  padding: 2px 8px; min-width: 62px;
}
body.ui-a .hstat span { color: #7f90ab !important; }
body.ui-a .hstat b { color: #f2f6ff !important; }
body.ui-a .ragebar {
  height: 8px !important; border-radius: 0 !important;
  border: 2px solid var(--a-line2) !important; background: #0a0e16 !important;
}
body.ui-a .ragebar i { border-radius: 0 !important; background: var(--a-gold) !important; box-shadow: none !important; }
body.ui-a .ragebar.full i { background: #ffe9a3 !important; }
/* 技能键 */
body.ui-a .skillbtn {
  width: 64px !important; height: 64px !important;
  border: 3px solid var(--a-line) !important;
  border-radius: 2px !important;
  background: #121a2c !important;
  box-shadow: 0 0 0 3px var(--a-ink), 0 4px 0 #06090f !important;
  color: #cfd8e6 !important;
}
body.ui-a .skillbtn.ready {
  border-color: var(--a-gold) !important;
  background: #241c0e !important;
  color: var(--a-gold) !important;
  box-shadow: 0 0 0 3px var(--a-ink), 0 4px 0 #06090f, 0 0 14px rgba(232,193,90,.55) !important;
}
body.ui-a .skillbtn.skillbtn2 { border-color: #2f5a6e !important; color: #bfe9f5 !important; background: #0f1a24 !important; }
body.ui-a .skillbtn.skillbtn2.ready {
  border-color: var(--a-jade) !important; color: #8ff0ff !important;
  box-shadow: 0 0 0 3px var(--a-ink), 0 4px 0 #06090f, 0 0 14px rgba(79,209,197,.5) !important;
}
/* 提示 / 图例 / 胶囊 / 进度条 */
body.ui-a .keyhint, body.ui-a .toast, body.ui-a .bag, body.ui-a .maptip, body.ui-a .picktimer {
  border: 2px solid var(--a-line2) !important;
  border-radius: 2px !important;
  background: #0c111a !important;
  color: #9fb1c9 !important;
  box-shadow: 0 0 0 3px var(--a-ink) !important;
}
body.ui-a .progline {
  border: 3px solid #5a4a1e !important;
  border-radius: 2px !important;
  background: #1b1508 !important;
  color: var(--a-gold) !important;
  box-shadow: 0 0 0 3px var(--a-ink) !important;
}
body.ui-a .pxchips span {
  border: 2px solid var(--a-line) !important;
  background: #141c2e !important;
  box-shadow: 0 3px 0 #06090f !important;
  border-radius: 2px !important;
  color: var(--a-gold) !important;
}
/* 主菜单按钮（沿用 A 版布局，只换描边手感） */
body.ui-a #scHome .bigbtn {
  border-radius: 2px !important;
  border: 3px solid var(--a-line) !important;
  background: linear-gradient(180deg, #1b2540 0%, #141c2e 100%) !important;
  box-shadow: 0 0 0 3px var(--a-ink), 0 5px 0 #06090f !important;
}
body.ui-a #scHome .bigbtn.primarybig {
  border-color: var(--a-gold) !important;
  background: linear-gradient(180deg, #3a2f18 0%, #241c10 100%) !important;
}
body.ui-a #scHome .bigbtn b { color: #eaf1ff; }
body.ui-a #scHome .bigbtn.primarybig b { color: var(--a-gold); }
/* A 版不显示素材图标 */
body.ui-a #scHome .bigbtn::before { display: none !important; }
body.ui-a .pxhead::after { display: none !important; }

/* v140：设置里的 UI 风格选择 */
.uipick { display: inline-flex; gap: 8px; }
.uiopt.on { border-color: #e8c15a !important; color: #e8c15a !important; }

/* v140：像素标题图（两种风格通用） */
.pxtitle-img { margin: 0 !important; }
.pxtitle-img img {
  display: block; margin: 2px auto;
  width: min(78vw, 300px); height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 5px 0 rgba(0,0,0,.5));
}

/* v150：未发现的遗物条目 */
.relicitem.unseen { opacity: .45; filter: grayscale(1); }
.relicitem.unseen b { color: #8fa2bd !important; }

/* v152：未发现的融合配方 */
.fusion.unseen { opacity: .4; filter: grayscale(1); }
.fusion.unseen b { color: #8fa2bd !important; }

/* v155：武将卡底部排版 —— 解锁按钮文案较长时不再挤压左侧说明 */
.gfoot { flex-wrap: wrap !important; row-gap: 6px; }
.grage { white-space: nowrap; flex: 1 1 auto; min-width: 0; }
.gbtn { flex: 0 0 auto; white-space: normal; line-height: 1.35; }
@media (max-width: 520px) {
  .gfoot .gbtn { flex: 1 1 100%; text-align: center; }
}

/* ================= v157：PC 横屏氛围模式（竖屏游戏居中 + 两侧氛围图） ================= */
@media (min-width: 900px) and (min-height: 560px) and (orientation: landscape) {
  html, body { background: #05070c; }
  body {
    background-image: url(../img/ui/desktop_bg.png);
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    background-repeat: no-repeat;
  }
  #app {
    width: 520px;
    max-width: 520px;
    margin: 0 auto;
    background: #0b0f1a;
    box-shadow: 0 0 0 3px #1b2437, 0 0 0 7px #070a12, 0 0 90px rgba(0, 0, 0, .92);
    position: relative;
  }
  /* 游戏框永远不低于窗口高度，避免背景从底部露一条 */
  #app, .screen { min-height: 100vh; }
  /* 桌面端给游戏框一圈内描边，像"画框" */
  #app::after {
    content: '';
    position: fixed;
    top: 0; bottom: 0;
    left: 50%;
    width: 520px;
    transform: translateX(-50%);
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(120, 150, 200, .18), inset 0 0 90px rgba(0, 0, 0, .55);
    z-index: 9999;
  }
}

/* ================= v158：PC 宽屏战斗布局（侧栏 + 更大战场） ================= */
.deskrail { display: none; }

@media (min-width: 1200px) and (orientation: landscape) {
  #scBattle:not(.hidden) {
    display: grid !important;
    grid-template-columns: 300px 1fr 320px;
    grid-template-rows: 1fr;
    height: 100vh !important;
    background: #0a0e18;
  }
  /* 顶部 HUD 收进左栏，不再占战场高度 */
  #scBattle .battlebar { display: none !important; }

  .deskrail {
    display: block;
    height: 100vh;
    overflow: auto;
    padding: 14px 14px 18px;
    background: #0e131f;
    border-right: 2px solid #1d2738;
  }
  .deskrail-r { border-right: 0; border-left: 2px solid #1d2738; }

  .deskrail .dr-title {
    font-size: 12px; letter-spacing: .18em; color: #e8c15a;
    margin: 10px 0 8px; padding-bottom: 6px;
    border-bottom: 1px dashed rgba(140, 170, 210, .25);
  }
  .deskrail .dr-title:first-child { margin-top: 0; }
  .deskrail .dr-hero b { display: block; font-size: 20px; color: #f2f6ff; letter-spacing: .08em; }
  .deskrail .dr-hero small { color: #8fa2bd; font-size: 12px; }
  .deskrail .dr-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; font-size: 13px; color: #9fb1c9; }
  .deskrail .dr-row b { color: #eef4ff; font-variant-numeric: tabular-nums; }
  .deskrail .dr-gold { color: #ffd76a !important; }
  .deskrail .dr-bar { height: 8px; background: #0a0e16; border: 2px solid #2b3550; margin: 2px 0 8px; }
  .deskrail .dr-bar i { display: block; height: 100%; background: #e8c15a; }
  .deskrail .dr-skill {
    border: 2px solid #2b3550; background: #121a29; padding: 8px 10px; margin-bottom: 8px;
  }
  .deskrail .dr-skill span { font-size: 11px; color: #7f90ab; letter-spacing: .12em; }
  .deskrail .dr-skill b { display: block; font-size: 14px; color: #dfe7f3; margin: 2px 0; }
  .deskrail .dr-skill small { font-size: 11px; color: #8fa2bd; }
  .deskrail .dr-skill.on { border-color: #e8c15a; box-shadow: inset 0 0 0 1px rgba(232, 193, 90, .25); }
  .deskrail .dr-skill.on b { color: #ffd76a; }
  .deskrail .dr-skill.dr-skill2.on { border-color: #4fd1c5; box-shadow: inset 0 0 0 1px rgba(79, 209, 197, .25); }
  .deskrail .dr-skill.dr-skill2.on b { color: #8ff0ff; }
  .deskrail .dr-tip { margin-top: 12px; font-size: 11px; line-height: 1.8; color: #6f8098; }
  .deskrail .dr-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; margin-bottom: 6px; background: #121a29; border: 2px solid #222d42; }
  .deskrail .dr-ic { font-size: 20px; line-height: 1.2; }
  .deskrail .dr-item b { display: block; font-size: 13px; color: #e8eef8; }
  .deskrail .dr-item small { display: block; font-size: 11px; color: #8fa2bd; line-height: 1.5; }
  .deskrail .dr-empty { font-size: 12px; color: #6f8098; padding: 4px 2px 8px; }

  /* 战场：占满中间列，画布按高度放大 */
  #scBattle .canvaswrap { grid-column: 2; grid-row: 1; padding: 10px; height: 100vh; }
  #scBattle .skilldock { left: 308px; right: 328px; bottom: 18px; }
}

/* v158 修正：进入战斗时，PC 宽屏让 #app 铺满整屏（取消 520px 竖屏画框） */
@media (min-width: 1200px) and (orientation: landscape) {
  body.in-battle { background-image: none !important; background: #0a0e18 !important; }
  body.in-battle #app { width: 100% !important; max-width: none !important; margin: 0 !important; box-shadow: none !important; }
  body.in-battle #app::after { display: none !important; }
  body.in-battle .screen { min-height: 0 !important; }
}

/* v158 修正：PC 宽屏下技能键贴住战场左右下角 */
@media (min-width: 1200px) and (orientation: landscape) {
  #scBattle .canvaswrap { position: relative; }
  #scBattle .canvaswrap .skilldock {
    position: absolute !important;
    left: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    z-index: 90;
  }
  .deskrail .dr-bar { margin: 4px 0 10px; }
  .deskrail-r { overflow-y: auto; }
}

/* v158 修正2：技能键对齐到画布左右下角 */
@media (min-width: 1200px) and (orientation: landscape) {
  #scBattle .canvaswrap .skilldock {
    left: calc(50% - (var(--game-w, 480px) / 2) + 10px) !important;
    right: auto !important;
    width: calc(var(--game-w, 480px) - 20px);
    display: flex !important;
    justify-content: space-between;
  }
}

/* v158：PC 宽屏战斗 —— 两侧空白用氛围图填充 */
@media (min-width: 1200px) and (orientation: landscape) {
  #scBattle {
    background: #080b12 url(../img/ui/desktop_bg.png) center center / cover no-repeat !important;
  }
  /* 侧栏半透明，让氛围图透出来 */
  .deskrail {
    background: rgba(10, 14, 24, .70) !important;
    backdrop-filter: blur(3px);
  }
  /* 战场两侧的留白加渐变暗角，把视线压到中间 */
  #scBattle .canvaswrap::before,
  #scBattle .canvaswrap::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: calc(50% - (var(--game-w, 480px) / 2));
    pointer-events: none;
    z-index: 1;
  }
  #scBattle .canvaswrap::before {
    left: 0;
    background: linear-gradient(90deg,
      rgba(6, 9, 15, .55) 0%,
      rgba(6, 9, 15, .32) 40%,
      rgba(6, 9, 15, 0) 100%);
  }
  #scBattle .canvaswrap::after {
    right: 0;
    background: linear-gradient(270deg,
      rgba(6, 9, 15, .55) 0%,
      rgba(6, 9, 15, .32) 40%,
      rgba(6, 9, 15, 0) 100%);
  }
  /* 画布本身加一点浮起感 */
  #scBattle #game {
    position: relative;
    z-index: 2;
    box-shadow: 0 0 0 2px rgba(90, 120, 170, .35), 0 18px 60px rgba(0, 0, 0, .85);
    border-radius: 6px;
  }
}

/* v159：PC 宽屏两侧氛围改用「当前关卡背景镜像」，与战场同一画风 */
@media (min-width: 1200px) and (orientation: landscape) {
  #scBattle {
    background: #070a10 !important;
  }
  #scBattle .canvaswrap::before,
  #scBattle .canvaswrap::after {
    background-image: var(--battle-bg, url(../img/bg/0.png));
    background-repeat: no-repeat;
    background-color: #070a10;
    filter: brightness(.78) saturate(1.02);
    opacity: .95;
  }
  #scBattle .canvaswrap::before {
    background-size: cover;
    transform: scaleX(-1);
  }
  #scBattle .canvaswrap::after {
    background-size: cover;
  }
  /* 压暗 + 渐变，保证两端暗、中间亮 */
  #scBattle .canvaswrap .sidefade-l,
  #scBattle .canvaswrap .sidefade-r { display: none; }
}

/* v159 修正：宽屏三栏从 1000px 起生效（原来 1200 太高，常见笔记本窗口达不到） */
@media (min-width: 1000px) and (orientation: landscape) {
  #scBattle:not(.hidden) { display: grid !important; grid-template-columns: 280px 1fr 300px; grid-template-rows: 1fr; height: 100vh !important; }
  body.in-battle { background-image: none !important; background: #0a0e18 !important; }
  body.in-battle #app { width: 100% !important; max-width: none !important; margin: 0 !important; box-shadow: none !important; }
  body.in-battle #app::after { display: none !important; }
}

/* v159：成就列表 */
.achrow { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-bottom: 2px dotted rgba(140,170,210,.16); }
.achrow .achic { font-size: 22px; width: 30px; text-align: center; filter: grayscale(1); opacity: .6; }
.achrow.on .achic { filter: none; opacity: 1; }
.achrow b { display: block; font-size: 14px; color: #8fa2bd; }
.achrow.on b { color: #ffd76a; }
.achrow small { display: block; font-size: 11.5px; color: #7f90ab; }
.achrow em { margin-left: auto; font-style: normal; font-size: 11px; color: #6f8098; white-space: nowrap; }
.achrow.on em { color: #69f0ae; }

/* 安全模式：?safe=1 时强制手机布局（排查 PC 三栏问题） */
html.safe-ui #scBattle,
html.safe-ui body.in-battle #scBattle {
  display: flex !important;
  grid-template-columns: none !important;
  height: auto !important;
  background: #070a10 !important;
}
html.safe-ui .deskrail { display: none !important; }
html.safe-ui #scBattle .battlebar { display: flex !important; }
html.safe-ui #app { width: auto !important; max-width: none !important; margin: 0 !important; }
html.safe-ui #scBattle .canvaswrap::before,
html.safe-ui #scBattle .canvaswrap::after { display: none !important; }

/* ================= v163 修正：任何情况下「隐藏的界面」必须真的隐藏 =================
   之前 #scBattle 用 display:grid !important 覆盖了 .hidden，导致战斗界面在其它界面
   下方继续显示，PC 上出现多屏叠在一起、内容被挤压变小。放在文件最后确保优先级最高。 */
.screen.hidden,
#scHome.hidden, #scMap.hidden, #scBattle.hidden, #scPanel.hidden {
  display: none !important;
}

/* v165：PC 侧栏操作按钮 */
.deskrail .dr-ctrl { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 4px; }
.deskrail .dr-ctrl button {
  width: 100%; padding: 9px 10px; text-align: left; font-size: 13px;
  background: #16203a; color: #dfe7f3; border: 2px solid #2f3d5c; border-radius: 0;
  cursor: pointer; touch-action: manipulation;
}
.deskrail .dr-ctrl button:hover { border-color: #e8c15a; color: #ffd76a; }
.deskrail .dr-ctrl button:active { transform: translateY(1px); }

/* ================= v166：PC 宽屏路线图三栏（左：关卡信息 中：地图 右：弹珠袋/图例） ================= */
@media (min-width: 1000px) and (orientation: landscape) {
  body.in-map #app {
    width: 100% !important; max-width: none !important; margin: 0 !important;
    box-shadow: none !important; background: transparent !important;
  }
  body.in-map #app::after { display: none !important; }
  body.in-map { background: #070a10 !important; }

  #scMap:not(.hidden) {
    display: grid !important;
    grid-template-columns: 340px 1fr 360px;
    grid-template-rows: 1fr;
    height: 100vh;
    gap: 0;
  }
  /* 左栏：关卡名 / 机制 / 敌兵种 / 资源 */
  #scMap > .bar {
    grid-column: 1; grid-row: 1;
    flex-direction: column; align-items: stretch; justify-content: flex-start;
    gap: 12px;
    padding: 18px 16px;
    background: #0e131f;
    border-right: 2px solid #1d2738;
    border-bottom: 0;
    overflow-y: auto;
  }
  #scMap > .bar .barbtns { margin: 8px 0 0; flex-direction: column; }
  #scMap > .bar .barbtns .ghost { width: 100%; }
  #scMap > .bar .bartitle { min-width: 0; }
  #scMap > .bar .runstat { align-self: flex-start; flex-wrap: wrap; }

  /* 中间：地图 */
  .mapbody { display: contents; }
  #mapCanvasWrap {
    grid-column: 2; grid-row: 1;
    margin: 0 auto;
    align-self: center;
    max-height: 100vh;
    overflow: auto;
  }
  /* 右栏：弹珠袋 + 提示 + 图例 */
  .sidebar {
    grid-column: 3; grid-row: 1;
    padding: 18px 16px;
    background: #0e131f;
    border-left: 2px solid #1d2738;
    overflow-y: auto;
    display: flex; flex-direction: column; gap: 12px;
  }
  .sidebar .bag, .sidebar .maptip { margin: 0; }
  .sidebar .legend { margin-top: 0; }
}

/* ================= v167：战场两侧氛围图层（真实 DOM） ================= */
.battle-side { display: none; }

@media (min-width: 1000px) and (orientation: landscape) {
  #scBattle .canvaswrap { position: relative; overflow: hidden; }
  #scBattle .battle-side {
    display: block;
    position: absolute;
    top: 0; bottom: 0;
    width: calc(50% - (var(--game-w, 480px) / 2) - 12px);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
    filter: brightness(.72) saturate(.95);
    pointer-events: none;
    z-index: 0;
  }
  #scBattle .battle-side-l { left: 0; transform: scaleX(-1); }
  #scBattle .battle-side-r { right: 0; }
  /* 靠近战场一侧压暗，形成聚焦；外侧也压暗一点 */
  #scBattle .battle-side::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(6,9,15,.55), rgba(6,9,15,.15));
  }
  #scBattle .battle-side-r::after { background: linear-gradient(270deg, rgba(6,9,15,.55), rgba(6,9,15,.15)); }
  /* 画布压在氛围图层之上 */
  #scBattle #game { position: relative; z-index: 2; }
  /* 旧的伪元素氛围层不再需要，避免重影 */
  #scBattle .canvaswrap::before, #scBattle .canvaswrap::after { background-image: none !important; }
}

/* v167 修正：两侧氛围图改用专门生成的 side_ 图（已提亮），叠加层更淡 */
@media (min-width: 1000px) and (orientation: landscape) {
  #scBattle .battle-side { filter: brightness(.9) saturate(.98); }
  #scBattle .battle-side::after { background: linear-gradient(90deg, rgba(6,9,15,.45), rgba(6,9,15,.05)) !important; }
  #scBattle .battle-side-r::after { background: linear-gradient(270deg, rgba(6,9,15,.45), rgba(6,9,15,.05)) !important; }
}

/* v167 最终：两侧氛围再提亮、渐变减淡 */
@media (min-width: 1000px) and (orientation: landscape) {
  #scBattle .battle-side { filter: brightness(1.05) saturate(1.02); }
  #scBattle .battle-side-l::after { background: linear-gradient(90deg, rgba(6,9,15,.35), rgba(6,9,15,0)) !important; }
  #scBattle .battle-side-r::after { background: linear-gradient(270deg, rgba(6,9,15,.35), rgba(6,9,15,0)) !important; }
}

/* v168：两侧氛围再提亮（1.05 → 1.38），渐变更淡 */
@media (min-width: 1000px) and (orientation: landscape) {
  #scBattle .battle-side { filter: brightness(1.38) saturate(1.06) contrast(1.02); }
  #scBattle .battle-side-l::after { background: linear-gradient(90deg, rgba(6,9,15,.28), rgba(6,9,15,0)) !important; }
  #scBattle .battle-side-r::after { background: linear-gradient(270deg, rgba(6,9,15,.28), rgba(6,9,15,0)) !important; }
}

/* v169：氛围亮度走 CSS 变量（设置里可调 60%~200%） */
@media (min-width: 1000px) and (orientation: landscape) {
  #scBattle .battle-side { filter: brightness(var(--ambient-bright, 1.38)) saturate(1.06) contrast(1.02) !important; }
}

/* v171：特效档位按钮 */
.fxpick { display: inline-flex; gap: 6px; }
.fxpick .ghost.on { border-color: #e8c15a !important; color: #ffd76a !important; }

/* ================= v175：战斗内暂停菜单 ================= */
#scBattle .bmenu, .bmenu {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(4, 7, 12, .72);
  display: flex; align-items: center; justify-content: center;
}
.bmenu.hidden { display: none !important; }
.bmenu-box {
  width: min(88vw, 320px);
  background: #101726; border: 2px solid #2f3d5c; border-radius: 0;
  padding: 18px 16px 14px; text-align: center;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.bmenu-box h3 { margin: 0 0 4px; font-size: 18px; color: #e8eefc; }
.bmenu-box button { width: 100%; padding: 11px 10px; font-size: 15px; }
.bmenu-tip { margin: 6px 0 0; font-size: 12px; color: #7f93b5; }

/* =========================================================================
   v181 · UI 主题 C「奇幻边框」（Kenney Fantasy UI Borders · CC0）
   - 只改观感，不改布局；所有规则以 body.ui-c 前缀限定
   - 面板/卡片：panel.png 九宫格 + 深色底
   - 按钮：panel_border.png 九宫格
   - 主按钮/弹窗：panel_double.png（双层描边）
   ========================================================================= */
body.ui-c {
  --c-ink: #e9eefc;
  --c-line: #cfd8ea;
  --c-bg: #0c111c;
  --c-bg2: #131a29;
}

/* 背景：深蓝渐变 + 细网格，让白色描边更清晰 */
body.ui-c #scHome,
body.ui-c #scMap,
body.ui-c #scBattle,
body.ui-c .panelbg {
  background: radial-gradient(circle at 50% 0%, #16203a 0%, #0a0e17 60%, #06090f 100%) !important;
}

/* 面板 / 卡片 / 信息块 */
body.ui-c .setbox,
body.ui-c .helpbox,
body.ui-c .gcard,
body.ui-c .pickcard,
body.ui-c .bag,
body.ui-c .maptip,
body.ui-c .legend,
body.ui-c .dr-box,
body.ui-c .reward,
body.ui-c .shopitem,
body.ui-c .fusion,
body.ui-c .relicitem,
body.ui-c .achrow,
body.ui-c .ucbox,
body.ui-c .bmenu-box,
body.ui-c .panel {
  border: 12px solid transparent !important;
  border-image: url(../img/ui/kenney_fantasy/panel_glass.png) 12 stretch !important;
  border-radius: 0 !important;
  background: rgba(12, 17, 28, .92) !important;
  box-shadow: none !important;
}

/* 按钮：单线边框 */
body.ui-c button,
body.ui-c .bigbtn,
body.ui-c .ghost,
body.ui-c .primary,
body.ui-c .setTab,
body.ui-c .uiopt {
  border: 10px solid transparent !important;
  border-image: url(../img/ui/kenney_fantasy/panel_border.png) 10 stretch !important;
  border-radius: 0 !important;
  background: rgba(18, 25, 40, .95) !important;
  color: var(--c-ink) !important;
  box-shadow: none !important;
}
body.ui-c button:hover,
body.ui-c .bigbtn:hover,
body.ui-c .ghost:hover {
  border-image: url(../img/ui/kenney_fantasy/panel_double.png) 10 stretch !important;
  color: #ffe08a !important;
}
/* 主按钮 / 选中态：双层描边 + 金边 */
body.ui-c .primary,
body.ui-c .primarybig,
body.ui-c .setTab.on,
body.ui-c .uiopt.on {
  border-image: url(../img/ui/kenney_fantasy/panel_double.png) 10 stretch !important;
  color: #ffe08a !important;
}

/* 大按钮（主菜单）再加粗一点 */
body.ui-c #scHome .bigbtn {
  border-width: 12px !important;
  border-image: url(../img/ui/kenney_fantasy/panel_border.png) 12 stretch !important;
  padding: 10px 16px !important;
}
body.ui-c #scHome .bigbtn b { color: #f4f7ff; }
body.ui-c #scHome .bigbtn span { color: #9fb2cf; }
body.ui-c #scHome .bigbtn.primarybig {
  border-image: url(../img/ui/kenney_fantasy/panel_double.png) 12 stretch !important;
}

/* 标题：去掉像素描边，换成细体大写感 */
body.ui-c .pxtitle,
body.ui-c .pxtitle b { text-shadow: none !important; }
body.ui-c .pxtitle span { color: #f4c752 !important; }

/* 分隔线（Kenney divider） */
body.ui-c hr,
body.ui-c .sep,
body.ui-c .dr-title::after,
body.ui-c .setbox h3::after {
  background: url(../img/ui/kenney_fantasy/divider.png) center/100% 100% no-repeat !important;
  height: 22px !important;
  border: 0 !important;
}

/* 战斗 HUD：细描边、去掉圆角 */
body.ui-c .hstat,
body.ui-c .skillbtn,
body.ui-c .volpanel,
body.ui-c .battlebar {
  border-color: transparent !important;
  border-radius: 0 !important;
}

/* v181 修正：主按钮底色 / 音量面板排除 / 边框收窄 */
body.ui-c .primary,
body.ui-c .primarybig,
body.ui-c #scHome .bigbtn.primarybig {
  background: linear-gradient(#1c2740, #131b2c) !important;
}
body.ui-c button,
body.ui-c .ghost,
body.ui-c .primary { border-width: 9px !important; border-image-slice: 9 !important; }
body.ui-c .volpanel,
body.ui-c .volpanel *,
body.ui-c .volbtn {
  border: 0 !important;
  border-image: none !important;
  background: rgba(12,17,28,.9) !important;
  border-radius: 0 !important;
}
body.ui-c .volpanel { border: 2px solid #2a3550 !important; }

/* v181 修正 2：双层边框用 16 切片，避免上下出现粗白带 */
body.ui-c .primary,
body.ui-c .primarybig,
body.ui-c .setTab.on,
body.ui-c .uiopt.on,
body.ui-c #scHome .bigbtn.primarybig {
  border-width: 12px !important;
  border-image: url(../img/ui/kenney_fantasy/panel_double.png) 16 stretch !important;
}
body.ui-c button:hover { border-image: url(../img/ui/kenney_fantasy/panel_border.png) 12 stretch !important; }

/* =========================================================================
   v182 · UI 主题 C 精修（观感调优，不改布局）
   目标：边框不挤压文字、主按钮有明确层级、面板内边距统一、弹窗用双线
   ========================================================================= */

/* ---- 1. 基础尺寸：把九宫格边框吃掉的空间补回来 ---- */
body.ui-c button,
body.ui-c .ghost,
body.ui-c .primary,
body.ui-c .bigbtn,
body.ui-c .setTab,
body.ui-c .uiopt {
  border-width: 10px !important;
  border-image: url(../img/ui/kenney_fantasy/panel_border.png) 10 stretch !important;
  border-image-slice: 10 !important;
  padding: 10px 18px !important;
  min-height: 44px;
  line-height: 1.25 !important;
  letter-spacing: .02em;
  background: rgba(16, 22, 36, .96) !important;
  color: #e6edfb !important;
  font-weight: 600;
  transition: color .12s ease, border-image .12s ease;
}
body.ui-c button:hover,
body.ui-c .ghost:hover,
body.ui-c .bigbtn:hover {
  color: #ffd76a !important;
  border-image: url(../img/ui/kenney_fantasy/panel_double.png) 10 stretch !important;
}
body.ui-c button:active { transform: translateY(1px); }

/* ---- 2. 主按钮：金框 + 深蓝底，明确层级 ---- */
body.ui-c .primary,
body.ui-c .primarybig,
body.ui-c .setTab.on,
body.ui-c .uiopt.on {
  border-width: 12px !important;
  border-image: url(../img/ui/kenney_fantasy/panel_double.png) 12 stretch !important;
  border-image-slice: 12 !important;
  background: linear-gradient(#243352, #16203a) !important;
  color: #ffd76a !important;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .6);
}

/* ---- 3. 主菜单大按钮：左对齐 + 副标题 ---- */
body.ui-c #scHome .bigbtn {
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 18px !important;
  min-height: 62px;
  text-align: left !important;
}
body.ui-c #scHome .bigbtn b { font-size: 19px; letter-spacing: .04em; }
body.ui-c #scHome .bigbtn small,
body.ui-c #scHome .bigbtn span { font-size: 12.5px; color: #9db0cd !important; font-weight: 500; }
body.ui-c #scHome .bigbtn.primarybig b { color: #ffe08a; }

/* ---- 4. 面板 / 卡片：内边距统一，边线用半透明中心版 ---- */
body.ui-c .setbox,
body.ui-c .helpbox,
body.ui-c .gcard,
body.ui-c .pickcard,
body.ui-c .bag,
body.ui-c .maptip,
body.ui-c .legend,
body.ui-c .reward,
body.ui-c .achrow {
  border-width: 12px !important;
  border-image: url(../img/ui/kenney_fantasy/panel_glass.png) 12 stretch !important;
  border-image-slice: 12 !important;
  padding: 14px 18px !important;
  background: rgba(11, 16, 26, .9) !important;
}
body.ui-c .setbox h3,
body.ui-c .helpbox h3 {
  margin: 0 0 10px !important;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(160, 190, 230, .18);
  font-size: 15px;
  letter-spacing: .04em;
  color: #cfe0f7;
}

/* ---- 5. 弹窗 / 暂停菜单：双层框 + 阴影 ---- */
body.ui-c .ucbox,
body.ui-c .bmenu-box {
  border-width: 14px !important;
  border-image: url(../img/ui/kenney_fantasy/panel_double.png) 14 stretch !important;
  border-image-slice: 14 !important;
  background: rgba(9, 13, 22, .97) !important;
  padding: 18px 22px !important;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .6) !important;
}

/* ---- 6. 设置页行距与标签 ---- */
body.ui-c .setrow { padding: 10px 0 !important; gap: 12px; }
body.ui-c .settip { color: #8fa4c4 !important; line-height: 1.75; }

/* ---- 7. 顶栏 / HUD：细线，不抢戏 ---- */
body.ui-c .bar {
  border-bottom: 1px solid rgba(150, 180, 220, .16) !important;
  background: rgba(9, 13, 21, .92) !important;
}
body.ui-c .hstat { color: #d7e3f7 !important; }
body.ui-c .hstat b { color: #ffe08a !important; }

/* ---- 8. 战斗左栏 / 右栏：卡片式 ---- */
body.ui-c #deskRailL .dr-box,
body.ui-c #deskRailR .dr-box {
  border-width: 10px !important;
  border-image: url(../img/ui/kenney_fantasy/panel_glass.png) 10 stretch !important;
  border-image-slice: 10 !important;
  padding: 10px 12px !important;
  background: rgba(11, 16, 26, .88) !important;
}
body.ui-c #deskRailL .dr-ctrl button { padding: 9px 12px !important; min-height: 40px; }

/* ---- 9. 路线图节点：菱形装饰感的细框 ---- */
body.ui-c .node {
  border-width: 8px !important;
  border-image: url(../img/ui/kenney_fantasy/panel_border.png) 8 stretch !important;
  background: rgba(14, 20, 32, .95) !important;
}
body.ui-c .node.avail { border-image: url(../img/ui/kenney_fantasy/panel_double.png) 8 stretch !important; }

/* =========================================================================
   v182·2 UI C 第二轮：小控件与高亮收敛
   ========================================================================= */

/* 1) 纯图标小按钮（音量、技能键）不要九宫格，避免四角脏 */
body.ui-c .volbtn,
body.ui-c #btnMute,
body.ui-c .skillbtn,
body.ui-c .iconbtn {
  border: 2px solid rgba(150, 180, 220, .35) !important;
  border-image: none !important;
  background: rgba(10, 15, 24, .92) !important;
  padding: 0 !important;
  min-height: 0 !important;
}

/* 2) 音量面板整体收成一块，内部不再套框 */
body.ui-c .volpanel {
  border: 2px solid rgba(150, 180, 220, .3) !important;
  border-image: none !important;
  background: rgba(9, 13, 21, .95) !important;
  padding: 6px 10px !important;
}
body.ui-c .volpanel * { border-image: none !important; }

/* 3) 主按钮回到单线金框（双线在矮按钮上会形成白带） */
body.ui-c .primary,
body.ui-c .primarybig {
  border-width: 10px !important;
  border-image: url(../img/ui/kenney_fantasy/panel_border.png) 10 stretch !important;
  border-image-slice: 10 !important;
  background: linear-gradient(#243352, #141d31) !important;
  color: #ffd76a !important;
}
/* 选中态仍用双线，但提高切片避免拉出白带 */
body.ui-c .setTab.on,
body.ui-c .uiopt.on {
  border-width: 10px !important;
  border-image: url(../img/ui/kenney_fantasy/panel_double.png) 10 stretch !important;
  border-image-slice: 10 !important;
}

/* 4) 左栏技能卡 / 信息行：只留分隔线，不再每块套框 */
body.ui-c #deskRailL .dr-skill,
body.ui-c #deskRailR .dr-item,
body.ui-c #deskRailL .dr-row {
  border-image: none !important;
  border: 0 !important;
  border-left: 2px solid rgba(150, 180, 220, .22) !important;
  background: transparent !important;
  padding-left: 10px !important;
}
body.ui-c #deskRailL .dr-skill.on { border-left-color: #ffd76a !important; }
body.ui-c #deskRailR .dr-marble,
body.ui-c #deskRailR .dr-item {
  border-left: 2px solid rgba(150, 180, 220, .22) !important;
}

/* 5) 主菜单底部留白，避免和音量条打架 */
body.ui-c #scHome { padding-bottom: 78px !important; }
body.ui-c #scHome .homebuttons { margin-bottom: 12px; }

/* =========================================================================
   v182·3 UI C 第三轮：统一「边框宽度 = 切片」，消除拉伸白带
   规则：border-width 必须等于 border-image-slice 的数值，否则九宫格会拉伸
   ========================================================================= */

/* 按钮：统一 10 / 10 */
body.ui-c button,
body.ui-c .ghost,
body.ui-c .primary,
body.ui-c .bigbtn,
body.ui-c .setTab,
body.ui-c .uiopt,
body.ui-c #scHome .bigbtn,
body.ui-c #scHome .bigbtn.primarybig,
body.ui-c .bmenu-box button {
  border-width: 10px !important;
  border-image-slice: 10 !important;
  border-image-width: 10px !important;
  border-image-repeat: stretch !important;
}
body.ui-c button,
body.ui-c .ghost,
body.ui-c .bigbtn,
body.ui-c #scHome .bigbtn { border-image-source: url(../img/ui/kenney_fantasy/panel_border.png) !important; }

body.ui-c .primary,
body.ui-c .primarybig,
body.ui-c .setTab.on,
body.ui-c .uiopt.on,
body.ui-c #scHome .bigbtn.primarybig {
  border-image-source: url(../img/ui/kenney_fantasy/panel_double.png) !important;
  border-image-slice: 10 !important;
  border-width: 10px !important;
}

/* 面板：统一 12 / 12 */
body.ui-c .setbox,
body.ui-c .helpbox,
body.ui-c .gcard,
body.ui-c .pickcard,
body.ui-c .bag,
body.ui-c .maptip,
body.ui-c .legend,
body.ui-c .reward,
body.ui-c .achrow,
body.ui-c .ucbox,
body.ui-c .bmenu-box,
body.ui-c #deskRailL .dr-box,
body.ui-c #deskRailR .dr-box {
  border-width: 12px !important;
  border-image-slice: 12 !important;
  border-image-width: 12px !important;
}
body.ui-c .ucbox,
body.ui-c .bmenu-box { border-image-source: url(../img/ui/kenney_fantasy/panel_double.png) !important; }

/* v182·4：主按钮不再用 Double 素材（会压成白带），改为单线框 + 内嵌金色细边 */
body.ui-c .primary,
body.ui-c .primarybig,
body.ui-c #scHome .bigbtn.primarybig,
body.ui-c .setTab.on,
body.ui-c .uiopt.on {
  border-image-source: url(../img/ui/kenney_fantasy/panel_border.png) !important;
  border-image-slice: 10 !important;
  border-width: 10px !important;
  box-shadow: inset 0 0 0 2px rgba(255, 215, 106, .55) !important;
  background: linear-gradient(#26355a, #16203a) !important;
  color: #ffd76a !important;
}

/* v182·5：弹窗改单线框（Double 素材在矮面板上会出现白块）；音量面板彻底去框 */
body.ui-c .ucbox,
body.ui-c .bmenu-box {
  border-image-source: url(../img/ui/kenney_fantasy/panel_border.png) !important;
  border-image-slice: 12 !important;
  border-width: 12px !important;
  box-shadow: 0 14px 40px rgba(0,0,0,.6), inset 0 0 0 2px rgba(255, 215, 106, .35) !important;
}
body.ui-c .volpanel,
body.ui-c .volpanel * {
  border: 0 !important;
  border-image-source: none !important;
  box-shadow: none !important;
  background: transparent !important;
  min-height: 0 !important;
}
body.ui-c .volpanel {
  border: 1px solid rgba(150, 180, 220, .3) !important;
  background: rgba(9, 13, 21, .95) !important;
}

/* v182·6：设置页文案不折行 + 列表按钮紧凑；音量条改名为 .audiobox */
body.ui-c .setrow b { white-space: nowrap; }
body.ui-c .uipick { display: inline-flex; gap: 6px; flex-wrap: wrap; }
body.ui-c .uipick .uiopt {
  border-width: 8px !important;
  border-image-slice: 8 !important;
  padding: 6px 12px !important;
  font-size: 13px !important;
  min-height: 36px !important;
}
body.ui-c .audiobox,
body.ui-c .audiobox * {
  border: 0 !important;
  border-image-source: none !important;
  box-shadow: none !important;
  background: transparent !important;
  min-height: 0 !important;
}
body.ui-c .audiobox {
  border: 1px solid rgba(150, 180, 220, .28) !important;
  background: rgba(9, 13, 21, .95) !important;
  padding: 6px 10px !important;
}
body.ui-c .audiobox .afold {
  border: 1px solid rgba(150, 180, 220, .35) !important;
  background: rgba(16, 22, 36, .9) !important;
  min-width: 30px !important;
  min-height: 30px !important;
}

/* =========================================================================
   v183 · UI 主题 C：选人卡片选中态强化
   ========================================================================= */
body.ui-c .pickgrid { gap: 14px !important; }

/* 未选：压暗，弱化存在感 */
body.ui-c .pickcard {
  position: relative;
  border-width: 10px !important;
  border-image: url(../img/ui/kenney_fantasy/panel_border.png) 10 stretch !important;
  border-image-slice: 10 !important;
  background: rgba(12, 17, 28, .92) !important;
  opacity: .78;
  filter: saturate(.85);
  transition: opacity .12s ease, filter .12s ease, transform .12s ease;
  cursor: pointer;
}
body.ui-c .pickcard:hover {
  opacity: 1;
  filter: none;
  transform: translateY(-2px);
  border-image: url(../img/ui/kenney_fantasy/panel_double.png) 10 stretch !important;
}

/* 已选：亮起来 + 金色内描边 + 外发光 + 右上角勾 */
body.ui-c .pickcard.on {
  opacity: 1;
  filter: none;
  background: linear-gradient(#1e2b46, #101a2c) !important;
  box-shadow:
    0 0 0 2px rgba(255, 216, 106, .95),
    0 0 22px rgba(255, 190, 60, .38),
    inset 0 0 26px rgba(255, 200, 90, .14) !important;
  transform: translateY(-2px);
}
body.ui-c .pickcard.on::after {
  content: '✓';
  position: absolute;
  top: -2px; right: -2px;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; line-height: 1;
  color: #1a1200;
  background: linear-gradient(#ffe08a, #e8b23c);
  border: 2px solid #fff3c4;
  border-radius: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
  z-index: 3;
}
/* 选中：名字与技能名变金 */
body.ui-c .pickcard.on b { color: #ffe08a !important; }
body.ui-c .pickcard.on small { color: #ffe9b0 !important; }
/* 选中：头像外圈补一圈金环 */
body.ui-c .pickcard.on .pickface {
  box-shadow: 0 0 0 3px rgba(255, 216, 106, .9), 0 0 16px rgba(255, 190, 60, .45);
  border-radius: 50%;
}
body.ui-c .pickcard .pickface img { image-rendering: auto; }

/* v219：窄屏把技能坞固定到视口底部，避免浮在战场中段 */
@media (max-width: 860px) {
  #scBattle .skilldock,
  #scBattle .canvaswrap .skilldock {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    z-index: 90 !important;
  }
  #scBattle .skilldock .skillbtn { width: 62px; height: 62px; }
}

/* v220：遗物稀有度可视化（描边用 outline，三种 UI 主题都生效） */
.reward[data-rarity] {
  outline: 2px solid var(--rc) !important;
  outline-offset: -2px;
}
.reward[data-rarity="dark"] {
  outline-color: #c9a227 !important;
}
.reward[data-rarity="red"] {
  outline: 3px solid #ff3b30 !important;
  outline-offset: -3px;
  box-shadow: 0 0 18px -4px rgba(255, 59, 48, .55) !important;
}
.reward .rtag {
  color: var(--rc) !important;
  font-weight: 700;
  letter-spacing: .5px;
}

/* v227：稀有度强区分 —— 描边样式 + 底色 + 实心胶囊 */
.reward[data-rarity="gold"] {
  outline: 2px solid #ffd54f !important;
  outline-offset: -2px;
  background: linear-gradient(160deg, rgba(255, 213, 79, .10), rgba(255, 255, 255, .02)) !important;
}
.reward[data-rarity="dark"] {
  outline: 2px dashed #a9762b !important;      /* 暗金：虚线 + 古铜色，形状上就能区分 */
  outline-offset: -2px;
  background: linear-gradient(160deg, rgba(169, 118, 43, .16), rgba(255, 255, 255, .02)) !important;
}
.reward[data-rarity="red"] {
  outline: 3px solid #ff3b30 !important;
  outline-offset: -3px;
  background: linear-gradient(160deg, rgba(255, 59, 48, .16), rgba(255, 255, 255, .02)) !important;
  box-shadow: 0 0 22px -6px rgba(255, 59, 48, .6) !important;
}
.reward .rtag {
  display: inline-block;
  padding: 1px 7px 2px;
  margin-right: 2px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .5px;
  vertical-align: 1px;
}
/* 胶囊底色与文字色都必须 !important，否则会被 v220 的 .rtag{color:var(--rc)!important} 盖掉 */
.reward[data-rarity] .rtag-gold { background: #ffd54f !important; color: #2a1d00 !important; }
.reward[data-rarity] .rtag-dark { background: #a9762b !important; color: #fff6e2 !important; }
.reward[data-rarity] .rtag-red  { background: #ff3b30 !important; color: #fff2f0 !important; }

/* v227b：稀有度色带（卡片顶部一条，颜色即档位，绕过主题背景限制） */
.reward .rbar {
  height: 4px;
  border-radius: 4px;
  margin: -6px 0 10px;
  opacity: .95;
}
.reward[data-rarity="gold"] .rbar { box-shadow: 0 0 8px rgba(255, 213, 79, .55); }
.reward[data-rarity="dark"] .rbar { box-shadow: 0 0 8px rgba(169, 118, 43, .55); }
.reward[data-rarity="red"] .rbar { height: 6px; box-shadow: 0 0 12px rgba(255, 59, 48, .7); }

/* v231：宝箱展示卡（单张，居中） */
.treasurecard { max-width: 260px; margin: 6px auto 14px; }
.treasurecard .reward { cursor: default; }
.treasurecard .reward:hover { transform: none; }

/* v231：弹珠/强化类卡片淡化，让遗物更突出 */
.reward.r-plain {
  outline: 1px solid rgba(150, 170, 195, .28) !important;
  outline-offset: -1px;
  opacity: .82;
}
.reward.r-plain:hover { opacity: 1; outline-color: rgba(150, 170, 195, .5) !important; }
.reward.r-plain .rkind { color: #8fa0b5 !important; border-color: rgba(150, 170, 195, .45) !important; }
.reward.r-plain .ricon { filter: saturate(.55) brightness(.9); }
.reward.r-plain b { color: #d7e0ec !important; }
.reward.r-plain p { color: #93a2b5 !important; }

/* v235：开始界面自适应 —— 尺寸由视口高度驱动，横竖屏都一屏放得下 */
#scHome {
  display: flex !important;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  box-sizing: border-box;
  overflow-y: auto;
  padding: 0 0 calc(clamp(52px, 8.5vh, 84px) + env(safe-area-inset-bottom, 0px)) !important;
}
#scHome > .homehead { margin-top: auto; }
#scHome > .homefoot2 { margin-bottom: auto; }
#scHome .homehead,
#scHome .homebuttons,
#scHome .homefoot2 { width: 100%; }

#scHome .homehead { padding: clamp(6px, 2vh, 30px) 16px clamp(4px, 1.3vh, 16px); }
#scHome .homehead .logo.pxlogo {
  width: clamp(48px, 9.2vh, 140px);
  height: clamp(48px, 9.2vh, 140px);
  margin-bottom: clamp(1px, .5vh, 8px);
}
#scHome .homehead h1 img { width: min(44vw, 40vh, 440px) !important; height: auto !important; }
#scHome .tagline { font-size: clamp(10.5px, 1.45vh, 14px) !important; }
#scHome .homesave { margin-top: clamp(2px, .7vh, 8px); }
#scHome .homesave span { font-size: clamp(9.5px, 1.3vh, 12.5px) !important; }

#scHome .homebuttons {
  max-width: min(660px, 88vw);
  gap: clamp(4px, 1.15vh, 14px);
  padding: clamp(3px, .8vh, 10px) 16px clamp(4px, 1.1vh, 16px);
}
#scHome .bigbtn {
  min-height: clamp(40px, 7vh, 76px);
  padding: clamp(5px, .95vh, 12px) clamp(12px, 1.6vh, 17px) !important;
  gap: clamp(0px, .2vh, 2px);
}
#scHome .bigbtn b { font-size: clamp(14px, 2vh, 22px); }
#scHome .bigbtn small,
#scHome .bigbtn span { font-size: clamp(9.5px, 1.35vh, 14px) !important; }
#scHome .bigbtn::before {
  width: clamp(20px, 3vh, 32px) !important;
  height: clamp(20px, 3vh, 32px) !important;
  background-size: clamp(20px, 3vh, 32px) clamp(20px, 3vh, 32px) !important;
}
#scHome .homefoot2 {
  font-size: clamp(9.5px, 1.2vh, 12px);
  padding-bottom: clamp(3px, .8vh, 8px);
}
#scHome .homefoot2 .vertag { font-size: clamp(9.5px, 1.2vh, 12px); padding: 2px 8px; }

/* ============ v256：手机端层级与音量浮窗修复 ============ */
/* 1) 手机上不再显示右下角音量浮窗（音量统一到「设置」里调），
     它原来正好压在「技能2」按钮上（360px 宽实测命中 audioFold） */
@media (max-width: 767px) {
  #audioBox, .audiobox { display: none !important; }
}
/* 触屏设备（平板/掌机）也一并隐藏，音量统一到「设置 → 音量」 */
@media (pointer: coarse) {
  #audioBox, .audiobox { display: none !important; }
}

/* 2) 面板页 / 确认弹窗必须盖住暂停菜单（.bmenu z-index 9000）
      原来 .screen 没有定位、.uiconfirm 只有 300，导致「设置」被暂停菜单的暗幕压住，
      只剩左上角一小块可见；「返回主菜单」的确认框同理被遮住 → 点了没反应 */
.screen { position: relative; z-index: 9500; }
.screen.hidden { z-index: 0; }
.uiconfirm { z-index: 10000 !important; }
#scPanel { z-index: 9600; }


/* ================= v374：首页语言快切按钮 =================
   反馈：语言切换藏在设置里，找了半天。现在放首页右上角，显眼且一键切换。 */
#scHome { position: relative; }
.langquick {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(160, 190, 235, .45);
  background: rgba(18, 26, 42, .92);
  color: #dce8f8;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .3px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .45);
  backdrop-filter: blur(3px);
  transition: .15s;
}
.langquick:hover { background: rgba(38, 56, 88, .96); border-color: rgba(190, 215, 250, .7); }
.langquick:active { transform: scale(.96); }
@media (max-width: 420px) { .langquick { top: 8px; right: 8px; padding: 7px 11px; font-size: 12px; } }

/* ================= v373：面板页滚动 + 返回按钮吸底 =================
   问题：设置/图鉴这类长页面在手机和窄窗口里下拉不到最底，找不到「返回」按钮，
        只能去点音量设置绕一圈回来。
   做法：① 面板页自己成为一个滚动容器（window 滚不动时它还能滚）
        ② panelfoot 吸底，任何时候都在屏幕内可点
        ③ 底部留出安全区，避免被手机圆角/手势条挡住 */
#scPanel {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  max-height: 100vh;
}
#scPanel .panelwrap { padding-bottom: 96px; }
#scPanel .panelfoot {
  position: sticky;
  bottom: 0;
  z-index: 8;
  margin-top: 18px;
  padding: 12px 8px calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, #0b0f1a 55%, rgba(11, 15, 26, .88) 80%, rgba(11, 15, 26, 0));
  backdrop-filter: blur(2px);
}
#scPanel .panelfoot button { min-height: 44px; }


/* 3) 战斗顶栏按钮加大触点并保证在画布之上（手机上误触率明显下降） */
#scBattle .battlebar { position: relative; z-index: 30; }
#scBattle .battlebar button { min-height: 44px; min-width: 72px; }

/* ============ v258：剧情对白播放器 ============ */
.storyplayer {
  position: fixed; inset: 0; z-index: 9700;
  background: radial-gradient(ellipse at 50% 40%, #0b1220 0%, #05070c 72%, #03040a 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
}
.storyplayer.hidden { display: none; }
.storyplayer .storybox {
  width: min(92vw, 720px); max-height: 88vh;
  display: grid; grid-template-columns: 176px 1fr; grid-template-rows: 1fr auto;
  gap: 14px 18px; padding: 18px;
  background: linear-gradient(160deg, rgba(24,32,48,.98), rgba(12,18,28,.98));
  border: 1px solid rgba(150,180,220,.34); border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0,0,0,.8);
}
.storyplayer .storyart { grid-column: 1; grid-row: 1; display: flex; align-items: flex-end; justify-content: center; }
.storyplayer .storyart img {
  max-width: 100%; max-height: 46vh; object-fit: contain;
  filter: drop-shadow(0 10px 26px rgba(0,0,0,.75));
}
.storyplayer.narration .storybox { grid-template-columns: 1fr; }
.storyplayer.narration .storyart { display: none; }
.storyplayer .storytext { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; justify-content: center; min-height: 120px; }
.storyplayer.narration .storytext { grid-column: 1; }
.storyplayer .storyname {
  display: flex; align-items: center; gap: 10px;
  color: #ffd76a; font-size: 15px; font-weight: 700; margin-bottom: 10px;
}
.storyplayer .storyname em { color: #7d8ea8; font-style: normal; font-size: 12px; font-weight: 400; }
.storyplayer #storyLine {
  color: #e6eefb; font-size: 17px; line-height: 1.85; min-height: 3.2em;
  text-shadow: 0 2px 10px rgba(0,0,0,.7);
}
.storyplayer .storyctrl { grid-column: 1 / -1; grid-row: 2; display: flex; gap: 10px; justify-content: flex-end; }
.storyplayer .storyctrl button { min-width: 96px; }
/* v266：手机端对白布局重写 —— 原来 storytext 与 storyctrl 都指定 grid-row:2，
   单列时互相重叠（旁白首句按钮压在台词上）。改成明确三行：立绘 / 台词 / 按钮。 */
@media (max-width: 560px) {
  .storyplayer .storybox {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    padding: 14px; gap: 10px;
    max-height: 92vh;
  }
  .storyplayer .storyart { grid-column: 1; grid-row: 1; max-height: 32vh; }
  .storyplayer .storyart img { max-height: 32vh; }
  .storyplayer .storytext { grid-column: 1; grid-row: 2; min-height: 0; }
  .storyplayer .storyctrl { grid-column: 1; grid-row: 3; justify-content: space-between; }
  .storyplayer .storyctrl button { min-width: 0; flex: 1 1 0; height: 44px; min-height: 44px; max-height: 48px; padding: 0 10px; }
  .storyplayer #storyLine { font-size: 15px; line-height: 1.8; min-height: 0; }
  /* 旁白：没有立绘，两行就够 */
  .storyplayer.narration .storybox { grid-template-rows: auto auto; }
  .storyplayer.narration .storytext { grid-row: 1; }
  .storyplayer.narration .storyctrl { grid-row: 2; }
}
/* 竖屏更窄（如 480p 逻辑宽 360）时再收一档 */
@media (max-width: 380px) {
  .storyplayer { padding: 10px; }
  .storyplayer .storybox { padding: 12px; }
  .storyplayer #storyLine { font-size: 14px; }
  .storyplayer .storyname { font-size: 14px; margin-bottom: 6px; }
}
/* 对白播放时隐藏战斗 UI，保证是"战斗前"的观感 */
body.story-open .battlebar,
body.story-open .skilldock,
body.story-open #audioBox,
body.story-open .keyhint { display: none !important; }

/* ============ v281：结算卡片 · 历史最佳对比 ============ */
.rbest { margin: 12px 0 6px; border-top: 1px solid rgba(150,180,220,.18); padding-top: 10px; }
.rbesttitle { color: #8fd6ff; font-size: 12px; letter-spacing: 1px; margin-bottom: 6px; }
.rbestrow {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 0; font-size: 13px; color: #cfe0f5;
  border-bottom: 1px dashed rgba(150,180,220,.12);
}
.rbestrow span { width: 84px; color: #9fb3cc; }
.rbestrow b { color: #e8f1ff; font-size: 15px; min-width: 84px; }
.rbestrow small { color: #7d8ea8; flex: 1; }
.rbestrow.rec b { color: #ffd76a; text-shadow: 0 0 8px rgba(255,215,106,.5); }
.rbestrow em { font-style: normal; font-size: 11px; padding: 1px 6px; border-radius: 4px; }
.rbestrow .rnew { background: rgba(255,215,106,.16); color: #ffd76a; border: 1px solid rgba(255,215,106,.5); }
.rbestrow .rup { background: rgba(105,240,174,.14); color: #8ff0b8; border: 1px solid rgba(105,240,174,.4); }
.achcr { color: #ffd76a !important; font-size: 11px; margin-right: 6px; }

/* ============ v291：专属武器解锁弹窗 ============ */
.wunlock {
  position: fixed; inset: 0; z-index: 10020;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 40%, rgba(90,20,20,.55), rgba(4,6,12,.92) 70%);
  animation: wuFade .22s ease-out;
}
.wunlock.out { opacity: 0; transition: opacity .18s ease-in; }
@keyframes wuFade { from { opacity: 0 } to { opacity: 1 } }
.wucard {
  width: min(420px, 88vw); padding: 18px 20px 20px; text-align: center;
  background: linear-gradient(180deg, #1a1116, #0d0a10);
  border: 1px solid rgba(255,90,90,.55);
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(255,215,106,.18) inset, 0 18px 50px rgba(0,0,0,.75);
  animation: wuPop .28s cubic-bezier(.2,1.4,.4,1);
}
@keyframes wuPop { from { transform: scale(.86) translateY(10px) } to { transform: scale(1) translateY(0) } }
.wutag { color: #ff8a80; font-size: 12px; letter-spacing: 3px; margin-bottom: 8px; }
.wuimg {
  width: 168px; height: 168px; margin: 4px auto 10px; display: block;
  object-fit: contain; filter: drop-shadow(0 6px 14px rgba(0,0,0,.7));
  background: radial-gradient(circle, rgba(255,120,80,.12), transparent 70%);
  border-radius: 50%;
}
.wucard h2 { margin: 2px 0 6px; color: #ffd76a; font-size: 20px; letter-spacing: 2px; }
.wucard p { margin: 0 0 10px; color: #cfe0f5; font-size: 13px; line-height: 1.7; }
.wuhint { color: #8a9bb5; font-size: 12px; margin-bottom: 14px; }
.wuhint b { color: #ff5252; }
