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

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 20px;
    gap: 20px;
}

/* 顶部工具栏 */
.toolbar {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #4a5568;
    color: white;
}

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

.btn.primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    font-size: 16px;
    padding: 12px 30px;
}

.btn.warning {
    background: #f56565;
}

.btn.danger {
    background: #e53e3e;
}

.btn.small {
    padding: 6px 12px;
    font-size: 12px;
}

/* 主体区域 */
.main-content {
    flex: 1;
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    min-height: 400px;
}

/* 3D地球容器 */
.earth-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#globe {
    width: 100%;
    height: 100%;
}

/* 学生显示 */
.student-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 10;
}

.student-display.show {
    opacity: 1;
}

.student-name {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
    animation: fadeInScale 0.5s ease;
}

.student-info {
    font-size: 20px;
    opacity: 0.9;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 底部面板 */
.bottom-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    height: 300px;
}

.panel-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.panel-section h3 {
    margin-bottom: 15px;
    color: #2d3748;
}

/* 表格样式 */
.student-list, .record-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 15px;
}

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

th, td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    background: #f7fafc;
    font-weight: bold;
    color: #4a5568;
    position: sticky;
    top: 0;
}

tr:hover {
    background: #f7fafc;
}

/* 操作按钮 */
.edit-btn, .delete-btn {
    padding: 4px 8px;
    margin: 0 2px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.edit-btn {
    background: #4299e1;
    color: white;
}

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

/* 添加学生 */
.add-student {
    display: flex;
    gap: 10px;
}

.add-student input {
    padding: 8px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 14px;
}

.add-student input[type="text"] {
    flex: 1;
}

/* 记录控制 */
.record-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.record-controls input[type="date"] {
    padding: 6px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
}

/* 状态标签 */
.status-normal {
    color: #38a169;
    font-weight: bold;
}

.status-late {
    color: #d69e2e;
    font-weight: bold;
}

.status-absent {
    color: #e53e3e;
    font-weight: bold;
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #2d3748;
}

#selectedStudent {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 30px;
    color: #4a5568;
}

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

.status-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.status-btn.normal {
    background: #48bb78;
}

.status-btn.late {
    background: #ed8936;
}

.status-btn.absent {
    background: #f56565;
}

.status-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* 加载动画 */
.loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.loading.show {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: white;
    font-size: 18px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .bottom-panel {
        grid-template-columns: 1fr;
        height: auto;
    }

    .panel-section {
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    .toolbar {
        justify-content: center;
    }

    .student-name {
        font-size: 36px;
    }

    .status-buttons {
        flex-direction: column;
        width: 100%;
    }

    .status-btn {
        width: 100%;
    }
}