
.toc-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.toc-modal-content {
    background-color: #ffffffea;
    margin: 10% auto;
    padding: 8px;
    width: 90%;
    max-width: 800px;
    border-radius: 2px;
    max-height: 70vh;
    overflow-y: auto;
    position: relative;
    border-radius: 18px;
}

.toc-close {
    position: absolute;
    right: 15px;
    top: 15px;
    color: #718096;
    font-size: 22px;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #f7fafc;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.toc-close:hover,
.toc-close:focus {
    color: #e53e3e;
    background-color: #fff5f5;
    transform: rotate(90deg);
    box-shadow: 0 2px 5px rgba(229, 62, 62, 0.2);
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list ul {
    list-style: none;
    padding-left: 16px;
    margin: 0;
    border-left: 1px solid #85847a9b;
}

.toc-list a {
    color: #2d3748;
    text-decoration: none;
    display: block;
    padding: 8px 12px;
    margin: 2px 0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    position: relative;
}

.toc-list a:hover {
    color: #2c5282;
    background-color: #d3d3bf;
    transform: translateX(6px);
}

/* 标题级别样式 */
.toc-list > li > a {
    font-size: 16px;
    font-weight: 600;
    color: #1a365d;
    padding: 10px 12px;
}

.toc-list > li > ul > li > a {
    font-size: 15px;
    font-weight: 500;
    color: #2c5282;
}

.toc-list > li > ul > li > ul > li > a {
    font-size: 14px;
    color: #3182ce;
}

.toc-list > li > ul > li > ul > li > ul > li > a {
    font-size: 13px;
    color: #4299e1;
}

.toc-modal-content h2 {
    margin: 0;
    padding-bottom: 10px;
    margin-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
    color: #1a365d;
    font-size: 1.6em;
    font-weight: 600;
    text-align: center;
}

/* 添加层级指示器 */
.toc-list ul li {
    position: relative;
}

.toc-list ul li::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 50%;
    width: 8px;
    height: 1px;
    background-color: #e2e8f0;
}

/* 悬停时的连接线效果 */
.toc-list ul li:hover::before {
    background-color: #3182ce;
}

.toc-list ul li:hover > a {
    color: #2c5282;
}

/* 自定义滚动条 */
.toc-modal-content::-webkit-scrollbar {
    width: 6px;
}

.toc-modal-content::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 8px;
}

.toc-modal-content::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 8px;
}

.toc-modal-content::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* 添加滚动阴影指示效果 */
.toc-modal-content {
    background-image: 
        linear-gradient(to bottom, #ffffff 30%, rgba(255, 255, 255, 0)),
        linear-gradient(to top, #ffffff 30%, rgba(255, 255, 255, 0));
    background-position: top, bottom;
    background-size: 100% 20px;
    background-repeat: no-repeat;
    background-attachment: local, local;
}

/* 目录层级样式 */
.toc-list > li > a {
    font-weight: 500;
    color: #1a365d;
}

.toc-list > li > ul > li > a {
    color: #2c5282;
}

.toc-list > li > ul > li > ul > li > a {
    color: #3182ce;
}


/* 自定义tooltip样式 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 180px;
    background-color: #2d3748;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 10px;
    position: absolute;
    z-index: 1001;
    bottom: 125%;
    right: 0;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    pointer-events: none;
    letter-spacing: 0.3px;
    line-height: 1.4;
}

/* 添加tooltip出现动画 */
.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
    transform: translateY(-5px);
}

/* 响应式调整 */
@media screen and (max-width: 768px) {
    .tooltip .tooltip-text {
        width: 160px;
        font-size: 12px;
        bottom: auto;
        top: -60px;
        right: 60px;
    }

    .tooltip .tooltip-text::after {
        top: 50%;
        left: 100%;
        margin-left: 0;
        margin-top: -5px;
        border-color: transparent transparent transparent #333;
    }

   .toc-modal-content {

    margin: 25% auto;

    }


}

/* 确保tooltip容器不影响按钮定位 */
.tooltip {
    position: fixed;
    right: 20px;
    bottom: 250px;
    z-index: 999;
}

/* 调整按钮样式以适应新的容器结构 */

.tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}