/* ============================================================
   ComfyUI 全景解析 — 站点主题
   零依赖 · 深色 · 仿 ComfyUI 视觉语言
   ============================================================ */

:root {
  --bg: #0d0f15;
  --bg-2: #12141d;
  --panel: #171a26;
  --panel-2: #1c2030;
  --border: #272c3d;
  --border-2: #333a52;
  --text: #e8ebf4;
  --muted: #9aa3b8;
  --faint: #6b7288;
  --accent: #7c5cff;
  --accent-2: #4cc9f0;
  --accent-grad: linear-gradient(135deg, #7c5cff 0%, #4cc9f0 100%);
  --ok: #4ade80;
  --warn: #fbbf24;
  --err: #f87171;

  /* 节点类别色（仿 ComfyUI） */
  --c-load: #b06ab3;
  --c-model: #8b5cf6;
  --c-cond: #e8a33d;
  --c-latent: #5faf5f;
  --c-image: #3d8bd6;
  --c-sampler: #2aa8b8;
  --c-mask: #8a93a8;
  --c-vae: #d9534f;
  --c-clip: #c9b34a;
  --c-video: #d4618c;
  --c-audio: #4fbf9f;
  --c-util: #647088;
  --c-net: #4cc9f0;
  --c-3d: #b8875c;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.75;
  min-height: 100vh;
}
::selection { background: rgba(124, 92, 255, .4); }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono {
  font-family: "Cascadia Code", Consolas, "JetBrains Mono", monospace;
}
code {
  background: rgba(124,92,255,.12);
  border: 1px solid rgba(124,92,255,.25);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: .86em;
  color: #c4b5fd;
}
pre {
  background: #0a0c12;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.65;
  margin: 14px 0;
}
pre code { background: none; border: none; padding: 0; color: #cdd6f4; }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,15,21,.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; gap: 28px;
  padding: 0 24px; height: 60px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 17px; color: var(--text);
  white-space: nowrap;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent-grad);
  display: grid; place-items: center;
  font-size: 15px; color: #fff;
  box-shadow: 0 2px 10px rgba(124,92,255,.45);
}
.main-nav { display: flex; gap: 4px; flex: 1; }
.main-nav a {
  color: var(--muted); padding: 7px 14px; border-radius: 8px;
  font-size: 14px; font-weight: 500;
}
.main-nav a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.main-nav a.active { color: #fff; background: rgba(124,92,255,.18); }

.search-wrap { position: relative; width: 280px; }
.search-wrap input {
  width: 100%; height: 36px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 9px; color: var(--text);
  padding: 0 12px 0 34px; font-size: 13px; outline: none;
}
.search-wrap input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,92,255,.18); }
.search-wrap .search-ico {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--faint); font-size: 13px; pointer-events: none;
}
.search-results {
  position: absolute; top: 44px; right: 0; width: 420px; max-height: 480px;
  overflow-y: auto; background: var(--panel-2);
  border: 1px solid var(--border-2); border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,.6);
  display: none; padding: 6px;
}
.search-results.open { display: block; }
.search-results .sr-item {
  display: block; padding: 9px 12px; border-radius: 8px; color: var(--text);
}
.search-results .sr-item:hover { background: rgba(124,92,255,.12); text-decoration: none; }
.sr-item .sr-title { font-size: 13.5px; font-weight: 600; }
.sr-item .sr-sub { font-size: 12px; color: var(--muted); }
.sr-item .sr-badge {
  display: inline-block; font-size: 10.5px; padding: 1px 7px; border-radius: 99px;
  margin-right: 7px; vertical-align: 1px;
}

/* ---------- 布局 ---------- */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.page { padding: 34px 0 80px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 72px 0 60px;
  text-align: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(600px 300px at 20% 0%, rgba(124,92,255,.16), transparent 70%),
    radial-gradient(600px 300px at 80% 10%, rgba(76,201,240,.12), transparent 70%),
    var(--bg-2);
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(124,92,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,92,255,.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
  pointer-events: none;
}
.hero h1 {
  font-size: 42px; font-weight: 800; letter-spacing: .5px;
  background: linear-gradient(120deg, #fff 30%, #a78bfa 60%, #4cc9f0 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .sub { color: var(--muted); font-size: 17px; margin-top: 14px; max-width: 760px; margin-left: auto; margin-right: auto; }
.hero .hero-badges { margin-top: 22px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; padding: 5px 13px; border-radius: 99px;
  border: 1px solid var(--border-2); background: var(--panel); color: var(--muted);
}
.badge.acc { border-color: rgba(124,92,255,.5); color: #c4b5fd; background: rgba(124,92,255,.1); }
.badge.cyan { border-color: rgba(76,201,240,.4); color: #7dd3fc; background: rgba(76,201,240,.08); }

/* ---------- 三大入口卡 ---------- */
.entry-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  margin-top: -38px; position: relative; z-index: 2;
}
.entry-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; padding: 26px 24px;
  display: block; color: var(--text); position: relative; overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.entry-card:hover {
  transform: translateY(-4px); text-decoration: none;
  border-color: var(--border-2);
  box-shadow: 0 18px 44px rgba(0,0,0,.5);
}
.entry-card .ec-num {
  position: absolute; right: 14px; top: 6px; font-size: 58px; font-weight: 800;
  color: rgba(124,92,255,.09); font-family: Consolas, monospace;
}
.entry-card .ec-ico {
  width: 44px; height: 44px; border-radius: 12px; font-size: 21px;
  display: grid; place-items: center; margin-bottom: 16px;
}
.entry-card h3 { font-size: 19px; margin-bottom: 8px; }
.entry-card p { color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.entry-card .ec-meta { margin-top: 14px; font-size: 12.5px; color: var(--faint); }
.ec-purple .ec-ico { background: rgba(124,92,255,.15); }
.ec-cyan .ec-ico { background: rgba(76,201,240,.12); }
.ec-green .ec-ico { background: rgba(74,222,128,.12); }

/* ---------- 通用区块 ---------- */
.section { margin-top: 46px; }
.sec-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 8px; flex-wrap: wrap; }
.sec-head h2 { font-size: 25px; font-weight: 700; }
.sec-head .sec-en { color: var(--faint); font-size: 13px; font-family: Consolas, monospace; }
.sec-desc { color: var(--muted); font-size: 14.5px; margin-bottom: 20px; max-width: 900px; }

.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

/* ---------- 节点包卡片 ---------- */
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.pkg-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px; display: flex; flex-direction: column; gap: 10px;
  transition: transform .16s, border-color .16s, box-shadow .16s;
  color: var(--text); position: relative;
}
.pkg-card:hover { transform: translateY(-3px); border-color: var(--border-2); box-shadow: 0 14px 34px rgba(0,0,0,.45); text-decoration: none; }
.pkg-card .pc-top { display: flex; align-items: center; gap: 10px; }
.pkg-card h3 { font-size: 16.5px; flex: 1; }
.pkg-tag {
  font-size: 10.5px; padding: 2px 9px; border-radius: 99px; font-weight: 600;
  border: 1px solid; white-space: nowrap;
}
.pkg-tag.official { color: #7dd3fc; border-color: rgba(76,201,240,.45); background: rgba(76,201,240,.08); }
.pkg-tag.third { color: #c4b5fd; border-color: rgba(124,92,255,.45); background: rgba(124,92,255,.08); }
.pkg-card .pc-desc { color: var(--muted); font-size: 13px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pkg-card .pc-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.mini-tag { font-size: 11px; color: var(--faint); background: var(--bg-2); border: 1px solid var(--border); padding: 2px 9px; border-radius: 99px; }
.mini-tag.n { color: #86efac; }

/* ---------- 包详情 / 节点卡 ---------- */
.pkg-hero {
  background: linear-gradient(160deg, rgba(124,92,255,.12), rgba(76,201,240,.05)), var(--panel);
  border: 1px solid var(--border-2); border-radius: 18px; padding: 30px; margin-bottom: 26px;
}
.pkg-hero h1 { font-size: 28px; margin-bottom: 6px; }
.pkg-hero .ph-meta { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 16px; }
.pkg-hero .ph-desc { color: var(--muted); max-width: 920px; }
.back-link { font-size: 13px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; margin-bottom: 16px; }

.node-list { display: flex; flex-direction: column; gap: 14px; }
.node-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 13px;
  overflow: hidden;
}
.node-card summary {
  list-style: none; cursor: pointer; padding: 15px 20px;
  display: flex; align-items: center; gap: 12px; user-select: none;
}
.node-card summary::-webkit-details-marker { display: none; }
.node-card summary:hover { background: var(--panel-2); }
.node-card[open] summary { border-bottom: 1px solid var(--border); background: var(--panel-2); }
.node-chevron { margin-left: auto; color: var(--faint); transition: transform .15s; font-size: 12px; }
.node-card[open] .node-chevron { transform: rotate(90deg); }
.node-name { font-family: Consolas, monospace; font-size: 14.5px; font-weight: 600; color: #e2e8f0; }
.node-brief { color: var(--muted); font-size: 12.5px; }
.cat-dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.node-body { padding: 18px 22px 20px; }
.node-body .nb-row { display: grid; grid-template-columns: 130px 1fr; gap: 12px; margin-bottom: 12px; font-size: 13.5px; }
.node-body .nb-row:last-child { margin-bottom: 0; }
.nb-label { color: var(--faint); font-size: 12.5px; padding-top: 2px; white-space: nowrap; }
.type-chip {
  display: inline-block; font-size: 11px; font-family: Consolas, monospace;
  padding: 1px 8px; border-radius: 5px; margin: 0 4px 4px 0;
  border: 1px solid; font-weight: 600;
}
.io-line { margin-bottom: 5px; }
.io-arrow { color: var(--faint); margin: 0 6px; font-size: 12px; }

/* ---------- 分类色 ---------- */
.t-MODEL    { color: #c4b5fd; border-color: #8b5cf6; background: rgba(139,92,246,.12); }
.t-CLIP     { color: #e5d78a; border-color: #c9b34a; background: rgba(201,179,74,.12); }
.t-VAE      { color: #fca5a5; border-color: #d9534f; background: rgba(217,83,79,.12); }
.t-IMAGE    { color: #93c5fd; border-color: #3d8bd6; background: rgba(61,139,214,.14); }
.t-LATENT   { color: #86efac; border-color: #5faf5f; background: rgba(95,175,95,.13); }
.t-CONDITIONING { color: #fcd34d; border-color: #e8a33d; background: rgba(232,163,61,.13); }
.t-SAMPLER  { color: #67e8f9; border-color: #2aa8b8; background: rgba(42,168,184,.13); }
.t-MASK     { color: #cbd5e1; border-color: #8a93a8; background: rgba(138,147,168,.13); }
.t-CONTROL_NET  { color: #d6c0b0; border-color: #a1887f; background: rgba(161,136,127,.13); }
.t-VIDEO    { color: #f9a8d4; border-color: #d4618c; background: rgba(212,97,140,.13); }
.t-AUDIO    { color: #5eead4; border-color: #4fbf9f; background: rgba(79,191,159,.13); }
.t-UPSCALE_MODEL { color: #c4b5fd; border-color: #7c5cff; background: rgba(124,92,255,.12); }
.t-CLIP_VISION   { color: #e5d78a; border-color: #a2914a; background: rgba(162,145,74,.13); }
.t-STYLE_MODEL   { color: #e5d78a; border-color: #a2914a; background: rgba(162,145,74,.13); }
.t-NOISE         { color: #67e8f9; border-color: #2aa8b8; background: rgba(42,168,184,.13); }
.t-GUIDER        { color: #67e8f9; border-color: #2aa8b8; background: rgba(42,168,184,.13); }
.t-SIGMAS        { color: #67e8f9; border-color: #2aa8b8; background: rgba(42,168,184,.13); }
.t-DEFAULT       { color: #9aa3b8; border-color: #647088; background: rgba(100,112,136,.15); }

.cat-load { background: var(--c-load); }
.cat-model { background: var(--c-model); }
.cat-cond { background: var(--c-cond); }
.cat-latent { background: var(--c-latent); }
.cat-image { background: var(--c-image); }
.cat-sampler { background: var(--c-sampler); }
.cat-mask { background: var(--c-mask); }
.cat-vae { background: var(--c-vae); }
.cat-clip { background: var(--c-clip); }
.cat-video { background: var(--c-video); }
.cat-audio { background: var(--c-audio); }
.cat-util { background: var(--c-util); }
.cat-net { background: var(--c-net); }
.cat-3d { background: var(--c-3d); }

/* ---------- 工作流卡片 ---------- */
.wf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 18px; }
.wf-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px; color: var(--text); display: flex; flex-direction: column; gap: 10px;
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.wf-card:hover { transform: translateY(-3px); border-color: var(--border-2); box-shadow: 0 14px 34px rgba(0,0,0,.45); text-decoration: none; }
.wf-card h3 { font-size: 16.5px; display: flex; align-items: center; gap: 10px; }
.wf-card .wf-desc { color: var(--muted); font-size: 13px; line-height: 1.7; }
.wf-card .wf-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; align-items: center; }
.diff { color: var(--warn); font-size: 12px; letter-spacing: 1px; }
.wf-cat-pill {
  font-size: 11px; font-weight: 600; padding: 3px 11px; border-radius: 99px;
  background: rgba(124,92,255,.14); color: #c4b5fd; border: 1px solid rgba(124,92,255,.4);
}

/* ---------- 筛选条 ---------- */
.filter-bar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin: 18px 0 22px;
}
.filter-btn {
  background: var(--panel); color: var(--muted); border: 1px solid var(--border);
  padding: 6px 15px; border-radius: 99px; font-size: 13px; cursor: pointer;
  font-family: inherit;
}
.filter-btn:hover { color: var(--text); border-color: var(--border-2); }
.filter-btn.active { background: rgba(124,92,255,.2); color: #d8ccff; border-color: rgba(124,92,255,.55); }

/* ---------- 节点图（ComfyUI 风格） ---------- */
.graph-shell {
  background: #101218;
  background-image:
    radial-gradient(rgba(124,92,255,.06) 1px, transparent 1px);
  background-size: 26px 26px;
  border: 1px solid var(--border-2); border-radius: 14px;
  position: relative; overflow: hidden;
}
.graph-shell svg { display: block; width: 100%; height: auto; cursor: grab; }
.graph-shell svg.panning { cursor: grabbing; }
/* 画布高度用户可调：拖底部边条后 svg 填满容器高度（视野变大，配合缩放看大图更省平移） */
.graph-shell.sized svg { height: 100%; }
.graph-rsz {
  position: absolute; left: 0; right: 0; bottom: 0; height: 14px;
  cursor: ns-resize; z-index: 7; touch-action: none;
}
.graph-rsz::after {
  content: ""; position: absolute; left: 50%; top: 5px; transform: translateX(-50%);
  width: 46px; height: 4px; border-radius: 2px;
  background: var(--border-2); transition: background .15s, width .15s;
}
.graph-rsz:hover::after, .graph-rsz.active::after { background: var(--accent); width: 64px; }
.graph-toolbar {
  position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; z-index: 5;
}
.gt-btn {
  width: 30px; height: 30px; border-radius: 8px;
  background: rgba(23,26,38,.92); border: 1px solid var(--border-2);
  color: var(--muted); cursor: pointer; font-size: 14px;
  display: grid; place-items: center; font-family: inherit;
}
.gt-btn:hover { color: var(--text); border-color: var(--accent); }
.graph-hint {
  position: absolute; left: 12px; bottom: 22px;
  font-size: 11.5px; color: var(--faint); pointer-events: none;
}
.g-node { cursor: grab; }
.g-node:active { cursor: grabbing; }
svg.nodedragging .g-node { cursor: grabbing; }
svg.nodedragging .g-node-body { stroke: #a78bfa; stroke-width: 1.5; }
/* 节点一句话备注：节点正下方小字，深色描边光晕保证任何底色可读 */
.g-node-note {
  font-size: 11px; fill: #aab3c8; pointer-events: none;
  paint-order: stroke; stroke: #0d0f15; stroke-width: 3px; stroke-linejoin: round;
}
svg.hide-notes .g-node-note { display: none; }
.graph-toolbar .gt-toggle.on { color: #4cc9f0; border-color: rgba(76,201,240,.55); }
.g-node:hover .g-node-body { stroke: #a78bfa; stroke-width: 1.5; }
.g-node.selected .g-node-body { stroke: #a78bfa; stroke-width: 2; }
.g-node-title { font-size: 12.5px; font-weight: 600; fill: #fff; pointer-events: none; }
.g-port-text { font-size: 10.5px; fill: #b6bdd0; pointer-events: none; }
.g-widget-text { font-size: 11px; fill: #9aa3b8; pointer-events: none; }
.g-link { fill: none; stroke-opacity: .85; stroke-width: 2; pointer-events: none; }

/* 节点详情弹层（fixed：可拖到整页任意位置，头部为拖把） */
.graph-detail {
  position: fixed; right: 16px; top: 110px; width: 330px; max-height: calc(100vh - 140px);
  overflow: hidden; display: none; flex-direction: column; z-index: 60;
  background: rgba(23,26,38,.97); border: 1px solid var(--border-2);
  border-radius: 12px; padding: 16px;
  box-shadow: 0 14px 40px rgba(0,0,0,.55);
}
.graph-detail.open { display: flex; }
/* 内容滚动层：面板本体不滚，头部拖把、关闭按钮与缩放手柄常驻 */
.graph-detail .gd-scroll { overflow-y: auto; flex: 1 1 auto; min-height: 0; scrollbar-width: thin; }
.graph-detail .gd-scroll::-webkit-scrollbar { width: 6px; }
.graph-detail .gd-scroll::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
.graph-detail.dragging { user-select: none; }
.graph-detail .gd-head { cursor: grab; user-select: none; touch-action: none; }
.graph-detail.dragging .gd-head { cursor: grabbing; }
.graph-detail .gd-head::before { content: "⠿"; color: var(--faint); font-size: 13px; opacity: .8; }
.graph-detail h4 { font-family: Consolas, monospace; font-size: 14px; margin-bottom: 4px; color: #e2e8f0; }
.graph-detail .gd-cat { font-size: 11px; margin-bottom: 10px; }
.graph-detail .gd-brief { font-size: 12.5px; color: #cdd6f4; margin-bottom: 10px; }
.graph-detail .gd-sec { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .8px; margin: 10px 0 5px; }
.graph-detail .gd-p { font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.graph-detail .gd-close { position: absolute; top: 8px; right: 10px; cursor: pointer; color: var(--faint); }
.graph-detail .gd-close:hover { color: var(--text); }

/* ---------- 阶段时间线 ---------- */
.stage-line { position: relative; margin: 10px 0 4px; padding-left: 30px; }
.stage-line::before {
  content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px;
  width: 2px; background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 2px; opacity: .5;
}
.stage-item { position: relative; padding: 10px 0 18px; }
.stage-item::before {
  content: ""; position: absolute; left: -27px; top: 17px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(124,92,255,.15);
}
.stage-item h4 { font-size: 15.5px; margin-bottom: 5px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stage-item .st-nodes { display: flex; gap: 6px; flex-wrap: wrap; }
.stage-item p { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.stage-num {
  width: 22px; height: 22px; border-radius: 7px; background: var(--accent-grad);
  display: inline-grid; place-items: center; font-size: 12px; color: #fff; font-weight: 700;
  flex-shrink: 0;
}

/* ---------- 步骤/流程 ---------- */
.flow-steps { display: flex; flex-direction: column; gap: 0; }
/* DATA FLOW 联动：步骤可点击，选中步高亮并在图上聚焦该步数据流 */
.flow-inline-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border);
}
.flow-inline-head h2 { font-size: 16px; margin: 0; }
.flow-hint { font-size: 11.5px; color: var(--faint); }
#flowList { margin-top: 6px; }
#flowList .flow-step {
  cursor: pointer; border-radius: 10px; padding: 4px 10px; margin: 0 -10px;
  transition: background .15s ease, box-shadow .15s ease;
}
#flowList .flow-step:hover { background: rgba(124, 92, 255, .06); }
#flowList .flow-step.active {
  background: rgba(76, 201, 240, .08);
  box-shadow: inset 3px 0 0 #4cc9f0;
}
#flowList .flow-step.active h4 { color: #7dd3fc; }
#flowList .flow-step.active .fs-num { background: #4cc9f0; color: #0d0f15; }
.flow-step { display: grid; grid-template-columns: 40px 1fr; gap: 14px; padding-bottom: 20px; position: relative; }
.flow-step:not(:last-child)::before {
  content: ""; position: absolute; left: 19px; top: 38px; bottom: 0;
  width: 2px; background: var(--border); 
}
.fs-num {
  width: 40px; height: 40px; border-radius: 12px; background: var(--panel-2);
  border: 1px solid var(--border-2); display: grid; place-items: center;
  font-weight: 700; color: #a78bfa; font-size: 15px;
}
.flow-step h4 { font-size: 15px; margin-bottom: 4px; padding-top: 8px; }
.flow-step p { color: var(--muted); font-size: 13.5px; }

/* ---------- 参数表 / 表格 ---------- */
table.data-table {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
}
table.data-table th, table.data-table td {
  padding: 11px 15px; text-align: left; border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.data-table th { background: var(--panel-2); color: var(--muted); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table td .mono { font-size: 12.5px; }

/* ---------- 提示框 ---------- */
.callout {
  border-radius: 12px; padding: 15px 18px; font-size: 13.5px; line-height: 1.7;
  border: 1px solid; margin: 16px 0; display: flex; gap: 11px;
}
.callout .co-ico { font-size: 16px; flex-shrink: 0; }
.callout.info { background: rgba(76,201,240,.07); border-color: rgba(76,201,240,.3); }
.callout.info .co-title { color: #7dd3fc; }
.callout.warn { background: rgba(251,191,36,.07); border-color: rgba(251,191,36,.3); }
.callout.warn .co-title { color: #fbbf24; }
.callout.danger { background: rgba(248,113,113,.07); border-color: rgba(248,113,113,.35); }
.callout.danger .co-title { color: #f87171; }
.callout.tip { background: rgba(74,222,128,.06); border-color: rgba(74,222,128,.3); }
.callout.tip .co-title { color: #4ade80; }
.co-title { font-weight: 700; margin-right: 6px; }

/* ---------- 架构图 ---------- */
.arch-figure { margin: 22px 0; }
.figcap { text-align: center; color: var(--faint); font-size: 12.5px; margin-top: 10px; }
.arch-svg { width: 100%; height: auto; display: block; }
.arch-svg .abox { rx: 10; }
.arch-svg text { font-family: "Segoe UI", "Microsoft YaHei", sans-serif; }
.arch-svg .lbl { font-size: 12px; fill: #9aa3b8; }
.arch-svg .lbl-strong { font-size: 13.5px; font-weight: 600; fill: #e8ebf4; }
.arch-svg .lbl-small { font-size: 10.5px; fill: #7b8299; }
.arch-svg .arrow-line { stroke: #4cc9f0; stroke-width: 1.8; fill: none; }
.arch-svg .arrow-line.purple { stroke: #a78bfa; }
.arch-svg .arrow-line.dashed { stroke-dasharray: 5 4; }

/* 两列图文 */
.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 980px) {
  .split-2, .grid-2, .grid-3, .grid-4, .entry-grid { grid-template-columns: 1fr; }
}

/* ---------- 时间线（发展史） ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2)); opacity: .45;
}
.tl-item { position: relative; padding: 0 0 22px 12px; }
.tl-item::before {
  content: ""; position: absolute; left: -24px; top: 7px; width: 11px; height: 11px;
  border-radius: 50%; background: var(--bg); border: 3px solid var(--accent-2);
}
.tl-item .tl-date { font-size: 12px; color: var(--accent-2); font-family: Consolas, monospace; font-weight: 600; }
.tl-item h4 { font-size: 15px; margin: 3px 0 4px; }
.tl-item p { color: var(--muted); font-size: 13px; }

/* ---------- 代码示例块头部 ---------- */
.code-head {
  display: flex; justify-content: space-between; align-items: center;
  background: #14161f; border: 1px solid var(--border); border-bottom: none;
  border-radius: 10px 10px 0 0; padding: 8px 15px;
  font-size: 12px; color: var(--faint); font-family: Consolas, monospace;
}
.code-head + pre { margin-top: 0; border-radius: 0 0 10px 10px; }

/* ---------- FAQ / 手风琴 ---------- */
.faq-item {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  margin-bottom: 12px; overflow: hidden;
}
.faq-item summary { cursor: pointer; padding: 15px 20px; font-weight: 600; font-size: 14.5px; list-style: none; display: flex; align-items: center; gap: 10px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { background: var(--panel-2); }
.faq-item .faq-body { padding: 4px 20px 18px; color: var(--muted); font-size: 13.5px; }
.faq-item .faq-body p { margin-bottom: 8px; }

/* ---------- 统计条 ---------- */
.stats-bar {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin: 34px 0 8px;
}
.stat-box {
  background: var(--panel); border: 1px solid var(--border); border-radius: 13px;
  padding: 18px 20px; text-align: center;
}
.stat-box .st-num {
  font-size: 28px; font-weight: 800;
  background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-box .st-label { color: var(--muted); font-size: 12.5px; margin-top: 3px; }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--border); padding: 34px 0 44px;
  color: var(--faint); font-size: 13px; text-align: center;
}
.site-footer a { color: var(--muted); }
.footer-links { display: flex; gap: 20px; justify-content: center; margin-bottom: 12px; flex-wrap: wrap; }

/* ---------- 架构页目录 ---------- */
.arch-toc {
  position: sticky; top: 76px; float: right; width: 220px; margin-left: 28px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; font-size: 12.5px; max-height: calc(100vh - 100px); overflow-y: auto;
}
.arch-toc .toc-title { color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.arch-toc a { display: block; color: var(--muted); padding: 4px 0; border-left: 2px solid transparent; padding-left: 10px; }
.arch-toc a:hover { color: var(--text); text-decoration: none; }
.arch-toc a.h2 { color: #cdd6f4; }
@media (max-width: 1180px) { .arch-toc { display: none; } }

.prose h2 { font-size: 24px; margin: 44px 0 12px; padding-top: 8px; scroll-margin-top: 80px; }
.prose h3 { font-size: 18.5px; margin: 30px 0 10px; scroll-margin-top: 80px; color: #dde3f0; }
.prose h4 { font-size: 15.5px; margin: 22px 0 8px; color: #cdd6f4; }
.prose p { color: var(--muted); margin-bottom: 12px; }
.prose li { color: var(--muted); margin: 0 0 6px 22px; }
.prose ul { margin-bottom: 12px; }
.prose strong { color: #dfe4f2; }

/* 对比表 */
.path-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.path-card { background: var(--panel); border: 1px solid var(--border); border-radius: 13px; padding: 20px; }
.path-card .pk-level { font-size: 11px; font-weight: 700; letter-spacing: 1px; padding: 3px 10px; border-radius: 99px; display: inline-block; margin-bottom: 10px; }
.path-card h4 { font-size: 15.5px; margin-bottom: 8px; }
.path-card p { color: var(--muted); font-size: 13px; margin-bottom: 8px; }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2c3245; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3c4460; }

/* toast */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--panel-2); border: 1px solid var(--border-2); color: var(--text);
  padding: 11px 22px; border-radius: 10px; font-size: 13.5px; z-index: 999;
  opacity: 0; transition: all .25s ease; box-shadow: 0 12px 34px rgba(0,0,0,.5);
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ============================================================
   交互增强（v2）
   ============================================================ */

/* 顶部阅读进度条 */
.read-progress {
  position: fixed; top: 0; left: 0; height: 2.5px; width: 0%;
  background: var(--accent-grad); z-index: 200;
  box-shadow: 0 0 8px rgba(124,92,255,.8);
  transition: width .08s linear;
}

/* 返回顶部 */
.back-top {
  position: fixed; right: 26px; bottom: 30px; z-index: 90;
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--panel-2); border: 1px solid var(--border-2);
  color: var(--muted); font-size: 17px; cursor: pointer;
  display: grid; place-items: center;
  opacity: 0; pointer-events: none; transform: translateY(14px);
  transition: all .22s ease;
  box-shadow: 0 10px 26px rgba(0,0,0,.45);
}
.back-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-top:hover { color: #fff; border-color: var(--accent); background: rgba(124,92,255,.2); }

/* 页面入场动画 */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.page { animation: fadeUp .35s ease both; }
.entry-card, .pkg-card, .wf-card, .stat-box, .card { animation: fadeUp .4s ease both; }
.pkg-card:nth-child(2), .wf-card:nth-child(2), .stat-box:nth-child(2) { animation-delay: .05s; }
.pkg-card:nth-child(3), .wf-card:nth-child(3), .stat-box:nth-child(3) { animation-delay: .1s; }
.pkg-card:nth-child(4), .wf-card:nth-child(4), .stat-box:nth-child(4) { animation-delay: .15s; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* 首页热搜词条 */
.hot-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }
.hot-chip {
  font-size: 12.5px; color: var(--muted); background: rgba(23,26,38,.7);
  border: 1px solid var(--border-2); border-radius: 99px; padding: 5px 14px;
  cursor: pointer; font-family: inherit; transition: all .15s;
}
.hot-chip:hover { color: #d8ccff; border-color: var(--accent); background: rgba(124,92,255,.14); }

/* 图内高亮系统 */
.g-link { transition: stroke-opacity .18s ease, stroke-width .18s ease; }
.g-link.hl { stroke-width: 3.2; stroke-opacity: 1; }
.g-link.ctx { stroke-width: 2.6; stroke-opacity: .38; }
.g-link.dim { stroke-opacity: .07; }

/* 连线流动层：dashoffset 动画沿路径方向（from→to）流动 */
.g-flow {
  fill: none; stroke-width: 2.2; stroke-dasharray: 5 13; stroke-linecap: round;
  opacity: .22; pointer-events: none; animation: gflow 1.5s linear infinite;
}
@keyframes gflow { to { stroke-dashoffset: -18; } }
.g-link.hl + .g-flow { opacity: .95; animation-duration: .6s; }
.g-link.ctx + .g-flow { opacity: .55; }
.g-link.dim + .g-flow { opacity: 0; animation-play-state: paused; }

/* 执行回放状态 */
.g-link.play-pending { stroke-opacity: .13; }
.g-link.play-pending + .g-flow { opacity: 0; animation-play-state: paused; }
.g-link.play-in { stroke-width: 3.4; stroke-opacity: 1; }
.g-link.play-in + .g-flow { opacity: 1; animation-duration: .45s; stroke-width: 3; }
.g-link.play-done { stroke-opacity: .75; }
.g-link.play-done + .g-flow { opacity: .6; }
.g-node.play-pending { opacity: .25; transition: opacity .25s ease; }
.g-node.play-done { opacity: 1; transition: opacity .25s ease; }
.g-node.play-active { opacity: 1; }
.g-node.play-active .g-node-body {
  stroke: #4cc9f0; stroke-width: 2;
  filter: drop-shadow(0 0 7px rgba(76, 201, 240, .75));
  animation: pbPulse 1.1s ease-in-out infinite alternate;
}
@keyframes pbPulse { from { stroke-width: 1.6; } to { stroke-width: 2.6; } }

/* 数据流播放控件 + 字幕条 */
.play-bar { display: flex; align-items: center; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.play-btn {
  background: rgba(76, 201, 240, .1); border: 1px solid rgba(76, 201, 240, .4);
  color: #7dd3fc; padding: 5px 16px; border-radius: 999px;
  font-size: 12.5px; cursor: pointer; transition: background .15s ease;
}
.play-btn:hover { background: rgba(76, 201, 240, .2); }
.pb-mini {
  background: transparent; border: 1px solid transparent; color: var(--faint);
  font-size: 13px; padding: 3px 8px; border-radius: 6px; cursor: pointer;
}
.pb-mini:hover { color: #7dd3fc; border-color: var(--border); }
.playing .pb-mini { color: var(--muted); }
.pb-note { color: var(--faint); font-size: 11.5px; margin-left: 6px; }
.playing .pb-note { display: none; }
/* 数据流卡片（回放每一步的数据形态/状态/来源/去向） */
.pb-sub { margin-top: 10px; }
.pb-sub:empty { margin-top: 0; }
.pb-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 16px; animation: stageIn .22s ease;
}
.pb-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.pb-head b { color: #dfe4f2; font-size: 14px; }
.pb-pos { color: #7dd3fc; font-size: 12px; }
.pb-stage-tag {
  font-size: 10.5px; color: #7dd3fc; border: 1px solid rgba(76, 201, 240, .35);
  border-radius: 999px; padding: 1px 9px;
}
.pb-row { display: flex; gap: 10px; margin-top: 5px; font-size: 12.5px; line-height: 1.9; }
.pb-k { flex: 0 0 56px; color: var(--faint); font-size: 11px; padding-top: 2px; }
.pb-d { margin-right: 16px; }
.pb-t { font-weight: 700; }
.pb-src { color: var(--faint); font-size: 11px; }
.pb-none { color: var(--faint); font-size: 11.5px; }
.pb-do-text { color: var(--muted); }
.pb-wid {
  margin-top: 2px; color: var(--faint); font-size: 11.5px;
  padding: 3px 8px; background: rgba(124, 92, 255, .07); border-radius: 6px;
  display: inline-block;
}
.pb-done { color: #7dd3fc; }

/* 逐节点分析卡 ↔ 图 联动标记 */
/* 图详情面板 · 在本工作流中（语境分析块，位于通用"作用"之下） */
.gd-note {
  margin-top: 8px; padding: 8px 12px; border-radius: 8px;
  background: rgba(76, 201, 240, .07); border-left: 3px solid rgba(76, 201, 240, .55);
  font-size: 12.5px; line-height: 1.8; color: var(--muted);
}
.gd-note b { display: block; color: #7dd3fc; font-size: 11px; margin-bottom: 3px; letter-spacing: .5px; }
.node-loc {
  display: none; font-size: 10.5px; color: #0d0f15; background: #4cc9f0;
  border-radius: 999px; padding: 1px 8px; white-space: nowrap; margin-left: 8px;
}
.node-card.active {
  border-color: rgba(76, 201, 240, .5) !important;
  background: rgba(76, 201, 240, .06);
  box-shadow: inset 3px 0 0 #4cc9f0;
}
.node-card.active .node-loc { display: inline-block; }
.node-card.active .node-name { color: #7dd3fc; }

@media (prefers-reduced-motion: reduce) {
  .g-flow { animation: none; opacity: .15; }
  .g-node.play-active .g-node-body { animation: none; }
}
.g-node { transition: opacity .18s ease; }
.g-node.dim { opacity: .18; }
.g-stage-tag {
  font-size: 10px; fill: #0d0f15; font-weight: 700; pointer-events: none;
}

/* 阶段聚焦条 */
.stage-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 4px; }
.stage-chip {
  font-size: 12.5px; padding: 6px 14px; border-radius: 99px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--border); color: var(--muted);
  font-family: inherit; transition: all .15s;
}
.stage-chip:hover { color: var(--text); border-color: var(--border-2); }
.stage-chip.active { background: rgba(76,201,240,.16); border-color: rgba(76,201,240,.55); color: #7dd3fc; }

/* 联动面板内：阶段时间线卡片可点击选中（选中态与图高亮双向联动） */
#wfPanel .stage-line .stage-item { cursor: pointer; border-radius: 10px; transition: background .15s ease, box-shadow .15s ease; }
#wfPanel .stage-line .stage-item:hover { background: rgba(124,92,255,.06); }
#wfPanel .stage-line .stage-item.active { background: rgba(76,201,240,.07); box-shadow: inset 3px 0 0 #4cc9f0; }
#wfPanel .stage-line .stage-item.active h4 { color: #7dd3fc; }
@keyframes stageIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* 图例 */
.graph-legend {
  display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px;
  font-size: 11.5px; color: var(--faint); align-items: center;
}
.graph-legend .lg { display: inline-flex; align-items: center; gap: 5px; }
.graph-legend .sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------- 联动面板：数据流 / 阶段拆解 / 逐节点分析（tab 切换 + 可收起） ---------- */
.wf-panel {
  margin-top: 18px;
  background: var(--panel);
  border: 1px solid var(--border-2);
  border-radius: 14px;
  overflow: hidden;
}
.wf-tabs {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(124,92,255,.05);
}
.wf-tab {
  background: transparent; border: 1px solid transparent; color: var(--muted);
  font-size: 13px; padding: 6px 14px; border-radius: 99px; cursor: pointer;
  font-family: inherit; transition: all .15s;
}
.wf-tab:hover { color: var(--text); border-color: var(--border-2); }
.wf-tab.active { background: rgba(124,92,255,.18); border-color: rgba(124,92,255,.55); color: #d8ccff; }
.wf-collapse {
  margin-left: auto;
  background: transparent; border: 1px solid var(--border); color: var(--faint);
  font-size: 12px; padding: 5px 12px; border-radius: 99px; cursor: pointer;
  font-family: inherit; transition: all .15s;
}
.wf-collapse:hover { color: var(--text); border-color: var(--border-2); }
.wf-body { padding: 8px 20px 20px; }
.wf-tabpane { display: none; }
.wf-tabpane.active { display: block; animation: stageIn .2s ease; }
.wf-panel.collapsed .wf-body { display: none; }
.wf-panel.collapsed .wf-tabs { border-bottom: none; }
/* 面板内的 flow 区头不再需要分隔线 */
.wf-tabpane .flow-inline-head { border-top: none; padding-top: 6px; margin-top: 4px; }

/* 三个 tab 统一的步进控制条：上一步 / 下一步 / 重置 + 当前聚焦位置 */
.wf-stepbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 7px 12px; margin: 6px 0 12px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px;
}
.wf-step-btn {
  background: var(--panel); border: 1px solid var(--border); color: var(--muted);
  border-radius: 99px; padding: 4px 13px; font-size: 12px; cursor: pointer;
  font-family: inherit; transition: all .15s;
}
.wf-step-btn:hover { color: var(--text); border-color: var(--accent); }
.wf-step-reset:hover { border-color: rgba(217,83,79,.6); color: #f1a0a0; }
.wf-step-pos { margin-left: auto; font-size: 11.5px; color: var(--faint); }
.wf-step-pos.on { color: #7dd3fc; }

/* 展开收起按钮条 */
.bulk-bar { display: flex; gap: 8px; align-items: center; margin: 14px 0; flex-wrap: wrap; }
.bulk-bar .spacer { flex: 1; }
.bulk-btn {
  background: var(--panel); border: 1px solid var(--border); color: var(--muted);
  border-radius: 9px; padding: 6px 14px; font-size: 12.5px; cursor: pointer; font-family: inherit;
}
.bulk-btn:hover { color: var(--text); border-color: var(--accent); }

/* 上一篇/下一篇 */
.pager-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 40px; }
.pager-nav a {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 18px; color: var(--text); transition: all .16s;
}
.pager-nav a:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }
.pager-nav .pn-label { font-size: 11.5px; color: var(--faint); margin-bottom: 4px; }
.pager-nav .pn-title { font-size: 14px; font-weight: 600; }
.pager-nav .pn-next { text-align: right; }

/* 搜索快捷键提示 */
.search-wrap kbd {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  font-size: 10px; color: var(--faint); border: 1px solid var(--border-2);
  border-radius: 4px; padding: 1px 5px; background: var(--bg-2); pointer-events: none;
}

/* 键盘焦点可见性 */
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px;
}

/* 节点卡悬浮微交互 */
.node-card { transition: border-color .15s; }
.node-card:hover { border-color: var(--border-2); }
.node-card summary { transition: background .15s; }

/* 详情面板动画 */
/* 详情卡入场只用 opacity：带 transform 的动画会让拖动起点坐标偏移（闪跳），也会把 fixed 变成相对内容定位 */
@keyframes cvFade { from { opacity: 0; } to { opacity: 1; } }
.graph-detail { animation: cvFade .2s ease both; }
.graph-detail.resizing { user-select: none; }
/* 左下角缩放手柄：左右调宽 · 上下调高 */
.graph-detail .gd-rsz { position: absolute; left: 0; bottom: 0; width: 20px; height: 20px; cursor: nesw-resize; touch-action: none; z-index: 3; }
.graph-detail .gd-rsz::after {
  content: ""; position: absolute; left: 5px; bottom: 5px; width: 9px; height: 9px;
  border-left: 2px solid var(--faint); border-bottom: 2px solid var(--faint);
  border-bottom-left-radius: 7px; opacity: .55; transition: opacity .15s, border-color .15s;
}
.graph-detail .gd-rsz:hover::after, .graph-detail.resizing .gd-rsz::after { opacity: 1; border-color: var(--accent); }

/* ============================================================
   交互升级 v3：节点真实结构 + 深度详情
   ============================================================ */

/* ---- 节点卡：左右分栏 ---- */
.np-split { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .np-split { grid-template-columns: 1fr; } }
.np-mock-wrap {
  position: sticky; top: 76px;
  background: #101218;
  background-image: radial-gradient(rgba(124,92,255,.06) 1px, transparent 1px);
  background-size: 22px 22px;
  border: 1px solid var(--border-2); border-radius: 12px; padding: 14px;
}
.np-mock-wrap svg { width: 100%; height: auto; display: block; }
.np-mock-wrap .mock-hint { font-size: 11px; color: var(--faint); text-align: center; margin-top: 8px; }
.np-mock .mock-row { cursor: pointer; }
.np-mock .mock-row:hover .mock-row-hl { stroke: #a78bfa; stroke-width: 1.5; }
.np-mock .mock-row.flash .mock-row-hl { stroke: #4cc9f0; stroke-width: 2; animation: rowflash 1.2s ease; }
@keyframes rowflash { 0% { stroke: #4cc9f0; } 100% { stroke: transparent; } }

/* 右侧详情 */
.np-details { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.np-sec { background: var(--bg-2); border: 1px solid var(--border); border-radius: 11px; overflow: hidden; }
.np-sec > summary {
  list-style: none; cursor: pointer; padding: 11px 16px;
  display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 600;
  user-select: none;
}
.np-sec > summary::-webkit-details-marker { display: none; }
.np-sec > summary:hover { background: var(--panel); }
.np-sec[open] > summary { border-bottom: 1px solid var(--border); }
.np-sec > summary .sec-count {
  font-size: 10.5px; font-weight: 600; color: var(--faint);
  background: var(--panel); border: 1px solid var(--border-2); border-radius: 99px; padding: 0 8px;
}
.np-sec > summary .node-chevron { margin-left: auto; }
.np-sec-body { padding: 12px 16px 14px; }

.np-prose { color: var(--muted); font-size: 13.5px; line-height: 1.75; }
.np-prose b, .np-prose strong { color: #dfe4f2; }

/* 输入/输出/参数条目（二级可展开） */
.io-item { border: 1px solid var(--border); border-radius: 9px; margin-bottom: 8px; background: var(--panel); overflow: hidden; }
.io-item:last-child { margin-bottom: 0; }
.io-item > summary {
  list-style: none; cursor: pointer; padding: 8px 12px;
  display: flex; align-items: center; gap: 8px; font-size: 12.5px; flex-wrap: wrap;
}
.io-item > summary::-webkit-details-marker { display: none; }
.io-item > summary:hover { background: var(--panel-2); }
.io-item[open] > summary { border-bottom: 1px dashed var(--border); }
.io-item .io-name { font-weight: 600; color: #dfe4f2; font-family: Consolas, monospace; font-size: 12px; }
.io-item .io-zh { color: var(--faint); font-size: 11.5px; }
.io-item .io-body { padding: 10px 13px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.io-item .io-body .io-cap { color: var(--faint); font-size: 11px; margin-right: 5px; }

/* 参数 */
.param-row { border-left: 2px solid rgba(124,92,255,.5); padding: 2px 0 2px 12px; margin-bottom: 12px; }
.param-row:last-child { margin-bottom: 0; }
.param-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.param-name { font-family: Consolas, monospace; font-weight: 600; font-size: 12.5px; color: #c4b5fd; }
.param-kind { font-size: 10px; color: var(--faint); border: 1px solid var(--border-2); border-radius: 4px; padding: 0 6px; }
.param-default { font-size: 11px; color: #7dd3fc; }
.param-desc { color: var(--muted); font-size: 12.5px; margin-top: 3px; line-height: 1.7; }
.param-opts { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.param-opt { display: flex; gap: 8px; font-size: 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 7px; padding: 5px 10px; }
.param-opt .opt-v { font-family: Consolas, monospace; color: #86efac; font-size: 11.5px; white-space: nowrap; min-width: 70px; }
.param-opt .opt-d { color: var(--muted); }

/* ---- 图内弹出详情窗 v3 ---- */
.graph-detail { width: 400px; }
@media (max-width: 900px) { .graph-detail { width: calc(100% - 20px); } }
.graph-detail .gd-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; padding-right: 22px; }
.graph-detail .gd-head h4 { margin: 0; }
.graph-detail .gd-sec-block {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: 8px; overflow: hidden;
}
.graph-detail .gd-sec-block > summary {
  list-style: none; cursor: pointer; padding: 8px 12px;
  display: flex; gap: 8px; align-items: center; font-size: 12.5px; font-weight: 600; color: #dfe4f2;
}
.graph-detail .gd-sec-block > summary::-webkit-details-marker { display: none; }
.graph-detail .gd-sec-block > summary:hover { background: var(--panel); }
.graph-detail .gd-sec-block[open] > summary { border-bottom: 1px solid var(--border); }
.graph-detail .gd-sec-block .sec-count {
  font-size: 10px; color: var(--faint); background: var(--panel);
  border: 1px solid var(--border-2); border-radius: 99px; padding: 0 7px; font-weight: 500;
}
.graph-detail .gd-sec-block .sec-body { padding: 10px 12px; }
.graph-detail .gd-role { font-size: 12.5px; color: var(--muted); line-height: 1.7; padding: 10px 12px; }
.graph-detail .type-zh { color: var(--faint); font-size: 10.5px; margin-left: 4px; }
.graph-detail .gd-pkg-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: #7dd3fc;
  background: rgba(76,201,240,.08); border: 1px solid rgba(76,201,240,.35);
  border-radius: 99px; padding: 4px 13px; margin-bottom: 10px;
}
.graph-detail .gd-pkg-link:hover { background: rgba(76,201,240,.18); text-decoration: none; color: #bae6fd; }

/* ===== 四 · 真实工作流库 (page-civitai.js) ===== */
.ec-orange .ec-ico { background: rgba(232,163,61,.14); }
.cv-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 18px 0 6px; }
.cv-tile { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.cv-tile-num { font-size: 24px; font-weight: 700; color: #7c5cff; font-family: Consolas, monospace; }
.cv-tile-label { font-size: 12px; color: var(--faint); margin-top: 4px; }
.cv-bars { display: flex; flex-direction: column; gap: 8px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.cv-bar { display: grid; grid-template-columns: 220px 1fr 70px; align-items: center; gap: 12px; font-size: 12.5px; }
.cv-bar-name { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-bar-track { height: 10px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.cv-bar-fill { display: block; height: 100%; background: linear-gradient(90deg, #7c5cff, #4cc9f0); border-radius: 99px; }
.cv-bar-num { color: var(--faint); text-align: right; font-family: Consolas, monospace; }
.cv-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cv-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0 18px; }
.cv-sel { background: var(--bg-2); color: var(--muted); border: 1px solid var(--border); border-radius: 99px; padding: 6px 12px; font-size: 12.5px; outline: none; cursor: pointer; }
.cv-q { flex: 1; min-width: 200px; background: var(--bg-2); color: var(--text); border: 1px solid var(--border); border-radius: 99px; padding: 7px 15px; font-size: 13px; outline: none; }
.cv-q:focus { border-color: rgba(124,92,255,.5); }
.cv-nsfw { font-size: 12px; color: var(--faint); display: flex; align-items: center; gap: 6px; cursor: pointer; }
.cv-nsfw-pill { font-size: 10px; font-weight: 700; color: #f87171; border: 1px solid rgba(248,113,113,.5); border-radius: 6px; padding: 1px 6px; margin-right: 6px; vertical-align: 2px; }
.cv-pager { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin: 22px 0 10px; }
.cv-pager-info { font-size: 12px; color: var(--faint); margin-right: auto; }
.cv-page-btn { min-width: 34px; padding: 6px 10px; background: var(--bg-2); color: var(--muted); border: 1px solid var(--border); border-radius: 8px; font-size: 13px; cursor: pointer; }
.cv-page-btn:hover { border-color: rgba(124,92,255,.5); color: var(--text); }
.cv-page-btn.active { background: rgba(124,92,255,.18); border-color: rgba(124,92,255,.55); color: #c4b5fd; font-weight: 600; }
.cv-dots { color: var(--faint); font-size: 13px; }
.cv-link { color: #7dd3fc; text-decoration: none; }
.cv-link:hover { text-decoration: underline; }
@media (max-width: 720px) { .cv-bar { grid-template-columns: 120px 1fr 56px; } .cv-pager-info { width: 100%; margin: 0 0 6px; text-align: center; } }
.cv-variant-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; }
.cv-variant-label { font-size: 12.5px; color: var(--faint); }
.cv-variant-btn { font-size: 12px; color: var(--muted); background: var(--bg-2); border: 1px solid var(--border); border-radius: 99px; padding: 5px 13px; text-decoration: none; }
.cv-variant-btn:hover { border-color: rgba(124,92,255,.5); color: var(--text); text-decoration: none; }
.cv-variant-btn.active { background: rgba(124,92,255,.18); border-color: rgba(124,92,255,.55); color: #c4b5fd; font-weight: 600; }
.cv-variant-file { font-size: 12px; color: var(--faint); font-family: Consolas, monospace; margin: -8px 0 10px; }
.cv-loading { text-align: center; color: var(--faint); font-size: 13px; padding: 60px 0; }
.cv-variant-bar { max-height: 130px; overflow-y: auto; padding-right: 4px; }
.cv-ai-badge { display: inline-block; font-size: 10.5px; font-weight: 700; color: #7c5cff; border: 1px solid rgba(124,92,255,.5); border-radius: 6px; padding: 1px 7px; margin-right: 8px; vertical-align: 2px; letter-spacing: 1px; }
/* ===== AI 精读摘要排版：分段 / 折叠 / 节点名高亮（第三、四部分共用，wfpanel.digest 产出） ===== */
.cv-ai-para { display: block; margin: 0 0 10px; }
.cv-ai-para:last-child { margin-bottom: 0; }
.cv-ai-more.collapsed { display: none; }
.cv-ai-toggle { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; padding: 3px 14px; border: 1px solid var(--border-2); border-radius: 999px; background: var(--panel-2); color: var(--accent-2); font-size: 12px; cursor: pointer; transition: border-color .15s; }
.cv-ai-toggle:hover { border-color: var(--accent-2); color: #a5e6f7; }
.cv-tok { color: var(--accent-2); font-weight: 600; }
/* ===== AI 精读双视图：横向流程图（默认）+ 文字讲解 ===== */
.cv-digest-tabs { display: flex; gap: 8px; margin: 10px 0 12px; }
.cv-digest-tab { font-size: 12.5px; padding: 5px 16px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--panel-2); color: var(--muted); cursor: pointer; }
.cv-digest-tab.active { background: rgba(124,92,255,.16); border-color: rgba(124,92,255,.55); color: #c4b5fd; font-weight: 600; }
.cv-digest-pane[hidden] { display: none; }
.cv-fc-scroll { overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
.cv-fc-scroll::-webkit-scrollbar { height: 6px; }
.cv-fc-scroll::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
.cv-fc-rail { display: flex; align-items: stretch; width: max-content; min-width: 100%; }
.cv-fc-step { flex: 0 0 auto; width: 208px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px 9px; cursor: pointer; transition: border-color .15s, background .15s; }
.cv-fc-step:hover { border-color: var(--border-2); }
.cv-fc-step.active { border-color: rgba(124,92,255,.6); background: rgba(124,92,255,.08); }
.cv-fc-no { font-size: 14px; color: #c4b5fd; font-weight: 700; margin-right: 6px; }
.cv-fc-chips, .cv-fc-step > div:first-child { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.cv-fc-chip { font-family: Consolas, monospace; font-size: 10.5px; padding: 1px 7px; border-radius: 6px; border: 1px solid; white-space: nowrap; }
.cv-fc-chip.loc { cursor: pointer; }
.cv-fc-chip.loc:hover { filter: brightness(1.35); }
.cv-fc-cap { margin-top: 6px; font-size: 11.5px; color: var(--muted); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cv-fc-link { align-self: center; flex: 0 0 auto; color: var(--accent-2); font-size: 15px; padding: 0 7px; opacity: .85; }
.cv-fc-hint { font-size: 11.5px; color: var(--faint); margin-top: 2px; }
.cv-fc-dock { margin-top: 10px; border: 1px solid var(--border-2); border-radius: 10px; background: var(--bg-2); padding: 10px 14px 11px; }
.cv-fc-dock[hidden] { display: none; }
.cv-fc-dock-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text); }
.cv-fc-dock-close { margin-left: auto; background: none; border: none; color: var(--faint); cursor: pointer; font-size: 12px; }
.cv-fc-dock-close:hover { color: var(--text); }
.cv-fc-dock-body { font-size: 12.5px; color: var(--muted); line-height: 1.85; margin-top: 6px; }
.cv-fc-dock-loc { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 11.5px; color: var(--faint); }
/* ===== 宏观分支流程图（飞书画板风格 SVG）：圆角节点 + 折线箭头，支线挂主线上方 ===== */
.cv-mc-board { width: 100%; overflow-x: auto; scrollbar-width: thin; }
.cv-mc-board::-webkit-scrollbar { height: 6px; }
.cv-mc-board::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
.cv-mc-board svg { display: block; width: 100%; height: auto; min-width: 620px; }
.cv-mc-stage { cursor: pointer; }
.cv-mc-stage rect {
  fill: #1c2030; stroke: #3a415c; stroke-width: 1.2;
  transition: stroke .15s, fill .15s;
}
.cv-mc-stage:hover rect { stroke: rgba(124,92,255,.6); }
.cv-mc-stage.active rect { stroke: rgba(124,92,255,.85); fill: rgba(124,92,255,.14); }
.cv-mc-stage .mc-t { font-size: 13px; font-weight: 600; fill: var(--text); }
.cv-mc-stage .mc-m { font-size: 10.5px; fill: #4cc9f0; }
.cv-mc-stage .mc-d { font-size: 11px; fill: var(--muted); }
.cv-mc-fork { cursor: pointer; }
.cv-mc-fork rect {
  fill: rgba(124,92,255,.06); stroke: rgba(196,181,253,.55); stroke-width: 1.2;
  stroke-dasharray: 5 4; transition: stroke .15s, fill .15s;
}
.cv-mc-fork:hover rect { stroke: rgba(196,181,253,.9); }
.cv-mc-fork.active rect { stroke: rgba(196,181,253,1); fill: rgba(124,92,255,.16); stroke-dasharray: none; }
.cv-mc-fork .mc-tag { font-size: 10px; font-weight: 700; fill: #c4b5fd; letter-spacing: 1px; }
.cv-mc-fork .mc-t { font-size: 12.5px; font-weight: 600; fill: #ddd6fe; }
.cv-mc-fork .mc-d { font-size: 10.5px; fill: var(--faint); }
.cv-mc-board path.mc-e { fill: none; stroke: #4cc9f0; stroke-width: 1.6; }
.cv-mc-board path.mc-ef { fill: none; stroke: #c4b5fd; stroke-width: 1.4; stroke-dasharray: 5 4; }
.cv-mc-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.cv-uc-list { margin: 0; padding-left: 20px; color: var(--muted); font-size: 13.5px; line-height: 1.9; }
.cv-uc-list li::marker { color: #7c5cff; }
/* ===== 多维表格视图 ===== */
.cv-viewbar { display: flex; align-items: center; gap: 14px; margin: 4px 0 18px; flex-wrap: wrap; }
.cv-viewtabs { display: flex; gap: 8px; }
.cv-viewtab { font-size: 13px; color: var(--muted); background: var(--bg-2); border: 1px solid var(--border); border-radius: 9px; padding: 7px 16px; cursor: pointer; }
.cv-viewtab.active { background: rgba(124,92,255,.16); border-color: rgba(124,92,255,.55); color: #c4b5fd; font-weight: 600; }
.cv-viewnote { font-size: 12px; color: var(--faint); }
.cv-tb-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.cv-tb-label { font-size: 12.5px; color: var(--faint); }
.cv-table-wrap { overflow: auto; max-height: 72vh; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-2); }
.cv-table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.cv-table thead th { position: sticky; top: 0; z-index: 2; background: #1b1e2b; text-align: left; padding: 0; border-bottom: 1px solid var(--border); }
.cv-th-in { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 9px 10px; min-width: 88px; }
.cv-th-sort { cursor: pointer; color: #cdd3e1; font-weight: 600; white-space: nowrap; }
.cv-th-sort:hover { color: #fff; }
.cv-arrow { font-style: normal; color: #7c5cff; font-size: 10px; }
.cv-th-fbtn { cursor: pointer; font-size: 9px; color: var(--faint); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; }
.cv-th-fbtn:hover { color: var(--text); border-color: rgba(124,92,255,.5); }
.cv-th-fbtn.on { color: #7c5cff; border-color: rgba(124,92,255,.7); background: rgba(124,92,255,.14); }
.cv-table tbody td { padding: 8px 10px; border-bottom: 1px solid rgba(58,65,87,.45); color: var(--muted); white-space: nowrap; }
.cv-table tbody tr:hover td { background: rgba(124,92,255,.05); }
td.num { font-family: Consolas, monospace; text-align: right; color: #cdd3e1; }
.mono.dim { color: var(--faint); font-family: Consolas, monospace; }
.cv-tname { color: #cdd3e1; text-decoration: none; }
.cv-tname:hover { color: #c4b5fd; text-decoration: underline; }
.cv-empty { text-align: center; color: var(--faint); padding: 40px 0 !important; }
.cv-ghead td { background: rgba(124,92,255,.08); cursor: pointer; padding: 9px 12px !important; border-left: 3px solid #7c5cff; }
.cv-ghead b { color: #dfe4f2; }
.cv-g-toggle { display: inline-block; width: 18px; color: #7c5cff; }
.cv-g-agg { margin-left: 12px; font-size: 12px; color: var(--faint); }
.cv-ai-mini { font-size: 11px; color: #7c5cff; border: 1px solid rgba(124,92,255,.45); border-radius: 6px; padding: 1px 7px; }
.cv-dup-tag { font-size: 11px; color: #e8a33d; border: 1px solid rgba(232,163,61,.45); border-radius: 6px; padding: 1px 7px; }
.cv-dup-tag.copy { color: var(--faint); border-color: var(--border); }
.cv-pending-badge { display: inline-block; font-size: 10.5px; font-weight: 700; color: #e8a33d; border: 1px solid rgba(232,163,61,.5); border-radius: 6px; padding: 1px 7px; margin-right: 8px; vertical-align: 2px; letter-spacing: 1px; }
.cv-v-ai { font-size: 10px; font-weight: 700; color: #86efac; margin-left: 6px; white-space: nowrap; }
/* 未精读备份区：折叠面板 + 紧凑表格 */
.cv-backup { margin-top: 26px; border: 1px dashed var(--border-2); border-radius: 14px; padding: 14px 18px; background: rgba(255,255,255,.015); }
.cv-backup-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; cursor: pointer; user-select: none; }
.cv-backup-head:hover h2 { color: var(--text); }
.cv-backup-arrow { color: #7c5cff; font-size: 14px; }
.cv-backup-note { font-size: 12px; color: var(--faint); margin-left: auto; }
.cv-backup-table { margin-top: 12px; }
.cv-backup-table td { padding: 6px 10px; font-size: 12.5px; }
.cv-pop { position: absolute; z-index: 50; width: 280px; background: #1b1e2b; border: 1px solid rgba(124,92,255,.45); border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.5); padding: 12px; }
.cv-pop-head { font-size: 12.5px; font-weight: 600; color: #dfe4f2; margin-bottom: 8px; }
.cv-pop-q { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 12.5px; outline: none; margin-bottom: 8px; }
.cv-pop-list { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.cv-pop-opt { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); cursor: pointer; padding: 3px 4px; border-radius: 6px; }
.cv-pop-opt:hover { background: rgba(124,92,255,.08); }
.cv-pop-cnt { margin-left: auto; color: var(--faint); font-size: 11px; font-family: Consolas, monospace; }
.cv-pop-nums { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cv-pop-nums input[type=number] { width: 90px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 5px 8px; }
.cv-pop-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
