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

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
    overflow-x: hidden;
}

/* 背景装饰 */
.background-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: #fff;
    top: -150px;
    left: -150px;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    background: #fff;
    bottom: -100px;
    right: -100px;
    animation-delay: 5s;
}

.shape-3 {
    width: 150px;
    height: 150px;
    background: #fff;
    top: 50%;
    right: -75px;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(20px, 20px) rotate(5deg);
    }
    50% {
        transform: translate(0, 40px) rotate(0deg);
    }
    75% {
        transform: translate(-20px, 20px) rotate(-5deg);
    }
}

.container {
    width: 100%;
    max-width: 800px;
    padding: 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* 主内容样式 */
.main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 游戏卡片 */
.game-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

/* 问题容器 */
.question-container {
    margin-bottom: 30px;
}

.question-container h2 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 15px;
    color: #333;
}

.difficulty-badge {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    background: #e3f2fd;
    color: #1976d2;
}

/* 选项容器 */
.options-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.option {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.option:hover {
    border-color: #667eea;
    background: #f5f5f5;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.option.selected {
    border-color: #667eea;
    background: #667eea;
    color: white;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.option.correct {
    border-color: #4caf50;
    background: #4caf50;
    color: white;
    animation: pulse 1s ease-in-out;
}

.option.incorrect {
    border-color: #f44336;
    background: #f44336;
    color: white;
    animation: shake 0.5s ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* 反馈信息 */
.feedback {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 1.1rem;
    transform: translateY(-10px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feedback.show {
    transform: translateY(0);
    opacity: 1;
}

.feedback.correct {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    color: #2e7d32;
    border: 1px solid #4caf50;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

.feedback.incorrect {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    border: 1px solid #f44336;
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.2);
}

/* 操作按钮 */
.actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover:not(:disabled) {
    background: #e0e0e0;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

/* 按钮点击效果 */
.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

/* 解释部分 */
.explanation {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.explanation h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #333;
}

.explanation p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #666;
}

/* 底部样式 */
.footer {
    text-align: center;
    margin-top: 30px;
    color: white;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .game-card {
        padding: 20px;
    }
    
    .question-container h2 {
        font-size: 1.5rem;
    }
    
    .options-container {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .option {
        padding: 12px;
        font-size: 1.1rem;
    }
    
    .actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 200px;
        padding: 10px 20px;
    }
    
    .explanation {
        padding: 20px;
    }
    
    .explanation h3 {
        font-size: 1.2rem;
    }
    
    .explanation p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .header p {
        font-size: 0.9rem;
    }
    
    .game-card {
        padding: 15px;
    }
    
    .question-container h2 {
        font-size: 1.3rem;
    }
    
    .options-container {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .option {
        padding: 10px;
        font-size: 1rem;
    }
    
    .feedback {
        padding: 12px;
        font-size: 1rem;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .explanation {
        padding: 15px;
    }
    
    .explanation h3 {
        font-size: 1.1rem;
    }
    
    .explanation p {
        font-size: 0.9rem;
    }
    
    .footer {
        font-size: 0.8rem;
    }
}

/* 无障碍样式 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 键盘聚焦样式 */
.option:focus,
.btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .option {
        border: 2px solid #000;
    }
    
    .option.selected {
        border: 2px solid #fff;
    }
    
    .btn {
        border: 2px solid #000;
    }
}