/* 用户中心左侧边栏样式 */
.sidebar {
    position: fixed;
    top: 56px; /* 导航栏高度 */
    left: 0;
    z-index: 100; /* 保持低于footer的层级 */
    padding: 0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
    height: calc(100vh - 56px); /* 高度覆盖到页面底部 */
    width: 250px; /* 固定宽度 */
}

.sidebar .nav-link {
    color: #495057;
    padding: 0.75rem 1.25rem;
    border-radius: 0.375rem;
    margin: 0.125rem 0.75rem;
    transition: all 0.2s ease-in-out;
    font-weight: 500;
}

.sidebar .nav-link:hover {
    color: #0056b3;
    background-color: rgba(0, 123, 255, 0.08);
    transform: translateX(2px);
}

.sidebar .nav-link.active {
    color: #fff;
    background-color: #007bff;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.sidebar .nav-link i {
    width: 16px;
    text-align: center;
}

.sidebar-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* 用户信息区域 */
.sidebar .user-info {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-bottom: 0.5rem;
}

.sidebar .user-info h6 {
    margin-bottom: 0.5rem;
    color: #fff;
    font-weight: 600;
    font-size: 1.1rem;
}

.sidebar .user-info small {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
}

.sidebar .user-info .user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
    color: #fff;
}

.avatar-circle {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* 响应式设计 */
@media (max-width: 991.98px) {
    .sidebar {
        position: relative;
        top: 0;
        left: 0;
        width: 100%;
        height: auto;
        margin-bottom: 1rem;
        box-shadow: none;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .sidebar.collapse:not(.show) {
        display: none;
    }
    
    .sidebar.collapsing {
        height: auto;
        transition: none;
    }
    
    .sidebar.show {
        display: block;
    }
}

/* 主内容区域调整 */
.main-content {
    margin-left: 250px; /* 为固定侧边栏留出空间 */
    padding: 2rem;
    padding-left: 0.4rem; /* 将左侧内边距降为原来的五分之一，贴近侧栏 */
    padding-bottom: 3rem; /* 为底部footer留出空间 */
    min-height: calc(100vh - 56px);
    background-color: #ffffff;
    height: 100%;
}

@media (max-width: 992px) {
    .main-content {
        padding: 1rem;
        margin-left: 0;
    }
    
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        top: 0;
        left: 0;
    }
}

/* 移动端菜单切换按钮 */
.mobile-menu-toggle {
    display: none;
}

@media (max-width: 991.98px) {
    .mobile-menu-toggle {
        display: inline-block;
        background: none;
        border: none;
        color: #333;
        font-size: 1.2rem;
        padding: 0.5rem;
        margin-right: 1rem;
    }
    
    .mobile-menu-toggle:hover {
        color: #007bff;
    }
    
    .navbar-nav .nav-link.btn.btn-link {
        color: rgba(255, 255, 255, 0.75);
        border: none;
        background: none;
        padding: 0.5rem 1rem;
    }
    
    .navbar-nav .nav-link.btn.btn-link:hover {
        color: rgba(255, 255, 255, 1);
    }
}

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

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}