/* ============================================================================
   Steward 控制台设计系统
   风格：面向单一管理员的工程工具。暖粉画布 + 藏蓝侧栏，单一紫蓝强调色，
        状态色只表达状态，数字一律等宽对齐，圆角规则固定（卡片 8 / 控件 6 / 徽标 4）。
   约定：全部颜色、字体、尺寸走变量；深浅主题只切换变量值，不写两套样式。
   ========================================================================== */

/* ---------- 1. 令牌 ---------- */
:root {
  color-scheme: light;

  /* 画布与面板（色板 bg-200 画布、bg-100 面板、bg-300 强边线） */
  --bg: #f2e1e0;
  --surface: #fcebea;
  --surface-2: #f8e7e5;
  --surface-3: #f3dcd9;
  --line: #ecdcd9;
  --line-strong: #c9b9b8;

  /* 文字（按重要性递减；ink-3 在浅底上的对比度不低于 4.5） */
  --ink: #3c3c3c;
  --ink-2: #666666;
  --ink-3: #6c6c6c;
  --ink-4: #949494;

  /* 强调色：只用于可交互元素、焦点与「进行中」状态（色板 primary-200） */
  --accent: #3e3689;
  --accent-hover: #322c73;
  --accent-fg: #ffffff;
  --accent-soft: #f9f1ff;
  --accent-line: #d5c9ef;

  /* 墨色：侧栏与主按钮（primary-100 提亮降饱和的深紫，与粉画布同色系，避免冷暖对撞） */
  --ink-bg: #2f2a63;
  --ink-bg-2: #3b3576;
  --ink-bg-3: #49428c;
  --ink-fg: #ecebf5;
  --ink-fg-2: #b4afcc;
  --ink-line: #443e7f;
  --btn-bg: #2f2a63;
  --btn-bg-hover: #3b3576;
  --btn-fg: #ffffff;

  /* 状态色：文字 / 浅底 / 边线 */
  --ok: #147a4d;       --ok-soft: #e3f3ea;       --ok-line: #b5dfc8;
  --warn: #955700;     --warn-soft: #fdf0d9;     --warn-line: #efd09a;
  --danger: #b3262c;   --danger-soft: #fbe8e8;   --danger-line: #efb9b9;
  --muted: #566373;    --muted-soft: #edf0f3;    --muted-line: #d7dde4;

  /* 终端（恒为深色，不随主题翻转） */
  --term-bg: #0e151e;
  --term-head: #131c28;
  --term-line: #22303f;
  --term-fg: #c8d3df;
  --term-dim: #6f8093;
  --term-err: #f28b82;
  --term-sys: #8fb0ff;
  --term-ok: #7bd39a;

  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, "Liberation Mono", monospace;

  /* 尺寸 */
  --side-w: 232px;
  --side-w-mini: 64px;
  --top-h: 52px;
  --r-box: 8px;
  --r-ctl: 6px;
  --r-tag: 4px;

  --shadow-1: 0 1px 2px rgba(0, 16, 59, .06);
  --shadow-2: 0 10px 30px rgba(0, 16, 59, .13), 0 1px 2px rgba(0, 16, 59, .08);
  --shadow-3: 0 28px 72px rgba(0, 10, 45, .28), 0 2px 6px rgba(0, 10, 45, .14);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0d0d1a;
  --surface: #15152a;
  --surface-2: #1a1a31;
  --surface-3: #21213c;
  --line: #2a2a45;
  --line-strong: #3e3e5e;

  --ink: #e9e8f0;
  --ink-2: #b3b1c6;
  --ink-3: #8f8da6;
  --ink-4: #62607a;

  --accent: #a08eec;
  --accent-hover: #b3a3f3;
  --accent-fg: #17103c;
  --accent-soft: #221d47;
  --accent-line: #443c85;

  --ink-bg: #050718;
  --ink-bg-2: #0b0d22;
  --ink-bg-3: #151638;
  --ink-fg: #e9e8f0;
  --ink-fg-2: #86839f;
  --ink-line: #1d1e3a;
  --btn-bg: #e9e8f0;
  --btn-bg-hover: #ffffff;
  --btn-fg: #0d0d1a;

  --ok: #4cc98a;       --ok-soft: #0f2a1e;       --ok-line: #1d5238;
  --warn: #e3a63a;     --warn-soft: #2d2210;     --warn-line: #5f4a1a;
  --danger: #f0706f;   --danger-soft: #321719;   --danger-line: #6e2c2e;
  --muted: #9aa7b5;    --muted-soft: #1e2733;    --muted-line: #35414f;

  --term-bg: #070b10;
  --term-head: #0b1119;
  --term-line: #1a2432;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .45);
  --shadow-2: 0 10px 30px rgba(0, 0, 0, .5), 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-3: 0 28px 72px rgba(0, 0, 0, .64), 0 2px 6px rgba(0, 0, 0, .4);
}

/* ---------- 2. 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* 中文与西文、数字之间自动留出间隙（支持的浏览器生效，其余靠文案里的空格） */
  text-autospace: normal;
  font-variant-numeric: tabular-nums;
}

h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
svg { display: block; }

::selection { background: var(--accent-soft); color: var(--ink); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-ctl); }

[v-cloak] { display: none !important; }

.icon { width: 16px; height: 16px; flex: none; fill: none; }
.icon-14 { width: 14px; height: 14px; }
.icon-18 { width: 18px; height: 18px; }
.icon-20 { width: 20px; height: 20px; }
.icon-28 { width: 28px; height: 28px; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.mono { font-family: var(--font-mono); font-size: .93em; }
.num { font-variant-numeric: tabular-nums; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.dim { color: var(--ink-3); }
.small { font-size: 12.5px; }
.strong { font-weight: 600; color: var(--ink); }
.break-all { word-break: break-all; }
/* 长地址：优先在斜杠处换行，整行都放不下时才在词内断开（break-all 会把仓库名从中间切开） */
.wrap-url { overflow-wrap: anywhere; }

/* 细滚动条 */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 3. 布局壳 ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100dvh; }

.side {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--ink-bg); color: var(--ink-fg);
  border-right: 1px solid var(--ink-line);
  z-index: 30;
  /* 深底上的强调色竖条换浅紫：正色 accent 在深紫底上亮度太接近，看不出来 */
  --accent: #a08eec;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  height: var(--top-h); padding: 0 14px; flex: none;
  color: var(--ink-fg);
  border-bottom: 1px solid var(--ink-line);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 28px; height: 28px; flex: none; border-radius: 7px;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #a08eec, #3e3689);
  color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28);
}
.brand-text { min-width: 0; line-height: 1.2; }
.brand-text b { display: block; font-size: 14.5px; font-weight: 600; letter-spacing: .01em; }
.brand-text small { display: block; font-size: 11.5px; color: var(--ink-fg-2); }

.nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-group {
  margin: 16px 0 6px; padding: 0 10px;
  font-size: 11.5px; color: var(--ink-fg-2); letter-spacing: .08em;
}
.nav-group:first-child { margin-top: 4px; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 10px; margin-bottom: 2px;
  border-radius: var(--r-ctl);
  color: var(--ink-fg-2); font-size: 13.5px;
  transition: background-color .12s var(--ease), color .12s var(--ease);
}
.nav-item:hover { background: var(--ink-bg-2); color: var(--ink-fg); text-decoration: none; }
.nav-item.is-active { background: var(--ink-bg-3); color: var(--ink-fg); font-weight: 500; }
.nav-item.is-active::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-item .icon { width: 17px; height: 17px; opacity: .9; }
.nav-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 9px;
  background: var(--warn); color: #fff; font-size: 11px; font-weight: 600;
}

.side-foot {
  flex: none; padding: 10px 14px; border-top: 1px solid var(--ink-line);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12px; color: var(--ink-fg-2);
}

/* 侧栏折叠：宽屏点顶栏按钮手动开关。状态记在 html[data-side] 上，
   由 layout 头部的内联脚本在渲染前设好，刷新不闪动。窄屏（≤820）抽屉模式下还原。 */
html[data-side="mini"] .app { grid-template-columns: var(--side-w-mini) minmax(0, 1fr); }
html[data-side="mini"] .brand { justify-content: center; padding: 0; }
html[data-side="mini"] .brand-text, html[data-side="mini"] .nav-item span,
html[data-side="mini"] .nav-group, html[data-side="mini"] .nav-badge,
html[data-side="mini"] .side-foot .ver-text { display: none; }
html[data-side="mini"] .nav-item { justify-content: center; padding: 0; }
html[data-side="mini"] .side-foot { justify-content: center; }
.js-side-toggle .i-unfold { display: none; }
html[data-side="mini"] .js-side-toggle .i-fold { display: none; }
html[data-side="mini"] .js-side-toggle .i-unfold { display: inline-block; }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--top-h); flex: none;
  display: flex; align-items: center; gap: 16px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.5) blur(12px);
  -webkit-backdrop-filter: saturate(1.5) blur(12px);
  border-bottom: 1px solid var(--line);
}
.menu-btn { display: none; }
/* 顶栏高度固定：窄屏放不下时当前页名用省略号收尾，不折行 */
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; }
.crumbs .sep { color: var(--ink-4); }
.crumbs .current { color: var(--ink); font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.content { flex: 1; padding: 24px 28px 56px; min-width: 0; }
/* 入场动画只保留「开始前」的填充（backwards），不要写 both：动画结束后变换会一直留在元素上，
   页面里相对视口定位的元素（下拉菜单）就改成相对它定位了 */
.page-root { animation: page-in .28s var(--ease) backwards; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 页头 */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-head h1 { font-size: 20px; line-height: 1.3; font-weight: 600; letter-spacing: 0; }
.page-head .sub { margin-top: 3px; font-size: 13px; color: var(--ink-3); }
.page-head .actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 栅格 */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main-side { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; }
.row-wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }

/* 响应式 */
@media (max-width: 1180px) {
  .app { grid-template-columns: var(--side-w-mini) minmax(0, 1fr); }
  .brand { justify-content: center; padding: 0; }
  .brand-text, .nav-item span, .nav-group, .nav-badge, .side-foot .ver-text { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .side-foot { justify-content: center; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main-side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: fixed; left: 0; top: 0; bottom: 0; width: var(--side-w);
    transform: translateX(-100%); transition: transform .24s var(--ease);
    box-shadow: var(--shadow-3);
  }
  .side.is-open { transform: none; }
  .brand { justify-content: flex-start; padding: 0 14px; }
  .brand-text, .nav-item span, .nav-group, .nav-badge, .side-foot .ver-text { display: block; }
  .nav-item { justify-content: flex-start; padding: 0 10px; }
  .side-foot { justify-content: space-between; }
  .menu-btn { display: inline-grid; }
  /* 抽屉模式下折叠态还原：抽屉固定 232px，折叠无意义 */
  html[data-side="mini"] .app { grid-template-columns: minmax(0, 1fr); }
  html[data-side="mini"] .brand { justify-content: flex-start; padding: 0 14px; }
  html[data-side="mini"] .brand-text, html[data-side="mini"] .nav-item span,
  html[data-side="mini"] .nav-group, html[data-side="mini"] .nav-badge,
  html[data-side="mini"] .side-foot .ver-text { display: block; }
  html[data-side="mini"] .nav-item { justify-content: flex-start; padding: 0 10px; }
  html[data-side="mini"] .side-foot { justify-content: space-between; }
  html[data-side="mini"] .js-side-toggle .i-fold { display: inline-block; }
  html[data-side="mini"] .js-side-toggle .i-unfold { display: none; }
  .js-side-toggle { display: none; }
  .content { padding: 16px 16px 48px; }
  .topbar { padding: 0 12px 0 8px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
}
.side-scrim { display: none; position: fixed; inset: 0; z-index: 25; background: rgba(9, 15, 24, .5); }
.side-scrim.is-open { display: block; }
@media (min-width: 821px) { .side-scrim { display: none !important; } }

/* ---------- 4. 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 13px;
  border: 1px solid transparent; border-radius: var(--r-ctl);
  font-size: 13.5px; font-weight: 500; line-height: 1; white-space: nowrap;
  transition: background-color .12s var(--ease), border-color .12s var(--ease), color .12s var(--ease), transform .08s var(--ease);
  user-select: none; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active:not(:disabled) { transform: scale(.975); }
.btn:disabled { opacity: .55; }
.btn .icon { width: 15px; height: 15px; }

.btn-primary { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg); }
.btn-primary:hover:not(:disabled) { background: var(--btn-bg-hover); border-color: var(--btn-bg-hover); }
.btn-accent { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn-accent:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: var(--surface); color: var(--ink-2); border-color: var(--line-strong); }
.btn-ghost:hover:not(:disabled) { color: var(--ink); border-color: var(--ink-4); background: var(--surface-2); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--danger-line); }
.btn-danger:hover:not(:disabled) { background: var(--danger-soft); }
.btn-danger-solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger-solid:hover:not(:disabled) { filter: brightness(.94); }
.btn-text { background: transparent; color: var(--ink-2); border-color: transparent; padding: 0 8px; }
.btn-text:hover:not(:disabled) { background: var(--surface-3); color: var(--ink); }
.btn-text.is-danger { color: var(--danger); }
.btn-text.is-danger:hover:not(:disabled) { background: var(--danger-soft); }

.btn-sm { height: 28px; padding: 0 9px; font-size: 12.5px; gap: 5px; }
.btn-sm .icon { width: 13px; height: 13px; }
.btn-lg { height: 40px; padding: 0 18px; font-size: 14.5px; }
.btn-icon { width: 34px; padding: 0; }
.btn-icon.btn-sm { width: 28px; }
.btn-icon.btn-lg { width: 40px; }

.btn.is-loading { color: transparent !important; pointer-events: none; position: relative; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  color: var(--btn-fg); animation: spin .7s linear infinite;
}
.btn-ghost.is-loading::after, .btn-text.is-loading::after, .btn-danger.is-loading::after { color: var(--ink-2); }
.btn-danger.is-loading::after { color: var(--danger); }

.spin { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-grid; place-items: center; width: 28px; height: 28px;
  border: 1px solid transparent; border-radius: var(--r-ctl); background: transparent; color: var(--ink-3);
  transition: background-color .12s var(--ease), color .12s var(--ease);
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn:active { transform: scale(.95); }
.icon-btn.is-on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.topbar .icon-btn { color: var(--ink-2); }
.topbar .icon-btn:hover { background: var(--surface-3); }
/* 主题按钮：浅色下显示月亮（点一下切到深色），深色下显示太阳 */
.js-theme .to-light { display: none; }
[data-theme="dark"] .js-theme .to-dark { display: none; }
[data-theme="dark"] .js-theme .to-light { display: block; }
.topbar .dropdown { display: inline-flex; }
.topbar .dropdown .menu { top: calc(100% + 5px); margin-top: 0; }

.link { color: var(--accent); cursor: pointer; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 5. 面板 ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-box);
  box-shadow: var(--shadow-1); min-width: 0;
}
.panel-head {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.panel-head .icon { color: var(--ink-3); }
.panel-head .hint { font-size: 12.5px; color: var(--ink-3); font-weight: 400; }
.panel-head .actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
/* 带放大镜的搜索框：图标固定在左侧，输入框给图标留出位置；宽度由所在位置决定 */
.search { position: relative; display: flex; flex: 0 0 auto; min-width: 0; }
.search > .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-4); pointer-events: none; }
.search .input { width: 100%; padding-left: 30px; }
.search.is-wide { width: 260px; }
.panel-head .search { flex: 0 0 200px; }
/* 窄屏（平板竖放及以下）：面板头部允许换成多行——说明文字另起一行；带页签的面板头，页签独占一行、放不下时横向滑动，操作区另起一行靠右 */
@media (max-width: 820px) {
  .panel-head { flex-wrap: wrap; row-gap: 8px; }
  .panel-head .hint { flex: 1 1 100%; order: 3; }
  .panel-head:has(> .tabs) > .tabs { flex: 1 0 100%; order: 1; overflow-x: auto; scrollbar-width: none; }
  .panel-head:has(> .tabs) > .tabs::-webkit-scrollbar { display: none; }
  .panel-head .tabs button { white-space: nowrap; }
  .panel-head:has(> .tabs) > .actions { order: 2; flex: 1 0 100%; margin-left: 0; justify-content: flex-end; }
}
/* 手机宽度：操作区里的搜索框占满这一行 */
@media (max-width: 640px) {
  .panel-head > .actions .search { flex: 1 1 auto; }
  .search.is-wide { width: auto; flex: 1 1 100%; }
}
.panel-body { padding: 16px; }
.panel-body.is-flush { padding: 0; }
.panel-foot { padding: 10px 16px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); }

/* 可点击的卡片（应用列表、集群卡片） */
.card-link {
  display: block; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-box);
  color: var(--ink); box-shadow: var(--shadow-1);
  transition: border-color .14s var(--ease), transform .14s var(--ease), box-shadow .14s var(--ease);
}
.card-link:hover { text-decoration: none; border-color: var(--accent-line); transform: translateY(-1px); box-shadow: var(--shadow-2); }

/* ---------- 6. 徽标与标签 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px; border-radius: var(--r-tag);
  font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap;
  border: 1px solid transparent;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge .icon { width: 12px; height: 12px; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.badge-muted { background: var(--muted-soft); color: var(--muted); border-color: var(--muted-line); }
.badge-accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.badge-plain { background: var(--surface-2); color: var(--ink-2); border-color: var(--line); }
/* 进行中：圆点呼吸，只用在真正在跑的状态上 */
.badge-live .dot { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* 点状状态（放在名称前面） */
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
.status-dot.ok { background: var(--ok); }
.status-dot.warn { background: var(--warn); }
.status-dot.danger { background: var(--danger); }
.status-dot.accent { background: var(--accent); }
.status-dot.live { animation: pulse 1.4s ease-in-out infinite; }

.chip {
  display: inline-flex; align-items: center; height: 20px; padding: 0 6px;
  border-radius: var(--r-tag); background: var(--surface-3); color: var(--ink-2);
  font-size: 11.5px; line-height: 1; white-space: nowrap;
}
.chip-mono { font-family: var(--font-mono); }
/* 生产环境标记：红底描边，提醒操作谨慎 */
.chip-prod { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger-line); }
.chip-dev { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-line); }

.code {
  font-family: var(--font-mono); font-size: .92em;
  padding: 1px 5px; border-radius: var(--r-tag);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2);
  word-break: break-all;
}

/* ---------- 7. 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
/* 标签文字与控件同在一个 label 里：标签按块级排，文字与「必填 / 选填」同行，控件另起一行 */
.field > label { display: block; cursor: text; }
.field > label > .input, .field > label > .select, .field > label > .textarea,
.field > label > .input-group, .field > label > .radio-cards, .field > label > .re { margin-top: 6px; }
.field > label > .input:hover, .field > label > .select:hover { cursor: text; }
.field-label .req { color: var(--danger); margin-left: 2px; }
.field-label .opt { color: var(--ink-4); font-weight: 400; margin-left: 4px; font-size: 12px; }
.help { font-size: 12.5px; color: var(--ink-3); line-height: 1.6; }
.error-text { font-size: 12.5px; color: var(--danger); display: flex; align-items: center; gap: 4px; }
.error-text .icon { width: 13px; height: 13px; }

.input, .select, .textarea {
  width: 100%; min-width: 0;
  height: 34px; padding: 0 10px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--r-ctl);
  font-size: 13.5px; transition: border-color .12s var(--ease), box-shadow .12s var(--ease);
}
.textarea { height: auto; min-height: 76px; padding: 7px 10px; line-height: 1.7; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.input:hover:not(:disabled), .select:hover:not(:disabled), .textarea:hover:not(:disabled) { border-color: var(--ink-4); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input:disabled, .select:disabled, .textarea:disabled { background: var(--surface-2); color: var(--ink-3); }
.input.is-error, .select.is-error, .textarea.is-error { border-color: var(--danger); }
.input.is-error:focus, .select.is-error:focus, .textarea.is-error:focus { box-shadow: 0 0 0 3px var(--danger-soft); }
.input.mono, .textarea.mono { font-family: var(--font-mono); font-size: 13px; }
.input-sm { height: 28px; font-size: 12.5px; padding: 0 8px; }

.select {
  appearance: none; -webkit-appearance: none; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 14px, calc(100% - 10px) 14px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}

/* 带前后缀的输入框 */
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: var(--r-ctl) 0 0 var(--r-ctl); }
.input-group .suffix, .input-group .prefix {
  display: inline-flex; align-items: center; padding: 0 10px; flex: none;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink-3); font-size: 12.5px;
}
.input-group .prefix { order: -1; border-radius: var(--r-ctl) 0 0 var(--r-ctl); }
.input-group .prefix + .input { border-radius: 0; border-left: none; }
.input-group .suffix { border-radius: 0 var(--r-ctl) var(--r-ctl) 0; border-left: none; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }

.check { display: inline-flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; line-height: 1.5; }
.check input { width: 15px; height: 15px; margin: 2px 0 0; accent-color: var(--accent); flex: none; cursor: pointer; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--ink-2); user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 32px; height: 18px; border-radius: 9px; background: var(--line-strong); flex: none; position: relative;
  transition: background-color .16s var(--ease);
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .16s var(--ease);
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.radio-card {
  position: relative; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-ctl);
  background: var(--surface); cursor: pointer; transition: border-color .12s var(--ease), background-color .12s var(--ease);
}
.radio-card:hover { border-color: var(--ink-4); }
.radio-card input { position: absolute; opacity: 0; }
.radio-card b { display: block; font-size: 13.5px; font-weight: 500; color: var(--ink); }
.radio-card small { display: block; font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.radio-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 8. 分段控件与页签 ---------- */
.seg {
  display: inline-flex; gap: 2px; padding: 2px;
  background: var(--surface-3); border-radius: var(--r-ctl);
}
.seg button {
  height: 28px; padding: 0 12px; border: 0; border-radius: 4px; background: transparent;
  color: var(--ink-2); font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: background-color .12s var(--ease), color .12s var(--ease);
}
.seg button:hover { color: var(--ink); }
.seg button.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.seg button:focus-visible { outline-offset: 0; }
/* 生产环境：选中时用红色强调，提醒当前在操作生产资源 */
.seg.seg-env button.is-active.is-prod { background: var(--danger-soft); color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger-line); }

.tabs { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--line); }
.tabs button {
  position: relative; height: 38px; padding: 0 12px; margin-bottom: -1px;
  border: 0; border-bottom: 2px solid transparent; background: transparent;
  color: var(--ink-3); font-size: 13.5px; font-weight: 500;
  transition: color .12s var(--ease), border-color .12s var(--ease);
}
.tabs button:hover { color: var(--ink); }
.tabs button.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.tabs button .count { margin-left: 5px; font-size: 12px; color: var(--ink-4); font-weight: 400; }
.tabs button:focus-visible { outline-offset: -2px; border-radius: 0; }

/* ---------- 9. 工具条与表格 ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar .search { position: relative; width: 240px; }
.toolbar .search .icon { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--ink-4); width: 14px; height: 14px; pointer-events: none; }
.toolbar .search .input { padding-left: 29px; }
.toolbar .select { width: auto; min-width: 120px; }
.toolbar .spacer { flex: 1; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table th {
  position: sticky; top: 0; z-index: 1;
  padding: 9px 14px; text-align: left; vertical-align: middle;
  font-size: 12px; font-weight: 500; color: var(--ink-3); white-space: nowrap;
  background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.table td {
  padding: 10px 14px; vertical-align: middle; color: var(--ink-2);
  border-bottom: 1px solid var(--line);
}
.table tbody tr { transition: background-color .1s var(--ease); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .cell-main { color: var(--ink); font-weight: 500; }
.table .cell-sub { display: block; font-size: 12px; color: var(--ink-3); font-weight: 400; margin-top: 1px; }
.table .cell-actions { text-align: right; white-space: nowrap; }
.table .cell-actions .btn-text, .table .cell-actions .icon-btn { opacity: .72; }
.table tbody tr:hover .cell-actions .btn-text, .table tbody tr:hover .cell-actions .icon-btn,
.table .cell-actions .btn-text:focus-visible, .table .cell-actions .icon-btn:focus-visible { opacity: 1; }
.table td.num, .table th.num { text-align: right; }
.table .is-missing .cell-main { color: var(--danger); text-decoration: line-through; }
/* 定宽表：列宽按表头给的宽度固定，没给宽度的列平分剩余空间。
   用在面板较窄、列又多的表上：长内容在格内省略，表不会横向溢出 */
.table.table-fixed { table-layout: fixed; }
.table-fixed th, .table-fixed td { overflow: hidden; }
.table-fixed .ellipsis { display: block; }

/* 键值清单 */
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 16px; font-size: 13px; }
.kv dt { color: var(--ink-3); white-space: nowrap; }
.kv dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }

.list { display: flex; flex-direction: column; }
.list-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 16px;
  border-bottom: 1px solid var(--line); font-size: 13px; transition: background-color .1s var(--ease);
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--surface-2); }
.list-row.is-clickable { cursor: pointer; }

/* 分页 */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; row-gap: 8px; font-size: 12.5px; color: var(--ink-3); }
.pager button {
  min-width: 28px; height: 28px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--r-ctl);
  background: var(--surface); color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.pager button:hover:not(:disabled) { border-color: var(--line-strong); color: var(--ink); }
.pager button.is-active { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-fg); }
.pager button:disabled { opacity: .45; }
.pager .gap { color: var(--ink-4); padding: 0 2px; }

/* ---------- 10. 提示条 ---------- */
.alert {
  display: flex; align-items: flex-start; gap: 9px; padding: 10px 13px;
  border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface-2);
  font-size: 13px; color: var(--ink-2); line-height: 1.6;
}
.alert .icon { width: 15px; height: 15px; margin-top: 3px; flex: none; }
.alert .alert-body { flex: 1; min-width: 0; }
.alert b { color: var(--ink); font-weight: 600; }
.alert-info { background: var(--accent-soft); border-color: var(--accent-line); }
.alert-info .icon { color: var(--accent); }
.alert-warn { background: var(--warn-soft); border-color: var(--warn-line); }
.alert-warn .icon { color: var(--warn); }
.alert-danger { background: var(--danger-soft); border-color: var(--danger-line); }
.alert-danger .icon { color: var(--danger); }
.alert-ok { background: var(--ok-soft); border-color: var(--ok-line); }
.alert-ok .icon { color: var(--ok); }

/* ---------- 11. 空态与骨架 ---------- */
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 24px; text-align: center; }
.empty .icon { width: 34px; height: 34px; color: var(--ink-4); stroke-width: 1.25; }
.empty .empty-title { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.empty .empty-hint { font-size: 13px; color: var(--ink-3); max-width: 420px; line-height: 1.7; }

.skeleton {
  position: relative; overflow: hidden; border-radius: var(--r-ctl); background: var(--surface-3);
}
.skeleton::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 70%, transparent), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-line { height: 13px; }
.sk-title { height: 18px; width: 38%; }
.sk-block { height: 84px; border-radius: var(--r-box); }

/* ---------- 12. 抽屉与弹窗 ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(9, 15, 24, .48);
  animation: fade-in .18s var(--ease) both;
}
.overlay.is-closing { animation: fade-out .14s var(--ease-in) both; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }

.modal {
  position: fixed; z-index: 101; left: 50%; top: 12vh; transform: translateX(-50%);
  width: min(480px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-box);
  box-shadow: var(--shadow-3);
  animation: modal-in .2s var(--ease) both;
}
.modal.is-closing { animation: modal-out .14s var(--ease-in) both; }
@keyframes modal-in { from { opacity: 0; transform: translate(-50%, -8px) scale(.985); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes modal-out { from { opacity: 1; transform: translate(-50%, 0) scale(1); } to { opacity: 0; transform: translate(-50%, -6px) scale(.985); } }
.modal-lg { width: min(720px, calc(100vw - 32px)); }

.modal-head { display: flex; align-items: center; gap: 10px; padding: 15px 20px 0; }
.modal-head h3 { font-size: 15.5px; font-weight: 600; flex: 1; min-width: 0; }
.modal-head .icon-btn { margin: -4px -6px -4px 0; }
.modal-body { padding: 14px 20px; font-size: 13.5px; color: var(--ink-2); line-height: 1.7; max-height: 68vh; overflow-y: auto; }
.modal-body .alert { margin-bottom: 12px; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 0 20px 18px; }
.modal-icon {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2);
}
.modal-icon .icon { width: 19px; height: 19px; }
.modal-icon.is-danger { background: var(--danger-soft); color: var(--danger); }
.modal-icon.is-warn { background: var(--warn-soft); color: var(--warn); }
.modal-icon.is-ok { background: var(--ok-soft); color: var(--ok); }
.modal-icon.is-info { background: var(--accent-soft); color: var(--accent); }

.drawer {
  position: fixed; z-index: 101; top: 0; right: 0; bottom: 0;
  width: min(540px, 100vw);
  /* 调用处方指定了宽度时是写在行内样式里的（如编辑部署配置的 720px）：再宽也不能超出视口 */
  max-width: 100vw;
  display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-3);
  /* 同 .page-root：只保留「开始前」的填充，抽屉里的下拉菜单才能相对视口定位 */
  animation: drawer-in .24s var(--ease) backwards;
}
.drawer.is-closing { animation: drawer-out .16s var(--ease-in) both; }
@keyframes drawer-in { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes drawer-out { from { transform: none; opacity: 1; } to { transform: translateX(28px); opacity: 0; } }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); flex: none; }
.drawer-head h3 { font-size: 15.5px; font-weight: 600; flex: 1; min-width: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); flex: none; background: var(--surface); }
.drawer-foot .left { margin-right: auto; }
/* 抽屉里的表单：正文区滚动，底部按钮固定 */
.drawer-body.is-form { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.drawer-form { display: flex; flex-direction: column; flex: 1; min-height: 100%; }
.drawer-form-body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer-form .drawer-foot { position: sticky; bottom: 0; }

/* ---------- 13. 下拉菜单 ---------- */
.dropdown { position: relative; display: inline-flex; }
.menu {
  /* 定位默认「跟着按钮走」；下拉菜单组件打开时会按触发按钮与视口改写成相对视口定位（见 components.js 的 menuPosition） */
  position: absolute; z-index: 110; min-width: 180px; max-width: 300px; max-height: calc(100vh - 16px); overflow-y: auto; margin-top: 5px;
  padding: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-box);
  box-shadow: var(--shadow-2); animation: menu-in .13s var(--ease) both;
}
.menu-right { right: 0; }
.menu-left { left: 0; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.menu button, .menu a {
  display: flex; align-items: center; gap: 8px; width: 100%;
  height: 31px; padding: 0 9px; border: 0; border-radius: 4px; background: transparent;
  color: var(--ink-2); font-size: 13px; text-align: left; text-decoration: none;
}
.menu button:hover, .menu a:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.menu button.is-danger, .menu a.is-danger { color: var(--danger); }
.menu button.is-danger:hover { background: var(--danger-soft); }
.menu button:disabled { color: var(--ink-4); }
.menu .icon { width: 14px; height: 14px; color: var(--ink-3); }
.menu .menu-sep { height: 1px; margin: 5px 4px; background: var(--line); }
.menu .menu-label { padding: 6px 9px 3px; font-size: 11.5px; color: var(--ink-4); }

/* ---------- 14. 轻提示 ---------- */
.toasts {
  position: fixed; z-index: 200; left: 50%; top: 18px; transform: translateX(-50%);
  /* 定位在左半边、再平移到中间：不写宽度的话，按「剩余空间」算宽度，只有视口的一半，窄屏上提示会被挤成细细一条 */
  width: max-content; max-width: calc(100vw - 32px);
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
}
.toast {
  display: inline-flex; align-items: center; gap: 8px;
  max-width: min(560px, calc(100vw - 32px)); padding: 9px 14px;
  border-radius: var(--r-ctl); background: var(--ink-bg); color: var(--ink-fg);
  font-size: 13px; line-height: 1.5; box-shadow: var(--shadow-2);
  animation: toast-in .22s var(--ease) both; pointer-events: auto;
}
.toast.is-closing { animation: toast-out .18s var(--ease-in) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { from { opacity: 1; } to { opacity: 0; transform: translateY(-6px); } }
.toast .icon { width: 15px; height: 15px; flex: none; }
.toast-ok .icon { color: #6fd598; }
.toast-error .icon { color: #f28b82; }
.toast-warn .icon { color: #f0c070; }
.toast-info .icon { color: #8fb0ff; }
.toast .toast-msg { min-width: 0; overflow-wrap: anywhere; }

/* ---------- 15. 步骤条 ---------- */
.stepper { display: flex; align-items: center; gap: 0; width: 100%; }
.step { display: flex; align-items: center; gap: 8px; flex: none; color: var(--ink-4); font-size: 13px; }
.step .step-dot {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  border: 1.5px solid var(--line-strong); background: var(--surface);
  font-size: 12px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums;
}
.step .step-dot .icon { width: 13px; height: 13px; }
.step.is-current { color: var(--ink); font-weight: 500; }
.step.is-current .step-dot { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.step.is-done { color: var(--ink-2); }
.step.is-done .step-dot { border-color: var(--ok); background: var(--ok); color: #fff; }
.step.is-done.is-clickable { cursor: pointer; }
.step.is-done.is-clickable:hover { color: var(--accent); }
.step-line { flex: 1; height: 1.5px; margin: 0 12px; min-width: 24px; background: var(--line-strong); }
.step-line.is-done { background: var(--ok); }

/* 竖向的流程清单（部署阶段） */
.flow { display: flex; flex-direction: column; gap: 0; }
.flow-item { position: relative; display: flex; gap: 10px; padding-bottom: 14px; font-size: 13px; color: var(--ink-3); }
.flow-item:last-child { padding-bottom: 0; }
.flow-item::before {
  content: ""; position: absolute; left: 8px; top: 18px; bottom: 0; width: 1.5px; background: var(--line);
}
.flow-item:last-child::before { display: none; }
.flow-item .flow-dot {
  width: 17px; height: 17px; margin-top: 2px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--line-strong); background: var(--surface); display: grid; place-items: center;
}
.flow-item .flow-dot .icon { width: 10px; height: 10px; }
.flow-item.is-done { color: var(--ink-2); }
.flow-item.is-done .flow-dot { border-color: var(--ok); background: var(--ok); color: #fff; }
.flow-item.is-current { color: var(--ink); font-weight: 500; }
.flow-item.is-current .flow-dot { border-color: var(--accent); color: var(--accent); }
.flow-item.is-failed { color: var(--danger); }
.flow-item.is-failed .flow-dot { border-color: var(--danger); color: var(--danger); }
.flow-item .flow-sub { display: block; font-size: 12px; color: var(--ink-3); font-weight: 400; margin-top: 1px; }

/* ---------- 16. 终端 ---------- */
.term {
  position: relative; display: flex; flex-direction: column; min-height: 0;
  background: var(--term-bg); border: 1px solid var(--term-line); border-radius: var(--r-box); overflow: hidden;
}
.term-head {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px 0 14px; flex: none;
  background: var(--term-head); border-bottom: 1px solid var(--term-line); color: var(--term-dim);
}
.term-head .term-title { font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 7px; }
.term-head .spacer { flex: 1; }
.term .icon-btn { color: var(--term-dim); }
.term .icon-btn:hover { background: var(--term-line); color: var(--term-fg); }
.term .icon-btn.is-on { background: var(--term-line); color: var(--term-sys); }
.term-body {
  flex: 1; min-height: 0; overflow-y: auto; padding: 10px 0 12px;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.72; color: var(--term-fg);
  overscroll-behavior: contain;
}
.term-body.is-wrap .tl-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.tl { display: flex; align-items: flex-start; min-height: 21px; padding: 0 14px 0 12px; white-space: pre; }
.tl:hover { background: rgba(255, 255, 255, .035); }
.tl-time { flex: none; width: 66px; color: var(--term-dim); user-select: none; }
.tl-stage { flex: none; width: 58px; color: var(--term-dim); user-select: none; overflow: hidden; text-overflow: ellipsis; }
.tl-text { flex: 1; min-width: 0; }
.tl-stdout .tl-text { color: var(--term-fg); }
.tl-stderr .tl-text { color: var(--term-err); }
.tl-status .tl-text { color: var(--term-dim); }
.tl-system .tl-text { color: var(--term-sys); }
.tl-system.is-mark .tl-text { font-weight: 600; }
.tl-system.is-ok .tl-text { color: var(--term-ok); }
.tl-system.is-fail .tl-text { color: var(--term-err); }
.term-empty { padding: 26px 14px; color: var(--term-dim); text-align: center; font-family: var(--font-sans); font-size: 13px; }
/* 光标行：任务进行中在末尾闪烁 */
.tl-cursor { display: inline-block; width: 7px; height: 14px; margin-top: 4px; vertical-align: top; background: var(--term-sys); animation: caret 1.1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
/* 贴在终端底部内侧（终端自己是固定高度的盒子，内容在里面滚动） */
.term-jump {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px;
  border: 1px solid var(--term-line); border-radius: 13px; background: var(--term-head); color: var(--term-fg);
  font-family: var(--font-sans); font-size: 12px; box-shadow: var(--shadow-2);
}
.term-jump:hover { border-color: var(--term-sys); color: var(--term-sys); }

/* ---------- 17. 密码展示 ---------- */
.secret {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: var(--r-ctl); background: var(--surface-2);
}
.secret code {
  flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 13px; color: var(--ink);
  overflow-wrap: anywhere; user-select: all;
}
.secret.is-hidden code { filter: blur(5px); user-select: none; }

/* ---------- 18. 统计块（仪表盘） ---------- */
.stat { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-box); box-shadow: var(--shadow-1); min-width: 0; }
.stat .stat-label { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.stat .stat-label .icon { width: 14px; height: 14px; color: var(--ink-4); }
.stat .stat-value { margin-top: 6px; font-size: 27px; line-height: 1.15; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.stat .stat-value small { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 3px; letter-spacing: 0; }
.stat .stat-sub { margin-top: 5px; font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stat.is-link:hover { border-color: var(--accent-line); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.stat.is-link { transition: border-color .14s var(--ease), transform .14s var(--ease), box-shadow .14s var(--ease); color: inherit; }
.stat.is-link:hover { text-decoration: none; }

/* 迷你进度条：有刻度感，不用粗底槽 */
.meter { position: relative; height: 4px; margin-top: 10px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: var(--ink-4); }
.meter i.ok { background: var(--ok); } .meter i.warn { background: var(--warn); } .meter i.danger { background: var(--danger); } .meter i.accent { background: var(--accent); }

/* 键值行（小信息列表） */
.info-list { display: flex; flex-direction: column; }
.info-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.info-row:last-child { border-bottom: 0; }
.info-row .k { color: var(--ink-3); flex: none; }
.info-row .v { color: var(--ink); min-width: 0; text-align: right; overflow-wrap: anywhere; }

/* 时间线（最近动态） */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.tl-item:last-child { border-bottom: 0; }
.tl-item .icon { width: 15px; height: 15px; margin-top: 2px; flex: none; color: var(--ink-4); }
.tl-item .tl-main { flex: 1; min-width: 0; color: var(--ink-2); line-height: 1.55; overflow-wrap: anywhere; }
.tl-item .tl-meta { flex: none; font-size: 12px; color: var(--ink-4); }

/* ---------- 19. 登录页 ---------- */
.login {
  min-height: 100dvh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 480px at 12% -10%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%),
    radial-gradient(700px 420px at 100% 110%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 60%),
    var(--bg);
}
.login-card {
  width: min(400px, 100%); padding: 32px 32px 28px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-2);
  animation: page-in .32s var(--ease) backwards;
}
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.login-card h1 { font-size: 19px; font-weight: 600; line-height: 1.35; }
.login-card .login-sub { margin: 4px 0 20px; font-size: 13px; color: var(--ink-3); }
.login-qr { display: grid; place-items: center; padding: 14px; margin: 4px 0 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-box); }
.login-qr img { width: 190px; height: 190px; image-rendering: pixelated; }
/* 密钥 32 位：4 位一组放进一个虚线框，宽度不够时在组与组之间折行（两侧均衡），不会从中间断开 */
.login-secret { margin-bottom: 16px; text-align: center; }
.login-secret .login-hint { display: block; margin-bottom: 8px; }
.login-secret .copyable {
  /* 左侧留出与右侧「复制」按钮等宽的位置，密钥整体才是居中的 */
  display: flex; width: 100%; padding: 9px 10px 9px calc(10px + 26px);
  border: 1px dashed var(--line-strong); border-radius: var(--r-ctl); background: var(--surface-2);
}
.login-secret .copyable .text { flex: 1; font-size: 13px; line-height: 1.7; letter-spacing: .02em; text-wrap: balance; user-select: all; }
.login-secret .copyable .icon-btn { flex: none; }
/* 对话框里的二维码与密钥（换绑验证器）：比登录页收紧一些 */
.dialog-qr { display: grid; place-items: center; padding: 10px; margin-bottom: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-box); }
.dialog-qr img { width: 168px; height: 168px; image-rendering: pixelated; }
.login-secret-compact { margin-bottom: 14px; }
.login-secret-compact.login-secret .copyable { padding-top: 7px; padding-bottom: 7px; }
.login-secret-compact .copyable .text { font-size: 12.5px; }
.otp-input { text-align: center; font-family: var(--font-mono); font-size: 22px; letter-spacing: .6em; padding-left: calc(10px + .6em); height: 48px; }
.login-foot { margin-top: 14px; text-align: center; font-size: 12px; color: var(--ink-4); }

/* ---------- 20. 其它 ---------- */
.copyable { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.copyable .text { min-width: 0; overflow-wrap: anywhere; }
.copyable .icon-btn { width: 22px; height: 22px; }
.copyable .icon-btn .icon { width: 13px; height: 13px; }

.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 600;
}
.user-menu { display: inline-flex; align-items: center; flex: none; white-space: nowrap; gap: 8px; height: 34px; padding: 0 8px 0 4px; border: 0; border-radius: 17px; background: transparent; color: var(--ink-2); font-size: 13px; }
.user-menu:hover { background: var(--surface-3); color: var(--ink); }

.divider { height: 1px; margin: 16px 0; background: var(--line); }
.section-title { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.section-title .icon { color: var(--ink-3); width: 15px; height: 15px; }

.truncate-1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- 21. 仪表盘 ---------- */
.dash { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.span-3 { grid-column: span 3; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-12 { grid-column: span 12; }
@media (max-width: 1180px) {
  .span-3, .span-5, .span-6, .span-7 { grid-column: span 6; }
}
@media (max-width: 820px) {
  .span-3, .span-5, .span-6, .span-7 { grid-column: span 12; }
}

.dash-big { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dash-big b { font-size: 30px; font-weight: 600; line-height: 1.1; letter-spacing: -.01em; color: var(--ink); margin-right: 2px; }
.ml-8 { margin-left: 8px; }
.is-clickable { cursor: pointer; }
/* 整行可点击、也能用键盘聚焦的表格行：焦点框画在行内，不压到相邻的行上 */
tr.is-clickable:focus-visible { outline-offset: -2px; border-radius: 0; }

/* 按占比着色的分段条（应用状态分布） */
.segbar { display: flex; height: 8px; margin-top: 16px; border-radius: 4px; overflow: hidden; background: var(--surface-3); }
.segbar i { display: block; height: 100%; transition: width .4s var(--ease); }
.segbar i + i { box-shadow: inset 1px 0 0 var(--surface); }
.segbar i.ok, .legend i.ok { background: var(--ok); }
.segbar i.accent, .legend i.accent { background: var(--accent); }
.segbar i.danger, .legend i.danger { background: var(--danger); }
.segbar i.muted, .legend i.muted { background: var(--ink-4); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

.mini-list { margin-top: 12px; display: flex; flex-direction: column; }
.mini-row { display: flex; align-items: center; gap: 8px; height: 30px; font-size: 13px; color: var(--ink-2); border-bottom: 1px dashed var(--line); }
.mini-row:last-child { border-bottom: 0; }
.mini-row .icon { width: 14px; height: 14px; }

.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.mini-stats > div { display: flex; flex-direction: column; }
.mini-stats span { font-size: 12.5px; }
.mini-stats b { font-size: 22px; font-weight: 600; line-height: 1.2; color: var(--ink); }

/* 外部依赖分组与状态卡片 */
.hgroup { padding: 14px 16px 8px; }
.hgroup + .hgroup { border-top: 1px solid var(--line); }
.hgroup-title { font-size: 12.5px; color: var(--ink-3); margin-bottom: 10px; }
.htiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.htile { padding: 12px 13px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface-2); min-width: 0; }
.htile.is-bad { border-color: var(--danger-line); background: var(--danger-soft); }
.htile.is-off { border-style: dashed; background: transparent; }
.htile-top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.htile-top > .icon { width: 16px; height: 16px; color: var(--ink-2); }
.htile-top b { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.htile-sub { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); }
.htile-detail { margin-top: 7px; font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.htile-foot { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: 12px; }

.meters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 28px; }
.meter-item { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.meter-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12.5px; color: var(--ink-3); }
.meter-label b { font-size: 14px; color: var(--ink); font-weight: 600; white-space: nowrap; }
.meter-item .meter { margin-top: 4px; }
@media (max-width: 1180px) { .meters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- 22. 行编辑器（授权 / 环境变量 / 挂载） ---------- */
.re { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface-2); }
.re-row { display: flex; align-items: center; gap: 6px; }
.re-row-wrap { flex-wrap: wrap; }
.re-row .input, .re-row .select { height: 30px; font-size: 12.5px; background: var(--surface); }
.re-row .select { flex: 1; min-width: 0; }
.re-sm { flex: 0 0 118px !important; }
.re-key { flex: 0 0 32%; }
.re-host { flex: 1 1 45%; }
.re-val { flex: 1 1 36%; }
.re-row .check { padding: 0 4px; white-space: nowrap; }
.re-err { flex-basis: 100%; padding-left: 2px; }
.re-empty { padding: 8px 2px; font-size: 12.5px; color: var(--ink-4); }
.re-foot { display: flex; align-items: center; gap: 8px; }

/* ---------- 23. 资源管理 ---------- */
.cluster-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.cluster-card {
  display: flex; flex-direction: column; gap: 8px; padding: 13px 14px; min-width: 0; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-box); box-shadow: var(--shadow-1);
  color: var(--ink); font: inherit; transition: border-color .14s var(--ease), transform .14s var(--ease), box-shadow .14s var(--ease);
}
.cluster-card:hover { border-color: var(--accent-line); transform: translateY(-1px); box-shadow: var(--shadow-2); }
.cluster-card.is-active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cluster-card.is-bad { border-color: var(--danger-line); }
.cluster-card.is-bad.is-active { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.cluster-card.is-off { border-style: dashed; box-shadow: none; }
.cluster-card-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cluster-card-top .icon { width: 17px; height: 17px; color: var(--ink-2); }
.cluster-card-top b { font-size: 14px; font-weight: 600; }
.cluster-card-top .spacer { flex: 1; }
.cluster-card-addr { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cluster-card-detail { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cluster-card-foot { display: flex; gap: 10px; font-size: 12px; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.cluster-card-foot .mono { color: var(--ink-3); }
@media (max-width: 1180px) { .cluster-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) { .cluster-strip { grid-template-columns: minmax(0, 1fr); } }

.env-alert { margin-bottom: 14px; }

.panel-head .tabs { border-bottom: 0; margin-bottom: 0; }
.panel-head .tabs button { height: 46px; }
.grants { display: flex; flex-wrap: wrap; gap: 4px; max-width: 420px; }
.grant { display: inline-flex; align-items: center; height: 21px; padding: 0 7px; border-radius: var(--r-tag); border: 1px solid var(--line); background: var(--surface-2); font-size: 12px; color: var(--ink-2); }
.grant .mono { color: var(--ink); }
.grant i { font-style: normal; margin-left: 5px; color: var(--ink-3); }
.grant.is-missing { border-color: var(--danger-line); background: var(--danger-soft); color: var(--danger); }
.grant.is-missing i { color: var(--danger); }
.src { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.src .icon { width: 12px; height: 12px; }

/* ---------- 24. 部署配置表单 ---------- */
.dcf-preview { border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface-2); overflow: hidden; }
.dcf-preview-head { display: flex; align-items: center; gap: 6px; padding: 7px 11px; font-size: 12px; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.dcf-preview-head .icon { width: 13px; height: 13px; }
.dcf-preview pre { margin: 0; padding: 10px 12px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.dcf-adv { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 9px; border: 1px dashed var(--line-strong); border-radius: var(--r-ctl); background: transparent; color: var(--ink-2); font-size: 12.5px; }
.dcf-adv:hover { border-color: var(--ink-4); color: var(--ink); }
.radio-card.is-on { border-color: var(--accent); }
.dcf.is-compact .section-title { margin-top: 2px; }
.dcf.is-compact .mt-24 { margin-top: 18px; }
.dcf .section-title { margin-bottom: 10px; }

/* ---------- 25. 应用列表 ---------- */
/* 卡片最小宽 352 像素；窄屏放不下时允许缩到与内容区同宽，不横向溢出 */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(352px, 100%), 1fr)); gap: 14px; }
.app-card {
  position: relative; display: flex; flex-direction: column; min-width: 0; padding: 15px 16px 11px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-box); box-shadow: var(--shadow-1); color: var(--ink);
  transition: border-color .14s var(--ease), transform .14s var(--ease), box-shadow .14s var(--ease);
}
.app-card:hover { text-decoration: none; border-color: var(--accent-line); transform: translateY(-1px); box-shadow: var(--shadow-2); }
.app-card.is-bad { border-color: var(--danger-line); }
.app-card-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.app-card-top h3 { font-size: 15px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-card-top .spacer { flex: 1; }
.app-card-repo { margin-top: 3px; font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-card-repo .icon { display: inline-block; vertical-align: -2px; width: 12px; height: 12px; margin-right: 3px; }
.app-card-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 14px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.fact { min-width: 0; }
.fact .k { font-size: 11.5px; color: var(--ink-4); }
.fact .v { margin-top: 1px; font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fact .v.mono { font-size: 12.5px; }
.app-card-foot { display: flex; align-items: center; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.app-card-foot .time { margin-right: auto; font-size: 12px; color: var(--ink-4); }
.app-card-foot .time.is-danger { color: var(--danger); }
.app-card .btn-text.is-danger { color: var(--danger); }
.app-card .btn-text.is-danger:hover:not(:disabled) { background: var(--danger-soft); }

/* ---------- 26. 创建向导 ---------- */
.wizard { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 24px; max-width: 1120px; align-items: start; }
.wz-side { position: sticky; top: calc(var(--top-h) + 24px); }
.wz-steps { display: flex; flex-direction: column; gap: 4px; }
.wz-step { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid transparent; border-radius: var(--r-ctl); background: transparent; color: var(--ink-3); font-size: 13.5px; text-align: left; }
.wz-step small { display: block; font-size: 12px; font-weight: 400; color: var(--ink-4); margin-top: 1px; }
.wz-step .step-dot { width: 26px; height: 26px; }
.wz-step.is-current { background: var(--surface); border-color: var(--line); color: var(--ink); font-weight: 500; box-shadow: var(--shadow-1); }
.wz-step.is-done { color: var(--ink-2); cursor: pointer; }
.wz-step.is-done:hover { color: var(--accent); }
.wz-step:disabled { cursor: default; }
.wz-app { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-box); background: var(--surface); font-size: 13px; }
.wz-app b { font-size: 14px; }
.wz-app .mono { font-size: 12px; color: var(--ink-3); }
.wz-app .dim { margin-top: 2px; font-size: 12.5px; }
.wz-main { min-width: 0; }
.wz-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-box); box-shadow: var(--shadow-1); }
.wz-card-head { padding: 20px 24px 0; }
.wz-card-head h2 { font-size: 17px; font-weight: 600; }
.wz-card-head p { margin-top: 5px; max-width: 64ch; font-size: 13px; line-height: 1.7; color: var(--ink-3); }
.wz-card-body { padding: 20px 24px 22px; }
.wz-card-foot { display: flex; align-items: center; gap: 8px; padding: 13px 24px; border-top: 1px solid var(--line); border-radius: 0 0 var(--r-box) var(--r-box); background: var(--surface-2); }
.wz-card-foot .note { margin-right: auto; font-size: 12.5px; color: var(--ink-3); }
.wz-done { padding: 44px 24px; text-align: center; }
.done-icon { width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.done-icon .icon { width: 26px; height: 26px; }
.wz-done h2 { font-size: 18px; font-weight: 600; }
.wz-done p { margin: 6px auto 18px; max-width: 52ch; font-size: 13px; line-height: 1.7; color: var(--ink-3); }
.path-preview { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: var(--r-ctl); background: var(--surface-2); font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); }
.path-preview b { color: var(--ink); font-weight: 500; }
.path-preview .is-new { color: var(--accent); }
.path-preview .sep { margin: 0 5px; color: var(--ink-4); }
.mode-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.mode-btn { height: 30px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 15px; background: var(--surface); color: var(--ink-2); font-size: 12.5px; }
.mode-btn:hover { border-color: var(--ink-4); color: var(--ink); }
.mode-btn.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 500; }
/* 向导里已经做完、不能再改的一步：用 fieldset 的原生禁用连带里面的输入框与按钮（只是置灰，看得出当时怎么选的） */
.wz-lock { min-width: 0; margin: 0; padding: 0; border: 0; }
.wz-lock:disabled .mode-btn { cursor: default; }
.wz-lock:disabled .mode-btn:not(.is-on) { opacity: .5; }
@media (max-width: 960px) {
  .wizard { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .wz-side { position: static; }
  .wz-steps { flex-direction: row; overflow-x: auto; }
  .wz-step { width: auto; white-space: nowrap; }
  .wz-step small, .wz-app { display: none; }
  .wz-card-head, .wz-card-body { padding-left: 16px; padding-right: 16px; }
}

/* ---------- 27. 应用首页 ---------- */
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 10px; font-size: 13px; color: var(--ink-3); }
.back:hover { color: var(--accent); text-decoration: none; }
.detail-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.detail-title { min-width: 0; }
.detail-title h1 { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 21px; font-weight: 600; line-height: 1.3; }
.detail-title .sub { margin-top: 3px; font-size: 13px; color: var(--ink-3); }
.detail-head .actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-left: auto; }
.stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-box); box-shadow: var(--shadow-1); }
.stat-cell { min-width: 0; padding: 14px 16px; border-left: 1px solid var(--line); }
.stat-cell:first-child { border-left: 0; }
.stat-cell .k { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }
.stat-cell .v { margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; font-weight: 500; color: var(--ink); }
.stat-cell .v small { margin-left: 4px; font-size: 12px; font-weight: 400; color: var(--ink-3); }
.stat-cell .s { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--ink-4); }
.live-nums { display: flex; gap: 14px; }
.live-num b { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.live-num span { font-size: 11.5px; color: var(--ink-4); }
@media (max-width: 1180px) {
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-cell:nth-child(3) { border-left: 0; }
  .stat-cell:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 820px) {
  .stat-strip { grid-template-columns: minmax(0, 1fr); }
  .stat-cell { border-left: 0; border-top: 1px solid var(--line); }
  .stat-cell:first-child { border-top: 0; }
  .detail-head { flex-wrap: wrap; }
  .detail-head .actions { justify-content: flex-start; width: 100%; margin-left: 0; }
}
.term-toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--line); }
.term-toolbar .select { width: auto; max-width: 260px; height: 28px; font-size: 12.5px; }
.deploying-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 9px 14px; background: var(--accent-soft); border-bottom: 1px solid var(--accent-line); font-size: 13px; color: var(--accent); }
.deploying-bar .spacer { flex: 1; }
.mini-steps { display: flex; align-items: center; gap: 4px; }
.mini-steps .ms { display: flex; align-items: center; gap: 4px; color: var(--ink-4); }
.mini-steps .ms .icon { width: 13px; height: 13px; }
.mini-steps .ms.is-done { color: var(--ok); }
.mini-steps .ms.is-current { font-weight: 500; color: var(--accent); }
.mini-steps .ms-line { width: 14px; height: 1.5px; background: var(--line-strong); }
.mini-steps .ms-line.is-done { background: var(--ok); }
.branch-list { max-height: 232px; overflow-y: auto; }
.branch-row { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 6px; border-radius: var(--r-tag); font-size: 13px; color: var(--ink-2); cursor: pointer; }
.branch-row:hover { background: var(--surface-2); }
.branch-row.is-current { color: var(--accent); font-weight: 500; }
.branch-row .icon { width: 14px; height: 14px; color: var(--ink-4); }
.branch-row .mono { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--ink-4); }
.commit { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.commit:last-child { border-bottom: 0; }
.commit .icon { flex: none; width: 15px; height: 15px; margin-top: 3px; color: var(--ink-4); }
.commit .c-main { flex: 1; min-width: 0; }
.commit .c-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.commit .c-meta { margin-top: 1px; font-size: 12px; color: var(--ink-4); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
@media (max-width: 1180px) { .detail-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- 28. 系统设置 ---------- */
.ops-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(256px, 1fr)); gap: 12px; margin-bottom: 24px; }
.op-card { padding: 14px 15px; border: 1px solid var(--line); border-radius: var(--r-box); background: var(--surface); }
.op-card.is-danger { border-color: var(--danger-line); }
.op-card h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.op-card h3 .icon { width: 16px; height: 16px; color: var(--ink-3); }
.op-card p { min-height: 42px; margin: 6px 0 12px; font-size: 12.5px; line-height: 1.65; color: var(--ink-3); }
.op-card .row { flex-wrap: wrap; gap: 6px; }
.op-card .input { height: 30px; font-size: 12.5px; }
.cfg-row { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.25fr) auto; gap: 16px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.cfg-row:last-child { border-bottom: 0; }
.cfg-row.is-dirty { background: var(--accent-soft); }
.cfg-row.is-off { opacity: .72; }
.cfg-key { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink); word-break: break-all; }
.cfg-desc { margin-top: 3px; font-size: 12.5px; line-height: 1.6; color: var(--ink-3); }
.cfg-ctl { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.cfg-ctl .input, .cfg-ctl .select { height: 30px; font-size: 12.5px; }
.cfg-ctl .textarea { min-height: 60px; font-size: 12.5px; }
.cfg-ctl .dim { font-size: 12.5px; line-height: 30px; }
.cfg-act { display: flex; align-items: center; gap: 8px; min-height: 30px; }
.cfg-act .hint { font-size: 12px; color: var(--ink-4); white-space: nowrap; }
@media (max-width: 820px) { .cfg-row { grid-template-columns: minmax(0, 1fr); gap: 8px; } }
.app-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.app-card-meta .sep { width: 1px; height: 14px; background: var(--line); margin: 0 2px; }
.app-card-meta .badge { height: 20px; }

/* ---------- 29. 应用首页补充 ---------- */
.livebar { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 18px; margin: -6px 0 16px; padding: 7px 14px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); font-size: 12.5px; color: var(--ink-2); }
.livebar b { font-weight: 600; color: var(--ink); margin-left: 4px; }
.livebar .live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.livebar .spacer { flex: 1; }
.livebar .dim { font-size: 12px; }
.term-inset { border: 0 !important; border-radius: 0 0 var(--r-box) var(--r-box) !important; }
/* 日志区是固定高度的盒子，行在盒子里面滚动：运行日志会一直输出，盒子不能跟着内容变长 */
.term-host { height: 520px; display: flex; flex-direction: column; }
.term-host > .term { flex: 1; min-height: 0; }
.err-box { max-height: 96px; overflow: auto; overflow-wrap: anywhere; }

/* ---------- 30. 日志页 ---------- */
.log-filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: var(--r-box) var(--r-box) 0 0; }
.log-filters .field { gap: 4px; }
.log-filters .field > label { font-size: 12px; color: var(--ink-3); }
.log-filters .input, .log-filters .select { height: 30px; font-size: 12.5px; background: var(--surface); }
.log-filters .w-sm { width: 120px; } .log-filters .w-md { width: 170px; } .log-filters .w-lg { width: 220px; }
.log-table td { font-size: 12.5px; }
.log-table .cell-sub { font-size: 11.5px; }
.level { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: var(--r-tag); font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; background: var(--muted-soft); color: var(--muted); }
.level-INFO, .level-info { background: var(--accent-soft); color: var(--accent); }
.level-WARN, .level-warn { background: var(--warn-soft); color: var(--warn); }
.level-ERROR, .level-error { background: var(--danger-soft); color: var(--danger); }
.level-DEBUG, .level-debug { background: var(--muted-soft); color: var(--muted); }
.pre { margin: 0; padding: 12px 14px; max-height: 460px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface-2); font-family: var(--font-mono); font-size: 12px; line-height: 1.7; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.file-list { display: flex; flex-direction: column; }
.file-item { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.file-item:last-child { border-bottom: 0; }
.file-item:hover { background: var(--surface-2); }
.file-item.is-active { background: var(--accent-soft); color: var(--accent); }
.file-item .mono { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .size { font-size: 12px; color: var(--ink-4); white-space: nowrap; }
.log-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .log-layout { grid-template-columns: minmax(0, 1fr); } }

/* 重启中的遮罩 */
.rebooting { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(6px); }
.rebooting-box { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 36px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-box); box-shadow: var(--shadow-3); font-size: 14px; color: var(--ink-2); }
.rebooting-box .icon { width: 26px; height: 26px; color: var(--accent); }
.log-content { font-size: 13.5px; line-height: 1.7; color: var(--ink); overflow-wrap: anywhere; }
