:root {
  --bg: #070b12;
  --bg2: #0b111b;
  --card: rgba(19, 27, 40, 0.94);
  --card-hi: rgba(26, 37, 55, 0.92);
  --line: rgba(120, 150, 190, 0.16);
  --line-hi: rgba(120, 170, 230, 0.35);
  --text: #e6edf6;
  --muted: #8392a7;
  --dim: #5a677a;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --hot: #ff6a2b;
  --cyan: #38bdf8;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: "PingFang SC", "HarmonyOS Sans SC", "Noto Sans SC", -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; }
body {
  height: 100vh; display: flex; flex-direction: column; overflow: hidden;
  background:
    radial-gradient(1200px 500px at 50% -120px, rgba(56, 189, 248, 0.10), transparent 70%),
    radial-gradient(900px 400px at 50% 280px, rgba(255, 106, 43, 0.05), transparent 70%),
    radial-gradient(rgba(255,255,255,0.035) 1px, transparent 1px) 0 0 / 22px 22px,
    var(--bg);
}
a { color: inherit; text-decoration: none; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); font-size: 12px; }
.grow { flex: 1; min-width: 0; }
.link:hover { color: var(--text); text-decoration: underline; }

/* ───── 顶栏 ───── */
.topbar {
  position: relative; z-index: 20; flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 28px; background: rgba(7, 11, 18, 0.86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--hot); box-shadow: 0 0 12px var(--hot); }
.brand-name { font-weight: 700; letter-spacing: 0.22em; font-size: 15px; }
.brand-sub { color: var(--muted); font-size: 12px; margin-top: 1px; }
.top-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.sep { width: 1px; height: 18px; background: var(--line); }
.pill { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 13px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.warn { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.dot.bad { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.dot.idle { background: #4b5563; }
.btn {
  font: inherit; font-size: 13px; color: var(--text); cursor: pointer;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line-hi); border-radius: 8px; padding: 6px 12px;
}
.btn:hover { background: rgba(255,255,255,0.08); }
.btn.accent { border-color: rgba(255,106,43,0.6); color: #ffd2bf; }
.banner { flex: none; margin: 12px 28px 0; padding: 10px 14px; border-radius: 10px; border: 1px solid rgba(248,113,113,0.5); background: rgba(248,113,113,0.08); color: #fecaca; }

/* ───── 无限画布 ───── */
.card {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 16px;   box-shadow: 0 10px 30px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.card[data-node]:hover { border-color: var(--line-hi); cursor: pointer; }
.title { font-size: 16px; font-weight: 600; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sub { color: var(--muted); font-size: 13px; margin-top: 3px; }

.founder { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.avatar {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 20px;
  background: radial-gradient(circle at 35% 30%, #ff9a5a, #ff5a1f 60%, #c2410c); box-shadow: 0 0 22px rgba(255,106,43,0.55);
}
.badge-hot {
  font-weight: 600; font-size: 14px; padding: 7px 12px; border-radius: 8px; white-space: nowrap;
  background: var(--hot); color: #fff; box-shadow: 0 0 18px rgba(255,106,43,0.55);
}
.badge-hot.zero { background: rgba(255,255,255,0.06); color: var(--muted); box-shadow: none; }

.ceo { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-color: rgba(56,189,248,0.45);
  box-shadow: 0 0 0 1px rgba(56,189,248,0.12), 0 0 40px rgba(56,189,248,0.12), 0 10px 30px rgba(0,0,0,0.4); }
.radar { width: 62px; height: 62px; border-radius: 50%; flex: none; position: relative; overflow: hidden;
  border: 1px solid rgba(56,189,248,0.45);
  background: repeating-radial-gradient(circle, transparent 0 9px, rgba(56,189,248,0.18) 9px 10px); }
.radar span { position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(56,189,248,0.55), transparent 70deg); animation: spin 6s linear infinite; }
.radar.busy span { animation-duration: 1.6s; }
@keyframes spin { to { transform: rotate(360deg); } }
.headline { margin-top: 6px; color: var(--cyan); font-size: 13px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.project { --c: var(--cyan); border-color: color-mix(in srgb, var(--c) 35%, transparent); }
.project:hover { box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent), 0 0 30px color-mix(in srgb, var(--c) 18%, transparent); }
.project .name { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.project .name .glyph { color: var(--c); }
.tag { font-size: 11px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line-hi); color: var(--muted); font-weight: 400; }
.tag.manual { border-color: rgba(251,191,36,0.4); color: #fcd34d; }
.tag.stale { border-color: rgba(248,113,113,0.5); color: #fca5a5; }
.metric { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 2px; flex-wrap: wrap; }
.metric .num { font-size: 30px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.metric .num.empty { color: var(--dim); }
.metric .lbl { color: var(--muted); font-size: 13px; }
.secondary { color: var(--muted); font-size: 12px; display: flex; gap: 12px; flex-wrap: wrap; min-height: 16px; }
.secondary b { color: var(--text); font-weight: 600; font-family: var(--mono); }
.meta { margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--line); color: var(--muted); font-family: var(--mono); font-size: 12px; line-height: 1.7; }
.meta .who { font-family: var(--sans); color: var(--text); }
.meta .warn { color: var(--warn); }
.project.pending { border-style: dashed; border-color: rgba(148,163,184,0.35); background: rgba(19,27,40,0.5); }
.verdict { margin-top: 10px; font-size: 13px; line-height: 1.5; color: #cbd5e1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.verdict-badge { font-size: 26px; font-weight: 700; color: var(--ok); }
.verdict-badge.no { color: var(--bad); } .verdict-badge.maybe { color: var(--warn); }

.subitems { position: relative; margin: 0 0 0 18px; padding: 10px 0 0 16px; border-left: 2px solid color-mix(in srgb, var(--c, var(--cyan)) 45%, transparent); }
.subitem { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 7px 10px; margin-bottom: 7px; border-radius: 10px; background: rgba(19,27,40,0.65); border: 1px solid var(--line); }
.subitem::before { content: ""; position: absolute; left: -17px; top: 50%; width: 16px; height: 2px; background: color-mix(in srgb, var(--c, var(--cyan)) 45%, transparent); }
.subitem .n { font-size: 13px; } .subitem .l { color: var(--muted); font-size: 11px; }
.subitem .v { font-family: var(--mono); font-size: 14px; font-weight: 600; text-align: right; }
.subitem .v.empty { color: var(--dim); font-weight: 400; }

.section-title { font-weight: 600; font-size: 15px; letter-spacing: 0.02em; }
.shared { padding: 12px 14px; }
.shared .duty { color: var(--muted); font-size: 12px; margin-top: 4px; min-height: 17px; }
.shared .stats { display: flex; gap: 14px; margin-top: 8px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.shared .stats b { color: var(--text); font-size: 15px; }

/* ───── 面板节点 ───── */
.panel { padding: 16px 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.tab { font: inherit; font-size: 12px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; cursor: pointer; }
.tab.on { color: var(--text); border-color: rgba(255,106,43,0.6); background: rgba(255,106,43,0.08); }
.todo-list { max-height: 380px; overflow: auto; list-style: none; margin: 0; padding: 0; }
.todo-list li { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); }
.todo-list li:last-child { border-bottom: 0; }
.todo-list .st { flex: none; font-size: 11px; padding: 3px 7px; border-radius: 6px; border: 1px solid var(--line-hi); color: var(--muted); min-width: 64px; text-align: center; }
.st.decide { color: #ffb08c; border-color: rgba(255,106,43,0.6); background: rgba(255,106,43,0.08); }
.st.blocked { color: #fca5a5; border-color: rgba(248,113,113,0.5); }
.st.active { color: #7dd3fc; border-color: rgba(56,189,248,0.5); }
.st.done { color: #6ee7b7; border-color: rgba(52,211,153,0.35); }
.todo-list .t { flex: 1; min-width: 0; }
.todo-list .t .main { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo-list .t .sub2 { color: var(--muted); font-size: 12px; font-family: var(--mono); margin-top: 3px; }
.todo-list .when { color: var(--muted); font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.empty-note { color: var(--muted); padding: 14px 4px; }
.report { user-select: text; white-space: pre-wrap; line-height: 1.65; font-size: 13px; color: #cbd5e1; max-height: 340px; overflow: auto; }
.report strong { color: var(--text); }
.runs { display: flex; align-items: flex-end; gap: 5px; height: 110px; padding-top: 6px; }
.runs .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.runs .bar { width: 100%; max-width: 22px; display: flex; flex-direction: column-reverse; border-radius: 4px 4px 0 0; overflow: hidden; min-height: 2px; background: rgba(255,255,255,0.05); }
.runs .bar i { display: block; }
.runs .d { font-family: var(--mono); font-size: 10px; color: var(--dim); }
.runs .col.today .d { color: var(--hot); }
.sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.sw.ok, .runs i.ok { background: #34d399; } .sw.bad, .runs i.bad { background: #f87171; } .sw.other, .runs i.other { background: #64748b; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 12px; margin-top: 8px; }

/* ───── 本月 Token 消耗 ───── */
.tok-list { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow: auto; }
.tok-list li { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 2px 11px 4px; border-bottom: 1px solid var(--line); }
.tok-list li:last-child { border-bottom: 0; }
.tok-list .t { flex: 1; min-width: 0; }
.tok-list .main { font-size: 13px; }
.tok-list .sub2 { color: var(--muted); font-family: var(--mono); font-size: 11px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tok-list .sub2 .dim { color: var(--dim); }
.tok-right { flex: none; text-align: right; }
.tok-total { font-family: var(--mono); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tok-cost { color: var(--warn); font-family: var(--mono); font-size: 11px; margin-top: 2px; }
.tok-bar { position: absolute; left: 0; bottom: -1px; height: 2px; width: var(--p, 0%); border-radius: 2px;
  background: linear-gradient(to right, rgba(255,106,43,0.75), rgba(255,170,90,0.35)); }

/* ───── 悬停详情 ───── */
.popover { position: fixed; z-index: 40; width: 340px; max-width: calc(100vw - 32px); padding: 14px 16px; border-radius: 14px;
  background: rgba(11, 17, 27, 0.97); border: 1px solid var(--line-hi); box-shadow: 0 20px 50px rgba(0,0,0,0.6); font-size: 13px; line-height: 1.6; }
.popover h4 { margin: 0 0 8px; font-size: 15px; display: flex; justify-content: space-between; align-items: center; }
.popover .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 8px 0; }
.popover .k { color: var(--muted); font-size: 12px; } .popover .v { font-family: var(--mono); font-size: 15px; }
.popover .desc { color: #cbd5e1; margin-top: 8px; }
.popover .go { display: inline-block; margin-top: 10px; color: var(--cyan); }

/* ───── 手填表单 ───── */
dialog { background: #0d1420; color: var(--text); border: 1px solid var(--line-hi); border-radius: 16px; padding: 0; width: min(640px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0,0,0,0.6); backdrop-filter: blur(3px); }
#edit-form { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; max-height: 85vh; }
.dialog-head { display: flex; flex-direction: column; gap: 4px; }
#edit-fields { overflow: auto; display: flex; flex-direction: column; gap: 14px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 12px; margin: 0; }
legend { padding: 0 6px; font-weight: 600; }
.field { display: grid; grid-template-columns: 1fr 160px; align-items: center; gap: 10px; margin-top: 8px; }
.field label { color: #cbd5e1; font-size: 13px; }
.field input { font: inherit; font-family: var(--mono); color: var(--text); background: rgba(255,255,255,0.04); border: 1px solid var(--line-hi); border-radius: 8px; padding: 6px 9px; width: 100%; }
.field input:focus { outline: none; border-color: var(--cyan); }
.dialog-foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.dialog-foot .muted { margin-right: auto; }

/* ───── 画布 ───── */
.viewport {
  position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: none; cursor: grab; user-select: none;
  background-image: radial-gradient(rgba(255,255,255,0.09) 1px, transparent 1.3px); background-size: 24px 24px;
}
.viewport.panning { cursor: grabbing; }
.viewport.linking, .viewport.linking .node { cursor: crosshair; }
.world { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; }
.world.view-anim { transition: transform .4s cubic-bezier(.2,.8,.2,1); }
.world.animating .node { transition: left .55s cubic-bezier(.2,.8,.2,1), top .55s cubic-bezier(.2,.8,.2,1); }
.wires { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.wires .hit { pointer-events: stroke; cursor: pointer; }
.node { position: absolute; cursor: grab; }

/* ───── 工具模式：抓手 / 箭头（框选） ───── */
.tool-toggle { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 11px; }
.tool-toggle .btn { border: 0; background: transparent; padding: 3px 9px; }
.tool-toggle .btn.on { background: rgba(56,189,248,0.16); color: var(--text); }
.viewport[data-tool="select"] { cursor: default; }
.viewport[data-tool="select"] .node { cursor: move; }
.viewport[data-tool="select"].marqueeing { cursor: crosshair; }
.viewport[data-tool="pan"].panning { cursor: grabbing; }
.viewport[data-tool="pan"] .node.dragging { cursor: grabbing; }
.marquee { position: absolute; border: 1px solid rgba(56,189,248,0.9); background: rgba(56,189,248,0.13); border-radius: 3px; pointer-events: none; z-index: 5; box-shadow: 0 0 18px rgba(56,189,248,0.25); }
.node.selected > .node-body > .card { box-shadow: 0 0 0 2px rgba(56,189,248,0.9), 0 10px 30px rgba(0,0,0,0.35); }
.node.dragging { cursor: grabbing; z-index: 9999 !important; }
.node.dragging .card { box-shadow: 0 24px 60px rgba(0,0,0,0.65); }
.node-x {
  position: absolute; top: -10px; right: -10px; width: 22px; height: 22px; padding: 0; border-radius: 50%; z-index: 3;
  border: 1px solid var(--line-hi); background: #0d1420; color: var(--muted); font-size: 14px; line-height: 1; cursor: pointer; opacity: 0;
}
.node:hover .node-x { opacity: 1; }
.node-x:hover { color: var(--text); border-color: var(--hot); }
.w-founder { width: 440px; } .w-ceo { width: 560px; } .w-project { width: 290px; } .w-agent { width: 230px; }
.w-label { width: 300px; } .w-panel { width: 540px; }
.node-body > .card { width: 100%; }
.card.label { padding: 12px 14px; border-style: dashed; background: rgba(19,27,40,0.6); }
.card.label .muted { margin-top: 3px; }
.node-body .subitems { margin-top: 0; }

.chip {
  position: absolute; z-index: 1; pointer-events: none; white-space: nowrap;
  font-family: var(--mono); font-size: 12px; line-height: 1.55; padding: 6px 10px; border-radius: 8px;
  background: rgba(7, 11, 18, 0.92); border: 1px solid var(--line);
}
.chip b { font-weight: 600; }
.chip .down { color: var(--cyan); }
.chip .up { color: var(--muted); }
.chip.warm .down { color: #ff8a5c; }
.chip.cool .up, .chip.cool .up b { color: var(--cyan); }
.chip .faint { color: var(--muted); }
.chip[hidden] { display: none; }

.note { width: max-content; min-width: 240px; }
.note .node-body { background: rgba(251,191,36,0.09); border: 1px solid rgba(251,191,36,0.4); border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.35); }
.note-bar { display: flex; justify-content: space-between; align-items: center; padding: 5px 6px 5px 12px; color: #fcd34d; font-size: 12px; background: rgba(251,191,36,0.08); }
.note-actions { display: flex; gap: 4px; }
.note-actions button { font: inherit; font-size: 12px; color: #fcd34d; background: transparent; border: 0; border-radius: 6px; padding: 2px 7px; cursor: pointer; }
.note-actions button:hover { background: rgba(251,191,36,0.18); }
.note textarea {
  display: block; width: 240px; height: 110px; min-width: 200px; min-height: 70px; resize: both; margin: 0; padding: 9px 12px; border: 0; outline: 0;
  background: transparent; color: var(--text); font: inherit; font-size: 13px; line-height: 1.6; user-select: text; cursor: text;
}

.toolbar {
  position: absolute; left: 16px; bottom: 16px; z-index: 30; display: flex; align-items: center; gap: 6px; padding: 6px;
  background: rgba(11, 17, 27, 0.94); border: 1px solid var(--line-hi); border-radius: 12px; cursor: default;
}
.toolbar .btn { padding: 5px 10px; }
.toolbar .sep { margin: 0 2px; }
.zoom-label { min-width: 42px; text-align: center; font-size: 12px; color: var(--muted); }
.menu {
  position: absolute; left: 0; bottom: calc(100% + 8px); min-width: 210px; padding: 6px; display: flex; flex-direction: column; gap: 2px;
  background: #0d1420; border: 1px solid var(--line-hi); border-radius: 12px; box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}
.menu[hidden] { display: none; }
.menu button { font: inherit; font-size: 13px; text-align: left; color: var(--text); background: transparent; border: 0; border-radius: 8px; padding: 7px 10px; cursor: pointer; }
.menu button:hover { background: rgba(255,255,255,0.07); }
.menu-sep { color: var(--dim); font-size: 11px; padding: 6px 10px 2px; }
.hint { position: absolute; right: 16px; bottom: 158px; text-align: right; max-width: 200px; line-height: 1.5; color: var(--dim); font-size: 12px; pointer-events: none; }
.toast {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 30; padding: 8px 14px; border-radius: 10px; font-size: 13px;
  background: rgba(11, 17, 27, 0.96); border: 1px solid var(--line-hi); pointer-events: none;
}
.toast[hidden] { display: none; }

@media (max-width: 640px) {
  .minimap { display: none; }
  .topbar { padding: 10px 16px; flex-direction: column; align-items: flex-start; gap: 8px; }
  .hint { display: none; }
  .toolbar { left: 8px; right: 8px; bottom: 8px; flex-wrap: wrap; }
  .field { grid-template-columns: 1fr 120px; }
}

/* ───── 异常、撤销、危险按钮 ───── */
.btn.danger { border-color: rgba(248,113,113,0.5); color: #fca5a5; margin-right: auto; }
.btn[disabled] { opacity: 0.35; cursor: default; }
.alert-pill { font: inherit; font-family: var(--mono); font-size: 13px; cursor: pointer; color: #fecaca; background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.5); border-radius: 8px; padding: 4px 10px; }
.alert-pill[hidden] { display: none; }
.node.alert > .node-body > .card { border-color: rgba(248,113,113,0.75); box-shadow: 0 0 0 1px rgba(248,113,113,0.25), 0 0 26px rgba(248,113,113,0.22), 0 10px 30px rgba(0,0,0,0.35); animation: alertpulse 2.4s ease-in-out infinite; }
@keyframes alertpulse { 50% { box-shadow: 0 0 0 1px rgba(248,113,113,0.4), 0 0 40px rgba(248,113,113,0.38), 0 10px 30px rgba(0,0,0,0.35); } }
.alert-note { margin-top: 8px; color: #fca5a5; font-size: 12px; }
.node-edit { position: absolute; top: -10px; right: -10px; width: 22px; height: 22px; padding: 0; border-radius: 50%; z-index: 3; border: 1px solid var(--line-hi); background: #0d1420; color: var(--muted); font-size: 12px; line-height: 1; cursor: pointer; opacity: 0; }
.node:hover .node-edit { opacity: 1; }
.node-edit:hover { color: var(--text); border-color: var(--cyan); }

/* ───── 外部站点 ───── */
.w-site { width: 220px; }
.card.site { padding: 12px 14px; cursor: pointer; }
.site-head { display: flex; align-items: center; gap: 10px; }
.site-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; flex: none; background: rgba(56,189,248,0.1); border: 1px solid rgba(56,189,248,0.3); }
.site-name { font-weight: 600; font-size: 14px; }
.site-url { color: var(--muted); font-family: var(--mono); font-size: 11px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.site .dot { margin-left: auto; }
.site .site-note { margin-top: 8px; color: var(--muted); font-size: 12px; }
.card.site:hover { border-color: rgba(56,189,248,0.6); }

/* ───── 内嵌页面（iframe） ───── */
.w-embed .node-body { width: 100%; height: 100%; }
.card.embed { width: 100%; height: 100%; padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.embed-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); flex: none; }
.embed-head .site-ic { width: 26px; height: 26px; font-size: 15px; border-radius: 8px; }
.embed-head .site-url { max-width: 300px; }
.embed-open { flex: none; color: var(--muted); text-decoration: none; font-size: 13px; padding: 3px 8px; border-radius: 7px; border: 1px solid var(--line); }
.embed-open:hover { color: var(--text); border-color: var(--line-hi); }
.embed-frame { position: relative; flex: 1; min-height: 0; }
.embed-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.card.embed .group-resize { z-index: 2; }

/* ───── Obsidian 小星球 ───── */
.w-planet { width: 190px; }
.planet { background: none; border: 0; box-shadow: none; padding: 0; text-align: center; cursor: pointer; }
.planet-wrap { position: relative; width: 190px; height: 140px; margin: 0 auto; }
.globe { position: absolute; inset: 27px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; color: #ede9fe;
  background: radial-gradient(circle at 32% 28%, #c4b5fd, #7c3aed 55%, #3b0764); box-shadow: 0 0 34px rgba(124,58,237,0.55), inset -10px -12px 22px rgba(0,0,0,0.45); }
.ring { position: absolute; left: -6px; right: -6px; top: 52px; bottom: 52px; border-radius: 50%; border: 2px solid rgba(196,181,253,0.55); transform: rotate(-18deg); box-shadow: 0 0 14px rgba(167,139,250,0.35); }
.orbit { position: absolute; inset: 4px; border-radius: 50%; animation: spin 9s linear infinite; }
.moon { position: absolute; left: 50%; top: -2px; width: 11px; height: 11px; margin-left: -5px; border-radius: 50%; background: #fde68a; box-shadow: 0 0 10px #fbbf24; }
.planet:hover .globe { box-shadow: 0 0 48px rgba(167,139,250,0.8), inset -10px -12px 22px rgba(0,0,0,0.45); }
.planet-name { margin-top: 2px; font-weight: 600; font-size: 14px; }
.planet-sub { color: var(--muted); font-size: 12px; font-family: var(--mono); }

/* ───── 分组框 ───── */
#groups { position: absolute; left: 0; top: 0; }
.node.group { cursor: default; }
.group-frame { position: relative; width: 100%; height: 100%; border-radius: 18px; pointer-events: none;
  border: 1.5px dashed color-mix(in srgb, var(--g, #38bdf8) 55%, transparent); background: color-mix(in srgb, var(--g, #38bdf8) 6%, transparent); }
.group-title { position: absolute; left: 12px; top: -13px; max-width: calc(100% - 40px); padding: 3px 12px; border-radius: 999px; pointer-events: auto; cursor: grab;
  font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--g, #38bdf8);
  background: #0a1019; border: 1px solid color-mix(in srgb, var(--g, #38bdf8) 55%, transparent); }
.group-resize { position: absolute; right: 2px; bottom: 2px; width: 18px; height: 18px; pointer-events: auto; cursor: nwse-resize; opacity: 0.6;
  background: linear-gradient(135deg, transparent 50%, var(--g, #38bdf8) 50% 58%, transparent 58% 72%, var(--g, #38bdf8) 72% 80%, transparent 80%); }
.group-resize:hover { opacity: 1; }

/* ───── 吸附辅助线 ───── */
.guide { stroke: #f472b6; stroke-width: 1; stroke-dasharray: 4 4; opacity: 0.8; }

/* ───── 小地图 ───── */
.minimap { position: absolute; right: 16px; bottom: 16px; z-index: 30; width: 200px; height: 130px; border-radius: 12px; overflow: hidden; cursor: pointer;
  background: rgba(11,17,27,0.94); border: 1px solid var(--line-hi); }
.minimap svg { display: block; }
.mm-node { fill: rgba(148,163,184,0.5); }
.mm-node.hot { fill: #f87171; } .mm-node.site { fill: #38bdf8; } .mm-node.planet { fill: #a78bfa; } .mm-node.note { fill: #fbbf24; }
.mm-group { fill: none; stroke: rgba(148,163,184,0.4); stroke-dasharray: 3 3; }
.mm-view { fill: rgba(255,106,43,0.08); stroke: #ff6a2b; stroke-width: 1.5; }

/* ───── 搜索 ───── */
.search { position: absolute; inset: 0; z-index: 60; display: grid; justify-items: center; align-content: start; padding-top: 12vh; background: rgba(0,0,0,0.45); backdrop-filter: blur(2px); }
.search[hidden] { display: none; }
.search-box { width: min(520px, calc(100vw - 32px)); background: #0d1420; border: 1px solid var(--line-hi); border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,0.6); overflow: hidden; }
.search-box input { width: 100%; font: inherit; font-size: 15px; color: var(--text); background: transparent; border: 0; outline: 0; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.search-list { max-height: 50vh; overflow: auto; padding: 6px; }
.search-item { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.search-item.on, .search-item:hover { background: rgba(255,255,255,0.07); }
.search-item .k { color: var(--muted); font-size: 12px; font-family: var(--mono); flex: none; }
.search-item .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-empty { color: var(--muted); padding: 14px 10px; }

/* ───── 趋势小图 ───── */
.spark { display: flex; align-items: center; gap: 8px; margin-top: 2px; color: var(--muted); font-size: 12px; font-family: var(--mono); }
.spark svg { flex: none; }
.spark .up { color: var(--ok); } .spark .down { color: var(--bad); }

/* ───── 节点编辑弹窗 ───── */
#node-form { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
#node-fields { display: flex; flex-direction: column; gap: 10px; }
.nfield { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 10px; }
.nfield label { color: #cbd5e1; font-size: 13px; }
.nfield input[type=text], .nfield select { font: inherit; color: var(--text); background: rgba(255,255,255,0.04); border: 1px solid var(--line-hi); border-radius: 8px; padding: 7px 10px; width: 100%; }
.nfield input[type=number] { font: inherit; color: var(--text); background: rgba(255,255,255,0.04); border: 1px solid var(--line-hi); border-radius: 8px; padding: 7px 8px; width: 90px; }
.nfield input[type=color] { width: 44px; height: 30px; padding: 0; border: 1px solid var(--line-hi); border-radius: 8px; background: transparent; }
.nfield input:focus, .nfield select:focus { outline: none; border-color: var(--cyan); }
.nfield .hint2 { grid-column: 2; color: var(--muted); font-size: 12px; margin-top: -4px; }
.nfield select option { background: #0d1420; }
.node.group { pointer-events: none; }
.node.group .group-title, .node.group .group-resize, .node.group .node-edit { pointer-events: auto; }
.node.group .node-body { width: 100%; height: 100%; }

/* ───── 插画（mowa-media 生成） ───── */
.portrait { position: relative; flex: none; border-radius: 50%; }
.portrait img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
/* 头像外圈的旋转装饰环（SVG） */
.pring { position: absolute; inset: -9px; pointer-events: none; overflow: visible; }
.founder-p .r1 { animation: spin 15s linear infinite; }
.founder-p .r2 { animation: spin 24s linear infinite reverse; }
.ceo-p .c1 { animation: spin 11s linear infinite; }
.ceo-p .c2 { animation: spin 19s linear infinite reverse; }
.founder-p { width: 84px; height: 84px; padding: 3px; background: radial-gradient(circle at 50% 38%, rgba(255,154,90,0.4), rgba(255,90,31,0.16) 62%, transparent); box-shadow: 0 0 30px rgba(255,106,43,0.5); }
.founder-p img { border: 2px solid #0b111b; }
.ceo-p { width: 100px; height: 100px; padding: 3px; background: radial-gradient(circle at 50% 38%, rgba(56,189,248,0.4), rgba(14,165,233,0.14) 62%, transparent); box-shadow: 0 0 34px rgba(56,189,248,0.4); }
.ceo-p img { border: 2px solid #0b111b; }
.ceo-p .sweep { position: absolute; inset: -5px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, rgba(56,189,248,0.85), transparent 60deg, transparent);
  -webkit-mask: radial-gradient(circle, transparent calc(50% - 3px), #000 calc(50% - 2px), #000 50%, transparent calc(50% + 1px)); mask: radial-gradient(circle, transparent calc(50% - 3px), #000 calc(50% - 2px), #000 50%, transparent calc(50% + 1px));
  animation: spin 6s linear infinite; }
.ceo-p.busy .sweep { animation-duration: 1.6s; }
.planet-img { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none;
  filter: drop-shadow(0 0 18px rgba(167,139,250,0.55)); animation: floaty 7s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translateY(-5px) rotate(1.5deg); } }
.planet:hover .planet-img { filter: drop-shadow(0 0 30px rgba(196,181,253,0.9)); }

/* ───── 开源热度 ───── */
.w-oss { width: 640px; }
.oss-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.oss-filters .tabs { margin: 0; }
.oss-filters select, .oss-filters input {
  font: inherit; font-size: 12px; color: var(--text); background: rgba(255,255,255,0.04); border: 1px solid var(--line-hi); border-radius: 8px; padding: 5px 9px; min-width: 0;
}
.oss-filters select option { background: #0d1420; }
.oss-filters input { flex: 1; min-width: 110px; user-select: text; cursor: text; }
.oss-filters input:focus, .oss-filters select:focus { outline: none; border-color: var(--cyan); }
.oss-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip-btn { font: inherit; font-size: 12px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; cursor: pointer; }
.chip-btn:hover { color: var(--text); }
.chip-btn.on { color: #ffd2bf; border-color: rgba(255,106,43,0.6); background: rgba(255,106,43,0.08); }
.mini { font: inherit; font-size: 13px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; cursor: pointer; }
.mini:hover { color: var(--text); }
.oss-list { list-style: none; margin: 0; padding: 0; max-height: 430px; overflow: auto; transition: opacity .15s; }
.oss-list.loading { opacity: 0.45; }
.oss-list li { display: flex; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.oss-list li:last-child { border-bottom: 0; }
.oss-list li.closed .main a { color: var(--muted); }
.oss-list .t { flex: 1; min-width: 0; }
.oss-list .main { font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.oss-list .sub2 { color: var(--muted); font-family: var(--mono); font-size: 11px; margin-top: 3px; }
.heat { position: relative; flex: none; width: 46px; height: 34px; border-radius: 8px; overflow: hidden; background: rgba(255,255,255,0.05); display: grid; place-items: center; }
.heat-bar { position: absolute; left: 0; right: 0; bottom: 0; height: var(--h); background: linear-gradient(to top, rgba(255,106,43,0.55), rgba(255,170,90,0.2)); }
.heat b { position: relative; font-family: var(--mono); font-size: 13px; }
.oss-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.oss-tags .repo { font-family: var(--mono); font-size: 11px; color: #7dd3fc; border: 1px solid rgba(56,189,248,0.4); border-radius: 5px; padding: 0 6px; }
.oss-tags .repo:hover { background: rgba(56,189,248,0.1); }
.lb { font-size: 11px; padding: 0 6px; border-radius: 999px; color: color-mix(in srgb, var(--lc, #888) 70%, white); background: color-mix(in srgb, var(--lc, #888) 16%, transparent); border: 1px solid color-mix(in srgb, var(--lc, #888) 45%, transparent); }
.oss-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 10px; }
.oss-pager .muted { margin-left: auto; }
.oss-pager .gap { color: var(--dim); }
.pg { font: inherit; font-size: 12px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 7px; padding: 3px 9px; cursor: pointer; min-width: 30px; }
.pg:hover:not([disabled]) { color: var(--text); border-color: var(--line-hi); }
.pg.on { color: var(--text); border-color: rgba(255,106,43,0.6); background: rgba(255,106,43,0.1); }
.pg[disabled] { opacity: 0.35; cursor: default; }
