:root{color-scheme:dark;--bg:#101319;--bg2:#161c25;--card:#1c2430;--card2:#222c3a;--line:#394453;--text:#f5f2eb;--muted:#bac4d1;--accent:#ffb478;--accent-ink:#121820;--ok:#afe3c5;--bad:#ffb4bc;--link:#b5cff7;--focus:#ffe1a3;--real:#7fd6a3;--sim:#ffd27a;--radius:14px}
:root[data-theme=light]{color-scheme:light;--bg:#f7f4ee;--bg2:#efe9de;--card:#fff;--card2:#f3eee5;--line:#c9c1b1;--text:#1b2028;--muted:#46505e;--accent:#a8470d;--accent-ink:#fff;--ok:#15683d;--bad:#a3202f;--link:#1c4f9c;--focus:#7a3200;--real:#15683d;--sim:#7a5200}
*{box-sizing:border-box}html{font-size:100%;scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--text);font:1rem/1.6 system-ui,-apple-system,"Segoe UI",sans-serif;min-height:100vh;display:flex;flex-direction:column}
a{color:var(--link)}h1,h2,h3{line-height:1.2;margin:0 0 .5em;font-weight:700;letter-spacing:-.01em}h1:focus,h2:focus,h3:focus{outline:none}main h1{font-size:clamp(1.5rem,3.2vw,1.9rem)}h2{font-size:1.3rem;margin-top:1.7rem}h3{font-size:1.05rem}.card h2,.card h3{margin-top:0}p{margin:.4em 0 .9em}
.skip{position:absolute;left:-999px;top:0;background:var(--accent);color:var(--accent-ink);padding:.6em 1em;z-index:50}.skip:focus{left:8px;top:8px}
.top{display:flex;align-items:center;flex-wrap:wrap;gap:.5rem 1rem;padding:.7rem 1.1rem;border-bottom:1px solid var(--line);background:var(--bg2);position:sticky;top:0;z-index:20}
.brand{display:flex;align-items:center;gap:.5rem;text-decoration:none;color:var(--text)}.logo{display:inline-grid;place-items:center;width:2rem;height:2rem;border-radius:8px;background:var(--accent);color:var(--accent-ink);font-weight:800;font-size:.85rem}.ver{font-size:.75rem;border:1px solid var(--line);border-radius:99px;padding:0 .5em;color:var(--muted)}
#nav{display:flex;flex-wrap:wrap;gap:.25rem;flex:1}#nav a{color:var(--muted);text-decoration:none;padding:.45rem .7rem;border-radius:9px;min-height:44px;display:inline-flex;align-items:center}#nav a:hover{background:var(--card)}#nav a[aria-current=page]{background:var(--card2);color:var(--text);box-shadow:inset 0 -2px var(--accent)}
.chip{white-space:nowrap;border:1px solid var(--line);border-radius:99px;padding:.35rem .9rem;text-decoration:none;color:var(--text);background:var(--card);font-weight:600;font-size:.9rem;min-height:44px;display:inline-flex;align-items:center}
main{flex:1;width:100%;max-width:1180px;margin:0 auto;padding:1.5rem 1.1rem 3rem}main:focus{outline:none}
.foot{border-top:1px solid var(--line);padding:1rem 1.1rem;color:var(--muted);font-size:.85rem;text-align:center}
.notice{background:#4a3b12;color:#fff1c9;padding:.7rem 1.1rem;border-bottom:1px solid var(--line)}[data-theme=light] .notice{background:#fff0c2;color:#4a3300}
.toasts{position:fixed;right:1rem;bottom:1rem;display:grid;gap:.5rem;z-index:40;max-width:min(92vw,360px)}.toast{background:var(--card2);border:1px solid var(--accent);border-radius:12px;padding:.7rem 1rem;box-shadow:0 8px 24px #0006}
.hero{padding:2.4rem 0 1.4rem}.hero h1{font-size:clamp(2rem,6vw,3rem);font-weight:800;letter-spacing:-.02em}.hero h1 span{color:var(--accent)}.lead{font-size:1.12rem;color:var(--muted);max-width:58ch}
.grid{display:grid;gap:1rem}.g2{grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr))}.g3{grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr))}.g4{grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr))}
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:1.1rem;min-width:0}.card h2,.card h3{margin-top:0}
a.card{display:block;text-decoration:none;color:var(--text)}a.card:hover{border-color:var(--accent)}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:.4rem;min-height:44px;padding:.55rem 1.1rem;border-radius:10px;border:1px solid var(--accent);background:var(--accent);color:var(--accent-ink);font:700 .95rem system-ui;cursor:pointer;text-decoration:none;transition:background .15s,border-color .15s,transform .05s}.btn:active{transform:translateY(1px)}.btn.sec{background:transparent;color:var(--text);border-color:var(--line)}.btn.sec:hover{border-color:var(--accent);background:var(--card)}.btn:disabled{opacity:.55;cursor:default;transform:none}.btn.small{min-height:36px;padding:.3rem .8rem;font-size:.85rem}
.row{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center}.row.end{justify-content:flex-end}.sp{flex:1}
:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
#menubtn{display:none;min-height:44px;padding:.4rem .9rem;border-radius:10px;border:1px solid var(--line);background:var(--card);color:var(--text);font:700 .9rem system-ui;cursor:pointer;align-items:center}
a.card{transition:border-color .15s}
.badge{display:inline-block;font-size:.7rem;font-weight:800;letter-spacing:.04em;padding:.1rem .55rem;border-radius:99px;border:1px solid currentColor;vertical-align:middle}.badge.real{color:var(--real)}.badge.sim{color:var(--sim)}.badge.lvl{color:var(--muted)}
.bar{height:10px;background:var(--bg);border:1px solid var(--line);border-radius:99px;overflow:hidden}.bar>i{display:block;height:100%;background:var(--accent);border-radius:99px;width:0}
.muted{color:var(--muted)}.small{font-size:.85rem}.ok{color:var(--ok)}.bad{color:var(--bad)}
.stat{font-size:1.5rem;font-weight:800;color:var(--accent);line-height:1.1}.stat+span{color:var(--muted);font-size:.85rem}.tile{padding:.75rem 1rem;display:flex;align-items:baseline;gap:.55rem}
.tracks{display:grid;gap:1rem;grid-template-columns:repeat(auto-fill,minmax(min(100%,270px),1fr))}.track h3{display:flex;gap:.5rem;align-items:center}.ico{display:inline-grid;place-items:center;width:2rem;height:2rem;border-radius:8px;background:var(--card2);border:1px solid var(--line);color:var(--accent);font-weight:800}
.nodes{display:flex;gap:.4rem;margin:.6rem 0;flex-wrap:wrap}.node{width:1.6rem;height:1.6rem;border-radius:50%;border:2px solid var(--line);display:inline-grid;place-items:center;font-size:.7rem;color:var(--muted)}.node.done{background:var(--ok);border-color:var(--ok);color:#102}.node.open{border-color:var(--accent);color:var(--accent)}
.clist{list-style:none;padding:0;margin:0;display:grid;gap:.6rem}.clist li a,.clist li .lockrow{display:flex;gap:.8rem;align-items:center;padding:.8rem 1rem;border:1px solid var(--line);border-radius:12px;background:var(--card);text-decoration:none;color:var(--text);min-height:56px}.clist li a:hover{border-color:var(--accent)}.clist .lockrow{opacity:.65}
.split{display:grid;gap:1rem;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr)}@media(max-width:860px){.split{grid-template-columns:minmax(0,1fr)}}
label{display:block;font-weight:700;margin-bottom:.35rem}
textarea,select,input[type=text],input[type=number],input[type=file]{width:100%;background:var(--bg);color:var(--text);border:1px solid var(--line);border-radius:10px;font:.95rem/1.6 ui-monospace,SFMono-Regular,Consolas,monospace;padding:.65rem}select,input[type=number]{font-family:system-ui;min-height:44px}
.editor{display:grid;grid-template-columns:auto minmax(0,1fr);border:1px solid var(--line);border-radius:10px;background:var(--bg);overflow:hidden}.editor:focus-within{border-color:var(--accent)}
input[type=range],input[type=radio],input[type=checkbox]{accent-color:var(--accent)}.editor .gutter{padding:.65rem .5rem;text-align:right;color:var(--muted);font:.95rem/1.6 ui-monospace,Consolas,monospace;white-space:pre;background:var(--bg2);user-select:none;min-width:2.4rem}.editor textarea{border:0;border-radius:0;min-height:260px;resize:vertical;white-space:pre;overflow:auto;tab-size:2}
pre,.out{white-space:pre-wrap;overflow-wrap:anywhere;background:var(--bg);border:1px solid var(--line);border-radius:10px;padding:.7rem;font:.9rem/1.55 ui-monospace,Consolas,monospace;margin:.4rem 0}
code{font-family:ui-monospace,Consolas,monospace;background:var(--bg);padding:.05em .35em;border-radius:5px}
.checks{list-style:none;padding:0;margin:.5rem 0;display:grid;gap:.35rem}.checks li::before{content:"○ ";color:var(--muted)}.checks li.ok::before{content:"✓ ";color:var(--ok)}.checks li.bad::before{content:"✗ ";color:var(--bad)}
.choices{display:grid;gap:.5rem;margin:.8rem 0}.choice{display:flex;gap:.6rem;align-items:flex-start;padding:.75rem .9rem;border:1px solid var(--line);border-radius:12px;cursor:pointer;background:var(--bg2)}.choice:has(input:checked){border-color:var(--accent);background:var(--card2)}.choice input{margin-top:.3rem;width:1.1rem;height:1.1rem}
.term{background:#0b1119;color:#e8eef6;border:1px solid var(--line);border-radius:10px;padding:.7rem;font:.9rem/1.55 ui-monospace,Consolas,monospace;min-height:260px;max-height:420px;overflow:auto}.term .ln{white-space:pre-wrap;overflow-wrap:anywhere}.term .err{color:#ffb4bc}.term .cmd{color:#ffcf9e}.termin{display:flex;gap:.5rem;align-items:center;margin-top:.5rem}.termin input{flex:1}
.preview{width:100%;height:260px;border:1px solid var(--line);border-radius:10px;background:#fff}
.viz{width:100%;height:auto;background:var(--bg);border:1px solid var(--line);border-radius:12px}.viz text{fill:var(--text);font:12px system-ui}.viz .b{fill:var(--accent)}.viz .b.hi{fill:#7db7ff}.viz .b.so{fill:var(--real)}.viz .e{stroke:var(--line);stroke-width:2}.viz .e.on{stroke:var(--accent)}.viz .n{fill:var(--card2);stroke:var(--line);stroke-width:2}.viz .n.v{fill:var(--real);}.viz .n.c{fill:#7db7ff}.viz .n.f{fill:var(--sim)}.viz .n.vv text{fill:#102}
.ctrls{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;margin:.7rem 0}.ctrls input[type=range]{width:160px;min-height:44px}
.counters{display:flex;gap:1.2rem;flex-wrap:wrap}.counters b{font-size:1.3rem;color:var(--accent)}
table{border-collapse:collapse;width:100%;font-size:.9rem}th,td{border:1px solid var(--line);padding:.35rem .6rem;text-align:left}th{background:var(--bg2)}
.gantt{display:flex;border:1px solid var(--line);border-radius:8px;overflow:hidden;min-height:44px}.gantt div{display:grid;place-items:center;font-size:.8rem;border-right:1px solid var(--bg);background:var(--accent);color:var(--accent-ink);font-weight:700;min-width:1.4rem}.gantt .idle{background:var(--card2);color:var(--muted)}
.tabs{display:flex;gap:.3rem;flex-wrap:wrap;border-bottom:1px solid var(--line);margin-bottom:1rem}.tabs a{padding:.5rem .9rem;text-decoration:none;color:var(--muted);border-radius:9px 9px 0 0;min-height:44px;display:inline-flex;align-items:center}.tabs a[aria-current=page]{color:var(--text);box-shadow:inset 0 -2px var(--accent)}
.ach{display:flex;gap:.8rem;align-items:flex-start}.ach .medal{width:2.4rem;height:2.4rem;border-radius:50%;display:grid;place-items:center;border:2px solid var(--line);color:var(--muted);flex:none}.ach.got .medal{border-color:var(--accent);color:var(--accent);background:var(--card2)}.ach:not(.got){opacity:.7}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.act{display:flex;gap:3px;align-items:flex-end;height:60px}.act i{display:block;width:12px;background:var(--accent);border-radius:3px 3px 0 0;min-height:3px}
details{margin:.6rem 0}summary{cursor:pointer;min-height:36px}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}*{animation:none!important;transition:none!important}}
:root[data-motion=off] *{animation:none!important;transition:none!important}
@media (max-width:860px){
.top{flex-wrap:wrap;position:sticky}.brand .ver{display:none}
#menubtn{display:inline-flex;margin-left:auto}#xpchip{order:2}#nav{order:3}
#nav{display:none;flex:1 1 100%;order:3}
#nav.open{display:flex;flex-direction:column;position:absolute;left:0;right:0;top:100%;background:var(--bg2);border-bottom:1px solid var(--line);padding:.5rem .7rem;gap:.15rem;box-shadow:0 14px 28px #0006}
#nav.open a{min-height:44px;padding:.55rem .8rem}}
@media (max-width:520px){main{padding:1rem .8rem 2.5rem}.top{padding:.55rem .7rem;gap:.5rem}.chip{padding:.3rem .6rem;font-size:.82rem;min-height:40px}}
@media print{.top,.foot,.toasts{display:none}}

.tablewrap{overflow-x:auto;max-width:100%}

.homemid{margin:1.2rem 0}
