/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    color: #333;
}

/* 登录页面样式 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: white;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header i {
    font-size: 48px;
    color: #667eea;
    margin-bottom: 15px;
}

.login-header h1 {
    color: #333;
    margin-bottom: 5px;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
    display: block;
    width: 100%;
    z-index: 10000;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    z-index: 2;
    pointer-events: none;
}

.input-group input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
    box-sizing: border-box;
    display: block;
    position: relative;
    z-index: 10000;
    background: white;
    cursor: text;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

/* 确保输入框完全可点击 */
.input-group input:hover {
    border-color: #667eea;
}

/* 修复可能的点击区域问题 */
#loginEmail, #loginPassword {
    min-height: 50px;
    line-height: normal;
    vertical-align: top;
}

/* 确保输入框在所有情况下都可编辑 */
.input-group input:disabled,
.input-group input[readonly] {
    background-color: #f8f9fa !important;
    cursor: not-allowed !important;
}

.input-group input:not(:disabled):not([readonly]) {
    background-color: white !important;
    cursor: text !important;
    pointer-events: auto !important;
    user-select: text !important;
}

/* 强制修复登录输入框的点击区域问题 */
#loginEmail, #loginPassword {
    position: relative !important;
    z-index: 99999 !important;
    pointer-events: auto !important;
    cursor: text !important;
    background: white !important;
    border: 2px solid #ddd !important;
    padding: 15px 15px 15px 45px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    display: block !important;
    margin: 0 !important;
    outline: none !important;
}

#loginEmail:focus, #loginPassword:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2) !important;
}

#loginEmail:hover, #loginPassword:hover {
    border-color: #667eea !important;
}

/* 确保登录表单容器不被遮挡 */
#loginForm {
    position: relative !important;
    z-index: 99999 !important;
}

.login-card {
    position: relative !important;
    z-index: 99999 !important;
}

.login-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s;
}

.login-btn:hover {
    transform: translateY(-2px);
}

.login-btn i {
    margin-right: 10px;
}

/* 管理界面样式 */
.admin-panel {
    display: grid;
    grid-template-areas: 
        "nav nav"
        "sidebar main";
    grid-template-columns: 250px 1fr;
    grid-template-rows: 60px 1fr;
    height: 100vh;
}

/* 顶部导航 */
.top-nav {
    grid-area: nav;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-brand {
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 18px;
    color: #333;
}

.nav-brand i {
    margin-right: 10px;
    color: #667eea;
}

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

.logout-btn {
    background: #f44336;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: #d32f2f;
}

/* 侧边栏 */
.sidebar {
    grid-area: sidebar;
    background: #2c3e50;
    color: white;
    overflow-y: auto;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-item {
    padding: 15px 20px;
    cursor: pointer;
    border-bottom: 1px solid #34495e;
    transition: background 0.3s;
    display: flex;
    flex-direction: column;
}

.nav-item:hover:not(.disabled) {
    background: #34495e;
}

.nav-item.active {
    background: #3498db;
}

.nav-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-item i {
    margin-right: 10px;
    width: 20px;
}

.nav-item small {
    margin-left: 30px;
    margin-top: 5px;
    font-size: 12px;
    opacity: 0.8;
}

/* 主内容区 */
.main-content {
    grid-area: main;
    background: #f5f5f5;
    overflow-y: auto;
    padding: 20px;
}

.page {
    display: none;
    max-width: 1200px;
    margin: 0 auto;
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.page-header h1 {
    font-size: 24px;
    color: #333;
}

.page-header h1 i {
    margin-right: 10px;
    color: #667eea;
}

/* 页面头部操作按钮组 */
.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    color: white;
    font-size: 24px;
}

.stat-icon.blue { background: #3498db; }
.stat-icon.green { background: #2ecc71; }
.stat-icon.orange { background: #f39c12; }
.stat-icon.purple { background: #9b59b6; }

.stat-content h3 {
    font-size: 24px;
    margin-bottom: 5px;
    color: #333;
}

.stat-content p {
    color: #666;
    font-size: 14px;
}

/* 仪表盘 */
.dashboard-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dashboard-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.dashboard-section h2 i {
    margin-right: 10px;
    color: #667eea;
}

.system-info {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.info-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 5px;
    flex: 1;
    min-width: 200px;
}

.info-item i {
    margin-right: 10px;
    color: #667eea;
}

.status-good {
    color: #2ecc71;
}

/* 搜索栏 */
.search-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-input {
    flex: 1;
    position: relative;
}

.search-input i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.search-input input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.search-bar select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    min-width: 150px;
}

/* 表格样式 */
.table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* 固定表格布局 */
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

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

/* 用户管理表格特定列宽（已更新复选框列后的索引） */
#usersTable th:nth-child(1), #usersTable td:nth-child(1) { width: 50px; text-align: center; white-space: nowrap; } /* 复选框 */
#usersTable th:nth-child(2), #usersTable td:nth-child(2) { width: 70px; text-align: center; white-space: nowrap; } /* 头像 */
#usersTable th:nth-child(3), #usersTable td:nth-child(3) { width: 120px; } /* 用户名 */
#usersTable th:nth-child(4), #usersTable td:nth-child(4) { width: 100px; } /* 姓名 */
#usersTable th:nth-child(5), #usersTable td:nth-child(5) { width: 160px; white-space: nowrap; } /* 身份证号 */
#usersTable th:nth-child(6), #usersTable td:nth-child(6) { width: 80px; white-space: nowrap; } /* 角色 */
#usersTable th:nth-child(7), #usersTable td:nth-child(7) { width: 120px; } /* 专业 */
#usersTable th:nth-child(8), #usersTable td:nth-child(8) { width: 100px; } /* 班级 */
#usersTable th:nth-child(9), #usersTable td:nth-child(9) { width: 120px; } /* 注册时间 */
#usersTable th:nth-child(10), #usersTable td:nth-child(10) { width: 120px; white-space: nowrap; } /* 账号有效期 */
#usersTable th:nth-child(11), #usersTable td:nth-child(11) { width: 200px; white-space: nowrap; } /* 操作 */

.data-table th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    font-weight: 600;
    color: #495057;
    font-size: 13px;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #dee2e6;
}

.data-table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #f1f3f4;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

.loading {
    text-align: center;
    color: #666;
    font-style: italic;
}

/* 角色标签 */
.role-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    white-space: nowrap;
    display: inline-block;
    min-width: 50px;
    text-align: center;
}

.role-student {
    background: #e3f2fd;
    color: #1976d2;
}

.role-teacher {
    background: #fff3e0;
    color: #f57c00;
}

/* 有效期样式 */
.expiry-date {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}
.expiry-date.valid {
    background: #e8f5e8;
    color: #2e7d32;
}
.expiry-date.expired {
    background: #ffebee;
    color: #c62828;
}
.expiry-date.permanent {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* 操作按钮容器 */
.action-buttons {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
}

/* 操作按钮 */
.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 60px;
    text-align: center;
}

.action-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.action-btn i {
    margin-right: 4px;
    font-size: 11px;
}

.btn-edit {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
    border: 1px solid transparent;
}

.btn-edit:hover {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.btn-delete {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
    border: 1px solid transparent;
}

.btn-delete:hover {
    background: linear-gradient(135deg, #d32f2f 0%, #c62828 100%);
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}

/* 通用按钮 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: transform 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex !important;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

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

.modal-header h2 {
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #333;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: bold;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-buttons {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.form-buttons .btn {
    white-space: nowrap;
    min-width: 80px;
    text-align: center;
}

/* 消息提示 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px 30px;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    z-index: 99999;
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
    min-width: 400px;
    font-size: 16px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: none;
    pointer-events: none;
}

/* 添加背景遮罩，仅在可见时渲染 */
.toast.show::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: -1;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, -50%);
    display: block;
    pointer-events: auto;
}

.toast.success {
    background: #4caf50;
}

.toast.error {
    background: #f44336;
    border: 3px solid #d32f2f;
}

.toast.warning {
    background: #ff9800;
}

.toast.info {
    background: #2196f3;
}

/* 开发中页面 */
.coming-soon {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.coming-soon i {
    font-size: 64px;
    color: #bbb;
    margin-bottom: 20px;
}

.coming-soon h2 {
    color: #333;
    margin-bottom: 10px;
}

.coming-soon p {
    color: #666;
}

/* 3D配置管理样式 */
.config-container {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.config-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 600px;
}

.config-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.config-card .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 25px;
    color: white;
}

.config-card .card-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.config-card .card-content {
    padding: 30px;
}

.form-help {
    display: block;
    margin-top: 5px;
    font-size: 14px;
    color: #666;
    font-style: italic;
}

.form-actions {
    margin-top: 25px;
    display: flex;
    gap: 15px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e1e5e9;
}

.btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.btn-danger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 批量删除功能样式 */
.user-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
    accent-color: #667eea;
}

.user-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

#selectAllUsers {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

/* 选中行的高亮效果 */
.data-table tbody tr:has(.user-checkbox:checked) {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.08) 0%, rgba(102, 126, 234, 0.03) 100%);
    border-left: 4px solid #667eea;
    box-shadow: inset 0 0 0 1px rgba(102, 126, 234, 0.2);
}

.data-table tbody tr:has(.user-checkbox:checked):hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.12) 0%, rgba(102, 126, 234, 0.06) 100%);
    transform: translateY(-1px);
    box-shadow: inset 0 0 0 1px rgba(102, 126, 234, 0.3), 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 批量操作工具栏 */
.bulk-actions-toolbar {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 10px 15px;
    margin-bottom: 20px;
    display: none;
    align-items: center;
    justify-content: space-between;
}

.bulk-actions-toolbar.show {
    display: flex;
}

.bulk-selection-info {
    color: #495057;
    font-weight: 500;
}

.bulk-actions {
    display: flex;
    gap: 10px;
}

/* 表格响应式优化 */
@media (max-width: 1200px) {
    /* 在较小屏幕上调整列宽 */
    #usersTable th:nth-child(5), #usersTable td:nth-child(5) { width: 140px; } /* 身份证号 */
    #usersTable th:nth-child(7), #usersTable td:nth-child(7) { width: 100px; } /* 专业 */
    #usersTable th:nth-child(8), #usersTable td:nth-child(8) { width: 80px; } /* 班级 */
    #usersTable th:nth-child(11), #usersTable td:nth-child(11) { width: 160px; } /* 操作 */
}

@media (max-width: 900px) {
    /* 在更小屏幕上进一步调整 */
    .action-btn {
        padding: 4px 8px;
        font-size: 11px;
        min-width: 50px;
    }
    
    .action-btn i {
        margin-right: 2px;
        font-size: 10px;
    }
    
    /* 隐藏某些不重要的列 */
    #usersTable th:nth-child(7), #usersTable td:nth-child(7),
    #usersTable th:nth-child(8), #usersTable td:nth-child(8) { 
        display: none; 
    }
}

@media (max-width: 600px) {
    /* 手机端优化 */
    .action-btn {
        padding: 3px 6px;
        font-size: 10px;
        min-width: 40px;
    }
    
    .action-btn span {
        display: none; /* 隐藏按钮文字，只显示图标 */
    }
    
    .action-buttons {
        gap: 3px;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .config-container {
        margin: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

/* 消息样式 */
.message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
}

.message.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.message.success {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

/* 组织管理标签页样式 */
.organization-tabs {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.tab-buttons {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    font-size: 14px;
    font-weight: 500;
}

.tab-btn:hover {
    background: #e9ecef;
}

.tab-btn.active {
    background: white;
    border-bottom-color: #667eea;
    color: #667eea;
}

.tab-btn i {
    margin-right: 8px;
}

.tab-content {
    display: none;
    padding: 20px;
}

.tab-content.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.section-header h2 {
    color: #333;
    margin: 0;
    font-size: 18px;
}

/* 表单textarea样式 */
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}

.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* 头像上传样式 */
.avatar-upload {
    display: flex;
    justify-content: center;
}

.avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px dashed #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.3s;
    overflow: hidden;
    position: relative;
}

.avatar-preview:hover {
    border-color: #667eea;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #999;
    font-size: 12px;
    text-align: center;
}

.avatar-placeholder i {
    font-size: 24px;
    margin-bottom: 5px;
}

.avatar-placeholder span {
    font-size: 10px;
}

/* 用户表格中的头像 */
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #ddd;
}

.user-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .admin-panel {
        grid-template-areas: 
            "nav"
            "main";
        grid-template-columns: 1fr;
        grid-template-rows: 60px 1fr;
    }
    
    .sidebar {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .search-bar {
        flex-direction: column;
    }
    
    .page-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    /* 成绩统计响应式 */
    .results-overview {
        grid-template-columns: 1fr !important;
    }

    .results-filters {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .results-filters .form-input {
        width: 100% !important;
    }

    .exam-selector-container > div {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .exam-selector-container select {
        width: 100% !important;
        min-width: auto !important;
        max-width: none !important;
    }
}

/* 成绩统计界面样式 */
.stats-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.stats-card:hover::before {
    left: 100%;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

/* 成绩表格行悬停效果 */
#examResultsTable tr:hover {
    background-color: #f8fafc !important;
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* 成绩表格样式优化 */
.results-detail-container .table {
    border-collapse: separate;
    border-spacing: 0;
}

.results-detail-container .table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    text-align: center;
    padding: 15px;
    border: none;
}

.results-detail-container .table th:first-child {
    border-top-left-radius: 12px;
}

.results-detail-container .table th:last-child {
    border-top-right-radius: 12px;
}

.results-detail-container .table td {
    border: none;
    vertical-align: middle;
}

/* 筛选器样式 */
.results-filters .form-input {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 12px;
    transition: all 0.3s ease;
}

.results-filters .form-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

/* 考试选择器样式 */
.exam-selector-container {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border: 2px solid #e1e5e9;
    transition: all 0.3s ease;
}

.exam-selector-container:hover {
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

/* 空状态样式 */
.empty-state {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.empty-state:hover {
    border-color: #94a3b8;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

/* 按钮样式优化 */
.btn-sm {
    transition: all 0.2s ease;
    border-radius: 6px;
}

.btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* 通过状态徽章动画 */
.results-detail-container tbody tr td:nth-child(5) span {
    transition: all 0.3s ease;
}

.results-detail-container tbody tr:hover td:nth-child(5) span {
    transform: scale(1.05);
}

/* 环形进度条动画 */
.results-detail-container svg path:last-child {
    transition: stroke-dasharray 0.6s ease-in-out;
}

/* 不同尺寸的模态框样式 */
/* 大型模态框 - 成绩详情 */
#resultDetailModal .modal-content {
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    max-width: 1200px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

/* 中型模态框 - 创建考试 */
#createExamModal .modal-content {
    max-width: 800px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
}

/* 中型模态框 - 选择题目 */
#selectQuestionsModal .modal-content {
    max-width: 900px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

/* 考试详情模态框 */
#examDetailModal .modal-content {
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
}

#resultDetailModal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px 16px 0 0;
}

/* 成绩详情统计卡片 */
.detail-stat-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.detail-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.detail-stat-card:hover::before {
    left: 100%;
}

.detail-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

/* 成绩详情头部样式 */
.result-detail-header {
    position: relative;
    overflow: hidden;
}

.result-detail-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(180deg); }
}

/* 错题卡片样式 */
.wrong-question-card {
    transition: all 0.3s ease;
    border-left: 4px solid #ef4444;
}

.wrong-question-card:hover {
    transform: translateX(5px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.15);
}

/* 选项样式动画 */
.option-item {
    transition: all 0.2s ease;
}

.option-item:hover {
    transform: translateX(3px);
}

/* 加载动画 */
.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* =============================================================================
   3D配置管理样式 - 简化版
   ============================================================================= */

.switch-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0;
}

.form-switch {
    position: relative;
    width: 50px;
    height: 24px;
    appearance: none;
    background: #ddd;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.3s;
}

.form-switch:checked {
    background: #28a745;
}

.form-switch::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: left 0.3s;
}

.form-switch:checked::before {
    left: 26px;
}

.switch-label {
    font-weight: 600;
    color: #333;
    margin: 0;
}

.results-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-label {
    color: #666;
    font-weight: 500;
}

.stat-value {
    font-weight: 700;
    color: #333;
    font-size: 18px;
}

.results-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.results-table {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

/* =============================================================================
   删除原来复杂的样式
   ============================================================================= */

.results-overview {
    padding: 24px;
}

.overview-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.overview-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.overview-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

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

.overview-card .card-content h3 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 4px;
    color: #1f2937;
}

.overview-card .card-content p {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
    font-weight: 500;
}

.quick-actions {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    margin-bottom: 32px;
}

.quick-actions h3 {
    margin: 0 0 16px;
    color: #1f2937;
    font-size: 18px;
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.action-buttons .btn {
    padding: 10px 16px;
    font-size: 14px;
    border-radius: 8px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-outline-primary {
    color: #2563eb;
    border: 1px solid #2563eb;
    background: white;
}

.btn-outline-primary:hover {
    background: #2563eb;
    color: white;
}

.btn-outline-success {
    color: #16a34a;
    border: 1px solid #16a34a;
    background: white;
}

.btn-outline-success:hover {
    background: #16a34a;
    color: white;
}

.btn-outline-info {
    color: #0891b2;
    border: 1px solid #0891b2;
    background: white;
}

.btn-outline-info:hover {
    background: #0891b2;
    color: white;
}

.recent-results {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.recent-results h3 {
    margin: 0 0 20px;
    color: #1f2937;
    font-size: 18px;
    font-weight: 600;
}

.results-list {
    min-height: 200px;
}

.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 20px;
    color: #6b7280;
    font-size: 14px;
}

.loading-state i {
    font-size: 18px;
}

/* 页面操作按钮组 */
.page-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.page-actions .btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.page-header h1 {
    margin: 0;
    color: #1f2937;
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header h1 i {
    font-size: 20px;
    color: #6366f1;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .overview-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .action-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .page-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* 3D竞赛结果管理样式 */
.score-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    text-align: center;
}

.score-badge.excellent {
    background: linear-gradient(135deg, #10b981, #059669);
}

.score-badge.good {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.score-badge.average {
    background: linear-gradient(135deg, #6b7280, #4b5563);
}

.score-badge.poor {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.percentage-bar {
    position: relative;
    width: 100px;
    height: 20px;
    background: #f3f4f6;
    border-radius: 10px;
    overflow: hidden;
}

.percentage-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.percentage-fill.excellent {
    background: linear-gradient(90deg, #10b981, #059669);
}

.percentage-fill.good {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.percentage-fill.average {
    background: linear-gradient(90deg, #6b7280, #4b5563);
}

.percentage-fill.poor {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.percentage-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 600;
    color: #374151;
}

.error-count {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    background: #f3f4f6;
    color: #6b7280;
}

.error-count.has-errors {
    background: #fef2f2;
    color: #dc2626;
}

.action-buttons {
    display: flex;
    gap: 4px;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
}

/* 3D竞赛结果详情模态框样式 */
#result3DDetailModal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

#result3DDetailModal.show,
#result3DDetailModal[style*="display: block"] {
    display: flex !important;
}

#result3DDetailModal .modal-content {
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    overflow-y: auto;
}

.result-detail {
    max-height: 70vh;
    overflow-y: auto;
}

.detail-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.detail-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.detail-section h3 {
    margin: 0 0 15px 0;
    color: #1f2937;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-section h3 i {
    color: #6366f1;
}

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

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item span {
    font-size: 14px;
    color: #1f2937;
    font-weight: 500;
}

.score-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.score-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s ease;
}

.score-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.score-value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1f2937;
}

.score-value.excellent {
    color: #059669;
}

.score-value.good {
    color: #d97706;
}

.score-value.average {
    color: #4b5563;
}

.score-value.poor {
    color: #dc2626;
}

.score-value.error {
    color: #dc2626;
}

.score-value.success {
    color: #059669;
}

.score-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.error-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.error-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
}

.error-number {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #dc2626;
    color: white;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.error-text {
    flex: 1;
    color: #374151;
    line-height: 1.5;
}

.error-deduct {
    flex-shrink: 0;
    color: #dc2626;
    font-weight: 600;
    font-size: 14px;
}

.raw-data {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.raw-data pre {
    margin: 0;
    padding: 15px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    color: #495057;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 解析数据样式 */
.parsed-data {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.data-subsection {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.data-subsection:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.data-subsection h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.data-subsection h4 i {
    color: #6366f1;
    font-size: 14px;
}

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

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.stat-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.stat-value {
    font-size: 14px;
    color: #1f2937;
    font-weight: 600;
}

.parsed-error-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.parsed-error-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.error-header {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    gap: 12px;
}

.error-index {
    flex-shrink: 0;
    width: 20px;
    font-weight: 600;
    color: #dc2626;
}

.error-description {
    flex: 1;
    color: #374151;
    line-height: 1.4;
}

.error-score {
    flex-shrink: 0;
    color: #dc2626;
    font-weight: 600;
    font-size: 14px;
}

/* 批量操作样式 */
.batch-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
}

.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pagination-info {
    color: #6b7280;
    font-size: 14px;
}

/* 搜索控件样式改进 */
.search-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-controls .form-input {
    min-width: 120px;
}

.search-controls .search-input {
    min-width: 200px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .score-overview {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .search-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-controls .form-input,
    .search-controls .search-input {
        min-width: auto;
        width: 100%;
    }

    .pagination-container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .error-content {
        flex-direction: column;
        gap: 8px;
    }

    .action-buttons {
        justify-content: center;
    }
}

/* =============================================================================
   改进的Toggle开关样式
   ============================================================================= */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 8px 0;
}

.toggle-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.toggle-slider {
    position: relative;
    width: 54px;
    height: 28px;
    background: #e2e8f0;
    border-radius: 28px;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.toggle-input:checked + .toggle-label .toggle-slider {
    background: #4f46e5;
    box-shadow: inset 0 2px 4px rgba(79,70,229,0.3);
}

.toggle-input:checked + .toggle-label .toggle-slider::before {
    transform: translateX(26px);
    box-shadow: 0 2px 8px rgba(79,70,229,0.4);
}

.toggle-text {
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.toggle-input:checked + .toggle-label .toggle-text {
    color: #4f46e5;
    font-weight: 600;
}

/* Hover效果 */
.toggle-label:hover .toggle-slider {
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.15), 0 0 0 3px rgba(79,70,229,0.1);
}

.toggle-input:checked + .toggle-label:hover .toggle-slider {
    background: #4338ca;
    box-shadow: inset 0 2px 4px rgba(67,56,202,0.3), 0 0 0 3px rgba(79,70,229,0.2);
}

/* 焦点样式 */
.toggle-input:focus + .toggle-label .toggle-slider {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

/* 禁用状态 */
.toggle-input:disabled + .toggle-label {
    opacity: 0.5;
    cursor: not-allowed;
}

.toggle-input:disabled + .toggle-label .toggle-slider {
    background: #f1f5f9;
}

/* 更好的配置卡片间距 */
.config-container {
    display: grid;
    gap: 30px;
    max-width: 800px;
    margin: 0 auto;
}

.config-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.config-card .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 25px;
    border-bottom: none;
}

.config-card .card-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.config-card .card-content {
    padding: 25px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.form-help {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

/* =============================================================================
   3D竞赛结果列表优化样式
   ============================================================================= */

/* 表格行样式 */
.result-row {
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s ease;
}

.result-row:hover {
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* 单元格样式 */
.checkbox-cell {
    padding: 20px 15px !important;
    text-align: center;
    width: 50px;
}

.student-info-cell {
    padding: 20px 15px !important;
    min-width: 150px;
}

.student-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 15px;
    margin-bottom: 4px;
}

.student-id {
    font-size: 12px;
    color: #6b7280;
    font-family: 'Consolas', 'Monaco', monospace;
}

.score-cell {
    padding: 20px 15px !important;
    text-align: center;
    min-width: 100px;
}

.score-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    color: white;
    min-width: 70px;
    justify-content: center;
}

.score-separator {
    margin: 0 4px;
    opacity: 0.8;
}

.percentage-cell {
    padding: 20px 15px !important;
    min-width: 120px;
}

.percentage-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.percentage-bar {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.percentage-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease;
}

.percentage-text {
    font-weight: 600;
    font-size: 13px;
    color: #374151;
    min-width: 45px;
    text-align: right;
}

.error-cell {
    padding: 20px 15px !important;
    text-align: center;
    width: 80px;
}

.error-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 600;
    font-size: 13px;
}

.error-count.has-errors {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.error-count.no-errors {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #bbf7d0;
}

.time-cell {
    padding: 20px 15px !important;
    text-align: center;
    color: #6b7280;
    font-weight: 500;
    min-width: 100px;
}

.datetime-cell {
    padding: 20px 15px !important;
    min-width: 140px;
}

.submit-date {
    font-weight: 500;
    color: #374151;
    font-size: 14px;
    margin-bottom: 2px;
}

.submit-time {
    font-size: 12px;
    color: #6b7280;
}

.action-cell {
    padding: 20px 15px !important;
    text-align: center;
    width: 100px;
}

.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
}

.btn-view {
    background: #3b82f6;
    color: white;
}

.btn-view:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-delete {
    background: #ef4444;
    color: white;
}

.btn-delete:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* 空状态样式优化 */
.empty-state-row {
    border: none;
}

.empty-state-cell {
    padding: 80px 20px !important;
    text-align: center;
    background: #fafbfc;
}

.empty-state-content {
    max-width: 400px;
    margin: 0 auto;
}

.empty-state-icon {
    font-size: 64px;
    color: #cbd5e1;
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 8px 0;
}

.empty-state-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* 表格容器优化 */
.table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
}

.table {
    margin: 0;
    width: 100%;
    border-collapse: collapse;
}

.table thead th {
    background: #f8fafc;
    padding: 20px 15px;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    text-align: left;
    font-size: 14px;
}

.table thead th:first-child {
    border-top-left-radius: 12px;
}

.table thead th:last-child {
    border-top-right-radius: 12px;
}

/* 分数等级颜色 */
.excellent {
    background: linear-gradient(135deg, #10b981, #059669);
}

.good {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.average {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.poor {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* 响应式优化 */
@media (max-width: 1200px) {
    .student-info-cell,
    .datetime-cell {
        min-width: 120px;
    }

    .percentage-container {
        flex-direction: column;
        gap: 4px;
    }

    .percentage-text {
        text-align: center;
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .result-row:hover {
        transform: none;
    }

    .table thead th,
    .result-row td {
        padding: 15px 10px !important;
    }

    .action-buttons {
        flex-direction: column;
        gap: 4px;
    }

    .btn-action {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

/* ============================================
   模态框滚动修复补丁
   确保所有模态框在内容超出时都能正常滚动
   ============================================ */

/* 为没有特定样式的模态框添加滚动支持 */
#addUserModal .modal-content,
#addMajorModal .modal-content,
#addClassModal .modal-content,
#editUserModal .modal-content,
#bulkImportModal .modal-content {
    max-height: 85vh;
    overflow-y: auto;
}

/* 确保模态框内容区域也能正常滚动 */
.modal-content form {
    max-height: calc(85vh - 120px); /* 减去header和按钮区域的高度 */
    overflow-y: auto;
    padding-right: 10px; /* 为滚动条留出空间 */
}

/* 修复模态框内部可能阻止滚动的元素 */
.modal-content .modal-body {
    max-height: calc(85vh - 150px);
    overflow-y: auto;
}

/* 针对考试详情等内容较多的模态框 */
#examDetailModal .modal-body,
#resultDetailModal .modal-body,
#result3DDetailModal .modal-body {
    max-height: calc(80vh - 150px);
    overflow-y: auto;
    padding: 20px;
}

/* ============================================
   模板下载下拉菜单样式
   ============================================ */

.btn-group {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 220px;
    margin-top: 2px;
    animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #667eea;
    text-decoration: none;
}

.dropdown-item i {
    margin-right: 10px;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.dropdown-item small {
    display: block;
    color: #666;
    font-size: 12px;
    margin-top: 2px;
    line-height: 1.3;
    font-weight: normal;
}

.dropdown-item:hover small {
    color: #667eea;
}

/* 按钮悬停时的下拉菜单效果 */
.btn:hover .dropdown-menu {
    display: none; /* 防止悬停时自动显示 */
}

/* 响应式设计 */
@media (max-width: 768px) {
    .dropdown-menu {
        min-width: 200px;
        right: 0;
        left: auto;
    }

    .dropdown-item {
        padding: 10px 14px;
        font-size: 13px;
    }

    .dropdown-item i {
        font-size: 14px;
        width: 18px;
    }

    .dropdown-item small {
        font-size: 11px;
    }
}

/* =============================================================================
   用户管理分页样式优化
   ============================================================================= */
#usersPagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 15px;
}

#usersPagination button {
    min-width: 45px !important;
    height: 45px !important;
    padding: 0 12px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border: 2px solid #e2e8f0 !important;
    background: white !important;
    color: #64748b !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

#usersPagination button:hover {
    background: #3b82f6 !important;
    color: white !important;
    border-color: #3b82f6 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
}

#usersPagination button.active {
    background: #3b82f6 !important;
    color: white !important;
    border-color: #3b82f6 !important;
    transform: scale(1.05) !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4) !important;
    pointer-events: none !important;
}

/* 移动设备上的优化 */
@media (max-width: 768px) {
    #usersPagination {
        gap: 6px;
        padding: 10px;
    }

    #usersPagination button {
        min-width: 40px !important;
        height: 40px !important;
        font-size: 14px !important;
        padding: 0 8px !important;
    }
}

@media (max-width: 480px) {
    #usersPagination {
        gap: 4px;
        padding: 8px;
        flex-wrap: wrap;
    }

    #usersPagination button {
        min-width: 35px !important;
        height: 35px !important;
        font-size: 13px !important;
        padding: 0 6px !important;
    }
}
