:root{--lab-bg:#05060f;--lab-fg:#e8ecff;--lab-dim:#8a93c4;--lab-accent:#ffd479;--f-shu:#7fcf98;--f-wei:#86aef0;--f-wu:#f0907c;--f-han:#d2b886;--e-sworn:#ffd479;--e-kin:#a9b8ff;--e-spouse:#c99be0;--e-lord:#56618f;--e-ally:#5fd6b0;--e-enemy:#ff8a7a;--e-slew:#ff4f5e;--dock-h:150px}*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}html,body{margin:0;height:100%;background:var(--lab-bg);color:var(--lab-fg);font-family:Pretendard,-apple-system,BlinkMacSystemFont,Apple SD Gothic Neo,Segoe UI,sans-serif;overflow:hidden;overscroll-behavior:none}#stage{position:fixed;inset:0;touch-action:none;cursor:grab}#stage.dragging{cursor:grabbing}svg{display:block;width:100%;height:100%}.lab-topbar{position:fixed;left:0;right:0;top:0;z-index:5;display:flex;align-items:center;gap:12px;padding:10px 14px;background:linear-gradient(#05060fee,#05060f00)}.lab-topbar a.back{color:var(--lab-fg);text-decoration:none;font-size:13px;border:1px solid #2a3568;border-radius:999px;padding:6px 12px;white-space:nowrap}.lab-topbar .t{flex:1;min-width:0;font-size:13px;color:var(--lab-dim);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}body[data-embed="1"] .lab-topbar{display:none}.hint{position:fixed;left:14px;right:14px;top:48px;z-index:4;margin:0;font-size:11.5px;line-height:1.5;color:#6c76a8;pointer-events:none;text-shadow:0 1px 3px #000}body[data-embed="1"] .hint{top:10px}.edge{fill:none;stroke-linecap:round;transition:opacity .2s}.edge.sworn{stroke:var(--e-sworn);stroke-width:3.2}.edge.kin{stroke:var(--e-kin);stroke-width:2}.edge.spouse{stroke:var(--e-spouse);stroke-width:2;stroke-dasharray:6 4}.edge.lord{stroke:var(--e-lord);stroke-width:1.4}.edge.ally{stroke:var(--e-ally);stroke-width:2.6}.edge.enemy{stroke:var(--e-enemy);stroke-width:2.2;stroke-dasharray:3 5}.edge.slew{stroke:var(--e-slew);stroke-width:2.4}.edge.off{opacity:.04}.edge.hidden{display:none}body[data-focus="1"] #edges .edge:not(.near){opacity:.05}.node{cursor:pointer;transition:opacity .2s}.node circle{stroke:#05060f;stroke-width:2}.node[data-f=shu] circle{fill:var(--f-shu)}.node[data-f=wei] circle{fill:var(--f-wei)}.node[data-f=wu] circle{fill:var(--f-wu)}.node[data-f=han] circle{fill:var(--f-han)}.node text{font-size:22px;font-weight:600;fill:#dfe4ff;text-anchor:middle;paint-order:stroke;stroke:#05060f;stroke-width:5px;stroke-linejoin:round;pointer-events:none}.node.lead text{font-size:27px;font-weight:800}.node.sel circle{stroke:var(--lab-accent);stroke-width:3}.node:focus{outline:none}.node:focus-visible circle{stroke:var(--lab-accent);stroke-width:3}body[data-focus="1"] .node:not(.near){opacity:.2}.faction{font-size:40px;font-weight:800;text-anchor:middle;opacity:.28;pointer-events:none}.faction[data-f=shu]{fill:var(--f-shu)}.faction[data-f=wei]{fill:var(--f-wei)}.faction[data-f=wu]{fill:var(--f-wu)}.faction[data-f=han]{fill:var(--f-han)}.dock{position:fixed;left:0;right:0;bottom:0;z-index:8;padding:10px 12px calc(12px + env(safe-area-inset-bottom));background:linear-gradient(#05060f00,#05060fee 22%)}.yearrow{display:flex;align-items:center;gap:10px;max-width:760px;margin:0 auto}.yearrow button,.tools button{background:#101736e6;color:var(--lab-fg);border:1px solid #2a3568;border-radius:999px;padding:6px 12px;font-size:12px;font-weight:600;cursor:pointer;white-space:nowrap}.yearrow button[aria-pressed=true]{border-color:var(--lab-accent);color:var(--lab-accent)}.yearrow input[type=range]{flex:1;min-width:0;accent-color:var(--lab-accent)}.yearval{min-width:64px;text-align:right;font-variant-numeric:tabular-nums;font-weight:800;color:var(--lab-accent);font-size:15px}.events{display:flex;gap:6px;flex-wrap:wrap;justify-content:center;max-width:760px;margin:8px auto 0}.events button{background:transparent;color:var(--lab-dim);border:1px solid #232c57;border-radius:999px;padding:3px 9px;font-size:11px;cursor:pointer;font-variant-numeric:tabular-nums}.events button[aria-pressed=true]{color:var(--lab-accent);border-color:var(--lab-accent)}.legend{display:flex;gap:6px 12px;flex-wrap:wrap;justify-content:center;max-width:760px;margin:8px auto 0}.legend button{display:flex;align-items:center;gap:6px;background:none;border:0;padding:2px 0;color:var(--lab-fg);font-size:11.5px;cursor:pointer}.legend button[aria-pressed=false]{opacity:.35;text-decoration:line-through}.legend svg{width:24px;height:8px}.undated{text-align:center;font-size:10.5px;color:#5b6493;margin:6px 0 0}.tools{position:fixed;right:12px;z-index:6;top:48px}body[data-embed="1"] .tools{top:8px}.hint{right:120px}#card{position:fixed;z-index:9;left:0;right:0;bottom:var(--dock-h);max-height:min(46dvh,420px);overflow:auto;transform:translateY(calc(100% + var(--dock-h) + 20px));transition:transform .28s cubic-bezier(.2,.8,.2,1);background:#0d1330f5;backdrop-filter:blur(8px);border:1px solid #223;border-radius:18px 18px 0 0;padding:16px 18px 18px;max-width:560px;margin:0 auto}#card.show{transform:translateY(0)}@media(min-width:900px){#card{inset:92px 14px auto auto;width:360px;max-height:calc(100dvh - 92px - var(--dock-h) - 16px);border-radius:16px;transform:translate(calc(100% + 30px))}#card.show{transform:translate(0)}}#card h2{margin:0 28px 2px 0;font-size:19px;color:#fff}#card .meta{margin:0 0 8px;font-size:12px;color:var(--lab-dim)}#card .meta i{display:inline-block;width:9px;height:9px;border-radius:50%;margin-right:6px;vertical-align:0}#card .ep{margin:0 0 10px;font-size:13px;line-height:1.65;color:#c6cdf0}#card ul{list-style:none;margin:0 0 12px;padding:0;font-size:12.5px;line-height:1.55}#card li{padding:3px 0;border-bottom:1px solid #1a2147}#card li.off{color:#4f5885}#card li button{all:unset;cursor:pointer;border-bottom:1px solid #2f3a6b}#card li button:hover{color:var(--lab-accent)}#card .links{display:flex;flex-direction:column;gap:6px;font-size:13px}#card .links a{color:var(--lab-accent);text-decoration:none}#card .links .appears{color:var(--lab-dim);font-size:12px}#card .close{position:absolute;right:12px;top:8px;color:var(--lab-dim);font-size:22px;cursor:pointer;background:none;border:0}
