/* 全校权限管理员专用页面样式 - 现代化设计风格 */

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
    overflow-x: hidden;
}

/* 主布局容器 */
.main-layout {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 280px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    overflow-y: auto;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    height: 72px;
    padding: 0 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-section {
    margin-bottom: 32px;
}

.nav-section-title {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 20px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background-color: #f1f5f9;
    color: #0ABAB5;
}

.nav-item.active {
    background-color: #eff6ff;
    color: #0ABAB5;
    border-left-color: #0ABAB5;
}

.nav-item-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-submenu {
    margin-left: 32px;
    margin-top: 8px;
}

.nav-submenu .nav-item {
    padding: 8px 20px;
    font-size: 13px;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    margin-left: 280px;
    background-color: #f8fafc;
    min-height: 100vh;
}

/* 顶部导航栏 */
.top-navbar {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    height: 72px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.navbar-title {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
}

.permission-badge {
    background: linear-gradient(135deg, #0ABAB5, #059669);
    color: white;
    padding: 3px 6px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px 8px 36px;
    font-size: 14px;
    width: 300px;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #0ABAB5;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-icon {
    position: absolute;
    left: 12px;
    color: #64748b;
    width: 16px;
    height: 16px;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    background: #f8fafc;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: #e2e8f0;
    color: #0ABAB5;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0ABAB5, #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.logout-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    background: #f8fafc;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.logout-btn:hover {
    background: #ef4444;
    color: white;
    transform: translateY(-1px);
}

/* 内容区域 */
.content-area {
    padding: 32px;
}

/* 模块分组 */
.section {
    margin-bottom: 48px;
}

.section-title {
    font-size: 20px;
    font-weight: 400;
    color: #1e293b;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

/* 页面标题 */
.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 32px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 8px;
}

.page-subtitle {
    font-size: 16px;
    color: #64748b;
}

/* 统计卡片网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0ABAB5, #059669);
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.stat-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-icon.blue {
    background: #dbeafe;
    color: #0ABAB5;
}

.stat-icon.green {
    background: #dcfce7;
    color: #0ABAB5;
}

.stat-icon.purple {
    background: #f3e8ff;
    color: #9333ea;
}

.stat-icon.orange {
    background: #fed7aa;
    color: #ea580c;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: #64748b;
}

/* 管理功能网格 */
.management-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.management-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.management-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: #0ABAB5;
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-right: 16px;
}

.card-icon.teacher {
    background: #dbeafe;
    color: #3b82f6;
}

.card-icon.student {
    background: #dcfce7;
    color: #16a34a;
}

.card-icon.class {
    background: #fef3c7;
    color: #d97706;
}

.card-icon.contest {
    background: #f3e8ff;
    color: #9333ea;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.card-description {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 20px;
    line-height: 1.5;
}

.card-actions {
    display: flex;
    gap: 12px;
}

.btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
    display: inline-block;
}

.btn-primary {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.btn-primary:hover {
    background: #0ABAB5;
    color: white;
    border-color: #0ABAB5;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #0ABAB5;
    color: white;
    border-color: #0ABAB5;
    transform: translateY(-1px);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .search-input {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .content-area {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .management-grid {
        grid-template-columns: 1fr;
    }
    
    .navbar-left {
        gap: 16px;
    }
    
    .search-input {
        width: 150px;
    }
    
    .page-title {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .content-area {
        padding: 16px;
    }
    
    .top-navbar {
        padding: 12px 16px;
    }
    
    .search-input {
        display: none;
    }
    
    .stat-card,
    .management-card {
        padding: 20px;
    }
    
    .card-actions {
        flex-direction: column;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card,
.management-card {
    animation: fadeInUp 0.6s ease-out;
}

.stat-card:nth-child(2) {
    animation-delay: 0.1s;
}

.stat-card:nth-child(3) {
    animation-delay: 0.2s;
}

.stat-card:nth-child(4) {
    animation-delay: 0.3s;
}

.management-card:nth-child(2) {
    animation-delay: 0.1s;
}

.management-card:nth-child(3) {
    animation-delay: 0.2s;
}

.management-card:nth-child(4) {
    animation-delay: 0.3s;
}
