/* ============ 全局容器 ============ */
.game-container {
    position: relative;
    width: 100%;
    height: 100vh;
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden;
}

/* ============ 背景装饰 ============ */
.bg-decorations {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 100px;
    box-shadow:
        25px 5px 0 -3px rgba(255, 255, 255, 0.7),
        -25px 5px 0 -3px rgba(255, 255, 255, 0.7),
        0 15px 0 -8px rgba(255, 255, 255, 0.7);
}
.cloud-1 { width: 50px; height: 20px; top: 12%; left: 10%; animation: floatCloud 18s linear infinite; }
.cloud-2 { width: 40px; height: 16px; top: 25%; right: 15%; animation: floatCloud 22s linear infinite reverse; }
.cloud-3 { width: 60px; height: 22px; top: 8%; right: 30%; animation: floatCloud 26s linear infinite; }

@keyframes floatCloud {
    0% { transform: translateX(-30px); }
    50% { transform: translateX(30px); }
    100% { transform: translateX(-30px); }
}

.star-decoration {
    position: absolute;
    font-size: 28px;
    animation: twinkle 2.5s ease-in-out infinite;
    opacity: 0.85;
}
.star-1 { top: 15%; right: 8%; animation-delay: 0s; }
.star-2 { top: 35%; left: 5%; animation-delay: 0.8s; font-size: 22px; }
.star-3 { top: 60%; right: 12%; animation-delay: 1.5s; font-size: 26px; }

@keyframes twinkle {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.6; }
    50% { transform: scale(1.2) rotate(20deg); opacity: 1; }
}

/* ============ 页面 ============ */
.page {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    z-index: 1;
    overflow-y: auto;
}
.page-active {
    display: flex;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* ============ 主菜单 ============ */
#page-menu {
    justify-content: center;
    gap: 24px;
}

/* 吉祥物 */
.mascot {
    width: 140px;
    height: 140px;
    position: relative;
    animation: mascotBounce 2.5s ease-in-out infinite;
}

@keyframes mascotBounce {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-12px) rotate(3deg); }
}

.mascot-body {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #FFD93D 0%, #FFB347 100%);
    border-radius: 50%;
    position: relative;
    box-shadow:
        inset -8px -8px 0 rgba(255, 165, 0, 0.3),
        0 8px 20px rgba(255, 165, 0, 0.4);
    border: 4px solid #fff;
}

.mascot-antenna {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 22px;
    background: #fff;
    border-radius: 2px;
}
.mascot-antenna::after {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    background: #FF6B6B;
    border-radius: 50%;
    border: 3px solid #fff;
    animation: pulseDot 1.5s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.2); }
}

.mascot-face {
    position: absolute;
    inset: 0;
}

.mascot-eye {
    position: absolute;
    top: 38%;
    width: 16px;
    height: 22px;
    background: #4a3c2a;
    border-radius: 50%;
}
.mascot-eye.left { left: 30%; }
.mascot-eye.right { right: 30%; }

.mascot-eye::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 3px;
    width: 5px;
    height: 5px;
    background: #fff;
    border-radius: 50%;
}

.mascot-mouth {
    position: absolute;
    bottom: 22%;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 14px;
    background: #FF6B6B;
    border-radius: 0 0 20px 20px;
    border: 2px solid #4a3c2a;
}

.mascot-blush {
    position: absolute;
    top: 50%;
    width: 18px;
    height: 12px;
    background: rgba(255, 107, 107, 0.5);
    border-radius: 50%;
}
.mascot-blush.left { left: 14%; }
.mascot-blush.right { right: 14%; }

/* 标题 */
.game-title {
    font-size: clamp(32px, 6vw, 52px);
    color: #fff;
    text-shadow:
        3px 3px 0 #FF6B6B,
        -1px -1px 0 #FF6B6B,
        1px -1px 0 #FF6B6B,
        -1px 1px 0 #FF6B6B,
        0 6px 0 rgba(0, 0, 0, 0.15);
    font-weight: 900;
    text-align: center;
    line-height: 1.3;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin-top: 8px;
}

.title-char {
    display: inline-block;
    animation: titlePop 0.5s ease backwards;
}
.title-1 { animation-delay: 0.1s; }
.title-2 { animation-delay: 0.15s; }
.title-3 { animation-delay: 0.2s; }
.title-4 { animation-delay: 0.25s; }
.title-5 { animation-delay: 0.3s; }
.title-6 { animation-delay: 0.35s; }
.title-7 { animation-delay: 0.4s; }
.title-8 { animation-delay: 0.45s; }

@keyframes titlePop {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.game-subtitle {
    font-size: clamp(16px, 3vw, 20px);
    color: #6B4423;
    background: rgba(255, 255, 255, 0.6);
    padding: 8px 20px;
    border-radius: 20px;
    margin-top: 4px;
    font-weight: 600;
}

/* ============ 通用按钮 ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 16px;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    min-height: 60px;
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.4);
}

.btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.1);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(50%);
}

.btn-primary {
    background: linear-gradient(180deg, #FF6B6B 0%, #EE5A52 100%);
}

.btn-secondary {
    background: linear-gradient(180deg, #6BCBEF 0%, #4FB3D9 100%);
}

.btn-large {
    font-size: 24px;
    padding: 18px 48px;
    min-height: 72px;
}

.btn-icon {
    font-size: 1.2em;
}

.btn-back {
    background: rgba(255, 255, 255, 0.8);
    color: #6B4423;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 20px;
    font-weight: 700;
    border: 2px solid #fff;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.1);
    transition: transform 0.15s ease;
}
.btn-back:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1);
}

/* ============ 游戏选择页 ============ */
.games-grid {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 0 0 24px;
}

.game-card {
    background: linear-gradient(135deg, #fff 0%, #FFF8E7 100%);
    border-radius: 24px;
    padding: 20px;
    border: 4px solid #fff;
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.1), 0 4px 16px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 120px;
    height: 120px;
    background: var(--game-color, #FFD93D);
    border-radius: 50%;
    opacity: 0.3;
}

.game-card:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1);
}

.game-card-icon {
    font-size: 64px;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.15));
    z-index: 1;
}

.game-card-content {
    flex: 1;
    z-index: 1;
}

.game-card-title {
    font-size: 24px;
    font-weight: 900;
    color: #6B4423;
    margin-bottom: 4px;
}

.game-card-desc {
    font-size: 16px;
    color: #8B6F47;
    margin-bottom: 8px;
    line-height: 1.4;
}

.game-card-stats {
    display: flex;
    gap: 12px;
    font-size: 15px;
    color: #6B4423;
    font-weight: 700;
}

.game-card-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.7);
    padding: 4px 10px;
    border-radius: 10px;
    border: 2px solid #fff;
}

.game-card-arrow {
    font-size: 32px;
    color: #6B4423;
    z-index: 1;
}

/* ============ 关卡选择页 ============ */
.page-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 8px 0;
}

.page-title {
    font-size: clamp(24px, 5vw, 32px);
    color: #6B4423;
    font-weight: 900;
    text-shadow: 2px 2px 0 #fff;
}

.stage-section {
    width: 100%;
    margin-bottom: 16px;
}

.stage-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 900;
    color: #6B4423;
    margin-bottom: 12px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    border: 2px solid #fff;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.08);
}

.stage-title .stage-icon {
    font-size: 24px;
}

.levels-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    padding-bottom: 8px;
}

.level-card {
    background: linear-gradient(135deg, #fff 0%, #FFF8E7 100%);
    border-radius: 20px;
    padding: 20px;
    border: 4px solid #fff;
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.1), 0 4px 16px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.level-card::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    background: var(--level-color, #FFD93D);
    border-radius: 50%;
    opacity: 0.3;
}

.level-card:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1);
}

.level-card.locked {
    filter: grayscale(0.7);
    opacity: 0.7;
    cursor: not-allowed;
}

.level-card.completed::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 14px;
    width: 32px;
    height: 32px;
    background: #4CAF50;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    font-size: 18px;
}

.level-emoji {
    font-size: 48px;
    text-align: center;
    margin-bottom: 8px;
    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.15));
}

.level-name {
    font-size: 20px;
    font-weight: 900;
    color: #6B4423;
    text-align: center;
    margin-bottom: 4px;
}

.level-desc {
    font-size: 14px;
    color: #8B6F47;
    text-align: center;
    margin-bottom: 12px;
}

.level-stars {
    display: flex;
    justify-content: center;
    gap: 4px;
    font-size: 18px;
}
.level-star {
    color: #ddd;
    transition: color 0.3s;
}
.level-star.earned {
    color: #FFD93D;
    filter: drop-shadow(0 1px 2px rgba(255, 165, 0, 0.4));
}

.level-lock {
    position: absolute;
    top: 8px;
    left: 10px;
    font-size: 28px;
    color: #999;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}

/* ============ 答题页面 ============ */
#page-game {
    padding: 16px;
    justify-content: flex-start;
}

.game-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.progress-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.progress-label {
    font-size: 16px;
    color: #6B4423;
    font-weight: 700;
}

.progress-bar {
    height: 14px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 7px;
    overflow: hidden;
    border: 2px solid #fff;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6BCBEF 0%, #4FB3D9 100%);
    border-radius: 7px;
    transition: width 0.4s ease;
    width: 0%;
}

.score-info {
    background: #fff;
    padding: 8px 14px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 18px;
    font-weight: 900;
    color: #FF6B6B;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.1);
    border: 2px solid #fff;
    min-width: 60px;
    justify-content: center;
}

.score-icon {
    font-size: 22px;
    filter: drop-shadow(0 1px 2px rgba(255, 165, 0, 0.3));
}

.question-area {
    width: 100%;
    background: linear-gradient(180deg, #fff 0%, #FFF8E7 100%);
    border-radius: 24px;
    padding: 24px;
    text-align: center;
    margin-bottom: 20px;
    border: 4px solid #fff;
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.question-emoji {
    font-size: 64px;
    margin-bottom: 8px;
    animation: floatEmoji 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.15));
}

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

.question-prompt {
    font-size: clamp(22px, 4.5vw, 32px);
    font-weight: 900;
    color: #6B4423;
    line-height: 1.4;
    margin-bottom: 8px;
}

.question-hint {
    font-size: 16px;
    color: #8B6F47;
    font-style: italic;
    min-height: 22px;
}

/* 听音题：喇叭按钮 */
.audio-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(180deg, #FFD93D 0%, #FFB347 100%);
    color: #fff;
    padding: 12px 28px;
    border-radius: 24px;
    font-size: 18px;
    font-weight: 900;
    margin: 12px auto;
    border: 3px solid #fff;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: transform 0.15s ease;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
    animation: pulseSpeaker 2s ease-in-out infinite;
}

.audio-button:active {
    transform: translateY(2px) scale(0.98);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
}

.audio-button.playing {
    animation: playingWiggle 0.4s ease;
}

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

@keyframes playingWiggle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-3deg); }
    75% { transform: scale(1.1) rotate(3deg); }
}

.audio-icon {
    font-size: 24px;
}

.question-pinyin-fallback {
    font-size: 28px;
    color: #FF6B6B;
    font-weight: 900;
    margin-top: 8px;
    letter-spacing: 4px;
}

.options-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    flex: 1;
    align-content: start;
}

.option-btn {
    background: linear-gradient(180deg, #fff 0%, #FFF8E7 100%);
    border: 4px solid #fff;
    border-radius: 20px;
    padding: 20px 12px;
    font-size: clamp(28px, 6vw, 40px);
    font-weight: 900;
    color: #4a3c2a;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.08);
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.option-btn:active {
    transform: translateY(3px);
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.1);
}

.option-btn.correct {
    background: linear-gradient(180deg, #6BCB77 0%, #4FB360 100%);
    color: #fff;
    border-color: #fff;
    animation: correctPop 0.5s ease;
}

.option-btn.wrong {
    background: linear-gradient(180deg, #FF8A8A 0%, #EE5A52 100%);
    color: #fff;
    border-color: #fff;
    animation: shake 0.4s ease;
}

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

@keyframes correctPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

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

/* ============ 结算页面 ============ */
#page-result {
    justify-content: center;
}

.result-content {
    background: linear-gradient(180deg, #fff 0%, #FFF8E7 100%);
    border-radius: 28px;
    padding: 32px 24px;
    border: 4px solid #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    text-align: center;
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.result-emoji {
    font-size: 96px;
    animation: resultBounce 1s ease;
    filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.2));
}

@keyframes resultBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.result-title {
    font-size: 36px;
    color: #FF6B6B;
    font-weight: 900;
    text-shadow: 2px 2px 0 #fff, 3px 3px 0 rgba(255, 107, 107, 0.3);
}

.result-stars {
    display: flex;
    gap: 8px;
    font-size: 56px;
}
.result-star {
    color: #ddd;
    transition: color 0.5s ease;
}
.result-star.earned {
    color: #FFD93D;
    filter: drop-shadow(0 3px 4px rgba(255, 165, 0, 0.4));
    animation: starPop 0.4s ease backwards;
}
.result-star.earned:nth-child(1) { animation-delay: 0.3s; }
.result-star.earned:nth-child(2) { animation-delay: 0.5s; }
.result-star.earned:nth-child(3) { animation-delay: 0.7s; }

@keyframes starPop {
    0% { transform: scale(0) rotate(-180deg); }
    100% { transform: scale(1) rotate(0); }
}

.result-stats {
    font-size: 20px;
    color: #6B4423;
    font-weight: 700;
}

.result-badge {
    background: linear-gradient(135deg, #FFD93D 0%, #FFB347 100%);
    color: #fff;
    padding: 12px 24px;
    border-radius: 20px;
    font-size: 22px;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(255, 165, 0, 0.4);
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
    animation: badgeShine 2s ease-in-out infinite;
}

@keyframes badgeShine {
    0%, 100% { box-shadow: 0 4px 12px rgba(255, 165, 0, 0.4); }
    50% { box-shadow: 0 4px 20px rgba(255, 165, 0, 0.7); }
}

.badge-icon {
    font-size: 28px;
}

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

.result-actions .btn {
    padding: 14px 28px;
    font-size: 18px;
    min-height: 56px;
}

/* ============ 帮助页面 ============ */
.help-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 8px;
}

.help-item {
    background: linear-gradient(135deg, #fff 0%, #FFF8E7 100%);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 3px solid #fff;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.08);
}

.help-num {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #FF6B6B 0%, #EE5A52 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 900;
    flex-shrink: 0;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.15);
    border: 3px solid #fff;
}

.help-item p {
    font-size: 18px;
    color: #4a3c2a;
    font-weight: 600;
    line-height: 1.4;
}

/* ============ Toast 提示 ============ */
.toast {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    z-index: 1000;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}
.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ============ 庆祝粒子 ============ */
.confetti-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 14px;
    top: -20px;
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) rotate(720deg);
        opacity: 0.5;
    }
}

/* ============ 模态确认框 ============ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
    padding: 24px;
}
.modal-box {
    background: linear-gradient(180deg, #fff 0%, #FFF8E7 100%);
    border-radius: 24px;
    padding: 32px 28px 24px;
    border: 4px solid #fff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    max-width: 380px;
    width: 100%;
    text-align: center;
    animation: modalPop 0.3s ease;
}
@keyframes modalPop {
    0% { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
.modal-message {
    font-size: 22px;
    font-weight: bold;
    color: #6B4423;
    margin-bottom: 24px;
    line-height: 1.5;
}
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.modal-actions .btn {
    min-width: 120px;
    padding: 14px 24px;
    font-size: 18px;
    border-radius: 16px;
    cursor: pointer;
    border: 3px solid #fff;
    font-weight: bold;
    font-family: inherit;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.1);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.modal-actions .btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1);
}
.modal-actions .modal-cancel {
    background: #F5F5F5;
    color: #888;
}
.modal-actions .modal-ok {
    background: linear-gradient(180deg, #FF6B6B, #EE5A52);
    color: #fff;
}

/* ============ 响应式 ============ */
@media (max-width: 480px) {
    .levels-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .level-card {
        padding: 14px 10px;
    }
    .level-emoji {
        font-size: 36px;
    }
    .level-name {
        font-size: 16px;
    }
    .level-desc {
        font-size: 12px;
    }
    .options-grid {
        gap: 10px;
    }
    .option-btn {
        min-height: 80px;
        padding: 14px 8px;
    }
    .game-header {
        flex-wrap: wrap;
        gap: 8px;
    }
    .progress-info {
        order: 2;
        width: 100%;
    }
    .score-info {
        order: 3;
        margin-left: auto;
    }
}

@media (max-height: 700px) {
    .mascot { width: 100px; height: 100px; }
    .game-title { font-size: 30px; }
    .btn-large { font-size: 20px; padding: 14px 36px; min-height: 60px; }
}

/* ============ 当前用户条 ============ */
.current-user-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #FFF7E0, #FFEBC4);
    border: 3px solid #FFD93D;
    border-radius: 24px;
    padding: 10px 14px 10px 18px;
    box-shadow: 0 4px 0 rgba(255, 193, 7, 0.25);
    max-width: 360px;
    width: 100%;
    justify-content: flex-start;
    animation: slideDown 0.4s ease;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.current-user-avatar {
    font-size: 36px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}
.current-user-text {
    font-size: 18px;
    font-weight: bold;
    color: #5A4400;
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.btn-switch-user {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #FF6B6B;
    color: white;
    border: none;
    border-radius: 18px;
    padding: 8px 16px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 3px 0 rgba(0,0,0,0.12);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    font-family: inherit;
}
.btn-switch-user:hover { background: #FF5252; }
.btn-switch-user:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,0.12); }
.btn-switch-user .btn-icon { font-size: 18px; }

/* ============ 用户列表 ============ */
#page-user-list {
    justify-content: flex-start;
    gap: 16px;
}
.user-count {
    margin-left: auto;
    font-size: 14px;
    color: #888;
    padding: 4px 10px;
    background: #f5f5f5;
    border-radius: 12px;
}
.users-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 500px;
    width: 100%;
    padding: 8px 0;
}
.user-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: white;
    border: 3px solid #E0E0E0;
    border-radius: 20px;
    box-shadow: 0 4px 0 rgba(0,0,0,0.06);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    text-align: left;
    font-family: inherit;
    width: 100%;
}
.user-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 rgba(0,0,0,0.08);
    border-color: #FFD93D;
}
.user-card:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0,0,0,0.08);
}
.user-card.current {
    border-color: #6BCBEF;
    background: linear-gradient(135deg, #E5F6FD, #FFFFFF);
}
.user-card-avatar {
    font-size: 48px;
    line-height: 1;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}
.user-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.user-card-name {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-card-meta {
    font-size: 14px;
    color: #888;
}
.user-card-progress {
    font-size: 14px;
    color: #FF9500;
    font-weight: bold;
}
.user-card-check {
    color: #6BCBEF;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0;
    background: white;
    padding: 4px 10px;
    border-radius: 12px;
    border: 2px solid #6BCBEF;
}
.users-list-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 18px;
}

/* ============ 注册表单 ============ */
#page-register {
    justify-content: flex-start;
    padding-top: 32px;
}
.register-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 480px;
    width: 100%;
    padding: 8px 0 24px;
}
.form-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.form-label {
    font-size: 20px;
    font-weight: bold;
    color: #444;
    text-align: left;
}
.register-form input[type="text"] {
    height: 64px;
    font-size: 22px;
    padding: 0 20px;
    border: 3px solid #FFD93D;
    border-radius: 16px;
    background: white;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
    color: #333;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    width: 100%;
    box-sizing: border-box;
}
.register-form input[type="text"]:focus {
    outline: none;
    border-color: #FF6B6B;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.2);
}
.register-form input[type="text"]::placeholder {
    color: #BBB;
}
.radio-group {
    display: flex;
    gap: 10px;
    width: 100%;
}
.radio-btn {
    flex: 1;
    min-height: 60px;
    font-size: 18px;
    font-weight: bold;
    color: #555;
    background: #F5F5F5;
    border: 3px solid transparent;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    box-shadow: 0 3px 0 rgba(0,0,0,0.06);
}
.radio-btn:hover {
    background: #FFFAE5;
    border-color: #FFE082;
}
.radio-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}
.radio-btn.selected {
    border-color: #FF6B6B;
    background: linear-gradient(135deg, #FFE5E5, #FFF0F0);
    color: #C62828;
    box-shadow: 0 3px 0 rgba(255, 107, 107, 0.3);
    transform: translateY(-1px);
}
.form-error {
    min-height: 28px;
    color: #FF6B6B;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    padding: 8px;
    border-radius: 12px;
    background: rgba(255, 107, 107, 0.1);
    transition: opacity 0.2s ease;
}
.form-error:empty {
    background: transparent;
    padding: 0;
}

@media (max-width: 480px) {
    .user-card-avatar { font-size: 40px; }
    .user-card-name { font-size: 18px; }
    .form-label { font-size: 18px; }
    .register-form input[type="text"] { font-size: 20px; height: 56px; }
    .radio-btn { font-size: 16px; min-height: 56px; }
    .current-user-text { font-size: 16px; }
}