/* Inter 字体本地化（woff2 子集在 static/vendor/fonts/，来源 Google Fonts Inter v20 可变字体） */
@import url('vendor/inter-fonts.css');

/* ── 设计令牌 ── */
:root {
  color-scheme: light;

  /* 品牌色 */
  --accent: #0f766e;
  --accent-light: #e6f2f0;
  --accent-hover: #0d6b63;
  --font-body: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* 严重级别色 (Acunetix 风格) */
  --critical: #dc2626;
  --critical-bg: #fef2f2;
  --high: #ea580c;
  --high-bg: #fff7ed;
  --medium: #ca8a04;
  --medium-bg: #fefce8;
  --low: #2563eb;
  --low-bg: #eff6ff;
  --info: #16a34a;
  --info-bg: #f0fdf4;

  /* 中性色 */
  --bg: #f1f5f9;
  --panel: #ffffff;
  --ink: #0f172a;
  --ink-secondary: #475569;
  --muted: #94a3b8;
  --line: #e2e8f0;
  --line-light: #f1f5f9;
  --page-gradient-start: #f8fafc;
  --surface-subtle: #f8fafc;
  --surface-alt: #fafbfc;
  --surface-hover: #f1f5f9;
  --input-bg: #ffffff;
  --code-bg: #e2e8f0;
  --code-panel-bg: #1e293b;
  --code-panel-ink: #e2e8f0;
  --overlay: rgba(15,23,42,.6);
  --chart-grid: #e2e8f0;
  --chart-border: #ffffff;
  --chart-accent: var(--accent);

  /* 侧边栏 */
  --sidebar-bg: #0f172a;
  --sidebar-ink: #e2e8f0;
  --sidebar-strong: #ffffff;
  --sidebar-muted: #94a3b8;
  --sidebar-subtle: #64748b;
  --sidebar-hover: #1e293b;
  --sidebar-border: #334155;

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(15,23,42,.04);
  --shadow: 0 2px 8px rgba(15,23,42,.07), 0 1px 2px rgba(15,23,42,.05);
  --shadow-md: 0 8px 20px rgba(15,23,42,.08), 0 2px 6px rgba(15,23,42,.05);
  --shadow-lg: 0 20px 40px rgba(15,23,42,.14), 0 6px 12px rgba(15,23,42,.06);

  /* 圆角 */
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* 间距 */
  --space: 20px;
  --space-sm: 10px;
  --space-lg: 28px;

  /* 过渡 */
  --transition: 150ms ease;
}

html[data-theme="dark"] {
  color-scheme: dark;

  --accent: #0c2d28;
  --accent-light: #0a211e;
  --accent-hover: #164a42;
  --accent-readable: #78b8ad;

  --critical: #ef8f8f;
  --critical-bg: #3f1519;
  --high: #d8995c;
  --high-bg: #3f2412;
  --medium: #d7bd55;
  --medium-bg: #3a3010;
  --low: #7aa7d9;
  --low-bg: #102b4f;
  --info: #78b891;
  --info-bg: #12351f;

  --bg: #08111f;
  --panel: #111827;
  --ink: #e5edf7;
  --ink-secondary: #b4c2d5;
  --muted: #7f8ea3;
  --line: #263449;
  --line-light: #1c2738;
  --page-gradient-start: #0b1422;
  --surface-subtle: #162132;
  --surface-alt: #131d2b;
  --surface-hover: #1d2a3d;
  --input-bg: #0b1220;
  --code-bg: #223049;
  --code-panel-bg: #060b14;
  --code-panel-ink: #dbeafe;
  --overlay: rgba(2,6,23,.72);
  --chart-grid: #263449;
  --chart-border: #111827;
  --chart-accent: #5f9f95;

  --sidebar-bg: #050b14;
  --sidebar-ink: #d7e2f0;
  --sidebar-strong: #f8fafc;
  --sidebar-muted: #91a0b5;
  --sidebar-subtle: #718096;
  --sidebar-hover: #101a2a;
  --sidebar-border: #253149;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.26);
  --shadow: 0 2px 8px rgba(0,0,0,.34), 0 1px 2px rgba(0,0,0,.24);
  --shadow-md: 0 10px 26px rgba(0,0,0,.38), 0 2px 8px rgba(0,0,0,.28);
  --shadow-lg: 0 24px 52px rgba(0,0,0,.5), 0 8px 18px rgba(0,0,0,.34);
}

html[data-theme="dark"] a,
html[data-theme="dark"] .balance-value,
html[data-theme="dark"] .stats .stat-card.neutral .stat-value,
html[data-theme="dark"] .toolbar .selected-count,
html[data-theme="dark"] .stats.stats-clickable a.stat-card.active {
  color: var(--accent-readable);
}
html[data-theme="dark"] a:hover,
html[data-theme="dark"] button.sub-link:hover {
  color: #9dccd5;
}
html[data-theme="dark"] .sidebar nav a.active,
html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .tabs a.active,
html[data-theme="dark"] .tabs button.active,
html[data-theme="dark"] .pagination button.active {
  background: var(--accent);
  border-color: #23645a;
  color: #d9fff8;
}

/* ── 重置 ── */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, var(--page-gradient-start) 0%, var(--bg) 42%);
  font: 14px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { margin: 0 0 12px; font-weight: 700; letter-spacing: 0; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
p { color: var(--ink-secondary); margin: 0 0 12px; line-height: 1.7; }

/* ── 侧边栏 ── */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 240px;
  background: var(--sidebar-bg);
  color: var(--sidebar-ink);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  z-index: 100;
  overflow-y: auto;
}
.brand {
  font-size: 1.25rem;
  font-weight: 700;
  padding: 0 12px;
  color: var(--sidebar-strong);
  letter-spacing: 0;
}
.brand span { color: var(--accent); }
.sidebar nav {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 6px;
  flex: 1;
}
.sidebar nav a {
  color: var(--sidebar-muted);
  min-height: 40px;
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 500;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar nav a:hover { background: var(--sidebar-hover); color: var(--sidebar-ink); }
.sidebar nav a.active { background: var(--accent); color: #fff; box-shadow: inset 3px 0 0 rgba(255,255,255,.5); }
.sidebar nav a .nav-icon { font-size: 1.1rem; width: 20px; text-align: center; }
.sidebar nav .nav-group { display: contents; }
.sidebar nav .nav-group summary {
  color: var(--sidebar-muted);
  min-height: 40px;
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 500;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}
.sidebar nav .nav-group summary::-webkit-details-marker { display: none; }
.sidebar nav .nav-group summary::after { content: "▸"; margin-left: auto; font-size: .7rem; opacity: .6; transition: transform var(--transition); }
.sidebar nav .nav-group[open] summary::after { transform: rotate(90deg); }
.sidebar nav .nav-group summary:hover { background: var(--sidebar-hover); color: var(--sidebar-ink); }
.sidebar nav .nav-group summary.active { background: var(--accent); color: #fff; box-shadow: inset 3px 0 0 rgba(255,255,255,.5); }
.sidebar nav .nav-subnav { display: flex; flex-direction: column; gap: 6px; padding: 6px 0 0 18px; }
.sidebar nav .nav-subnav a { font-size: .85rem; min-height: 36px; }
.sidebar form { margin-top: auto; }
.sidebar form button {
  width: 100%;
  background: transparent;
  color: var(--sidebar-muted);
  border: 1px solid var(--sidebar-border);
  padding: 10px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: .9rem;
  transition: all var(--transition);
}
.sidebar form button:hover { background: var(--sidebar-hover); color: #f87171; border-color: #f87171; }
.sidebar-user {
  padding: 8px 12px;
  border-top: 1px solid var(--sidebar-hover);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}
.sidebar-user-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-user-copy span:first-child {
  overflow: hidden;
  color: var(--sidebar-ink);
  font-size: .85rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-role {
  font-size: .7rem;
  color: var(--sidebar-subtle);
  text-transform: uppercase;
  letter-spacing: 0;
}
.sidebar-password-link {
  width: fit-content;
  margin: 3px 0 2px;
  color: var(--sidebar-muted);
  font-size: .7rem;
  text-decoration: none;
}
.sidebar-password-link:hover { color: var(--sidebar-ink); text-decoration: underline; }
.sidebar-build-meta {
  overflow: hidden;
  color: var(--sidebar-subtle);
  font-size: .66rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-role + .sidebar-build-meta { margin-top: 4px; }
.theme-toggle {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  color: var(--sidebar-muted);
  border: 1px solid transparent;
  border-radius: 6px;
}
.theme-toggle:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-ink);
  border-color: var(--sidebar-border);
}
.theme-toggle-icon {
  width: auto;
  text-align: center;
  font-size: 1rem;
}

/* ── 主内容区 ── */
.main {
  margin-left: 240px;
  padding: 32px;
  min-height: 100vh;
}
.login-main {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f766e 100%);
}
.login-panel {
  width: min(420px, 100%);
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
}
.login-panel h1 { text-align: center; font-size: 1.4rem; }
.login-panel .brand-sub { text-align: center; color: var(--muted); font-size: .85rem; margin-bottom: 24px; }

/* 登录页错误提示：行业通行内联模式（GitHub/Google/飞书同款），一行小字显示在密码框正下方，
   卡片自然长高一行；不弹大框、不预留空位、不做浮层 */
.field-msg { color: var(--critical); font-size: .82rem; margin: 0; }
.field-msg-ok { color: #15803d; }
html[data-theme="dark"] .field-msg { color: #fca5a5; }
html[data-theme="dark"] .field-msg-ok { color: #86efac; }

/* ── 用户协议同意页（复用 .login-panel 外观，随视口宽度自适应，不再卡死一个固定像素值） ── */
.agreement-panel { width: min(1100px, 92vw); }
.agreement-header { text-align: center; margin-bottom: 22px; }
.agreement-header-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent-light); font-size: 1.5rem; margin-bottom: 10px;
}
.agreement-header h1 { font-size: 1.4rem; margin: 0 0 6px; }
.agreement-header .agreement-lead { color: var(--ink-secondary); font-size: .88rem; margin: 0 0 12px; }

/* 三份文档卡片：复用 .stat-card 的左边框配色语言，每份文档一个强调色，一眼区分 */
.agreement-docs { display: grid; gap: 14px; }
.agreement-doc {
  position: relative;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.agreement-doc--disclaimer { border-left: 3px solid var(--high); }
.agreement-doc--privacy { border-left: 3px solid var(--low); }
/* 标签页切换效果：点击侧边栏锚点后，对应卡片高亮、其他变淡 */
.agreement-doc { transition: opacity 0.2s, background 0.2s; }
/* 当页面有任一锚点激活时，所有卡片默认半透明 */
.agreement-doc:target,
.agreement-doc:target ~ .agreement-doc { opacity: 0.5; }
/* 被激活的那个卡片恢复完全不透明 + 背景高亮 */
.agreement-doc:target { opacity: 1 !important; background: var(--surface); }
.agreement-doc header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.agreement-doc-icon { font-size: 1.05rem; line-height: 1; }
.agreement-doc h3 { margin: 0; font-size: .92rem; }
.agreement-doc-body {
  max-height: 230px;
  overflow-y: auto;
  /* pre-line：保留条款/子项之间人为的换行，但每一条内部按容器实际宽度自然折行，
     不会因为源码里为了控制单行长度而手动插入的旧换行符，导致文字挤成一条窄栏。 */
  white-space: pre-line;
  word-break: break-word;
  font-size: .83rem;
  line-height: 1.75;
  color: var(--ink-secondary);
  padding-right: 6px;
  margin-bottom: -4px;
}
/* 滚动区底部渐隐提示"还有更多内容"，纯 CSS 不拦截滚动 */
.agreement-doc:not(.agreement-doc--flat)::after {
  content: "";
  position: absolute;
  left: 18px; right: 18px; bottom: 16px;
  height: 26px;
  background: linear-gradient(to bottom, transparent, var(--surface-subtle));
  pointer-events: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
/* 独立协议页：文档完整展开不截断，不需要渐隐提示 */
.agreement-doc--flat .agreement-doc-body { max-height: none; overflow: visible; margin-bottom: 0; }

.agreement-consent {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--accent-light); border-radius: var(--radius);
  padding: 14px 16px; margin: 6px 0 0; font-size: .85rem;
}
.agreement-consent input[type="checkbox"] { margin-top: 3px; flex-shrink: 0; width: 16px; height: 16px; }
.agreement-actions { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; margin-top: 6px; }
.agreement-actions .btn-primary, .agreement-actions .btn-ghost { padding: 10px 22px; }
html[data-theme="dark"] .agreement-doc { background: var(--surface-subtle); }

/* ── 文档中心（/docs；/policies 为历史兼容入口） ── */
.docs-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.docs-overview-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 16px 18px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.docs-overview-card:hover {
  color: var(--ink);
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.docs-overview-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-light);
  font-size: 1.2rem;
}
.docs-overview-card span:last-child { display: grid; min-width: 0; gap: 3px; }
.docs-overview-card strong { font-size: .94rem; }
.docs-overview-card small { color: var(--muted); font-size: .78rem; }
.docs-overview--all { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.docs-section {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.docs-standalone { width: 100%; }
.tutorial-steps { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.tutorial-steps li { position: relative; display: flex; gap: 14px; padding: 0 0 20px; }
.tutorial-steps li:last-child { padding-bottom: 0; }
.tutorial-steps li:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 31px;
  bottom: 3px;
  left: 14px;
  width: 1px;
  background: var(--line);
}
.tutorial-step-number {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 29px;
  width: 29px;
  height: 29px;
  color: #fff;
  background: var(--accent);
  border-radius: 50%;
  font-size: .78rem;
  font-weight: 700;
}
.tutorial-steps h3 { margin: 3px 0 5px; font-size: .92rem; }
.tutorial-steps p { margin: 0; color: var(--ink-secondary); font-size: .84rem; line-height: 1.65; }
.docs-callout {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding: 12px 14px;
  color: var(--ink-secondary);
  background: var(--accent-light);
  border-radius: var(--radius);
  font-size: .82rem;
  line-height: 1.6;
}
.docs-callout strong { flex: 0 0 auto; color: var(--accent); }
.changelog-list { display: grid; gap: 0; }
.changelog-entry { position: relative; padding: 0 0 24px 22px; border-left: 1px solid var(--line); }
.changelog-entry:last-child { padding-bottom: 0; }
.changelog-entry::before {
  content: "";
  position: absolute;
  top: 5px;
  left: -5px;
  width: 9px;
  height: 9px;
  background: var(--accent);
  border: 2px solid var(--surface);
  border-radius: 50%;
}
.changelog-meta { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.changelog-meta time { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.changelog-entry h3 { margin: 0 0 8px; font-size: .94rem; }
.changelog-entry ul { margin: 0; padding-left: 18px; color: var(--ink-secondary); font-size: .84rem; line-height: 1.75; }
.docs-agreement-status {
  color: var(--ink-secondary);
  font-size: .82rem;
  margin: -8px 0 16px;
}
.docs-standalone-agreement { width: 100%; }
.docs-standalone-agreement .agreement-doc-body { font-size: .88rem; }

@media (max-width: 900px) {
  .docs-overview { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .docs-section { padding: 17px; }
  .docs-overview-card { padding: 14px; }
  .docs-callout { display: grid; }
}

/* ── 使用教程：图解式长文档 ── */
.tutorial-page-head { margin-bottom: 16px; }
.tutorial-eyebrow,
.tutorial-section-label {
  display: block;
  color: var(--accent);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .14em;
  line-height: 1.4;
}
.tutorial-page-head .tutorial-eyebrow { margin-bottom: 4px; }

section.tutorial-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr);
  align-items: center;
  gap: clamp(28px, 5vw, 68px);
  min-height: 360px;
  margin-bottom: 26px;
  padding: clamp(30px, 5vw, 58px);
  overflow: hidden;
  color: #f8fafc;
  background:
    radial-gradient(circle at 78% 14%, rgba(45,212,191,.2), transparent 28%),
    radial-gradient(circle at 3% 100%, rgba(14,116,144,.24), transparent 35%),
    linear-gradient(135deg, #07131f 0%, #0d2530 52%, #0e3c38 100%);
  border: 1px solid rgba(148,163,184,.22);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}
section.tutorial-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image:
    linear-gradient(rgba(148,163,184,.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,184,.18) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(90deg, transparent, #000 50%, #000);
}
.tutorial-hero-copy,
.tutorial-hero-visual { position: relative; z-index: 1; min-width: 0; }
.tutorial-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: #99f6e4;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.tutorial-kicker-dot {
  width: 8px;
  height: 8px;
  background: #2dd4bf;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(45,212,191,.12);
}
.tutorial-hero h2 {
  max-width: 620px;
  margin-bottom: 14px;
  color: #fff;
  font-size: clamp(1.85rem, 3.2vw, 2.8rem);
  line-height: 1.18;
  letter-spacing: -.035em;
}
.tutorial-hero-copy > p {
  max-width: 640px;
  margin-bottom: 24px;
  color: #cbd5e1;
  font-size: .94rem;
  line-height: 1.85;
}
.tutorial-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.tutorial-hero-actions .btn-primary,
.tutorial-hero-actions .btn-ghost { padding: 9px 15px; }
.tutorial-hero-actions .btn-primary {
  color: #042f2e;
  background: #5eead4;
  border-color: #5eead4;
}
.tutorial-hero-actions .btn-primary:hover { color: #042f2e; background: #99f6e4; }
.tutorial-hero-actions .btn-ghost {
  color: #e2e8f0;
  background: rgba(15,23,42,.34);
  border-color: rgba(148,163,184,.35);
}
.tutorial-hero-actions .btn-ghost:hover { color: #fff; background: rgba(30,41,59,.65); }

.tutorial-hero-visual {
  padding: 14px;
  background: rgba(2,6,23,.58);
  border: 1px solid rgba(148,163,184,.28);
  border-radius: 16px;
  box-shadow: 0 28px 70px rgba(0,0,0,.32);
  backdrop-filter: blur(10px);
  transform: rotate(1deg);
}
.tutorial-visual-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 2px 2px 12px;
  color: #94a3b8;
  font-size: .68rem;
}
.tutorial-window-dots { display: flex; gap: 5px; }
.tutorial-window-dots i { width: 6px; height: 6px; background: #475569; border-radius: 50%; }
.tutorial-window-dots i:nth-child(2) { background: #64748b; }
.tutorial-window-dots i:nth-child(3) { background: #0f766e; }
.tutorial-online { justify-self: end; display: inline-flex; align-items: center; gap: 5px; color: #86efac; }
.tutorial-online i,
.tutorial-device-status i {
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(34,197,94,.12);
}
.tutorial-visual-api {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: rgba(15,23,42,.78);
  border: 1px solid rgba(94,234,212,.2);
  border-radius: 12px;
}
.tutorial-visual-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #042f2e;
  background: #5eead4;
  border-radius: 10px;
}
.tutorial-visual-api > span:nth-child(2) { display: grid; gap: 1px; min-width: 0; }
.tutorial-visual-api small { color: #94a3b8; font-size: .64rem; }
.tutorial-visual-api strong { overflow: hidden; color: #f8fafc; font-size: .84rem; text-overflow: ellipsis; white-space: nowrap; }
.tutorial-mini-flow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 18px 3px;
}
.tutorial-mini-flow span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #cbd5e1;
  font-size: .68rem;
  white-space: nowrap;
}
.tutorial-mini-flow b { color: #5eead4; font-size: .58rem; }
.tutorial-mini-flow i { color: #475569; font-style: normal; }
.tutorial-visual-result {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px 14px;
  color: #94a3b8;
  background: rgba(15,118,110,.15);
  border: 1px solid rgba(45,212,191,.24);
  border-radius: 10px;
  font-size: .68rem;
}
.tutorial-visual-result span { display: inline-flex; align-items: center; gap: 8px; }
.tutorial-visual-result strong { color: #99f6e4; font-size: .7rem; }
.tutorial-result-pulse { width: 7px; height: 7px; background: #2dd4bf; border-radius: 50%; box-shadow: 0 0 0 4px rgba(45,212,191,.12); }

.tutorial-shell {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: start;
  gap: 22px;
}
.tutorial-toc {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 4px;
  padding: 15px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.tutorial-toc > strong { padding: 0 9px 8px; color: var(--ink); font-size: .76rem; }
.tutorial-toc a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 7px 9px;
  color: var(--ink-secondary);
  border-radius: 7px;
  font-size: .76rem;
  font-weight: 600;
}
.tutorial-toc a:hover { color: var(--accent); background: var(--accent-light); }
.tutorial-toc a span { color: var(--muted); font-size: .62rem; font-variant-numeric: tabular-nums; }
.tutorial-content { min-width: 0; }
section.tutorial-chapter {
  scroll-margin-top: 20px;
  margin-bottom: 22px;
  padding: clamp(22px, 3vw, 34px);
  overflow: hidden;
}
.tutorial-chapter-head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 15px;
  margin-bottom: 24px;
}
.tutorial-chapter-no {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--accent);
  background: var(--accent-light);
  border-radius: 11px;
  font-size: .72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.tutorial-chapter-head h2 { margin: 2px 0 4px; font-size: 1.3rem; }
.tutorial-chapter-head p { max-width: 820px; margin: 0; font-size: .85rem; }

.tutorial-route-map {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}
.tutorial-route-map li {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0 8px;
  text-align: center;
}
.tutorial-route-map li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 22px;
  left: calc(50% + 28px);
  right: calc(-50% + 28px);
  height: 1px;
  background: linear-gradient(90deg, var(--accent), var(--line));
}
.tutorial-route-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--accent);
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: 14px;
  font-size: 1rem;
  box-shadow: 0 0 0 5px var(--panel);
}
.tutorial-route-map li > span:last-child { display: grid; gap: 2px; min-width: 0; }
.tutorial-route-map small { color: var(--muted); font-size: .62rem; }
.tutorial-route-map strong { font-size: .8rem; }
.tutorial-route-map em { overflow: hidden; color: var(--ink-secondary); font-size: .66rem; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.tutorial-first-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.tutorial-first-steps > article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 16px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.tutorial-first-step-no {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  background: var(--accent);
  border-radius: 11px;
  font-size: .66rem;
  font-weight: 900;
}
.tutorial-first-steps h3 { margin: 3px 0 5px; font-size: .86rem; }
.tutorial-first-steps p { margin: 0 0 7px; font-size: .7rem; line-height: 1.55; }
.tutorial-role-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.tutorial-role-grid > div {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
}
.tutorial-role-grid p { margin: 0; font-size: .75rem; line-height: 1.5; }
.tutorial-role-grid strong { color: var(--ink); }
.tutorial-role-mark {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  color: #fff;
  background: var(--accent);
  border-radius: 50%;
  font-size: .65rem;
  font-weight: 800;
}
.tutorial-role-mark.user { background: var(--low); }
.tutorial-role-mark.tenant-admin { background: #8e44ad; }
.tutorial-role-mark.analyst { color: var(--ink); background: var(--code-bg); }
.tutorial-callout-warning { color: var(--ink-secondary); background: var(--high-bg); }
.tutorial-callout-warning strong { color: var(--high); }

.tutorial-recommend-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  padding: 20px;
  background: linear-gradient(110deg, var(--accent-light), var(--surface-subtle));
  border: 1px solid rgba(15,118,110,.24);
  border-radius: var(--radius-lg);
}
.tutorial-recommend-badge {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  color: #fff;
  background: var(--accent);
  border-radius: 16px;
  font-size: .82rem;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(15,118,110,.2);
}
.tutorial-recommend-label,
.tutorial-mode-tag {
  display: inline-flex;
  width: fit-content;
  padding: 2px 7px;
  color: var(--accent);
  background: var(--panel);
  border: 1px solid rgba(15,118,110,.2);
  border-radius: 99px;
  font-size: .62rem;
  font-weight: 700;
}
.tutorial-recommend-card h3 { margin: 4px 0 4px; font-size: 1.05rem; }
.tutorial-recommend-card p { margin: 0; font-size: .78rem; line-height: 1.65; }
.tutorial-recommend-facts { display: grid; grid-template-columns: repeat(3, auto); gap: 8px; }
.tutorial-recommend-facts span {
  display: grid;
  min-width: 70px;
  gap: 1px;
  padding: 9px 10px;
  color: var(--ink-secondary);
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(15,118,110,.12);
  border-radius: 9px;
  font-size: .62rem;
  text-align: center;
}
html[data-theme="dark"] .tutorial-recommend-facts span { background: rgba(15,23,42,.42); }
.tutorial-recommend-facts b { color: var(--accent); font-size: .82rem; }

.tutorial-config-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  gap: 18px;
  margin-bottom: 28px;
}
.tutorial-form-shot {
  overflow: hidden;
  color: #e2e8f0;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 13px;
  box-shadow: 0 16px 30px rgba(15,23,42,.13);
}
.tutorial-shot-head,
.tutorial-shot-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 15px;
  background: #111c2d;
  border-bottom: 1px solid #293548;
  font-size: .74rem;
  font-weight: 700;
}
.tutorial-shot-head > span:first-child { display: flex; align-items: center; gap: 7px; }
.tutorial-shot-head i { width: 7px; height: 7px; background: #2dd4bf; border-radius: 50%; box-shadow: 0 0 0 4px rgba(45,212,191,.12); }
.tutorial-form-shot dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 14px; }
.tutorial-form-shot dl > div { min-width: 0; padding: 8px 10px; background: #172235; border: 1px solid #2b3a50; border-radius: 8px; }
.tutorial-form-shot dl > div.is-highlight { border-color: #2dd4bf; box-shadow: 0 0 0 2px rgba(45,212,191,.08); }
.tutorial-form-shot dt { margin-bottom: 3px; color: #94a3b8; font-size: .6rem; }
.tutorial-form-shot dd { overflow: hidden; margin: 0; color: #f8fafc; font: 600 .68rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.tutorial-shot-actions { border-top: 1px solid #293548; border-bottom: 0; color: #94a3b8; font-weight: 500; }
.tutorial-shot-actions b { padding: 5px 9px; color: #042f2e; background: #5eead4; border-radius: 6px; font-size: .66rem; }
.tutorial-config-notes { padding: 8px 2px; }
.tutorial-config-notes h3 { margin-bottom: 14px; font-size: .95rem; }
.tutorial-number-list { display: grid; gap: 14px; margin: 0 0 16px; padding: 0; list-style: none; }
.tutorial-number-list li { display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.tutorial-number-list li > span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--accent);
  background: var(--accent-light);
  border-radius: 50%;
  font-size: .66rem;
  font-weight: 800;
}
.tutorial-number-list p { display: grid; gap: 2px; margin: 0; font-size: .76rem; line-height: 1.55; }
.tutorial-number-list strong { color: var(--ink); }
.tutorial-number-list code,
.tutorial-compat-table code,
.tutorial-compat-summary code,
.tutorial-status-note code,
.tutorial-faq code,
.tutorial-check-list code {
  width: fit-content;
  max-width: 100%;
  padding: 1px 5px;
  overflow-wrap: anywhere;
  color: var(--ink);
  background: var(--code-bg);
  border-radius: 4px;
  font-size: .68rem;
}
.tutorial-inline-link { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 700; }
.tutorial-inline-link span { transition: transform var(--transition); }
.tutorial-inline-link:hover span { transform: translateX(3px); }
.tutorial-subhead { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 0 0 12px; }
.tutorial-subhead h3 { margin: 2px 0 0; font-size: 1.02rem; }
.tutorial-subhead p { margin: 0; font-size: .75rem; }
.tutorial-protocol-diagram {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  background: var(--surface-subtle);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.tutorial-protocol-diagram > span { display: grid; min-width: 0; gap: 2px; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; }
.tutorial-protocol-diagram > span.is-success { border-color: rgba(22,163,74,.38); }
.tutorial-protocol-diagram small { color: var(--muted); font-size: .58rem; }
.tutorial-protocol-diagram b { overflow: hidden; color: var(--ink); font: 600 .66rem/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.tutorial-protocol-diagram > i { color: var(--muted); font-style: normal; font-weight: 700; }
.tutorial-compat-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tutorial-compat-summary article { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.tutorial-compat-summary article.is-supported { background: var(--info-bg); border-color: rgba(22,163,74,.3); }
.tutorial-compat-summary article.is-unsupported { background: var(--critical-bg); border-color: rgba(220,38,38,.25); }
.tutorial-compat-summary h4 { margin: 10px 0 5px; color: var(--ink); font-size: .82rem; }
.tutorial-compat-summary p { margin: 0; color: var(--ink-secondary); font-size: .72rem; line-height: 1.65; }
.tutorial-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.tutorial-compat-table { min-width: 780px; font-size: .75rem; }
.tutorial-compat-table th { color: var(--muted); background: var(--surface-subtle); font-size: .66rem; text-transform: uppercase; letter-spacing: .04em; }
.tutorial-compat-table td { vertical-align: top; line-height: 1.55; }
.tutorial-compat-table td:first-child { min-width: 145px; }
.tutorial-compat-table td:nth-child(3) { min-width: 230px; }
.tutorial-compat-table td strong,
.tutorial-compat-table td small { display: block; }
.tutorial-compat-table td small { color: var(--muted); font-size: .65rem; }
.tutorial-status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: .64rem;
  font-weight: 700;
  white-space: nowrap;
}
.tutorial-status-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.tutorial-status-dot.ok { color: var(--info); background: var(--info-bg); }
.tutorial-status-dot.ok::before { background: var(--info); }
.tutorial-status-dot.maybe { color: var(--medium); background: var(--medium-bg); }
.tutorial-status-dot.maybe::before { background: var(--medium); }
.tutorial-status-dot.no { color: var(--critical); background: var(--critical-bg); }
.tutorial-status-dot.no::before { background: var(--critical); }
.tutorial-tip-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.tutorial-tip-grid article,
.tutorial-result-grid article {
  padding: 15px;
  background: var(--surface-subtle);
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
}
.tutorial-tip-grid article > span,
.tutorial-result-grid article > span { color: var(--accent); font-size: 1rem; }
.tutorial-tip-grid h4 { margin: 6px 0 3px; font-size: .78rem; }
.tutorial-tip-grid p { margin: 0; font-size: .7rem; line-height: 1.55; }
.tutorial-source-note { margin: 12px 0 0; color: var(--muted); font-size: .66rem; text-align: right; }

.tutorial-node-create-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .8fr);
  align-items: center;
  gap: 24px;
  margin-bottom: 18px;
  padding: 20px;
  background: linear-gradient(135deg, var(--surface-subtle), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.tutorial-node-create-card h3 { margin: 10px 0 6px; font-size: .96rem; }
.tutorial-node-create-card p { margin-bottom: 10px; font-size: .76rem; }
.tutorial-node-create-fields { display: grid; grid-template-columns: 1fr 90px; gap: 8px; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.tutorial-node-create-fields span { display: grid; gap: 3px; padding: 9px 10px; background: var(--surface-subtle); border: 1px solid var(--line-light); border-radius: 7px; }
.tutorial-node-create-fields small { color: var(--muted); font-size: .56rem; }
.tutorial-node-create-fields b { color: var(--ink); font: 600 .68rem/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
.tutorial-node-create-fields > strong { grid-column: 1 / -1; justify-self: end; padding: 6px 10px; color: #042f2e; background: #5eead4; border-radius: 6px; font-size: .66rem; }
.tutorial-node-enroll-guide {
  display: grid;
  grid-template-columns: minmax(300px, .9fr) minmax(0, 1.1fr);
  align-items: stretch;
  gap: 14px;
  margin-bottom: 18px;
}
.tutorial-node-location-card { display: grid; overflow: hidden; background: var(--surface-subtle); border: 2px solid var(--accent); border-radius: var(--radius-lg); box-shadow: 0 10px 28px rgba(15,118,110,.1); }
.tutorial-node-location-card header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 15px; background: var(--panel); border-bottom: 1px solid var(--line); }
.tutorial-node-location-card header span { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: .76rem; font-weight: 800; }
.tutorial-node-location-card header i { width: 8px; height: 8px; background: var(--medium); border-radius: 50%; box-shadow: 0 0 0 4px var(--medium-bg); }
.tutorial-node-location-card header b { color: var(--medium); font-size: .62rem; }
.tutorial-node-location-card > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 15px; }
.tutorial-node-location-card > div span { display: grid; gap: 3px; padding: 9px; color: var(--ink); background: var(--panel); border: 1px solid var(--line-light); border-radius: 8px; font-size: .7rem; font-weight: 700; }
.tutorial-node-location-card > div small { color: var(--muted); font-size: .56rem; font-weight: 500; }
.tutorial-node-location-card footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 15px; background: var(--accent-light); border-top: 1px solid rgba(15,118,110,.26); }
.tutorial-node-location-card footer em { margin-right: auto; color: var(--accent); font-size: .62rem; font-style: normal; font-weight: 900; }
.tutorial-node-location-card footer strong,
.tutorial-node-location-card footer b { padding: 6px 10px; border-radius: 7px; font-size: .68rem; }
.tutorial-node-location-card footer strong { color: var(--ink); background: var(--panel); border: 2px solid var(--accent); }
.tutorial-node-location-card footer b { color: #042f2e; background: #5eead4; }
.tutorial-node-enroll-steps { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tutorial-node-enroll-steps li { display: grid; grid-template-columns: auto 1fr; gap: 9px; padding: 10px 12px; background: var(--surface-subtle); border: 1px solid var(--line-light); border-radius: var(--radius); }
.tutorial-node-enroll-steps li > span { display: grid; place-items: center; width: 24px; height: 24px; color: #fff; background: var(--accent); border-radius: 7px; font-size: .6rem; font-weight: 800; }
.tutorial-node-enroll-steps p { margin: 0; font-size: .7rem; line-height: 1.55; }
.tutorial-node-enroll-steps strong { display: block; color: var(--ink); }
.tutorial-requirements { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tutorial-requirements > div { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--surface-subtle); border: 1px solid var(--line-light); border-radius: var(--radius); }
.tutorial-requirements > div > span { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; color: var(--accent); background: var(--accent-light); border-radius: 8px; }
.tutorial-requirements p { display: grid; gap: 1px; margin: 0; }
.tutorial-requirements strong { color: var(--muted); font-size: .6rem; font-weight: 600; }
.tutorial-requirements b { color: var(--ink); font-size: .76rem; }
.tutorial-requirements > div.is-required { background: #fff7ed; border-color: #fdba74; }
.tutorial-requirements > div.is-required > span { color: #c2410c; background: #ffedd5; }
.tutorial-requirements > div.is-required strong { color: #9a3412; }
.tutorial-storage-warning {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(130px, .3fr);
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding: 15px;
  color: #7c2d12;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: var(--radius);
}
.tutorial-storage-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #fff;
  background: #c2410c;
  border-radius: 50%;
  font-size: .9rem;
  font-weight: 900;
}
.tutorial-storage-warning strong { color: #9a3412; font-size: .78rem; }
.tutorial-storage-warning p { margin: 3px 0 0; color: #7c2d12; font-size: .69rem; line-height: 1.6; }
.tutorial-storage-meter { display: grid; gap: 5px; }
.tutorial-storage-meter::before { content: ""; height: 7px; background: #fed7aa; border-radius: 99px; }
.tutorial-storage-meter span { z-index: 1; width: 76%; height: 7px; margin-top: -12px; background: #ea580c; border-radius: 99px; }
.tutorial-storage-meter small { color: #9a3412; font-size: .6rem; font-weight: 700; text-align: right; }
.tutorial-node-subhead { margin-top: 20px; }
.tutorial-concurrency-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.tutorial-concurrency-grid article {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 15px;
  background: var(--surface-subtle);
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
}
.tutorial-concurrency-grid article.is-recommended { background: var(--accent-light); border-color: rgba(15,118,110,.36); }
.tutorial-concurrency-machine,
.tutorial-concurrency-value { display: grid; gap: 1px; }
.tutorial-concurrency-machine b,
.tutorial-concurrency-value b { color: var(--ink); font-size: 1rem; }
.tutorial-concurrency-machine small,
.tutorial-concurrency-value small { color: var(--muted); font-size: .6rem; }
.tutorial-concurrency-value { text-align: right; }
.tutorial-concurrency-value b { color: var(--accent); }
.tutorial-concurrency-grid article > i { color: var(--muted); font-style: normal; }
.tutorial-concurrency-grid article > p { grid-column: 1 / -1; margin: 5px 0 0; font-size: .68rem; }
.tutorial-concurrency-tag {
  position: absolute;
  top: -8px;
  right: 10px;
  padding: 2px 7px;
  color: #fff;
  background: var(--accent);
  border-radius: 99px;
  font-size: .56rem;
  font-weight: 700;
}

.tutorial-scope-visual {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  align-items: stretch;
  gap: 12px;
  margin-bottom: 18px;
}
.tutorial-scope-origin,
.tutorial-scope-boundary { padding: 18px; border-radius: var(--radius-lg); }
.tutorial-scope-origin { display: grid; align-content: center; gap: 8px; color: #cbd5e1; background: #0f172a; }
.tutorial-scope-origin > small { color: #94a3b8; font-size: .64rem; }
.tutorial-scope-origin > code { overflow-x: auto; color: #f8fafc; background: transparent; font-size: clamp(.85rem, 2vw, 1.15rem); white-space: nowrap; }
.tutorial-scope-origin > code span { color: #5eead4; }
.tutorial-scope-labels { display: grid; grid-template-columns: 62px 1fr 82px; gap: 8px; color: #64748b; font: .54rem/1.3 ui-monospace, SFMono-Regular, Consolas, monospace; }
.tutorial-scope-labels span:nth-child(2) { text-align: center; }
.tutorial-scope-labels span:nth-child(3) { text-align: right; }
.tutorial-scope-boundary { display: grid; align-content: center; gap: 8px; background: var(--surface-subtle); border: 1px solid var(--line); }
.tutorial-scope-boundary > span { display: flex; align-items: center; gap: 8px; padding: 7px 9px; overflow: hidden; background: var(--panel); border-radius: 7px; font: .65rem/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.tutorial-scope-boundary i { display: grid; place-items: center; flex: 0 0 18px; width: 18px; height: 18px; border-radius: 50%; font-style: normal; }
.tutorial-scope-boundary .is-in i { color: var(--info); background: var(--info-bg); }
.tutorial-scope-boundary .is-out { color: var(--muted); }
.tutorial-scope-boundary .is-out i { color: var(--critical); background: var(--critical-bg); }
.tutorial-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.tutorial-two-col > div { min-width: 0; padding: 16px; background: var(--surface-subtle); border: 1px solid var(--line-light); border-radius: var(--radius); }
.tutorial-two-col h3 { margin-bottom: 12px; font-size: .88rem; }
.tutorial-check-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.tutorial-check-list li { display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.tutorial-check-list li > span { color: var(--info); font-weight: 800; }
.tutorial-check-list p { margin: 0; font-size: .74rem; }
.tutorial-check-list strong { color: var(--ink); }
.tutorial-auth-card { position: relative; overflow: hidden; }
.tutorial-auth-icon { position: absolute; top: -4px; right: 10px; opacity: .09; font-size: 4rem; transform: rotate(-12deg); }
.tutorial-auth-card p { margin-bottom: 12px; font-size: .74rem; }
.tutorial-auth-card code { display: block; padding: 9px 11px; overflow: hidden; color: #cbd5e1; background: #0f172a; border-radius: 7px; font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.tutorial-auth-card small { display: block; margin-top: 7px; color: var(--muted); font-size: .62rem; }

.tutorial-mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.tutorial-mode-grid article { position: relative; display: grid; gap: 3px; padding: 16px; background: var(--surface-subtle); border: 1px solid var(--line); border-radius: var(--radius); }
.tutorial-mode-grid article.is-recommended { background: var(--accent-light); border-color: rgba(15,118,110,.35); }
.tutorial-mode-grid b { margin-top: 8px; font-size: 1rem; }
.tutorial-mode-grid small { color: var(--muted); font-size: .62rem; text-transform: uppercase; }
.tutorial-mode-grid p { margin: 6px 0 0; font-size: .72rem; }
.tutorial-launch-shot { margin-bottom: 18px; overflow: hidden; background: var(--surface-subtle); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.tutorial-launch-target { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.tutorial-launch-target > span { display: grid; place-items: center; width: 34px; height: 34px; color: var(--accent); background: var(--accent-light); border-radius: 9px; }
.tutorial-launch-target p { display: grid; margin: 0; }
.tutorial-launch-target small { color: var(--muted); font-size: .58rem; }
.tutorial-launch-target strong { font-size: .76rem; }
.tutorial-launch-target code { color: var(--ink-secondary); background: transparent; font-size: .62rem; }
.tutorial-launch-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 14px; }
.tutorial-launch-options span { display: grid; gap: 3px; min-width: 0; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; }
.tutorial-launch-options small { color: var(--muted); font-size: .58rem; }
.tutorial-launch-options b { overflow: hidden; font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.tutorial-launch-footer { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--info); font-size: .64rem; }
.tutorial-launch-footer b { padding: 6px 10px; color: #fff; background: var(--accent); border-radius: 6px; font-size: .66rem; }
.tutorial-step-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0; padding: 0; list-style: none; }
.tutorial-step-list li { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 12px; border: 1px solid var(--line-light); border-radius: var(--radius); }
.tutorial-step-list li > span { display: grid; place-items: center; width: 25px; height: 25px; color: var(--accent); background: var(--accent-light); border-radius: 7px; font-size: .66rem; font-weight: 800; }
.tutorial-step-list h3 { margin: 2px 0 3px; font-size: .76rem; }
.tutorial-step-list p { margin: 0; font-size: .68rem; }

.tutorial-status-lane { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 10px; margin-bottom: 10px; }
.tutorial-status-lane > span { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 8px; padding: 10px 12px; border: 1px solid transparent; border-radius: var(--radius); }
.tutorial-status-lane > span i { grid-row: 1 / span 2; width: 8px; height: 8px; background: currentColor; border-radius: 50%; box-shadow: 0 0 0 4px rgba(148,163,184,.12); }
.tutorial-status-lane small { font-size: .58rem; }
.tutorial-status-lane b { font-size: .68rem; }
.tutorial-status-lane > i { color: var(--muted); font-style: normal; }
.tutorial-status-note { margin: 0 0 16px; color: var(--muted); font-size: .68rem; text-align: center; }
.tutorial-result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.tutorial-result-grid h3 { margin: 6px 0 4px; font-size: .8rem; }
.tutorial-result-grid p { margin: 0 0 8px; font-size: .7rem; }
.tutorial-result-grid a { font-size: .68rem; font-weight: 700; }
.tutorial-close-loop { display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 12px; overflow-x: auto; color: var(--ink-secondary); background: var(--surface-subtle); border: 1px dashed var(--line); border-radius: var(--radius); }
.tutorial-close-loop span { display: inline-flex; align-items: center; gap: 6px; min-width: max-content; font-size: .66rem; font-weight: 600; }
.tutorial-close-loop b { display: grid; place-items: center; width: 20px; height: 20px; color: var(--accent); background: var(--accent-light); border-radius: 50%; font-size: .58rem; }
.tutorial-close-loop i { color: var(--muted); font-style: normal; }

.tutorial-faq { border: 1px solid var(--line); border-radius: var(--radius-lg); }
.tutorial-faq details + details { border-top: 1px solid var(--line); }
.tutorial-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; cursor: pointer; list-style: none; color: var(--ink); font-size: .76rem; font-weight: 700; }
.tutorial-faq summary::-webkit-details-marker { display: none; }
.tutorial-faq summary i { color: var(--muted); font-style: normal; transition: transform var(--transition); }
.tutorial-faq details[open] summary i { transform: rotate(45deg); }
.tutorial-faq details > div { padding: 0 15px 13px; }
.tutorial-faq p { margin: 0; font-size: .72rem; }

/* ── 教程模式拆分：选择页与专项模式页 ── */
.tutorial-mode-nav { display: flex; align-items: center; gap: 6px; margin: 0 0 18px; padding: 7px; background: var(--surface-subtle); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.tutorial-mode-nav a { flex: 0 0 auto; padding: 7px 14px; color: var(--ink-secondary); border-radius: 7px; font-size: .74rem; font-weight: 700; text-decoration: none; }
.tutorial-mode-nav a:hover { color: var(--ink); background: var(--panel); }
.tutorial-mode-nav a.active { color: #fff; background: var(--accent); }

.tutorial-hub-hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); align-items: center; gap: 24px; margin-bottom: 20px; padding: 26px; background: linear-gradient(135deg, var(--panel), var(--accent-light)); border: 1px solid rgba(15,118,110,.25); border-radius: var(--radius-lg); }
.tutorial-hub-hero h2 { margin: 10px 0 8px; font-size: 1.75rem; }
.tutorial-hub-hero p { max-width: 62ch; margin: 0; color: var(--ink-secondary); font-size: .8rem; line-height: 1.7; }
.tutorial-hub-router { display: grid; gap: 10px; }
.tutorial-hub-router span { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 8px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.tutorial-hub-router b { display: grid; place-items: center; min-width: 42px; padding: 5px 7px; color: #fff; background: var(--accent); border-radius: 6px; font: 800 .64rem/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.tutorial-hub-router i { color: var(--muted); font-style: normal; }
.tutorial-hub-router strong { overflow: hidden; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }

.tutorial-mode-router { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.tutorial-route-card { display: flex; flex-direction: column; gap: 12px; padding: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.tutorial-route-card header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tutorial-route-code { display: grid; place-items: center; min-width: 48px; padding: 6px 9px; color: #fff; background: var(--accent); border-radius: 7px; font: 800 .7rem/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.tutorial-route-card[data-mode="code"] .tutorial-route-code { background: #7c3aed; }
.tutorial-route-card[data-mode="llm"] .tutorial-route-code { background: #0891b2; }
.tutorial-route-card header small { color: var(--muted); font-size: .58rem; letter-spacing: .08em; }
.tutorial-route-card h2 { margin: 0; font-size: 1.12rem; }
.tutorial-route-card > p { margin: 0; color: var(--ink-secondary); font-size: .74rem; line-height: 1.65; }
.tutorial-route-card dl { display: grid; gap: 6px; margin: 0; padding: 10px 12px; background: var(--surface-subtle); border-radius: var(--radius); }
.tutorial-route-card dl div { display: grid; grid-template-columns: 44px 1fr; gap: 8px; align-items: baseline; }
.tutorial-route-card dt { color: var(--muted); font-size: .6rem; }
.tutorial-route-card dd { margin: 0; font-size: .68rem; font-weight: 600; }
.tutorial-route-card ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tutorial-route-card li { position: relative; padding-left: 14px; color: var(--ink-secondary); font-size: .7rem; }
.tutorial-route-card li::before { position: absolute; top: 7px; left: 0; width: 5px; height: 5px; background: var(--accent); border-radius: 50%; content: ""; }
.tutorial-route-card .btn-primary { margin-top: auto; }

.tutorial-hub-checklist { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(0, 1.2fr); gap: 20px; padding: 20px; background: var(--surface-subtle); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.tutorial-hub-checklist h2 { margin: 4px 0 0; font-size: 1rem; }
.tutorial-hub-checklist ol { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0; padding: 0; list-style: none; }
.tutorial-hub-checklist li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.tutorial-hub-checklist li > span { display: grid; place-items: center; width: 24px; height: 24px; color: var(--accent); background: var(--accent-light); border-radius: 7px; font-size: .66rem; font-weight: 800; }
.tutorial-hub-checklist p { margin: 0; font-size: .72rem; }

.tutorial-specialty-hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .6fr); align-items: center; gap: 24px; margin-bottom: 20px; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.tutorial-specialty-hero h2 { margin: 10px 0 8px; font-size: 1.6rem; }
.tutorial-specialty-hero p { max-width: 66ch; margin: 0 0 4px; color: var(--ink-secondary); font-size: .78rem; line-height: 1.7; }
.tutorial-specialty-hero--code { background: linear-gradient(135deg, var(--panel), #f3e8ff); border-color: rgba(124,58,237,.22); }
.tutorial-specialty-hero--llm { background: linear-gradient(135deg, var(--panel), #cffafe); border-color: rgba(8,145,178,.25); }
.tutorial-specialty-flow { display: grid; gap: 8px; }
.tutorial-specialty-flow span { display: grid; gap: 2px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; }
.tutorial-specialty-flow small { color: var(--muted); font-size: .56rem; letter-spacing: .08em; }
.tutorial-specialty-flow b { overflow: hidden; font: 600 .64rem/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.tutorial-specialty-flow i { color: var(--muted); font-style: normal; text-align: center; }

.tutorial-mode-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tutorial-mode-summary-grid article { display: grid; gap: 6px; padding: 14px; background: var(--surface-subtle); border: 1px solid var(--line); border-radius: var(--radius); }
.tutorial-mode-summary-grid article > span { display: grid; place-items: center; width: 26px; height: 26px; color: var(--accent); background: var(--accent-light); border-radius: 7px; font-weight: 800; }
.tutorial-mode-summary-grid article.is-invalid > span { color: var(--critical); background: var(--critical-bg); }
.tutorial-mode-summary-grid h3 { margin: 0; font-size: .82rem; }
.tutorial-mode-summary-grid p { margin: 0; color: var(--ink-secondary); font-size: .7rem; line-height: 1.6; }

.tutorial-target-pattern { display: grid; gap: 8px; margin-bottom: 14px; }
.tutorial-target-pattern > div { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius); }
.tutorial-target-pattern .is-valid { background: var(--info-bg); }
.tutorial-target-pattern .is-invalid { background: var(--critical-bg); }
.tutorial-target-pattern small { font-size: .62rem; font-weight: 800; }
.tutorial-target-pattern .is-valid small { color: var(--info); }
.tutorial-target-pattern .is-invalid small { color: var(--critical); }
.tutorial-target-pattern code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .68rem; }
.tutorial-target-pattern b { padding: 4px 8px; background: var(--panel); border-radius: 5px; font: 700 .6rem/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.tutorial-step-list--single { grid-template-columns: 1fr; }

.tutorial-launch-shot--specialty .tutorial-launch-options { grid-template-columns: repeat(4, 1fr); }
.tutorial-audit-matrix { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.tutorial-audit-matrix article { display: grid; gap: 4px; padding: 14px; background: var(--surface-subtle); border: 1px solid var(--line); border-radius: var(--radius); }
.tutorial-audit-matrix b { width: fit-content; padding: 3px 7px; color: #fff; background: #7c3aed; border-radius: 5px; font: 800 .58rem/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
.tutorial-audit-matrix h3 { margin: 2px 0 0; font-size: .8rem; }
.tutorial-audit-matrix p { margin: 0; color: var(--ink-secondary); font-size: .68rem; line-height: 1.6; }

.tutorial-evidence-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.tutorial-evidence-grid article { display: grid; gap: 4px; padding: 14px; background: var(--surface-subtle); border: 1px solid var(--line); border-radius: var(--radius); }
.tutorial-evidence-grid small { color: var(--muted); font-size: .6rem; }
.tutorial-evidence-grid strong { overflow: hidden; font: 700 .74rem/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.tutorial-evidence-grid p { margin: 0; color: var(--ink-secondary); font-size: .68rem; }
.tutorial-evidence-grid--llm strong { color: var(--accent); }

.tutorial-llm-surface { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.tutorial-llm-surface article { display: grid; gap: 4px; padding: 14px; background: var(--surface-subtle); border: 1px solid var(--line); border-radius: var(--radius); }
.tutorial-llm-surface b { width: fit-content; padding: 3px 7px; color: #fff; background: #0891b2; border-radius: 5px; font: 800 .58rem/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
.tutorial-llm-surface h3 { margin: 2px 0 0; font-size: .8rem; }
.tutorial-llm-surface p { margin: 0; color: var(--ink-secondary); font-size: .68rem; line-height: 1.6; }

.tutorial-architecture-lane { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 12px; overflow-x: auto; background: var(--surface-subtle); border: 1px dashed var(--line); border-radius: var(--radius); }
.tutorial-architecture-lane span { flex: 0 0 auto; padding: 7px 10px; background: var(--panel); border-radius: 6px; font-size: .66rem; font-weight: 600; }
.tutorial-architecture-lane i { color: var(--muted); font-style: normal; }

.tutorial-endpoint-compare { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 10px; margin-bottom: 14px; }
.tutorial-endpoint-compare article { display: grid; align-content: start; gap: 8px; padding: 16px; background: var(--surface-subtle); border: 1px solid var(--line); border-radius: var(--radius); }
.tutorial-endpoint-compare h3 { margin: 0; font-size: .88rem; }
.tutorial-endpoint-compare code { overflow: hidden; padding: 8px 10px; background: var(--code-bg); border-radius: 6px; text-overflow: ellipsis; white-space: nowrap; font-size: .66rem; }
.tutorial-endpoint-compare p { margin: 0; color: var(--ink-secondary); font-size: .7rem; line-height: 1.6; }
.tutorial-endpoint-compare > i { display: grid; place-items: center; color: var(--critical); font-size: 1.3rem; font-style: normal; font-weight: 800; }

.tutorial-preflight-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tutorial-preflight-list span { display: grid; gap: 2px; padding: 10px 12px; background: var(--surface-subtle); border: 1px solid var(--line); border-radius: var(--radius); font-size: .66rem; }
.tutorial-preflight-list b { color: var(--muted); font-size: .58rem; }

.tutorial-llm-matrix { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.tutorial-llm-matrix article { display: grid; gap: 4px; padding: 12px; background: var(--surface-subtle); border: 1px solid var(--line); border-radius: var(--radius); }
.tutorial-llm-matrix b { display: grid; place-items: center; width: fit-content; min-width: 26px; padding: 3px 6px; color: #fff; background: #0891b2; border-radius: 5px; font: 800 .62rem/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
.tutorial-llm-matrix h3 { margin: 2px 0 0; font-size: .72rem; }
.tutorial-llm-matrix p { margin: 0; color: var(--ink-secondary); font-size: .64rem; line-height: 1.55; }

html[data-theme="dark"] .tutorial-mode-nav a.active { color: #042f2e; background: var(--accent-readable); }
html[data-theme="dark"] .tutorial-hub-hero { border-color: #2b665d; }
html[data-theme="dark"] .tutorial-specialty-hero--code { background: linear-gradient(135deg, var(--panel), #2a1d47); border-color: #4c3a80; }
html[data-theme="dark"] .tutorial-specialty-hero--llm { background: linear-gradient(135deg, var(--panel), #0b3a46); border-color: #2b6b7d; }
html[data-theme="dark"] .tutorial-route-card[data-mode="code"] .tutorial-route-code { background: #6d28d9; }
html[data-theme="dark"] .tutorial-route-card[data-mode="llm"] .tutorial-route-code { background: #0e7490; }
html[data-theme="dark"] .tutorial-audit-matrix b { background: #6d28d9; }
html[data-theme="dark"] .tutorial-llm-surface b,
html[data-theme="dark"] .tutorial-llm-matrix b { background: #0e7490; }
html[data-theme="dark"] .tutorial-evidence-grid--llm strong { color: var(--accent-readable); }
.tutorial-feedback {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding: 16px;
  background: var(--accent-light);
  border: 1px solid rgba(15,118,110,.3);
  border-radius: var(--radius-lg);
}
.tutorial-feedback-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: var(--panel);
  border: 1px solid var(--line-light);
  border-radius: 12px;
  font-size: 1.15rem;
}
.tutorial-feedback h3 { margin: 2px 0 3px; font-size: .86rem; }
.tutorial-feedback p { margin: 0; font-size: .7rem; }
.tutorial-feedback-actions { display: grid; gap: 7px; }
.tutorial-feedback-actions a { min-width: max-content; text-align: center; }
.tutorial-final-check {
  display: grid;
  grid-template-columns: minmax(190px, .8fr) minmax(260px, 1.2fr) auto;
  align-items: center;
  gap: 20px;
  margin-top: 18px;
  padding: 20px;
  color: #e2e8f0;
  background: linear-gradient(135deg, #0f172a, #123f3a);
  border-radius: var(--radius-lg);
}
.tutorial-final-check h3 { margin: 3px 0 0; color: #fff; font-size: .95rem; }
.tutorial-final-check ul { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 12px; margin: 0; padding: 0; list-style: none; }
.tutorial-final-check li { display: flex; gap: 6px; color: #cbd5e1; font-size: .66rem; }
.tutorial-final-check li span { color: #5eead4; font-weight: 800; }
.tutorial-final-check .btn-primary { min-width: max-content; color: #042f2e; background: #5eead4; border-color: #5eead4; }

html[data-theme="dark"] .tutorial-eyebrow,
html[data-theme="dark"] .tutorial-section-label,
html[data-theme="dark"] .tutorial-chapter-no,
html[data-theme="dark"] .tutorial-route-icon,
html[data-theme="dark"] .tutorial-recommend-label,
html[data-theme="dark"] .tutorial-recommend-facts b,
html[data-theme="dark"] .tutorial-number-list li > span,
html[data-theme="dark"] .tutorial-tip-grid article > span,
html[data-theme="dark"] .tutorial-result-grid article > span,
html[data-theme="dark"] .tutorial-requirements > div > span,
html[data-theme="dark"] .tutorial-launch-target > span,
html[data-theme="dark"] .tutorial-step-list li > span,
html[data-theme="dark"] .tutorial-close-loop b,
html[data-theme="dark"] .tutorial-mode-tag {
  color: var(--accent-readable);
}
html[data-theme="dark"] .tutorial-chapter-no,
html[data-theme="dark"] .tutorial-number-list li > span,
html[data-theme="dark"] .tutorial-requirements > div > span,
html[data-theme="dark"] .tutorial-launch-target > span,
html[data-theme="dark"] .tutorial-step-list li > span,
html[data-theme="dark"] .tutorial-close-loop b {
  background: #123b35;
}
html[data-theme="dark"] .tutorial-route-icon { border-color: #3c8278; }
html[data-theme="dark"] .tutorial-role-mark.admin,
html[data-theme="dark"] .tutorial-recommend-badge { background: #195b51; }
html[data-theme="dark"] .tutorial-first-step-no,
html[data-theme="dark"] .tutorial-node-enroll-steps li > span { background: #2b8175; }
html[data-theme="dark"] .tutorial-node-location-card { border-color: #3c8278; }
html[data-theme="dark"] .tutorial-node-location-card footer { background: #123b35; border-color: #2b665d; }
html[data-theme="dark"] .tutorial-node-location-card footer em { color: var(--accent-readable); }
html[data-theme="dark"] .tutorial-node-location-card footer strong { border-color: #4fa196; }
html[data-theme="dark"] .tutorial-compat-summary article.is-supported { background: #0b2b25; border-color: #24685d; }
html[data-theme="dark"] .tutorial-compat-summary article.is-unsupported { background: #301519; border-color: #71323a; }
html[data-theme="dark"] .tutorial-requirements > div.is-required,
html[data-theme="dark"] .tutorial-storage-warning { background: #2b1b0e; border-color: #854d24; }
html[data-theme="dark"] .tutorial-requirements > div.is-required > span { color: #fdba74; background: #4a2b14; }
html[data-theme="dark"] .tutorial-requirements > div.is-required strong,
html[data-theme="dark"] .tutorial-storage-warning strong,
html[data-theme="dark"] .tutorial-storage-meter small { color: #fdba74; }
html[data-theme="dark"] .tutorial-storage-warning p { color: #fed7aa; }
html[data-theme="dark"] .tutorial-storage-icon { color: #2b1b0e; background: #fb923c; }
html[data-theme="dark"] .tutorial-storage-meter::before { background: #5a3318; }
html[data-theme="dark"] .tutorial-storage-meter span { background: #fb923c; }
html[data-theme="dark"] .tutorial-concurrency-value b { color: var(--accent-readable); }
html[data-theme="dark"] .tutorial-concurrency-tag { background: #2b8175; }

@media (max-width: 1180px) {
  section.tutorial-hero { grid-template-columns: 1fr 400px; }
  .tutorial-hub-hero,
  .tutorial-specialty-hero { grid-template-columns: 1fr; }
  .tutorial-shell { grid-template-columns: 1fr; }
  .tutorial-toc { position: static; display: flex; gap: 5px; padding: 8px; overflow-x: auto; }
  .tutorial-toc > strong { display: none; }
  .tutorial-toc a { flex: 0 0 auto; }
}
@media (max-width: 980px) {
  section.tutorial-hero { grid-template-columns: 1fr; }
  .tutorial-hero-visual { width: min(100%, 560px); transform: none; }
  .tutorial-route-map { grid-template-columns: repeat(3, 1fr); gap: 22px 0; }
  .tutorial-route-map li:nth-child(3)::after { display: none; }
  .tutorial-recommend-card { grid-template-columns: auto 1fr; }
  .tutorial-recommend-facts { grid-column: 1 / -1; }
  .tutorial-config-layout,
  .tutorial-node-create-card,
  .tutorial-node-enroll-guide,
  .tutorial-scope-visual { grid-template-columns: 1fr; }
  .tutorial-final-check { grid-template-columns: 1fr; }
  .tutorial-final-check .btn-primary { width: fit-content; }
  .tutorial-mode-router,
  .tutorial-mode-summary-grid,
  .tutorial-audit-matrix,
  .tutorial-evidence-grid,
  .tutorial-llm-surface,
  .tutorial-preflight-list { grid-template-columns: repeat(2, 1fr); }
  .tutorial-llm-matrix { grid-template-columns: repeat(3, 1fr); }
  .tutorial-endpoint-compare { grid-template-columns: 1fr; }
  .tutorial-endpoint-compare > i { justify-content: center; }
  .tutorial-launch-shot--specialty .tutorial-launch-options { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  section.tutorial-hero { min-height: 0; padding: 24px 20px; }
  .tutorial-hero h2 { font-size: 1.7rem; }
  .tutorial-hero-actions > * { flex: 1 1 100%; text-align: center; }
  .tutorial-visual-api { grid-template-columns: auto 1fr; }
  .tutorial-visual-api .badge { grid-column: 2; width: fit-content; }
  .tutorial-mini-flow { align-items: stretch; }
  .tutorial-mini-flow span { display: grid; justify-items: center; text-align: center; }
  .tutorial-visual-result { grid-template-columns: 1fr; }
  section.tutorial-chapter { padding: 20px 16px; }
  .tutorial-first-steps { grid-template-columns: 1fr; }
  .tutorial-role-grid,
  .tutorial-tip-grid,
  .tutorial-compat-summary,
  .tutorial-concurrency-grid,
  .tutorial-mode-grid,
  .tutorial-result-grid,
  .tutorial-step-list,
  .tutorial-two-col { grid-template-columns: 1fr; }
  .tutorial-hub-checklist { grid-template-columns: 1fr; }
  .tutorial-hub-checklist ol { grid-template-columns: 1fr; }
  .tutorial-mode-router,
  .tutorial-mode-summary-grid,
  .tutorial-audit-matrix,
  .tutorial-evidence-grid,
  .tutorial-llm-surface,
  .tutorial-preflight-list { grid-template-columns: 1fr; }
  .tutorial-llm-matrix { grid-template-columns: repeat(2, 1fr); }
  .tutorial-target-pattern > div { grid-template-columns: 1fr; justify-items: start; }
  .tutorial-hub-router span { grid-template-columns: auto auto; }
  .tutorial-hub-router strong { grid-column: 1 / -1; }
  .tutorial-protocol-diagram { grid-template-columns: 1fr; }
  .tutorial-protocol-diagram > i { text-align: center; transform: rotate(90deg); }
  .tutorial-requirements { grid-template-columns: repeat(2, 1fr); }
  .tutorial-storage-warning { grid-template-columns: auto 1fr; }
  .tutorial-storage-meter { grid-column: 1 / -1; }
  .tutorial-launch-options { grid-template-columns: repeat(2, 1fr); }
  .tutorial-final-check ul { grid-template-columns: 1fr; }
  .tutorial-feedback { grid-template-columns: auto 1fr; }
  .tutorial-feedback-actions { grid-column: 1 / -1; justify-items: start; }
}
@media (max-width: 480px) {
  .tutorial-route-map { grid-template-columns: repeat(2, 1fr); }
  .tutorial-route-map li:nth-child(3)::after { display: block; }
  .tutorial-route-map li:nth-child(2n)::after { display: none; }
  .tutorial-recommend-card { grid-template-columns: 1fr; }
  .tutorial-recommend-badge { width: 44px; height: 44px; }
  .tutorial-recommend-facts { grid-template-columns: 1fr; }
  .tutorial-form-shot dl { grid-template-columns: 1fr; }
  .tutorial-requirements { grid-template-columns: 1fr; }
  .tutorial-launch-options { grid-template-columns: 1fr; }
  .tutorial-chapter-head { grid-template-columns: 1fr; }
  .tutorial-llm-matrix { grid-template-columns: 1fr; }
  .tutorial-launch-shot--specialty .tutorial-launch-options { grid-template-columns: 1fr; }
}

/* ── 页面头部 ── */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-head h1 { margin-bottom: 4px; }
.page-head p { margin: 0; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 24px 0 12px;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── MCP 接入：把凭据生命周期与客户端配置收进同一控制台 ── */
.mcp-page,
.mcp-page-head { width: 100%; max-width: none; }
.mcp-page-head { align-items: center; margin-bottom: 18px; }
.mcp-page-title { max-width: 720px; }
.mcp-page-title h1 { margin: 2px 0 5px; font-size: clamp(1.55rem, 2vw, 1.9rem); }
.mcp-page-title p { max-width: 680px; }
.mcp-eyebrow,
.mcp-panel-label {
  display: block;
  color: var(--accent);
  font-size: .7rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
html[data-theme="dark"] .mcp-eyebrow,
html[data-theme="dark"] .mcp-panel-label { color: var(--accent-readable); }
.mcp-account-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
  padding: 9px 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.mcp-account-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  color: var(--accent);
  background: var(--accent-light);
  border-radius: 9px;
  font-weight: 800;
}
html[data-theme="dark"] .mcp-account-mark { color: var(--accent-readable); }
.mcp-account-chip > span:last-child { display: grid; min-width: 0; line-height: 1.35; }
.mcp-account-chip small { color: var(--muted); font-size: .68rem; }
.mcp-account-chip strong { overflow: hidden; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }

.mcp-console {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}
.mcp-console-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 10px 18px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--line);
}
.mcp-console-bar > div { display: flex; align-items: center; gap: 9px; }
.mcp-console-bar strong { font-size: .82rem; }
.mcp-live-dot {
  width: 8px;
  height: 8px;
  background: var(--info);
  border-radius: 50%;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--info) 14%, transparent);
}
.mcp-live-dot.is-offline { background: var(--muted); box-shadow: none; }
.mcp-status {
  padding: 3px 9px;
  color: var(--info);
  background: var(--info-bg);
  border: 1px solid color-mix(in srgb, var(--info) 28%, transparent);
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
}
.mcp-status.is-offline { color: var(--muted); background: var(--surface-alt); border-color: var(--line); }

.mcp-console-grid { display: grid; grid-template-columns: minmax(320px, .86fr) minmax(480px, 1.14fr); }
.mcp-credential-panel,
.mcp-config-panel {
  min-width: 0;
  margin: 0;
  padding: 28px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}
.mcp-credential-panel { border-right: 1px solid var(--line); }
.mcp-credential-panel h2,
.mcp-config-panel h2 { margin: 4px 0 6px; font-size: 1.12rem; }
.mcp-panel-intro { max-width: 420px; margin-bottom: 20px; font-size: .84rem; }
.mcp-token-field {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.mcp-token-field span { color: var(--muted); font-size: .7rem; font-weight: 650; }
.mcp-token-field code,
.mcp-token-field strong {
  overflow: hidden;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mcp-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.mcp-actions form { display: inline-flex; }
.mcp-security-note {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line-light);
}
.mcp-security-note > span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--info);
  background: var(--info-bg);
  border-radius: 50%;
  font-size: .72rem;
  font-weight: 800;
}
.mcp-security-note p { margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.55; }
.mcp-security-note strong { display: block; margin-bottom: 2px; color: var(--ink-secondary); font-size: .78rem; }
.mcp-write-mode {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.mcp-write-mode.is-enabled { border-color: color-mix(in srgb, var(--warning, #f0ad4e) 45%, var(--line)); }
.mcp-write-mode strong { display: block; margin: 3px 0; color: var(--ink); font-size: .86rem; }
.mcp-write-mode p { margin: 0; color: var(--muted); font-size: .74rem; line-height: 1.45; }
.mcp-write-mode form { flex: 0 0 auto; }

.mcp-config-panel { background: var(--surface-alt); }
.mcp-config-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.mcp-config-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.mcp-code-window {
  overflow: hidden;
  background: var(--code-panel-bg);
  border: 1px solid color-mix(in srgb, var(--line) 70%, #020617);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 28px rgba(2, 6, 23, .16);
}
.mcp-code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  padding: 8px 14px;
  color: #91a4bd;
  background: color-mix(in srgb, var(--code-panel-bg) 88%, #334155);
  border-bottom: 1px solid rgba(148, 163, 184, .18);
  font: 600 .68rem/1.3 var(--font-body);
}
.mcp-code-bar span:last-child { color: #7dd3c7; }
.mcp-code-window pre {
  min-height: 232px;
  margin: 0;
  padding: 18px 20px;
  overflow: auto;
  color: var(--code-panel-ink);
  font: .76rem/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  tab-size: 2;
}
.mcp-code-window code { color: inherit; background: transparent; }
.mcp-config-hint { margin: 12px 2px 0; color: var(--muted); font-size: .72rem; }
.mcp-config-empty {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 232px;
  padding: 24px;
  color: var(--muted);
  background: var(--surface-subtle);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
}
.mcp-config-empty > span { font: 700 1.1rem/1 ui-monospace, monospace; }
.mcp-config-empty strong { display: block; margin-bottom: 4px; color: var(--ink-secondary); }
.mcp-config-empty p { margin: 0; font-size: .8rem; }

.mcp-permission-strip {
  display: grid;
  grid-template-columns: auto auto minmax(220px, 1fr);
  align-items: center;
  gap: 8px 16px;
  padding: 13px 18px;
  background: var(--surface-subtle);
  border-top: 1px solid var(--line);
  font-size: .75rem;
}
.mcp-permission-strip > span { color: var(--muted); font-weight: 650; }
.mcp-permission-strip > strong { color: var(--ink-secondary); }
.mcp-permission-strip > p { margin: 0; color: var(--muted); font-size: .74rem; text-align: right; }

.mcp-capability-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 18px; padding: 18px; border-top: 1px solid var(--line); background: var(--surface-alt); }
.mcp-capability-card { min-width: 0; margin: 0; padding: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.mcp-capability-card h2 { margin: 4px 0 14px; font-size: 1.05rem; }
.mcp-capability-group + .mcp-capability-group { margin-top: 18px; }
.mcp-capability-group h3 { margin: 0 0 8px; color: var(--ink-secondary); font-size: .78rem; }
.mcp-capability-list { display: grid; gap: 7px; }
.mcp-capability-item { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; align-items: start; padding: 8px 10px; background: var(--surface-subtle); border: 1px solid var(--line-light); border-radius: var(--radius); }
.mcp-capability-item.is-disabled { opacity: .52; }
.mcp-capability-mark { color: var(--success, #15803d); font-weight: 800; }
.mcp-capability-item strong { display: block; font-size: .78rem; }
.mcp-capability-item small { display: block; margin-top: 2px; color: var(--muted); font-size: .7rem; line-height: 1.45; }
.mcp-capability-item code { font-size: .68rem; }
.mcp-limit-list { display: grid; gap: 9px; margin: 0; padding-left: 18px; color: var(--ink-secondary); font-size: .78rem; line-height: 1.55; }
.mcp-capability-footnote { margin: 16px 0 0; font-size: .72rem; line-height: 1.55; }

.mcp-console :is(button, a):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 2px;
}

.vuln-version-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.vuln-version-head h2 { margin: 0 0 4px; }
.vuln-version-head p { margin: 0; }

@media (max-width: 980px) {
  .mcp-console-grid { grid-template-columns: 1fr; }
  .mcp-credential-panel { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 600px) {
  .mcp-page-head { align-items: stretch; }
  .mcp-account-chip { width: 100%; }
  .mcp-credential-panel,
  .mcp-config-panel { padding: 21px 18px; }
  .mcp-config-heading { align-items: stretch; flex-direction: column; }
  .mcp-config-actions { justify-content: flex-start; }
  .mcp-config-actions > *,
  .mcp-actions form,
  .mcp-actions button { width: 100%; }
  .mcp-write-mode { align-items: stretch; flex-direction: column; }
  .mcp-write-mode form,
  .mcp-write-mode button { width: 100%; }
  .mcp-permission-strip { grid-template-columns: 1fr; }
  .mcp-permission-strip > p { text-align: left; }
  .mcp-capability-grid { grid-template-columns: 1fr; padding: 12px; }
  .mcp-code-window pre { min-height: 0; padding: 16px; font-size: .68rem; }
}

/* ── 漏洞台账分组（按目标折叠，点组头就地展开漏洞，不跳转目标详情页） ── */
.registry-group > .registry-group-summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
  /* 覆盖 .section-head 的 space-between：勾选框+目标名靠左成一组，同步徽标推到右侧 */
  justify-content: flex-start;
  margin: 0;
}
.registry-group-summary .sync-badge { margin-left: auto; text-align: right; }
.registry-group-summary h2 { margin: 0; }
.registry-group > .registry-group-summary::-webkit-details-marker { display: none; }
.registry-group-summary .registry-group-name::before {
  content: "▶";
  display: inline-block;
  margin-right: 8px;
  font-size: .8em;
  color: var(--muted);
  transition: transform .15s ease;
}
.registry-group[open] > .registry-group-summary .registry-group-name::before {
  transform: rotate(90deg);
}
.registry-group-summary .registry-group-name { font-weight: 600; }
.registry-group-summary:hover .registry-group-name { text-decoration: underline; }

/* ── 统计卡片 ── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stats .stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.stats .stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.stats .stat-card .stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
}
.stats .stat-card .stat-label {
  display: block;
  color: var(--ink-secondary);
  font-size: .82rem;
  font-weight: 500;
  margin-top: 2px;
}
.stats .stat-card.critical { border-left: 3px solid var(--critical); }
.stats .stat-card.critical .stat-value { color: var(--critical); }
.stats .stat-card.high { border-left: 3px solid var(--high); }
.stats .stat-card.high .stat-value { color: var(--high); }
.stats .stat-card.medium { border-left: 3px solid var(--medium); }
.stats .stat-card.medium .stat-value { color: var(--medium); }
.stats .stat-card.low { border-left: 3px solid var(--low); }
.stats .stat-card.low .stat-value { color: var(--low); }
.stats .stat-card.neutral { border-left: 3px solid var(--accent); }
/* 一键复制的隐藏源文本框：移出视口但保留在 DOM 里（display:none 会让 execCommand 复制兜底失效） */
.copy-src { position: absolute; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; }
/* 可点击的状态统计卡片：重置链接默认样式，选中态加高亮边框 */
.stats.stats-clickable a.stat-card { display: block; text-decoration: none; color: inherit; cursor: pointer; }
.stats.stats-clickable a.stat-card.active { box-shadow: 0 0 0 2px var(--accent) inset; }
.stats.stats-clickable a.stat-card.critical.active { box-shadow: 0 0 0 2px var(--critical) inset; }
.stats .stat-card.neutral .stat-value { color: var(--accent); }

/* ── 面板 / 卡片 / 网格 ── */
section:not(.stats):not(.grid):not(.tutorial-hero), .grid > div, .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}
.grid { display: grid; gap: 20px; margin-bottom: 20px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.section-head.tight { margin-top: 0; }
/* 目标页"批量导入/导出"卡片：内容天然比左边"添加目标"少，
   用 flex 让文本框自己撑满同一行网格拉伸出的高度，不管视口多宽都精确贴合，
   不用像固定 rows 数那样只在量出来的某个宽度下凑巧对齐 */
.bulk-import-card { display: flex; flex-direction: column; }
/* 用 form.xxx（类型+类选择器）而不是纯类选择器，优先级要盖过后面 .stack 的
   display:grid（选择器优先级相同时，后声明的规则赢，纯类选择器盖不过它） */
form.bulk-import-text-form { flex: 1 1 auto; display: flex; flex-direction: column; gap: 14px; }
.bulk-import-text-form label { flex: 1 1 auto; display: flex; flex-direction: column; gap: 5px; }
.bulk-import-text-form textarea { flex: 1 1 auto; min-height: 90px; }
.bulk-import-text-form button { flex: 0 0 auto; }
.dashboard-llm .card {
  position: relative;
  padding-bottom: 84px;
}

.balance-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 10px 0 18px;
}
.dashboard-provider-select {
  position: absolute;
  left: 16px;
  bottom: 14px;
  display: block;
  max-width: min(240px, calc(100% - 32px));
}
.dashboard-provider-select select {
  width: 100%;
  min-height: 28px;
  padding: 4px 26px 4px 8px;
  border-radius: 6px;
  font-size: .76rem;
  line-height: 1.2;
  color: var(--ink-secondary);
  background-color: var(--surface-subtle);
}
.balance-value {
  color: var(--accent);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
}
.balance-label { color: var(--muted); font-size: .82rem; font-weight: 600; }
.dashboard-detail { grid-template-columns: 90px 1fr; }
.dashboard-note {
  color: var(--muted);
  font-size: .68rem;
  line-height: 1.35;
}
.dashboard-note.corner-note {
  position: absolute;
  right: 16px;
  bottom: 14px;
  width: min(360px, calc(100% - 280px));
  margin: 0;
  text-align: right;
  opacity: .72;
}
.usage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.usage-grid div {
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-subtle);
  min-width: 0;
}
.usage-grid strong {
  display: block;
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1.25;
}
.usage-grid span {
  display: block;
  color: var(--muted);
  font-size: .78rem;
  margin-top: 2px;
}

/* ── 图表容器 ── */
.chart-container {
  position: relative;
  width: 100%;
  max-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chart-container canvas { max-height: 300px; }
.chart-half { height: 280px; max-height: 280px; }

/* ── 流程图 / 架构卡片 ── */
.flow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.flow-grid .flow-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--panel);
  transition: all var(--transition);
}
.flow-grid .flow-card:hover { box-shadow: var(--shadow-md); }
.flow-grid .flow-card h3 { font-size: .95rem; margin-bottom: 6px; }
.flow-grid .flow-card p { font-size: .82rem; margin: 0; }

/* ── 表格 ── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
}
.todo-agent-group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  margin-bottom: 10px;
  padding: 10px 14px;
}
.todo-agent-group summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--ink);
}
.todo-agent-group .table-wrap { margin-top: 10px; border: none; }
/* 任务综述：四段报告在 details 内的 markdown 排版 */
.todo-agent-group .job-summary-content { margin-top: 10px; font-size: .9rem; line-height: 1.75; }
table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  font-size: .88rem;
}
.main > .table-wrap table,
section > .table-wrap table {
  min-width: 760px;
}
th, td {
  text-align: left;
  padding: 11px 14px;
  vertical-align: middle;
  border-bottom: 1px solid var(--line-light);
  white-space: nowrap;
}
td form { margin: 0; }
th {
  color: var(--ink-secondary);
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: 0;
  background: var(--surface-subtle);
  position: sticky;
  top: 0;
  z-index: 1;
}
tbody tr:hover { background: var(--surface-subtle); }
tbody tr:nth-child(even) { background: var(--surface-alt); }
tbody tr:nth-child(even):hover { background: var(--surface-hover); }
td.mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .8rem;
  word-break: break-all;
  white-space: normal;
}
td.nowrap { white-space: nowrap; }
td.truncate {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
table.compact-table {
  table-layout: fixed;
  min-width: 100%;
}
table.compact-table th,
table.compact-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}
table.compact-table td.truncate {
  max-width: none;
}

/* ── 报告中心表格：固定布局让操作列始终可见，不依赖横向滚动 ── */
table.report-table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
}
table.report-table th.col-check { width: 44px; }
table.report-table th.col-job { width: 110px; }
table.report-table th.col-target { width: 230px; max-width: 230px; }
table.report-table th.col-mode { width: 64px; }
table.report-table th.col-node { width: 88px; }
table.report-table th.col-time { width: 175px; }
table.report-table th.col-sev { width: 80px; }
table.report-table th.col-cost { width: 88px; }
table.report-table th.col-actions { width: 260px; }
table.report-table td.cell-actions { min-width: 260px; width: 260px; }
table.report-table td.truncate,
table.report-table td.mono {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
table.report-table .row-actions {
  flex-wrap: wrap;
}
table.report-table .row-actions a,
table.report-table .row-actions form {
  white-space: nowrap;
}

/* ── 徽章 / 状态标签 ── */
.badge, .sev, .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
  /* 不设的话继承 body 的 line-height:1.6，pill 内部比实际文字高一大截，
     不同徽章挨在一起时高矮、图标位置看着对不齐 */
  line-height: 1;
}
.sev::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
/* 状态色 */
.queued { background: #eff6ff; color: #1d4ed8; }
.running { background: #fff7ed; color: #c2410c; }
.completed { background: #f0fdf4; color: #15803d; }
.failed { background: #fef2f2; color: #dc2626; }
.cancelled { background: var(--surface-subtle); color: var(--muted); }
.completed_with_errors { background: var(--high-bg); color: var(--high); }
/* 漏洞状态 */
.open { background: #fef2f2; color: #dc2626; }
.triaged { background: #fff7ed; color: #c2410c; }
.in_progress { background: #eff6ff; color: #1d4ed8; }
.fixed { background: #f0fdf4; color: #15803d; }
.false_positive { background: var(--surface-subtle); color: var(--muted); text-decoration: line-through; }
.wont_fix { background: var(--surface-subtle); color: var(--muted); }
/* 严重级别 */
.critical { background: var(--critical-bg); color: var(--critical); }
.critical::before { background: var(--critical); }
.high { background: var(--high-bg); color: var(--high); }
.high::before { background: var(--high); }
.medium { background: var(--medium-bg); color: var(--medium); }
.medium::before { background: var(--medium); }
.low { background: var(--low-bg); color: var(--low); }
.low::before { background: var(--low); }
.info, .unknown { background: var(--surface-subtle); color: var(--muted); }
.info::before, .unknown::before { background: var(--muted); }
/* 节点类型徽章：一眼区分 local/ssh/web，不复用 completed/cancelled 避免跟启用状态徽章混淆 */
.badge.kind-local { background: var(--surface-subtle); color: var(--muted); }
.badge.kind-ssh { background: #eff6ff; color: #1d4ed8; }
.badge.kind-web { background: #f5f3ff; color: #7c3aed; }
/* 进度条中的状态 */
.progress .queued { background: #84adff; }
.progress .running { background: #fbbf24; }
.progress .completed { background: #22c55e; }
.progress .failed { background: #ef4444; }
.progress .cancelled { background: #94a3b8; }
.progress .completed_with_errors { background: var(--high); }

/* ── 扫描任务列表：批次分组行 ── */
.batch-group-row { background: var(--surface-subtle); font-weight: 500; }
.batch-group-row:hover { background: var(--surface-hover); }
.expand-caret { display: inline-block; font-size: .7rem; color: var(--muted); }
.batch-child-row { background: var(--panel); }

/* ── 按钮系统 ── */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1.4;
}
:where(html[data-theme="dark"]) button,
:where(html[data-theme="dark"]) .btn {
  background: #195b51;
  color: #f3fffc;
  border-color: #2f7d72;
}
button:hover, .btn:hover { filter: brightness(.95); }
button:active, .btn:active { transform: scale(.98); }
button:disabled, .btn:disabled, input[type="submit"]:disabled {
  opacity: .72;
  cursor: not-allowed;
  transform: none;
}
button.is-submitting, input[type="submit"].is-submitting {
  cursor: wait;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: var(--accent-light); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.btn-ghost:hover { background: color-mix(in srgb, var(--accent-light) 78%, var(--accent) 22%); }
.btn-danger { background: #fef2f2; color: var(--critical); border-color: #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-warning { background: #fffbeb; color: #d97706; border-color: #fde68a; }
.btn-sm { padding: 5px 10px; font-size: .78rem; }
.btn-xs { padding: 3px 8px; font-size: .72rem; border-radius: 6px; }
.btn-full { width: 100%; }

/* ── 表单 ── */
.stack { display: grid; gap: 14px; }
label { display: grid; gap: 5px; color: var(--ink); font-weight: 500; font-size: .85rem; }
label .hint { color: var(--muted); font-weight: 400; font-size: .78rem; }
.inline { display: flex; align-items: center; gap: 8px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.form-row label { flex: 1 1 160px; min-width: 140px; }
.form-row button { flex: 0 0 auto; }
/* 新增端点表单字段多（含 3 个勾选与提交），沿用 .form-row 的 160px 弹性宽度会换行；
   这里收紧为定宽，让整行放得下。窄屏仍按 flex-wrap 正常折行。 */
.config-create-form { gap: 10px; }
.config-create-form label { flex: 0 0 auto; min-width: 0; }
/* 字段宽度用 CSS 变量：宽度只声明一次（那条选择器带两个 :not()，特异性 3，
   普通 input[name=x] 只有 2，直接写 width 会被它压掉——上一版就这么白写了）。
   变量按元素解析，所以各字段只需覆写 --field-w，不存在特异性问题。 */
.config-create-form { --field-w: 116px; }
.config-create-form input:not([type="checkbox"]):not([type="hidden"]),
.config-create-form select { width: var(--field-w); }
/* 这三个要放得下占位文字（deepseek-v4-flash、Base URL 或完整地址、sk-…），
   116px 会把占位截断成 "deepseek-v4-fla…"，看起来像控件坏了 */
.config-create-form input[name="model"] { --field-w: 150px; }
.config-create-form input[name="api_base"],
.config-create-form input[name="api_key"] { --field-w: 170px; }
.config-create-form label.inline { white-space: nowrap; }
/* 高度统一：基础样式里 input/select≈40px（padding 9px）、button≈37px（padding 8px）、
   .btn-sm≈29px（padding 5px + 更小字号），并排会参差不齐。这里统一 38px + 定字号，
   纵向 padding 归零、靠 height 撑高，这样任何字号/内边距差异都不再影响行高。 */
.config-create-form input:not([type="checkbox"]):not([type="hidden"]),
.config-create-form select,
.config-create-form button {
  height: 38px;
  box-sizing: border-box;
  padding: 0 10px;
  font-size: .85rem;
}
.config-create-form button { padding: 0 14px; }
/* 勾选行高度对齐输入框，纵向居中，不再贴到行底 */
.config-create-form label.inline { height: 38px; align-items: center; }
.notify-channel { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; }
.notify-channel h3 { margin: 0; font-size: .95rem; }
.notify-events { display: grid; gap: 6px; border: none; padding: 0; margin: 0; }
.notify-events legend { font-size: .78rem; color: var(--muted); font-weight: 500; padding: 0; margin-bottom: 4px; }
.instruction-create {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.instruction-create summary,
.instruction-template-item summary,
.legacy-instructions summary {
  cursor: pointer;
  font-weight: 700;
}
.instruction-template-list {
  display: grid;
  gap: 12px;
}
.instruction-picker {
  max-width: 520px;
  margin-bottom: 12px;
}
.instruction-template-dropdown-mode {
  margin-top: 0;
}
.instruction-template-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--panel);
}
.instruction-template-head {
  margin-bottom: 10px;
  align-items: flex-start;
}
.instruction-template-head h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}
.instruction-template-head p {
  margin: 2px 0;
}
.instruction-template-panel[hidden] {
  display: none;
}
.instruction-template-item details form {
  margin-top: 10px;
}
.instruction-readonly {
  display: grid;
  gap: 10px;
}
.instruction-readonly-notice {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--low);
  border-radius: var(--radius);
  background: var(--low-bg);
  color: var(--ink-secondary);
  font-size: .84rem;
  line-height: 1.55;
}
.instruction-readonly-content {
  max-height: 520px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  color: var(--ink);
  font-size: .84rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text;
}
.legacy-instructions {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 12px;
  background: var(--input-bg);
  color: var(--ink);
  font-size: .88rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15,118,110,.15);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
select { cursor: pointer; }
textarea { resize: vertical; min-height: 80px; }

/* ── 搜索栏 ── */
.search-bar {
  position: relative;
  max-width: 360px;
  flex: 1;
}
.search-bar input {
  padding-left: 36px;
  border-radius: 999px;
  background: var(--surface-subtle);
}
.search-bar::before {
  content: '🔍';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: .85rem;
}

/* 可折叠搜索框：默认收起成放大镜图标，点击(聚焦)或已有搜索词时展开，省工具栏空间 */
.search-bar.search-collapsible {
  flex: 0 0 auto;
  max-width: none;
}
.search-bar.search-collapsible input {
  width: 36px;
  min-width: 0;
  cursor: pointer;
  transition: width .18s ease;
}
.search-bar.search-collapsible input:focus,
.search-bar.search-collapsible input:not(:placeholder-shown) {
  width: 260px;
  cursor: text;
}
@media (max-width: 640px) {
  .search-bar.search-collapsible { flex: 1 1 100%; }
  .search-bar.search-collapsible input,
  .search-bar.search-collapsible input:focus { width: 100%; }
}

/* ── 标签页 (Tabs) ── */
.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.tabs a, .tabs button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 16px;
  background: var(--panel);
  color: var(--ink-secondary);
  font-size: .85rem;
  font-weight: 500;
  transition: all var(--transition);
}
.tabs a:hover, .tabs button:hover { background: var(--surface-hover); color: var(--ink); }
.productivity-window.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.tabs a.active, .tabs button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── 工具栏 ── */
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.toolbar select { width: auto; min-width: 140px; }
.toolbar .toolbar-spacer { flex: 1; }
.toolbar .selected-count {
  font-size: .82rem;
  color: var(--accent);
  font-weight: 600;
  padding: 4px 8px;
  background: var(--accent-light);
  border-radius: 6px;
}
.toolbar .toolbar-group {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.toolbar .toolbar-label {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
}

.toolbar select.toolbar-target-select {
  min-width: 180px;
  max-width: 320px;
}
.toolbar .toolbar-date-range {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  white-space: nowrap;
  color: var(--muted);
  font-size: .85rem;
}
.toolbar .toolbar-date-range label {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  margin: 0;
  font-size: .85rem;
}
.toolbar .toolbar-date-range input[type="date"] {
  width: 150px;
  max-width: 150px;
  padding: 6px 8px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.toolbar .toolbar-date-range .btn-xs {
  white-space: nowrap;
}
.toolbar-grow { flex: 1 1 240px; }
.nowrap-label { display: flex; align-items: center; gap: 6px; }
.nowrap { white-space: nowrap; }

/* ── 目标列表：筛选、扫描参数、选中项操作分层展示 ── */
.targets-list-section { overflow: visible; }
.target-list-head { margin: 0 0 12px; }
.target-list-head h2 { margin-bottom: 3px; }
.target-list-head p { margin: 0; font-size: .78rem; }
.target-controls {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.target-control-block {
  display: grid;
  grid-template-columns: minmax(150px, 180px) minmax(0, 1fr);
  gap: 14px 18px;
  align-items: center;
  padding: 13px 14px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.target-control-heading {
  display: grid;
  gap: 3px;
  align-content: center;
  min-height: 42px;
  padding-left: 10px;
  border-left: 3px solid var(--accent-readable, var(--accent));
}
.target-control-heading strong { color: var(--ink); font-size: .85rem; }
.target-control-heading small { color: var(--muted); font-size: .68rem; line-height: 1.4; }
.target-filter-controls {
  display: flex;
  gap: 10px;
  align-items: end;
  min-width: 0;
  flex-wrap: wrap;
}
.target-filter-controls > label {
  flex: 1 1 155px;
  min-width: 145px;
  margin: 0;
  font-size: .72rem;
}
.target-search-form { flex: 2 1 360px; min-width: min(360px, 100%); }
.target-search-form > label { margin: 0; font-size: .72rem; }
.target-search-inline { display: flex; gap: 6px; min-width: 0; }
.target-search-inline input { flex: 1 1 220px; min-width: 120px; }
.target-search-inline button,
.target-search-inline .btn-ghost { flex: 0 0 auto; }
.target-bulk-scan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 10px;
  align-items: end;
  min-width: 0;
}
.target-bulk-scan-grid label { min-width: 0; margin: 0; font-size: .72rem; }
.target-bulk-scan-grid select,
.target-bulk-scan-grid input { min-width: 0; }
/* label 的通用 display:grid 会覆盖浏览器原生 [hidden]，这里恢复定时字段的真实隐藏状态。 */
.targets-list-section [data-schedule-time-wrap][hidden],
.targets-list-section [data-schedule-interval-wrap][hidden] { display: none !important; }
/* 同理：.stack 的通用 display:grid 会覆盖浏览器原生 [hidden]，
   「添加目标」按种类切换网址扫描/上传代码审计表单时两个都会显示。 */
[data-target-type-panel][hidden] { display: none !important; }
.target-selection-bar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 9px 12px 9px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.target-selection-summary { display: flex; gap: 8px; align-items: center; min-width: 0; }
.target-selection-summary strong { font-size: .78rem; white-space: nowrap; }
.target-selection-summary small { color: var(--muted); font-size: .7rem; white-space: nowrap; }
.target-selection-summary .selected-count {
  padding: 3px 7px;
  color: var(--accent-readable, var(--accent));
  background: var(--accent-light);
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  white-space: nowrap;
}
.target-selection-summary .selected-count:empty { display: none; }
.target-selection-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.target-action-divider { width: 1px; height: 24px; margin: 0 2px; background: var(--line); }

.table-wrap > table.target-table {
  min-width: 1780px;
  table-layout: fixed;
}
/* 列宽总和控制在 ~1680：表格 width:100% 下宽屏会自动摊满，这里是实质的最小宽度，
   总和过大时容器稍窄就会横向裁切、盖住操作列最右侧的按钮 */
/* th/td 全局 white-space:nowrap 没有配 overflow 处理；浏览器/系统字体放大到一定程度后
   （用户反馈"缩放"，实测 rem 换算后根字号约 40px+ 即触发），"范围模式/任务/漏洞"这类窄列
   文字会横向溢出、互相覆盖成无法辨认的乱码。其余固定列宽表格（.compact-table、
   .config-endpoints-table）都已有这层截断保护，只有这张表漏了，补齐保持一致 */
.target-table th,
.target-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}
.target-table .target-col-select { width: 44px; }
.target-table .target-col-name { width: 220px; }
.target-table .target-col-url { width: 270px; }
.target-table .target-col-group { width: 150px; }
.target-table .target-col-description { width: 190px; }
.target-table .target-col-creator { width: 120px; }
.target-table .target-col-status { width: 108px; }
.target-table .target-col-scope { width: 110px; }
.target-table .target-col-metric { width: 68px; }
.target-table .target-col-actions { width: 330px; }
.target-table input,
.target-table select { min-width: 0; }
/* 状态/范围列的下拉压 padding，避免 fixed 布局下文本溢出 */
.target-table .target-col-status select,
.target-table .target-col-scope select { padding: 5px 6px; font-size: .8rem; }
/* 范围模式说明折叠块（目标列表头部） */
.scope-mode-help { margin-top: 8px; max-width: 720px; }
.scope-mode-help summary {
  cursor: pointer; color: var(--ink-secondary); font-size: .82rem;
  user-select: none; padding: 2px 0;
}
.scope-mode-help summary:hover { color: var(--ink); }
.scope-mode-help-body {
  margin-top: 8px; padding: 10px 14px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--panel);
  font-size: .84rem; line-height: 1.7; color: var(--ink-secondary);
}
.scope-mode-help-body p { margin: 0 0 6px; }
.scope-mode-help-body ul { margin: 4px 0 6px; padding-left: 1.3em; }
.scope-mode-help-body li { margin-bottom: 4px; }
.scope-mode-help-body code { background: var(--code-bg); padding: 1px 5px; border-radius: 4px; font-size: .8rem; }
.target-table .target-metric { color: var(--ink-secondary); text-align: center; font-variant-numeric: tabular-nums; }
.target-table th:nth-child(8),
.target-table th:nth-child(9) { text-align: center; }
.target-table .target-actions-cell { min-width: 0; }
.target-row-actions { gap: 5px; flex-wrap: wrap; }
.target-row-actions form { flex: 0 0 auto; }
/* 操作列按钮统一 60px 定宽（含「认证 ●」指示点也放得下），按钮文本自动居中，
   避免两个字/四个字标签宽窄不一 */
.target-row-actions .btn-sm { min-height: 32px; padding: 5px 9px; width: 60px; }
.node-edit-panel.target-auth-panel,
.node-edit-panel.target-scan-panel { border-left: 3px solid var(--accent-readable, var(--accent)); }
/* 下发扫描面板分上下两块，两块共用同一套列模板（面板按目标类型挂 cols-7 / cols-6）：
   「执行方式」与上方「扫描级别」同列同宽，跨行严格对齐；代码审计目标少一个
   范围模式字段，两行同步降为 6 列，行尾不留空位 */
.node-edit-panel.target-scan-panel { display: flex; flex-direction: column; gap: 12px; }
.target-scan-param-grid,
.target-scan-exec-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
}
.target-scan-exec-row { align-items: end; }
.target-scan-panel.cols-6 .target-scan-param-grid,
.target-scan-panel.cols-6 .target-scan-exec-row { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.target-auth-panel .node-edit-actions { grid-column: 1 / -1; }
/* 执行行：定时字段隐藏时不占列，认证覆盖/按钮自动前移，按钮跨到行尾右对齐 */
.target-scan-panel .target-scan-auth-override { min-width: 0; }
.target-scan-panel .node-edit-actions { grid-column: auto / -1; justify-self: end; }

@media (max-width: 1100px) {
  .target-control-block { grid-template-columns: 1fr; gap: 10px; }
  .target-control-heading { min-height: 0; }
  .target-scan-param-grid,
  .target-scan-exec-row,
  .target-scan-panel.cols-6 .target-scan-param-grid,
  .target-scan-panel.cols-6 .target-scan-exec-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .target-filter-controls { display: grid; grid-template-columns: 1fr; }
  .target-filter-controls > label,
  .target-search-form { min-width: 0; width: 100%; }
  .target-selection-bar,
  .target-selection-summary { align-items: flex-start; flex-direction: column; }
  .target-selection-actions { width: 100%; justify-content: flex-start; }
  .target-action-divider { display: none; }
  .target-search-inline { flex-wrap: wrap; }
  .target-scan-param-grid,
  .target-scan-exec-row,
  .target-scan-panel.cols-6 .target-scan-param-grid,
  .target-scan-panel.cols-6 .target-scan-exec-row { grid-template-columns: 1fr; }
}

/* ── 管理员日志中心 ── */
.log-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.log-stat-card {
  display: grid;
  gap: 5px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.log-stat-card span { color: var(--muted); font-size: .78rem; }
.log-stat-card strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.log-stat-card small { color: var(--ink-secondary); font-size: .78rem; }
.log-filter-toolbar { align-items: end; }
.log-filter-toolbar label { display: grid; gap: 5px; }
.log-level-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.log-level-filter legend { margin-bottom: 5px; color: var(--muted); font-size: .78rem; font-weight: 600; }
.log-level-option {
  display: inline-flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 5px !important;
  padding: 5px 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: .74rem;
  font-weight: 600;
}
.log-level-option input { width: 14px; height: 14px; margin: 0; }
.log-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin: -4px 0 14px; }
.log-actions form { margin: 0; }
.log-level-badge {
  display: inline-flex;
  justify-content: center;
  min-width: 68px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
}
.log-level-debug { color: #475569; background: #e2e8f0; }
.log-level-info { color: #1d4ed8; background: #dbeafe; }
.log-level-warning { color: #a16207; background: #fef3c7; }
.log-level-error, .log-level-critical { color: #b91c1c; background: #fee2e2; }
.log-table .log-detail {
  min-width: 300px;
  max-width: 720px;
  max-height: 130px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink-secondary);
  background: transparent;
  font-size: .75rem;
}
.assistant-audit-entry { display: grid; gap: 8px; min-width: 420px; }
.assistant-audit-entry header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.assistant-audit-entry header span,
.assistant-audit-entry footer { color: var(--muted); font-size: .72rem; }
.assistant-chat-content {
  margin: 0;
  overflow: visible;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink-secondary);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: .78rem;
}
.assistant-audit-entry details summary { cursor: pointer; color: var(--ink-secondary); font-size: .76rem; }
.assistant-audit-entry details[open] summary { margin-bottom: 6px; }
.system-log-list {
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}
.system-log-row {
  display: grid;
  grid-template-columns: 180px 76px minmax(130px, 190px) minmax(260px, 1fr) 110px;
  gap: 10px;
  align-items: start;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  font-size: .76rem;
}
.system-log-row:last-child { border-bottom: 0; }
.system-log-row time, .system-log-source, .system-log-row small { color: var(--muted); }
.system-log-row pre { margin: 0; white-space: pre-wrap; word-break: break-word; color: var(--ink-secondary); }
.system-log-row small { text-align: right; }

html[data-theme="dark"] .log-level-debug { color: #cbd5e1; background: #334155; }
html[data-theme="dark"] .log-level-info { color: #bfdbfe; background: #1e3a5f; }
html[data-theme="dark"] .log-level-warning { color: #fde68a; background: #513d0a; }
html[data-theme="dark"] .log-level-error,
html[data-theme="dark"] .log-level-critical { color: #fecaca; background: #5b1f28; }

@media (max-width: 900px) {
  .log-stats-grid { grid-template-columns: 1fr; }
  .system-log-row { grid-template-columns: 1fr; }
  .system-log-row small { text-align: left; }
}

/* ── 批量任务向导：多步骤表单，收紧卡片级留白 ── */
.batch-wizard { gap: 10px; }
.batch-wizard section, .batch-wizard .grid > div { padding: 14px 16px; margin-bottom: 0; }
.batch-wizard .section-head { margin: 0 0 8px; }
.batch-wizard h2 { font-size: 1rem; margin-bottom: 8px; }
.batch-wizard .toolbar { padding: 8px 10px; margin-bottom: 8px; }
.batch-wizard .toolbar:last-child { margin-bottom: 0; }
.batch-wizard .table-wrap { margin-top: 4px; }
.batch-wizard .grid { margin-bottom: 0; gap: 10px; }
/* 选项列表（扫描模式 / 编排 / 回退共用，竖排、对齐） */
.batch-wizard .opt-list { display: grid; gap: 10px; margin-top: 6px; }
.batch-wizard .opt-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-weight: 500;
  font-size: .88rem;
  cursor: pointer;
}
.batch-wizard .opt-item input { width: auto; margin-top: 3px; }
.batch-wizard .opt-text { display: grid; gap: 2px; }
.batch-wizard .opt-text .muted { font-size: .76rem; font-weight: 400; }
.batch-wizard .opt-title { color: var(--ink); }
.batch-wizard .wave-input { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: nowrap; }
.batch-wizard .wave-input input { width: 80px; flex: 0 0 auto; }
.batch-wizard .wave-label { font-weight: 500; font-size: .85rem; white-space: nowrap; }
/* 提交条：预览信息 + 按钮 一行 */
.batch-wizard .batch-submit { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.batch-wizard .batch-submit .alert { flex: 1 1 280px; margin: 0; }
.batch-wizard .batch-submit .btn-primary { flex: 0 0 auto; }
.preset-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 14px;
}

/* ── 在线状态指示 ── */
.online-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.online-dot.online { background: #16a34a; box-shadow: 0 0 6px rgba(22,163,74,.4); }
.online-dot.offline { background: #94a3b8; }
.online-dot.unknown { background: #cbd5e1; }

/* ── 行操作 ── */
.row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.row-actions form { display: inline-flex; }
.row-actions select { width: auto; min-width: 94px; }
.cell-stack { display: grid; gap: 6px; min-width: 0; }
.cell-stack > * { min-width: 0; }
.cell-stack .inline { justify-content: flex-start; }
.cell-actions { min-width: 300px; }
.status-cell { display: grid; gap: 5px; align-items: start; }
.status-cell > * { min-width: 0; }

/* ── 出口代理列表：主机与端口分列，字段保留稳定可读宽度 ── */
.table-wrap > table.proxy-table {
  min-width: 1960px;
  table-layout: fixed;
}
/* 同 .target-table：th/td 继承全局 white-space:nowrap 没配 overflow，字体放大后
   窄列（id/owner/port）文字会横向溢出、覆盖相邻列，补齐截断保护 */
.proxy-table th,
.proxy-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}
.proxy-table .proxy-col-id { width: 54px; }
.proxy-table .proxy-col-name { width: 230px; }
.proxy-table .proxy-col-protocol { width: 120px; }
.proxy-table .proxy-col-host { width: 260px; }
.proxy-table .proxy-col-port { width: 110px; }
.proxy-table .proxy-col-username { width: 220px; }
.proxy-table .proxy-col-password { width: 220px; }
.proxy-table .proxy-col-dns { width: 140px; }
.proxy-table .proxy-col-status { width: 250px; }
.proxy-table .proxy-col-owner { width: 100px; }
.proxy-table .proxy-col-actions { width: 256px; }
.proxy-table input,
.proxy-table select { min-width: 0; }
.proxy-table td:nth-child(9) { white-space: normal; }
.proxy-check-message {
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── API 端点列表 ── */
.table-wrap > table.config-endpoints-table {
  min-width: 2020px;
  table-layout: fixed;
}
.config-endpoints-table .config-col-select { width: 46px; }
.config-endpoints-table .config-col-id { width: 64px; }
.config-endpoints-table .config-col-name { width: 230px; }
.config-endpoints-table .config-col-creator { width: 140px; }
.config-endpoints-table .config-col-provider { width: 160px; }
.config-endpoints-table .config-col-model { width: 210px; }
.config-endpoints-table .config-col-base { width: 330px; }
.config-endpoints-table .config-col-key { width: 210px; }
.config-endpoints-table .config-col-reasoning { width: 120px; }
.config-endpoints-table .config-col-pricing { width: 220px; }
.config-endpoints-table .config-col-actions { width: 290px; }
.config-endpoints-table td { overflow: hidden; text-overflow: ellipsis; }
.config-endpoints-table input,
.config-endpoints-table select { min-width: 0; }
.config-name-cell { white-space: normal; }
.config-name-controls,
.config-name-badges,
.config-base-controls {
  display: flex;
  align-items: center;
  min-width: 0;
}
.config-name-controls { gap: 6px; flex-wrap: wrap; }
.config-name-controls > input,
.config-name-text {
  width: auto;
  min-width: 0;
  flex: 1 1 130px;
}
.config-name-badges { gap: 4px; flex: 0 1 auto; flex-wrap: wrap; }
.config-name-badges .muted {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.config-base-controls { gap: 6px; }
.config-base-controls > input {
  width: auto;
  flex: 1 1 auto;
}
.config-base-controls > button { flex: 0 0 auto; }

/* ── 节点列表 ── */
.node-table-wrap {
  overflow-x: auto;
}
.node-table {
  min-width: 100%;
  table-layout: fixed;
}
.node-table th,
.node-table td {
  padding: 12px 14px;
  white-space: normal;
  vertical-align: middle;
}
.node-table .mono,
.node-table .clip {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  /* 这两个类之前没设字号，会掉回表格基准 .88rem，跟同一格里 .muted 的 .8rem 挤在一起
     大小对不上（比如连接列的主机名 vs 下面 .muted 的入网状态行）；统一到 .8rem */
  font-size: .8rem;
}
.node-col-check { width: 36px; }
.node-col-name { width: 15%; }
.node-col-conn { width: 19%; }
.node-col-work { width: 15%; }
.node-col-state { width: 27%; }
.node-col-check-result { width: 24%; }
.node-metrics-cell { gap: 4px; }
.node-metrics-cell [data-field="spec"] { font-size: .78rem; line-height: 1.25; opacity: .85; }
/* 在线灯 + 状态文字 + CPU/内存 挤在同一行展示，靠 flex 撑开间距和自动换行 */
.node-live-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  /* 在线/离线文字之前没设字号会掉回 .88rem，跟同一行右边 .muted 的 CPU/内存文字（.8rem）
     大小不一致；这里统一交给容器控制，子元素没单独设字号的就跟着继承 */
  font-size: .8rem;
}
.node-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
.node-table .badge {
  padding: 2px 8px;
  font-size: .72rem;
}
.node-info-cell { text-align: left; }
.node-creator-info {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin-bottom: 7px;
  font-size: .78rem;
}
.node-creator-label {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  background: var(--surface-subtle);
  font-size: .7rem;
}
.node-creator-info .mono { color: var(--ink-secondary); }
.node-info-summary {
  display: grid;
  gap: 3px;
  min-width: 0;
  margin-bottom: 7px;
}
.node-netbird-info {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: .78rem;
}
.node-netbird-info .clip { max-width: 180px; }
.node-netbird-label {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: 5px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  font-size: .7rem;
  letter-spacing: .02em;
}
.node-netbird-label::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 18%, transparent);
}
html[data-theme="dark"] .node-netbird-label {
  color: #a7f3e3;
  border-color: #367d72;
  background: linear-gradient(135deg, rgba(28, 104, 91, .42), rgba(13, 62, 55, .58));
  box-shadow: inset 0 0 0 1px rgba(122, 214, 196, .08), 0 0 12px rgba(39, 162, 139, .12);
}
html[data-theme="dark"] .node-netbird-info > .mono:not(.muted) { color: #d5e9e5; }
html[data-theme="dark"] .node-netbird-info > .muted { color: #82bdb2; }
.node-os-release {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-secondary);
  font-size: .75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html[data-theme="dark"] .node-os-release { color: #9fb0c4; }
.node-version-list {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
  max-width: 100%;
}
.node-version {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .76rem;
  white-space: nowrap;
}
.node-check-summary {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.node-check-summary > .muted {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.node-check-summary .errorline,
.node-check-summary .muted:last-child {
  min-width: 0;
  max-width: 100%;
  margin-top: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.node-edit-row td {
  background: var(--surface-subtle);
  padding: 14px;
}
/* 操作条紧跟在节点数据行下面常驻展示，上下留白比展开的编辑表单收紧一些，
   视觉上更像"挂在这一行下面的工具条"，而不是另起一个独立分区 */
.node-actions-row td {
  background: var(--surface-subtle);
  padding: 0;
}
.node-management-row > summary {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 34px;
  padding: 0 16px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.node-management-row > summary::marker { color: var(--accent); }
.node-management-row[open] > summary {
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.node-edit-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 14px;
}
.node-edit-wide {
  grid-column: span 2;
}
/* 端点「配置」展开面板：不用 .node-edit-panel 的刚性 4 列网格（勾选框/价格输入/多选混排会错位），
   改成竖直分区卡片，价格三项内部再自成一行网格 */
.config-edit-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.config-edit-panel > form:empty { display: none; }
.config-edit-group {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.config-edit-group > legend {
  padding: 0 6px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
}
.config-edit-group label { margin: 0; }
.config-edit-group .inline {
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}
.config-edit-group .inline small { flex-basis: 100%; margin-left: 24px; }
.config-edit-tenants small { display: block; margin-top: 4px; }
.config-price-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 12px;
}
.config-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
@media (max-width: 760px) {
  .config-price-grid { grid-template-columns: 1fr; }
}
.node-web-create {
  display: grid;
  grid-template-columns: minmax(280px, 2fr) minmax(240px, 1fr) 120px 140px;
  gap: 14px 18px;
  align-items: end;
}
.node-web-create label {
  margin: 0;
}
.node-web-type {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  color: var(--muted);
}
.node-web-create > button {
  min-height: 42px;
  margin: 0;
}
.node-web-create-hint {
  grid-column: 1 / -1;
  margin: -2px 0 0;
}
@media (max-width: 1050px) {
  .node-web-create {
    grid-template-columns: 1fr 1fr;
  }
  .node-web-create > button {
    width: 100%;
  }
}
/* plugins.html 里 .node-edit-panel 直接包了两个独立 <form>（配置表单 + 重传源码表单），
   不加这条会被当成 grid 的两个 item 挤到同一行左右两列，右侧表单还会被拉伸到与左侧等高
   并因 .form-row 的 align-items:flex-end 贴底，和左侧"保存配置"按钮视觉重叠 */
.node-edit-panel > form {
  grid-column: 1 / -1;
}
.node-edit-actions {
  display: flex;
  gap: 8px;
  align-items: end;
  justify-content: flex-end;
  flex-wrap: wrap;
}
/* 节点操作条：单独占一整行常驻展示（不再塞进窄的操作列），按钮间距更宽松、不必挤 btn-xs。
   整体靠右对齐——跟表格里数据天然右侧收尾（检测列、数字类内容）呼应，行与行之间右边缘
   对得齐，不会因为按钮数量不同（比如默认节点没有"设为默认/删除"）而看起来长短不一。 */
.node-actions-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px;
}
.node-actions-panel form {
  display: inline-flex;
}
/* 设默认/删除属于节点生命周期管理，跟上面运维类操作用分隔线隔开；父容器已整体右对齐，
   这里不需要再用 margin-left:auto 抢占空间（会跟 justify-content:flex-end 打架）*/
.node-actions-danger-group {
  display: inline-flex;
  gap: 8px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}
/* 操作面板内普通操作的竖线分隔分组：与危险组同款视觉，但不带危险语义 */
.node-actions-sep-group {
  display: inline-flex;
  gap: 8px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}
/* 漏洞管理页操作面板：下拉框同步缩到小尺寸，跟 btn-xs 按钮对齐，整条操作更紧凑 */
#vuln-table .node-actions-panel form {
  gap: 10px;
}
#vuln-table .node-actions-panel select {
  width: auto;
  min-width: 96px;
  padding: 3px 8px;
  font-size: .72rem;
  line-height: 1.4;
  height: 24px;
}
#vuln-table .node-actions-panel .btn-xs {
  height: 24px;
}

.node-log-grid {
  display: grid;
  gap: 12px;
}
.node-log-section {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}
.node-log-head,
.node-log-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.node-log-head {
  justify-content: space-between;
  margin-bottom: 10px;
}
.node-log-preview {
  max-height: 360px;
  margin: 10px 0 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: .76rem;
}

/* ── 进度条 ── */
.progress {
  width: 120px;
  height: 6px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--code-bg);
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width .5s ease;
}
.progress-indeterminate span {
  width: 40% !important;
  animation: progress-slide 1.5s ease-in-out infinite;
}
.is-hidden {
  display: none !important;
}
@keyframes progress-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* ── 任务实时状态 ── */
.job-live-panel {
  overflow-x: visible;
}
.job-live-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.job-live-head h2 { margin: 0; }
.job-live-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.job-live-grid > div {
  min-width: 0;
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  padding: 11px 13px;
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 64px;
}
.job-live-grid .job-live-current {
  border-left: 3px solid var(--accent);
  background: var(--surface-hover);
}
.job-live-grid strong {
  min-width: 0;
  font-size: .9rem;
  overflow-wrap: anywhere;
}
.job-live-grid > div > .muted,
.job-usage-grid > div > .muted {
  font-size: .78rem;
  line-height: 1.4;
}
.job-live-grid strong,
.job-runtime-time,
.job-usage-grid strong {
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}
.job-runtime-heading,
.job-runtime-usage h3 {
  margin: 16px 0 8px;
  color: var(--ink-secondary);
  font-size: .82rem;
  font-weight: 600;
}
.job-runtime-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}
.job-runtime-details > div {
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 64px;
}
.job-runtime-details > div[hidden] { display: none !important; }
.job-runtime-details dt {
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 500;
  line-height: 1.4;
}
.job-runtime-details dd {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: .88rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.job-runtime-time {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px 12px;
}
/* 独立命名，避免全局 usage-grid 的后代 span 规则拆散数值和推理明细。 */
.job-usage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.job-usage-grid > div {
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 64px;
}
.job-usage-grid strong {
  min-width: 0;
  color: var(--ink);
  font-size: .9rem;
  overflow-wrap: anywhere;
}
.job-usage-output {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 10px;
}
.job-usage-output small {
  display: inline-flex;
  gap: .3em;
  font-size: .76rem;
  font-weight: 400;
  white-space: nowrap;
}
.job-runtime-artifacts {
  display: grid;
  gap: 6px;
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.job-runtime-artifacts > div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: baseline;
  gap: 12px;
  font-size: .78rem;
  line-height: 1.5;
}
.job-runtime-artifacts dt {
  color: var(--muted);
}
.job-runtime-artifacts dd {
  min-width: 0;
  margin: 0;
  color: var(--ink-secondary);
  overflow-wrap: anywhere;
}
.usage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.usage-grid > div {
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  padding: 12px;
  display: grid;
  gap: 4px;
}
.usage-grid strong {
  min-width: 0;
  font-size: .94rem;
  overflow-wrap: anywhere;
}
.live-log {
  max-height: 360px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow: auto;
  scroll-behavior: smooth;
}
.live-follow-toggle {
  font-size: .82rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ── 对话框 / Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: grid;
  place-items: center;
  z-index: 200;
  animation: fade-in .15s ease;
}
.modal {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 640px;
  width: calc(100% - 40px);
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slide-up .2s ease;
}
.modal h2 { margin-bottom: 16px; }
.modal .modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ── Toast 通知 ── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 300;
  display: grid;
  gap: 8px;
}
.toast {
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: .85rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: slide-in .25s ease;
  max-width: 380px;
}
.toast-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.toast-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.toast-info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
@keyframes slide-in { from { opacity: 0; transform: translateX(100px); } to { opacity: 1; transform: translateX(0); } }

/* ── 分页 ── */
.pagination {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
}
.pagination-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-top: 14px;
  color: var(--ink-secondary);
  font-size: .85rem;
}
.pagination-summary { font-weight: 500; }
.pagination-size {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.pagination-size select { width: auto; min-width: 90px; padding: 6px 10px; }
.page-current {
  min-width: 64px;
  text-align: center;
  color: var(--ink-secondary);
  font-weight: 600;
}
.btn.disabled {
  opacity: .45;
  cursor: default;
  pointer-events: none;
  background: var(--surface-subtle);
  color: var(--muted);
  border-color: var(--line);
}
.pagination button, .pagination span {
  min-width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink-secondary);
  font-size: .85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}
.pagination button:hover { background: var(--surface-hover); }
.pagination button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination button:disabled { opacity: .4; cursor: default; }

/* ── 详情定义列表 ── */
.detail {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 8px 20px;
  font-size: .88rem;
}
.detail dt { color: var(--muted); font-weight: 500; }
.detail dd { margin: 0; color: var(--ink); }

/* ── 长文本 / 代码块 ── */
.longtext {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  max-height: 500px;
  overflow: auto;
  font-size: .85rem;
  line-height: 1.6;
}
.longtext.live-log {
  max-height: 360px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow: auto;
  scroll-behavior: smooth;
}
.longtext.markdown-body {
  white-space: normal;
  font-family: system-ui, -apple-system, sans-serif;
}
.longtext.markdown-body h1, .longtext.markdown-body h2, .longtext.markdown-body h3 { margin-top: 16px; }
.longtext.markdown-body ol, .longtext.markdown-body ul { padding-left: 1.4em; margin: 0 0 12px; }
.longtext.markdown-body li { margin-bottom: 4px; }
.longtext.markdown-body code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: .82rem;
}
.longtext.markdown-body pre {
  background: var(--code-panel-bg);
  color: var(--code-panel-ink);
  padding: 14px;
  border-radius: var(--radius);
  overflow-x: auto;
}
.longtext.markdown-body pre code { background: none; padding: 0; color: inherit; }
.longtext.vuln-content {
  max-height: none;
  overflow: visible;
}

/* ── LLM 日志检索工作台 ── */
.llm-explorer-head { margin-bottom: 18px; }
.llm-explorer-scope {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-secondary);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  padding: 6px 11px;
  font-size: .78rem;
}
.llm-scope-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--info); box-shadow: 0 0 0 3px var(--info-bg); }
.llm-query-panel,
.llm-timeline-panel,
.llm-facet-panel,
.llm-result-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}
.llm-query-panel { border-radius: var(--radius-lg); padding: 14px; margin-bottom: 14px; }
.llm-query-row { display: grid; grid-template-columns: minmax(320px, 1fr) auto auto; gap: 10px; }
.llm-query-input-wrap { position: relative; display: block; }
.llm-query-input-wrap svg {
  position: absolute;
  width: 18px;
  height: 18px;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
}
.llm-query-input-wrap input { height: 42px; padding-left: 42px; padding-right: 42px; font-size: .92rem; }
.llm-query-input-wrap kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: var(--muted);
  background: var(--surface-subtle);
  font: 11px/1.4 var(--font-body);
  padding: 0 5px;
}
.llm-range-select { width: 138px; height: 42px; }
.llm-run-button { min-width: 76px; height: 42px; }
.llm-custom-range {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-light);
  color: var(--muted);
}
.llm-custom-range[hidden] { display: none; }
.llm-custom-range label { display: grid; gap: 3px; color: var(--ink-secondary); font-size: .75rem; }
.llm-custom-range input { width: 168px; }
.llm-query-options {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  margin-top: 10px;
  color: var(--muted);
  font-size: .78rem;
  flex-wrap: wrap;
}
.llm-query-options input { width: 112px; padding: 6px 9px; }
.llm-query-options select { width: 154px; padding: 6px 9px; }
.llm-active-filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.llm-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent);
  padding: 4px 8px;
  font-size: .75rem;
  cursor: pointer;
}
.llm-filter-chip span { font-size: .9rem; line-height: 1; }
.llm-timeline-panel { border-radius: var(--radius-lg); padding: 10px 14px 8px; margin-bottom: 14px; }
.llm-timeline-panel[hidden] { display: none; }
.llm-panel-title { display: flex; justify-content: space-between; gap: 12px; align-items: center; font-size: .78rem; font-weight: 650; }
.llm-timeline-canvas { height: 92px; margin-top: 4px; }
.llm-explorer-grid { display: grid; grid-template-columns: 228px minmax(0, 1fr); gap: 14px; align-items: start; }
.llm-facet-panel { border-radius: var(--radius-lg); padding: 13px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.llm-facet-group { border-top: 1px solid var(--line-light); padding-top: 12px; margin-top: 12px; }
.llm-facet-group h2 { color: var(--ink-secondary); font-size: .77rem; margin: 0 0 6px; font-weight: 650; }
.llm-facet-hint { color: var(--muted); font-size: .68rem; font-weight: 400; margin-left: 4px; }
.llm-facet-list { display: grid; gap: 2px; }
.llm-facet-empty { color: var(--muted); font-size: .74rem; padding: 4px 2px; }
.llm-facet-option {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-secondary);
  padding: 5px 7px;
  font-size: .77rem;
  font-weight: 500;
  text-align: left;
}
.llm-facet-option:hover { background: var(--surface-hover); filter: none; }
.llm-facet-option.active { background: var(--accent-light); color: var(--accent); }
.llm-facet-option .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.llm-facet-option .count { color: var(--muted); font-variant-numeric: tabular-nums; }
.llm-result-panel { border-radius: var(--radius-lg); min-height: 440px; overflow: hidden; }
.llm-result-toolbar { min-height: 45px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 9px 13px; }
.llm-result-toolbar strong { font-size: .84rem; margin-right: 8px; }
.llm-result-hint { color: var(--muted); font-size: .73rem; }
.llm-log-stream { display: grid; }
.llm-log-row {
  --llm-role-color: var(--muted);
  position: relative;
  display: grid;
  grid-template-columns: 92px minmax(135px, 220px) minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line-light);
  border-left: 3px solid var(--llm-role-color);
  border-radius: 0;
  background: var(--panel);
  color: var(--ink);
  padding: 10px 13px 11px 10px;
  font-weight: 400;
  text-align: left;
}
.llm-log-row:hover { background: var(--surface-hover); filter: none; }
.llm-log-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.llm-log-row.role-user { --llm-role-color: var(--low); }
.llm-log-row.role-assistant { --llm-role-color: var(--accent); }
.llm-log-row.role-tool { --llm-role-color: var(--medium); }
.llm-log-time { color: var(--muted); font-size: .72rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.llm-log-source { min-width: 0; }
.llm-log-source strong,
.llm-log-source span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.llm-log-source strong { font-size: .77rem; color: var(--ink-secondary); }
.llm-log-source span { color: var(--muted); font-size: .71rem; margin-top: 2px; }
.llm-log-body { min-width: 0; }
.llm-log-labels { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; }
.llm-log-role,
.llm-log-type { font-size: .68rem; line-height: 1.4; color: var(--ink-secondary); }
.llm-log-role { color: var(--llm-role-color); font-weight: 650; }
.llm-log-snippet { margin: 0; color: var(--ink-secondary); font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; word-break: break-word; max-height: 5em; overflow: hidden; }
.llm-search-highlight mark {
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 3px;
  padding: 0 2px;
}
.llm-loadmore { display: flex; justify-content: center; border-top: 1px solid var(--line-light); padding: 12px; }
.llm-loadmore[hidden] { display: none; }
.llm-detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 299;
  border: 0;
  border-radius: 0;
  background: rgba(2, 6, 23, .42);
  backdrop-filter: blur(1px);
}
.llm-detail-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 300;
  display: flex;
  flex-direction: column;
  width: min(620px, calc(100vw - 260px));
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.llm-detail-backdrop[hidden], .llm-detail-drawer[hidden] { display: none; }
.llm-detail-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); padding: 15px 18px; }
.llm-detail-head h2 { margin: 1px 0 0; font-size: 1rem; }
.llm-icon-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-subtle); color: var(--ink-secondary); padding: 0; font-size: 1.25rem; }
.llm-detail-meta { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 18px 0; }
.llm-detail-meta span { background: var(--surface-subtle); border: 1px solid var(--line); border-radius: 4px; color: var(--ink-secondary); padding: 3px 6px; font-size: .72rem; }
.llm-detail-actions { display: flex; gap: 8px; padding: 10px 18px; border-bottom: 1px solid var(--line-light); }
.llm-detail-drawer > .alert { margin: 10px 18px 0; }
.llm-context-stream { flex: 1; overflow-y: auto; padding: 12px 18px 24px; display: grid; gap: 8px; }
.llm-context-item { border-left: 2px solid var(--line); padding: 7px 10px; background: var(--surface-subtle); }
.llm-context-item.current { border-left-color: var(--accent); background: var(--accent-light); }
.llm-context-item-head { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: .7rem; margin-bottom: 4px; }
.llm-context-item pre { margin: 0; white-space: pre-wrap; word-break: break-word; color: var(--ink-secondary); font: 11px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
.llm-detail-raw { flex: 0 0 auto; border-top: 1px solid var(--line); padding: 10px 18px 14px; }
.llm-detail-raw summary { cursor: pointer; color: var(--muted); font-size: .75rem; }
.llm-detail-raw pre { max-height: 220px; overflow: auto; white-space: pre-wrap; word-break: break-word; background: var(--code-panel-bg); color: var(--code-panel-ink); border-radius: 6px; padding: 10px; font-size: .72rem; }
body.llm-drawer-open { overflow: hidden; }

html[data-theme="dark"] .llm-filter-chip,
html[data-theme="dark"] .llm-facet-option.active,
html[data-theme="dark"] .llm-search-highlight mark { color: var(--accent-readable); }
html[data-theme="dark"] .llm-log-row.role-assistant { --llm-role-color: var(--accent-readable); }

@media (max-width: 980px) {
  .llm-query-row { grid-template-columns: minmax(0, 1fr) auto; }
  .llm-run-button { grid-column: 1 / -1; }
  .llm-explorer-grid { grid-template-columns: 1fr; }
  .llm-facet-panel { position: static; max-height: none; }
  .llm-facet-group { display: inline-block; vertical-align: top; width: min(220px, 48%); margin-right: 8px; }
  .llm-detail-drawer { width: min(620px, 92vw); }
}

@media (max-width: 640px) {
  .llm-query-row { grid-template-columns: 1fr; }
  .llm-range-select, .llm-run-button { width: 100%; }
  .llm-custom-range { align-items: stretch; flex-direction: column; }
  .llm-custom-range input { width: 100%; }
  .llm-query-options > label { display: none; }
  .llm-query-options input, .llm-query-options select { flex: 1 1 130px; width: auto; }
  .llm-log-row { grid-template-columns: 76px minmax(0, 1fr); }
  .llm-log-body { grid-column: 1 / -1; }
  .llm-facet-group { width: 100%; margin-right: 0; }
  .llm-result-hint { display: none; }
  .llm-detail-drawer { width: 100vw; }
}

/* ── 辅助类 ── */
.muted, .sub-link { color: var(--muted); font-size: .8rem; }
.sub-link { display: inline-block; margin-top: 4px; }
/* 用 <button> 当链接时（如目标行“认证”）重置按钮外观，否则会渲染成挤压布局的胖按钮 */
button.sub-link {
  background: none;
  border: none;
  padding: 0;
  font-weight: normal;
  line-height: 1.4;
  cursor: pointer;
  text-decoration: underline;
}
button.sub-link:hover { color: var(--accent); }
/* 目标行“认证”按钮里的已配置绿点 */
.auth-on { color: #16a34a; font-size: .9em; }
.alert {
  border: 1px solid #fecaca;
  color: var(--critical);
  background: #fef2f2;
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: .88rem;
}
.alert-success { border-color: #bbf7d0; color: #15803d; background: #f0fdf4; }
.alert-info { border-color: #bfdbfe; color: #1d4ed8; background: #eff6ff; }
.alert-warning { border-color: #fed7aa; color: var(--high); background: var(--high-bg); }
.job-error-banner {
  border-color: #fca5a5;
  background: #fff1f2;
  color: #b91c1c;
}
.job-error-banner strong { display: block; margin-bottom: 8px; }
.job-error-banner .job-error-summary { font-weight: 700; }
.job-error-banner details { margin-top: 10px; }
.job-error-banner summary { cursor: pointer; }
.job-error-banner pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: .82rem;
  line-height: 1.55;
  color: inherit;
}
.errorline {
  max-width: 540px;
  margin: 6px 0 0;
  color: var(--critical);
  font-size: .8rem;
}
.errorline.job-error-detail {
  max-width: 900px;
  white-space: pre-wrap;
}
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state p { margin: 0; }
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── AI 助手悬浮窗 ── */
.assistant-shell {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
}
/* ── AI 助手启动按钮：科幻神经核心风格 ── */
.assistant-launcher {
  --ai-glow: #0891b2;          /* 主辉光色 */
  --ai-glow-bright: #06b6d4;   /* 高亮色 */
  --ai-glow-soft: rgba(6, 182, 212, .35);
  --ai-core-from: #0e7490;     /* 渐变起始 */
  --ai-core-to: #06b6d4;       /* 渐变终止 */
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background: conic-gradient(from 0deg, var(--ai-core-from), var(--ai-core-to), var(--ai-core-from));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: none;
  box-shadow:
    0 0 0 1px rgba(6, 182, 212, .3),
    0 0 18px 2px var(--ai-glow-soft),
    0 8px 28px rgba(8, 145, 178, .25);
  transition: transform .2s ease, box-shadow .3s ease;
  animation: ai-pulse 3s ease-in-out infinite;
}
.assistant-launcher:hover {
  transform: scale(1.06);
  box-shadow:
    0 0 0 1px rgba(6, 182, 212, .5),
    0 0 28px 6px var(--ai-glow-soft),
    0 10px 36px rgba(8, 145, 178, .35);
  animation-duration: 1.8s;
}
.assistant-launcher:active { transform: scale(.96); }
/* 脉冲呼吸光环 */
.assistant-launcher::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--ai-glow-bright);
  opacity: 0;
  animation: ai-ring 3s ease-out infinite;
  pointer-events: none;
}
/* 旋转轨道虚线环 */
.assistant-launcher::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1px dashed rgba(6, 182, 212, .28);
  animation: ai-orbit 14s linear infinite;
  pointer-events: none;
}
.assistant-launcher-icon {
  width: 26px;
  height: 26px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, .4));
}
@keyframes ai-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(6, 182, 212, .3),
      0 0 14px 2px var(--ai-glow-soft),
      0 8px 28px rgba(8, 145, 178, .25);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(6, 182, 212, .45),
      0 0 24px 4px var(--ai-glow-soft),
      0 8px 28px rgba(8, 145, 178, .25);
  }
}
@keyframes ai-ring {
  0%   { transform: scale(.82); opacity: .7; }
  100% { transform: scale(1.45); opacity: 0; }
}
@keyframes ai-orbit {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
/* 助手面板打开时停止脉冲（视觉聚焦到面板） */
.assistant-launcher.is-active,
.assistant-launcher.is-active::before {
  animation: none;
}
.assistant-launcher.is-active::before { opacity: 0; }
.assistant-launcher.is-active::after { animation-duration: 30s; }
/* ── 夜间主题：霓虹辉光增强 ── */
html[data-theme="dark"] .assistant-launcher {
  --ai-glow: #22d3ee;
  --ai-glow-bright: #67e8f9;
  --ai-glow-soft: rgba(34, 211, 238, .45);
  --ai-core-from: #0e7490;
  --ai-core-to: #22d3ee;
  box-shadow:
    0 0 0 1px rgba(34, 211, 238, .35),
    0 0 22px 3px var(--ai-glow-soft),
    0 8px 28px rgba(8, 145, 178, .3);
}
html[data-theme="dark"] .assistant-launcher::after {
  border-color: rgba(34, 211, 238, .3);
}
html[data-theme="dark"] .assistant-launcher-icon {
  filter: drop-shadow(0 0 4px rgba(103, 232, 249, .6));
}
.assistant-panel {
  position: fixed;
  right: 22px;
  bottom: 86px;
  width: clamp(760px, 68vw, 1040px);
  height: clamp(560px, 78vh, 820px);
  min-width: min(640px, calc(100vw - 16px));
  min-height: min(480px, calc(100vh - 16px));
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
  overflow: hidden;
}
.assistant-resize-handle {
  position: absolute;
  z-index: 20;
  touch-action: none;
  background: transparent;
}
.assistant-resize-handle:hover {
  background: rgba(15, 118, 110, .08);
}
.assistant-resize-n,
.assistant-resize-s {
  cursor: ns-resize;
}
.assistant-resize-e,
.assistant-resize-w {
  cursor: ew-resize;
}
.assistant-resize-ne,
.assistant-resize-sw {
  cursor: nesw-resize;
}
.assistant-resize-nw,
.assistant-resize-se {
  cursor: nwse-resize;
}
.assistant-panel[hidden] { display: none; }
.assistant-sidebar {
  border-right: 1px solid var(--line);
  background: var(--surface-subtle);
  padding: 11px 10px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: stretch;
  gap: 9px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.assistant-brand strong,
.assistant-brand span {
  display: block;
}
.assistant-brand {
  padding: 1px 4px 3px;
}
.assistant-brand strong {
  font-size: .88rem;
}
.assistant-brand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: .7rem;
}
.assistant-new-session {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  height: 33px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}
.assistant-session-list {
  min-height: 0;
  overflow-y: auto;
  padding-right: 3px;
}
.assistant-session-row {
  position: relative;
  display: block;
  margin-bottom: 3px;
  border-radius: 6px;
}
.assistant-session-item {
  min-width: 0;
  width: 100%;
  border: 0;
  border-radius: 6px;
  padding: 8px 34px 8px 10px;
  background: transparent;
  color: var(--ink);
  display: block;
  text-align: left;
  cursor: pointer;
}
.assistant-session-item:hover {
  background: var(--surface-hover);
}
.assistant-session-item.active {
  background: var(--panel);
  box-shadow: inset 2px 0 var(--accent);
}
.assistant-session-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .8rem;
  line-height: 1.35;
}
.assistant-session-delete {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
}
.assistant-session-row:hover .assistant-session-delete,
.assistant-session-delete:focus-visible {
  opacity: 1;
}
.assistant-session-delete:hover {
  color: var(--critical);
  background: var(--panel);
}
.assistant-main {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--panel);
  overflow: hidden;
}
.assistant-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 6px 10px 6px 14px;
  border-bottom: 1px solid var(--line);
}
.assistant-head-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.assistant-head-title strong,
.assistant-head-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.assistant-head-title strong {
  font-size: .88rem;
}
.assistant-head span {
  display: inline-block;
  margin: 0;
  padding-left: 8px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: .7rem;
}
.assistant-head-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.assistant-head-actions select {
  width: min(240px, 30vw);
  min-width: 150px;
  height: 32px;
  padding-top: 4px;
  padding-bottom: 4px;
  font-size: .78rem;
}
.assistant-close,
.assistant-icon-button {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-subtle);
  color: var(--ink);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.assistant-icon-button {
  display: inline-grid;
  place-items: center;
  font-size: .92rem;
}
.assistant-icon-button svg {
  width: 15px;
  height: 15px;
}
.assistant-icon-button:hover,
.assistant-close:hover {
  background: var(--surface-hover);
}
.assistant-config-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  font-size: .8rem;
  color: var(--muted);
}
.assistant-config-row select {
  min-width: 0;
  width: 100%;
}
.assistant-current-config {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 5px 10px;
  border-bottom: 0;
  border-top: 1px solid var(--line);
  background: var(--surface-subtle);
}
.assistant-current-config select {
  min-width: 0;
  width: 100%;
  height: 26px;
  padding: 2px 6px;
  font-size: .72rem;
}
.assistant-toast {
  position: absolute;
  left: 50%;
  bottom: 104px;
  transform: translateX(-50%);
  z-index: 12;
  max-width: calc(100% - 24px);
  padding: 6px 12px;
  border-radius: 7px;
  background: var(--ink);
  color: var(--panel);
  font-size: .74rem;
  box-shadow: var(--shadow-md);
  pointer-events: none;
}
.assistant-thinking span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 18px;
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-weight: 800;
  line-height: 1;
}
.assistant-trace-empty {
  color: var(--muted);
  font-size: .78rem;
  padding: 4px 0;
}
.assistant-event {
  max-width: 94%;
  margin: 0 0 18px;
  padding: 0;
  color: var(--muted);
}
.assistant-event.error {
  color: var(--critical);
}
.assistant-event-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
}
.assistant-event-head strong {
  color: var(--ink);
  font-weight: 650;
}
.assistant-event-head em {
  margin-left: auto;
  color: var(--muted);
  font-style: normal;
}
.assistant-event-marker {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 18px;
  flex: 0 0 24px;
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-weight: 800;
  line-height: 1;
}
.assistant-thought {
  max-width: 86%;
  min-width: 0;
  margin: 0 0 16px;
  color: var(--muted);
}
.assistant-thought-label,
.assistant-runtime-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
}
.assistant-thought-label strong {
  color: var(--muted);
  font-weight: 600;
}
.assistant-thought-body {
  margin: 5px 0 0 32px;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.55;
}
.assistant-runtime-status {
  margin: 0 0 14px;
  color: var(--muted);
}
.assistant-tool {
  max-width: 94%;
  min-width: 0;
  margin: 0 0 14px;
}
.assistant-tool summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: baseline;
  gap: 7px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  font-size: .82rem;
}
.assistant-tool summary::-webkit-details-marker {
  display: none;
}
.assistant-tool summary::after {
  content: "›";
  grid-column: 4;
  color: var(--muted);
  transform: rotate(90deg);
  transition: transform .15s ease;
}
.assistant-tool[open] summary::after {
  transform: rotate(-90deg);
}
.assistant-tool summary strong {
  color: var(--ink);
  font-weight: 650;
}
.assistant-tool summary span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.assistant-tool summary em {
  color: var(--muted);
  font-size: .75rem;
  font-style: normal;
}
.assistant-tool pre,
.assistant-task-output {
  margin: 7px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: .76rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--ink);
}
.assistant-tool pre {
  max-height: 240px;
  margin-left: 0;
  padding: 11px 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-subtle);
}
.assistant-tool-empty {
  margin-top: 7px;
  color: var(--muted);
  font-size: .78rem;
}
.assistant-progress-text {
  max-width: 86%;
  min-width: 0;
  margin: 0 0 14px;
  color: var(--ink);
  font-size: .88rem;
  line-height: 1.5;
}
.assistant-event-detail {
  margin: 7px 0 0 32px;
  color: inherit;
  font-size: .82rem;
  line-height: 1.5;
}
.assistant-task-output {
  max-height: 170px;
  overflow: auto;
}
.assistant-messages {
  width: 100%;
  min-width: 0;
  padding: 16px 20px 10px;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--panel);
  min-height: 0;
}
.assistant-msg {
  max-width: 86%;
  min-width: 0;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
  font-size: .88rem;
}
.assistant-msg.user {
  max-width: 72%;
  margin-left: auto;
  padding: 9px 12px;
  background: var(--accent);
  color: #fff;
}
.assistant-msg.assistant {
  background: transparent;
  color: var(--ink);
  white-space: normal;
}
.assistant-msg h1,
.assistant-msg h2,
.assistant-msg h3,
.assistant-msg h4,
.assistant-thought h1,
.assistant-thought h2,
.assistant-thought h3,
.assistant-thought h4,
.assistant-progress-text h1,
.assistant-progress-text h2,
.assistant-progress-text h3,
.assistant-progress-text h4 {
  margin: 15px 0 7px;
  font-size: .94rem;
  line-height: 1.35;
}
.assistant-msg h1:first-child,
.assistant-msg h2:first-child,
.assistant-msg h3:first-child,
.assistant-msg h4:first-child {
  margin-top: 0;
}
.assistant-md-line {
  min-height: 1.45em;
}
.assistant-md-space {
  height: 9px;
}
.assistant-md-list {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 3px;
  margin: 4px 0;
}
.assistant-md-list > span {
  color: var(--muted);
  text-align: right;
}
.assistant-markdown p,
.assistant-thought-body p,
.assistant-progress-text p,
.assistant-event-detail p {
  margin: 0 0 9px;
}
.assistant-markdown p:last-child,
.assistant-thought-body p:last-child,
.assistant-progress-text p:last-child,
.assistant-event-detail p:last-child {
  margin-bottom: 0;
}
.assistant-markdown ul,
.assistant-markdown ol,
.assistant-thought-body ul,
.assistant-thought-body ol,
.assistant-progress-text ul,
.assistant-progress-text ol,
.assistant-event-detail ul,
.assistant-event-detail ol {
  margin: 7px 0 10px;
  padding-left: 22px;
}
.assistant-markdown li,
.assistant-thought-body li,
.assistant-progress-text li,
.assistant-event-detail li {
  margin: 3px 0;
}
.assistant-markdown blockquote,
.assistant-thought-body blockquote,
.assistant-progress-text blockquote,
.assistant-event-detail blockquote {
  margin: 9px 0;
  padding: 2px 0 2px 11px;
  border-left: 3px solid var(--line);
  color: var(--muted);
}
.assistant-markdown a,
.assistant-thought-body a,
.assistant-progress-text a,
.assistant-event-detail a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.assistant-markdown table,
.assistant-thought-body table,
.assistant-progress-text table,
.assistant-event-detail table {
  display: block;
  width: 100%;
  margin: 10px 0;
  overflow-x: auto;
  border-collapse: collapse;
  white-space: nowrap;
}
.assistant-markdown th,
.assistant-markdown td,
.assistant-thought-body th,
.assistant-thought-body td,
.assistant-progress-text th,
.assistant-progress-text td,
.assistant-event-detail th,
.assistant-event-detail td {
  padding: 6px 9px;
  border: 1px solid var(--line);
  text-align: left;
}
.assistant-markdown th,
.assistant-thought-body th,
.assistant-progress-text th,
.assistant-event-detail th {
  background: var(--surface-subtle);
  font-weight: 700;
}
.assistant-msg code,
.assistant-thought code,
.assistant-progress-text code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--surface-subtle);
  color: var(--ink);
  font: .82em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.assistant-code {
  max-width: 100%;
  margin: 9px 0;
  padding: 11px 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-subtle);
  white-space: pre;
  font: .78rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.assistant-markdown pre,
.assistant-thought-body pre,
.assistant-progress-text pre,
.assistant-event-detail pre {
  max-width: 100%;
  margin: 9px 0;
  padding: 11px 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-subtle);
  white-space: pre;
  font: .78rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.assistant-markdown pre code,
.assistant-thought-body pre code,
.assistant-progress-text pre code,
.assistant-event-detail pre code {
  padding: 0;
  background: transparent;
  font: inherit;
}
.assistant-code code {
  padding: 0;
  background: transparent;
  font: inherit;
}
.assistant-msg hr {
  margin: 13px 0;
  border: 0;
  border-top: 1px solid var(--line);
}
.assistant-msg.assistant.error {
  padding: 9px 11px;
  border-left: 3px solid var(--critical);
  background: color-mix(in srgb, var(--critical) 8%, transparent);
}
.assistant-thinking {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.assistant-task-card {
  margin-top: 9px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
}
.assistant-task-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: .8rem;
  font-weight: 700;
}
.assistant-task-title a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.assistant-task-status {
  margin-top: 6px;
  color: var(--muted);
  font-size: .78rem;
}
.assistant-task-status.running { color: var(--accent); }
.assistant-task-status.completed { color: var(--info); }
.assistant-task-status.failed,
.assistant-task-status.cancelled { color: var(--critical); }
.assistant-task-events {
  margin-top: 8px;
}
.assistant-task-events summary {
  color: var(--muted);
  font-size: .78rem;
  cursor: pointer;
  list-style: none;
}
.assistant-task-events summary::-webkit-details-marker { display: none; }
.assistant-task-hint {
  margin-top: 7px;
  color: var(--muted);
  font-size: .76rem;
}
.assistant-settings {
  position: absolute;
  inset: 46px 0 0;
  z-index: 8;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--panel);
}
.assistant-settings[hidden] {
  display: none;
}
.assistant-settings-head {
  min-height: 48px;
  padding: 8px 12px 8px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.assistant-settings-head strong,
.assistant-settings-head span {
  display: block;
}
.assistant-settings-head strong {
  font-size: .88rem;
}
.assistant-settings-head span {
  margin-top: 2px;
  color: var(--muted);
  font-size: .7rem;
}
.assistant-settings-body {
  min-height: 0;
  overflow-y: auto;
  padding: 0 18px 24px;
}
.assistant-settings-section {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.assistant-settings-section:last-child {
  border-bottom: 0;
}
.assistant-settings-section h3 {
  margin: 0 0 12px;
  font-size: .84rem;
}
.assistant-settings-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.assistant-settings-title-row h3 {
  margin: 0;
}
.assistant-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}
.assistant-settings-grid label,
.assistant-settings-wide {
  display: grid;
  gap: 5px;
  min-width: 0;
}
#assistant-idle-minutes-field[hidden] {
  display: none;
}
.assistant-settings-wide {
  margin-top: 11px;
}
.assistant-settings-grid label > span,
.assistant-settings-wide > span {
  color: var(--muted);
  font-size: .72rem;
}
.assistant-settings-grid select,
.assistant-settings-grid input,
.assistant-settings-wide select,
.assistant-settings-wide input,
.assistant-settings-wide textarea {
  width: 100%;
  min-width: 0;
}
.assistant-settings-wide textarea {
  resize: vertical;
  line-height: 1.45;
}
.assistant-settings-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.assistant-settings-status {
  margin-right: auto;
  color: var(--muted);
  font-size: .72rem;
}
.assistant-settings-status.error {
  color: var(--critical);
}
.assistant-form {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.assistant-form textarea {
  min-height: 40px;
  max-height: 120px;
  padding: 8px 11px;
  resize: none;
  overflow-y: auto;
}
.assistant-send {
  align-self: start;
  width: 42px;
  min-width: 42px;
  height: 40px;
  padding: 0;
  font-size: 1.08rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background-color .15s ease, transform .1s ease;
}
.assistant-send svg {
  width: 17px;
  height: 17px;
  margin: 0 0 0 1px;
}
.assistant-send:hover:not(.stop) {
  background: var(--accent-hover);
}
.assistant-send:active:not(.stop) {
  transform: scale(.94);
}
.assistant-send.stop {
  border: 1px solid var(--line);
  background: var(--ink);
  color: var(--panel);
}
.assistant-send.stop:hover {
  background: var(--muted);
  color: var(--panel);
}
.assistant-send.stop span {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: currentColor;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── 复选框美化 ── */
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  /* 默认 vertical-align:baseline 会让勾选框比同行文字低一点，看着没对齐 */
  vertical-align: middle;
}

html[data-theme="dark"] .queued,
html[data-theme="dark"] .in_progress,
html[data-theme="dark"] .toast-info,
html[data-theme="dark"] .alert-info {
  background: var(--low-bg);
  color: #93c5fd;
  border-color: #1d4f8f;
}
html[data-theme="dark"] .running,
html[data-theme="dark"] .triaged,
html[data-theme="dark"] .btn-warning,
html[data-theme="dark"] .alert-warning {
  background: var(--high-bg);
  color: #fdba74;
  border-color: #7c3f16;
}
html[data-theme="dark"] .completed,
html[data-theme="dark"] .fixed,
html[data-theme="dark"] .toast-success,
html[data-theme="dark"] .alert-success {
  background: var(--info-bg);
  color: #86efac;
  border-color: #166534;
}
html[data-theme="dark"] .failed,
html[data-theme="dark"] .open,
html[data-theme="dark"] .btn-danger,
html[data-theme="dark"] .alert,
html[data-theme="dark"] .toast-error,
html[data-theme="dark"] .job-error-banner {
  background: var(--critical-bg);
  color: #fca5a5;
  border-color: #7f1d1d;
}
html[data-theme="dark"] .cancelled,
html[data-theme="dark"] .false_positive,
html[data-theme="dark"] .wont_fix,
html[data-theme="dark"] .info,
html[data-theme="dark"] .unknown,
html[data-theme="dark"] .badge.kind-local,
html[data-theme="dark"] .btn.disabled {
  background: var(--surface-subtle);
  color: var(--muted);
  border-color: var(--line);
}
html[data-theme="dark"] .badge.kind-ssh {
  background: var(--low-bg);
  color: #93c5fd;
}
html[data-theme="dark"] .badge.kind-web {
  background: #2e1065;
  color: #c4b5fd;
}
html[data-theme="dark"] .btn-primary {
  background: #195b51;
  color: #f3fffc;
  border-color: #2f7d72;
}
html[data-theme="dark"] .btn-primary:hover { background: #216d62; }
html[data-theme="dark"] .btn-ghost {
  background: #13273a;
  color: #c7d9ee;
  border-color: #34506d;
}
html[data-theme="dark"] .btn-ghost:hover {
  background: #1b344c;
  color: #f1f7ff;
  border-color: #4b6b8e;
}
html[data-theme="dark"] .btn-warning {
  background: #3b2613;
  color: #ffd08a;
  border-color: #a16207;
}
html[data-theme="dark"] .btn-warning:hover {
  background: #4a3118;
  color: #ffe0ad;
  border-color: #c47a09;
}
html[data-theme="dark"] .btn-danger {
  background: #3b171b;
  color: #ffb4b4;
  border-color: #b43a3a;
}
html[data-theme="dark"] .btn-danger:hover {
  background: #4a1d22;
  color: #ffd1d1;
  border-color: #dc5555;
}
html[data-theme="dark"] button:disabled,
html[data-theme="dark"] .btn:disabled,
html[data-theme="dark"] input[type="submit"]:disabled,
html[data-theme="dark"] .btn.disabled {
  background: #111b2a;
  color: #8ea0b7;
  border-color: #2b3d55;
  opacity: 1;
  filter: none;
}
html[data-theme="dark"] .stats .stat-card {
  background: var(--panel);
  color: var(--ink);
}
html[data-theme="dark"] .modal,
html[data-theme="dark"] .toast,
html[data-theme="dark"] .login-panel {
  border: 1px solid var(--line);
}
html[data-theme="dark"] .progress .queued { background: #60a5fa; }
html[data-theme="dark"] .progress .running { background: #f59e0b; }
html[data-theme="dark"] .progress .completed { background: #22c55e; }
html[data-theme="dark"] .progress .failed { background: #f87171; }
html[data-theme="dark"] .progress .cancelled { background: #64748b; }

/* ── 响应式 ── */
@media (max-width: 1024px) {
  .grid.two, .grid.three, .grid.four { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .detail { grid-template-columns: 1fr; }
  .job-live-grid,
  .job-runtime-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .job-usage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .sidebar { position: static; width: 100%; padding: 16px; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .sidebar nav a { font-size: .78rem; padding: 6px 10px; }
  .sidebar form { display: none; }
  .main { margin-left: 0; padding: 16px; }
  .page-head { flex-direction: column; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .toolbar-group { flex-wrap: wrap; }
  .toolbar select, .toolbar button, .toolbar .btn, .toolbar input[type="date"] { width: 100%; }
  .toolbar .toolbar-date-range { flex-wrap: wrap; }
  .toolbar .toolbar-date-range label { width: 100%; }
  .toolbar .toolbar-date-range input[type="date"] { width: 100%; max-width: 100%; }
  .pagination-bar { align-items: stretch; flex-direction: column; }
  .pagination { justify-content: flex-start; }
  .row-actions { flex-wrap: wrap; }
  .node-table { min-width: 920px; }
  .node-edit-panel { grid-template-columns: 1fr; }
  .node-edit-wide { grid-column: auto; }
  .usage-grid { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .flow-grid { grid-template-columns: 1fr; }
  .assistant-shell { right: 12px; bottom: 12px; }
  .assistant-panel {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 74px;
    width: auto;
    height: min(620px, calc(100vh - 96px));
    min-width: 0;
    grid-template-columns: 1fr;
  }
  .assistant-sidebar { display: none; }
  .assistant-msg { max-width: 92%; }
  .assistant-head-actions select { width: min(220px, 42vw); min-width: 120px; }
  .assistant-current-config { grid-template-columns: 1fr; }
  .assistant-settings-grid { grid-template-columns: 1fr; }
  .table-wrap { font-size: .78rem; }
  th, td { padding: 8px 10px; }
}

/* 排队提示卡片：详情页排队中状态展示前方任务数和节点负载 */
.queue-info-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--warning, #f0ad4e);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 16px;
}
.queue-info-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.queue-info-icon {
  font-size: 1.5rem;
  line-height: 1;
}
.queue-info-head strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1.05rem;
}
.queue-info-head p {
  margin: 0;
  line-height: 1.6;
}
.queue-info-tip {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  color: var(--text-muted, #888);
  font-size: .9rem;
}

/* 任务列表页排队提示（状态列内） */
.job-queue-info {
  font-size: .78rem;
  color: var(--warning, #b8860b);
  line-height: 1.4;
  margin-top: 2px;
}

/* 全站 Tips 提示条（顶部，静态单条展示，紧凑高度） */
.tips-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: min(680px, 100%);
  margin: 0 auto 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--info, #4a90d9);
  border-radius: var(--radius-lg);
  padding: 5px 10px 5px 12px;
}
.tips-content {
  flex: 1;
  min-width: 0;
  font-size: .85rem;
  line-height: 1.4;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tips-bar[hidden] {
  display: none;
}
.tips-close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: .8rem;
  color: var(--text-muted, #888);
  padding: 0 4px;
  border-radius: var(--radius-sm, 4px);
  line-height: 1;
}
.tips-close:hover {
  background: var(--line, #e0e0e0);
  color: var(--text);
}

/* ── 平台运营大屏（仅 admin） ── */
.admin-overview { --overview-accent: #0f766e; --overview-ink: #12382f; }
.admin-overview-head {
  position: relative;
  padding: 22px 24px;
  border: 1px solid color-mix(in srgb, var(--overview-accent) 26%, var(--line));
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 82% 18%, color-mix(in srgb, var(--overview-accent) 15%, transparent), transparent 32%),
    linear-gradient(120deg, color-mix(in srgb, var(--overview-accent) 8%, var(--panel)), var(--panel) 64%);
  overflow: hidden;
}
.admin-overview-head::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -70px;
  bottom: -115px;
  border: 1px solid color-mix(in srgb, var(--overview-accent) 28%, transparent);
  border-radius: 50%;
  box-shadow: 0 0 0 28px color-mix(in srgb, var(--overview-accent) 5%, transparent), 0 0 0 58px color-mix(in srgb, var(--overview-accent) 3%, transparent);
}
.admin-overview-head h1 { margin: 5px 0 3px; letter-spacing: -.035em; }
.admin-overview-head p { margin: 0; color: var(--ink-secondary); }
.admin-overview-eyebrow { display: flex; align-items: center; gap: 7px; color: var(--overview-accent); font-size: .65rem; font-weight: 800; letter-spacing: .12em; }
.admin-overview-eyebrow > span { width: 18px; height: 2px; background: currentColor; border-radius: 2px; }
.admin-overview-head-actions { position: relative; z-index: 1; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.admin-only-chip { padding: 6px 10px; border: 1px solid color-mix(in srgb, var(--overview-accent) 35%, var(--line)); border-radius: 999px; color: var(--overview-accent); background: color-mix(in srgb, var(--overview-accent) 8%, var(--panel)); font-size: .72rem; font-weight: 700; }
.admin-overview-filter { align-items: end; }
.admin-overview-filter label { display: grid; gap: 5px; }
.admin-overview-filter input[type="date"] { width: auto; min-width: 145px; }
/* 勾选式租户选择器：<details> 原生展开，面板浮在筛选栏之上，不挤压其它筛选项 */
.admin-tenant-picker { display: grid; gap: 5px; align-content: start; }
.admin-tenant-picker-box { position: relative; }
.admin-tenant-picker-box > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 210px; min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink); font-size: .84rem; cursor: pointer; list-style: none; }
.admin-tenant-picker-box > summary::-webkit-details-marker { display: none; }
.admin-tenant-picker-text { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.admin-tenant-picker-caret { color: var(--muted); font-size: .7rem; }
.admin-tenant-picker-box[open] > summary { border-color: var(--overview-accent); }
.admin-tenant-picker-panel { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: 280px; max-height: 320px; overflow-y: auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow-md, 0 10px 24px rgba(15, 23, 42, .12)); }
.admin-tenant-picker-tools { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: .72rem; }
.admin-tenant-picker-tools .muted { margin-left: auto; font-size: .68rem; }
.admin-tenant-picker-list { display: grid; gap: 2px; }
.admin-tenant-picker-list label { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; font-size: .8rem; cursor: pointer; }
.admin-tenant-picker-list label:hover { background: var(--surface-subtle); }
.admin-tenant-picker-list input[type="checkbox"] { margin: 0; }
.admin-overview-filter-note { color: var(--muted); font-size: .74rem; }
/* 外部 Token 只读视图：无侧栏，主区不吃 240px 的侧栏留白 */
.overview-public-main { margin-left: 0; }
/* 外部视图是纯只读的：勾选列、已选计数、导出相关提示一律不出现 */
.admin-overview-public .admin-check-cell,
.admin-overview-public .selected-count { display: none; }
.admin-overview-public .admin-tenant-table { min-width: 1120px; }
/* 外部访问 Token 管理面板：默认折叠成一行，展开后是链接 + 操作按钮 */
.admin-share-card { margin: 0 0 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.admin-share-card > summary { display: flex; align-items: center; gap: 10px; padding: 11px 14px; font-size: .8rem; font-weight: 700; color: var(--ink-secondary); cursor: pointer; list-style: none; }
.admin-share-card > summary::-webkit-details-marker { display: none; }
.admin-share-card[open] > summary { border-bottom: 1px solid var(--line); }
.admin-share-title { color: var(--ink); }
.admin-share-state { padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .68rem; font-weight: 700; }
.admin-share-state.on { border-color: color-mix(in srgb, var(--overview-accent) 35%, var(--line)); color: var(--overview-accent); background: color-mix(in srgb, var(--overview-accent) 8%, var(--panel)); }
.admin-share-body { display: grid; gap: 10px; padding: 12px 14px; }
.admin-share-body .muted { margin: 0; font-size: .76rem; }
.admin-share-link-row { display: flex; gap: 8px; align-items: center; }
.admin-share-link-row input { flex: 1; min-width: 0; font-size: .78rem; }
.admin-share-actions { display: flex; gap: 8px; }
.admin-kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.admin-kpi-card { position: relative; display: grid; min-height: 126px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow-sm); overflow: hidden; }
.admin-kpi-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: color-mix(in srgb, var(--muted) 50%, transparent); }
.admin-kpi-card.accent::before { background: var(--overview-accent); }
.admin-kpi-card.success::before { background: var(--low); }
.admin-kpi-card.danger::before { background: var(--critical); }
.admin-kpi-label { color: var(--ink-secondary); font-size: .75rem; font-weight: 700; }
.admin-kpi-card strong { align-self: center; color: var(--ink); font-size: 1.75rem; font-variant-numeric: tabular-nums; letter-spacing: -.035em; }
.admin-kpi-card strong small { color: var(--muted); font-size: .85rem; font-weight: 600; letter-spacing: 0; }
.admin-kpi-card .admin-kpi-cost { font-size: 1.45rem; }
.admin-kpi-foot { align-self: end; color: var(--muted); font-size: .68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 需要两行说明的 KPI 卡（模型消耗）：换行展示，不要 ellipsis 吃掉数字 */
.admin-kpi-foot-stack { display: grid; gap: 1px; white-space: normal; overflow: visible; }
.admin-chart-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, .8fr); gap: 14px; margin-bottom: 18px; }
.admin-chart-card { min-width: 0; margin: 0; }
.admin-chart-full { grid-column: 1 / -1; }
.admin-chart-unit { color: var(--muted); font-size: .68rem; }
/* 成本卡片里的各租户口径小表：曲线给总量分布，这张表给单任务/单目标/单漏洞的平均值 */
.admin-cost-detail { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 10px; }
.admin-cost-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; font-size: .8rem; }
.admin-cost-head .muted { font-size: .7rem; }
.admin-cost-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.admin-cost-table th { padding: 6px 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .68rem; font-weight: 700; text-align: left; white-space: nowrap; }
.admin-cost-table td { padding: 6px 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.admin-cost-table td small { display: block; color: var(--muted); font-size: .68rem; }
.admin-cost-table tfoot td { border-top: 2px solid var(--line); border-bottom: 0; background: var(--surface-subtle); font-weight: 700; }
/* 维度标签：每张图归到任务/用户/风险/成本/趋势，扫一眼就知道这张图在讲什么 */
.admin-chart-tag { display: inline-flex; align-items: center; margin-right: 8px; padding: 1px 9px; border-radius: 999px; background: var(--surface-subtle); font-size: .64rem; font-weight: 800; letter-spacing: .06em; vertical-align: 2px; }
.admin-chart-tag.is-task { color: var(--overview-accent); }
.admin-chart-tag.is-user { color: var(--low); }
.admin-chart-tag.is-risk { color: var(--critical); }
.admin-chart-tag.is-cost { color: var(--medium); }
.admin-chart-tag.is-trend { color: var(--muted); }
.admin-chart-container { position: relative; height: 280px; }
.admin-chart-bar { height: clamp(250px, 34vh, 390px); }
.admin-tenant-section { padding: 0; overflow: hidden; }
.admin-tenant-head { padding: 17px 18px 0; }
.admin-tenant-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.admin-table-search input { width: 210px; min-height: 34px; }
.admin-tenant-table-wrap { border: 0; border-radius: 0; }
.admin-tenant-table { min-width: 1180px; }
.admin-tenant-table th { font-size: .69rem; white-space: nowrap; }
.admin-tenant-table td { vertical-align: middle; font-variant-numeric: tabular-nums; }
/* 11 列后左右各 14px 会在 1680 宽的窗口里顶出横向滚动条，收窄到 12px（省约 44px） */
.admin-tenant-table th, .admin-tenant-table td { padding-left: 12px; padding-right: 12px; }
.admin-tenant-table td strong, .admin-tenant-table td small { display: block; }
.admin-tenant-table td small { max-width: 170px; color: var(--muted); font-size: .68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-tenant-table td > span:not(.sev):not(.admin-rate):not(.admin-live-dot):not(.admin-fail-dot):not(.admin-rank) { color: var(--muted); font-size: .74rem; }
.admin-tenant-table .admin-check-cell { width: 42px; text-align: center; }
/* 排名徽章：前三名给点颜色，其余走中性灰，扫一眼就能看出头部租户 */
.admin-tenant-cell { display: flex; align-items: flex-start; gap: 4px; }
.admin-rank { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; margin-right: 2px; padding: 0 6px; border-radius: 6px; background: var(--surface-subtle); color: var(--muted); font-size: .7rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.admin-tenant-table tr:nth-child(1) .admin-rank { background: #fef2f2; color: var(--critical); }
.admin-tenant-table tr:nth-child(2) .admin-rank { background: #fff7ed; color: var(--high); }
.admin-tenant-table tr:nth-child(3) .admin-rank { background: #fefce8; color: #a16207; }
.admin-live-dot { display: inline-flex; align-items: center; gap: 5px; color: #15803d; font-size: .68rem; }
.admin-live-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 14%, transparent); }
.admin-fail-dot { display: inline-flex; align-items: center; gap: 5px; color: #b91c1c; font-size: .68rem; }
.admin-fail-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
/* 合计行：把小字说明压掉一部分，让总计数字更醒目 */
.admin-tenant-table tfoot td { border-top: 2px solid var(--line); background: var(--surface-subtle); font-weight: 700; }
.admin-tenant-table tfoot td small { color: var(--muted); font-weight: 600; }
.admin-rate { display: inline-flex; padding: 3px 7px; border-radius: 999px; color: var(--overview-accent); background: color-mix(in srgb, var(--overview-accent) 9%, var(--panel)); font-size: .72rem; font-weight: 750; }
.admin-risk-open { color: #b45309 !important; }
/* 截图专用：筛选口径改用文字交代，替代会被截糊的原生下拉/日期控件 */
.admin-capture-scope { display: none; color: var(--ink-secondary); font-size: .78rem; }
/* 风险敞口卡：四档漏洞级别两列铺开，窄卡片里也不挤成一行被截断 */
.admin-risk-grid { align-self: end; display: grid; grid-template-columns: repeat(2, max-content); justify-content: space-between; gap: 4px 10px; }
.admin-risk-grid .sev { padding: 2px 8px; font-size: .68rem; }
/* 严重/高危/中危/低危四枚徽章：两列栅格比一行铺开省一半宽度，行高不受影响 */
.admin-sev-cell { display: grid; grid-template-columns: repeat(2, max-content); justify-content: start; align-items: center; gap: 4px 6px; }

/* ── 保存为图片：截图期间的临时版式 ──
   固定宽度让导出的图片不随打开的窗口变化；放开表格裁剪保证右侧列不被截掉；
   勾选框、搜索框、导出按钮这类操作控件不进图。 */
/* 截图时容器会临时变宽，先按住横向滚动条，免得页面上闪一下横向滚动 */
body.overview-capturing { overflow-x: hidden; }
.admin-overview.is-capturing { width: 1600px; max-width: none; }
.admin-overview.is-capturing .admin-overview-head-actions,
.admin-overview.is-capturing .admin-check-cell,
.admin-overview.is-capturing .admin-table-search,
.admin-overview.is-capturing .selected-count,
.admin-overview.is-capturing .admin-tenant-picker,
.admin-overview.is-capturing .admin-overview-filter label,
.admin-overview.is-capturing .admin-overview-filter button,
.admin-overview.is-capturing .admin-overview-filter a,
.admin-overview.is-capturing .admin-overview-filter-note,
.admin-overview.is-capturing .admin-share-card { display: none; }
.admin-overview.is-capturing .admin-capture-scope { display: block; }
.admin-overview.is-capturing .admin-tenant-table-wrap { overflow: visible; }
.admin-overview.is-capturing .admin-tenant-table { min-width: 0; width: 100%; }
.admin-export-overlay[hidden] { display: none; }
.admin-export-dialog { width: min(760px, calc(100vw - 32px)); max-width: 760px; padding: 0; overflow: hidden; }
.admin-export-dialog form { padding: 20px; }
.admin-export-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.admin-export-head h2 { margin: 4px 0; }
.admin-export-section { padding-top: 16px; }
.admin-export-section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.admin-export-section-head > div { display: flex; gap: 10px; }
.admin-export-tenant-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 190px; overflow: auto; padding: 2px; }
.admin-export-tenant-grid label { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-subtle); cursor: pointer; }
.admin-export-tenant-grid label:has(input:checked) { border-color: color-mix(in srgb, var(--overview-accent) 40%, var(--line)); background: color-mix(in srgb, var(--overview-accent) 8%, var(--panel)); }
.admin-export-tenant-grid label > span { min-width: 0; }
.admin-export-tenant-grid label strong,
.admin-export-tenant-grid label small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-export-tenant-grid label strong { color: var(--ink); font-size: .76rem; }
.admin-export-tenant-grid label small { margin-top: 2px; color: var(--muted); font-size: .65rem; }
.admin-export-field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-height: 310px; overflow: auto; padding: 2px; }
.admin-export-field-grid label { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-subtle); color: var(--ink-secondary); font-size: .75rem; cursor: pointer; }
.admin-export-field-grid label:has(input:checked) { border-color: color-mix(in srgb, var(--overview-accent) 40%, var(--line)); background: color-mix(in srgb, var(--overview-accent) 8%, var(--panel)); color: var(--ink); }
.admin-export-field-grid label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

html[data-theme="dark"] .admin-overview { --overview-accent: #54c7b6; --overview-ink: #d8faf4; }
html[data-theme="dark"] .admin-kpi-card { background: color-mix(in srgb, var(--panel) 94%, #0f766e); }

@media (max-width: 1280px) {
  .admin-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .admin-overview-head-actions { width: 100%; }
  .admin-overview-head-actions .btn-primary { flex: 1; }
  .admin-overview-filter { align-items: stretch; }
  .admin-overview-filter label,
  .admin-overview-filter input[type="date"],
  .admin-overview-filter select,
  .admin-overview-filter > .btn-primary,
  .admin-overview-filter > .btn-ghost { width: 100%; }
  .admin-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-chart-grid { grid-template-columns: 1fr; }
  .admin-chart-full { grid-column: auto; }
  .admin-tenant-head { align-items: stretch; }
  .admin-tenant-tools, .admin-table-search input { width: 100%; }
  .admin-export-tenant-grid,
  .admin-export-field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .admin-kpi-grid, .admin-export-tenant-grid, .admin-export-field-grid { grid-template-columns: 1fr; }
}


/* ── 扫描详情页 · 探索链路图（目标/意图/事实/漏洞知识图谱）── */
:root {
  --eg-intent: #2563eb;
  --eg-intent-bg: #eff6ff;
  --eg-fact: #0891b2;
  --eg-fact-bg: #ecfeff;
  --eg-derived: #7c3aed;
  --eg-derived-bg: #f5f3ff;
  --eg-proves: #ea580c;
  --eg-proves-bg: #fff7ed;
}
html[data-theme="dark"] {
  --eg-intent: #60a5fa;
  --eg-intent-bg: rgba(37, 99, 235, .18);
  --eg-fact: #22d3ee;
  --eg-fact-bg: rgba(8, 145, 178, .18);
  --eg-derived: #a78bfa;
  --eg-derived-bg: rgba(124, 58, 237, .2);
  --eg-proves: #fb923c;
  --eg-proves-bg: rgba(234, 88, 12, .18);
}

.explore-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.explore-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .78rem;
  color: var(--ink-secondary);
  background: var(--surface-subtle);
  border: 1px solid var(--line);
}
.explore-chip b { color: var(--ink); font-weight: 600; }
.explore-chip::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.explore-chip.chip-goal::before { background: var(--accent); }
.explore-chip.chip-intent::before { background: var(--eg-intent); }
.explore-chip.chip-fact::before { background: var(--eg-fact); }
.explore-chip.chip-vuln::before { background: var(--high); }
.explore-legend { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.explore-hint { font-size: .74rem; }
.edge-cap {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: .72rem;
  line-height: 1.5;
  border: 1px solid transparent;
}
.edge-cap.cap-spawns { color: var(--eg-intent); background: var(--eg-intent-bg); }
.edge-cap.cap-yields { color: var(--eg-fact); background: var(--eg-fact-bg); }
.edge-cap.cap-derived { color: var(--eg-derived); background: var(--eg-derived-bg); }
.edge-cap.cap-proves { color: var(--eg-proves); background: var(--eg-proves-bg); }

.explore-canvas-wrap { position: relative; }
.explore-canvas {
  height: 560px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-subtle);
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}
.explore-canvas.eg-grabbing { cursor: grabbing; }
.explore-canvas svg { display: block; width: 100%; height: 100%; }

/* ── 探索链路全屏独立页（/scans/{id}/explore-graph，无侧栏）── */
body.eg-fullscreen {
  margin: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.eg-full-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.eg-full-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.eg-full-title h1 { font-size: 1.05rem; margin: 0; font-weight: 600; }
.eg-full-target {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .8rem;
}
.eg-full-head .row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.eg-full-wrap { flex: 1; min-height: 0; display: flex; }
body.eg-fullscreen .explore-canvas {
  flex: 1;
  height: auto;
  border: none;
  border-radius: 0;
}
body.eg-fullscreen .explore-drawer { top: 0; right: 0; bottom: 0; border-radius: 0; }
body.eg-fullscreen .explore-drawer-backdrop { border-radius: 0; }
body.eg-fullscreen #explore-graph-empty { flex: 1; padding: 40px 20px 20px; }
.eg-full-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 20px;
  border-top: 1px solid var(--line);
  background: var(--panel);
  font-size: .74rem;
}
.eg-full-legend .muted { margin-left: auto; }

/* 边：贝塞尔 + 关系胶囊 */
.eg-edge path {
  fill: none;
  stroke-width: 1.6;
  stroke-opacity: .75;
}
.eg-edge-kind-spawns path { stroke: var(--eg-intent); }
.eg-edge-kind-yields path { stroke: var(--eg-fact); }
.eg-edge-kind-derived_from path { stroke: var(--eg-derived); stroke-dasharray: 6 4; }
.eg-edge-kind-proves path { stroke: var(--eg-proves); stroke-width: 2; }
.eg-edge-pill rect {
  fill: var(--panel);
  stroke-width: 1;
}
.eg-edge-kind-spawns .eg-edge-pill rect { stroke: var(--eg-intent); }
.eg-edge-kind-yields .eg-edge-pill rect { stroke: var(--eg-fact); }
.eg-edge-kind-derived_from .eg-edge-pill rect { stroke: var(--eg-derived); }
.eg-edge-kind-proves .eg-edge-pill rect { stroke: var(--eg-proves); }
.eg-edge-pill text {
  font-size: 10.5px;
  fill: var(--ink-secondary);
  pointer-events: none;
}
.eg-edge-kind-spawns .eg-edge-pill text { fill: var(--eg-intent); }
.eg-edge-kind-yields .eg-edge-pill text { fill: var(--eg-fact); }
.eg-edge-kind-derived_from .eg-edge-pill text { fill: var(--eg-derived); }
.eg-edge-kind-proves .eg-edge-pill text { fill: var(--eg-proves); }

/* 节点卡片 */
.eg-node { cursor: grab; }
.eg-node:active { cursor: grabbing; }
.eg-node .eg-card {
  fill: var(--panel);
  stroke: var(--line);
  stroke-width: 1;
}
.eg-node:hover .eg-card { stroke: var(--accent); stroke-width: 1.5; }
.eg-node.eg-kind-goal .eg-card { stroke: var(--accent); stroke-width: 1.5; }
.eg-card-accent { fill: var(--accent); }
.eg-title {
  font-size: 13px;
  font-weight: 600;
  fill: var(--ink);
}
.eg-detail {
  font-size: 11.5px;
  fill: var(--ink-secondary);
}
.eg-footer {
  font-size: 10.5px;
  fill: var(--muted);
}
.eg-badge rect { stroke: none; }
.eg-badge text {
  font-size: 10.5px;
  font-weight: 500;
  pointer-events: none;
}
.eg-badge-goal rect { fill: var(--accent); }
.eg-badge-goal text { fill: #ffffff; }
.eg-badge-intent rect { fill: var(--eg-intent-bg); }
.eg-badge-intent text { fill: var(--eg-intent); }
.eg-badge-fact rect { fill: var(--eg-fact-bg); }
.eg-badge-fact text { fill: var(--eg-fact); }
.eg-badge-vuln rect { fill: var(--eg-proves-bg); }
.eg-badge-vuln text { fill: var(--eg-proves); }
.eg-status rect { fill: var(--surface-subtle); }
.eg-status text { fill: var(--muted); }
.eg-status.eg-status-ok rect { fill: var(--info-bg); }
.eg-status.eg-status-ok text { fill: var(--info); }
.eg-status.eg-status-run rect { fill: var(--eg-intent-bg); }
.eg-status.eg-status-run text { fill: var(--eg-intent); }
.eg-status.eg-status-bad rect { fill: var(--critical-bg); }
.eg-status.eg-status-bad text { fill: var(--critical); }
.eg-sev rect { fill: var(--muted); }
.eg-sev text { fill: #ffffff; }
.eg-sev.eg-sev-critical rect { fill: var(--critical); }
.eg-sev.eg-sev-high rect { fill: var(--high); }
.eg-sev.eg-sev-medium rect { fill: var(--medium); }
.eg-sev.eg-sev-low rect { fill: var(--low); }
.eg-sev.eg-sev-info rect { fill: var(--info); }
.eg-sev.eg-sev-unknown rect { fill: var(--muted); }

/* 详情抽屉
   ⚠️ [hidden] 规则必须补：.explore-drawer 声明了 display:flex，作者样式会覆盖 UA 的
   [hidden]{display:none}——否则 hidden 的抽屉仍以 360px 实体面板常驻画布右侧遮挡/挤压。
   选择器特异性 (类+属性 0,2,0) 高于 .explore-drawer (0,1,0)，与书写顺序无关。 */
.explore-drawer-backdrop[hidden],
.explore-drawer[hidden] { display: none; }
.explore-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  border-radius: 12px;
  z-index: 5;
}
.explore-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 82%);
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  border-radius: 0 12px 12px 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.eg-drawer-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line-light);
}
.eg-drawer-head h3 {
  margin: 0;
  font-size: .92rem;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.eg-drawer-kind {
  flex-shrink: 0;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: .72rem;
}
.eg-drawer-kind.eg-badge-goal { background: var(--accent); color: #fff; }
.eg-drawer-kind.eg-badge-intent { background: var(--eg-intent-bg); color: var(--eg-intent); }
.eg-drawer-kind.eg-badge-fact { background: var(--eg-fact-bg); color: var(--eg-fact); }
.eg-drawer-kind.eg-badge-vuln { background: var(--eg-proves-bg); color: var(--eg-proves); }
.eg-drawer-close {
  flex-shrink: 0;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}
.eg-drawer-close:hover { color: var(--ink); }
.eg-drawer-body {
  padding: 12px 16px 16px;
  overflow-y: auto;
  flex: 1;
}
.eg-field { margin-bottom: 12px; }
.eg-field-label {
  display: block;
  font-size: .72rem;
  color: var(--muted);
  margin-bottom: 3px;
}
.eg-field-value {
  font-size: .84rem;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
}
.eg-field-mono .eg-field-value { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; }
.eg-drawer-link { margin-top: 4px; display: inline-block; }

/* ── 移动端应用壳与数据视图 ──
   桌面继续使用高密度侧栏 + 表格；窄屏改为抽屉导航 + 语义卡片，避免把关键操作藏在
   超宽表格最右侧。卡片字段标签由 app.js 从真实表头生成，动态追加的行也会同步处理。 */
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sidebar-head .brand { min-width: 0; }
.mobile-appbar,
.mobile-nav-close,
.sidebar-backdrop,
.mobile-table-tools { display: none; }

/* 窄桌面仍保留高密度宽表，但功能列不能依赖用户滚到最右侧才能发现。 */
@media (min-width: 901px) {
  table.responsive-table > thead > tr > .responsive-table-actions-head,
  table.responsive-table > tbody > tr > .mobile-table-actions-cell {
    position: sticky;
    right: 0;
  }
  table.responsive-table > thead > tr > .responsive-table-actions-head {
    z-index: 4;
    background: var(--surface-subtle);
    box-shadow: -1px 0 0 var(--line), -12px 0 18px rgba(15, 23, 42, .1);
  }
  table.responsive-table > tbody > tr > .mobile-table-actions-cell {
    z-index: 2;
    background: var(--panel);
    box-shadow: -1px 0 0 var(--line), -12px 0 18px rgba(15, 23, 42, .08);
  }
  table.responsive-table > tbody > tr:nth-child(even) > .mobile-table-actions-cell {
    background: var(--surface-alt);
  }
  table.responsive-table > tbody > tr:hover > .mobile-table-actions-cell {
    background: var(--surface-hover);
  }
}

@media (max-width: 900px) {
  body.mobile-nav-open { overflow: hidden; }
  .mobile-appbar {
    position: sticky;
    top: 0;
    z-index: 120;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 42px;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: max(8px, env(safe-area-inset-top)) 14px 8px;
    color: var(--sidebar-ink);
    background: color-mix(in srgb, var(--sidebar-bg) 96%, transparent);
    border-bottom: 1px solid var(--sidebar-border);
    box-shadow: 0 8px 24px rgba(2, 8, 23, .16);
    backdrop-filter: blur(14px);
  }
  .mobile-appbar-brand {
    color: var(--sidebar-strong);
    font-size: .92rem;
    font-weight: 750;
    white-space: nowrap;
  }
  .mobile-appbar-title {
    overflow: hidden;
    color: var(--sidebar-muted);
    font-size: .78rem;
    font-weight: 600;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-nav-toggle,
  .mobile-nav-close {
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    color: var(--sidebar-ink);
    background: var(--sidebar-hover);
    border: 1px solid var(--sidebar-border);
    border-radius: 10px;
    font-size: 1.25rem;
    line-height: 1;
  }
  .mobile-nav-toggle { display: grid; place-items: center; }
  .mobile-nav-close { display: grid; place-items: center; }
  .mobile-nav-toggle:focus-visible,
  .mobile-nav-close:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
    outline-offset: 2px;
  }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 140;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    background: rgba(2, 8, 23, .7);
    border: 0;
    border-radius: 0;
    transition: opacity .18s ease, visibility .18s ease;
  }
  body.mobile-nav-open .sidebar-backdrop {
    pointer-events: auto;
    visibility: visible;
    opacity: 1;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 150;
    width: min(86vw, 330px);
    height: 100vh;
    height: 100dvh;
    padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
    gap: 18px;
    overflow-y: auto;
    visibility: hidden;
    transform: translateX(calc(-100% - 18px));
    box-shadow: 24px 0 60px rgba(2, 8, 23, .35);
    transition: transform .2s ease, visibility .2s ease;
  }
  .sidebar.is-open {
    visibility: visible;
    transform: translateX(0);
  }
  .sidebar .brand { padding: 0 4px; }
  .sidebar nav {
    display: grid;
    grid-auto-rows: max-content;
    align-content: start;
    gap: 6px;
    width: 100%;
  }
  .sidebar nav a,
  .sidebar nav .nav-group summary {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    font-size: .88rem;
  }
  .sidebar nav .nav-group { display: block; width: 100%; }
  .sidebar nav .nav-subnav {
    width: 100%;
    padding: 6px 0 2px 18px;
  }
  .sidebar nav .nav-subnav a { min-height: 42px; font-size: .84rem; }
  .sidebar-user { margin-top: auto; }
  .sidebar form { display: block; }
  .main {
    min-width: 0;
    margin-left: 0;
    padding: 20px;
    padding-bottom: max(28px, env(safe-area-inset-bottom));
    overflow-x: clip;
  }
}

@media (max-width: 900px) {
  .main { padding: 16px; }
  section:not(.stats):not(.grid):not(.tutorial-hero),
  .grid > div,
  .card {
    padding: 14px;
    margin-bottom: 14px;
  }
  .page-head { gap: 12px; margin-bottom: 18px; }
  .page-head > .row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .page-head > .row-actions > a,
  .page-head > .row-actions > button,
  .page-head > .row-actions > form,
  .page-head > .row-actions > form > button {
    width: 100%;
    min-width: 0;
  }
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }
  .tabs > * { flex: 0 0 auto; min-height: 40px; }
  .toolbar { padding: 12px; }
  .toolbar .toolbar-group { width: 100%; }
  .search-bar { width: 100%; max-width: none; }
  .toolbar button,
  .toolbar .btn { min-height: 40px; }
  .toolbar .selected-count { width: fit-content; }
  .pagination { flex-wrap: wrap; }
  .form-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }
  .form-row label,
  .form-row button { width: 100%; min-width: 0; }
  .target-selection-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .target-selection-actions > a,
  .target-selection-actions > button,
  .target-selection-actions > form,
  .target-selection-actions > form > button { width: 100%; min-width: 0; }
  .admin-overview-head-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .admin-overview-head-actions > * { width: 100%; }
  .registry-group > .registry-group-summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 10px;
  }
  .registry-group-summary h2 { min-width: 0; overflow-wrap: anywhere; }
  .registry-group-summary .sync-badge {
    grid-column: 1 / -1;
    width: 100%;
    margin-left: 0;
    text-align: left;
  }
  .dashboard-llm .card { padding-bottom: 14px; }
  .dashboard-provider-select {
    position: static;
    max-width: none;
    margin-top: 14px;
  }
  .dashboard-note.corner-note {
    position: static;
    width: auto;
    margin-top: 10px;
    text-align: left;
  }

  .mobile-table-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    padding: 9px 12px;
    color: var(--ink-secondary);
    background: var(--surface-subtle);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: .78rem;
  }
  .mobile-table-tools label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    margin: 0;
    cursor: pointer;
  }
  .mobile-table-tools input[type="checkbox"],
  .responsive-table input[type="checkbox"] {
    width: 18px;
    min-width: 18px;
    height: 18px;
  }
  .mobile-table-tools-hint { color: var(--muted); }

  .table-wrap:has(> table.responsive-table) {
    overflow: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
  }
  .table-wrap[style*="max-height"]:has(> table.responsive-table) {
    max-height: 60dvh !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
  }
  table.responsive-table {
    display: block;
    width: 100%;
    min-width: 0 !important;
    table-layout: auto !important;
    background: transparent;
    border-collapse: separate;
  }
  table.responsive-table colgroup,
  table.responsive-table > thead { display: none; }
  table.responsive-table > tbody {
    display: grid;
    gap: 12px;
    width: 100%;
  }
  table.responsive-table > tbody > tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
    padding: 5px 14px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-left: 3px solid color-mix(in srgb, var(--accent) 62%, var(--line));
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
  }
  table.responsive-table > tbody > tr[hidden] { display: none !important; }
  table.responsive-table > tbody > tr > td,
  table.responsive-table > tbody > tr > th {
    display: grid;
    grid-template-columns: minmax(76px, 30%) minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    width: auto !important;
    min-width: 0 !important;
    padding: 9px 0 !important;
    overflow: visible;
    white-space: normal;
    border: 0;
    border-bottom: 1px solid var(--line-light);
  }
  table.responsive-table > tbody > tr > :last-child { border-bottom: 0; }
  table.responsive-table > tbody > tr > td::before,
  table.responsive-table > tbody > tr > th::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: .72rem;
    font-weight: 650;
    line-height: 1.55;
  }
  table.responsive-table .mobile-table-select-cell {
    grid-template-columns: minmax(76px, 30%) auto;
    align-items: center;
  }
  table.responsive-table .mobile-table-select-cell::before { content: "选择"; }
  table.responsive-table .mobile-table-empty-cell { display: none; }
  table.responsive-table .mobile-table-actions-cell {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 11px !important;
  }
  table.responsive-table .mobile-table-actions-cell::before {
    margin-bottom: 2px;
    color: var(--ink-secondary);
  }
  table.responsive-table > tbody > tr.responsive-table-wide-row {
    padding: 0;
    overflow: hidden;
    border-left-color: var(--line);
  }
  table.responsive-table > tbody > tr.responsive-table-wide-row > td,
  table.responsive-table > tbody > tr.responsive-table-wide-row > th {
    display: block;
    padding: 12px !important;
    border: 0;
  }
  table.responsive-table > tbody > tr.responsive-table-wide-row > td::before,
  table.responsive-table > tbody > tr.responsive-table-wide-row > th::before { display: none; }
  table.responsive-table .truncate,
  table.responsive-table .clip,
  table.responsive-table .errorline {
    max-width: 100%;
    overflow: visible;
    text-overflow: initial;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  table.responsive-table input:not([type="checkbox"]):not([type="radio"]),
  table.responsive-table select,
  table.responsive-table textarea { width: 100%; min-width: 0; }
  table.responsive-table .node-version-list { width: 100%; min-width: 0; }
  table.responsive-table .node-version {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  table.responsive-table .row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }
  table.responsive-table .row-actions > a,
  table.responsive-table .row-actions > button,
  table.responsive-table .row-actions > form,
  table.responsive-table .row-actions > form > button,
  table.responsive-table .row-actions > form > select {
    width: 100%;
    min-width: 0;
  }
  table.responsive-table .inline-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    width: 100%;
  }
  table.responsive-table .node-edit-panel,
  table.responsive-table .edit-grid { grid-template-columns: minmax(0, 1fr); }
  table.responsive-table .node-edit-wide { grid-column: auto; }
  table.responsive-table .node-actions-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    padding: 12px;
  }
  table.responsive-table .node-actions-panel > a,
  table.responsive-table .node-actions-panel > button,
  table.responsive-table .node-actions-panel > form,
  table.responsive-table .node-actions-panel > form > button,
  table.responsive-table .node-actions-panel > form > select {
    width: 100%;
    min-width: 0;
  }
  table.responsive-table .node-actions-sep-group {
    display: contents;
    padding: 0;
    border: 0;
  }

  .modal-overlay { align-items: end; padding-top: 20px; }
  .modal {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 20px);
    padding: 20px 16px max(20px, env(safe-area-inset-bottom));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .modal .modal-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .modal .modal-actions > * { width: 100%; min-width: 0; }
  .toast-container { top: 70px; right: 12px; left: 12px; }
  .toast { width: 100%; max-width: none; }
  .tips-bar { width: 100%; max-width: 100%; }
  .tips-content {
    display: -webkit-box;
    overflow: hidden;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .tips-close { width: 36px; min-width: 36px; height: 36px; padding: 0; }
  .assistant-shell {
    top: max(7px, env(safe-area-inset-top)) !important;
    right: 64px !important;
    bottom: auto !important;
    left: auto !important;
    z-index: 130;
  }
  .assistant-launcher { width: 44px; height: 44px; }
  .assistant-launcher-icon { width: 22px; height: 22px; }
  .assistant-panel {
    top: 64px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 8px;
    width: auto;
    height: auto;
    max-height: none;
  }
}

@media (max-width: 420px) {
  .mobile-appbar { grid-template-columns: minmax(0, 1fr) auto; }
  .mobile-appbar-title { display: none; }
  .page-head > .row-actions,
  .modal .modal-actions,
  .target-selection-actions,
  table.responsive-table .row-actions,
  table.responsive-table .node-actions-panel { grid-template-columns: minmax(0, 1fr); }
  table.responsive-table > tbody > tr > td,
  table.responsive-table > tbody > tr > th {
    grid-template-columns: minmax(70px, 29%) minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .sidebar-backdrop { transition: none; }
}

/* ── 扫描交互终端（scan_detail）── */
#intervention-section.scan-terminal {
  --term-bg: #000;
  --term-panel: #000;
  --term-line: #303030;
  --term-green: #00df73;
  --term-muted: #939393;
  --term-amber: #e7bd74;
  --term-red: #ff7b72;
  padding: 0;
  overflow: hidden;
  border-color: var(--term-line);
  border-radius: 4px;
  background: var(--term-bg);
  color: #d6d6d6;
  box-shadow: none;
  font-family: "Cascadia Code", "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}
#intervention-section.is-fullscreen {
  position: fixed;
  z-index: 1200;
  inset: 8px;
  margin: 0;
  display: flex;
  flex-direction: column;
  border-radius: 4px;
}
.scan-terminal.is-fullscreen .scan-terminal-workspace { flex: 1; min-height: 0; }
.scan-terminal.is-fullscreen .scan-terminal-output { flex: 1; height: auto; min-height: 0; }
.scan-terminal [hidden] { display: none !important; }
body.scan-terminal-open { overflow: hidden; }
.scan-terminal-bar,
.scan-terminal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 8px 12px;
  background: var(--term-bg);
  border-bottom: 1px solid var(--term-line);
  font-size: 12px;
}
.scan-terminal-footer {
  min-height: 30px;
  border-top: 1px solid var(--term-line);
  border-bottom: 0;
  color: var(--term-muted);
  flex-wrap: wrap;
}
.scan-terminal-brand,
.scan-terminal-actions { display: flex; align-items: center; gap: 10px; }
.scan-terminal-brand strong { color: #d6d6d6; font-size: 13px; font-weight: 600; }
.scan-terminal-state { color: var(--term-amber); }
.scan-terminal-state.ready { color: var(--term-green); }
.scan-terminal-state.finished { color: var(--term-muted); }
.scan-terminal-follow { display: flex; align-items: center; gap: 4px; color: var(--term-muted); font-size: 11px; line-height: 1; user-select: none; white-space: nowrap; }
.scan-terminal-follow input { width: 12px; height: 12px; min-width: 12px; margin: 0; accent-color: var(--term-green); }
.scan-terminal-button {
  min-height: 28px;
  padding: 3px 9px;
  border: 1px solid var(--term-line);
  border-radius: 4px;
  background: transparent;
  color: #bdbdbd;
  font: inherit;
}
.scan-terminal-button:hover { border-color: #777; color: #fff; }
.scan-terminal-button.danger { border-color: #56332f; color: #e99a93; }
.scan-terminal-workspace { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 440px; }
.scan-terminal-agents {
  min-width: 0;
  padding: 12px 8px;
  border-right: 1px solid var(--term-line);
  background: var(--term-bg);
  overflow: auto;
}
.scan-terminal-agents-title { margin: 0 7px 12px; color: var(--term-muted); font-size: 12px; }
.scan-terminal-agent-list { display: grid; gap: 2px; }
.scan-terminal-agent {
  width: 100%;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 8px;
  padding: 7px 5px 7px calc(7px + var(--agent-depth, 0) * 14px);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #bdbdbd;
  text-align: left;
  font: inherit;
}
.scan-terminal-agent:hover { background: #171717; color: #fff; }
.scan-terminal-agent.selected { background: #07385b; color: #fff; }
.scan-terminal-agent-dot { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: #939393; }
.scan-terminal-agent-dot.status-running { background: var(--term-green); }
.scan-terminal-agent-dot.status-waiting { background: var(--term-amber); }
.scan-terminal-agent-dot.status-failed,
.scan-terminal-agent-dot.status-crashed { background: var(--term-red); }
.scan-terminal-agent-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.scan-terminal-agent-meta { display: block; margin-top: 2px; color: var(--term-muted); font-size: 11px; }
.scan-terminal-agent.selected .scan-terminal-agent-meta { color: #b5cddd; }
.scan-terminal-note, .scan-terminal-target { margin: 12px 7px; color: var(--term-muted); font-size: 11px; overflow-wrap: anywhere; }
.scan-terminal-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--term-bg); }
.scan-terminal-output {
  height: 520px;
  min-height: 300px;
  overflow: auto;
  padding: 18px 16px 24px;
  scrollbar-color: #393939 transparent;
  line-height: 1.6;
  font-size: 13px;
}
.scan-terminal-boot,
.scan-terminal-empty { color: var(--term-muted); }
.scan-terminal-line { position: relative; margin: 0 0 18px; }
.scan-terminal-line-time { display: none; }
.scan-terminal-line-body { min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.scan-terminal-line-label { color: var(--term-muted); margin-right: 8px; }
.scan-terminal-line.assistant .scan-terminal-line-label { display: none; }
.scan-terminal-line.user { border-left: 2px solid #168bff; padding-left: 12px; }
.scan-terminal-line.user .scan-terminal-line-label { display: block; color: #dedede; font-weight: 600; }
.scan-terminal-line.system, .scan-terminal-line.error { margin-bottom: 10px; font-size: 12px; color: var(--term-muted); }
.scan-terminal-line.system .scan-terminal-line-label { color: var(--term-amber); }
.scan-terminal-line.error .scan-terminal-line-label { color: var(--term-red); }
.scan-terminal-tool {
  margin: 0;
  padding: 0;
  color: var(--term-muted);
}
.scan-terminal-tool summary { cursor: pointer; color: var(--term-muted); overflow-wrap: anywhere; }
.scan-terminal-tool summary::marker { color: #b490ff; }
.scan-terminal-tool.status-running summary::after { content: "  执行中"; color: var(--term-amber); }
.scan-terminal-tool.status-completed summary::after { content: "  完成"; color: var(--term-muted); }
.scan-terminal-tool.status-failed summary::after { content: "  失败"; color: var(--term-red); }
.scan-terminal-tool pre { max-height: 260px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0 0 14px; padding: 0; background: transparent; color: var(--term-muted); border: 0; font: inherit; }
.scan-terminal-markdown { white-space: normal; }
.scan-terminal-markdown :is(h1, h2, h3, h4, h5, h6) { margin: 14px 0 6px; font: inherit; font-weight: 700; color: var(--term-green); }
.scan-terminal-markdown p { margin: 0 0 10px; }
.scan-terminal-markdown :is(ul, ol) { margin: 6px 0 12px; padding-left: 2em; }
.scan-terminal-markdown :is(strong, a), .scan-terminal-markdown li::marker { color: var(--term-green); }
.scan-terminal-markdown a { text-decoration: underline; }
.scan-terminal-markdown pre { overflow: auto; padding: 8px 12px; border: 1px solid var(--term-line); background: transparent; color: inherit; }
.scan-terminal-markdown code { font: inherit; color: inherit; background: transparent; }
.scan-terminal-markdown blockquote { border-left: 2px solid var(--term-line); margin: 8px 0; padding-left: 12px; color: var(--term-muted); }
.scan-terminal-composer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
  gap: 9px;
  flex-shrink: 0;
  padding: 4px 10px;
  margin: 0 8px 8px;
  border: 1px solid var(--term-line);
  border-radius: 4px;
  background: var(--term-panel);
}
.scan-terminal-composer:focus-within { border-color: var(--term-green); }
.scan-terminal-prompt { color: var(--term-green); line-height: 30px; white-space: nowrap; }
.scan-terminal-composer textarea {
  width: 100%;
  min-height: 30px;
  max-height: 132px;
  padding: 5px 0;
  resize: none;
  overflow-y: auto;
  border: 0;
  outline: 0;
  background: transparent;
  color: #dedede;
  caret-color: var(--term-green);
  font: inherit;
  line-height: 20px;
}
.scan-terminal-composer textarea::placeholder { color: var(--term-muted); }
.scan-terminal-composer textarea:disabled { opacity: .45; }
.scan-terminal-composer button {
  min-height: 30px;
  padding: 4px 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--term-green);
  font: inherit;
}
.scan-terminal-composer button:disabled { background: transparent; color: #777; }
.scan-terminal :focus-visible { outline: 2px solid #72c98d; outline-offset: 2px; }
.scan-terminal-composer textarea:focus-visible { outline: 0; box-shadow: none; }
@media (max-width: 1100px) {
  .scan-terminal-workspace { grid-template-columns: 200px minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .job-live-head { align-items: flex-start; }
  .job-live-grid,
  .job-runtime-details { grid-template-columns: 1fr; }
  .job-usage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
  .scan-terminal-bar { flex-wrap: wrap; }
  .scan-terminal-actions { gap: 6px; }
  .scan-terminal-workspace { grid-template-columns: 1fr; }
  .scan-terminal-agents { grid-row: 1; border-right: 0; border-bottom: 1px solid var(--term-line); padding: 8px; max-height: 150px; }
  .scan-terminal-agents-title, .scan-terminal-target { display: none; }
  .scan-terminal-agent-list { display: flex; overflow-x: auto; }
  .scan-terminal-agent { flex: 0 0 auto; min-width: 150px; max-width: 240px; width: auto; padding: 7px; }
  .scan-terminal-output { height: 380px; }
  .scan-terminal.is-fullscreen .scan-terminal-workspace { grid-template-rows: auto minmax(0, 1fr); }
}
