* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', '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;
}

header h1 {
    color: white;
    font-size: 2.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 10px;
}

.button-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.game-mode-btn {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.game-mode-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.game-mode-btn.active {
    background: linear-gradient(45deg, #FF6B6B, #FF8E8E);
    transform: translateY(-2px);
}

.settings-panel {
    background: rgba(255,255,255,0.95);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.mode-settings {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: center;
}

.mode-settings label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.category-filter, .sequential-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sequential-controls {
    display: none;
}

.sequential-controls.active {
    display: flex;
}

select, input[type="number"] {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

#jumpBtn {
    background: #2196F3;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

#jumpBtn:hover {
    background: #1976D2;
}

.game-area {
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.question-section {
    margin-bottom: 30px;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.question-counter {
    font-weight: bold;
    color: #666;
}

.game-mode-display {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
}

.question-content {
    text-align: center;
}

.question-text {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.question-type {
    font-size: 1rem;
    color: #666;
    font-style: italic;
}

.answer-section {
    margin-bottom: 30px;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    max-width: 1000px;
    margin: 0 auto;
}

/* 当选项超过4个时，使用4列布局 */
.options-grid.many-options {
    grid-template-columns: repeat(4, 1fr);
    max-width: 1200px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .options-grid.many-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

.option-btn {
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
    border: 2px solid #dee2e6;
    border-radius: 15px;
    padding: 20px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.option-btn:hover {
    background: linear-gradient(45deg, #e3f2fd, #bbdefb);
    border-color: #2196F3;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(33,150,243,0.3);
}

.option-btn.correct {
    background: linear-gradient(45deg, #c8e6c9, #4caf50);
    border-color: #4caf50;
    color: white;
    font-weight: bold;
}

.option-btn.incorrect {
    background: linear-gradient(45deg, #ffcdd2, #f44336);
    border-color: #f44336;
    color: white;
    font-weight: bold;
}

.option-btn.disabled {
    pointer-events: none;
    opacity: 0.7;
}

.feedback-section {
    text-align: center;
    margin-bottom: 20px;
}

.feedback {
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
}

.feedback.correct {
    background: linear-gradient(45deg, #c8e6c9, #81c784);
    color: white;
}

.feedback.incorrect {
    background: linear-gradient(45deg, #ffcdd2, #e57373);
    color: white;
}

.explanation {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    margin-top: 10px;
    color: #495057;
}

.next-btn {
    background: linear-gradient(45deg, #FF6B6B, #FF8E8E);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
}

.next-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,107,107,0.4);
}

footer {
    background: rgba(255,255,255,0.95);
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-weight: bold;
    color: #666;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .button-nav {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .game-mode-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .question-text {
        font-size: 1.4rem;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .mode-settings {
        flex-direction: column;
        gap: 15px;
    }
    
    .stats {
        flex-direction: column;
        gap: 10px;
    }
}

/* 单选按钮样式 */
input[type="radio"] {
    margin-right: 5px;
    transform: scale(1.2);
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.question-content, .options-grid {
    animation: fadeIn 0.5s ease;
}

/* 加载动画 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
