@font-face { font-family: 'EQSerif'; src: url('assets/title.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'EQSerif'; src: url('assets/title_ext.woff2') format('woff2'); font-weight: 700; font-display: swap; unicode-range: U+2212,U+2248,U+25C6,U+2699,U+2713,U+4E22,U+4E2B,U+4E9B,U+4EB2,U+4F55,U+4F63,U+4F9D,U+4FD1,U+505A,U+514D,U+5175,U+517D,U+518C,U+5199,U+519B,U+51B3,U+51FD,U+5200,U+5265,U+526F,U+52A9,U+5348,U+5360,U+5378,U+539A,U+53C2,U+53EB,U+5403,U+540A,U+541E,U+541F,U+5427,U+5438,U+5439,U+545B,U+5473,U+5475,U+547C,U+5531,U+5598,U+559C,U+5632,U+5636,U+56F1,U+574A,U+5750,U+5769,U+576F,U+5782,U+57CB,U+57DA,U+57FA,U+5806,U+58A8,U+5949,U+5A01,U+5A18,U+5BCC,U+5BFF,U+5C51,U+5C55,U+5C71,U+5C9A,U+5DE2,U+5DEE,U+5DF7,U+5E02,U+5E08,U+5E3D,U+5E7F,U+5E8A,U+5E9F,U+5ED3,U+5F29,U+5F92,U+5FA1,U+5FD8,U+5FFD,U+600E,U+60AC,U+6234,U+6241,U+6258,U+6263,U+627E,U+62C6,U+62D0,U+62DF,U+62E2,U+62FD,U+62FE,U+6355,U+6392,U+63A2,U+63B7,U+63C9,U+63CF,U+643A,U+6458,U+6492,U+654F,U+65BD,U+65E6,U+65F7,U+660F,U+667E,U+66AE,U+66DD,U+66FE,U+6743,U+6781,U+679D,U+67AA,U+67D0,U+6805,U+6865,U+6881,U+68DA,U+68F1,U+69FD,U+6A90,U+6B22,U+6B47,U+6C42,U+6C49,U+6CB3,U+6D4F,U+6DA1,U+6DB8,U+6DE1,U+6E20,U+6E23,U+6EA2,U+6F02,U+6F6D,U+704C,U+706F,U+70BC,U+70BD,U+70DF,U+70ED,U+718F,U+724C,U+72D0,U+7565,U+76CF,U+76D2,U+7701,U+775B,U+7761,U+77AC,U+77DB,U+77E5,U+780C,U+7816,U+7827,U+7840,U+7891,U+78D0,U+7A0D,U+7A97,U+7AED,U+7AEF,U+7AF9,U+7B20,U+7B56,U+7B8D,U+7BA1,U+7BD3,U+7C98,U+7D2F,U+7EAF,U+7ED1,U+7EFD,U+7F1A,U+7F20,U+7F3A,U+7F61,U+7F72,U+8017,U+809A,U+80AF,U+80C1,U+8106,U+8111,U+8138,U+8154,U+8170,U+8179,U+819B,U+81C2,U+821E,U+82D3,U+8499,U+86DB,U+8857,U+88F9,U+8910,U+892A,U+89C8,U+8BA2,U+8BBD,U+8C61,U+8D56,U+8DE8,U+8DEA,U+8DFA,U+8E22,U+8E66,U+8EBA,U+8F66,U+8F68,U+8F91,U+8F99,U+8FF8,U+903B,U+903C,U+904D,U+90ED,U+91C9,U+91CE,U+9488,U+949F,U+94A9,U+94C1,U+94F8,U+94FA,U+9519,U+95FB,U+9632,U+964D,U+9676,U+9699,U+96BC,U+96C0,U+96C7,U+96EA,U+96F9,U+972D,U+987A,U+9999,U+9A7B,U+9A97,U+9AA4,U+9B03,U+9B3C,U+9B42,U+9ECE,U+9F9F; }
:root {
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --ember: #ff8a3a; --ember2: #ffc46b; --teal: #6ff0d0; --ink: #f3ead8; --dim: #b9b2a2; --panel: rgba(18, 24, 26, 0.86); --line: rgba(255, 196, 120, 0.28);
  --title: 'EQSerif', 'Noto Serif CJK SC', 'Songti SC', 'STSong', serif;
  --sans: system-ui, -apple-system, 'PingFang SC', 'Noto Sans CJK SC', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
  /* ---- 布局度量（docs_out/UI布局规范.md）。--hs 由 main.js layout() 按视口计算：clamp(min(宽/390, 高/844), 0.88, 1.25) ---- */
  --hs: 1;                                  /* HUD 缩放 */
  --bs: 1;                                  /* 设置 → 按钮大小（0.7–1.4） */
  --m: calc(12px * var(--hs));              /* 屏幕边距（另加安全区） */
  --g: calc(8px * var(--hs));               /* 栅格间距 */
  --edge: calc(18px * var(--hs));           /* 摇杆 / 动作簇距屏幕边缘 */
  --stick: calc(128px * var(--hs) * var(--bs));   /* 摇杆底座直径 */
  --btnP: calc(84px * var(--hs) * var(--bs));     /* 主动作键（翻滚）直径 */
  --btnS: calc(64px * var(--hs) * var(--bs));     /* 弧位副键（绝技）直径 */
  --arcR: calc(var(--btnP) / 2 + var(--btnS) / 2 + 10px * var(--hs) * var(--bs));   /* 主键圆心 → 副键圆心 */
  --btn: var(--btnP);                       /* 兼容旧引用 */
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0f1414; color: var(--ink); font-family: var(--sans); user-select: none; -webkit-user-select: none; touch-action: none; overscroll-behavior: none; }
canvas#c { position: fixed; inset: 0; display: block; }
button { font-family: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }
#vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(5, 8, 8, 0.55) 100%); display: none; }
body.lowq #vignette { display: block; }
#hurt { position: fixed; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, transparent 50%, rgba(200, 20, 10, 0.55) 100%); transition: opacity 0.35s; }
#slowfx { position: fixed; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, transparent 40%, rgba(60, 120, 255, 0.35) 100%); transition: opacity 0.2s; }
#dmg { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.dn { position: absolute; left: 0; top: 0; font-weight: 800; font-size: 17px; color: #fff; text-shadow: 0 2px 0 #2a1408, 0 0 6px rgba(0, 0, 0, 0.6); white-space: nowrap; will-change: transform; font-family: var(--sans); }
.dn.crit { color: #ffd23a; font-size: 28px; text-shadow: 0 2px 0 #5a2a00, 0 0 10px rgba(255, 170, 40, 0.75); z-index: 2; } .dn.crit::after { content: '!'; font-size: 0.8em; color: #ffefb0; }   /* 第 6 轮：去掉「暴击」后缀（连续暴击时满屏重复字），靠字号 / 金色 / 弹跳区分 */
.dn.call { font-family: var(--title); font-size: 19px; letter-spacing: 1px; padding: 1px 8px; border-radius: 10px; background: rgba(16, 10, 6, 0.55); z-index: 3; }   /* 状态提示：去重排队，带底衬，与数字分层 */
.dn.call.weak { font-size: 20px; } .dn.call.perfect { font-size: 22px; }
.dn.weak { color: #ffe36b; font-size: 24px; } .dn.weak:not(.call)::before { content: '◆'; font-size: 0.62em; color: #ff9a3a; margin-right: 2px; vertical-align: 0.18em; }   /* 第 8 轮：弱点 = 金色 + 橙色菱形，不再写「弱点」二字 */ .dn.hurt { color: #ff5a4a; font-size: 20px; } .dn.heal { color: #8fe38a; font-size: 18px; }
.dn.dot { font-size: 13px; opacity: 0.9; } .dn.dot.fire { color: #ffa060; } .dn.dot.poison { color: #a8f070; } .dn.bolt { color: #d0c0ff; } .dn.ult { color: #ffb070; }
.dn.react { font-family: var(--title); font-size: 24px; letter-spacing: 2px; color: #fff; }
.dn.burst { color: #ffb36b; } .dn.shock { color: #c8b4ff; } .dn.toxic { color: #c0f070; } .dn.ice { color: #9fe8ff; }
.dn.ally { color: #c8f0d0; font-size: 14px; } .dn.hurt.ally { color: #ffa890; font-size: 14px; } .dn.call.ally { color: #ffd0b0; font-size: 16px; }   /* 第 8 轮：雇佣游侠造成 / 受到的伤害（小号、浅色，与主角区分） */
.dn.perfect { font-family: var(--title); color: #9fd8ff; font-size: 26px; letter-spacing: 2px; } .dn.block { color: #8fd8ff; }

/* ---------------- HUD（顶部栅格） ---------------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 6; }
.hud-stack { position: absolute; left: calc(var(--sal) + var(--m)); right: calc(var(--sar) + var(--m)); top: calc(var(--sat) + var(--m)); display: flex; flex-direction: column; gap: var(--g); }
/* 两行三列：状态区 | 弹性空白 | 系统区；货币 | 弹性空白 | 目标。左列宽 = min(60%, 300px·hs) */
.hud-top { display: grid; grid-template-columns: minmax(0, min(60%, calc(300px * var(--hs)))) 1fr auto; grid-template-rows: calc(44px * var(--hs)) calc(36px * var(--hs)); grid-template-areas: "status . sys" "chips . target"; column-gap: var(--g); row-gap: calc(6px * var(--hs)); align-items: center; }
.hud-status { grid-area: status; display: flex; align-items: center; gap: var(--g); min-width: 0; }
.bars { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: calc(5px * var(--hs)); }
.hpbar { position: relative; height: calc(22px * var(--hs)); border-radius: calc(11px * var(--hs)); background: var(--skin-hp-bg); border: 1.5px solid rgba(255, 210, 160, 0.35); overflow: hidden; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); }
.hpfill, .hpghost { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; border-radius: inherit; transition: width 0.15s; }
.hpfill { background: var(--skin-hp-fill); z-index: 2; }
.hpghost { background: #ffe0b0; opacity: 0.6; transition: width 0.8s 0.2s; z-index: 1; }
#hpText { position: absolute; inset: 0; z-index: 3; font-size: calc(12.5px * var(--hs)); font-weight: 800; display: flex; align-items: center; justify-content: center; text-shadow: 0 1px 2px #000; font-variant-numeric: tabular-nums; }
.skin-frame { position: absolute; inset: 0; z-index: 4; pointer-events: none; background: var(--skin-hp-frame); }
.lvl { flex: none; width: calc(40px * var(--hs)); height: calc(40px * var(--hs)); border-radius: 50%; background: var(--skin-lvl-bg); color: #2a1408; font-weight: 900; font-size: calc(16px * var(--hs)); display: flex; align-items: center; justify-content: center; border: 2px solid #ffe7b8; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45); }
.xpbar { height: calc(7px * var(--hs)); border-radius: 4px; background: rgba(255, 255, 255, 0.12); overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.15); }
.xpfill { height: 100%; width: 0; background: var(--skin-xp-fill); transition: width 0.2s; }
.chips { grid-area: chips; display: flex; gap: var(--g); min-width: 0; }
.chip { background: var(--skin-chip-bg); border: 1px solid rgba(255, 220, 170, 0.2); border-radius: calc(14px * var(--hs)); height: calc(28px * var(--hs)); padding: 0 calc(10px * var(--hs)) 0 calc(7px * var(--hs)); font-size: calc(13px * var(--hs)); display: inline-flex; align-items: center; gap: calc(5px * var(--hs)); white-space: nowrap; }
.chip b { font-weight: 800; font-variant-numeric: tabular-nums; }
.hud-top .chip { min-width: calc(64px * var(--hs)); }
.coin, .emb { width: calc(13px * var(--hs)); height: calc(13px * var(--hs)); border-radius: 50%; display: inline-block; flex: none; }
.coin { background: radial-gradient(circle at 35% 30%, #fff1b0, #d9a441 60%, #8a5a10); }
.emb { background: radial-gradient(circle at 40% 35%, #fff0c0, #ff7a2a 55%, #8a2a0a); transform: rotate(45deg); border-radius: 40% 60% 50% 50%; }
.hud-sys { grid-area: sys; display: flex; align-items: center; justify-content: flex-end; gap: var(--g); min-width: 0; }
.roomtag { font-family: var(--title); font-size: calc(14px * var(--hs)); letter-spacing: 1px; color: #ffe0b0; text-shadow: 0 1px 4px #000, 0 0 10px rgba(0, 0, 0, 0.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(120px * var(--hs)); }
.iconbtn { pointer-events: auto; flex: none; width: calc(44px * var(--hs)); height: calc(44px * var(--hs)); border-radius: 50%; border: 1.5px solid rgba(255, 220, 170, 0.4); background: var(--skin-iconbtn-bg); display: flex; align-items: center; justify-content: center; padding: 0; }
.pz { width: calc(14px * var(--hs)); height: calc(16px * var(--hs)); border-left: calc(4px * var(--hs)) solid var(--ink); border-right: calc(4px * var(--hs)) solid var(--ink); }
.chipbtn { grid-area: target; justify-self: end; position: relative; pointer-events: auto; font-size: calc(12.5px * var(--hs)); height: calc(32px * var(--hs)); padding: 0 calc(11px * var(--hs)); border-radius: calc(16px * var(--hs)); border: 1px solid rgba(255, 196, 120, 0.4); background: var(--skin-chip-bg); white-space: nowrap; }
.chipbtn::before { content: ''; position: absolute; inset: -6px -4px; }   /* 扩大触控区到 ≥ 44px 高 */
#bossBar { align-self: center; width: min(100%, calc(520px * var(--hs))); text-align: center; }
.bname { font-family: var(--title); font-size: calc(18px * var(--hs)); letter-spacing: 3px; color: #ffd0a0; text-shadow: 0 2px 6px #000; }
.bbar { position: relative; height: calc(12px * var(--hs)); margin-top: 4px; border-radius: 6px; background: rgba(10, 4, 4, 0.8); border: 1.5px solid rgba(255, 120, 80, 0.5); overflow: hidden; }
.bbar .skin-frame { background: var(--skin-boss-frame); }
.bfill { height: 100%; width: 100%; background: linear-gradient(90deg, #ff4a2a, #ffb02e); transition: width 0.15s; }
.bbar .mk { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(255, 255, 255, 0.55); }
.bphase { font-size: calc(11px * var(--hs)); color: var(--dim); margin-top: 2px; }
#statusIcons { display: flex; gap: 4px; min-height: 0; }
#statusIcons:empty { display: none; }
.sico { font-size: calc(11px * var(--hs)); padding: 2px 7px; border-radius: 8px; background: rgba(20, 30, 30, 0.75); border: 1px solid rgba(111, 240, 208, 0.5); color: var(--teal); }
#banner { position: fixed; left: 50%; top: 32%; transform: translate(-50%, -50%) scale(0.9); z-index: 7; pointer-events: none; font-family: var(--title); font-size: clamp(20px, 5.4cqmin, 34px); letter-spacing: 4px; color: #fff3d8; text-shadow: 0 0 18px rgba(255, 140, 60, 0.8), 0 3px 0 #2a1408; opacity: 0; transition: opacity 0.25s, transform 0.25s; width: max-content; max-width: 88cqw; white-space: normal; text-align: center; line-height: 1.3; }   /* 长提示换行而不是截断成「……」 */
#banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
/* 第 6 轮：战斗中横幅进入 HUD 栈正下方的专用通道（top 由 ui.bShow 写入），单条半透明条，不再压在屏幕中央 */
#banner.lane { transform: translate(-50%, -4px); font-size: calc(17px * var(--hs)); letter-spacing: 2px; padding: calc(4px * var(--hs)) calc(26px * var(--hs)); max-width: min(92cqw, calc(520px * var(--hs))); background: linear-gradient(90deg, transparent, rgba(22, 12, 6, 0.66) 14%, rgba(22, 12, 6, 0.66) 86%, transparent); text-shadow: 0 0 10px rgba(255, 140, 60, 0.7), 0 2px 0 #2a1408; }
#banner.lane.show { transform: translate(-50%, 0); }

/* ---------------- 触控：固定摇杆 + 动作簇 ---------------- */
#ctrl { position: fixed; inset: 0; z-index: 4; pointer-events: none; }
/* 摇杆底座固定在左下（左手模式：右下），--sx/--sy 为「调整按钮位置」的偏移；触控区 = 底座四周外扩 0.35 倍直径 */
#stickBase { position: absolute; width: var(--stick); height: var(--stick); left: calc(var(--sal) + var(--edge) + var(--sx, 0px)); bottom: calc(var(--sab) + var(--edge) + var(--sy, 0px)); border-radius: 50%; background: var(--skin-stick-base); opacity: 0.85; pointer-events: none; transition: opacity 0.12s; }
#stickBase.on { opacity: 1; }
#stickKnob { position: absolute; left: 50%; top: 50%; width: 44%; height: 44%; border-radius: 50%; transform: translate(-50%, -50%); background: var(--skin-stick-knob); box-shadow: 0 0 12px rgba(255, 150, 80, 0.5); will-change: transform; }
#stickBase.on #stickKnob { box-shadow: 0 0 18px rgba(255, 150, 80, 0.9); }
#stickZone { position: absolute; width: calc(var(--stick) * 1.9); height: calc(var(--stick) * 1.9); left: calc(var(--sal) + var(--edge) + var(--sx, 0px) - var(--stick) * 0.45); bottom: calc(var(--sab) + var(--edge) + var(--sy, 0px) - var(--stick) * 0.45); border-radius: 50%; pointer-events: auto; touch-action: none; }
body.lefty #stickBase { left: auto; right: calc(var(--sar) + var(--edge) + var(--sx, 0px)); }
body.lefty #stickZone { left: auto; right: calc(var(--sar) + var(--edge) + var(--sx, 0px) - var(--stick) * 0.45); }
#stickHint { position: absolute; left: calc(var(--sal) + var(--edge)); bottom: calc(var(--sab) + var(--edge) + var(--stick) + var(--g)); max-width: calc(100cqw - var(--edge) * 2 - var(--btnP) - var(--btnS) - 24px); font-size: calc(12px * var(--hs)); color: rgba(255, 240, 220, 0.75); text-shadow: 0 1px 3px #000; pointer-events: none; transition: opacity 1s; }
body.lefty #stickHint { left: auto; right: calc(var(--sar) + var(--edge)); text-align: right; }
/* 动作簇：主键贴右下角，副键位于以主键圆心为原点、半径 --arcR 的弧上（arc1 = 112°，向左上）。预留 arc2 = 165° 给后续按键 */
#actions { position: absolute; right: calc(var(--sar) + var(--edge)); bottom: calc(var(--sab) + var(--edge)); width: var(--btnP); height: var(--btnP); pointer-events: none; }
body.lefty #actions { right: auto; left: calc(var(--sal) + var(--edge)); }
.abtn { position: absolute; pointer-events: auto; touch-action: none; border-radius: 50%; border: 2px solid rgba(255, 220, 170, 0.55); background: var(--skin-btn-secondary); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), inset 0 0 12px rgba(255, 160, 80, 0.15); display: flex; align-items: center; justify-content: center; padding: 0; }
.abtn .lab { font-family: var(--title); font-size: calc(var(--d) * 0.26); letter-spacing: 1px; position: relative; z-index: 2; text-shadow: 0 1px 3px #000; transition: opacity 0.15s; }
.abtn svg { position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px); transform: rotate(-90deg); pointer-events: none; }
.abtn circle { fill: none; stroke-width: 6; stroke-dasharray: 289; }
.abtn .track { stroke: rgba(0, 0, 0, 0.45); stroke-dashoffset: 0; }
.abtn .cd { stroke: var(--skin-ring-cd); stroke-dashoffset: 0; opacity: 0; }
.abtn .fillc { stroke: var(--skin-ring-ult); stroke-dashoffset: 289; }
.abtn.cooling .cd { opacity: 1; }
.abtn.cooling { filter: saturate(0.4) brightness(0.75); }
.abtn.cooling .lab { opacity: 0.6; }
.abtn.press { transform: scale(0.92); }
.abtn.primary { --d: var(--btnP); width: var(--btnP); height: var(--btnP); right: var(--rx, 0px); bottom: var(--ry, 0px); background: var(--skin-btn-primary); }
/* 副键圆心 = 主键圆心 + arcR·(cos112°, sin112°) = (−0.375·arcR, +0.927·arcR)（向上为正） */
.abtn.arc1 { --d: var(--btnS); width: var(--btnS); height: var(--btnS); right: calc(var(--btnP) / 2 + var(--arcR) * 0.375 - var(--btnS) / 2 + var(--ux, 0px)); bottom: calc(var(--btnP) / 2 + var(--arcR) * 0.927 - var(--btnS) / 2 + var(--uy, 0px)); }
.abtn.arc2 { --d: var(--btnS); width: var(--btnS); height: var(--btnS); right: calc(var(--btnP) / 2 + var(--arcR) * 0.966 - var(--btnS) / 2); bottom: calc(var(--btnP) / 2 + var(--arcR) * 0.259 - var(--btnS) / 2); }
/* 左手：动作簇镜像到左下，弧向右上 */
body.lefty .abtn.primary { right: auto; left: var(--rx, 0px); }
body.lefty .abtn.arc1 { right: auto; left: calc(var(--btnP) / 2 + var(--arcR) * 0.375 - var(--btnS) / 2 + var(--ux, 0px)); }
.abtn.ult.ready { border-color: #ffd080; box-shadow: 0 0 22px rgba(255, 150, 60, 0.9), inset 0 0 18px rgba(255, 170, 80, 0.5); animation: ultpulse 1s infinite; }
@keyframes ultpulse { 50% { box-shadow: 0 0 34px rgba(255, 170, 80, 1), inset 0 0 22px rgba(255, 190, 100, 0.7); } }
body.editlayout .abtn, body.editlayout #stickBase { outline: 2px dashed #6ff0d0; outline-offset: 4px; }
body.editlayout #stickBase { pointer-events: auto; opacity: 1; }
body.kbmode #stickHint { display: none; }

/* ---------------- 皮肤槽位（占位样式；Blender 烘焙美术换皮时只覆盖这些变量，例如
   --skin-stick-base: url(assets/ui/stick_base.webp) center / 100% 100% no-repeat; ） ---------------- */
:root {
  --skin-stick-base: radial-gradient(circle closest-side, rgba(255, 220, 180, 0.10) 0 30%, rgba(10, 12, 12, 0.42) 31% 88%, rgba(255, 205, 150, 0.75) 90% 95%, rgba(10, 12, 12, 0.35) 96% 100%);
  --skin-stick-knob: radial-gradient(circle at 40% 35%, rgba(255, 240, 220, 0.95), rgba(255, 170, 100, 0.8));
  --skin-btn-primary: radial-gradient(circle at 40% 35%, rgba(86, 72, 56, 0.9), rgba(22, 20, 18, 0.9));
  --skin-btn-secondary: radial-gradient(circle at 40% 35%, rgba(90, 58, 34, 0.9), rgba(26, 18, 14, 0.9));
  --skin-ring-cd: #6ff0d0; --skin-ring-ult: #ffb347;
  --skin-hp-bg: rgba(10, 6, 6, 0.75); --skin-hp-fill: linear-gradient(180deg, #ff9a6a, #d8362a 60%, #a8201a); --skin-hp-frame: none; --skin-boss-frame: none;
  --skin-xp-fill: linear-gradient(90deg, #6ff0d0, #c0fff0);
  --skin-lvl-bg: radial-gradient(circle at 35% 30%, #ffd88a, #c86a1a);
  --skin-chip-bg: rgba(10, 12, 12, 0.7); --skin-iconbtn-bg: rgba(10, 12, 12, 0.72);
  --skin-panel-bg: linear-gradient(180deg, rgba(34, 40, 40, 0.96), rgba(16, 20, 21, 0.97));
  --skin-sheet-bg: linear-gradient(180deg, rgba(30, 36, 36, 0.93), rgba(14, 18, 19, 0.96));
  --skin-panel-9s: none;      /* 九宫格面板框：例如 url(assets/ui/panel.webp) 48 fill / 24px stretch */
  --skin-tabbar-bg: linear-gradient(180deg, rgba(22, 26, 26, 0.94), rgba(10, 12, 12, 0.98));
}

/* ---------------- screens & panels ---------------- */
#screen { position: fixed; inset: 0; z-index: 8; pointer-events: none; }
#screen > * { pointer-events: auto; }
#modal { position: fixed; inset: 0; z-index: 10; display: none; align-items: center; justify-content: center; background: rgba(6, 8, 8, 0.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); padding: calc(var(--sat) + 10px) calc(var(--sar) + 10px) calc(var(--sab) + 10px) calc(var(--sal) + 10px); }
#modal.open { display: flex; }
.panel { position: relative; width: min(94cqw, 600px); max-height: 100%; overflow-y: auto; background: var(--skin-panel-bg); border-image: var(--skin-panel-9s); border: 1.5px solid var(--line); border-radius: 18px; padding: 18px 16px 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 220, 170, 0.12); animation: pop 0.22s ease-out; }
.panel.wide { width: min(96cqw, 860px); }
@keyframes pop { from { transform: scale(0.94); opacity: 0; } }
.panel h2 { margin: 0 0 4px; font-family: var(--title); font-size: 24px; letter-spacing: 3px; color: #ffe0b0; text-align: center; text-shadow: 0 0 14px rgba(255, 140, 60, 0.45); }
.panel .sub { text-align: center; color: var(--dim); font-size: 13px; margin-bottom: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 18px; border-radius: 12px; border: 1.5px solid rgba(255, 200, 130, 0.45); background: linear-gradient(180deg, rgba(70, 56, 40, 0.95), rgba(40, 30, 22, 0.95)); font-size: 15px; font-weight: 700; letter-spacing: 1px; white-space: nowrap; }
.btn.primary { background: linear-gradient(180deg, #ff9a4a, #d0581a); border-color: #ffd08a; color: #2a1206; text-shadow: 0 1px 0 rgba(255, 220, 170, 0.5); box-shadow: 0 4px 18px rgba(255, 120, 40, 0.4); }
.btn.teal { background: linear-gradient(180deg, rgba(40, 90, 84, 0.95), rgba(20, 50, 48, 0.95)); border-color: rgba(111, 240, 208, 0.5); }
.btn.ghost { background: rgba(255, 255, 255, 0.04); }
.btn:disabled { opacity: 0.4; filter: grayscale(0.6); }
.btn:focus-visible, .card:focus-visible, .tile:focus-visible { outline: 3px solid #6ff0d0; outline-offset: 2px; }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.small { font-size: 12px; color: var(--dim); }

/* title */
.title-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: calc(var(--sat) + 9cqh) 20px calc(var(--sab) + 7cqh); background: linear-gradient(180deg, rgba(10, 14, 14, 0.55), transparent 35%, transparent 60%, rgba(10, 14, 14, 0.75)); }
.logo { text-align: center; }
.logo .t1 { font-family: var(--title); font-size: clamp(48px, 15cqmin, 104px); letter-spacing: 0.12em; color: #fff0d0; text-shadow: 0 0 30px rgba(255, 120, 40, 0.75), 0 4px 0 #3a1a08; line-height: 1.1; }
.logo .t2 { font-family: var(--title); font-size: clamp(15px, 3.6cqmin, 22px); letter-spacing: 0.5em; color: #ffc08a; margin-top: 8px; padding-left: 0.5em; }
.logo .t3 { font-size: 12px; color: var(--dim); margin-top: 10px; letter-spacing: 2px; }
.menu { display: flex; flex-direction: column; gap: 10px; width: min(78cqw, 300px); }
.menu .btn { width: 100%; min-height: 52px; font-size: 17px; }
.foot { position: absolute; bottom: calc(var(--sab) + 8px); left: 0; right: 0; text-align: center; font-size: 11px; color: rgba(255, 240, 220, 0.4); }

/* camp */
.camp-top { position: absolute; top: calc(var(--sat) + 12px); left: calc(var(--sal) + 12px); right: calc(var(--sar) + 12px); display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.camp-title { font-family: var(--title); font-size: 22px; letter-spacing: 4px; color: #ffe0b0; text-shadow: 0 0 12px rgba(255, 140, 60, 0.6); }
.camp-title small.hero { color: var(--ember2); margin-top: 2px; }
.camp-title small { display: block; font-family: var(--sans); font-size: 12px; letter-spacing: 1px; color: var(--dim); }
.res { display: flex; gap: 6px; align-items: center; }
.res .chip { font-size: 14px; padding: 4px 12px 4px 8px; }
.camp-bottom { position: absolute; left: 0; right: 0; bottom: calc(var(--sab) + 14px); padding: 0 calc(var(--sar) + 12px) 0 calc(var(--sal) + 12px); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.stations { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: min(96cqw, 520px); }
.tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 62px; border-radius: 14px; border: 1.5px solid rgba(255, 200, 130, 0.3); background: linear-gradient(180deg, rgba(40, 44, 42, 0.92), rgba(20, 22, 22, 0.92)); font-size: 14px; font-weight: 700; padding: 6px 4px; }
.tile .g { font-family: var(--title); font-size: 22px; color: var(--ember2); line-height: 1; }
.tile .s { font-size: 10.5px; color: var(--dim); font-weight: 400; }
.tile .dot { position: absolute; right: 8px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: #ff5a3a; box-shadow: 0 0 6px #ff5a3a; }
.go { width: min(96cqw, 520px); min-height: 58px !important; font-size: 20px !important; letter-spacing: 6px !important; font-family: var(--title); }

/* map */
.map-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; background: radial-gradient(ellipse at 50% 40%, rgba(30, 40, 38, 0.55), rgba(8, 10, 10, 0.92)); }
.map-head { padding: calc(var(--sat) + 12px) calc(var(--sar) + 14px) 6px calc(var(--sal) + 14px); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.map-head h3 { margin: 0; font-family: var(--title); font-size: 20px; letter-spacing: 3px; color: #ffe0b0; }
.map-head .small { margin-top: 2px; }
.map-head .row { flex-wrap: nowrap; flex: none; }
.map-head h3 { white-space: nowrap; }
.map-body { flex: 1; position: relative; overflow: auto; padding: 0 calc(var(--sar) + 10px) 0 calc(var(--sal) + 10px); }
.map-canvas { position: relative; margin: 0 auto; width: min(100%, 560px); }
.map-canvas svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.mnode { position: absolute; transform: translate(-50%, -50%); width: 52px; height: 52px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.25); background: radial-gradient(circle at 40% 35%, rgba(60, 60, 56, 0.95), rgba(24, 24, 22, 0.95)); display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--title); font-size: 20px; color: var(--c); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5); padding: 0; }
.mnode small { font-family: var(--sans); font-size: 9.5px; color: var(--dim); line-height: 1; margin-top: 1px; }
.mnode.boss { width: 70px; height: 70px; font-size: 28px; border-color: #ff5a3a; }
.mnode.reach { border-color: var(--c); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05), 0 0 18px var(--c); animation: nodepulse 1.2s infinite; }
@keyframes nodepulse { 50% { transform: translate(-50%, -50%) scale(1.08); } }
.mnode.done { opacity: 0.45; filter: grayscale(0.4); }
.mnode.cur { border-color: #fff; }
.mnode.locked { opacity: 0.55; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 10px; justify-content: center; padding: 6px 10px calc(var(--sab) + 10px); font-size: 11px; color: var(--dim); }
.legend span b { font-family: var(--title); font-size: 13px; margin-right: 2px; }

/* level-up cards */
.cards { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 6px; }
.card { position: relative; display: flex; gap: 12px; align-items: center; text-align: left; padding: 12px; border-radius: 14px; border: 1.5px solid rgba(255, 200, 130, 0.3); background: linear-gradient(135deg, rgba(48, 46, 40, 0.95), rgba(24, 24, 22, 0.95)); min-height: 86px; }
.card .ic { flex: none; width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-family: var(--title); font-size: 28px; color: #fff; background: radial-gradient(circle at 35% 30%, var(--c1), var(--c2)); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25), 0 3px 10px rgba(0, 0, 0, 0.4); text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); }
.card .tx { flex: 1; min-width: 0; }
.card .nm { font-weight: 800; font-size: 16px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card .lv { font-size: 11px; color: var(--ember2); letter-spacing: 1px; }
.card .ds { font-size: 13px; color: #e8dfcc; margin-top: 3px; line-height: 1.35; }
.card .sy { font-size: 11.5px; color: var(--teal); margin-top: 4px; line-height: 1.3; }
.card .sy.hot { color: #ffd36b; }
.card.evo { border-color: #ffd36b; background: linear-gradient(135deg, rgba(90, 66, 24, 0.97), rgba(40, 28, 12, 0.97)); box-shadow: 0 0 24px rgba(255, 190, 80, 0.45); }
.card.evo .nm::before { content: '进化'; font-size: 10px; padding: 1px 6px; border-radius: 6px; background: #ffd36b; color: #3a2408; }
.card.evo .sy { color: #ffe9b0; line-height: 1.55; } .card.evo .ef { display: inline-block; padding: 0 5px; border-radius: 5px; background: rgba(255, 255, 255, 0.08); color: #d8c8a8; white-space: nowrap; } .card.evo .ef.ok { background: rgba(120, 220, 140, 0.18); color: #b8f0b0; } .card.evo .ef-to { display: block; margin-top: 2px; color: #ffd36b; font-family: var(--title); letter-spacing: 1px; white-space: nowrap; } .card.evo .ef-to::before { content: '→ 进化为 '; font-family: var(--sans); font-weight: 400; letter-spacing: 0; color: #e8d8b0; }   /* 第 6 轮：进化公式 基础 ✓ ＋ 条件 ✓ → 形态 */
.card.locked { border-color: #6ff0d0; }
.card .acts { position: absolute; right: 8px; top: 8px; display: flex; gap: 6px; }
.mini { min-width: 34px; height: 30px; border-radius: 9px; font-size: 11.5px; border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(0, 0, 0, 0.35); padding: 0 6px; }
.mini.on { background: #6ff0d0; color: #082a24; border-color: #6ff0d0; }
.card .tx { padding-right: 76px; }
.cat-shot { --c1: #ffd08a; --c2: #b86a1a; } .cat-stat { --c1: #ff9a7a; --c2: #a0301a; } .cat-def { --c1: #9ae8a0; --c2: #2a7a3a; }
.cat-fire { --c1: #ffb36b; --c2: #c8380a; } .cat-ice { --c1: #c8f4ff; --c2: #3a8ab8; } .cat-bolt { --c1: #e0d0ff; --c2: #6a40c8; } .cat-poison { --c1: #d8ff9a; --c2: #4a8a1a; } .cat-water { --c1: #a8d8ff; --c2: #1a5ab8; }
.cat-evo { --c1: #fff0b0; --c2: #d08a10; } .cat-relic { --c1: #f0c8ff; --c2: #7a3aa8; }
.lu-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.owned { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; justify-content: center; }
.owned span { font-size: 11px; padding: 2px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); }

/* shop / lists */
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08); }
.item .ic { flex: none; width: 44px; height: 44px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-family: var(--title); font-size: 22px; background: radial-gradient(circle at 35% 30%, var(--c1, #ffd08a), var(--c2, #8a4a10)); }
.item .tx { flex: 1; min-width: 0; } .item .nm { font-weight: 700; } .item .ds { font-size: 12px; color: var(--dim); line-height: 1.35; }
.item .cost { color: #ff9a8a; font-size: 11.5px; }
.item .btn { min-height: 38px; padding: 0 12px; font-size: 13px; }
.tabs { display: flex; gap: 6px; justify-content: center; margin-bottom: 10px; flex-wrap: wrap; }
.tabs .btn { min-height: 36px; font-size: 13px; padding: 0 14px; }
.tabs .btn.on { background: linear-gradient(180deg, #ff9a4a, #d0581a); color: #2a1206; }
.unseen { filter: grayscale(1) brightness(0.5); }
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 2px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); font-size: 14px; }
.seg { display: flex; border-radius: 10px; overflow: hidden; border: 1px solid rgba(255, 200, 130, 0.35); flex: none; }
.seg button { border: 0; background: rgba(0, 0, 0, 0.25); padding: 7px 10px; font-size: 13px; min-width: 46px; }
.seg button.on { background: #ff8a3a; color: #2a1206; font-weight: 700; }
input[type=range] { width: 130px; accent-color: #ff8a3a; }
.result-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.result-stats div { background: rgba(255, 255, 255, 0.05); border-radius: 10px; padding: 8px; text-align: center; font-size: 12px; color: var(--dim); }
.result-stats b { display: block; font-size: 18px; color: var(--ink); }
#toast { position: fixed; left: 50%; bottom: calc(var(--sab) + 30%); transform: translateX(-50%); z-index: 12; background: rgba(20, 24, 24, 0.92); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity 0.3s; max-width: 86cqw; text-align: center; }
#toast.show { opacity: 1; }
#fps { position: fixed; left: calc(var(--sal) + 6px); top: 42%; z-index: 20; font: 11px/1.3 monospace; color: #9f9; background: rgba(0, 0, 0, 0.5); padding: 2px 6px; border-radius: 4px; pointer-events: none; }
#loading { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, #1e2a28, #0a0e0e); transition: opacity 0.6s; }
#loading.gone { opacity: 0; pointer-events: none; }
.ltitle { font-family: var(--title); font-size: clamp(42px, 12cqmin, 80px); letter-spacing: 0.12em; color: #fff0d0; text-shadow: 0 0 24px rgba(255, 120, 40, 0.7); }
.lsub { font-family: var(--title); letter-spacing: 0.4em; color: #ffc08a; margin: 6px 0 26px; }
.lbar { width: min(60cqw, 280px); height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
#lfill { height: 100%; width: 0; background: linear-gradient(90deg, #ff7a2a, #ffd08a); transition: width 0.2s; }
.ltip { margin-top: 12px; font-size: 12px; color: var(--dim); }
.kbd { font-family: monospace; background: rgba(255, 255, 255, 0.1); border-radius: 4px; padding: 0 4px; }

/* ---------- 大尺寸竖屏区域（宽框模式下的平板 / 电脑，区域高 ≥ 900px） ---------- */
@container app (min-height: 900px) {
  .panel h2 { font-size: 26px; }
  .dn { font-size: 19px; } .dn.crit { font-size: 31px; } .dn.call { font-size: 21px; }
  .mnode { width: 58px; height: 58px; font-size: 22px; } .mnode.boss { width: 78px; height: 78px; }
}


.credits { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.credits summary { cursor: pointer; color: #ffe0b0; font-size: 14px; padding: 4px 0; }
.credits .cr { margin: 8px 0; font-size: 12px; line-height: 1.5; color: var(--dim); word-break: break-all; }
.credits .cr b { color: #f3e6d0; } .credits .cr span { color: #9fb7b0; } .credits .cr i { font-style: normal; color: #c9b89a; }
.credits .cr .tag { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 8px; background: rgba(120,200,190,.18); color: #9fe3d6; font-size: 11px; }

/* ================= M2 客户端外壳 ================= */
/* #app：全部游戏画面的容器。transform 让内部 position:fixed 以它为包含块；container 让 cqw/cqh 以它为准 */
#app { position: fixed; inset: 0; transform: translateZ(0); container-type: size; container-name: app; overflow: hidden; background: #0f1414; }
body.framed { background: #0b0f0f; }
body.framed #app { left: calc(50% - var(--fw) / 2); right: auto; width: var(--fw); box-shadow: 0 0 0 1px rgba(255, 196, 120, 0.22), 0 0 60px rgba(0, 0, 0, 0.8); }
/* 两侧装饰面板 */
.side { display: none; position: fixed; top: 0; bottom: 0; width: var(--side); overflow: hidden; pointer-events: none;
  background: radial-gradient(ellipse at 50% 30%, rgba(255, 138, 58, 0.10), transparent 60%), repeating-linear-gradient(135deg, rgba(255, 220, 170, 0.035) 0 2px, transparent 2px 14px), linear-gradient(180deg, #172120, #0c1111 60%, #120d0c); }
#sideL { left: 0; border-right: 1px solid rgba(255, 196, 120, 0.18); }
#sideR { right: 0; border-left: 1px solid rgba(255, 196, 120, 0.18); }
body.framed .side { display: block; }
.side::before { content: ''; position: absolute; left: 50%; top: 50%; width: min(70%, 240px); aspect-ratio: 1; transform: translate(-50%, -50%) rotate(45deg); border: 1.5px solid rgba(255, 196, 120, 0.16); box-shadow: inset 0 0 0 10px rgba(255, 196, 120, 0.03), 0 0 0 10px rgba(255, 196, 120, 0.03); }
.side::after { content: ''; position: absolute; inset: 14px; border: 1px solid rgba(255, 196, 120, 0.12); border-radius: 18px; }
.side .sd { position: absolute; left: 0; right: 0; top: 0; bottom: 0; display: none; flex-direction: column; justify-content: center; align-items: center; gap: 18px; padding: 40px 28px; text-align: center; }
body.sides-rich .side .sd { display: flex; }
.sd .sd-logo { font-family: var(--title); font-size: clamp(30px, 3.4vw, 46px); letter-spacing: 0.14em; color: #fff0d0; text-shadow: 0 0 22px rgba(255, 120, 40, 0.6); }
.sd .sd-sub { font-family: var(--title); letter-spacing: 0.4em; color: #ffc08a; font-size: 15px; }
.sd .sd-box { width: min(100%, 300px); background: rgba(10, 14, 14, 0.6); border: 1px solid rgba(255, 196, 120, 0.22); border-radius: 14px; padding: 12px 14px; text-align: left; font-size: 13px; color: var(--dim); line-height: 1.7; }
.sd .sd-box b { color: #ffe0b0; font-weight: 700; }
.sd .sd-box h4 { margin: 0 0 6px; font-family: var(--title); font-size: 16px; letter-spacing: 2px; color: #ffe0b0; font-weight: 700; }
.sd .sd-ch { display: flex; justify-content: space-between; gap: 8px; }
.sd .sd-ch i { font-style: normal; color: #9fb7b0; }
/* 手机横屏遮罩 */
#rotateHint { display: none; position: fixed; inset: 0; z-index: 100; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: radial-gradient(ellipse at center, #1e2a28, #0a0e0e); text-align: center; padding: 20px; }
body.rotate #rotateHint { display: flex; }
body.rotate #app { visibility: hidden; }
.rh-phone { width: 46px; height: 78px; border: 3px solid #ffc08a; border-radius: 10px; position: relative; animation: rhturn 2.4s ease-in-out infinite; }
.rh-phone i { position: absolute; left: 50%; bottom: 6px; width: 10px; height: 3px; margin-left: -5px; border-radius: 2px; background: #ffc08a; }
@keyframes rhturn { 0%, 20% { transform: rotate(-90deg); } 55%, 100% { transform: rotate(0deg); } }
.rh-t { font-family: var(--title); font-size: 30px; letter-spacing: 6px; color: #fff0d0; text-shadow: 0 0 18px rgba(255, 120, 40, 0.6); }
.rh-s { font-size: 13px; color: var(--dim); }

/* ---------- 营地主界面：顶栏 + 内容 + 底部页签 ---------- */
.shell { position: absolute; inset: 0; pointer-events: none; }
.shell > * { pointer-events: auto; }
.sh-top { position: absolute; top: 0; left: 0; right: 0; padding: calc(var(--sat) + 10px) calc(var(--sar) + 12px) 22px calc(var(--sal) + 12px); display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; background: linear-gradient(180deg, rgba(8, 10, 10, 0.7), rgba(8, 10, 10, 0)); pointer-events: none; }
.sh-top > * { pointer-events: auto; }
.sh-title { font-family: var(--title); font-size: 22px; letter-spacing: 4px; color: #ffe0b0; text-shadow: 0 0 12px rgba(255, 140, 60, 0.6); min-width: 0; }
.sh-title small { display: block; font-family: var(--sans); font-size: 12px; letter-spacing: 1px; color: var(--ember2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabbar { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px calc(var(--sar) + 6px) calc(var(--sab) + 6px) calc(var(--sal) + 6px); background: var(--skin-tabbar-bg); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45); z-index: 2; }
.tabbar button { position: relative; min-height: 54px; border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; color: var(--dim); border-radius: 12px; padding: 4px 0; }
.tabbar button .g { font-family: var(--title); font-size: 20px; line-height: 1; color: #9a927f; }
.tabbar button.on { color: #ffe0b0; background: radial-gradient(ellipse at 50% 100%, rgba(255, 138, 58, 0.28), transparent 70%); }
.tabbar button.on .g { color: var(--ember2); text-shadow: 0 0 10px rgba(255, 150, 60, 0.7); }
.tabbar button.on::before { content: ''; position: absolute; top: -7px; left: 30%; right: 30%; height: 3px; border-radius: 2px; background: var(--ember); box-shadow: 0 0 8px var(--ember); }
.tabbar .dot { position: absolute; top: 6px; right: calc(50% - 18px); width: 8px; height: 8px; border-radius: 50%; background: #ff5a3a; box-shadow: 0 0 6px #ff5a3a; }
.sh-body { position: absolute; left: 0; right: 0; top: calc(var(--sat) + 70px); bottom: calc(var(--sab) + 66px); display: flex; flex-direction: column; justify-content: flex-end; padding: 0 calc(var(--sar) + 12px) 10px calc(var(--sal) + 12px); pointer-events: none; }
.sh-body > * { pointer-events: auto; }
.sheet { background: var(--skin-sheet-bg); border-image: var(--skin-panel-9s); border: 1.5px solid var(--line); border-radius: 18px; padding: 14px 12px 12px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 220, 170, 0.1); overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; min-height: 0; }
.sheet.tall { flex: 1; }
.sheet h3 { margin: 0 0 2px; font-family: var(--title); font-size: 20px; letter-spacing: 3px; color: #ffe0b0; }
.sheet .sub { color: var(--dim); font-size: 12.5px; margin-bottom: 10px; }
.sec { margin: 12px 0 6px; font-size: 13px; color: var(--ember2); font-weight: 700; letter-spacing: 1px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sec small { color: var(--dim); font-weight: 400; letter-spacing: 0; }
/* 营地页签 */
.side-btns { position: absolute; left: calc(var(--sal) + 12px); top: calc(var(--sat) + 78px); display: flex; flex-direction: column; gap: 8px; }
.pill { min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: 22px; border: 1.5px solid rgba(255, 200, 130, 0.38); background: rgba(14, 18, 18, 0.78); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.pill .g { font-family: var(--title); color: var(--ember2); font-size: 16px; }
.pill small { color: var(--dim); font-weight: 400; font-size: 11px; }
.actcard { background: linear-gradient(180deg, rgba(26, 32, 32, 0.9), rgba(12, 16, 16, 0.94)); border: 1.5px solid var(--line); border-radius: 18px; padding: 12px; box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5); }
.act-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.act-head .an { font-family: var(--title); font-size: 18px; letter-spacing: 2px; color: #ffe0b0; white-space: nowrap; }
.act-head .an small { font-family: var(--sans); font-size: 12px; color: var(--dim); letter-spacing: 0; margin-left: 6px; }
.act-head .pill { min-height: 44px; font-size: 12px; padding: 0 12px; }
.chaps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.chap { position: relative; min-height: 92px; border-radius: 14px; border: 1.5px solid rgba(255, 200, 130, 0.25); background: linear-gradient(180deg, rgba(48, 52, 46, 0.92), rgba(22, 24, 22, 0.94)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 8px 4px; text-align: center; overflow: hidden; }
.chap .cn { font-size: 11px; color: var(--dim); }
.chap .nm { font-family: var(--title); font-size: 16px; letter-spacing: 1px; color: #f6e6c8; line-height: 1.15; }
.chap .wx { font-size: 10.5px; padding: 1px 7px; border-radius: 8px; background: rgba(111, 240, 208, 0.12); color: #9fe3d6; }
.chap .st { font-size: 10.5px; color: var(--ember2); }
.chap.on { border-color: #ffc46b; box-shadow: 0 0 0 2px rgba(255, 196, 107, 0.25), 0 0 18px rgba(255, 140, 60, 0.35); background: linear-gradient(180deg, rgba(86, 64, 36, 0.95), rgba(34, 26, 18, 0.95)); }
.chap.locked { filter: grayscale(0.85); opacity: 0.62; }
.chap.wip .st { color: #9fb7b0; }
.ch-info { margin-top: 8px; font-size: 12px; color: var(--dim); line-height: 1.5; text-align: center; }
.ch-info b { color: #f3e6d0; font-weight: 700; }
.go-row { display: flex; gap: 8px; margin-top: 10px; }
.go-row .btn { flex: 1; }
.go { min-height: 56px !important; font-size: 20px !important; letter-spacing: 6px !important; font-family: var(--title); width: auto; }
/* 英雄页签 */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stats div { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 10px; padding: 6px 4px; text-align: center; font-size: 11px; color: var(--dim); }
.stats b { display: block; font-size: 16px; color: var(--ink); font-weight: 800; }
.wcards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wcard { border-radius: 14px; border: 1.5px solid rgba(255, 200, 130, 0.25); background: rgba(255, 255, 255, 0.04); padding: 10px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wcard.on { border-color: #ffc46b; background: rgba(255, 170, 80, 0.1); }
.wcard .wn { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; }
.wcard .wn .ic { flex: none; width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-family: var(--title); font-size: 18px; background: radial-gradient(circle at 35% 30%, var(--c1), var(--c2)); }
.wcard .wd { font-size: 11.5px; color: var(--dim); line-height: 1.4; flex: 1; }
.wcard .btn { min-height: 44px; font-size: 13px; padding: 0 8px; }
/* 通用条目（成长 / 挑战 / 图鉴） */
.entry { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08); min-height: 64px; width: 100%; text-align: left; font: inherit; color: inherit; }
button.entry { cursor: pointer; }
.entry + .entry { margin-top: 8px; }
.entry .ic { flex: none; width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-family: var(--title); font-size: 22px; color: #fff; background: radial-gradient(circle at 35% 30%, var(--c1, #ffd08a), var(--c2, #8a4a10)); text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); overflow: hidden; }
.entry .ic img { width: 100%; height: 100%; object-fit: contain; }
.entry .ic.pt { background: radial-gradient(circle at 50% 40%, rgba(255, 220, 170, 0.22), rgba(20, 24, 22, 0.9)); width: 56px; height: 56px; }
.entry .tx { flex: 1; min-width: 0; }
.entry .nm { font-weight: 800; font-size: 14.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.entry .ds { font-size: 12px; color: var(--dim); line-height: 1.4; margin-top: 2px; }
.entry .id { font-size: 10.5px; color: rgba(185, 178, 162, 0.5); margin-top: 3px; font-family: ui-monospace, monospace; letter-spacing: 0.3px; }
.entry .chev { flex: none; color: var(--ember2); font-size: 20px; }
.entry.soon { opacity: 0.72; }
.entry.unseen .ic { filter: grayscale(1) brightness(0.35); }
.entry.unseen .nm { color: #9a927f; }
.tag { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 8px; background: rgba(255, 196, 107, 0.16); color: var(--ember2); border: 1px solid rgba(255, 196, 107, 0.3); white-space: nowrap; }
.tag.soon { background: rgba(160, 160, 160, 0.12); color: #c8c0b0; border-color: rgba(200, 200, 200, 0.25); }
.tag.boss { background: rgba(255, 90, 58, 0.16); color: #ff9a7a; border-color: rgba(255, 90, 58, 0.35); }
.subtabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.subtabs button { min-height: 44px; border-radius: 12px; border: 1.5px solid rgba(255, 200, 130, 0.3); background: rgba(255, 255, 255, 0.04); font-size: 14px; font-weight: 700; }
.subtabs button.on { background: linear-gradient(180deg, #ff9a4a, #d0581a); color: #2a1206; border-color: #ffd08a; }
.prog { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin: 2px 0 10px; }
.prog i { display: block; height: 100%; background: linear-gradient(90deg, #ff8a3a, #ffd08a); }
.story-note { font-size: 12px; color: var(--dim); text-align: center; margin: -4px 0 10px; line-height: 1.5; }
/* 全部章节面板 */
.actlist .act { margin-bottom: 12px; }
.actlist .act h4 { margin: 0 0 6px; font-family: var(--title); font-size: 16px; letter-spacing: 2px; color: #ffe0b0; font-weight: 700; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.actlist .act h4 small { font-family: var(--sans); font-size: 11.5px; color: var(--dim); letter-spacing: 0; font-weight: 400; }
@container app (min-height: 900px) {
  .sh-title { font-size: 26px; }
  .chap { min-height: 104px; } .chap .nm { font-size: 18px; }
  .stats b { font-size: 18px; }
}

/* ---- 第一幕整合：双子子血条 / 字幕 / 剧情对话 / 章节载入 ---- */
.bsub { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 11px; color: var(--dim); }
.bsub.hidden { display: none; }
.bsub span { font-family: var(--title); color: #cfe8ff; min-width: 1.2em; }
.bsub .sbar { flex: 1; height: 6px; border-radius: 3px; background: rgba(10, 8, 8, 0.8); border: 1px solid rgba(140, 200, 255, 0.4); overflow: hidden; }
.bsub .sbar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #4aa8ff, #9ae0ff); transition: width 0.15s; }
.bsub .sbar i.dead { background: #444; }
#bsubB { background: linear-gradient(90deg, #a0804a, #e0c080); }
#subtitle { position: absolute; left: 50%; bottom: calc(var(--sab) + 30cqh); transform: translateX(-50%); z-index: 8; pointer-events: none; max-width: 88cqw; text-align: center; font-size: clamp(14px, 3.9cqw, 18px); line-height: 1.45; color: #fff4e0; background: rgba(10, 12, 14, 0.72); border: 1px solid rgba(255, 196, 120, 0.3); border-radius: 12px; padding: 7px 14px; opacity: 0; transition: opacity 0.25s; }
#subtitle.show { opacity: 1; }
#subtitle b { font-family: var(--title); color: #ffc46b; margin-right: 6px; letter-spacing: 1px; }
#dialog { position: absolute; inset: 0; z-index: 25; display: flex; flex-direction: column; justify-content: flex-end; background: linear-gradient(180deg, rgba(5, 7, 8, 0.55) 0%, rgba(5, 7, 8, 0.62) 45%, rgba(5, 7, 8, 0.9) 100%); cursor: pointer; }
#dialog.hidden { display: none; }
.dlg-scene { position: absolute; left: 0; right: 0; top: calc(var(--sat) + 22cqh); text-align: center; font-family: var(--title); font-size: clamp(14px, 3.6cqw, 18px); letter-spacing: 4px; color: rgba(255, 220, 170, 0.75); text-shadow: 0 2px 8px #000; padding: 0 16px; }
.dlg-box { margin: 0 calc(var(--sar) + 14px) calc(var(--sab) + 7cqh) calc(var(--sal) + 14px); padding: 16px 18px 12px; border-radius: 16px; background: rgba(16, 20, 22, 0.92); border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); min-height: 120px; display: flex; flex-direction: column; }
.dlg-who { font-family: var(--title); font-size: 17px; letter-spacing: 2px; color: #ffc46b; min-height: 22px; }
.dlg-who.narr { color: var(--dim); font-size: 13px; letter-spacing: 3px; }
.dlg-text { flex: 1; margin-top: 8px; font-size: clamp(16px, 4.3cqw, 20px); line-height: 1.6; color: #fff4e0; }
.dlg-text.narr { font-style: italic; color: #e6dcc8; }
.dlg-text.sys { font-family: var(--title); text-align: center; font-size: clamp(20px, 5.6cqw, 28px); letter-spacing: 4px; color: #ffd8a0; text-shadow: 0 0 16px rgba(255, 140, 60, 0.6); padding: 8px 0; }
.dlg-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.dlg-hint { font-size: 12px; color: var(--dim); }
.dlg-skip { min-width: 72px; min-height: 44px; border-radius: 22px; border: 1px solid var(--line); background: rgba(255, 196, 120, 0.08); font-size: 14px; color: var(--ink); }
#chload { position: absolute; inset: 0; z-index: 26; display: flex; align-items: center; justify-content: center; background: rgba(8, 10, 10, 0.82); }
#chload.hidden { display: none; }
.cl-box { width: min(80cqw, 360px); text-align: center; }
.cl-t { font-family: var(--title); font-size: 20px; letter-spacing: 3px; color: #ffd8a0; margin-bottom: 14px; }
.cl-s { margin-top: 10px; font-size: 12px; color: var(--dim); }
#chload .lbar { width: 100%; }
#clFill { height: 100%; width: 0; background: linear-gradient(90deg, #ff8a3a, #ffc46b); transition: width 0.2s; }
.story-sec { font-family: var(--title); font-size: 14px; letter-spacing: 2px; color: #ffc46b; margin: 12px 0 6px; }
.story-act { font-family: var(--title); font-size: 16px; letter-spacing: 3px; color: #ffe2b0; margin: 16px 0 2px; padding-bottom: 4px; border-bottom: 1px solid rgba(255, 196, 107, 0.35); }
.entry .tx .lore { font-size: 13px; line-height: 1.6; color: var(--ink); margin-top: 4px; }
.entry.replay { cursor: pointer; }
.csec { font-family: var(--title); font-size: 13px; letter-spacing: 2px; color: #ffc46b; margin: 10px 2px 4px; }

/* ---------- 平板竖屏（全屏，宽 ≥ 600）：营地外壳与弹窗整体按 --hs 等比放大，内容列限宽居中 ---------- */
body.tabletp .shell, body.tabletp #modal > .panel { zoom: var(--hs); }
body.tabletp .sh-body { align-items: center; }
body.tabletp .sh-body > * { width: 100%; max-width: 640px; }
body.tabletp .tabbar { padding-left: calc(50% - 320px); padding-right: calc(50% - 320px); }


/* ================= 菜单背景（UI 第 4 轮整合）=================
   #menuBg 位于 3D 画布之上、#screen 之下；main.js 每帧比对「当前界面 + 章节」，变化时由 ui.backdrop() 切换。
   章节 → 前缀：第一章 雾沼遗林 = mist，第二章 雨渊浅滩 = rain，第三章 雷鸣朽冠 = storm；手机用 *_phone（1080×2340），body.tabletp 用 *_tablet（1536×2048）。
   只给当前那一张 .mb-img 设置 background-image → 其余章节的图不会被下载（懒加载）；切换时预载完成再交叉淡入。
   动效：底图 60 s 缓慢推拉 + 雾带横向漂移 + 暴雨章实时雨丝（SVG 平铺）+ 雷暴章偶发闪光；减少动效 / 低画质时全部静止。 */
#menuBg { position: absolute; inset: 0; z-index: 7; pointer-events: none; overflow: hidden; background: #0b0d0c; opacity: 1; transition: opacity 0.35s ease, visibility 0s; }
#menuBg.off { opacity: 0; visibility: hidden; transition: opacity 0.35s ease, visibility 0s 0.35s; }
#menuBg > i { position: absolute; inset: 0; display: block; }
#menuBg .mb-img { inset: -3%; background: #0b0d0c center / cover no-repeat; opacity: 0; transition: opacity 0.7s ease; transform: scale(1.03); will-change: transform, opacity; animation: mbDrift 60s ease-in-out infinite alternate; }
#menuBg .mb-img.on { opacity: 1; }
@keyframes mbDrift { from { transform: scale(1.03) translate3d(-0.8%, 0.5%, 0); } to { transform: scale(1.075) translate3d(0.8%, -0.6%, 0); } }
/* 雾带：两层宽椭圆渐变，40–70 s 横向往返（只在营地 / 标题明显，路线图被遮罩压暗） */
#menuBg .mb-fog { inset: -10% -40%; opacity: 0.55; background:
    radial-gradient(ellipse 38% 9% at 30% 62%, rgba(214, 228, 222, 0.30), transparent 70%),
    radial-gradient(ellipse 46% 11% at 72% 74%, rgba(214, 228, 222, 0.26), transparent 70%),
    radial-gradient(ellipse 30% 7% at 55% 50%, rgba(214, 228, 222, 0.18), transparent 70%);
  animation: mbFog 54s ease-in-out infinite alternate; will-change: transform; }
@keyframes mbFog { from { transform: translate3d(-6%, 0, 0); } to { transform: translate3d(6%, -1.5%, 0); } }
#menuBg[data-k="rain"] .mb-fog { opacity: 0.35; }
#menuBg[data-k="storm"] .mb-fog { opacity: 0.22; filter: hue-rotate(190deg) saturate(0.4); }
/* 暴雨章：实时雨丝（两层不同速度） */
#menuBg .mb-fx { display: none; }
#menuBg[data-k="rain"] .mb-fx, #menuBg[data-k="storm"] .mb-fx { display: block; inset: -320px 0 0 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='320'%3E%3Cg stroke='%23d8ecff' stroke-width='1.2' stroke-linecap='round'%3E%3Cpath d='M10 214l-7.5 42' stroke-opacity='0.39'/%3E%3Cpath d='M10 -106l-7.5 42' stroke-opacity='0.39'/%3E%3Cpath d='M228 100l-7.3 41' stroke-opacity='0.40'/%3E%3Cpath d='M228 -220l-7.3 41' stroke-opacity='0.40'/%3E%3Cpath d='M151 146l-7.8 43' stroke-opacity='0.49'/%3E%3Cpath d='M151 -174l-7.8 43' stroke-opacity='0.49'/%3E%3Cpath d='M123 213l-5.2 29' stroke-opacity='0.43'/%3E%3Cpath d='M123 -107l-5.2 29' stroke-opacity='0.43'/%3E%3Cpath d='M168 318l-7.7 43' stroke-opacity='0.32'/%3E%3Cpath d='M168 -2l-7.7 43' stroke-opacity='0.32'/%3E%3Cpath d='M100 214l-5.1 28' stroke-opacity='0.37'/%3E%3Cpath d='M100 -106l-5.1 28' stroke-opacity='0.37'/%3E%3Cpath d='M44 37l-5.2 29' stroke-opacity='0.44'/%3E%3Cpath d='M44 -283l-5.2 29' stroke-opacity='0.44'/%3E%3Cpath d='M34 79l-6.3 35' stroke-opacity='0.47'/%3E%3Cpath d='M34 -241l-6.3 35' stroke-opacity='0.47'/%3E%3Cpath d='M21 144l-6.8 38' stroke-opacity='0.47'/%3E%3Cpath d='M21 -176l-6.8 38' stroke-opacity='0.47'/%3E%3C/g%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='240'%3E%3Cg stroke='%23d8ecff' stroke-width='1.2' stroke-linecap='round'%3E%3Cpath d='M58 36l-4.5 25' stroke-opacity='0.20'/%3E%3Cpath d='M58 -204l-4.5 25' stroke-opacity='0.20'/%3E%3Cpath d='M96 88l-3.0 17' stroke-opacity='0.30'/%3E%3Cpath d='M96 -152l-3.0 17' stroke-opacity='0.30'/%3E%3Cpath d='M7 104l-3.1 17' stroke-opacity='0.20'/%3E%3Cpath d='M7 -136l-3.1 17' stroke-opacity='0.20'/%3E%3Cpath d='M76 198l-3.2 18' stroke-opacity='0.23'/%3E%3Cpath d='M76 -42l-3.2 18' stroke-opacity='0.23'/%3E%3Cpath d='M113 227l-4.3 24' stroke-opacity='0.28'/%3E%3Cpath d='M113 -13l-4.3 24' stroke-opacity='0.28'/%3E%3Cpath d='M176 11l-5.0 28' stroke-opacity='0.25'/%3E%3Cpath d='M176 -229l-5.0 28' stroke-opacity='0.25'/%3E%3Cpath d='M26 28l-3.7 20' stroke-opacity='0.38'/%3E%3Cpath d='M26 -212l-3.7 20' stroke-opacity='0.38'/%3E%3Cpath d='M33 140l-4.5 25' stroke-opacity='0.27'/%3E%3Cpath d='M33 -100l-4.5 25' stroke-opacity='0.27'/%3E%3Cpath d='M99 15l-3.0 17' stroke-opacity='0.23'/%3E%3Cpath d='M99 -225l-3.0 17' stroke-opacity='0.23'/%3E%3Cpath d='M122 103l-3.7 20' stroke-opacity='0.32'/%3E%3Cpath d='M122 -137l-3.7 20' stroke-opacity='0.32'/%3E%3Cpath d='M82 72l-4.9 27' stroke-opacity='0.35'/%3E%3Cpath d='M82 -168l-4.9 27' stroke-opacity='0.35'/%3E%3Cpath d='M44 138l-4.2 23' stroke-opacity='0.39'/%3E%3Cpath d='M44 -102l-4.2 23' stroke-opacity='0.39'/%3E%3Cpath d='M131 69l-5.4 30' stroke-opacity='0.21'/%3E%3Cpath d='M131 -171l-5.4 30' stroke-opacity='0.21'/%3E%3Cpath d='M75 182l-3.3 18' stroke-opacity='0.30'/%3E%3Cpath d='M75 -58l-3.3 18' stroke-opacity='0.30'/%3E%3C/g%3E%3C/svg%3E"); background-size: 260px 320px, 180px 240px; animation: mbRain 0.9s linear infinite; opacity: 0.85; will-change: transform; }
#menuBg[data-k="storm"] .mb-fx { opacity: 0.35; animation-duration: 0.75s; }
@keyframes mbRain { to { background-position: -58px 320px, -43px 240px; } }
/* 雷暴章：偶发冷色闪光（约每 11 s 一次，双闪） */
#menuBg[data-k="storm"] .mb-scrim::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 80% 45% at 40% 8%, rgba(190, 205, 255, 0.55), rgba(190, 205, 255, 0) 70%); opacity: 0; animation: mbFlash 11s linear infinite 3s; mix-blend-mode: screen; }
@keyframes mbFlash { 0%, 100% { opacity: 0; } 1% { opacity: 0.9; } 1.8% { opacity: 0.1; } 2.6% { opacity: 0.7; } 5% { opacity: 0; } }
/* 遮罩：按界面保证文字可读 */
#menuBg .mb-scrim { background: linear-gradient(180deg, rgba(6, 8, 9, 0.35), transparent 22%, transparent 70%, rgba(6, 8, 9, 0.55)); }
#menuBg[data-s="title"] .mb-scrim { background: linear-gradient(180deg, rgba(6, 8, 9, 0.62) 0%, rgba(6, 8, 9, 0.30) 22%, rgba(6, 8, 9, 0) 40%, rgba(6, 8, 9, 0) 58%, rgba(6, 8, 9, 0.55) 78%, rgba(6, 8, 9, 0.88) 100%); }
#menuBg[data-s="camp"] .mb-scrim { background: linear-gradient(180deg, rgba(6, 8, 9, 0.62) 0%, rgba(6, 8, 9, 0.18) 16%, rgba(6, 8, 9, 0) 34%, rgba(6, 8, 9, 0.15) 55%, rgba(6, 8, 9, 0.7) 100%); }
#menuBg[data-s="map"] .mb-scrim { background: radial-gradient(ellipse 90% 70% at 50% 45%, rgba(6, 8, 9, 0.52), rgba(6, 8, 9, 0.86)); }
#menuBg[data-s="map"] .mb-fog { opacity: 0.2; }
#menuBg[data-s="result"] .mb-scrim, #menuBg[data-s="load"] .mb-scrim { background: radial-gradient(ellipse 90% 70% at 50% 50%, rgba(6, 8, 9, 0.12), rgba(6, 8, 9, 0.6)); }
body.has-bg #modal { background: rgba(6, 8, 9, 0.38); }
@media (prefers-reduced-motion: reduce) {
  #menuBg .mb-img, #menuBg .mb-fog, #menuBg .mb-fx, #menuBg .mb-scrim::before { animation: none !important; }
  #menuBg .mb-img { transition: none; }
}
body.lowq #menuBg .mb-img, body.lowq #menuBg .mb-fog { animation: none; }
/* 弹窗（带 backdrop-filter 模糊）打开时暂停菜单背景动画：背景不动 → 模糊层不必每帧重算（平板大窗口软件合成时成就页仅 1–2 fps） */
body:has(#modal.open) #menuBg .mb-img, body:has(#modal.open) #menuBg .mb-fog, body:has(#modal.open) #menuBg .mb-fx, body:has(#modal.open) #menuBg .mb-scrim::before { animation-play-state: paused; }
body.lowq #menuBg .mb-fx { animation-duration: 1.4s; }
/* 背景之上的界面：去掉原本为 3D 场景准备的不透明底 */
body.has-bg .title-wrap { background: none; }
body.has-bg .map-wrap { background: none; }
body.has-bg .sh-top { background: none; }
body.has-bg #chload { background: rgba(6, 8, 9, 0.35); }
.title-wrap .logo .t3 { color: #d8cdb6; text-shadow: 0 1px 3px #000; }
.title-wrap .logo .t2 { text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85); }
.title-wrap .foot { color: rgba(255, 240, 220, 0.55); text-shadow: 0 1px 2px #000; padding: 0 12px; }

/* ---------- 路线图：平板竖屏按 --hs 等比放大（节点 / 文字 / 列宽），与营地外壳一致 ---------- */
body.tabletp .map-wrap { zoom: var(--hs); }
body.tabletp .map-canvas { width: min(100%, 600px); }
.map-head h3 { text-shadow: 0 2px 6px #000; }
.map-head .small { color: #cfc5b0; text-shadow: 0 1px 3px #000; }
.legend { text-shadow: 0 1px 2px #000; color: #cfc5b0; }
.mnode { box-shadow: 0 0 0 1.5px rgba(20, 14, 8, 0.9), 0 3px 10px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 230, 190, 0.15); }
/* 平板竖屏标题页：菜单 / 说明 / 页脚与营地外壳一样按 --hs 放大（标题字本身按 cqmin 已随屏幕放大） */
body.tabletp .title-wrap .menu, body.tabletp .title-wrap .logo .t3, body.tabletp .title-wrap .foot { zoom: var(--hs); }
body.tabletp .title-wrap .menu { width: 320px; }

/* ---------- 第 6 轮：灵宠页（成长 → 灵宠）。纯代码浅色 UI，取 --k-* / --skin-* 变量，未定义时有回退色 ---------- */
.panel.pets .pet-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.panel.pets .pet-tabs button { position: relative; min-height: 54px; border-radius: 12px; border: 1.5px solid rgba(255, 200, 130, 0.28); background: rgba(255, 255, 255, 0.04); display: flex; align-items: center; gap: 6px; padding: 4px 6px; text-align: left; }
.panel.pets .pet-tabs button.on { border-color: var(--k-ember-hi, #ffd08a); background: linear-gradient(180deg, rgba(255, 154, 74, 0.28), rgba(208, 88, 26, 0.18)); box-shadow: 0 0 12px var(--k-ember-glow, rgba(255, 140, 60, 0.35)); }
.panel.pets .pet-tabs button.lock { opacity: 0.55; }
.panel.pets .pet-tabs .g { flex: 0 0 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-family: var(--title); font-size: 17px; color: #fff; background: radial-gradient(circle at 35% 30%, var(--c1), var(--c2)); }
.panel.pets .pet-tabs .t { font-size: 13px; font-weight: 700; line-height: 1.2; min-width: 0; } .panel.pets .pet-tabs .t small { display: block; font-weight: 400; font-size: 11px; color: var(--dim); white-space: nowrap; }
.panel.pets .pet-tabs .dot { position: absolute; right: 6px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: #ff5a3a; box-shadow: 0 0 6px #ff5a3a; }
.panel.pets .pet-main { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.panel.pets .pet-pt { position: relative; flex: 0 0 112px; height: 112px; border-radius: 16px; overflow: hidden; border: 1.5px solid var(--k-bronze-hi, rgba(255, 210, 150, 0.45)); background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--c1) 45%, #1c211f), #121614 75%); display: grid; place-items: center; }
.panel.pets .pet-pt .pg { font-family: var(--title); font-size: 52px; color: var(--c1); text-shadow: 0 0 18px var(--c1); opacity: 0.85; }
.panel.pets .pet-pt.lock .pg { color: #3a3f3c; text-shadow: none; }
.panel.pets .pet-pt.has .pg { display: none; } .panel.pets .pet-pt img { width: 100%; height: 100%; object-fit: cover; display: block; }
.panel.pets .pet-info { min-width: 0; flex: 1; }
.panel.pets .pn { font-family: var(--title); font-size: 22px; letter-spacing: 2px; color: #ffe8c0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.panel.pets .tag.role { font-family: var(--sans); font-size: 11px; letter-spacing: 0; background: rgba(120, 200, 255, 0.18); color: #b8e4ff; }
.panel.pets .tag.on { font-family: var(--sans); font-size: 11px; letter-spacing: 0; background: rgba(120, 220, 140, 0.2); color: #b8f0b0; }
.panel.pets .plv { font-size: 13px; color: var(--k-ember-hi, #ffd08a); margin: 4px 0; display: flex; align-items: center; gap: 8px; }
.panel.pets .pbar { flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; } .panel.pets .pbar i { display: block; height: 100%; background: var(--skin-xp-fill, linear-gradient(90deg, #ff9a4a, #ffd08a)); }
.panel.pets .pl { font-size: 12px; color: var(--dim); line-height: 1.5; }
.panel.pets .pet-eff { background: rgba(0, 0, 0, 0.22); border-radius: 12px; padding: 8px 10px; font-size: 13px; line-height: 1.55; }
.panel.pets .pe b { display: inline-block; min-width: 44px; margin-right: 6px; color: var(--k-ember-hi, #ffd08a); font-size: 12px; }
.panel.pets .pe.nx { color: #c8e8c0; } .panel.pets .pe.lockt { color: #ffb8a0; }
.panel.pets .perks { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; } .panel.pets .pk { font-size: 11px; padding: 1px 7px; border-radius: 8px; background: rgba(255, 255, 255, 0.06); color: var(--dim); } .panel.pets .pk.ok { background: rgba(120, 220, 140, 0.18); color: #b8f0b0; }
.panel.pets .pet-act { margin-top: 10px; }
.tag.new { background: #ff6a3a; color: #2a0e04; }
.petpill .g { color: #a8e0ff; }

/* ===== 第 7 轮 ===== */
/* 首领招式名提示条：横幅通道内（top 由 ui.atkStrip 写入），暗红底短条 */
#atkStrip { position: fixed; left: 50%; top: 30%; transform: translate(-50%, -3px); z-index: 7; pointer-events: none; opacity: 0; transition: opacity 0.18s, transform 0.18s; font-family: var(--title); font-size: calc(15px * var(--hs)); letter-spacing: 3px; color: #ffe2d0; padding: calc(2px * var(--hs)) calc(22px * var(--hs)); white-space: nowrap; background: linear-gradient(90deg, transparent, rgba(110, 16, 10, 0.78) 16%, rgba(110, 16, 10, 0.78) 84%, transparent); text-shadow: 0 0 8px rgba(255, 70, 40, 0.8), 0 2px 0 #2a0604; }
#atkStrip.show { opacity: 1; transform: translate(-50%, 0); }
#atkStrip i { font-style: normal; color: #ff6a4a; margin-right: 6px; font-size: 0.8em; vertical-align: 1px; }
/* 受击方向指示：角色周围的红色弧 + 屏幕边缘箭头 */
#hitdir { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
#hitdir i { position: absolute; display: block; opacity: 0; }
#hitdir .hd-arc { width: calc(150px * var(--hs)); height: calc(150px * var(--hs)); border-radius: 50%; background: conic-gradient(from 60deg, transparent 0deg, rgba(255, 50, 30, 0.95) 22deg, rgba(255, 50, 30, 0.95) 38deg, transparent 60deg, transparent 360deg); -webkit-mask: radial-gradient(circle, transparent 58%, #000 60%, #000 70%, transparent 72%); mask: radial-gradient(circle, transparent 58%, #000 60%, #000 70%, transparent 72%); filter: drop-shadow(0 0 6px rgba(255, 40, 20, 0.9)); }
#hitdir .hd-edge { width: 0; height: 0; border-top: calc(14px * var(--hs)) solid transparent; border-bottom: calc(14px * var(--hs)) solid transparent; border-left: calc(24px * var(--hs)) solid rgba(255, 60, 40, 0.95); filter: drop-shadow(0 0 6px rgba(255, 40, 20, 0.9)); }
#hitdir i.show { animation: hdfade 0.6s ease-out forwards; }
@keyframes hdfade { 0% { opacity: 0; } 12% { opacity: 1; } 60% { opacity: 0.85; } 100% { opacity: 0; } }
/* 英雄选择 */
.hero-sel .hcards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.hero-sel .hc { position: relative; min-height: 58px; border-radius: 14px; border: 1.5px solid rgba(255, 200, 130, 0.28); background: rgba(255, 255, 255, 0.04); display: flex; align-items: center; gap: 10px; padding: 6px 10px; color: inherit; text-align: left; }
.hero-sel .hc.on { border-color: var(--k-ember-hi, #ffd08a); background: linear-gradient(180deg, rgba(255, 154, 74, 0.26), rgba(208, 88, 26, 0.16)); box-shadow: 0 0 12px rgba(255, 160, 80, 0.25); }
.hero-sel .hc.lock { opacity: 0.6; }
.hero-sel .hc .g { flex: 0 0 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-family: var(--title); font-size: 22px; color: #fff; background: radial-gradient(circle at 35% 30%, var(--c1), var(--c2)); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.25); }
.hero-sel .hc .t { font-family: var(--title); font-size: 18px; letter-spacing: 2px; line-height: 1.15; min-width: 0; } .hero-sel .hc .t small { display: block; font-family: var(--sans); font-size: 11px; letter-spacing: 0; color: var(--dim); }
.hero-sel .hhead { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; } .hero-sel .hhead h3 { margin: 0; }
.hero-sel .tag.role { font-size: 11px; background: rgba(120, 200, 255, 0.18); color: #b8e4ff; } .hero-sel .tag.on { font-size: 11px; background: rgba(120, 220, 140, 0.2); color: #b8f0b0; }
.hero-sel .sub { margin-top: 4px; line-height: 1.5; }
.hero-sel .hkit { display: grid; gap: 6px; margin-bottom: 8px; }
.hero-sel .hk { background: rgba(0, 0, 0, 0.22); border-radius: 12px; padding: 7px 10px; font-size: 12.5px; line-height: 1.5; color: #e8dcc8; }
.hero-sel .hk b { display: block; font-size: 13px; color: var(--k-ember-hi, #ffd08a); } .hero-sel .hk.ult b { color: #9ff0d8; }
.hero-sel .hsel-act { margin: 8px 0 4px; flex-wrap: wrap; align-items: center; gap: 8px; }
.hero-sel .hlock { width: 100%; font-size: 12px; color: #ffb8a0; }
.hero-sel .wfixed { font-size: 12px; color: var(--dim); line-height: 1.5; background: rgba(255, 255, 255, 0.04); border-radius: 12px; padding: 8px 10px; }
/* 灵宠成长分支 */
.panel.pets .pet-br { margin-top: 8px; display: grid; gap: 6px; }
.panel.pets .brh { font-size: 13px; font-weight: 700; color: #ffe0b0; } .panel.pets .brh small { display: block; font-weight: 400; font-size: 11px; color: var(--dim); }
.panel.pets .brow { display: grid; grid-template-columns: 38px 1fr 1fr; gap: 6px; align-items: stretch; }
.panel.pets .brow .bl { display: grid; place-items: center; font-family: var(--title); font-size: 14px; color: var(--k-ember-hi, #ffd08a); background: rgba(0, 0, 0, 0.25); border-radius: 10px; }
.panel.pets .brow.lock .bl { color: #6a6a66; }
.panel.pets .bopt { min-height: 64px; border-radius: 12px; border: 1.5px solid rgba(255, 200, 130, 0.25); background: rgba(255, 255, 255, 0.04); color: inherit; text-align: left; padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; line-height: 1.35; }
.panel.pets .bopt b { font-size: 13.5px; color: #ffe8c0; } .panel.pets .bopt b i { font-style: normal; color: #9ff0a0; margin-left: 4px; }
.panel.pets .bopt span { color: var(--dim); flex: 1; }
.panel.pets .bopt em { font-style: normal; font-size: 11px; color: var(--k-ember-hi, #ffd08a); }
.panel.pets .bopt.on { border-color: #8fe0a0; background: rgba(120, 220, 140, 0.13); box-shadow: 0 0 10px rgba(120, 220, 140, 0.22); }
.panel.pets .bopt.on em { color: #b8f0b0; }
.panel.pets .bopt.off { opacity: 0.72; }
.panel.pets .bopt:disabled { opacity: 0.45; }
.petpill { position: relative; } .petpill .dot { position: absolute; right: 4px; top: 4px; width: 8px; height: 8px; border-radius: 50%; background: #ff5a3a; box-shadow: 0 0 6px #ff5a3a; }
/* 英雄页紧凑化（第 7 轮评审 r1）：页签卡片高度受限、内部滚动，上方留出 3D 英雄 + 灵宠的位置 */
.hero-sel { max-height: calc(54vh / var(--hs, 1)); overflow-y: auto; overscroll-behavior: contain; padding-top: 10px; }
.hero-sel .hcards { margin-bottom: 8px; } .hero-sel .hc { min-height: 50px; padding: 4px 8px; } .hero-sel .hc .g { flex-basis: 34px; height: 34px; font-size: 19px; }
.hero-sel .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 6px; }
.hero-sel .hkit { grid-template-columns: 1fr 1fr; } .hero-sel .hk { font-size: 11.5px; line-height: 1.42; padding: 6px 8px; } .hero-sel .hk b { font-size: 12.5px; }
.hero-sel .sec { margin: 8px 0 4px; }
.hero-sel .stats { grid-template-columns: repeat(6, 1fr); gap: 4px; } .hero-sel .stats div { padding: 4px 2px; font-size: 10px; } .hero-sel .stats b { font-size: 13px; }
body.tabletp .hero-sel .stats b { font-size: 14px; }
.hero-sel .stats b { white-space: nowrap; } .hero-sel .stats b i { font-style: normal; font-size: 0.72em; font-weight: 600; margin-left: 1px; }
#hitdir i.show.hold { animation: none; opacity: 1; }
/* 第 8 轮：雇佣游侠（英雄页签底部） */
.hero-sel .hire-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.hero-sel .hire { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 220, 160, 0.12); }
.hero-sel .hire.on { border-color: rgba(255, 190, 110, 0.7); background: rgba(255, 160, 80, 0.1); }
.hero-sel .hire .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-family: var(--title); font-size: 22px; color: var(--c1); background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c1) 35%, transparent), var(--c2)); }
.hero-sel .hire .nm { font-family: var(--title); font-size: 16px; color: #fff3d8; }
.hero-sel .hire .nm small { font-family: var(--sans); font-size: 11px; color: var(--dim); margin-left: 6px; }
.hero-sel .hire .ds { font-size: 11.5px; color: var(--dim); line-height: 1.45; margin-top: 2px; }
.hero-sel .hire .ha .btn { min-height: 44px; min-width: 84px; padding: 0 10px; font-size: 13px; white-space: nowrap; }
