/* ============================================================
   服务器控制台 · 浅色卡片版（参考墨通游戏面板风格）
   浅灰底 / 白卡片大圆角 / 绿色主色 / 顶部导航 + 白色侧栏
   ============================================================ */
:root {
  --bg:        oklch(97.3% 0.004 150);
  --panel:     oklch(100% 0 0);
  --border:    oklch(93% 0.008 150);
  --row-line:  oklch(95% 0.006 150);

  --text:      oklch(30% 0.02 220);
  --text-dim:  oklch(50% 0.015 220);
  --text-faint:oklch(64% 0.012 220);

  --green:       oklch(63% 0.14 160);          /* 主色：运行中/确认按钮 */
  --green-deep:  oklch(56% 0.13 160);
  --green-dim:   oklch(63% 0.14 160 / 12%);
  --blue:        oklch(60% 0.14 245);          /* 次级：重启等中性操作 */
  --blue-dim:    oklch(60% 0.14 245 / 12%);
  --red:         oklch(58% 0.19 25);
  --red-dim:     oklch(58% 0.19 25 / 12%);
  --amber:       oklch(70% 0.13 80);

  --ink:       oklch(23% 0.02 240);            /* 终端深底 */
  --sans: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Courier New", monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sp-1: 6px; --sp-2: 12px; --sp-3: 20px; --sp-4: 32px; --sp-5: 48px;
  --r: 12px;   --r-sm: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  font-kerning: normal;
}

.hidden { display: none !important; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-dim); }
::selection { background: var(--green-dim); }

/* 卡片基类 */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: 0 1px 2px oklch(40% 0.02 220 / 4%), 0 4px 16px oklch(40% 0.02 220 / 4%);
}

/* ============================================================
   着陆页（未登录）
   ============================================================ */
.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: var(--sp-3) var(--sp-5) var(--sp-4);
  background:
    radial-gradient(ellipse 55% 40% at 75% 12%, oklch(92% 0.04 160), transparent 60%),
    radial-gradient(ellipse 40% 35% at 8% 90%, oklch(94% 0.02 200), transparent 65%),
    var(--bg);
  transition: opacity .18s var(--ease);
}
.landing.land-out { opacity: 0; }

.land-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3); padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
}
.land-brand { font-weight: 600; font-size: 15px; }
.land-brand b { font-family: var(--mono); color: var(--green); font-weight: 500; margin-right: 6px; }
.land-host {
  font-size: 12px; color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 12px; background: #fff; font-variant-numeric: tabular-nums;
}

.land-grid {
  flex: 1; display: grid; grid-template-columns: 1.2fr 0.8fr;
  gap: var(--sp-4); align-items: center;
  max-width: 1060px; width: 100%; margin: var(--sp-4) auto; padding: var(--sp-2) 0;
}

/* 终端窗口（登录页 + SSH 动画共用） */
.term-window {
  background: var(--ink);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: 0 24px 60px oklch(25% 0.04 240 / 28%);
}
.term-title {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  background: oklch(20% 0.02 240);
  border-bottom: 1px solid oklch(100% 0 0 / 6%);
}
.term-title .tl { width: 10px; height: 10px; border-radius: 50%; }
.term-title .tl:nth-child(1) { background: oklch(62% 0.16 25); }
.term-title .tl:nth-child(2) { background: oklch(70% 0.13 80); }
.term-title .tl:nth-child(3) { background: oklch(62% 0.13 150); }
.term-title em {
  margin-left: 10px; font-style: normal; font-family: var(--mono);
  font-size: 11px; color: oklch(60% 0.015 255); letter-spacing: 0.04em;
}
.term-body {
  padding: var(--sp-3) var(--sp-3) var(--sp-4);
  font-family: var(--mono); font-size: 13.5px; line-height: 2;
  color: oklch(88% 0.01 255); min-height: 190px;
}
.tline { white-space: pre-wrap; word-break: break-all; }
.t-cmd { color: oklch(88% 0.01 255); }
.t-out { color: oklch(75% 0.13 160); }
.t-dim { color: oklch(58% 0.015 255); }
.t-ok  { color: oklch(75% 0.14 150); }
.caret {
  display: inline-block; width: 8px; height: 15px; margin-left: 4px;
  vertical-align: -2px; background: oklch(75% 0.13 160);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.term-body .tline { animation: tline-in .3s var(--ease) backwards; }
.term-body .tline:nth-child(2) { animation-delay: .12s; }
.term-body .tline:nth-child(3) { animation-delay: .24s; }
.term-body .tline:nth-child(4) { animation-delay: .36s; }
@keyframes tline-in { from { opacity: 0; transform: translateY(4px); } }

/* 登录卡 */
.login-card {
  width: auto; padding: var(--sp-4);
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: 0 10px 40px oklch(40% 0.03 200 / 8%);
}
.login-brand { font-family: var(--mono); font-size: 13px; color: var(--text-faint); margin-bottom: 4px; }
.login-brand b { color: var(--green); font-weight: 500; }
.login-card h1 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 var(--sp-3); }
.f-label {
  display: block; font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-faint); margin: var(--sp-2) 0 5px;
}
.login-card input {
  width: 100%; padding: 11px 13px; margin-bottom: var(--sp-1);
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text); font-size: 14px; outline: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.login-card input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-dim); }
.login-card button {
  width: 100%; padding: 11px; margin-top: var(--sp-2);
  background: var(--green); color: #fff; border: 0; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: filter .2s var(--ease);
}
.login-card button:hover { filter: brightness(1.08); }
.err { color: var(--red); font-size: 13px; min-height: 18px; margin: var(--sp-2) 0 0; }

.land-feat {
  max-width: 1060px; width: 100%; margin: 0 auto;
  display: flex; gap: var(--sp-5); flex-wrap: wrap;
  padding-top: var(--sp-3); border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-dim);
}
.land-feat span i { font-style: normal; color: var(--text-faint); margin-left: 8px; font-size: 12px; }
.land-foot {
  max-width: 1060px; width: 100%; margin: var(--sp-3) auto 0;
  font-size: 11px; color: var(--text-faint); text-align: center; letter-spacing: 0.04em;
}
.land-foot .beian-link, .app-foot a { color: inherit; text-decoration: none; border-bottom: 1px solid currentColor; }
.app-foot {
  position: fixed;
  left: 216px; right: 0; bottom: 0;      /* 从侧栏右缘开始，不挡住左下角「登录身份」 */
  z-index: 20;
  padding: 6px 0;
  background: oklch(100% 0 0 / 88%);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--border);
  font-size: 11px; color: var(--text-faint); text-align: center; letter-spacing: 0.04em;
}
.app-foot .sep { margin: 0 6px; }

/* SSH 连接动画 */
.ssh-mask {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: oklch(30% 0.02 220 / 40%);
  animation: fade .2s var(--ease);
}
@keyframes fade { from { opacity: 0; } }
.term-window.ssh { width: 560px; max-width: calc(100vw - 32px); }
.term-window.ssh .term-body { min-height: 120px; }

/* ============================================================
   主界面框架：顶部导航 + 侧栏
   ============================================================ */
.app { min-height: 100vh; }

.topnav {
  position: sticky; top: 0; z-index: 30;
  height: 52px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--sp-4);
  background: oklch(100% 0 0 / 92%);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.tn-brand { font-weight: 600; font-size: 15px; }
.tn-brand b { font-family: var(--mono); color: var(--green); font-weight: 500; margin-right: 6px; }
.tn-right { display: flex; align-items: center; gap: 12px; font-size: 12px; }
.tn-host {
  color: var(--text-dim); background: var(--bg);
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 12px;
  font-size: 11.5px; font-variant-numeric: tabular-nums;
}
.tn-btn {
  padding: 6px 14px; background: #fff; color: var(--text-dim);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  font-size: 12.5px; cursor: pointer;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.tn-btn:hover { color: var(--red); border-color: var(--red); }

.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); display: inline-block;
  animation: pulse 2.4s ease-out infinite;
}
.live-dot.err { background: var(--red); animation: none; }
@keyframes pulse {
  0%  { box-shadow: 0 0 0 0 oklch(63% 0.14 160 / 35%); }
  70% { box-shadow: 0 0 0 7px oklch(63% 0.14 160 / 0%); }
  100%{ box-shadow: 0 0 0 0 oklch(63% 0.14 160 / 0%); }
}

.layout { display: flex; min-height: calc(100vh - 52px); }

.sidebar {
  width: 216px; flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 52px; height: calc(100vh - 52px);
  overflow-y: auto;
}
.sb-server { padding: var(--sp-3) var(--sp-3) var(--sp-2); }
.sb-name { font-weight: 600; font-size: 14.5px; }
.sb-host { font-size: 11px; color: var(--text-faint); margin-top: 2px; font-variant-numeric: tabular-nums; }

.sb-label {
  font-family: var(--mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--text-faint);
  padding: var(--sp-2) var(--sp-3) 6px;
}
.sidebar nav, .sb-links { padding: 0 var(--sp-2); display: flex; flex-direction: column; gap: 3px; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-dim); text-decoration: none;
  padding: 9px 12px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 500;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.nav-item:hover { color: var(--text); background: var(--bg); }
.nav-item.active {
  color: #fff; background: var(--green);
  box-shadow: 0 4px 12px oklch(63% 0.14 160 / 30%);
}
.nav-item .ico {
  width: 17px; height: 17px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.nav-item.sub { font-size: 12.5px; font-weight: 400; color: var(--text-dim); }
.nav-item.sub:hover { color: var(--green); }

.nav-badge {
  margin-left: auto; font-family: var(--mono); font-size: 11px;
  color: inherit; opacity: .7; font-variant-numeric: tabular-nums;
}

.sidebar-foot {
  margin-top: auto; padding: var(--sp-3);
  border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-dim);
}
.sidebar-foot .who b { color: var(--text); font-weight: 500; }

.main { flex: 1; min-width: 0; padding-bottom: 36px; }   /* 底部留出固定备案条的高度，避免内容被盖住 */
.view-wrap { padding: var(--sp-4) var(--sp-4) var(--sp-5); max-width: 1280px; }
.view > * { animation: rise .4s var(--ease) backwards; }
.view > *:nth-child(2) { animation-delay: .05s; }
.view > *:nth-child(3) { animation-delay: .1s; }
.view > *:nth-child(4) { animation-delay: .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .view > *, .live-dot { animation: none !important; }
  * { transition: none !important; }
}

/* 分区标签 */
.sec { margin-top: var(--sp-4); }
.sec-label {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.16em;
  display: flex; align-items: center; gap: var(--sp-2);
  margin: var(--sp-4) 0 var(--sp-3);
}
.sec-label::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.sec-label .sec-note { letter-spacing: 0; text-transform: none; color: var(--text-faint); }

/* ============================================================
   仪表盘
   ============================================================ */
.hero-card {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3); flex-wrap: wrap;
  padding: var(--sp-3) var(--sp-4);
}
.hero-left { display: flex; align-items: center; gap: var(--sp-3); }
.avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--green-dim); color: var(--green-deep);
  border: 1px solid oklch(63% 0.14 160 / 25%);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 600; text-transform: uppercase;
}
.hero-card h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.hero-sub { font-size: 12px; color: var(--text-faint); margin-top: 2px; font-variant-numeric: tabular-nums; }

.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hact {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: var(--r-sm);
  background: var(--bg); border: 1px solid var(--border);
  font-size: 12.5px; font-weight: 500; color: var(--text-dim);
  cursor: pointer; text-decoration: none; font-family: inherit;
  transition: color .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease);
}
.hact:hover { color: var(--green-deep); border-color: var(--green); background: var(--green-dim); }
.hact .hi { font-size: 14px; }

/* 资源大卡片 */
.stat-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--sp-3);
}
.stat-card { padding: var(--sp-3); min-width: 0; }
.st-head {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--text-faint); margin-bottom: 10px;
}
.st-ico {
  width: 16px; height: 16px;
  fill: none; stroke: var(--green); stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.st-big {
  font-family: var(--mono); font-size: clamp(26px, 3vw, 34px);
  font-weight: 300; line-height: 1.1; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; color: var(--text);
}
.st-big .unit { font-size: 13px; color: var(--text-faint); margin-left: 5px; letter-spacing: 0; }
#cpu-spark { display: block; margin: 8px 0 2px; }
.st-bar {
  height: 6px; border-radius: 3px; overflow: hidden;
  background: var(--border); margin: 10px 0 2px;
}
.st-bar-fill {
  height: 100%; border-radius: 3px; width: 0%;
  background: var(--green);
  transition: width .5s var(--ease), background .3s var(--ease);
}
.st-bar-fill.warn { background: var(--amber); }
.st-bar-fill.bad  { background: var(--red); }
.st-sub { font-size: 11.5px; color: var(--text-faint); margin-top: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-card.lvl-warn .st-big { color: var(--amber); }
.stat-card.lvl-bad  .st-big { color: var(--red); }
.stat-card.lvl-bad  .st-ico { stroke: var(--red); }

/* 容器小卡 */
.ctn-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--sp-3);
}
.ctn-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r); padding: var(--sp-3);
  cursor: pointer; position: relative;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease);
}
.ctn-card:hover {
  border-color: oklch(63% 0.14 160 / 40%);
  box-shadow: 0 6px 20px oklch(40% 0.05 160 / 10%);
  transform: translateY(-1px);
}
.ctn-card .name {
  font-weight: 600; font-size: 13.5px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.ctn-card .meta {
  font-family: var(--mono); font-size: 11.5px; color: var(--text-faint);
  line-height: 1.9; font-variant-numeric: tabular-nums; word-break: break-all;
}
.ctn-card .web-link {
  display: inline-block; margin-top: 8px;
  font-family: var(--mono); font-size: 11.5px;
  color: var(--green-deep); text-decoration: none;
  border-bottom: 1px dashed oklch(56% 0.13 160 / 45%);
  transition: border-color .15s var(--ease);
}
.ctn-card .web-link:hover { border-bottom-style: solid; }

/* 状态点与标签 */
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot.ok { background: var(--green); }
.dot.off { background: oklch(78% 0.01 220); }
.dot.warn { background: var(--amber); }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11.5px;
  padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-dim);
  white-space: nowrap; background: var(--panel);
}
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: oklch(78% 0.01 220); }
.tag.running, .tag.success { color: var(--green-deep); border-color: oklch(56% 0.13 160 / 35%); background: var(--green-dim); }
.tag.running::before, .tag.success::before { background: var(--green); }
.tag.failed { color: var(--red); border-color: oklch(58% 0.19 25 / 35%); background: var(--red-dim); }
.tag.failed::before { background: var(--red); }
.tag.timeout, .tag.restarting, .tag.paused { color: var(--amber); border-color: oklch(70% 0.13 80 / 40%); }
.tag.timeout::before, .tag.restarting::before, .tag.paused::before { background: var(--amber); }
.tag.infra { color: var(--blue); border-color: oklch(60% 0.14 245 / 30%); background: var(--blue-dim); }
.tag.infra::before { background: var(--blue); }

/* ============================================================
   信息条（容器页顶部）
   ============================================================ */
.info-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-3); margin-bottom: var(--sp-3);
}
.info-card { padding: 14px 16px; }
.if-label {
  font-family: var(--mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--text-faint); margin-bottom: 6px;
}
.info-card b {
  display: block; font-size: 15px; font-weight: 600;
  font-variant-numeric: tabular-nums; word-break: break-all;
  color: var(--text);
}
.info-card span { display: block; font-size: 11.5px; color: var(--text-faint); margin-top: 3px; }

/* ============================================================
   表格与按钮
   ============================================================ */
.panel { overflow: hidden; }
.panel-head {
  padding: var(--sp-3);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-2); flex-wrap: wrap; background: oklch(99% 0.003 150);
}
.panel-head .title {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.16em; color: var(--text-faint);
}
.panel-head .title .count { color: var(--text-dim); letter-spacing: 0; }
.panel-head .ops { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

table { width: 100%; border-collapse: collapse; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll table { min-width: 760px; }
th {
  text-align: left; font-family: var(--mono); font-weight: 400;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-faint); padding: 10px 14px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
td {
  padding: 12px 14px; border-bottom: 1px solid var(--row-line);
  font-size: 13px; vertical-align: middle; word-break: break-word;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s var(--ease); }
tbody tr:hover { background: oklch(97% 0.006 160); }
td .mono, td.mono { font-family: var(--mono); font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
td b { font-weight: 500; }

button.act, a.act {
  display: inline-block; padding: 4px 11px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-sm);
  font-size: 12px; font-family: var(--mono); cursor: pointer;
  color: var(--text-dim); margin-right: 5px;
  text-decoration: none; line-height: 1.5; vertical-align: middle;
  transition: color .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease);
  white-space: nowrap;
}
button.act:hover, a.act:hover { color: var(--green-deep); border-color: var(--green); }
button.act:disabled { opacity: .4; cursor: not-allowed; }

/* 电源式分色操作按钮 */
button.act.go         { color: var(--green-deep); border-color: oklch(56% 0.13 160 / 40%); }
button.act.go:hover   { color: #fff; background: var(--green); border-color: var(--green); }
button.act.stop       { color: var(--red); border-color: oklch(58% 0.19 25 / 35%); }
button.act.stop:hover { color: #fff; background: var(--red); border-color: var(--red); }
button.act.re         { color: var(--blue); border-color: oklch(60% 0.14 245 / 35%); }
button.act.re:hover   { color: #fff; background: var(--blue); border-color: var(--blue); }
button.act.danger:hover { color: #fff; background: var(--red); border-color: var(--red); }

a.act.web {
  display: inline-block; color: var(--green-deep);
  border-color: oklch(56% 0.13 160 / 40%);
}
a.act.web:hover { background: var(--green); color: #fff; border-color: var(--green); }

.btn-sm {
  padding: 7px 14px; background: #fff;
  border: 1px solid var(--green); color: var(--green-deep);
  border-radius: var(--r-sm); font-size: 12.5px; font-family: var(--mono);
  cursor: pointer; white-space: nowrap;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.btn-sm:hover { background: var(--green); color: #fff; }

/* 开关 */
.switch { position: relative; display: inline-block; width: 32px; height: 17px; vertical-align: middle; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0;
  background: oklch(85% 0.01 220); border-radius: 17px; transition: .2s var(--ease);
}
.slider:before {
  content: ""; position: absolute; height: 11px; width: 11px;
  left: 3px; top: 3px; background: #fff; border-radius: 50%;
  transition: .2s var(--ease); box-shadow: 0 1px 2px oklch(40% 0.02 220 / 25%);
}
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider:before { transform: translateX(15px); }

/* ============================================================
   实时终端（仪表盘）
   ============================================================ */
.term-console {
  background: var(--ink);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: 0 12px 36px oklch(25% 0.04 240 / 24%);
}
.tc-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: oklch(20% 0.02 240);
  border-bottom: 1px solid oklch(100% 0 0 / 6%);
}
.tc-title { font-family: var(--mono); font-size: 12px; color: oklch(75% 0.02 255); letter-spacing: 0.04em; }
.tc-status { font-size: 11px; color: oklch(70% 0.13 150); }
.tc-status.busy { color: var(--amber); }
.tc-body {
  margin: 0; padding: var(--sp-3);
  font-size: 12.5px; line-height: 1.65;
  color: oklch(86% 0.01 255);
  height: 300px; overflow-y: auto;
  white-space: pre-wrap; word-break: break-all; font-variant-ligatures: none;
}
.tc-body::-webkit-scrollbar { width: 8px; }
.tc-body::-webkit-scrollbar-thumb { background: oklch(45% 0.02 255); border-radius: 4px; }
.tc-body::-webkit-scrollbar-track { background: transparent; }
.tc-input {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid oklch(100% 0 0 / 8%);
  background: oklch(22% 0.02 240);
}
.tc-prompt { color: var(--green); font-size: 13px; flex-shrink: 0; }
.tc-input input {
  flex: 1; background: transparent; border: 0; outline: none;
  color: oklch(88% 0.01 255); font-family: var(--mono); font-size: 13px;
}
.tc-input input::placeholder { color: oklch(50% 0.015 255); }
.tc-send {
  padding: 5px 14px; background: var(--green); color: #fff;
  border: 0; border-radius: var(--r-sm);
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: filter .15s var(--ease);
}
.tc-send:hover { filter: brightness(1.08); }
.tc-send:disabled { opacity: .5; cursor: not-allowed; }

/* ============================================================
   弹层
   ============================================================ */
.modal-mask {
  position: fixed; inset: 0;
  background: oklch(30% 0.02 220 / 38%);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; animation: fade .2s var(--ease);
}
.modal {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r); padding: var(--sp-4);
  width: 640px; max-width: calc(100vw - 40px); max-height: 84vh; overflow: auto;
  box-shadow: 0 20px 60px oklch(28% 0.02 220 / 22%);
  animation: rise .3s var(--ease);
}
.modal.wide { width: 780px; }
.modal h3 { margin: 0 0 var(--sp-3); font-size: 15px; font-weight: 600; }
.modal label {
  display: block; color: var(--text-dim); font-size: 12px;
  font-family: var(--mono); margin: var(--sp-3) 0 5px; letter-spacing: 0.04em;
}
.modal input, .modal select, .modal textarea {
  width: 100%; padding: 9px 12px; background: #fff;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text); font-size: 14px; font-family: inherit; outline: none;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.modal input:focus, .modal select:focus, .modal textarea:focus {
  border-color: var(--green); box-shadow: 0 0 0 3px var(--green-dim);
}
.modal textarea { min-height: 60px; resize: vertical; font-family: var(--mono); font-size: 13px; }
.modal .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.modal .actions { margin-top: var(--sp-4); text-align: right; }
.modal .actions button { margin-left: var(--sp-2); }
.primary { background: var(--green) !important; color: #fff !important; border: 0 !important; font-weight: 600; }

.kv { width: 100%; font-size: 13px; }
.kv td { padding: 7px 8px; border-bottom: 1px solid var(--row-line); }
.kv td:first-child {
  color: var(--text-faint); width: 110px; white-space: nowrap;
  font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em;
}
.kv td:last-child { font-family: var(--mono); font-size: 12.5px; word-break: break-all; color: var(--text-dim); }

/* 日志：深色终端块 */
pre.logs {
  background: var(--ink); color: oklch(88% 0.01 255);
  padding: var(--sp-3); border-radius: var(--r-sm);
  font-family: var(--mono); font-size: 12px; line-height: 1.6;
  max-height: 46vh; overflow: auto;
  white-space: pre-wrap; word-break: break-all; font-variant-ligatures: none;
}
pre.logs::-webkit-scrollbar { width: 8px; height: 8px; }
pre.logs::-webkit-scrollbar-thumb { background: oklch(45% 0.02 255); border-radius: 4px; }
pre.logs::-webkit-scrollbar-track { background: transparent; }

.preset-row { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 8px; }
.preset-row button {
  font-family: var(--mono); font-size: 12px; padding: 4px 11px;
  border: 1px solid var(--border); background: #fff; border-radius: var(--r-sm);
  cursor: pointer; color: var(--text-dim); transition: all .15s var(--ease);
}
.preset-row button:hover, .preset-row button.on { border-color: var(--green); color: var(--green-deep); }

.toast {
  position: fixed; top: 60px; left: 50%;
  transform: translateX(-50%);
  background: var(--ink); color: #fff;
  padding: 10px 18px; border-radius: var(--r-sm);
  font-size: 13px; z-index: 99; opacity: 0;
  transition: opacity .25s var(--ease); pointer-events: none;
  box-shadow: 0 8px 24px oklch(28% 0.02 220 / 25%);
}
.toast.show { opacity: 1; }
.toast.error { background: var(--red); }

.hint { color: var(--text-faint); font-size: 12px; margin-top: var(--sp-2); line-height: 1.7; }
.empty {
  padding: var(--sp-5); text-align: center;
  color: var(--text-faint); font-family: var(--mono); font-size: 13px;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1100px) {
  .view-wrap { padding: var(--sp-3) var(--sp-3) var(--sp-4); }
}

@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static;
    flex-direction: row; align-items: center;
    border-right: 0; border-bottom: 1px solid var(--border);
    overflow-x: auto; overflow-y: hidden;
  }
  .sb-server { padding: var(--sp-2) var(--sp-3); border-right: 1px solid var(--border); }
  .sb-host { display: none; }
  .sb-label { display: none; }
  .sidebar nav, .sb-links { flex-direction: row; padding: var(--sp-2); flex: 1; }
  .nav-item { padding: 8px 11px; white-space: nowrap; }
  .sidebar-foot { margin: 0; padding: 0 var(--sp-2); border-top: 0; border-left: 1px solid var(--border); display: flex; align-items: center; }
  .sidebar-foot .who { display: none; }
  .app-foot { left: 0; }   /* 窄屏下侧栏变横向顶栏，备案条恢复全宽贴底 */
  .hero-card { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
  .topnav { padding: 0 var(--sp-3); }
  .tn-host { display: none; }
  #last-refresh { display: none; }
  .view-wrap { padding: var(--sp-3) var(--sp-2) var(--sp-5); }
  .hero-card { padding: var(--sp-3); }
  .hero-card h2 { font-size: 17px; }
  th, td { padding: 9px 10px; }
  .modal { width: calc(100vw - 16px); max-height: 90vh; padding: var(--sp-3); }
  .modal .row2 { grid-template-columns: 1fr; }
  .ctn-grid { grid-template-columns: 1fr 1fr; }
  button.act, a.act { padding: 7px 10px; margin-right: 4px; }
  .btn-sm { padding: 8px 12px; }
  .land-grid { grid-template-columns: 1fr; gap: var(--sp-3); }
  .term-body { min-height: 0; font-size: 12.5px; }
  .landing { padding: var(--sp-3); }
  .land-feat { gap: var(--sp-3) var(--sp-4); }
}
