/* =============================================================
   MiniMax H3 Console · 统一设计系统 (Light / Dark)
   商业级后台管理控制台样式。所有页面共用。
   ============================================================= */

/* ---------- 主题变量 ---------- */
:root {
  --bg: #f5f6f9;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #f1f3f8;
  --border: #e8eaef;
  --border-strong: #d8dce4;
  --text: #15181f;
  --text-2: #3c4452;
  --muted: #8a93a2;
  --accent: #5b54e8;
  --accent-2: #8b5cf6;
  --accent-grad: linear-gradient(135deg, #5b54e8 0%, #8b5cf6 100%);
  --accent-soft: #efeffe;
  --accent-ring: rgba(91, 84, 232, .18);
  --ok: #18a558;
  --ok-soft: #e7f7ee;
  --warn: #c47d09;
  --warn-soft: #fdf3e2;
  --err: #e0413e;
  --err-soft: #fdecec;
  --info: #2563eb;
  --info-soft: #e9f0fe;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .05);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, .08);
  --shadow-lg: 0 18px 48px rgba(16, 24, 40, .14);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --sidebar-w: 258px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

[data-theme="dark"] {
  --bg: #0a0d13;
  --surface: #13171f;
  --surface-2: #181d27;
  --surface-3: #1f2531;
  --border: #232a36;
  --border-strong: #2e3644;
  --text: #e9ecf2;
  --text-2: #c2c9d6;
  --muted: #828c9c;
  --accent: #7c75f0;
  --accent-2: #a78bfa;
  --accent-grad: linear-gradient(135deg, #6d65ec 0%, #9d6bf5 100%);
  --accent-soft: rgba(124, 117, 240, .16);
  --accent-ring: rgba(124, 117, 240, .28);
  --ok: #2fbf6b;
  --ok-soft: rgba(47, 191, 107, .14);
  --warn: #e0a431;
  --warn-soft: rgba(224, 164, 49, .14);
  --err: #f06360;
  --err-soft: rgba(240, 99, 96, .16);
  --info: #5b9bff;
  --info-soft: rgba(91, 155, 255, .16);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, .45);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; color: var(--text); }
code, pre { font-family: var(--mono); }
.muted { color: var(--muted); }
.hidden { display: none !important; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 应用骨架 ---------- */
.app { display: flex; min-height: 100vh; }

/* 侧边栏 */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 40;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.brand .logo {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 15px;
  box-shadow: 0 6px 16px var(--accent-ring);
}
.brand .name { font-weight: 700; font-size: 15px; line-height: 1.1; }
.brand .sub { font-size: 11px; color: var(--muted); margin-top: 2px; letter-spacing: .02em; }

.nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
/* 权限解析完成前先隐藏导航，避免无权限菜单先闪现（视觉暴露） */
#h3-nav.nav-auth-pending { visibility: hidden; }
.nav-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); font-weight: 600; padding: 14px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 13.5px; font-weight: 500;
  cursor: pointer; margin-bottom: 2px; position: relative;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-item.active {
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
}
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px; border-radius: 0 4px 4px 0; background: var(--accent);
}

.user-chip {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 16px; border-top: 1px solid var(--border);
  margin-top: auto;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--accent-grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.user-chip .meta { min-width: 0; flex: 1; }
.user-chip .uname { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .urole { font-size: 11px; color: var(--muted); }
.user-chip .logout {
  border: none; background: none; color: var(--muted); cursor: pointer;
  padding: 6px; border-radius: 8px; display: flex;
}
.user-chip .logout:hover { background: var(--surface-2); color: var(--err); }

/* 主区 */
.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: 66px; padding: 0 28px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
}
.topbar .page-title { font-size: 18px; font-weight: 700; }
.topbar .page-sub { font-size: 12.5px; color: var(--muted); }
.topbar .spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.content { padding: 26px 28px 48px; width: 100%; }
@media (max-width: 880px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-100%); }
  .topbar { padding: 0 16px; }
  .content { padding: 18px 16px 40px; }
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-title { font-size: 15px; font-weight: 650; margin-bottom: 8px; }
.card-head .spacer { flex: 1; }
.card-desc { color: var(--muted); font-size: 12.5px; margin: -8px 0 16px; }

/* ---------- KPI 统计卡 ---------- */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px; margin-bottom: 22px;
}
.kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.kpi .ic {
  width: 40px; height: 40px; border-radius: 11px; display: flex;
  align-items: center; justify-content: center; margin-bottom: 14px;
  color: #fff;
}
.kpi .ic svg { width: 20px; height: 20px; }
.kpi .k { font-size: 12.5px; color: var(--muted); }
.kpi .v { font-size: 28px; font-weight: 750; letter-spacing: -.02em; margin-top: 2px; }
.kpi .d { font-size: 12px; margin-top: 6px; color: var(--muted); }
.kpi .d.up { color: var(--ok); }
.kpi .d.down { color: var(--err); }

/* ---------- 表格 ---------- */
.table-wrap {
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: auto; background: var(--surface); box-shadow: var(--shadow-sm);
}
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl thead th {
  text-align: left; padding: 12px 16px; font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.tbl tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: middle; }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl tbody tr { transition: background .12s; }
table.tbl tbody tr:hover { background: var(--surface-2); }
.table-wrap .empty { padding: 28px; text-align: center; color: var(--muted); }
/* 操作列：表过宽时右固定，始终可见（解决「列表太长操作按钮看不到」） */
table.tbl th.col-act, table.tbl td.col-act {
  position: sticky; right: 0; z-index: 2;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -6px 0 10px -8px rgba(16,24,40,.18);
}
table.tbl thead th.col-act { z-index: 3; }
table.tbl tbody tr:hover td.col-act { background: var(--surface-2); }
[data-theme="dark"] table.tbl th.col-act, [data-theme="dark"] table.tbl td.col-act { box-shadow: -6px 0 10px -8px rgba(0,0,0,.6); }

/* ---------- 角色权限：权限分组勾选 ---------- */
.perm-group { margin-bottom: 14px; }
.perm-group-title {
  font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: .04em;
}
.perm-group .checks { flex-wrap: wrap; }
.load-more { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px 0 4px; }
.load-more .muted { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.row-sub { color: var(--muted); font-size: 11.5px; margin-top: 3px; }

/* ---------- 徽章 / 状态药丸 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.queued, .badge.pending { background: var(--surface-3); color: var(--muted); }
.badge.running, .badge.processing { background: var(--info-soft); color: var(--info); }
.badge.success, .badge.enabled, .badge.online, .badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.error, .badge.failed, .badge.disabled, .badge.offline { background: var(--err-soft); color: var(--err); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
/* 2026-08-12 状态机拆分：润色前/生成中多状态配色 */
.badge.pending_polish { background: var(--surface-3); color: var(--muted); }
.badge.polishing { background: var(--info-soft); color: var(--info); }
.badge.polished { background: var(--ok-soft); color: var(--ok); }
.badge.no_polish { background: var(--surface-3); color: var(--text-2); }
.badge.role-admin { background: var(--accent-soft); color: var(--accent); }
.badge.role-user { background: var(--surface-3); color: var(--text-2); }
.badge.plain::before { display: none; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 9px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all .15s; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent-grad); color: #fff; box-shadow: 0 6px 16px var(--accent-ring); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); box-shadow: 0 8px 22px var(--accent-ring); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); border-color: var(--muted); }
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-soft:hover:not(:disabled) { background: color-mix(in srgb, var(--accent-soft) 80%, var(--accent)); color: #fff; }
.btn-danger { background: var(--err-soft); color: var(--err); }
.btn-danger:hover:not(:disabled) { background: var(--err); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-icon { padding: 8px; border-radius: 9px; background: var(--surface); border-color: var(--border); color: var(--muted); }
.btn-icon:hover { color: var(--text); background: var(--surface-2); }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
label.lbl { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
input.in, select.in, textarea.in {
  width: 100%; background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 13.5px; font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
input.in::placeholder, textarea.in::placeholder { color: var(--muted); }
input.in:focus, select.in:focus, textarea.in:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring);
}
textarea.in { min-height: 220px; resize: vertical; line-height: 1.6; font-family: var(--mono); font-size: 12.5px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); margin-top: 12px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.checks { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 8px; }
.check.inline { display: inline-flex; align-items: center; gap: 6px; margin-top: 0; font-weight: 400; }
.badge.subtle { background: var(--surface-3); color: var(--text-2); }

/* ---------- 角色管理弹窗辅助（persona.html） ---------- */
.op-pick-row { display: flex; align-items: center; gap: 12px; }
.rad { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; color: var(--text); }
.code-sample {
  background: var(--surface-3); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-family: monospace; font-size: 12px; color: var(--text-2);
  white-space: pre-wrap; margin: 0 0 10px; line-height: 1.5;
}

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs .tab {
  padding: 10px 4px; margin-right: 18px; font-size: 13.5px; font-weight: 600;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent;
  transition: color .15s;
}
.tabs .tab:hover { color: var(--text-2); }
.tabs .tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- 提示 / Toast ---------- */
.msg { font-size: 13px; padding: 11px 14px; border-radius: var(--radius-sm); margin-top: 14px; display: none; }
.msg.ok { background: var(--ok-soft); color: var(--ok); display: block; }
.msg.err { background: var(--err-soft); color: var(--err); display: block; }
.msg.warn { background: var(--warn-soft); color: var(--warn); display: block; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--surface); padding: 11px 18px; border-radius: 10px;
  font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transition: all .25s; z-index: 999; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(8, 11, 18, .5);
  backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; z-index: 200;
}
.modal-backdrop.show { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  width: min(560px, 92vw); max-height: 88vh; overflow: auto;
}
.modal-head { display: flex; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 15.5px; }
.modal-head .x { margin-left: auto; border: none; background: none; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }
.modal-body { padding: 20px; }
.modal-foot { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* 模型编辑/新增弹窗：框比默认更宽（更大气），但内部元素保持紧凑，尽量一屏内可操作、无需滚动 */
.modal.xl { width: min(900px, 96vw); max-height: 90vh; border-radius: 14px; }
.modal.xl .modal-head { padding: 16px 22px; }
.modal.xl .modal-head h3 { font-size: 17px; font-weight: 700; }
.modal.xl .modal-head .x { font-size: 22px; }
.modal.xl .modal-body { padding: 18px 22px; }
.modal.xl .modal-foot { padding: 14px 22px; gap: 10px; }
.modal.xl .form-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px 14px; }
.modal.xl label.lbl { font-size: 12.5px; margin-bottom: 5px; }
.modal.xl input.in, .modal.xl select.in { padding: 8px 10px; font-size: 13px; }
.modal.xl .checks { gap: 20px; margin-top: 7px; }
.modal.xl .check.inline { font-size: 13px; }
.modal.xl .check.inline input { width: 16px; height: 16px; accent-color: var(--accent); }
.modal.xl .mt-16 { margin-top: 16px; }
.modal.xl .msg { font-size: 12.5px; }

/* ---------- 代码块 ---------- */
pre.code {
  background: #0e1117; color: #d7e0ee; padding: 16px 18px; border-radius: var(--radius-sm);
  overflow: auto; font-size: 12.5px; line-height: 1.65; margin: 0;
  border: 1px solid #1c2230;
}
[data-theme="dark"] pre.code { background: #0a0c10; border-color: #1c2230; }

/* ---------- 本地 LLM 润色（在「人设角色」页配置） ---------- */
.llm-test { border-top: 1px dashed var(--border-strong); padding-top: 16px; }
.llm-test-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.llm-test-in { width: 100%; min-height: 64px; resize: vertical; line-height: 1.5; font-family: var(--mono); font-size: 13px; }
.muted.ok { color: var(--ok); } .muted.err { color: var(--err); }

code.inline { background: var(--surface-3); padding: 2px 6px; border-radius: 6px; font-size: 12px; color: var(--text); }
.copy-btn {
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
  border-radius: 8px; padding: 5px 10px; font-size: 12px; cursor: pointer; font-family: inherit;
}
.copy-btn:hover { background: var(--surface-2); }

/* ---------- 登录页 ---------- */
.login {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr;
}
.login .aside {
  background: var(--accent-grad); color: #fff; position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; padding: 48px;
}
.login .aside::after {
  content: ""; position: absolute; right: -120px; top: -120px; width: 360px; height: 360px;
  background: rgba(255, 255, 255, .14); border-radius: 50%; filter: blur(8px);
}
.login .aside::before {
  content: ""; position: absolute; left: -80px; bottom: -100px; width: 280px; height: 280px;
  background: rgba(255, 255, 255, .10); border-radius: 50%;
}
.login .aside .brand { background: none; border: none; padding: 0; position: relative; z-index: 1; }
.login .aside .brand .logo { background: rgba(255, 255, 255, .2); box-shadow: none; }
.login .aside .brand .name { color: #fff; } .login .aside .brand .sub { color: rgba(255,255,255,.8); }
.login .aside .hero { position: relative; z-index: 1; }
.login .aside .hero h2 { color: #fff; font-size: 30px; line-height: 1.25; font-weight: 750; letter-spacing: -.02em; }
.login .aside .hero p { color: rgba(255, 255, 255, .85); font-size: 14.5px; margin-top: 14px; max-width: 420px; line-height: 1.7; }
.login .aside .feat { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 12px; }
.login .aside .feat .row { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.95); font-size: 13.5px; }
.login .aside .feat .dot { width: 30px; height: 30px; border-radius: 9px; background: rgba(255,255,255,.16); display: flex; align-items: center; justify-content: center; }
.login .form-side { display: flex; align-items: center; justify-content: center; padding: 32px; background: var(--bg); }
.login .form-card { width: 380px; max-width: 100%; }
.login .form-card h1 { font-size: 22px; }
.login .form-card .sub { color: var(--muted); margin: 6px 0 26px; font-size: 13.5px; }
.login .form-card .fm { margin-bottom: 16px; }
.login .form-card .foot { font-size: 12.5px; color: var(--muted); margin-top: 18px; text-align: center; }
@media (max-width: 820px) { .login { grid-template-columns: 1fr; } .login .aside { display: none; } }

/* ---------- 工具类 ---------- */
.flex { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.section-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 980px) { .grid-2 { grid-template-columns: 1fr; } }
.label-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: var(--surface-3); border-radius: 8px; font-size: 12px; color: var(--text-2); font-family: var(--mono); }
.menu-toggle { display: none; }
@media (max-width: 880px) {
  .menu-toggle { display: inline-flex; }
  .nav-drawer-open .sidebar { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .nav-drawer-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 39; }
}

/* ---------- 关于页面 / 授权卡片 ---------- */
.about-body { color: var(--text-2); font-size: 13.5px; line-height: 1.85; }
.about-body p { margin: 0 0 12px; }
.about-body ul { margin: 0 0 16px; padding-left: 20px; }
.about-body li { margin: 5px 0; }
.about-meta { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 2px; }

.about-meta .row, .lic-rows .row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; font-size: 13px; border-bottom: 1px dashed var(--border);
}
.about-meta .row:last-child, .lic-rows .row:last-child { border-bottom: none; }
.about-meta .row span, .lic-rows .row span { color: var(--muted); }
.about-meta .row b, .lic-rows .row b { font-weight: 600; color: var(--text-2); }

.license-box { display: flex; flex-direction: column; gap: 16px; }
.lic-loading { color: var(--muted); font-size: 13px; }
.lic-state { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; width: fit-content; }
.lic-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.lic-ok    { color: var(--ok);   background: var(--ok-soft); }
.lic-warn  { color: var(--warn); background: var(--warn-soft); }
.lic-bad   { color: var(--err);  background: var(--err-soft); }
.lic-off   { color: var(--muted); background: var(--surface-3); }

.lic-remain { font-size: 20px; font-weight: 700; color: var(--text-2); }
.lic-remain b { color: var(--accent); }
.lic-rows { margin-top: 2px; }
.lic-note { font-size: 12.5px; color: var(--muted); line-height: 1.7; border-top: 1px solid var(--border); padding-top: 12px; }

/* ---------- 续期码输入 ---------- */
.renew-box { display: flex; gap: 8px; margin-top: 14px; }
.renew-box input { flex: 1; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 8px; font-size: 13px; background: var(--surface-2); color: var(--text-2); outline: none; }
.renew-box input:focus { border-color: var(--accent); }
.renew-msg { font-size: 12.5px; min-height: 18px; margin-top: 6px; color: var(--muted); }
.renew-msg.ok { color: var(--ok); }
.renew-msg.err { color: var(--err); }

/* ---------- 机器码复制 ---------- */
.machine-copy { display: inline-flex; align-items: center; gap: 8px; }
.machine-copy code { font-family: var(--mono); font-size: 12px; color: var(--text-2); word-break: break-all; }
.mini-copy { padding: 3px 10px; border: 1px solid var(--accent); border-radius: 6px;
             background: transparent; color: var(--accent); font-size: 12px; cursor: pointer; white-space: nowrap; }
.mini-copy:hover { background: var(--accent-soft); }

/* ---------- 多生成类型（2026-08-23）：生成类型卡片 + 类型徽章 ---------- */
.gt-cards { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.gt-card { display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 10px 16px; border: 1px solid var(--bd); border-radius: 10px; background: var(--bg-2);
  cursor: pointer; transition: .15s; min-width: 92px; }
.gt-card b { font-size: 14px; color: var(--text); }
.gt-card span { font-size: 11.5px; color: var(--muted); }
.gt-card:hover { border-color: var(--accent); }
.gt-card.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent-soft); }
.gt-card.active b { color: var(--accent); }
.gt-badge { display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 11.5px; margin: 0 4px 4px 0; border: 1px solid transparent; }
.gt-badge.txt { background: #e8f0fe; color: #1a56db; border-color: #c5d8fb; }
.gt-badge.img { background: #fde8f3; color: #c2185b; border-color: #f8c9e0; }
.gt-badge.mus { background: #e7f6ec; color: #1b8a4b; border-color: #bfe9cd; }
.gt-badge.vid { background: #fef3e2; color: #b26a00; border-color: #f7d9a8; }
.gt-mini { display: inline-flex; flex-wrap: wrap; vertical-align: middle; }
.gt-check { display: inline-flex; align-items: center; gap: 5px; margin-right: 14px; font-size: 13px; cursor: pointer; }
.gt-check input { width: auto; }
@media (prefers-color-scheme: dark) {
  .gt-badge.txt { background: #1a2a44; color: #8fb4ff; border-color: #28406a; }
  .gt-badge.img { background: #3a1f2e; color: #ff9bc7; border-color: #5a2f44; }
  .gt-badge.mus { background: #16331f; color: #7ee0a3; border-color: #245130; }
  .gt-badge.vid { background: #3a2e16; color: #f0c07a; border-color: #5a4726; }
}
/* ---------- 节点角色管理面板（vLLM 改造 2026-08-23）---------- */
.node-role-list { display: flex; flex-direction: column; gap: 10px; }
.node-role-card { border: 1px solid var(--bd); border-radius: 10px; background: var(--bg-2); padding: 12px 14px; }
/* 客户端级「部署 / 安装 vLLM（整机）」区块：始终可见，不依赖节点 */
.vllm-deploy-card { border: 1px solid var(--accent-soft, #cfe3ff); border-radius: 10px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-3, #f6f9ff)); padding: 14px 16px; margin-bottom: 14px; }
.vllm-deploy-card .vdc-title { font-weight: 700; color: var(--text); font-size: 14.5px; margin-bottom: 2px; }
.nrc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.nrc-name { font-weight: 600; color: var(--text); font-size: 14px; }
.nrc-head .badge { font-size: 11px; }
.nrc-head .muted.mono { font-size: 11.5px; }
/* ---------- 部署 vLLM 三区布局（2026-08-25）：管理区 / 大模型 / 人设角色 ---------- */
.mm-zone { border: 1px solid var(--bd); border-radius: 12px; background: var(--bg-2); padding: 14px 16px; }
.mm-title { font-weight: 700; color: var(--text); font-size: 15px; display: flex; align-items: center; margin-bottom: 8px; }
.mm-row { border: 1px solid var(--bd); border-radius: 10px; background: var(--bg-3, #f6f9ff); padding: 10px 12px; margin-bottom: 10px; }
.mm-row:last-child { margin-bottom: 0; }
.mm-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.mm-head b { color: var(--text); font-size: 14px; }
.mm-head .badge { font-size: 11px; }
.mm-models { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.mm-models .k { color: var(--muted); font-size: 12px; min-width: 64px; }
.mm-models .v { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  background: var(--bg-3, #eef2ff); border: 1px solid var(--bd); font-size: 12px; color: var(--text); }
[data-theme="dark"] .chip { background: #172347; border-color: #27407a; color: #cbd5e1; }
[data-theme="dark"] .mm-row { background: #16203a; }
[data-theme="dark"] .vllm-deploy-card { background: linear-gradient(180deg, #16203a, #131c33); }

/* ---------- 按卡实例规格可视化配置器（comfyui_gpus） ---------- */
.gpus-builder{display:flex;flex-direction:column;gap:8px;margin-top:4px}
.gpu-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:9px 11px;background:var(--bg,#fff);border:1px solid var(--bd,#e2e8f0);border-radius:9px}
[data-theme="dark"] .gpu-row{background:#10192f;border-color:#22324f}
.gpu-row .gpu-id{font-weight:700;font-size:12.5px;color:var(--accent,#3b5bdb);min-width:48px}
.gpu-fld{display:flex;align-items:center;gap:7px}
.gpu-fld .lbl{font-size:12px;color:var(--muted,#64748b)}
.stepper{display:inline-flex;align-items:center;border:1px solid var(--bd,#e2e8f0);border-radius:7px;overflow:hidden}
.stepper .step-btn{width:24px;height:26px;border:none;background:var(--bg-3,#f1f5f9);color:var(--text);font-size:14px;cursor:pointer;line-height:1}
.stepper .step-btn:hover{background:var(--accent-soft,#e7ecff);color:var(--accent)}
.stepper .gpu-inst{width:42px;height:26px;border:none;text-align:center;font-size:13px;background:var(--bg,#fff);color:var(--text);-moz-appearance:textfield}
.stepper .gpu-inst::-webkit-outer-spin-button,.stepper .gpu-inst::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.gpu-fld .chk{display:inline-flex;align-items:center;gap:4px;font-size:12.5px;color:var(--text);cursor:pointer;user-select:none}
.gpu-fld .chk input{accent-color:var(--accent,#3b5bdb)}
.gpu-del{border:none;background:transparent;color:var(--err,#d23);cursor:pointer;font-size:13px;padding:2px 6px;border-radius:6px;margin-left:auto}
.gpu-del:hover{background:var(--err-soft,#fde8e8)}
.gpus-json{margin-top:8px;background:var(--bg-3,#f8fafc);border:1px solid var(--bd,#e2e8f0);border-radius:8px;padding:8px 10px;font-family:var(--mono,monospace);font-size:11.5px;color:var(--muted,#64748b);white-space:pre-wrap;max-height:180px;overflow:auto}

