/* htmlBWZ.css —— html保卫战 样式表（由 index.html 外链引入） */

  * { box-sizing: border-box; }
  html, body { height: 100%; }
  body {
    margin: 0; padding: 0;
    background: #12141a; color: #e6e8ee;
    font-family: "WenQuanYi Micro Hei", "Microsoft YaHei", system-ui, sans-serif;
    -webkit-tap-highlight-color: transparent;
    overflow: hidden;
  }
  button { font-family: inherit; }

  .btn {
    padding: 10px 6px; font-size: 13px; color: #e6e8ee;
    background: #1b1f28; border: 1px solid #333a47; border-radius: 8px; cursor: pointer;
  }
  .btn:active { background: #262c38; }
  .btn.sel { background: #2c3a2a; border-color: #6fbf5f; color: #b6f0a4; }
  .btn:disabled { opacity: .45; cursor: not-allowed; }
  .btn .c { display: block; font-size: 11px; color: #d8b45a; margin-top: 2px; }
  .btn.sel .c { color: #ffe08a; }
  .btn .tag { display: block; font-style: normal; font-family: monospace; font-size: 12px; color: #7fd4ff; }
  .btn.sel .tag { color: #a9e6ff; }
  .btn .nm { display: block; font-size: 13px; margin-top: 1px; }
  .pnm { color: #7fe8ff; font-weight: 700; }

  .screen { display: none; position: absolute; inset: 0; }
  .screen.on { display: block; }

  /* ================= 选关屏 ================= */
  #scTitle { display: none; position: absolute; inset: 0; flex-direction: column;
             align-items: center; justify-content: flex-start;
             background: #0a1510 center/cover no-repeat; overflow: hidden; }
  #scTitle.on { display: flex; }
  #scTitle .tbg { position: absolute; inset: 0; width: 100%; height: 100%;
                  object-fit: cover; opacity: .92; }
  #scTitle .tveil { position: absolute; inset: 0;
    background: radial-gradient(ellipse at 50% 26%, rgba(6,14,9,.30) 0%, rgba(6,14,9,.72) 46%, rgba(4,10,7,.93) 100%); }
  #scTitle .tin { position: relative; z-index: 2; width: 100%;
                  display: flex; flex-direction: column; align-items: center;
                  padding: 16vh 18px 0; }
  #scTitle .tmk { font-size: 15px; color: #ffd479; letter-spacing: 2px;
                  text-shadow: 0 0 12px rgba(255,190,70,.75); margin-bottom: 6px; }
  #scTitle .ttl { font-size: clamp(30px, 11vw, 46px); font-weight: 900; color: #f2fff5;
                  letter-spacing: 3px; line-height: 1.25; text-align: center;
                  text-shadow: 0 0 18px rgba(90,230,140,.55), 0 3px 0 #1b3a28, 0 0 42px rgba(0,0,0,.9); }
  #scTitle .tsub { margin-top: 10px; font-size: 12px; color: #9fd8b4; letter-spacing: 1px;
                   text-shadow: 0 1px 4px rgba(0,0,0,.9); }
  #scTitle .tnamerow { margin-top: 26px; display: flex; align-items: center;
                      justify-content: center; gap: 8px; width: min(320px, 84%); }
  #scTitle .tnlabel { font-size: 13px; font-weight: 700; color: #9fd8b4; letter-spacing: 1px;
                      white-space: nowrap; text-shadow: 0 1px 4px rgba(0,0,0,.9); }
  #scTitle .tname { margin-top: 0; flex: 1 1 auto; min-width: 0; width: auto; padding: 10px 12px;
                    font-size: 14px; text-align: center; color: #eaf6ee;
                    background: rgba(8,20,14,.82); border: 1px solid rgba(120,200,150,.42);
                    border-radius: 10px; outline: none; letter-spacing: 1px; }
  #scTitle .tname:focus { border-color: #7ff0a8; box-shadow: 0 0 12px rgba(90,230,140,.35); }
  #scTitle .tname::placeholder { color: #6f8a79; letter-spacing: 0; }
  #scTitle .tbtn { margin-top: 16px; width: min(300px, 78%); padding: 15px 10px;
                   font-size: 17px; font-weight: 800; letter-spacing: 2px;
                   color: #062012; background: linear-gradient(180deg,#7ff0a8,#38b96e);
                   border: none; border-radius: 12px; cursor: pointer;
                   box-shadow: 0 5px 0 #1e6d41, 0 10px 26px rgba(0,0,0,.6); }
  #scTitle .tbtn:active { transform: translateY(3px); box-shadow: 0 2px 0 #1e6d41; }
  #scTitle .tmini { margin-top: 14px; display: flex; gap: 8px; }
  #scTitle .tmini .btn { padding: 9px 14px; font-size: 12px; background: rgba(14,26,20,.78);
                         border-color: rgba(120,200,150,.35); color: #bfe8cf; }
  #scLevel { display: none; flex-direction: column; }
  #scLevel.on { display: flex; }
  .lvhead {
    flex: 0 0 auto; padding: 12px 14px 8px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid #232833;
  }
  .lvhead .t { font-size: 17px; font-weight: 600; letter-spacing: 1px; }
  .lvhead .st { font-size: 13px; color: #ffd479; }
  /* ===== 猎人模式 ===== */
  .lvhead .hhd { flex: 1 1 auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .lvhead .hhd .btn { padding: 5px 10px; font-size: 12px; }
  .huntwrap { padding: 14px 12px 24px; }
  .huntbtn { width: 100%; padding: 22px 10px; font-size: 16px; font-weight: 800; letter-spacing: 1px;
             color: #1a0f22; background: linear-gradient(180deg,#c9a8ff,#8a5cc9);
             border: none; border-radius: 14px; cursor: pointer; line-height: 1.5;
             box-shadow: 0 5px 0 #4d2d75, 0 10px 22px rgba(0,0,0,.5); }
  .huntbtn:active { transform: translateY(3px); box-shadow: 0 2px 0 #4d2d75; }
  .huntbtn:disabled { opacity: .45; box-shadow: none; }
  .hcard { margin-top: 14px; padding: 12px; border-radius: 10px;
           background: rgba(255,255,255,.05); border: 1px solid #3a4152;
           font-size: 12px; line-height: 1.9; color: #c7ccd6; }
  .hcard .ttl { font-size: 14px; font-weight: 700; color: #c9a8ff; margin-bottom: 4px; }
  .hcard b { color: #e6e8ee; }
  .hcard .v { color: #ffd479; }
  .hcard .go { margin-top: 12px; width: 100%; box-sizing: border-box; }
  .hcard .hgo { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
  .hcard .hgo .go { flex: 1 1 auto; margin-top: 0; }
  .hcard .hgo .drop { flex: 0 0 auto; margin-top: 0; padding: 6px 12px; color: #ff8f8f;
                      border-color: rgba(255,143,143,.4); }
  .hstam { display: inline-flex; align-items: center; gap: 2px; font-size: 15px; white-space: nowrap; }
  .hstam i { font-style: normal; }
  .hstam i.off { opacity: .22; filter: grayscale(1); }
  .hstam .plus { margin-left: 4px; padding: 0 8px; font-size: 14px; line-height: 22px;
                 border-radius: 6px; background: rgba(200,149,31,.16);
                 border: 1px solid rgba(200,149,31,.4); color: #ffd479; cursor: pointer; }
  .hstam .plus.off { opacity: .35; }
  .hfund { font-size: 13px; color: #ffd479; white-space: nowrap; }
  /* 背包条目：单行紧凑排布，一屏能多列好几条（图标 40→26、内边距与字号同步收） */
  .bagitem { display: flex; align-items: center; gap: 6px; padding: 3px 6px; margin-bottom: 3px;
             border-radius: 6px; background: rgba(255,255,255,.04); border: 1px solid #333a48;
             font-size: 11px; color: #dfe3ea; min-height: 28px; }
  .bagitem .bn { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; gap: 5px;
                 overflow: hidden; white-space: nowrap; }
  .bagitem .bn b { font-size: 12px; color: #fff; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
  .bagitem .bn span { font-size: 10px; color: #8b94a3; flex: 0 0 auto; }
  .bagitem .bn .bsc { font-size: 11px; color: #c792ea; font-weight: 700; flex: 0 0 auto;
                      background: rgba(199,146,234,.12); border-radius: 3px; padding: 0 3px; }
  .bagitem .bn .bg { color: #ffd479; font-weight: 700; margin-left: auto; padding-left: 4px; }
  .bagitem .btn { flex: 0 0 auto; padding: 2px 6px; font-size: 10px; }
  .bagitem .bic { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 4px;
    background: #20262f; overflow: hidden; }
  .bagitem .bic canvas { display: block; width: 26px; height: 26px; image-rendering: pixelated; }
  .bagitem .btn.lock { padding: 2px 5px; font-size: 12px; }
  .bagitem .btn.lock.on { background: #2f6b3c; }
  .bagitem.lockon { border-color: #2f6b3c; background: rgba(47,107,60,.14); }
  .lvscroll { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; position: relative; }
  .lvmapwrap { position: relative; width: 100%; }
  .lvmapwrap canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; }
  button.lvslot {
    position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px;
    padding: 0; font-size: 16px; font-weight: bold;
    color: #ffd479; background: rgba(18,26,22,.78);
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
  }
  button.lvslot::before {
    content: ""; position: absolute; inset: 0;
    border: 2px dashed rgba(214,160,60,.9); pointer-events: none;
  }
  button.lvslot:active { background: rgba(60,80,60,.9); color: #fff0b8; }
  .lvslot.done { border-color: #c8951f; color: #ffdf9a; box-shadow: 0 0 8px rgba(200,149,31,.35); }
  .lvtoast {
    position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%) translateY(8px);
    max-width: 86%; padding: 9px 14px; border-radius: 8px;
    background: rgba(28,32,40,.96); border: 1px solid #3a4250; color: #dfe3ea;
    font-size: 12px; text-align: center; z-index: 500;
    opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s;
  }
  .lvtoast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
  /* 精英关：紫色 */
  button.lvslot.elite::before { border-color: rgba(196,107,255,.9); }
  button.lvslot.elite { background: rgba(40,20,58,.82); color: #e2b6ff; }
  .lvslot.elite.done { border-color: #c46bff; color: #f0d0ff;
    box-shadow: 0 0 9px rgba(196,107,255,.45); }
  .lvslot.lock {
    border-color: #3a4049; background: rgba(20,23,29,.92); color: #6b7383;
    box-shadow: none; cursor: not-allowed; font-size: 13px;
  }
  .lvslot.lock:active { background: rgba(20,23,29,.92); color: #6b7383; }
  .lvstars {
    position: absolute; transform: translate(-50%, 0);
    font-size: 11px; color: #ffd479; white-space: nowrap;
    pointer-events: none; text-shadow: 0 1px 2px #000;
  }
  .lvstars .off { color: #4a5060; }
  .lvstars .cup { color: #ffe08a; }
  .lvstars .cup.dim { opacity: .5; font-size: 9px; }
  .chbar {
    flex: 0 0 auto; padding: 6px 10px 0;
    background: #171a22; border-top: 1px solid #2a2e39;
  }
  .chbtn {
    width: 100%; font-size: 13px; color: #ffd479;
    background: rgba(200,149,31,.12); border: 1px solid rgba(200,149,31,.35);
  }
  .chbtn:active { background: rgba(200,149,31,.26); }
  .chitem {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 12px; margin-bottom: 8px; border-radius: 8px;
    background: rgba(255,255,255,.04); border: 1px solid #333a48;
    cursor: pointer; font-size: 13px; color: #dfe3ea;
  }
  .chitem:active { background: rgba(255,255,255,.09); }
  .chitem.sel { border-color: #c8951f; background: rgba(200,149,31,.14); }
  .chitem .no {
    flex: 0 0 42px; height: 42px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; font-weight: bold; color: #ffd479;
    background: rgba(18,26,22,.7); border: 1px dashed rgba(214,160,60,.85);
  }
  .chitem.gpu .no { color: #7fd4ff; border-color: rgba(127,212,255,.85);
    background: rgba(13,27,42,.8); }
  .chitem .tx { flex: 1; line-height: 1.55; }
  .chitem .tx b { display: block; font-size: 13px; color: #fff; }
  .chitem .tx span { font-size: 11px; color: #8b94a3; }
  .chitem .tag2 { font-size: 10px; color: #ffd479; border: 1px solid rgba(200,149,31,.5);
    border-radius: 4px; padding: 1px 5px; }

  .tabbar {
    flex: 0 0 auto; display: flex; gap: 6px; padding: 8px 10px;
    background: #171a22; border-top: 1px solid #2a2e39;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }
  .tabbar .btn { flex: 1; }

  /* ================= 游戏屏 ================= */
  #scGame { display: none; flex-direction: column; overflow-y: auto; }
  #scGame.on { display: flex; }
  .gamebody { flex: 1 1 auto; overflow-y: auto; padding: 12px 12px 24px; }
  .topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 10px; }
  h1.title { margin: 0; font-size: 18px; letter-spacing: 1px; color: #9aa3b2; font-weight: 600; }
  #bHome { flex: 0 0 auto; padding: 6px 12px; font-size: 12px; }
  .dexgrid .dexitem.sel { border-color:#4be08a; }
  .storybox { background:linear-gradient(180deg,#141b26,#0e141c); border:1px solid #2c3442;
    border-left:3px solid #7fd4ff; border-radius:8px; padding:14px 14px; color:#dbe6f2;
    font-size:14px; line-height:1.9; letter-spacing:.3px; }
  .storybox b { color:#7fd4ff; }
  #codeBox { width:100%; height:150px; box-sizing:border-box; background:#10161f;
    color:#b9e8ff; border:1px solid #2c3442; border-radius:6px; padding:8px;
    font-family:monospace; font-size:10px; line-height:1.5; resize:vertical; }
  .tw { display:flex; gap:6px; margin-bottom:8px; }
  .tw .tt { flex:1; padding:6px 0; font-size:12px; background:#1b2029;
            color:#8b94a3; border:1px solid #2c3442; border-radius:6px; }
  .tw .tt.on { background:#26303f; color:#dff6ff; border-color:#7fd4ff; }
  .hud .hstat { color:#4be08a; }
  .hud .hstat.hot { color:#ff8a5c; }
  .hud .hstat.cold { color:#8ec8ff; }
  .hud { display: flex; gap: 8px; margin-bottom: 8px; font-size: 11px; }
  /* 固定高度：手机上文字紧凑，内容变长（如「敌人 12（待出 30）」「🌡 45°C · 过热」）会换行、
     把下面的画布顶得上下跳动。这里锁死 42px 并禁用换行，超出以省略号收尾 */
  .hud div { flex: 1; height: 46px; line-height: 1.3; box-sizing: border-box; background: #171a22; border: 1px solid #2a2e39;
             border-radius: 6px; padding: 4px 5px; text-align: center; overflow: hidden;
             display: flex; flex-direction: column; align-items: center; justify-content: center; }
  .hud div > span, .hud div.hstat { display: block; max-width: 100%; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hud b { display: block; max-width: 100%; font-size: 14px; line-height: 1.3; color: #e6e8ee; margin-top: 2px;
           white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .stage { position: relative; width: 100%; aspect-ratio: 16/9; border: 1px solid #2a2e39; border-radius: 6px; overflow: hidden; background: #12332a; }
  .stage canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; cursor: pointer; }
  /* 2-13 强制教学：右下角「跳过」键（只在教学期间显示） */
  .tutskip { position: absolute; right: 8px; bottom: 8px; z-index: 6; padding: 6px 10px;
             font-size: 12px; background: #22262f; border: 1px solid #ffd479; color: #ffd479;
             box-shadow: 0 2px 8px rgba(0,0,0,.5); }
  /* ================= 电脑端适配（窗口 ≥ 900px） =================
     画布按 16:9 等比例放大（不拉伸、不裁切），具体倍率由脚本按窗口大小算；
     这里只负责居中、留边、把按钮和字号放大到鼠标操作的舒适尺寸。 */
  @media (min-width: 900px){
    body { background: #0b0d11; }
    .screen { left: 0; right: 0; width: min(100%, 1180px); margin-left: auto; margin-right: auto;
              border-left: 1px solid #22262f; border-right: 1px solid #22262f; background: #12141a; }
    .gamebody { padding: 16px 20px 28px; }
    .topbar { margin-bottom: 12px; }
    .topbar .title { font-size: 20px; }
    .hud { font-size: 12px; gap: 10px; }
    .hud div { height: 56px; padding: 6px 8px; }
    .hud b { font-size: 17px; }
    .stage { margin: 0 auto; border-radius: 10px; border-width: 2px; }
    .btn { padding: 12px 8px; font-size: 14px; }
    .bar { gap: 10px; margin-top: 12px; }
    /* 建造栏塔多，桌面放宽到 6 列；技能栏/波次栏只有 2~4 个按钮，保持 3 列 */
    #barBuild.grid3 { grid-template-columns: repeat(6, 1fr); }
    .bar.grid3 .btn.wave { grid-column: 1 / -1; }
    #tip { font-size: 13px; padding: 8px 10px; }
    .card.wide { max-width: 900px; }
    .modal .card { max-height: 88vh; }
    .lvtoast { font-size: 13px; padding: 8px 14px; }
    .tabbar .btn, .chbtn { font-size: 14px; padding: 12px 8px; }
  }
  .over {
    position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
    flex-direction: column; background: rgba(10,12,16,.88); font-size: 19px; font-weight: bold; letter-spacing: 2px;
  }
  .over.show { display: flex; }
  .over small { font-size: 12px; font-weight: normal; color: #9aa3b2; margin-top: 8px; white-space: pre-line; text-align: center; }
  .overbtns { display: flex; gap: 8px; margin-top: 10px; }
  .overbtns .btn { flex: 1; margin-top: 0; white-space: nowrap; overflow: hidden;
                   text-overflow: ellipsis; padding: 10px 4px; font-size: 13px; }
  .overbtns .go { background: #2f6f4f; border-color: #4a9c6d; color: #dff5e6; }
  .over .starrow { font-size: 22px; letter-spacing: 4px; margin-top: 10px; }
  .over .starrow .off { color: #4a5060; }
  #bBack { max-width: 160px; padding: 9px 14px; font-size: 13px; margin-top: 12px; }
  .overbtns #bBack { max-width: none; margin-top: 0; padding: 10px 6px; }
  .bar { display: flex; gap: 8px; margin-top: 10px; }
  .bar .btn { flex: 1; }
  /* 炮塔栏：每行 3 个 */
  .bar.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .bar.grid3 .btn { flex: none; width: 100%; }
  .bar.grid3 .btn.wave { grid-column: 1 / -1; }
  /* hide 必须放在 .grid3 之后，否则会被 grid 覆盖而失效 */
  .bar.hide { display: none !important; }
  #tip { margin-top: 8px; font-size: 12px; color: #8b94a3; min-height: 16px; }
  /* BOSS 血条：占用「开始第 N 波」按钮的位置 */
  .btn.wave.bossbar { display: flex; flex-direction: column; gap: 3px; align-items: stretch;
    background: #2a1418; border-color: #8b2b3a; padding: 7px 10px; cursor: default; }
  .btn.wave.bossbar .bn { font-size: 13px; font-weight: 700; color: #ff8a5c; letter-spacing: 1px; }
  .btn.wave.bossbar .bh { font-size: 11px; color: #e8b0b8; font-variant-numeric: tabular-nums; }
  .btn.wave.bossbar .bb { display: block; height: 7px; border-radius: 4px;
    background: #47202a; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.5); }
  .btn.wave.bossbar .bb i { display: block; height: 100%; border-radius: 4px;
    background: linear-gradient(90deg, #ff3b5c, #ff8a5c); transition: width .12s linear; }
  /* 关卡进度表 */
  table.pg { width: 100%; border-collapse: collapse; font-size: 11px; }
  table.pg th { color: #8b94a3; font-weight: 500; padding: 4px 2px; text-align: center; }
  table.pg td { padding: 4px 2px; text-align: center; border-top: 1px solid rgba(120,130,145,.16); }
  table.pg td.nm { text-align: left; color: #cdd4df; white-space: nowrap; padding-right: 6px; }
  table.pg td small { display: block; font-size: 10px; opacity: .85; }
  table.pg td.ok { color: #ffd479; }
  table.pg td.no { color: #7b8493; }
  table.pg td.lk { color: #5a6270; }
  table.pg td.cp { white-space: nowrap; }
  .sum { font-size: 13px; margin-bottom: 8px; }
  .sum .src { font-size: 11px; color: #8b94a3; }
  .urow { font-size: 12px; padding: 3px 0; color: #cdd4df; }
  .tip2 { font-size: 11px; color: #8b94a3; line-height: 1.5; }

  /* ================= 版权说明 ================= */
  .copy { margin-top: 14px; padding: 10px 12px; border-radius: 8px;
    background: rgba(0,0,0,.28); border: 1px solid rgba(120,130,145,.22); }
  .copyt { font-size: 14px; color: #ffd479; margin-bottom: 6px; letter-spacing: .5px; }
  .copyt b { font-size: 11px; color: #b6f0a4; font-weight: 600; }
  .copys { font-size: 11px; color: #98a2b0; line-height: 1.7; }
  .copys b { color: #cdd4df; font-weight: 600; }
  .copys a { color: #7fd4ff; text-decoration: none; border-bottom: 1px dotted rgba(127,212,255,.5); }
  .copys a:active { color: #b6f0a4; }
  .dbtn { display: block; width: 100%; margin-top: 9px; padding: 7px 0;
    font-size: 12px; font-family: inherit; color: #ffd479; cursor: pointer;
    background: rgba(200,149,31,.14); border: 1px solid rgba(200,149,31,.4);
    border-radius: 6px; }
  .dbtn:active { background: rgba(200,149,31,.28); }

  /* ================= 更新日志 ================= */
  .loggrp { margin-bottom: 12px; }
  .logver { font-size: 12px; color: #ffd479; font-weight: 600; margin-bottom: 4px;
    padding-bottom: 3px; border-bottom: 1px solid rgba(120,130,145,.2); }
  .logver span { float: right; font-size: 10px; color: #6b7383; font-weight: 400; }
  .logul { margin: 0; padding-left: 15px; }
  .logul li { font-size: 11px; color: #98a2b0; line-height: 1.65; margin-bottom: 2px; }
  .logul li b { color: #cdd4df; font-weight: 600; }
  .logul li.tag-new  b.n { color: #b6f0a4; }
  .logul li.tag-fix  b.n { color: #ff8a5c; }
  .logul li.tag-chg  b.n { color: #7fd4ff; }
  .logul li.tag-note b.n { color: #ffd479; }
  .logul li.tag-info b.n { color: #c89bff; }
  .logul li.loghl { background: rgba(60,150,220,.13); border-left: 3px solid #7fd4ff;
    padding: 7px 9px; margin: 0 0 6px -3px; border-radius: 0 6px 6px 0; color: #c3ccd8; }
  .logul li.loghl b.logtag { display: inline-block; font-size: 10px; color: #10131a;
    background: #7fd4ff; border-radius: 4px; padding: 1px 5px; margin-right: 3px; vertical-align: 1px; }

  /* ================= 弹窗 ================= */
  .modal {
    position: fixed; inset: 0; z-index: 60; display: none;
    align-items: center; justify-content: center; padding: 16px;
    background: rgba(8,10,14,.82);
  }
  .modal.show { display: flex; }
  .card {
    width: 100%; max-width: 380px; max-height: 86vh; display: flex; flex-direction: column;
    background: #171a22; border: 1px solid #333a47; border-radius: 12px; padding: 14px;
  }
  .card h3 { margin: 0 0 10px; font-size: 16px; flex: 0 0 auto; }
  .card .scroll { flex: 1 1 auto; overflow-y: auto; }
  /* 通用隐藏：面板切换靠它（之前缺这条，导致科技页和炮塔页同时显示） */
  .hide { display: none !important; }
  .card .foot { flex: 0 0 auto; margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
  .card .foot .btn, .card .foot .close { width: 100%; box-sizing: border-box; }
  .lvmap { width: 100%; aspect-ratio: 16/9; border: 1px solid #2a2e39; border-radius: 6px; display: block; background: #12332a; image-rendering: pixelated; margin-bottom: 10px; }
  .inf { font-size: 12px; color: #9aa3b2; line-height: 1.85; }
  .inf b { color: #e6e8ee; font-weight: 600; }
  .inf .hi { color: #ffd479; }
  .hsbar { flex: 0 0 auto; font-size: 12px; line-height: 1.7; color: #c7ccd6; margin-bottom: 8px; }
  .hsbar b { color: #ffd479; }
  .hsbar .s { color: #9aa3b2; }
  .lb { font-size: 11px; color: #6b7280; margin: 10px 0 6px; letter-spacing: 1px; }
  .row { display: flex; gap: 6px; }
  .row .btn { flex: 1; }
  .row .btn small { display: block; font-size: 10px; margin-top: 2px; opacity: .85; }
  .go { width: 100%; padding: 12px; font-size: 14px; font-weight: bold; background: #2c3a2a; border: 1px solid #6fbf5f; border-radius: 8px; color: #b6f0a4; cursor: pointer; }
  .go:active { background: #35492f; }
  .close { width: 100%; margin-top: 8px; padding: 9px; font-size: 12px; background: transparent; border: 1px solid #333a47; border-radius: 8px; color: #8b94a3; cursor: pointer; }

  .dexgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; }
  .mk { display:inline-block; vertical-align:middle; margin:0 2px; padding:1px 5px; border-radius:6px;
    font-size:10px; line-height:14px; color:#0e1116; background:#c8951f; font-weight:bold; }
  .nm .mk, #tip .mk { margin-left:5px; }
  .dexitem {
    aspect-ratio: 1; border: 1px solid #333a47; border-radius: 8px; background: #1b1f28;
    display: flex; align-items: center; justify-content: center; flex-direction: column;
    font-size: 10px; color: #9aa3b2; cursor: pointer; padding: 3px; text-align: center;
    min-width: 0; overflow: hidden;
  }
  .dexitem canvas { image-rendering: pixelated; }
  .dexitem span {
    display: block; width: 100%; line-height: 1.2; font-size: 10px;
    white-space: normal; word-break: break-all;
  }
  .dexitem.sel { border-color: #6fbf5f; background: #232c22; color: #b6f0a4; }
  /* 术语页：格子稍宽，符号 + 名称 */
  .dexgrid2 { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
  .dexitem .tic { display:block; font-size:15px; line-height:20px; margin-bottom:1px; }
  /* 术语超链接：点一下跳到图鉴「术语」分页 */
  .tl { color:#7fd4ff; text-decoration: underline dotted; text-underline-offset:2px; cursor:pointer; }
  .tl:active { color:#ffd479; }
  /* 图鉴介绍框：名称固定，正文超高后可上下滑动（如 <span> 的长介绍） */
  .dexstat {
    flex: 0 0 auto; margin-top: 8px; padding: 9px; min-height: 78px; max-height: 172px;
    border: 1px solid #2a2e39; border-radius: 8px; background: #12151c;
    font-size: 12px; color: #9aa3b2; line-height: 1.8;
    display: flex; flex-direction: column;
  }
  .dexstat .nm { font-size: 14px; color: #e6e8ee; font-weight: 600; margin-bottom: 4px; flex: 0 0 auto; }
  .dexstat .v { color: #ffd479; }
  .dexstat .dbody {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch; padding-right: 4px;
  }
  .dexstat .dbody::-webkit-scrollbar { width: 6px; }
  .dexstat .dbody::-webkit-scrollbar-track { background: transparent; }
  .dexstat .dbody::-webkit-scrollbar-thumb { background: #3a4152; border-radius: 3px; }
  .dexstat .dbody::-webkit-scrollbar-thumb:hover { background: #4a5265; }

  /* ===================== 小游戏 ===================== */
  .mgboard { width: 100%; box-sizing: border-box; margin: 0 auto; display: grid; gap: 3px;
             background: #0e1116; border: 1px solid #333a47; border-radius: 8px; padding: 4px;
             touch-action: none; user-select: none; -webkit-user-select: none; }
  .mgcell { aspect-ratio: 1; border-radius: 5px; background: #1b1f28; border: 1px solid #2a2e39;
            display: flex; align-items: center; justify-content: center; overflow: hidden;
            font-size: 10px; font-weight: bold; color: #9aa3b2; }
  .mgcell img { width: 100%; height: 100%; image-rendering: pixelated; }
  .mgcell.empty { background: #12151c; border-color: #191d26; }
  .mgcell.pop { animation: mgpop .22s ease-out; }
  @keyframes mgpop { from { transform: scale(.62); } to { transform: scale(1); } }
  .mgcell.back { background: #232a38; border-color: #3c4658; }
  .mgcell.back::after { content: '?'; font-size: 15px; font-weight: bold; color: #6f7c92; }
  .mgcell.done { background: #1c2a20; border-color: #33533a; opacity: .42; }
  .mgcell.bad { animation: mgbad .3s ease-out; }
  @keyframes mgbad { 0%,100% { transform: translateX(0); } 30% { transform: translateX(-3px); } 70% { transform: translateX(3px); } }
  .mgbar { display: flex; gap: 6px; align-items: center; justify-content: space-between;
           font-size: 12px; color: #9aa3b2; margin-bottom: 8px; flex: 0 0 auto; }
  .mgbar b { color: #ffd479; font-size: 15px; }
  .mghint { font-size: 11px; color: #6f7c92; line-height: 1.7; margin-top: 8px; flex: 0 0 auto; }
  .mgmode { display: flex; gap: 6px; margin-bottom: 8px; }
  .mgmode .btn { flex: 1; padding: 9px 4px; font-size: 12px; }
  .mgmode .btn.sel { background: #2c3a2a; border-color: #6fbf5f; color: #b6f0a4; }
  .mgover { position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
            flex-direction: column; background: rgba(10,12,16,.9); border-radius: 8px; gap: 6px; }
  .mgover.show { display: flex; }
  /* 踩雷时：不糊黑屏，只在底部挂一条半透明横幅，好让玩家看清雷都在哪 */
  .mgover.soft { inset: auto 0 0 0; align-items: center; gap: 3px; border-radius: 0 0 8px 8px;
                 padding: 16px 8px 8px; pointer-events: none;
                 background: linear-gradient(180deg, rgba(10,12,16,0) 0%, rgba(10,12,16,.72) 40%, rgba(10,12,16,.93) 100%); }
  .mgstage { position: relative; }
  .mgfly { position: absolute; left: 0; top: 0; right: 0; bottom: 0; pointer-events: none; z-index: 3; }
  .mgflyi { position: absolute; image-rendering: pixelated; border-radius: 5px;
            transition: transform .13s cubic-bezier(.3,.9,.4,1), opacity .12s linear; }
  /* 扫雷 */
  .mgcell.mine { background: #232a38; border-color: #3c4658; }
  .mgcell.mrev { background: #141821; border-color: #22262f;
                 font-size: calc(var(--mgs, 26px) * .5); }
  .mgcell.n1 { color:#7fd4ff; } .mgcell.n2 { color:#6fbf5f; }
  .mgcell.n3 { color:#ff7b6b; } .mgcell.n4 { color:#b39bff; }
  .mgcell.n5 { color:#ffb84d; } .mgcell.n6 { color:#4fd6c9; }
  .mgcell.n7 { color:#e6e8ee; } .mgcell.n8 { color:#8b94a3; }
  .mgcell.mflag { background:#2a2119; border-color:#6b4a22; }
  .mgcell.mflag::after { content:'\1F6A9'; font-size: calc(var(--mgs, 26px) * .46); }
  /* 踩雷结算：插错的旗标 ✕、插对的旗标 ✓ */
  .mgcell.mwrong { background:#2e2418; border-color:#8a6a2a; }
  .mgcell.mwrong::after { content:'\2715'; color:#ffb84d; font-size: calc(var(--mgs, 26px) * .46); }
  .mgcell.mright { background:#16261c; border-color:#2f7a45; }
  .mgcell.mright::after { content:'\2713'; color:#6fbf5f; font-size: calc(var(--mgs, 26px) * .46); }
  .mgcell.mboom { background:#5a1512; border-color:#ff5a4d; animation: mgbad .3s ease-out; }
  .mgcell.mreveal { background:#33201c; border-color:#7a4a3a; }
  .mgcustom { display:flex; gap:10px; align-items:center; font-size:11px; color:#8b94a3;
              margin-bottom:8px; flex-wrap:wrap; }
  .mgcustom label { display:flex; align-items:center; gap:4px; }
  .mgcustom input { width:64px; background:#141821; color:#e6e8ee; border:1px solid #333a47;
                    border-radius:5px; padding:4px 6px; font-size:12px; }

  /* 科技树：主板式地图，节点沿铜线树形排布 */
  /* 科技树：实际平面比可视区大，可上下左右滑动 */
  .techmap { position: relative; width: 100%; height: 268px; margin: 4px 0 8px;
             overflow: auto; border-radius: 8px; background: #0f1a14;
             border: 1px solid #1e2a22; -webkit-overflow-scrolling: touch; }
  .techmap::-webkit-scrollbar { width: 6px; height: 6px; }
  .techmap::-webkit-scrollbar-thumb { background: #3a4a3e; border-radius: 3px; }
  .techinner { position: relative; width: 460px; height: 740px; }
  .techinner canvas { display: block; width: 460px; height: 740px; }
  .technodes { position: absolute; inset: 0; }
  .technode {
    position: absolute; transform: translate(-50%, -50%);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 1px; padding: 5px 7px; border-radius: 7px; cursor: pointer;
    border: 1px dashed #6b5730; background: rgba(22,28,22,.94); color: #9aa3b2;
    font-size: 11px; line-height: 1.15; white-space: nowrap;
  }
  .technode .ic { font-size: 13px; }
  .technode .nm { font-weight: bold; }
  .technode.owned { border-style: solid; border-color: #6fbf5f; background: #22301f; color: #cdf3bd; }
  .technode.ready { border-color: #c8951f; color: #ffdf9a; }
  .technode.locked { border-color: #3a4049; background: rgba(18,21,28,.94); color: #6b7383; }
  .technode.sel { outline: 2px solid #ffd479; }
  /* 沙盒设置 */
  .sbrow { display:flex; align-items:center; justify-content:space-between; gap:8px;
           padding:6px 0; border-bottom:1px dashed rgba(255,255,255,.07); font-size:12px; }
  .sbrow > span:first-child { color:#9aa3b2; flex:0 0 76px; }
  .sbipt { width:92px; padding:5px 7px; border-radius:6px; border:1px solid #3a4049;
           background:#181c24; color:#e6e9ef; font-size:12px; text-align:right; }
  .sbsel { flex:1; padding:5px 7px; border-radius:6px; border:1px solid #3a4049;
           background:#181c24; color:#e6e9ef; font-size:12px; }
  .sbgrid { display:grid; grid-template-columns:repeat(2,1fr); gap:5px; }
  .sbtype { display:flex; align-items:center; gap:5px; padding:6px; border-radius:6px;
            border:1px dashed #3a4049; font-size:11px; cursor:pointer; color:#9aa3b2; }
  .sbtype.on { border-style:solid; border-color:#6fbf5f; background:#22301f; color:#cdf3bd; }
  .sbmini { display:flex; gap:6px; flex-wrap:wrap; }
  /* 关卡详情：左（地图 + 信息）| 右（难度 + 开始/返回） */
  .card.wide { max-width: 97vw; }
  .mdwrap { display: flex; gap: 8px; align-items: stretch; min-height: 0; max-height: 74vh; }
  .mdleft  { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px;
              max-height: 100%; overflow-y: auto; }   /* 内容过长时内部滚动，按钮不会被挤出屏幕 */
  .mdleft .lvmap { width: 100%; height: auto; border-radius: 8px; }
  .mdright { flex: 0 0 30%; min-width: 96px; display: flex; flex-direction: column; gap: 6px;
              flex-shrink: 0; }
  .mdright .row.v { flex-direction: column; gap: 6px; }
  .mdright .go { font-size: 13px; padding: 10px 4px; margin-top: auto; }
  .mdright .close { font-size: 12px; padding: 9px 4px; }
  .mdwrap .inf { font-size: 11px; line-height: 1.6; }
  .mdwrap .lb { font-size: 11px; margin-bottom: 2px; }
  .eqtabs { display: flex; gap: 6px; margin-bottom: 8px; }
  .eqtab { flex: 1; padding: 8px 6px; font-size: 13px; border-radius: 8px; cursor: pointer;
           background: #1b1f28; border: 1px solid #333a47; color: #9aa3b2; }
  .eqtab.on { background: #2c3a2a; border-color: #6fbf5f; color: #b6f0a4; }
  /* 强化操作固定在弹窗底部，不随列表滚动 */
  .eqfix { border-top: 1px solid #2a2e39; margin-top: 8px; padding-top: 8px; }
  .eqfix.hide { display: none; }
  .eqrow { display: flex; gap: 8px; flex-wrap: wrap; }
  /* 装备页炮塔列表：flex 换行，格子拉大，一行正好 6 个 */
  .eqgrid3 { display: flex; gap: 8px; flex-wrap: wrap; }
  .eqcell {
    width: 56px; height: 56px; border: 1px solid #333a47; border-radius: 8px; background: #1b1f28;
    display: flex; align-items: center; justify-content: center; flex-direction: column;
    font-size: 11px; color: #9aa3b2; cursor: pointer;
  }
  .eqcell.on { border-color: #6fbf5f; background: #232c22; color: #b6f0a4; }
  .eqcell.empty { color: #4a5060; border-style: dashed; }
  /* 拉大：一行 6 个（必须放在 .eqcell 之后才生效） */
  .eqrow .eqcell, .eqgrid3 .eqcell {
    width: calc((100% - 40px) / 6);
    min-width: 44px; height: 56px; font-size: 14px;
    box-sizing: border-box; flex: 0 0 auto;
  }
  /* 强化区恒定最小高度：选没选目标都不让这一块缩回去，避免页面跳动 */
  .eqlist { display: flex; flex-direction: column; gap: 8px; min-height: 150px; }
  .eqtower {
    display: flex; align-items: center; gap: 10px; padding: 8px;
    border: 1px solid #2a2e39; border-radius: 8px; background: #12151c; cursor: pointer;
  }
  .eqtower.sel { border-color: #6fbf5f; background: #1e2a1c; }
  .eqtower .ic { flex: 0 0 auto; font-size: 13px; color: #7fd4ff; font-weight: bold; font-family: monospace; }
  .eqtower .mid { flex: 1 1 auto; font-size: 12px; color: #9aa3b2; line-height: 1.6; }
  .eqtower .mid b { color: #e6e8ee; }
  .eqtower .mid .v { color: #ffd479; }
  .eqtower .lvtag { flex: 0 0 auto; font-size: 11px; color: #ffd479; font-weight: bold; }
  /* 被双击选中的强化目标：金边 + 右上角勾 */
  .eqcell.picked { border-color: #ffd479; background: #2b2415; box-shadow: 0 0 0 2px rgba(255,212,121,.35); position: relative; }
  .eqcell.picked::after {
    content: '✓'; position: absolute; top: -6px; right: -4px;
    font-size: 11px; line-height: 1; color: #10131a; background: #ffd479;
    border-radius: 50%; width: 15px; height: 15px;
    display: flex; align-items: center; justify-content: center; font-weight: bold;
  }
  /* 未选目标时用操作指引填满空位，不让区块塌下去 */
  .eqguide {
    display: flex; flex-direction: column; gap: 7px; padding: 11px 10px;
    border: 1px dashed #3a4150; border-radius: 8px; background: #12151c; min-height: 150px;
  }
  .eqguide .gt { font-size: 12px; color: #ffd479; font-weight: bold; }
  .eqguide .gs { font-size: 12px; color: #9aa3b2; line-height: 1.65; }
  .eqguide .gs b { color: #7fd4ff; font-family: monospace; }
  .eqguide .gs em { color: #b6f0a4; font-style: normal; }
  .tutlist { display: flex; flex-direction: column; gap: 8px; }
  .tutitem { display: flex; gap: 10px; padding: 8px; border: 1px solid #2a2e39; border-radius: 8px; background: #12151c; }
  .tutitem .ic {
    flex: 0 0 auto; width: 34px; height: 34px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: bold; font-family: monospace;
    background: #1b1f28; border: 1px solid #333a47; color: #7fd4ff;
  }
  .tutitem .ic.gold { color: #ffd479; border-color: #5a4a22; }
  .tutitem .tx { flex: 1 1 auto; font-size: 12px; color: #9aa3b2; line-height: 1.7; }
  .tutitem .tx b { color: #e6e8ee; display: block; margin-bottom: 2px; font-size: 13px; }
  .optrow { display: flex; gap: 6px; }
  .optrow .btn { flex: 1; font-size: 12px; padding: 10px 4px; }
  /* 每波间隔滑动条 */
  .gaprow { border: 1px solid #2a2e39; border-radius: 10px; background: #171a22; padding: 12px 14px; }
  .gapt { font-size: 13px; color: #9aa3b2; }
  .gapt b { color: #7fd4ff; font-size: 16px; }
  .gaps { font-size: 11px; color: #6b7280; line-height: 1.6; margin-top: 8px; }
  #gapRange { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; margin: 10px 0 0; background: transparent; }
  #gapRange::-webkit-slider-runnable-track { height: 5px; border-radius: 3px; background: #2a2e39; }
  #gapRange::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #7fd4ff; border: 2px solid #10131a; margin-top: -8px; cursor: pointer; }
  #gapRange::-moz-range-track { height: 5px; border-radius: 3px; background: #2a2e39; }
  #gapRange::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #7fd4ff; border: 2px solid #10131a; cursor: pointer; }
  #optReset { flex: 1; font-size: 12px; padding: 10px 4px; color: #ffb4b4; border-color: #4a2a2a; }
  /* 自适应文字：放不下时由脚本缩小字号，不再用 ellipsis 吞成「…」（见 fitOne / setFit） */
  .fit { overflow: hidden; text-overflow: clip; }
  /* ================= 局内横向模式（设置里开启） =================
     竖屏手机上画布被屏幕宽度卡死，槽位小到指头点不准。开启后把【游戏界面】旋转 90°，
     用屏幕的长边做画布的宽度 —— 同样一台手机，画面能大出将近一倍。
     只在局内生效，局外界面不跟着转。系统本身就是横屏（宽 > 高）时不重复旋转。 */
  @media (max-width: 899px){
    body.ls { overflow: hidden; }
    /* 只转游戏界面：局外（主菜单 / 选关 / 图鉴）保持正常方向 */
    body.ls #scGame.on { position: fixed; top: 50%; left: 50%;
                         width: 100vh; height: 100vw; max-width: none;
                         transform: translate(-50%, -50%) rotate(90deg);
                         transform-origin: 50% 50%; overflow: hidden; }
    /* 横过来后：整个界面按 grid 分成两行两列 —— 上：顶栏 + HUD；下：画布 | 右列。
       右列从上到下是：建造栏（按内容自然高度）→ 塔介绍（吃掉剩余高度）→ 玩法说明。
       之前把提示条 / 玩法说明单独放在底部一行（写死 38px 高），玩法说明一展开就超出，根本看不全。
       并进右列之后，塔介绍把剩下的高度吃满，多的内容手指上下滑就能看完。 */
    /* 列宽：画布那列按算出来的尺寸走（auto），右列吃掉剩下的全部宽度（1fr）。
       之前按钮栏写死 200px，画布右边到按钮栏之间会空出一大条 —— 就是那片空白。 */
    body.ls .gamebody { display: grid; grid-template-columns: auto minmax(0, 1fr);
                        grid-template-rows: auto minmax(0, 1fr);
                        gap: 2px; padding: 2px 3px 2px; }
    /* 画布是 grid 项，width 必须 auto —— 原来的 100% 会撑满整格被拉变形（画面变扁） */
    body.ls .gamebody > .stage { grid-column: 1; grid-row: 2; justify-self: start;
                                 min-width: 0; width: auto; aspect-ratio: auto; margin: 0; }
    /* 右列整列可上下滑：建造栏 / 塔介绍 / 玩法说明都按内容自然高度排，
       放不下就手指滑着看 —— 不再把某一块塞进弹窗、也不再被写死的行高裁掉。
       grid 行是 minmax(0,1fr)，所以列内容再高也不会把画布挤变形。 */
    body.ls .gamebody > .lsSide { grid-column: 2; grid-row: 2;
                                  display: flex; flex-direction: column; gap: 4px;
                                  min-height: 0; overflow-y: auto; overscroll-behavior: contain;
                                  -webkit-overflow-scrolling: touch; }
    /* 旋转之后滚动条会横在画面边上，藏掉 */
    body.ls .lsSide::-webkit-scrollbar { width: 0; height: 0; }
    /* 建造栏列数写死 2 列：右列比屏幕窄，3 列会把按钮挤到 69px，塔名要被裁掉。
       另外列数绝不能自适应 —— 之前用 minmax(84px,1fr)，窄屏不足 84px 就塌成 1 列。 */
    body.ls .lsSide .bar { margin-top: 0; display: grid;
                           grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px;
                           /* 按钮恢复自然高度：以前 grid-auto-rows 用 1fr，把每个按钮拉到 97px 高，
                              而按钮里只有三行字（42px），上下各空 27px —— 就是那片「怪怪的空白」。 */
                           flex: 0 0 auto; align-content: start; }
    body.ls .lsSide .bar .btn { padding: 5px 2px; font-size: 11px; }
    body.ls .lsSide > .btn { padding: 7px 3px; font-size: 11px; flex: 0 0 auto; }
    /* 塔介绍：吃掉右列剩下的全部高度。内容比格子高就手指上下滑看完，
       不再像以前那样被写死的行高裁掉。 */
    /* 塔介绍按内容自然高度，不再吃掉剩余高度 —— 吃掉剩余高度会把按钮拉长、
       玩法说明挤到看不见，之前那片「怪怪的空白」就是这么来的。 */
    body.ls .lsSide > #tip { flex: 0 0 auto; margin: 0; min-height: 46px; height: auto;
                             font-size: 11px; line-height: 14px; padding: 4px 6px; }
    /* 玩法说明回到右列最下面，跟着整列一起滑（之前藏进弹窗，等于直接消失） */
    body.ls .lsSide > #help, body.ls .lsBot > #help,
    body.ls .lsSide > #rpt,  body.ls .lsBot > #rpt  { flex: 0 0 auto; margin: 0;
                                                      font-size: 11px; }
    /* 弹窗跟着转：游戏界面是横的，弹窗竖着弹出来还得把手机转回去才看得清 */
    body.ls .modal.show { inset: auto; top: 50%; left: 50%; width: 100vh; height: 100vw;
                          transform: translate(-50%, -50%) rotate(90deg); }
    body.ls .modal.show .card { max-height: 90%; max-width: 96%; }
    /* 顶部横带：标题 / 选关键 / 资金 / 波次都在这里，回到画布上方 */
    body.ls .gamebody > .lsTop { grid-column: 1 / -1; grid-row: 1;
                                 display: flex; flex-direction: row; align-items: center; gap: 6px; }
    body.ls .lsTop > .topbar { flex: 0 0 auto; margin: 0; display: flex; flex-direction: row;
                               align-items: center; gap: 6px; }
    body.ls .lsTop > .topbar .title { font-size: 12px; }
    body.ls .lsTop > .hud { flex: 1 1 auto; margin: 0; display: flex; flex-direction: row;
                            align-items: center; gap: 4px; flex-wrap: nowrap; overflow: hidden; }
    body.ls .lsTop > .hud div { height: auto; padding: 0 3px; white-space: nowrap; font-size: 11px; }
    body.ls .lsTop > .hud b { font-size: 11px; }
    /* 底部横带：只剩提示条 + 玩法说明 */
    body.ls .gamebody > .lsBot { grid-column: 1 / -1; grid-row: 3; height: 38px;
                                 display: flex; flex-direction: row; align-items: stretch; gap: 4px; }
    /* 提示条：高度写死在这条横带里，内容再多也不撑开，超出的部分手指上下滑看完
       （一撑开就会从画布身上扣像素，画面跟着跳一下） */
    body.ls .lsBot > #tip { flex: 1 1 auto; margin: 0; height: auto; font-size: 11px;
                            line-height: 14px; padding: 4px 6px;
                            overflow-y: auto; overscroll-behavior: contain;
                            -webkit-overflow-scrolling: touch; }
  }
  /* 设置页：左侧竖排导航栏 + 右侧分类面板 */
  .setbox { display: flex; gap: 8px; align-items: flex-start; }
  .setnav { display: flex; flex-direction: column; gap: 6px; flex: 0 0 58px; }
  .setnav .btn { font-size: 12px; padding: 12px 2px; text-align: center; }
  .setpane { flex: 1; min-width: 0; }
  .setpane.hide { display: none !important; }

  #help { margin-top: 14px; border: 1px solid #2a2e39; border-radius: 10px; background: #171a22; overflow: hidden; }
  #help summary { padding: 12px 14px; cursor: pointer; font-size: 14px; font-weight: bold; list-style: none; user-select: none; }
  #help summary::-webkit-details-marker { display: none; }
  #help summary::before { content: "▸ "; }
  #help[open] summary::before { content: "▾ "; }
  #help .body { padding: 0 14px 12px; color: #9aa3b2; font-size: 12px; line-height: 1.9; }
  #help code { background: #232833; padding: 1px 5px; border-radius: 3px; color: #ffd479; font-size: 11px; }
  #rpt { margin-top: 14px; border: 1px solid #2a2e39; border-radius: 10px; background: #171a22; overflow: hidden; }
  #rpt summary { padding: 12px 14px; cursor: pointer; font-size: 14px; font-weight: bold; list-style: none; user-select: none; }
  #rpt summary::-webkit-details-marker { display: none; }
  #rpt summary::before { content: "▸ "; }
  #rpt[open] summary::before { content: "▾ "; }
  #rpt .body { padding: 0 12px 12px; color: #9aa3b2; font-size: 12px; line-height: 1.7; }
  .rpttb { width: 100%; border-collapse: collapse; font-size: 11px; }
  .rpttb th { color: #6b7280; font-weight: normal; text-align: right; padding: 4px 4px; border-bottom: 1px solid #2a2e39; }
  .rpttb th:first-child { text-align: left; }
  .rpttb td { padding: 4px 4px; border-bottom: 1px solid #21252e; text-align: right; color: #c8ced8; }
  .rpttb td.rk { text-align: left; color: #9aa3b2; }
  .rpttb td.rf { color: #ffd479; }
  .rpttb td.rd { color: #7fd4ff; }
  .rpttb td.rp { color: #ffb37f; }
  .rpttb tr.sum td { border-bottom: none; border-top: 1px solid #2a2e39; color: #e6e9ee; font-weight: bold; padding-top: 6px; }
  .rptnote { margin-top: 8px; color: #6b7280; font-size: 10px; line-height: 1.7; }
