#content{
	
    background: #2c3e50;
    color: white;
}

main#main{
	background: #f8f9fa;   /* 浅灰白 */
  	color: #2d3748;        /* 深蓝灰文字 */
  	border-left: 1px solid #d1d5db; /* 浅灰分隔线 */
}

/* 侧边栏样式 */
nav#primary {
    width: var(--sidebar-width);
    background: #2c3e50;
    color: white;
    padding: 20px;
    transition: transform var(--transition-speed) ease;
    position: relative;
}

.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    background: transparent;
    color: #0F8B8D;
    border: none;
    width: 50px;
    height: 50px;
	align-items: center;    /* 垂直居中 */
    justify-content: center; /* 水平居中 */
    padding: 0;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
	box-shadow: 0 2px 10px rgba(15, 139, 141, 0.3);
}

.sidebar-toggle:hover {
    background: #2980b9;
    transform: scale(1.1);
}

.sidebar-toggle.visible {
  opacity: 0;
  transform: translateY(0);
  pointer-events: auto;
}

/* 目录容器样式 */
#contents-menu {
    padding-right: 10px; /* 为滚动条留出空间 */
    margin: 15px 0;
}



/* 目录列表样式 */
.category-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.category-item {
	position: relative;
    margin-bottom: 15px;
}

.category-title {
    position: relative; /* 确保伪元素相对于此定位 */
    display: flex;      /* 使用flex布局更好控制内容 */
    align-items: center; /* 垂直居中 */
    padding-left: 55px; /* 为箭头留出空间 */
    margin: 0;
    cursor: pointer;
    color: #f5f5f5;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.category-item .category-title::before {
    content: "\e907"; /* 右箭头Unicode */
    transform: translateY(-50%) rotate(-90deg);
	font-family: 'iconmeta', 'System Font', sans-serif; 
    position: absolute; /* 相对于.category-item定位 */
    left: 5px;        /* 调整这个值控制箭头水平位置 */
    top: 50%;
    font-size: 14px;
    transition: transform 0.3s ease;
}

.category-item.active .category-title::before {
    content: "\e907";
	font-family: 'iconmeta', 'System Font', sans-serif; 
    transform: translateY(-50%) rotate(0deg);
}


/* 分类列表项样式 */
.category-item {
    margin-bottom: 8px;
    list-style: none;
}

/* 文章列表样式 */
.post-list {
    padding-left: 20px; /* 缩进文章列表 */
    margin-top: 5px;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
}

/* 展开状态下的文章列表 */
.category-item.active .post-list {
    max-height: 2000px; /* 足够大的值确保显示所有内容 */
}

.post-item {
    margin: 5px 0;
}

.post-item a {
    display: block;
    padding: 8px 15px;
    color: #f5f5f5;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.post-item a:hover {
    background-color: #f0f0f0;
    color: #222;
}

.no-categories-message {
    padding: 15px;
    color: #666;
    text-align: center;
}


/* 移动端样式 */
@media (max-width: 768px) {
    nav#primary {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 900;
        transform: translateX(-100%);
    }
    
    nav#primary.active {
        transform: translateX(0);
    }

	#contents-menu{
    max-height: calc(100vh - 200px); /* 根据实际需要调整高度 */
    overflow-y: auto;
	}
	/* 滚动条样式 (Webkit浏览器) */
#contents-menu::-webkit-scrollbar {
    width: 8px;
}

#contents-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#contents-menu::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

#contents-menu::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

    
    .sidebar-toggle {
        display: block;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 800;
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-speed) ease;
    }
    
    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }

	#contents-menu {
        max-height: calc(100vh - 150px); /* 移动端调整高度 */
    }
    
    .category-title {
        padding: 8px 25px;
        font-size: 0.95em;
    }
    
    .post-item a {
        padding: 6px 12px;
        font-size: 0.9em;
    }
}

/* 桌面端样式 */
@media (min-width: 769px) {
    .sidebar-toggle {
        display: none !important;
    }
}
