/**
 * 管理后台新布局样式 - 先上下再左右结构
 */

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f6fa;
    color: #333;
    overflow: hidden; /* 防止双滚动条 */
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ==================== 顶部页头 ==================== */
.top-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    flex-shrink: 0;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    margin-right: 30px;
}

.logo-icon {
    font-size: 28px;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.header-stats {
    display: flex;
    align-items: center;
    gap: 25px;
    flex: 1;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-label {
    font-size: 11px;
    opacity: 0.9;
    white-space: nowrap;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    font-size: 14px;
    opacity: 0.9;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* ==================== 主容器（左侧菜单 + 右侧内容） ==================== */
.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ==================== 左侧菜单 ==================== */
.sidebar {
    width: 240px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-left-color: white;
}

.nav-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.nav-text {
    font-size: 15px;
    font-weight: 500;
}

/* ==================== 内容区 ==================== */
.main-content {
    flex: 1;
    overflow: hidden;
}

#contentFrame {
    width: 100%;
    height: 100%;
    border: none;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1200px) {
    .header-stats {
        gap: 15px;
    }

    .stat-item {
        min-width: 70px;
    }

    .stat-value {
        font-size: 18px;
    }

    .stat-label {
        font-size: 10px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }

    .top-header {
        padding: 10px 15px;
        flex-direction: column;
        align-items: stretch;
    }

    .header-stats {
        justify-content: center;
        gap: 10px;
    }

    .stat-value {
        font-size: 16px;
    }

    .header-user {
        justify-content: center;
    }
}
