
.lib{max-width:1080px;margin:0 auto;padding:0 16px 64px}
.lib h1{margin:28px 0 8px}
.lib-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:22px;margin:22px 0}
.work-card{border:1px solid var(--border,#e3e8ee);border-radius:14px;overflow:hidden;background:#fff;display:flex;flex-direction:column}
.work-card img{width:100%;aspect-ratio:auto;object-fit:cover;display:block;background:#222}
.work-card .wc-body{padding:14px 16px 18px;display:flex;flex-direction:column;gap:8px;flex:1}
.work-card h3{margin:0;font-size:1.1rem}
.work-card p{margin:0;font-size:.93rem}
.work-card .tag{font-size:.78rem;letter-spacing:.06em;text-transform:uppercase;color:#4d45e5}
.work-card .wc-actions{margin-top:auto;display:flex;gap:8px;flex-wrap:wrap}
.tabbar{display:flex;gap:8px;margin:18px 0 8px;border-bottom:1px solid #e3e8ee}.tabbar button{border:0;background:none;padding:10px 16px;font:inherit;font-weight:600;color:#6b7280;cursor:pointer;border-bottom:3px solid transparent}.tabbar button.on{color:#4d45e5;border-bottom-color:#4d45e5}
.author-note{border-left:4px solid #635bff;background:#f6f5ff;margin:20px 0;padding:14px 20px;border-radius:0 10px 10px 0;font-family:Georgia,serif;font-size:1.05rem;line-height:1.65}.author-note p{margin:0 0 .7em}.author-note .sig{margin:0;font-style:italic}.author-note h2{margin:0 0 .4em;font-size:1.15rem}
.warn{border:1px solid #c9a23a;background:#fff9e8;border-radius:10px;padding:12px 14px;margin:16px 0;font-size:.93rem}
.toc{list-style:none;padding:0;margin:18px 0}
.toc li{border-bottom:1px solid #e3e8ee;padding:10px 2px}
.toc a{text-decoration:none;display:flex;gap:12px;align-items:baseline}
.toc .n{min-width:6.5em;color:#6b7280;font-size:.88rem;letter-spacing:.05em;text-transform:uppercase}
.work-head{display:grid;grid-template-columns:minmax(0,260px) 1fr;gap:26px;align-items:start;margin:20px 0}
.work-head img{width:100%;border-radius:12px;display:block}
@media(max-width:640px){.work-head{grid-template-columns:1fr}}
.reader{max-width:40rem;margin:0 auto;padding:10px 16px 60px;font-family:Georgia,'Times New Roman',serif;font-size:1.13rem;line-height:1.75}
.reader h1{font-size:1.9rem;line-height:1.2;margin:28px 0 8px;text-align:center}
.reader .kicker{display:block;text-align:center;font-size:.78rem;letter-spacing:.28em;text-transform:uppercase;color:#6b7280;margin-top:30px}
.reader p{margin:0 0 .9em;text-indent:0}
.reader p.scene{text-align:center;letter-spacing:.5em;margin:1.6em 0;color:#6b7280}
.reader .crumb{font-family:system-ui,sans-serif;font-size:.85rem;color:#6b7280;margin-top:18px}
.reader .adv{font-family:system-ui,sans-serif;font-size:.82rem;color:#6b7280;border-top:1px solid #e3e8ee;border-bottom:1px solid #e3e8ee;padding:8px 0;margin:14px 0 6px;text-align:center}
.pager{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;margin:34px 0 0;font-family:system-ui,sans-serif}
.agegate{position:fixed;inset:0;z-index:9999;background:#12121a;color:#f2f2f7;display:flex;align-items:center;justify-content:center;padding:24px}
.agegate[hidden]{display:none}
.agegate .box{max-width:30rem;text-align:center;font-family:system-ui,sans-serif}
.agegate h2{margin:0 0 10px;color:#fff}.agegate p{color:#e4e4ee}
.agegate .btns{display:flex;gap:12px;justify-content:center;flex-wrap:wrap;margin-top:20px}
.agegate a.leave{color:#c9c9d6}

/* ---- dark mode (story pages) ---- */
html[data-theme="dark"]{color-scheme:dark;--bg:#14141b;--panel:#1b1b25;--panel-soft:#20202c;--text:#e6e6ee;--muted:#a3a3b3;--line:#2e2e3c;--line-strong:#3b3b4c;--accent:#9c96ff;--accent-dark:#b8b3ff;--accent-soft:#25233f;--border:#2e2e3c;--shadow:0 18px 48px rgba(0,0,0,.4);--shadow-tight:0 10px 28px rgba(0,0,0,.35)}
html[data-theme="dark"] body{background:#14141b;color:var(--text)}
html[data-theme="dark"] .nav-links a:last-child,html[data-theme="dark"] .button.primary{color:#14141b;background:var(--accent)}
html[data-theme="dark"] .nav-links a:last-child:hover,html[data-theme="dark"] .button.primary:hover{color:#14141b;background:var(--accent-dark)}
html[data-theme="dark"] .button.secondary{background:var(--panel);color:var(--text);border-color:var(--line-strong)}
html[data-theme="dark"] .reader .kicker,html[data-theme="dark"] .reader p.scene,html[data-theme="dark"] .reader .crumb,html[data-theme="dark"] .reader .adv,html[data-theme="dark"] .adv-note,html[data-theme="dark"] .toc .n,html[data-theme="dark"] .tabbar button{color:#a3a3b3!important}
html[data-theme="dark"] .reader .adv{border-color:var(--line)}
html[data-theme="dark"] .toc li,html[data-theme="dark"] .tabbar{border-color:var(--line)}
html[data-theme="dark"] .work-card{background:var(--panel);border-color:var(--line)}
html[data-theme="dark"] .work-card .tag,html[data-theme="dark"] .tabbar button.on{color:var(--accent)}
html[data-theme="dark"] .tabbar button.on{border-bottom-color:var(--accent)}
html[data-theme="dark"] .author-note{background:#1f1e33;border-left-color:var(--accent)}
html[data-theme="dark"] .warn{background:#2b2514;border-color:#7a6221;color:#e9dcb4}
html[data-theme="dark"] .field-note{background:var(--panel-soft);border-color:var(--line);color:var(--muted)}
html[data-theme="dark"] .mini-footer{background:#0b0b10}
html[data-theme="dark"] .nav-brand img{filter:brightness(1.6) contrast(.95)}
.theme-toggle{position:fixed;right:16px;bottom:16px;z-index:9000;display:inline-flex;align-items:center;gap:8px;padding:9px 14px;border-radius:999px;border:1px solid #d9dfeb;background:#fff;color:#20252f;font:600 .85rem/1 system-ui,sans-serif;cursor:pointer;box-shadow:0 6px 18px rgba(31,40,68,.18)}
.theme-toggle:hover{border-color:#635bff}
.theme-toggle:focus-visible{outline:3px solid #635bff;outline-offset:2px}
html[data-theme="dark"] .theme-toggle{background:#1b1b25;color:#e6e6ee;border-color:#3b3b4c;box-shadow:0 6px 18px rgba(0,0,0,.5)}
@media print{.theme-toggle{display:none}}
