/**
 * 培训/文章页「本篇目录」紧凑布局：短标题一行可排 5～6 个，长标题自动占宽换行。
 * 在页面内联样式之后加载，覆盖各页 .toc ol 的 grid 全宽规则。
 */
.toc ol {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px;
    align-items: stretch;
    grid-template-columns: unset !important;
}

.toc li {
    margin: 0;
    flex: 0 1 auto;
    max-width: 100%;
    list-style: none;
}

.toc a {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 8px 12px !important;
    border-radius: 10px;
    height: auto !important;
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
}

.toc a .toc-label {
    flex: 0 1 auto;
    line-height: 1.35;
}

.toc a .toc-arrow {
    margin-left: 2px;
    flex-shrink: 0;
    font-size: 14px;
}

.toc a .toc-num,
.toc-num {
    flex-shrink: 0;
    width: 24px !important;
    height: 24px !important;
    font-size: 11px !important;
}

@media (max-width: 768px) {
    .toc ol {
        gap: 6px;
    }

    .toc a {
        padding: 7px 10px !important;
        font-size: 13px;
    }

    .toc a .toc-num,
    .toc-num {
        width: 22px !important;
        height: 22px !important;
    }
}

@media print {
    .toc ol {
        gap: 6px;
    }
}
