/* 资料 · 三国：势力的颜色、时间线、地图。版式沿用 composers.css / denominations.css */
/* 势力配色：魏蓝、蜀绿、吴红，晋紫、汉金、群雄灰（三国题材里通行的配法） */
.sg{--f-han:#E0B03A;--f-lords:#8D97AB;--f-wei:#3E86E8;--f-jin:#A566E0;--f-shu:#35B866;--f-wu:#E8483F}
.sg .l-han,.sg .f-han{--fc:var(--f-han)}.sg .l-lords,.sg .f-lords{--fc:var(--f-lords)}.sg .l-wei,.sg .f-wei{--fc:var(--f-wei)}
.sg .l-jin,.sg .f-jin{--fc:var(--f-jin)}.sg .l-shu,.sg .f-shu{--fc:var(--f-shu)}.sg .l-wu,.sg .f-wu{--fc:var(--f-wu)}
.sg-fac{--fc:var(--accent);color:var(--fc)}
.sg-fac.f-han{--fc:#E0B03A}.sg-fac.f-lords{--fc:#9AA3B5}.sg-fac.f-wei{--fc:#5E9CF0}.sg-fac.f-jin{--fc:#B983EA}.sg-fac.f-shu{--fc:#4CC87A}.sg-fac.f-wu{--fc:#F0655C}
.sg-legend{display:flex;flex-wrap:wrap;gap:6px 18px;margin:10px 0 14px;font-size:14px;color:var(--muted)}
.sg-legend span{display:inline-flex;align-items:center;gap:7px}
.sg-legend i{width:12px;height:12px;border-radius:3px;background:var(--fc)}
/* 时间线 */
.sg-scroll{overflow:auto;max-height:78vh;max-height:78svh;border:1px solid var(--line);border-radius:10px;background:rgba(10,14,26,.55)}
.sg-line{position:relative}
.sg-ax{position:sticky;height:28px;z-index:4;background:rgba(13,18,33,.97)}
.sg-ax-top{top:0;border-bottom:1px solid var(--line)}
.sg-ax-bot{bottom:0;border-top:1px solid var(--line)}
.sg-tick{position:absolute;top:5px;transform:translateX(-50%);font-size:13px;color:var(--muted);font-variant-numeric:tabular-nums}
.sg-grid{position:absolute;width:1px;background:rgba(255,255,255,.05)}
.sg-lane{position:absolute;left:0;right:0;border-top:1px solid var(--line);background:linear-gradient(to right,color-mix(in srgb,var(--fc) 9%,transparent),transparent 70%)}
.sg-lane-n{position:sticky;left:0;z-index:3;display:inline-block;width:90px;height:100%;padding:8px 6px 0 10px;box-sizing:border-box;font-size:13px;line-height:1.35;color:var(--fc);background:linear-gradient(to right,rgba(13,18,33,.96) 78%,transparent)}
.sg-p{position:absolute;height:19px;padding:0 8px;border:1px solid color-mix(in srgb,var(--fc) 70%,transparent);border-radius:10px;background:color-mix(in srgb,var(--fc) 22%,#10162A);color:var(--text);font:inherit;font-size:12px;line-height:17px;text-align:left;white-space:nowrap;overflow:clip;cursor:pointer;transition:opacity .2s ease,box-shadow .2s ease}
.sg-p span{position:sticky;left:100px;display:inline-block}
.sg-p.ruler{font-weight:700;background:color-mix(in srgb,var(--fc) 40%,#10162A)}
.sg-p.eb{border-left-style:dashed;border-top-left-radius:0;border-bottom-left-radius:0}
.sg-p.ed{border-right-style:dashed;border-top-right-radius:0;border-bottom-right-radius:0}
.sg-p.rom{border-style:dotted;font-style:italic}
.sg-p:hover,.sg-p.on{box-shadow:0 0 0 2px var(--fc);z-index:2}
.sg-line.has-focus .sg-p:not(.on){opacity:.4}
.sg-ev{position:absolute;z-index:1;height:22px;padding:0 8px 0 6px;border:0;border-left:2px solid var(--accent);background:rgba(216,188,126,.10);color:var(--text);font:inherit;font-size:12px;line-height:22px;white-space:nowrap;cursor:pointer}
.sg-ev b{color:var(--accent);font-weight:500;margin-right:2px}
.sg-ev.rom{border-left-style:dotted;background:rgba(255,255,255,.05);font-style:italic;color:var(--muted)}
.sg-ev:hover{background:rgba(216,188,126,.24);z-index:2}
.sg-now{position:absolute;top:0;width:2px;margin-left:-1px;background:var(--accent);opacity:.55;pointer-events:none;z-index:2}
/* 地图 */
.sg-maphead{display:flex;flex-wrap:wrap;align-items:center;gap:10px 16px;margin:34px 0 10px}
.sg-maphead h2{margin:0;font-size:22px;font-weight:500}
.sg-year{font-size:16px;color:var(--accent);min-width:6.5em}
.sg-slider{flex:1;min-width:200px;max-width:560px;accent-color:var(--accent);height:28px}
.sg-map{border:1px solid var(--line);border-radius:10px;background:rgba(10,14,26,.55);max-width:920px}
.sg-map svg{display:block;width:100%;height:auto}
.sg-coast{fill:none;stroke:#8A96B0;stroke-width:1.6;stroke-linejoin:round}
.sg-riv{fill:none;stroke:#A9C4F2;stroke-width:1.6;stroke-linejoin:round;stroke-linecap:round;opacity:.55}
.sg-zhou{fill:#E6E9F2;font-size:calc(18px * var(--z,1));pointer-events:none;letter-spacing:.12em;text-anchor:middle;dominant-baseline:middle;opacity:.5;paint-order:stroke;stroke:#0D1220;stroke-width:calc(4px * var(--z,1));stroke-opacity:.6}
.sg-c{cursor:pointer;outline:none}
.sg-c circle{fill:var(--fc);stroke:#0D1220;stroke-width:calc(1.2px * var(--z,1))}
.sg-c path{stroke:var(--fc);stroke-width:calc(2.4px * var(--z,1));stroke-linecap:round;fill:none}
.sg-c text{fill:var(--text);font-size:calc(13px * var(--z,1));paint-order:stroke;stroke:#0D1220;stroke-width:calc(3px * var(--z,1));stroke-linejoin:round}
.sg-c.k-c text{font-size:calc(15px * var(--z,1));font-weight:700}
.sg-c.k-b text{fill:var(--muted);font-size:calc(12px * var(--z,1))}
.sg-c .sg-ring{fill:none;stroke:var(--accent);stroke-width:calc(2px * var(--z,1))}
.sg-c:hover text,.sg-c:focus text,.sg-c.on text{fill:var(--accent)}
.sg-info{max-width:920px;min-height:3.2em;margin:10px 0 0;font-size:15px;line-height:1.8}
.sg-info p{margin:0 0 4px}
.sg-info b{color:var(--accent);font-weight:500}
.sg-h{white-space:nowrap;color:var(--muted)}.sg-h.on{color:var(--fc);font-weight:700}
.sg-dim{color:var(--muted)}
.sg-born{display:flex;flex-wrap:wrap;align-items:center;gap:6px}.sg-born span{color:var(--muted);font-size:13px;margin-right:4px}
.sg-romtag{margin-right:6px;padding:0 6px;border:1px dotted var(--muted);border-radius:4px;font-style:normal;font-size:12px;color:var(--muted)}
/* 卡片里的资料 */
.sg-dl{display:grid;grid-template-columns:auto 1fr;gap:6px 14px;margin:14px 0;font-size:15px}
.sg-dl dt{color:var(--muted);font-size:13px;padding-top:2px;white-space:nowrap}.sg-dl dd{margin:0}
.sg-tomap{margin-left:6px;font-size:12px;padding:1px 9px}
.sg-rom.on{background:var(--accent);color:#10162A;border-color:var(--accent)}
@media (max-width:720px){.sg-scroll{max-height:70svh}.sg-maphead h2{width:100%}}
/* 宽屏：地图在左，说明在右 */
@media (min-width:1180px){.sg-mapwrap{display:grid;grid-template-columns:minmax(0,920px) minmax(260px,1fr);gap:24px;align-items:start}.sg-info{margin:0;position:sticky;top:20px}}
/* 筛选 */
.sg-filter{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:10px 0 14px}
.sg-filter .sg-fbtn i{background:var(--fc)}
.sg-filter .sg-fbtn.on{border-color:var(--fc);color:var(--fc)}
.sg-sur{height:38px;padding:0 12px;border:1px solid var(--line);border-radius:999px;background:rgba(14,20,36,.9);color:var(--text);font:inherit;font-size:14px}
.sg-count{font-size:13px;color:var(--muted)}
/* 势力底色、缩放 */
.sg-terr{fill:var(--fc);opacity:.42;stroke:var(--fc);stroke-width:.6;stroke-linejoin:round}
.sg-map{touch-action:pan-y;overflow:hidden}
.sg-map svg{cursor:grab}
.sg-zoom{display:inline-flex;gap:6px}
.sg-zoom button{min-width:40px;height:40px;padding:0 12px;border:1px solid var(--line);border-radius:999px;background:none;color:var(--text);font:inherit;font-size:15px;cursor:pointer}
.sg-zoom button:hover{border-color:var(--accent);color:var(--accent)}
.sg-rel small{margin-left:5px;font-size:12px;color:var(--muted)}
/* 姓氏一行 */
.sg-surrow{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0 0 14px}
.sg-surlab{font-size:13px;color:var(--muted);margin-right:4px}
.sg-surbtn{height:32px;padding:0 11px;border:1px solid var(--line);border-radius:999px;background:none;color:var(--text);font:inherit;font-size:14px;cursor:pointer}
.sg-surbtn small{margin-left:4px;font-size:12px;color:var(--muted)}
.sg-surbtn:hover,.sg-surbtn.on{border-color:var(--accent);color:var(--accent)}
.sg-surbtn.on{background:rgba(216,188,126,.12)}
.sg-surlist{display:inline-flex;flex-wrap:wrap;gap:5px;padding:4px 10px 4px 8px;margin-right:6px;border-left:2px solid var(--accent);background:rgba(216,188,126,.06);border-radius:0 10px 10px 0}
.sg-surname{padding:2px 10px;font-size:13px;border-color:color-mix(in srgb,var(--fc) 60%,transparent)}
/* 时间线 / 关系图 */
.sg-views{display:flex;flex-wrap:wrap;align-items:center;gap:10px 22px;margin:0 0 12px}
.sg-vbtn.on,.sg-et.on{border-color:var(--accent);color:var(--accent)}
.sg-relbar[hidden]{display:none}
.sg-lg{display:inline-block;width:26px;height:0;margin-right:7px;vertical-align:middle;border-top:2px solid var(--accent)}
.sg-lg.e-s{border-top-style:dotted}.sg-lg.e-m{border-top:3px double #E79AB8}.sg-lg.e-k{border-top:1px solid var(--muted)}.sg-lg.e-t{border-top-style:dashed}.sg-lg.e-j{border-top:1px solid #7FA6E0}
.sg-edges{position:absolute;left:0;top:0;pointer-events:none;z-index:1}
.sg-e{fill:none;stroke:var(--fc,var(--accent));stroke-width:1.6;opacity:.75}
.sg-e.e-s{stroke-dasharray:2 4;stroke-linecap:round}
.sg-e.e-m{stroke:#E79AB8;stroke-width:2.2;stroke-dasharray:7 3}
.sg-e.e-k{stroke-width:1;opacity:.5}
.sg-e.e-t{stroke-dasharray:6 4}
.sg-e.e-j{stroke-width:.9;opacity:.38}
.sg-line.is-rel .sg-n{z-index:2;text-align:center;padding:0 4px;height:22px;line-height:20px;font-size:13px;overflow:hidden;text-overflow:ellipsis}
.sg-line.is-rel.has-focus .sg-p:not(.on):not(.near){opacity:.22}
.sg-line.is-rel.has-focus .sg-p.near{opacity:1}
.sg-line.is-rel.has-focus .sg-e{opacity:.06}
.sg-line.is-rel.has-focus .sg-e.on{opacity:1;stroke-width:2.4}
.sg-hn{color:var(--muted);font-size:13px}
.sg-dl .sg-h{white-space:normal}

/* 地形层：山脉、峡谷、关隘、平原盆地、湖泽、州郡界 */
.sg-layers{display:inline-flex;gap:6px;flex-wrap:wrap}
.sg-sea{fill:rgba(70,100,150,.10);stroke:none}
.sg-isl{fill:rgba(10,14,26,.55);stroke:#8A96B0;stroke-width:1.2}
.sg-lake{fill:rgba(120,160,230,.28);stroke:#A9C4F2;stroke-width:1;opacity:.85}
.sg-lake.k-s{fill:rgba(120,160,230,.12);stroke-dasharray:3 3}
.sg-bor{fill:none;stroke:#D8BC7E;stroke-width:calc(1.6px * var(--z,1));stroke-dasharray:calc(7px * var(--z,1)) calc(4px * var(--z,1));stroke-linejoin:round;stroke-linecap:round;opacity:.8;pointer-events:none}
.sg-tm{cursor:pointer;outline:none}
.sg-tm .sg-mt{fill:none;stroke:#B39A72;stroke-width:calc(5px * var(--z,1));stroke-linecap:round;stroke-linejoin:round;opacity:.38}
.sg-tm.k-g .sg-mt{stroke:#9C8A6A;stroke-dasharray:calc(2px * var(--z,1)) calc(5px * var(--z,1));stroke-width:calc(4px * var(--z,1));opacity:.6}
.sg-tm .sg-hit{fill:none;stroke:transparent;stroke-width:calc(16px * var(--z,1))}
.sg-tm text,.sg-tv text{fill:#C9B48E;font-size:calc(12px * var(--z,1));paint-order:stroke;stroke:#0D1220;stroke-width:calc(3px * var(--z,1));stroke-linejoin:round;letter-spacing:.08em;opacity:.85}
.sg-tv{cursor:pointer;outline:none}
.sg-tv text{fill:#9FB3A0;font-style:italic;opacity:.75}
.sg-tp{cursor:pointer;outline:none}
.sg-tp path{fill:#C9B48E;stroke:#0D1220;stroke-width:calc(1px * var(--z,1))}
.sg-tp text{fill:#C9B48E;font-size:calc(12px * var(--z,1));paint-order:stroke;stroke:#0D1220;stroke-width:calc(3px * var(--z,1));stroke-linejoin:round}
.sg-tm:hover .sg-mt,.sg-tm:focus .sg-mt,.sg-tm.on .sg-mt{opacity:.8;stroke:var(--accent)}
.sg-tm:hover text,.sg-tv:hover text,.sg-tp:hover text,.sg-tm.on text,.sg-tv.on text,.sg-tp.on text{fill:var(--accent);opacity:1}
.sg-tp.on path,.sg-tp:hover path{fill:var(--accent)}
.sg-tags{display:inline-flex;gap:4px;flex-wrap:wrap;vertical-align:middle;margin-left:6px}
.sg-tags i{font-style:normal;font-size:12px;padding:0 7px;border:1px solid var(--line);border-radius:999px;color:var(--muted);line-height:1.6}
.sg-terd{color:var(--text)}
.sg-maptip{font-size:12px;color:var(--muted)}

/* 时间线和关系图合一：关系线画在横带下面，点一个人只亮出和他相连的人 */
.sg-line .sg-p{z-index:2}
.sg-line .sg-e{opacity:.5}
.sg-line.has-focus .sg-p.near{opacity:1}
.sg-line.has-focus .sg-e{opacity:.05}
.sg-line.has-focus .sg-e.on{opacity:1;stroke-width:2.4}
.sg-rellab{font-size:13px;color:var(--muted);margin-right:2px;align-self:center}
/* 姓氏一行的开关 */
.sg-surtg{height:32px;padding:0 12px;border:1px solid var(--line);border-radius:999px;background:none;color:var(--muted);font:inherit;font-size:14px;cursor:pointer}
.sg-surtg i{font-style:normal;font-size:12px;margin-left:2px}
.sg-surtg:hover,.sg-surtg.open{border-color:var(--accent);color:var(--accent)}
/* 群雄展开成各家 */
.sg-lordsx{width:30px;height:32px;margin-left:-6px;border:1px solid var(--line);border-left:none;border-radius:0 999px 999px 0;background:none;color:var(--muted);font:inherit;font-size:13px;cursor:pointer}
.sg-lordsx:hover,.sg-lordsx[aria-expanded="true"]{color:var(--f-lords,var(--accent));border-color:var(--line)}
.sg-lordsrow{display:flex;flex-wrap:wrap;gap:6px;margin:-4px 0 14px;padding:8px 10px;border-left:2px solid var(--f-lords,var(--line));background:rgba(140,150,170,.06);border-radius:0 10px 10px 0}
.sg-lordsrow[hidden]{display:none}
.sg-gbtn{height:30px;padding:0 11px;border:1px solid var(--line);border-radius:999px;background:none;color:var(--text);font:inherit;font-size:13px;cursor:pointer}
.sg-gbtn small{margin-left:4px;font-size:12px;color:var(--muted)}
.sg-gbtn:hover{border-color:var(--accent);color:var(--accent)}
.sg-gbtn.on{border-color:var(--accent);color:var(--accent);background:rgba(216,188,126,.12)}
.sg-relbar{flex-wrap:wrap;max-width:100%}

/* 群雄各家的颜色：取自《三国志14》190、194 年剧本的势力地图（深色底上略调亮）；张角家游戏里没有，用黄巾的黄 */
.sg .f-lords.g-g0,.sg .l-lords.g-g0,.sg .sg-gbtn.g-g0{--fc:#8C9BBE}
.sg .f-lords.g-g1,.sg .l-lords.g-g1,.sg .sg-gbtn.g-g1{--fc:#3F8394}
.sg .f-lords.g-g2,.sg .l-lords.g-g2,.sg .sg-gbtn.g-g2{--fc:#C2D12E}
.sg .f-lords.g-g3,.sg .l-lords.g-g3,.sg .sg-gbtn.g-g3{--fc:#E092BF}
.sg .f-lords.g-g4,.sg .l-lords.g-g4,.sg .sg-gbtn.g-g4{--fc:#2CC6D6}
.sg .f-lords.g-g5,.sg .l-lords.g-g5,.sg .sg-gbtn.g-g5{--fc:#4650C4}
.sg .f-lords.g-g6,.sg .l-lords.g-g6,.sg .sg-gbtn.g-g6{--fc:#EE7A2C}
.sg .f-lords.g-g7,.sg .l-lords.g-g7,.sg .sg-gbtn.g-g7{--fc:#9EE29A}
.sg .f-lords.g-g8,.sg .l-lords.g-g8,.sg .sg-gbtn.g-g8{--fc:#5FCB7E}
.sg .f-lords.g-g9,.sg .l-lords.g-g9,.sg .sg-gbtn.g-g9{--fc:#B57A2C}
.sg .f-lords.g-g10,.sg .l-lords.g-g10,.sg .sg-gbtn.g-g10{--fc:#9C8BD6}
.sg .f-lords.g-g11,.sg .l-lords.g-g11,.sg .sg-gbtn.g-g11{--fc:#F2E86B}
.sg-gbtn i{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:6px;background:var(--fc,var(--f-lords));vertical-align:-1px}
.sg-gbtn.go i{background:var(--f-lords)}

/* 人物卡片：外貌 · 性格 · 穿着（折叠） */
.sg-look{margin:12px 0 4px;border:1px solid var(--line);border-radius:10px;padding:0 12px}
.sg-look summary{cursor:pointer;padding:9px 0;font-size:14px;color:var(--accent);list-style:none}
.sg-look summary::-webkit-details-marker{display:none}
.sg-look summary::before{content:"▸";display:inline-block;width:1.1em;transition:transform .2s ease}
.sg-look[open] summary::before{transform:rotate(90deg)}
.sg-lr{display:grid;grid-template-columns:3em 1fr;gap:8px;padding:0 0 10px;font-size:14px;line-height:1.75}
.sg-lr span{color:var(--muted);font-size:13px;padding-top:2px}
.sg-lr p{margin:0}
.sg-lt{font-style:normal;font-size:12px;padding:0 5px;margin:0 3px 0 1px;border:1px solid var(--line);border-radius:4px;color:var(--muted);vertical-align:1px}
.sg-lt.t-史{color:#D8BC7E;border-color:rgba(216,188,126,.5)}
.sg-lt.t-演{color:#9FC3E6;border-color:rgba(159,195,230,.45)}
.sg-lt.t-戏{color:#E79AB8;border-color:rgba(231,154,184,.45)}
.sg-lt.t-创{color:#9FB3A0;border-color:rgba(159,179,160,.45)}
