:root {
  --bg: #0c0f16;
  --panel: #141925;
  --panel-alt: #1b2232;
  --border: #28324a;
  --text: #e6ecf8;
  --muted: #93a1be;
  --primary: #4f8cff;
  --primary-hover: #3b78eb;
  --success: #2cc784;
  --warning: #f0ad4e;
  --danger: #ef5b5b;
  --radius: 10px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.cp-shell { min-height: 100vh; display: flex; flex-direction: column; }
.cp-topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 20px; background: rgba(16, 20, 30, 0.96); border-bottom: 1px solid var(--border);
}
.cp-brand { display: flex; align-items: center; gap: 10px; }
.cp-logo { width: 34px; height: 34px; border-radius: 8px; background: linear-gradient(135deg, #3c6df0, #6a42f4); display: grid; place-items: center; color: #fff; }
.cp-logo svg { width: 20px; height: 20px; }
.cp-brand-title { font-weight: 700; font-size: 15px; }
.cp-brand-sub { font-size: 11px; color: var(--muted); }

.cp-nav { display: flex; gap: 6px; flex-shrink: 0; }
.nav-tab {
  background: transparent; color: var(--muted); border: 1px solid transparent;
  padding: 6px 10px; border-radius: 8px; cursor: pointer; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.nav-tab:hover { color: var(--text); background: var(--panel-alt); }
.nav-tab.active { color: #fff; background: var(--panel-alt); border-color: var(--primary); }
.nav-badge { background: rgba(79, 140, 255, 0.2); color: #9fc0ff; border-radius: 999px; padding: 1px 7px; font-size: 11px; }

.cp-status-pills { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.status-pill {
  padding: 4px 10px; border-radius: 999px; background: var(--panel-alt); border: 1px solid var(--border);
  font-size: 12px; color: var(--muted);
}
.status-pill.ok { color: var(--success); border-color: rgba(44, 199, 132, 0.45); }
.status-pill.warn { color: var(--warning); border-color: rgba(240, 173, 78, 0.45); }
.status-pill.err { color: var(--danger); border-color: rgba(239, 91, 91, 0.5); background: rgba(239, 91, 91, 0.1); }

.cp-main { flex: 1; padding: 18px 22px; max-width: 1540px; width: 100%; margin: 0 auto; }
.view-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.view-header h1 { margin: 0 0 4px; font-size: 20px; }
.view-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filter-group { display: flex; gap: 4px; background: var(--panel); padding: 3px; border-radius: 8px; border: 1px solid var(--border); }
.filter-group .btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.card:hover { border-color: #3d4f78; }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card-title { font-weight: 700; font-size: 15px; }
.card-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; border-top: 1px solid rgba(40, 50, 74, 0.6); }

.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--panel-alt); color: var(--muted); border: 1px solid var(--border); }
.badge-online, .badge-completed, .badge-ready, .badge-confirmed { color: var(--success); border-color: rgba(44, 199, 132, 0.5); background: rgba(44, 199, 132, 0.1); }
.badge-busy, .badge-running, .badge-provisioning, .badge-in_progress { color: #7cb0ff; border-color: rgba(79, 140, 255, 0.5); background: rgba(79, 140, 255, 0.12); }
.badge-offline, .badge-draft, .badge-empty { color: var(--muted); }
.badge-warn { color: var(--warning); border-color: rgba(240, 173, 78, 0.5); background: rgba(240, 173, 78, 0.12); }
.badge-error { color: var(--danger); border-color: rgba(239, 91, 91, 0.5); background: rgba(239, 91, 91, 0.12); }

.vram-track { height: 6px; border-radius: 4px; background: #0a0d13; overflow: hidden; border: 1px solid var(--border); }
.vram-fill { height: 100%; background: linear-gradient(90deg, #3c8cff, #2cc784); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border-radius: 7px; border: 1px solid var(--border); padding: 7px 12px;
  cursor: pointer; font-weight: 600; font-size: 13px; text-decoration: none;
  background: var(--panel-alt); color: var(--text);
}
.btn:hover:not(:disabled) { filter: brightness(1.12); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-secondary { background: var(--panel-alt); border-color: var(--border); color: var(--text); }
.btn-warning { background: rgba(240, 173, 78, 0.2); border-color: var(--warning); color: #ffd799; }
.btn-danger { background: rgba(239, 91, 91, 0.18); border-color: var(--danger); color: #ffb3b3; }
.btn-ghost, .btn-ghost-danger { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost-danger:hover:not(:disabled) { color: var(--danger); border-color: var(--danger); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }

.detail-top-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.detail-breadcrumb, .detail-inst-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inst-header-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.banner { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; border: 1px solid var(--border); }
.banner-warning { background: rgba(240, 173, 78, 0.12); border-color: rgba(240, 173, 78, 0.45); color: #ffdca8; }
.banner-danger {
  background: rgba(239, 91, 91, 0.14);
  border-color: rgba(239, 91, 91, 0.55);
  color: #ffd0d0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
}
.banner-danger strong { color: #ffebeb; }
.banner-danger code {
  background: rgba(8, 10, 15, 0.72);
  border: 1px solid rgba(239, 91, 91, 0.35);
  border-radius: 5px;
  padding: 1px 6px;
  color: #ffe3e3;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}
.banner-danger-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-weight: 700;
  color: #ffb3b3;
}
.banner-danger-meta {
  font-size: 12px;
  color: #ffcccc;
  line-height: 1.55;
}

.collapsible-card, .cap-card, .table-card, .wf-head-card, .logs-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px;
}
.collapsible-card summary { cursor: pointer; font-weight: 600; color: var(--muted); }

.workspace-split { display: grid; grid-template-columns: 290px 1fr; gap: 14px; align-items: start; }
@media (max-width: 960px) { .workspace-split { grid-template-columns: 1fr; } }

.wf-sidebar { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.sidebar-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.sidebar-title-row h2 { margin: 0; font-size: 14px; }
.meta-chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--panel-alt); color: var(--muted); border: 1px solid var(--border); }
.wf-list { display: flex; flex-direction: column; gap: 8px; }
.wf-item {
  padding: 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel-alt);
  cursor: pointer; text-align: left; color: var(--text); width: 100%;
}
.wf-item.active { border-color: var(--primary); background: rgba(79, 140, 255, 0.14); }
.wf-item-top { display: flex; justify-content: space-between; gap: 6px; font-weight: 600; margin-bottom: 4px; }

.empty-box { background: var(--panel); border: 1px dashed var(--border); border-radius: var(--radius); padding: 48px 20px; text-align: center; color: var(--muted); }
.wf-head-card { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.wf-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wf-title-row h2 { margin: 0; font-size: 17px; }
.wf-head-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.step-tabs-bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 12px; }
@media (max-width: 900px) { .step-tabs-bar { grid-template-columns: 1fr 1fr; } }
.step-tab {
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
  cursor: pointer; text-align: left; color: var(--text); display: flex; flex-direction: column; gap: 4px;
}
.step-tab.active { border-color: var(--primary); background: rgba(79, 140, 255, 0.14); }

.step-io-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
@media (max-width: 1100px) { .step-io-grid { grid-template-columns: 1fr; } }
.io-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.io-card-head { display: flex; justify-content: space-between; align-items: center; }
.io-card-head h3 { margin: 0; font-size: 14px; }

.artifact-list { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }
.artifact-row {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 6px; background: var(--panel-alt); border: 1px solid rgba(40, 50, 74, 0.7);
  font-size: 12px;
}
.artifact-row a { color: #8cb7ff; text-decoration: none; }
.artifact-row a:hover { text-decoration: underline; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.media-card { background: var(--panel-alt); border: 1px solid var(--border); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.media-card img { width: 100%; height: 130px; object-fit: cover; border-radius: 6px; cursor: pointer; background: #090b10; }
.media-card video { width: 100%; max-height: 150px; border-radius: 6px; background: #000; }
.theater-video { width: 100%; max-height: 360px; border-radius: 8px; background: #000; }

.step-controls-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px;
}
.step-controls-left, .step-controls-right { display: flex; gap: 8px; flex-wrap: wrap; }

.code-log-box {
  background: #080a0f; border: 1px solid var(--border); border-radius: 8px; padding: 10px;
  margin: 8px 0 0; max-height: 260px; overflow: auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; white-space: pre-wrap; word-break: break-word; color: #c9d5ee;
}

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; font-size: 12px; }
.field-label-row { display: flex; justify-content: space-between; align-items: center; }
.input-control, .textarea-control {
  width: 100%; background: #0b0e15; color: var(--text); border: 1px solid var(--border);
  border-radius: 7px; padding: 7px 10px; font-size: 13px; font-family: inherit;
}
.textarea-control { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; resize: vertical; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.inline-form-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.inline-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; cursor: pointer; margin-bottom: 10px; }
.parse-hint {
  padding: 8px 10px; border-radius: 7px; background: #0b0e15; border: 1px solid var(--border);
  margin-bottom: 10px; font-size: 12px; color: var(--muted);
}
.field code,
.parse-hint code {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}
.parse-hint.ok { border-color: rgba(44, 199, 132, 0.5); color: var(--success); }
.parse-hint.err { border-color: rgba(239, 91, 91, 0.5); color: #ffb3b3; background: rgba(239, 91, 91, 0.08); }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(5, 7, 12, 0.72);
  display: grid; place-items: center; padding: 18px;
}
.modal-panel {
  width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  display: flex; flex-direction: column;
}
.modal-lg { max-width: 780px; }
.modal-head, .modal-foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.modal-foot { border-bottom: none; border-top: 1px solid var(--border); justify-content: flex-end; gap: 8px; }
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-body { padding: 14px 16px; }
.lightbox-body { display: grid; place-items: center; }
.lightbox-body img { max-width: 100%; max-height: 75vh; border-radius: 8px; }

.toast-host { position: fixed; right: 16px; bottom: 16px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--panel-alt); border: 1px solid var(--border); color: var(--text);
  padding: 9px 14px; border-radius: 8px; font-size: 13px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.toast.ok { border-color: var(--success); }
.toast.warn { border-color: var(--warning); }
.toast.err { border-color: var(--danger); }

.cred-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.cred-table th, .cred-table td { padding: 8px; border-bottom: 1px solid var(--border); text-align: left; }

/* 宿主机服务可用性探测面板 */
.host-health-panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 12px;
}
.host-health-panel .banner { margin-bottom: 0; }
.host-health-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
}
.host-health-title-group { display: flex; flex-direction: column; gap: 4px; }
.host-health-title-group h2 { margin: 0; font-size: 15px; }
.host-probe-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.host-health-actions { display: flex; align-items: center; gap: 8px; }

.bridge-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600;
  border: 1px solid var(--border); background: var(--panel-alt); color: var(--muted);
}
.bridge-badge.is-connected {
  color: var(--success); border-color: rgba(44, 199, 132, 0.45); background: rgba(44, 199, 132, 0.12);
}
.bridge-badge.is-offline {
  color: #ffb3b3; border-color: rgba(239, 91, 91, 0.55); background: rgba(239, 91, 91, 0.16);
}
.bridge-badge.is-local {
  color: #9fc0ff; border-color: rgba(79, 140, 255, 0.42); background: rgba(79, 140, 255, 0.12);
}
.host-meta-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px; font-size: 11px;
  background: #0b0e15; color: var(--muted); border: 1px solid var(--border);
}
.cap-arch-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
}
.cap-bridge-alert {
  margin-top: 8px; margin-bottom: 4px;
}
.host-health-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
}
@media (max-width: 1080px) { .host-health-grid { grid-template-columns: 1fr; } }

.host-card {
  background: var(--panel-alt); border: 1px solid var(--border); border-radius: 8px;
  padding: 11px 12px; display: flex; flex-direction: column; gap: 7px; min-width: 0;
}
.host-card.is-ready { border-color: rgba(44, 199, 132, 0.35); }
.host-card.is-warn { border-color: rgba(240, 173, 78, 0.42); }
.host-card.is-err { border-color: rgba(239, 91, 91, 0.48); }
.host-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.host-card-title { font-weight: 700; font-size: 13px; }
.host-card-kv { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.host-card-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.host-card-line strong { color: var(--text); font-weight: 600; }
.host-card-err {
  font-size: 11px; color: #ffb3b3; background: rgba(239, 91, 91, 0.12);
  border: 1px solid rgba(239, 91, 91, 0.35); border-radius: 6px; padding: 6px 8px;
  white-space: pre-wrap; word-break: break-word; line-height: 1.45; max-height: 112px; overflow-y: auto;
}
.host-card-warn {
  font-size: 11px; color: #ffdca8; background: rgba(240, 173, 78, 0.12);
  border: 1px solid rgba(240, 173, 78, 0.42); border-radius: 6px; padding: 6px 8px;
  line-height: 1.45; display: flex; flex-direction: column; gap: 4px;
}
.host-card-warn.is-notice {
  background: rgba(240, 173, 78, 0.08); border-color: rgba(240, 173, 78, 0.34);
}
.host-card-warn-title {
  font-weight: 700; color: #ffe3b8; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.host-card-warn-msg {
  white-space: pre-wrap; word-break: break-word; max-height: 112px; overflow-y: auto;
}
.host-card-warn code {
  background: rgba(11, 14, 21, 0.72); border: 1px solid rgba(240, 173, 78, 0.35);
  border-radius: 4px; padding: 0 4px; color: #ffe8c2;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px;
}
.host-card-tags {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.host-probe-history {
  background: rgba(11, 14, 21, 0.72); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 8px; font-size: 11px; color: var(--muted);
}
.host-probe-history summary {
  cursor: pointer; font-weight: 600; color: var(--muted);
  user-select: none; list-style-position: inside;
}
.host-probe-history summary:hover,
.host-probe-history[open] summary { color: var(--text); }
.host-probe-history-list {
  margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(40, 50, 74, 0.65);
  display: flex; flex-direction: column; gap: 5px; max-height: 170px; overflow-y: auto;
}
.host-probe-event {
  display: flex; flex-direction: column; gap: 3px;
  padding: 5px 7px; border-radius: 5px;
  background: rgba(20, 25, 37, 0.85); border: 1px solid rgba(40, 50, 74, 0.6);
}
.host-probe-event-top {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap;
}
.host-probe-event-meta {
  display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap;
}
.host-probe-event-time {
  color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10.5px;
}
.host-probe-event-stat { color: var(--muted); font-size: 10.5px; }
.host-probe-event-err {
  color: #ffb3b3; white-space: pre-wrap; word-break: break-word; line-height: 1.4; font-size: 11px;
}
.host-probe-event.is-degraded .host-probe-event-err { color: #ffdca8; }
.host-card-foot {
  display: flex; align-items: center; justify-content: flex-start; gap: 8px;
  margin-top: auto; padding-top: 6px; border-top: 1px solid rgba(40, 50, 74, 0.65); flex-wrap: wrap;
}

/* 存储与凭据页探测详情 */
.cap-head-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.cap-probe-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.cap-probe-item {
  display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap;
  padding: 7px 10px; border-radius: 7px; background: var(--panel-alt); border: 1px solid rgba(40, 50, 74, 0.7);
  font-size: 12px;
}
.cap-probe-label { font-weight: 600; min-width: 112px; color: var(--text); }
.cap-probe-detail { flex: 1; min-width: 220px; color: var(--muted); word-break: break-word; }
.cap-probe-detail .host-card-tags,
.cap-probe-detail .host-card-warn,
.cap-probe-detail .host-card-err,
.cap-probe-detail .host-probe-history { margin-top: 6px; }
.cap-probe-err { color: #ffb3b3; white-space: pre-wrap; word-break: break-word; }

/* 实例 Google Drive 可用状态展示 */
.inst-drive-box { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.inst-drive-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.inst-drive-sub {
  font-size: 11px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.inst-drive-sub.is-err { color: #ffb3b3; }

/* 实例卡片实时创建日志预览与完整日志弹窗 */
.inst-prov-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(40, 50, 74, 0.85);
  background: rgba(11, 14, 21, 0.78);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  min-width: 0;
}
.inst-prov-box:hover {
  border-color: rgba(79, 140, 255, 0.65);
  background: rgba(20, 27, 42, 0.92);
}
.inst-prov-box.is-provisioning {
  border-color: rgba(79, 140, 255, 0.45);
  background: rgba(79, 140, 255, 0.08);
}
.inst-prov-box.is-retry {
  border-color: rgba(240, 173, 78, 0.52);
  background: rgba(240, 173, 78, 0.09);
}
.inst-prov-box.is-error {
  border-color: rgba(239, 91, 91, 0.5);
  background: rgba(239, 91, 91, 0.09);
}
.inst-prov-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}
.inst-prov-head-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}
.inst-prov-elapsed {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: #b7ccf7;
}
.inst-prov-more {
  font-size: 11px;
  color: #8cb7ff;
  font-weight: 600;
  white-space: nowrap;
}
.inst-prov-hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}
.inst-prov-box.is-retry .inst-prov-hint { color: #ffdca8; }
.inst-prov-box.is-error .inst-prov-hint { color: #ffcccc; }
.inst-prov-latest {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.4;
  color: #d6e1f7;
  background: rgba(8, 10, 15, 0.72);
  border: 1px solid rgba(40, 50, 74, 0.65);
  border-radius: 5px;
  padding: 4px 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prov-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.prov-modal-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.prov-log-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.prov-log-toolbar-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.prov-autoscroll-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.prov-log-viewer {
  margin: 0;
  min-height: 240px;
  max-height: 58vh;
  overflow-y: auto;
  overflow-x: auto;
  line-height: 1.48;
  scrollbar-width: thin;
  scrollbar-color: #3d4f78 #080a0f;
}

/* 顶栏用户鉴权控制条与用户管理弹窗 */
.user-auth-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-left: 8px;
  border-left: 1px solid var(--border);
}
.user-pill {
  color: #d7e4ff;
  border-color: rgba(79, 140, 255, 0.45);
  background: rgba(79, 140, 255, 0.12);
  font-weight: 600;
}
.users-section-title {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text);
}
.user-reset-row td {
  background: rgba(11, 14, 21, 0.72);
}

/* 独立登录页 */
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(circle at 20% 20%, rgba(79, 140, 255, 0.14), transparent 46%),
    radial-gradient(circle at 80% 80%, rgba(106, 66, 244, 0.14), transparent 46%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 22px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.login-brand .cp-logo {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.login-brand .cp-brand-title {
  font-size: 17px;
}
.login-brand .cp-brand-sub {
  font-size: 12px;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.login-submit-btn {
  width: 100%;
  padding: 9px 14px;
  font-size: 14px;
  margin-top: 4px;
}
.login-error {
  padding: 9px 11px;
  border-radius: 8px;
  background: rgba(239, 91, 91, 0.14);
  border: 1px solid rgba(239, 91, 91, 0.55);
  color: #ffd0d0;
  font-size: 12px;
  line-height: 1.5;
}
.login-config-hint {
  margin-bottom: 0;
  line-height: 1.55;
}

/* 工作流步骤进度展示与日志弹窗交互 */
.logs-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.logs-head h3 {
  margin: 0;
  font-size: 14px;
}
.logs-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.wf-log-preview {
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.wf-log-preview:hover {
  border-color: rgba(79, 140, 255, 0.65);
  background: #0a0e17;
}

.step-tab-progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: auto;
  padding-top: 4px;
}
.step-tab-progress-track {
  height: 5px;
  border-radius: 999px;
  background: #0a0d13;
  border: 1px solid rgba(40, 50, 74, 0.85);
  overflow: hidden;
}
.step-tab-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: var(--muted);
  transition: width 0.25s ease;
}
.step-tab-progress-text {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step-progress-banner {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.step-progress-banner-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
}
.step-progress-banner-label {
  font-weight: 700;
  color: var(--text);
}
.step-progress-banner-text {
  font-weight: 600;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.step-progress-track {
  height: 8px;
  border-radius: 999px;
  background: #080a0f;
  border: 1px solid var(--border);
  overflow: hidden;
}
.step-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--muted);
  transition: width 0.3s ease;
}

.step-tab-progress.is-done .step-tab-progress-bar,
.step-progress-banner.is-done .step-progress-fill {
  background: var(--success);
}
.step-tab-progress.is-done .step-tab-progress-text,
.step-progress-banner.is-done .step-progress-banner-text {
  color: var(--success);
}
.step-progress-banner.is-done {
  border-color: rgba(44, 199, 132, 0.42);
}

.step-tab-progress.is-running .step-tab-progress-bar,
.step-progress-banner.is-running .step-progress-fill {
  background: linear-gradient(90deg, #4f8cff, #2cc784);
}
.step-tab-progress.is-running .step-tab-progress-text,
.step-progress-banner.is-running .step-progress-banner-text {
  color: #9fc0ff;
}
.step-progress-banner.is-running {
  border-color: rgba(79, 140, 255, 0.5);
  background: rgba(79, 140, 255, 0.06);
}

.step-tab-progress.is-partial .step-tab-progress-bar,
.step-progress-banner.is-partial .step-progress-fill {
  background: var(--warning);
}
.step-tab-progress.is-partial .step-tab-progress-text,
.step-progress-banner.is-partial .step-progress-banner-text {
  color: #ffdca8;
}
.step-progress-banner.is-partial {
  border-color: rgba(240, 173, 78, 0.42);
}

.step-tab-progress.is-failed .step-tab-progress-track,
.step-progress-banner.is-failed .step-progress-track {
  border-color: rgba(239, 91, 91, 0.6);
  background: rgba(239, 91, 91, 0.16);
}
.step-tab-progress.is-failed .step-tab-progress-bar,
.step-progress-banner.is-failed .step-progress-fill {
  background: var(--danger);
}
.step-tab-progress.is-failed .step-tab-progress-text,
.step-progress-banner.is-failed .step-progress-banner-text {
  color: #ffb3b3;
}
.step-progress-banner.is-failed {
  border-color: rgba(239, 91, 91, 0.55);
  background: rgba(239, 91, 91, 0.08);
}

/* 全局工作流/操作按钮悬浮详细帮助提示 */
.ui-help-tooltip {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  max-width: 320px;
  padding: 9px 12px;
  border-radius: 9px;
  background: rgba(11, 15, 25, 0.96);
  border: 1px solid rgba(99, 146, 255, 0.52);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.58);
  color: #eef3ff;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.artifact-inherited-chip {
  color: #9fc0ff;
  border-color: rgba(79, 140, 255, 0.42);
  background: rgba(79, 140, 255, 0.12);
}

/* 工作流画风预设、写实生图引擎与 Step 1~5 摘要栏 */
.wf-config-summary-bar,
.wf-step-config-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.wf-config-summary-bar {
  margin-top: 6px;
}
.wf-step-config-summary {
  margin-bottom: 10px;
}
.wf-config-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: var(--panel-alt);
  color: #cdd9f3;
  border: 1px solid var(--border);
}
.wf-config-chip strong {
  color: var(--text);
  font-weight: 600;
}
.wf-config-chip.is-accent {
  border-color: rgba(79, 140, 255, 0.45);
  background: rgba(79, 140, 255, 0.12);
  color: #b7d0ff;
}
.wf-realism-section {
  background: #0e131e;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.wf-realism-section-title {
  font-size: 12px;
  font-weight: 700;
  color: #9fc0ff;
  margin-bottom: 8px;
}
.wf-realism-row-align {
  align-items: center;
  margin-bottom: 2px;
}
.wf-refiner-check {
  margin-bottom: 10px;
  padding-top: 14px;
}
.wf-inline-config-card {
  margin-top: 10px;
  margin-bottom: 0;
  background: #0e131e;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
}
.wf-inline-config-card summary {
  font-size: 12px;
  font-weight: 600;
  color: #b7d0ff;
  cursor: pointer;
  user-select: none;
}
.wf-inline-config-body {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(40, 50, 74, 0.7);
}
@media (max-width: 640px) {
  .row-2 { grid-template-columns: 1fr; }
  .wf-refiner-check { padding-top: 0; }
}

/* 镜像管理两级分类布局、分类头卡与实例流水线徽章 */
.cat-tabs-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.cat-tab:hover {
  color: var(--text);
  border-color: #3d4f78;
  background: var(--panel-alt);
}
.cat-tab.active {
  color: #fff;
  border-color: var(--primary);
  background: rgba(79, 140, 255, 0.18);
}
.cat-tab-badge {
  background: rgba(79, 140, 255, 0.18);
  color: #b7d0ff;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
}
.cat-tab-kind {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-alt);
  color: var(--muted);
}
.cat-tab-kind.is-builtin {
  color: #9fc0ff;
  border-color: rgba(79, 140, 255, 0.4);
}
.cat-tab-kind.is-custom {
  color: #ffdca8;
  border-color: rgba(240, 173, 78, 0.4);
}

.image-categories-wrap {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.image-category-section {
  background: rgba(20, 25, 37, 0.72);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.image-category-section.is-anime {
  border-color: rgba(168, 118, 255, 0.38);
}
.image-category-section.is-live-action {
  border-color: rgba(79, 140, 255, 0.36);
}
.image-category-section.is-custom {
  border-color: rgba(240, 173, 78, 0.36);
}
.category-header-card {
  background: linear-gradient(135deg, rgba(27, 34, 50, 0.96), rgba(16, 21, 32, 0.96));
  border: 1px solid rgba(61, 79, 120, 0.7);
  border-radius: 10px;
  padding: 13px 15px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}
.category-header-main {
  flex: 1;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.category-header-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.category-header-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.category-header-desc {
  font-size: 12.5px;
  color: #b9c5de;
  line-height: 1.5;
}
.category-meta-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.category-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.category-images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 12px;
}
.image-card-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
.image-engine-badge {
  color: #d7e4ff;
  border-color: rgba(79, 140, 255, 0.45);
  background: rgba(79, 140, 255, 0.14);
}
.image-engine-badge.is-anime {
  color: #ebd4ff;
  border-color: rgba(176, 125, 255, 0.5);
  background: rgba(168, 118, 255, 0.16);
}
.image-drive-tip {
  font-size: 11px;
  color: #8be0b8;
  background: rgba(44, 199, 132, 0.08);
  border: 1px solid rgba(44, 199, 132, 0.25);
  border-radius: 6px;
  padding: 4px 8px;
}

.inst-pipeline-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--border);
}
.inst-pipeline-badge.is-live-action {
  color: #9fc8ff;
  border-color: rgba(79, 140, 255, 0.5);
  background: rgba(79, 140, 255, 0.15);
}
.inst-pipeline-badge.is-anime {
  color: #f0c9ff;
  border-color: rgba(186, 118, 255, 0.55);
  background: rgba(176, 108, 255, 0.18);
}
.inst-pipeline-badge.is-custom {
  color: #ffe0a3;
  border-color: rgba(240, 173, 78, 0.5);
  background: rgba(240, 173, 78, 0.15);
}

/* 镜像 5 步全链路规格详情弹窗 */
.modal-xl {
  max-width: 980px;
}
.img-card-title-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}
.img-card-title-btn:hover {
  color: #8cb7ff;
  text-decoration: underline;
}
.img-spec-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.img-spec-overview {
  background: linear-gradient(135deg, rgba(27, 34, 50, 0.95), rgba(14, 19, 30, 0.95));
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.img-spec-stack-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.img-spec-boot-wrap {
  margin-top: 8px;
}
.img-spec-steps-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.img-spec-step-card {
  background: #0e131e;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.img-spec-step-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.img-spec-step-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.img-spec-step-badge {
  background: rgba(79, 140, 255, 0.18);
  color: #b7d0ff;
  border: 1px solid rgba(79, 140, 255, 0.45);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 700;
}
.img-spec-step-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}
.img-spec-model-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: rgba(8, 10, 15, 0.55);
  border-radius: 7px;
  overflow: hidden;
}
.img-spec-model-table th,
.img-spec-model-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(40, 50, 74, 0.7);
  text-align: left;
  word-break: break-word;
}
.img-spec-model-table th {
  color: var(--muted);
  font-weight: 600;
  background: rgba(20, 25, 37, 0.85);
}
.img-spec-param-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.img-spec-io-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: #c9d5ee;
  background: rgba(20, 25, 37, 0.72);
  border: 1px solid rgba(40, 50, 74, 0.75);
  border-radius: 7px;
  padding: 7px 10px;
}
.img-spec-vram-note {
  font-size: 12px;
  color: #8be0b8;
  background: rgba(44, 199, 132, 0.08);
  border: 1px solid rgba(44, 199, 132, 0.25);
  border-radius: 6px;
  padding: 6px 9px;
}
.img-spec-note-input {
  margin-top: 2px;
}

/* 全局系统设置页 */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 980px) {
  .settings-grid { grid-template-columns: 1fr; }
}
.settings-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.settings-card-full {
  grid-column: 1 / -1;
}
.settings-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(40, 50, 74, 0.65);
}
.settings-card-head h3 {
  margin: 0;
  font-size: 14.5px;
}
.settings-storage-health {
  background: #0e131e;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.settings-storage-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.storage-meter-track {
  height: 7px;
  border-radius: 999px;
  background: #080a0f;
  border: 1px solid var(--border);
  overflow: hidden;
}
.storage-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #4f8cff, #2cc784);
  transition: width 0.25s ease;
}
.settings-path-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.settings-path-row .input-control {
  flex: 1;
}
.settings-path-row .btn {
  white-space: nowrap;
}
.settings-dir-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: #0b0e15;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 10px;
}
.settings-dir-preview code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  color: #b7d0ff;
  word-break: break-all;
}

/* 镜像与分类全生命周期管理：空分类占位、自定义 Notebook 清理提示与批量导入摘要 */
.category-empty-box {
  grid-column: 1 / -1;
  padding: 26px 18px;
}
.custom-nb-clear-box {
  background: rgba(240, 173, 78, 0.09);
  border: 1px solid rgba(240, 173, 78, 0.42);
  border-radius: 8px;
  padding: 9px 12px;
  margin-bottom: 10px;
}
.custom-nb-clear-box .inline-check {
  margin-bottom: 4px;
  color: #ffe3b8;
  font-weight: 600;
}
.import-bundle-summary {
  background: #0e131e;
  border: 1px solid rgba(79, 140, 255, 0.42);
  border-radius: 9px;
  padding: 10px 12px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.import-bundle-summary-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
  font-weight: 700;
  color: #b7d0ff;
}
.import-bundle-file-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 180px;
  overflow-y: auto;
}
.import-bundle-file-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--panel-alt);
  border: 1px solid rgba(40, 50, 74, 0.75);
  font-size: 12px;
}
.confirm-modal-msg {
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* viewer 只读访客提示条、紧凑输入控件与跨用户 Key 内联展开区 */
.banner-info {
  background: rgba(79, 140, 255, 0.12);
  border-color: rgba(79, 140, 255, 0.48);
  color: #cfe0ff;
  font-size: 13px;
  line-height: 1.55;
}
.banner-info strong {
  color: #eaf2ff;
}
.banner-info code {
  background: rgba(11, 14, 21, 0.72);
  border: 1px solid rgba(79, 140, 255, 0.35);
  border-radius: 4px;
  padding: 1px 5px;
  color: #dce9ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
}

.input-control.input-xs {
  width: auto;
  min-width: 132px;
  padding: 3px 8px;
  font-size: 12px;
  border-radius: 6px;
}

.user-keys-row td {
  background: rgba(11, 14, 21, 0.84);
  padding: 10px 12px;
}
.user-keys-subbox {
  border: 1px solid rgba(79, 140, 255, 0.32);
  border-radius: 8px;
  background: rgba(20, 25, 37, 0.9);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.user-keys-subhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}

/* 个人 API Key 一次性明文展示横幅 */
.apikey-created-banner {
  background: rgba(44, 199, 132, 0.1);
  border: 1px solid rgba(44, 199, 132, 0.52);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.apikey-created-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: #a9f0cf;
  font-size: 13px;
}
.apikey-secret-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #070a10;
  border: 1px solid rgba(44, 199, 132, 0.42);
  border-radius: 7px;
  padding: 8px 10px;
  overflow-x: auto;
}
.apikey-secret-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  font-weight: 700;
  color: #6df2b4;
  word-break: break-all;
}
.apikey-header-example-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.apikey-header-example-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.apikey-curl-preview {
  margin: 0;
  max-height: 110px;
  font-size: 11.5px;
}

/* 站内在线交互 API 文档页 (#viewApiDocs) */
.apidocs-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.apidocs-search-wrap {
  flex: 1;
  min-width: 260px;
  max-width: 480px;
}
.apidocs-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.apidocs-quickstart-card,
.apidocs-section-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.apidocs-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.apidocs-card-head h2,
.apidocs-card-head h3 {
  margin: 0;
  font-size: 15.5px;
}
.apidocs-code-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 980px) {
  .apidocs-code-grid { grid-template-columns: 1fr; }
}
.apidocs-code-block {
  background: #0b0f18;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.apidocs-code-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #b7d0ff;
}
.apidocs-code-block .code-log-box {
  margin: 0;
  max-height: 220px;
}
.apidocs-roles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 980px) {
  .apidocs-roles-grid { grid-template-columns: 1fr; }
}
.apidocs-role-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.apidocs-role-card.is-current-role {
  border-color: rgba(79, 140, 255, 0.62);
  background: linear-gradient(135deg, rgba(27, 36, 56, 0.95), rgba(18, 24, 38, 0.95));
}
.apidocs-endpoints-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.apidocs-endpoint-card {
  background: #0e131e;
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
}
.apidocs-endpoint-card[open] {
  border-color: rgba(79, 140, 255, 0.48);
}
.apidocs-endpoint-summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  user-select: none;
}
.apidocs-endpoint-summary::-webkit-details-marker {
  display: none;
}
.apidocs-endpoint-summary:hover {
  background: rgba(27, 34, 50, 0.72);
}
.apidocs-ep-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.apidocs-ep-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.http-method-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  border: 1px solid var(--border);
  background: var(--panel-alt);
  color: var(--text);
}
.http-method-badge.is-get {
  color: #8cc4ff;
  background: rgba(79, 140, 255, 0.16);
  border-color: rgba(79, 140, 255, 0.48);
}
.http-method-badge.is-post {
  color: #7ee2b8;
  background: rgba(44, 199, 132, 0.16);
  border-color: rgba(44, 199, 132, 0.48);
}
.http-method-badge.is-put {
  color: #ffd591;
  background: rgba(240, 173, 78, 0.16);
  border-color: rgba(240, 173, 78, 0.48);
}
.http-method-badge.is-delete {
  color: #ffb3b3;
  background: rgba(239, 91, 91, 0.16);
  border-color: rgba(239, 91, 91, 0.5);
}
.apidocs-path {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  font-weight: 600;
  color: #e8effc;
  word-break: break-all;
}
.apidocs-ep-summary-text {
  font-size: 12.5px;
  color: var(--muted);
}
.apidocs-endpoint-body {
  padding: 12px 14px;
  border-top: 1px solid rgba(40, 50, 74, 0.75);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.apidocs-params-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: rgba(8, 10, 15, 0.55);
  border-radius: 7px;
  overflow: hidden;
}
.apidocs-params-table th,
.apidocs-params-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(40, 50, 74, 0.7);
  text-align: left;
  word-break: break-word;
}
.apidocs-params-table th {
  color: var(--muted);
  font-weight: 600;
  background: rgba(20, 25, 37, 0.85);
}

/* =========================================================================
   顶栏清爽化防挤压、醒目 API Key 按钮与快速创建行
   ========================================================================= */
.cp-topbar {
  flex-wrap: wrap;
}
.cp-brand {
  min-width: 0;
}
.cp-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}
.cp-topbar-actions .user-auth-bar {
  flex-wrap: nowrap;
  white-space: nowrap;
}
@media (max-width: 1360px) {
  .cp-brand-sub {
    display: none;
  }
}
@media (max-width: 980px) {
  .cp-topbar-actions,
  .cp-topbar-actions .user-auth-bar {
    flex-wrap: wrap;
  }
}
.btn-apikey-top {
  background: linear-gradient(135deg, #3f7eff, #5b58f5);
  border-color: rgba(130, 172, 255, 0.72);
  color: #fff;
  box-shadow: 0 2px 10px rgba(79, 140, 255, 0.28);
  white-space: nowrap;
}
.btn-home-apikey {
  border-color: rgba(79, 140, 255, 0.52);
  background: rgba(79, 140, 255, 0.14);
  color: #dce9ff;
}
.apikey-quick-create-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 168px auto;
  gap: 10px;
  align-items: end;
}
.apikey-quick-create-row .field {
  margin-bottom: 0;
}
.apikey-create-btn-wrap {
  display: flex;
  align-items: center;
}
.apikey-create-btn-wrap .btn {
  height: 34px;
  white-space: nowrap;
  padding: 0 14px;
}
@media (max-width: 760px) {
  .apikey-quick-create-row {
    grid-template-columns: 1fr;
  }
  .apikey-create-btn-wrap .btn {
    width: 100%;
  }
}

/* =========================================================================
   首页（系统总览仪表盘 #viewHome）
   ========================================================================= */
.home-runtime-banner {
  background: linear-gradient(135deg, rgba(24, 31, 48, 0.96), rgba(14, 19, 30, 0.96));
  border: 1px solid rgba(79, 140, 255, 0.36);
  border-radius: 12px;
  padding: 15px 18px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.home-runtime-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.home-runtime-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.home-runtime-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.home-runtime-title-row h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}
.home-env-chips {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.home-uptime-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.home-uptime-label {
  font-size: 12.5px;
  color: #b9c7e2;
  font-weight: 600;
}
.home-uptime-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14.5px;
  font-weight: 700;
  color: #6df2b4;
  background: rgba(44, 199, 132, 0.12);
  border: 1px solid rgba(44, 199, 132, 0.42);
  border-radius: 7px;
  padding: 3px 10px;
  font-variant-numeric: tabular-nums;
}
.home-started-meta {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.home-quick-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.home-status-pills-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid rgba(40, 50, 74, 0.72);
}

.home-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
@media (max-width: 1180px) {
  .home-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .home-stats-grid {
    grid-template-columns: 1fr;
  }
}

.home-stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 14px 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.home-stat-card.is-clickable {
  cursor: pointer;
}
.home-stat-card.is-clickable:hover {
  border-color: rgba(79, 140, 255, 0.62);
  background: rgba(24, 31, 47, 0.96);
}
.home-stat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.home-stat-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #d6e2fa;
}
.home-stat-link {
  font-size: 11.5px;
  font-weight: 600;
  color: #8cb7ff;
  white-space: nowrap;
}
.home-stat-kpi-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.home-stat-number {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  color: #f2f6ff;
  font-variant-numeric: tabular-nums;
}
.home-stat-unit {
  font-size: 12px;
  color: var(--muted);
}

.home-stat-matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: auto;
}
.home-metric-tile {
  background: #0e131e;
  border: 1px solid rgba(40, 50, 74, 0.85);
  border-radius: 7px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.home-metric-tile-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
}
.home-metric-tile-top strong {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.home-metric-tile.is-active {
  border-color: rgba(79, 140, 255, 0.45);
  background: rgba(79, 140, 255, 0.08);
}
.home-metric-tile.is-active .home-metric-tile-top strong {
  color: #8cc0ff;
}
.home-metric-tile.is-ok {
  border-color: rgba(44, 199, 132, 0.42);
  background: rgba(44, 199, 132, 0.08);
}
.home-metric-tile.is-ok .home-metric-tile-top strong {
  color: #6df2b4;
}
.home-metric-tile.is-err {
  border-color: rgba(239, 91, 91, 0.45);
  background: rgba(239, 91, 91, 0.08);
}
.home-metric-tile.is-err .home-metric-tile-top strong {
  color: #ff9f9f;
}
.home-metric-sub {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-infra-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.home-infra-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  background: #0e131e;
  border: 1px solid rgba(40, 50, 74, 0.78);
  font-size: 12px;
}
.home-storage-stack {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: auto;
}
.home-storage-item {
  background: #0e131e;
  border: 1px solid rgba(40, 50, 74, 0.8);
  border-radius: 8px;
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.home-storage-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
}

.home-recent-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 1024px) {
  .home-recent-grid {
    grid-template-columns: 1fr;
  }
}
.home-recent-card {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.home-recent-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.home-recent-head h3 {
  margin: 0 0 2px;
  font-size: 15px;
}
.home-recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.home-recent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--panel-alt);
  border: 1px solid rgba(40, 50, 74, 0.78);
}
.home-recent-item-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.home-recent-item-title {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-weight: 600;
  font-size: 13px;
}
.home-recent-item-sub {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
