/* ========== 全局样式变量 ========== */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --gray-color: #6c757d;

    --border-radius: 10px;
    --border-radius-sm: 5px;
    --box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    --box-shadow-hover: 0 5px 20px rgba(0,0,0,0.15);

    --font-family: "Microsoft YaHei", "微软雅黑", "SimHei", "黑体", "SimSun", "宋体", Arial, sans-serif;
    --font-size-sm: 12px;
    --font-size-base: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 18px;
    --font-size-xxl: 24px;

    --transition: all 0.3s ease;
    --transition-fast: all 0.2s ease;
}

/* ========== 基础重置和全局样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== 头部样式 ========== */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.school-brand {
    display: flex;
    align-items: center;
}

.school-logo {
    width: 50px;
    height: 50px;
    margin-right: 15px;
    border-radius: 50%;
    object-fit: cover;
    background: white;
    padding: 5px;
}

.school-name {
    display: flex;
    flex-direction: column;
}

.school-name-cn {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 3px;
}

.school-name-en {
    font-size: 12px;
    opacity: 0.9;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.role-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 10px;
}

.role-switch-label {
    font-size: 12px;
    opacity: 0.8;
    white-space: nowrap;
}

.role-switch-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 12px;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.role-switch-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-1px);
}

.logout-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-fast);
}

.logout-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* ========== 网格布局 ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* 桌面端统计网格优化 */
@media (min-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 25px;
        max-width: 1200px;
        margin: 0 auto 30px;
    }
    
    .stat-card {
        padding: 30px;
        min-height: 180px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
}

/* 教师工作台统计卡片 - 横向布局 */
.dashboard-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: nowrap;
}

.dashboard-stats .stat-card {
    flex: 1;
    min-width: 0;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* ========== 卡片组件 ========== */
.stat-card, .card {
    background: white;
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.stat-card:hover, .card:hover {
    transform: translateY(-5px);
}

.card {
    margin-bottom: 20px;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 20px;
}

.card-title {
    font-size: var(--font-size-xl);
    color: #333;
    margin: 0;
}

/* ========== 统计数字样式 ========== */
.stat-number {
    font-size: 36px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
    text-align: center;
}

.stat-label {
    color: var(--gray-color);
    font-size: var(--font-size-base);
    text-align: center;
}

/* ========== 菜单项样式 ========== */
.menu-item {
    background: white;
    padding: 12px 8px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    text-align: center;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    display: block;
}

.menu-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    color: var(--primary-color);
}

.menu-icon {
    font-size: 28px;
    margin-bottom: 6px;
}

.menu-title {
    font-size: 12px;
    font-weight: 500;
}

/* ========== 按钮样式 ========== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: var(--font-size-base);
    text-decoration: none;
    display: inline-block;
    transition: var(--transition-fast);
    margin-right: 10px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: #212529;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: var(--font-size-sm);
}

/* ========== 表格样式 ========== */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.table th, .table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background: var(--light-color);
    font-weight: 600;
    color: #333;
}

.table tr:hover {
    background: var(--light-color);
}

/* ========== 表单样式 ========== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-base);
    transition: var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

/* ========== 徽章和标签 ========== */
.badge, .status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.status-draft {
    background: #fff3cd;
    color: #856404;
}

.status-published {
    background: #d4edda;
    color: #155724;
}

.score-excellent {
    background: #d4edda;
    color: #155724;
}

.score-good {
    background: #d1ecf1;
    color: #0c5460;
}

.score-pass {
    background: #fff3cd;
    color: #856404;
}

.score-fail {
    background: #f8d7da;
    color: #721c24;
}

/* ========== 进度条 ========== */
.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 5px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

/* ========== 分段标题 ========== */
.section-title {
    font-size: var(--font-size-xl);
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

/* ========== 标签页 ========== */
.tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.tab {
    padding: 12px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: var(--font-size-base);
    color: var(--gray-color);
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: bold;
}

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

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-color);
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #999;
}

/* ========== 响应式设计 ========== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .menu-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .school-brand {
        flex-direction: column;
        text-align: center;
    }
    
    .school-logo {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .stats-grid {
        display: flex;
        gap: 15px;
        margin-bottom: 20px;
        flex-wrap: nowrap;
        width: 100%;
    }
    
    .stats-grid .stat-card {
        flex: 1;
        min-width: 0;
    }
    
    .menu-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }
    
    /* 教师工作台统计卡片在小屏幕上保持横向布局 */
    .dashboard-stats {
        gap: 10px;
    }
    
    .dashboard-stats .stat-card {
        padding: 15px 10px;
    }
    
    .dashboard-stats .stat-number {
        font-size: 24px;
    }
    
    .dashboard-stats .stat-label {
        font-size: 12px;
    }
    
    .stat-card, .card {
        padding: 20px 15px;
    }
    
    .stat-number {
        font-size: 28px;
    }

    .menu-item {
        padding: 12px 8px;
    }

    .menu-icon {
        font-size: 28px;
        margin-bottom: 6px;
    }

    .menu-title {
        font-size: 12px;
    }
    
    .card-header {
        padding: 15px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .table {
        font-size: var(--font-size-sm);
    }
    
    .table th, .table td {
        padding: 8px 6px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: var(--font-size-sm);
    }
    
    .container {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        display: flex;
        gap: 8px;
        flex-wrap: nowrap;
        width: 100%;
    }
    
    .menu-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
    
    .user-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .menu-item {
        padding: 12px 6px;
    }
    
    .menu-icon {
        font-size: 24px;
        margin-bottom: 4px;
    }
    
    .menu-title {
        font-size: 10px;
    }
    
    .tabs {
        overflow-x: auto;
    }
    
    /* 教师工作台统计卡片在超小屏幕上仍保持横向布局 */
    .dashboard-stats {
        gap: 8px;
    }
    
    .dashboard-stats .stat-card {
        padding: 12px 8px;
    }
    
    .dashboard-stats .stat-number {
        font-size: 20px;
    }
    
    .dashboard-stats .stat-label {
        font-size: 11px;
    }
}

/* 极小屏幕优化 */
@media (max-width: 360px) {
    .menu-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .menu-item {
        padding: 10px 4px;
    }
    
    .menu-icon {
        font-size: 20px;
        margin-bottom: 2px;
    }
    
    .menu-title {
        font-size: 9px;
    }
}

/* ========== 打印样式 ========== */
/* ========== 认证页面样式 ========== */
.auth-page {
    background: linear-gradient(135deg, #e8f4fd 0%, #f0e6ff 50%, #fef6e8 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
}

.login-school-info {
    text-align: left;
}

.login-description {
    color: #666;
    font-size: 14px;
    margin-top: 15px;
}

/* ========== 打印样式 ========== */
@media print {
    .header, .btn, .menu-item {
        display: none !important;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}