.table-of-contents {
    background-color: #f8f8f8;
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
}

.table-of-contents .toc-title {
    color: #333;
    font-size: 24px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.table-of-contents .toc-item {
    margin-bottom: 15px;
    position: relative;
}

.table-of-contents .toc-item h3 {
    font-size: 16px;
    color: #333;
    margin: 0;
    padding: 5px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.table-of-contents .toc-item h3:hover {
    color: #007bff;
}

.table-of-contents .sub-items {
    padding-left: 20px;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform-origin: top;
    transform: translateZ(0);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: max-height, opacity;
}

.table-of-contents .toc-item.expanded .sub-items {
    max-height: 1000px;
    opacity: 1;
}

.table-of-contents .sub-item {
    font-size: 14px;
    color: #666;
    padding: 5px 0;
    cursor: pointer;
    transform: translateZ(0);
}

.table-of-contents .sub-item:hover {
    color: #007bff;
}

/* 展开/关闭图标 */
.table-of-contents .toc-item.has-children h3::before {
    content: '+';
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    margin-right: 8px;
    font-size: 18px;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    color: #666;
    transform: translateZ(0);
}

.table-of-contents .toc-item.has-children.expanded h3::before {
    content: '-';
} 