/* =====================================================================
   形胜三国 · 界面样式 v2（漆木底 · 青铜边 · 朱漆标签格）
   全部界面只用下面这组变量与组件：
     窗口（青铜斜面边 + 回纹角饰）· 标题栏 .wh / .mtitle（朱印 + 标题 + 右侧附注）
     标签格 .kv（朱漆标签 + 凹陷数值框，进度只有一种青铜条）· 按钮（常态 / 主按钮 / 选中 / 禁用）· 表格 .otable
   字号只有 4 档（12 / 14 / 17 / 22）+ 展示字 30；次要文字用实色 --tx2，不用透明度
   毛笔字（--f-brush）只用于标题画面字标与开场 / 终局 CG、战法 Cut-in
   ===================================================================== */
:root {
  --lq0: #0e0a07; --lq1: #1b130d; --lq2: #281c13; --lq3: #36271b;          /* 漆木底 */
  --br0: #3a2914; --br1: #7a5c31; --br2: #b8954f; --br3: #e6cc8c;          /* 青铜边 */
  --ver0: #5a1a10; --ver1: #8a2b1c; --ver2: #b0432b;                        /* 朱漆 */
  --tx: #ece2c8; --tx2: #a39374; --txd: #6d6150; --num: #eed08a; --hi: #ffe7a8;
  --good: #9cc97a; --bad: #de7a62;
  --s1: 12px; --s2: 14px; --s3: 17px; --s4: 22px; --s5: 30px;
  --f-body: "Noto Serif SC", "Source Han Serif SC", "Microsoft YaHei", serif;
  --f-title: var(--f-body);
  --f-brush: "Ma Shan Zheng", "STXingkai", serif;
  --pat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36'%3E%3Cpath d='M4 32V4h28v22H12V12h12v6' fill='none' stroke='rgba(230,204,140,0.03)' stroke-width='2'/%3E%3C/svg%3E");
  --cn-tl: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M2 22V2h20' fill='none' stroke='%23e6cc8c' stroke-width='2.6'/%3E%3Cpath d='M7 18V7h11v6h-5v-3' fill='none' stroke='%23b8954f' stroke-width='1.8'/%3E%3C/svg%3E");
  --cn-tr: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M22 22V2H2' fill='none' stroke='%23e6cc8c' stroke-width='2.6'/%3E%3Cpath d='M17 18V7H6v6h5v-3' fill='none' stroke='%23b8954f' stroke-width='1.8'/%3E%3C/svg%3E");
  --cn-bl: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M2 2v20h20' fill='none' stroke='%23e6cc8c' stroke-width='2.6'/%3E%3Cpath d='M7 6v11h11v-6h-5v3' fill='none' stroke='%23b8954f' stroke-width='1.8'/%3E%3C/svg%3E");
  --cn-br: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M22 2v20H2' fill='none' stroke='%23e6cc8c' stroke-width='2.6'/%3E%3Cpath d='M17 6v11H6v-6h5v3' fill='none' stroke='%23b8954f' stroke-width='1.8'/%3E%3C/svg%3E");
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0h10L5 6z' fill='%23b8954f'/%3E%3C/svg%3E");
  /* 旧变量名（战场 HUD、剧本页等仍在引用）→ 新色板 */
  --gold: var(--br3); --gold-dim: var(--br1); --ink: var(--lq1); --panel: rgba(27, 19, 13, .94); --paper: var(--tx);
  --muted: var(--tx2); --val: var(--tx); --line: rgba(122, 92, 49, .35); --well: var(--lq0);
  /* 界面缩放：JS 按窗口大小设定（菜单中可手动调整），地图本身不缩放 */
  --ui: 1;
}
/* 英文：正文 Noto Serif（拉丁字形），毛笔字换 Cinzel 罗马大写体；残余中文（印章字等）落到思源宋体 */
:root[data-lang=en] {
  --f-body: "Noto Serif", "Noto Serif SC", "Microsoft YaHei", serif;
  --f-brush: "Cinzel", "Noto Serif", "Ma Shan Zheng", serif;
}
/* 繁体：思源宋体换繁体版；马善政毛笔字只有简体字形，缺字由霞鹜文楷补 */
:root[data-lang=hant] {
  --f-body: "Noto Serif TC", "Noto Serif SC", "Source Han Serif TC", "Microsoft JhengHei", serif;
  --f-brush: "Ma Shan Zheng", "LXGW WenKai TC", "STXingkai", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0e0a07; color: var(--tx); text-wrap: pretty;   /* 避免段末孤字 */
  font-family: var(--f-body); font-weight: 500; -webkit-font-smoothing: antialiased; user-select: none; }
.hide { display: none !important; }
button { font-family: inherit; }
.hint { font-size: var(--s1); color: var(--tx2); }
small { font-size: var(--s1); color: var(--tx2); }
b { font-weight: 700; }
.bad { color: var(--bad); }
#strategy b, .otable td, .kv .v, .le span { font-variant-numeric: tabular-nums lining-nums; }
:where(#strategy, #modal, #sysm, #scensel, #scene) * { scrollbar-width: thin; scrollbar-color: var(--br1) var(--lq0); }
/* 复选框、滑条：统一漆木青铜样式，不用浏览器原生外观 */
input[type=checkbox] { -webkit-appearance: none; appearance: none; flex: none; width: 16px; height: 16px; margin: 0 6px 0 0; vertical-align: -3px; cursor: pointer; position: relative;
  background: var(--lq0); border: 1px solid #000; box-shadow: inset 0 0 0 1px var(--br1), inset 0 2px 3px rgba(0, 0, 0, .6); }
input[type=checkbox]:hover { box-shadow: inset 0 0 0 1px var(--br2), inset 0 2px 3px rgba(0, 0, 0, .6); }
input[type=checkbox]:checked { background: linear-gradient(180deg, var(--ver2), var(--ver1)); box-shadow: inset 0 0 0 1px #c8784a; }
input[type=checkbox]:checked::after { content: ''; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px; border: solid #fbecc8; border-width: 0 2px 2px 0; transform: rotate(45deg); }
input[type=checkbox]:disabled { opacity: .4; cursor: default; }
input[type=radio] { accent-color: var(--br2); }
input[type=range]:not(#wFoodR, #mkR) { -webkit-appearance: none; appearance: none; height: 18px; margin: 0; background: none; cursor: pointer; vertical-align: middle; }
input[type=range]:not(#wFoodR, #mkR)::-webkit-slider-runnable-track { height: 6px; border: 1px solid #000; background: var(--lq0); box-shadow: inset 0 0 0 1px var(--br0); }
input[type=range]:not(#wFoodR, #mkR)::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 18px; margin-top: -7px; background: linear-gradient(180deg, var(--hi), var(--br2)); border: 1px solid #000; }

/* ============================ 组件 ============================ */
/* 窗口：青铜斜面边框 + 内细线 + 回纹四角；滚动放在窗口内部的容器上，窗口本身不滚动（否则角饰被裁掉） */
.win, .mbox, #cmdbar, #sside, #slog, .scwin, .ss-desc, .sysm-panel, .tmenu {
  background: var(--pat), linear-gradient(180deg, var(--lq2), var(--lq1) 70%);
  border: 3px solid transparent; border-image: linear-gradient(180deg, var(--br3), var(--br1) 40%, var(--br0)) 1;
  box-shadow: 0 0 0 1px #000, 0 14px 36px rgba(0, 0, 0, .6); }
.win::after, .mbox::after, #cmdbar::after, #sside::after, #slog::after, .scwin::after, .ss-desc::after, .sysm-panel::after, .tmenu::after {
  content: ''; position: absolute; inset: 2px; border: 1px solid rgba(230, 204, 140, .14); pointer-events: none; }
.win::before, .mbox::before, #cmdbar::before, #sside::before, #slog::before, .scwin::before, .ss-desc::before, .sysm-panel::before, .tmenu::before {
  content: ''; position: absolute; inset: -6px; z-index: 3; pointer-events: none;
  background: var(--cn-tl) left top / 24px no-repeat, var(--cn-tr) right top / 24px no-repeat, var(--cn-bl) left bottom / 24px no-repeat, var(--cn-br) right bottom / 24px no-repeat; }
.win, .mbox, .scwin, .ss-desc, .sysm-panel { position: relative; }

/* 标题栏：朱印 + 标题 + 右侧附注 */
.wh, .mtitle { position: relative; flex: none; height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 12px; min-width: 0;
  background: linear-gradient(180deg, var(--lq3), var(--lq2)); border-bottom: 1px solid var(--br1); box-shadow: 0 1px 0 #000; }
.wh h2, .mtitle h2 { margin: 0; min-width: 0; font-size: var(--s3); font-weight: 700; letter-spacing: 4px; color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wh .aside { margin-left: auto; min-width: 0; color: var(--tx2); font-size: var(--s1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wh .aside.bad { color: var(--bad); }
.mtitle { cursor: move; user-select: none; touch-action: none; }
.mtitle.drag { cursor: grabbing; }
.mtitle .msub { margin-left: 10px; font-size: var(--s1); font-weight: 500; letter-spacing: 0; color: var(--tx2); }
.seal { flex: none; width: 24px; height: 24px; display: inline-grid; place-items: center; font-style: normal; font-size: var(--s1); font-weight: 900; line-height: 1; letter-spacing: 0;
  color: #f6e3bc; background: linear-gradient(180deg, var(--ver2), var(--ver1)); border: 1px solid #000; box-shadow: inset 0 0 0 1px rgba(255, 210, 160, .25); text-shadow: none; }
.seal.fl { color: #fff; background: var(--fc); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); text-shadow: 0 1px 1px rgba(0, 0, 0, .6); }
.seal.fl.ink-dark { color: #1e160c; text-shadow: none; }
/* 小节标题 */
.sec, .osec { display: flex; align-items: center; gap: 8px; margin: 12px 0 6px; color: var(--br3); font-size: var(--s2); font-weight: 700; letter-spacing: 2px; white-space: nowrap; }
.sec::after, .osec::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--br1), transparent); }
.sec small, .osec small { font-weight: 500; letter-spacing: 0; }

/* 标签格：朱漆标签 + 凹陷数值框 */
.kv { display: grid; grid-template-columns: 52px minmax(0, 1fr); height: 26px; min-width: 0; }
.kv > .k { display: grid; place-items: center; font-size: var(--s2); color: #f3e3c0; letter-spacing: 2px; white-space: nowrap; overflow: hidden;
  background: linear-gradient(180deg, var(--ver2), var(--ver1) 55%, var(--ver0)); border: 1px solid #000; border-right: 0; }
.kv > .v { position: relative; display: flex; align-items: center; justify-content: flex-end; gap: 4px; padding: 0 8px; min-width: 0; overflow: hidden;
  background: var(--lq0); border: 1px solid #000; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .7), 0 1px 0 rgba(230, 204, 140, .12);
  color: var(--num); font-weight: 700; white-space: nowrap; }
.kv > .v.t { justify-content: flex-start; color: var(--tx); font-weight: 500; }
.kv > .v.bad { color: var(--bad); }
.kv > .v > span { position: relative; z-index: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.kv > .v i { font-style: normal; font-weight: 500; font-size: var(--s1); color: var(--tx2); margin-left: 4px; }
.kv > .v.bar::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: calc(100% * var(--p, 0));
  background: linear-gradient(90deg, rgba(122, 92, 49, .12), rgba(184, 149, 79, .4)); }
.kvs { display: grid; gap: 4px; min-width: 0; align-content: start; }
.kvs.c2 { grid-template-columns: 1fr 1fr; gap: 4px 8px; }
.kvs.c3 { grid-template-columns: repeat(3, 1fr); gap: 4px 6px; }
.kvs.c3 .kv { grid-template-columns: 46px minmax(0, 1fr); }

/* 按钮：常态 / 悬停 / 按下 / 主按钮（朱漆）/ 选中（朱漆）/ 禁用；作用域内所有按钮默认同一外观 */
:where(#title-screen, #scensel, #strategy, #modal, #scene, #sysm, .audiopop) button {
  padding: 4px 14px; font: inherit; font-size: var(--s2); color: var(--tx); letter-spacing: 1px; cursor: pointer; white-space: nowrap;
  background: linear-gradient(180deg, var(--lq3), var(--lq2)); border: 1px solid #000; border-radius: 0;
  box-shadow: inset 0 1px 0 rgba(255, 230, 170, .16), inset 0 0 0 1px var(--br1); }
:where(#title-screen, #scensel, #strategy, #modal, #scene, #sysm, .audiopop) button:hover:not(:disabled) { color: #fff4d8; box-shadow: inset 0 1px 0 rgba(255, 230, 170, .22), inset 0 0 0 1px var(--br2); }
:where(#title-screen, #scensel, #strategy, #modal, #scene, #sysm, .audiopop) button:active:not(:disabled) { background: var(--lq1); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .7), inset 0 0 0 1px var(--br1); }
:where(#title-screen, #scensel, #strategy, #modal, #scene, #sysm, .audiopop) button:disabled { color: var(--txd); box-shadow: inset 0 0 0 1px var(--br0); cursor: default; }
:where(#title-screen, #scensel, #strategy, #modal, #scene, #sysm, .audiopop) :is(button.primary, button.on) {
  color: #fbecc8; background: linear-gradient(180deg, var(--ver2), var(--ver1) 60%, var(--ver0)); box-shadow: inset 0 1px 0 rgba(255, 210, 160, .3), inset 0 0 0 1px #c8784a; }
:where(#title-screen, #scensel, #strategy, #modal, #scene, #sysm, .audiopop) :is(button.primary, button.on):hover:not(:disabled) { box-shadow: inset 0 1px 0 rgba(255, 210, 160, .4), inset 0 0 0 1px #e0a070; }
:where(#title-screen, #scensel, #strategy, #modal, #scene, #sysm, .audiopop) button.danger { color: #f6d8c8; background: linear-gradient(180deg, #5a1810, #300a06); }
/* 禁用优先于朱漆/危险色：主按钮禁用后也要一眼看出不可点 */
:where(#title-screen, #scensel, #strategy, #modal, #scene, #sysm, .audiopop) :is(button.primary, button.danger):disabled {
  color: var(--txd); background: linear-gradient(180deg, var(--lq3), var(--lq2)); box-shadow: inset 0 0 0 1px var(--br0); filter: grayscale(.6); opacity: .6; }
.mini-btn { height: 22px; padding: 0 8px !important; font-size: var(--s1) !important; margin-left: 6px; }
.mini-btn.danger { color: var(--bad) !important; }
/* 势力表外交按钮：固定三格，平时收起、悬停行显示（避免满屏同样按钮） */
.otable td.dip { white-space: nowrap; }
.otable td.dip .mini-btn { opacity: 0; transition: opacity .12s; }
.otable tr:hover td.dip .mini-btn, .otable td.dip .mini-btn:focus-visible { opacity: 1; }
.otable td.dip .mini-btn:disabled { visibility: hidden; }
/* 出征规则：默认只露一行摘要，点开看细则 */
.wrules { margin-top: 8px; font-size: var(--s1); color: var(--tx2); }
.wrules summary { cursor: pointer; list-style: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wrules summary::-webkit-details-marker { display: none; }
.wrules summary::before { content: '▸'; display: inline-block; width: 14px; color: var(--br2); }
.wrules[open] summary::before { content: '▾'; }
.wrules .hint { margin: 4px 0 0 14px; }

/* 头像：界面一律用 192px 平滑头像（assets/portraits/hd），外框青铜 */
.por, .porS, .porL { display: inline-block; object-fit: cover; vertical-align: middle; background: var(--lq0); image-rendering: auto; }
.porS { width: 28px; height: 28px; border: 1px solid var(--br1); outline: 1px solid #000; }
.porL, .cpor, .sc-por, .fcard .por, .ofp-por { border: 2px solid var(--br2); outline: 1px solid #000; box-shadow: inset 0 0 0 1px #000, 0 2px 6px rgba(0, 0, 0, .6); }
.porL { width: 96px; height: 96px; flex: none; }

/* 表格：表头次要色小字，行高固定，高值亮金；点击表头排序 */
.otable { width: 100%; border-collapse: collapse; font-size: var(--s2); }
.otable th { height: 26px; padding: 0 5px; font-size: var(--s1); font-weight: 500; color: var(--tx2); text-align: center; white-space: nowrap;
  border-bottom: 1px solid var(--br1); cursor: pointer; user-select: none; }
.otable th:empty { cursor: default; }
.otable th:not(:empty):hover { color: var(--hi); }
.otable th[data-arrow]::after { content: attr(data-arrow); font-size: 9px; margin-left: 1px; color: var(--hi); }
.otable td { height: 32px; padding: 0 5px; text-align: center; white-space: nowrap; border-bottom: 1px solid rgba(122, 92, 49, .22); }
.otable td.on { text-align: left; font-weight: 700; letter-spacing: 1px; color: var(--tx); }
.otable td.hl { color: var(--hi); font-weight: 700; }
.otable td.tn { color: var(--tx); }
.otable td.ib { color: var(--good); }
.otable td.small { font-size: var(--s1); }
.otable tr[data-o], .otable tr.pick, .otable tr.fo, .otable tr[data-f] { cursor: pointer; }
.otable tr[data-o]:hover td, .otable tr.pick:hover td, .otable tr.fo:hover td, .otable tr[data-f]:hover td { background: rgba(230, 204, 140, .07); }
.otable tr.done, .otable tr.off, .otable tr.dis { opacity: .45; }
.otable tr.pick.dis { cursor: default; }
.otable tr.tsec td { height: 34px; padding: 10px 0 3px; text-align: left; color: var(--br3); font-weight: 700; letter-spacing: 2px; border-bottom: 1px solid var(--br1); }
.otable td.fo-act { text-align: right; color: var(--tx2); }
.otable td.fo-act .mini-btn { margin-left: 0; }
.otable td.ty { width: 28px; }
.otable td.fm { white-space: nowrap; }
.otable td.fm b { display: inline-block; min-width: 3ch; text-align: right; font-weight: 500; color: var(--tx); }
.otable td.fm small { display: inline-block; width: 5em; margin-left: 6px; text-align: left; }
.rlist { height: calc(58vh / var(--ui)); overflow-y: auto; }
/* 登用名单：定宽列（切换页签列宽不变），姓名 / 身份左对齐，色块对齐成一列 */
.rtable { table-layout: fixed; }
.rtable th.l, .rtable td.who { text-align: left; }
.rtable td.who { overflow: hidden; text-overflow: ellipsis; }
.rtable tr.rempty td { height: 120px; white-space: normal; color: var(--tx2); font-size: var(--s1); border-bottom: 0; }
.rtools { display: flex; gap: 6px; margin-left: auto; }
.rtools select { margin-left: 0 !important; }
.rnote > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rnote { margin-top: 6px; line-height: 1.7; }
.rlist .otable th, .pc-list .otable th, .al-list .otable th, .bz-list .otable th, .itlist .otable th { position: sticky; top: 0; z-index: 1; background: var(--lq1); }
/* 小徽记：君 / 师 / 守 / 毕 / 伤 */
.crown, .dn, .el, .inj { display: inline-block; font-style: normal; font-size: var(--s1); line-height: 16px; height: 16px; padding: 0 3px; margin-left: 3px; vertical-align: 1px; font-weight: 500; letter-spacing: 0; }
.crown { color: #f6e3bc; background: var(--ver1); }
.crown.adv-i, .crown.gov-i { color: var(--br3); background: var(--lq3); box-shadow: inset 0 0 0 1px var(--br1); }
.dn { color: var(--tx2); background: #2e2820; }
.el { color: #ffe; background: var(--ver1); }
.inj { color: #ffd0c0; background: #5a1810; }
.dot { display: inline-block; width: 10px; height: 10px; margin-right: 5px; vertical-align: middle; border: 1px solid #000; }
.tag, .tg, .chip, .ctag { display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 20px; padding: 0 6px; font-style: normal; font-size: var(--s1); font-weight: 500; white-space: nowrap; vertical-align: middle;
  color: var(--br3); background: var(--lq3); border: 1px solid #000; box-shadow: inset 0 0 0 1px var(--br1); }
.odds { font-size: var(--s1); white-space: nowrap; } .odds.hi { color: var(--good); } .odds.mid { color: var(--num); } .odds.lo { color: var(--bad); }
.rk, .rt { color: var(--num); }
.rk { font-weight: 700; }

/* 输入框与下拉：凹陷框，下拉箭头青铜色 */
:where(#modal, #sysm, #strategy) :is(select, input[type=number], input[type=text]) { height: 28px; padding: 0 8px; font: inherit; font-size: var(--s2); color: var(--tx);
  background-color: var(--lq0); border: 1px solid #000; border-radius: 0; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .7), inset 0 0 0 1px var(--br0), 0 1px 0 rgba(230, 204, 140, .12); outline: none; }
:where(#modal, #sysm, #strategy) select { appearance: none; -webkit-appearance: none; padding-right: 26px; cursor: pointer; background-image: var(--arrow); background-repeat: no-repeat; background-position: right 9px center; }
:where(#modal, #sysm, #strategy) :is(select, input):focus { box-shadow: inset 0 2px 3px rgba(0, 0, 0, .7), inset 0 0 0 1px var(--br2); }
select option { background: var(--lq1); color: var(--tx); }
select option:disabled { color: var(--txd); }

/* ============================ 标题画面 ============================ */
/* 玄黑漆地朱红纹（汉代云纹瓦当 + 柿蒂纹 + 菱格，少数描金；assets/ui/brocade.svg 由 tools/ui/brocade.py 生成）上：金字标、双线副题、青铜框竖排菜单。全部静止，不做动效 */
/* 字标与副题随页面立即显示；菜单与语言按钮（内容由 showTitle() 填写）在 .boot 期间隐藏，就绪后一起淡入。面板顶端固定，菜单增减按钮只向下伸展，字标不动 */
#title-screen { position: fixed; inset: 0; display: flex; align-items: flex-start; justify-content: center; }
.tmenu, #tlang { animation: tIn .35s ease-out; }
#title-screen.boot .tmenu { visibility: hidden; animation: none; }
@keyframes tIn { from { opacity: 0; } to { opacity: 1; } }
.tbg { position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 75% at 50% 46%, transparent 35%, rgba(0, 0, 0, .85) 100%),
    radial-gradient(ellipse 42% 32% at 50% 30%, rgba(150, 50, 30, .2), transparent 72%),
    radial-gradient(ellipse 44% 62% at 50% 42%, rgba(12, 8, 6, .96) 0%, rgba(12, 8, 6, .88) 50%, rgba(12, 8, 6, .5) 78%, transparent 100%),   /* 中央压暗：纹样退为四周边饰，不与字标、菜单争抢 */
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .016) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .09) 0 1px, transparent 1px 3px),
    url("assets/ui/brocade.svg") center / 480px,
    linear-gradient(180deg, #1a110c, #0b0705); }
.tpanel { position: relative; display: flex; flex-direction: column; align-items: center; width: 560px; margin-top: max(24px, 15vh); }
.title { font-family: var(--f-brush); font-size: 116px; line-height: 1.2; text-align: center; letter-spacing: 18px; text-indent: 18px; white-space: nowrap;
  color: var(--br3); background: linear-gradient(180deg, #fff3cf 10%, var(--br3) 42%, var(--br2) 74%, #8a6630); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 0 #1a1208) drop-shadow(0 0 30px rgba(230, 190, 110, .18)); }
.subtitle { display: flex; align-items: center; gap: 16px; width: 100%; margin-top: 2px; font-size: var(--s2); letter-spacing: 6px; color: var(--tx2); white-space: nowrap; }
.subtitle::before, .subtitle::after { content: ''; flex: 1; height: 5px; border-top: 1px solid var(--br1); border-bottom: 1px solid var(--br0); }
.subtitle::before { border-image: linear-gradient(90deg, transparent, var(--br2)) 1; }
.subtitle::after { border-image: linear-gradient(90deg, var(--br2), transparent) 1; }
.tmenu { position: relative; display: flex; flex-direction: column; gap: 10px; width: 340px; margin-top: 44px; padding: 24px 26px; box-sizing: border-box; }
.tmenu > * { position: relative; display: block; box-sizing: border-box; width: 100%; height: 44px; line-height: 42px; padding: 0 30px !important;
  font-size: var(--s3); letter-spacing: 8px; text-indent: 8px; text-align: center; text-decoration: none; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmenu > a { color: var(--tx); background: linear-gradient(180deg, var(--lq3), var(--lq2)); border: 1px solid #000; box-shadow: inset 0 1px 0 rgba(255, 230, 170, .16), inset 0 0 0 1px var(--br1); }
.tmenu > a:hover { color: #fff4d8; box-shadow: inset 0 1px 0 rgba(255, 230, 170, .22), inset 0 0 0 1px var(--br2); }
.tmenu > .primary { height: 54px; line-height: 52px; font-size: var(--s4); font-weight: 900; letter-spacing: 14px; text-indent: 14px; margin-bottom: 4px; }
#autoLoadBtn { font-size: var(--s2); letter-spacing: 1px; text-indent: 0; }
.tmenu > *::before, .tmenu > *::after { content: '◆'; position: absolute; top: 50%; margin-top: -7px; font-size: 10px; line-height: 14px; text-indent: 0; letter-spacing: 0; color: var(--br3); opacity: 0; transition: opacity .12s; }
.tmenu > *::before { left: 14px; } .tmenu > *::after { right: 14px; }
.tmenu > :hover:not(:disabled)::before, .tmenu > :hover:not(:disabled)::after { opacity: 1; }
.tmenu > :disabled { cursor: default; }
#tlang { position: absolute; top: 18px; right: 22px; }
#tlang .langsw { margin: 0; }
.credits { display: grid; gap: 14px; padding: 18px 8px 10px; min-width: 300px; }
.credits > div { display: flex; align-items: baseline; justify-content: center; gap: 28px; }
.credits span { width: 4em; text-align: right; color: var(--tx2); letter-spacing: 4px; }
.credits b { width: 9em; font-family: Cinzel, serif; font-weight: 700; letter-spacing: 2px; white-space: nowrap; }

/* ============================ 选择势力 ============================ */
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.fcard { height: 214px; padding: 12px 10px 10px; text-align: center; cursor: pointer; background: rgba(14, 10, 7, .6); border: 1px solid #000;
  box-shadow: inset 0 3px 0 var(--fc), inset 0 0 0 1px var(--br0); }
.fcard:hover { background: rgba(230, 204, 140, .06); box-shadow: inset 0 3px 0 var(--fc), inset 0 0 0 1px var(--br2); }
.fcard .por { width: 88px; height: 88px; }
.fname2 { margin-top: 8px; font-size: var(--s3); font-weight: 700; letter-spacing: 3px; color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fmeta { font-size: var(--s1); color: var(--num); }
.ftip { height: 36px; margin-top: 4px; font-size: var(--s1); line-height: 18px; color: var(--tx2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ============================ 战略主界面 ============================ */
/* 大地图铺满，其上浮动窗口：顶栏 · 右上城市窗 · 右下战报 · 左下指令 · 下方军师 */
#strategy { position: fixed; inset: 0; display: grid; grid-template-columns: 1fr; grid-template-rows: calc(48px * var(--ui)) 1fr; }
#stop, #sside, #slog, #cmdbar, #stoasts, #warcap, .mbox { zoom: var(--ui); }

/* 顶栏：日期牌 · 季节印 · 势力旗 · 标签格（空间不足时先截断标签格）· 按钮 */
#stop { grid-row: 1; position: relative; z-index: 6; display: flex; align-items: center; gap: 6px; padding: 0 10px; min-width: 0;
  background: var(--pat), linear-gradient(180deg, var(--lq3), var(--lq1)); border-bottom: 2px solid var(--br1); box-shadow: 0 1px 0 #000, 0 6px 18px rgba(0, 0, 0, .5); }
#sdate { flex: none; display: flex; align-items: center; gap: 6px; }
#sdate .date { width: 108px; text-align: center; height: 30px; padding: 0 2px; line-height: 28px; font-size: var(--s4); font-weight: 900; color: var(--hi); white-space: nowrap;
  background: var(--lq0); border: 1px solid #000; box-shadow: inset 0 0 0 1px var(--br1); }
#sdate .date small { font-size: var(--s2); font-weight: 500; margin: 0 2px; }
#sfaction { flex: none; display: flex; align-items: center; gap: 8px; height: 30px; width: 150px; padding: 0 8px 0 0; cursor: pointer; white-space: nowrap;
  font-weight: 700; letter-spacing: 2px; color: var(--tx); background: var(--lq0); border: 1px solid #000; box-shadow: inset 0 0 0 1px var(--br1); }
#sfaction:hover { box-shadow: inset 0 0 0 1px var(--br2); }
#sfaction span { overflow: hidden; text-overflow: ellipsis; }
#sfaction .sf-t { margin-right: 5px; font-size: var(--s1); font-weight: 700; letter-spacing: 1px; color: var(--br3); }
#sfaction .sf-emb { flex: none; width: 26px; height: 28px; display: grid; place-items: center; font-style: normal; font-weight: 900; letter-spacing: 0;
  color: #fff; background: var(--fc); border-right: 1px solid #000; text-shadow: 0 1px 1px rgba(0, 0, 0, .6); }
#sfaction.ink-dark .sf-emb { color: #1e160c; text-shadow: none; }
#sres { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 3px; overflow: hidden; }
#sres .res { flex: none; height: 30px; grid-template-columns: auto auto; }
#sres .res .k { padding: 0 4px; letter-spacing: 1px; }
#sres .res .v { min-width: 0; gap: 0; padding: 0 4px; }
/* 布局稳定：各格数值区定宽（按最大可能值留足），数值与回合变化时整排不平移 */
#sres .res { grid-template-columns: auto var(--vw, 64px); }
#sres .fame { --vw: 48px; } #sres .ord { --vw: 52px; } #sres .r-city { --vw: 31px; } #sres .r-off { --vw: 39px; }
#sres .r-troop { --vw: 62px; } #sres .r-gold { --vw: 101px; } #sres .r-food { --vw: 101px; } #sres .r-horse { --vw: 53px; }
:root.ui-roomy #sres .fame { --vw: 110px; } :root.ui-roomy #sres .ord { --vw: 160px; }
/* 英文：数值写作 40K / 1.2M，数值区更窄；爵位前缀过长，只在悬停说明中给出 */
:root[data-lang=en] #sres .fame { --vw: 40px; } :root[data-lang=en] #sres .ord { --vw: 42px; } :root[data-lang=en] #sres .r-city { --vw: 26px; } :root[data-lang=en] #sres .r-off { --vw: 34px; }
:root[data-lang=en] #sres .r-troop { --vw: 46px; } :root[data-lang=en] #sres .r-gold { --vw: 82px; } :root[data-lang=en] #sres .r-food { --vw: 82px; } :root[data-lang=en] #sres .r-horse { --vw: 36px; }
:root.ui-roomy[data-lang=en] #sres .fame { --vw: 120px; } :root.ui-roomy[data-lang=en] #sres .ord { --vw: 130px; }
:root[data-lang=en] #sfaction .sf-t { display: none; }
#sres .res b { color: var(--num); }
#sres .res i { margin-left: 3px; }
#sres .res i.bad, #sres .res.ord.none b { color: var(--bad); }
#sres .res em { margin-left: 6px; font-style: normal; font-weight: 500; font-size: var(--s1); color: var(--br3); }
.pips { display: inline-flex; gap: 2px; margin-left: 6px; }
.pips i { width: 6px; height: 12px; margin: 0 !important; background: var(--br0); border: 1px solid #000; }
.pips i.on { background: linear-gradient(180deg, var(--hi), var(--br2)); }
/* 窄屏：声望称号、指令书刻度收起，保证金 / 粮 / 马完整可见。按缩放后的等效宽度判断（ui-roomy 由 ui.js 设定），
   不能用 @media 视口宽度：窗口最大化但未全屏时视口宽而矮，--ui 按高度放大，等效宽度其实只有 1440 左右 */
:root:not(.ui-roomy) #sres .res em, :root:not(.ui-roomy) #sres .res .pips { display: none; }
@media (max-width: 1360px) { #sres .res .k { letter-spacing: 0; padding: 0 5px; } #sres .res .v { padding: 0 5px; } }
.sbtns { flex: none; display: flex; gap: 5px; margin-left: auto; }
.sbtns button { height: 32px; padding: 0 10px !important; letter-spacing: 1px !important; }
#endTurnBtn { width: 112px; padding: 0 !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* 「群雄行动中…」不撑宽，右侧按钮不左移 */
#endTurnBtn { font-weight: 700; letter-spacing: 3px !important; }
/* 委任中：地图顶部常驻提示条，带「亲政」按钮（群雄交战字幕出现时让到字幕下方） */
#delegatebar { position: absolute; left: 50%; top: 6px; transform: translateX(-50%); z-index: 5; display: flex; align-items: center; gap: 10px; height: 30px; white-space: nowrap; padding: 0 4px 0 14px;
  font-size: var(--s1); color: var(--tx); background: rgba(20, 14, 8, 0.86); border: 1px solid var(--br2); opacity: 0; pointer-events: none; transition: opacity 0.3s, top 0.3s; }
#delegatebar.on { opacity: 1; pointer-events: auto; }
#delegatebar button { height: 24px; padding: 0 10px !important; }
body:has(#warcap.on) #delegatebar { top: 54px; }
body:has(#delegatebar.on) #maphint { opacity: 0; }

/* 大地图 */
#smap { grid-row: 2; position: relative; overflow: hidden; background: #0b0f12; }
#map3d { position: absolute; inset: 0; }
#map3d canvas { display: block; }
#mlabels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
#maphint { position: absolute; left: 50%; top: 6px; transform: translateX(-50%); white-space: nowrap; font-size: var(--s1); color: var(--tx); pointer-events: none;
  padding: 3px 14px; background: rgba(14, 10, 7, .82); border: 1px solid var(--br0); z-index: 3; transition: opacity .6s; }
#maphint.gone, body:has(#warcap.on) #maphint { opacity: 0; }
/* 城市名牌：势力旗（方块 + 君主姓）+ 漆木名牌；己方金边、同盟绿边、选中亮金 */
.mlabel { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: auto; cursor: pointer; text-align: center; white-space: nowrap; }
.ml-plate { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 7px 0 0; background: rgba(18, 12, 8, .88); border: 1px solid #000;
  box-shadow: inset 0 0 0 1px rgba(184, 149, 79, .4), 0 2px 6px rgba(0, 0, 0, .55); }
.ml-emb { flex: none; width: 22px; height: 22px; display: grid; place-items: center; font-size: var(--s1); font-weight: 900; color: #fff; background: var(--fc);
  border-right: 1px solid #000; text-shadow: 0 1px 1px rgba(0, 0, 0, .6); }
.ml-plate b { font-size: var(--s2); font-weight: 700; color: var(--tx); letter-spacing: 1px; }
.ml-plate img { width: 20px; height: 20px; object-fit: cover; border: 1px solid #000; }
.ml-plate small { font-size: var(--s1); color: var(--tx2); margin-left: -2px; }
.mlabel.ink-dark .ml-emb { color: #1e160c; text-shadow: none; }
.mlabel.r-me .ml-plate { box-shadow: inset 0 0 0 1px var(--br3), 0 0 8px rgba(230, 204, 140, .3), 0 2px 6px rgba(0, 0, 0, .55); }
.mlabel.r-me .ml-plate b { color: var(--hi); }
.mlabel.r-ally .ml-plate { box-shadow: inset 0 0 0 1px rgba(156, 201, 122, .7), 0 2px 6px rgba(0, 0, 0, .55); }
.mlabel:hover .ml-plate { box-shadow: inset 0 0 0 1px var(--br3), 0 2px 6px rgba(0, 0, 0, .55); }
.mlabel.sel .ml-plate { box-shadow: inset 0 0 0 1px var(--hi), 0 0 12px rgba(255, 231, 168, .6); }
.ml-sub { display: table; margin: 2px auto 0; padding: 0 5px; font-size: var(--s1); line-height: 16px; color: var(--tx); background: rgba(18, 12, 8, .72); }   /* 暗底：雪地、浅滩上也看得清 */
.mlabel.far .ml-sub, .mlabel.far .ml-plate img { display: none; }
.ml-tag { display: inline-block; font-style: normal; font-size: var(--s1); line-height: 14px; padding: 0 2px; margin-left: 3px; }
.ml-tag.gold { background: var(--br3); color: #1a1206; } .ml-tag.bad { background: var(--ver1); color: #ffe; }
/* 行军部队标签 */
.march-tag { position: absolute; left: 0; top: 0; transform-origin: 0 0; text-align: center; white-space: nowrap; pointer-events: none; z-index: 3; }
.march-tag .ml-plate { padding-left: 4px; box-shadow: inset 3px 0 0 var(--fc), inset 0 0 0 1px var(--hi), 0 2px 8px rgba(0, 0, 0, .6); }
/* 群雄交战：顶部战报字幕（定宽定高、单行省略）与城头战果名牌 */
#warcap { position: absolute; left: 50%; top: 12px; width: 560px; height: 34px; margin-left: -280px; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 0 14px;
  background: linear-gradient(90deg, rgba(14, 10, 6, 0), rgba(27, 19, 13, .94) 12%, rgba(27, 19, 13, .94) 88%, rgba(14, 10, 6, 0));
  border-top: 1px solid var(--br1); border-bottom: 1px solid var(--br1); pointer-events: none; opacity: 0; transform: translateY(-6px); transition: opacity .35s ease, transform .35s ease; }
#warcap.on { opacity: 1; transform: none; }
#warcap .wc-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: var(--s2); color: var(--tx); text-align: center; }
#warcap .wc-t b { margin-right: 2px; }
#warcap .wc-t .dot { width: 9px; height: 9px; margin: 0 4px 2px 6px; }
#warcap small { flex: none; }
.war-res { position: absolute; left: 0; top: 0; transform-origin: 0 0; white-space: nowrap; pointer-events: none; z-index: 4; }
.war-res .wr-in { text-align: center; opacity: 0; transform: translateY(10px); transition: opacity .3s ease, transform .45s cubic-bezier(.2, .8, .3, 1); }
.war-res .wr-in.in { opacity: 1; transform: none; }
.war-res .ml-plate { height: 28px; padding: 0 10px 0 4px; box-shadow: inset 3px 0 0 var(--fc), inset 0 0 0 1px var(--br1), 0 0 12px rgba(0, 0, 0, .6); }
.war-res .ml-plate b { font-size: var(--s3); font-weight: 900; letter-spacing: 2px; }
.war-res .win .ml-plate { box-shadow: inset 3px 0 0 var(--fc), inset 0 0 0 1px var(--hi), 0 0 12px rgba(0, 0, 0, .6); }
.war-res .win .ml-plate b { color: var(--hi); }
.war-res .ml-sub { margin-top: 2px; }

/* 城市窗（右上）：标题栏固定，内容在窗内滚动 */
#sside { position: absolute; right: 10px; top: 58px; bottom: 178px; width: 404px; z-index: 5; display: flex; flex-direction: column; }
#sside .wb { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 12px 12px; }
#sside .otable th { position: sticky; top: -10px; z-index: 1; background: var(--lq1); }
#sside .otable th, #sside .otable td { padding: 0 3px; }
#sside .otable td { height: 30px; }
.chead { display: flex; gap: 10px; }
.cpor { width: 116px; height: 116px; flex: none; }
.cpor.none { display: grid; place-items: center; font-size: var(--s4); font-weight: 900; color: var(--txd); background: var(--lq0); }
.chead + .kvs, .chead + .catk + .kvs { margin-top: 4px; }
.catk { display: block; width: 100%; height: 32px; margin: 8px 0 4px; letter-spacing: 4px !important; font-weight: 700; }
.ctags { display: flex; flex-wrap: nowrap; gap: 4px; height: 22px; overflow: hidden; margin: 6px 0 0; }
.ctag.bad { color: var(--bad); } .ctag.good { color: var(--good); } .ctag.gold { color: #1a1206; background: var(--br3); } .ctag.dim { color: var(--txd); }
.ctag.t-light { color: var(--good); } .ctag.t-heavy { color: var(--bad); }
.resv { display: flex; align-items: center; gap: 8px; height: 32px; margin-top: 6px; padding: 0 8px; font-size: var(--s2); white-space: nowrap; overflow: hidden;
  background: var(--lq0); border: 1px solid #000; box-shadow: inset 0 0 0 1px var(--br0); }
.resv b { color: var(--num); } .resv.bz b { color: var(--hi); } .resv .mini-btn { margin-left: auto; }
.ally-tag { margin-top: 10px; color: var(--good); font-size: var(--s2); }
.empty { color: var(--tx2); padding: 20px 0; text-align: center; }

/* 战报（右下） */
#slog { position: absolute; right: 10px; bottom: 10px; width: 404px; height: 158px; z-index: 5; display: flex; flex-direction: column; }
#slog .wh { height: 30px; }
#slog .wh h2 { font-size: var(--s2); }
#slog .seal { width: 20px; height: 20px; }
.slog-b { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 12px 6px; }
/* 条目：战报窗为「日期 | 内容」两栏；天下大势等弹窗里是整行文字 */
.le { padding: 4px 0; line-height: 1.6; color: var(--tx); border-bottom: 1px solid rgba(122, 92, 49, .18); }
#slog .le { display: grid; grid-template-columns: 72px 1fr; gap: 6px; padding: 3px 0; font-size: var(--s1); line-height: 1.5; }
.le span { color: var(--tx2); }
.le p { margin: 0; color: var(--tx); }
.le.good, .le.good p { color: var(--good); } .le.bad, .le.bad p { color: var(--bad); } .le.sys, .le.sys p { color: var(--br3); }

/* 指令窗（左下）：左列分类，右侧 4×2 指令格；定高（最多的一类为内政 8 条），切换分类时尺寸不变 */
#cmdbar { position: absolute; left: 10px; bottom: 10px; z-index: 4; width: 500px; user-select: none; }
#cmdbar .cb-body { display: grid; grid-template-columns: 72px 1fr; gap: 8px; height: 204px; padding: 10px; }
#cmdbar .cb-cats { display: grid; grid-template-rows: repeat(6, 1fr); gap: 4px; min-height: 0; }
#cmdbar .cb-cats button { padding: 0; font-weight: 700; letter-spacing: 3px; text-indent: 3px; }
#cmdbar .cb-cmds { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr); gap: 6px; min-height: 0; }
#cmdbar .cbc { display: grid; align-content: center; justify-items: center; gap: 4px; padding: 0; min-width: 0; }
#cmdbar .cbc b { font-size: var(--s3); letter-spacing: 4px; text-indent: 4px; }
#cmdbar .cbc small { max-width: 100%; padding: 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: 0; }
#cmdbar .cbc small.short { color: var(--bad); }
#cmdbar .cbc.dim { color: var(--txd); }
#cmdbar .cbc.dim small { color: var(--txd); }
#cmdbar .cb-desc { height: 28px; line-height: 27px; padding: 0 12px; font-size: var(--s1); color: var(--tx2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-top: 1px solid var(--br1); background: rgba(0, 0, 0, .25); }
#cmdbar .cb-desc::before { content: '◆'; color: var(--br1); margin-right: 6px; font-size: 10px; vertical-align: 1px; }

/* 军师进言弹窗 */
.advhead { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.advhead .say { flex: 1; padding: 10px 12px; font-size: var(--s2); background: var(--lq0); border: 1px solid #000; box-shadow: inset 0 0 0 1px var(--br0); }
.advhead .say b { color: var(--br3); letter-spacing: 2px; }
.advlist { display: flex; flex-direction: column; gap: 4px; }
.adv { display: flex; gap: 8px; align-items: center; min-height: 34px; padding: 5px 8px; background: rgba(14, 10, 7, .55); border: 1px solid #000; box-shadow: inset 0 0 0 1px var(--br0); }
.adv.act { cursor: pointer; } .adv.act:hover { box-shadow: inset 0 0 0 1px var(--br2); }
.adv .tag { flex: none; width: 24px; padding: 0; color: #f6e3bc; background: linear-gradient(180deg, var(--ver2), var(--ver1)); box-shadow: inset 0 0 0 1px rgba(255, 210, 160, .25); }
.adv .tag.t机, .adv .tag.t才, .adv .tag.t人, .adv .tag.t技, .adv .tag.t宝 { color: var(--br3); background: var(--lq3); box-shadow: inset 0 0 0 1px var(--br1); }
.adv .go { margin-left: auto; flex: none; font-size: var(--s1); color: var(--tx2); }

/* 提示条（弹窗之上） */
#stoasts { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
.stoast { max-width: 640px; padding: 7px 20px; font-size: var(--s2); color: var(--tx); transition: opacity .6s;
  background: rgba(27, 19, 13, .96); border: 1px solid #000; box-shadow: inset 0 0 0 1px var(--br2), 0 4px 14px rgba(0, 0, 0, .5); }
.stoast.good { color: var(--good); } .stoast.bad { color: var(--bad); }
.stoast.out { opacity: 0; }

/* ============================ 弹窗 ============================ */
#modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(6, 4, 2, .55); }
.mbox { display: flex; flex-direction: column; width: min(600px, calc((100vw - 32px) / var(--ui))); max-height: calc(90vh / var(--ui)); }
.mbox.wide { width: min(1040px, calc((100vw - 32px) / var(--ui))); }
.mbox.ofw { width: min(720px, calc((100vw - 32px) / var(--ui))); }   /* 武将档案：六个按钮一行放得下，宝物五格不截字 */
.mbody { flex: 1 1 auto; min-height: 0; padding: 12px 16px; overflow-y: auto; scrollbar-gutter: stable; font-size: var(--s2); line-height: 1.7; }
.mbtns { flex: none; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding: 10px 16px 14px; border-top: 1px solid var(--br1); }
.mbtns button { height: 32px; padding: 0 18px !important; letter-spacing: 2px !important; }
.plist { display: flex; flex-direction: column; gap: 4px; }
.plist-scroll { max-height: calc(36vh / var(--ui)); overflow-y: auto; }   /* 来犯部队多（至多 30 支）时定高滚动 */
.pitem { min-height: 34px; padding: 6px 10px; cursor: pointer; background: rgba(14, 10, 7, .55); border: 1px solid #000; box-shadow: inset 0 0 0 1px var(--br0); }
.pitem:hover { box-shadow: inset 0 0 0 1px var(--br2); }
.pitem.dis { opacity: .45; cursor: default; }
.frm { margin: 8px 0; }
.frm label { margin-right: 10px; white-space: nowrap; }
.frm input[type=range] { width: 260px; vertical-align: middle; }
.howto { padding-left: 18px; }
.howto li { margin: 4px 0; }
.howto b, .mbody p b { color: var(--br3); }
.news .le { font-size: var(--s2); }
p.big { font-size: var(--s4); font-weight: 700; color: var(--br3); }
.ev-text { font-size: var(--s3); line-height: 1.75; }
.oprof { display: flex; gap: 16px; align-items: flex-start; }
.orow { margin-top: 6px; }
.uiscale, .langsw { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 14px; }
.rtabs { display: flex; gap: 4px; margin-bottom: 8px; align-items: center; }
.rtabs select { margin-left: auto; }
.rtabs button small { margin-left: 4px; color: inherit; }

/* 指令详情：执行城市 + 定高武将列表（切换城市时弹窗尺寸不变） */
.pc-city, .wroute { display: flex; align-items: center; gap: 0; margin-bottom: 8px; white-space: nowrap; }
.pc-city > span, .wroute > span:first-child, .wfood > span { flex: none; height: 28px; padding: 0 12px; display: grid; place-items: center; letter-spacing: 2px; color: #f3e3c0;
  background: linear-gradient(180deg, var(--ver2), var(--ver1) 55%, var(--ver0)); border: 1px solid #000; border-right: 0; }
.pc-city select, .wroute select { flex: 1; min-width: 0; }
/* 城市方位图：城市下拉框前的标题可点开（citymap.js） */
.cmap-lab { cursor: pointer; grid-auto-flow: column; gap: 6px; }
.cmap-lab::after { content: ''; width: 13px; height: 13px; opacity: .85;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 13'%3E%3Cpath d='M3 3L10 5M3 3L5 10M10 5L5 10' stroke='%23f3e3c0' stroke-width='1'/%3E%3Crect x='1' y='1' width='4' height='4' fill='%23f3e3c0'/%3E%3Crect x='8' y='3' width='4' height='4' fill='%23f3e3c0'/%3E%3Crect x='3' y='8' width='4' height='4' fill='%23f3e3c0'/%3E%3C/svg%3E") center / contain no-repeat; }
.cmap-lab:hover { filter: brightness(1.2); }
.cmap { position: fixed; z-index: 80; zoom: var(--ui); width: 460px; background: var(--lq1); border: 2px solid var(--br2); outline: 1px solid #000; box-shadow: 0 8px 28px rgba(0, 0, 0, .7); }
.cmap-h { height: 32px; line-height: 32px; padding: 0 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: var(--s2); letter-spacing: 1px; color: var(--tx);
  background: linear-gradient(180deg, var(--lq3), var(--lq2)); border-bottom: 1px solid #000; }
.cmap svg { display: block; width: 100%; height: auto; background: radial-gradient(ellipse at 45% 40%, #d8b684, #b8905a); }
.cm-road0 { fill: none; stroke: #6a4a26; stroke-width: 6; stroke-linejoin: round; }
.cm-road { fill: none; stroke: #f2e6cc; stroke-width: 2.5; stroke-linejoin: round; }
.cm-box { stroke: #1c2a44; stroke-width: 3; }
.cm-hi { fill: none; stroke: rgba(255, 255, 255, .45); stroke-width: 2.5; }
.cm-ring { fill: none; stroke: none; stroke-width: 4; }
.cm-t { text-anchor: middle; font-size: 17px; font-weight: 700; fill: #2a1808; paint-order: stroke; stroke: rgba(250, 236, 206, .85); stroke-width: 4px; pointer-events: none; }
.cm-n.off .cm-box, .cm-n.off .cm-hi { opacity: .45; }
.cm-n.off .cm-t { font-size: 13px; font-weight: 400; fill: #4a3420; }
.cm-n.ok { cursor: pointer; }
.cm-n.ok:hover .cm-box { stroke: #fff4d0; }
.cm-n.ref .cm-ring { stroke: #ffffff; }
.cm-n.cur .cm-ring { stroke: #ffd24a; }
.cmap-f { height: 26px; display: flex; align-items: center; gap: 14px; padding: 0 12px; font-size: var(--s1); color: var(--tx2); white-space: nowrap; overflow: hidden; }
.cmap-f span { display: flex; align-items: center; gap: 5px; }
.cm-k { width: 10px; height: 10px; background: #8a6a40; border: 1px solid #1c2a44; }
.cm-k.off { opacity: .45; } .cm-k.cur { outline: 2px solid #ffd24a; } .cm-k.ref { outline: 2px solid #fff; }
.wroute > i { flex: none; font-style: normal; color: var(--br3); padding: 0 8px; }
.wfrom { margin-left: 10px; color: var(--tx2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; }
.pc-list { height: 284px; overflow-y: auto; border: 1px solid #000; background: rgba(14, 10, 7, .45); }   /* 表头 26 + 8 行 × 32 + 边框：末行不切半 */
.pc-note { height: 26px; }
.wintel { height: 26px; margin: 6px 0 4px; font-size: var(--s1); line-height: 26px; color: var(--tx2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 列表高度取整行：表头 + 整数行，末行不被切半 */
.wlist { max-height: calc(round(down, calc(46vh / var(--ui)) - 34px, 50px) + 34px); overflow-y: auto; border: 1px solid #000; background: rgba(14, 10, 7, .45); }
.wtable { table-layout: fixed; line-height: 1.3; }
.wtable thead th { position: sticky; top: 0; z-index: 1; height: 32px; padding: 0 6px; background: var(--lq1); }
.wtable td { height: 50px; padding: 0 6px; vertical-align: middle; }
.wtable .wn { text-align: left; }
.wtable td.wn b { display: block; font-size: var(--s2); color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wtable td.wn small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wtable th.wn small { margin-left: 4px; }
.wtable .wtv { text-align: right; padding-right: 16px; }
.wtable td.wtv { color: var(--num); font-weight: 700; }
.wtable td.wday { white-space: nowrap; color: var(--tx2); }
.wtable td.wday.first { color: var(--good); }
.wtable td.wday.late { color: var(--txd); }
.wtable td.wday.shift { color: var(--num); }   /* 前一批已满，顺延 */
.wtable select { width: 100%; }
.wtable .wchk { width: 16px; height: 16px; cursor: pointer; vertical-align: middle; }
.wtable .wchk:disabled { cursor: default; }
.wtable .porS { width: 36px; height: 36px; }
.wtable tbody tr[data-o] { cursor: pointer; user-select: none; }
.wtable tbody tr[data-o].dis { cursor: default; }
.wfood { display: flex; align-items: center; gap: 10px; margin-top: 10px; white-space: nowrap; }
.wfood > span { gap: 0; }
.wfood input { width: 110px; }
.wfood small { overflow: hidden; text-overflow: ellipsis; }
#wFoodR { flex: none; width: 240px; height: 20px; margin: 0; background: none; cursor: pointer; -webkit-appearance: none; appearance: none; }
/* 未拉到的一段用浅一档的漆木色 + 青铜描边：面板底是黑的，与底同色就看不出槽的全长 */
:is(#wFoodR, #mkR)::-webkit-slider-runnable-track { height: 6px; border: 1px solid var(--br1); background: linear-gradient(90deg, var(--br2) var(--p, 0%), var(--lq3) var(--p, 0%)); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6); }
:is(#wFoodR, #mkR)::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 18px; margin-top: -7px; background: var(--br3); border: 1px solid #000; }
:is(#wFoodR, #mkR)::-moz-range-track { height: 6px; border: 1px solid var(--br1); background: linear-gradient(90deg, var(--br2) var(--p, 0%), var(--lq3) var(--p, 0%)); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6); }
:is(#wFoodR, #mkR)::-moz-range-thumb { width: 12px; height: 18px; border-radius: 0; background: var(--br3); border: 1px solid #000; }
/* 汇总条：定高单行 */
.wsum { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 34px; margin-top: 8px; padding: 0 12px; white-space: nowrap; overflow: hidden;
  background: var(--lq0); border: 1px solid #000; box-shadow: inset 0 0 0 1px var(--br0); }
.wsum b { color: var(--num); }
.wsum .hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.wsum #wAuto, .wsum #alFill, .wsum #asAuto, .wsum #bzAuto { margin-left: auto; }
.wsum .mini-btn + .mini-btn { margin-left: 4px; }
.werr { min-height: 20px; margin-top: 4px; color: var(--bad); font-weight: 700; }
.werr.flash { animation: werr .5s; }
@keyframes werr { 0%, 60% { background: rgba(222, 122, 98, .2); } 100% { background: transparent; } }
.odds-w { white-space: nowrap; min-width: 150px; text-align: right; }

/* 交易 */
/* 交易：类别三签 → 买卖方向与价格 → 数量（输入 / 加减 / 四档 / 滑条）→ 成交与上限 → 府库前后对照。内容区定高，切换类别不跳动 */
.mk-cat button { flex: 1; height: 34px; font-size: var(--s3); letter-spacing: 4px; }
.mk-tag { margin-left: 6px !important; padding: 0 5px; font-size: var(--s1); letter-spacing: 0; color: #1a1206 !important; background: var(--br3); }
.mk-body { height: 200px; }
.mk-trade { display: flex; flex-direction: column; gap: 10px; padding: 10px 12px; height: 100%; box-sizing: border-box; background: var(--lq0); border: 1px solid var(--br0); }
.mk-dir { display: flex; align-items: center; gap: 4px; }
.mk-dir button { width: 76px; }
.mk-price { margin-left: auto; color: var(--num); font-size: var(--s2); white-space: nowrap; }
.mk-amt { display: flex; align-items: center; gap: 4px; }
.mk-amt .mk-pm { width: 30px; padding: 0 !important; font-size: var(--s3); }
.mk-amt input[type=number] { width: 110px; text-align: right; font-variant-numeric: tabular-nums; }
.mk-unit { width: 24px; color: var(--tx2); }
.mk-q { display: flex; gap: 4px; margin-left: auto; }
.mk-q button { min-width: 40px; padding: 0 8px !important; }
.mk-deal { height: 28px; line-height: 28px; font-size: var(--s3); color: var(--tx2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-deal b { color: var(--hi); font-size: var(--s4); font-variant-numeric: tabular-nums; }
.mk-lim { height: 18px; line-height: 18px; font-size: var(--s1); color: var(--tx2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#mkR { width: 100%; }
.mk-items { height: 100%; overflow-y: auto; padding: 4px 8px; box-sizing: border-box; background: var(--lq0); border: 1px solid var(--br0); }
.mk-sec { margin: 6px 0 2px; font-size: var(--s1); color: var(--br2); letter-spacing: 2px; }
.mk-it { display: flex; align-items: center; gap: 8px; white-space: nowrap; cursor: pointer; }
.mk-it small { overflow: hidden; text-overflow: ellipsis; }
.mk-it em { margin-left: auto; font-style: normal; color: var(--num); }
.mk-it.dis { cursor: default; opacity: .55; } .mk-it.dis em { color: var(--bad); }
.mk-it.on { box-shadow: inset 0 0 0 1px var(--br3); background: rgba(230, 204, 140, .1); }
.mk-far { display: flex; align-items: baseline; gap: 8px; height: 26px; white-space: nowrap; color: var(--tx2); }
.mk-far small { margin-left: auto; overflow: hidden; text-overflow: ellipsis; }
.mk-led { display: flex; align-items: center; gap: 6px; height: 34px; margin: 8px 0 4px; padding: 0 10px; background: var(--lq0); border: 1px solid var(--br0); white-space: nowrap; }
.mk-led .lbl { margin-right: 6px; font-size: var(--s1); color: var(--br2); letter-spacing: 2px; }
.mk-led [data-k] { flex: 1; min-width: 0; color: var(--tx2); overflow: hidden; text-overflow: ellipsis; }
.mk-led b { color: var(--tx); font-variant-numeric: tabular-nums; }
.mk-led i { margin: 0 4px; font-style: normal; color: var(--tx2); }
.mk-led b.mk-up { color: var(--good); } .mk-led b.mk-dn { color: var(--bad); }
#mkR { height: 22px; margin: 0; background: none; cursor: pointer; -webkit-appearance: none; appearance: none; }
#mkR::-webkit-slider-runnable-track { height: 8px !important; } #mkR::-webkit-slider-thumb { width: 14px !important; height: 20px !important; margin-top: -7px !important; }
/* 分配兵士 */
.al-list { height: 300px; }
.al-n { width: 90px; }
.al-cell { display: inline-flex; align-items: center; gap: 6px; }
.al-cell .mini-btn { margin-left: 0; min-width: 48px; }
.as-cell { white-space: nowrap; }
.as-cell .as-r { width: 240px; vertical-align: middle; }
.as-cell .as-v { display: inline-block; width: 56px; text-align: right; color: var(--num); vertical-align: middle; }

/* 编制（军事）：顶部分段条显示全城兵力构成；列宽、行高、摘要行均固定 */
.ty-spear { --ty: #6f8a4e; } .ty-sword { --ty: #a07a48; } .ty-archer { --ty: #4f7a9a; } .ty-cav { --ty: #9a5244; }
.bz-head { margin-bottom: 8px; }
.bz-sum { height: 24px; line-height: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--tx2); }
.bz-sum b { color: var(--num); }
.bz-bar { display: flex; height: 22px; border: 1px solid #000; background: var(--lq0); overflow: hidden; }
.bz-bar i { font-style: normal; min-width: 0; padding: 0 4px; font-size: var(--s1); line-height: 20px; color: #fff3d0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: color-mix(in srgb, var(--ty, #555) 70%, var(--lq0)); border-right: 1px solid rgba(0, 0, 0, .5); }
.bz-bar i.res { color: var(--tx2); background: repeating-linear-gradient(135deg, var(--lq2) 0 6px, var(--lq1) 6px 12px); }
.bz-list { height: 290px; }
.bztable td { height: 50px; }
.bztable .bz-n b { display: block; }
.bztable .bz-n small { display: block; white-space: nowrap; }
.bz-ty { white-space: nowrap; }
.bz-c { width: 30px; height: 30px; margin-right: 4px; padding: 0 !important; font-size: var(--s2) !important; font-weight: 700; color: var(--tx2) !important; }
.bz-c.on { color: #fff3d0 !important; background: color-mix(in srgb, var(--ty) 75%, var(--lq1)) !important; box-shadow: inset 0 0 0 1px var(--br3) !important; }
.bz-c:disabled { opacity: .3; cursor: not-allowed; }
.bz-tr { white-space: nowrap; }
.bz-tr .mini-btn { width: 30px; padding-left: 0 !important; padding-right: 0 !important; vertical-align: middle; }
.bz-tr .bz-max { width: 34px; margin-left: 4px; }
.bz-in { width: 72px; margin: 0 4px; text-align: right; vertical-align: middle; -moz-appearance: textfield; }
.bz-in::-webkit-inner-spin-button, .bz-in::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.bz-cap { display: inline-block; width: 64px; margin-left: 6px; color: var(--tx2); vertical-align: middle; }
.bz-q { white-space: nowrap; }

/* 军职 */
.rktable td { vertical-align: middle; }
.rktable tr.locked { opacity: .45; }
.rktable .rk-cell { white-space: normal; }
.rk-who { display: inline-flex; align-items: center; gap: 4px; margin: 2px 8px 2px 0; cursor: pointer; }
.rk-who:hover { color: var(--hi); }
.rk-slot { display: inline-flex; align-items: center; gap: 4px; min-width: 96px; margin: 2px 10px 2px 0; padding: 1px 6px 1px 1px; background: var(--lq0); border: 1px solid #000; box-shadow: inset 0 0 0 1px var(--br0); }
.rk-slot em { font-style: normal; color: var(--num); font-weight: 700; padding: 0 3px; }
.rk-slot i { font-style: normal; color: var(--txd); font-size: var(--s1); }
.rk-slot .rk-who { margin: 0; }
.rf .mini-btn { margin-right: 3px; }
.mini-btn.on { color: #fbecc8; }

/* 俘虏处置：问话一行定高（登用失败改写此行，不改弹窗高度） */
.cap-prof { flex: 1; min-width: 0; }
.cap-prof .orow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cap-say { margin-top: 10px; height: 26px; line-height: 26px; font-size: var(--s3); color: var(--br3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cap-say.bad { color: var(--bad); } .cap-say.good { color: var(--good); }

/* 宝物：加成数值与能力条末段为青绿（不改变尺寸） */
.itn { font-weight: 700; color: var(--tx); }
.itn.r9 { color: #f0a860; } .itn.r7 { color: var(--num); } .itn.r5 { color: var(--tx); } .itn.r1 { color: var(--tx2); }
/* 宝物图：边框按品级（★5 橙金 · ★4 金 · ★3 铜 · 其余暗铜），定尺寸不随图加载伸缩 */
.iti { flex: none; display: inline-block; width: 40px; height: 40px; object-fit: cover; vertical-align: middle; background: var(--lq0); border: 1px solid var(--br1); outline: 1px solid #000; image-rendering: auto; }
.iti.s { width: 24px; height: 24px; margin: 0 2px; }
.iti.r9 { border-color: #f0a860; } .iti.r7 { border-color: var(--num); } .iti.r5 { border-color: var(--br2); }
.itcell { display: inline-flex; align-items: center; gap: 8px; }
.ittable td { height: 46px; }
/* 武将档案：五类宝物固定五格 */
.ofp-gear { flex: 1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.gear { display: flex; align-items: center; gap: 6px; min-width: 0; height: 44px; padding: 0 6px 0 4px; background: var(--lq0); border: 1px solid var(--br0); cursor: help; }
.gear .iti { width: 34px; height: 34px; }
.gear span { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.gear b { font-size: var(--s2); }
.gear b, .gear small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gear small { font-size: var(--s1); color: var(--good); }
/* 赏赐选择 / 交易行：图在左 */
.pitem > .iti { margin-right: 8px; }
.pitem:has(> .iti) { display: flex; align-items: center; }
.pit-t { min-width: 0; }
.resv.bz .iti.s { margin-right: 0; }
/* 得宝展示 */
.itr { display: flex; gap: 18px; align-items: flex-start; padding: 6px 2px 10px; }
.itr-img { flex: none; width: 192px; height: 192px; border: 2px solid var(--br2); outline: 1px solid #000; box-shadow: 0 6px 18px rgba(0, 0, 0, .5); }
.itr-img.r9 { border-color: #f0a860; } .itr-img.r7 { border-color: var(--num); }
.itr-t { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.itr-h { color: var(--tx2); font-size: var(--s1); }
.itr-t > b.itn { font-size: var(--s5); line-height: 1.1; letter-spacing: 4px; }
.itr-m { color: var(--tx2); } .itr-g { color: #f0c060; letter-spacing: 2px; }
.itr-b { color: var(--good); font-size: var(--s3); }
.itr-e { color: var(--tx); }
.itr-d { margin: 4px 0 0; color: var(--tx2); font-style: italic; }
.itlist { height: calc(50vh / var(--ui)); max-height: none; }
.ittable td.itd, .ittable td.itw { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.ittable td.itb { white-space: nowrap; color: var(--good); }
.ittable tr.mine td { background: rgba(156, 201, 122, .07); }
.ittable td[data-o] { cursor: pointer; }

/* ---------- 武将详情 ---------- */
.ofp-head { display: flex; gap: 16px; align-items: center; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--br1); }
.ofp-por { width: 100px; height: 100px; flex: none; }
.ofp-id { min-width: 0; }
.ofp-name { font-size: var(--s5); font-weight: 900; line-height: 1.1; letter-spacing: 4px; color: var(--tx); white-space: nowrap; }
.ofp-name small { margin-left: 12px; font-size: var(--s2); font-weight: 500; letter-spacing: 2px; }
.ofp-sub { margin-top: 6px; font-size: var(--s2); color: var(--tx2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ofp-tags { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.tg.lord { color: #f6e3bc; background: linear-gradient(180deg, var(--ver2), var(--ver1)); box-shadow: inset 0 0 0 1px rgba(255, 210, 160, .25); }
.tg.st { color: var(--tx2); }
.ofp-tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.ofp-tabs button { height: 30px; padding: 0 22px !important; letter-spacing: 3px !important; }
.ofp-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; }
.ofs, .ofm { display: grid; grid-template-columns: 52px minmax(0, 1fr) 40px 20px; align-items: center; height: 26px; margin: 0 0 4px; }
.ofm { grid-template-columns: 52px minmax(0, 1fr) 50px 64px; }
.ofs > span, .ofm > span { height: 26px; display: grid; place-items: center; font-size: var(--s2); letter-spacing: 2px; color: #f3e3c0;
  background: linear-gradient(180deg, var(--ver2), var(--ver1) 55%, var(--ver0)); border: 1px solid #000; }
.ofs > b, .ofm > b { padding-right: 2px; color: var(--num); text-align: right; font-weight: 700; }
.ofs > b.hi { color: var(--hi); } .ofs > b.ib { color: var(--good); }
.ofs > em { font-style: normal; font-size: var(--s1); font-weight: 700; text-align: center; color: var(--tx2); }
.ofs > em.hi { color: var(--hi); }
.ofm > b:nth-child(2) { grid-column: 2 / -1; height: 26px; line-height: 24px; padding: 0 8px; text-align: left; color: var(--tx); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--lq0); border: 1px solid #000; border-left: 0; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .7); }
.ofm > b.big { color: var(--num); font-weight: 700; }
.ofm > b.rk { color: var(--num); }
.ofm small { white-space: nowrap; padding-left: 6px; }
.ofs-bar { display: flex; height: 26px; background: var(--lq0); border: 1px solid #000; border-left: 0; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .7); }
.ofs-bar i { display: block; height: 100%; background: linear-gradient(180deg, rgba(184, 149, 79, .55), rgba(122, 92, 49, .42)); border-right: 1px solid var(--br2); }
.ofs-bar i.ib { background: rgba(156, 201, 122, .5); border-right-color: var(--good); }
.ofm.bad .ofs-bar i { background: rgba(222, 122, 98, .45); border-right-color: var(--bad); }
.ofm.bad > b { color: var(--bad); }
.ofs-total { margin-top: 6px; font-size: var(--s1); color: var(--tx2); } .ofs-total b { color: var(--num); font-size: var(--s2); }
.ofp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 4px; min-height: 26px; }
.ofp-row .lbl { flex: none; width: 52px; height: 24px; display: grid; place-items: center; margin-right: 4px; letter-spacing: 2px; color: #f3e3c0;
  background: linear-gradient(180deg, var(--ver2), var(--ver1) 55%, var(--ver0)); border: 1px solid #000; }
.chip { color: var(--tx); }
.chip.tr { color: var(--br3); }
.ofp-pers { margin-left: 8px; }
.ofp-bio { margin: 2px 0 10px; font-size: var(--s2); line-height: 1.9; text-indent: 2em; text-align: justify; }
.ofp-deeds { max-height: 220px; overflow-y: auto; font-size: var(--s2); }
.ofp-deeds div { padding: 3px 0; border-bottom: 1px solid rgba(122, 92, 49, .18); }
.ofp-deeds span { display: inline-block; min-width: 88px; color: var(--tx2); font-size: var(--s1); }
.ofp-pane { min-height: 250px; }

/* ---------- 技术树（格子定宽定高，文案单行省略） ---------- */
.tk-sum { font-size: var(--s2); font-weight: 500; color: var(--tx2); letter-spacing: 0; margin-left: 8px; }
.tk-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; line-height: 1.35; }
.tk-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tk-br { display: flex; align-items: baseline; justify-content: center; gap: 8px; height: 36px; margin-bottom: -4px; font-size: var(--s3); font-weight: 900; letter-spacing: 6px; color: var(--br3);
  border-bottom: 1px solid var(--br1); }
.tk-br small { letter-spacing: 0; font-weight: 500; }
.tk { position: relative; height: 112px; min-width: 0; padding: 10px 12px 11px 10px; display: flex; align-items: center; gap: 10px;
  background: var(--lq0); border: 1px solid #000; box-shadow: inset 0 0 0 1px var(--br0); }
.tk + .tk::before { content: ''; position: absolute; left: 50%; top: -17px; height: 16px; border-left: 1px dashed var(--br1); }
.tk.done + .tk::before { border-left: 1px solid rgba(156, 201, 122, .6); }
.tk.open { cursor: pointer; box-shadow: inset 0 0 0 1px var(--br1); }
.tk.open:hover { box-shadow: inset 0 0 0 1px var(--br3); background: rgba(230, 204, 140, .06); }
.tk.done { box-shadow: inset 0 0 0 1px rgba(156, 201, 122, .45); background: linear-gradient(rgba(156, 201, 122, .07), rgba(156, 201, 122, 0) 60%), var(--lq0); }
.tk.lock { opacity: .5; }
/* 技术图：左侧 64px；未解锁者去色，已完成者正常 */
.tki { flex: none; width: 64px; height: 64px; object-fit: cover; background: var(--lq0); border: 1px solid var(--br1); outline: 1px solid #000; }
.tk.lock .tki { filter: grayscale(1) brightness(.7); }
.tk.done .tki { border-color: rgba(156, 201, 122, .7); }
.tk-c { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: space-between; }
.tk-h b { overflow: hidden; text-overflow: ellipsis; }
.tk-h { display: flex; align-items: center; gap: 8px; height: 24px; min-width: 0; }
.tk-tier { flex: none; width: 22px; height: 22px; display: inline-grid; place-items: center; font-style: normal; font-size: var(--s1); color: var(--br3); background: var(--lq3); border: 1px solid #000; box-shadow: inset 0 0 0 1px var(--br1); }
.tk.done .tk-tier { color: var(--good); }
.tk-h b { font-size: var(--s3); letter-spacing: 2px; color: var(--tx); white-space: nowrap; }
.tk-st { display: block; height: 16px; line-height: 16px; font-style: normal; font-size: var(--s1); color: var(--tx2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-st.ok { color: var(--good); } .tk-st.ok::before { content: '✓ '; } .tk-st.go { color: var(--br3); }
.tk-e { height: 32px; font-size: var(--s1); line-height: 16px; color: var(--tx); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tk-bar { height: 4px; background: rgba(0, 0, 0, .5); }
.tk-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--br1), var(--br3)); }
.tk.done .tk-bar i { background: var(--good); }
.tk-master { color: #d8b8f0; }
.tk-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 0; margin-top: 16px; padding: 8px 12px; font-size: var(--s1); line-height: 1.5; color: var(--tx2);
  background: var(--lq0); border: 1px solid #000; box-shadow: inset 0 0 0 1px var(--br0); }
.tk-foot span { padding: 0 14px; white-space: nowrap; }
.tk-foot span + span { border-left: 1px solid var(--br1); }
.tk-foot b { font-weight: 500; color: var(--tx); }

/* ============================ 指令动画（场景窗） ============================ */
#scene { position: fixed; inset: 0; z-index: 55; padding-top: 20px; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .45); cursor: pointer; }
.scwin { width: min(720px, calc(100vw - 32px)); padding: 0 12px 12px; animation: scIn .25s ease-out; }
@keyframes scIn { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.sc-title { height: 38px; margin: 0 -12px 12px; padding: 0 12px; display: flex; align-items: center; gap: 10px; font-size: var(--s3); font-weight: 700; letter-spacing: 4px; color: var(--tx);
  background: linear-gradient(180deg, var(--lq3), var(--lq2)); border-bottom: 1px solid var(--br1); box-shadow: 0 1px 0 #000; }
.sc-title::before { content: '令'; width: 24px; height: 24px; display: grid; place-items: center; font-size: var(--s1); font-weight: 900; letter-spacing: 0; color: #f6e3bc;
  background: linear-gradient(180deg, var(--ver2), var(--ver1)); border: 1px solid #000; box-shadow: inset 0 0 0 1px rgba(255, 210, 160, .25); }
.scwin canvas { display: block; margin: 0 auto; width: auto; max-width: 100%; height: min(calc(100vh - 270px), calc((min(720px, 100vw - 32px) - 28px) * 9 / 16)); aspect-ratio: 16 / 9;
  image-rendering: pixelated; border: 2px solid var(--br2); outline: 1px solid #000; }
.scbox { position: relative; display: flex; gap: 12px; margin-top: 12px; height: 144px; padding: 10px; background: rgba(14, 10, 7, .8); border: 1px solid #000; box-shadow: inset 0 0 0 1px var(--br0); }
.sc-por { width: 84px; height: 84px; flex: none; object-fit: cover; }
.sc-body { flex: 1; min-width: 0; padding-bottom: 16px; }
.sc-name { margin-bottom: 4px; font-size: var(--s2); font-weight: 700; letter-spacing: 3px; color: var(--br3); }
.sc-text { font-size: var(--s3); line-height: 1.65; max-height: calc(var(--s3) * 1.65 * 3); overflow: hidden; }   /* 对白框定高：台词 + 结果行增减不改变窗口尺寸 */
.sc-say { color: var(--tx); }
.sc-res.ok { color: var(--good); } .sc-res.ng { color: var(--bad); }
.sc-hint { position: absolute; right: 12px; bottom: 6px; font-size: var(--s1); line-height: 1; color: var(--tx2); animation: scHint 1.2s ease-in-out infinite; }
@keyframes scHint { 50% { opacity: .35; } }
/* 战报顶部的战果过场：16:9 画布，过高时上下等量裁切；底部单行字幕 */
.wr-scene { position: relative; margin-bottom: 10px; background: #000; border: 2px solid var(--br2); outline: 1px solid #000; }
.wr-scene canvas { display: block; width: 100%; aspect-ratio: 16 / 9; max-height: 40vh; object-fit: cover; object-position: 50% 55%; image-rendering: pixelated; }
.wr-cap { position: absolute; left: 0; right: 0; bottom: 0; height: 44px; padding: 0 14px; display: flex; align-items: center; gap: 14px; white-space: nowrap; overflow: hidden;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .78)); }
.wr-cap b { flex: none; font-size: var(--s4); letter-spacing: 6px; color: #f6e3bc; text-shadow: 0 2px 0 #000; }
.wr-cap.ng b { color: #c9c2b4; }
.wr-cap span { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: var(--s3); color: var(--tx); text-shadow: 0 1px 0 #000; }
/* 战后战报：过场压成横幅，攻守左右两栏；行高固定、数字等宽右对齐 */
.wr-scene.slim canvas { aspect-ratio: 32 / 9; max-height: 26vh; }
.wr-summary { height: 24px; line-height: 24px; margin-bottom: 8px; color: var(--tx2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wr-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.wr-col { min-width: 0; padding: 8px 10px 6px; background: var(--lq0); border: 1px solid var(--br0); border-top: 3px solid var(--br2); }
.wr-h { display: flex; align-items: center; gap: 8px; height: 26px; white-space: nowrap; }
.wr-h b { font-size: var(--s3); color: var(--hi); overflow: hidden; text-overflow: ellipsis; }
.wr-h small { font-size: var(--s1); color: var(--tx2); }
.wr-role { width: 20px; height: 20px; line-height: 18px; text-align: center; font-size: var(--s1); color: #fbecc8; background: var(--ver1); border: 1px solid var(--br2); flex: none; }
.wr-win { margin-left: auto; padding: 0 8px; line-height: 20px; font-size: var(--s1); color: #fbecc8; background: var(--ver1); border: 1px solid var(--br2); }
.wr-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 4px; font-size: var(--s1); color: var(--tx2); }
.wr-sum span { display: flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.wr-sum b { font-size: var(--s3); color: var(--num); font-variant-numeric: tabular-nums; }
.wr-sum b.bad { color: var(--bad); }
.wr-bar { height: 6px; margin: 6px 0 4px; background: #000; border: 1px solid var(--br0); }
.wr-bar i { display: block; height: 100%; }
.wr-r { display: grid; grid-template-columns: 28px minmax(0, 1fr) 96px 44px 44px 48px 34px; align-items: center; gap: 6px; height: 38px; border-bottom: 1px solid var(--line); white-space: nowrap; line-height: 1.2; }
.wr-r.wr-rh { height: 22px; font-size: var(--s1); color: var(--tx2); border-bottom-color: var(--br1); }
.wr-r .tn { text-align: right; font-variant-numeric: tabular-nums; }
.wr-n { display: flex; flex-direction: column; min-width: 0; overflow: hidden; color: var(--tx); }
.wr-n small { font-size: var(--s1); color: var(--tx2); }
.wr-g { display: inline-block; line-height: 26px; text-align: center; font-size: var(--s1); color: var(--tx2); }
.wr-tr { display: flex; flex-direction: column; gap: 3px; }
.wr-tr small { font-size: var(--s1); color: var(--tx2); }
.wr-tr i { display: block; height: 3px; background: #000; }
.wr-tr em { display: block; height: 100%; }
.wr-k { color: var(--num); }
.wr-s { font-size: var(--s1); color: var(--tx2); text-align: center; }
.wr-note { margin-top: 8px; }
@media (max-width: 860px) { .wr-cols { grid-template-columns: 1fr; } }
:root[data-lang=en] .wr-r { grid-template-columns: 28px minmax(0, 1fr) 90px 42px 58px 40px 62px; gap: 5px; }

/* ============================ 系统菜单 ============================ */
#sysm { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: rgba(12, 9, 6, .3); backdrop-filter: blur(8px) brightness(.9); -webkit-backdrop-filter: blur(8px) brightness(.9); animation: sysmIn .18s ease-out; }
#sysm.out { opacity: 0; transition: opacity .16s; }
@keyframes sysmIn { from { opacity: 0; } to { opacity: 1; } }
.sysm-panel { zoom: var(--ui); width: 440px; height: 600px; padding: 40px 40px 32px; animation: sysmPanel .2s ease-out; }
@keyframes sysmPanel { from { transform: translateY(8px); } to { transform: none; } }
.sysm-c { display: none; }
.sysm-page { height: 100%; display: flex; flex-direction: column; }
.sysm-page.main { justify-content: center; gap: 12px; }
.sysm-btn { position: relative; display: block; flex: none; width: 300px; height: 46px; margin: 0 auto; padding: 0 !important;
  font-size: var(--s3) !important; font-weight: 700; letter-spacing: 6px !important; text-indent: 6px; }
.sysm-btn::before, .sysm-btn::after { content: '◆'; position: absolute; top: 50%; margin-top: -7px; font-size: 10px; line-height: 14px; color: var(--br3); opacity: 0; transition: opacity .12s; }
.sysm-btn::before { left: 18px; } .sysm-btn::after { right: 18px; }
.sysm-btn:hover:not(:disabled)::before, .sysm-btn:hover:not(:disabled)::after { opacity: 1; }
.sysm-btn.two { height: 54px; }
.sysm-btn.two span { display: block; }
.sysm-btn small { display: block; margin-top: 3px; padding: 0 16px; font-size: var(--s1); font-weight: 500; letter-spacing: 0; text-indent: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sysm-page.sub .sysm-btn { margin-top: 12px; }
.sysm-h { flex: none; margin-bottom: 10px; text-align: center; font-size: var(--s4); font-weight: 900; letter-spacing: 8px; color: var(--tx); }
.sysm-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 6px; font-size: var(--s2); }
.sysm-body .sm-sec { display: flex; align-items: center; gap: 8px; margin: 12px 0 6px; color: var(--br3); font-weight: 700; letter-spacing: 2px; }
.sysm-body .sm-sec::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--br1), transparent); }
.sysm-body .sm-sec:first-child { margin-top: 0; }
.sysm-body .sm-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.sysm-body .sm-row .hint { margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sysm-body .sm-row b { color: var(--num); }
.sysm-body .howto { margin: 4px 0 8px; line-height: 1.6; }
.sysm-q { margin: 6px 0; text-align: center; line-height: 1.6; }
.sysm-q.dim { color: var(--tx2); font-size: var(--s1); }
.sysm-body .sysm-btn { margin-bottom: 10px; }
.sysm-body .sysm-q + .sysm-btn, .sysm-body .sysm-q.dim + .sysm-q + .sysm-btn { margin-top: 18px; }
/* 音量面板 */
.audiopop { position: fixed; z-index: 60; padding: 10px 14px; font-size: var(--s1); background: rgba(27, 19, 13, .97); border: 1px solid #000; box-shadow: inset 0 0 0 1px var(--br2); }
.audioctl { display: flex; flex-direction: column; gap: 6px; }
.audioctl label { display: flex; align-items: center; gap: 8px; }
.audioctl input[type=range] { width: 160px; }
.audioctl label.off { color: var(--txd); }
.audioctl input[type=range]:disabled { filter: grayscale(1); opacity: .4; cursor: default; }

/* ============================ 剧本选择页 ============================ */
/* 固定 1280×720 舞台，整体按窗口等比缩放，内部布局永不重排 */
#scensel { position: fixed; inset: 0; z-index: 30; overflow: hidden; background: radial-gradient(ellipse at 70% 40%, var(--lq3) 0%, var(--lq1) 55%, var(--lq0) 100%); }
#scensel::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: var(--pat); }
.ss-stage { position: absolute; left: 50%; top: 50%; width: 1280px; height: 720px; transform-origin: 50% 50%; transform: translate(-50%, -50%) scale(var(--ss, 1)); }
.ss-stage::before { content: ''; position: absolute; left: 470px; top: -70px; width: 690px; height: 690px; border-radius: 50%;
  border: 2px solid rgba(230, 204, 140, .12); box-shadow: 0 0 0 10px rgba(230, 204, 140, .04); pointer-events: none; }
.ss-head { position: absolute; left: 20px; top: 16px; width: 360px; height: 44px; display: flex; align-items: center; gap: 12px; padding: 0 14px;
  background: linear-gradient(90deg, var(--lq3), rgba(54, 39, 27, 0)); border-top: 1px solid var(--br1); border-bottom: 1px solid var(--br1); }
.ss-head::before { content: '本'; width: 28px; height: 28px; display: grid; place-items: center; font-size: var(--s2); font-weight: 900; color: #f6e3bc;
  background: linear-gradient(180deg, var(--ver2), var(--ver1)); border: 1px solid #000; box-shadow: inset 0 0 0 1px rgba(255, 210, 160, .25); }
.ss-head span { font-size: var(--s4); font-weight: 900; letter-spacing: 8px; color: var(--tx); }
/* 剧本列表：漆木条，选中朱漆 */
.ss-list { position: absolute; left: 0; top: 90px; width: 560px; }
.ss-item { position: absolute; height: 50px; width: 440px; display: flex; align-items: center; gap: 12px; padding: 0 18px 0 10px; cursor: pointer; white-space: nowrap; overflow: hidden;
  color: var(--tx); background: linear-gradient(90deg, var(--lq3), var(--lq2) 60%, rgba(40, 28, 19, .5)); border: 1px solid #000;
  box-shadow: inset 0 1px 0 rgba(255, 230, 170, .12), inset 0 0 0 1px var(--br0), 0 3px 6px rgba(0, 0, 0, .45); transition: background .18s, box-shadow .18s; }
/* 选中：左缘金色刻痕，条目不横移（各列对齐、布局稳定） */
.ss-item::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; background: transparent; }
.ss-item.on::before { background: linear-gradient(180deg, var(--hi), var(--br2)); }
.ss-item:hover { box-shadow: inset 0 1px 0 rgba(255, 230, 170, .16), inset 0 0 0 1px var(--br2), 0 3px 6px rgba(0, 0, 0, .45); }
.ss-item.on { background: linear-gradient(90deg, var(--ver1), var(--ver0) 60%, rgba(90, 26, 16, .5)); box-shadow: inset 0 0 0 1px #c8784a, 0 3px 10px rgba(0, 0, 0, .5); }
.ss-tag { flex: none; height: 26px; padding: 0 7px; display: grid; place-items: center; font-size: var(--s1); font-weight: 700; letter-spacing: 2px; color: var(--br3);
  background: var(--lq0); border: 1px solid #000; box-shadow: inset 0 0 0 1px var(--br1); }
.ss-y, .ss-m { font-size: var(--s4); font-weight: 900; color: var(--hi); }
.ss-y { width: 80px; flex: none; } .ss-m { width: 50px; flex: none; text-align: right; }   /* flex: none：剧本名长时不挤压年月 */
.ss-n { font-size: var(--s4); font-weight: 700; letter-spacing: 3px; overflow: hidden; text-overflow: ellipsis; }
.ss-sub { font-size: var(--s1); color: var(--tx2); flex: none; }
/* 势力图：边缘羽化融入背景 */
.ss-map { position: absolute; left: 500px; top: 12px; width: 620px; height: 508px;
  -webkit-mask-image: radial-gradient(ellipse 64% 66% at 50% 50%, #000 72%, transparent 100%); mask-image: radial-gradient(ellipse 64% 66% at 50% 50%, #000 72%, transparent 100%); }
.ss-map canvas { width: 100%; height: 100%; display: block; filter: saturate(.8) sepia(.12); transition: opacity .25s; }
.ss-map.fade canvas { opacity: .25; }
/* 代表人物：外缘渐隐 */
.ss-heroes { position: absolute; left: 0; top: 0; width: 1280px; height: 560px; pointer-events: none; }
.ss-hero { position: absolute; width: 158px; height: 158px; object-fit: cover; opacity: 0; transform: translateY(8px); transition: opacity .35s ease, transform .35s ease;
  -webkit-mask-image: radial-gradient(circle at 50% 46%, #000 56%, transparent 71%); mask-image: radial-gradient(circle at 50% 46%, #000 56%, transparent 71%); }
.ss-hero.in { opacity: 1; transform: none; }
.ss-hero.h0 { left: 1086px; top: 8px; width: 176px; height: 176px; }
.ss-hero.h1 { left: 1108px; top: 176px; }
.ss-hero.h2 { left: 1092px; top: 334px; }
.ss-hname { position: absolute; font-size: var(--s3); font-weight: 700; color: var(--tx); letter-spacing: 4px; text-shadow: 0 2px 3px #000, 0 0 6px #000; opacity: 0; transition: opacity .35s; white-space: nowrap; }
.ss-hname.in { opacity: 1; }
/* 说明窗 */
.ss-desc { position: absolute; left: 596px; top: 516px; width: 664px; height: 124px; padding: 10px 18px; }
.ss-dtitle { height: 26px; font-size: var(--s3); font-weight: 700; color: var(--br3); letter-spacing: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-dtext { height: 50px; font-size: var(--s2); line-height: 25px; color: var(--tx); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ss-dmeta { height: 20px; font-size: var(--s1); color: var(--tx2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-dmeta i { font-style: normal; display: inline-block; width: 9px; height: 9px; margin: 0 3px 0 8px; vertical-align: 0; border: 1px solid rgba(0, 0, 0, .6); }
/* 提示条与按钮 */
.ss-hint { position: absolute; left: 0; top: 656px; width: 1280px; height: 28px; line-height: 28px; text-align: center; font-size: var(--s2); letter-spacing: 3px; color: var(--tx2);
  background: linear-gradient(90deg, rgba(14, 10, 7, .2), rgba(14, 10, 7, .9) 20%, rgba(14, 10, 7, .9) 80%, rgba(14, 10, 7, .2)); border-top: 1px solid var(--br0); border-bottom: 1px solid var(--br0); }
.ss-btns { position: absolute; left: 0; top: 650px; width: 1280px; height: 40px; display: flex; justify-content: center; gap: 360px; pointer-events: none; }
.ss-round { pointer-events: auto; width: 132px; height: 40px; font-size: var(--s3) !important; font-weight: 700; letter-spacing: 8px !important; text-indent: 8px; }

.ss-round.go { color: #fbecc8; background: linear-gradient(180deg, var(--ver2), var(--ver1) 60%, var(--ver0)); box-shadow: inset 0 1px 0 rgba(255, 210, 160, .3), inset 0 0 0 1px #c8784a; }
.ss-round.go:hover { box-shadow: inset 0 1px 0 rgba(255, 210, 160, .4), inset 0 0 0 1px #e0a070; }

/* =====================================================================
   以下沿用旧样式：旧战场 HUD（demo/ 演示页）、战法 Cut-in、开场 / 终局 CG
   旧变量名（--gold / --panel / --paper …）已在 :root 映射到 v2 色板
   ===================================================================== */
/* ---------- 战场 HUD ---------- */
#battle { position: fixed; inset: 0; z-index: 20; background: #000; }
#battle-view canvas { display: block; }
#hud { position: absolute; inset: 0; pointer-events: none; }
#hud > * { pointer-events: auto; }
#banners, #toasts, #selbox, #tip, #pausedTag, #battleTitle { pointer-events: none !important; }
#topbar { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 6px 16px;
  background: var(--panel); border: 1px solid var(--gold-dim); box-shadow: 0 4px 16px rgba(0,0,0,.4); }
.fname { font-family: var(--f-title); font-weight: 900; font-size: 22px; min-width: 110px; }
.fname small { display: block; font-family: var(--f-body); font-size: 12px; color: #fff; opacity: .85; }
.fname.p { text-align: right; }
.tcenter { display: flex; flex-direction: column; align-items: center; gap: 3px; }
#balance { position: relative; width: 320px; height: 12px; border: 1px solid var(--gold); overflow: hidden; }
#balP { height: 100%; width: 50%; transition: width .4s; }
#balance .mid { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; background: var(--gold); }
.tinfo { display: flex; gap: 18px; font-size: 12px; }
.tinfo b { color: #fff; }
#day { color: var(--gold); font-weight: 700; }
b.starve { color: #ff5a4a !important; animation: blink .5s infinite alternate; }
#occupy { font-size: 11px; color: #ffd75a; display: flex; gap: 6px; align-items: center; }
.obar { width: 120px; height: 6px; background: rgba(0,0,0,.6); border: 1px solid #ffd75a; }
.obar i { display: block; height: 100%; background: #ffd75a; }
#battleTitle { position: absolute; top: 76px; left: 50%; transform: translateX(-50%); font-size: 12px; opacity: .7; text-shadow: 0 1px 3px #000; white-space: nowrap; }
#timectl { position: absolute; top: 8px; right: 12px; display: flex; gap: 4px; padding: 4px 6px; background: var(--panel); border: 1px solid var(--gold-dim); }
#timectl button { min-width: 32px; height: 26px; font-size: 13px; }
#timectl button.on { background: var(--gold); color: var(--ink); }
#pausedTag { position: absolute; top: 96px; left: 50%; transform: translateX(-50%); font-family: var(--f-title); font-weight: 900; font-size: 26px; color: var(--gold); text-shadow: 0 2px 6px #000; letter-spacing: 6px; }

#cards { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 5px; padding: 6px; background: var(--panel); border: 1px solid var(--gold-dim); }
.card { position: relative; width: 78px; height: 112px; background: linear-gradient(#3a3024, #1a140e); border: 2px solid #3a3226; cursor: pointer; overflow: hidden; }
.card:hover { border-color: var(--gold-dim); }
.card.sel { border-color: #fff27a; box-shadow: 0 0 10px rgba(255,242,122,.6); }
.card.fight { animation: fight .6s infinite alternate; }
.card.rout { background: linear-gradient(#6a2a22, #301410); }
.card.down .por { filter: grayscale(1); }
.card.dead { filter: grayscale(1) brightness(.45); cursor: default; }
.card .key { position: absolute; top: 2px; left: 4px; font-size: 10px; color: rgba(255,255,255,.55); }
.card .por { display: block; width: 44px; height: 44px; margin: 6px auto 0; border: 1px solid #000; }
.card .tglyph { position: absolute; top: 34px; right: 6px; font-family: var(--f-title); font-weight: 900; font-size: 16px; background: rgba(0,0,0,.6); padding: 0 3px; color: #ffd75a; }
.card .cname { font-size: 12px; text-align: center; white-space: nowrap; }
.card .cnt { font-size: 11px; text-align: center; color: #fff; font-weight: 700; }
.card .bar { position: absolute; left: 4px; right: 4px; height: 3px; background: rgba(0,0,0,.6); }
.card .bar.ghp { bottom: 14px; } .card .bar.hp { bottom: 9px; } .card .bar.mor { bottom: 4px; }
.card .bar i { display: block; height: 100%; }
.card .bar.hp i { background: #e8e0c8; } .card .bar.ghp i { background: #e8a33a; }
.card .st { position: absolute; top: 2px; right: 4px; font-size: 13px; color: #ffd75a; text-shadow: 0 1px 2px #000; }
@keyframes fight { from { box-shadow: inset 0 0 0 0 rgba(200,40,30,0); } to { box-shadow: inset 0 0 14px 0 rgba(220,50,30,.7); } }

#info { position: absolute; left: 12px; bottom: 10px; width: 280px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--gold-dim); font-size: 12px; }
.ihead { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.iglyph { width: 44px; height: 44px; font-family: var(--f-title); font-weight: 900; font-size: 30px; line-height: 44px; text-align: center; background: #3a3024; border: 1px solid var(--gold); }
.iport { width: 48px; height: 48px; image-rendering: pixelated; border: 1px solid var(--gold); }
.iname { font-size: 16px; font-weight: 700; color: var(--gold); }
.isub { opacity: .75; }
.irow { margin: 3px 0; } .irow b { color: #fff; }
.stats { display: flex; flex-wrap: wrap; gap: 3px 10px; margin-top: 5px; opacity: .85; }
.itip { opacity: .7; margin-top: 4px; }
.buff, .debuff { font-size: 10px; padding: 0 4px; margin-left: 3px; }
.buff { background: #6a5a1a; color: #ffe27a; } .debuff { background: #6a1a1a; color: #ff9a8a; }
.forms { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 8px; }
.fbtn { padding: 3px 8px; font-size: 12px; cursor: pointer; background: #241b12; color: var(--paper); border: 1px solid var(--gold-dim); }
.fbtn.on { background: var(--gold); color: var(--ink); }
.fbtn:hover { border-color: var(--gold); }
.abil-row { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.abil { display: flex; align-items: center; gap: 6px; padding: 5px 8px; cursor: pointer; background: linear-gradient(#7a5a1e, #3e2c0e); color: #fff3cc; border: 1px solid var(--gold); font-size: 13px; }
.abil:hover { filter: brightness(1.2); }
.abil.cool { filter: grayscale(.8) brightness(.7); cursor: default; }
.abil.on { outline: 2px solid #fff27a; }
.abil .ak { margin-left: auto; font-size: 11px; opacity: .8; }

#mmwrap { position: absolute; right: 12px; bottom: 10px; padding: 4px; background: var(--panel); border: 1px solid var(--gold-dim); }
#minimap { display: block; width: 200px; height: 200px; cursor: pointer; image-rendering: pixelated; }

#banners { position: absolute; inset: 0; overflow: hidden; }
.banner { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: auto; cursor: pointer; }
.banner .pole { position: absolute; left: -1px; top: -38px; width: 2px; height: 38px; background: #3a2a18; }
.banner .flag { position: absolute; left: 1px; top: -38px; width: 26px; height: 28px; font-family: var(--f-title); font-weight: 900; font-size: 19px; line-height: 28px; text-align: center; color: #fff;
  border: 1px solid rgba(0,0,0,.6); text-shadow: 0 1px 1px #000; transform-origin: left center; }
.banner.own .flag { border-color: var(--gold); }
.banner .bhp { position: absolute; left: 1px; top: -8px; width: 26px; height: 3px; background: rgba(0,0,0,.6); }
.banner .bhp i { display: block; height: 100%; background: #e8e0c8; }
.banner.sel .flag { outline: 2px solid #fff27a; }
.banner.hov .flag { filter: brightness(1.35); }
.banner.fight .flag { animation: wave .35s infinite alternate; }
.banner.down .flag { filter: grayscale(.7); }
.banner.rout .flag { background: #eee !important; color: #a33; animation: blink .5s infinite alternate; }
@keyframes wave { from { transform: skewY(-6deg); } to { transform: skewY(6deg); } }
@keyframes blink { from { opacity: 1; } to { opacity: .4; } }

#tip { position: absolute; left: 0; top: 0; padding: 6px 9px; background: var(--panel); border: 1px solid var(--gold-dim); font-size: 12px; line-height: 1.5; white-space: nowrap; }
.tname { font-weight: 700; font-size: 13px; }
.tact { color: #ff8a6a; }
#toasts { position: absolute; top: 112px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.toast { padding: 5px 18px; background: linear-gradient(90deg, transparent, rgba(20,15,10,.85) 15%, rgba(20,15,10,.85) 85%, transparent); font-size: 15px; transition: opacity .8s; white-space: nowrap; text-shadow: 0 1px 2px #000; }
.toast.good { color: #9bf09b; } .toast.bad { color: #ff8a7a; } .toast.ability { color: #ffe27a; font-size: 17px; }
.toast.enemy { color: #9ab8ff; } .toast.order { color: #e8e0c8; font-size: 13px; } .toast.out { opacity: 0; }
#selbox { position: absolute; display: none; border: 1px solid #fff27a; background: rgba(255,242,122,.12); }
#help { position: absolute; top: 46px; right: 12px; width: 360px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--gold-dim); font-size: 12px; line-height: 1.9; }
#help h3 { margin: 0 0 4px; color: var(--gold); font-size: 14px; }
#help b { color: #fff; }

.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(0,0,0,.2), rgba(0,0,0,.7)); z-index: 10; }
#bprep { background: none; align-items: flex-start; padding-top: 120px; pointer-events: none; }
#bprep .panel { pointer-events: auto; }
.panel { width: min(760px, calc(100vw - 32px)); max-height: 90vh; overflow-y: auto; padding: 24px 30px; text-align: center; background: rgba(20,15,10,.93);
  border: 1px solid var(--gold); box-shadow: 0 0 0 4px rgba(0,0,0,.6), 0 0 0 5px var(--gold-dim), 0 20px 60px rgba(0,0,0,.6); }
.panel.small { width: min(520px, calc(100vw - 32px)); }
.ptitle { font-family: var(--f-title); font-weight: 900; font-size: 34px; color: var(--gold); }
#bprepText { margin: 8px 0; line-height: 1.7; }
.bigbtn { font-family: var(--f-title); font-weight: 900; font-size: 28px; padding: 6px 40px; margin-top: 12px; cursor: pointer; color: #fff3d0; background: linear-gradient(#a33a26, #5e1a10); border: 2px solid var(--gold); letter-spacing: 4px; }
.bigbtn:hover { filter: brightness(1.2); }
#bresTitle { font-family: var(--f-brush); font-size: 72px; letter-spacing: 10px; }
#bresTitle.win { color: var(--gold); } #bresTitle.lose { color: #c8412e; }
#bresSub { margin-bottom: 10px; opacity: .85; }
#bresStats table { margin: 0 auto 8px; border-collapse: collapse; font-size: 13px; }
#bresStats td, #bresStats th { padding: 3px 12px; border-bottom: 1px solid rgba(214,178,94,.15); }
#bresStats th { color: var(--gold); font-weight: 500; }

/* 战法 Cut-in */
#cutin { position: absolute; inset: 0; pointer-events: none !important; overflow: hidden; z-index: 6; }
#cutin .ci-flash { position: absolute; inset: 0; background: #fff; opacity: 0; }
#cutin .ci-band { position: absolute; left: -10%; right: -10%; top: 50%; height: clamp(110px, 24vh, 200px); margin-top: calc(clamp(110px, 24vh, 200px) * -0.62); transform: skewY(-6deg) scaleY(0);
  background: linear-gradient(90deg, rgba(0,0,0,.92), var(--fcd) 22%, var(--fc) 50%, var(--fcd) 78%, rgba(0,0,0,.92));
  border-top: 4px solid var(--kc); border-bottom: 4px solid var(--kc); box-shadow: 0 0 40px var(--kc), 0 0 0 2px #000; overflow: hidden; }
#cutin .ci-lines { position: absolute; inset: -20px; opacity: .35;
  background: repeating-linear-gradient(90deg, transparent 0 38px, rgba(255,255,255,.55) 38px 40px, transparent 40px 90px, rgba(255,255,255,.3) 90px 91px); }
#cutin .ci-por { position: absolute; top: 50%; width: clamp(120px, 27vh, 230px); height: clamp(120px, 27vh, 230px); margin-top: calc(clamp(120px, 27vh, 230px) * -0.68); image-rendering: pixelated;
  border: 4px solid var(--kc); box-shadow: 0 0 0 3px #000, 0 0 30px var(--kc); opacity: 0; }
#cutin .ci-text { position: absolute; top: 50%; margin-top: calc(clamp(110px, 24vh, 200px) * -0.5); opacity: 0; white-space: nowrap; text-shadow: 0 3px 0 #000, 0 0 12px #000; }
#cutin .ci-name { font-size: clamp(14px, 2.4vh, 22px); font-weight: 700; color: #fff; letter-spacing: 4px; }
#cutin .ci-skill { font-family: var(--f-brush); font-size: clamp(40px, 8vh, 80px); line-height: 1.05; color: #fff6d0; letter-spacing: 6px;
  -webkit-text-stroke: 2px var(--kc); text-shadow: 0 4px 0 #000, 0 0 24px var(--kc); }
#cutin .ci-line { font-size: clamp(14px, 2.4vh, 22px); color: #fff; margin-top: 6px; }
#cutin.left .ci-por { left: 6%; } #cutin.left .ci-text { left: calc(6% + clamp(120px, 27vh, 230px) + 28px); }
#cutin.right .ci-por { right: 6%; } #cutin.right .ci-text { right: calc(6% + clamp(120px, 27vh, 230px) + 28px); text-align: right; }
#cutin.play .ci-flash { animation: ciFlash .35s ease-out; }
#cutin.play .ci-band { animation: ciBand 1.7s cubic-bezier(.2,.9,.3,1) forwards; }
#cutin.play .ci-lines { animation: ciLines .5s linear infinite; }
#cutin.play.left .ci-por { animation: ciPorL 1.7s cubic-bezier(.2,.9,.3,1) forwards; }
#cutin.play.right .ci-por { animation: ciPorR 1.25s cubic-bezier(.2,.9,.3,1) forwards; }
#cutin.play .ci-text { animation: ciText 1.7s ease-out forwards; }
#cutin.play .ci-skill { animation: ciSlam 1.7s cubic-bezier(.2,1.4,.4,1) forwards; }
#cutin.play.right .ci-band, #cutin.play.right .ci-text, #cutin.play.right .ci-skill { animation-duration: 1.25s; }
@keyframes ciFlash { 0% { opacity: .85; } 100% { opacity: 0; } }
@keyframes ciBand { 0% { transform: skewY(-6deg) scaleY(0); } 12% { transform: skewY(-6deg) scaleY(1.08); } 18%, 82% { transform: skewY(-6deg) scaleY(1); } 100% { transform: skewY(-6deg) scaleY(0); } }
@keyframes ciLines { from { transform: translateX(0); } to { transform: translateX(-91px); } }
@keyframes ciPorL { 0% { transform: translateX(-140%) skewX(-8deg); opacity: 0; } 18% { transform: translateX(6%) skewX(0); opacity: 1; } 26%, 80% { transform: translateX(0); opacity: 1; } 100% { transform: translateX(-40%); opacity: 0; } }
@keyframes ciPorR { 0% { transform: translateX(140%) skewX(8deg); opacity: 0; } 18% { transform: translateX(-6%) skewX(0); opacity: 1; } 26%, 80% { transform: translateX(0); opacity: 1; } 100% { transform: translateX(40%); opacity: 0; } }
@keyframes ciText { 0%, 15% { opacity: 0; } 25%, 82% { opacity: 1; } 100% { opacity: 0; } }
@keyframes ciSlam { 0%, 15% { transform: scale(2.4); } 28% { transform: scale(.94); } 34%, 100% { transform: scale(1); } }

/* ---------- 终局 CG（src/intro/unify.js）：2.35:1 遮幅，字幕定宽定高 ---------- */
#intro { position: fixed; inset: 0; z-index: 100; background: #000; overflow: hidden; --bar: 0px; }
#intro > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.in-bar { position: absolute; left: 0; right: 0; height: var(--bar); background: #000; z-index: 2; }
.in-bar.top { top: 0; }
.in-bar.bot { bottom: 0; }
.in-frame { position: absolute; left: 0; right: 0; top: var(--bar); bottom: var(--bar); pointer-events: none; z-index: 1; }
.in-verse { position: absolute; top: 10%; right: 9%; writing-mode: vertical-rl; visibility: hidden;
  font-family: var(--f-brush); font-size: clamp(16px, 6.4vh, 70px); letter-spacing: .28em; color: #f6ead0;
  text-shadow: 0 0 16px rgba(0,0,0,.6), 0 2px 0 rgba(0,0,0,.35); }
.in-verse p { margin: 0 0 0 .55em; white-space: nowrap; }
.in-verse p + p { margin-top: 1.5em; font-size: .76em; color: #e9d7ae; }
.in-title { position: absolute; left: 50%; top: 13%; transform: translateX(-50%); text-align: center; visibility: hidden; }
.in-title .t { position: relative; font-family: var(--f-brush); font-size: clamp(64px, 14vh, 156px); line-height: 1.15; padding-left: .14em; letter-spacing: .14em; color: #f0cf82; white-space: nowrap;
  text-shadow: 0 5px 0 #3a2410, 0 0 36px rgba(255,186,110,.4); }
.in-title .s { display: inline-block; margin-top: 6px; padding: 4px 18px 4px calc(18px + .3em); font-size: clamp(14px, 2.1vh, 20px); letter-spacing: .3em; color: #fff1d6; white-space: nowrap; opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(40,16,8,.45) 18%, rgba(40,16,8,.45) 82%, transparent); text-shadow: 0 1px 4px rgba(0,0,0,.8); }
.in-title .seal { position: absolute; right: -58px; top: 16%; width: 44px; height: 50px; display: flex; align-items: center; justify-content: center; opacity: 0;
  writing-mode: vertical-rl; font-family: var(--f-brush); font-size: 19px; line-height: 1; color: #fbe6d0; background: #a8261a; border-radius: 3px; box-shadow: inset 0 0 0 2px rgba(255,225,190,.35), 0 2px 8px rgba(0,0,0,.4); }
.in-fade { position: absolute; inset: 0; background: #000; z-index: 3; pointer-events: none; }
.in-skip { position: absolute; right: 28px; bottom: max(14px, calc(var(--bar) / 2 - 14px)); z-index: 4; padding: 4px 12px; font-size: 14px; letter-spacing: .25em; color: #d8c8a8; cursor: pointer; opacity: 0; transition: opacity .8s; }
.in-skip:hover { color: #fff4dc; }
/* 明亮画面用墨色字，诗句可放左侧 */
.in-verse.left { right: auto; left: 9%; }
.in-verse.ink { color: #2c1a12; text-shadow: 0 0 14px rgba(255,248,236,.85), 0 0 3px rgba(255,248,236,.9); }
.in-verse.ink p + p { color: #4a2e1e; }
/* 终局 CG（src/intro/unify.js）：登基名牌（头像 + 名号，单行定宽）、标题下的功臣行 */
.un-lord { position: absolute; left: 6%; bottom: 10%; height: 120px; display: flex; align-items: center; gap: 22px; visibility: hidden; opacity: 0; --hc: #d6b25e; }
.un-lord::before { content: ''; position: absolute; left: -60px; top: -30px; right: -60px; bottom: -30px; z-index: -1; background: radial-gradient(ellipse at 35% 55%, rgba(30,14,6,.6), transparent 70%); }
.un-lord img { width: 112px; height: 112px; flex: none; object-fit: cover; border-radius: 6px; image-rendering: auto; box-shadow: 0 0 0 3px var(--hc), 0 0 0 5px rgba(240,210,130,.8), 0 6px 18px rgba(0,0,0,.5); }
.un-lt { width: 420px; border-left: 4px solid var(--hc); padding-left: 18px; }
.un-lt .nm { font-family: var(--f-brush); font-size: 64px; line-height: 76px; color: #fff4dc; letter-spacing: .08em; text-shadow: 0 3px 0 rgba(0,0,0,.45), 0 0 18px rgba(0,0,0,.5); white-space: nowrap; }
.un-lt .zi { margin-left: 14px; font-size: 20px; color: #f0d898; letter-spacing: .2em; white-space: nowrap; text-shadow: 0 1px 4px rgba(0,0,0,.8); }
.un-lt .ep { font-size: 16px; line-height: 30px; height: 30px; color: #efe0bc; letter-spacing: .32em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 4px rgba(0,0,0,.85); }
.unify .in-title .s { max-width: 86vw; overflow: hidden; text-overflow: ellipsis; }
.unify .in-title::before { content: ''; position: absolute; left: -12%; right: -12%; top: -18%; bottom: -40%; z-index: -1; background: radial-gradient(ellipse at 50% 45%, rgba(6,8,24,.62), transparent 68%); }
.un-cred { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); width: 80vw; max-width: 900px; margin-top: 14px; font-size: clamp(13px, 1.9vh, 18px); line-height: 1.6; letter-spacing: .28em; color: #e8d6ae; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; text-shadow: 0 1px 4px rgba(0,0,0,.85); }
/* 开场 CG（src/intro/opening.js）：16:9 视频等比居中，字幕叠在画面内；画面偏亮，字用浅色加深色描影 */
.op-stage { position: absolute; left: 50%; top: 50%; width: min(100vw, 177.78vh); height: min(100vh, 56.25vw); transform: translate(-50%, -50%); overflow: hidden; }
.op-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.opening .in-verse { text-shadow: 0 0 18px rgba(20,8,4,.85), 0 2px 0 rgba(20,8,4,.6); }
.opening .in-title { top: 8%; }
.opening .in-title .t { color: #f6ead0; text-shadow: 0 4px 0 rgba(40,16,8,.8), 0 0 30px rgba(40,16,8,.6); }
.opening .in-skip { cursor: default; }

/* ============================ 英文界面（data-lang=en） ============================
   中文排版的字距（按钮 12px、标题 16px 等）用在拉丁字母上会把单词拆散：一律归零，只给 Cinzel 大标题留一点；
   竖排诗句改横排；大标题字号按英文长度收小。 */
:root[data-lang=en] body * { letter-spacing: normal !important; text-indent: 0 !important; }
:root[data-lang=en] .title { font-size: 64px; line-height: 1.1; letter-spacing: .04em !important; text-indent: 0; white-space: normal; }
:root[data-lang=en] .in-title .t { font-size: clamp(40px, 8vh, 92px); padding-left: 0; }
:root[data-lang=en] .opening .in-title .t { font-size: min(4vw, 7.1vh); }   /* 英文标题长：按画面宽度定字号，占画面约七成 */
:root[data-lang=en] .in-verse { writing-mode: horizontal-tb; max-width: 40%; font-size: clamp(14px, 3.2vh, 32px); }
:root[data-lang=en] .in-verse p { margin: 0 0 .3em; white-space: normal; }
:root[data-lang=en] .in-verse p + p { margin-top: .8em; }
:root[data-lang=en] .ss-item { gap: 8px; }
:root[data-lang=en] .ss-y { width: 44px; }
:root[data-lang=en] .ss-m { width: 46px; text-align: left; }
:root[data-lang=en] .ss-n { font-size: var(--s3); }
/* 标签格：英文标签较长，标签列加宽、字号降一档 */
:root[data-lang=en] .kv { grid-template-columns: 78px minmax(0, 1fr); }
:root[data-lang=en] .kv > .k { font-size: var(--s1); }
:root[data-lang=en] .fname2 { font-size: var(--s2); }
:root[data-lang=en] .ofs { grid-template-columns: 78px minmax(0, 1fr) 40px 20px; }
:root[data-lang=en] .ofm { grid-template-columns: 78px minmax(0, 1fr) 50px 64px; }
:root[data-lang=en] :is(.ofs, .ofm) > span { font-size: var(--s1); }
/* 游戏设定：英文说明较长，改为标题下方换行显示 */
:root[data-lang=en] .sysm-body .sm-row { flex-wrap: wrap; row-gap: 0; }
:root[data-lang=en] .sysm-body .sm-row .hint { flex-basis: 100%; margin-left: 24px; white-space: normal; }
:root[data-lang=en] .kvs.c3 .kv { grid-template-columns: 44px minmax(0, 1fr); }

/* 悬停说明框（src/tooltip.js 接管 title） */
#uitip { position: fixed; z-index: 1000; max-width: 360px; padding: 6px 10px; pointer-events: none; opacity: 0; transition: opacity .12s;
  font-size: var(--s1); line-height: 1.6; color: var(--tx); background: rgba(20, 14, 9, .96); border: 1px solid #000; box-shadow: inset 0 0 0 1px var(--br1), 0 6px 16px rgba(0, 0, 0, .6); }
#uitip.on { opacity: 1; }
