﻿/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 整体布局容器 */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* 侧边栏包装器 */
.sidebar-wrapper {
    width: 280px;
    min-width: 280px;
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    position: relative;
    z-index: 1000;
    transition: all 0.3s ease;
}

/* 侧边栏 */
.sidebar {
    width: 280px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    background: inherit;
    box-shadow: 3px 0 15px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    background: rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

    .sidebar-header h5 {
        color: white;
        margin: 0;
        font-weight: 600;
        font-size: 1.2rem;
    }

/* 导航菜单样式 */
.sidebar-nav {
    padding: 15px 0;
}

    .sidebar-nav .nav {
        flex-direction: column;
    }

    .sidebar-nav .nav-item {
        margin: 3px 15px;
    }

    .sidebar-nav .nav-link {
        color: rgba(255, 255, 255, 0.85) !important;
        padding: 12px 15px;
        border-radius: 8px;
        transition: all 0.3s ease;
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 12px;
        font-weight: 500;
        position: relative;
        overflow: hidden;
        cursor: pointer;
    }

        .sidebar-nav .nav-link:hover {
            background: rgba(255, 255, 255, 0.1);
            color: white !important;
            transform: translateX(5px);
        }

        .sidebar-nav .nav-link.active {
            background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
            color: white !important;
            box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
        }

            .sidebar-nav .nav-link.active::before {
                content: '';
                position: absolute;
                left: 0;
                top: 0;
                height: 100%;
                width: 4px;
                background: #fff;
            }

        /* 下拉菜单样式 */
        .sidebar-nav .nav-link[data-bs-toggle="collapse"] {
            position: relative;
        }

            .sidebar-nav .nav-link[data-bs-toggle="collapse"] .fa-angle-down {
                margin-left: auto;
                transition: transform 0.3s ease;
            }

            .sidebar-nav .nav-link[data-bs-toggle="collapse"]:not(.collapsed) .fa-angle-down {
                transform: rotate(180deg);
            }

/* 子菜单样式 */
.sub-menu {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    margin: 5px 0;
    padding: 5px 0;
}

    .sub-menu .nav-link {
        padding: 10px 15px 10px 45px !important;
        font-size: 0.9em;
        background: transparent !important;
    }

        .sub-menu .nav-link:hover {
            background: rgba(255, 255, 255, 0.05) !important;
        }

        .sub-menu .nav-link.active {
            background: rgba(231, 76, 60, 0.2) !important;
            box-shadow: none;
        }

            .sub-menu .nav-link.active::before {
                width: 3px;
            }

/* 主内容区域 */
.main-content {
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: calc(100% - 280px);
    margin-left: 280px;
}

/* 顶部导航栏 */
.top-navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 999;
    position: sticky;
    top: 0;
    width: 100%;
}

/* 内容区域 */
.content-area {
    flex: 1;
    padding: 30px;
    background: #f8f9fa;
    width: 100%;
    overflow-x: auto;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    border: none;
    background: none;
    font-size: 1.5rem;
    color: #2c3e50;
    margin-right: 15px;
}

/* 响应式设计 */
@media (max-width: 991.98px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar-wrapper {
        width: 100%;
        min-width: 100%;
        position: fixed;
        top: 0;
        left: -100%;
        height: 100vh;
        z-index: 1050;
        transition: left 0.3s ease;
    }

        .sidebar-wrapper.mobile-open {
            left: 0;
        }

    .sidebar {
        width: 280px;
        left: 0;
    }

    .main-content {
        width: 100%;
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: block !important;
    }

    /* 移动端遮罩层 */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
    }

        .sidebar-overlay.mobile-open {
            display: block;
        }
}

/* 菜单图标样式 */
.nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1.1em;
}

/* 滚动条样式 */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

    .sidebar::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.5);
    }


