:root {
  color-scheme: light dark;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #1c2430;
  --muted: #6b7684;
  --line: #d9dee5;
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --danger: #c62828;
  --warnbg: #fff4f2;
  --warnline: #f0b4ab;
  --on: #1a9c53;
  --off: #97a1ad;
  --radius: 8px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c;
    --panel: #1a2029;
    --ink: #e6ebf2;
    --muted: #9aa6b4;
    --line: #2b333e;
    --accent: #4b8bf5;
    --accent-ink: #0b1220;
    --danger: #ff6b5e;
    --warnbg: #2a1c1b;
    --warnline: #7d3730;
    --on: #43c97e;
    --off: #6b7684;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
/* 滚动条统一加粗到 12px（2026-11-12 现场反馈：1280x900 下整页滚动条又细又小，几乎抓不住）。
   scrollbar-width/scrollbar-color = Firefox 与 Chromium 121+ 的标准写法；
   ::-webkit-scrollbar 三件套 = 老 Chromium / Edge 的实际生效路径。两套都给，别只给一套。 */
html, body, .sections, .section, .table-wrap, .tlist, .box, #machine-detail, #thread-drawer > .db {
  scrollbar-width: auto;
  scrollbar-color: #9aa4b2 #eef1f5;
}
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: #9aa4b2; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #7d8794; }
::-webkit-scrollbar-track { background: #eef1f5; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 -apple-system, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
code, .mono { font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: 12.5px; }
muted, .muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.spacer { flex: 1; }
.red { color: var(--danger); }

/* ---------- 甯冨眬 ---------- */
/* 2026-11-12 撑满高度：整页不再滚动，滚动只在 .sections（分区多时）与 .table-wrap（行多时）内部。
   必须 height:100vh 而不是 min-height:100vh —— min-height 只保证"至少一屏"，
   内容不够时子元素分不到可用的高度，.table-wrap 就塌回内容高度（现场「列表只占顶部 300px」）。 */
.app { display: flex; height: 100vh; min-height: 100vh; }
.side {
  width: 172px;
  flex: 0 0 172px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { font-weight: 700; padding: 14px 16px; letter-spacing: .3px; border-bottom: 1px solid var(--line); }
.nav { display: flex; flex-direction: column; padding: 8px; gap: 2px; flex: 1; }
.navitem {
  display: block; padding: 9px 12px; border-radius: 6px; color: var(--ink);
  border: 1px solid transparent;
}
.navitem:hover { background: rgba(37, 99, 235, .08); }
.navitem.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.side-foot { padding: 10px 14px; border-top: 1px solid var(--line); }
.who { font-size: 12.5px; margin-bottom: 6px; color: var(--muted); }
.main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.top {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  border-bottom: 1px solid var(--line); background: var(--panel);
  position: sticky; top: 0; z-index: 5;
}
.burger { display: none; font-size: 18px; line-height: 1; }
/* .sections 是"分区滚动容器"：flex:1 吃掉 .main 里 .top 之外的全部高度，
   min-height:0 才允许它**小于内容**（不写这条，flex item 的 min-height:auto = 内容高度，
   就永远撑到整页滚，反而把 .table-wrap 顶出视口）。
   自己也要是 flex column —— 它是 .section.on 的父容器，不设 flex 时分区高度仍然 = 内容高度
   （2026-11-12 实测：漏了这条，1280x900 下 #sec-machines 量到 1829px，列表区照样没有"撑满"）。 */
.sections { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: auto; padding: 14px 16px 14px; }
/* 分区本身也是纵向 flex：工具条 / 表单 / 详情块按内容高度固定，只有 .table-wrap 会长。 */
.section { display: none; min-height: 0; }
.section.on { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
.section.on > * { flex: 0 0 auto; }
.section.on > .table-wrap { flex: 1 1 auto; min-height: 0; }

/* ---------- 鎺т欢 ---------- */
.btn {
  font: inherit; padding: 5px 11px; border-radius: 6px; cursor: pointer;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line);
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: var(--danger); border-color: var(--warnline); }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.mini {
  font: inherit; font-size: 12px; padding: 1px 7px; border-radius: 5px; cursor: pointer;
  background: transparent; color: var(--accent); border: 1px solid var(--line);
}
.mini.danger { color: var(--danger); }
/* 「停止中… / 启动中…」（2026-11-13）：点击后到回执前的那一段。按钮同时被 disabled
   （防连点）+ aria-busy（读屏能听到"正在处理"）。这里只补 .mini 的置灰与转圈光标 ——
   行宽是固定的（.runtoggle 有 min-width），文案换长短不会把列表挤动。 */
.mini[disabled] { opacity: .55; cursor: progress; }
.mini[aria-busy="true"] { opacity: .75; cursor: progress; }
/* 新插进来的线程行（2026-11-13 ④）：自动刷新把新行补进列表时闪 2 秒底色，
   客户一眼能找到"刚来的那一条"。用动画而不是定时改 style：动画结束后底色自己回到透明，
   不会和 .kw-dim / .is-sel 之类的类互相盖。减少动态效果时改成一条静态边框（不闪）。 */
.tlist .titem.row-new { animation: nf-rownew 2s ease-out 1; }
@keyframes nf-rownew {
  0% { background: rgba(46, 160, 67, .26); }
  100% { background: transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .tlist .titem.row-new { animation: none; box-shadow: inset 0 0 0 1px var(--accent); }
}
.link { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--panel);
  border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px;
}
input.tiny { width: 62px; }
select { padding: 4px 6px; }
.toolbar, .toolbar2 {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 0; border-bottom: 1px solid var(--line); margin-bottom: 8px;
}
.toolbar2 { border-bottom: 0; padding-top: 0; }
/* 鍙粰宸ュ叿鏍忛噷鐨?<label class="sel">锛堟帓搴忎笅鎷夛級鐢ㄣ€?   **蹇呴』鎸傚湪 .toolbar/.toolbar2 涓嬮潰**锛氭満鍣ㄨ〃鏇剧粡鐢?`<tr class="sel">` 鏍囪閫変腑琛岋紝
   瑁搁€夋嫨鍣?`.sel{display:inline-flex}` 鎶婃暣琛屽彉鎴?flex 琛?鈥斺€?璇ヨ鐨?<td> 鍏ㄩ儴鑴辩琛ㄦ牸鍒楃綉鏍笺€?   鎸ゅ埌宸﹁竟锛屽悓鏃惰〃鏍煎鍑轰竴涓尶鍚嶅崟鍏冩牸鎶娿€屾満鍣ㄣ€嶅垪鎾戝埌鍑犵櫨鍍忕礌锛屼簬鏄〃澶翠笌鏁版嵁琛屽交搴曢敊浣嶃€?*/
.toolbar .sel, .toolbar2 .sel { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); }

/* ---------- 琛ㄦ牸 ---------- */
/* table-layout: fixed + 姣忓紶琛ㄧ殑 <colgroup> 鏄惧紡鍒楀 = 琛ㄥご涓庢暟鎹鐢ㄥ悓涓€濂楀垪缃戞牸锛?   鍙 <th> 鏁颁笌姣忚 <td> 鏁颁竴鑷达紙鑷鏂█锛夛紝灏变笉鍙兘閿欎綅銆?   鍘嗗彶鍧戯細table-layout:auto 鏃跺垪瀹界敱鍐呭鍐冲畾锛屼竴琛岄噷鍙鏈変竴涓崟鍏冩牸鎹簡 display
   锛堜緥濡?td 涓婃寕 .acts{display:flex}锛夛紝鏁磋〃鐨勫搴﹀垎閰嶅氨浼氳鎷借窇銆?*/
/* 2026-11-12 列表区自适应撑满 + 表头固定：
   overflow:auto 让"行多时在列表区内滚动"，而不是整页滚；scrollbar-gutter:stable 预留滚动条位，
   否则纵向滚动条一出现就把「操作」列往左压 12px（现场看到按钮被滚动条盖住一点）。
   table-layout: fixed + 每张表的 <colgroup> 显式列宽 = 表头与数据行用同一套列网格；
   只要 <th> 数与每行 <td> 数一致（自检断言），就不可能错位。
   历史坑：table-layout:auto 时列宽由内容决定，一行里只要有一个单元格换了 display
   （例如 td 上挂 .acts{display:flex}），整表的宽度分配就会被拽跑。 */
.table-wrap {
  flex: 1 1 auto; min-height: 0; overflow: auto; scrollbar-gutter: stable;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
}
.tbl { width: 100%; border-collapse: collapse; table-layout: fixed; }
.tbl th, .tbl td { text-align: left; padding: 5px 9px; border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere; }
.tbl th { font-size: 12px; color: var(--muted); font-weight: 600; background: rgba(0, 0, 0, .02); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tr.sel, .tbl tr.is-sel { background: rgba(37, 99, 235, .06); }
/* 表头固定（2026-11-12）：列表区内部滚动时表头不离场。
   背景**必须不透明** —— 上面 .tbl th 的 rgba(0,0,0,.02) 是半透明的，行滚到下面会透出来串行；
   这里用 --panel（当面主题的实色面板底色）盖死。
   border-collapse:collapse 下 sticky 单元格的下边框不跟着滚，所以边框用 inset 阴影补一条。 */
.tbl thead th {
  position: sticky; top: 0; z-index: 3;
  background: var(--panel, #fff);
  box-shadow: inset 0 -1px 0 var(--line);
}
/* 操作列不贴边：最后一列右侧留 12px 呼吸位（配合 .table-wrap 的 scrollbar-gutter:stable，
   纵向滚动条出现时也不压住「操作」里的按钮）。 */
.tbl thead th:last-child, .tbl tbody td:last-child { padding-right: 12px; }
.tbl tr.dim { opacity: .62; }
.tbl td.empty { text-align: center; color: var(--muted); padding: 18px 8px; }
.nowrap { white-space: nowrap; }
.tbl td.nowrap { overflow: hidden; text-overflow: ellipsis; }
/* 琛ㄦ牸閲岀殑鎸夐挳缁勪竴寰嬪寘涓€灞?<div class="acts">锛屼笉瑕佹妸 .acts 鎸傚埌 <td> 涓婏細
   td 涓€鏃?display:flex 灏变笉鍐嶆槸 table-cell锛屾祻瑙堝櫒浼氱粰瀹冭ˉ涓€涓尶鍚嶅崟鍏冩牸锛屽垪缃戞牸闅忎箣婕傜Щ銆?*/
.acts { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }

/* ---------- 鍒楀锛堟瘡寮犺〃鍚堣 100%锛?---------- */
/* v7 自更新：首列「勾选框」+ 「执行器版本」列（紧跟状态）。10 列合计仍是 100%。 */
.tbl.machines .w-check { width: 3%; }
.tbl.machines .w-host { width: 15%; }
.tbl.machines .w-act { width: 9%; }
.tbl.machines .w-state { width: 14%; }
.tbl.machines .w-ver { width: 13%; }
/* v6 线路列（状态之后）：主文本「线路2」+ 小字短名。合计仍是 100%（改一列要重算整行）。 */
.tbl.machines .w-line { width: 10%; }
.tbl.machines .w-skew { width: 8%; }
.tbl.machines .w-threads { width: 11%; }
.tbl.machines .w-pending { width: 5%; }
.tbl.machines .w-ops { width: 12%; }

.tbl.accounts .w-user { width: 22%; }
.tbl.accounts .w-role { width: 10%; }
.tbl.accounts .w-mach { width: 10%; }
.tbl.accounts .w-login { width: 18%; }
.tbl.accounts .w-state { width: 12%; }
.tbl.accounts .w-ops { width: 28%; }

.tbl.receipts .w-time { width: 13%; }
.tbl.receipts .w-kind { width: 11%; }
.tbl.receipts .w-state { width: 9%; white-space: nowrap; }
.tbl.receipts .w-nums { width: 14%; }
.tbl.receipts .w-threads { width: 9%; }
.tbl.receipts .w-restart { width: 12%; }
.tbl.receipts .w-note { width: 32%; }
.tbl.logs .w-note { width: 32%; }


/* ---------- 绾跨▼鍒楄〃锛歞iv + CSS Grid锛堜笉鐢?<table>锛?----------
   涓轰粈涔堜笉鐢ㄨ〃鏍硷細鎵嬫満绔崱鐗囧寲蹇呴』鎶?table/tr/td 鍏ㄦ敼鎴?display:block锛?   鑰屽睍寮€璇︽儏鍘熸潵鏄?`<td colspan="5">` 閭ｄ竴琛?鈥斺€?瀹冧笉鍦ㄥ崱鐗囨祦閲岋紝浼氬拰鐩搁偦鍗＄墖鍙犲湪涓€璧枫€?   鐜板湪姣忔潯绾跨▼鏄竴涓?.titem 瀹瑰櫒锛?trow锛堜竴琛?grid锛変笌 .tdetail锛堣鎯咃級鏄?*鍚屼竴鐖惰妭鐐逛笅鐨勭浉閭诲厔寮?*锛?   璇︽儏灞曞紑鍙兘鎶婅繖寮犲崱鎾戦珮锛岀粨鏋勪笂涓嶅彲鑳介噸鍙犮€?   绂佹锛氱粰 .trow / .tdetail / .titem 鐢?position:absolute锛屾垨鐢?height:0 / overflow:hidden 瑁硅鎯呫€?*/
.tlist { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.tlist .thead, .tlist .trow {
  display: grid;
  /* 2026-11-13：抽屉占掉 432px 后列表只剩 ~640px —— 列的最小宽必须收窄，
     否则操作列（勾选 / ⋯ / 编辑）会被裁到抽屉底下点不到（1280 实测截图）。 */
  grid-template-columns: 44px minmax(96px, 1fr) minmax(120px, 1.15fr) minmax(120px, 1.15fr) 252px;
  gap: 8px;
  align-items: center;
}
.tlist .thead { padding: 6px 10px; border-bottom: 1px solid var(--line); }
.tlist .thead span { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.titem { border-top: 1px solid var(--line); }
.tlist .thead + .titem { border-top: 0; }
.trow { padding: 4px 10px; min-height: 34px; }
.trow.isend { box-shadow: inset 3px 0 0 var(--accent); }
.trow > span { min-width: 0; }
.trow .c-num { color: var(--muted); font-variant-numeric: tabular-nums; }
.trow .c-link, .trow .c-send { overflow: hidden; }
.trow .c-act { display: flex; gap: 4px; align-items: center; }
/* 操作列（2026-11-13 用户截图报障后重做）：**平铺一排，绝不折行**。
   上一版为了防溢出写成 flex-wrap: wrap，结果 6 个元素（勾选 / ⋯ / 编辑 / 删除 / 复制全部 / 停止）
   折成两排，截图里就是"累在一起"。用户明确要求「直接平铺」。
   口径：列宽放到 252px（见 .tlist 的 grid-template-columns 末列）+ 按钮紧凑内边距；
   nowrap 兜底 —— 万一被压窄，宁可整体横向滚动，也不折行。 */
.tlist .trow .c-act { flex-wrap: nowrap; gap: 3px; }
.tlist .trow .c-act .mini { white-space: nowrap; padding: 2px 5px; }
.tlist .trow .c-act .mini.runtoggle { min-width: 52px; }
.tdetail { padding: 8px 10px; border-top: 1px dashed var(--line); background: rgba(0, 0, 0, .02); }
.tempty { text-align: center; color: var(--muted); padding: 18px 8px; }

.chips { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.chip {
  display: inline-block; max-width: 168px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: rgba(37, 99, 235, .1); border-radius: 5px; padding: 0 6px; font-size: 12.5px;
}
.more { color: var(--muted); font-size: 12px; margin-left: 4px; cursor: default; }
.tag {
  display: inline-block; font-size: 11px; padding: 0 5px; border-radius: 4px;
  border: 1px solid var(--line); color: var(--muted); margin-left: 5px;
}
.tag.red { color: var(--danger); border-color: var(--warnline); }
/* 待下发徽标（v13）：换收码/换发码/停止启动/改设置之后，行内立刻能看到新值 */
.tag.pending { color: var(--accent); border-color: var(--accent); background: rgba(37, 99, 235, .1); }
/* 已停止（v13）：这一行不在收码，行左侧不再有发码的强调条，改用灰条 + 灰字 */
.tag.stopped { color: var(--muted); border-color: var(--line); background: rgba(120, 120, 120, .12); }
.trow.isstopped { opacity: .72; }
.trow.isstopped .c-link .lnk { text-decoration: line-through; }
/* 发码限制的两个数字框：非法值时标红（app.js 的 syncSendLimitState 加 .invalid） */
.nt-fld input.invalid { border-color: var(--danger); outline: 1px solid var(--danger); }
.lnk { display: inline-block; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.detgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 4px 14px; padding: 6px 2px; }
.detgrid .k { color: var(--muted); font-size: 12px; margin-right: 6px; }
.detacts { display: flex; gap: 6px; flex-wrap: wrap; padding: 4px 2px 8px; }

/* 鍥炴墽 */
.tbl tr.warn { background: var(--warnbg); }
.tbl tr.warn td { border-bottom-color: var(--warnline); }
.state { font-size: 11.5px; padding: 0 6px; border-radius: 4px; border: 1px solid var(--line); white-space: nowrap; }
.state.acked { color: var(--on); border-color: var(--on); }
.state.failed { color: var(--danger); border-color: var(--warnline); }
.state.pending, .state.sent { color: var(--muted); }
.sub { margin-top: 14px; }
.subhead { font-weight: 600; padding: 6px 0; display: flex; align-items: center; gap: 8px; }

/* ---------- 回执区：默认只露 3 行，超出在区内滚动（2026-11-13 现场反馈）----------
   以前回执区跟线程列表抢高度，默认吃掉下半屏 ~55%，列表只剩几行。
   现在：① 收起 = 表头 + 3 行 ≈ 150px（.receipts-wrap 自己的 max-height）；
        ② 展开 = 回到 ~55vh（body.receipts-expanded，状态存 localStorage）；
        ③ 列表让出的空间由 .stage > .stage-list > .tlist 的 flex:1 吃掉。
   为什么 class 挂 body 而不是 #receipts-<act>：那块会被 pollReceipts / 换机器**整段 replace**，
   挂在会被替换掉的节点上，一次轮询就丢状态。 */
.receipts-wrap {
  max-height: 150px; overflow: auto; scrollbar-gutter: stable;
}
body.receipts-expanded .receipts-wrap { max-height: 55vh; }
/* 批量新建面板的标题行（一行说明语法，不必等 placeholder 消失才看得到规则） */
.paste-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
/* textarea 的高度由 app.js 的 syncPasteHeight() 按内容算（min 3 行 / max 40 行或 60vh）：
   这里只钉住宽度，resize:none 免得用户手拖出来的高度和自适应打架。 */
#paste-text { width: 100%; resize: none; overflow-y: hidden; }
/* 「统一默认设置」（批量新建）：.nt-* 那套样式只在 .newthread 下生效，这里是第二处使用点，
   样式按同一套写一遍（勾选组 / 行内 / 竖排字段），别让它长成裸控件。 */
.paste-defaults {
  margin: 8px 0; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--radius); background: rgba(0, 0, 0, .015);
}
.paste-defaults > summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.paste-defaults .nt-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; }
.paste-defaults .nt-checks .chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.paste-defaults .nt-checks .chk input { width: 16px; height: 16px; }
.paste-defaults .nt-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.paste-defaults .nt-inline input.tiny { width: 72px; }
.paste-defaults .nt-fld { display: flex; flex-direction: column; gap: 2px; font-size: 13px; margin-top: 8px; }
/* 黄字提醒（编辑抽屉：该线程的 forwardParams 未上报） */
.warn-hint {
  color: #a86200; background: #fff8e6; border: 1px solid #f0d48a;
  border-radius: 6px; padding: 6px 9px; margin: 8px 0 2px;
}
@media (prefers-color-scheme: dark) {
  .warn-hint { color: #f0c674; background: #2a2317; border-color: #6b5730; }
}

/* 鍗＄墖 / 琛ㄥ崟 */
.card, .box {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin: 8px 0;
}
.card h2 { font-size: 15px; margin: 0 0 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 14px; align-items: end; }
.grid .wide { grid-column: 1 / -1; }
.fld { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--muted); }
.fld input, .fld textarea, .fld select { width: 100%; }
.out { font-size: 12.5px; color: var(--ink); white-space: pre-wrap; word-break: break-all; }
/* 机器详情的心跳摘要（2026-11-12）：一行文字取代原来那段 hb.body 原始 JSON。
   颜色只表达"成没成功"：绿=成功 / 红=已中断 / 灰=从未成功。 */
.hb-sum {
  margin-top: 10px; padding: 6px 10px; font-size: 12.5px;
  border: 1px solid var(--line); border-left-width: 3px; border-radius: var(--radius);
  background: var(--panel);
}
.hb-sum.is-ok { border-left-color: var(--on); }
.hb-sum.is-bad { border-left-color: var(--danger); color: var(--danger); }
.hb-sum.is-none { border-left-color: var(--off); color: var(--muted); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.dot.on { background: var(--on); }
.dot.off { background: var(--off); }

/* 鐧诲綍 */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
/* 瀹藉害鎸夎鍙ｇ畻锛氭墜鏈轰笂 100vw 鍑忔帀宸﹀彸鍚?16px 鐨勫懠鍚镐綅锛岀粷涓嶆瘮灞忓箷瀹斤紙浠ュ墠鍐欐 340px锛?   鍦?320~360 瀹界殑鑰佹満鍨嬩笂浼氭妸鍗＄墖鍙崇紭瑁佹帀銆佺櫥褰曟寜閽窡鐫€鍑虹晫锛夈€?*/
.login-wrap { width: 100%; max-width: min(420px, calc(100vw - 32px)); padding: 16px; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.login-card h1 { font-size: 16px; margin: 0 0 4px; }
.err { color: var(--danger); font-size: 12.5px; min-height: 16px; margin: 0; }
@media (max-width: 420px) {
  .login-wrap { padding: 12px; }
  .login-card { padding: 16px; }
}

/* ---------- 绐勫睆锛氬鑸敹璧锋垚椤堕儴鎶樺彔鑿滃崟 + 琛ㄦ牸鍙樺崱鐗?---------- */
/* ---------- 线程页 V1：列表 + 右侧 432px 抽屉（2026-11-13）----------
   .stage 是 flex 行：左列列表 flex:1 + 右列抽屉 flex:0 0 432px。
   桌面**不遮挡列表**（抽屉把列表压窄，列表始终可见、可点）；
   ≤760px 才改成「抽屉铺满、列表 display:none」（见下面 760 那段媒体查询）。

   两条硬要点：
     ① #thread-drawer 自己 display:flex，所以必须显式写 #thread-drawer[hidden]{display:none}
        —— 否则 hidden 属性被 display:flex 盖掉，就成了「关不掉的抽屉」；
     ② 抽屉内的表单沿用 .newthread 那套（分区 / 勾选组 / 位数框），这里只把它的卡片外壳去掉
        （.box 的 padding/border/margin 在抽屉里是多余的），控件 id 与语义全不变。 */
.section.on > .stage { flex: 1 1 auto; min-height: 0; }
.stage { display: flex; align-items: stretch; min-height: 0; }
.stage > .stage-list { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.stage > .stage-list > .tlist { flex: 1 1 auto; min-height: 0; overflow: auto; scrollbar-gutter: stable; }

#thread-drawer {
  flex: 0 0 432px; width: 432px; box-sizing: border-box; min-height: 0;
  display: flex; flex-direction: column;
  background: var(--panel); border-left: 1px solid var(--line);
  box-shadow: -8px 0 24px rgba(20, 30, 50, .10);
  /* 打开时的滑入（2026-11-13）：140ms 的 translateX，落在 120–160ms 这一段。
     骨架先出、内容后填，动画只负责"抽屉出现了"这一下，不拖慢可操作时间。
     系统开了「减少动态效果」时下面 @media 里整段关掉。 */
  transition: transform 140ms cubic-bezier(.2, .8, .2, 1);
  will-change: transform;
}
#thread-drawer[hidden] { display: none; }
@keyframes nf-drawer-in {
  from { transform: translateX(28px); opacity: .55; }
  to   { transform: translateX(0);    opacity: 1; }
}
#thread-drawer:not([hidden]) { animation: nf-drawer-in 140ms cubic-bezier(.2, .8, .2, 1) 1; }
@media (prefers-reduced-motion: reduce) {
  #thread-drawer { transition: none; animation: none; }
  #thread-drawer:not([hidden]) { animation: none; }
}
#thread-drawer > .dh {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
}
#thread-drawer > .dh .t {
  font-weight: 600; font-size: 13.5px; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#thread-drawer > .dh .dh-grow { flex: 1 1 auto; min-width: 0; }
#thread-drawer > .dh .dh-close { flex: 0 0 auto; line-height: 1; padding: 3px 8px; }
#thread-drawer > .db { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 12px; }
#thread-drawer > .df {
  flex: 0 0 auto; display: flex; gap: 8px;
  padding: 10px 12px; border-top: 1px solid var(--line); background: rgba(0, 0, 0, .02);
}
#thread-drawer > .df .btn { flex: 1 1 auto; min-height: 34px; }
#thread-drawer > .df .btn.primary { flex: 2 1 auto; }
#thread-drawer .newthread { margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
#thread-drawer .newthread .nt-sub { margin: 0; }
#thread-drawer .nt-sec {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .04em; margin: 2px 0;
}
#thread-drawer .nt-sec::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--line); }
#thread-drawer .nt-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#thread-drawer .nt-ro code {
  font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: 12px;
  background: rgba(0, 0, 0, .03); border: 1px dashed var(--line); border-radius: 5px;
  padding: 2px 6px; overflow-wrap: anywhere;
}

/* ---------- 抽屉骨架（点「编辑」立刻出，不等片段）----------
   .skel 由 #tpl-drawer-skel 克隆进 #thread-drawer-body：灰色占位块 + 一行「正在载入表单…」。
   关键点：骨架**没有 pointer 拦截层**、也不改抽屉高度 —— 片段回来时只换 .db 的内容，
   布局不跳（骨架块高度按真实控件的量级写的）。 */
.skel { padding: 2px 0; }
.skel-note { margin: 0 0 10px; font-size: 12.5px; color: var(--muted); }
.skel-line, .skel-block, .skel-chip {
  background: rgba(120, 134, 150, .16); border-radius: 6px;
}
.skel-line { height: 11px; margin: 0 0 8px; }
.skel-line.w30 { width: 30%; }
.skel-line.w40 { width: 40%; }
.skel-line.w50 { width: 50%; }
.skel-block { margin: 0 0 12px; }
.skel-block.h38 { height: 38px; }
.skel-block.h64 { height: 64px; }
.skel-chips { display: flex; gap: 8px; margin: 0 0 12px; }
.skel-chip { width: 74px; height: 20px; border-radius: 10px; }
@media (prefers-color-scheme: dark) {
  .skel-line, .skel-block, .skel-chip { background: rgba(200, 214, 230, .16); }
}

@media (max-width: 760px) {
  .app { flex-direction: column; }
  .side {
    width: 100%; flex: 0 0 auto; height: auto; position: sticky; top: 0; z-index: 20;
    border-right: 0; border-bottom: 1px solid var(--line);
    flex-direction: row; align-items: center; flex-wrap: wrap;
  }
  .brand { border: 0; padding: 10px 12px; }
  .nav { display: none; flex: 1 0 100%; flex-direction: column; padding: 0 8px 8px; }
  body.navopen .nav { display: flex; }
  .side-foot { display: flex; align-items: center; gap: 8px; border: 0; padding: 0 12px; }
  .burger { display: inline-block; }
  .sections { padding: 10px; }
  /* 绾跨▼鍒楄〃鍗＄墖鍖栵細妗岄潰閭ｅ grid 鍒楀鍦ㄦ墜鏈轰笂涓€寰嬪彉鎴?block锛屾瘡鏍间竴琛屻€屾爣绛?+ 鍊笺€嶃€?     璇︽儏鍧椾粛鍦ㄥ悓涓€寮犲崱鍐咃紙.titem锛夛紝灞曞紑鍙細鎶婂崱鐗囨拺楂?鈥斺€?杩欓噷涓嶈鍑虹幇 position/height 鑺辨椿銆?*/
  .tlist { border: 0; background: transparent; }
  .tlist .thead { display: none; }
  .titem {
    border: 1px solid var(--line); border-radius: var(--radius);
    margin: 6px 0; background: var(--panel);
  }
  .tlist .thead + .titem { border-top: 1px solid var(--line); }
  /* 娉ㄦ剰閫夋嫨鍣ㄨ甯?.tlist 鍓嶇紑锛氭闈㈤偅鏉℃槸 `.tlist .trow { display: grid }`锛?,2,0锛夛紝
     杩欓噷鑻ュ彧鍐?`.trow`锛?,1,0锛変細琚畠鐩栦綇锛屾墜鏈轰笂浠嶆棫鏄?5 鍒?grid 鈥斺€?妯悜婧㈠嚭銆侀摼鎺ヨ窇鍑哄睆銆?*/
  .tlist .trow { display: block; padding: 6px 8px; min-height: 0; }
  .tlist .trow > span { display: flex; gap: 8px; align-items: baseline; padding: 1px 0; min-width: 0; }
  .tlist .trow > span[data-label]::before {
    content: attr(data-label); flex: 0 0 76px; color: var(--muted); font-size: 12px;
  }
  .tlist .trow > .c-num { display: block; font-weight: 600; }
  .tlist .trow > .c-num::before { content: none; }
  .tlist .trow > .c-kw::before { content: none; }
  .tlist .trow > .c-kw { display: block; }
  .tlist .trow > .c-act { display: flex; }
  .tlist .trow .lnk, .tlist .trow .c-link, .tlist .trow .c-send { max-width: none; }
  .tlist .trow .lnk { flex: 1 1 auto; min-width: 0; max-width: none; }
  .tlist .trow .mini { flex: 0 0 auto; white-space: nowrap; }
  /* 行内「复制全部」（2026-11-13）：窄屏卡片模式下操作列**整行展开**，
     按钮 ≥40px 高（触屏可点区）。只加 min-height / padding，不改桌面那套紧凑尺寸。
     v13：加了第 5 颗「停止/启动」之后 390 宽放不下一排（实测溢出 20px），
     于是改成**允许换行**：一行放不下就折到第二行，容器不横向溢出、按钮也不缩到点不到。 */
  .tlist .trow > .c-act { flex-wrap: wrap; gap: 6px; row-gap: 6px; }
  .tlist .trow .c-act .mini { min-height: 40px; padding: 0 10px; line-height: 38px; }
  .tlist .trow .c-act .mini.copyall { flex: 0 1 auto; }
  /* 「停止 / 启动」是这一列里唯一会变文案的按钮：不许被压窄到只剩一个字 */
  .tlist .trow .c-act .mini.runtoggle { flex: 0 0 auto; min-width: 62px; }
  /* 鍥炴墽 / 鏃ュ織鍦ㄦ墜鏈轰笂鏁村潡妯粴锛屾牸瀛愰噷鐨勬椂闂翠笉瑕佽 ellipsis 鎴帀 */
  .tbl.receipts td.nowrap { white-space: normal; overflow: visible; text-overflow: clip; }
  .tbl.receipts .state { white-space: nowrap; }
  .tdetail { border-radius: 0 0 var(--radius) var(--radius); }
  .detgrid { grid-template-columns: 1fr; }
  .toolbar, .toolbar2 { gap: 6px; flex-wrap: wrap; }
  .toolbar .btn, .toolbar2 .btn { padding: 4px 9px; }
  .toolbar .spacer, .toolbar2 .spacer { flex: 1 0 100%; }
  /* 鏈哄櫒琛ㄤ篃璧板崱鐗囨ā寮忥細涓€琛屼竴寮犲崱锛屽瓧娈靛悕鐢?<td data-label> 鎻愪緵銆?     浠ュ墠杩欓噷鏄€岄殣钘忕 4 鍒楀強浠ュ悗銆嶁€斺€旇〃澶村拰鏁版嵁琛屽悇钘忓悇鐨勶紝绐勫睆蹇呯劧閿欎綅锛屽凡鍒犻櫎銆?*/
  .tbl.machines thead { display: none; }
  /* 卡片模式下 <colgroup> 没有任何意义（百分比列宽只服务于表格布局），
     留着会让表头和数据的宽度口径各算一套 —— 直接关掉，卡片一律 100%。 */
  .tbl.machines colgroup, .tbl.machines col { display: none; }
  .tbl.machines, .tbl.machines tbody, .tbl.machines tr, .tbl.machines td { display: block; width: 100%; }
  /* 兜底：卡片区不产生横向溢出（R10 要求"按钮不许被视口裁掉"）。
     2026-11-12 实测（390 视口）：.table-wrap 量到 472px —— 明明子元素都写了 100%，
     整条链上还是有人按"内容宽度"撑开了。所以这里**把整条链钉在视口宽度上**，
     并给卡片加 overflow:hidden：宁可省略号，也绝不把「删除」画到屏幕外面去。 */
  .main, .sections, .section, .table-wrap { max-width: 100vw !important; box-sizing: border-box; }
  /* 用 width:100% 而不是 max-width：实测 max-width 不足以把 .table-wrap 拉回容器宽度。 */
  .table-wrap, .tbl.machines { width: 100% !important; }
  /* **真正的根因（2026-11-12 实测）**：`.sections` 是 `.main`（flex column）的 flex item，
     而 flex item 的 `min-width: auto` = min-content —— 卡片里有个 nowrap 的宽孩子（实测 min-content 477px），
     于是整页被撑到 477px，390 视口里右边的「认领 / 删除」就被裁在屏幕外。
     修法：给这条链显式 min-width:0（允许窄于内容），并让 .sections 真正裁剪自己。
     注意 overflow 必须**两轴**都不是 visible，min-width:auto 才会变成 0（只写 overflow-x 无效）。 */
  /* 2026-11-12（撑满高度那一轮）：min-width:0 已经是**显式值**，不再依赖 overflow 才能生效，
     所以这里把 overflow 恢复成 visible —— 卡片模式回到"整页自然滚动"，
     桌面那套「.sections 内部滚动」不许带进窄屏。 */
  .sections { min-width: 0; overflow: visible; }
  .tbl.machines, .tbl.machines tbody, .tbl.machines tr, .tbl.machines td { min-width: 0; }
  /* 2026-11-12 收尾：**整条链一起**写 min-width:0 + 最外层裁掉横向溢出。
     block 元素的 width:auto 本该等于父宽度，但 flex/grid 祖先里的 min-width:auto = min-content，
     只要链上有一环没写 0，卡片里的 nowrap 孩子（ver-main / snap / line-name）就能把整页顶宽。
     这条链上任何一环都别再省略。 */
  html, body { overflow-x: hidden; }
  .app, .main, .sections, .section, #sec-machines, .table-wrap { min-width: 0; max-width: 100%; }
  /* 表格保持 fixed 布局（卡片模式下 display:block 已经让它不参与表格布局，
     但这条留着：万一哪天真退化成 table-row，fixed + 100% 也不会按内容撑开）。 */
  .tbl.machines { table-layout: fixed; width: 100%; }
  .tbl.machines tbody tr { overflow: hidden; }
  .tbl.machines td { overflow-wrap: anywhere; word-break: break-word; }
  /* 卡片里的 nowrap 一律放开：它们只服务于桌面单行显示，窄屏继续 nowrap 就会顶宽。
     （ver-main 是 `1.3.0 · d220c95e`，exec-hint 是「未知 → 1.3.0（旧版）」，都是长文本。） */
  .tbl.machines .c-act, .tbl.machines .c-act.nowrap,
  .tbl.machines .snap, .tbl.machines .line-name, .tbl.machines .ver-main,
  .tbl.machines .exec-badge, .tbl.machines .exec-hint { white-space: normal; overflow-wrap: anywhere; }
  /* 卡片内的格子也不许靠 content-box 撑出去（td 有 padding: 2px 0，横向为 0，但 border-box 更保险） */
  .tbl.machines td { box-sizing: border-box; max-width: 100%; }
  .tbl.machines tbody tr {
    border: 1px solid var(--line); border-radius: var(--radius);
    margin: 6px 0; padding: 6px 8px; height: auto; background: var(--panel);
    /* R10 回归（2026-11-12）：卡片是 width:100% + padding，
       不写 border-box 时总宽 = 100% + 16px，整页比视口宽 16px ——
       于是操作行最右边的「删除」被裁掉一半（390 截图就是这个）。 */
    width: 100%; box-sizing: border-box; max-width: 100%;
  }
  .tbl.machines tbody tr.is-sel { border-color: var(--accent); }
  .tbl.machines td { border: 0; padding: 2px 0; display: flex; gap: 8px; align-items: baseline; }
  .tbl.machines td::before {
    content: attr(data-label); flex: 0 0 82px; color: var(--muted); font-size: 12px;
  }
  .tbl.machines td.c-host { display: block; padding-bottom: 4px; }
  .tbl.machines td.c-host::before { content: none; }
  .tbl.machines td.empty { display: block; }
  .tbl.machines td.empty::before { content: none; }
  /* 状态格里有**两个**子块（「在线/离线 + 最近…前」和那两枚小标签）。卡片模式下 td 是 flex 行，
     两块会挤在同一行、右侧被视口裁掉（2026-11-11 390×844 截图：在线那台的「新四方 运行中 #12544」被切）。
     允许换行并把小标签单独放一行 —— 离线时那两枚写的是「—」，更不能被裁。 */
  .tbl.machines td.c-state { flex-wrap: wrap; }
  .tbl.machines td.c-state .pills { flex: 1 1 100%; min-width: 0; }
  /* v7：首列勾选框在卡片模式下**必须可见**（批量更新是手机上也常用的操作）——
     td 是 flex 行，::before 那点"字段名"对勾选框没意义，直接去掉标签、放大热区到 24px。
     标签写成 content:none 而不是删 data-label：桌面仍按 data-label 对齐断言。 */
  .tbl.machines td.c-check { display: flex; align-items: center; gap: 8px; padding-bottom: 2px; }
  .tbl.machines td.c-check::before { content: none; }
  .tbl.machines td.c-check input { width: 24px; height: 24px; }
  /* v7：「执行器版本」格在卡片模式下同样保留字段名（td::before 用 data-label），
     主文本与徽标横向排开，宽度不够就换行，绝不被裁。 */
  .tbl.machines td.c-ver { flex-wrap: wrap; }
  .tbl.machines td.c-ver .ver-main { display: inline-block; max-width: 100%; }
  /* 工具条里的「批量更新执行器」按钮：窄屏整行、≥40px 高（和其它动作按钮同一口径） */
  #btn-bulk-update { min-height: 40px; padding: 8px 10px; }
  #bulk-picked { flex: 1 1 100%; }
  /* 旧版机器提示（「旧版未上报指纹 N 台」）同样整行，不许挤在批量按钮右边被裁。 */
  #bulk-legacy { flex: 1 1 100%; color: #8a5a00; }
  /* R10 截图回归（2026-11-12）：窄屏下「批量更新执行器 → <版本>」比视口宽，右侧被裁掉了。
     批量的主按钮整行独占（≥40px 高），其余工具条按钮允许收缩但绝不越界。 */
  #btn-bulk-update { flex: 1 1 100%; width: 100%; box-sizing: border-box; }
  .toolbar .btn, .toolbar2 .btn { max-width: 100%; }
  /* 回执 / 日志 / 账号表在自己的 .table-wrap 里横向滚动，
     不许用 min-width 把**整页**撑宽 —— 整页变宽会让工具条右侧被视口裁掉（同一张截图里出现两处裁切）。 */
  .table-wrap { overflow-x: auto; max-width: 100%; }
  /* 新建线程表单（P0）：窄屏全部单列堆叠，勾选框一行放不下就换行，输入框占满整行不溢出，
     按钮 ≥40px（与机器卡片的动作按钮同一口径，手指点得到）。 */
  .newthread { gap: 12px; }
  .newthread .nt-checks { gap: 8px 12px; }
  .newthread .nt-checks .chk { min-height: 32px; }
  .newthread textarea, .newthread .nt-fld input, .newthread input.tiny { width: 100%; max-width: 100%; box-sizing: border-box; }
  .newthread .nt-inline { flex-wrap: wrap; }
  .newthread .acts .btn { min-height: 40px; min-width: 96px; padding: 8px 12px; font-size: 13px; }
  #executor-block .grid { grid-template-columns: 1fr; }
  .execdist .stats { gap: 4px 10px; }

  /* 卡片模式下把 ⋯ 菜单**整行展开**：手机上没有 hover，细节收进下拉会藏掉删除/改名入口。
     ⋯ 按钮本身隐藏，三个动作按钮直接排在操作行，每个 ≥40px 高、≥56px 宽，手指点得到。
     这里用 !important：桌面那套（.tbl.machines .menu-items{display:none;position:absolute}）
     写在文件更后面，靠层叠顺序抢不过来 —— 只有 !important 能保证窄屏一定展开成一行。 */
  .tbl.machines .c-ops .ops { flex-wrap: wrap; gap: 6px; }
  .tbl.machines .c-ops .menu-btn { display: none !important; }
  /* .menu 自己占满一行：三个动作按钮在它内部换行，否则"认领/改名/删除"会被挤到视口外被裁 */
  .tbl.machines .c-ops .menu { display: flex; flex: 1 1 100%; }
  .tbl.machines .c-ops .menu-items {
    /* v6 多了「切线路1 / 已在当前线路」两个按钮，v7 又多了「更新执行器」：一行横排到
       390 视口里必然裁掉最后一个（2026-11-12 截图：认领/删除被切）。
       改成 **两列网格**：按钮各占一格、行高 ≥40px、永不横向溢出，文案也都能看全。 */
    display: grid !important; position: static !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px; min-width: 0; padding: 0; border: 0; background: transparent; box-shadow: none;
  }
  /* 桌面那条 `.menu-items .btn { width: 100% }` 是给竖排下拉用的；窄屏网格里每格自适应 */
  .tbl.machines .c-ops .menu-items .btn { width: 100%; }
  /* R10 回归（2026-11-12）：窄屏的菜单按钮不许有 min-width 硬底（56px×5 直接顶出视口），
     一律可收缩；格子里居中显示，文案超长就省略号，绝不横向溢出。 */
  .tbl.machines .c-ops .ops, .tbl.machines .c-ops .menu-items { width: 100%; box-sizing: border-box; }
  /* 最后一道闸（2026-11-12）：卡片在 390 视口里实测被撑到 470px（同一张表的 .table-wrap 也是 470），
     所以「按百分比排」的按钮列一定会被裁在屏幕外。这里把动作区**按视口宽算死**：
     视口 − 卡片左内边距(10) − 字段名(82) − 间距/边框(≈48)，剩下的宽度两列均分。
     这样无论卡片自身多宽，按钮的右边界都不会越过视口。 */
  .tbl.machines .c-ops .menu-items {
    width: calc(100vw - 140px) !important;
    max-width: calc(100vw - 140px) !important;
  }
  .tbl.machines .c-ops .menu-items .btn {
    min-width: 0; padding: 8px 6px; font-size: 12.5px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .tbl.machines .c-ops .ops .btn {
    min-height: 40px; min-width: 56px; padding: 8px 10px; font-size: 13px; text-align: center;
    display: inline-flex; align-items: center; justify-content: center;
  }
  /* 线程页机器选择框：与工具条同一行自动换行，宽度自适应不被裁，触控高度 ≥40px */
  #machine-picker { flex: 1 1 100%; max-width: 100%; white-space: nowrap; }
  #sel-machine { width: 100%; max-width: 100%; min-height: 40px; flex: 1 1 auto; min-width: 0; }
  /* 工具条里的下拉（机器 / 排序）都不许把行撑出视口：各占满一行，绝不横向溢出被裁 */
  .toolbar > *, .toolbar2 > * { min-width: 0; }
  .toolbar .sel, .toolbar2 .sel { flex: 1 1 100%; max-width: 100%; flex-wrap: wrap; }
  #sortsel { width: 100%; max-width: 100%; min-width: 0; min-height: 40px; }
  /* 当前机器标识换行显示在工具条下方（窄屏右侧放不下） */
  #cur-machine { flex: 1 1 100%; order: 99; white-space: normal; }
  /* 鍏朵綑琛紙璐﹀彿 / 鍥炴墽 / 鏃ュ織锛夛細涓嶉殣钘忓垪锛屾暣鍧楁í鍚戝彲婊氬姩 */
  .tbl.accounts, .tbl.receipts, .tbl.logs { min-width: 720px; }
  .tbl.receipts th, .tbl.receipts td { font-size: 12px; }

  /* ---------- 2026-11-12 窄屏（≤760px）不吃桌面那套「撑满高度」 ----------
     卡片模式必须维持"整页自然滚动"：给 html/body 固定高度 + 让 .sections 内部滚，
     手机上会变成两层滚动条互相打架，滚到底部还可能滚不到卡片最后一行。
     所以这一段把 A 组那 5 条**逐条退回**（顺序放最后，靠层叠赢过文件前面的桌面规则）。 */
  html, body { height: auto; }
  .app { height: auto; min-height: 100vh; }
  .section.on { display: block; flex: 0 0 auto; min-height: 0; }

  /* ---------- 线程页抽屉（≤760px）：抽屉铺满、列表 display:none ----------
     打开抽屉时 app.js 给 body 加 .drawer-open（关闭时去掉）；桌面也加，但桌面不靠它。
     不遮挡列表的桌面契约在窄屏换成"抽屉就是这一屏"，关掉（✕ / Esc / 保存）即回列表。
     横向溢出必须为 0：抽屉 width:100% + 控件 box-sizing:border-box + 长 token 可断行。 */
  .stage { display: block; }
  .stage > .stage-list { display: block; }
  body.drawer-open .stage > .stage-list { display: none; }
  /* 抽屉铺满**整屏**：分区的那圈左右内边距在抽屉打开时让位（否则 390 视口只拿到 370） */
  body.drawer-open .sections { padding-left: 0; padding-right: 0; }
  #thread-drawer { flex: 1 1 auto; width: 100%; max-width: 100%; border-left: 0; box-shadow: none; }
  #thread-drawer > .db { padding: 10px; }
  #thread-drawer > .df { position: sticky; bottom: 0; }
  /* 手机上抽屉铺满整屏后，"保存到待下发 / 取消"要**一直看得见**（不是滚到底才见）：
     底部按钮改成钉在视口底部，滚动区留出等高的内边距，最后一段内容不会被挡住。 */
  body.drawer-open #thread-drawer > .df {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  }
  body.drawer-open #thread-drawer > .db { padding-bottom: 72px; }
  #thread-drawer .nt-row2 { grid-template-columns: 1fr; }
  #thread-drawer .newthread input, #thread-drawer .newthread textarea { box-sizing: border-box; max-width: 100%; }
  #thread-drawer .nt-ro code { overflow-wrap: anywhere; word-break: break-all; }
  /* .table-wrap 回到按内容高度（卡片多长就多长），只保留横向滚动；竖向交给整页 */
  .table-wrap {
    flex: 0 0 auto; min-height: 0;
    overflow-y: visible; overflow-x: auto;
    scrollbar-gutter: auto;
  }
  /* 表头 sticky 关掉：卡片模式下 <thead> 本来就是 display:none，这条是防止将来有人
     把 thead 又打开一半，留下一个"粘在分区顶部"的空表头。 */
  .tbl thead th { position: static; }
}

/* ---------- 鏈哄櫒鍒楄〃锛氱姸鎬佹牸锛堝湪绾?+ 涓ゅ紶灏忔爣绛撅級/ 鏃堕挓鍋忓樊 / 绾跨▼鏍?/ 寰呬笅鍙?---------- */
/* 鏃х増鏄笁鍒楋紙鍦ㄧ嚎 / 鏂伴叿鍗?/ 鏂板洓鏂癸級鎸ゆ垚涓€鎺掞紱鐜板湪鍚堣繘銆岀姸鎬併€嶄竴鏍硷紝涓よ涓ゆ鏂囧瓧銆?*/
.tbl.machines .c-host b { font-weight: 600; }
.tbl.machines .c-host .muted { display: block; font-size: 12px; }
.tbl.machines .c-act { font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: 12.5px; }
.tbl.machines .c-state .st-main { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tbl.machines .c-state .pills { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.tbl.machines .c-threads { font-variant-numeric: tabular-nums; }
.tbl.machines .c-threads .snap { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl.machines .c-pending { text-align: center; font-variant-numeric: tabular-nums; color: var(--muted); }
.tbl.machines .c-pending.hot { color: var(--danger); font-weight: 600; }
/* 线路列（v6）：主文本「线路2」+ 小字短名（newszfang）；未知线路整格灰虚 = 未知，不是「线路0」 */
.tbl.machines .c-line { line-height: 1.25; }
.tbl.machines .c-line .line-main { font-weight: 600; }
.tbl.machines .c-line .line-name { display: block; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl.machines .c-line.na .line-main { color: var(--muted); font-weight: 400; }
/* 菜单里「已在当前线路」是禁用态：灰字 + 不可点（后端也会回 409 already_on_line） */
.tbl.machines .menu-items .btn:disabled,
.tbl.machines .menu-items .btn[disabled] { color: var(--muted); opacity: .7; cursor: not-allowed; }
.tbl.machines .menu-items .btn.is-cur { font-style: normal; }
/* 线程页工具条上的「线路：线路2（newszfang）」——链接域名跟着它变，必须看得见 */
#line-info { white-space: nowrap; }
/* 回执里的线路切换那一行（绿=生效 / 红=已写入但未重启） */
.lineswitch { font-size: 12px; }
.lineswitch.green { color: var(--on); }
.lineswitch.red { color: var(--danger); }
/* ---------- 执行器自更新（v7）----------
   ① 首列勾选框：桌面 16px（精确点击），窄屏放大到 24px（手指点得到，见下面的 media query）
   ② 「执行器版本」格：主文本 `1.3.0 · a1b2c3d4` + 徽标（可更新=黄 / 已最新=灰 / 失败=红 / 未知=—）
   ③ 上次更新失败的那一行整行淡红（与「日志」页回执行的标红同一个语义） */
.tbl.machines td.c-check { text-align: center; }
.tbl.machines td.c-check input { width: 16px; height: 16px; cursor: pointer; }
.tbl.machines .c-ver { line-height: 1.3; }
.tbl.machines .c-ver .ver-main {
  display: block; font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.badge {
  display: inline-block; font-size: 11px; line-height: 16px; padding: 0 6px;
  border-radius: 4px; border: 1px solid var(--line); color: var(--muted);
}
.exec-badge.exec-old { color: #8a5a00; border-color: #e0b34d; background: rgba(234, 179, 8, .16); font-weight: 600; }
/* 「可更新（旧版）」= 没有 agent_sha8 的 0.2.0 执行器：与「可更新」同一档黄（都是"该升"），
   但文案多了「（旧版）」，客户一眼看出它不是"版本号对不上"，而是"根本没上报指纹"。 */
.exec-badge.exec-legacy { color: #8a5a00; border-color: #e0b34d; background: rgba(234, 179, 8, .16); font-weight: 600; }
/* 「更新无回执（请确认版本）」= ack_timeout（回执丢了、心跳还没法证明升没升上去）：
   **黄档**，与「可更新」同色。它既不是"版本过低"（红、要重装），也不是"更新失败"（红、已回滚）——
   客户要做的动作只是"看一眼版本"，用红色会把人吓到去重装。 */
.exec-badge.exec-unconfirmed { color: #8a5a00; border-color: #e0b34d; background: rgba(234, 179, 8, .16); font-weight: 600; }
/* 「需重装（版本过低）」= 旧执行器不认 op:update（op_not_allowed / unknown_op）：红档，与更新失败同色。 */
.exec-badge.exec-reinstall { color: var(--danger); border-color: var(--warnline); background: rgba(220, 38, 38, .10); font-weight: 600; }
.exec-badge.exec-ok { color: var(--muted); }
.exec-badge.exec-fail { color: var(--danger); border-color: var(--warnline); background: rgba(220, 38, 38, .10); font-weight: 600; }
.exec-badge.exec- { color: var(--muted); }
/* 版本格下面的第三行小字（旧版 →「未知 → 1.3.0（旧版）」；需重装 →「请用安装包重装一次」）。
   必须能换行：窄屏卡片里这行最长，nowrap 会把它自己撑出视口（R10 硬指标查的就是这个）。 */
.tbl.machines .c-ver .exec-hint {
  display: block; font-size: 11px; color: var(--muted); margin-top: 2px;
  white-space: normal; overflow-wrap: anywhere;
}
.tbl.machines tr[data-exec="fail"] td { background: rgba(220, 38, 38, .055); }
.tbl.machines tr[data-exec="reinstall"] td { background: rgba(220, 38, 38, .055); }
.tbl.machines tr[data-exec="reinstall"] td.c-ver .exec-hint { color: var(--danger); }
.tbl.machines tr[data-exec="old"] td.c-ver { background: rgba(234, 179, 8, .06); }
.tbl.machines tr[data-exec="legacy"] td.c-ver { background: rgba(234, 179, 8, .06); }
/* 「更新无回执」= 黄档（不是红的"需重装/失败"）：只是在等客户确认版本 */
.tbl.machines tr[data-exec="unconfirmed"] td.c-ver { background: rgba(234, 179, 8, .06); }
/* 「日志」页的执行器版本区块（发布版身份 + 分布统计） */
.execblock .grid { gap: 6px 14px; }
.execdist .stats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 4px 0 6px; }
.execdist .stat { font-size: 12.5px; color: var(--muted); }
.execdist .stat b { color: inherit; font-variant-numeric: tabular-nums; }
.execdist .stat.ok b { color: var(--on); }
.execdist .stat.warn b { color: #8a5a00; }
.execdist .stat.danger b { color: var(--danger); }
.execupd { font-size: 12px; }
.execupd.green { color: var(--on); }
.execupd.red { color: var(--danger); }

/* ---------- 「新建线程」表单（2026-11-12 重做：分区纵向 + 转发内容 5 勾选）----------
   以前九个字段平铺在一行 .grid 里，层级不清、「转发内容」还是个自由文本框。
   现在每组 .nt-group 一块：小标题 .nt-label + 控件 + 说明 <p class="muted small">。
   窄屏（≤760px）自动单列堆叠、勾选框换行、按钮 ≥40px（见 media query）。 */
.newthread { display: flex; flex-direction: column; gap: 10px; }
.newthread .nt-group { display: flex; flex-direction: column; gap: 4px; }
.newthread .nt-label { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.newthread .nt-label input[type="checkbox"] { width: 16px; height: 16px; }
.newthread textarea, .newthread input[type="text"], .newthread input:not([type]) { max-width: 100%; }
.newthread .nt-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.newthread .nt-checks .chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.newthread .nt-checks .chk input { width: 16px; height: 16px; }
.newthread .nt-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.newthread .nt-inline input.tiny { width: 72px; }
.newthread .nt-fld { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.newthread #nt-suffix-hint, .nt-hint { font-size: 12px; }
/* 线程页顶部「机器」选择框 + 当前机器标识：所有线程操作只作用于选中的那台机器 */
#machine-picker { flex: 0 1 auto; max-width: 100%; }
#sel-machine {
  max-width: 100%; min-width: 0; font-size: 13px; padding: 4px 6px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: inherit;
}
#cur-machine { white-space: nowrap; font-variant-numeric: tabular-nums; }
.empty-state { text-align: center; padding: 18px 12px; }
.empty-state p { margin: 0 0 10px; color: var(--muted); }
.tbl.machines .ops { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.tbl.machines .ops .btn { padding: 2px 7px; font-size: 11.5px; }
/* 操作列的「⋯ 更多」菜单：认领 / 改名 / 删除 收在这里（14% 宽塞 5 个按钮必爆） */
.tbl.machines .menu { position: relative; display: inline-block; }
.tbl.machines .menu-btn { list-style: none; cursor: pointer; user-select: none; }
.tbl.machines .menu.open > .menu-items { display: flex; border-color: var(--accent); }
.tbl.machines .menu-items {
  display: none; position: absolute; right: 0; top: calc(100% + 4px); z-index: 30;
  flex-direction: column; gap: 2px; min-width: 96px;
  padding: 4px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); box-shadow: 0 6px 18px rgba(0,0,0,.12);
}
.tbl.machines .menu-items .btn { width: 100%; text-align: left; }
.tbl.machines .menu-items .btn.danger { color: var(--danger); }
.pill {
  display: inline-block; font-size: 11px; line-height: 16px; padding: 0 6px; border-radius: 9px;
  border: 1px solid var(--line); color: var(--muted); white-space: nowrap; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; vertical-align: middle;
}
.pill.on { color: var(--on); border-color: var(--on); }
.pill.off { color: var(--off); }
/* 离线 = 未知：虚线灰，**不许**用 off 冒充「关」（离线机器的进程状态没有任何事实依据） */
.pill.na { color: var(--muted); border-style: dashed; }

.c-skew { font-variant-numeric: tabular-nums; white-space: nowrap; }
/* 日志页的归属 / 改名 / 删除留痕：ul 平铺（不是表格，不能被 TABLE 组的列数断言套住） */
.audit { list-style: none; margin: 4px 0 10px; padding: 0; }
.audit li {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline;
  padding: 4px 0; border-bottom: 1px dashed var(--line);
}
.audit .audit-rename { color: var(--accent); }
.audit .audit-delete { color: var(--danger); }
.audit .audit-detail { color: var(--muted); word-break: break-all; }
.c-skew.warn { color: #a66a00; font-weight: 600; }
.c-skew.danger { color: var(--danger); font-weight: 600; }
.green { color: var(--on); }
.timesync { margin: 2px 0; }
@media (prefers-color-scheme: dark) {
  .c-skew.warn { color: #e0a53c; }
}

/* ---------- 绾跨▼鍒楄〃锛氬彂鐮侀摼鎺ユ牸锛堟病鏈夊彂鐮佹椂杩欎竴鏍煎畬鍏ㄧ┖鐧斤紝浣嗘牸瀛愭湰韬繀椤诲湪锛?---------- */
.tlist .c-send { white-space: nowrap; }
.tlist .c-send .lnk { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: bottom; }

/* ---------- 机器日志（v8）：日志页顶部入口 + 机器详情里的「机器日志」区 ----------
   三列固定：时间 / 级别 / 内容。内容必须能断（一条日志里可能有长 hex、长 token），
   否则 390 视口下整页被撑宽 —— 这正是 §3.12 踩过的坑。 */
.box.machinelog { margin-bottom: 10px; }
.box.machinelog .toolbar { flex-wrap: wrap; }
#log-machine-picker { flex: 0 1 auto; max-width: 100%; }
#log-machine {
  max-width: 100%; min-width: 0; font-size: 13px; padding: 4px 6px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: inherit;
}
#log-kw, .logquick .inp {
  font-size: 13px; padding: 4px 6px; min-width: 0; max-width: 100%;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: inherit;
}
.logquick { flex-wrap: wrap; gap: 6px; }
.logquick .chipbtn { padding: 3px 9px; font-size: 12px; }
.logquick .chipbtn.is-cur { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.logwrap { max-height: 340px; overflow: auto; scrollbar-gutter: stable; }
.tbl.machinelog { table-layout: fixed; width: 100%; }
.tbl.machinelog th.w-time, .tbl.machinelog td:first-child { width: 92px; }
.tbl.machinelog th.w-kind, .tbl.machinelog td:nth-child(2) { width: 74px; }
.tbl.machinelog td.msg {
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word;
}
.tbl.machinelog tr.mline.lv-warn td.msg { color: #a66a00; }
.tbl.machinelog tr.mline.lv-error td.msg { color: var(--danger); }
.lvtag {
  display: inline-block; font-size: 11px; line-height: 16px; padding: 0 6px;
  border-radius: 9px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.lvtag.lv-warn { color: #a66a00; border-color: #d8a53c; }
.lvtag.lv-error { color: var(--danger); border-color: var(--warnline); }
@media (prefers-color-scheme: dark) {
  .tbl.machinelog tr.mline.lv-warn td.msg { color: #e0a53c; }
  .lvtag.lv-warn { color: #e0a53c; }
}
@media (max-width: 760px) {
  /* 窄屏：三列压成「时间 + 级别」一行、内容另起一行（表格退出 table 布局，卡片模式） */
  .logwrap { max-height: none; overflow-y: visible; }
  .tbl.machinelog { table-layout: auto; display: block; }
  .tbl.machinelog thead { display: none; }
  .tbl.machinelog tbody, .tbl.machinelog tr, .tbl.machinelog td { display: block; width: 100% !important; }
  .tbl.machinelog tr.mline {
    display: grid; grid-template-columns: auto 1fr; gap: 2px 8px;
    box-sizing: border-box; padding: 6px 8px; border-bottom: 1px solid var(--line);
  }
  .tbl.machinelog tr.mline td { padding: 0; border: 0; }
  .tbl.machinelog tr.mline td.msg { grid-column: 1 / -1; }
  .logquick .chipbtn { flex: 1 1 auto; }
}


/* ---------- 顶部「更新状态栏」（v9） ---------- */
/* 一条紧凑横幅，最多 10 行，只在最近 10 分钟内有 op:update 活动时出现（服务端算，见 execbar.go）。
   宿主 #execbar 自己不加内边距：没有更新在跑时它是**空元素 = 零高度**，不占版面 —— 这是契约
   §14.5 的「无活动不渲染」，别在这里加 min-height / padding 把空横幅撑出来。 */
.execbar-host { flex: 0 0 auto; min-width: 0; }
.execbar {
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
  padding: 6px 16px 8px; border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.exec-row {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  font-size: 12.5px; line-height: 1.35; min-height: 22px;
}
.exec-ico { flex: 0 0 auto; font-size: 13px; }
/* 激活码前 8 位用等宽字体：现场是靠它跟机器表对号入座的 */
.exec-act { flex: 0 0 auto; font-family: ui-monospace, Consolas, "Courier New", monospace; letter-spacing: .2px; }
.exec-main { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exec-tail { flex: 0 0 auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.exec-hint {
  flex: 1 1 auto; min-width: 0; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 「gzip」小标记（v10）：done 且实际传输 < total*70% 才有，灰底小圆角，不抢主文案。
   不要加粗、不要上彩色 —— 它是个"解释"，不是状态。 */
.exec-mark {
  flex: 0 0 auto; display: inline-block; padding: 0 5px; border-radius: 3px;
  font-size: 10.5px; line-height: 15px; letter-spacing: .2px;
  color: var(--muted); background: var(--line); text-transform: lowercase;
}
/* 细进度条：与机器行内联进度条同一个组件（.exec-track），宽度由服务端给的百分比驱动 */
.exec-track {
  flex: 0 0 76px; height: 5px; border-radius: 3px;
  background: rgba(37, 99, 235, .16); overflow: hidden;
}
.exec-track > i { display: block; height: 100%; background: var(--accent); transition: width .3s linear; }
.exec-track.small { flex: 0 0 54px; height: 4px; margin-top: 3px; }
.exec-row.exec-ok .exec-main { color: var(--on); font-weight: 600; }
.exec-row.exec-fail .exec-main { color: var(--danger); font-weight: 600; }
.exec-row.exec-fail .exec-track > i { background: var(--danger); }
.exec-row.exec-stuck .exec-main { color: #8a5a00; font-weight: 600; }
.exec-row.exec-stuck { background: rgba(234, 179, 8, .08); border-radius: 4px; }
/* 「更新无回执」那一行：黄档（与 stuck 同一套配色，但状态码是 noreceipt —— 它比"卡住"更确定：
   超时已收尾，只差人确认一次版本）。 */
.exec-row.exec-warn .exec-main { color: #8a5a00; font-weight: 600; }
.exec-row.exec-warn { background: rgba(234, 179, 8, .08); border-radius: 4px; }
@media (prefers-color-scheme: dark) {
  .exec-row.exec-stuck .exec-main { color: #e0b34d; }
  .exec-row.exec-warn .exec-main { color: #e0b34d; }
}
/* 机器行里的内联进度（「执行器版本」列，更新中才出现） */
.exec-live { display: block; margin-top: 2px; }
.exec-live-txt { display: block; font-size: 11px; color: var(--accent); font-variant-numeric: tabular-nums; }
/* 窄屏（<=600px，含 390x844 的手机视口）：提示折到第二行，否则一行挤不下会被省略号吃光 */
@media (max-width: 600px) {
  .execbar { padding: 6px 10px 8px; }
  .exec-row { flex-wrap: wrap; row-gap: 2px; }
  .exec-main { flex: 1 1 auto; }
  .exec-tail { flex: 0 0 auto; }
  .exec-hint { flex: 1 1 100%; white-space: normal; overflow-wrap: anywhere; }
}

/* ---------------------------------------------------------------- B-3 断线黄条
   连续 2 次请求失败才出现，任何一次成功立刻消失（节点由 app.js 的 netBanner 建）。
   放在 .main 的第一个子节点：切分区不会丢，且不挤 .top 的高度节奏。 */
.netbar {
  flex: 0 0 auto;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: #8a5a00;
  background: rgba(234, 179, 8, .14);
  border-bottom: 1px solid rgba(234, 179, 8, .45);
}
.netbar[hidden] { display: none; }
@media (prefers-color-scheme: dark) {
  .netbar { color: #e0b34d; background: rgba(234, 179, 8, .16); border-bottom-color: rgba(234, 179, 8, .38); }
}

/* --------------------------------------------------- ① 等待回执状态条（行级更新）
   挂在 #receipts-<act> 的 .subhead 之后、滚动容器之外：滚回执列表时它不动。
   只改 data-wait 与文案，不重建节点 —— DOM 节点数在整段等待期里基本不变。 */
.receipt-wait {
  margin: 2px 0 6px;
  padding: 5px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.receipt-wait[data-wait="run"] { color: var(--accent); border-color: var(--accent); background: rgba(37, 99, 235, .08); }
.receipt-wait[data-wait="ok"] { color: var(--on); border-color: var(--on); background: rgba(26, 156, 83, .10); }
.receipt-wait[data-wait="fail"] { color: var(--danger); border-color: var(--warnline); background: var(--warnbg); }
.receipt-wait[data-wait="timeout"] { color: #8a5a00; border-color: rgba(234, 179, 8, .5); background: rgba(234, 179, 8, .12); }
@media (max-width: 600px) {
  .receipt-wait { white-space: normal; overflow-wrap: anywhere; }
}

/* ------------------------------------------- 关键词查找（v14，线程列表顶部）
   一行搜索框 + 右侧命中计数。它在 .tlist **之前**（列表区最顶），所以不吃列表的
   flex:1 空间；手机上整行独占（.kws 换 flex-wrap，.sel 撑满 100%），
   上方的排序控件在 .toolbar 里，一行放不下时仍按原来的规则换行 → 不会被搜索框挤压。

   命中高亮：.kw-hit 由 app.js 加在 .trow 上，2 秒后由同一个定时器摘掉；
   这里用 keyframes 从"实心高亮"淡到透明，即使定时器被系统降频拖慢，视觉上也是淡出而不是硬切。
   .kw-dim 是"不匹配"的行：**只压暗、不隐藏**。
   为什么不 display:none：用户要的是"定位"（滚到那一行 + 短暂高亮），
   隐藏掉其它行的话列表会立刻塌成一行、滚动位置被浏览器夹回 0 ——
   既看不出"定位到了多远的地方"，也没法在上下文里看前后还有哪几条。 */
.kws {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 0 0 8px;
}
.kws .sel { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.kws #kw-search {
  width: 260px; max-width: 100%; box-sizing: border-box;
  font-size: 13px;
}
/* 清掉 Edge/Safari 给 type=search 的默认样式（会跟其它输入框长得不一样） */
.kws #kw-search::-webkit-search-cancel-button { cursor: pointer; }
.kws #kw-search-hit {
  font-variant-numeric: tabular-nums; white-space: nowrap;
  min-height: 1.2em;
}
.kws #kw-search-hit[data-empty="1"] { color: var(--danger); font-weight: 600; }
.titem.kw-dim { opacity: .32; }
.titem.kw-dim .trow { box-shadow: none; }
@keyframes kw-hit-fade {
  0%   { background: rgba(234, 179, 8, .34); }
  70%  { background: rgba(234, 179, 8, .26); }
  100% { background: transparent; }
}
.trow.kw-hit { animation: kw-hit-fade 2s ease-out forwards; }

/* ---------------------------------------------------------------- 四方位置（v11）
   机器详情里的「四方位置」块 + 「设置位置」弹窗。
   两条硬约束（窄屏 390x844 也要能填）：
     ① 长路径必须能换行**不撑破**卡片：.mono 用 overflow-wrap:anywhere，
        否则 D:\很深\很长的目录\ 会把 1280 的表格也顶歪；
     ② 弹窗是 fixed 覆盖层而不是内联展开：客户点「设置位置」时不该丢掉详情区的滚动位置。 */
.tgtbox { margin-top: 8px; }
.tgtbox .grid { margin-top: 4px; }
.tgt-src { font-weight: 600; margin-left: 6px; }
/* 来源徽标的三种颜色口径：自动搜索（中性）/ 人工或注册表快捷方式（蓝）/ 未找到·未知（黄·红） */
.tgt-auto     { background: rgba(100, 116, 139, .18); color: var(--fg, #e5e7eb); }
.tgt-registry { background: rgba(59, 130, 246, .18); color: #93c5fd; }
.tgt-shortcut { background: rgba(59, 130, 246, .18); color: #93c5fd; }
.tgt-manual   { background: rgba(16, 185, 129, .20); color: #6ee7b7; }
.tgt-notfound { background: rgba(234, 179, 8, .20); color: #fcd34d; }
.tgt-unknown  { background: rgba(148, 163, 184, .18); color: #cbd5e1; }
.tgtbox .mono { overflow-wrap: anywhere; word-break: break-all; }
.tgtbox .chip { display: inline-block; padding: 1px 6px; border-radius: 6px; background: rgba(148, 163, 184, .16); margin: 2px 4px 2px 0; }
.tgt-pending { color: #fcd34d; margin-top: 4px; }
.tgt-modal {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: rgba(2, 6, 23, .55); padding: 16px;
}
.tgt-modal[hidden] { display: none; }
.tgt-card { width: 100%; max-width: 520px; margin: 0; }
.tgt-card .fld { display: block; margin: 8px 0; }
.tgt-card .fld input { width: 100%; }
.tgt-card .acts { margin-top: 12px; }
@media (max-width: 760px) {
  /* 手机：弹窗铺满可视宽度、按钮占满一行（拇指够得着），输入框 16px 防 iOS 缩放 */
  .tgt-card { max-width: 100%; }
  .tgt-card .fld input { font-size: 16px; }
  .tgt-card .acts .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .trow.kw-hit { animation: none; background: rgba(234, 179, 8, .22); }
}
@media (max-width: 760px) {
  /* 手机：搜索框占满一行（不和命中计数挤在一起），排序控件仍在上面那行工具栏里。
     「查找」这两个字必须 nowrap：flex 行里它会被输入框的 width:100% 挤成一列两行。 */
  .kws { display: block; padding-bottom: 6px; }
  .kws .sel { display: flex; flex: 1 1 100%; max-width: 100%; align-items: center; gap: 6px; white-space: nowrap; }
  .kws #kw-search { width: auto; flex: 1 1 auto; min-width: 0; }
  .kws #kw-search-hit { display: block; padding-top: 4px; }
}

/* ---------------------------------------------------- 品牌副标（v16）
   网页上的名字是「猫猫-大橘」，英文副标 maomao-ju 跟在后面小一号：
   客户电话里说的是"那个 nf 控制端"、界面上写的是中文名，两个都得有才好对号。
   只改界面文案 —— module 名 / systemd 服务名 / 目录 / 域名 / API 路径一律没动。 */
.brand-sub { font-weight: 400; font-size: 11.5px; letter-spacing: .2px; color: var(--muted); }
.login-card h1 .brand-sub { display: block; margin-top: 2px; font-size: 12px; }

/* ------------------------------------------------------ 配置修复（v16）
   分区结构见 web\configfix.html；结果区（三态 + 修复清单）由 app.js 建。
   这组样式只做三件事：把上传控件排成一行、三态标题染色、修复清单窄屏变卡片。 */
.cfgfix .cfgfix-intro { margin: 2px 0 10px; line-height: 1.6; }
.cfgfix .cfgfix-intro code {
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  padding: 0 3px; border-radius: 3px; background: rgba(0, 0, 0, .05);
}
.cfgfix .cfgfile { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cfgfix .cfgfile input[type=file] { max-width: 300px; font-size: 12.5px; }
/* 三态标题：成功=绿、无需修复=灰、修不了=红。不许只靠颜色区分（文案本身已带状态词）。 */
.cfgfix .cfg-state { margin: 12px 0 4px; font-weight: 700; font-size: 14px; }
.cfgfix .cfg-state.ok { color: var(--on); }
.cfgfix .cfg-state.noop { color: var(--muted); }
.cfgfix .cfg-state.bad { color: var(--danger); }
.cfgfix .cfg-ctx {
  margin: 6px 0 0; padding: 8px 10px; border-radius: var(--radius);
  border: 1px solid var(--line); background: rgba(0, 0, 0, .03);
  overflow-x: auto; white-space: pre; line-height: 1.5;
}
.cfgfix .acts { margin-top: 10px; }
/* 修复清单表：列宽固定（行号 / 类型窄，原文与修复后各占一半），值一律等宽字体便于逐字比对。 */
.tbl.cfgfix .w-line { width: 72px; }
.tbl.cfgfix .w-kind { width: 132px; }
.tbl.cfgfix td.mono { overflow-wrap: anywhere; }
@media (max-width: 760px) {
  /* 手机上：上传控件整行、按钮满宽够得着；修复清单从表格退成卡片（一行一条修复）。 */
  .cfgfix .cfgfile { display: block; flex: 1 1 100%; }
  .cfgfix .cfgfile input[type=file] { width: 100%; max-width: 100%; }
  .cfgfix-bar .btn { flex: 1 1 100%; min-height: 40px; }
  .cfgfix-bar .spacer { flex: 1 0 100%; }
  .tbl.cfgfix { table-layout: auto; display: block; }
  .tbl.cfgfix thead { display: none; }
  .tbl.cfgfix tbody, .tbl.cfgfix tr, .tbl.cfgfix td { display: block; width: 100% !important; }
  .tbl.cfgfix tr {
    border: 1px solid var(--line); border-radius: var(--radius);
    margin: 6px 0; padding: 6px 8px; background: var(--panel); box-sizing: border-box;
  }
  .tbl.cfgfix td { display: flex; gap: 8px; padding: 1px 0; border: 0; }
  .tbl.cfgfix td::before {
    content: attr(data-label); flex: 0 0 76px; color: var(--muted); font-size: 12px;
  }
  .cfgfix .cfg-ctx { font-size: 11.5px; }
}
