:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 70px;
}
.sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - 60px);
    background-color: white;
    border-right: 1px solid #e9ecef;
    transition: width 0.3s ease;
    z-index: 1020;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}



body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    color: var(--dark-color);
    background-color: var(--light-color);
}
/* 侧边栏头部 */
.sidebar-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
}

.sidebar-brand {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.sidebar-nav {
    flex: 1;
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

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

.sidebar-nav li {
    list-style: none;
    margin: 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 0.5rem 1.25rem;
    color: var(--dark-color);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    font-size: 0.9rem;
}

.sidebar-nav a:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
}

.sidebar-nav a.active {
    background-color: rgba(0,123,255,0.1);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.sidebar-nav a i {
    font-size: 0.875rem;
    margin-right: 0.5rem;
    width: 14px;
    text-align: center;
}

.sidebar-nav li.sub-item {
    padding-left: 1rem;
}

.sidebar-nav .nav-label {
    white-space: nowrap;
}

.sidebar-nav a.with-arrow {
    position: relative;
}

.sidebar-nav a.with-arrow .ml-auto {
    position: absolute;
    right: 1.25rem;
    font-size: 0.625rem;
}

.sidebar-nav a.nav-header {
    pointer-events: none;
    cursor: default;
    font-weight: 600;
    color: var(--dark-color);
}

.sidebar-nav a.nav-header:hover {
    background-color: transparent;
    color: var(--dark-color);
}

/* 子菜单样式 */
.sidebar-nav .submenu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav .submenu li {
    padding-left: 1rem;
}

.sidebar-nav .submenu a {
    font-size: 0.85rem;
    padding: 0.35rem 1.25rem;
}

/* 主内容区 */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: 2rem;
    min-height: calc(100vh - 60px);
    transition: margin-left 0.3s ease;
    padding: 1rem;
}

.sidebar.collapsed + .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* 导航栏 */
.navbar {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1030;
}

.navbar-brand {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.25rem;
}

.nav-link {
    color: var(--dark-color);
    font-weight: 500;
    margin: 0 0.5rem;
}

.nav-link:hover {
    color: var(--primary-color);
}

.user-menu {
    position: relative;
}

.user-menu-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-menu-btn:focus {
    outline: none;
}

.user-menu .user-name {
    font-weight: 500;
    color: var(--dark-color);
    white-space: nowrap;
    padding-top: 0.5rem;
    font-size: 1.5rem;
    line-height: 1;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1000;
    margin-top: 0.5rem;
    display: none;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--dark-color);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.user-dropdown a:hover {
    background-color: var(--light-color);
}

/* 通知菜单 */
.nav-item.dropdown {
    position: relative;
}

.nav-item.dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 250px;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1000;
    margin-top: 0.5rem;
    border: 1px solid #e9ecef;
}

.nav-item.dropdown .dropdown-item {
    padding: 0.75rem 1rem;
    transition: background-color 0.2s ease;
}

.nav-item.dropdown .dropdown-item:hover {
    background-color: var(--light-color);
}

.nav-item.dropdown .badge {
    transform: translate(50%, -50%);
}






/* 响应式 */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar.collapsed + .main-content {
        margin-left: 0;
    }

    #sidebar-toggle {
        display: block;
    }
}

@media (min-width: 992px) {
    #sidebar-toggle {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .main-content {
        padding: 1rem;
    }
}
