/* Handwritten notebook throughout; reserve monospace for code. */
.notebook-theme{--reading-font:var(--hand)}
/* Poetic menu titles retain an accessible, literal destination caption. */
.notebook-theme .notebook-masthead nav a:has(>.menu-item-caption){position:relative;padding-bottom:26px}
.notebook-theme .menu-item-caption{position:absolute;bottom:3px;left:50%;width:max-content;max-width:180px;transform:translateX(-50%);font:13px/1.5 var(--hand);color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;opacity:0;visibility:hidden;pointer-events:none}
.notebook-theme .notebook-masthead nav li:hover>a>.menu-item-caption,.notebook-theme .notebook-masthead nav li:focus-within>a>.menu-item-caption{opacity:1;visibility:visible}
.notebook-theme .notebook-menu .current-menu-item>a{text-decoration-style:wavy;text-decoration-thickness:1px;text-decoration-color:var(--accent)}
.notebook-theme .notebook-menu .current-menu-item>a:has(>.menu-item-caption){text-decoration:none}
.notebook-theme .notebook-menu .current-menu-item>a>.menu-item-label{text-decoration:underline wavy var(--accent);text-decoration-thickness:1px;text-underline-offset:8px}
@media(prefers-reduced-motion:no-preference){.notebook-theme .menu-item-caption{transition:opacity .16s ease}}
@media(max-width:680px){
 .notebook-theme .notebook-masthead nav a:has(>.menu-item-caption){display:flex;align-items:baseline;gap:12px;min-width:0;padding-bottom:10px}
 .notebook-theme .menu-item-label{display:inline-block;flex:0 0 auto;line-height:1.6}
 .notebook-theme .notebook-menu .current-menu-item>a>.menu-item-label{text-underline-offset:4px}
 .notebook-theme .menu-item-caption{position:static;display:block;flex:0 1 auto;min-width:0;width:auto;max-width:none;margin:0;transform:none;white-space:nowrap;opacity:1;visibility:visible}
}
@media(hover:none){.notebook-theme .menu-item-caption{opacity:1;visibility:visible}}
@media print{.notebook-theme .menu-item-caption{display:none}}

/* Border hierarchy: quiet paper rules, structural ink, and functional outlines. */
:root{--rule-strong:#a0aa98;--control-line:#818d7c;--binding-line:#7b8e73}
html[data-color-mode=dark]{--rule-strong:#788777;--control-line:#8a9b80;--binding-line:#90a582}
/* Desktop daylight: warm natural paper, close to the original without grey-green tint.
   Screen-only and explicitly excluding dark mode; mobile retains its existing palette. */
@media screen and (min-width:981px){
 :root:not([data-color-mode=dark]){--paper:#f7f4ec;--sheet:#fffdf7;--sage:#ececde;--line:#dddccf;--muted:#626b62;--rule-strong:#9da89e;--control-line:#7a877d;--binding-line:#7c8d7c}
 html:not([data-color-mode=dark]) .notebook-theme{background-image:radial-gradient(#53645a0a .65px,transparent .65px)}
 html:not([data-color-mode=dark]) .notebook-theme ::selection{background:#d9e2d7}
 html:not([data-color-mode=dark]) .intro-copy h1 span::after{background:#98aa9440}
 html:not([data-color-mode=dark]) .notebook-profile:before{background:#b7c1af80}
}

.notebook-theme .notebook-masthead,.notebook-theme .notebook-footer{border-color:var(--rule-strong)}
.notebook-theme .notebook-section,.notebook-theme .title,.notebook-theme .archive-header{border-bottom:1px solid var(--rule-strong)}
.notebook-theme .notebook-profile,.notebook-theme .manual-title{border-color:var(--line)}
.notebook-theme .notebook-profile a{border-color:var(--rule-strong)}
.notebook-theme .notebook-profile:after{border-color:var(--binding-line)}
.notebook-theme .notebook-utility form,.notebook-theme .notebook-rss,.notebook-theme .notebook-toggle,.notebook-theme .color-toggle{border-color:var(--control-line)}
.notebook-theme :is(textarea,input[type=text],input[type=email],input[type=url],select){border-color:var(--control-line)}
.notebook-theme :is(textarea,input[type=text],input[type=email],input[type=url],select):focus{border-color:var(--accent);outline:2px solid var(--accent);outline-offset:2px}
.notebook-theme :is(.notebook-rss,.notebook-toggle,.color-toggle):hover{border-color:var(--accent)}
.notebook-theme .article-content :is(h2,h3,h4,h5,h6){border-color:var(--line);background:transparent}
.notebook-theme .article-content h2{border-left-color:var(--accent)}
.notebook-theme .article-content blockquote{border:0;border-left:3px solid var(--binding-line)}
.notebook-theme .article-content table,.notebook-theme .article-content :is(th,td){border-color:var(--line)}
.notebook-theme .article-content th{background:var(--sage)}
.notebook-theme .article-content .table-striped tbody>tr:nth-child(odd)>:is(td,th){background:var(--sheet)}
.notebook-theme .article-content .table-hover tbody tr:hover>:is(td,th){background:var(--sage)}
.notebook-theme .article-footer{border-top:0}
.notebook-theme .relates h3{border-bottom:0}
.notebook-theme :is(.archives .item,.children .comment,#comments,.comt-title,.comt-comterinfo ul,.comment #respond,.d_comment ul a,.widget_calendar th,.widget_calendar td){border-color:var(--line)}
.notebook-theme .comt-title{background:transparent}
.notebook-theme .comt-submit{border:1px solid var(--control-line);background:var(--sheet);color:var(--ink);box-shadow:none}
.notebook-theme .comt-submit:hover{border-color:var(--accent);background:var(--sage)}
.notebook-theme .comt-submit:active{box-shadow:none}
.notebook-theme .article-actions :is(button,a){border-color:var(--control-line)}
.notebook-theme .article-actions :is(button,a):hover{border-color:var(--accent)}
.notebook-theme .pagination ul>.active>:is(a,span){border-color:var(--rule-strong)}
@media print{:root{--rule-strong:#777;--control-line:#777;--binding-line:#777}}

/* Keep volume labels visible while long titles ellipsize, including on mobile. */
.notebook-theme .article-nav{--volume-ink:#536057;--volume-accent:#a44332;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;padding:18px 0;font:17px/1.7 var(--hand)}
.notebook-theme .article-nav>div{display:flex;align-items:center;gap:10px;min-width:0}
.notebook-theme .article-nav .article-nav-next{grid-column:2;text-align:right}
.notebook-theme .article-nav .article-nav-label{float:none;flex:none;color:var(--volume-accent)}
.notebook-theme .article-nav a{display:block;min-width:0;min-height:44px;line-height:44px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:var(--volume-ink)}
.notebook-theme .article-nav a:hover,.notebook-theme .article-nav a:focus-visible{color:var(--volume-accent)}
html[data-color-mode=dark] .notebook-theme .article-nav{--volume-ink:var(--ink);--volume-accent:var(--accent)}
.notebook-theme .article-nav .article-nav-next a{flex:1}
@media(max-width:680px){.notebook-theme .article-nav{gap:12px;font-size:16px}.notebook-theme .article-nav>div{gap:6px}}
.notebook-theme .article-content,.notebook-theme .excerpt .note{font-family:var(--reading-font);font-size:19px;line-height:1.95;letter-spacing:.015em}
.notebook-theme .article-content{overflow-wrap:break-word}
.notebook-theme .article-content h2,.notebook-theme .article-content h3,.notebook-theme .article-content h4{font-family:var(--hand);scroll-margin-top:24px}
.notebook-theme .article-content pre{position:relative;padding:48px 18px 18px;font:14px/1.75 Consolas,"SFMono-Regular",monospace;white-space:pre;word-break:normal;overflow-wrap:normal;overflow-x:auto;tab-size:4}
.notebook-theme .article-content pre code{font:inherit;white-space:inherit;word-break:normal;overflow-wrap:normal}
.notebook-theme .meta{display:flex;flex-wrap:wrap;align-items:center;gap:6px 16px;font:15px/1.7 var(--reading-font);color:var(--muted)}
.notebook-theme .meta>span,.notebook-theme .meta>time,.notebook-theme .excerpt .muted{white-space:nowrap}
.notebook-theme .excerpt>p:not(.note){font-family:var(--reading-font);line-height:1.8}
.notebook-theme .code-copy{position:absolute;right:10px;top:8px;min-height:32px;padding:2px 10px;border:1px solid #87958b;background:#26382f;color:#f5f3e9;border-radius:3px;font:12px/1.6 var(--reading-font);cursor:pointer}
.reading-toc{margin:0 0 28px;padding:16px 20px;border:1px solid var(--line);border-left:3px solid var(--accent);background:var(--sheet)}
.reading-toc summary{cursor:pointer;font:20px/1.5 var(--hand)}
.reading-toc ol{margin:14px 0 0 22px;padding:0;font:17px/1.8 var(--reading-font)}
.reading-toc li{padding:3px 0}.reading-toc a{color:var(--ink)}.reading-toc a:hover{color:var(--accent)}
.notebook-theme .pay_support{margin:32px 0 20px;padding:18px 0;background:transparent;border-top:1px dashed var(--line);border-bottom:1px dashed var(--line);box-shadow:none;text-align:left}
.pay_support summary{cursor:pointer;font:18px/1.7 var(--hand);color:var(--accent)}
.pay_support p{font:14px/1.8 var(--reading-font);color:var(--muted)}
.pay_support .alipay_img{display:flex;flex-wrap:wrap;gap:20px;margin-top:16px}
.pay_support figure{margin:0;text-align:center}.pay_support figcaption{font:12px/1.8 var(--reading-font);color:var(--muted)}
.article-actions{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin:18px 0;font:14px/1.7 var(--reading-font)}
.article-actions button,.article-actions a{display:inline-flex;align-items:center;min-height:44px;box-sizing:border-box;padding:6px 14px;background:transparent;color:var(--ink);border:1px solid var(--line);border-radius:3px;cursor:pointer;font:inherit}
.article-actions [hidden]{display:none!important}
.article-actions button:hover,.article-actions a:hover{border-color:var(--accent);color:var(--accent)}
.article-action-status{flex-basis:100%;color:var(--muted);overflow-wrap:anywhere}
.notebook-theme .relates ul{display:block;columns:auto}.notebook-theme .relates li{float:none;width:auto;padding:8px 0;font:15px/1.8 var(--reading-font)}
/* Historical posts can carry inline white backgrounds. Override headings only. */
html[data-color-mode=dark] .notebook-theme .article-content :is(h2,h3,h4),
html[data-color-mode=dark] .notebook-theme .article-content :is(h2,h3,h4) *{background:transparent!important;color:var(--ink)!important}
html[data-color-mode=dark] .notebook-theme .article-content :is(h2,h3,h4){border-color:var(--line)!important;border-left-color:var(--accent)!important}
@media(max-width:680px){
 .notebook-theme .notebook-intro{display:block;min-height:0;padding:30px 0 28px;margin-bottom:24px}
 .notebook-intro .intro-copy h1{font-size:31px;line-height:1.5;margin:12px 0}
 .notebook-intro .intro-copy p{font:16px/1.85 var(--reading-font);margin:12px 0;max-width:30em}
 .notebook-compact-mobile .notebook-intro .intro-sketch{display:none}
 .notebook-theme .notebook-section{padding-top:12px;margin-bottom:20px}
 .notebook-theme .sticky{padding:12px 0;margin-top:12px}
 .notebook-theme .article-title{font-size:27px;line-height:1.6}
 .notebook-theme .article-content{padding:22px 16px;font-size:19px;line-height:1.95}
 .notebook-theme .article-content pre{margin-left:0;margin-right:0;font-size:14px}
 .reading-toc{padding:12px 16px}
 .notebook-theme .excerpt .note{font-size:17px;line-height:1.9}
}
@media print{.reading-toc,.code-copy,.article-actions,.pay_support{display:none!important}.notebook-theme .article-content pre{padding:12px;white-space:pre-wrap}}
