/* =========================================================================
   Article detail
   ========================================================================= */
.breadcrumb { display: flex; align-items: center; gap: 7px; padding-top: 26px; font-size: 13px; color: var(--text-muted); flex-wrap: wrap; }
.breadcrumb a { color: var(--text-muted); transition: color .14s; }
.breadcrumb a:hover { color: var(--brand-ink); }
.breadcrumb svg { color: var(--text-faint); flex: none; }
.breadcrumb span { white-space: nowrap; }
.breadcrumb .crumb-title { overflow: hidden; text-overflow: ellipsis; max-width: 40ch; }

.article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 56px; padding-top: 26px; align-items: start; }
@media (max-width: 980px) { .article-grid { grid-template-columns: 1fr; gap: 8px; } .article-side { display: none; } }

.article-head { padding-bottom: 26px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.article-head h1 { font-size: clamp(27px, 4vw, 40px); margin-top: 14px; letter-spacing: -0.035em; line-height: 1.08; }
.article-meta { display: flex; align-items: center; gap: 10px; margin-top: 18px; font-size: 13px; color: var(--text-muted); flex-wrap: wrap; }
.article-meta span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.article-meta svg { color: var(--text-faint); }
.am-author { font-weight: 540; color: var(--text); }
.am-avatar { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: var(--on-brand); font-size: 11px; font-weight: 700; margin-right: 2px; }
.am-dot { color: var(--text-faint); }
.article-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }

/* ---- prose ---- */
.prose { padding-top: 26px; max-width: 720px; }
.prose > * + * { margin-top: 18px; }
.prose .lead { font-size: 18px; line-height: 1.6; color: var(--text-muted); }
.prose h2 { font-size: 23px; margin-top: 42px; scroll-margin-top: 80px; letter-spacing: -0.025em; }
.prose h3 { font-size: 18px; margin-top: 30px; scroll-margin-top: 80px; }
.prose p { font-size: 15.5px; line-height: 1.72; color: var(--text); }
.prose ul { padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; }
.prose ul li { position: relative; padding-left: 24px; font-size: 15.5px; line-height: 1.6; }
.prose ul li::before { content: ""; position: absolute; left: 6px; top: 11px; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.prose code { font-family: var(--mono); font-size: .86em; background: var(--brand-soft); color: var(--brand-ink); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--brand-line); }
.prose a { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; text-decoration-color: var(--brand-line); }
.prose a:hover { text-decoration-color: var(--brand); }

/* code block */
.codeblock { margin: 22px 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--border-strong); background: var(--code-bg); box-shadow: var(--shadow-md); }
.codeblock-bar { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; background: color-mix(in oklab, var(--code-bg), #fff 6%); border-bottom: 1px solid rgba(255,255,255,.07); }
.codeblock-file { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: #c9bfb2; }
.cb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand), transparent 70%); }
.codeblock-copy { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #c9bfb2; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); padding: 5px 9px; border-radius: 7px; transition: background .14s, color .14s; }
.codeblock-copy:hover { background: rgba(255,255,255,.13); color: #fff; }
.codeblock pre { margin: 0; padding: 16px; overflow-x: auto; }
.codeblock code { font-size: 13px; line-height: 1.7; color: var(--code-text); background: none; border: 0; padding: 0; }
.tok-c { color: #8a8170; font-style: italic; }
.tok-s { color: #e9b872; }
.tok-f { color: #7fb3e0; }
.tok-n { color: #d0a0e0; }
.tok-k { color: #f0a878; font-weight: 600; }

/* callout */
.callout { display: flex; gap: 13px; padding: 16px 18px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel-2); margin: 22px 0; }
.callout-ico { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; }
.callout-body { min-width: 0; }
.callout-body strong { display: block; font-size: 14.5px; margin-bottom: 4px; }
.callout-body p, .callout-body li { font-size: 14px; line-height: 1.6; color: var(--text-muted); }
.callout-body ul { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.callout-body ul li { position: relative; padding-left: 18px; }
.callout-body ul li::before { content: ""; position: absolute; left: 4px; top: 9px; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .5; }
.callout-info { background: color-mix(in oklab, var(--blue), var(--bg) 92%); border-color: color-mix(in oklab, var(--blue), var(--bg) 78%); }
.callout-info .callout-ico { background: color-mix(in oklab, var(--blue), var(--bg) 82%); color: var(--blue); }
.callout-warn { background: color-mix(in oklab, var(--amber), var(--bg) 90%); border-color: color-mix(in oklab, var(--amber), var(--bg) 76%); }
.callout-warn .callout-ico { background: color-mix(in oklab, var(--amber), var(--bg) 80%); color: var(--amber); }
.callout-tip { background: var(--brand-soft); border-color: var(--brand-line); }
.callout-tip .callout-ico { background: var(--bg); color: var(--brand-ink); }

.art-image { height: 280px; margin: 24px 0; }
.art-diagram { margin: 24px 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.art-diagram-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--panel-2); border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-muted); }
.art-diagram-canvas { height: 220px; border: 0; border-radius: 0; }

/* feedback */
.article-feedback { margin-top: 48px; padding: 20px 22px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel-2); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.article-feedback span { font-weight: 540; }
.fb-btns { display: flex; gap: 9px; }
.fb-thanks { color: var(--brand-ink); font-weight: 500; }

/* ---- sidebar ---- */
.article-side-sticky { position: sticky; top: calc(var(--header-h) + 22px); display: flex; flex-direction: column; gap: 26px; }
.toc-head { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 12px; font-weight: 600; }
.toc ul, .related-list { list-style: none; margin: 0; padding: 0; }
.toc li a { display: block; padding: 5px 0 5px 13px; font-size: 13.5px; color: var(--text-muted); border-left: 2px solid var(--border); transition: color .14s, border-color .14s; line-height: 1.4; }
.toc li.toc-h3 a { padding-left: 26px; font-size: 13px; }
.toc li a:hover { color: var(--text); }
.toc li.is-active a { color: var(--brand-ink); border-color: var(--brand); font-weight: 540; }
.related { padding-top: 22px; border-top: 1px solid var(--border); }
.related-row { display: flex; align-items: flex-start; gap: 9px; padding: 7px 0; font-size: 13.5px; color: var(--text-muted); transition: color .14s; line-height: 1.4; }
.related-row svg { color: var(--text-faint); flex: none; margin-top: 2px; }
.related-row:hover { color: var(--brand-ink); }
.related-row:hover svg { color: var(--brand); }
.side-help { padding: 16px; }
.side-help strong { font-size: 14.5px; }
.side-help p { font-size: 13px; margin: 5px 0 12px; }
