.widget-wrapper.toc.single .widget-header font-weight: 500 font-size: $fs-12 .toc-item margin-top: 2px .toc-child margin-top: 2px .widget-wrapper.toc .widget-body margin-top: 0 ul ul, ul ol padding-left: 0 ol ul, ol ol padding-left: 0 .toc padding: 0 margin: 0 padding-left: 0.25rem .toc-item .toc-link padding: 0.5rem font-weight: 500 font-size: $fs-13 color: var(--text-p1) .toc-child .toc-item .toc-link padding: 0.25rem 0.5rem 0.25rem 1.3rem font-weight: 400 color: var(--text-p2) .toc-child .toc-child .toc-item .toc-link padding-left: 2.1rem font-size: $fs-12 color: var(--text-p3) .toc-child .toc-child .toc-child .toc-item .toc-link padding-left: 2.9rem .widget-wrapper.toc .toc-item color: var(--text-p2) font-size: $fs-12 padding: 0 list-style: none &.active background: var(--alpha50) border-left-color: @color .toc-child .toc-item padding: 0 .widget-wrapper.toc a.toc-link color: inherit display: block line-height: 1.2 border-radius: $border-bar position: relative trans1 background &:before content: '' position: absolute left: -6px top: 'calc(50% - %s)' % 6px bottom: 'calc(50% - %s)' % 6px width: 2px border-radius: 2px background: var(--text-p0) visibility: hidden &.active background: var(--alpha50) &:before visibility: visible &:hover background: var(--alpha100) // 始终折叠 .widget-wrapper.toc[collapse='true'] .toc-item a.toc-link+ol display: none // 激活上级目录时显示子目录 .toc a.toc-link.active+ol display: block // 自动折叠 .widget-wrapper.toc[collapse='auto'] .toc-item a.toc-link+ol display: none // 激活上级目录时显示子目录 .toc a.toc-link.active+ol display: block // 鼠标放上去时显示子目录 &:hover a.toc-link+ol display: block // 子目录激活时显示 .widget-wrapper.toc[collapse='true'] ol:has(> .toc-item a.active) display: block .widget-wrapper.toc[collapse='auto'] ol:has(> .toc-item a.active) display: block