/* Switchyard 管理界面：顶部导航 + 左右分栏工作区，面板内滚动，整页不滚动。 */

:root {
  --bg: #f3f4f6;
  --panel: #ffffff;
  --panel-2: #f9fafb;
  --hover: #f3f4f6;
  --line: #e5e7eb;
  --line-2: #d1d5db;
  --text: #111827;
  --text-2: #4b5563;
  --text-3: #9ca3af;
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --accent-bg: #eff6ff;
  --ok: #16a34a;
  --ok-bg: #ecfdf3;
  --warn: #d97706;
  --warn-bg: #fffbeb;
  --bad: #dc2626;
  --bad-bg: #fef2f2;
  --server: #4f46e5;
  --server-bg: #eef2ff;
  --edge: #0891b2;
  --edge-bg: #ecfeff;
  --fb: #ea580c;
  --fb-bg: #fff7ed;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 20px 48px rgba(16, 24, 40, 0.18), 0 2px 6px rgba(16, 24, 40, 0.06);
  --r: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d12;
    --panel: #141820;
    --panel-2: #10131a;
    --hover: #1b2029;
    --line: #262c37;
    --line-2: #343b48;
    --text: #e5e7eb;
    --text-2: #a3aab8;
    --text-3: #6b7280;
    --accent: #3b82f6;
    --accent-2: #60a5fa;
    --accent-bg: rgba(59, 130, 246, 0.14);
    --ok: #22c55e;
    --ok-bg: rgba(34, 197, 94, 0.12);
    --warn: #f59e0b;
    --warn-bg: rgba(245, 158, 11, 0.12);
    --bad: #ef4444;
    --bad-bg: rgba(239, 68, 68, 0.12);
    --server: #818cf8;
    --server-bg: rgba(129, 140, 248, 0.14);
    --edge: #22d3ee;
    --edge-bg: rgba(34, 211, 238, 0.12);
    --fb: #fb923c;
    --fb-bg: rgba(251, 146, 60, 0.13);
    --shadow: none;
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 13px/1.5 var(--font); color: var(--text); background: var(--bg); overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
code, .mono { font-family: var(--mono); font-size: 12px; }
[hidden] { display: none !important; }
svg { flex: none; }

/* 滚动条：默认隐形，悬停时显示细条 */
* { scrollbar-width: thin; scrollbar-color: transparent transparent; }
*:hover { scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: transparent; border-radius: 6px; }
*:hover::-webkit-scrollbar-thumb { background: var(--line-2); }

/* ---------- 顶部导航 ---------- */
.top { height: 52px; display: flex; align-items: center; gap: 20px; padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 14px; letter-spacing: -0.01em; }
.logo i { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--accent); color: #fff; }
.logo i svg { width: 16px; height: 16px; }
.nav { display: flex; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 7px; color: var(--text-2); font-weight: 500; position: relative; }
.nav a svg { width: 15px; height: 15px; }
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a.on { background: var(--accent-bg); color: var(--accent); }
.nav a .cnt { min-width: 16px; height: 16px; border-radius: 8px; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 600; display: grid; place-items: center; padding: 0 4px; }
.top .sp { flex: 1; }
.me { display: flex; align-items: center; gap: 8px; }
.me .av { width: 28px; height: 28px; border-radius: 50%; background: var(--hover); display: grid; place-items: center; font-weight: 600; font-size: 12px; color: var(--text-2); cursor: pointer; border: none; }

/* ---------- 工作区 ---------- */
.work { height: calc(100vh - 52px); padding: 12px; display: grid; gap: 12px; grid-template-columns: 300px minmax(0, 1fr); }
.work.single { grid-template-columns: minmax(0, 1fr); }
.work.wide-left { grid-template-columns: 340px minmax(0, 1fr); }
.pane { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; }
.pane-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); min-height: 48px; }
.pane-h h2 { margin: 0; font-size: 14px; font-weight: 650; }
.pane-h .sp { flex: 1; }
.pane-b { flex: 1; overflow: auto; min-height: 0; }
.pane-b.pad { padding: 14px 16px; }
.pane-f { padding: 10px 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }

/* 详情头部 */
.head { padding: 14px 16px 0; border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; gap: 10px; }
.head h1 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.head .meta { color: var(--text-2); font-size: 12.5px; margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tabs { display: flex; gap: 18px; margin-top: 12px; }
.tabs button { border: none; background: none; padding: 8px 0 10px; color: var(--text-2); font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- 左侧列表 ---------- */
.search { margin: 10px 12px 6px; position: relative; }
.search input { width: 100%; height: 30px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); padding: 0 10px 0 28px; outline: none; }
.search input:focus { border-color: var(--accent); background: var(--panel); }
.search svg { position: absolute; left: 9px; top: 8px; width: 14px; height: 14px; color: var(--text-3); }
.grp { padding: 10px 12px 4px; font-size: 11.5px; font-weight: 600; color: var(--text-3); display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.grp .chev { width: 12px; height: 12px; transition: transform 0.15s; }
.grp.closed .chev { transform: rotate(-90deg); }
.grp .sp { flex: 1; }
.li { display: flex; align-items: center; gap: 9px; margin: 1px 6px; padding: 7px 8px; border-radius: 7px; cursor: pointer; min-width: 0; }
.li:hover { background: var(--hover); }
.li.on { background: var(--accent-bg); }
.li.on .li-t { color: var(--accent); }
.li-m { flex: 1; min-width: 0; }
.li-t { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-s { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-r { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.li.sub { margin-left: 22px; padding-top: 5px; padding-bottom: 5px; }
.li .ic { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex: none; }
.li .ic svg { width: 15px; height: 15px; }
.ic.server { background: var(--server-bg); color: var(--server); }
.ic.edge { background: var(--edge-bg); color: var(--edge); }
.ic.cf { background: var(--fb-bg); color: var(--fb); }
.summary { display: flex; gap: 6px; padding: 8px 12px 2px; flex-wrap: wrap; }

/* ---------- 基础元素 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 30px; padding: 0 12px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn svg { width: 14px; height: 14px; }
.btn.pri { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.pri:hover { background: var(--accent-2); }
.btn.dng { color: var(--bad); }
.btn.dng:hover { background: var(--bad-bg); border-color: var(--bad); }
.btn.dng.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.gh { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.gh:hover { background: var(--hover); color: var(--text); }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12px; }
.btn.ico { width: 30px; padding: 0; }
.btn.sm.ico { width: 26px; }
.btn:disabled { opacity: 0.45; cursor: default; }

.seg { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--hover); gap: 2px; }
.seg button { border: none; background: none; height: 24px; padding: 0 10px; border-radius: 6px; font-size: 12px; font-weight: 500; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.seg button:disabled { opacity: 0.4; cursor: default; }

.sw { position: relative; width: 32px; height: 18px; display: inline-block; flex: none; }
.sw input { opacity: 0; position: absolute; width: 0; height: 0; }
.sw span { position: absolute; inset: 0; border-radius: 18px; background: var(--line-2); cursor: pointer; transition: background 0.15s; }
.sw span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }
.sw input:checked + span { background: var(--accent); }
.sw input:checked + span::after { transform: translateX(14px); }
.sw input:disabled + span { opacity: 0.4; cursor: default; }
/* 等待中：开关变淡、右侧转圈，期间不能再次操作 */
.sw.busy { pointer-events: none; cursor: progress; }
.sw.busy span { opacity: 0.55; }
.sw.busy::after { content: ""; position: absolute; right: -20px; top: 2px; width: 14px; height: 14px; box-sizing: border-box; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
.is-busy { pointer-events: none; opacity: 0.6; cursor: progress; }
/* 任务 */
.pbar { height: 4px; border-radius: 4px; background: var(--hover); overflow: hidden; margin-top: 6px; }
.pbar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.3s; }
.pbar.lg { height: 6px; margin-top: 12px; }
.tstat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tstat span { display: block; font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.tstat b { font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; }
.tsteps { display: flex; flex-direction: column; }
.tstep { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.tstep:last-child { border-bottom: none; }
.tstep .ti { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--hover); color: var(--text-3); font-size: 12px; }
.tstep .ti svg { width: 12px; height: 12px; }
.tstep.done .ti { background: var(--ok-bg); color: var(--ok); }
.tstep.running .ti { background: var(--accent-bg); }
.tstep.failed .ti { background: var(--bad-bg); color: var(--bad); }
.tstep.skipped .tn, .tstep.pending .tn { color: var(--text-3); }
.tstep .tn { font-weight: 550; }
.tstep .td { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.tstep .tt { font-size: 12px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tlog { font-size: 12px; display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; }

.tag { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 11.5px; font-weight: 550; background: var(--hover); color: var(--text-2); white-space: nowrap; }
.tag svg { width: 11px; height: 11px; }
.ii { display: inline-flex; vertical-align: -2px; color: var(--text-3); cursor: help; }
.ii svg { width: 14px; height: 14px; }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }
.tag.acc { background: var(--accent-bg); color: var(--accent); }
.tag.server { background: var(--server-bg); color: var(--server); }
.tag.edge { background: var(--edge-bg); color: var(--edge); }
.tag.fb { background: var(--fb-bg); color: var(--fb); }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); display: inline-block; flex: none; }
.dot.ok, .dot.healthy { background: var(--ok); }
.dot.warn, .dot.degraded, .dot.recovering { background: var(--warn); }
.dot.critical, .dot.down { background: var(--bad); }
.dot.unknown { background: transparent; box-shadow: inset 0 0 0 1.5px var(--text-3); }
.dot.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.45); } 70% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); } 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); } }

.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.sm-t { font-size: 12px; }
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 4px; }
.grow { flex: 1; min-width: 0; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

.input, select.input, textarea.input { width: 100%; height: 32px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); padding: 0 10px; outline: none; }
textarea.input { height: auto; padding: 8px 10px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.fld { display: flex; flex-direction: column; gap: 5px; }
.fld > label { font-size: 12px; font-weight: 550; color: var(--text-2); }
.fld .hint { font-size: 11.5px; color: var(--text-3); }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form .full { grid-column: 1 / -1; }
.chk { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.chk input { accent-color: var(--accent); width: 14px; height: 14px; margin: 0; }

/* 区块 */
.sec { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.sec:last-child { border-bottom: none; }
.sec-t { font-size: 12px; font-weight: 600; color: var(--text-3); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.sec-t .sp { flex: 1; }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 7px 12px; margin: 0; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.grid2 > .sec:nth-child(odd) { border-right: 1px solid var(--line); }

/* 设置项（两列紧凑表单行） */
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.opt { display: flex; align-items: center; gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--line); }
.opt .lb { flex: 1; min-width: 0; }
.opt .lb b { font-weight: 550; display: block; }
.opt .lb span { font-size: 11.5px; color: var(--text-3); }
.opt .input { width: 96px; text-align: right; }
.opt .u { width: 22px; color: var(--text-3); font-size: 12px; }

/* 表格 */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--text-3); padding: 8px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 1; white-space: nowrap; }
.tbl td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.off td { color: var(--text-3); }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--hover); }
.tbl th:first-child, .tbl td:first-child { padding-left: 16px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 16px; }

/* 提示条 */
.note { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; font-size: 12.5px; }
.note svg { width: 15px; height: 15px; }
.note.warn { background: var(--warn-bg); color: var(--warn); }
.note.bad { background: var(--bad-bg); color: var(--bad); }
.note.ok { background: var(--ok-bg); color: var(--ok); }
.note.acc { background: var(--accent-bg); color: var(--accent); }
.note .grow { color: var(--text); }
.notes { display: flex; flex-direction: column; gap: 6px; padding: 12px 16px 0; }

.empty { padding: 48px 20px; text-align: center; color: var(--text-3); }
.empty b { display: block; color: var(--text); font-size: 14px; margin-bottom: 4px; font-weight: 600; }
.empty .btn { margin-top: 14px; }

/* 指标 */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.kpi { background: var(--panel); padding: 14px 16px; }
.kpi b { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; display: block; line-height: 1.2; }
.kpi span { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }

/* 步骤 */
.steps { display: flex; flex-direction: column; gap: 2px; padding: 8px; }
.step { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 8px; color: inherit; }
.step:hover { background: var(--hover); }
.step i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 650; font-size: 12px; background: var(--hover); color: var(--text-2); flex: none; }
.step.done i { background: var(--ok); color: #fff; }
.step b { font-weight: 550; display: block; }
.step span { font-size: 12px; color: var(--text-3); }

/* ---------- 线路顺序 ---------- */
.ord-i { display: grid; grid-template-columns: 16px 26px minmax(0, 1fr) 180px 180px 36px; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.ord-i.drag { opacity: 0.45; }
.ord-i.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.ord-i.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.ord-i .hd { color: var(--text-3); cursor: grab; display: grid; }
.ord-i .hd svg { width: 14px; height: 14px; }
.ord-i .rk { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; font-weight: 650; font-size: 12px; background: var(--hover); color: var(--text-2); }
.ord-i.cur .rk { background: var(--accent); color: #fff; }
.ord-i.off .nm, .ord-i.off .rk { opacity: 0.45; }
.ord-i .nm { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 550; }
.ord-i .st { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 6px; min-width: 0; }
.ord-i .lt { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 8px; justify-content: flex-end; font-variant-numeric: tabular-nums;}
.ord-i.fb { background: var(--panel-2); }
.ord-g { --gc: var(--accent); margin: 12px 16px 0; border: 1px solid var(--line); border-left: 3px solid var(--gc); border-radius: var(--r); overflow: hidden; background: var(--panel); }
.ord-g.g-tencent { --gc: #0a6cff; }
.ord-g.g-aliyun { --gc: #ff6a00; }
.ord-g.g-server { --gc: #7c3aed; }
.ord-g.cur { box-shadow: 0 0 0 1px var(--gc); }
.ord-g .ord-i { padding-left: 13px; }
.ord-gh .gi { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: var(--gc); background: color-mix(in srgb, var(--gc) 14%, transparent); }
.ord-gh .gi svg { width: 13px; height: 13px; }
.ord-gh .gn { font-size: 13px; font-weight: 650; color: var(--text); }
.ord-gh .gs { display: flex; align-items: center; gap: 8px; font-weight: 400; }
#ol > .ord-i.fb { margin: 12px 16px; border: 1px dashed var(--line); border-left: 3px solid var(--text-3); border-radius: var(--r); padding-left: 13px; }
.ord-g.drag { opacity: 0.45; }
.ord-g.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.ord-g.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.ord-gh { display: flex; align-items: center; gap: 8px; padding: 8px 13px; background: color-mix(in srgb, var(--gc) 5%, var(--panel-2)); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--text-2); }
.ord-gh .hd { color: var(--text-3); cursor: grab; display: grid; }
.ord-gh .hd svg { width: 14px; height: 14px; }
.ord-gb .ord-i:last-child { border-bottom: none; }
.ord-i.fb .rk { background: var(--fb-bg); color: var(--fb); }
.ord-i.fb.cur .rk { background: var(--fb); color: #fff; }
.ord-i .rk svg { width: 13px; height: 13px; }

/* 服务范围 */
.scope-h { display: flex; align-items: center; gap: 10px; padding: 9px 16px; background: var(--panel-2); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; }
.scope-h b { font-weight: 600; }
.scope-r { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 12px; padding: 6px 16px 10px 40px; border-bottom: 1px solid var(--line); }
.scope-r label { display: flex; align-items: center; gap: 7px; padding: 4px 0; cursor: pointer; min-width: 0; }
.scope-r label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scope-r label.dis { cursor: default; color: var(--text-3); }
.scope-r label em.un { font-style: normal; font-size: 11px; color: var(--text-3); background: var(--panel-2); border-radius: 4px; padding: 0 5px; flex: none; }
.scope-r input, .scope-h input { accent-color: var(--accent); }

/* 底部保存条 */
.savebar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--accent-bg); }
.savebar .grow { color: var(--accent); font-weight: 500; }

/* 代码 */
pre.code { margin: 0; padding: 14px 16px; font: 12px/1.6 var(--mono); white-space: pre; overflow: auto; background: var(--panel-2); flex: 1; min-height: 0; }

/* 时间线 */
.tl { padding: 4px 16px 12px; }
.tl-d { font-size: 11.5px; font-weight: 600; color: var(--text-3); padding: 12px 0 4px; }
.tl-i { display: grid; grid-template-columns: 58px 10px 1fr; gap: 10px; padding: 5px 0; align-items: baseline; }
.tl-i .t { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tl-i .d { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); align-self: center; }
.tl-i .d.warn { background: var(--warn); }
.tl-i .d.critical { background: var(--bad); }
.tl-i .m small { display: block; font-size: 11.5px; color: var(--text-3); }

/* 迷你柱 */
.spark { display: inline-flex; gap: 1px; align-items: flex-end; height: 14px; vertical-align: middle; }
.spark i { width: 2px; height: 100%; border-radius: 1px; background: var(--ok); opacity: 0.85; }
.spark i.f { background: var(--bad); }
.spark i.p { background: var(--warn); }
.spark i.n { background: var(--line); height: 40%; }

/* ---------- 浮层 ---------- */
.scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.25); z-index: 50; animation: fade 0.15s; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 60px; right: 12px; bottom: 12px; width: min(440px, calc(100vw - 24px)); z-index: 51; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide 0.2s ease-out; overflow: hidden; }
@keyframes slide { from { transform: translateX(16px); opacity: 0; } }
.modal-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(15, 23, 42, 0.3); padding: 20px; animation: fade 0.15s; }
.modal { width: min(440px, 100%); max-height: calc(100vh - 40px); background: var(--panel); border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; border: 1px solid var(--line); animation: pop 0.18s ease-out; }
.modal.wide { width: min(680px, 100%); }
.modal.xwide { width: min(920px, 100%); }
@keyframes pop { from { transform: scale(0.97); opacity: 0; } }
.modal-head { padding: 16px 18px 4px; }
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 650; }
.modal-head p { margin: 4px 0 0; color: var(--text-2); font-size: 12.5px; }
.modal-body { padding: 12px 18px; overflow: auto; }
.modal-foot { padding: 10px 18px 16px; display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.modal-foot .left { margin-right: auto; }
.menu { position: fixed; z-index: 70; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow-lg); padding: 4px; min-width: 160px; }
.menu button { display: flex; width: 100%; align-items: center; gap: 8px; border: none; background: none; padding: 7px 10px; border-radius: 6px; cursor: pointer; text-align: left; }
.menu button:hover { background: var(--hover); }
.menu button.on { color: var(--accent); font-weight: 600; }
.menu button svg { width: 14px; height: 14px; }
.menu hr { border: none; border-top: 1px solid var(--line); margin: 4px 0; }
.tbl tr.zrow td { background: var(--panel-2); font-size: 12px; font-weight: 600; color: var(--text-2); padding-top: 6px; padding-bottom: 6px; }
.scope-r label em.hold { font-style: normal; font-size: 11px; padding: 0 5px; border-radius: 4px; background: var(--ok-bg); color: var(--ok); margin-left: 4px; }
.ngx-wrap { display: flex; flex: 1; min-height: 0; }
.ngx-l { width: 260px; flex: none; border-right: 1px solid var(--line); overflow: auto; padding-bottom: 8px; }
.ngx-r { flex: 1; min-width: 0; overflow: auto; padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.ngx { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: none; }
.ngx-h { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.ngx pre.code { flex: none; overflow-x: auto; }
.menu.pick { max-height: 320px; overflow: auto; }
.menu.pick button > span { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.hpick { display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; }
.hpick .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hpick svg { width: 14px; height: 14px; color: var(--text-3); flex: none; }
.menu .mh { padding: 6px 10px 4px; font-size: 11.5px; color: var(--text-3); }

.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #111827; color: #fff; padding: 9px 14px; border-radius: 9px; font-size: 12.5px; display: flex; gap: 8px; align-items: center; box-shadow: var(--shadow-lg); animation: up 0.2s ease-out; max-width: 560px; }
.toast svg { width: 15px; height: 15px; }
.toast.err { background: var(--bad); }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }
.tip { position: fixed; z-index: 90; max-width: 300px; background: #111827; color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 6px; pointer-events: none; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; padding: 50px; }

/* 登录 */
.auth-wrap { height: 100vh; display: grid; place-items: center; }
.auth { width: 340px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px 26px 22px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 14px; }
.auth .logo { justify-content: center; font-size: 16px; }
.auth .logo i { width: 32px; height: 32px; border-radius: 9px; }
.auth p { margin: -6px 0 2px; text-align: center; color: var(--text-2); font-size: 12.5px; }
.auth .btn { height: 34px; }
.auth .err { color: var(--bad); font-size: 12px; text-align: center; min-height: 18px; }
.auth .hint { background: var(--accent-bg); color: var(--accent); border-radius: 8px; padding: 7px 10px; font-size: 12px; text-align: center; }

@media (max-width: 900px) {
  .work, .work.wide-left { grid-template-columns: 1fr; grid-template-rows: 40% 1fr; }
  .nav a span { display: none; }
  .form, .grid2 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}

.step > svg, .note > svg:last-child { width: 14px; height: 14px; color: var(--text-3); }
.li > svg { width: 15px; height: 15px; }
label.btn { position: relative; }

/* 自动配置 Nginx */
.kvs { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.kvs .kv { grid-template-columns: 80px 1fr; }
#ngauto { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
#ngauto .full { grid-column: 1 / -1; }

/* 可折叠的说明卡片 */
.folds { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 18px; }
.fold { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); overflow: hidden; }
.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-size: 13px; user-select: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary:hover { background: var(--hover); }
.fold > summary svg { width: 14px; height: 14px; color: var(--text-3); transform: rotate(-90deg); transition: transform .15s; }
.fold[open] > summary svg { transform: rotate(0deg); }
.fold[open] > summary { border-bottom: 1px solid var(--line); }
.fold-b { padding: 4px 14px 14px; }
.fold-b p { margin: 8px 0; }
