/* Article sidebar: sticky TOC + important links (p46).
   Fix vs p41: sticky must be on the flex item itself (<aside>). In p41 it was
   on .article-sidebar-inner, but the flex container uses align-items:flex-start,
   so the aside is only as tall as its content and the inner element has zero
   room to stick -- sticky could never engage. With sticky on the aside, its
   containing block is the flex container (.wrap.article-layout), as tall as
   the article, so the sidebar follows the scroll.
   p43 (2026-11-23, user instruction): (1) the baked-in in-content TOC
   (.post-toc) is no longer hidden on desktop -- it shows in its original
   position alongside the sidebar TOC; (2) sidebar text is the same size as
   article body text (17px, html font-size); (3) the important-links block
   is paused (not emitted by publisher.php), its CSS is kept for a future
   restore.
   p44 (2026-11-23, user instruction): (1) the sidebar TOC no longer lists
   H3s inside the 資料來源 section (e.g. 官網實查) -- see publisher.php;
   (2) when the TOC list is taller than the viewport it scrolls on its own:
   max-height on the top-level <ol> only (the 文章目錄 title stays put),
   overflow-y:auto + overscroll-behavior:contain so wheel scrolling over
   the list does not scroll the page. Height budget: sticky top 84px +
   nav border/padding (1+16+12+1) + title (~29px + 10px margin) + ~16px
   safety = ~170px. Sticky stays on the flex item (.article-sidebar)
   itself; the scrolling element is the inner <ol>, so sticky is untouched
   and the aside is never stretched.
   p45 (2026-11-24, user instruction: sidebar TOC should match the small
   body text): sidebar text is now 1rem instead of fixed 17px. Root cause
   of the visible gap: the CSS file says html{font-size:17px}, but site.js
   (A-/A+ control, localStorage 'bb-fs', default index 0) sets the root to
   15px on load, so body paragraphs render at 15px while the fixed-17px
   sidebar looked larger. 1rem tracks the root, so the sidebar equals body
   text at every A-/A+ setting (15px by default) instead of only at one.
   p46 (2026-11-24, user instruction: rounded corners on the sidebar TOC
   box): .article-sidebar-toc (the visible bordered box inside the aside;
   the aside itself has no border/background) gets border-radius:14px,
   matching the baked-in in-content TOC (.post-toc) and other 14px boxes
   site-wide (callout, faq-item, info-table, nav-menu). Same radius on
   .article-sidebar-links (paused, kept for a future restore) so the pair
   stays consistent. Nothing else changes: 1rem text, sticky on the flex
   item, independent TOC scrolling, no 資料來源 H3s, mobile hidden.
   p47 (2026-11-24, user instruction: more space above the sidebar TOC
   box): .article-sidebar gets margin-top:30px on desktop. Root cause of
   the cramped look: the flex container (.wrap.article-layout) starts right
   below the breadcrumb strip, and the aside had no top margin, so the box
   top sat at the container top while the article column starts 30px lower
   (.article{padding-block:30px 44px}). 30px lines the box top up with the
   article kicker. Sticky is untouched: margin only shifts the resting
   position; once scrolled the box still sticks at top:84px, so the
   170px <ol> height budget still holds. Mobile unchanged (sidebar hidden).
   Desktop: article + sidebar side by side. Mobile: sidebar hidden,
   the baked-in in-content TOC (.post-toc) remains the directory. */
.article-layout>.article{min-width:0}
@media (min-width:1024px){
  main#main>.wrap.article-layout{display:flex;align-items:flex-start;gap:32px}
  main#main>.wrap.article-layout>.article{flex:1 1 auto}
  .article-sidebar{flex:0 0 264px;min-width:0;align-self:flex-start;position:sticky;top:84px;margin-top:30px}
}
@media (max-width:1023.98px){
  .article-sidebar{display:none}
}
.article-sidebar-title{margin:0 0 10px;font-size:1rem;font-weight:700;color:var(--ink)}
.article-sidebar-toc{border:1px solid var(--line);background:var(--card);padding:16px 16px 12px;border-radius:14px}
.article-sidebar-toc>ol,.article-sidebar-toc ol ol{list-style:none;margin:0;padding:0}
.article-sidebar-toc>ol{max-height:calc(100vh - 170px);overflow-y:auto;overscroll-behavior:contain}
.article-sidebar-toc>ol>li{margin:0 0 6px}
.article-sidebar-toc ol ol{margin:4px 0 6px 12px}
.article-sidebar-toc a{display:block;padding:3px 8px;border-left:2px solid transparent;color:var(--ink-soft);font-size:1rem;line-height:1.55;text-decoration:none}
.article-sidebar-toc a:hover{color:var(--red-deep)}
.article-sidebar-toc a.is-active{border-left-color:var(--red-deep);background:var(--paper-deep);color:var(--red-deep);font-weight:700}
.article-sidebar-links{margin-top:16px;border:1px solid var(--line);background:var(--card);padding:16px;border-radius:14px}
.article-sidebar-links ul{list-style:none;margin:0;padding:0}
.article-sidebar-links li{margin:0 0 8px}
.article-sidebar-links li:last-child{margin-bottom:0}
.article-sidebar-links a{color:var(--red-deep);font-size:1rem;line-height:1.55}
.article-prose h2[id],.article-prose h3[id]{scroll-margin-top:110px}
