/* 文章详情页侧边栏样式 */

.single-post-sidebar {
    position: sticky;
    top: 30px;
}

.single-widget {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.single-widget-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--main-color);
    color: var(--bs-gray-900, #111827);
}

.single-widget-placeholder {
    text-align: center;
    color: var(--bs-gray-500, #6b7280);
}

.single-widget-placeholder p {
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

/* 文章目录样式 */
.toc-nav {
    max-height: 400px;
    overflow-y: auto;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-item {
    margin-bottom: 8px;
}

.toc-link {
    display: block;
    padding: 8px 12px;
    color: var(--bs-gray-700, #374151);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.toc-link:hover {
    background: var(--bs-gray-100, #f3f4f6);
    color: var(--main-color);
    border-left-color: var(--main-color);
}

.toc-link.active {
    background: var(--main-color);
    color: white;
    border-left-color: var(--main-color);
}

.toc-level-h2 .toc-link {
    font-weight: 600;
}

.toc-level-h3 .toc-link {
    font-size: 0.85rem;
}

.toc-level-h4 .toc-link {
    font-size: 0.8rem;
    color: var(--bs-gray-600, #4b5563);
}

.toc-level-h5 .toc-link,
.toc-level-h6 .toc-link {
    font-size: 0.75rem;
    color: var(--bs-gray-500, #6b7280);
}

/* 文章内容中的标题锚点样式 */
.single .entry-content h2[id],
.single .entry-content h3[id],
.single .entry-content h4[id],
.single .entry-content h5[id],
.single .entry-content h6[id] {
    scroll-margin-top: 100px;
    position: relative;
}

.single .entry-content h2[id]::before,
.single .entry-content h3[id]::before,
.single .entry-content h4[id]::before,
.single .entry-content h5[id]::before,
.single .entry-content h6[id]::before {
    content: '#';
    position: absolute;
    left: -1em;
    color: var(--main-color);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.single .entry-content h2[id]:hover::before,
.single .entry-content h3[id]:hover::before,
.single .entry-content h4[id]:hover::before,
.single .entry-content h5[id]:hover::before,
.single .entry-content h6[id]:hover::before {
    opacity: 1;
}

/* 滚动条样式 */
.toc-nav::-webkit-scrollbar {
    width: 6px;
}

.toc-nav::-webkit-scrollbar-track {
    background: var(--bs-gray-100, #f3f4f6);
    border-radius: 3px;
}

.toc-nav::-webkit-scrollbar-thumb {
    background: var(--bs-gray-300, #d1d5db);
    border-radius: 3px;
}

.toc-nav::-webkit-scrollbar-thumb:hover {
    background: var(--bs-gray-400, #9ca3af);
}

/* 响应式设计 */
@media (max-width: 991px) {
    .single-post-sidebar {
        position: static;
        margin-top: 40px;
    }
    
    .toc-nav {
        max-height: none;
    }
}

@media (max-width: 767px) {
    .single-widget {
        padding: 20px;
    }
    
    .toc-link {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
}
