/* ============================================================
 * 战略模式样式 —— 复用 fc.css 皮。作用域全在 #sc-strategic 内。
 * 游戏屏 256×240：地图 256×160 置顶；下方黑区 256×80 = 行①状态 + 行②双栏。
 *   ┌ 地图(160) ────────────────────────────┐
 *   │ 行① 左：提示文案  右：本月 N 令(12px)    │
 *   │ 行② 左：城详情(130px) 右：菜单网格/banner │
 *
 * P3 统一：字号收敛 5 档 —— 9(徽章) / 10(脚注) / 11(详情行) / 12(正文·菜单) / 16(大字·数字)；
 *          颜色全部走 fc.css :root 的 NES 变量（结构色 #222/#333 保留字面值）；
 *          菜单高亮统一为居中反白（menu-2/3/4/5/6 网格同款，含城池六命令 2×3）；
 *          下箭头改纯 CSS 三角 + 复用剧情全局 @keyframes blink；
 *          选中 ▶ 补 blink 闪烁（对齐 fc.css .mi.sel）。
 * ============================================================ */
#sc-strategic {
  background: #000; color: var(--c-white);
  font-family: var(--font-cjk);
  -webkit-font-smoothing: none; font-smoothing: none;
}

/* ---------- 地图区 ---------- */
.st-map { position: absolute; top: 0; left: 0; width: 256px; height: 160px; overflow: hidden; }
.st-mapimg, .st-names { position: absolute; top: 0; left: 0; width: 256px; height: 160px;
  image-rendering: pixelated; image-rendering: crisp-edges; }
.st-names { z-index: 2; pointer-events: none; opacity: 0.94; }
/* 年月框：放进底图左上黑框（x19..93,y18..30），整体左右居中 */
.st-timebar { position: absolute; left: 19px; top: 18px; width: 74px; z-index: 6;
  background: transparent; border: 0; padding: 0; text-align: center;
  color: var(--c-white); height: 12px; line-height: 12px; font-size: 11px;
  white-space: nowrap; pointer-events: auto; cursor: pointer;   /* v2.2.18g：年月框可点=START（原 pointer-events:none 让点击穿透地图） */
  text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000; }
.st-city { position: absolute; image-rendering: pixelated; z-index: 3; }
/* 锁定城闪烁（霸王大陆：城池不停闪烁提示已选中） */
.st-city.flicker { animation: st-flick 0.55s steps(2, start) infinite; z-index: 4; }
/* v2.1.16: 闪烁由「变透明」改为「变白高亮」——grayscale(1) 去色 + brightness(2.5) 提亮,
   保持 FC 霸王大陆式两步像素跳变(steps(2,start))。 */
@keyframes st-flick { 50% { filter: grayscale(1) brightness(2.5); } }
/* 鼠标指针光标：P3 缩为 50%（8×12），贴图顶端尖对准目标点（定位见 renderMap） */
.st-cursor { position: absolute; z-index: 5; image-rendering: pixelated;
  pointer-events: none; width: 8px; height: 12px; }
/* 地图行动画面框（P1：移动/巡查/修筑…） */
.st-fx { position: absolute; z-index: 20; left: 0; top: 0; width: 256px; height: 160px;
  pointer-events: none; }
.fx-box { position: absolute; }
/* 图片版：白底黑边，像素风图片铺满，底部细条说明 */
.fx-img { background: #fff; border: 2px solid #000; outline: 2px solid #fff;
  box-sizing: border-box; }
.fx-img img { width: 100%; height: 100%; image-rendering: pixelated;
  image-rendering: crisp-edges; display: block; }
.fx-img .fx-cap { position: absolute; bottom: 0; left: 0; width: 100%;
  text-align: center; font-size: 10px; line-height: 11px; color: var(--c-white);
  background: rgba(0, 0, 0, 0.55); }
/* 无素材命令的占位文字框 */
.fx-txt { border: 2px solid #fff; background: #000; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center;
  color: var(--c-gold); font-size: 12px; }
/* 开发三件套 · 内政令票卡片 */
.fx-dev { background: #fff; border: 2px solid #000; outline: 2px solid #fff;
  box-sizing: border-box; text-align: center; padding: 8px 4px 0; }
.fx-dev-name { font-size: 16px; color: #000; letter-spacing: 4px; padding-top: 8px; }
/* P3：delta 走 12 正文档并去掉 font-weight:bold —— 剧情模式从不用粗体，
 * 子集字体无 bold 字重，faux bold 在关抗锯齿下会糊成一团 */
.fx-dev-delta { font-size: 12px; margin-top: 10px; white-space: nowrap; }
.fx-dev-delta.long { font-size: 10px; }
.fx-dev-note { position: absolute; bottom: 2px; left: 0; width: 100%;
  font-size: 10px; color: #666; }

/* ---------- 下方黑区 ---------- */
.st-panel { position: absolute; top: 160px; left: 0; width: 256px; height: 80px;
  background: #000; color: var(--c-white); }
/* 行① 状态条：左=文案 / 右=「本月 N 令」 */
.st-top { position: absolute; top: 0; left: 0; width: 256px; height: 12px;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 4px; box-sizing: border-box; font-size: 11px;
  background: linear-gradient(180deg, #1a1a1a, #000);
  border-bottom: 1px solid var(--c-dgray); }
.st-top .left { overflow: hidden; white-space: nowrap; color: var(--c-orange); }
.st-top .right { color: var(--c-white); white-space: nowrap; }
.st-top .right b { color: var(--c-orange); font-weight: normal; }
.st-top .right.zero b { color: var(--c-red); }
/* 行② 双栏 */
.st-body { position: absolute; top: 13px; left: 0; width: 256px; height: 67px; }
.st-info { position: absolute; top: 0; left: 0; width: 130px; height: 67px;
  padding: 2px 3px 0; font-size: 11px; line-height: 11px; box-sizing: border-box;
  border-right: 1px solid var(--c-dgray); overflow: hidden; }
.st-info .ir { height: 11px; line-height: 11px; white-space: nowrap; overflow: hidden; }
/* R4：城池选择提示行放开换行（'·'→'，请' 后自动折行，不裁切） */
.st-info .ir.hint { white-space: normal; line-height: 11px; height: auto; }
.st-info .ir b { color: var(--c-white); font-weight: normal; }
.st-info .ir .k { color: var(--c-dgray); }
.st-info .ir .v { color: var(--c-white); }
.st-info .ir .p { color: var(--c-lgreen); }
.st-info .ir .dim { color: var(--c-dgray); }
/* 右栏：菜单网格 与 大字横幅 叠放 */
.st-side { position: absolute; top: 0; left: 131px; width: 125px; height: 67px; }
/* v2.2.26 ⑤：选中城池、未开菜单时右下黑块显示该城缩略图（FC 霸王大陆同款：开菜单即被命令占掉） */
.st-citypic { position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center; display: none; background: #000; image-rendering: pixelated; }
.st-cmds { position: absolute; inset: 0; display: grid;
  grid-template-columns: 1fr 1fr; padding: 2px; box-sizing: border-box; }
/* P3 统一：网格型菜单（一级 2×2 / 仓库 2×1 / 集市 2×1+整行 / 兵部 2×2+整行 / 城池 2×3）
 * 一律 12px 居中 + 反白高亮，不再画 ▶（对齐剧情模式网格菜单 .k-tab.on 的视觉） */
.st-cmds.menu-2 { grid-auto-rows: 30px; }
.st-cmds.menu-3 { grid-auto-rows: 30px; }
.st-cmds.menu-4 { grid-auto-rows: 30px; }        /* 一级菜单 2×2 */
.st-cmds.menu-5 { grid-auto-rows: 21px; }        /* 兵部 5 项：2×2 + 末行整行 */
.st-cmds.menu-6 { grid-auto-rows: 20px; }        /* 城池六命令 2×3 */
.st-cmds.menu-2 .st-cmd,
.st-cmds.menu-3 .st-cmd,
.st-cmds.menu-4 .st-cmd,
.st-cmds.menu-5 .st-cmd,
.st-cmds.menu-6 .st-cmd { padding-left: 0; text-align: center;
  display: flex; align-items: center; justify-content: center; }   /* 白/黑块内文字上下左右居中 */
.st-cmds.menu-2 .st-cmd.sel::before,
.st-cmds.menu-3 .st-cmd.sel::before,
.st-cmds.menu-4 .st-cmd.sel::before,
.st-cmds.menu-5 .st-cmd.sel::before,
.st-cmds.menu-6 .st-cmd.sel::before { content: ''; }
.st-cmds.menu-2 .st-cmd.sel,
.st-cmds.menu-3 .st-cmd.sel,
.st-cmds.menu-4 .st-cmd.sel,
.st-cmds.menu-5 .st-cmd.sel,
.st-cmds.menu-6 .st-cmd.sel { background: var(--c-white); color: var(--c-black); }
.st-cmds.menu-2 .st-cmd.dim.sel,
.st-cmds.menu-3 .st-cmd.dim.sel,
.st-cmds.menu-4 .st-cmd.dim.sel,
.st-cmds.menu-5 .st-cmd.dim.sel,
.st-cmds.menu-6 .st-cmd.dim.sel { background: transparent; }
/* 集市/兵部 末行占整行 */
.st-cmds.menu-3 .st-cmd:nth-child(3),
.st-cmds.menu-5 .st-cmd:nth-child(5) { grid-column: 1 / span 2; }
/* v2.1.50：兵部七命令（menu-7）此前无对应规则 → 回退到通用 .st-cmd.sel（只有 ▶ 无白块）。
 * 这里补齐白底黑字 + 箭头清空 + 第 7 项整行横跨，视觉与城池 menu-6 一致。 */
.st-cmds.menu-7 { grid-auto-rows: 15px; }        /* 7 项=4 行，15px×4+padding 恰好塞进 67px 黑区 */
.st-cmds.menu-7 .st-cmd { padding-left: 0; text-align: center;
  display: flex; align-items: center; justify-content: center; }
.st-cmds.menu-7 .st-cmd.sel::before { content: ''; }
.st-cmds.menu-7 .st-cmd.sel { background: var(--c-white); color: var(--c-black); }
.st-cmds.menu-7 .st-cmd.dim.sel { background: transparent; }
.st-cmds.menu-7 .st-cmd:nth-child(7) { grid-column: 1 / span 2; }
/* v2.2.21：情报画面右栏只有一项「部将」（menu-1）——此前无对应规则，会落进通用 2 列网格只占左半格。
 * 这里改成单列整宽 + 单行 30px，白底黑字高亮与 menu-2/6 同款。 */
.st-cmds.menu-1 { grid-template-columns: 1fr; grid-auto-rows: 30px; }
.st-cmds.menu-1 .st-cmd { padding-left: 0; text-align: center;
  display: flex; align-items: center; justify-content: center; }
.st-cmds.menu-1 .st-cmd.sel::before { content: ''; }
.st-cmds.menu-1 .st-cmd.sel { background: var(--c-white); color: var(--c-black); }
.st-cmds.menu-1 .st-cmd.dim.sel { background: transparent; }

/* v2.2.21：情报画面（#sc-strategic.intel-mode）把行②左右栏重新分配——左栏 130→150px，
 * 右栏 125→104px。理由：情报要显示 11 项军情（含「人口 9.6万」这类较长的万级数字），
 * 实测 130px 列宽下含万值的 3 字段行会到 137px 被挤出；而右栏此时只有「部将」一个按钮，104px 足够。
 * ⚠ 仅在本画面生效，内政/兵部/仓库/集市的 130+125 布局一字不动。 */
#sc-strategic.intel-mode .st-info { width: 150px; }
#sc-strategic.intel-mode .st-side { left: 151px; width: 104px; }

/* v2.2.21：情报 · 部将全屏武将信息框容器。
 * 内层 .bpk-* 视觉直接复用 fc.css（与战斗部将窗同款版面），此处只定义容器几何——
 * 覆盖整个 256×240 游戏内框，层级高于战略全屏弹层(z40)。 */
#st-peek { position: absolute; top: 0; left: 0; width: 256px; height: 240px;
  background: #000; border: 2px solid var(--c-white); box-sizing: border-box;
  z-index: 60; padding: 4px 5px 3px; color: #fff; display: flex; flex-direction: column; }
/* 必须显式压过上面的 display:flex（id 选择器权重高于 .hidden 类），否则关不掉 */
#st-peek.hidden { display: none; }
.st-cmd { position: relative; overflow: hidden; white-space: nowrap;
  font-size: 12px; line-height: 1; padding-left: 10px; }
.st-cmd .cn { display: block; margin-top: 7px; }
.st-cmd.sel { color: var(--c-white); }
.st-cmd.sel::before { content: '▶'; position: absolute; left: 1px; top: 1px;
  color: var(--c-white); animation: blink .6s steps(2,end) infinite; }
.st-cmd.dim { color: #555; }
.st-cmd.dim.sel::before { content: ''; }
.st-cmd.ok { color: var(--c-white); }
/* 大字横幅：覆盖整个黑区中间（行①保留），居中大字 + 其下箭头（P3 改纵向排布） */
/* R4：结果大字 16px→13px、letter-spacing→1px，补 line-height 让折行舒展、不挤边 */
.st-banner { position: absolute; top: 13px; left: 0; width: 256px; height: 67px;
  z-index: 12; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; font-size: 13px; letter-spacing: 1px;
  line-height: 15px; padding: 0 6px; box-sizing: border-box;
  color: var(--c-white); background: #000; }
/* 向下的闪烁箭头：P3 改纯 CSS 三角（对齐剧情 .scroll-hint，不依赖字体，▼ 不在字体子集）。
 * 复用 fc.css 全局 @keyframes blink（1s steps(2,end)）。定位由使用处内联控制。 */
.st-down { width: 0; height: 0; margin: 6px auto 0;
  border-left: 4.9px solid transparent; border-right: 4.9px solid transparent;
  border-top: 6.3px solid var(--c-white);
  animation: blink 1s steps(2,end) infinite; }
/* 文字版闪烁提示（AI 过场「按 A 跳过」等，非箭头场景） */
.st-down-txt { width: 100%; text-align: center; font-size: 10px; color: var(--c-dgray); }
.st-blink { animation: blink 1s steps(2,end) infinite; }

/* ---------- 全屏层（开始/君主/简况/对话/转场） ----------
 * P3：.st-dialog 同时挂 fc.css 的 .win（2px 白边 + 8 点切角），与剧情模式同窗框语言。
 * 黑区 .st-panel 不加框 —— 它是地图的延伸。 */
.st-dialog { position: absolute; top: 0; left: 0; width: 256px; height: 240px;
  background: #000; z-index: 40; box-sizing: border-box;
  font-size: 12px; line-height: 13px; padding: 4px 6px; overflow: hidden;
  color: var(--c-white); }
.st-dialog .dlg-inner { position: relative; width: 100%; height: 100%; }
/* 通用行/组标题 */
.st-row { position: relative; height: 13px; line-height: 13px; padding-left: 14px;
  white-space: nowrap; overflow: hidden; }
/* v2.1.41：横幅内「居中行」——抵消 st-row 的 padding-left:14px。
 * .st-banner 是 flex+align-items:center，行按内容宽收缩后居中；
 * 行内再留 14px 左内边距 → 文字整体右偏 7px。加 .ctr 归零即真居中。 */
.st-row.ctr { padding-left: 0; }
.st-row.sel::before { content: '▶'; position: absolute; left: 1px;
  color: var(--c-white); animation: blink .6s steps(2,end) infinite; }
.st-row.sel { color: var(--c-white); }
.st-row.dim { color: #555; }
/* 商店「等级不足」的灰显锁定：物品大表走 renderFull 的 genpick 分支中「无 cells → 纯文本行」
   （strategic.js 的 openItemsPick），渲染成 .st-row.locked——不是 .st-listrow（那是武将六列行）。 */
.st-row.locked { color: #555; opacity: .55; }
/* v2.1.29 第⑫条 · 战局情报：年月灰字分隔 / 事件白字 / 阵营小图标 / 滚动条 */
.st-row.ym-sep { color: var(--c-dgray); font-size: 9px; padding-left: 8px; letter-spacing: 0; }
.st-row.ev { color: var(--c-white); font-size: 9px; padding-left: 8px; white-space: nowrap; overflow: hidden; }
.st-row.ev .st-ic-s { width: 9px; height: 7px; vertical-align: -1px; image-rendering: pixelated; margin: 0 1px; }
.st-scroll { position: absolute; top: 16px; bottom: 14px; right: 1px; width: 4px;
  background: rgba(0, 0, 0, .5); border-radius: 2px; }
.st-scrollbar { position: absolute; left: 0; width: 4px; background: var(--c-gold); border-radius: 2px; }
.st-row.locked .k { color: #444; }
.st-row.head { color: var(--c-orange); border-bottom: 1px solid var(--c-dgray);
  margin-bottom: 2px; padding-bottom: 1px; padding-left: 0; height: 14px; }
.st-row .k { color: var(--c-dgray); }
.st-row b { color: var(--c-white); font-weight: normal; }
.st-row .loy-hi { color: var(--c-gold); }
/* v2.2.15 需求④：集市购买翻页行 —— 把「（←→翻页）」拆成两个可点按钮，
 * 鼠标/手指直接点 ← / → 翻页（键盘 ←→ 仍可用）。 */
.st-row.st-pager { display: flex; align-items: center; justify-content: center; gap: 10px;
  padding-left: 0; height: 15px; line-height: 15px; }
.st-row.st-pager .k { color: var(--c-dgray); }
.st-pager .pgbtn { cursor: pointer; min-width: 22px; height: 13px; line-height: 13px;
  text-align: center; color: var(--c-yellow, #fc8); border: 1px solid var(--c-dgray);
  border-radius: 2px; user-select: none; }
.st-pager .pgbtn:hover, .st-pager .pgbtn:active { background: var(--c-dblue); color: var(--c-white);
  border-color: var(--c-white); }
/* 中央大字块（对话/结果展示） */
.st-center { position: absolute; left: 0; right: 0; top: 96px; text-align: center; }
/* R4：全屏 msg 大字同步 16px→13px、line-height 提到 16px，仍左右居中 */
.st-center .big { font-size: 13px; color: var(--c-white); letter-spacing: 1px; line-height: 16px; }
.st-center .sub { font-size: 11px; color: var(--c-dgray); margin-top: 6px; }
/* 底部按键提示 */
.st-foot { position: absolute; bottom: 2px; left: 0; width: 100%;
  text-align: center; font-size: 10px; color: var(--c-dgray); }
/* v2.2.14 战局情报：正文改为 absolute 定高滚动容器——底边停在 .st-foot 上方留 5px 安全距离，
 * 16 行军情不再压到「↑↓翻看 A/B关闭」提示字；滚动条走全站 3px 暗灰条（fc.css ::-webkit-scrollbar）。 */
.st-realm-body { position: absolute; top: 18px; left: 0; right: 2px; bottom: 20px;
  overflow-y: auto; padding-right: 2px; }
/* v2.1.28 第⑩条：菜单框最下方独立说明小字（非可选项）。
 * absolute 定位在 st-foot 正上方（bottom:14px 起步），不撑开 dlg-inner 流式高度，
 * 避免与 foot(absolute bottom:2px) 视觉重叠。 */
/* v2.1.35 #4：开局「手动存档」提示改为两行大号居中（原单行 9px 小字，易被忽略）。
 * 仅战略模式开始界面使用，不影响其它。 */
/* v2.1.41：left 由 6px 改 0 —— 本元素 absolute 于 .dlg-inner（已从 x=6 起），
 * 再 +6px 会让「手动存档」两行整体右偏 6px（.st-foot 用 left:0 故正常）。 */
.st-note { position: absolute; bottom: 16px; left: 0; width: 244px;
  text-align: center; font-size: 11px; line-height: 15px; font-weight: bold; color: var(--c-dgray); }
/* v2.1.54：策略菜单选中项简短介绍——底部固定条（与 .st-note 同基线 bottom:16px，但二者不会同时出现：
 * taskStrat 行带 desc 时不带 note）。文字用 --c-white 保证可读性，上边框用 --c-dgray 与脚注同色系。 */
.st-desc { position: absolute; bottom: 16px; left: 0; width: 244px;
  text-align: center; font-size: 10px; line-height: 14px; color: var(--c-white);
  border-top: 1px solid var(--c-dgray); padding-top: 3px; }
/* v2.1.51：仓库 → 战利品 展示界面：列表可滚动，详情固定于底部（纯展示，无买卖/赏赐） */
.st-loot-list { max-height: 150px; overflow-y: auto; }
/* v2.1.53：list / genpick 长列表滚动容器（与 .st-loot-list 同思路；表头/foot 固定在容器外）。
 * max-height 预留 head + foot 空间，padding-bottom 让末行不被底部 foot 提示遮挡。 */
.st-list-scroll { position: relative; max-height: 200px; overflow-y: auto; padding-bottom: 12px; }
.st-loot-detail { position: absolute; bottom: 16px; left: 0; width: 244px; border-top: 1px solid var(--c-dgray); padding-top: 3px; }
.st-loot-detail .ld-name { color: var(--c-white); font-size: 11px; }
.st-loot-detail .ld-desc { color: var(--c-dgray); font-size: 10px; line-height: 13px; white-space: normal; }
/* 全屏列表（武将选择/君主选择/在野/物品）共用版式 */
/* R4：genpick 头部「兵/武/智/忠/德/经」抽成表头列；c0=名(固定宽, 左对齐) + c1=级(固定宽, 居中) + c2~c7 六数据列(flex:1 居中),
 *     数据列与表头列左右居中对齐（名字与数据各自居中）。 */
/* v2.1.17 列几何（需求：级靠拢名、级/兵/武等距、武列不动）：
 * 行宽 244px（256−12）。c0=46(名,3字33+padding10) c1=26(级) c2=54(兵,吸收位移,9999/9999 十px 可全显)
 * c3=26(武) c4..c7=23(flex:1)。c1 与 c3 同宽 ⇒ 级中心→兵中心 = 兵中心→武中心 恒等距(13+W2/2)。
 * 武列起点 72+54=126 ≈ 原 125.67，右移 0.33px 可忽略。 */
.st-listhead { color: var(--c-dgray); font-size: 10px; height: 12px; line-height: 12px;
  border-bottom: 1px solid #222; display: flex; }
.st-listhead .c0 { width: 46px; padding-left: 10px; flex: none; text-align: left; }
.st-listhead .c1 { width: 26px; flex: none; text-align: center; }
.st-listhead .c2 { width: 54px; flex: none; text-align: center; }
.st-listhead .c3 { width: 26px; flex: none; text-align: center; }
.st-listhead span { flex: 1; overflow: hidden; text-align: center; }
.st-listrow { display: flex; height: 13px; line-height: 13px; font-size: 11px;
  white-space: nowrap; }
.st-listrow .c0 { width: 46px; padding-left: 10px; position: relative; overflow: hidden; flex: none; }
.st-listrow .c0::before { content: '▶'; position: absolute; left: 1px; display: none; }
.st-listrow.sel .c0::before { display: block; }
.st-listrow.sel .c0 { color: var(--c-white); }
.st-listrow.lord .c0::after { content: '君'; position: absolute; right: 0;
  color: var(--c-gold); font-size: 9px; }
.st-listrow.gray, .st-listrow.dim { color: #555; }
.st-listrow .c1 { width: 26px; flex: none; text-align: center; }
.st-listrow .c2 { width: 54px; flex: none; text-align: center; }
.st-listrow .c3 { width: 26px; flex: none; text-align: center; }
.st-listrow .c4, .st-listrow .c5,
.st-listrow .c6, .st-listrow .c7 { flex: 1; text-align: center; }
/* v2.1.16: 武将表头/数据超长(army/cap ≥7 字符,如 9999/9999)时整表缩字号到 10px;
数据列 overflow:hidden 裁切而不重叠——即使 10px 仍装不下,绝不侵入邻列。 */
.st-listhead.compact, .st-listrow.compact { font-size: 10px; }
.st-listrow .c2, .st-listrow .c3, .st-listrow .c4,
.st-listrow .c5, .st-listrow .c6, .st-listrow .c7 { overflow: hidden; }
/* 询问条（是/否） */
.st-yesno { display: flex; justify-content: center; margin-top: 12px; font-size: 12px; }
.st-yesno .yn { width: 44px; text-align: center; position: relative; color: var(--c-dgray); }
.st-yesno .yn.sel { color: var(--c-white); }
.st-yesno .yn.sel::before { content: '▶'; position: absolute; left: 2px;
  animation: blink .6s steps(2,end) infinite; }
.st-hidden { display: none !important; }

/* ============ P2：NumEdit / 征兵分配 / 部将卡 ============ */
.ne-row { text-align:center; margin-top:16px; letter-spacing:3px; }
.ne-d { display:inline-block; width:16px; font-size:16px; color:var(--c-white);
  border-bottom:2px solid transparent; }
.ne-d.on { color:var(--c-gold); border-bottom:2px solid var(--c-gold);
  animation:ne-blink .5s steps(1) infinite; }
.ne-d.lock { color:var(--c-dgray); }
@keyframes ne-blink { 50% { opacity: .25; } }
.ne-unit { color:var(--c-gray); font-size:11px; margin-top:4px; }
.spy-body { text-align:center; padding-top:22px; }
.spy-name { font-size:16px; color:var(--c-white); letter-spacing:2px; }
.spy-meta { font-size:11px; color:var(--c-gray); margin-top:4px; }
.spy-stats { font-size:12px; margin-top:6px; }

/* ============ P3：装备界面（左槽右仓 双栏） ============ */
.eq2-wrap { display: flex; gap: 6px; padding: 6px 8px 0; height: 178px; box-sizing: border-box; }
.eq2-col { flex: 1; border: 1px solid #333; background: #000; padding: 4px; overflow-y: auto; }   /* v2.2.14：hidden→auto，装备多时不再被裁且可滚 */
.eq2-col.eq2-wh { flex: 2; }
.eq2-row { height: 15px; line-height: 15px; font-size: 11px; white-space: nowrap;
  color: var(--c-gray); overflow: hidden; }
.eq2-row .v { color: var(--c-gold); }
.eq2-row.rare .v, .eq2-row.rare { color: var(--c-rare); }
.eq2-row.sel { background: var(--c-white); color: var(--c-black); }
.eq2-row.sel .k, .eq2-row.sel .v, .eq2-row.sel .rare { color: var(--c-black); }

/* ============ R3：虚拟手柄 — SELECT/START 仅战略模式显示 ============
 * 规则写在 strategic.css（全局加载且位于 fc.css 之后），不触碰公共文件。
 * 默认隐藏 .pb-fc（主菜单/剧情/神兵不显示这两个键）；body.st-pad-on 时仅战略场景显示。
 * 分方向布局（见下方媒体查询）：
 *   方向键/AB 两方向均恢复剧情/主菜单原始比例（原始 --zoom，不封顶）；
 *   横版(landscape)：SELECT/START 移到 A/B 正下方（距两个 B 键直径），上下竖排，自身在 ZC=min(--zoom,1.3) 处封顶（防放大重叠）；
 *   竖版(portrait) ：SELECT/START 屏幕水平居中、上下竖排（仅改位置），SELECT 上移/START 下移避让方向键与 B 键，自身仍在 ZC 处封顶。
 * 含块说明：.pad-ab(fc.css) 带 transform:translateY(-50%)，会使其内部 fixed 元素以 .pad-ab 为包含块。
 *           竖版据此用 right:calc(50vw - gap-r - pbw/2) 把键心钉在 50vw（水平居中），top:50% 取 .pad-ab 垂直中心（与 dpad/AB 同高）；
 *           不移除 .pad-ab 的 transform（移除反而需硬编码半高，跨主题/粗指针易错）。 */
#pad .pb-fc { display: none; }
body.st-pad-on #pad .pb-fc { display: flex;
  /* 原战略外观(R4) + 1.3 封顶(防放大重叠)；仅改位置、不改样式（两方向共用） */
  width:  calc(44px * min(var(--zoom), 1.3) * min(var(--scale), 1));
  height: calc(22px * min(var(--zoom), 1.3) * min(var(--scale), 1));
  margin: 0; border-radius: 4px; line-height: 1; letter-spacing: 0; white-space: nowrap;
  justify-content: center; align-items: center; padding: 0; top: 50%;
  font-size: calc(9px * min(var(--zoom), 1.3) * min(var(--scale), 1));
}
/* 方向键/AB：恢复剧情/主菜单比例（原始 --zoom），不封顶；
 * 删除原战略私有尺寸/字号覆盖，使其继承 fc.css 基础（34/40px·zoom），与剧情/主菜单一致。 */

/* ---------- 横版：SELECT/START 移到 A/B 正下方（距两个 B 键直径），上下竖排（外观走 BASE）；
 * 且左缘与 B 键「最左边缘」对齐（用户 2026-09-16 指令：整体和 B 键最左边缘左对齐） ---------- */
@media (orientation: landscape) {
  body.st-pad-on #pad .pb-fc {
    position: absolute;                                   /* 脱离 .pad-ab flex 流，A/B 不受影响 */
    /* 移到 AB 正下方：top:100% = .pad-ab 盒底；+72px·ZC·SC = 两个 B 键直径(B 直径=40px×0.9=36px，36×2=72)。
       1.3 封顶保留（用户要求：防放大重叠）。
       水平：左缘对齐 B 键左缘——B 是 .pad-ab 首个在流子元素（SELECT/START 横版已 absolute 脱流），
       其左缘 = 容器内容左 + B 自身 margin-left（粗指针 html.coarse .pb-r 有 margin-left:12px、精细指针无）；
       故 left 取 0 / 12px 并去掉原 translateX(-50%) 的水平居中。 */
    top: calc(100% + 72px * min(var(--zoom), 1.3) * min(var(--scale), 1));
    left: 0;
    right: auto;
    transform: translateY(-50%);                          /* 仅保留垂直半高对齐，水平不再居中 */
  }
  html.coarse body.st-pad-on #pad .pb-fc { left: 12px; }  /* 粗指针：B 带 margin-left:12px，左缘随之后移 */
  body.st-pad-on #pad .pb-fc[data-key='select'] { transform: translateY(calc(-50% - 15px * min(var(--zoom), 1.3) * min(var(--scale), 1))); }
  body.st-pad-on #pad .pb-fc[data-key='start']  { transform: translateY(calc(-50% + 15px * min(var(--zoom), 1.3) * min(var(--scale), 1))); }
}

/* ---------- 竖版：SELECT/START 屏幕水平居中、上下竖排（外观同 BASE，含 1.3 封顶），并避让方向键/AB ----------
 * 手柄不在 #fc-screen 内（不吃它的 scale 变换），但 .pb-fc 是 fixed，而 .pad-ab 带 transform:translateY(-50%)，
 * 于是 .pad-ab 成了 fixed 的含块 —— top 是「相对 .pad-ab 的 padding box 顶部」，vh 也救不了（实测：含块顶部 550px，
 * top:30vh=253px → SELECT 落在 803px、START 落在 1141px，后者直接飞出 844px 视口）。
 * 所以偏移量必须用「按键尺寸」表达、相对手柄带计算：
 *   .pad-ab 与 .pad-dir 的中心都在 --handle-y 上，故 方向键上/下缘 相对含块顶部 = ∓(dirH/2) + abH/2。
 *   dirH = 3×方向键边长（3×3 十字），abH = B 键直径。
 * 这样无论 fit() 把 --handle-y 算到哪、屏幕多高，SELECT/START 都稳定贴在方向键的上/下缘外侧。 */
body.st-pad-on #pad {
  --st-pbw: calc(30.6px * var(--zoom) * min(var(--scale), 1));          /* 方向键边长 = 34px×0.9 */
  --st-pbr: calc(36px * var(--zoom) * min(var(--scale), 1));            /* B 键直径  = 40px×0.9 */
  --st-fcw: calc(44px * min(var(--zoom), 1.3) * min(var(--scale), 1));  /* SELECT/START 宽（1.3 封顶） */
  --st-fch: calc(22px * min(var(--zoom), 1.3) * min(var(--scale), 1));  /* SELECT/START 高（1.3 封顶） */
  --st-gap: calc(14px * var(--zoom) * min(var(--scale), 1));            /* 与方向键上下缘的安全间隙 */
}
html.coarse body.st-pad-on #pad {                                       /* 粗指针：52/64px ×0.9 */
  --st-pbw: calc(46.8px * var(--zoom) * min(var(--scale), 1));
  --st-pbr: calc(57.6px * var(--zoom) * min(var(--scale), 1));
}
@media (orientation: portrait) {
  body.st-pad-on #pad .pb-fc {
    position: fixed;
    right: calc(50vw - var(--gap-r) - var(--st-fcw) / 2);   /* 键心钉在 50vw：左右居中于屏幕 */
    top: 50%;
  }
  /* v2.2.18c：竖版 SELECT/START 间距对齐横版——横版两键各以 translateY(∓15px·ZC·SC) 从共同基准错开，
   * 中心距 = 30px·ZC·SC（ZC=min(--zoom,1.3)、SC=min(--scale,1)）。竖版照搬同一错开量：
   *   中心(.pad-ab 垂直中心 = 含块顶 + abH/2) ∓ 15px·ZC·SC → top = abH/2 − fch/2 ∓ 15px·ZC·SC（abH = --st-pbr）
   * 横向仍钉 50vw 不动。 */
  body.st-pad-on #pad .pb-fc[data-key='select'] {
    top: calc(var(--st-pbr) * 0.5 - var(--st-fch) * 0.5 - 15px * min(var(--zoom), 1.3) * min(var(--scale), 1));
    transform: none;
  }
  body.st-pad-on #pad .pb-fc[data-key='start'] {
    top: calc(var(--st-pbr) * 0.5 - var(--st-fch) * 0.5 + 15px * min(var(--zoom), 1.3) * min(var(--scale), 1));
    transform: none;
  }
}

/* ===== v2.1.14 选君主界面 ===== */
/* 阵营列表：单/双列网格（>7 个势力自动双列） */
/* 阵营列表:v2.1.16 高度弹性扩展填满 head 与 bottom card 之间可用空间——
   calc(100% - 80px) 相对 .dlg-inner 高 232px,扣除 head 行 + card 区后约 152px,
   双列 11~15 势力约 6~8 行全可见;溢出保留 overflow-y:auto 兜底。 */
.st-lord-grid { display: grid; grid-template-columns: 1fr; gap: 1px;
  margin-bottom: 0; max-height: calc(100% - 80px); overflow-y: auto; }
.st-lord-grid[data-cols="2"] { grid-template-columns: 1fr 1fr; }
.st-lord-row { padding: 1px 14px; height: 13px; line-height: 13px;
  font-size: 11px; position: relative; cursor: pointer; }
.st-lord-row.sel { color: var(--c-white); }
.st-lord-row.sel::before { content: '▶'; position: absolute; left: 1px;
  color: var(--c-white); animation: blink .6s steps(2,end) infinite; }
/* 底部固定君主简况卡（带头像）——v2.1.15 absolute 向下磁吸底部按键提示行;
   v2.1.16: padding 去掉右 8 使 head 行 border-bottom 延伸到与上方分割线同右缘;
   .st-lord-info 内 .st-row padding-left:0 使数据行与「君主·XXX」左对齐。 */
.st-lord-card { position: absolute; left: 0; right: 0; bottom: 18px;
  display: flex; padding: 4px 0 4px 8px; background: rgba(0,0,0,0.55);
  border-top: 1px solid var(--c-dgray); align-items: center; }
.st-lord-face { width: 32px; height: 32px; object-fit: contain;
  margin-right: 8px; image-rendering: pixelated; flex: none; }
.st-lord-info { flex: 1; min-width: 0; }
.st-lord-info .st-row { padding-left: 0; }  /* v2.1.16: 数据行左对齐到「君主·XXX」 */
