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

:root {
    --primary: #4A90E2;
    --secondary: #FFD700;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --purple: #8B5CF6;
    --pink: #EC4899;
    --bg-light: #F0F7FF;
    --text-dark: #1E293B;
    --text-light: #64748B;
    --shadow: 0 4px 20px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.15);
    --radius: 16px;
    --radius-sm: 10px;
}

body {
    font-family: 'Comic Sans MS', 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-dark);
    overflow-x: hidden;
}

/* ===== 导航栏 ===== */
.navbar {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

.navbar .logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar .logo span {
    background: linear-gradient(135deg, var(--primary), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-stats {
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-light);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: bold;
    color: var(--text-dark);
}

.stat-badge .icon {
    font-size: 20px;
}

/* ===== 页面容器 ===== */
.page {
    display: none;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    animation: fadeIn 0.4s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== 首页 ===== */
.hero {
    text-align: center;
    padding: 30px 0;
    color: white;
}

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

.hero p {
    font-size: 18px;
    opacity: 0.9;
}

.mascot {
    font-size: 80px;
    animation: bounce 2s infinite;
    display: inline-block;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* ===== 分类卡片 ===== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.category-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--card-color, var(--primary));
}

.category-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.category-card:active {
    transform: scale(0.98);
}

.category-card .icon {
    font-size: 48px;
    margin-bottom: 10px;
    display: block;
}

.category-card .name {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.category-card .name-en {
    font-size: 13px;
    color: var(--text-light);
}

.category-card .progress-bar {
    margin-top: 12px;
    height: 6px;
    background: #E2E8F0;
    border-radius: 3px;
    overflow: hidden;
}

.category-card .progress-fill {
    height: 100%;
    background: var(--card-color, var(--primary));
    border-radius: 3px;
    transition: width 0.5s ease;
}

.category-card .progress-text {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

/* ===== 游戏选择页 ===== */
.game-header {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
}

.game-header .back-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--bg-light);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.game-header .back-btn:hover {
    background: var(--primary);
    color: white;
}

.game-header .info h2 {
    font-size: 22px;
    color: var(--text-dark);
}

.game-header .info p {
    font-size: 14px;
    color: var(--text-light);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.game-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

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

.game-card .game-icon {
    font-size: 50px;
    margin-bottom: 12px;
    display: block;
}

.game-card .game-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 6px;
}

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

/* ===== 游戏区域 ===== */
.game-area {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    min-height: 400px;
}

.game-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px dashed #E2E8F0;
}

.game-toolbar .score {
    font-size: 20px;
    font-weight: bold;
    color: var(--warning);
}

.game-toolbar .progress {
    font-size: 16px;
    color: var(--text-light);
}

/* ===== 看图选词游戏 ===== */
.word-display {
    text-align: center;
    padding: 30px 0;
}

.word-display .emoji {
    font-size: 100px;
    display: block;
    margin-bottom: 16px;
    animation: popIn 0.5s ease;
}

@keyframes popIn {
    0% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.word-display .hint {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.word-display .speak-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 28px;
    cursor: pointer;
    margin: 10px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(74,144,226,0.4);
}

.word-display .speak-btn:hover {
    transform: scale(1.1);
}

.word-display .speak-btn:active {
    transform: scale(0.95);
}

/* ===== 选项按钮 ===== */
.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 500px;
    margin: 0 auto;
}

.option-btn {
    padding: 16px 20px;
    border: 3px solid #E2E8F0;
    border-radius: var(--radius-sm);
    background: white;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.option-btn:hover {
    border-color: var(--primary);
    background: var(--bg-light);
    transform: scale(1.02);
}

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

.option-btn.correct {
    border-color: var(--success);
    background: #D1FAE5;
    color: var(--success);
    animation: correctPulse 0.5s ease;
}

.option-btn.wrong {
    border-color: var(--danger);
    background: #FEE2E2;
    color: var(--danger);
    animation: shake 0.5s ease;
}

.option-btn.disabled {
    pointer-events: none;
    opacity: 0.6;
}

@keyframes correctPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

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

/* ===== 听音选图游戏 ===== */
.listen-area {
    text-align: center;
    padding: 20px 0;
}

.listen-area .big-speak-btn {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: white;
    font-size: 50px;
    cursor: pointer;
    margin: 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 6px 25px rgba(74,144,226,0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 6px 25px rgba(74,144,226,0.4); }
    50% { box-shadow: 0 6px 35px rgba(74,144,226,0.6); }
}

.listen-area .big-speak-btn:hover {
    transform: scale(1.1);
}

.emoji-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 400px;
    margin: 20px auto;
}

.emoji-option {
    padding: 20px;
    border: 3px solid #E2E8F0;
    border-radius: var(--radius-sm);
    background: white;
    font-size: 50px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.emoji-option:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}

.emoji-option.correct {
    border-color: var(--success);
    background: #D1FAE5;
    animation: correctPulse 0.5s ease;
}

.emoji-option.wrong {
    border-color: var(--danger);
    background: #FEE2E2;
    animation: shake 0.5s ease;
}

/* ===== 拼写游戏 ===== */
.spell-area {
    text-align: center;
    padding: 20px 0;
}

.spell-area .target-emoji {
    font-size: 80px;
    display: block;
    margin-bottom: 10px;
}

.spell-area .target-zh {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 20px;
}

.letter-slots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.letter-slot {
    width: 44px;
    height: 52px;
    border: 3px dashed #CBD5E1;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    text-transform: lowercase;
    background: #F8FAFC;
    transition: all 0.2s;
}

.letter-slot.filled {
    border-style: solid;
    border-color: var(--primary);
    background: var(--bg-light);
    color: var(--primary);
}

.letter-slot.correct-slot {
    border-color: var(--success);
    background: #D1FAE5;
    color: var(--success);
}

.letter-slot.wrong-slot {
    border-color: var(--danger);
    background: #FEE2E2;
    color: var(--danger);
}

.letter-choices {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.letter-btn {
    width: 44px;
    height: 52px;
    border: 2px solid #CBD5E1;
    border-radius: 10px;
    background: white;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: lowercase;
    font-family: inherit;
}

.letter-btn:hover {
    border-color: var(--primary);
    background: var(--bg-light);
    transform: scale(1.1);
}

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

.letter-btn.used {
    opacity: 0.3;
    pointer-events: none;
}

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

.action-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.action-btn.undo {
    background: #F1F5F9;
    color: var(--text-dark);
}

.action-btn.check {
    background: var(--primary);
    color: white;
}

.action-btn:hover {
    transform: scale(1.05);
}

/* ===== 结果页面 ===== */
.result-area {
    text-align: center;
    padding: 40px 20px;
}

.result-area .trophy {
    font-size: 80px;
    display: block;
    margin-bottom: 16px;
    animation: bounce 1s infinite;
}

.result-area h2 {
    font-size: 28px;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.result-area .score-display {
    font-size: 48px;
    font-weight: bold;
    color: var(--warning);
    margin: 16px 0;
}

.result-area .stars {
    font-size: 40px;
    margin: 16px 0;
}

.result-area .message {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 24px;
}

.result-btns {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.result-btn {
    padding: 14px 32px;
    border: none;
    border-radius: 25px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.result-btn.primary {
    background: var(--primary);
    color: white;
}

.result-btn.secondary {
    background: #F1F5F9;
    color: var(--text-dark);
}

.result-btn:hover {
    transform: scale(1.05);
}

/* ===== 反馈动画 ===== */
.feedback-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.feedback-overlay.show {
    opacity: 1;
}

.feedback-overlay .feedback-text {
    font-size: 60px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: feedbackPop 0.8s ease;
}

.feedback-overlay .feedback-text.correct {
    color: var(--success);
}

.feedback-overlay .feedback-text.wrong {
    color: var(--danger);
}

@keyframes feedbackPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* ===== 粒子效果 ===== */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 999;
}

.particle {
    position: absolute;
    font-size: 30px;
    animation: particleFall 1.5s ease-out forwards;
}

@keyframes particleFall {
    0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ===== 节奏跟读游戏 ===== */
.read-along-area {
    text-align: center;
    padding: 20px 0;
}

.read-word-display {
    margin-bottom: 30px;
}

.read-word-display .read-emoji {
    font-size: 80px;
    display: block;
    margin-bottom: 10px;
}

.read-word-display .read-word-en {
    font-size: 36px;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 5px;
}

.read-word-display .read-word-zh {
    font-size: 18px;
    color: var(--text-light);
}

.read-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.read-listen-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 25px;
    background: var(--bg-light);
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.read-listen-btn:hover {
    background: var(--primary);
    color: white;
}

.read-mic-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 25px;
    background: linear-gradient(135deg, var(--danger), var(--pink));
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
    /* 禁止文本选择和长按菜单 */
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.read-mic-btn:hover {
    transform: scale(1.05);
}

.read-mic-btn.recording {
    animation: pulse 0.5s infinite alternate;
    background: var(--danger);
}

.read-mic-btn .mic-icon {
    font-size: 24px;
}

.read-result {
    font-size: 24px;
    font-weight: bold;
    min-height: 40px;
    margin-bottom: 10px;
}

.read-result.correct {
    color: var(--success);
}

.read-result.wrong {
    color: var(--danger);
}

.read-tip {
    font-size: 14px;
    color: var(--text-light);
}

/* ===== 气球爆破游戏 ===== */
.balloon-game {
    position: relative;
}

.balloon-instruction {
    text-align: center;
    margin-bottom: 16px;
}

.balloon-play-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    background: var(--primary);
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.balloon-play-btn:hover {
    transform: scale(1.05);
}

.balloon-field {
    position: relative;
    height: 350px;
    background: linear-gradient(180deg, #E0F7FA 0%, #B2EBF2 100%);
    border-radius: var(--radius);
    overflow: hidden;
}

.balloon {
    position: absolute;
    width: 70px;
    height: 90px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform 0.2s;
    animation: float 3s ease-in-out infinite;
}

.balloon::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 15px;
    background: #666;
}

.balloon:hover {
    transform: scale(1.1);
}

.balloon.popped {
    animation: pop 0.3s ease forwards;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pop {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.5; }
    100% { transform: scale(0); opacity: 0; }
}

.balloon-start {
    text-align: center;
    padding: 40px 0;
}

.start-balloon-btn {
    padding: 16px 40px;
    border: none;
    border-radius: 30px;
    background: linear-gradient(135deg, var(--pink), var(--danger));
    color: white;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.start-balloon-btn:hover {
    transform: scale(1.05);
}

/* ===== 中英配对游戏 ===== */
.match-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.match-list-en,
.match-list-zh {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.match-item {
    padding: 14px 20px;
    border: 3px solid #E2E8F0;
    border-radius: var(--radius-sm);
    background: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.match-item:hover {
    border-color: var(--primary);
    transform: scale(1.02);
}

.match-item.selected {
    border-color: var(--warning);
    background: #FEF3C7;
}

.match-item.matched {
    border-color: var(--success);
    background: #D1FAE5;
    pointer-events: none;
}

.match-item.wrong {
    animation: shake 0.5s ease;
}

/* ===== 工具栏补充样式 ===== */
.game-toolbar .timer {
    font-size: 20px;
    font-weight: bold;
    color: var(--danger);
}

.game-toolbar .moves {
    font-size: 16px;
    color: var(--text-light);
}


.read-mic-btn .mic-text {
    font-size: 16px;
}

/* ===== 记忆翻牌游戏 ===== */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    max-width: 400px;
    margin: 0 auto;
}

.memory-card {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    cursor: pointer;
    position: relative;
    perspective: 1000px;
}

.memory-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.memory-card.flipped .memory-card-inner {
    transform: rotateY(180deg);
}

.memory-card-front,
.memory-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
}

.memory-card-front {
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: white;
    font-size: 30px;
}

.memory-card-back {
    background: white;
    border: 3px solid var(--primary);
    transform: rotateY(180deg);
    padding: 8px;
    text-align: center;
}

.memory-card.matched .memory-card-inner {
    transform: rotateY(180deg);
}

.memory-card.matched .memory-card-back {
    border-color: var(--success);
    background: #D1FAE5;
}

/* ===== 响应式 ===== */
@media (max-width: 600px) {
    .hero h1 { font-size: 26px; }
    .mascot { font-size: 60px; }
    .categories-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .category-card { padding: 16px 12px; }
    .category-card .icon { font-size: 36px; }
    .games-grid { grid-template-columns: 1fr; }
    .word-display .emoji { font-size: 70px; }
    .options-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .option-btn { padding: 12px 16px; font-size: 17px; }
    .letter-slot, .letter-btn { width: 36px; height: 44px; font-size: 20px; }
    .game-area { padding: 16px; }
    .navbar { padding: 10px 16px; }
    .stat-badge { padding: 4px 10px; font-size: 14px; }
}

/* ===== 返回主页按钮 ===== */
.home-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: var(--primary);
    cursor: pointer;
    font-weight: bold;
    font-family: inherit;
}

.home-btn:hover {
    text-decoration: underline;
}

/* ===== 加载动画 ===== */
.loading {
    text-align: center;
    padding: 40px;
    color: white;
    font-size: 20px;
}

.loading .spinner {
    font-size: 40px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== 单词跑酷 v4.0 ===== */
.runner-v4-area {
    padding: 12px !important;
}

/* HUD */
.rv4-hud {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}
.rv4-hud-item {
    background: rgba(255,255,255,0.95);
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.rv4-combo-box {
    background: linear-gradient(135deg, #FF6B35, #FF2E63) !important;
    color: white;
    transition: opacity 0.3s;
}

/* 速度条 */
.rv4-speed {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: white;
    font-size: 12px;
    font-weight: bold;
}
.rv4-speed-bar {
    flex: 1;
    height: 8px;
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
    overflow: hidden;
}
.rv4-speed-fill {
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, #4ECDC4, #FFD700, #FF6B35);
    border-radius: 4px;
    transition: width 0.5s;
}

/* 游戏场景 */
.rv4-scene {
    position: relative;
    height: 220px;
    border-radius: var(--radius);
    overflow: hidden;
    background: linear-gradient(180deg, #87CEEB 0%, #B0E0E6 40%, #90EE90 70%, #228B22 100%);
}
#rv4Canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* 角色 */
.rv4-char {
    position: absolute;
    left: 60px;
    bottom: 48px;
    font-size: 48px;
    z-index: 10;
    transition: none;
}
.rv4-char.run {
    animation: rv4run 0.3s steps(2) infinite;
}
.rv4-char.jump {
    animation: rv4jump 0.55s ease-out forwards;
}
.rv4-char.crash {
    animation: rv4crash 0.6s ease forwards;
}
@keyframes rv4run {
    0% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
@keyframes rv4jump {
    0% { transform: translateY(0) rotate(0); }
    40% { transform: translateY(-90px) rotate(-8deg); }
    70% { transform: translateY(-80px) rotate(4deg); }
    100% { transform: translateY(0) rotate(0); }
}
@keyframes rv4crash {
    0% { transform: translateX(0) rotate(0); }
    30% { transform: translateX(15px) rotate(20deg); }
    60% { transform: translateX(-8px) rotate(-15deg); }
    100% { transform: translateX(0) rotate(0); }
}

/* 障碍物 */
.rv4-obstacle {
    position: absolute;
    right: -120px;
    bottom: 48px;
    font-size: 40px;
    z-index: 5;
    transition: right 0.6s ease-out;
}
.rv4-obstacle.show { right: 100px; }
.rv4-obstacle.boom {
    animation: rv4boom 0.4s ease forwards;
}
@keyframes rv4boom {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5) rotate(20deg); opacity: 0.5; }
    100% { transform: scale(0) rotate(45deg); opacity: 0; }
}

/* 飘字 */
.rv4-pops {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 20;
}
.rv4-pop {
    position: absolute;
    font-size: 22px;
    font-weight: 900;
    color: #FFD700;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
    animation: rv4pop 0.9s ease-out forwards;
}
@keyframes rv4pop {
    0% { transform: translateY(0) scale(0.5); opacity: 0; }
    30% { transform: translateY(-15px) scale(1.3); opacity: 1; }
    100% { transform: translateY(-50px) scale(1); opacity: 0; }
}

/* 连击火焰 */
.rv4-fire {
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 15;
}
.rv4-fire.on {
    opacity: 1;
    animation: rv4fire 0.4s ease infinite alternate;
}
@keyframes rv4fire {
    from { box-shadow: inset 0 0 20px rgba(255,107,53,0.5); }
    to { box-shadow: inset 0 0 40px rgba(255,46,99,0.7); }
}

/* 场景震动 */
.rv4-scene.shake {
    animation: rv4shake 0.35s ease;
}
@keyframes rv4shake {
    0%,100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* 答题区 */
.rv4-answer {
    background: white;
    border-radius: var(--radius);
    padding: 14px;
    margin-top: 12px;
    box-shadow: var(--shadow);
    animation: rv4slideUp 0.25s ease;
}
@keyframes rv4slideUp {
    from { transform: translateY(15px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.rv4-question {
    text-align: center;
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 10px;
}
.rv4-options {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
.rv4-options .option-btn {
    padding: 10px 22px;
    font-size: 18px;
    min-width: 70px;
}

/* 覆盖层 */
.rv4-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.75);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
    border-radius: var(--radius);
    color: white;
    text-align: center;
    padding: 20px;
}
.rv4-overlay-icon { font-size: 60px; margin-bottom: 8px; }
.rv4-overlay-title { font-size: 26px; font-weight: bold; margin-bottom: 6px; }
.rv4-overlay-desc { font-size: 15px; opacity: 0.9; margin-bottom: 16px; }
.rv4-end-stats { font-size: 17px; line-height: 2; margin: 12px 0; }
.rv4-end-stats b { color: #FFD700; }
.rv4-btn {
    padding: 14px 36px;
    border: none;
    border-radius: 30px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: white;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
    font-family: inherit;
}
.rv4-btn:hover { transform: scale(1.05); }

/* 响应式 */
@media (max-width: 600px) {
    .rv4-scene { height: 180px; }
    .rv4-char { font-size: 38px; left: 40px; }
    .rv4-obstacle.show { right: 70px; }
    .rv4-options .option-btn { padding: 8px 14px; font-size: 16px; }
}
