:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-weak: #dbeafe;
  --ok: #16a34a;
  --ok-weak: #dcfce7;
  --warn: #d97706;
  --warn-weak: #fef3c7;
  --bad: #dc2626;
  --bad-weak: #fee2e2;
  --gray-weak: #f1f5f9;
  --side: #0f172a;
  --side-text: #cbd5e1;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --radius: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1120; --panel: #111827; --panel-2: #0f172a; --border: #1f2937; --text: #e5e7eb; --muted: #94a3b8;
    --primary: #3b82f6; --primary-weak: #1e3a8a55; --ok: #22c55e; --ok-weak: #14532d66; --warn: #f59e0b; --warn-weak: #78350f66;
    --bad: #f87171; --bad-weak: #7f1d1d66; --gray-weak: #1f2937; --side: #020617; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1120; --panel: #111827; --panel-2: #0f172a; --border: #1f2937; --text: #e5e7eb; --muted: #94a3b8;
  --primary: #3b82f6; --primary-weak: #1e3a8a55; --ok: #22c55e; --ok-weak: #14532d66; --warn: #f59e0b; --warn-weak: #78350f66;
  --bad: #f87171; --bad-weak: #7f1d1d66; --gray-weak: #1f2937; --side: #020617; --shadow: none; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.boot { padding: 40px; color: var(--muted); }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.side { width: 208px; background: var(--side); color: var(--side-text); flex-shrink: 0; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; font-weight: 600; font-size: 16px; }
.brand img { width: 26px; height: 26px; }
.nav { display: flex; flex-direction: column; padding: 6px 10px; gap: 2px; }
.nav a { color: var(--side-text); padding: 8px 12px; border-radius: 6px; display: flex; align-items: center; gap: 10px; }
.nav a:hover { background: #1e293b; text-decoration: none; color: #fff; }
.nav a.active { background: var(--primary); color: #fff; }
.nav .sep { font-size: 12px; color: #64748b; padding: 14px 12px 4px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 54px; background: var(--panel); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 20px; gap: 12px; }
.topbar .title { font-size: 16px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .menu-btn { display: none; }
.content { padding: 20px; max-width: 1600px; width: 100%; }
.userbox { display: flex; align-items: center; gap: 8px; color: var(--muted); }

/* 通用组件 */
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--border); background: var(--panel); color: var(--text); font-size: 13.5px; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.sm { height: 26px; padding: 0 8px; font-size: 12.5px; }
.btn.link { border: none; background: none; padding: 0 4px; color: var(--primary); height: auto; }
.btn.link.danger { color: var(--bad); }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; font-weight: 600; }
.card-b { padding: 16px; }
.mb { margin-bottom: 16px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }

input[type=text], input[type=password], input[type=number], input[type=search], input[type=datetime-local], select, textarea {
  height: 32px; border: 1px solid var(--border); border-radius: 6px; padding: 0 10px; background: var(--panel); color: var(--text);
  font: inherit; outline: none; min-width: 0;
}
textarea { height: auto; padding: 8px 10px; resize: vertical; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-weak); }
label.chk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

.form { display: grid; grid-template-columns: 110px 1fr; gap: 12px 14px; align-items: center; }
.form > label { color: var(--muted); text-align: right; }
.form .full { grid-column: 1 / -1; }
.form .hint { grid-column: 2; font-size: 12px; color: var(--muted); margin-top: -6px; }
.form input, .form select, .form textarea { width: 100%; }
.form input[type=checkbox], .form input[type=radio] { width: auto; }
.form .btns select { width: auto; }
.form-sec { grid-column: 1 / -1; font-weight: 600; padding-top: 6px; border-top: 1px dashed var(--border); margin-top: 4px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th, .t td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.t th { font-weight: 500; color: var(--muted); background: var(--panel-2); font-size: 12.5px; white-space: nowrap; position: sticky; top: 0; }
.t tr:hover td { background: var(--panel-2); }
.t th.center, .t td.center { text-align: center; }
.t td.chk, .t th.chk { width: 34px; padding-right: 0; }
.t tr.sel td { background: var(--primary-weak); }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* 徽章 */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--gray-weak); color: var(--muted); white-space: nowrap; line-height: 20px; }
.badge.ok { background: var(--ok-weak); color: var(--ok); }
.badge.warn { background: var(--warn-weak); color: var(--warn); }
.badge.bad { background: var(--bad-weak); color: var(--bad); }
.badge.info { background: var(--primary-weak); color: var(--primary); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* 统计 */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { padding: 14px 16px; cursor: pointer; }
.stat .n { font-size: 26px; font-weight: 600; line-height: 1.2; }
.stat .l { color: var(--muted); font-size: 13px; }
.stat.on { outline: 2px solid var(--primary); }
.stat .n.ok { color: var(--ok); } .stat .n.bad { color: var(--bad); } .stat .n.warn { color: var(--warn); }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 3px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel); cursor: pointer; font-size: 13px; color: var(--text); }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* 服务器卡片 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.grid > *, .cols > * { min-width: 0; }
.srv { padding: 14px; display: flex; flex-direction: column; gap: 8px; border-left: 3px solid var(--border); }
.srv.st-ok { border-left-color: var(--ok); }
.srv.st-off { border-left-color: var(--muted); }
.srv.st-bad { border-left-color: var(--bad); }
.srv.st-warn { border-left-color: var(--warn); }
.srv .top { display: flex; align-items: center; gap: 8px; }
.srv .name { font-weight: 600; font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv .meta { color: var(--muted); font-size: 12.5px; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; }
.srv .err { color: var(--bad); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }

/* 详情 */
.detail-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.detail-head h2 { margin: 0; font-size: 20px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; }
.kv .k { color: var(--muted); }
.kv .v { word-break: break-all; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--primary); border-bottom-color: var(--primary); }
.tabs a:hover { text-decoration: none; color: var(--text); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.cols > .wide { grid-column: 1 / -1; }
pre.out { background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 10px; white-space: pre-wrap; word-break: break-all; max-height: 260px; overflow: auto; margin: 8px 0 0; }

/* 下拉菜单 */
.dd { position: relative; display: inline-block; }
.dd-menu { position: fixed; z-index: 60; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.15); min-width: 170px; padding: 4px; }
.dd-menu button { display: block; width: 100%; text-align: left; border: none; background: none; padding: 7px 10px; border-radius: 5px; cursor: pointer; color: var(--text); font: inherit; }
.dd-menu button:hover { background: var(--panel-2); }
.dd-menu button.danger { color: var(--bad); }
.dd-menu .sep { border-top: 1px solid var(--border); margin: 4px 0; }

/* 弹窗 */
.mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: flex-start; justify-content: center; z-index: 50; padding: 6vh 16px; overflow-y: auto; }
.modal { background: var(--panel); border-radius: 10px; width: 100%; max-width: 560px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.wide { max-width: 980px; }
.modal-h { padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 15px; display: flex; align-items: center; }
.modal-h .x { margin-left: auto; cursor: pointer; border: none; background: none; font-size: 20px; color: var(--muted); line-height: 1; }
.modal-b { padding: 18px; }
.modal-f { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.alert { padding: 10px 12px; border-radius: 6px; background: var(--warn-weak); color: var(--warn); margin-bottom: 12px; font-size: 13px; }
.alert.bad { background: var(--bad-weak); color: var(--bad); }
.alert.info { background: var(--primary-weak); color: var(--primary); }
.alert.ok { background: var(--ok-weak); color: var(--ok); }

/* 提示 */
#toasts { position: fixed; right: 16px; top: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--panel); border: 1px solid var(--border); border-left: 4px solid var(--primary); padding: 10px 14px; border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.15); max-width: 380px; word-break: break-all; }
.toast.ok { border-left-color: var(--ok); }
.toast.bad { border-left-color: var(--bad); }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login { width: 100%; max-width: 360px; padding: 28px; }
.login h1 { font-size: 20px; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; }
.login .f { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.login input { height: 38px; }
.login .btn { height: 38px; justify-content: center; }

.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 10px 12px; }
.sel-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 12px; background: var(--primary-weak); border-radius: 6px; margin-bottom: 10px; }

@media (max-width: 860px) {
  .side { position: fixed; left: -220px; top: 0; bottom: 0; z-index: 40; transition: left .2s; }
  .side.open { left: 0; }
  .topbar .menu-btn { display: inline-flex; }
  .content { padding: 12px 16px; }
  .form { grid-template-columns: 1fr; }
  .form > label { text-align: left; margin-bottom: -8px; }
  .form .hint { grid-column: 1; }
  .userbox .uname { display: none; }
  .grid { grid-template-columns: 1fr; }
}

/* ---------- 阶段二：监控、任务 ---------- */
.chart-wrap { position: relative; }
.chart-svg { display: block; max-width: 100%; }
.chart-svg .grid { stroke: var(--border); stroke-width: 1; }
.chart-svg .axis { fill: var(--muted); font-size: 11px; }
.chart-svg .cross { stroke: var(--muted); stroke-dasharray: 3 3; }
.chart-tip { position: absolute; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; font-size: 12px; pointer-events: none; box-shadow: 0 4px 14px rgba(0,0,0,.15); min-width: 150px; z-index: 5; }
.chart-tip i, .chart-legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.chart-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); padding: 4px 0 0 56px; flex-wrap: wrap; }
.chart-empty { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; }
.charts > * { min-width: 0; }

.bar { display: grid; grid-template-columns: 40px 1fr 92px; align-items: center; gap: 8px; font-size: 12.5px; }
.bar .track { height: 8px; background: var(--gray-weak); border-radius: 4px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--ok); border-radius: 4px; }
.bar .fill.warn { background: var(--warn); }
.bar .fill.bad { background: var(--bad); }
.bar .val { text-align: right; color: var(--muted); white-space: nowrap; }
.over { color: var(--bad); font-weight: 600; }
/* 分组颜色：--gc 由页面按分组设置 */
.gbadge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 18px; white-space: nowrap; vertical-align: middle;
  color: var(--gc); background: color-mix(in srgb, var(--gc) 14%, transparent); border: 1px solid color-mix(in srgb, var(--gc) 45%, transparent); }
.gdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gc); margin-right: 6px; vertical-align: 1px; }
.bar .k { color: var(--muted); }
.netline { display: flex; gap: 12px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.netline b { color: var(--text); font-weight: 500; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { padding: 12px 14px; }
.tile .l { color: var(--muted); font-size: 12.5px; }
.tile .n { font-size: 20px; font-weight: 600; margin-top: 2px; }
.tile .s { color: var(--muted); font-size: 12px; }

.term { background: #0b1020; color: #d1d5db; border-radius: 6px; padding: 10px 12px; font: 12.5px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-all; max-height: 420px; overflow: auto; margin: 0; }
.term .sys { color: #93c5fd; }
.run-row { cursor: pointer; }
.run-row td:first-child::before { content: '▸'; display: inline-block; width: 14px; color: var(--muted); }
.run-row.open td:first-child::before { content: '▾'; }
.run-out td { background: var(--panel-2); padding: 0 12px 12px; }
.code { background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; white-space: pre-wrap; word-break: break-all; max-height: 220px; overflow: auto; margin: 0; }
.target-list { max-height: 300px; overflow: auto; border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; }
.target-list label { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.target-list .grp { font-weight: 600; margin-top: 6px; color: var(--muted); font-size: 12.5px; }
.copy-box { display: flex; gap: 6px; }
.copy-box input { flex: 1; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.mismatch { background: var(--warn-weak); color: var(--warn); border-radius: 4px; padding: 0 4px; }
.range-btns { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.range-btns button { border: none; background: var(--panel); color: var(--text); padding: 4px 12px; cursor: pointer; font: inherit; font-size: 13px; border-right: 1px solid var(--border); }
.range-btns button:last-child { border-right: none; }
.range-btns button.on { background: var(--primary); color: #fff; }
@media (max-width: 860px) { .charts { grid-template-columns: 1fr; } }

/* ---------- 阶段三：终端、定时任务、令牌 ---------- */
.term-card { display: flex; flex-direction: column; height: calc(100vh - 54px - 40px); min-height: 360px; }
.term-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); font-weight: 600; }
.term-bar .btns { font-weight: normal; }
.modal.term-modal { max-width: 1100px; height: min(720px, 88vh); display: flex; flex-direction: column; }
.modal.term-modal .modal-b { flex: 1; min-height: 0; padding: 0; display: flex; flex-direction: column; }
.modal.term-modal .modal-f { display: none; }
.modal.term-modal.max { max-width: none; height: 100%; border-radius: 0; }
.mask.full { padding: 0; }
.term-ui { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.term-ui .term-box { border-radius: 0 0 10px 10px; }
.modal.term-modal.max .term-box { border-radius: 0; }
.term-box { flex: 1; min-height: 0; background: #0b1020; padding: 6px; border-radius: 0 0 var(--radius) var(--radius); }
.term-box .xterm { height: 100%; }
.term-status { font-weight: normal; font-size: 12.5px; }
.cron-help { font-size: 12px; color: var(--muted); }
.cron-help code { background: var(--gray-weak); padding: 0 4px; border-radius: 3px; }
@media (max-width: 860px) { .term-card { height: calc(100vh - 54px - 24px); } }

/* ---------- 概览：卡片 / 列表 ---------- */
.seg { display: inline-flex; }
.seg .btn { border-radius: 0; margin-left: -1px; }
.seg .btn:first-child { border-radius: 6px 0 0 6px; margin-left: 0; }
.seg .btn:last-child { border-radius: 0 6px 6px 0; }
.seg .btn.on { background: var(--primary); border-color: var(--primary); color: #fff; position: relative; }
.srv .meta .ell, .ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv .meta .mono { word-break: break-all; }
.disks { display: flex; flex-direction: column; gap: 4px; }
.bar.dk .k { font-size: 12px; }
.bar .k { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini { display: flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
.mini .track { width: 40px; flex: none; height: 6px; background: var(--gray-weak); border-radius: 3px; overflow: hidden; }
.mini .fill { height: 100%; background: var(--ok); }
.mini .fill.warn { background: var(--warn); }
.mini .fill.bad { background: var(--bad); }
.ovt td { vertical-align: top; padding: 8px 10px; }
.ovt th { padding: 8px 10px; }
.ovt .acts-row { display: flex; gap: 4px; white-space: nowrap; }
.ovt td:first-child { border-left: 3px solid var(--border); }
.ovt tr.st-ok td:first-child { border-left-color: var(--ok); }
.ovt tr.st-bad td:first-child { border-left-color: var(--bad); }
.ovt tr.st-warn td:first-child { border-left-color: var(--warn); }
.ovt .cpu-model { min-width: 130px; max-width: 190px; }
.ovt .dline { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.ovt .dline > .mono { min-width: 36px; max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
.ovt .dline + .dline { margin-top: 3px; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
th.sortable .arr { font-size: 10px; margin-left: 3px; color: var(--primary); }

/* ---------- 带内读取的 BMC 数据 ---------- */
.bmc-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.spin { width: 10px; height: 10px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
/* 监控列表较宽时操作列固定在右侧 */
.ovt td:last-child { position: sticky; right: 0; background: var(--panel); box-shadow: -6px 0 6px -6px rgba(0,0,0,.25); }
.t.ovt th:last-child { position: sticky; right: 0; z-index: 1; box-shadow: -6px 0 6px -6px rgba(0,0,0,.25); }
.t.ovt tr.sel td:last-child { background: linear-gradient(var(--primary-weak), var(--primary-weak)), var(--panel); }
.radio-row { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.radio-row input { margin-top: 3px; }
.radio-row.off { opacity: .55; cursor: not-allowed; }

/* 被控端自定义字段：设置页的输入行、服务器列表的汇总条 */
.row-inline { display: flex; gap: 8px; align-items: center; }
.cf-sum { display: flex; flex-direction: column; gap: 8px; }
.cf-line { display: flex; gap: 6px 14px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.cf-pick { color: var(--primary); }
.ovt td.cf-v { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t tfoot td { background: var(--panel-2); border-top: 2px solid var(--border); }
.col-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px 12px; }
.cf-line .cf-name { min-width: 64px; }
.cf-line > span b { margin-left: 2px; }
.cf-warn { color: var(--warn); }
.ovt td.cf-off, .t td.cf-off { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--border); }
.cf-menu-btn { border: none; background: none; color: var(--muted); cursor: pointer; padding: 0 2px 0 6px; font: inherit; }
.cf-menu-btn:hover { color: var(--primary); }
th.cf-filtered { color: var(--primary); }
.cf-chip { display: inline-flex; align-items: center; gap: 4px; }
.cf-chip .x { border: none; background: none; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 0 0 4px; }
.cf-pop { position: fixed; z-index: 60; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.15); width: 300px; max-width: calc(100vw - 16px); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.cf-pop-h { font-weight: 600; }
.cf-pop-sec { color: var(--muted); font-size: 12px; border-top: 1px solid var(--border); padding-top: 8px; }
.cf-pop-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cf-pop-row select { max-width: 100%; }
.cf-pop-err { color: var(--bad); min-height: 0; }
.cf-pop-err:empty { display: none; }
.cf-pop-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cf-sum .cf-group { margin-top: 4px; }
.cf-sum .cf-group th, .cf-sum .cf-group td { padding: 5px 10px; }
.cf-panel { position: fixed; right: 16px; bottom: 16px; z-index: 40; width: 460px; max-width: calc(100vw - 32px); max-height: 70vh; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.18); }
.cf-panel-h { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--border); cursor: move; user-select: none; touch-action: none; }
.cf-panel-h .x { border: none; background: none; font-size: 18px; line-height: 1; cursor: pointer; color: var(--muted); padding: 0 4px; }
.cf-panel-b { padding: 10px 12px; overflow: auto; }
.cf-panel .cf-line { gap: 4px 12px; }
.cf-field { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; border-top: 1px solid var(--border); }
.cf-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cf-tile { background: var(--panel-2); border-radius: 6px; padding: 6px 10px; min-width: 0; }
.cf-tile .l { color: var(--muted); font-size: 12px; }
.cf-tile .n { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 长久任务 */
.form .sec { grid-column: 1 / -1; font-weight: 600; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; color: var(--text); }
.nbadge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 600; vertical-align: 1px; }
.nbadge[hidden] { display: none; }
.dir-note { margin-top: 6px; font-size: 12px; }
