From 490e5f49dc252a8219c6881ddd292342997542ef Mon Sep 17 00:00:00 2001 From: albert4719 Date: Tue, 13 Oct 2026 10:05:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E7=B4=A2=E9=A1=B5=E4=BE=A7=E6=A0=8F?= =?UTF-8?q?=EF=BC=9A=E8=8A=82=E5=90=8D=E6=8A=98=E8=A1=8C=E6=97=B6=E7=BC=96?= =?UTF-8?q?=E5=8F=B7=E6=82=AC=E6=8C=82=E7=BC=A9=E8=BF=9B=E3=80=81=E7=AC=AC?= =?UTF-8?q?=E4=BA=8C=E8=A1=8C=E5=92=8C=E8=8A=82=E5=90=8D=E9=A6=96=E5=AD=97?= =?UTF-8?q?=E5=AF=B9=E9=BD=90=EF=BC=8C=E6=9D=A1=E6=95=B0=E5=92=8C=E6=8A=98?= =?UTF-8?q?=E5=8F=A0=E7=AE=AD=E5=A4=B4=E8=B4=B4=E7=AC=AC=E4=B8=80=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index f340317..4fe0279 100644 --- a/index.html +++ b/index.html @@ -132,10 +132,13 @@ html.dark .switch .sun{display:none} html.dark .switch .moon{display:block} .gt{font-size:14px;font-weight:700;color:var(--t1);line-height:24px;margin-bottom:4px;display:flex;justify-content:space-between;align-items:baseline} .gt small{font-weight:400;font-size:12px;color:var(--t3)} .sec-links{display:flex;flex-direction:column} -.sec-link{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:4px 0;font-size:14px;font-weight:500;color:var(--t2);line-height:24px;text-align:left;transition:color .25s;border-radius:0} +.sec-link{display:flex;justify-content:space-between;align-items:flex-start;gap:8px;padding:4px 0;font-size:14px;font-weight:500;color:var(--t2);line-height:24px;text-align:left;transition:color .25s;border-radius:0} .sec-link:hover{color:var(--t1)} .sec-link[aria-pressed="true"]{color:var(--brand-1)} -.sec-link i{font-style:normal;font-size:12px;color:var(--t3);font-variant-numeric:tabular-nums} +.sec-link i{font-style:normal;font-size:12px;color:var(--t3);font-variant-numeric:tabular-nums;flex:none;min-width:1.6em;text-align:right} +/* 节名折行时:编号单独一列做悬挂缩进,第二行和节名首字对齐;条数、箭头贴第一行 */ +.sec-link .sn{flex:none;width:1.6em;margin-right:-4px;font-variant-numeric:tabular-nums} +.sec-link .st{flex:1;min-width:0;text-wrap:pretty} .sec-link.all{padding-bottom:8px;margin-bottom:4px;border-bottom:1px solid var(--divider)} /* 章节下的条目目录:只展开选中的那节,没选节时展开正在读的那节(issue #38) */ .toc-sub{display:flex;flex-direction:column;margin:2px 0 8px;border-left:1px solid var(--divider)} @@ -148,7 +151,7 @@ html.dark .switch .sun{display:none} html.dark .switch .moon{display:block} .toc-none{margin:0;padding:3px 0 3px 12px;font-size:13px;line-height:20px;color:var(--t3)} /* 折叠箭头:点它只收起或展开目录,不切换章节筛选 */ .sec-link i{margin-left:auto} -.sec-link .fold{flex:none;align-self:stretch;display:grid;place-items:center;width:24px;margin:-4px -6px -4px 0;border-radius:4px;color:var(--t3);transition:transform .2s,color .2s} +.sec-link .fold{flex:none;display:grid;place-items:center;width:24px;height:24px;margin-right:-6px;border-radius:4px;color:var(--t3);transition:transform .2s,color .2s} .sec-link .fold:hover{color:var(--t1);background:var(--bg-mute)} .sec-link .fold svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;transform:rotate(-90deg);transition:transform .2s} .sec-link.open .fold svg{transform:none} @@ -1060,7 +1063,7 @@ function build(sections){ fsec.appendChild(allBtn); for (const s of sections){ const b = document.createElement('button'); b.className='sec-link'; b.dataset.v = s.n; b.setAttribute('aria-pressed','false'); - b.innerHTML = `${s.n}. ${esc(s.title)}${s.entries.length}`; fsec.appendChild(b); + b.innerHTML = `${s.n}.${esc(s.title)}${s.entries.length}`; fsec.appendChild(b); const sub = document.createElement('div'); sub.className = 'toc-sub'; sub.hidden = true; for (const e of s.entries){ const a = document.createElement('a'); a.href = `#e-${e.sec}-${e.n}`; a.dataset.go = `${e.sec}-${e.n}`; a.title = e.title;