/* ============ 绿国行动 · 全局样式 ============ */
* { margin:0; padding:0; box-sizing:border-box; user-select:none; }
html,body { width:100%; height:100%; overflow:hidden; background:#0b0d10; }
body { font-family:"Segoe UI","Microsoft YaHei",sans-serif; color:#cfd6d3; font-size:14px; }
.hidden { display:none !important; }

#cv { position:fixed; inset:0; display:block; width:100%; height:100%; }   /* CSS 显示与物理缓冲解耦（触屏 DPR 高清） */
#hud ~ #popup-search, #popup-search { cursor:default; }

/* ---------- HUD ---------- */
#hud { position:fixed; inset:0; pointer-events:none; z-index:5; }
#hud-tl { position:absolute; top:14px; left:16px; width:250px; }
.bar { position:relative; height:22px; background:#000a; border:1px solid #ffffff22; border-radius:3px; margin-bottom:6px; overflow:hidden; }
.bar > div { height:100%; width:100%; transition:width .12s; }
.bar.hp > div { background:linear-gradient(90deg,#5fae4e,#8fd06a); }
.bar.armor { height:14px; }
.bar.armor > div { background:linear-gradient(90deg,#5b7d9e,#87aecf); }
.bar span { position:absolute; inset:0; text-align:center; font-size:12px; line-height:21px; color:#fff; text-shadow:0 1px 2px #000; font-weight:600; }
.bar.armor span { line-height:13px; font-size:10px; }
#buff-line { font-size:12px; color:#e8c96a; text-shadow:0 1px 2px #000; min-height:16px; }

#hud-tr { position:absolute; top:14px; right:16px; text-align:right; }
#body-diag { margin-top:8px; display:inline-block; padding:6px 8px; background:#000a; border:1px solid #ffffff18; border-radius:5px; }
.bd-row { display:flex; justify-content:center; gap:2px; }
.bd { background:#5fae4e; }
.bd.head { width:13px; height:13px; border-radius:50%; margin:0 auto 2px; }
.bd.torso { width:16px; height:24px; border-radius:2px; }
.bd.arm { width:5px; height:22px; border-radius:2px; margin-top:2px; }
.bd.leg { width:7px; height:20px; border-radius:2px; }
#obj-text { font-size:13px; color:#d8e0d8; text-shadow:0 1px 3px #000; margin-bottom:4px; }
#obj-text b { color:#8fd06a; }
#raid-timer { font-size:12px; color:#9aa39d; text-shadow:0 1px 3px #000; }

#hud-bl { position:absolute; bottom:16px; left:16px; }
#skill-line { font-size:13px; color:#cfe0c8; text-shadow:0 1px 3px #000; margin-bottom:3px; min-height:17px; }
#weapon-line { font-size:15px; font-weight:600; color:#fff; text-shadow:0 1px 3px #000; }
#weapon-line .ammo { color:#e8c96a; }
#weapon-line .rld { color:#e07a5f; font-size:12px; }
#med-line { margin-top:4px; font-size:12px; color:#b9c4bb; text-shadow:0 1px 3px #000; }
#med-line b { color:#8fd06a; }

#mini { position:absolute; right:16px; bottom:16px; background:#0b0d10cc; border:1px solid #ffffff22; border-radius:4px; pointer-events:auto; cursor:zoom-in; }

#hint { position:absolute; bottom:22%; left:50%; transform:translateX(-50%); font-size:15px; color:#fff; text-shadow:0 1px 4px #000; background:#000a; padding:6px 14px; border-radius:4px; border:1px solid #ffffff18; }
#hint b { color:#8fd06a; }

#bossbar { position:absolute; top:52px; left:50%; transform:translateX(-50%); width:420px; text-align:center; }
#boss-name { font-size:14px; font-weight:700; color:#ffb3a7; text-shadow:0 1px 4px #000; letter-spacing:2px; }
.bbar { height:10px; background:#000a; border:1px solid #ffffff30; border-radius:3px; overflow:hidden; margin-top:3px; }
#boss-fill { height:100%; width:100%; background:linear-gradient(90deg,#a53c2e,#e06a4e); transition:width .15s; }

#toasts { position:absolute; top:120px; left:50%; transform:translateX(-50%); text-align:center; }
.toast { background:#000c; border:1px solid #ffffff22; border-left:3px solid #8fd06a; padding:6px 16px; margin-bottom:6px; border-radius:3px; font-size:13px; color:#e6ece6; animation:tfade 3.2s forwards; }
.toast.bad { border-left-color:#e06a4e; }
.toast.gold { border-left-color:#e8c96a; }
@keyframes tfade { 0%{opacity:0; transform:translateY(-6px)} 8%{opacity:1; transform:none} 80%{opacity:1} 100%{opacity:0} }

#extract-big { position:absolute; top:34%; left:50%; transform:translate(-50%,-50%); font-size:34px; font-weight:800; color:#8fd06a; text-shadow:0 2px 8px #000; letter-spacing:4px; }
#extract-big.bad { color:#e06a4e; }
#extract-big small { display:block; font-size:14px; color:#cfd6d3; letter-spacing:1px; text-align:center; font-weight:400; }

/* ---------- 面板 / 按钮 ---------- */
.screen { position:fixed; inset:0; z-index:10; display:flex; overflow:auto; padding:24px 12px; box-sizing:border-box; }
.screen > .panel { margin:auto; }
.screen.dim { background:#000a; z-index:20; }
.panel { background:#14171b; border:1px solid #2c3238; border-radius:8px; padding:22px 26px; box-shadow:0 8px 40px #000c; }
.popup { position:fixed; z-index:15; top:50%; left:50%; transform:translate(-50%,-50%); min-width:340px; }

h1.title { font-size:30px; letter-spacing:6px; color:#e8efe8; text-align:center; }
h1.title small { display:block; font-size:13px; letter-spacing:3px; color:#7f8a82; margin-top:6px; font-weight:400; }
h2 { font-size:18px; color:#e8efe8; margin-bottom:14px; letter-spacing:2px; }
h3 { font-size:14px; color:#aeb8ae; margin:10px 0 8px; }

.btn { display:inline-block; background:#232a30; border:1px solid #3a444c; color:#d8e0d8; padding:8px 18px; border-radius:4px; cursor:pointer; font-size:14px; transition:all .12s; text-align:center; }
.btn:hover { background:#2e373f; border-color:#5a6a75; }
.btn.primary { background:#3d5c34; border-color:#5f8a4e; color:#eafbe8; }
.btn.primary:hover { background:#4a703d; }
.btn.danger { background:#5c3028; border-color:#8a4a3e; color:#ffe8e4; }
.btn.danger:hover { background:#703a2f; }
.btn.small { padding:3px 10px; font-size:12px; border-radius:3px; }
.btn:disabled { opacity:.4; cursor:not-allowed; }
.btn.ghost { background:transparent; border-color:#ffffff22; }

.tag { display:inline-block; font-size:11px; padding:1px 8px; border-radius:10px; background:#232a30; border:1px solid #3a444c; color:#9fb09f; margin-right:4px; }
.tag.gold { color:#e8c96a; border-color:#8a7430; }
.tag.red { color:#e88a7a; border-color:#8a4a3e; }
.tag.green { color:#9fd88a; border-color:#4e7a3e; }

#money-chip { position:fixed; top:14px; right:16px; z-index:12; background:#14171b; border:1px solid #3a444c; padding:6px 14px; border-radius:4px; font-size:14px; color:#e8c96a; font-weight:700; }

/* ---------- 主菜单 ---------- */
#screen-menu .panel { width:420px; text-align:center; padding:40px 36px; }
#screen-menu .menu-list { margin-top:26px; display:flex; flex-direction:column; gap:10px; }
#screen-menu .menu-list .btn { font-size:16px; padding:12px; letter-spacing:4px; }
#screen-menu .save-info { margin-top:18px; font-size:12px; color:#7f8a82; }
#screen-menu .logo-badge { width:74px; height:74px; margin:0 auto 16px; border:2px solid #5f8a4e; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:34px; background:#0f1a0d; }

/* ---------- 商店 ---------- */
.shop-wrap { width:860px; max-width:94vw; }
.shop-body { display:flex; gap:18px; }
.shop-tabs { display:flex; flex-direction:column; gap:8px; width:130px; }
.shop-tabs .btn { text-align:left; }
.shop-tabs .btn.on { background:#3d5c34; border-color:#5f8a4e; color:#eafbe8; }
.shop-list { flex:1; max-height:56vh; overflow:auto; }
.srow { display:flex; align-items:center; gap:12px; background:#191d22; border:1px solid #2c3238; border-radius:5px; padding:10px 14px; margin-bottom:8px; }
.srow .ic { font-size:24px; width:34px; text-align:center; }
.srow .nm { flex:1; }
.srow .nm b { color:#e8efe8; }
.srow .nm .d { font-size:12px; color:#8a958c; margin-top:2px; }
.srow .pr { color:#e8c96a; font-weight:700; width:90px; text-align:right; }

/* ---------- 选图 / BOSS大厅 ---------- */
.cards { display:flex; gap:16px; flex-wrap:wrap; justify-content:center; }
.card { width:250px; background:#191d22; border:1px solid #2c3238; border-radius:8px; padding:18px; display:flex; flex-direction:column; }
.card.boss-card { width:262px; }
.card .art { height:86px; border-radius:5px; margin-bottom:12px; display:flex; align-items:center; justify-content:center; font-size:44px; border:1px solid #ffffff14; }
.card b.nm { font-size:16px; color:#e8efe8; }
.card .desc { font-size:12px; color:#8a958c; margin:8px 0 10px; flex:1; line-height:1.5; }
.card .stats { font-size:12px; color:#aeb8ae; margin-bottom:12px; line-height:1.7; }
.card .stats i { color:#e8c96a; font-style:normal; }

/* ---------- 仓库 ---------- */
.stash-wrap { width:900px; max-width:95vw; }
.stash-body { display:flex; gap:16px; }
.stash-col { flex:1; }
.stash-col h3 { display:flex; justify-content:space-between; align-items:center; }
.irow { display:flex; align-items:center; gap:10px; background:#191d22; border:1px solid #2c3238; border-radius:5px; padding:7px 10px; margin-bottom:6px; font-size:13px; }
.irow .ic { font-size:18px; width:26px; text-align:center; }
.irow .nm { flex:1; }
.irow .nm small { color:#8a958c; margin-left:6px; }
.irow.equip-on { border-color:#5f8a4e; background:#1b2418; }
.empty-note { color:#5a655c; font-size:12px; padding:14px; text-align:center; border:1px dashed #2c3238; border-radius:5px; }
.equip-bar { display:flex; gap:10px; margin-bottom:14px; }
.equip-slot { flex:1; background:#191d22; border:1px solid #2c3238; border-radius:5px; padding:8px 12px; font-size:13px; min-height:44px; }
.equip-slot small { display:block; color:#8a958c; margin-top:2px; }

/* ---------- 结算 ---------- */
#screen-result .panel { width:520px; max-width:94vw; }
.result-head { text-align:center; font-size:26px; font-weight:800; letter-spacing:6px; margin-bottom:4px; }
.result-head.ok { color:#8fd06a; } .result-head.no { color:#e06a4e; }
.result-sub { text-align:center; color:#8a958c; font-size:13px; margin-bottom:16px; }
.result-stats { display:flex; justify-content:center; gap:24px; margin-bottom:14px; font-size:13px; color:#aeb8ae; }
.result-stats b { color:#e8c96a; }
.loot-list { max-height:220px; overflow:auto; margin-bottom:16px; }
.result-actions { display:flex; gap:10px; justify-content:center; }

/* ---------- 弹窗 / 背包 / 暂停 ---------- */
.popup h3 { margin-top:0; }
.popup .loot-row { display:flex; align-items:center; gap:10px; padding:6px 8px; border-bottom:1px solid #23282e; font-size:14px; }
.popup .loot-row .val { margin-left:auto; color:#e8c96a; font-size:12px; }
.popup .loot-row.taken { opacity:.35; text-decoration:line-through; }
.popup .popup-actions { margin-top:12px; display:flex; gap:8px; justify-content:flex-end; }
.inv-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; min-width:560px; }
.inv-cell { background:#191d22; border:1px solid #2c3238; border-radius:5px; padding:8px; min-height:64px; font-size:12px; display:flex; flex-direction:column; gap:3px; }
.inv-cell .nm { color:#e8efe8; font-weight:600; }
.inv-cell .sub { color:#8a958c; }
.inv-cell .acts { margin-top:auto; display:flex; gap:4px; flex-wrap:wrap; }
.inv-cell.loot-c { border-color:#6a5a2e; }
.help-table { font-size:13px; line-height:2; color:#b9c4bb; }
.help-table kbd { background:#232a30; border:1px solid #3a444c; border-radius:3px; padding:1px 7px; font-family:inherit; color:#e8efe8; margin-right:6px; }

/* ---------- 干员卡片 ---------- */
.op-cards { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.op-card { background:#191d22; border:1px solid #2c3238; border-radius:6px; padding:9px 11px; cursor:pointer; transition:all .12s; }
.op-card:hover { border-color:#5a6a75; }
.op-card.on { border-color:#5f8a4e; background:#1b2418; box-shadow:0 0 0 1px #5f8a4e66; }
.op-head { font-size:13px; color:#e8efe8; margin-bottom:4px; }
.op-line { font-size:11px; color:#8a958c; line-height:1.5; }
.op-line.skill { color:#aeb8ae; margin-top:2px; }
.op-line.pass { color:#8fb08a; }

/* ---------- 仓库拖动 ---------- */
.drag-item { cursor:grab; }
.drag-item:active { cursor:grabbing; }
.drop-hover { outline:2px dashed #8fd06a; outline-offset:-2px; background:#1a221a55; border-radius:5px; }

/* ---------- 转盘式搜索卡片 ---------- */
.search-cards { display:flex; flex-wrap:wrap; gap:10px; margin:10px 0 4px; min-height:92px; }

/* F版迭代：搜索弹窗=真网格布局（与背包界面统一：空格可见，物品按占地落在格子坐标上） */
.loot-grid-wrap { position:relative; margin:10px auto 4px; }
.lg-cell { float:left; box-sizing:border-box; width:54px; height:54px; border:1px solid #262c33; background:#101317; }
.lg-cell.alt { background:#12161a; }
.lg-item { position:absolute; box-sizing:border-box; background:#191d22; border:1.5px solid #3f4b42; border-radius:5px;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px; padding:1px;
  cursor:pointer; overflow:hidden; transition:transform .12s, border-color .15s; }
.lg-item:hover { border-color:#8fd06a; transform:translateY(-1px); }
.lg-item.down { background:#14171b; cursor:wait; color:#5a655c; }
.lg-item.taken { opacity:.35; }
.lg-item.bonus { box-shadow:0 0 8px #e0a93844; }
.lg-item.spin { transform:rotateY(90deg) scale(1.06); }
.lg-item .sc-name { font-size:10px; color:#e8efe8; max-width:97%; text-align:center; line-height:1.2;
  overflow:hidden; word-break:break-all; }
.lg-item .sc-sub { font-size:9.5px; color:#8a958c; display:flex; gap:3px; align-items:center; flex-wrap:wrap; justify-content:center; }
.lg-item .sc-emoji { font-size:20px; }
.lg-item.quality-frame { border-color:var(--quality-color, #3f4b42); }
.lg-item .sc-emoji .picon { width:24px; height:24px; }
.lg-item .sc-emoji .wicon { width:40px; height:20px; }
.scard { width:86px; height:92px; background:#191d22; border:1px solid #2c3238; border-radius:6px;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
  transition:transform .22s ease, border-color .2s; cursor:default; }
.scard.down { color:#5a655c; background:#14171b; }
.scard.spin { transform:rotateY(90deg) scale(1.06); }
.scard.rev { cursor:pointer; border-color:#3f4b42; }
.scard.rev:hover { border-color:#8fd06a; transform:translateY(-2px); }
.scard.rev.taken { opacity:.35; }
.scard.rev.bonus { border-color:#e0a938; box-shadow:0 0 8px #e0a93844; }
.sc-emoji { font-size:24px; }
.sc-name { font-size:10.5px; color:#e8efe8; max-width:78px; max-height:27px; text-align:center; line-height:1.25; overflow:hidden; word-break:break-all; }
.sc-sub { font-size:10px; color:#8a958c; }

::-webkit-scrollbar { width:8px; height:8px; }
::-webkit-scrollbar-thumb { background:#2c3238; border-radius:4px; }
::-webkit-scrollbar-track { background:transparent; }

/* ============ F版新增 ============ */

/* 武器独立像素图标 */
.wicon { width:40px; height:20px; display:block; image-rendering:pixelated; }
.ic-gun { display:flex; align-items:center; justify-content:center; }
.sc-gun { display:flex; align-items:center; justify-content:center; height:24px; }
.sc-gun .wicon { width:38px; height:19px; }
.srow .ic-gun .wicon { width:44px; height:22px; }

/* F版：护甲/子弹独立像素图标 */
.picon { width:28px; height:28px; display:block; image-rendering:pixelated; }
.srow .ic-gun .picon { width:30px; height:30px; }
.sc-emoji .picon { width:26px; height:26px; }
.equip-slot .picon { width:20px; height:20px; display:inline-block; }
.equip-slot .wicon { width:34px; height:17px; display:inline-block; }

/* 悬浮属性浮窗 */
#tooltip { position:fixed; z-index:999; max-width:280px; background:#12161add; border:1px solid #5f8a4e;
  border-radius:7px; padding:10px 12px; font-size:12px; color:#c4cdc4; line-height:1.6;
  box-shadow:0 6px 24px #000c; pointer-events:none; backdrop-filter:blur(3px); }
#tooltip h4 { margin:0 0 6px; color:#e8efe8; font-size:13px; }
#tooltip .trow { border-bottom:1px dashed #2c3238; padding:2px 0; }
#tooltip .trow:last-of-type { border-bottom:none; }
#tooltip .trow b { color:#e8c96a; }
#tooltip .tdesc { margin-top:5px; color:#8a958c; font-size:11px; }
.has-tip:hover { outline:1px solid #5f8a4e66; outline-offset:-1px; cursor:help; }

/* 地图玩法规则 */
.rule-line { font-size:11.5px; color:#e0a938; background:#2a241655; border:1px dashed #8a5a2e;
  border-radius:5px; padding:5px 8px; margin:7px 0; line-height:1.5; }
.rule-line.dim { color:#5a655c; border-color:#3a444c; background:transparent; }

/* 电脑终端密码键盘 */
.pw-box { display:flex; flex-direction:column; align-items:center; gap:10px; padding:10px 0 4px; }
.pw-progress { color:#8a958c; font-size:13px; letter-spacing:4px; }
.pw-progress b { color:#8fd06a; }
.pw-target { font-size:52px; font-weight:700; color:#3fd07a; text-shadow:0 0 18px #3fd07a66;
  background:#10171a; border:1px solid #2c4438; border-radius:9px; padding:2px 34px; line-height:1.3; }
.pw-tip { color:#8a958c; font-size:12px; }
.pw-keys { display:flex; gap:8px; }
.pw-key { width:52px; height:52px; font-size:22px; font-weight:700; color:#e8efe8;
  background:#1c2126; border:1px solid #3a444c; border-radius:8px; cursor:pointer; transition:all .1s; }
.pw-key:hover { border-color:#3fd07a; color:#3fd07a; }
.pw-key:active { transform:scale(0.94); background:#23303a; }

/* ============ H1：主线任务 / 安全箱 / 解锁 ============ */
.quest-list { display:flex; flex-direction:column; gap:8px; max-height:62vh; overflow-y:auto; padding:2px; }
.qrow { display:flex; align-items:center; gap:12px; background:#191d22; border:1px solid #2c3238;
  border-radius:7px; padding:10px 12px; }
.qrow.done { opacity:.55; }
.qrow.current { border-color:#5f8a4e; background:#1a221a; }
.qrow.locked { opacity:.45; }
.q-idx { width:30px; height:30px; flex:none; display:flex; align-items:center; justify-content:center;
  border-radius:50%; background:#232a30; color:#9aa39d; font-weight:700; font-size:13px; }
.qrow.current .q-idx { background:#2e4029; color:#8fd06a; }
.q-main { flex:1; min-width:0; }
.q-main b { color:#e8efe8; font-size:13.5px; }
.q-desc { color:#8a958c; font-size:11.5px; margin:2px 0; }
.q-bar { height:6px; background:#10141a; border-radius:3px; overflow:hidden; margin:4px 0 2px; }
.q-fill { height:100%; background:linear-gradient(90deg,#4e7a3e,#8fd06a); border-radius:3px; transition:width .3s; }
.q-prog { color:#aeb8ae; font-size:10.5px; }
.q-reward { color:#e8c96a; font-size:11px; margin-top:3px; line-height:1.6; }

/* 安全箱面板 */
.secure-box { text-align:center; }
.secure-box h4 { margin:0 0 6px; color:#e8c96a; font-size:13px; }
.sec-grid { position:relative; margin:0 auto 4px; }
.sec-cell { float:left; box-sizing:border-box; width:47px; height:47px; border:1px solid #5a5230; background:#1a1a12; }
.sec-grid .lg-item { border-color:#8a7a3e; }
.sec-grid .lg-item:hover { border-color:#e0a938; }

/* 干员锁定卡片 */
.op-card.locked { opacity:.6; cursor:not-allowed; border-style:dashed; }
.op-card.locked:hover { border-color:#d05a4e; }

/* 特勤处锁定配方 */
.srow.recipe-locked { opacity:.6; }
.srow.recipe-locked .ic-gun { filter:grayscale(1); }

/* H1：1×1 小格紧凑显示修复（名称完整可见） */
.lg-item.sm { gap:0; }
.lg-item.sm .sc-emoji { font-size:14px; }
.lg-item.sm .sc-emoji .picon { width:18px; height:18px; }
.lg-item.sm .sc-emoji .wicon { width:26px; height:13px; }
.lg-item.sm .sc-name { font-size:8.5px; line-height:1.1; }
.lg-item.sm .sc-sub { font-size:8px; }

/* ============================================================
   H版迭代：硬核军事风格全局覆写（全 UI）
   切角面板 / 扫描线质感 / 全直角 / 等宽数字 / 军绿对比 / 战术条
   ============================================================ */

* { border-radius:0 !important; }

body { background:#06080a; font-family:"Microsoft YaHei", Consolas, monospace; }

/* 面板：切角轮廓 + 扫描线质感 + 军绿框线 */
.panel { position:relative;
  clip-path:polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
  background:linear-gradient(180deg,#10141a,#0b0e12);
  border:1px solid #39443a;
}
.panel::after { content:''; position:absolute; inset:0; pointer-events:none;
  background:repeating-linear-gradient(0deg, rgba(255,255,255,0.016) 0 1px, transparent 1px 3px); }
.panel > * { position:relative; z-index:1; }

/* 标题：军用字距 + 左侧战术条 */
h1, h2, h3 { letter-spacing:5px; }
h2 { border-left:4px solid #7da05a; padding-left:10px; }
h1.title { border-left:none; padding-left:0; }

/* 按钮：切角 + 字距 + 亮化反馈 */
.btn { letter-spacing:3px; font-weight:700;
  clip-path:polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px); }
.btn.primary { background:linear-gradient(180deg,#31452c,#253521); }
.btn:hover { filter:brightness(1.25) saturate(1.08); }
.btn.small { letter-spacing:1px; }

/* 标签：等宽字 */
.tag { font-family:Consolas,'Courier New',monospace; letter-spacing:1px; font-weight:700; }

/* 浮窗：直角 + 军绿框 */
#tooltip { border-color:#5f8a4e; box-shadow:0 8px 28px #000d; }

/* HUD：扫描线 + 战术切角 + 等宽计时 */
#hud::after { content:''; position:absolute; inset:0; pointer-events:none; z-index:4;
  background:repeating-linear-gradient(0deg, rgba(0,0,0,0.045) 0 1px, transparent 1px 3px); }
#hud .bar { clip-path:polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
#hud-tl, #hud-tr, #hud-bl { text-shadow:0 1px 0 #000; }
#mini { border:1px solid #3a4438; }
#raid-timer { font-family:Consolas,monospace; letter-spacing:2px; font-weight:700; }
#hint { border:1px solid #3a4438; background:#0d1114e6;
  clip-path:polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px); }
#obj-text { letter-spacing:1px; }

/* toast：左缘警示条 */
.toast { border-left:3px solid #7da05a; font-weight:600; letter-spacing:1px; }
.toast.bad { border-left-color:#d05a4e; }
.toast.gold { border-left-color:#e0a938; }

/* 列表行：左缘战术条，悬浮点亮 */
.srow, .irow { border-left:3px solid #2c3238; transition:border-color .12s, background .12s; }
.srow:hover, .irow:hover { border-left-color:#7da05a; background:#161b16; }

/* 商店分类 */
.shop-tabs .btn { letter-spacing:2px; }

/* 遮罩层更沉 */
.screen.dim { background:#040608dd; }

/* 主菜单军徽：方形切角 */
.logo-badge { border:2px solid #5f8a4e;
  clip-path:polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
.menu-list .btn { margin:0; }

/* 大标题：更硬 */
h1.title { letter-spacing:8px; }
h1.title small { letter-spacing:2px; }

/* 结算头 */
.result-head { letter-spacing:10px; }

/* 密码键盘：直角 */
.pw-key { letter-spacing:0; }
.pw-target { border-radius:0; }

/* 任务面板 */
.qrow { border-left:3px solid #2c3238; }
.qrow.current { border-left-color:#8fd06a; }
.q-fill { border-radius:0; }

/* ============================================================
   v0.11 移动端触屏适配（body.touch 由 touch.js 检测触屏设备后挂载）
   横屏优先：竖屏被 #rotate-prompt 拦截；全部规则仅在触屏生效，桌面零影响。
   ============================================================ */

/* 点按高亮透明，避免 iOS 灰闪 */
body.touch { -webkit-tap-highlight-color: transparent; }

/* ---------- 竖屏提示层 ---------- */
#rotate-prompt { position:fixed; inset:0; z-index:9999; background:#040608f5;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px; text-align:center; }
#rotate-prompt .rp-phone { font-size:64px; position:relative; animation:rp-swing 1.8s ease-in-out infinite; }
#rotate-prompt .rp-arrow { position:absolute; right:-36px; top:4px; font-size:30px; color:#8fd06a; text-shadow:0 0 12px #8fd06a88; }
#rotate-prompt .rp-title { font-size:22px; letter-spacing:6px; color:#e8efe8; }
#rotate-prompt .rp-sub { font-size:13px; color:#7f8a82; letter-spacing:2px; }
@keyframes rp-swing { 0%,100%{ transform:rotate(0deg);} 22%{ transform:rotate(-90deg);} 48%{ transform:rotate(-90deg);} 70%{ transform:rotate(0deg);} }

/* ---------- 触屏控制层（横屏布局；摇杆为动态基座：按下时以触点为中心，抬起回提示位 ---------- */
#touch-layer { position:fixed; inset:0; z-index:6; pointer-events:auto; touch-action:none; }
#touch-layer.hidden { display:none; }
.tstick { position:absolute; width:112px; height:112px; border-radius:50% !important;  /* 全局直角覆写层，必须 !important */
  background:rgba(16,20,24,0.38); border:1.5px solid rgba(255,255,255,0.24); will-change:transform; }
#ts-move { left:calc(14px + env(safe-area-inset-left)); bottom:calc(14px + env(safe-area-inset-bottom)); }
#ts-aim  { right:calc(14px + env(safe-area-inset-right)); bottom:calc(14px + env(safe-area-inset-bottom)); }
.tsk { position:absolute; left:50%; top:50%; width:50px; height:50px; border-radius:50% !important;
  background:rgba(143,208,106,0.4); border:2px solid rgba(143,208,106,0.9);
  transform:translate(-50%,-50%) scale(0); transition:transform .08s; }
#ts-aim .tsk { background:rgba(224,106,78,0.4); border-color:rgba(224,106,78,0.9); }

/* 只有此按钮生成射击意图；右侧其它区域始终只是瞄准。 */
.tfire { position:absolute; right:calc(33px + env(safe-area-inset-right)); bottom:calc(33px + env(safe-area-inset-bottom));
  width:74px; height:74px; padding:4px; border-radius:50% !important; border:2px solid #f0ad55;
  background:radial-gradient(circle at 35% 28%, #ffcf73, #bc4d32 58%, #551f20); color:#fff6dd;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:0; touch-action:none;
  box-shadow:0 0 0 3px #1b1010bb, 0 0 18px #e8694088; z-index:2; }
.tfire-icon { font-size:21px; line-height:.8; text-shadow:0 1px 1px #3c1310; }
.tfire b { font-size:13px; line-height:1.1; letter-spacing:1px; }
.tfire small { font-size:9px; line-height:1.1; opacity:.9; }
.tfire.on,.tfire.active { transform:scale(.94); filter:brightness(1.22); }
.tfire.pending { border-color:#ffe48a; animation:tfire-pending .45s ease-in-out infinite alternate; }
.tfire.disabled { filter:grayscale(.75); opacity:.7; }
@keyframes tfire-pending { to { box-shadow:0 0 0 3px #1b1010bb, 0 0 24px #ffe48aaa; } }

/* 动作按钮：3×3 靠右，右摇杆上方（横屏高度有限，不再堆到右上角） */
.tbtns { position:absolute; right:calc(14px + env(safe-area-inset-right)); bottom:132px;
  display:grid; grid-template-columns:repeat(3,54px); gap:8px; }
.tbtn { width:54px; height:46px; padding:3px 0; border:1px solid #3a444c; background:#1c2126cc;
  color:#d8e0d8; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
  border-radius:8px !important; touch-action:none; clip-path:none; cursor:pointer; }
.tbtn i { font-style:normal; font-size:18px; line-height:1; }
.tbtn b { font-size:10px; font-weight:600; letter-spacing:0; max-width:52px; overflow:hidden; white-space:nowrap; }
.tbtn.primary { background:#3d5c34cc; border-color:#5f8a4e; }
.tbtn.on { filter:brightness(1.4); }
.tbtn.cur { border-color:#8fd06a; box-shadow:0 0 6px #8fd06a66; }      /* 主/副直切：当前槽高亮 */
.tbtn.cd { opacity:0.55; }                                             /* 技能冷却态 */
.tbtn.cd i { filter:grayscale(1); }

/* 医疗胶囊：底部居中（左右留给摇杆） */
.tmeds { position:absolute; left:50%; bottom:calc(16px + env(safe-area-inset-bottom)); transform:translateX(-50%); display:flex; gap:8px; }
.tpill { width:54px; height:46px; border:1px solid #3a444c; background:#1c2126cc; color:#d8e0d8;
  border-radius:8px !important; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
  touch-action:none; clip-path:none; cursor:pointer; }
.tpill .m-emo { font-size:17px; line-height:1; }
.tpill .m-cnt { font-size:10px; color:#e8c96a; line-height:1; }
.tpill.empty { opacity:0.45; }
.tpill.on { filter:brightness(1.4); }

/* ---------- HUD 触屏横屏重排：避开左右摇杆与右侧按钮簇 ---------- */
body.touch #hud-tl { top:calc(10px + env(safe-area-inset-top)); left:calc(10px + env(safe-area-inset-left)); width:212px; }
/* 小地图移左上（HP 条下方）；右上留给 目标/计时/人形图，右中留给动作钮；触屏改用 🗺️ 按钮看大地图 */
body.touch #mini { left:calc(10px + env(safe-area-inset-left)); top:calc(78px + env(safe-area-inset-top));
  right:auto; bottom:auto; width:148px; height:114px; z-index:70; pointer-events:none; }
body.touch #hud-tr { top:calc(8px + env(safe-area-inset-top)); right:calc(10px + env(safe-area-inset-right)); }
body.touch #hud-tr #obj-text { font-size:12px; }
body.touch #hud-tr #raid-timer { font-size:11px; }
body.touch #body-diag { margin-top:4px; padding:4px 6px; transform:scale(0.82); transform-origin:right top; }
body.touch #bossbar { top:calc(56px + env(safe-area-inset-top)); width:min(380px,56vw); }
/* 武器/技能信息左对齐在左摇杆上方（医疗行由底部药丸替代，隐藏去冗余） */
body.touch #hud-bl { left:calc(10px + env(safe-area-inset-left)); right:auto; bottom:132px; text-align:left; max-width:46vw; }
body.touch #hud-bl #skill-line, body.touch #hud-bl #weapon-line { font-size:12.5px; }
body.touch #med-line { display:none; }
body.touch #hint { bottom:62%; font-size:13px; max-width:90vw; }
body.touch #toasts { top:calc(8px + env(safe-area-inset-top)); }

/* ---------- 基地界面触屏：横屏自适应 + 去密留白 + 触控目标加大 ---------- */
body.touch .screen { padding:16px 14px; }
body.touch .panel { padding:20px 22px; }
body.touch h1.title { font-size:23px; letter-spacing:6px; }
body.touch h1.title small { font-size:12px; letter-spacing:2px; }
body.touch h2 { font-size:16px; letter-spacing:3px; }
body.touch .btn { min-height:42px; padding:10px 18px; font-size:14px; }
body.touch .btn.small { min-height:34px; padding:6px 12px; font-size:12px; }
body.touch .tag { font-size:11.5px; padding:2px 9px; }

/* 主菜单：横屏一屏放下——按钮改两列，出击主按钮通栏 */
body.touch #screen-menu .panel { width:min(460px,92vw); padding:12px 22px; }
body.touch #screen-menu .logo-badge { width:44px; height:44px; font-size:22px; margin:0 auto 6px; border-width:1.5px; }
body.touch #screen-menu h1.title { font-size:17px; letter-spacing:5px; }
body.touch #screen-menu h1.title small { font-size:10px; letter-spacing:2px; margin-top:2px; }
body.touch #screen-menu .menu-list { margin-top:10px; display:grid; grid-template-columns:1fr 1fr; gap:6px; }
body.touch #screen-menu .menu-list .btn { font-size:14px; padding:8px 10px; letter-spacing:2px; min-height:34px; }
body.touch #screen-menu .menu-list #m-raid { grid-column:1 / -1; }
body.touch #screen-menu .save-info { margin-top:8px; font-size:10.5px; line-height:1.5; }

/* 商店 */
body.touch .shop-wrap, body.touch .stash-wrap,
body.touch #screen-maps .panel, body.touch #screen-boss .panel,
body.touch #screen-craft .panel, body.touch #screen-result .panel, body.touch #screen-help .panel { width:min(920px,96vw); max-width:96vw; }
body.touch .shop-body { gap:20px; }
body.touch .shop-tabs { width:104px; gap:10px; }
body.touch .shop-list { max-height:58vh; }
body.touch .srow { gap:12px; padding:11px 14px; margin-bottom:9px; }

/* 选图 / BOSS 卡片：横屏 3 列（不再用竖屏 44vw 收窄），压缩卡片高度减滚动 */
body.touch .cards { gap:12px; }
body.touch .card { width:240px; padding:14px; }
body.touch .card .art { height:60px; font-size:38px; margin-bottom:8px; }
body.touch .card b.nm { font-size:15px; }
body.touch .card .desc { font-size:11.5px; margin:6px 0 6px; }
body.touch .card .stats { font-size:11.5px; margin-bottom:8px; line-height:1.55; }
body.touch .card .rule-line { font-size:10.5px; padding:4px 6px; margin:5px 0; }
body.touch .card .btn { min-height:36px; padding:7px 10px; }

/* 仓库整备：干员/装备槽恢复横向排列，拉大间距 */
body.touch .op-cards { gap:12px; }
body.touch .op-card { padding:12px 14px; }
body.touch .equip-bar { gap:12px; }
body.touch .equip-slot { padding:10px 14px; }
body.touch .stash-body { gap:18px; }
body.touch .irow { gap:12px; padding:10px 12px; margin-bottom:8px; }
body.touch .empty-note { padding:16px; }

/* 任务 */
body.touch .quest-list { gap:10px; max-height:58vh; }
body.touch .qrow { gap:12px; padding:12px 14px; }
body.touch .q-main b { font-size:14px; }

/* 结算 / 帮助 / 特勤处 */
body.touch #screen-result .panel { width:min(560px,94vw); }
body.touch .loot-list { max-height:46vh; }
body.touch .help-table { font-size:13px; line-height:2; }

/* 背包（横屏加宽） */
body.touch #overlay-inv .panel { width:min(640px,96vw) !important; }

/* 弹窗 / 大地图 */
body.touch .popup { min-width:min(340px,94vw); max-width:96vw; max-height:calc(100vh - 16px);
  display:flex; flex-direction:column; }   /* 高度保护：头部/动作区固定，内容体内部滚动 */
body.touch .popup .popup-body { flex:1 1 auto; min-height:0; overflow-y:auto; -webkit-overflow-scrolling:touch; }
body.touch .popup > h3, body.touch .popup > .popup-actions { flex:0 0 auto; }
body.touch #bigmap-cv { max-width:96vw; max-height:80vh; }

/* 金币角标：移右下（左上/右上会与界面标题/返回钮重叠） */
body.touch #money-chip { top:auto; bottom:calc(12px + env(safe-area-inset-bottom)); right:calc(12px + env(safe-area-inset-right)); left:auto; }

/* ---------- 矮屏（高 ≤380px）触屏 HUD 防重叠：缩小小地图/按钮/摇杆区，重锚信息行 ---------- */
@media (max-height:380px){
  body.touch #mini { width:118px; height:92px; top:calc(58px + env(safe-area-inset-top)); }
  body.touch #hud-tl { width:190px; }
  body.touch .tbtns { bottom:110px; gap:6px; }
  body.touch .tbtn { width:50px; height:42px; }
  body.touch .tbtn i { font-size:15px; }
  body.touch .tbtn b { font-size:9px; }
  body.touch .tstick { width:110px; height:110px; }
  body.touch .tfire { width:66px; height:66px; right:calc(36px + env(safe-area-inset-right)); bottom:calc(36px + env(safe-area-inset-bottom)); }
  body.touch #hud-bl { bottom:110px; }
  body.touch #hint { bottom:68%; font-size:12px; }
  body.touch #bossbar { width:min(300px,50vw); }
  body.touch .tpill { width:50px; height:42px; }
  body.touch .tpill .m-emo { font-size:14px; }
}

/* ============================================================
   v0.12 移动横屏交互收口
   以 844×390 为主基线，并覆盖 667×375；仅 body.touch 生效。
   ============================================================ */

body.touch {
  overscroll-behavior:none;
  touch-action:manipulation;
}
body.touch #money-chip { display:none !important; }
body.touch .screen {
  padding:8px max(8px, env(safe-area-inset-right)) 8px max(8px, env(safe-area-inset-left));
  overflow:hidden;
}
body.touch .screen > .panel {
  max-width:calc(100vw - max(16px, env(safe-area-inset-left) + env(safe-area-inset-right)));
  max-height:calc(100dvh - 16px);
  box-sizing:border-box;
  overflow:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
body.touch .panel { padding:12px 14px; }
body.touch .btn,
body.touch .btn.small { min-height:44px; padding:8px 12px; }
body.touch .mobile-panel-head { position:sticky; top:-12px; z-index:4; background:#0e1217; padding:8px 0; }

/* 主菜单：身份/金币归入头部，主操作一列 + 次操作两列。 */
body.touch #screen-menu .panel {
  width:min(620px, calc(100vw - 16px));
  padding:10px 14px 8px;
  overflow:hidden;
}
body.touch #screen-menu .logo-badge {
  position:absolute; left:14px; top:10px; width:36px; height:36px;
  margin:0; font-size:18px;
}
body.touch #screen-menu .mobile-money {
  position:absolute; right:14px; top:12px; color:#e8c96a; font-weight:700;
  min-height:32px; display:flex; align-items:center; padding:0 8px;
  border:1px solid #665b32; background:#17170f;
}
body.touch #screen-menu h1.title {
  min-height:38px; margin:0 104px 4px 48px; display:flex; flex-direction:column;
  justify-content:center; font-size:17px; line-height:1.05;
}
body.touch #screen-menu .menu-list {
  margin-top:4px; grid-template-columns:1fr 1fr; gap:6px;
}
body.touch #screen-menu .menu-list .btn {
  min-height:44px; padding:7px 10px; font-size:13px; line-height:1.1;
}
body.touch #screen-menu .save-info { margin-top:4px; font-size:10px; line-height:1.25; }
body.touch #screen-menu .save-info:last-child { margin-top:3px; }
body.touch #screen-menu #m-reset { min-height:44px; padding:6px 12px; }

/* 战斗动作：四个战斗动作靠近右拇指，系统动作独立置于右上。 */
body.touch .tbtns {
  right:calc(10px + env(safe-area-inset-right));
  bottom:calc(126px + env(safe-area-inset-bottom));
  display:flex; align-items:flex-end; justify-content:flex-end; gap:6px;
}
body.touch .tsysbar {
  position:absolute; top:calc(8px + env(safe-area-inset-top));
  right:calc(8px + env(safe-area-inset-right)); display:flex; gap:6px;
}
body.touch .tbtn { width:48px; height:48px; min-width:48px; padding:3px; }
body.touch .tbtn i { font-size:17px; }
body.touch .tbtn b { max-width:100%; font-size:9px; text-overflow:ellipsis; }
body.touch .tbtns [data-a="interact"] { width:88px; }
body.touch .tbtns [data-a="interact"] b { font-size:9px; }
body.touch .tbtn.context-off { display:none; }
body.touch .tfire { right:calc(29px + env(safe-area-inset-right)); bottom:calc(29px + env(safe-area-inset-bottom)); }

/* 单一快捷医疗；长按菜单向上展开。 */
body.touch .tmed-quick,
body.touch .tmed-item {
  width:48px; height:48px; border:1px solid #4b5b4c; color:#e8efe8;
  background:#19211bcc; display:flex; flex-direction:column; align-items:center;
  justify-content:center; gap:1px; touch-action:none;
}
body.touch .tmed-quick {
  position:absolute; left:42%; bottom:calc(14px + env(safe-area-inset-bottom));
  transform:translateX(-50%);
}
body.touch .tmed-quick .m-emo,
body.touch .tmed-item .m-emo { font-size:18px; line-height:1; }
body.touch .tmed-quick .m-cnt,
body.touch .tmed-item .m-cnt { color:#e8c96a; font-size:10px; line-height:1; }
body.touch .tmed-quick.empty { opacity:.45; }
body.touch .tmed-menu {
  position:absolute; left:42%; bottom:calc(68px + env(safe-area-inset-bottom));
  transform:translateX(-50%); display:flex; gap:5px; padding:5px;
  background:#090c0fe8; border:1px solid #3a4438;
}
body.touch .tmed-menu.hidden,
body.touch .tmed-item.hidden { display:none; }

/* HUD：为系统动作和双摇杆让路，小地图本身就是大地图入口。 */
body.touch #hud-tl { width:188px; top:calc(8px + env(safe-area-inset-top)); }
body.touch #mini {
  width:126px; height:96px; top:calc(64px + env(safe-area-inset-top));
  pointer-events:auto; cursor:pointer; opacity:.9;
}
body.touch #hud-tr {
  top:calc(8px + env(safe-area-inset-top));
  right:calc(122px + env(safe-area-inset-right)); max-width:230px;
}
body.touch #body-diag { transform:scale(.7); transform-origin:right top; margin-top:2px; }
body.touch #hud-bl { bottom:calc(126px + env(safe-area-inset-bottom)); max-width:40vw; }
body.touch #hint { bottom:56%; padding:5px 10px; font-size:12px; }
body.touch #toasts { top:calc(50px + env(safe-area-inset-top)); max-width:55vw; }
body.touch .toast { padding:5px 10px; margin-bottom:4px; font-size:11px; }
body.touch #bossbar { top:calc(48px + env(safe-area-inset-top)); width:min(320px,48vw); }

/* 搜索：左格子、右详情、底部固定动作。 */
body.touch #popup-search.mobile-search {
  width:min(820px, calc(100vw - 16px)); max-width:calc(100vw - 16px);
  max-height:calc(100dvh - 16px); padding:10px 12px; overflow:hidden;
}
body.touch #popup-search.mobile-search > h3 { margin:0 0 6px; letter-spacing:2px; }
body.touch #popup-search .mobile-loot-layout {
  display:grid; grid-template-columns:minmax(220px, 1.25fr) minmax(180px, .75fr);
  gap:10px; min-height:0; overflow:hidden;
}
body.touch #popup-search .mobile-loot-layout > .loot-grid-wrap {
  margin:0; max-width:100%; max-height:210px; overflow:auto;
}
body.touch #popup-search .loot-detail {
  min-width:0; padding:9px; border-left:2px solid #5f8a4e; background:#11161a;
  overflow:auto;
}
body.touch #popup-search .loot-detail-item { display:flex; flex-direction:column; gap:5px; height:100%; }
body.touch #popup-search .loot-detail-item > b { display:flex; align-items:center; gap:5px; }
body.touch #popup-search .loot-detail-item .ic { font-size:25px; }
body.touch #popup-search .loot-detail-item small { color:#9aa39d; line-height:1.35; }
body.touch #popup-search .loot-detail-item .quality-text { display:block; font-weight:700; }
body.touch #popup-search .loot-detail-item .btn { margin-top:auto; width:100%; }
body.touch #popup-search.mobile-search .lg-item .sc-name { display:none; }
body.touch #popup-search.mobile-search .lg-item.quality-frame { border-color:var(--quality-color); background:linear-gradient(160deg,color-mix(in srgb, var(--quality-color) 14%, transparent),#191d22 60%); }
body.touch #popup-search.mobile-search .lg-item.selected { box-shadow:inset 0 0 0 2px #8fd06a88, inset 0 0 12px #8fd06a22; }
body.touch #popup-search .popup-actions { margin-top:7px; }

/* 密码：信息、目标、按键、关闭在一屏内。 */
body.touch #popup-search.mobile-password { width:min(520px, calc(100vw - 16px)); padding:9px 12px; }
body.touch #popup-search.mobile-password > h3 { margin:0 0 3px; }
body.touch #popup-search.mobile-password .pw-box { flex-direction:row; flex-wrap:wrap; justify-content:center; gap:6px 10px; padding:2px 0; }
body.touch #popup-search.mobile-password .pw-progress { order:1; }
body.touch #popup-search.mobile-password .pw-target { order:2; font-size:38px; padding:0 24px; }
body.touch #popup-search.mobile-password .pw-tip { order:3; flex-basis:100%; text-align:center; }
body.touch #popup-search.mobile-password .pw-keys { order:4; }

/* 行动背包：格子固定在左，详情与安全箱在右栏内部滚动。 */
body.touch #overlay-inv .mobile-inv-panel {
  width:min(760px, calc(100vw - 16px)) !important;
  max-height:calc(100dvh - 16px); padding:10px 12px; overflow:hidden;
}
body.touch .mobile-inv-panel .mobile-panel-head { top:-10px; margin-bottom:6px !important; }
body.touch .mobile-inv-panel .mobile-panel-head h2 { font-size:14px; letter-spacing:1px; }
body.touch .mobile-inv-layout {
  display:grid; grid-template-columns:minmax(196px, .8fr) minmax(250px, 1.2fr);
  gap:12px; align-items:start; min-height:0;
}
body.touch .mobile-inv-grid { overflow:auto; display:flex; justify-content:center; }
body.touch .mobile-inv-detail {
  min-width:0; max-height:275px; padding-left:10px; border-left:2px solid #5f8a4e;
  overflow:auto;
}
body.touch .mobile-inv-detail > .irow { display:grid; grid-template-columns:28px 1fr; gap:6px; padding:7px; }
body.touch .mobile-inv-detail > .irow > .btn { min-width:0; width:100%; grid-column:1 / -1; }
body.touch .mobile-inv-detail .nm small { display:block; margin:3px 0 0; line-height:1.3; }
body.touch .mobile-inv-detail .nm .quality-text { font-weight:700; }
body.touch .mobile-inv-detail .secure-box { margin-top:8px; }
body.touch .mobile-inv-detail .sec-grid .quality-frame { border-color:var(--quality-color); }
body.touch .mobile-inv-detail .sec-grid .sc-name { display:none; }

/* 基地页：固定头部、内容独立滚动，避免整页缩放成 PC 缩略图。 */
body.touch .shop-wrap,
body.touch .stash-wrap,
body.touch #screen-maps .panel,
body.touch #screen-boss .panel,
body.touch #screen-craft .panel,
body.touch #screen-result .panel,
body.touch #screen-help .panel,
body.touch #screen-quest .panel {
  max-height:calc(100dvh - 16px); box-sizing:border-box;
}
body.touch .shop-wrap { display:flex; flex-direction:column; overflow:hidden !important; }
body.touch .shop-wrap .shop-body { min-height:0; flex:1; }
body.touch .shop-wrap .shop-tabs { flex:none; width:104px; }
body.touch .shop-wrap .shop-list { max-height:none; min-height:0; overflow:auto; }
body.touch .stash-wrap { overflow:auto; }
/* 移动端仓库：装备槽 / 物品 / 详情三栏；每个物品栏独立滚动。 */
body.touch .mobile-stash-layout {
  display:grid; grid-template-columns:minmax(112px, .62fr) minmax(196px, 1fr) minmax(220px, 1.08fr);
  gap:10px; align-items:stretch; height:260px;
}
body.touch .mobile-stash-equip,
body.touch .mobile-stash-items,
body.touch .mobile-stash-detail {
  min-width:0; min-height:0; border:1px solid #2c3238; border-radius:6px; background:#11161a;
}
body.touch .mobile-stash-equip { padding:7px; overflow:auto; }
body.touch .mobile-stash-equip h3,
body.touch .mobile-stash-items h3 { margin:0 0 5px; font-size:12px; }
body.touch .mobile-stash-equip .equip-bar { display:flex; flex-direction:column; gap:6px; margin:0; }
body.touch .mobile-stash-equip .equip-slot { position:relative; min-height:44px; padding:7px 7px 7px 30px; font-size:11px; }
body.touch .mobile-stash-items { display:grid; grid-template-rows:minmax(0, 1fr) minmax(0, 1fr); gap:7px; padding:7px; }
body.touch .mobile-stash-items .stash-col { display:flex; flex-direction:column; min-height:0; }
body.touch .mobile-stash-items .stash-list { min-height:0; flex:1; overflow:auto; overscroll-behavior:contain; padding-right:2px; }
body.touch .mobile-stash-items .irow { position:relative; min-height:44px; margin-bottom:5px; padding:6px 6px 6px 31px; gap:5px; font-size:11px; cursor:pointer; }
body.touch .mobile-stash-items .irow .ic { width:22px; font-size:15px; }
body.touch .mobile-stash-items .irow .nm small { display:block; margin:2px 0 0; line-height:1.25; }
body.touch .irow.selected { border-color:#8fd06a; box-shadow:inset 0 0 0 1px #8fd06a66; }
.stash-drag-handle { cursor:grab; user-select:none; color:#9fb09f; font-size:18px; line-height:1; border:0; background:transparent; padding:0; }
.irow > .stash-drag-handle { margin-left:-4px; }
body.touch .stash-drag-handle { position:absolute; left:4px; top:50%; transform:translateY(-50%); display:grid; place-items:center; width:26px; min-height:44px; touch-action:none; }
body.touch .mobile-stash-detail { padding:8px; overflow:auto; }
body.touch .mobile-stash-detail .irow { display:grid; grid-template-columns:28px 1fr; gap:6px; padding:7px; }
body.touch .mobile-stash-detail .irow .nm small { display:block; margin:3px 0 0; }
body.touch .stash-detail-actions { display:grid; grid-template-columns:1fr 1fr; gap:7px; margin-top:8px; }
body.touch .stash-detail-actions .btn { min-height:44px; padding:7px 8px; white-space:normal; line-height:1.15; }
@media (max-width:700px){
  body.touch .mobile-stash-layout { grid-template-columns:minmax(100px, .58fr) minmax(178px, 1fr) minmax(200px, 1.04fr); gap:7px; }
  body.touch .mobile-stash-detail { padding:6px; }
  body.touch .stash-detail-actions { gap:5px; }
  body.touch .stash-detail-actions .btn { font-size:11px; }
}
body.touch .op-card { padding:8px 10px; }
body.touch .op-line { line-height:1.3; }
body.touch .equip-slot { padding:7px 9px; }
body.touch .srow { padding:8px 10px; margin-bottom:6px; }
body.touch .cards { flex-wrap:nowrap; justify-content:flex-start; overflow-x:auto; padding-bottom:5px; }
body.touch .card { flex:0 0 220px; padding:10px; }
body.touch #screen-help .panel { overflow:auto; }
body.touch #screen-help h3 { margin:8px 0 5px; }
body.touch #screen-help .help-table { font-size:11px; line-height:1.55 !important; }

/* 选图卡在横屏首屏内保留完整的出击动作；长说明在卡内限行。 */
body.touch #screen-maps .card { padding:8px 10px; }
body.touch #screen-maps .card .art { height:40px; margin-bottom:4px; font-size:28px; }
body.touch #screen-maps .card .desc {
  margin:2px 0; line-height:1.35; min-height:32px; max-height:32px; overflow:hidden;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
}
body.touch #screen-maps .card .rule-line {
  margin:2px 0; padding:3px 5px; line-height:1.25; min-height:34px; max-height:34px; overflow:hidden;
}
body.touch #screen-maps .card .stats { margin:2px 0 4px; line-height:1.25; }
body.touch #screen-maps .card .btn { min-height:44px; padding:7px 10px; }
body.touch #extract-big { top:31%; font-size:23px; letter-spacing:2px; }
body.touch #extract-big small { font-size:11px; }
body.touch #overlay-bigmap .mobile-map-panel { overflow:hidden; }

@media (max-height:380px){
  body.touch #screen-menu .panel { padding-top:7px; padding-bottom:6px; }
  body.touch #screen-menu .logo-badge { top:7px; }
  body.touch #screen-menu .mobile-money { top:8px; }
  body.touch #screen-menu h1.title { min-height:36px; margin-bottom:2px; }
  body.touch #screen-menu .menu-list { margin-top:2px; gap:4px 6px; }
  body.touch #screen-menu .save-info { margin-top:2px; }
  body.touch .tbtns { bottom:calc(122px + env(safe-area-inset-bottom)); }
  body.touch .tbtn { width:46px; min-width:46px; height:46px; }
  body.touch .tbtns [data-a="interact"] { width:84px; }
  body.touch #mini { width:112px; height:84px; top:calc(60px + env(safe-area-inset-top)); }
  body.touch #hud-bl { bottom:calc(120px + env(safe-area-inset-bottom)); }
  body.touch #popup-search .mobile-loot-layout > .loot-grid-wrap { max-height:190px; }
  body.touch .mobile-inv-detail { max-height:258px; }
}
