/* ========== 布局样式 ========== */

/* 顶部导航栏 */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-left {
    display: flex;
    align-items: center;
}

.logo {
    font-size: 20px;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    font-size: 14px;
    opacity: 0.9;
}

/* 主容器 */
.main-container {
    display: flex;
    margin-top: 60px;
    height: calc(100vh - 60px);
}

/* 侧边栏 */
.sidebar {
    width: 240px;
    background: linear-gradient(180deg, #3B6D11 0%, #2F5A0D 60%, #1a3d08 100%);
    color: #fff;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 10px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.nav-item.active {
    background: rgba(255,255,255,0.18);
    color: #fff;
    border-left-color: #fff;
    font-weight: 600;
}

.nav-icon {
    margin-right: 10px;
    font-size: 18px;
}

.nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.12);
    margin: 10px 0;
}

/* 分区标题 - 绿色背景适配 */
.sidebar .nav-section {
    color: rgba(255,255,255,0.5);
    letter-spacing: 1px;
    padding: 16px 20px 6px;
    font-size: 11px;
    font-weight: 500;
}

/* 主内容区 */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #fff;
}

.content-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.content-header h2 {
    margin: 0;
    font-size: 24px;
    color: #2c3e50;
}

.content-body {
    min-height: calc(100vh - 150px);
}

/* 仪表盘欢迎页 */
.dashboard-welcome {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.dashboard-welcome h3 {
    font-size: 28px;
    margin-bottom: 15px;
    color: #2c3e50;
}

.dashboard-welcome p {
    font-size: 16px;
}

/* Toast 提示 */
.toast {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    color: white;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s;
    max-width: 400px;
}

.toast-show {
    opacity: 1;
}

.toast-info {
    background: #3498db;
}

.toast-success {
    background: #27ae60;
}

.toast-warning {
    background: #f39c12;
}

.toast-error {
    background: #e74c3c;
}

/* 汉堡按钮 - 桌面隐藏 */
.hamburger-btn {
    display: none;
    position: fixed;
    top: 6px;
    left: 8px;
    z-index: 1001;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--primary);
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
    transition: transform 0.15s, background 0.15s;
}
.hamburger-btn:active {
    transform: scale(0.92);
    background: var(--primary-hover);
}
.hamburger-btn svg {
    width: 22px;
    height: 22px;
}

/* 侧边栏遮罩 */
.sidebar-overlay {
    display: none;
}
@media (max-width: 768px) {
    /* 汉堡按钮 - 移动端显示 */
    .hamburger-btn {
        display: inline-flex;
    }
    .top-header {
        padding: 0 12px;
        height: 52px;
    }
    .logo { font-size: 16px; }
    .user-info { font-size: 12px; }
    .header-right { gap: 8px; }
    
    /* 主容器 */
    .main-container {
        margin-top: 52px;
        height: calc(100vh - 52px);
    }
    
    /* 侧边栏 - 移动端：悬浮层叠，默认隐藏 */
    .sidebar {
        position: fixed;
        top: 52px;
        left: 0;
        bottom: 0;
        width: 260px;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 12px rgba(0,0,0,0.15);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    
    /* 遮罩层 */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 52px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.4);
        z-index: 998;
    }
    .sidebar-overlay.show {
        display: block;
    }
    
    /* 顶栏 - 移动端自适应 */
    .topbar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px 0;
    }
    .topbar h2 {
        font-size: 16px;
        flex: 1;
        min-width: 0;
    }
    .topbar .topbar-right {
        flex-wrap: wrap;
        gap: 6px;
    }
    .topbar .topbar-right .btn {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    /* 主内容区 */
    .main-content {
        padding: 10px;
    }
    
    /* 导航项 */
    .nav-item {
        padding: 14px 20px;
        font-size: 14px;
    }
    .nav-item span:not(.nav-icon) { display: inline; }
    
    /* Toast */
    .toast {
        max-width: calc(100vw - 32px);
        right: 16px;
        top: 64px;
    }
}
