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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
}

#app {
    max-width: 100%;
    padding: 0;
}

/* 顶部导航 */
.students-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    padding: 24px 30px;
    border-bottom: 1px solid #e8e8e8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.header-left h1 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0 0 4px 0;
}

.header-description {
    font-size: 14px;
    color: #666;
    margin: 0;
}

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

.add-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.add-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.add-icon {
    font-size: 18px;
    font-weight: bold;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-input {
    padding: 10px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    width: 300px;
    transition: all 0.3s ease;
}

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

.search-button {
    background: #f0f0f0;
    border: 1px solid #d9d9d9;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-button:hover {
    background: #e6f7ff;
    border-color: #91d5ff;
}

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

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
}

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

.stat-icon {
    font-size: 36px;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
}

.stat-content {
    flex: 1;
}

.stat-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.stat-change {
    font-size: 12px;
    font-weight: 500;
}

.stat-change.positive {
    color: #52c41a;
}

.stat-change.negative {
    color: #ff4d4f;
}

/* 学员列表 */
.students-section {
    background: white;
    margin: 0 30px 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}

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

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

.filter-select {
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.export-button {
    background: #f0f0f0;
    border: 1px solid #d9d9d9;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.export-button:hover {
    background: #e6f7ff;
    border-color: #91d5ff;
}

/* 学员表格 */
.students-table {
    padding: 24px;
    overflow-x: auto;
}

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

.students-table th {
    background: #fafafa;
    padding: 12px 16px;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #f0f0f0;
}

.students-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #333;
}

.students-table tr:hover {
    background: #f5f5f5;
}

/* 班宠缩写标签 */
.abbr-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    background: #f0eaff;
    color: #7c5cff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.active {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.status-badge.inactive {
    background: #fff1f0;
    color: #ff4d4f;
    border: 1px solid #ffccc7;
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 8px;
}

.action-button {
    padding: 4px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.action-button.edit {
    background: #e6f7ff;
    border-color: #91d5ff;
    color: #1890ff;
}

.action-button.edit:hover {
    background: #bae7ff;
    border-color: #40a9ff;
}

.action-button.view {
    background: #f6ffed;
    border-color: #b7eb8f;
    color: #52c41a;
}

.action-button.view:hover {
    background: #d9f7be;
    border-color: #73d13d;
}

.action-button.delete {
    background: #fff1f0;
    border-color: #ffccc7;
    color: #ff4d4f;
}

.action-button.delete:hover {
    background: #ffccc7;
    border-color: #ff4d4f;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-text {
    font-size: 16px;
}

/* 分页 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}

.page-button {
    padding: 6px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.page-button:hover:not(:disabled) {
    border-color: #1890ff;
    color: #1890ff;
}

.page-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.page-info {
    font-size: 14px;
    color: #666;
}

/* 模态框 */
.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: 2000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.3s ease;
}

.view-modal {
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.delete-modal {
    max-width: 400px;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.close-button {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.close-button:hover {
    background: #f0f0f0;
    color: #666;
}

.modal-body {
    padding: 24px;
    max-height: 500px;
    overflow-y: auto;
}

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

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

.form-input,
.form-select {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

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

.form-select {
    height: 40px;
}

.form-select[multiple] {
    height: 120px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

/* 按钮样式 */
.btn-secondary {
    background: white;
    color: #666;
    border: 1px solid #d9d9d9;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    border-color: #1890ff;
    color: #1890ff;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-danger {
    background: #ff4d4f;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: #ff7875;
    box-shadow: 0 4px 12px rgba(255, 77, 79, 0.4);
}

/* 学员详情 */
.student-details {
    margin-bottom: 32px;
}

.detail-row {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px 0;
    border-bottom: 1px dashed #f0f0f0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    width: 120px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
}

.detail-value {
    flex: 1;
    font-size: 14px;
    color: #333;
}

/* 课程进度 */
.course-progress h4 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
}

.progress-item {
    margin-bottom: 16px;
}

.progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.course-name {
    font-weight: 500;
    color: #333;
}

.progress-percentage {
    font-weight: 500;
    color: #667eea;
}

.progress-bar {
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* 上课记录（含缺勤） */
.records-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.records-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.records-head h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.records-filter {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 4px 12px;
    font-size: 12px;
    border: 1px solid #d9d9d9;
    border-radius: 14px;
    background: #fff;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.filter-btn.on {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
}

.records-summary {
    font-size: 13px;
    color: #666;
    background: #f7f8ff;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 12px;
}

.records-loading,
.records-empty {
    font-size: 13px;
    color: #999;
    text-align: center;
    padding: 16px 0;
}

.rec-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    margin-bottom: 8px;
}

.rec-item.absent {
    background: #fff6f6;
    border-color: #ffd9d9;
}

.rec-date {
    width: 118px;
    flex-shrink: 0;
    font-size: 12px;
    color: #888;
}

.rec-date b {
    display: block;
    font-size: 13px;
    color: #333;
}

.rec-info {
    flex: 1;
    min-width: 0;
}

.rec-course {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.rec-sub {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.rec-chip {
    flex-shrink: 0;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 12px;
}

.rec-chip.ok {
    background: #e6f7ee;
    color: #12a150;
}

.rec-chip.bad {
    background: #ffe9e9;
    color: #d93025;
}

.delete-warning {
    color: #ff4d4f;
    font-size: 14px;
    margin-top: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .students-header {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
        text-align: center;
    }
    
    .header-right {
        flex-direction: column;
        width: 100%;
    }
    
    .search-input {
        width: 100%;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
        padding: 16px;
    }
    
    .students-section {
        margin: 16px;
    }
    
    .section-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .section-actions {
        justify-content: space-between;
    }
    
    .students-table {
        padding: 16px;
    }
    
    .students-table table {
        font-size: 12px;
    }
    
    .students-table th,
    .students-table td {
        padding: 8px 12px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 4px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .detail-label {
        width: 100%;
    }
}
