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

:root {
    --primary: #4a90d9;
    --primary-dark: #3a7bc8;
    --secondary: #6c757d;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --late: #fd7e14;
    --bg-dark: #1a1a2e;
    --bg-card: #16213e;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --border-radius: 12px;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

/* ===== 头部 ===== */
.header {
    text-align: center;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #4a90d9, #87ceeb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== 3D地球容器 ===== */
.earth-container {
    width: 100%;
    height: 300px;
    border-radius: var(--border-radius);
    background: radial-gradient(ellipse at center, #1e3a5f 0%, #0f0f1a 100%);
    overflow: hidden;
    margin-bottom: 20px;
    position: relative;
}

.earth-container canvas {
    display: block;
}

/* ===== 控制面板 ===== */
.control-panel {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: center;
}

.control-group {
    display: flex;
    gap: 10px;
}

.date-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-filter input {
    background: #0f0f1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.date-filter input:focus {
    outline: none;
    border-color: var(--primary);
}

.date-filter label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ===== 按钮 ===== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #5ba0e8);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 144, 217, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: #333;
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #444;
}

.btn-large {
    padding: 15px 40px;
    font-size: 1.1rem;
}

/* 文件输入标签 */
.file-input-label {
    background: linear-gradient(135deg, var(--success), #34ce57);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.file-input-label:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

/* ===== 点名结果展示 ===== */
.result-display {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: default;
}

.result-display.hidden {
    display: none;
}

.result-name {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #ffd700, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-status {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.result-time {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.status-present { color: var(--success); }
.status-late { color: var(--late); }
.status-absent { color: var(--danger); }
.status-pending { color: var(--warning); }

/* 结果操作按钮 */
.result-actions {
    margin: 20px 0;
}

.result-actions.hidden {
    display: none;
}

.result-prompt {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 1rem;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.action-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.action-btn.present {
    background: rgba(40, 167, 69, 0.2);
    color: var(--success);
}

.action-btn.present:hover {
    background: var(--success);
    color: white;
    transform: scale(1.05);
}

.action-btn.late {
    background: rgba(253, 126, 20, 0.2);
    color: var(--late);
}

.action-btn.late:hover {
    background: var(--late);
    color: white;
    transform: scale(1.05);
}

.action-btn.absent {
    background: rgba(220, 53, 69, 0.2);
    color: var(--danger);
}

.action-btn.absent:hover {
    background: var(--danger);
    color: white;
    transform: scale(1.05);
}

/* 学生卡片选中状态 */
.student-card.selected {
    background: #2a3f5f;
    border: 2px solid var(--warning);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.4); }
    50% { box-shadow: 0 0 20px 5px rgba(255, 193, 7, 0.2); }
}

.today-pending { color: var(--warning); }

/* ===== 学生名单 ===== */
.students-section,
.history-section {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
}

.students-section h2,
.history-section h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.students-list,
.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.student-card {
    background: #1e2a4a;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.student-card:hover {
    background: #253352;
    transform: translateX(5px);
}

.student-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.student-name {
    font-size: 1.1rem;
    font-weight: 500;
}

.student-name.today-present::after { content: ' ✓'; color: var(--success); }
.student-name.today-late::after { content: ' ⏰'; color: var(--late); }
.student-name.today-absent::after { content: ' ✗'; color: var(--danger); }

.student-stats {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.student-details {
    display: flex;
    gap: 8px;
}

.stat-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    background: #333;
}

.stat-badge.late {
    background: rgba(253, 126, 20, 0.2);
    color: var(--late);
}

.stat-badge.absent {
    background: rgba(220, 53, 69, 0.2);
    color: var(--danger);
}

.stat-badge.call {
    background: rgba(74, 144, 217, 0.2);
    color: var(--primary);
}

/* ===== 历史记录 ===== */
.history-item {
    background: #1e2a4a;
    border-radius: 8px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.history-item:hover {
    background: #253352;
}

.history-name {
    flex: 1;
    font-weight: 500;
}

.history-status {
    font-size: 1.2rem;
}

.history-time {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ===== 空状态提示 ===== */
.empty-hint {
    text-align: center;
    color: var(--text-secondary);
    padding: 30px;
    font-size: 0.95rem;
}

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

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 30px;
    min-width: 320px;
    text-align: center;
}

.modal-content h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #ffd700, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.status-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.status-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.status-btn.present {
    background: rgba(40, 167, 69, 0.2);
    color: var(--success);
}

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

.status-btn.late {
    background: rgba(253, 126, 20, 0.2);
    color: var(--late);
}

.status-btn.late:hover {
    background: var(--late);
    color: white;
}

.status-btn.absent {
    background: rgba(220, 53, 69, 0.2);
    color: var(--danger);
}

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

.btn-close {
    background: #333;
    color: var(--text-primary);
    padding: 10px 30px;
}

.btn-close:hover {
    background: #444;
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #1a1a2e;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ===== 响应式 ===== */
@media (max-width: 600px) {
    .header h1 {
        font-size: 1.8rem;
    }

    .earth-container {
        height: 220px;
    }

    .control-panel {
        flex-direction: column;
    }

    .control-group,
    .date-filter {
        width: 100%;
        justify-content: center;
    }

    .btn-large {
        width: 100%;
    }

    .student-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .result-name {
        font-size: 2rem;
    }
}
