/* ===== 学生报名审核分班系统 - 全局样式 ===== */
:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #e0e7ff;
    --success: #10b981;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --info: #3b82f6;
    --info-light: #dbeafe;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
}

/* ===== 通用组件 ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.hidden { display: none !important; }

/* ===== 按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-outline { background: transparent; border: 2px solid var(--gray-300); color: var(--gray-600); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* 开关 (switch) */
.switch { position: relative; display: inline-block; width: 38px; height: 22px; vertical-align: middle; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--gray-300); border-radius: 22px; transition: 0.2s;
}
.switch .slider:before {
    position: absolute; content: ""; height: 16px; width: 16px;
    left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: 0.2s;
}
.switch input:checked + .slider { background: var(--success); }
.switch input:checked + .slider:before { transform: translateX(16px); }

/* 表格 + 过滤条 */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td {
    padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--gray-200); vertical-align: middle;
}
.data-table thead th {
    background: var(--gray-100); font-weight: 700; color: var(--gray-600);
    position: sticky; top: 0;
}
.data-table tbody tr:hover { background: var(--gray-50); }
.filter-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.form-group label .required { color: var(--danger); }
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color 0.2s;
    background: #fff;
}
.form-control:focus { outline: none; border-color: var(--primary); }
.form-control:read-only { background: var(--gray-100); }
.form-row { display: flex; gap: 16px; }
.form-row > .form-group { flex: 1; }
.form-hint { font-size: 12px; color: var(--gray-400); margin-top: 4px; }

select.form-control { cursor: pointer; }
textarea.form-control { min-height: 80px; resize: vertical; }

/* ===== 表单校验（行内错误反馈）===== */
/* 通过 .is-invalid 为输入框添加红色边框及阴影，.field-error 用于显示具体提示语。*/
.form-control.is-invalid,
.form-control.is-invalid:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}
.field-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 4px;
    line-height: 1.4;
    min-height: 16px;
}
.field-error:empty { display: none; }

/* ===== 卡片 ===== */
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}
.card-title { font-size: 18px; font-weight: 700; color: var(--gray-800); }

/* ===== 表格 ===== */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { background: var(--gray-50); padding: 12px 16px; text-align: left; font-weight: 600; color: var(--gray-600); border-bottom: 2px solid var(--gray-200); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--gray-100); }
.table tbody tr:hover { background: var(--gray-50); }

/* ===== 徽章 ===== */
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge-pending { background: var(--warning-light); color: #92400e; }
.badge-passed { background: var(--success-light); color: #065f46; }
.badge-rejected { background: var(--danger-light); color: #991b1b; }
.badge-classed { background: var(--info-light); color: #1e40af; }
.badge-published { background: #e0e7ff; color: #3730a3; }

/* ===== 导航栏 ===== */
.navbar {
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.navbar-brand { font-size: 18px; font-weight: 700; color: var(--primary); text-decoration: none; display: flex; align-items: center; }
.navbar-nav { display: flex; gap: 4px; align-items: center; }
.nav-link { padding: 8px 16px; border-radius: var(--radius); font-size: 14px; color: var(--gray-600); text-decoration: none; cursor: pointer; transition: all 0.2s; }
.nav-link:hover { background: var(--gray-100); color: var(--primary); }
.nav-link.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }

/* ===== 统计卡片 ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); text-align: center; }
.stat-card .stat-value { font-size: 32px; font-weight: 700; color: var(--primary); }
.stat-card .stat-label { font-size: 13px; color: var(--gray-500); margin-top: 4px; }
.stat-card.success .stat-value { color: var(--success); }
.stat-card.danger .stat-value { color: var(--danger); }
.stat-card.warning .stat-value { color: var(--warning); }

/* ===== 进度条 ===== */
.progress-steps { display: flex; align-items: center; margin: 24px 0; }
.progress-step { display: flex; align-items: center; gap: 8px; }
.progress-step .step-circle { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; background: var(--gray-200); color: var(--gray-500); }
.progress-step.active .step-circle { background: var(--primary); color: #fff; }
.progress-step.done .step-circle { background: var(--success); color: #fff; }
.progress-step .step-label { font-size: 13px; color: var(--gray-500); }
.progress-step.active .step-label, .progress-step.done .step-label { color: var(--gray-800); font-weight: 600; }
.progress-line { flex: 1; height: 2px; background: var(--gray-200); margin: 0 8px; }
.progress-line.done { background: var(--success); }

/* ===== 模态框 ===== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--gray-200); }
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--gray-400); padding: 0 4px; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--gray-200); display: flex; justify-content: flex-end; gap: 8px; }

/* ===== Toast 提示 ===== */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 20px; border-radius: var(--radius); color: #fff; font-size: 14px; box-shadow: var(--shadow-lg); animation: slideIn 0.3s ease; max-width: 400px; }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--info); }
.toast-warning { background: var(--warning); }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }

/* ===== 空状态 ===== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--gray-400); }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state .empty-text { font-size: 15px; }

/* ===== 表头 / 表单 label 上的"二级提示"小标签（半透明，不喧宾夺主） ===== */
.col-hint,
.label-hint {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 6px;
    border-radius: 8px;
    background: var(--gray-100);
    color: var(--gray-500);
    font-size: 12px;
    font-weight: 500;
    cursor: help;
    vertical-align: middle;
    line-height: 1.4;
}
.col-hint:hover,
.label-hint:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

/* ===== 分页 ===== */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 20px; align-items: center; }
.pagination .page-item { padding: 6px 12px; border-radius: var(--radius); font-size: 13px; cursor: pointer; border: 1px solid var(--gray-200); background: #fff; }
.pagination .page-item:hover { background: var(--gray-100); }
.pagination .page-item.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .page-item:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== 标签页 ===== */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--gray-200); margin-bottom: 20px; }
.tab { padding: 10px 20px; font-size: 14px; font-weight: 600; color: var(--gray-500); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.2s; }
.tab:hover { color: var(--gray-800); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ===== 侧边栏布局（管理端）===== */
.admin-layout { display: flex; min-height: calc(100vh - 60px); }
.admin-sidebar { width: 220px; background: #fff; border-right: 1px solid var(--gray-200); padding: 16px 0; flex-shrink: 0; }
.admin-sidebar .menu-item { display: flex; align-items: center; gap: 10px; padding: 12px 24px; font-size: 14px; color: var(--gray-600); cursor: pointer; transition: all 0.2s; }
.admin-sidebar .menu-item:hover { background: var(--gray-50); color: var(--primary); }
.admin-sidebar .menu-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; border-right: 3px solid var(--primary); }
.admin-content { flex: 1; padding: 24px; overflow-x: auto; }

/* ===== 文件上传 ===== */
.upload-area { border: 2px dashed var(--gray-300); border-radius: var(--radius); padding: 24px; text-align: center; cursor: pointer; transition: all 0.2s; }
.upload-area:hover { border-color: var(--primary); background: var(--primary-light); }
.upload-area .upload-icon { font-size: 32px; color: var(--gray-400); }
.upload-area.uploaded { border-style: solid; background: #f0fff4; }
.upload-area .upload-status { display: flex; align-items: center; justify-content: center; gap: 6px; }
.upload-area .upload-status .check { display: inline-block; }
.text-muted { color: var(--gray-500); font-size: 13px; }
.btn-link { background: transparent; color: var(--primary); border: none; cursor: pointer; padding: 2px 6px; }
.btn-link:hover { text-decoration: underline; }

/* ===== 自动补全搜索框 ===== */
.autocomplete-wrapper { position: relative; }
.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: #fff;
    border: 2px solid var(--primary);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.autocomplete-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.15s;
}
.autocomplete-item:hover { background: var(--primary-light); }
.autocomplete-item .item-name { font-size: 14px; font-weight: 600; color: var(--gray-800); }
.autocomplete-item .item-desc { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.autocomplete-item .item-code { font-size: 12px; color: var(--info); margin-top: 2px; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .form-row { flex-direction: column; gap: 0; }
    .admin-sidebar { display: none; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
