/* ============================================================
   bonus.css - 扩展模块样式（百科/故事/急转弯/游戏）
   复用 chinese.css 中的 .quiz-block / .quiz-option / .reading-sentence
   ============================================================ */

/* ===== 通用头部 ===== */
.bonus-header {
    text-align: center;
    margin-bottom: 20px;
}

.bonus-header h2 {
    font-size: 36px;
    color: var(--grass-dark);
    text-shadow: 0 2px 0 rgba(255, 217, 61, 0.4);
}

.bonus-header p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ===== 百科分类 Tab ===== */
.bonus-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.6);
    padding: 6px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.bonus-tab {
    flex: 1;
    padding: 12px 8px;
    border-radius: var(--radius-md);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    transition: all 0.2s;
}

.bonus-tab:hover {
    background: rgba(255, 255, 255, 0.5);
    color: var(--grass-dark);
}

.bonus-tab.active {
    background: linear-gradient(135deg, var(--grass) 0%, var(--grass-dark) 100%);
    color: white;
    box-shadow: var(--shadow-medium);
}

/* ===== 百科知识卡 ===== */
.baike-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.baike-card {
    background: linear-gradient(135deg, #FFFFFF 0%, #E8F5E9 100%);
    border: 3px solid var(--grass);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    transition: all 0.2s;
}

.baike-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

.baike-card-emoji {
    font-size: 56px;
    line-height: 1;
    margin-bottom: 8px;
}

.baike-card-title {
    font-size: 22px;
    font-family: 'ZCOOL KuaiLe', serif;
    color: var(--grass-dark);
    margin-bottom: 6px;
}

.baike-card-fact {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 12px;
    min-height: 48px;
}

.action-btn.small {
    padding: 6px 12px;
    font-size: 14px;
}

/* 百科问答区 */
.bonus-quiz-section {
    background: rgba(52, 152, 219, 0.08);
    border: 3px solid var(--math-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
}

.bonus-quiz-section h3 {
    font-size: 22px;
    color: var(--math-color);
    margin-bottom: 14px;
}

.quiz-result {
    text-align: center;
    padding: 20px;
}

.quiz-result p {
    font-size: 18px;
    margin: 8px 0;
}

/* ===== 故事模块 ===== */
.story-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.story-list-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: linear-gradient(135deg, #FFFFFF 0%, #FFF8E7 100%);
    border: 3px solid var(--chinese-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    transition: all 0.2s;
    text-align: left;
}

.story-list-card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-medium);
}

.story-list-card.done {
    background: linear-gradient(135deg, #E8F5E9 0%, #FFF8E7 100%);
    border-color: var(--grass-deep);
}

.story-list-emoji {
    font-size: 44px;
    line-height: 1;
    flex-shrink: 0;
    width: 60px;
    text-align: center;
}

.story-list-info {
    flex: 1;
    min-width: 0;
}

.story-list-title {
    font-size: 22px;
    font-family: 'ZCOOL KuaiLe', serif;
    color: var(--chinese-color);
}

.story-list-meta {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.story-list-arrow {
    font-size: 28px;
    color: var(--chinese-color);
    font-weight: 700;
}

.story-detail {
    animation: pageFadeIn 0.3s ease;
}

.story-cover-card {
    background: linear-gradient(135deg, #FFF8E7 0%, #FFE9B0 100%);
    border: 4px solid var(--chinese-color);
    border-radius: var(--radius-xl);
    padding: 24px 16px;
    text-align: center;
    box-shadow: var(--shadow-medium);
    margin-bottom: 20px;
}

.story-cover-emoji {
    font-size: 80px;
    line-height: 1;
    animation: numberPop 0.4s ease;
}

.story-title {
    font-size: 32px;
    font-family: 'ZCOOL KuaiLe', serif;
    color: var(--chinese-color);
    margin-top: 8px;
}

.story-content {
    background: rgba(255, 255, 255, 0.85);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-soft);
    font-size: 24px;
    line-height: 2.2;
    font-family: 'ZCOOL KuaiLe', serif;
    color: var(--text-primary);
    text-align: center;
}

.story-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* ===== 脑筋急转弯 ===== */
.puzzle-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.puzzle-stat-card {
    background: linear-gradient(135deg, #FFFFFF 0%, #FFF8E7 100%);
    border: 3px solid var(--chinese-color);
    border-radius: var(--radius-lg);
    padding: 14px 8px;
    text-align: center;
    box-shadow: var(--shadow-soft);
}

.puzzle-stat-card .stat-num {
    font-size: 32px;
    color: var(--chinese-color);
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    line-height: 1;
}

.puzzle-stat-card .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.puzzle-card {
    background: linear-gradient(135deg, #FFF8E7 0%, #FFE9B0 100%);
    border: 4px solid var(--chinese-color);
    border-radius: var(--radius-xl);
    padding: 24px 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-medium);
    min-height: 200px;
}

.puzzle-question {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'ZCOOL KuaiLe', serif;
    margin-bottom: 16px;
    line-height: 1.5;
}

.puzzle-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.puzzle-feedback {
    padding: 12px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-md);
    font-size: 16px;
    line-height: 1.6;
    margin-top: 8px;
}

.puzzle-controls {
    text-align: center;
}

/* ===== 游戏中心 ===== */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.game-card {
    background: linear-gradient(135deg, #FFFFFF 0%, #F0F8FF 100%);
    border: 3px solid var(--math-color);
    border-radius: var(--radius-lg);
    padding: 20px 12px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    transition: all 0.2s;
}

.game-card:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: var(--shadow-medium);
}

.game-emoji {
    font-size: 56px;
    line-height: 1;
    margin-bottom: 8px;
}

.game-name {
    font-size: 22px;
    font-family: 'ZCOOL KuaiLe', serif;
    color: var(--math-color);
    margin-bottom: 4px;
}

.game-desc {
    font-size: 14px;
    color: var(--text-secondary);
}

.game-area {
    animation: pageFadeIn 0.3s ease;
    background: rgba(255, 255, 255, 0.85);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-soft);
}

.game-area h3 {
    font-size: 28px;
    color: var(--math-color);
    text-align: center;
    margin-bottom: 16px;
    font-family: 'ZCOOL KuaiLe', serif;
}

.game-tip {
    text-align: center;
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

/* 猜数字游戏 */
.guess-game {
    max-width: 500px;
    margin: 0 auto;
}

.guess-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    justify-content: center;
}

#guessInput {
    flex: 1;
    max-width: 200px;
    padding: 14px 16px;
    font-size: 22px;
    border: 3px solid var(--math-color);
    border-radius: var(--radius-md);
    text-align: center;
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
}

#guessInput:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.2);
}

.guess-history {
    display: flex;
    flex-direction: column-reverse;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.guess-history-item {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 16px;
    text-align: center;
    animation: pageFadeIn 0.2s ease;
}

.guess-history-item.correct {
    background: #D4EDDA;
    color: #155724;
    font-weight: 700;
}

.guess-history-item.wrong {
    background: #F8D7DA;
    color: #721C24;
}

.guess-history-item.small {
    background: #FFF3CD;
    color: #856404;
}

.guess-history-item.big {
    background: #FFE5E5;
    color: #C0392B;
}

.guess-hint {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--math-color);
    min-height: 28px;
}

/* 记忆翻牌游戏 */
.memory-game {
    max-width: 500px;
    margin: 0 auto;
}

.memory-stats {
    text-align: center;
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.memory-stats strong {
    color: var(--math-color);
    font-size: 22px;
}

.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.memory-card {
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    border: 3px solid var(--math-color);
    background: linear-gradient(135deg, #3498DB 0%, #2980B9 100%);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
}

.memory-card:hover:not(.flipped):not(.matched) {
    transform: scale(1.05);
    box-shadow: var(--shadow-medium);
}

.memory-card.flipped {
    background: linear-gradient(135deg, #FFFFFF 0%, #F0F8FF 100%);
    color: var(--text-primary);
    transform: rotateY(180deg);
}

.memory-card.matched {
    border-color: var(--grass-deep);
}

.memory-back,
.memory-front {
    font-size: 40px;
}

/* 反应训练 */
.reaction-game {
    max-width: 500px;
    margin: 0 auto;
}

.reaction-stats {
    text-align: center;
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.reaction-stats strong {
    color: var(--math-color);
    font-size: 22px;
}

.reaction-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 16px auto;
    max-width: 360px;
}

.reaction-cell {
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    background: #E0E0E0;
    cursor: pointer;
    transition: all 0.1s;
}

.reaction-cell.active {
    background: linear-gradient(135deg, #FFD93D 0%, #FF8C42 100%);
    box-shadow: 0 0 20px rgba(255, 217, 61, 0.8);
    transform: scale(1.05);
}

.reaction-cell.hit {
    background: linear-gradient(135deg, #28A745 0%, #20C997 100%);
}

.reaction-cell:hover:not(.active) {
    background: #D0D0D0;
}

/* ===== 响应式 ===== */
@media (max-width: 480px) {
    .bonus-header h2 {
        font-size: 30px;
    }
    .bonus-tab {
        font-size: 15px;
        padding: 10px 4px;
    }
    .baike-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    .baike-card-emoji {
        font-size: 44px;
    }
    .baike-card-title {
        font-size: 18px;
    }
    .baike-card-fact {
        font-size: 13px;
        min-height: 60px;
    }
    .story-content {
        font-size: 20px;
    }
    .story-cover-emoji {
        font-size: 64px;
    }
    .story-title {
        font-size: 26px;
    }
    .puzzle-options {
        grid-template-columns: 1fr;
    }
    .puzzle-question {
        font-size: 19px;
    }
    .game-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .game-emoji {
        font-size: 44px;
    }
    .game-name {
        font-size: 18px;
    }
    .memory-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .memory-card,
    .memory-back,
    .memory-front {
        font-size: 32px;
    }
}
