/* 小红书风格的CSS样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
    font-weight: 300;
}

/* 控制面板 */
.control-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    flex-wrap: wrap;
    gap: 20px;
}

.file-operations, .roll-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

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

.btn-import {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: white;
}

.btn-export {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.btn-save-hand {
    background: linear-gradient(45deg, #00d2d3, #01a3a4);
    color: white;
}

.btn-load-hand {
    background: linear-gradient(45deg, #54a0ff, #2e86de);
    color: white;
}

.btn-start {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
}

.btn-stop {
    background: linear-gradient(45deg, #feca57, #ff9ff3);
    color: white;
}

.btn-reset {
    background: linear-gradient(45deg, #54a0ff, #2e86de);
    color: white;
}

/* 3D球形展示区域 */
.sphere-container {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#threejs-container {
    width: 100%;
    height: 500px;
    border-radius: 15px;
    overflow: hidden;
    background: radial-gradient(circle at center, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

/* 选中学生显示 */
.selected-student {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    text-align: center;
    min-width: 200px;
    transition: all 0.3s ease;
    /* 初始状态隐藏 */
    opacity: 0;
    visibility: hidden;
}

.selected-student.visible {
    opacity: 1;
    visibility: visible;
}

.selected-student.rolling {
    animation: bounce 0.6s ease-in-out infinite alternate;
}

.selected-student.final-result {
    border: 3px solid #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.3);
}

.student-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ff6b6b; /* 点名过程中也使用相同的颜色 */
    margin: 0;
    text-align: center;
}

.selected-student.final-result .student-name {
    color: #ff6b6b;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
}

@keyframes bounce {
    0% { transform: translateX(-50%) translateY(0); }
    100% { transform: translateX(-50%) translateY(-10px); }
}

@keyframes pulse {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.05); }
}

/* 学生列表 */
.students-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.student-count {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.students-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
}

.student-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 10px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.student-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.student-card.selected {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

.student-card.hand-raised {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}

.student-card.hand-raised:hover {
    box-shadow: 0 8px 25px rgba(78, 205, 196, 0.4);
}

.student-name-text {
    font-size: 0.9rem;
}

.hand-icon {
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.student-card:hover .hand-icon {
    transform: scale(1.2);
}

.student-card.hand-raised .hand-icon {
    animation: wave 1s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(30deg); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(-15deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .control-panel {
        flex-direction: column;
        gap: 15px;
    }
    
    .file-operations, .roll-controls {
        width: 100%;
        justify-content: center;
    }
    
    .students-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    #threejs-container {
        height: 400px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .header {
        padding: 20px;
    }
    
    .title {
        font-size: 1.8rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    #threejs-container {
        height: 350px;
    }
    
    .selected-student {
        bottom: 20px;
        padding: 15px 25px;
    }
    
    .student-name {
        font-size: 1.5rem;
    }
}