/* ============================================
   财经课程管理系统 - Professional UI Theme
   ============================================ */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f0f2f5;
    color: #333;
    font-size: 14px;
    line-height: 1.6;
}

.container { min-height: 100vh; }

/* --- Header --- */
.header {
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    color: #fff;
    padding: 28px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 12px rgba(26,115,232,0.3);
}
.header h1 { font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.header p { font-size: 13px; opacity: 0.85; }
.header-actions { display: flex; gap: 10px; }

/* --- Tabs --- */
.tabs {
    background: #fff;
    display: flex;
    padding: 0 32px;
    border-bottom: 1px solid #e8e8e8;
}
.tab-btn {
    padding: 14px 22px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    position: relative;
    top: 1px;
}
.tab-btn:hover { color: #1a73e8; }
.tab-btn.active { color: #1a73e8; border-bottom-color: #1a73e8; font-weight: 500; }

/* --- Content --- */
.content { padding: 24px 32px; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* --- Buttons --- */
.btn {
    padding: 8px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-primary { background: #1a73e8; color: #fff; }
.btn-primary:hover { background: #1557b0; box-shadow: 0 2px 8px rgba(26,115,232,0.35); }
.btn-secondary { background: #fff; color: #333; border: 1px solid #d0d0d0; }
.btn-secondary:hover { background: #f5f5f5; }
.btn-danger { background: #fff; color: #e53935; border: 1px solid #e53935; }
.btn-danger:hover { background: #e53935; color: #fff; }
.btn-small { padding: 4px 10px; font-size: 12px; border-radius: 4px; }
.btn-small.btn-primary { background: #e8f0fe; color: #1a73e8; }
.btn-small.btn-primary.btn-primary-active { background: #1a73e8; color: #fff; }

/* --- Search Bar --- */
.search-bar {
    background: #fff;
    border-radius: 10px;
    padding: 18px 22px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}
.search-input-wrapper { position: relative; flex: 1; min-width: 200px; }
.search-input-wrapper input {
    width: 100%;
    padding: 9px 36px 9px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}
.search-input-wrapper input:focus { outline: none; border-color: #1a73e8; box-shadow: 0 0 0 3px rgba(26,115,232,0.1); }
.search-clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}
input[type="number"], input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
}
input[type="number"]:focus, input[type="text"]:focus { outline: none; border-color: #1a73e8; }

/* --- Stats Cards --- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 16px 20px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    border-left: 4px solid #1a73e8;
}
.stat-card.green { border-left-color: #43a047; }
.stat-card.orange { border-left-color: #fb8c00; }
.stat-card.red { border-left-color: #e53935; }
.stat-label { font-size: 12px; color: #888; margin-bottom: 4px; }
.stat-value { font-size: 26px; font-weight: 700; color: #1a1a1a; }
.stat-sub { font-size: 11px; color: #999; margin-top: 2px; }

/* --- Table --- */
.table-wrapper {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}
table { width: 100%; border-collapse: collapse; }
th {
    background: #f8f9fa;
    padding: 12px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e8e8e8;
    white-space: nowrap;
}
td {
    padding: 11px 14px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    color: #333;
}
tr:hover td { background: #f8fafc; }
tr:last-child td { border-bottom: none; }
.checkbox-cell { width: 40px; text-align: center; }
.id-cell { font-family: monospace; font-size: 12px; color: #888; }
.sessions-cell { font-weight: 600; color: #1a73e8; }
.sessions-zero { color: #e53935; }
.actions-cell { display: flex; gap: 6px; }

/* --- Pagination --- */
.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    flex-wrap: wrap;
    gap: 10px;
}
.pagination-info { font-size: 13px; color: #888; }
.pagination-controls { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.pagination-controls button {
    min-width: 34px;
    height: 34px;
    border: 1px solid #e0e0e0;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    transition: all 0.15s;
}
.pagination-controls button:hover:not(:disabled) { background: #e8f0fe; border-color: #1a73e8; color: #1a73e8; }
.pagination-controls button.active { background: #1a73e8; color: #fff; border-color: #1a73e8; }
.pagination-controls button:disabled { opacity: 0.4; cursor: not-allowed; }

/* --- Modal --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.modal-overlay.active { display: flex; }
.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 14px;
    width: 90%;
    max-width: 680px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    z-index: 1001;
}

.modal.active {
    display: block;
}
.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: #999; line-height: 1; }
.modal-body { padding: 22px 24px; overflow-y: auto; max-height: calc(85vh - 120px); }
.modal-footer { padding: 14px 24px; border-top: 1px solid #eee; display: flex; justify-content: flex-end; gap: 10px; }

/* --- Import Preview --- */
.import-preview { width: 100%; border-collapse: collapse; margin-top: 12px; }
.import-preview th { background: #f0f4ff; padding: 8px 12px; font-size: 12px; text-align: left; border: 1px solid #dde; }
.import-preview td { padding: 7px 12px; border: 1px solid #eef; font-size: 13px; }

/* --- File Upload --- */
.file-upload-area {
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
}
.file-upload-area:hover { border-color: #1a73e8; background: #e8f0fe; }
.file-upload-area input[type="file"] { display: none; }
.file-upload-icon { font-size: 36px; margin-bottom: 8px; }
.file-upload-text { color: #666; font-size: 14px; }
.file-upload-hint { color: #999; font-size: 12px; margin-top: 4px; }

/* --- Toast --- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 12px 20px;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    min-width: 220px;
    max-width: 320px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease;
}
.toast.success { background: #43a047; }
.toast.error { background: #e53935; }
.toast.warning { background: #fb8c00; }
.toast.info { background: #1a73e8; }
.toast-title { font-weight: 600; margin-bottom: 2px; }
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* --- Loading --- */
.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.85);
    z-index: 9000;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 12px;
}
.loading-overlay.active { display: flex; }
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e0e0;
    border-top-color: #1a73e8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 14px; color: #666; }

/* --- Misc --- */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: #555; margin-bottom: 6px; }
.form-group input { width: 100%; }
.hint-text { font-size: 12px; color: #999; margin-top: 4px; }
.empty-state { text-align: center; padding: 48px; color: #999; }
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .header { flex-direction: column; gap: 12px; text-align: center; padding: 20px; }
    .content { padding: 16px; }
    .tabs { padding: 0 16px; overflow-x: auto; }
    .search-bar { padding: 14px; }
    th, td { padding: 8px 10px; font-size: 12px; }
    .stat-value { font-size: 22px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }


/* 隐藏底部添加学员表单区域 */
.add-student-section,
.import-section,
.batch-import,
.form-section,
.student-form,
.add-form {
    display: none !important;
}


/* 编辑弹窗样式优化 */
.modal .modal-content {
    padding: 30px;
}

.modal .modal-content h2 {
    margin: 0 0 25px 0;
    font-size: 22px;
    color: #333;
    font-weight: 600;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.modal .form-group {
    margin-bottom: 20px;
}

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

.modal .form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

.modal .form-group input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

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

.modal .btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.modal .btn-primary {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.modal .btn-primary:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.modal .btn-secondary {
    background: #f5f5f5;
    color: #666;
}

.modal .btn-secondary:hover {
    background: #e8e8e8;
}
