 /* 侧边栏布局样式 */
.content-with-sidebar {
    display: block;
}

        /* 侧边栏基础样式 */
        /* 侧边栏容器：始终固定右下角 */
        .sidebar {
            position: fixed;
            bottom: 20px;
            right: 20px;
            top: auto;
            left: auto;
            z-index: 1000;
            width: auto;
            background: transparent;
            padding: 0;
            border: none;
            box-shadow: none;
        }

        /* 折叠按钮样式 - 始终显示 */
        .sidebar-toggle {
            display: flex;
            background: #2C3E50;
            color: white;
            padding: 12px 20px;
            border-radius: 40px;
            cursor: pointer;
            box-shadow: 0 4px 12px rgba(0,0,0,0.2);
            font-weight: 500;
            align-items: center;
            justify-content: center;
            gap: 8px;
            transition: all 0.3s;
            border: none;
            width: auto;           /* 自适应内容 */
            min-width: 100px;
            font-size: 1rem;
            border: 1px solid rgba(255,255,255,0.1);
            margin-bottom: 0;      /* 移除底部间距 */
        }

        .sidebar-toggle:hover {
            background: #1a2b3c;
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(0,0,0,0.25);
        }

        .toggle-icon {
            font-size: 1.3rem;
        }

        /* 侧边栏内容样式 - 默认隐藏 */
        .sidebar-content {
            position: absolute;
            bottom: 70px;
            right: 0;
            width: 300px;          /* 桌面端宽度 */
            max-height: 70vh;
            overflow-y: auto;
            background: #f8f9fa;
            padding: 1.5rem;
            border-radius: 12px;
            box-shadow: 0 8px 24px rgba(0,0,0,0.15);
            border-left: 4px solid #2C3E50;
            display: none;
            transition: all 0.3s ease;
        }
        .sidebar-content.active {
            display: block;
            animation: fadeIn 0.3s ease;
        }
/* 淡入动画保持不变 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

        /* 目录组件样式 */
        /* 目录组件样式 */
        .toc-widget {
            background: white;
            padding: 1.2rem;
            border-radius: 8px;
            margin-bottom: 1.5rem;
        }
        
        .toc-widget h3 {
            margin-top: 0;
            margin-bottom: 1rem;
            font-size: 1.2rem;
            color: #333;
            border-bottom: 2px solid #e9ecef;
            padding-bottom: 0.5rem;
        }
        
        #toc-list ul {
            list-style: none;
            padding-left: 0;
            margin: 0;
        }
        
        #toc-list li {
            margin-bottom: 0.4rem;
            line-height: 1.4;
        }
        
        #toc-list a {
            color: #495057;
            text-decoration: none;
            display: block;
            padding: 0.2rem 0.5rem;
            border-radius: 4px;
            transition: all 0.2s;
            font-size: 0.95rem;
        }
        
        #toc-list a:hover {
            background: #e9ecef;
            color: #2C3E50;
        }
        
        #toc-list a.active {
            background: #2C3E50;
            color: white;
            font-weight: 500;
        }
        
        .toc-level-h4 {
            padding-left: 1.2rem;
            font-size: 0.9rem;
        }

        /* 快速链接小工具 */
        .sidebar-widget {
            background: white;
            padding: 1.2rem;
            border-radius: 8px;
        }

        .sidebar-widget h3 {
            margin-top: 0;
            margin-bottom: 1rem;
            font-size: 1.1rem;
            color: #333;
        }

        .sidebar-widget ul {
            list-style: none;
            padding-left: 0;
        }

        .sidebar-widget li {
            margin-bottom: 0.5rem;
        }

        .sidebar-widget a {
            color: #0066cc;
            text-decoration: none;
        }

        .sidebar-widget a:hover {
            text-decoration: underline;
        }

        /* 移动端适配 */
        @media (max-width: 992px) {
            .sidebar-content {
                width: 280px;
            }
        }        /* 超小屏幕适配 */
        @media (max-width: 480px) {
            .sidebar-content {
                width: 260px;
                padding: 1rem;
            }
        }
            
            .sidebar {
                position: fixed;
                bottom: 20px;
                right: 20px;
                top: auto;
                left: auto;
                z-index: 1000;
                width: auto;
            }
            
            .sidebar-toggle {
                width: auto;
                min-width: 100px;
                margin-bottom: 0;
            }
            
            .sidebar-content {
                position: absolute;
                bottom: 70px;
                right: 0;
                width: 280px;
                max-height: 70vh;
                overflow-y: auto;
                box-shadow: 0 8px 24px rgba(0,0,0,0.15);
                padding: 1rem;
            }
        }




        /* 为标题添加锚点样式 */
        h3[id], h4[id] {
            scroll-margin-top: 20px;
        }

        /* 卡片内图片样式 */
        .divimg {
            max-width: 100%;
            height: auto;
            display: block;
            margin: 1rem auto;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }

        /* 卡片样式微调 */
        .onlycard-list {
            background: white;
            padding: 2rem;
            border-radius: 12px;
            box-shadow: 0 2px 12px rgba(0,0,0,0.08);
            margin-bottom: 2rem;
        }

        .onlycard-list h3 {
            color: #2C3E50;
            border-left: 4px solid #2C3E50;
            padding-left: 1rem;
            margin-top: 0;
        }

        .onlycard-list h4 {
            color: #666;
            margin-top: 1.5rem;
        }
		
		/* 返回顶部按钮样式（复用目录按钮，只调整位置） */
		.back-to-top {
			text-align: center;
		    display: none;              /* 默认隐藏 */
		    background: #aaffff;
		    color: white;
		    padding: 12px 20px;
		    border-radius: 40px;
		    cursor: pointer;
		    box-shadow: 0 4px 12px rgba(0, 255, 255, 0.2);
		    font-weight: 500;
		    align-items: center;
		    justify-content: center;
		    gap: 8px;
		    transition: all 0.3s;
		    border: none;
		    width: 100px;
		    font-size: 1rem;
		    border: 1px solid rgba(255,255,255,0.1);
		    margin-top: 10px;           /* 与目录按钮拉开距离 */
		}
		
		.back-to-top:hover {
		    background: #00ffff;
		    transform: translateY(-2px);
		    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
		}
		
		/* 移动端适配（与目录按钮保持一致） */
		@media (max-width: 992px) {
		    .back-to-top {
		        width: 100;
		        min-width: 100px;
		        margin-top: 0;
		    }
		}