/* fui_toc — 前台目录样式，跟随 FinchUI 2.0 风格 */

/* 通用基础 */
.fui-toc { display: block; margin: 1.5em 0; line-height: 1.75; }
.fui-toc ul { list-style: none; margin: 0; display: grid; grid-template-columns: 1fr; gap: 10px; align-items: stretch; }
.fui-toc li { margin: 0; padding: 0; line-height: 1.75; overflow: hidden;font-size: 16px; }
.fui-toc a { display: block; color: #444; text-decoration: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; transition: color 0.2s ease; }
.fui-toc a:hover { color: #0069cc; text-decoration: none; }
.fui-toc a:focus { color: #0069cc; outline: none; }
/* 当前激活项 */
.fui-toc a.fui-toc-active { color: #0069cc; font-weight: 600; }
/* 自动编号 */
.fui-toc-number { margin-right: 4px; color: #999; font-variant-numeric: tabular-nums; }
/* 层级缩进 */
.fui-toc-body > ul > li ul { padding-left: 14px; }

/* 标题栏 */
.fui-toc-title { display: flex; justify-content: space-between; cursor: pointer;font-size: 16px;line-height: 1.75;}

/* 折叠箭头 */
.fui-toc-toggle { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex-shrink: 0; cursor: pointer; }
.fui-toc-toggle::before { content: ""; display: inline-block; width: 0; height: 0; border-style: solid; border-width: 7px 5px 0 5px; border-color: #999 transparent transparent transparent; }

/* 折叠时隐藏正文 */
.fui-toc-body { overflow: hidden; transition: max-height 0.2s ease; }
.fui-toc-collapsed .fui-toc-body { display: none; }

/* 样式：简约 (simple) */
.fui-toc.fui-toc-simple { background: transparent; border: none; padding: 0; }
.fui-toc.fui-toc-simple .fui-toc-title { margin-bottom: 8px; padding-bottom: 8px; border-bottom: .01rem solid #ededed; }

/* 样式：边框卡片 (boxed) */
.fui-toc.fui-toc-boxed { background: #fff; border: .01rem solid #ededed; border-radius: 5px; display: flex; flex-direction: column; gap: 0; }
.fui-toc.fui-toc-boxed .fui-toc-title { padding:5px 5px 5px 15px; border-bottom: 1px solid #ededed; }
.fui-toc.fui-toc-boxed .fui-toc-body { padding: 15px; }

/* 样式：浮动侧边栏 (floating) */
.fui-toc.fui-toc-floating { position: fixed; top: 80px; right: 20px; width: 240px; max-height: calc(100vh - 120px); overflow-y: auto; background: #fff; border: .01rem solid #ededed; border-radius: 5px; padding: 15px; z-index: 999; box-shadow: 0 1px 5px rgba(0,0,0,.1); scrollbar-width: thin; scrollbar-color: #ccc transparent; }
.fui-toc.fui-toc-floating::-webkit-scrollbar { width: 4px; }
.fui-toc.fui-toc-floating::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }
.fui-toc.fui-toc-floating .fui-toc-title { padding-bottom: 10px; border-bottom: 2px solid #0069cc; }

/* 小屏退回行内 */
@media (max-width: 1100px) {
    .fui-toc.fui-toc-floating { position: static; width: auto; max-height: none; box-shadow: none; }
}

/* 深色模式 */
.fui-dark .fui-toc a { color: #ccc; }
.fui-dark .fui-toc a:hover { color: #2b90ee; }
.fui-dark .fui-toc a:focus { color: #2b90ee; }
.fui-dark .fui-toc a.fui-toc-active { color: #2b90ee; }
.fui-dark .fui-toc-number { color: #666; }
.fui-dark .fui-toc-title { color: #e6e6e6; }
.fui-dark .fui-toc-toggle::before { border-color: #666 transparent transparent transparent; }
.fui-dark .fui-toc.fui-toc-simple .fui-toc-title { border-bottom-color: #444; }
.fui-dark .fui-toc.fui-toc-boxed { background: #333; border-color: #444; box-shadow: none; }
.fui-dark .fui-toc.fui-toc-floating { background: #333; border-color: #444; box-shadow: 0 1px 5px rgba(0,0,0,.3); }
