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

body {
    font-family: 'Arial', sans-serif;
    height: 100vh;
    overflow: hidden;
    background-color: #f5f5f5;
}

/* 年级选择界面样式 */
.grade-selection {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #f0f8ff;
}

.grade-selection h1 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 2rem;
    text-align: center;
}

.grade-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    width: 80%;
    max-width: 400px;
}

.grade-btn {
    padding: 1.5rem;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    background-color: #4CAF50;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.grade-btn:hover {
    background-color: #45a049;
    transform: scale(1.05);
}

.grade-btn:active {
    transform: scale(0.95);
}

/* 游戏主界面样式 */
.game-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* 顶部动图显示区域 */
.gif-container {
    flex: 1;
    max-height: 50vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #ffffff;
    border-bottom: 2px solid #e0e0e0;
    overflow: hidden;
}

.gif-container video {
    width: auto;
    height: 100%;
    object-fit: contain;
}

/* 底部题目和选项区域 */
.question-container {
    flex: 1;
    max-height: 50vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background-color: #f9f9f9;
    overflow: auto;
}

.instruction-text {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 1rem;
    text-align: center;
}

#question-content {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 2rem;
    text-align: center;
    max-width: 90%;
}

.options-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
    width: 80%;
    max-width: 500px;
    justify-content: center;
}

.option-btn {
    padding: 1.2rem;
    font-size: 1.1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    background-color: white;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    flex: 1;
    min-width: 120px;
    max-width: calc(50% - 0.5rem);
}

.option-btn:hover {
    background-color: #f0f0f0;
    border-color: #4CAF50;
}

.option-btn:active {
    transform: scale(0.98);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .grade-selection h1 {
        font-size: 2rem;
    }

    .grade-buttons {
        grid-template-columns: 1fr;
        width: 90%;
    }

    .grade-btn {
        padding: 1.2rem;
        font-size: 1.1rem;
    }

    #question-content {
        font-size: 1.5rem;
    }

    .options-container {
        width: 90%;
    }

    .option-btn {
        padding: 1rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .grade-selection h1 {
        font-size: 1.8rem;
    }

    #question-content {
        font-size: 1.3rem;
    }

    .question-container {
        padding: 1rem;
    }
}