
/* ═══ 阅读进度条 ═══ */
.read-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--accent), #e0884f); z-index: 300; transition: width .1s linear; }
/* ═══ 目录 ═══ */
.toc-box { margin: 0 0 28px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); overflow: hidden; }
.toc-box summary { cursor: pointer; padding: 12px 18px; font-size: 14px; font-weight: 600; color: var(--ink); list-style: none; display: flex; align-items: center; gap: 8px; }
.toc-box summary::before { content: "▸"; color: var(--accent); transition: transform .2s; }
.toc-box[open] summary::before { transform: rotate(90deg); }
.toc-box nav { padding: 2px 18px 14px; }
.toc-box nav a { display: block; font-size: 13.5px; color: var(--ink-3); padding: 5px 0; border-bottom: 1px dashed var(--border); line-height: 1.6; }
.toc-box nav a:last-child { border-bottom: none; }
.toc-box nav a:hover { color: var(--accent); }
.toc-float { display: none; position: fixed; right: calc((100vw - 820px)/2 - 250px); top: 140px; width: 216px; max-height: 70vh; overflow: auto; font-size: 12.5px; }
.toc-float .tf-title { font-size: 12px; letter-spacing: 2px; color: var(--ink-4); font-weight: 500; margin-bottom: 8px; }
.toc-float a { display: block; color: var(--ink-3); padding: 4px 0 4px 12px; border-left: 2px solid var(--border); line-height: 1.5; transition: color .15s, border-color .15s; }
.toc-float a.here { color: var(--accent); border-left-color: var(--accent); }
.toc-float a:hover { color: var(--accent); }
@media (min-width: 1380px) { .toc-float { display: block; } .toc-box { display: none; } }
/* ═══ 代码复制按钮 ═══ */
.pre-wrap { position: relative; }
.copy-btn { position: absolute; top: 10px; right: 10px; padding: 4px 12px; font-size: 12px; font-family: inherit; color: #cdd6f4; background: rgba(205,214,244,.12); border: 1px solid rgba(205,214,244,.25); border-radius: 6px; cursor: pointer; opacity: 0; transition: opacity .2s, background .2s; }
.pre-wrap:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: rgba(205,214,244,.22); }
.copy-btn.done { color: #a6e3a1; border-color: rgba(166,227,161,.4); }
/* ═══ 上一篇/下一篇 + 相关文章(紧凑脚注式, 贴正文排版) ═══ */
.art-nav { display: flex; justify-content: space-between; gap: 24px; margin: 44px 0 0; padding-top: 18px; border-top: 1px solid var(--border); }
.art-nav-item { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 0; border: none; background: none; transition: none; }
.art-nav-item.next { text-align: right; align-items: flex-end; }
.art-nav-item span { font-size: 12px; color: var(--ink-4); }
.art-nav-item strong { font-size: 13.5px; font-weight: 500; color: var(--ink); line-height: 1.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .15s; }
.art-nav-item:hover { border: none; transform: none; box-shadow: none; }
.art-nav-item:hover strong { color: var(--accent); }
.art-nav-empty { visibility: hidden; }
.related { margin-top: 30px; padding-top: 16px; border-top: 1px dashed var(--border); }
.related h3 { font-family: inherit; font-size: 13px; font-weight: 500; color: var(--ink-4); margin: 0 0 10px; padding: 0; border: none; letter-spacing: 1px; }
.rel-grid { display: flex; flex-direction: column; gap: 8px; }
.rel-card { display: flex; align-items: baseline; gap: 9px; padding: 0; border: none; background: none; transition: none; }
.rel-card:hover { border: none; transform: none; }
.rel-card .rc-tag { flex: none; display: inline-block; font-size: 11px; padding: 1.5px 9px; background: #fffde0; color: #b45309; border-radius: 100px; font-weight: 500; }
.rel-card .rc-title { font-size: 13.5px; font-weight: 400; color: var(--ink-2); line-height: 1.7; transition: color .15s; }
.rel-card:hover .rc-title { color: var(--accent); }
.rel-card .rc-desc { display: none; }
@media (max-width: 560px) { .art-nav { gap: 16px; } .art-nav-empty { display: none; } }
/* ═══ 深色模式(跟随系统) ═══ */
@media (prefers-color-scheme: dark) {
    :root { --bg: #17161A; --surface: #1E1D23; --ink: #EAE8E4; --ink-2: #C9C6C0; --ink-3: #9C9890; --ink-4: #6F6B64; --accent: #E0884F; --accent-l: rgba(224,136,79,.16); --border: #34323B; --bl: #26252B; }
    .nav { background: rgba(23,22,26,.88); backdrop-filter: blur(12px); }
    .article-tag { background: rgba(224,136,79,.15); color: #E0884F; }
    .callout { background: rgba(224,136,79,.09); }
    .callout strong { color: #E0884F; }
    .callout.danger { background: rgba(220,38,38,.12); }
    .callout.danger strong { color: #f87171; }
    .callout.ok { background: rgba(46,125,50,.14); }
    .callout.ok strong { color: #66bb6a; }
    .rel-card .rc-tag, .badge { background: rgba(224,136,79,.15); color: #E0884F; }
    .badge.bad { background: rgba(220,38,38,.15); color: #f87171; }
    .badge.good { background: rgba(46,125,50,.16); color: #66bb6a; }
    .art-nav-item, .rel-card, .toc-box { background: var(--bg); }
}
