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

body {
    font-family: 'Arial', sans-serif;
    background-color: #f0f8ff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.game-container {
    width: 800px;
    max-width: 100%;
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
    position: relative;
}

.game-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.game-header h1 {
    color: #4a6baf;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.back-to-lobby {
    position: absolute;
    top: 10px;
    right: 10px;
}

.back-to-lobby a {
    display: inline-block;
    padding: 8px 15px;
    background-color: #4a6baf;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    transition: background-color 0.3s;
}

.back-to-lobby a:hover {
    background-color: #3a5999;
}

.screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hidden {
    display: none;
}

/* 开始界面样式 */
.grade-selection {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 30px 0;
    width: 100%;
    max-width: 500px;
}

.grade-btn {
    padding: 15px;
    font-size: 1.2rem;
    background-color: #4a6baf;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.3s;
}

.grade-btn:hover {
    transform: translateY(-3px);
    background-color: #3a5999;
}

.game-rules {
    background-color: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
}

.game-rules h3 {
    color: #4a6baf;
    margin-bottom: 10px;
}

.game-rules ul {
    padding-left: 20px;
}

.game-rules li {
    margin-bottom: 8px;
    color: #555;
}

/* 游戏界面样式 */
.game-info {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 30px;
    font-size: 1.2rem;
    color: #555;
}

.question-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.question {
    font-size: 3rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

.answer-input {
    width: 200px;
    height: 60px;
    font-size: 2rem;
    text-align: center;
    border: 2px solid #4a6baf;
    border-radius: 8px;
    margin-bottom: 20px;
}

.submit-btn {
    padding: 12px 40px;
    font-size: 1.2rem;
    background-color: #4a6baf;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.submit-btn:hover {
    background-color: #3a5999;
}

/* 结果界面样式 */
.result-summary {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin: 20px 0;
    font-size: 1.5rem;
    color: #333;
}

.result-details, .wrong-questions {
    width: 100%;
    margin-bottom: 30px;
}

.result-details h3, .wrong-questions h3 {
    color: #4a6baf;
    margin-bottom: 15px;
    text-align: center;
}

.question-list {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.question-item {
    padding: 10px;
    margin-bottom: 5px;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
}

.question-item.correct {
    background-color: #e6f7e6;
    border-left: 4px solid #4caf50;
}

.question-item.wrong {
    background-color: #ffebee;
    border-left: 4px solid #f44336;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.play-again-btn, .change-grade-btn {
    padding: 12px 25px;
    font-size: 1.1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.play-again-btn {
    background-color: #4a6baf;
    color: white;
}

.play-again-btn:hover {
    background-color: #3a5999;
}

.change-grade-btn {
    background-color: #f5f5f5;
    color: #333;
}

.change-grade-btn:hover {
    background-color: #e0e0e0;
}

@media (max-width: 600px) {
    .grade-selection {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .question {
        font-size: 2.5rem;
    }
    
    .result-summary {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
}