/* 整合包创作 /pack/ —— 与资源站 /res/ 同一套设计语言（浅色底、圆角、柔和阴影） */
:root {
  --bg: #fbfaf9;
  --card: #ffffff;
  --line: #e9e6e2;
  --side: #f4f2ef;
  --ink: #23201d;
  --sub: #5f5a54;
  --faint: #9b958d;
  --brand: #2ea073;
  --brand-soft: #d8efe5;
  --brand-ink: #1d7a56;
  --warn: #b4760f;
  --warn-bg: #fdf3e0;
  --shadow: 0 1px 2px rgba(30, 24, 18, .05), 0 8px 24px rgba(30, 24, 18, .06);
  --r: 14px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
html { overflow-x: hidden; }
body {
  max-width: 100vw;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 顶栏 ---------- */
.pk-top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: rgba(251, 250, 249, .92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.pk-back {
  color: var(--sub); text-decoration: none; font-size: 13.5px;
  padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--card);
  white-space: nowrap;
}
.pk-back:hover { color: var(--brand-ink); border-color: var(--brand-soft); }
.pk-title { flex: 1; min-width: 0; }
.pk-title h1 { margin: 0; font-size: 16px; letter-spacing: .3px; }
.pk-title p { margin: 0; font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-actions { display: flex; gap: 8px; }
.pk-btn {
  font: inherit; font-size: 13px; border-radius: 10px; padding: 7px 14px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
}
.pk-btn:active { transform: translateY(1px); }
.pk-btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pk-btn.ghost { background: transparent; color: var(--sub); }
.pk-btn[disabled] { opacity: .55; cursor: default; }

main { padding: 16px; }

/* ---------- 第一步 ---------- */
.step1 { display: flex; justify-content: center; padding: 28px 0 8px; }
.s1-card {
  width: min(680px, 100%);
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow); padding: 24px;
}
.s1-card h2 { margin: 0 0 6px; font-size: 19px; }
.s1-sub { margin: 0 0 14px; color: var(--sub); font-size: 13px; }
#idea {
  width: 100%; resize: vertical; min-height: 88px;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  font: inherit; color: var(--ink); background: var(--side);
}
#idea:focus { outline: 2px solid var(--brand-soft); background: #fff; }
.s1-row { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.s1-tip { margin: 10px 0 0; font-size: 12.5px; color: var(--faint); min-height: 18px; }

/* ---------- 工作台 ---------- */
.work {
  display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px;
  align-items: start;
}
.pool {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); overflow: hidden;
  position: sticky; top: 66px; max-height: calc(100vh - 130px); display: flex; flex-direction: column;
}
.pool-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px;
}
.pool-count { color: var(--faint); font-size: 12px; }
.pool-search { padding: 10px 12px 6px; }
.pool-search input {
  width: 100%; font: inherit; font-size: 13px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--side); color: var(--ink);
}
.pool-search input:focus { outline: 2px solid var(--brand-soft); background: #fff; }
.pool-list { overflow: auto; padding: 6px 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.pool-card {
  display: flex; gap: 10px; align-items: center;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card);
  padding: 8px 10px; cursor: grab; touch-action: none; user-select: none;
}
.pool-card:hover { border-color: var(--brand-soft); box-shadow: 0 2px 8px rgba(46,160,115,.10); }
.pool-card.dragging { opacity: .45; }
.pool-ico {
  width: 34px; height: 34px; flex: none; border-radius: 9px; background: var(--side);
  object-fit: cover; display: block;
}
.pool-main { min-width: 0; flex: 1; }
.pool-title { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pool-zh { display: block; font-size: 11.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pool-meta { font-size: 11px; color: var(--faint); margin-top: 1px; }
.pool-empty { color: var(--faint); font-size: 12.5px; padding: 18px 6px; text-align: center; }

/* ---------- 画布（无限画布：整块 stage 平移，不靠滚动条） ---------- */
.board {
  position: relative; min-height: 560px; height: calc(100vh - 190px);
  background:
    radial-gradient(circle at 1px 1px, #e6e1db 1px, transparent 0) 0 0 / 22px 22px,
    var(--card);
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
  overflow: hidden; touch-action: none; overscroll-behavior: contain;
  cursor: grab; overflow-anchor: none;
}
.board.panning { cursor: grabbing; }
.board.panning * { cursor: grabbing !important; }
/* stage 是真正被平移的那块内容：按住画布空白处拖动就是改它的 translate */
.stage { position: absolute; inset: 0; transform: translate(0, 0); transform-origin: 0 0; will-change: transform; }

/* 工作台模式：整页不滚，只有画布滚（桌面）。标题栏/状态栏固定为上下两条 */
@media (min-width: 861px) {
  body.pk-work { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
  body.pk-work .pk-top { flex: 0 0 auto; position: static; }
  body.pk-work main { flex: 1 1 auto; min-height: 0; display: flex; padding: 12px 16px; }
  body.pk-work .work { flex: 1 1 auto; min-height: 0; width: 100%; align-items: stretch; }
  body.pk-work .board { height: auto; min-height: 0; }
  body.pk-work .pool { position: relative; top: 0; max-height: none; }
  body.pk-work .statusbar { flex: 0 0 auto; position: static; }
}
.edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.nodes { position: absolute; inset: 0; }
.board-hint {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  font-size: 11.5px; color: var(--faint); background: rgba(255,255,255,.85);
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap;
}
.trash {
  position: absolute; right: 12px; bottom: 12px; z-index: 5;
  font-size: 12px; color: var(--faint); border: 1px dashed #e0c9a4; background: var(--warn-bg);
  color: var(--warn); border-radius: 12px; padding: 8px 12px; opacity: 0;
  transition: opacity .15s;
}
.trash.on { opacity: 1; }
.trash.hot { background: #fde3e3; border-color: #e8a3a3; color: #a33; }

.node {
  position: absolute; z-index: 2; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow);
  padding: 8px 10px; cursor: default; user-select: none;
}
.node.root {
  border: 1px solid var(--brand); background: linear-gradient(180deg, #f3fbf7, #fff);
  padding: 10px 14px; cursor: grab; touch-action: none;
}
.node.root .n-title { font-size: 14px; font-weight: 700; }
.node.root .n-sub { font-size: 11.5px; color: var(--faint); }
.node.branch {
  min-width: 180px; max-width: 220px; cursor: grab; touch-action: none;
  border-color: #cfe6db;
}
.node.branch .n-title { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.node.branch .n-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node.branch .n-count {
  font-size: 11px; color: var(--brand-ink); background: var(--brand-soft);
  border-radius: 999px; padding: 0 7px; font-weight: 600; flex: none;
}
.node.branch.drop-on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
/* +/× 钉在分类节点最右，别让短名字把它们带到节点中间（点中间应该是拖节点，不是加/删分类） */
.node.branch .n-tools { display: flex; gap: 4px; margin-left: auto; flex: none; }
.node.mod {
  display: flex; gap: 8px; align-items: center; min-width: 168px; max-width: 210px;
  cursor: grab; touch-action: none; padding: 6px 8px;
}
.node.mod .m-ico { width: 26px; height: 26px; border-radius: 7px; background: var(--side); flex: none; object-fit: cover; }
.node.mod .m-main { min-width: 0; flex: 1 1 auto; }
.node.mod .n-x { margin-left: auto; flex: none; }
.node.mod .m-title { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node.mod .m-zh { display: block; font-size: 10.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node.mod.dragging, .node.branch.dragging, .node.root.dragging { opacity: .94; }
.n-btn {
  border: 0; background: var(--side); color: var(--sub); border-radius: 7px;
  font-size: 11px; line-height: 1; padding: 3px 6px; cursor: pointer;
}
.n-btn:hover { background: var(--brand-soft); color: var(--brand-ink); }
.n-x { border: 0; background: transparent; color: var(--faint); cursor: pointer; font-size: 12px; padding: 0 2px; }
.n-x:hover { color: #b53; }

/* ---------- 状态栏 ---------- */
.statusbar {
  position: sticky; bottom: 0; z-index: 20;
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  padding: 9px 16px; background: rgba(251,250,249,.95); border-top: 1px solid var(--line);
  font-size: 12px; color: var(--sub); backdrop-filter: blur(8px);
}
.statusbar .warn {
  color: var(--warn); background: var(--warn-bg); border: 1px solid #f0dcb6;
  border-radius: 8px; padding: 2px 8px;
}
.toast {
  position: fixed; left: 50%; bottom: 64px; transform: translateX(-50%);
  background: #23201d; color: #fff; font-size: 13px; padding: 9px 16px; border-radius: 999px;
  z-index: 99; box-shadow: var(--shadow); max-width: 86vw;
}

/* ---------- 移动端 ---------- */
@media (max-width: 860px) {
  main { padding: 10px; }
  .work { grid-template-columns: minmax(0, 1fr); }
  .pool { position: relative; top: 0; max-height: 240px; order: 2; }
  .board { height: 62vh; min-height: 420px; order: 1; }
  .pk-title p { display: none; }
  .s1-card { padding: 16px; }
  .pk-top { padding: 8px 10px; gap: 8px; }
  .pk-actions .pk-btn { padding: 6px 10px; font-size: 12.5px; }
}
@media (max-width: 480px) {
  .pk-actions #btn-clear { display: none; }
  .board-hint { display: none; }
}

/* ---------- 模组简略介绍弹层 ---------- */
.sheet-bg {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(26, 22, 18, .42); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.sheet-bg[hidden] { display: none; }
.sheet {
  width: min(460px, 100%); max-height: 82vh; display: flex; flex-direction: column;
  background: var(--card); border-radius: 18px; border: 1px solid var(--line);
  box-shadow: 0 18px 60px rgba(20, 16, 10, .28); overflow: hidden;
}
.sheet-head {
  display: flex; gap: 10px; align-items: flex-start; justify-content: space-between;
  padding: 14px 16px 10px; border-bottom: 1px solid var(--line);
}
.sh-titles { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sh-titles strong { font-size: 15px; line-height: 1.35; word-break: break-word; }
.sh-titles span { font-size: 12px; color: var(--faint); }
.sh-close {
  border: 0; background: var(--side); color: var(--sub); border-radius: 10px;
  font-size: 18px; line-height: 1; width: 30px; height: 30px; cursor: pointer; flex: none;
}
.sheet-body { padding: 12px 16px 4px; overflow: auto; }
.sh-ico { width: 46px; height: 46px; border-radius: 12px; background: var(--side); object-fit: cover; float: left; margin: 0 12px 6px 0; }
.sh-meta { font-size: 11.5px; color: var(--faint); margin-bottom: 8px; }
.sh-brief { margin: 0 0 8px; font-size: 13.5px; line-height: 1.7; color: var(--ink); word-break: break-word; }
.sh-intro { margin: 0; font-size: 12.8px; line-height: 1.7; color: var(--sub); word-break: break-word; }
.sh-note { margin: 8px 0 0; font-size: 11px; color: var(--faint); }
.sh-loading { color: var(--faint); font-size: 12.5px; padding: 10px 0 14px; }
.sheet-foot {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 10px 16px 14px; border-top: 1px solid var(--line); background: var(--bg);
}
.sheet-foot select {
  font: inherit; font-size: 12.5px; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: 7px 8px; flex: 1 1 120px; min-width: 0;
}
.sheet-foot .pk-btn { text-decoration: none; }

@media (max-width: 560px) {
  .sheet-bg { align-items: flex-end; padding: 0; }
  .sheet { width: 100%; max-height: 78vh; border-radius: 18px 18px 0 0; border-bottom: 0; }
}
/* ---------- 无限画布：回正按钮 ---------- */
.board-reset {
  position: absolute; left: 12px; bottom: 12px; z-index: 6;
  font: inherit; font-size: 12px; color: var(--sub); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; cursor: pointer;
}
.board-reset:hover { color: var(--brand-ink); border-color: var(--brand-soft); background: var(--brand-soft); }

/* ---------- AI 助手：右下角小球 + 对话小窗 ---------- */
.ai-fab {
  position: fixed; right: 22px; bottom: 66px; z-index: 60;
  font: inherit; font-size: 13px; font-weight: 700; color: #fff;
  background: var(--brand); border: 0; border-radius: 999px;
  padding: 12px 18px; cursor: pointer; box-shadow: 0 10px 26px rgba(46,160,115,.35);
}
.ai-fab:hover { filter: brightness(1.05); }
.ai-panel {
  position: fixed; right: 22px; bottom: 118px; z-index: 61;
  width: min(400px, calc(100vw - 32px)); height: min(520px, calc(100vh - 150px));
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 18px 50px rgba(30,24,18,.18); overflow: hidden;
}
.ai-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  background: var(--bg); cursor: grab; user-select: none;
}
.ai-head-t { display: flex; flex-direction: column; min-width: 0; }
.ai-head-t strong { font-size: 13.5px; }
.ai-model { font-size: 11px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-x { border: 0; background: transparent; color: var(--faint); font-size: 18px; line-height: 1; cursor: pointer; padding: 2px 4px; }
.ai-x:hover { color: var(--ink); }
.ai-msgs { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.ai-tip { font-size: 12px; color: var(--faint); line-height: 1.7; background: var(--side); border-radius: 12px; padding: 10px 12px; }
.ai-msg { max-width: 88%; border-radius: 14px; padding: 9px 12px; font-size: 13px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.ai-msg.user { align-self: flex-end; background: var(--brand-soft); color: var(--ink); }
.ai-msg.bot { align-self: flex-start; background: var(--side); color: var(--ink); }
.ai-msg.err { align-self: stretch; max-width: 100%; background: var(--warn-bg); color: var(--warn); }
.ai-src { align-self: flex-start; font-size: 11.5px; color: var(--faint); line-height: 1.7; }
.ai-src a { color: var(--brand-ink); text-decoration: none; }
.ai-foot { flex: 0 0 auto; border-top: 1px solid var(--line); padding: 8px 10px 10px; background: var(--bg); }
.ai-web { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--sub); margin-bottom: 6px; }
.ai-web em { color: var(--faint); font-style: normal; font-size: 11px; }
.ai-row { display: flex; gap: 8px; align-items: flex-end; }
.ai-row textarea {
  flex: 1 1 auto; min-width: 0; resize: none; font: inherit; font-size: 13px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: var(--card);
}
.ai-row textarea:focus { outline: 2px solid var(--brand-soft); background: #fff; }
.ai-note { margin: 6px 0 0; font-size: 11px; color: var(--faint); line-height: 1.6; }
@media (max-width: 560px) {
  .ai-fab { right: 14px; bottom: 58px; padding: 10px 15px; }
  .ai-panel { right: 8px; left: 8px; bottom: 108px; width: auto; height: min(62vh, 480px); }
}

/* ============================================================
   视觉升级（2026-10-24c，pack-visual）
   只做「皮肤」：不改任何布局尺寸/坐标/事件语义，pack.js 零改动。
   - 绿色主题令牌 → assets/visual.css 的极光/渐变/呼吸光自动跟随本页品牌色
   - 画布：柔和内发光 + 双层点阵 + 四角光晕（全部 pointer-events:none）
   - 节点：玻璃卡 + 悬浮抬升/光晕 + 拖动中收紧阴影（不闪烁、不改盒子尺寸）
   - 工具栏 / 推荐池 / 状态栏 / 弹层：玻璃质感；AI 小窗：玻璃拟态 + 标题渐变 + 悬浮球呼吸光
   - prefers-reduced-motion 降级；390 宽不产生横向溢出
   ============================================================ */

/* ---------- 0. 本页令牌：把 visual.css 的紫色系令牌覆盖成绿色系 ---------- */
html:root {
  --v-brand: #2ea073;
  --v-brand-soft: #d8efe5;
  --v-brand-a08: rgba(46, 160, 115, .08);
  --v-brand-a14: rgba(46, 160, 115, .14);
  --v-brand-a22: rgba(46, 160, 115, .22);
  --v-brand-a35: rgba(46, 160, 115, .35);
  --v-ink-a06: rgba(35, 32, 29, .06);
  --v-ink-a12: rgba(35, 32, 29, .12);
  --v-line: #e9e6e2;
}
:root {
  --pk-ease: cubic-bezier(.22, .61, .36, 1);
  --pk-grad: linear-gradient(145deg, #38b887, #2ea073 58%, #1f8b5e);
  --pk-glass: rgba(255, 255, 255, .78);
  --pk-glass-strong: rgba(255, 255, 255, .93);
  --pk-line-brand: rgba(46, 160, 115, .16);
  --pk-glow: 0 0 0 4px rgba(46, 160, 115, .14);
  --pk-shadow-card: 0 1px 0 rgba(255, 255, 255, .92) inset,
    0 20px 46px -30px rgba(30, 24, 18, .32),
    0 12px 30px -24px rgba(46, 160, 115, .38);
  --pk-shadow-lift: 0 1px 0 rgba(255, 255, 255, .95) inset,
    0 26px 52px -28px rgba(46, 160, 115, .45),
    0 14px 32px -22px rgba(30, 24, 18, .28);
}

/* visual.js 会给画布/节点自动加 [data-reveal]（带 opacity:0 + translateY）。
   画布元素绝不能带 transform，否则拖拽坐标会偏移；节点也不该先隐身。 */
.board[data-reveal] {
  opacity: 1;
  transform: none;
  transition: none;
}
.node[data-reveal] {
  opacity: 1;
  transform: none;
  transition: box-shadow .2s var(--pk-ease), border-color .2s var(--pk-ease),
    translate .2s var(--pk-ease), background .2s var(--pk-ease);
}
/* 弹层/小窗是「按需出现」的，不能因为 IntersectionObserver 没赶上就隐身 */
.sheet[data-reveal],
.ai-panel[data-reveal] {
  opacity: 1;
  transform: none;
}

/* ---------- 1. 顶栏：玻璃 + 品牌内阴影，标题渐变（.v-grad 来自 visual.css） ---------- */
.pk-top {
  background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(251, 250, 249, .74));
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid var(--pk-line-brand);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .95) inset, 0 12px 32px -26px rgba(46, 160, 115, .6);
}
.pk-title h1 { font-size: 16.5px; font-weight: 800; letter-spacing: .4px; }
.pk-title p { font-size: 12px; color: var(--sub); }

/* ---------- 2. 按钮：玻璃描边 / 主按钮绿色渐变 + 扫光（visual.js 自动加 .v-sheen） ---------- */
.pk-btn {
  border: 1px solid rgba(46, 160, 115, .18);
  background: rgba(255, 255, 255, .8);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 6px 16px -14px rgba(30, 24, 18, .4);
  transition: border-color .18s var(--pk-ease), box-shadow .18s var(--pk-ease),
    background .18s var(--pk-ease), color .18s var(--pk-ease), transform .12s var(--pk-ease);
}
.pk-btn:hover {
  border-color: rgba(46, 160, 115, .38);
  color: var(--brand-ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .95) inset, 0 10px 24px -16px rgba(46, 160, 115, .6);
}
.pk-btn.primary {
  background: var(--pk-grad);
  border-color: rgba(24, 118, 82, .55);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .34) inset, 0 12px 26px -14px rgba(46, 160, 115, .7);
}
.pk-btn.primary:hover { color: #fff; filter: brightness(1.05); }
.pk-btn.ghost {
  background: rgba(255, 255, 255, .42);
  border-color: rgba(46, 160, 115, .14);
  color: var(--sub);
}
.pk-btn.ghost:hover { background: rgba(255, 255, 255, .8); color: var(--brand-ink); }

/* ---------- 3. 第一步：卡片玻璃化 + 输入框聚焦光晕 ---------- */
.s1-card {
  position: relative;
  border: 1px solid rgba(255, 255, 255, .92);
  border-radius: 20px;
  background:
    radial-gradient(120% 90% at 50% -12%, rgba(46, 160, 115, .12), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(255, 255, 255, .74));
  -webkit-backdrop-filter: saturate(1.35) blur(18px);
  backdrop-filter: saturate(1.35) blur(18px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .95) inset,
    0 34px 70px -38px rgba(30, 24, 18, .4),
    0 16px 40px -28px rgba(46, 160, 115, .5);
  padding: 26px;
}
.s1-card h2 { font-size: 20px; letter-spacing: .2px; }
.s1-card h2::after {
  content: "";
  display: block;
  width: 34px;
  height: 3px;
  margin-top: 8px;
  border-radius: 3px;
  background: var(--pk-grad);
  box-shadow: 0 2px 8px -2px rgba(46, 160, 115, .6);
}
.s1-sub { color: var(--sub); }
#idea {
  background: rgba(244, 242, 239, .68);
  border: 1px solid rgba(46, 160, 115, .14);
  border-radius: 14px;
  transition: border-color .2s var(--pk-ease), background .2s var(--pk-ease),
    box-shadow .25s var(--pk-ease);
}
#idea::placeholder { color: var(--faint); }
#idea:focus {
  outline: none;
  border-color: rgba(46, 160, 115, .55);
  background: #fff;
  box-shadow: var(--pk-glow), 0 12px 28px -18px rgba(46, 160, 115, .55);
}
.s1-tip { color: var(--sub); }

/* ---------- 4. 工作台：推荐池玻璃 ---------- */
.pool {
  background: linear-gradient(180deg, rgba(255, 255, 255, .88), rgba(255, 255, 255, .72));
  -webkit-backdrop-filter: saturate(1.35) blur(16px);
  backdrop-filter: saturate(1.35) blur(16px);
  border: 1px solid rgba(255, 255, 255, .92);
  box-shadow: var(--pk-shadow-card);
}
.pool-head {
  border-bottom: 1px solid rgba(46, 160, 115, .13);
  background: rgba(255, 255, 255, .46);
}
.pool-head strong { font-size: 13px; letter-spacing: .2px; }
.pool-head strong::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  vertical-align: 1.5px;
  border-radius: 50%;
  background: var(--pk-grad);
  box-shadow: 0 0 0 3px rgba(46, 160, 115, .12);
}
.pool-count {
  color: var(--brand-ink);
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(46, 160, 115, .1);
  border-radius: 999px;
  padding: 1px 8px;
}
.pool-count:empty { display: none; }
.pool-search input {
  background: rgba(244, 242, 239, .66);
  border: 1px solid rgba(46, 160, 115, .14);
  border-radius: 11px;
  transition: border-color .2s var(--pk-ease), background .2s var(--pk-ease),
    box-shadow .25s var(--pk-ease);
}
.pool-search input:focus {
  outline: none;
  border-color: rgba(46, 160, 115, .55);
  background: #fff;
  box-shadow: var(--pk-glow);
}
.pool-card {
  background: rgba(255, 255, 255, .8);
  border: 1px solid rgba(233, 230, 226, .92);
  border-radius: 13px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .92) inset, 0 4px 12px -10px rgba(30, 24, 18, .4);
  transition: transform .18s var(--pk-ease), box-shadow .18s var(--pk-ease),
    border-color .18s var(--pk-ease), background .18s var(--pk-ease);
}
.pool-card:hover {
  transform: translateY(-2px);
  border-color: rgba(46, 160, 115, .34);
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 12px 24px -16px rgba(46, 160, 115, .6), 0 3px 8px -2px rgba(46, 160, 115, .08);
}
.pool-card.dragging { opacity: .45; }
.pool-ico,
.node.mod .m-ico {
  border: 1px solid rgba(46, 160, 115, .16);
  background: linear-gradient(145deg, var(--brand-soft), #fff);
  box-shadow: 0 2px 6px -4px rgba(46, 160, 115, .55);
}
.pool-title { letter-spacing: .1px; }

/* ---------- 5. 画布：柔和内发光 + 双层点阵 + 四角光晕（不拦截 pointer 事件） ---------- */
.board {
  border: 1px solid rgba(46, 160, 115, .18);
  background:
    radial-gradient(circle at 1px 1px, rgba(46, 160, 115, .2) 1px, transparent 0) 0 0 / 22px 22px,
    radial-gradient(circle at 1px 1px, rgba(35, 32, 29, .045) 1px, transparent 0) 11px 11px / 22px 22px,
    radial-gradient(130% 90% at 50% -24%, rgba(46, 160, 115, .09), transparent 62%),
    linear-gradient(180deg, #ffffff, #fcfdfc);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .9) inset,
    inset 0 0 0 1px rgba(255, 255, 255, .5),
    inset 0 0 70px rgba(46, 160, 115, .07),
    0 30px 64px -38px rgba(30, 24, 18, .36),
    0 14px 34px -26px rgba(46, 160, 115, .5);
}
.board::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(58% 42% at 10% 0%, rgba(46, 160, 115, .1), transparent 62%),
    radial-gradient(46% 38% at 94% 3%, rgba(46, 160, 115, .07), transparent 64%),
    radial-gradient(52% 40% at 50% 102%, rgba(46, 160, 115, .05), transparent 66%);
}
.board.panning { cursor: grabbing; }
.board-hint {
  background: rgba(255, 255, 255, .74);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(46, 160, 115, .16);
  color: var(--sub);
  box-shadow: 0 10px 22px -20px rgba(30, 24, 18, .45);
}
.edges { opacity: .95; }
.edges path {
  stroke: rgba(46, 160, 115, .38);
  stroke-width: 1.6;
  stroke-linecap: round;
}
.trash {
  background: rgba(253, 243, 224, .92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px dashed #e0c9a4;
  color: var(--warn);
  border-radius: 999px;
  box-shadow: 0 10px 22px -20px rgba(30, 24, 18, .4);
  transition: opacity .18s var(--pk-ease), background .18s var(--pk-ease),
    box-shadow .18s var(--pk-ease);
}
.trash.on { opacity: 1; }
.trash.hot { background: #fde8e8; border-color: #e29c9c; color: #a33; box-shadow: 0 12px 26px -18px rgba(163, 51, 51, .55); }
.board-reset {
  background: rgba(255, 255, 255, .8);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(46, 160, 115, .18);
  border-radius: 999px;
  color: var(--sub);
  box-shadow: 0 10px 22px -20px rgba(30, 24, 18, .45);
  transition: color .18s var(--pk-ease), border-color .18s var(--pk-ease),
    background .18s var(--pk-ease), box-shadow .18s var(--pk-ease);
}
.board-reset:hover {
  color: var(--brand-ink);
  border-color: rgba(46, 160, 115, .4);
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 12px 26px -18px rgba(46, 160, 115, .6);
}
.board-reset[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 8;
  padding: 5px 10px;
  border-radius: 9px;
  white-space: nowrap;
  font-size: 11.5px;
  font-weight: 500;
  color: #fff;
  background: rgba(24, 48, 38, .94);
  box-shadow: 0 12px 24px -16px rgba(0, 0, 0, .6);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .18s var(--pk-ease), transform .18s var(--pk-ease);
}
.board-reset:hover::after { opacity: 1; transform: translateY(0); }

/* ---------- 6. 节点：玻璃卡 + 悬浮抬升/光晕 + 拖动中「更亮但不闪」 ---------- */
.node {
  border: 1px solid rgba(233, 230, 226, .95);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(255, 255, 255, .9));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .95) inset, 0 2px 6px rgba(30, 24, 18, .05),
    0 12px 26px -20px rgba(30, 24, 18, .38);
  translate: 0 0;
  transition: box-shadow .2s var(--pk-ease), border-color .2s var(--pk-ease),
    translate .2s var(--pk-ease), background .2s var(--pk-ease);
}
.node:hover {
  translate: 0 -2px;
  border-color: rgba(46, 160, 115, .4);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .95) inset, 0 0 0 4px rgba(46, 160, 115, .1),
    0 18px 34px -22px rgba(46, 160, 115, .55), 0 4px 12px rgba(30, 24, 18, .07);
}
.node.root {
  border: 1px solid rgba(46, 160, 115, .5);
  border-radius: 16px;
  background: linear-gradient(155deg, #f4fcf8, #ffffff 52%, #eefaf4);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .95) inset, 0 0 0 4px rgba(46, 160, 115, .06),
    0 20px 40px -24px rgba(46, 160, 115, .6), 0 4px 14px -8px rgba(30, 24, 18, .18);
}
.node.root::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 0;
  height: 2px;
  border-radius: 0 0 3px 3px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(46, 160, 115, .7), transparent);
}
.node.branch {
  border-color: rgba(46, 160, 115, .3);
  background: linear-gradient(180deg, rgba(255, 255, 255, .99), rgba(247, 252, 249, .95));
}
.node.branch::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(46, 160, 115, .6), rgba(46, 160, 115, .12));
}
.node.branch .n-title { letter-spacing: .1px; }
.node.branch .n-count {
  background: rgba(46, 160, 115, .12);
  color: var(--brand-ink);
  box-shadow: 0 0 0 1px rgba(46, 160, 115, .08) inset;
}
.node.branch.drop-on {
  border-color: var(--brand);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .95) inset, 0 0 0 4px rgba(46, 160, 115, .18),
    0 20px 38px -22px rgba(46, 160, 115, .6);
}
.node.mod .m-title { letter-spacing: .05px; }
.node.root.dragging,
.node.branch.dragging,
.node.mod.dragging {
  opacity: .94;
  z-index: 6;
  border-color: rgba(46, 160, 115, .55);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .95) inset, 0 0 0 5px rgba(46, 160, 115, .16),
    0 26px 48px -22px rgba(46, 160, 115, .6), 0 14px 30px -16px rgba(30, 24, 18, .3);
  transition: box-shadow .16s var(--pk-ease), border-color .16s var(--pk-ease),
    opacity .16s var(--pk-ease);
  will-change: left, top;
}
.node.branch .n-tools { opacity: .6; transition: opacity .18s var(--pk-ease); }
.node.branch:hover .n-tools,
.node.branch.dragging .n-tools { opacity: 1; }
.node.mod .n-x { opacity: .5; transition: opacity .18s var(--pk-ease), color .18s var(--pk-ease); }
.node.mod:hover .n-x { opacity: 1; }
.n-btn {
  background: rgba(244, 242, 239, .9);
  border-radius: 8px;
  transition: background .16s var(--pk-ease), color .16s var(--pk-ease);
}
.n-btn:hover { background: rgba(46, 160, 115, .14); color: var(--brand-ink); }
.n-x { border-radius: 8px; transition: color .16s var(--pk-ease), background .16s var(--pk-ease); }
.n-x:hover { color: #b53; background: rgba(181, 51, 51, .08); }

/* ---------- 7. 状态栏 / toast ---------- */
.statusbar {
  background: linear-gradient(180deg, rgba(255, 255, 255, .8), rgba(251, 250, 249, .92));
  -webkit-backdrop-filter: saturate(1.3) blur(14px);
  backdrop-filter: saturate(1.3) blur(14px);
  border-top: 1px solid rgba(46, 160, 115, .14);
  box-shadow: 0 -1px 0 rgba(255, 255, 255, .9) inset;
  color: var(--sub);
}
.statusbar > span {
  background: rgba(255, 255, 255, .66);
  border: 1px solid rgba(46, 160, 115, .12);
  border-radius: 999px;
  padding: 2px 10px;
  line-height: 1.5;
}
.statusbar > span:empty { display: none; }
.statusbar > span.warn {
  background: var(--warn-bg);
  border-color: #f0dcb6;
  color: var(--warn);
}
.toast {
  background: linear-gradient(180deg, rgba(30, 58, 46, .97), rgba(22, 48, 38, .97));
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 18px 40px -20px rgba(20, 40, 32, .7), 0 0 0 1px rgba(46, 160, 115, .2) inset;
  letter-spacing: .2px;
}

/* ---------- 8. 模组简介弹层：玻璃 + 渐变头 ---------- */
.sheet-bg {
  background: rgba(22, 30, 26, .44);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.sheet {
  background: linear-gradient(180deg, rgba(255, 255, 255, .97), rgba(252, 255, 253, .93));
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 30px 80px -34px rgba(20, 34, 27, .55), 0 1px 0 rgba(255, 255, 255, .95) inset;
}
.sheet-head {
  background: linear-gradient(120deg, rgba(46, 160, 115, .16), rgba(46, 160, 115, .04) 62%, transparent);
  border-bottom: 1px solid rgba(46, 160, 115, .14);
}
.sh-close {
  background: rgba(255, 255, 255, .7);
  transition: background .18s var(--pk-ease), color .18s var(--pk-ease);
}
.sh-close:hover { background: #fff; color: var(--ink); }
.sheet-foot { background: rgba(251, 250, 249, .8); border-top: 1px solid rgba(46, 160, 115, .12); }
.sheet-foot select:focus,
.sheet-foot select:focus-visible {
  outline: none;
  border-color: rgba(46, 160, 115, .5);
  box-shadow: var(--pk-glow);
}

/* ---------- 9. AI 助手：悬浮球呼吸光 + 玻璃拟态小窗 + 标题渐变 ---------- */
.ai-fab {
  background: var(--pk-grad);
  border: 1px solid rgba(255, 255, 255, .22);
  box-shadow: 0 12px 28px -10px rgba(46, 160, 115, .6), 0 1px 0 rgba(255, 255, 255, .28) inset;
  letter-spacing: .3px;
  transition: transform .2s var(--pk-ease), box-shadow .25s var(--pk-ease), filter .2s var(--pk-ease);
}
.ai-fab:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 18px 34px -12px rgba(46, 160, 115, .68), 0 1px 0 rgba(255, 255, 255, .3) inset;
}
.ai-fab::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: 0 0 0 0 rgba(46, 160, 115, .45);
  animation: pk-ai-breathe 2.8s var(--pk-ease) infinite;
}
@keyframes pk-ai-breathe {
  0% { box-shadow: 0 0 0 0 rgba(46, 160, 115, .45); opacity: .9; }
  70% { box-shadow: 0 0 0 16px rgba(46, 160, 115, 0); opacity: 0; }
  100% { box-shadow: 0 0 0 0 rgba(46, 160, 115, 0); opacity: 0; }
}
.ai-panel {
  border: 1px solid rgba(255, 255, 255, .92);
  border-radius: 20px;
  background:
    radial-gradient(120% 60% at 18% -4%, rgba(46, 160, 115, .12), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(250, 255, 252, .88));
  -webkit-backdrop-filter: saturate(1.4) blur(22px);
  backdrop-filter: saturate(1.4) blur(22px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .95) inset,
    0 34px 76px -34px rgba(30, 24, 18, .45),
    0 14px 34px -24px rgba(46, 160, 115, .55);
  animation: pk-ai-pop .28s var(--pk-ease) both;
}
@keyframes pk-ai-pop {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: none; }
}
.ai-head {
  background: linear-gradient(120deg, rgba(46, 160, 115, .2), rgba(46, 160, 115, .06) 58%, rgba(46, 160, 115, .02));
  border-bottom: 1px solid rgba(46, 160, 115, .16);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset;
}
.ai-head-t strong {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: .2px;
  background: linear-gradient(100deg, #17694a, #2ea073 55%, #1d7a56);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ai-model { color: var(--sub); }
.ai-x {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, .6);
  transition: background .16s var(--pk-ease), color .16s var(--pk-ease);
}
.ai-x:hover { background: #fff; color: var(--ink); }
.ai-msgs { background: transparent; }
.ai-tip {
  background: rgba(46, 160, 115, .06);
  border: 1px solid rgba(46, 160, 115, .12);
  border-radius: 14px;
  color: var(--sub);
}
.ai-msg {
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 9px 13px;
  box-shadow: 0 8px 18px -16px rgba(30, 24, 18, .5);
}
.ai-msg.user {
  background: linear-gradient(145deg, #37b385, #2ea073 70%, #279365);
  border-color: rgba(255, 255, 255, .24);
  color: #fff;
  border-bottom-right-radius: 6px;
  box-shadow: 0 12px 24px -16px rgba(46, 160, 115, .75);
}
.ai-msg.bot {
  background: rgba(255, 255, 255, .92);
  border-color: rgba(46, 160, 115, .14);
  color: var(--ink);
  border-bottom-left-radius: 6px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 8px 20px -18px rgba(30, 24, 18, .5);
}
.ai-msg.err {
  background: var(--warn-bg);
  border-color: #f0dcb6;
  color: var(--warn);
  border-radius: 14px;
}
.ai-src {
  background: rgba(46, 160, 115, .06);
  border: 1px solid rgba(46, 160, 115, .1);
  border-radius: 10px;
  padding: 6px 10px;
  color: var(--sub);
}
.ai-src a { color: var(--brand-ink); text-decoration: none; }
.ai-src a:hover { text-decoration: underline; }
.ai-foot {
  background: rgba(255, 255, 255, .58);
  border-top: 1px solid rgba(46, 160, 115, .14);
}
.ai-web input { accent-color: var(--brand); }
.ai-row textarea {
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(46, 160, 115, .16);
  border-radius: 14px;
  transition: border-color .2s var(--pk-ease), background .2s var(--pk-ease),
    box-shadow .25s var(--pk-ease);
}
.ai-row textarea:focus {
  outline: none;
  border-color: rgba(46, 160, 115, .55);
  background: #fff;
  box-shadow: var(--pk-glow);
}
.ai-note { color: var(--sub); }
.ai-panel .pk-btn.primary { flex: none; }

/* ---------- 10. 手机端：减模糊，保证滚动/拖拽流畅；不产生横向溢出 ---------- */
@media (max-width: 700px) {
  .pk-top,
  .pool,
  .s1-card,
  .ai-panel {
    -webkit-backdrop-filter: saturate(1.25) blur(12px);
    backdrop-filter: saturate(1.25) blur(12px);
  }
  .board {
    background:
      radial-gradient(circle at 1px 1px, rgba(46, 160, 115, .18) 1px, transparent 0) 0 0 / 20px 20px,
      radial-gradient(120% 80% at 50% -20%, rgba(46, 160, 115, .08), transparent 62%),
      linear-gradient(180deg, #ffffff, #fcfdfc);
  }
  .node:hover { translate: 0 0; }
  .pool-card:hover { transform: none; }
  .board-reset[data-tip]::after { display: none; }
}
@media (max-width: 480px) {
  .statusbar { gap: 8px; padding: 8px 10px; }
  .statusbar > span { padding: 1px 8px; }
  .ai-msg { max-width: 92%; }
  .s1-card { padding: 16px; }
  .s1-card h2 { font-size: 18px; }
}

/* ---------- 11. 减弱动效：呼吸光/入场/抬升全部降级为静态 ---------- */
@media (prefers-reduced-motion: reduce) {
  .ai-fab::after { animation: none; opacity: 0; }
  .ai-panel { animation: none; }
  .pk-title h1.v-grad { animation: none; background-position: 50% 50%; }
  .node,
  .pool-card,
  .pk-btn,
  .ai-fab,
  .board-reset,
  .ai-x,
  .trash,
  #idea,
  .pool-search input,
  .ai-row textarea {
    transition: none;
  }
  .node:hover,
  .node.root:hover,
  .node.branch:hover,
  .node.mod:hover { translate: 0 0; }
  .pool-card:hover { transform: none; }
  .ai-fab:hover { transform: none; }
  .board-reset:hover::after { transition: none; }
}