/* Shared structure; the host supplies the paper, ink, type and shape. */
.bl-switcher,.bl-shelf,.bl-inline{--bl-paper:#f7f4eb;--bl-ink:#35463b;--bl-muted:#687367;--bl-line:#d8dace;--bl-soft:#eeeee3;--bl-accent:#a45a48;--bl-radius:3px;--bl-font:'STKaiti','KaiTi','Songti SC',serif}
[data-bl-theme=poetry]{--bl-paper:var(--paper,#f7f4eb);--bl-ink:var(--ink,#35463b);--bl-accent:var(--cinnabar,#a45a48)}
html.night-read [data-bl-theme=poetry]{--bl-paper:#20251f;--bl-ink:#e5e4d7;--bl-muted:#b1baaa;--bl-line:#4b5347;--bl-soft:#30372d;--bl-accent:#d2977b}
[data-bl-theme=draw]{--bl-paper:#f8f5eb;--bl-ink:#394637;--bl-muted:#6d745f;--bl-line:#d9dccb;--bl-soft:#eeefdf;--bl-accent:#9b6951;--bl-radius:5px;--bl-font:var(--serif,'KaiTi',serif)}
[data-bl-theme=chat]{--bl-paper:var(--surface,#203128);--bl-ink:var(--text-ui,#eeeade);--bl-muted:var(--muted-ui,#b4c0b5);--bl-line:var(--line,#435046);--bl-soft:var(--surface-soft,#263c30);--bl-accent:var(--gold,#ccba92);--bl-font:var(--font-serif,'KaiTi',serif)}
[data-bl-theme=map]{--bl-paper:var(--paper,#f5f3ec);--bl-ink:var(--ink,#243b36);--bl-muted:var(--muted,#73817a);--bl-line:var(--line,#dadfd5);--bl-soft:#e9eee5;--bl-accent:var(--green,#326c59);--bl-radius:12px;--bl-font:var(--serif,'Songti SC',serif)}
[data-bl-theme=solar]{--bl-paper:#0d1924;--bl-ink:#dfe8ed;--bl-muted:#9eb1c1;--bl-line:#354655;--bl-soft:#172838;--bl-accent:#e8bd83;--bl-radius:9px;--bl-font:Inter,'Segoe UI','Microsoft YaHei',sans-serif}
.bl-switcher{position:relative;flex:none;margin:0;color:var(--bl-ink);font:14px/1.5 var(--bl-font);letter-spacing:0;text-align:left;isolation:isolate}
.bl-switcher>summary{display:flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:7px 12px;border:1px solid var(--bl-line);border-radius:var(--bl-radius);background:transparent;color:var(--bl-ink);cursor:pointer;list-style:none;white-space:nowrap;user-select:none;font:inherit}
.bl-switcher>summary::-webkit-details-marker{display:none}
.bl-switcher>summary:after{content:'＋';font:16px/1 sans-serif;color:var(--bl-muted)}
.bl-switcher[open]>summary:after{content:'−'}
.bl-switcher>summary:hover,.bl-switcher[open]>summary{background:var(--bl-soft);border-color:var(--bl-accent)}
.bl-switcher .bl-mark{display:grid;grid-template-columns:repeat(2,3px);gap:3px;transform:rotate(-8deg)}
.bl-switcher .bl-mark i{display:block;width:3px;height:3px;border-radius:50%;background:currentColor}
.bl-switcher .bl-panel{display:block;position:fixed;z-index:2000;inset:auto;top:var(--bl-top,96px);right:var(--bl-right,24px);margin:0;width:min(700px,calc(100vw - 32px));max-height:var(--bl-height,calc(100dvh - 120px));overflow:auto;overscroll-behavior:contain;padding:22px;background:var(--bl-paper);color:var(--bl-ink);border:1px solid var(--bl-line);border-radius:var(--bl-radius);box-shadow:0 18px 48px #0002;letter-spacing:0;text-align:left;box-sizing:border-box}
.bl-switcher:not([open])>.bl-panel{display:none}
.bl-switcher .bl-panel-top{display:flex;align-items:center;justify-content:space-between;gap:15px;margin:0 0 17px}
.bl-switcher .bl-panel-top strong{display:block;font:500 19px/1.6 var(--bl-font);color:var(--bl-ink)}
.bl-switcher .bl-panel-top small{display:block;font:9px/1.7 sans-serif;letter-spacing:2px;color:var(--bl-muted)}
.bl-switcher .bl-close{display:none;flex:none;width:44px;height:44px;min-height:44px;border:1px solid var(--bl-line);border-radius:var(--bl-radius);font:22px/1 sans-serif;color:var(--bl-muted);background:transparent;cursor:pointer;padding:0}
.bl-switcher[data-enhanced] .bl-close{display:block}
.bl-switcher .bl-grid,.bl-shelf .bl-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(105px,1fr));gap:0;margin:0;padding:0;border:1px solid var(--bl-line);border-radius:var(--bl-radius);overflow:hidden}
.bl-switcher a.bl-card,.bl-shelf a.bl-card{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:10px;position:relative;min-width:0;min-height:148px;margin:0;padding:18px 13px;text-decoration:none;text-align:left;border:0;border-radius:0;background:none;color:var(--bl-ink);font:14px/1.5 var(--bl-font);letter-spacing:0;box-shadow:inset -1px 0 var(--bl-line);transition:background .18s}
.bl-switcher a.bl-card:last-child,.bl-shelf a.bl-card:last-child{box-shadow:none}
.bl-switcher a.bl-card:hover,.bl-shelf a.bl-card:hover{background:var(--bl-soft);color:var(--bl-ink);transform:none}
.bl-card .bl-glyph{display:grid;place-items:center;width:29px;height:31px;border:1px solid var(--bl-line);border-radius:var(--bl-radius);font:16px/1 var(--bl-font);color:var(--bl-ink);border-bottom:2px solid var(--bl-destination);flex:none}
.bl-card .bl-copy{display:block;min-width:0}
.bl-card .bl-copy b{display:block;font:500 16px/1.5 var(--bl-font);color:var(--bl-ink);white-space:nowrap}
.bl-card .bl-copy small{display:block;margin-top:6px;font:11px/1.7 var(--bl-font);color:var(--bl-muted);letter-spacing:0}
.bl-card .bl-state{display:block;margin-top:auto;font:10px/1.5 var(--bl-font);color:var(--bl-muted)}
.bl-switcher a[aria-current],.bl-shelf a[aria-current]{background:var(--bl-soft)}
.bl-switcher .bl-panel-note{margin:14px 0 0;padding:0;font:11px/1.7 var(--bl-font);color:var(--bl-muted)}
.bl-switcher :is(summary,a,button):focus-visible,.bl-shelf a:focus-visible,.bl-inline a:focus-visible{outline:2px solid var(--bl-accent);outline-offset:-3px}
.bl-shelf{display:block;margin:46px auto 32px;color:var(--bl-ink);font-family:var(--bl-font)}
.bl-shelf .bl-shelf-heading{display:flex;justify-content:space-between;align-items:baseline;gap:15px;margin-bottom:20px}
.bl-shelf .bl-shelf-heading h2{font:400 24px/1.5 var(--bl-font);margin:0;color:var(--bl-ink)}
.bl-shelf .bl-shelf-heading span{font:9px/1.5 sans-serif;letter-spacing:2px;color:var(--bl-muted)}
.bl-shelf>p{font:13px/1.8 var(--bl-font);color:var(--bl-muted);margin:16px 0}
.bl-inline{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:4px 18px;margin:0 auto 12px;font:13px/1.5 var(--bl-font)}
.bl-inline a{display:inline-flex;align-items:center;min-height:44px;padding:5px 0;color:var(--bl-ink);text-decoration:none;white-space:nowrap;border-bottom:1px solid transparent}
.bl-inline a:hover{border-color:var(--bl-accent)}
.bl-inline a[aria-current]{border-color:var(--bl-line)}
.bl-fallback{position:fixed;top:16px;right:16px;z-index:20}
body[data-bl-site=poetry] .site-nav{z-index:110}
body[data-bl-site] :is(.site-nav,.topbar):has(.bl-switcher[open]){backdrop-filter:none}
body[data-bl-site=draw] .topbar,body[data-bl-site=chat] .topbar{z-index:110}
body[data-bl-site=draw] .topbar-inner{gap:22px}
body[data-bl-site=draw] #topnav{min-width:0}
body[data-bl-site=map] .masthead{position:relative;z-index:20;gap:18px}
body[data-bl-site=solar] header{gap:18px}
body[data-bl-site=solar] .bl-switcher{font-size:12px}
body[data-bl-site=solar] .bl-switcher>summary{padding:5px 10px;min-height:36px}
body[data-bl-site=solar].immersive .bl-switcher{display:none}
@media(max-width:1100px){body[data-bl-site=solar] .bl-mark{display:none}}
@media(max-width:700px){
 .bl-switcher>summary{padding:6px 10px;font-size:13px}
 .bl-switcher .bl-panel{padding:18px;width:calc(100vw - 24px);right:12px;top:var(--bl-top,88px);max-height:var(--bl-height,calc(100dvh - 110px))}
 .bl-switcher .bl-panel-top{margin-bottom:14px}.bl-switcher .bl-panel-top strong{font-size:19px}
 .bl-switcher .bl-grid{grid-template-columns:1fr}
 .bl-switcher a.bl-card{min-height:65px;display:flex;flex-direction:row;align-items:center;gap:12px;padding:10px 12px;box-shadow:inset 0 -1px var(--bl-line)}
 .bl-switcher .bl-copy b{font-size:15px}.bl-switcher .bl-copy small{margin-top:2px;font-size:11px}
 .bl-switcher .bl-state{margin:0 0 0 auto;white-space:nowrap}
 .bl-shelf .bl-grid{grid-template-columns:1fr}
 .bl-shelf a.bl-card{min-height:70px;flex-direction:row;align-items:center;gap:14px;padding:12px 16px;box-shadow:inset 0 -1px var(--bl-line)}
 .bl-shelf .bl-state{margin:0 0 0 auto;white-space:nowrap}.bl-shelf .bl-copy small{margin-top:2px}
 .bl-shelf .bl-shelf-heading h2{font-size:21px}.bl-shelf .bl-shelf-heading span{font-size:8px}
 body[data-bl-site=poetry] .site-nav,html.night-read body[data-bl-site=poetry] .site-nav{grid-template-columns:minmax(0,1fr) auto 44px;gap:8px}
 body[data-bl-site=poetry] .site-nav>.bl-switcher{grid-row:1;grid-column:2;justify-self:end}
 body[data-bl-site=poetry] .site-nav>.night-toggle{grid-row:1;grid-column:3}
 body[data-bl-site=poetry] .site-nav>.nav-links{grid-column:1/-1}
 body[data-bl-site=draw] .topbar-inner{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 12px}
 body[data-bl-site=draw] .topbar-inner>.logo{grid-row:1;grid-column:1}
 body[data-bl-site=draw] .topbar-inner>.bl-switcher{grid-row:1;grid-column:2}
 body[data-bl-site=draw] #topnav{grid-row:2;grid-column:1/-1}
 body[data-bl-site=chat] .topbar-inner{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px}
 body[data-bl-site=chat] .topbar-inner>.brand{grid-row:1;grid-column:1/4;margin-bottom:9px}
 body[data-bl-site=chat] .topbar-inner>.bl-switcher{grid-row:1;grid-column:4/6;justify-self:end;margin-bottom:9px}
 body[data-bl-site=chat] .topbar-inner>:is(#btnTheme,#btnSessions,#btnSearch,#btnExport,#btnNew){grid-row:2;grid-column:auto;margin:0;padding:6px 2px;font-size:12px;min-width:0}
 body[data-bl-site=map] .masthead{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px}
 body[data-bl-site=map] .masthead>.brand{grid-row:1;grid-column:1}
 body[data-bl-site=map] .masthead>.bl-switcher{grid-row:1;grid-column:2}
 body[data-bl-site=map] .masthead>nav{grid-row:2;grid-column:1/-1;justify-content:center}
 body[data-bl-site=solar] header{gap:10px}
 body[data-bl-site=solar] .header-actions{gap:3px}
 body[data-bl-site=solar] .bl-switcher>summary{min-height:44px;padding:4px 7px;font-size:11px}
 body[data-bl-site=solar] .bl-switcher>summary:after{font-size:12px}
}
@media(max-width:760px){
 body[data-bl-site=solar] .header-actions{gap:2px}
 body[data-bl-site=solar] .header-actions #view-open{font-size:0}
 body[data-bl-site=solar] .header-actions #view-open:after{content:'手记';font-size:9px}
 body[data-bl-site=solar] .brand{font-size:15px;gap:6px;letter-spacing:.2em}
 body[data-bl-site=solar] header{padding-inline:12px;gap:8px}
 body[data-bl-site=solar] .bl-switcher .bl-mark{display:none}
 body[data-bl-site=solar] .bl-switcher>summary{min-height:44px;padding:4px 6px;gap:3px;font-size:11px}
}
@media(prefers-reduced-motion:reduce){.bl-switcher *,.bl-shelf *{transition:none!important}}
@media print{.bl-switcher,.bl-shelf,.bl-inline,.bl-fallback{display:none!important}}
