/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: all 0.3s ease;
}

/* 安卓 Chrome 触控优化 */
html, body {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

button, .control-btn, .small-btn, .choice-btn, .chip {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

#app {
    position: relative;
    min-height: 100vh;
}

/* 屏幕切换 */
.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
}

.screen.active {
    display: block;
}

/* 主菜单样式 */
#main-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: radial-gradient(circle, #ffeaa7, #fab1a0);
}

.title h1 {
    font-size: 3rem;
    color: #e17055;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
    margin-bottom: 30px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* 精灵角色 */
.fairy {
    position: relative;
    margin: 20px 0;
    animation: float 3s ease-in-out infinite;
}

.fairy-body {
    font-size: 4rem;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.8));
}

.fairy-speech {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 10px 15px;
    border-radius: 20px;
    border: 3px solid #fd79a8;
    font-size: 1rem;
    color: #2d3436;
    white-space: nowrap;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.fairy-speech::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 10px solid transparent;
    border-top-color: white;
}

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

/* 菜单按钮 */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 30px 0;
}

.menu-btn {
    padding: 15px 30px;
    font-size: 1.5rem;
    border: none;
    border-radius: 25px;
    background: linear-gradient(45deg, #fd79a8, #fdcb6e);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
    font-family: inherit;
    min-width: 250px;
}

.menu-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    background: linear-gradient(45deg, #e84393, #f39c12);
}

.menu-btn:active {
    transform: translateY(0);
}

/* 按钮样式 */
.btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    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 var(--shadow-color);
}

.btn:hover {
    background: linear-gradient(135deg, var(--button-hover), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-color);
}

.btn:active {
    transform: translateY(0);
}

/* 进度信息 */
.progress-info {
    background: rgba(255,255,255,0.9);
    padding: 15px 25px;
    border-radius: 20px;
    border: 3px solid #fd79a8;
    font-size: 1.2rem;
    color: #2d3436;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* 游戏界面样式 */
#game {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #ff9ff3, #f368e0);
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(243, 104, 224, 0.3);
}

.back-btn, .settings-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:hover, .settings-btn:hover {
    background: white;
    transform: scale(1.05);
}

.level-display {
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* 游戏内容 */
.game-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px; /* 更紧凑 */
}

/* 汉字显示区域 */
.character-display {
    text-align: center;
    margin: 12px 0; /* 更紧凑 */
    padding: 40px;
    background: linear-gradient(135deg, var(--card-background), rgba(255, 255, 255, 0.8));
    border-radius: 20px;
    border: 3px solid var(--border-color);
    box-shadow: 0 8px 25px var(--shadow-color);
    transition: all 0.3s ease;
}

.character-display:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px var(--shadow-color);
}

.character {
    font-size: 4rem;
    font-weight: bold;
    color: #2d3436;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
    border-radius: 20px;
    padding: 20px;
    display: inline-block;
    min-width: 120px;
    box-shadow: 0 8px 25px rgba(253, 203, 110, 0.4);
}

.pinyin-display {
    background: white;
    border-radius: 15px;
    padding: 16px; /* 更紧凑 */
    margin: 10px 0; /* 更紧凑 */
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.pinyin-step {
    text-align: center;
    margin-bottom: 15px;
}

.step-label {
    font-size: 1.1rem;
    color: #636e72;
    margin-right: 10px;
}

.step-value {
    font-size: 2rem;
    font-weight: bold;
    color: #0984e3;
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.character-progress {
    text-align: center;
    font-size: 0.9rem;
    color: #636e72;
    background: #f8f9fa;
    padding: 8px 15px;
    border-radius: 20px;
    display: inline-block;
}

.progress-section {
    margin: 8px 0; /* 更紧凑 */
}

.progress-container {
    background: white;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 4px 15px var(--shadow-color);
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 6px;
    transition: width 0.5s ease;
}

.progress-text {
    text-align: center;
    font-size: 0.9rem;
    color: #636e72;
    font-weight: bold;
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 10px; /* 同排更紧凑 */
    margin: 8px 0 12px 0; /* 更紧凑 */
    flex-wrap: nowrap; /* 同排 */
}

.control-btn {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(116, 185, 255, 0.4);
    min-width: 120px;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(116, 185, 255, 0.6);
}

.control-btn:active {
    transform: translateY(0);
}

.game-status {
    text-align: center;
    padding: 15px;
    background: linear-gradient(135deg, #a29bfe, #6c5ce7);
    color: white;
    border-radius: 15px;
    font-size: 1rem;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(162, 155, 254, 0.3);
}

/* 学习界面样式 */
#learning {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

.learning-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    gap: 20px;
}

.learning-header h2 {
    font-size: 2rem;
    color: #2d3436;
    flex: 1;
    text-align: center;
}

.learning-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.tab-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 15px;
    background: rgba(255,255,255,0.7);
    color: #2d3436;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.tab-btn.active {
    background: #fd79a8;
    color: white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.tab-btn:hover {
    background: #e84393;
    color: white;
}

.learning-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.game-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--card-background);
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--shadow-color);
    transition: all 0.3s ease;
}

.learning-tab {
    display: none;
}

.learning-tab.active {
    display: block;
}

.pinyin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

/* 练习卡片区域 */
.practice-section {
    margin-top: 10px;
}

.practice-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.practice-header h3 {
    margin: 0;
    color: #2d3436;
}

.practice-stats {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.practice-card {
    background: white;
    border-radius: 16px;
    border: 2px solid #e9ecef;
    padding: 14px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.practice-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(0,0,0,0.12);
}

.practice-card .card-title {
    font-weight: 700;
    color: #6c5ce7;
    margin-bottom: 8px;
}

.practice-card .card-question {
    color: #2d3436;
    margin-bottom: 10px;
}

.practice-card .char {
    font-size: 1.6rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 8px;
    background: #fff3cd;
}

.practice-card .card-pinyin {
    font-size: 1.2rem;
    font-weight: 600;
    color: #0984e3;
    margin-bottom: 10px;
}

.practice-card .card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.small-btn {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.small-btn:hover {
    transform: translateY(-1px);
}

.choice-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.choice-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.choice-btn:hover {
    background: #e9ecef;
}

.assemble-source {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.chip {
    background: #f1f3f5;
    border: 1px solid #dee2e6;
    border-radius: 999px;
    padding: 6px 10px;
    cursor: pointer;
}

.assemble-target {
    min-height: 36px;
    background: #fff;
    border: 2px dashed #e9ecef;
    border-radius: 12px;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tag {
    background: #dfe7fd;
    color: #2d3436;
    border-radius: 999px;
    padding: 4px 10px;
    font-weight: 600;
}

.card-feedback {
    margin-top: 8px;
    min-height: 20px;
}

.practice-card.correct {
    border-color: #2ecc71;
}

.practice-card.wrong {
    border-color: #e74c3c;
}

.pinyin-item {
    background: white;
    padding: 15px;
    border-radius: 15px;
    border: 3px solid #fd79a8;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #2d3436;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.pinyin-item:hover {
    background: #fd79a8;
    color: white;
    transform: scale(1.05);
}

.example-characters {
    background: rgba(255,255,255,0.9);
    padding: 20px;
    border-radius: 15px;
    border: 2px solid #fd79a8;
    text-align: center;
    font-size: 1.2rem;
    color: #2d3436;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 奖励动画 */
#reward-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.firework {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    animation: firework 1s ease-out forwards;
}

@keyframes firework {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(20);
        opacity: 0;
    }
}

.reward-animal {
    position: absolute;
    font-size: 3rem;
    animation: reward-bounce 2s ease-out forwards;
}

@keyframes reward-bounce {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    50% {
        transform: translateY(20vh) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translateY(-20vh) scale(1);
        opacity: 0;
    }
}

.reward-flower {
    position: absolute;
    font-size: 2rem;
    animation: reward-float 3s ease-out forwards;
}

@keyframes reward-float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(-20vh) rotate(360deg);
        opacity: 0;
    }
}

/* 全局导航栏样式 */
.global-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.global-nav.hidden {
    transform: translateY(-100%);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-weight: bold;
    font-size: 18px;
}

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

.nav-buttons {
    display: flex;
    gap: 10px;
}

.nav-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.nav-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: rgba(255,255,255,0.4);
    box-shadow: 0 0 10px rgba(255,255,255,0.3);
    transform: scale(1.05);
}

.nav-btn-icon {
    font-size: 18px;
}

/* 调整主内容区域，为导航栏留出空间 */
#app {
    padding-top: 0;
}

.screen {
    min-height: 100vh;
    padding-top: 60px; /* 为导航栏留出空间 */
}

.screen.main-menu-active {
    padding-top: 0; /* 主菜单页面不需要顶部间距 */
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        padding: 8px 15px;
    }
    
    .nav-brand {
        font-size: 16px;
    }
    
    .nav-icon {
        font-size: 20px;
    }
    
    .nav-buttons {
        gap: 8px;
    }
    
    .nav-btn {
        padding: 6px 10px;
    }
    
    .nav-btn-icon {
        font-size: 16px;
    }
    
    .screen {
        padding-top: 50px; /* 移动端导航栏较小 */
    }
    
    .title h1 {
        font-size: 2rem;
    }
    
    .menu-btn {
        font-size: 1.2rem;
        min-width: 200px;
    }
    
    .characters {
        font-size: 3rem;
    }
    
    .pinyin-part {
        font-size: 1.5rem;
        padding: 15px 20px;
    }
    
    .complete-pinyin {
        font-size: 1.4rem;
    }
    
    .game-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .pinyin-grid {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        gap: 10px;
    }
    
    .pinyin-item {
        font-size: 1.2rem;
        padding: 10px;
    }
}

/* 更紧凑的手机端适配 */
@media (max-width: 480px) {
    .learning-content {
        max-width: 100%;
        padding: 12px;
        max-height: calc(100vh - 140px);
    }

    .pinyin-grid {
        grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
        gap: 8px;
    }

    .pinyin-item {
        font-size: 1rem;
        padding: 8px;
        border-width: 2px;
    }

    .practice-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .practice-stats {
        justify-content: space-between;
    }

    .practice-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

    .practice-card {
        padding: 10px;
        border-radius: 12px;
    }

    .practice-card .card-title {
        font-size: 0.95rem;
        margin-bottom: 6px;
    }

    .practice-card .card-question {
        font-size: 0.95rem;
        margin-bottom: 6px;
    }

    .practice-card .char {
        font-size: 1.3rem;
        padding: 2px 6px;
    }

    .practice-card .card-pinyin {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .small-btn {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .choice-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .choice-btn {
        padding: 8px 6px;
        border-radius: 10px;
    }

    .chip {
        padding: 4px 8px;
        font-size: 0.9rem;
    }

    .assemble-target {
        min-height: 32px;
        padding: 4px 6px;
    }

    .tag {
        padding: 3px 8px;
        font-size: 0.9rem;
    }

    .game-content {
        gap: 10px;
    }

    .character-display {
        margin: 8px 0;
        padding: 24px;
    }

    .character {
        font-size: 3rem;
        padding: 14px;
        min-width: 90px;
    }

    .pinyin-display {
        padding: 12px;
        margin: 8px 0;
    }

    .progress-section {
        margin: 6px 0;
    }

    .game-controls {
        gap: 8px;
        margin: 6px 0 10px 0;
        flex-wrap: wrap; /* 窄屏允许换行 */
    }

    .control-btn {
        min-width: 110px;
        padding: 10px 14px;
        font-size: 0.95rem;
    }
}

/* 强制移动端优先的紧凑布局（全局生效） */
.learning-content {
    max-width: 100%;
    padding: 12px;
    max-height: calc(100vh - 140px);
}

.pinyin-grid {
    grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
    gap: 8px;
}

.pinyin-item {
    font-size: 1rem;
    padding: 8px;
    border-width: 2px;
}

.practice-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.practice-stats {
    justify-content: space-between;
}

.practice-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.practice-card {
    padding: 10px;
    border-radius: 12px;
}

.practice-card .card-title {
    font-size: 0.95rem;
    margin-bottom: 6px;
}

.practice-card .card-question {
    font-size: 0.95rem;
    margin-bottom: 6px;
}

.practice-card .char {
    font-size: 1.3rem;
    padding: 2px 6px;
}

.practice-card .card-pinyin {
    font-size: 1rem;
    margin-bottom: 8px;
}

.small-btn {
    padding: 6px 10px;
    font-size: 0.85rem;
}

.choice-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.choice-btn {
    padding: 8px 6px;
    border-radius: 10px;
}

.chip {
    padding: 4px 8px;
    font-size: 0.9rem;
}

.assemble-target {
    min-height: 32px;
    padding: 4px 6px;
}

.tag {
    padding: 3px 8px;
    font-size: 0.9rem;
}

.example-char {
    font-size: 1.1rem;
    padding: 6px 10px;
}

/* 动画效果增强 */
.success-animation {
    animation: success-pulse 0.6s ease-out;
}

@keyframes success-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); background: #00b894; }
    100% { transform: scale(1); }
}

.error-animation {
    animation: error-shake 0.6s ease-out;
}

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

/* 设置页面样式 */
.settings-page {
    padding-top: 80px;
}

.settings-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 0 20px;
}

.settings-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.settings-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.settings-section h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.2em;
    font-weight: 600;
}

.theme-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.theme-option {
    position: relative;
}

/* 我的世界主题样式 */
.minecraft .theme-preview {
    background: linear-gradient(135deg, #8B4513, #654321);
    border: 3px solid #4A4A4A;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.minecraft .theme-preview:hover {
    background: linear-gradient(135deg, #A0522D, #8B4513);
    transform: scale(1.05);
}

.minecraft .theme-preview.active {
    border-color: #228B22;
    box-shadow: 0 0 20px rgba(34, 139, 34, 0.5);
}

/* 设置按钮样式 */
.settings-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.settings-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.settings-btn:active {
    transform: translateY(0);
}

/* 关卡选择器样式 */
.level-selector {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.level-selector-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 80%;
    max-height: 80%;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.level-item {
    aspect-ratio: 1;
    border: 2px solid #ddd;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.level-item:hover {
    transform: scale(1.1);
    border-color: #667eea;
}

.level-item.completed {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    border-color: #4CAF50;
}

.level-item.locked {
    background: #f0f0f0;
    color: #999;
    cursor: not-allowed;
}

.level-item.current {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #5a67d8;
}

.example-characters {
    background: rgba(255,255,255,0.9);
    padding: 20px;
    border-radius: 15px;
    border: 2px solid #fd79a8;
    text-align: center;
    font-size: 1.2rem;
    color: #2d3436;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 奖励动画 */
#reward-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.firework {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    animation: firework 1s ease-out forwards;
}

@keyframes firework {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(20);
        opacity: 0;
    }
}

.reward-animal {
    position: absolute;
    font-size: 3rem;
    animation: reward-bounce 2s ease-out forwards;
}

@keyframes reward-bounce {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    50% {
        transform: translateY(20vh) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translateY(-20vh) scale(1);
        opacity: 0;
    }
}

.reward-flower {
    position: absolute;
    font-size: 2rem;
    animation: reward-float 3s ease-out forwards;
}

@keyframes reward-float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(-20vh) rotate(360deg);
        opacity: 0;
    }
}

/* 全局导航栏样式 */
.global-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.global-nav.hidden {
    transform: translateY(-100%);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-weight: bold;
    font-size: 18px;
}

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

.nav-buttons {
    display: flex;
    gap: 10px;
}

.nav-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.nav-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: rgba(255,255,255,0.4);
    box-shadow: 0 0 10px rgba(255,255,255,0.3);
    transform: scale(1.05);
}

.nav-btn-icon {
    font-size: 18px;
}

/* 调整主内容区域，为导航栏留出空间 */
#app {
    padding-top: 0;
}

.screen {
    min-height: 100vh;
    padding-top: 60px; /* 为导航栏留出空间 */
}

.screen.main-menu-active {
    padding-top: 0; /* 主菜单页面不需要顶部间距 */
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        padding: 8px 15px;
    }
    
    .nav-brand {
        font-size: 16px;
    }
    
    .nav-icon {
        font-size: 20px;
    }
    
    .nav-buttons {
        gap: 8px;
    }
    
    .nav-btn {
        padding: 6px 10px;
    }
    
    .nav-btn-icon {
        font-size: 16px;
    }
    
    .screen {
        padding-top: 50px; /* 移动端导航栏较小 */
    }
    
    .title h1 {
        font-size: 2rem;
    }
    
    .menu-btn {
        font-size: 1.2rem;
        min-width: 200px;
    }
    
    .characters {
        font-size: 3rem;
    }
    
    .pinyin-part {
        font-size: 1.5rem;
        padding: 15px 20px;
    }
    
    .complete-pinyin {
        font-size: 1.4rem;
    }
    
    .game-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .pinyin-grid {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        gap: 10px;
    }
    
    .pinyin-item {
        font-size: 1.2rem;
        padding: 10px;
    }
}

/* 动画效果增强 */
.success-animation {
    animation: success-pulse 0.6s ease-out;
}

@keyframes success-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); background: #00b894; }
    100% { transform: scale(1); }
}

.error-animation {
    animation: error-shake 0.6s ease-out;
}

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

/* 设置页面样式 */
.settings-page {
    padding-top: 80px;
}

.settings-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 0 20px;
}

.settings-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.settings-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.settings-section h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.2em;
    font-weight: 600;
}

.theme-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.theme-option {
    position: relative;
}

.theme-preview {
    width: 100%;
    padding: 20px;
    border: 2px solid transparent;
    border-radius: 10px;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.theme-preview.cool {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.theme-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.theme-name {
    font-weight: 600;
    font-size: 1.1em;
}

.theme-desc {
    font-size: 0.9em;
    opacity: 0.9;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item label {
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

#volume-slider {
    width: 150px;
    margin: 0 10px;
}

#volume-value {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    color: #666;
}

.settings-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.3s ease;
}

.settings-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.about-info {
    text-align: center;
    color: #666;
    line-height: 1.6;
}

.about-info p {
    margin: 10px 0;
}

/* 权限测试页面样式 */
.permissions-test-page {
    padding-top: 80px;
}

.permissions-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 0 20px;
}

.permissions-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.test-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.test-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.test-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.3s ease;
}

.test-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.test-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.test-status {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    min-width: 120px;
    text-align: center;
}

.test-status.testing {
    background: #fff3cd;
    color: #856404;
}

.test-status.success {
    background: #d4edda;
    color: #155724;
}

.test-status.error {
    background: #f8d7da;
    color: #721c24;
}

.test-description {
    color: #666;
    font-size: 0.9em;
    line-height: 1.5;
}

.test-results {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.overall-status {
    padding: 20px;
    border-radius: 10px;
    background: #f8f9fa;
    color: #495057;
    text-align: center;
    font-weight: 500;
}