/* RC 控制台 —— 参考管理平台风格（Ant Design 浅色语言）
   page #f4f7f9 · panel #fff · sider #f5f5f5 · primary #0960bd
   table-head #fafafa · text rgba(0,0,0,.88) · sub rgba(0,0,0,.45) */
:root {
  --page: #f4f7f9;
  --panel: #ffffff;
  --sider: #f5f5f5;
  --raise: #fafafa;
  --line: #e8eaed;
  --line2: #f0f0f0;
  --ink: rgba(0, 0, 0, 0.88);
  --sub: rgba(0, 0, 0, 0.45);
  --primary: #0960bd;
  --primary-h: #2f7ad1;
  --ok: #52c41a;
  --warn: #faad14;
  --err: #ff4d4f;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  --sans: "Segoe UI", "MiSans", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  --radius: 8px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; padding-left: 148px;
  background: var(--page); color: var(--ink);
  font: 14px/1.55 var(--sans);
}
.hidden { display: none !important; }
.muted { color: var(--sub); font-size: 12px; }

/* ── 左侧主菜单 ── */
.sidenav {
  position: fixed; left: 0; top: 0; bottom: 0; width: 148px; z-index: 20;
  background: var(--sider); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 14px 10px;
}
.logo {
  width: 32px; height: 32px; margin: 2px auto 18px; border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #0d4f94);
}
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: none; background: none; cursor: pointer;
  color: var(--ink); font-family: inherit; font-size: 13.5px;
  padding: 10px 12px; border-radius: 6px; text-align: left;
}
.nav-item:hover { background: rgba(9,96,189,.06); color: var(--primary); }
.nav-item.active { background: rgba(9,96,189,.1); color: var(--primary); font-weight: 600; }
.nav-item .ico { width: 18px; text-align: center; font-size: 15px; }
.nav-foot { margin-top: auto; text-align: center; }
.ver { font-size: 10px; color: var(--sub); font-family: var(--mono); }

/* ── 顶栏 ── */
.shell { display: flex; flex-direction: column; height: 100vh; }
.view { display: none; height: 100%; min-height: 0; }
.view.active { display: flex; flex-direction: column; gap: 14px; }
.topbar {
  height: 56px; flex: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; background: var(--panel);
  border-bottom: 1px solid var(--line2);
}
.page-title { margin: 0; font-size: 16px; font-weight: 600; }
.stats { display: flex; align-items: center; gap: 18px; }
.stat {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--sub);
}
.stat b { color: var(--ink); font-family: var(--mono); font-weight: 600; }
.led { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #d9dee3; }
.led.on { background: var(--ok); }

/* ── 视图主体 ── */
#view-console.active { padding: 16px 24px 22px; }
#view-gen.active { padding: 24px; overflow: auto; }

/* ── 过滤工具栏 ── */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; flex: none; }
.chips {
  display: inline-flex; background: var(--panel);
  border: 1px solid var(--line); border-radius: 6px; padding: 2px;
}
.chip {
  border: none; background: none; cursor: pointer;
  color: var(--sub); font-size: 13px; font-family: inherit;
  padding: 5px 16px; border-radius: 4px;
}
.chip:hover { color: var(--primary); }
.chip.active { background: var(--primary); color: #fff; }
#search, select, input[type="text"], input[type="search"], input[type="file"] {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; color: var(--ink); font-family: inherit; font-size: 13px;
}
#search { width: 250px; padding: 6px 12px; outline: none; }
#os-filter { padding: 6px 10px; outline: none; }
input:focus, select:focus, #search:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(9,96,189,.1); }
#match-count { margin-left: auto; }

/* ── 客户端表格（参考站：#fafafa 表头 + 600 字重） ── */
.board {
  flex: 1; min-height: 0; overflow: auto;
  background: var(--panel); border: 1px solid var(--line2);
  border-radius: var(--radius);
}
.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.grid thead th {
  position: sticky; top: 0; z-index: 2;
  text-align: left; padding: 11px 16px;
  background: #fafafa; color: rgba(0,0,0,.88);
  font-size: 14px; font-weight: 600; white-space: nowrap;
}
.grid td {
  padding: 11px 16px; border-top: 1px solid var(--line2);
  font-family: var(--mono); font-size: 13px; white-space: nowrap;
}
.grid tbody tr { cursor: pointer; transition: background .12s; }
.grid tbody tr:hover { background: #f8fafc; }
.grid tbody tr.selected {
  background: rgba(9,96,189,.05);
  box-shadow: inset 3px 0 0 var(--primary);
}
.row-led {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
  background: #d9dee3;
}
.row-led.on { background: var(--ok); }
.status-tag {
  display: inline-block; padding: 1px 9px; border-radius: 4px; font-size: 12px;
  font-family: var(--sans);
}
.status-tag.on  { background: #f6ffed; color: var(--ok); border: 1px solid #b7eb8f; }
.status-tag.off { background: #f5f5f5; color: var(--sub); border: 1px solid #d9d9d9; }
.status-tag.installing { background: #fffbe6; color: #ad8b00; border: 1px solid #ffe58f; }
.hostname { font-family: var(--sans); font-weight: 600; color: var(--primary); }
.client-version { display: block; margin-top: 3px; font-size: 12px; font-weight: 400; color: var(--sub); }
.cu-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.cu-filters input, .cu-filters select { min-height: 38px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text); }
.cu-filters input[type=search] { flex: 1; min-width: 220px; }
.cu-table-wrap { overflow-x: auto; }
.cu-client-table td, .cu-client-table th { white-space: nowrap; }
.cu-client-table input[type=checkbox] { width: 17px; height: 17px; cursor: pointer; }
.cu-client-table tr.offline { color: var(--sub); }
.os-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.gpu-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.ip-cell { color: var(--ink); }
.ip-pub, .ip-lan { display: flex; align-items: center; gap: 5px; }
.ip-pub { font-family: var(--mono); font-size: 12.5px; }
.ip-lan { font-size: 11.5px; color: var(--sub); }
.ip-copy {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; flex: none; padding: 0;
  background: none; border: none; border-radius: 3px;
  color: var(--sub); cursor: pointer; opacity: 0;
  transition: opacity .12s;
}
.ip-copy svg { width: 12px; height: 12px; }
tr:hover .ip-copy, .ip-copy.copied { opacity: 1; }
.ip-copy:hover { background: rgba(9,96,189,.1); color: var(--primary); }
.ip-copy.copied { color: #10b981; }
.web-toast {
  position: fixed; left: 50%; top: 72px; z-index: 11000;
  transform: translate(-50%, -10px); opacity: 0; pointer-events: none;
  padding: 9px 16px; border-radius: 8px; color: #176b3a;
  background: #edf9f2; border: 1px solid #bfe8cf;
  box-shadow: 0 8px 24px rgba(20, 38, 60, .14);
  font-size: 13px; transition: opacity .15s, transform .15s;
}
.web-toast.show { opacity: 1; transform: translate(-50%, 0); }
.web-toast.error { color: #b42318; background: #fff2f0; border-color: #ffc9c2; }
/* 数值列靠左对齐（与表头一致） */
th.c-num, td.c-num { text-align: left; }
/* 速率列固定宽度：数值变化不挤动其他列 */
.c-speed-col { width: 150px; }
.speed-cell {
  font-family: var(--mono); font-size: 12px; white-space: nowrap;
  color: var(--ink); text-align: left; padding-right: 14px;
}
.geo-cell { white-space: nowrap; }
.c-num { text-align: right; }
td.c-num { color: var(--sub); }
.empty { padding: 40px; text-align: center; color: var(--sub); font-size: 13px; }

/* ── 行内操作 ── */
.ops { display: inline-flex; gap: 6px; }
.mini-btn {
  font-family: var(--sans); font-size: 12px;
  padding: 3px 12px; border-radius: 4px; cursor: pointer;
  background: var(--panel); color: var(--primary);
  border: 1px solid var(--primary);
}
.mini-btn:hover { background: var(--primary); color: #fff; }

/* ── 按钮 ── */
.btn {
  border: 1px solid #d9d9d9; border-radius: 6px; cursor: pointer;
  padding: 6px 18px; font-size: 13px; font-family: inherit;
  background: var(--panel); color: var(--ink);
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.btn.primary:hover { background: var(--primary-h); border-color: var(--primary-h); color: #fff; }

/* ── 悬浮功能窗口 ── */
.fwin {
  position: fixed; z-index: 40;
  width: 1280px; min-width: 560px; height: 900px; min-height: 380px;
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 6px 24px rgba(0,0,0,.14);
}
.fwin.focused { box-shadow: 0 10px 34px rgba(9,96,189,.22); border-color: rgba(9,96,189,.35); }
/* ── 窗口缩放手柄（八方向）── */
.fwin .rs { position: absolute; z-index: 5; }
.rs-n { top: 0; left: 10px; right: 10px; height: 5px; cursor: ns-resize; }
.rs-s { bottom: 0; left: 10px; right: 10px; height: 5px; cursor: ns-resize; }
.rs-e { right: 0; top: 10px; bottom: 10px; width: 5px; cursor: ew-resize; }
.rs-w { left: 0; top: 10px; bottom: 10px; width: 5px; cursor: ew-resize; }
.rs-ne { top: 0; right: 0; width: 12px; height: 12px; cursor: nesw-resize; }
.rs-nw { top: 0; left: 0; width: 12px; height: 12px; cursor: nwse-resize; }
.rs-se { bottom: 0; right: 0; width: 14px; height: 14px; cursor: nwse-resize; }
.rs-sw { bottom: 0; left: 0; width: 12px; height: 12px; cursor: nesw-resize; }
.rs-se::after {
  content: ''; position: absolute; right: 3px; bottom: 3px;
  width: 7px; height: 7px;
  border-right: 2px solid rgba(0,0,0,.2); border-bottom: 2px solid rgba(0,0,0,.2);
  border-radius: 2px;
}
.fwin-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: move; user-select: none;
  background: var(--raise); border-bottom: 1px solid var(--line2);
}
.fwin-title { font-size: 14px; font-weight: 600; flex: 1; }
.fwin-meta { font-size: 12px; color: var(--sub); font-family: var(--mono); }
.fbtn {
  background: none; border: none; cursor: pointer;
  color: var(--sub); font-size: 15px; line-height: 1;
  padding: 3px 8px; border-radius: 4px;
}
.fbtn:hover { background: rgba(0,0,0,.06); color: var(--err); }
.fwin-tabs { display: flex; gap: 2px; padding: 6px 12px 0; border-bottom: 1px solid var(--line2); }
.tab {
  background: none; border: none; cursor: pointer;
  color: var(--sub); font-size: 13.5px; font-family: inherit;
  padding: 8px 16px; margin-bottom: -1px;
  border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }
.badge {
  background: var(--err); color: #fff; border-radius: 9px;
  padding: 0 6px; font-size: 10px; font-weight: 700;
}
.fwin-body {
  flex: 1; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column;
  padding: 12px 16px 14px;
}

/* 独立工作窗口：由右键菜单调用 window.open 打开，只保留当前功能工作区。 */
body.workspace-window { padding-left: 0; overflow: hidden; }
.workspace-window .sidenav,
.workspace-window .topbar,
.workspace-window #view-console > .toolbar,
.workspace-window #view-console > .board,
.workspace-window #ctx-menu { display: none !important; }
.workspace-window .shell { height: 100vh; }
.workspace-window .view { display: none !important; }
.workspace-window #view-console { display: block !important; height: 100vh; padding: 0 !important; }
.workspace-window #win-layer { position: fixed; inset: 0; }
.workspace-window .fwin,
.workspace-window .fwin.fwin-max,
.workspace-window .fwin-aux.fwin-proc,
.workspace-window .fwin-aux.fwin-mon {
  position: fixed; inset: 0 !important; width: 100% !important; height: 100% !important;
  min-width: 0; min-height: 0; border: 0; border-radius: 0; box-shadow: none;
}
.workspace-window .fwin-head { cursor: default; border-radius: 0; }
.workspace-window .fwin [data-a=max],
.workspace-window .fwin .rs { display: none; }
.offline-note {
  margin: 0 0 10px; padding: 8px 12px;
  background: #fff2f0; color: var(--err);
  border: 1px solid #ffccc7; border-radius: 6px; font-size: 12px;
}

/* ── 交互式终端 ── */
.term-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.term-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 0 0 8px;
}
.term-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #f59e0b; flex: none;
}
.term-state { font-size: 12px; color: var(--sub); }
.term-flex { flex: 1; }
.term-hint { font-size: 11.5px; }
.term {
  flex: 1; min-height: 0; overflow-y: auto;
  background: #10151d; border: 1px solid #232b38; border-radius: 6px;
  padding: 10px 12px 6px;
  font-family: var(--mono); font-size: 13px; line-height: 1.55;
  color: #d7dde6;
}
.term:focus { outline: none; border-color: #2f4a6e; }
.term-out span { white-space: pre-wrap; word-break: break-all; }
/* 输出末尾解析出的提示符：隐藏，由输入行的提示符代替显示 */
.term-out span.t-ps-hide { display: none; }
/* ANSI SGR 前景色（xterm 16 色近似，适配深色终端背景） */
.a30 { color: #6b7280; }  .a31 { color: #f87171; }
.a32 { color: #34d399; }  .a33 { color: #fbbf24; }
.a34 { color: #60a5fa; }  .a35 { color: #c084fc; }
.a36 { color: #22d3ee; }  .a37 { color: #e5e7eb; }
.a90 { color: #9ca3af; }  .a91 { color: #fca5a5; }
.a92 { color: #6ee7b7; }  .a93 { color: #fde68a; }
.a94 { color: #93c5fd; }  .a95 { color: #d8b4fe; }
.a96 { color: #67e8f9; }  .a97 { color: #ffffff; }
.a-bold { font-weight: 700; }
.t-echo { color: #8ab4ff; }
.t-err  { color: #ff8a80; }
.t-sys  { color: #7f8ea3; }
.term-row { display: flex; align-items: center; gap: 7px; padding: 2px 0 6px; }
.term-ps { color: #34d399; font-weight: 700; user-select: none; }
.term-in {
  flex: 1; background: none; border: none; outline: none;
  color: #eef4fb; caret-color: #34d399;
  font-family: var(--mono); font-size: 13px;
}
.term.dead { opacity: .55; }

/* ── 文件传输与任务 ── */
.file-card {
  background: var(--panel); border: 1px solid var(--line2);
  border-radius: 6px; padding: 13px 15px; margin-bottom: 13px;
}
.file-card h3 { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.file-card h3 small { color: var(--sub); font-weight: 400; margin-left: 8px; font-size: 11.5px; }
.row-form { display: flex; gap: 8px; }
.row-form > input[type="text"] { flex: 1; padding: 7px 11px; font-family: var(--mono); font-size: 12.5px; outline: none; }
.row-form.push { flex-wrap: wrap; }
.row-form.push input[type="file"] { flex: 2; min-width: 200px; padding: 6px; }
.row-form.push input[type="text"] { flex: 3; min-width: 220px; }
.pull-list, .task-list { list-style: none; margin: 10px 0 0; padding: 0; }
.fwin-body > .task-list { flex: 1; min-height: 0; overflow-y: auto; }
.task-filter { display:flex; flex-wrap:wrap; align-items:center; gap:7px; padding:4px 0 7px; }
.task-filter select, .task-filter input { height:30px; border:1px solid var(--line); border-radius:6px; background:var(--panel); color:var(--text); padding:0 7px; }
.task-filter label { display:flex; align-items:center; gap:4px; color:var(--sub); font-size:12px; }
.pull-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 7px 2px; border-top: 1px solid var(--line2);
  font-family: var(--mono); font-size: 12.5px;
}
.pull-list a { color: var(--primary); text-decoration: none; }
.pull-list a:hover { text-decoration: underline; }
.hint-line { margin-top: 8px; }
.task-list li {
  display: flex; gap: 12px; align-items: center;
  padding: 7px 2px; border-top: 1px solid var(--line2); font-size: 13px;
}
.ttime { width:145px; flex:none; color:var(--sub); font-family:var(--mono); font-size:11px; }
.tclient { width:110px; flex:none; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tkind { width: 86px; flex:none; font-size: 11px; color: var(--primary); }
.tstat { width: 52px; font-size: 12px; }
.tstat.done-ok, .tstat.running { color: var(--ok); }
.tstat.running { color: var(--warn); }
.tstat.done-err { color: var(--err); }
.tdetail {
  flex: 1; color: var(--sub); font-family: var(--mono); font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── 右键菜单 ── */
.ctx-menu {
  position: fixed; z-index: 90; margin: 0; padding: 5px; list-style: none;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.12);
  min-width: 168px;
}
.ctx-menu li {
  padding: 8px 13px; font-size: 13px; color: var(--ink);
  border-radius: 4px; cursor: pointer;
}
.ctx-menu li:hover { background: rgba(9,96,189,.08); color: var(--primary); }

/* ── 生成页 ── */
.gen-page {
  max-width: 560px; width: 100%;
  background: var(--panel); border: 1px solid var(--line2);
  border-radius: var(--radius); padding: 26px 30px;
}
.gen-page h2 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.gen-page > .muted { font-size: 13px; }
.gen-form { margin-top: 20px; }
.gen-form label { display: block; margin-bottom: 16px; font-size: 13px; color: var(--sub); }
.gen-form label em { font-style: normal; opacity: .75; }
.gen-form input {
  display: block; width: 100%; max-width: 420px; margin-top: 6px;
  padding: 9px 12px; font-family: var(--mono); font-size: 13px; outline: none;
}
.gen-page .row { display: flex; gap: 10px; margin-top: 6px; }

.it-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-bottom: 10px;
}
.it-bar label { display: flex; align-items: center; gap: 7px; }
.it-process { width: 210px; }
.it-state { margin-left: auto; }
.it-summary { display: flex; gap: 22px; padding: 8px 10px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: 7px; background: #f8fafc; }
.it-summary b { color: var(--primary); }
.it-scroll { min-height: 240px; flex: 1; }
.it-list { display: flex; flex-direction: column; gap: 10px; padding: 2px; }
.it-card { padding: 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); }
.it-card-head { display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 7px; }
.it-card-head span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.it-keys-box { display: block; width: 100%; min-height: 58px; max-height: 240px;
  box-sizing: border-box; resize: vertical; overflow-wrap: anywhere;
  word-break: break-all; white-space: pre-wrap; line-height: 1.65;
  font-family: var(--mono); }
.it-empty { padding: 30px; text-align: center; }
.fwin-telemetry .fwin-body { display: flex; flex-direction: column; min-height: 0; }

@media (max-width: 900px) {
  body { padding-left: 0; }
  .sidenav { position: static; width: auto; flex-direction: row; align-items: center; height: 52px; }
  .sidenav .logo { margin: 0 10px; }
  .shell { height: calc(100vh - 52px); }
  .os-cell { max-width: 160px; }
  .c-num { display: none; }
}

/* 状态标签旁的心跳时间 */
.ago { color: var(--sub); font-size: 12px; }

/* ── 文件浏览器 ── */
.fb-toolbar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px; flex-wrap: wrap;
}
.fb-crumbs {
  flex: 1; min-width: 160px;
  background: var(--raise); border: 1px solid var(--line2);
  border-radius: 6px; padding: 5px 10px;
  font-family: var(--mono); font-size: 12.5px;
  overflow-x: auto; white-space: nowrap;
}
.crumb { color: var(--primary); cursor: pointer; }
.crumb::after { content: ' / '; color: var(--sub); }
.crumb:last-child::after { content: ''; }
.crumb:hover { text-decoration: underline; }
.crumb.cur { color: var(--ink); font-weight: 600; cursor: default; }
.crumb.cur:hover { text-decoration: none; }
.fb-path {
  flex: 1; min-width: 200px; padding: 5px 10px; outline: none;
  font-family: var(--mono); font-size: 12.5px;
}
.fb-filter {
  width: 170px; padding: 4px 10px; outline: none;
  border-radius: 6px; font-size: 12.5px;
}
.fb-count { margin-left: auto; white-space: nowrap; }
.mini-btn.danger { color: var(--err); border-color: #ffccc7; }
.mini-btn.danger:hover { background: var(--err); color: #fff; border-color: var(--err); }

/* 批量操作条 */
.fb-batch {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px; padding: 6px 10px;
  background: #e6f4ff; border: 1px solid #91caff; border-radius: 6px;
  font-size: 12.5px;
}
.fb-selinfo { color: var(--primary); font-weight: 600; }

/* 状态栏与传输进度条 */
.fb-status {
  min-height: 20px; margin-bottom: 6px;
  font-family: var(--mono); font-size: 12px;
  display: flex; align-items: center; gap: 10px;
}
.pbar {
  display: inline-block; width: 180px; height: 6px; flex: none;
  background: #eef0f2; border-radius: 3px; overflow: hidden;
}
.pbar i { display: block; height: 100%; background: var(--primary); transition: width .25s; }

/* 列表区（同时作为拖拽上传的落点）：撑满剩余高度，内部滚动，
   工具栏/路径栏固定不随之滚出 */
.fb-scroll {
  position: relative;
  flex: 1; min-height: 0; overflow-y: auto;
  border: 1px solid var(--line2); border-radius: 6px;
}
.fb-scroll.dragover {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 2px rgba(9,96,189,.25);
  background: rgba(9,96,189,.04);
}
.fb-drop-hint {
  position: absolute; inset: 0; z-index: 5; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(230,244,255,.92); color: var(--primary);
  font-size: 15px; font-weight: 600;
}
.fb-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fb-table th {
  text-align: left; padding: 7px 10px;
  background: #fafafa; font-size: 12.5px; font-weight: 600;
  border-bottom: 1px solid var(--line2); white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
.fb-table th.sortable { cursor: pointer; user-select: none; }
.fb-table th.sortable:hover { color: var(--primary); }
.fb-table th .arr { font-style: normal; font-size: 9px; color: var(--primary); margin-left: 3px; }
.fb-table td {
  padding: 5px 10px; border-top: 1px solid var(--line2);
  font-family: var(--mono); font-size: 12.5px; white-space: nowrap;
}
.fb-table tbody tr { transition: background .1s; }
.fb-table tbody tr:hover { background: #f7fafd; }
.fb-table tbody tr.selected { background: rgba(9,96,189,.09); }
.fb-check { width: 34px; text-align: center; }
.fb-check input { accent-color: var(--primary); cursor: pointer; vertical-align: middle; }
.fb-name .nm { cursor: default; }
.fb-name .nm.dir { color: var(--ink); font-weight: 600; cursor: pointer; }
.fb-name .nm.dir:hover { color: var(--primary); text-decoration: underline; }

/* 类型图标徽章 */
.fb-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px; margin-right: 8px;
  vertical-align: middle; flex: none;
  font-family: var(--sans); font-size: 8.5px; font-weight: 700;
  color: #fff; letter-spacing: .3px;
}
.fb-ico.dir { font-size: 14px; background: none; }

.fb-ops-col { width: 250px; text-align: right; }
.fb-rowops { text-align: right; }
.fb-rowops .mini-btn { margin-left: 4px; padding: 2px 9px; font-size: 11px; }
.fb-empty { padding: 26px; text-align: center; }

/* ── 在线编辑器对话框 ── */
.dlg-editor {
  width: min(1060px, 94%); height: min(78vh, 780px);
  min-width: 430px; min-height: 300px;
  max-width: 96%; max-height: 92vh;
  display: flex; flex-direction: column;
  resize: both; overflow: hidden;
}
.dlg-editor h4 { font-family: var(--mono); font-size: 12.5px; }
.ed-text {
  flex: 1; min-height: 0; width: 100%; resize: none;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.5;
  outline: none; color: var(--ink); background: var(--panel);
}
.ed-text:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(9,96,189,.1); }
.ed-text[disabled] { opacity: .55; }
.ed-info { margin-top: 6px; }
.dlg-editor .dlg-row { margin-top: 10px; }

/* ── 窗口内对话框 ── */
.dlg-mask {
  position: absolute; inset: 0; z-index: 30;
  background: rgba(0,0,0,.28);
  display: flex; align-items: center; justify-content: center;
}
.dlg {
  width: min(360px, 86%);
  background: var(--panel); border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,.22);
  padding: 18px 20px;
}
.dlg h4 {
  margin: 0 0 12px; font-size: 14px; font-weight: 600;
  word-break: break-all; white-space: pre-wrap;
}
.dlg-input, .dlg input[type="text"] {
  width: 100%; padding: 8px 11px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; color: var(--ink);
  font-family: var(--mono); font-size: 13px; outline: none;
}
.dlg input:focus { border-color: var(--primary); }
.dlg-row { display: flex; gap: 10px; margin-top: 16px; justify-content: flex-end; }
.global-dialog-mask { position: fixed; z-index: 10050; }
.account-dialog[open] {
  position: fixed; inset: 0; margin: 0; border: 0; padding: 12px;
  width: 100%; height: 100%; max-width: none; max-height: none;
  box-sizing: border-box; overflow: auto; align-items: safe center;
}
.account-dialog::backdrop { background: transparent; }
.account-dialog .dlg input + input { margin-top: 8px; }
.global-message-dlg { width: min(460px, calc(100vw - 32px)); }
.global-message-text {
  color: var(--ink); font-size: 13.5px; line-height: 1.7;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.socks-dlg { width:min(820px, 94vw); max-height:88vh; overflow:auto; }
.socks-dlg .gen-row { flex-wrap:wrap; }
.socks-dlg .gen-row label { min-width:210px; }
.socks-dlg .sk-list { margin-top:14px; border:1px solid var(--line); border-radius:8px; padding:10px; min-height:48px; }
.socks-dlg .sk-peers { margin-top:14px; border-top:1px solid var(--line); padding-top:12px; }
.socks-dlg .sk-peers strong { display:block; margin-bottom:7px; font-size:13px; }
.socks-dlg .sk-peer-list { min-height:34px; max-height:140px; overflow:auto; font-family:var(--mono); font-size:12px; line-height:1.8; }

/* ── MCP 接口页 ── */
.mcp-panel { padding: 26px 30px; max-width: 760px; }
.client-update-panel { margin:24px; padding:26px 30px; max-width:900px; }
.client-update-panel h2 { margin:0 0 6px; font-size:18px; }
.cu-grid { display:grid; grid-template-columns:1fr 1.2fr; gap:22px; margin-top:22px; }
.cu-grid label { display:flex; flex-direction:column; gap:8px; font-size:13px; }
.cu-grid input[type=file], .cu-grid select { border:1px solid var(--line); border-radius:8px; padding:10px; background:var(--panel); color:var(--text); }
.cu-grid select { min-height:210px; font-family:var(--mono); }
.cu-all { display:flex; gap:7px; align-items:center; margin:14px 0; font-size:13px; }
.cu-actions { display:flex; align-items:center; gap:12px; margin:14px 0 20px; }
.cu-result-table { width:100%; border-collapse:collapse; font-size:13px; }
.cu-result-table th, .cu-result-table td { text-align:left; padding:9px 10px; border-top:1px solid var(--line); }
.cu-result-table .done-ok { color:var(--ok); }
.cu-result-table .done-err { color:var(--err); }
.template-grid { grid-template-columns:1.4fr .8fr; }
.template-grid select { min-height:auto; }
.ct-auto-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.ct-auto-row input { width: auto; }

.template-result { border:1px solid var(--line); border-radius:8px; padding:12px; font-family:var(--mono); font-size:12px; word-break:break-all; }
.mcp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.mcp-head h3 { margin: 0 0 4px; font-size: 15px; }
.mcp-head p { margin: 0; }
.status-badge {
  flex: none; padding: 3px 12px; border-radius: 999px; font-size: 12px;
  font-family: var(--sans);
}
.status-badge.ok  { background: #f6ffed; color: var(--ok); border: 1px solid #b7eb8f; }
.status-badge.off { background: #f5f5f5; color: var(--sub); border: 1px solid #d9d9d9; }
.status-badge.err { background: #fff2f0; color: var(--err); border: 1px solid #ffccc7; }
.mcp-form { margin-top: 22px; display: flex; flex-direction: column; gap: 16px; }
.switch-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 44px; width: 100%; box-sizing: border-box;
  padding: 10px 14px; border: 1px solid var(--line2); border-radius: 6px;
  color: var(--ink); background: var(--panel); font: inherit; text-align: left;
  cursor: pointer;
}
.switch-row:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.switch-row:disabled { opacity: .65; cursor: default; }
.switch-track {
  position: relative; width: 40px; height: 22px; flex: none;
  border-radius: 999px; background: #687687;
}
.switch-track::before {
  content: '';
  position: absolute; left: 2px; top: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.switch-row[aria-checked="true"] .switch-track { background: var(--primary); }
.switch-row[aria-checked="true"] .switch-track::before { left: 20px; }
.field-row { display: flex; align-items: center; gap: 14px; }
.field-row label { width: 70px; flex: none; color: var(--sub); font-size: 13px; }
.field-row input {
  flex: 1; padding: 7px 12px; border: 1px solid var(--line);
  border-radius: 6px; font-family: var(--mono); font-size: 13px;
  color: var(--ink); background: var(--panel); outline: none;
}
.field-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(9,96,189,.1); }
.token-row { display: flex; gap: 8px; flex: 1; }
.mcp-actions { display: flex; align-items: center; gap: 12px; }
#mcp-msg { min-width: 0; overflow-wrap: anywhere; }
#mcp-port[aria-invalid="true"] { border-color: var(--err); }
#settings-form .mcp-actions { flex-wrap: wrap; }
#settings-msg { flex-basis: 100%; }
#settings-form .token-row, #settings-client-token { min-width: 0; }
.mcp-example { margin-top: 26px; border-top: 1px solid var(--line2); padding-top: 18px; }
.mcp-example h4 { margin: 0 0 10px; font-size: 13.5px; }
.mcp-cmd {
  position: relative; margin: 0; padding: 12px 40px 12px 14px;
  background: #10151d; color: #d7dde6; border-radius: 6px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6;
  overflow-x: auto; white-space: pre-wrap; word-break: break-all;
}
.mcp-cmd .ip-copy { position: absolute; right: 8px; top: 8px; color: #8b98a9; opacity: 1; }
.mcp-cmd .ip-copy:hover { color: #fff; background: rgba(255,255,255,.12); }
.ip-copy.always { opacity: 1; }

/* ---------- 屏幕控制窗口 ---------- */
.scr-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px; border-bottom: 1px solid var(--line2);
  background: var(--panel-2);
}
.scr-bar select {
  padding: 4px 6px; border: 1px solid var(--line); border-radius: 5px;
  font-size: 12.5px; color: var(--ink); background: var(--panel);
}
.scr-bar button:disabled,
.scr-bar select:disabled {
  opacity: .45;
  cursor: not-allowed;
  filter: grayscale(.35);
}
.scr-ctl-label {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px; color: var(--sub); cursor: pointer; user-select: none;
}
.scr-stage {
  position: relative; flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: auto; background: #0b0f14;
  outline: none; cursor: default;
}
.scr-stage.scr-control-on { cursor: none; }
.scr-stage.scr-scroll-mode {
  align-items: flex-start;
  justify-content: flex-start;
}
.scr-canvas { display: block; box-shadow: 0 0 0 1px #232b36; }
.scr-pointer {
  position: absolute; left: 0; top: 0; z-index: 4;
  width: 15px; height: 21px; pointer-events: none;
  transform-origin: 0 0; will-change: transform;
  background: #fff;
  clip-path: polygon(0 0, 0 18px, 5px 13px, 8px 21px, 12px 19px,
                     9px 12px, 15px 12px);
  filter: drop-shadow(0 0 1px #000) drop-shadow(1px 1px 1px #000);
}
.scr-hint, .scr-err {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none; color: #8b98a9; font-size: 13px;
}
.scr-err { top: 58%; color: #ff9c9c; }
.scr-status {
  padding: 5px 10px; border-top: 1px solid var(--line2);
  font-size: 12px; color: var(--sub);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ═══════════ Web 登录遮罩 ═══════════ */
.login-mask {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(15, 23, 42, .55);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
}
.login-card {
  width: 320px; padding: 34px 30px 26px;
  background: var(--panel); border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
  text-align: center;
}
.login-card h3 { margin: 6px 0 2px; letter-spacing: 1px; }
.login-card input {
  width: 100%; margin: 14px 0 4px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; outline: none;
}
.login-card input:focus { border-color: var(--primary); }
.login-card .btn { width: 100%; margin-top: 12px; }
.login-card #login-msg { min-height: 18px; margin: 8px 0 0; color: var(--err); font-size: 12.5px; }

/* ═══════════ 进程管理窗口 ═══════════ */
.fwin-aux.fwin-proc, .fwin-aux.fwin-mon { width: 1020px !important; }
.p-table th:nth-child(5) { width: 34%; }
.p-table td { padding: 4px 10px; font-size: 12.5px; }
.p-table .p-path {
  max-width: 330px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; color: var(--sub); font-family: var(--mono);
}
.p-table .p-name { font-weight: 600; }
.p-total { margin-left: 8px; }
.p-filter { margin-left: auto; }
.p-status { padding: 5px 10px; }

/* ═══════════ 性能监控窗口 ═══════════ */
.mon-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.mon-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; padding: 12px 10px 4px;
}
.mon-card {
  background: var(--raise); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px;
}
.mon-card h5 { margin: 0 0 4px; color: var(--sub); font-size: 12px; font-weight: 500; }
.mon-big { font-size: 24px; font-weight: 700; font-family: var(--mono); }
.mon-mut { color: var(--sub); font-size: 11.5px; margin: 2px 0 6px; }
.mon-net { line-height: 1.55; font-family: var(--mono); }
.mon-up { font-size: 18px; font-weight: 600; font-family: var(--mono); }
.mon-disk-title { margin: 10px 12px 4px; color: var(--sub); }
.mon-disks { padding: 0 12px 12px; }
.mon-disk { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.md-mount { min-width: 110px; font-family: var(--mono); font-size: 12.5px; }
.md-bar { flex: 1; height: 8px; background: #eef2f6; border-radius: 99px; overflow: hidden; }
.md-free { font-size: 11.5px; white-space: nowrap; }

/* ═══════════ 音频监听窗口 ═══════════ */
.aud-section { border-bottom: 1px solid var(--line); }
.aud-title { padding: 10px 10px 0; font-weight: 600; }
.aud-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px; border-bottom: 1px solid var(--line);
}
.aud-device { min-width: 180px; max-width: 300px; }
.aud-wave-wrap {
  position: relative; padding: 0 10px 10px; background: #fff;
}
.aud-wave {
  display: block; width: 100%; height: 92px; border: 1px solid var(--line);
  border-radius: 8px; background: #f6f9fc; box-sizing: border-box;
}
.aud-wave-level {
  position: absolute; right: 18px; top: 7px; padding: 2px 6px;
  border-radius: 10px; color: var(--sub); background: rgba(255,255,255,.82);
  font: 11px var(--mono);
}
.aud-bar label { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }
.aud-bar input[type=number] {
  width: 64px; padding: 4px 8px; border: 1px solid var(--line);
  border-radius: 6px; outline: none;
}
.aud-bar select { padding: 4px 8px; }
.aud-stage {
  display: flex; flex-direction: column; gap: 10px;
  align-items: flex-start; padding: 16px;
}
.aud-player { width: 100%; }
.aud-save { text-decoration: none; }
.aud-hint { line-height: 1.6; }
.aud-status { padding: 4px 16px 12px; }

/* ═══════════ 终端多标签 ═══════════ */
.term-tabs {
  display: flex; align-items: center; gap: 4px;
  padding: 5px 8px; border-bottom: 1px solid var(--line);
  background: var(--raise); overflow-x: auto; flex: none;
}
.tt {
  padding: 3px 12px; font-size: 12px; border-radius: 6px 6px 0 0;
  border: 1px solid transparent; background: transparent;
  color: var(--sub); cursor: pointer; white-space: nowrap;
}
.tt:hover { color: var(--ink); background: #eef2f6; }
.tt.active {
  background: var(--panel); color: var(--primary);
  border-color: var(--line); border-bottom-color: var(--panel);
  font-weight: 600;
}
.tt-add { color: var(--primary); font-weight: 700; }
.term-stack { flex: 1; display: flex; min-height: 0; }
.term-stack .term-wrap { display: none; }
.term-stack .term-wrap.active { display: flex; }
.term-find {
  width: 130px; padding: 3px 8px; font-size: 12px;
  border: 1px solid var(--line); border-radius: 6px; outline: none;
}
.term-find:focus { border-color: var(--primary); }
.term-find-n { font-size: 11px; white-space: nowrap; }
.t-hit { background: #fde68a; border-radius: 2px; }
.term-shell { padding: 3px 6px; font-size: 12px; }

/* ═══════════ 窗口最大化 ═══════════ */
.fwin-max { left: 8px !important; top: 8px !important; z-index: 9998 !important; }

/* ═══════════ 网络连接窗口 ═══════════ */
.cn-proto-cell { font-family: var(--mono); font-weight: 600; }
.cn-addr { font-family: var(--mono); font-size: 12px; }
.cn-est { color: var(--ok); font-weight: 600; }
.cn-count { margin-left: auto; }

/* ═══════════ 注册表窗口（Windows regedit 风格） ═══════════ */
.rg-main { display: flex; flex: 1; min-height: 0; border-top: 1px solid var(--line2); }
.rg-tree {
  width: 32%; min-width: 220px; max-width: 430px;
  overflow: auto; padding: 6px 0; background: var(--panel-2);
  border-right: 1px solid var(--line); font-family: var(--mono); font-size: 12.5px;
}
.rg-values { flex: 1; min-width: 0; }
.rg-tree-row {
  height: 25px; display: flex; align-items: center; gap: 4px;
  white-space: nowrap; cursor: default; user-select: none;
}
.rg-tree-row:hover { background: #eaf2ff; }
.rg-tree-row.active { background: #cfe3ff; color: #075fbd; }
.rg-exp {
  width: 18px; height: 20px; padding: 0; border: 0; background: transparent;
  color: var(--sub); cursor: pointer; font-size: 12px;
}
.rg-folder { color: #d99a00; font-size: 11px; }
.rg-tree-label { padding: 3px 8px 3px 0; flex: 1; }
.rg-path { min-width: 260px; flex: 1; font-family: var(--mono); }
.rg-vname { font-family: var(--mono); font-weight: 600; }
.rg-vtype { color: var(--sub); font-family: var(--mono); font-size: 12px; }
.rg-vdata {
  font-family: var(--mono); font-size: 12px;
  max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rg-vtable td { padding: 4px 10px; font-size: 12.5px; }
.fwin-reg .fwin-body { overflow: hidden; }

/* ═══════════ 电源操作 / 批量执行 对话框 ═══════════ */
.pw-grid { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; min-width: 320px; }
.pw-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 12px; }
.pw-item b { font-size: 13.5px; }
.pw-item .muted { font-size: 11.5px; }
.pw-item.danger { color: var(--err); border-color: #ffccc7; }
.dlg-batch { width: 560px; }
.ba-hosts {
  display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0;
  max-height: 140px; overflow-y: auto; padding: 6px;
  border: 1px solid var(--line); border-radius: 8px;
}
.ba-host { display: inline-flex; gap: 5px; align-items: center; font-size: 12.5px; }
.ba-cmd { font-family: var(--mono); }
.ba-status { min-height: 18px; margin-top: 6px; }

/* 性能窗口登录用户 */
.mon-users { padding: 0 12px 12px; font-size: 13px; }

/* ═══════════ 生成客户端页全配置 ═══════════ */
.gen-row { display: flex; gap: 14px; margin-bottom: 10px; }
.gen-row label { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.gen-row em { font-style: normal; color: var(--sub); font-size: 11.5px; }
.gen-port-warn {
  margin: -4px 0 10px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 77, 79, 0.45);
  border-radius: 6px;
  background: rgba(255, 77, 79, 0.08);
  color: #ff7875;
  font-size: 12px;
  line-height: 1.5;
}
.gen-row input, .gen-row select {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  outline: none; font-size: 13.5px; background: var(--panel);
}
.gen-row input:focus, .gen-row select:focus { border-color: var(--primary); }
.gen-install { margin: 4px 0 10px; border: 1px dashed var(--line); border-radius: 8px; padding: 8px 12px; }
.gen-install summary { cursor: pointer; color: var(--sub); font-size: 13px; user-select: none; }
.gen-install[open] summary { margin-bottom: 8px; }
.gen-check { flex-direction: row !important; align-items: center; gap: 6px !important; justify-content: flex-end; }

/* ═══════════ 首启设置视图与菜单操作 ═══════════ */
.login-card #setup-view { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.login-card #setup-view input {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; outline: none; box-sizing: border-box;
}
.login-card #setup-view input:focus { border-color: var(--primary); }
.login-card .setup-note { text-align: left; font-size: 12.5px; line-height: 1.6; }
.nav-act { color: var(--sub); }
.nav-act:hover span:last-child { color: var(--primary); }
.cp-msg { min-height: 16px; }

/* ═══════════ 侧栏「系统」分组与分隔线 ═══════════ */
.nav-sep { height: 1px; background: var(--line); margin: 8px 14px; }
.nav-toggle .chev { margin-left: auto; transition: transform .15s; font-size: 10px; color: var(--sub); }
.nav-item.open .chev { transform: rotate(180deg); }
.nav-sub { display: flex; flex-direction: column; overflow: hidden; max-height: 200px; transition: max-height .18s ease; }
.nav-sub.hidden { display: none; }
.nav-sub-item { padding-left: 30px !important; font-size: 13.5px; }

/* ═══════════ 右键菜单分组与二级飞出 ═══════════ */
.ctx-menu { position: fixed; z-index: 9000; min-width: 168px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 12px 36px rgba(0,0,0,.16);
  padding: 5px; list-style: none; margin: 0; }
.ctx-menu li { position: relative; padding: 7px 12px; font-size: 13px;
  cursor: pointer; white-space: nowrap; border-radius: 6px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.ctx-menu li:hover { background: #eef4fb; color: var(--primary); }
.ctx-menu li.danger { color: var(--err); }
.ctx-menu li.danger:hover { background: #fff1f0; }
.ctx-menu li.sep { height: 1px; padding: 0; margin: 5px 8px;
  background: var(--line); border-radius: 0; pointer-events: none; }
.ctx-menu li.has-sub .arr { font-size: 10px; color: var(--sub); }
.ctx-menu li.plugin-feature:not(.has-sub) { display: grid;
  grid-template-columns: max-content max-content; column-gap: 16px; }
.ctx-menu li > .ctx-item-label { display: block; min-width: 0; }
.ctx-plugin-status { justify-self: end; margin-left: auto; text-align: right;
  color: var(--sub); font-size: 12px; white-space: nowrap; }
.ctx-menu ul.sub { position: absolute; display: block; list-style: none;
  margin: 0; padding: 5px; min-width: 210px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.14); }
.ctx-menu ul.sub.hidden { display: none; }

/* 系统服务管理 */
.svc-toolbar { gap: 8px; }
.svc-toolbar .svc-filter { min-width: 220px; flex: 1; }
.svc-table { table-layout: fixed; min-width: 980px; }
.svc-table th:nth-child(1) { width: 19%; }
.svc-table th:nth-child(2) { width: 27%; }
.svc-table th:nth-child(3) { width: 10%; }
.svc-table th:nth-child(4) { width: 22%; }
.svc-table th:nth-child(5) { width: 22%; }
.svc-name { font-family: var(--mono); word-break: break-all; }
.svc-display { font-weight: 600; }
.svc-desc { margin-top: 3px; font-size: 11.5px; line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc-state { display: inline-flex; align-items: center; padding: 2px 9px;
  border-radius: 999px; font-size: 12px; white-space: nowrap; }
.svc-state.running { color: #1f8f4d; background: #e9f8ef; }
.svc-state.stopped { color: #697386; background: #f0f2f5; }
.svc-state.failed { color: #cf1322; background: #fff1f0; }
.svc-startup-edit, .svc-actions { display: flex; align-items: center;
  gap: 5px; flex-wrap: wrap; }
.svc-startup-edit select { min-width: 100px; height: 29px; border: 1px solid var(--line);
  border-radius: 5px; background: #fff; }
.svc-status { min-height: 18px; padding: 5px 12px; }

/* Windows 已安装软件 */
.soft-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px; }
.soft-categories { display: inline-flex; gap: 5px; }
.soft-categories .mini-btn.active { background: var(--primary); color: #fff; }
.soft-filter { flex: 1; min-width: 220px; height: 30px; padding: 0 10px; }
.soft-table { table-layout: fixed; min-width: 940px; }
.soft-table th:nth-child(1) { width: 28%; }
.soft-table th:nth-child(2) { width: 12%; }
.soft-table th:nth-child(3) { width: 22%; }
.soft-table th:nth-child(4) { width: 10%; }
.soft-table th:nth-child(5) { width: 15%; }
.soft-table th:nth-child(6) { width: 13%; }
.soft-name { font-family: var(--sans); font-weight: 600; overflow: hidden;
  text-overflow: ellipsis; }
.soft-category { display: inline-flex; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; white-space: nowrap; background: #f0f2f5; color: #596579; }
.soft-category.antivirus { background: #fff1f0; color: #cf1322; }
.soft-category.communication { background: #e6f4ff; color: #0958d9; }
.soft-category.game { background: #f9f0ff; color: #722ed1; }
.soft-category.tool { background: #f6ffed; color: #389e0d; }
.soft-status { min-height: 18px; padding: 5px 12px; }

/* ══════════════════════════════════════════════════════════════
   DESIGN v2 —— 运维驾驶舱视觉层（深色导航 + AntD 浅色内容）
   签名元素：深海军蓝侧栏 + LED 脉冲徽标 + 主色激活条
   ══════════════════════════════════════════════════════════════ */

:root {
  --page: #eef2f7;
  --line: #e4e9f0;
  --line2: #e4e9f0;
  --primary-b: #3b8cff;
  --ink-num: var(--mono);
}

body { padding-left: 170px; }

@media (max-width: 900px) {
  body { padding-left: 0; }
}

/* ── 侧栏：深海军蓝驾驶舱 ── */
.sidenav {
  width: 170px; padding: 16px 12px 12px;
  background: linear-gradient(180deg, #0e1c30 0%, #0a1524 100%);
  border-right: none;
}
.sidenav .logo {
  width: 40px; height: 40px; margin: 2px auto 20px; border-radius: 10px;
  background: linear-gradient(135deg, #1a77e8, #0952ad);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(22, 104, 220, .45);
  position: relative;
}
.sidenav .logo::after {
  content: 'RC'; font: 700 13px/1 var(--mono); color: #fff; letter-spacing: .5px;
}
.sidenav .logo::before {
  content: ''; position: absolute; right: -3px; top: -3px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #2ecc71; border: 2px solid #0e1c30;
  animation: led-pulse 2.4s ease-in-out infinite;
}
@keyframes led-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, .5); }
  50%      { box-shadow: 0 0 0 5px rgba(46, 204, 113, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .sidenav .logo::before { animation: none; }
}
.nav-item {
  color: rgba(255, 255, 255, .72);
  font-size: 13.5px; padding: 10px 12px; border-radius: 7px;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(59, 140, 255, .32), rgba(59, 140, 255, .10));
  color: #fff; font-weight: 600;
  box-shadow: inset 3px 0 0 var(--primary-b);
}
.nav-item .ico { color: rgba(255, 255, 255, .85); }
.nav-sep { background: rgba(255, 255, 255, .08); margin: 10px 12px; }
.nav-toggle .chev { color: rgba(255, 255, 255, .45); }
.nav-sub { padding-left: 6px; }
.nav-sub-item { color: rgba(255, 255, 255, .62) !important; font-size: 13px !important; padding: 8px 12px 8px 34px !important; }
.nav-sub-item:hover { color: #fff !important; }
.nav-foot .ver { color: rgba(255, 255, 255, .32); }

/* ── 顶栏与统计胶囊 ── */
.topbar { box-shadow: 0 1px 0 var(--line); }
.page-title { font-size: 17px; letter-spacing: .2px; }
.stats .stat {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 14px; border-radius: 999px;
  background: #f4f7fb; border: 1px solid #e8edf4; font-size: 12.5px;
}

/* ── 内容面：白卡化与层次 ── */
.board {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .05); overflow: auto;
}
table.grid thead th {
  background: #f7f9fc; color: #5a6472; font-size: 12.5px;
  border-bottom: 1px solid var(--line);
}
table.grid td { border-bottom: 1px solid #f0f3f7; }
table.grid tbody tr:hover { background: #f7faff; }
.status-tag {
  padding: 2px 12px; border-radius: 999px; font-size: 12px; border: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.status-tag.on  { background: #e9f8ef; color: #1f9d55; }
.status-tag.on::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #35c26e; }
.status-tag.off { background: #f0f2f5; color: #8a93a3; }
/* Loader 引导阶段：黄色「安装模块中」，base 上线后转为绿色「在线」 */
.status-tag.installing { background: #fff7e6; color: #b8860b; }
.status-tag.installing::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: #e8a33d;
  animation: status-pulse 1.2s ease-in-out infinite;
}
@keyframes status-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
table.grid tr.installing td { background: #fffdf5; }

/* ── 控件：按钮 / 输入 ── */
.btn {
  height: 34px; padding: 0 16px; border-radius: 6px;
  border: 1px solid #d5dce6; background: #fff; color: var(--ink);
  font-size: 13px; cursor: pointer;
  transition: all .15s; display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary {
  background: linear-gradient(180deg, #1a77e8, #0960bd);
  border-color: #0d56ab; color: #fff;
  box-shadow: 0 1px 2px rgba(9, 96, 189, .35);
}
.btn.primary:hover { color: #fff; filter: brightness(1.07); }
.btn.primary:active { filter: brightness(.95); }
.btn.danger { color: var(--err); border-color: #ffccc7; }
.mini-btn { border-radius: 5px; }
.toolbar input, .toolbar select {
  height: 34px; border: 1px solid #d9dfe8; border-radius: 6px;
  padding: 0 12px; background: #fff; outline: none; font-size: 13px;
  transition: border-color .15s, box-shadow .15s;
}
.toolbar input:focus, .toolbar select:focus {
  border-color: #4a95f5;
  box-shadow: 0 0 0 3px rgba(22, 104, 220, .13);
}
.toolbar .chip { border-radius: 999px; padding: 5px 14px; font-size: 12.5px; }
.toolbar .chip.active { box-shadow: 0 1px 4px rgba(9, 96, 189, .3); }

/* ── 生成客户端页：配置卡片 ── */
.gen-page {
  width: 100%; max-width: 800px; margin: 0 auto; align-self: flex-start;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 30px 34px 26px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .05);
}
.gen-page h2 { font-size: 20px; }
.gen-form { margin-top: 8px; }
.gen-eyebrow {
  font-size: 12px; font-weight: 600; color: #5a6472;
  letter-spacing: .14em; margin: 20px 0 12px;
  padding-left: 9px; border-left: 3px solid var(--primary); line-height: 1.1;
}
.gen-eyebrow:first-of-type { margin-top: 8px; }
.gen-form .gen-row, .gen-form .gen-full { margin-bottom: 14px; }
.gen-full { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--sub); margin-bottom: 14px; }
.gen-form input, .gen-form select {
  width: 100%; height: 38px; box-sizing: border-box; border: 1px solid #d9dfe8; border-radius: 7px;
  padding: 0 12px; font-size: 13.5px; outline: none; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.gen-form input:focus, .gen-form select:focus {
  border-color: #4a95f5;
  box-shadow: 0 0 0 3px rgba(22, 104, 220, .13);
}
.gen-form input::placeholder { color: #b8c0cc; }
.gen-install {
  border: 1px solid #e6ebf2; border-radius: 10px; padding: 12px 16px;
  background: #fafbfd; margin: 6px 0 16px;
}
.gen-page .row { margin-top: 10px; }
.gen-page .btn.primary { height: 38px; padding: 0 26px; font-size: 14px; }

/* ── 登录 / 初始化卡片 ── */
.login-mask {
  background:
    radial-gradient(900px 500px at 20% 15%, rgba(22, 104, 220, .20), transparent 55%),
    radial-gradient(800px 500px at 85% 85%, rgba(10, 21, 36, .55), transparent 60%),
    rgba(8, 15, 30, .58);
  backdrop-filter: blur(6px);
}
.login-card {
  width: 360px; padding: 38px 34px 28px; border-radius: 14px;
  box-shadow: 0 28px 70px rgba(4, 12, 28, .45); text-align: center;
}
.login-card .logo {
  width: 46px; height: 46px; margin: 0 auto 16px; border-radius: 11px;
  background: linear-gradient(135deg, #1a77e8, #0952ad);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(22, 104, 220, .4);
}
.login-card .logo::after { content: 'RC'; font: 700 14px/1 var(--mono); color: #fff; }
.login-card h3 { margin: 0 0 4px; font-size: 19px; letter-spacing: .5px; }
.login-card .muted { font-size: 12.5px; }
.login-card input {
  height: 40px; padding: 0 14px; border-radius: 8px;
  border: 1px solid #d9dfe8; font-size: 14px;
  transition: border-color .15s, box-shadow .15s; box-sizing: border-box;
}
.login-card input:focus {
  border-color: #4a95f5;
  box-shadow: 0 0 0 3px rgba(22, 104, 220, .13);
}
.login-card .btn { height: 40px; border-radius: 8px; margin-top: 14px; }
.login-card .btn.primary {
  background: linear-gradient(180deg, #1a77e8, #0960bd);
  border-color: #0d56ab; box-shadow: 0 2px 8px rgba(9, 96, 189, .4);
}
#setup-view { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.setup-note { text-align: left; font-size: 12.5px; line-height: 1.65; }

/* ── 悬浮窗 / 对话框 ── */
.fwin { border-radius: 10px; box-shadow: 0 18px 48px rgba(10, 21, 36, .22); }
.fwin-head { border-radius: 10px 10px 0 0; }
.dlg { border-radius: 12px; box-shadow: 0 22px 56px rgba(10, 21, 36, .2); padding: 22px; }
.dlg h4 { font-size: 15px; margin: 0 0 12px; }
.dlg input[type=text], .dlg input[type=password], .dlg input[type=number], .dlg textarea {
  border: 1px solid #d9dfe8; border-radius: 7px; padding: 8px 12px;
  outline: none; transition: border-color .15s, box-shadow .15s; width: 100%;
  box-sizing: border-box; font-size: 13px;
}
.dlg input:focus, .dlg textarea:focus {
  border-color: #4a95f5;
  box-shadow: 0 0 0 3px rgba(22, 104, 220, .13);
}
.dlg-row { display: flex; gap: 10px; margin-top: 12px; }

/* ═══════════ v3：配色回退 AntD 原始令牌 + 生成页对齐修正 ═══════════ */
:root {
  --page: #f4f7f9;
  --line: #e8eaed;
  --line2: #f0f0f0;
  --primary-b: #0960bd;
}
body { padding-left: 148px; }
@media (max-width: 900px) { body { padding-left: 0; } }

/* 侧栏回浅色（保留结构：分组/折叠） */
.sidenav {
  width: 148px; padding: 14px 10px;
  background: var(--sider); border-right: 1px solid var(--line);
}
.sidenav .logo {
  width: 32px; height: 32px; margin: 2px auto 18px; border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #0d4f94);
  box-shadow: none; display: block;
}
.sidenav .logo::after { content: none; }
.sidenav .logo::before { content: none; animation: none; }
.nav-item {
  color: var(--ink); background: none; box-shadow: none;
  font-size: 13.5px; padding: 10px 12px; border-radius: 6px;
}
.nav-item:hover { background: rgba(9, 96, 189, .06); color: var(--primary); }
.nav-item.active {
  background: rgba(9, 96, 189, .1); color: var(--primary);
  font-weight: 600; box-shadow: none;
}
.nav-item .ico { color: inherit; }
.nav-sep { background: var(--line); margin: 8px 14px; }
.nav-toggle .chev { color: var(--sub); }
.nav-sub-item {
  color: var(--sub) !important; font-size: 13.5px !important;
  padding: 9px 12px 9px 30px !important;
}
.nav-sub-item:hover { color: var(--primary) !important; background: rgba(9, 96, 189, .06) !important; }
.nav-foot .ver { color: var(--sub); }

/* 按钮回 AntD 平色 */
.btn {
  height: auto; padding: 6px 18px; border-radius: 6px;
  border: 1px solid #d9d9d9; background: var(--panel); color: var(--ink);
  box-shadow: none; font-size: 13px; filter: none;
}
.btn:hover { background: var(--panel); border-color: var(--primary); color: var(--primary); }
.btn.primary {
  background: var(--primary); color: #fff;
  border-color: var(--primary); box-shadow: none; filter: none;
}
.btn.primary:hover { background: var(--primary-h); border-color: var(--primary-h); color: #fff; }
.btn.danger { color: var(--err); border-color: #ffccc7; }

/* 输入框：AntD 描边风（去光环，聚焦仅描边） */
.toolbar input, .toolbar select {
  height: auto; border: 1px solid #d9d9d9; border-radius: 6px;
  background: var(--panel); box-shadow: none;
}
.toolbar input:focus, .toolbar select:focus {
  border-color: var(--primary); box-shadow: none; color: var(--primary);
}
.toolbar .chip.active { box-shadow: none; }
.stats .stat { background: var(--panel); border: 1px solid var(--line); }
table.grid thead th { background: #fafafa; color: rgba(0, 0, 0, .65); }
table.grid tbody tr:hover { background: #f8fafc; }
.fwin { box-shadow: 0 6px 24px rgba(0, 0, 0, .14); }
.fwin.focused { box-shadow: 0 10px 34px rgba(9, 96, 189, .22); }
.dlg { box-shadow: 0 12px 36px rgba(0, 0, 0, .16); }

/* ── 生成页对齐与勾选框 ── */
.gen-page { max-width: 760px; }
.gen-form input, .gen-form select { max-width: none; }
.gen-form .gen-full { width: 100%; }
.gen-form .gen-full input { max-width: 100%; }
.gen-row { align-items: flex-end; }
.gen-check {
  flex: 0 0 auto !important;
  flex-direction: row !important; align-items: center; gap: 8px;
  margin-bottom: 9px; color: var(--ink); font-size: 13px;
}
.gen-check input[type=checkbox] {
  width: 16px !important; height: 16px !important;
  margin: 0; flex: none; accent-color: var(--primary);
}

/* 登录卡按钮同样回 AntD 平色 */
.login-card .btn.primary {
  background: var(--primary); border-color: var(--primary);
  box-shadow: none; filter: none;
}
.login-card .btn.primary:hover { background: var(--primary-h); }

/* ═══════════ 生成客户端 v3：宽屏、多目标、持久化完整展开 ═══════════ */
.gen-page {
  width: 100%; max-width: 1180px; margin: 0 auto; box-sizing: border-box;
  padding: 28px 34px 30px;
}
.gen-form { margin-top: 18px; }
.gen-form label { margin-bottom: 0; }
.gen-row-connection label:first-child { flex: 2.4; }
.gen-row-connection label:last-child { flex: .8; }
.gen-port-control { display: flex; align-items: stretch; gap: 8px; }
.gen-port-control input { min-width: 90px; flex: 1; }
.gen-port-control .btn { flex: none; white-space: nowrap; padding: 0 15px; }
.gen-row-identity { display: grid; grid-template-columns: 1fr 1fr; }
.gen-target-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px; margin-bottom: 18px;
}
.gen-target-option, .gen-mode-option {
  position: relative; display: flex !important; align-items: flex-start;
  gap: 10px; min-width: 0; margin: 0 !important; padding: 13px 14px;
  border: 1px solid #dfe5ed; border-radius: 9px; background: #fff;
  color: var(--ink) !important; cursor: pointer; transition: .15s;
}
.gen-target-option:hover, .gen-mode-option:hover { border-color: #78aee7; }
.gen-target-option:has(input:checked), .gen-mode-option:has(input:checked) {
  border-color: var(--primary); background: #f1f7ff;
  box-shadow: inset 0 0 0 1px rgba(9, 96, 189, .08);
}
.gen-target-option input, .gen-mode-option input {
  width: 17px !important; height: 17px !important; flex: none;
  margin: 2px 0 0 !important; accent-color: var(--primary);
}
.gen-target-option span, .gen-mode-option span,
.gen-delete-option span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.gen-target-option b, .gen-mode-option b,
.gen-delete-option b { font-size: 13.5px; font-weight: 600; }
.gen-target-option small, .gen-mode-option small,
.gen-delete-option small { color: var(--sub); font-size: 11.5px; line-height: 1.4; }
.gen-install-panel {
  border: 1px solid #dfe6ef; border-radius: 11px; background: #f8fafc;
  padding: 18px; margin-bottom: 18px;
}
.gen-install-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 18px; margin-bottom: 14px;
}
.gen-install-head > div { display: flex; flex-direction: column; gap: 3px; }
.gen-install-head strong { font-size: 14px; }
.gen-install-head > div span { color: var(--sub); font-size: 12px; }
.gen-mode-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
}
.gen-install-fields {
  display: grid; grid-template-columns: minmax(220px, .8fr) minmax(320px, 1.7fr);
  gap: 14px; margin: 16px 0 12px !important;
}
.gen-delete-option {
  display: inline-flex !important; align-items: flex-start; gap: 9px;
  margin: 2px 0 0 !important; color: var(--ink) !important; cursor: pointer;
}
.gen-delete-option input {
  width: 17px !important; height: 17px !important; flex: none;
  margin: 2px 0 0 !important; accent-color: var(--primary);
}
.gen-actions { align-items: center; gap: 14px !important; }
.gen-actions .muted { font-size: 12px; }
.gen-linux-command {
  border: 1px solid #dfe6ef; border-radius: 11px; background: #f8fafc;
  padding: 16px 18px 18px;
}
.gen-linux-command-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; margin-bottom: 11px;
}
.gen-linux-command-head > div { display: flex; flex-direction: column; gap: 3px; }
.gen-linux-command-head strong { font-size: 14px; }
.gen-linux-command-head span { color: var(--sub); font-size: 12px; }
.gen-linux-command-head .btn { flex: none; }
.gen-linux-command textarea {
  width: 100%; min-height: 108px; box-sizing: border-box; resize: vertical;
  border: 1px solid #d9dfe8; border-radius: 7px; padding: 10px 12px;
  background: #101722; color: #dce8f5; outline: none;
  font: 12px/1.55 var(--mono); overflow-wrap: anywhere;
}
.gen-linux-command textarea:focus { border-color: var(--primary); }
.gen-linux-command .btn:disabled { opacity: .5; cursor: not-allowed; }

/* ═══════════ 独立更新页面 ═══════════ */
.update-standalone-view.active { padding: 24px; overflow: auto; }
.update-page { width: 100%; max-width: 1180px; margin: 0 auto; padding-bottom: 28px; }
.update-page-head { margin-bottom: 14px; }
.update-page-head h2 { margin: 0 0 5px; font-size: 20px; }
.update-page-head p { margin: 0; }
.update-card { padding: 22px 24px; margin-bottom: 14px; overflow: visible; }
.update-card-head { display: flex; gap: 13px; align-items: flex-start; margin-bottom: 18px; }
.update-card-head h3 { margin: 0 0 4px; font-size: 16px; }
.update-card-head p { margin: 0; color: var(--sub); font-size: 12.5px; }
.update-step {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: #eaf3ff; color: var(--primary); font: 700 12px/1 var(--mono);
}
.update-inline-form {
  display: grid; grid-template-columns: minmax(280px, 1fr) auto minmax(180px, .7fr);
  gap: 14px; align-items: end;
}
.update-inline-form label, .cu-platform-row label, .cu-grid > label {
  display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; color: var(--sub);
}
.update-card input[type=file], .update-card select {
  min-width: 0; min-height: 38px; box-sizing: border-box;
  border: 1px solid #d9dfe8; border-radius: 7px; padding: 8px 10px;
  background: #fff; color: var(--ink);
}
.cu-platform-row {
  display: grid; grid-template-columns: minmax(200px, .6fr) minmax(360px, 1.4fr);
  gap: 14px; margin-bottom: 14px;
}
.update-card .cu-grid { grid-template-columns: minmax(360px, 1.2fr) 1fr; margin-top: 0; }
.update-card .cu-grid select { min-height: 180px; }
.cu-options { display: flex; flex-direction: column; gap: 12px; padding: 8px 0; }
.cu-options .cu-all {
  display: flex; flex-direction: row; align-items: center;
  justify-content: flex-start; gap: 8px; margin: 0;
  color: var(--ink); cursor: pointer;
}
.cu-options .cu-all input { width: 16px; height: 16px; flex: none; margin: 0; }
.template-grid { grid-template-columns: minmax(300px, 1.3fr) minmax(190px, .7fr) auto; }
.template-result { margin-top: 14px; overflow-wrap: anywhere; font-family: var(--mono); font-size: 11.5px; }

@media (max-width: 980px) {
  .gen-target-grid { grid-template-columns: 1fr; }
  .gen-mode-grid { grid-template-columns: 1fr 1fr; }
  .gen-row-identity, .gen-install-fields,
  .cu-platform-row, .update-card .cu-grid,
  .update-inline-form, .template-grid { grid-template-columns: 1fr; }
  .gen-linux-command-head { align-items: flex-start; }
}

/* ═══════════ 侧栏宽度自适应：子菜单不缩进、不换行 ═══════════ */
:root { --sidenav-width: clamp(184px, 13vw, 220px); }
body { padding-left: var(--sidenav-width); }
.sidenav {
  width: var(--sidenav-width); padding-left: 12px; padding-right: 12px;
}
.nav-item { white-space: nowrap; }
.nav-item > span:not(.ico):not(.chev) {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-item .ico { width: 22px; flex: 0 0 22px; }
.nav-sub { padding-left: 0; }
.nav-sub-item {
  padding: 9px 12px !important; font-size: 13.5px !important;
}
@media (max-width: 900px) {
  body { padding-left: 0; }
  .sidenav { width: auto; }
}

/* ---------- 微信历史消息 ---------- */
.fwin-wechat .fwin-body { padding: 0; }
.wx-layout { display: flex; flex: 1; min-height: 0; background: #f5f5f5; }
.wx-sidebar {
  width: 330px; min-width: 250px; max-width: 42%; display: flex;
  flex-direction: column; min-height: 0; background: #f7f7f7;
  border-right: 1px solid #dedede;
}
.wx-search-row { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid #e5e5e5; }
.wx-search { flex: 1; min-width: 0; padding: 7px 10px; outline: none; }
.wx-tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid #ddd; background: #fafafa; }
.wx-tab { position: relative; border: 0; background: transparent; padding: 10px 4px 9px; color: #666; cursor: pointer; font-family: var(--sans); }
.wx-tab::after { content: ''; position: absolute; left: 24%; right: 24%; bottom: 0; height: 2px; background: transparent; }
.wx-tab.active { color: #07a854; font-weight: 600; }
.wx-tab.active::after { background: #07c160; }
.wx-tab i { margin-left: 2px; font: normal 10px var(--sans); color: #aaa; }
.wx-conversations { flex: 1; min-height: 0; overflow: auto; }
.wx-loading { padding: 28px 16px; text-align: center; }
.wx-conversation {
  position: relative; width: 100%; border: 0; border-bottom: 1px solid #ececec;
  background: transparent; display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; text-align: left; cursor: pointer; font-family: var(--sans);
}
.wx-conversation:hover { background: #ededed; }
.wx-conversation.active { background: #dcdcdc; }
.wx-avatar {
  position: relative; overflow: hidden; width: 42px; height: 42px; flex: none; border-radius: 5px; display: grid;
  place-items: center; background: #07c160; color: #fff; font-size: 17px;
}
.wx-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #eee; }
.wx-conversation-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.wx-conversation-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wx-conversation-top b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.wx-conversation-top time { flex: none; font-size: 10px; color: #999; }
.wx-preview { color: #999; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wx-unread {
  position: absolute; left: 43px; top: 7px; min-width: 17px; height: 17px;
  padding: 0 4px; border-radius: 9px; background: #fa5151; color: #fff;
  font: normal 10px/17px var(--sans); text-align: center;
}
.wx-chat { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #f5f5f5; }
.wx-chat-head { height: 58px; flex: none; padding: 10px 18px; border-bottom: 1px solid #dedede; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.wx-chat-head > div { display: flex; flex-direction: column; gap: 2px; }
.wx-chat-name { font-size: 16px; font-weight: 500; }
.wx-live { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.wx-live i { width: 7px; height: 7px; border-radius: 50%; background: #aaa; }
.wx-live.active { color: #07883f; border-color: #07c160; background: #e9f9ef; }
.wx-live.active i { background: #07c160; box-shadow: 0 0 0 3px rgba(7,193,96,.14); }
.wx-messages { flex: 1; min-height: 0; overflow: auto; padding: 20px 24px; }
.wx-empty { height: 100%; display: grid; place-items: center; }
.wx-message { display: flex; flex-direction: column; margin: 10px 0; max-width: 75%; }
.wx-message.received { align-items: flex-start; margin-right: auto; }
.wx-message.sent { align-items: flex-end; margin-left: auto; }
.wx-message-meta { margin: 0 4px 4px; color: #999; font-size: 10px; }
.wx-bubble {
  position: relative; padding: 9px 12px; border-radius: 5px; color: #222;
  background: #fff; box-shadow: 0 1px 1px rgba(0,0,0,.04);
  white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55;
}
.wx-message.sent .wx-bubble { background: #95ec69; }
.wx-media-bubble { padding: 4px; overflow: hidden; }
.wx-media-content { position: relative; display: flex; flex-direction: column; gap: 5px; min-width: 130px; }
.wx-media-loading { padding: 14px; color: #888; font-size: 12px; }
.wx-message-image { display: block; width: auto; max-width: min(420px, 52vw); max-height: 440px; border-radius: 4px; cursor: zoom-in; object-fit: contain; }
.wx-media-action { align-self: flex-end; border: 0; border-radius: 4px; padding: 5px 9px; background: rgba(0,0,0,.07); color: #555; cursor: pointer; font: 12px var(--sans); }
.wx-media-action:hover { background: rgba(0,0,0,.13); }
.wx-video-preview { width: min(360px, 48vw); height: 210px; display: grid; place-items: center; border-radius: 4px; background: #202020 center/cover no-repeat; }
.wx-video-play { width: 52px; height: 52px; border: 0; border-radius: 50%; background: rgba(0,0,0,.62); color: #fff; font-size: 22px; cursor: pointer; }
.wx-video-play.unavailable { width: auto; max-width: 88%; height: auto; min-height: 38px; padding: 9px 14px; border-radius: 20px; font-size: 13px; cursor: default; opacity: 1; }
.wx-message-video { display: block; width: min(440px, 52vw); max-height: 440px; border-radius: 4px; background: #000; }
.wx-video-status { display: block; padding: 7px 2px 0; color: #777; font-size: 12px; }
.wx-file-card { min-width: 290px; max-width: 390px; display: flex; align-items: center; gap: 10px; padding: 9px; }
.wx-file-icon { width: 38px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 3px; background: #fff1e8; color: #eb6a2c; font-weight: 700; }
.wx-file-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.wx-file-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 500; }
.wx-file-info small { color: #888; }
.wx-chat-foot {
  min-height: 45px; flex: none; display: flex; align-items: center;
  justify-content: center; gap: 12px; padding: 7px 14px;
  border-top: 1px solid #dedede; background: #f7f7f7;
}

/* ═══════════ 平板与手机适配 ═══════════ */
.mobile-row-menu, .wx-back { display: none; }

@media (max-width: 1180px) {
  .fwin {
    min-width: 0;
    max-width: calc(100vw - 24px);
  }
  .fwin-aux.fwin-proc, .fwin-aux.fwin-mon {
    width: calc(100vw - 24px) !important;
  }
  .gen-page { padding: 20px; }
  .update-standalone-view.active { padding: 18px; }
  #view-console .grid { display: block; width: 100%; }
  #view-console .grid thead { display: none; }
  #client-tbody {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px; padding: 10px;
  }
  #client-tbody tr {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid var(--line); border-radius: 9px;
    overflow: hidden; background: #fff;
  }
  #client-tbody td {
    display: flex; flex-direction: column; align-items: flex-start;
    min-width: 0; padding: 9px 10px; border: 0;
    border-bottom: 1px solid #eef1f5; white-space: normal; overflow-wrap: anywhere;
  }
  #client-tbody td::before {
    content: attr(data-label); margin-bottom: 4px; color: var(--sub);
    font-size: 10px; font-weight: 500;
  }
  #client-tbody .c-status, #client-tbody .hostname,
  #client-tbody .gpu-cell, #client-tbody .os-cell { grid-column: 1 / -1; }
  #client-tbody .c-status {
    flex-direction: row; align-items: center; justify-content: space-between;
    background: #f8fafc;
  }
  #client-tbody .c-status::before { display: none; }
  .mobile-row-menu {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 36px; padding: 5px 15px; border: 1px solid var(--primary);
    border-radius: 6px; background: #fff; color: var(--primary);
  }
}

/* 触摸设备不能依赖右键、悬停和鼠标拖动。 */
@media (hover: none), (pointer: coarse) {
  button, .btn, .mini-btn, select { min-height: 42px; }
  input, select, textarea { font-size: 16px !important; }
  .mobile-row-menu { display: inline-flex; }

  .ctx-menu {
    left: 10px !important; right: 10px !important; top: auto !important;
    bottom: max(10px, env(safe-area-inset-bottom)); width: auto;
    max-height: calc(100dvh - 20px); overflow-y: auto;
    border-radius: 12px; padding: 8px; box-shadow: 0 16px 44px rgba(0,0,0,.28);
  }
  .ctx-menu li { min-height: 44px; padding: 11px 12px; box-sizing: border-box; }
  .ctx-menu li.has-sub { display: flex; flex-wrap: wrap; }
  .ctx-menu li.has-sub > .lb { flex: 1; }
  .ctx-menu ul.sub {
    position: static; flex: 1 0 100%; width: 100%; min-width: 0;
    margin: 7px 0 0; padding: 4px 0 4px 10px; border: 0;
    border-left: 2px solid #dce9f8; border-radius: 0; box-shadow: none;
  }

  .fwin, .fwin.fwin-max,
  .fwin-aux.fwin-proc, .fwin-aux.fwin-mon {
    position: fixed; left: 0 !important; top: 0 !important;
    width: 100vw !important; height: 100dvh !important;
    min-width: 0 !important; min-height: 0 !important; max-width: none;
    border: 0; border-radius: 0; box-shadow: none;
  }
  .fwin-head { min-height: 48px; height: 48px; padding: 0 10px; border-radius: 0; }
  .fwin-meta { display: none; }
  .fwin [data-a=max], .fwin .rs { display: none; }
  .fwin-body { min-width: 0; overflow: auto; }

  .wx-sidebar { width: 100%; min-width: 0; max-width: none; border-right: 0; }
  .wx-chat { display: none; }
  .wx-layout.wx-chat-open .wx-sidebar { display: none; }
  .wx-layout.wx-chat-open .wx-chat { display: flex; }
  .wx-back { display: inline-flex; align-items: center; justify-content: center; }

  .scr-bar { flex-wrap: wrap; overflow: visible; }
  .scr-stage.scr-control-on {
    touch-action: none; overscroll-behavior: contain; user-select: none;
  }
}

@media (max-width: 900px) {
  html, body { width: 100%; height: 100%; overflow: hidden; }
  body { padding-left: 0; }
  button, .btn, .mini-btn, select { min-height: 40px; }
  input, select, textarea { font-size: 16px !important; }

  .sidenav {
    position: fixed; left: 0; right: 0; top: auto; bottom: 0;
    z-index: 10020; width: 100%; height: 56px; padding: 4px 6px;
    display: flex; flex-direction: row; align-items: stretch; gap: 4px;
    overflow: visible; border: 0; border-top: 1px solid var(--line);
    box-sizing: border-box; background: #fff;
  }
  .sidenav > .logo, .sidenav > .nav-sep, .sidenav > .nav-foot { display: none; }
  .sidenav > .nav-item {
    flex: 1 1 0; min-width: 0; height: 48px; min-height: 48px;
    padding: 3px 2px; margin: 0; border-radius: 7px;
    display: flex; flex-direction: column; justify-content: center; gap: 1px;
    font-size: 11px;
  }
  .sidenav > .nav-item .ico {
    width: auto; flex: none; height: 20px; font-size: 18px;
  }
  .sidenav > .nav-item > span:not(.ico):not(.chev) { max-width: 100%; }
  .sidenav > .nav-item .chev { display: none; }
  .sidenav .nav-sub {
    position: fixed; left: auto; right: 8px; bottom: 62px; z-index: 10030;
    width: min(240px, calc(100vw - 16px)); max-height: calc(100dvh - 76px);
    padding: 7px; overflow-y: auto; border: 1px solid var(--line);
    border-radius: 10px; background: #fff; box-shadow: 0 12px 34px rgba(0,0,0,.2);
  }
  .sidenav .nav-sub-item {
    width: 100%; min-height: 44px; display: flex; flex-direction: row;
    justify-content: flex-start; padding: 8px 12px !important;
  }

  .shell { width: 100%; height: calc(100dvh - 56px); min-height: 0; }
  .topbar { min-height: 48px; height: 48px; padding: 0 12px; gap: 8px; }
  .page-title { font-size: 16px; }
  .stats { gap: 8px; font-size: 11px; }
  .view.active { gap: 8px; }
  #view-console.active { padding: 8px; overflow: hidden; }
  .toolbar { gap: 7px; }
  .toolbar #search { order: -2; width: 100%; flex: 1 0 100%; }
  .toolbar .chips { order: -1; }
  .toolbar #batch-btn { margin-left: auto; }
  .toolbar #match-count { width: 100%; }
  .board { min-height: 0; border-radius: 8px; overflow: auto; }

  #view-console .grid { display: block; width: 100%; }
  #view-console .grid thead { display: none; }
  #client-tbody {
    display: grid; grid-template-columns: 1fr; gap: 9px; padding: 9px;
  }
  #client-tbody tr {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0; border: 1px solid var(--line); border-radius: 9px;
    overflow: hidden; background: #fff; cursor: default;
  }
  #client-tbody td {
    display: flex; flex-direction: column; align-items: flex-start;
    min-width: 0; padding: 9px 10px; border: 0; border-bottom: 1px solid #eef1f5;
    white-space: normal; overflow-wrap: anywhere;
  }
  #client-tbody td::before {
    content: attr(data-label); margin-bottom: 4px; color: var(--sub);
    font-size: 10px; font-weight: 500;
  }
  #client-tbody .c-status, #client-tbody .hostname,
  #client-tbody .gpu-cell, #client-tbody .os-cell {
    grid-column: 1 / -1;
  }
  #client-tbody .c-status {
    flex-direction: row; align-items: center; justify-content: space-between;
    background: #f8fafc;
  }
  #client-tbody .c-status::before { display: none; }
  #client-tbody .c-status { order: -2; }
  #client-tbody .hostname { order: -1; }
  #client-tbody .speed-cell { font-size: 11px; }
  .mobile-row-menu {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 34px; padding: 4px 14px; border: 1px solid var(--primary);
    border-radius: 6px; background: #fff; color: var(--primary);
  }

  .ctx-menu {
    left: 8px !important; right: 8px !important; top: auto !important; bottom: 64px;
    width: auto; max-height: calc(100dvh - 84px); overflow-y: auto;
    border-radius: 12px; padding: 7px; box-shadow: 0 16px 44px rgba(0,0,0,.28);
  }
  .ctx-menu li { min-height: 42px; padding: 10px 12px; box-sizing: border-box; }
  .ctx-menu li.has-sub { display: flex; flex-wrap: wrap; }
  .ctx-menu li.has-sub > .lb { flex: 1; }
  .ctx-menu ul.sub {
    position: static; flex: 1 0 100%; width: 100%; min-width: 0;
    margin: 7px 0 0; padding: 4px 0 4px 10px; border: 0;
    border-left: 2px solid #dce9f8; border-radius: 0; box-shadow: none;
  }

  .fwin, .fwin.fwin-max,
  .fwin-aux.fwin-proc, .fwin-aux.fwin-mon {
    position: fixed; left: 0 !important; top: 0 !important;
    width: 100vw !important; height: calc(100dvh - 56px) !important;
    min-width: 0 !important; min-height: 0 !important; max-width: none;
    border: 0; border-radius: 0; box-shadow: none;
  }
  .fwin-head { min-height: 46px; height: 46px; padding: 0 9px; border-radius: 0; }
  .fwin-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fwin-meta { display: none; }
  .fwin [data-a=max], .fwin .rs { display: none; }
  .fwin-body { min-width: 0; padding: 8px; overflow: auto; }
  .fwin-wechat .fwin-body { padding: 0; overflow: hidden; }

  .wx-sidebar { width: 100%; min-width: 0; max-width: none; border-right: 0; }
  .wx-chat { display: none; }
  .wx-layout.wx-chat-open .wx-sidebar { display: none; }
  .wx-layout.wx-chat-open .wx-chat { display: flex; }
  .wx-back { display: inline-flex; flex: none; width: 40px; font-size: 25px; }
  .wx-chat-head { height: 52px; padding: 6px 9px; gap: 8px; }
  .wx-chat-head > div { min-width: 0; flex: 1; }
  .wx-chat-name, .wx-chat-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .wx-live { padding: 5px 8px; }
  .wx-messages { padding: 12px 10px; }
  .wx-message { max-width: 92%; }
  .wx-message-image, .wx-message-video { max-width: 76vw; max-height: 55vh; }
  .wx-video-preview { width: 72vw; max-width: 360px; }
  .wx-file-card { min-width: 0; max-width: 76vw; }

  .gen-page, .update-standalone-view.active { padding: 10px; }
  .gen-row, .gen-row-connection, .gen-install-fields,
  .gen-row-identity, .update-inline-form, .template-grid,
  .cu-platform-row, .update-card .cu-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
  .update-inline-form label { min-width: 0; }
  .update-card input[type=file] { width: 100%; max-width: 100%; }
  .field-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .field-row label { width: auto; }
  .field-row input, .token-row { min-width: 0; }
  .token-row .btn { flex: none; white-space: nowrap; }
  .mcp-actions { flex-wrap: wrap; }
  .gen-mode-grid { grid-template-columns: 1fr; }
  .gen-install-panel, .gen-linux-command, .update-card { padding: 14px; }
  .gen-linux-command-head { flex-direction: column; }
  .update-card { margin-bottom: 10px; }
  .update-inline-form .btn, .template-grid .btn { width: 100%; }
  .login-card { width: calc(100vw - 24px); max-width: 420px; box-sizing: border-box; }
  .web-dialog { width: calc(100vw - 24px) !important; max-width: 480px; }
}

@media (max-width: 520px) {
  .stats .stat { font-size: 10px; padding: 3px 5px; gap: 3px; white-space: nowrap; }
  .stats .stat b { font-size: 12px; }
  .stats .stat .led { margin-right: 3px; }
  #client-tbody tr { grid-template-columns: 1fr; }
  #client-tbody td { grid-column: 1 / -1; }
  .toolbar select { max-width: 42vw; }
  .wx-chat-sub { display: none; }
  .wx-chat-name { font-size: 14px; }
}
/* gpt 分组视图：隐藏主机名/操作系统，改为显示 Codex 额度列 */
.grid th.gpt-col { display: none; }
#client-tbody td.gpt-col { display: none; }
.grid.gpt-view th.col-host, .grid.gpt-view th.col-os { display: none; }
.grid.gpt-view th.gpt-col { display: table-cell; }
.grid.gpt-view #client-tbody td.gpt-col { display: table-cell; }
/* 认证文件列只在 gpt 分组显示（与额度列同一套视图规则） */
.grid th.auth-col { display: none; }
#client-tbody td.auth-cell { display: none; text-align: center; white-space: nowrap; }
.grid.gpt-view th.auth-col { display: table-cell; }
.grid.gpt-view #client-tbody td.auth-cell { display: table-cell; }
#client-tbody td.auth-cell .auth-dl { padding: 2px 8px; font-size: 12px; }
.grid.gpt-view #client-tbody td.col-host, .grid.gpt-view #client-tbody td.col-os { display: none; }
/* WorkBuddy 分组视图：同 gpt 的列切换（WB 账号/剩余积分 + 最右下载列） */
.grid th.wb-col, .grid th.wb-auth-col { display: none; }
#client-tbody td.wb-col, #client-tbody td.wb-auth-cell { display: none; }
.grid.wb-view th.col-host, .grid.wb-view th.col-os { display: none; }
.grid.wb-view th.wb-col { display: table-cell; }
.grid.wb-view th.wb-auth-col { display: table-cell; }
.grid.wb-view #client-tbody td.wb-acc { display: table-cell; text-align: center; white-space: nowrap; }
.grid.wb-view #client-tbody td.wb-credits { display: table-cell; text-align: center; white-space: nowrap; }
.grid.wb-view #client-tbody td.wb-auth-cell { display: table-cell; text-align: center; white-space: nowrap; }
.grid.wb-view #client-tbody td.col-host, .grid.wb-view #client-tbody td.col-os { display: none; }
#client-tbody td.wb-auth-cell .wb-dl { padding: 2px 8px; font-size: 12px; }
@media (max-width: 900px) {
  .grid.gpt-view #client-tbody td.gpt-col { display: flex; }
  .grid.gpt-view #client-tbody td.auth-cell { display: flex; }
  .grid.wb-view #client-tbody td.wb-col { display: flex; }
  .grid.wb-view #client-tbody td.wb-auth-cell { display: flex; }
}
/* DeepSeek 分组视图：Key 与余额列，行内复制 + 顶部全部复制 */
.grid th.ds-col { display: none; }
#client-tbody td.ds-col { display: none; }
.grid.ds-view th.col-host, .grid.ds-view th.col-os { display: none; }
.grid.ds-view th.ds-col { display: table-cell; }
.grid.ds-view #client-tbody td.ds-key { display: table-cell; white-space: nowrap; }
.grid.ds-view #client-tbody td.ds-bal { display: table-cell; text-align: center; white-space: nowrap; }
.grid.ds-view #client-tbody td.col-host, .grid.ds-view #client-tbody td.col-os { display: none; }
#client-tbody td.ds-key .ds-key-text { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
#client-tbody td.ds-key .ds-more { margin-left: 4px; color: var(--muted); font-size: 12px; }
#client-tbody td.ds-key .ds-copy { margin-left: 6px; padding: 2px 8px; font-size: 12px; }
@media (max-width: 900px) {
  .grid.ds-view #client-tbody td.ds-col { display: flex; }
}
/* DSH（DeepSeek Harness）分组视图：账号 Token/余额/设备/API Key/导出 */
.grid th.dsh-col, .grid th.dsh-exp-col { display: none; }
#client-tbody td.dsh-col, #client-tbody td.dsh-exp-cell { display: none; }
.grid.dsh-view th.col-host, .grid.dsh-view th.col-os { display: none; }
.grid.dsh-view th.dsh-col, .grid.dsh-view th.dsh-exp-col { display: table-cell; }
.grid.dsh-view #client-tbody td.dsh-token { display: table-cell; white-space: nowrap; }
.grid.dsh-view #client-tbody td.dsh-bal { display: table-cell; text-align: center; white-space: nowrap; }
.grid.dsh-view #client-tbody td.dsh-device { display: table-cell; text-align: center; white-space: nowrap; }
.grid.dsh-view #client-tbody td.dsh-apikey { display: table-cell; white-space: nowrap; }
.grid.dsh-view #client-tbody td.dsh-export { display: table-cell; text-align: center; white-space: nowrap; }
.grid.dsh-view #client-tbody td.col-host, .grid.dsh-view #client-tbody td.col-os { display: none; }
#client-tbody td.dsh-token .dsh-token-text, #client-tbody td.dsh-apikey .dsh-token-text { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
#client-tbody td.dsh-token .ds-more { margin-left: 4px; color: var(--muted); font-size: 12px; }
#client-tbody td.dsh-token .dsh-copy1, #client-tbody td.dsh-apikey .dsh-copy1 { margin-left: 6px; padding: 2px 8px; font-size: 12px; }
#client-tbody td.dsh-apikey .dsh-key-status { margin-right: 6px; }
#client-tbody td.dsh-apikey .dsh-create { padding: 2px 8px; font-size: 12px; }
#client-tbody td.dsh-export .dsh-dl { padding: 2px 8px; font-size: 12px; }
@media (max-width: 900px) {
  .grid.dsh-view #client-tbody td.dsh-col { display: flex; }
}

/* ── 凭证管理：按平台聚合（账号/余额/套餐/额度，不展示绑定机器） ── */
.creds-panel { padding: 14px 16px 10px; }
.creds-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
}
.creds-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.creds-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.creds-board { padding: 0; }
.creds-grid td { vertical-align: middle; }
.creds-account span {
  display: block; max-width: 260px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.creds-account small { display: block; color: var(--sub); font-size: 11px; }
.creds-balance small { color: var(--sub); }
.creds-updated { color: var(--sub); white-space: nowrap; }
.creds-ops { white-space: nowrap; }
.creds-ops .btn { padding: 2px 10px; font-size: 12px; margin-right: 6px; }
.creds-plat {
  display: inline-block; padding: 1px 8px; border-radius: 10px;
  font-size: 12px; border: 1px solid #d9d9d9; background: #fafafa; color: var(--sub);
}
.creds-plat.plat-workbuddy  { color: #0958d9; border-color: #adc6ff; background: #f0f5ff; }
.creds-plat.plat-deepseek  { color: #08979c; border-color: #87e8de; background: #e6fffb; }
.creds-plat.plat-dsh       { color: #531dab; border-color: #d3adf7; background: #f9f0ff; }
.creds-plat.plat-gpt       { color: #d46b08; border-color: #ffd591; background: #fff7e6; }
.creds-panel .hint-line { margin: 8px 0 0; }
@media (max-width: 900px) {
  .creds-grid th:nth-child(5), .creds-grid td:nth-child(5),
  .creds-grid th:nth-child(7), .creds-grid td:nth-child(7) { display: none; }
}