@charset "utf-8";
/* TOCX_V1 文章页目录统一增强样式(8 套模板通用) —— 配套 js/public/tocx.js
   正文里的目录: 去掉卡片外框, 用「竖色条标题 + 数量徽标 + 序号列表 + 当前章节高亮」, 颜色/字体沿用各模板自己的变量, 和正文融为一体
   悬浮目录: 滚过正文目录后, 左下角出现带阅读进度环的小按钮, 点开是目录面板(手机是底部抽屉) */

/* ---- 各模板的配色变量(--tx-*) ---- */
html body .tocx{--tx-ac:var(--primary-blue,#2563eb);--tx-ink:#0f172a;--tx-mute:#5b6678;--tx-rule:rgba(100,116,139,.24);--tx-bg:#fff}
html body .d3 .tocx{--tx-ac:var(--m-spot,var(--primary-blue,#2563eb));--tx-ink:var(--m-ink,#0f172a);--tx-mute:var(--m-graphite,#5b6678);--tx-rule:var(--m-line,rgba(100,116,139,.24))}
html body .d4 .tocx{--tx-ac:var(--g-spot,var(--primary-blue,#2563eb));--tx-ink:var(--g-ink,#0f172a);--tx-mute:var(--g-graphite,#5b6678)}
html body .d5 .tocx{--tx-ac:var(--k-spot,var(--primary-blue,#2563eb));--tx-ink:var(--k-ink,#0f172a);--tx-mute:var(--k-graphite,#5b6678)}
html body .th-main .tocx{--tx-ac:var(--t-brand,var(--primary-blue,#2563eb));--tx-ink:var(--t-ink,#171a21);--tx-mute:var(--t-muted,#5b6270);--tx-rule:var(--t-rule,#e3e6eb);--tx-bg:var(--t-surface,#fff)}

/* ---- 正文里的目录 ---- */
html body .article-body .tocx.tocx{margin:0 0 clamp(26px,3vw,40px);padding:0;border:0;border-radius:0;background:none;box-shadow:none;font-size:15px;line-height:1.55;color:var(--tx-ink);font-family:inherit}
html body .article-body .tocx.tocx>summary{display:flex;align-items:center;gap:.7rem;margin:0;padding:.1rem 0 .85rem;border:0;border-bottom:1px solid var(--tx-rule);cursor:pointer;list-style:none;
  font-size:1rem;font-weight:700;line-height:1.3;letter-spacing:0;text-transform:none;color:var(--tx-ink);-webkit-user-select:none;user-select:none;transition:color .2s}
html body .article-body .tocx.tocx>summary::-webkit-details-marker{display:none}
html body .article-body .tocx.tocx>summary::before{content:"";flex:none;width:4px;height:1.15em;border-radius:2px;background:var(--tx-ac)}
html body .article-body .tocx.tocx>summary:hover{color:var(--tx-ac)}
html body .article-body .tocx.tocx>summary:focus-visible{outline:2px solid var(--tx-ac);outline-offset:4px;border-radius:4px}
html body .article-body .tocx.tocx>summary::after{content:"";margin:0 .15rem 0 auto;flex:none;width:.5rem;height:.5rem;border:0;border-right:2px solid currentColor;border-bottom:2px solid currentColor;opacity:.55;
  transform:rotate(45deg) translate(-1px,-1px);transition:transform .22s}
html body .article-body .tocx.tocx[open]>summary::after{transform:rotate(-135deg) translate(-1px,-1px)}
html body .article-body .tocx.tocx .tocx-n{flex:none;min-width:1.7em;padding:.12em .6em;border-radius:999px;background:rgba(127,127,127,.13);background:color-mix(in srgb,var(--tx-ac) 11%,transparent);
  color:var(--tx-ac);font-size:.74rem;font-weight:700;line-height:1.45;text-align:center;font-variant-numeric:tabular-nums}
html body .article-body .tocx.tocx>ol{counter-reset:tx;margin:0;padding:.6rem 0 .2rem;max-width:none;list-style:none;columns:auto}
html body .article-body .tocx.tocx li{counter-increment:tx;margin:0;padding:0;border:0;list-style:none;break-inside:avoid}
html body .article-body .tocx.tocx li::before{content:none}
html body .article-body .tocx.tocx a{position:relative;display:flex;align-items:baseline;gap:.85rem;margin:0;padding:.48rem .75rem .48rem .6rem;border:0;border-radius:8px;
  color:var(--tx-mute);font-weight:500;text-decoration:none;box-shadow:none;transition:background-color .18s,color .18s}
html body .article-body .tocx.tocx a::before{content:counter(tx,decimal-leading-zero);flex:none;min-width:1.75em;color:var(--tx-ac);opacity:.7;font-size:.78em;font-weight:700;letter-spacing:.02em;font-variant-numeric:tabular-nums}
html body .article-body .tocx.tocx a:hover{background:rgba(127,127,127,.08);color:var(--tx-ink)}
html body .article-body .tocx.tocx a:focus-visible{outline:2px solid var(--tx-ac);outline-offset:-2px}
html body .article-body .tocx.tocx a.on{background:rgba(127,127,127,.09);background:color-mix(in srgb,var(--tx-ac) 9%,transparent);color:var(--tx-ink);font-weight:600}
html body .article-body .tocx.tocx a.on::before{opacity:1}
html body .article-body .tocx.tocx a.on::after{content:"";position:absolute;left:0;top:.45em;bottom:.45em;width:3px;border-radius:2px;background:var(--tx-ac)}
/* 三级(h3)缩进, 序号换成小横线 */
html body .article-body .tocx.tocx li>ol{counter-reset:tx2;margin:0 0 .25rem 2.4rem;padding:0;list-style:none;max-width:none;columns:auto}
html body .article-body .tocx.tocx li li{counter-increment:tx2}
html body .article-body .tocx.tocx li li a{padding:.3rem .75rem .3rem .6rem;font-size:.93em;font-weight:400}
html body .article-body .tocx.tocx li li a::before{content:"\2013";min-width:1em;opacity:.55;font-size:1em}
@media(min-width:900px){html body .article-body .tocx.tocx.is-2col>ol{columns:2;column-gap:2.4rem}}
@media(max-width:640px){html body .article-body .tocx.tocx a{padding:.55rem .5rem}html body .article-body .tocx.tocx li>ol{margin-left:1.6rem}}
@media(prefers-reduced-motion:reduce){html body .article-body .tocx.tocx *{transition:none!important}}

/* ---- 悬浮目录(左下角) ---- */
.tocx-fab{position:fixed;left:max(16px,env(safe-area-inset-left));bottom:max(22px,env(safe-area-inset-bottom));z-index:900;font-family:inherit;
  --tx-ac:#2563eb;--tx-ink:#0f172a;--tx-mute:#5b6678;--tx-rule:rgba(100,116,139,.24);--tx-bg:#fff}
.tocx-fab[hidden]{display:none}
.tocx-btn{display:inline-flex;align-items:center;gap:.6rem;height:46px;margin:0;padding:0 1rem 0 .5rem;border:0;border-radius:999px;background:var(--tx-bg);color:var(--tx-ink);
  box-shadow:0 0 0 1px var(--tx-rule),0 10px 28px rgba(15,23,42,.16);font-family:inherit;font-size:14px;font-weight:600;line-height:1;cursor:pointer;transition:transform .2s,box-shadow .2s}
.tocx-btn:hover{transform:translateY(-2px);box-shadow:0 0 0 1px var(--tx-ac),0 14px 32px rgba(15,23,42,.2)}
.tocx-btn:focus-visible{outline:2px solid var(--tx-ac);outline-offset:3px}
.tocx-ring{position:relative;flex:none;width:34px;height:34px;border-radius:50%;background:conic-gradient(var(--tx-ac) calc(var(--p,0)*1%),rgba(127,127,127,.2) 0)}
.tocx-ring::before{content:"";position:absolute;inset:3.5px;border-radius:50%;background:var(--tx-bg)}
.tocx-ring svg{position:absolute;left:50%;top:50%;width:15px;height:15px;margin:-7.5px 0 0 -7.5px;color:var(--tx-ac)}
.tocx-lbl{max-width:11em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tocx-pop{position:absolute;left:0;bottom:58px;width:min(350px,calc(100vw - 32px));max-height:min(62vh,480px);display:flex;flex-direction:column;overflow:hidden;
  border-radius:14px;background:var(--tx-bg);color:var(--tx-ink);box-shadow:0 0 0 1px var(--tx-rule),0 22px 60px rgba(15,23,42,.24);animation:tocxin .18s ease-out}
.tocx-pop[hidden]{display:none}
@keyframes tocxin{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.tocx-ph{display:flex;align-items:center;gap:.6rem;padding:14px 16px 10px}
.tocx-ph b{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:15px}
.tocx-pct{flex:none;color:var(--tx-ac);font-size:13px;font-weight:700;font-variant-numeric:tabular-nums}
.tocx-x{flex:none;width:30px;height:30px;margin:0;padding:0;border:0;border-radius:50%;background:transparent;color:var(--tx-mute);font-size:20px;line-height:1;cursor:pointer}
.tocx-x:hover{background:rgba(127,127,127,.12);color:var(--tx-ink)}
.tocx-bar{height:3px;margin:0 16px 6px;border-radius:2px;background:rgba(127,127,127,.18);overflow:hidden}
.tocx-bar i{display:block;height:100%;width:calc(var(--p,0)*1%);background:var(--tx-ac);transition:width .15s linear}
.tocx-list{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:4px 8px 8px;scrollbar-width:thin}
.tocx-list ol{counter-reset:tp;margin:0;padding:0;list-style:none}
.tocx-list li{counter-increment:tp;margin:0;padding:0;list-style:none}
.tocx-list li>ol{margin:0 0 2px 1.9rem}
.tocx-list a{position:relative;display:flex;gap:.7rem;align-items:baseline;padding:.55rem .7rem;border-radius:8px;color:var(--tx-mute);font-size:14px;line-height:1.45;font-weight:500;text-decoration:none;transition:background-color .15s,color .15s}
.tocx-list a::before{content:counter(tp,decimal-leading-zero);flex:none;min-width:1.7em;color:var(--tx-ac);opacity:.7;font-size:.8em;font-weight:700;font-variant-numeric:tabular-nums}
.tocx-list li li a{font-size:13px;font-weight:400}
.tocx-list li li a::before{content:"\2013";opacity:.5}
.tocx-list a:hover{background:rgba(127,127,127,.1);color:var(--tx-ink)}
.tocx-list a.on{background:rgba(127,127,127,.1);background:color-mix(in srgb,var(--tx-ac) 10%,transparent);color:var(--tx-ink);font-weight:600}
.tocx-list a.on::before{opacity:1}
.tocx-list a.on::after{content:"";position:absolute;left:0;top:.5em;bottom:.5em;width:3px;border-radius:2px;background:var(--tx-ac)}
.tocx-top{display:block;padding:11px 16px;border-top:1px solid var(--tx-rule);color:var(--tx-mute);font-size:13px;font-weight:600;text-align:center;text-decoration:none}
.tocx-top:hover{color:var(--tx-ac)}
.tocx-ov{position:fixed;inset:0;z-index:899;background:rgba(15,23,42,.4);animation:tocxfade .18s ease-out}
.tocx-ov[hidden]{display:none}
@keyframes tocxfade{from{opacity:0}to{opacity:1}}
@media(max-width:640px){
  .tocx-fab{left:12px;bottom:max(16px,env(safe-area-inset-bottom))}
  .tocx-lbl{display:none}
  .tocx-btn{height:46px;padding:0 .5rem}
  .tocx-pop{position:fixed;left:0;right:0;bottom:0;width:auto;max-height:72vh;border-radius:18px 18px 0 0;padding-bottom:env(safe-area-inset-bottom);animation:tocxup .22s ease-out}
  @keyframes tocxup{from{transform:translateY(40px);opacity:0}to{transform:none;opacity:1}}
  .tocx-list a{padding:.7rem .7rem}
}
@media(prefers-reduced-motion:reduce){.tocx-pop,.tocx-ov{animation:none}.tocx-btn,.tocx-bar i{transition:none}}
@media print{.tocx-fab,.tocx-ov{display:none!important}}
/* TOCX_V1_END */
