/* 英雄坛说 · 客户端样式表
 * 由 gmud-client.html 里的 <style> 原样抽出，未做改写。
 */
  :root { color-scheme: light; }
  * { margin: 0; padding: 0; }
  body { background: #111; display: flex; justify-content: center; align-items: center; min-height: 100vh; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
  input, textarea { user-select: text; -webkit-user-select: text; }
  canvas { image-rendering: pixelated; }
  #dbg { position: fixed; top: 0; right: 0; color: #0f0; background: rgba(0,0,0,0.85); font: 12px Menlo, 'Songti SC', monospace; padding: 6px; pointer-events: none; white-space: pre; max-height: 100vh; overflow-y: auto; }
  #game-wrap { position: relative; display: inline-block; }
  #mapname-cv { position: absolute; top: 0; left: 0; z-index: 50; display: none; }
  #name-cv { position: absolute; z-index: 51; display: none; }
  #player-menu-cv { position: absolute; top: 0; left: 0; z-index: 52; display: none; }
  #function-menu-cv { position: absolute; top: 0; left: 0; z-index: 53; display: none; }
  #force-menu-cv { position: absolute; top: 0; left: 0; z-index: 54; display: none; }
  #jiali-cv { position: absolute; top: 0; left: 0; z-index: 55; display: none; }
  #msg-dialog-cv { position: absolute; top: 0; left: 0; z-index: 60; display: none; }
  #practice-menu-cv { position: absolute; top: 0; left: 0; z-index: 55; display: none; }
  #practice-progress-cv { position: absolute; top: 0; left: 0; z-index: 56; display: none; }
  #learn-menu-cv { position: absolute; top: 0; left: 0; z-index: 55; display: none; }
  #msgbox-cv { position: absolute; top: 0; left: 0; z-index: 54; display: none; }
  #confirm-cv { position: absolute; top: 0; left: 0; z-index: 57; display: none; }
  #npc-menu-cv { position: absolute; top: 0; left: 0; z-index: 55; display: none; }
  #npc-name-cv { position: absolute; top: 0; left: 0; z-index: 54; display: none; }
  #npc-view-desc-cv { position: absolute; top: 0; left: 0; z-index: 56; display: none; }
  #pv-cv { position: absolute; top: 0; left: 0; z-index: 57; display: none; }
  #trade-cv { position: absolute; top: 0; left: 0; z-index: 55; display: none; }
  #trade-bar-cv { position: absolute; top: 0; left: 0; z-index: 55; display: none; }
  #items-tab-cv { position: absolute; top: 0; left: 0; z-index: 55; display: none; }
  #items-list-cv { position: absolute; top: 0; left: 0; z-index: 55; display: none; }
  #items-desc-cv { position: absolute; top: 0; left: 0; z-index: 56; display: none; }
  #skills-tab-cv { position: absolute; top: 0; left: 0; z-index: 55; display: none; }
  #skills-list-cv { position: absolute; top: 0; left: 0; z-index: 55; display: none; }
  #skills-desc-cv { position: absolute; top: 0; left: 0; z-index: 56; display: none; }
  #fight-cv { position: absolute; top: 0; left: 0; z-index: 58; display: none; }
  #fight-perform-cv { position: absolute; top: 0; left: 0; z-index: 59; display: none; }
  #fight-item-cv { position: absolute; top: 0; left: 0; z-index: 59; display: none; }
  /* 登录界面已改为全画布渲染（gmud.js 画布登录段），原 DOM 登录样式整体移除 */
  #loading-overlay { position: fixed; inset: 0; background: #111; display: flex; justify-content: center; align-items: center; z-index: 99; color: #9fb07a; font: 16px Menlo, 'Songti SC', monospace; }
  #conn-status { position: fixed; top: 8px; right: 8px; color: #888; font: 12px Menlo, 'Songti SC', monospace; z-index: 99; }
  /* 备案信息：画布窗口外的页面底部，登录阶段显示（样式沿用老版 DOM 登录页） */
  #login-beian { position: fixed; left: 0; right: 0; bottom: 0; padding: 2px 0 3px; text-align: center; color: #555; font: 12px Menlo, 'Songti SC', monospace; background: #111; z-index: 90; }
  #login-beian a { color: #555; text-decoration: none; }
  #login-beian .sep { margin: 0 6px; color: #333; }
  #login-beian img { height: 16px; vertical-align: -3px; margin-right: 4px; }
  body.mobile #login-beian { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; column-gap: 6px; font-size: 11px; }
  body.mobile #login-beian .sep { display: none; }
  /*
   * 左上角那颗胶囊：既是物理手柄的状态灯，也是触屏手柄的开关。
   *   - 常驻显示（藏了十字键 / A·B 之后还得有地方点回来）；
   *   - 左边那个绿点只在真有物理手柄连上时亮；
   *   - 短按显隐十字键与 A·B，长按锁定 / 解锁位置（锁定后整颗转琥珀色并多出一把小锁）；
   *   - 只在手机端出现，桌面端由文件下半部分的 body.desktop 规则收掉。
   * 样式和桌面客户端的 .led 保持同一套（背景、描边、图标线宽都一样）。
   */
  /* 左右内边距必须相等：原来 8/10 是给左边那颗绿点留的位，没连手柄时图标就会偏左 2px */
  #gp-led { position: fixed; top: max(10px, env(safe-area-inset-top, 0px)); left: max(10px, env(safe-area-inset-left, 0px)); z-index: 320; display: flex; align-items: center; gap: 6px; padding: 5px 9px; border: 1px solid rgba(104,180,122,0.4); border-radius: 999px; background: rgba(10,15,13,0.62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); color: #8fe0a4; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; -webkit-appearance: none; appearance: none; animation: gp-led-in 0.18s ease-out; transition: border-color 0.15s, background 0.15s, color 0.15s, opacity 0.15s; }
  /* 视觉不变，把可点区域往外撑 8px：这么小的胶囊直接摸太费劲 */
  #gp-led::before { content: ''; position: absolute; inset: -8px; border-radius: 999px; }
  #gp-led .gp-led-dot { display: none; width: 7px; height: 7px; border-radius: 50%; background: #57e07a; box-shadow: 0 0 6px rgba(87,224,122,0.9), 0 0 12px rgba(87,224,122,0.45); animation: gp-led-pulse 2.4s ease-in-out infinite; }
  /* 只有「有手柄连上」那一档才亮灯 */
  #gp-led.gp-online .gp-led-dot { display: block; }
  #gp-led .gp-led-icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: opacity 0.15s; }
  #gp-led .gp-led-icon circle { fill: currentColor; stroke: none; }
  #gp-led .gp-led-lock { display: none; width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  /* 锁定态：琥珀色 + 小锁，和「拖不动了」这件事对上号 */
  #gp-led.is-locked { border-color: rgba(214,178,104,0.75); background: rgba(34,27,14,0.72); color: #f0d79a; }
  #gp-led.is-locked .gp-led-lock { display: block; }
  /* 触屏键被藏起来时图标暗一档，一眼看出「现在是收着的」 */
  #gp-led.is-off .gp-led-icon { opacity: 0.5; }
  @keyframes gp-led-in { from { opacity: 0; transform: translateY(-3px); } }
  @keyframes gp-led-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
  @media (prefers-reduced-motion: reduce) { #gp-led, #gp-led .gp-led-dot { animation: none; } }
  /*
   * 桌面端没有触屏键要开关，左上角这颗胶囊就只剩一块纯装饰的芯片，直接收掉。
   * 判据用 body.desktop —— gmud.js 里按 isMobile 给 body 挂的类，正好是它的反面；
   * 桌面端接了物理手柄也照常能玩，只是少了那颗状态灯（#gamepad 本来就只有手机端会展开）。
   */
  body.desktop #gp-led { display: none; }
  #npc-menu { position: fixed; inset: 0; background: transparent; display: flex; justify-content: center; align-items: center; z-index: 200; }
  #npc-menu-box { background: #1a1a1a; border: 1px solid #444; border-radius: 8px; padding: 20px 0; min-width: 220px; text-align: center; }
  #npc-menu-title { color: #9fb07a; font: bold 16px Menlo, 'Songti SC', monospace; padding: 0 24px 14px; border-bottom: 1px solid #333; margin-bottom: 6px; }
  #npc-menu-items { list-style: none; }
  #npc-menu-items li { color: #aaa; font: 14px Menlo, 'Songti SC', monospace; padding: 8px 40px; cursor: pointer; user-select: none; }
  #npc-menu-items li.selected { color: #fff; background: #2a3a1a; }
  #npc-view { position: fixed; inset: 0; background: transparent; display: flex; justify-content: center; align-items: center; z-index: 200; }
  /* 默认框高由内容决定：对话、事件、查看、存档/吸气/疗伤这些只有几句话的面板，
     不该都撑成画布那么高、底下留一大片黑。max-height 上限是画布高度（--gmud-canvas-h
     由 gmud.js 的 syncNpcViewBoxSize() 写入，手机端的 zoom 也算进去了），
     内容超了就在 #npc-view-text 里滚，框本身不会再涨。
     max-height:100vh 只是极小窗口下的兜底，正常情况用不到。 */
  #npc-view-box { background: #1a1a1a; border: 1px solid #444; border-radius: 8px; padding: 20px 28px; min-width: 280px; max-width: 420px; text-align: left; position: relative; box-sizing: border-box; display: flex; flex-direction: column; height: auto; max-height: min(var(--gmud-canvas-h, 70vh), 100vh); }
  /* 列表页（拍卖行 / 购买 / 出售 / 仓库 / 强化 / 物品 / 技能）：来回选东西时要翻页滚动，
     框高固定成画布高度，高度不随条目数变化，滚动条位置才稳定、视口不会忽高忽低。 */
  #npc-view.fixed-h #npc-view-box { height: min(var(--gmud-canvas-h, 70vh), 100vh); max-height: 100vh; }
  /* 详情 / 对话正文：一行一个 div，纵向 flex 排开。
     - flex: 0 0 auto 不让行被压缩（容器限高后 flex 子项默认会缩，字会被挤在一起）；
     - min-height 给空行占位，pre-wrap 保住 pad() 对出来的前导空格。
     正文靠 flex:1 + min-height:0 吃满框里剩下的高度，超出的部分在框内滚动。
     position: relative 让行变成子元素的 offsetParent，滚到第 n 行直接读 offsetTop。 */
  #npc-view-text { position: relative; display: flex; flex-direction: column; align-items: stretch; color: #cde; font: 13px/1.6 Menlo, 'Songti SC', monospace; flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: #4b5866 #161616; }
  #npc-view-text .npc-line { flex: 0 0 auto; min-height: 1.6em; white-space: pre-wrap; overflow-wrap: anywhere; }
  /* 查看（player_view）：默认就是按内容撑开，这里只把内边距收窄一档 ——
     每页至少 6 行（6 × 1.6em ≈ 125px）再加上底部页码条，
     20px/28px 的内边距会顶破画布高度，6 行的页面反而挤出滚动条。
     高度由 JS 的 pvBoxLockH 以内联 height 锁住（换页时框不跳）。 */
  #npc-view.pv-page #npc-view-box { padding: 14px 18px; }
  /* 正文高度的地板：6 行（PV_MIN_LINES）。空行是真实存在的 .npc-line，这里再兜一层，
     即使某一刻正文为空，框也不会塌成一条再弹回来。 */
  #npc-view.pv-page #npc-view-text { min-height: 9.6em; }
  /* 页码条：查看页有 6 个分页、靠 ← → 循环切，底部标一下「‹ 3 / 6 ›」 */
  #pv-pager { display: none; flex: 0 0 auto; margin-top: 10px; padding-top: 8px; border-top: 1px solid #333; text-align: center; color: #8896a4; font: 12px/1.5 Menlo, 'Songti SC', monospace; user-select: none; -webkit-user-select: none; }
  #pv-pager .pv-cur { margin: 0 10px; color: #cde; letter-spacing: 1px; }
  #pv-pager .pv-arrow { color: #5d6b78; font-size: 14px; }
  /* 物品 / 技能（手机非原版界面）：左栏分类 + 右栏列表 + 底部描述。
     三块各自滚动：分类再多也不会被条目顶出屏幕，长描述也不会把列表挤没。
     只在 .split-page 下生效，其他页面（对话 / 查看 / 拍卖行…）完全不受影响。 */
  #npc-view.split-page #npc-view-box { width: min(94vw, 520px); max-width: 520px; min-width: 0; padding: 12px 14px; }
  #npc-view.split-page #npc-view-text { display: none; }
  #npc-split { display: none; flex: 1 1 auto; min-height: 0; flex-direction: column; color: #cde; font: 13px/1.6 Menlo, 'Songti SC', monospace; }
  #npc-view.split-page #npc-split { display: flex; }
  #npc-split-main { display: flex; flex: 1 1 auto; min-height: 0; }
  #npc-split-cats { flex: 0 0 auto; width: 5.6em; overflow-y: auto; overflow-x: hidden; padding-right: 8px; border-right: 1px solid #333; scrollbar-width: thin; scrollbar-color: #4b5866 #161616; }
  #npc-split-list { flex: 1 1 auto; min-width: 0; overflow-y: auto; overflow-x: hidden; padding-left: 8px; scrollbar-width: thin; scrollbar-color: #4b5866 #161616; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  /* 底部描述：高度按内容撑开（够大，不需要翻页也不做内部滚动）：
     一段文字自己换行，最多占半框，真遇到超长文才在自身区域里滚。 */
  #npc-split-desc { flex: 0 0 auto; max-height: 50%; margin-top: 8px; padding-top: 7px; border-top: 1px solid #3a3a3a; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: #4b5866 #161616; }
  #npc-split .sp-row { white-space: pre-wrap; overflow-wrap: anywhere; }
  /* 右栏光标行：一块底色比箭头更醒目，滚动时眼睛不用追那一个小三角 */
  #npc-split-list .sp-row.sp-cursor { background: #2a3a1a; border-radius: 3px; }
  #npc-split .sp-row.sp-dim { color: #66707a; }
  /* 左栏当前分类只提亮不加底色，免得和右栏光标抢注意力 */
  #npc-split-cats .sp-row.sp-cursor { background: none; color: #fff; }
  #npc-split-desc .sp-desc-line { color: #9fb0c0; }
  #npc-split::-webkit-scrollbar, #npc-split-cats::-webkit-scrollbar, #npc-split-list::-webkit-scrollbar, #npc-split-desc::-webkit-scrollbar { width: 8px; }
  #npc-split-cats::-webkit-scrollbar-thumb, #npc-split-list::-webkit-scrollbar-thumb, #npc-split-desc::-webkit-scrollbar-thumb { background: #4b5866; border-radius: 4px; }
  /* 查看 NPC 的第二页：本地拼的属性面板（姓名年龄 / 生命内力经验 / 两栏属性武功）。
     .vstat = 两页模式开着；.vstat-page = 当前正停在属性页（此时正文收起、属性面板接管）。
     目标是「一屏放得下」：不放头像、不挂页码条，行距压到最小，尽量不出滚动条。 */
  /* 两页模式开着时（不管当前在哪一页）框宽固定：翻页时宽度不跟着内容跳一下 */
  #npc-view.vstat #npc-view-box { width: min(94vw, 520px); max-width: 520px; min-width: 0; padding: 12px 16px; }
  #npc-view.vstat-page #npc-view-box { width: min(94vw, 520px); max-width: 520px; min-width: 0; padding: 12px 16px; }
  #npc-view.vstat-page #npc-view-text { display: none; }
  /* position: relative 让每行成为 #npc-vstat 的子级 offsetParent —— scrollSplitRow 用
     offsetTop 算滚动位置，不设的话会拿 #npc-view-box 当基准，滚起来会偏。 */
  #npc-vstat { display: none; position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; color: #cde; font: 13px/1.5 Menlo, 'Songti SC', monospace; scrollbar-width: thin; scrollbar-color: #4b5866 #161616; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  #npc-view.vstat-page #npc-vstat { display: block; }
  #npc-vstat .nvs-head { display: flex; flex-wrap: wrap; gap: 0 18px; }
  #npc-vstat .nvs-line { display: flex; flex-wrap: wrap; gap: 0 16px; margin-top: 3px; }
  #npc-vstat .nvs-kv { white-space: nowrap; }
  #npc-vstat .nvs-k { color: #66707a; }
  #npc-vstat .nvs-v { color: #cde; }
  #npc-vstat .nvs-cols { display: flex; gap: 14px; margin-top: 5px; padding-top: 5px; border-top: 1px solid #333; }
  #npc-vstat .nvs-col { flex: 1 1 0; min-width: 0; }
  #npc-vstat .nvs-row { display: flex; align-items: center; gap: 7px; padding: 0 3px; border-radius: 3px; white-space: nowrap; overflow: hidden; }
  /* 可选的武功行：上下键挪到哪行就点亮哪行（默认一行都不亮）。
     名字长的（先天破体无形剑气）允许把等级折到下一行，宁可多一行也不截断。 */
  #npc-vstat .nvs-kf { cursor: pointer; flex-wrap: wrap; }
  #npc-vstat .nvs-kf .nvs-kv { white-space: normal; overflow-wrap: anywhere; }
  #npc-vstat .nvs-kf.nvs-cur { background: #2f3b28; }
  #npc-vstat .nvs-kf.nvs-cur .nvs-v { color: #eaf5e6; }
  #npc-vstat .nvs-lv { color: #8896a4; }
  /* 属性条：底槽 + 填充，长度按同页最大值归一 */
  #npc-vstat .nvs-bar { flex: 1 1 auto; min-width: 24px; height: 7px; background: #262b30; border-radius: 2px; overflow: hidden; }
  #npc-vstat .nvs-bar i { display: block; height: 100%; background: #7f9a63; border-radius: 2px; }
  #npc-vstat::-webkit-scrollbar { width: 8px; }
  #npc-vstat::-webkit-scrollbar-thumb { background: #4b5866; border-radius: 4px; }
  /* 手机端提示条：画在 canvas 上的底部提示会被 #npc-view（z-index 200）挡住，
     所以手机端的 showMsgDialog 改用这条浮在最上层、自动消失的 DOM 提示。 */
  #msg-toast { position: fixed; left: 50%; top: 50%; transform: translateX(-50%); z-index: 300; max-width: 86vw; padding: 10px 16px; background: rgba(26,26,26,0.97); border: 1px solid #444; border-radius: 8px; color: #cde; font: 13px/1.6 Menlo, 'Songti SC', monospace; text-align: center; white-space: pre-wrap; overflow-wrap: anywhere; pointer-events: none; box-shadow: 0 6px 20px rgba(0,0,0,0.55); }
  #msg-toast.show { animation: msg-toast-in 0.12s ease-out; }
  @keyframes msg-toast-in { from { opacity: 0; transform: translate(-50%, 6px); } }
  /* 确认框（DOM 版）：画在 canvas 上的确认框同样会被面板挡住，手机端改由这层浮层显示 */
  #confirm-box { position: fixed; z-index: 250; transform: translateX(-50%); min-width: 220px; max-width: 86vw; padding: 14px 18px; background: rgba(26,26,26,0.98); border: 1px solid #6a7d8d; border-radius: 8px; color: #cde; font: 13px/1.7 Menlo, 'Songti SC', monospace; text-align: left; box-shadow: 0 10px 28px rgba(0,0,0,0.62); pointer-events: none; }
  #confirm-box .cf-line { white-space: pre-wrap; overflow-wrap: anywhere; }
  #confirm-box .cf-hint { margin-top: 10px; padding-top: 8px; border-top: 1px solid #3a3a3a; color: #8896a4; }
  /* 详情浮层（物品 / 拍卖行 / 交易 / 技能 列表里按 → 打开）。
     独立一层，盖在 #npc-view（200）和确认框（250）之上，列出列表里放不下的信息：
     物品是品质星级 / 类型 / 数值效果 / 价钱 / 描述，技能是类型 / 兵器 / 招式 / 描述。 */
  #item-detail { position: fixed; inset: 0; z-index: 260; display: flex; justify-content: center; align-items: center; background: rgba(0,0,0,0.45); }
  /* 高度上限跟拍卖行 / 查看框一个口径：不超过地图画布的高度（--gmud-canvas-h 由
     gmud.js 的 syncNpcViewBoxSize() 写入，手机端的 zoom 也算进去了）；100vh 只是兜底。 */
  #item-detail-box { width: min(88vw, 460px); max-height: min(var(--gmud-canvas-h, 70vh), 100vh); overflow-y: auto; box-sizing: border-box; padding: 16px 20px 10px; background: #1a1a1a; border: 1px solid #444; border-radius: 8px; color: #cde; font: 13px/1.7 Menlo, 'Songti SC', monospace; text-align: left; box-shadow: 0 12px 34px rgba(0,0,0,0.62); scrollbar-width: thin; scrollbar-color: #4b5866 #161616; }
  #item-detail .idt-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid #333; }
  #item-detail .idt-name { font-size: 16px; font-weight: bold; overflow-wrap: anywhere; }
  #item-detail .idt-count { color: #8896a4; font-size: 13px; }
  /* 技能页标题一行说完：Lv.101 太极拳 普普通通 */
  #item-detail .idt-lv { color: #8896a4; font-size: 13px; }
  #item-detail .idt-rank { color: #b8a878; font-size: 13px; }
  #item-detail .idt-equip { color: #9fb07a; font-size: 12px; border: 1px solid #4b5a33; border-radius: 3px; padding: 0 5px; }
  #item-detail .idt-row { display: flex; gap: 10px; margin-top: 5px; }
  #item-detail .idt-label { flex: 0 0 auto; color: #66707a; }
  #item-detail .idt-value { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; letter-spacing: 1px; }
  /* 减益（减闪避 / 减命中）标红，和加成分开看 */
  #item-detail .idt-fx-bad { color: #e0766c; }
  #item-detail .idt-hr { margin: 9px 0 7px; border-top: 1px solid #333; }
  #item-detail .idt-desc { color: #9fb0c0; white-space: pre-wrap; overflow-wrap: anywhere; }
  /* 招式 / 绝招列表：一行一条，招多了在这块里滚，别把整个浮层撑高。
     overscroll-behavior 防止滑到底继续带着外层浮层一起滚。 */
  #item-detail .idt-acts-none { padding: 1px 4px; color: #66707a; }
  #item-detail .idt-act-sec { margin-top: 8px; padding: 0 4px; color: #66707a; }
  #item-detail .idt-act-sec:first-child { margin-top: 0; }
  #item-detail .idt-acts { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #4b5866 #161616; -webkit-overflow-scrolling: touch; }
  /* 有招式列表时浮层改成纵向 flex：框被画布高度卡住时只压招式列表，
     标题 / 属性 / 描述始终留在框内，不会出现「里外两层都在滚」。
     框高仍由内容撑开、只受 max-height 封顶：招式少的时候不会拖一大片空白，
     招式多的时候列表会吃掉除去标题 / 描述之外的全部高度。 */
  #item-detail-box.has-acts { display: flex; flex-direction: column; }
  #item-detail-box.has-acts > * { flex: 0 0 auto; }
  #item-detail-box.has-acts > .idt-acts { flex: 1 1 auto; min-height: 0; }
  #item-detail .idt-act { display: flex; flex-wrap: wrap; gap: 0 8px; padding: 1px 4px; border-radius: 3px; }
  #item-detail .idt-act-cur { background: #2f3b28; }
  #item-detail .idt-act-name { flex: 0 0 auto; color: #cde; }
  #item-detail .idt-act-cur .idt-act-name { color: #eaf5e6; }
  #item-detail .idt-act-fx { flex: 0 1 auto; color: #8896a4; letter-spacing: 0; }
  /* 绝招：名字 + 类型徽标 + 内力消耗一行，效果 / 持续回合换行小字。
     整块算一条，上下键高亮时一起点亮。 */
  #item-detail .idt-jz-main { flex: 1 1 auto; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; min-width: 0; }
  #item-detail .idt-jz-tag { flex: 0 0 auto; color: #b8a878; border: 1px solid #4d4634; border-radius: 3px; padding: 0 4px; font-size: 12px; }
  #item-detail .idt-jz-cost { flex: 0 0 auto; color: #8896a4; }
  #item-detail .idt-jz-note { flex: 1 0 100%; color: #7f8c98; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
  /* 绝招文案一个分句一行。子项的缩进由 alignJzNotes() 实测「上一条标签宽度」后
     写成内联 padding-left；这条 3em 只是量不出宽度时的兜底。 */
  #item-detail .idt-jz-note-line { white-space: pre-wrap; }
  #item-detail .idt-jz-note-child { padding-left: 3em; }
  /* 子项前面挂一条竖线，一眼看出它是上一条的下级（不给内容加字符，复制出来还是原文） */
  #item-detail .idt-jz-note-child::before { content: '└'; margin-left: -1.2em; width: 1.2em; display: inline-block; color: #4b5866; }
  #item-detail .idt-acts::-webkit-scrollbar { width: 8px; }
  #item-detail .idt-acts::-webkit-scrollbar-thumb { background: #4b5866; border-radius: 4px; }
  #item-detail .idt-hint { margin-top: 10px; padding-top: 8px; border-top: 1px solid #333; color: #66707a; text-align: center; font-size: 12px; }
  #item-detail-box::-webkit-scrollbar { width: 8px; }
  #item-detail-box::-webkit-scrollbar-thumb { background: #4b5866; border-radius: 4px; }
  #npc-view-text::-webkit-scrollbar { width: 8px; }
  #npc-view-text::-webkit-scrollbar-track { background: #161616; border-radius: 4px; }
  #npc-view-text::-webkit-scrollbar-thumb { background: #4b5866; border-radius: 4px; }
  #npc-view-text::-webkit-scrollbar-thumb:active { background: #6a7d8d; }
  #pv-canvas { display: none; }
  #npc-view.pv #pv-canvas { display: block; }
  #npc-view.pv #npc-view-box { background: #fff; border: 0; border-radius: 0; width: 604px; height: 300px; max-height: none; padding: 0; min-width: 0; max-width: none; }
  #npc-view.pv #npc-view-text { display: none; }
  #player-menu { position: fixed; inset: 0; background: transparent; display: flex; justify-content: center; align-items: center; z-index: 200; }
  #player-menu-box { background: #1a1a1a; border: 1px solid #444; border-radius: 8px; padding: 20px 0; min-width: 220px; text-align: center; }
  #player-menu-title { color: #9fb07a; font: bold 16px Menlo, 'Songti SC', monospace; padding: 0 24px 14px; border-bottom: 1px solid #333; margin-bottom: 6px; }
  #player-menu-items { list-style: none; }
  #player-menu-items li { color: #aaa; font: 14px Menlo, 'Songti SC', monospace; padding: 8px 40px; cursor: pointer; user-select: none; }
  #player-menu-items li.selected { color: #fff; background: #2a3a1a; }
  #function-menu { position: fixed; inset: 0; background: transparent; display: flex; justify-content: center; align-items: center; z-index: 200; }
  #function-menu-box { background: #1a1a1a; border: 1px solid #444; border-radius: 8px; padding: 20px 0; min-width: 220px; text-align: center; }
  #function-menu-title { color: #9fb07a; font: bold 16px Menlo, 'Songti SC', monospace; padding: 0 24px 14px; border-bottom: 1px solid #333; margin-bottom: 6px; }
  #function-menu-items { list-style: none; }
  #function-menu-items li { color: #aaa; font: 14px Menlo, 'Songti SC', monospace; padding: 8px 40px; cursor: pointer; user-select: none; }
  #function-menu-items li.selected { color: #fff; background: #2a3a1a; }
  #force-menu { position: fixed; inset: 0; background: transparent; display: flex; justify-content: center; align-items: center; z-index: 200; }
  #force-menu-box { background: #1a1a1a; border: 1px solid #444; border-radius: 8px; padding: 20px 0; min-width: 220px; text-align: center; }
  #force-menu-title { color: #9fb07a; font: bold 16px Menlo, 'Songti SC', monospace; padding: 0 24px 14px; border-bottom: 1px solid #333; margin-bottom: 6px; }
  #force-menu-items { list-style: none; }
  #force-menu-items li { color: #aaa; font: 14px Menlo, 'Songti SC', monospace; padding: 8px 40px; cursor: pointer; user-select: none; }
  #force-menu-items li.selected { color: #fff; background: #2a3a1a; }
  #force-overlay { position: fixed; inset: 0; background: transparent; display: flex; justify-content: center; align-items: center; z-index: 200; }
  #force-overlay-box { background: #1a1a1a; border: 1px solid #444; border-radius: 8px; padding: 20px 28px; min-width: 280px; max-width: 420px; text-align: left; }
  #force-overlay-box pre { color: #cde; font: 13px/1.6 Menlo, 'Songti SC', monospace; white-space: pre-wrap; margin: 0; }
  #fight-overlay { position: fixed; inset: 0; background: transparent; display: flex; justify-content: center; align-items: center; z-index: 200; }
  #fight-box { background: #1a1a1a; border: 1px solid #555; border-radius: 8px; padding: 14px 18px; width: 520px; max-height: 90vh; display: flex; flex-direction: column; }
  #fight-rows { display: flex; flex-direction: row; gap: 10px; align-items: stretch; }
  #fight-rows .fcol { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-start; }
  #fight-rows .fcol-mid { flex: 2; }
  #fight-rows .name { color: #9fb07a; font: bold 13px Menlo, 'Songti SC', monospace; margin-bottom: 4px; }
  #fight-rows .name.pname { text-align: left; }
  #fight-rows .name.nname { text-align: right; }
  #fight-rows .bar-wrap { background: #222; border: 1px solid #444; border-radius: 3px; height: 14px; margin: 3px 0; position: relative; overflow: hidden; font: 9px Menlo, 'Songti SC', monospace; line-height: 14px; text-align: center; color: #cde; }
  #fight-rows .bar-wrap .bar-fill { height: 100%; position: absolute; left: 0; top: 0; border-radius: 2px; transition: width .3s; }
  #fight-rows .bar-wrap .hp-fill { background: #7a2a2a; }
  #fight-rows .bar-wrap .fp-fill { background: #2a4a7a; }
  #fight-rows .bar-wrap .bar-label { position: relative; z-index: 1; color: #eee; text-shadow: 1px 1px 1px #000; }
  #fight-rows .bar-row { display: flex; align-items: center; }
  #fight-rows .bar-row .bar-wrap { flex: 1; min-width: 0; }
  /* 中栏：固定 96px，高度不随内容变 —— 绝招 / 药物列表再长也只在框内滚，战斗框高度稳定。
     竖直不留 padding 是有意的：减去 2px 边框后内容区正好 94px = 5 行 × 18.8px，
     每一行的行首都是行高的整数倍，JS 整行对齐滚动后上下边缘都不会露出被切一半的字
     （那种半行看着就像被遮挡）。18.8px 行高本身含约 3px 上下留白，字不会贴边。 */
  #fight-msgs { background: #111; border: 1px solid #333; border-radius: 4px; padding: 0 10px; margin: 6px 0; height: 96px; box-sizing: border-box; overflow-y: auto; font: 13px Menlo, 'Songti SC', monospace; line-height: 18.8px; color: #cde; white-space: pre-wrap; }
  /* 操作行：战斗结束 / 等对手行动时这里会被清空，若不定高整块战斗框会「缩」一下。
     定成一行文字的高度（13px Menlo 一行约 18.5px + 上下 padding 8px ≈ 26.5px），
     空了也占住位置；万一文字折行还能继续变高，不会被裁掉。 */
  #fight-actions { text-align: center; color: #888; font: 13px Menlo, 'Songti SC', monospace; padding: 6px 0 2px; min-height: 27px; box-sizing: border-box; }
  #fight-actions span.hl { color: #9fb07a; }
  #fight-stage { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 22px; background: #e9e0cd; border: 1px solid #c4b696; border-radius: 6px; padding: 8px 10px 4px; margin-bottom: 8px; }
  #fight-stage .sprite-box { position: relative; width: 64px; height: 96px; display: flex; align-items: flex-end; justify-content: center; }
/* PvP 回合倒计时条：平时带 .hidden 整条不显示（非 PvP 时没有内容，白底空条会很显眼） */
#pvp-countdown-mobile { height: 16px; display: flex; justify-content: center; align-items: center; font: 12px SimSun, 'Songti SC', serif; color: #000; background: #fff; border: 1px solid #333; margin: 0 auto 4px; min-width: 24px; max-width: 90%; }
  #fight-stage canvas { image-rendering: pixelated; }
  #fight-vs { color: #b0392b; font: bold 22px Menlo, 'Songti SC', monospace; text-shadow: 0 0 6px rgba(176,57,43,.6); }
  .hidden { display: none !important; }
  #gamepad { position: fixed; inset: 0; pointer-events: none; z-index: 300; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; overscroll-behavior: contain; }
  #gamepad .gp-widget { position: fixed; pointer-events: auto; touch-action: none; transform-origin: center; background: rgba(20,28,20,0.55); border: 1px solid rgba(120,140,120,0.45); border-radius: 24px; padding: 40px; box-shadow: 0 2px 8px rgba(0,0,0,0.35); -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
  /* 锁定后改成实线边框，一眼能看出「现在拖不动了」 */
  #gamepad.gp-locked .gp-widget { border-color: rgba(120,180,130,0.8); box-shadow: 0 2px 8px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(120,180,130,0.25); }
  #gamepad .gp-dpad, #gamepad .gp-ab { display: grid; }
  #gamepad .gp-btn { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-user-drag: none; -webkit-appearance: none; appearance: none; background: rgba(30,40,30,0.72); color: #cde; border: 1px solid #556; border-radius: 24px; font: bold 40px Menlo, 'Songti SC', monospace; padding: 0; }
  #gamepad .gp-btn.gp-active, #gamepad .gp-btn:active { background: #2a4a2a; }
  #gamepad .gp-btn.gp-arrow { background-repeat: no-repeat; background-size: 400% 100%; background-position: var(--gp-arrow-pos) 50%; background-image: var(--gp-arrow-img); color: transparent; }
  #gamepad .gp-btn.gp-arrow.gp-active, #gamepad .gp-btn.gp-arrow:active { background-image: var(--gp-arrow-img-flash); background-color: transparent; }
  #gamepad .gp-dpad { grid-template-columns: repeat(3, 100px); grid-template-rows: repeat(3, 100px); gap: 15px; }
  #gamepad .gp-dpad .gp-up { grid-column: 2; grid-row: 1; }
  #gamepad .gp-dpad .gp-left { grid-column: 1; grid-row: 2; }
  #gamepad .gp-dpad .gp-down { grid-column: 2; grid-row: 3; }
  #gamepad .gp-dpad .gp-right { grid-column: 3; grid-row: 2; }
  #gamepad .gp-ab { grid-template-columns: repeat(2, 140px); grid-template-rows: repeat(2, 140px); gap: 30px; }
#gamepad .gp-ab .gp-a { grid-column: 2; grid-row: 2; background: rgba(42,74,42,0.8); color: #efe; }
#gamepad .gp-ab .gp-b { grid-column: 1; grid-row: 1; background: rgba(74,42,42,0.8); color: #fdd; }
  #captcha-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; justify-content: center; align-items: center; z-index: 400; }
  #captcha-box { background: #fff; border: 2px solid #333; border-radius: 10px; padding: 14px 20px 8px; text-align: center; }
  #captcha-quiz { color: #111; font: 14px Menlo, 'Songti SC', monospace; text-align: left; margin: 2px 0 8px; white-space: pre-line; }
  #captcha-tip { color: #222; font: 13px Menlo, 'Songti SC', monospace; margin: 4px 0 8px; }
  #captcha-pad { display: grid; grid-template-columns: repeat(3, 52px); grid-template-rows: repeat(3, 52px); gap: 6px; justify-content: center; }
  #captcha-pad .cap-btn { background: #f0f0f0; border: 1px solid #999; border-radius: 8px; font-size: 20px; color: #222; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
  #captcha-pad .cap-btn:active { background: #cfe3bc; }
  #captcha-pad .cap-up { grid-column: 2; grid-row: 1; }
  #captcha-pad .cap-left { grid-column: 1; grid-row: 2; }
  #captcha-pad .cap-right { grid-column: 3; grid-row: 2; }
  #captcha-pad .cap-down { grid-column: 2; grid-row: 3; }
  #captcha-count { color: #c33; font: 13px Menlo, 'Songti SC', monospace; margin-top: 6px; height: 16px; }

/* 登录界面：桌面走全画布渲染（gmud.js 画布登录段）；手机端用下面的 DOM 表单
   （真实 input —— 软键盘/浏览器自动填充走原生路径），视觉仿画布原版观感，
   背景仍是画布的随机地图（DOM 层透明，透出 #c）。 */

#lcd-login { position: fixed; inset: 0; z-index: 95; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: 'SimSun', 'Songti SC', 'STSong', serif; }
#lcd-login.hidden { display: none; }
#lcd-login .lcd-title { background: #fff; border: 1px solid #1a1a1a; width: 270px; }
#lcd-login .lcd-banner { background: #1a1a1a; color: #fff; text-align: center; font-size: 17px; padding: 5px 0; letter-spacing: 2px; }
#lcd-login .lcd-sub { text-align: center; color: #1a1a1a; font-size: 14px; padding: 5px 0 6px; }
#lcd-login .lcd-form { background: #fff; border: 1px solid #1a1a1a; width: 270px; margin-top: 6px; padding: 6px 0; }
#lcd-login .lcd-row { display: flex; align-items: center; margin: 4px 10px; }
#lcd-login .lcd-label { color: #1a1a1a; font-size: 14px; width: 4.5em; flex: none; }
#lcd-login .lcd-input { flex: 1; min-width: 0; background: #fff; border: 1px solid #1a1a1a; color: #1a1a1a; font-family: inherit; font-size: 16px; padding: 6px 8px; border-radius: 0; outline: none; }
#lcd-login .lcd-input:focus { background: #1a1a1a; color: #fff; }
#lcd-login .lcd-optval { flex: 1; background: #fff; border: 1px solid #1a1a1a; color: #1a1a1a; font-family: inherit; font-size: 14px; text-align: left; padding: 5px 8px; border-radius: 0; }
/* 建角属性行的 −/+ 按钮与剩余点数 */
#lcd-login .lcd-row .lcd-optval { flex: none; width: 34px; text-align: center; padding: 5px 0; }
#lcd-login .lcd-remain { color: #1a1a1a; font-size: 14px; font-weight: bold; margin-left: 6px; }
#lcd-login .lcd-btn { display: block; width: 100%; background: none; border: none; color: #1a1a1a; font-family: inherit; font-size: 15px; padding: 5px 0; }
#lcd-login .lcd-btn:active { background: #1a1a1a; color: #fff; }
#lcd-login .lcd-notes { color: #1a1a1a; font-size: 12px; margin-top: 8px; text-align: center; line-height: 1.7; padding: 0 10px; }
#lcd-login .lcd-meta { position: absolute; left: 0; right: 0; bottom: 40px; color: #1a1a1a; font-size: 12px; text-align: center; line-height: 1.9; }
#lcd-login .lcd-meta a, #lcd-login .lcd-meta button { color: #1a1a1a; font-family: inherit; font-size: 12px; background: none; border: none; padding: 0; text-decoration: underline; }
#lcd-login .lcd-notice { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); background: #fff; border: 1px solid #1a1a1a; color: #1a1a1a; font-size: 13px; padding: 4px 12px; white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; }
  #lcd-login .lcd-notice.hidden { display: none; }

  /* 桌面登录的隐形输入槽（#gmud-login form 里的真实 input）：
     真实大小叠在画布值框上供浏览器自动填充/保存密码，视觉全透明（字与光标由画布点阵绘制）。
     这套处理照搬 maplemei 的经验：credentials-auto-fill-button 要藏（Chrome 填充时会画钥匙
     图标破坏画面）、-webkit-autofill 的黄底要用超长 transition 冻结、::selection 要透明。 */
  #gmud-login { position: fixed; left: 0; top: 0; width: 1px; height: 1px; border: 0; padding: 0; margin: 0; }
  #gmud-login .gmud-vault-field {
    position: fixed; margin: 0; padding: 0; border: 0; outline: none; border-radius: 0;
    background: transparent; color: transparent; -webkit-text-fill-color: transparent;
    caret-color: transparent; font-size: 16px; line-height: 1.4;
    touch-action: manipulation; -webkit-appearance: none; appearance: none;
    box-shadow: none; overflow: hidden; white-space: nowrap;
    pointer-events: auto; z-index: 2147483000;
  }
  #gmud-login .gmud-vault-field::selection { background: transparent; }
  #gmud-login .gmud-vault-field::-webkit-credentials-auto-fill-button,
  #gmud-login .gmud-vault-field::-webkit-caps-lock-indicator { visibility: hidden; pointer-events: none; }
  #gmud-login .gmud-vault-field:-webkit-autofill,
  #gmud-login .gmud-vault-field:-webkit-autofill:hover,
  #gmud-login .gmud-vault-field:-webkit-autofill:focus {
    transition: background-color 100000s ease-in-out 0s, color 100000s ease-in-out 0s;
    -webkit-text-fill-color: transparent;
  }



