* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: linear-gradient(135deg, #58CC02 0%, #1CB0F6 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

/* 加载页 */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #58CC02 0%, #1CB0F6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.3s;
}

#loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    animation: fadeIn 0.5s;
}

.loading-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 1s infinite alternate;
}

.loading-text {
    font-size: 32px;
    font-weight: bold;
    color: white;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    margin: 0 auto;
    animation: spin 1s linear infinite;
}

/* 应用容器 */
#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#app.hidden {
    display: none;
}

/* 屏幕切换 */
.screen {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.screen.hidden {
    display: none;
}

/* 顶部栏 */
.app-header {
    background: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header h1 {
    font-size: 24px;
    font-weight: bold;
    color: #58CC02;
    flex: 1;
    text-align: center;
}

.app-header h2 {
    font-size: 20px;
    font-weight: bold;
    color: #58CC02;
    flex: 1;
    text-align: center;
}

.app-header button {
    background: none;
    border: none;
    font-size: 28px;
    color: #58CC02;
    cursor: pointer;
    padding: 0 10px;
}

.stars {
    font-size: 20px;
    font-weight: bold;
    color: #FFC107;
    background: rgba(255,193,7,0.1);
    padding: 8px 16px;
    border-radius: 20px;
}

.header-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.progress-text {
    font-size: 16px;
    color: #666;
}

.lives {
    color: #FF5252;
    font-weight: bold;
}

/* 课程列表 */
.courses-grid {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    flex: 1;
    overflow-y: auto;
}

.course-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 3px solid transparent;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #58CC02;
}

.course-icon {
    font-size: 50px;
    flex-shrink: 0;
}

.course-info {
    flex: 1;
}

.course-name {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.course-desc {
    font-size: 16px;
    color: #666;
    margin-bottom: 10px;
}

.course-stats {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #888;
}

/* 学习页 */
.learn-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 40px;
}

.word-card {
    background: white;
    border-radius: 30px;
    padding: 40px;
    width: 100%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    animation: fadeInUp 0.5s;
}

.card-emoji {
    font-size: 100px;
    margin-bottom: 30px;
    animation: bounce 2s infinite;
}

.card-words {
    margin-bottom: 30px;
}

.card-word-en {
    font-size: 48px;
    font-weight: bold;
    color: #58CC02;
    margin-bottom: 10px;
}

.card-word-cn {
    font-size: 28px;
    color: #666;
}

.audio-buttons {
    display: flex;
    gap: 12px;
}

.btn-audio {
    flex: 1;
    background: #58CC02;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 15px 20px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.btn-audio:hover {
    transform: scale(1.03);
}

.btn-audio.playing {
    background: #2196F3;
    transform: scale(0.97);
}

.btn-chinese {
    background: #FF9800;
}

.btn-chinese:hover {
    background: #F57C00;
}

.btn-chinese.playing {
    background: #2196F3;
}

.btn-audio.big {
    font-size: 24px;
    padding: 20px 40px;
    border-radius: 30px;
}

/* Loading animation */
.audio-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 8px 0 0 0;
}

.audio-loading.hidden {
    display: none;
}

.loading-dot {
    width: 10px;
    height: 10px;
    background: #58CC02;
    border-radius: 50%;
    animation: dotBounce 0.6s ease-in-out infinite;
}

.loading-dot:nth-child(2) { animation-delay: 0.15s; }
.loading-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes dotBounce {
    0%, 100% { transform: translateY(0); opacity: 0.3; }
    50% { transform: translateY(-10px); opacity: 1; }
}

.learn-nav {
    display: flex;
    gap: 20px;
    width: 100%;
    max-width: 500px;
}

.btn-nav {
    flex: 1;
    background: white;
    border: 3px solid #58CC02;
    color: #58CC02;
    border-radius: 25px;
    padding: 20px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-nav:hover {
    background: #f0f9f0;
    transform: translateY(-2px);
}

.btn-nav.btn-primary {
    background: #58CC02;
    color: white;
}

.btn-nav.btn-primary:hover {
    background: #4CAF50;
}

.btn-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 测试页 */
.quiz-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    gap: 30px;
}

.quiz-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 600px;
}

.quiz-option {
    background: white;
    border: 3px solid #E0E0E0;
    border-radius: 20px;
    padding: 25px;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.quiz-option:hover {
    border-color: #58CC02;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(88,204,2,0.2);
}

.quiz-option.correct {
    background: #E8F5E9;
    border-color: #4CAF50;
    color: #2E7D32;
    animation: pulse 0.5s;
}

.quiz-option.wrong {
    background: #FFEBEE;
    border-color: #FF5252;
    color: #C62828;
    animation: shake 0.5s;
}

.quiz-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px 50px;
    border-radius: 20px;
    font-size: 28px;
    font-weight: bold;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 1000;
    animation: popIn 0.3s;
}

.quiz-feedback.correct {
    color: #4CAF50;
    border: 4px solid #4CAF50;
}

.quiz-feedback.wrong {
    color: #FF5252;
    border: 4px solid #FF5252;
}

.quiz-feedback.hidden {
    display: none;
}

/* 结果页 */
.quiz-result {
    background: white;
    border-radius: 30px;
    padding: 40px;
    width: 100%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    animation: fadeInUp 0.5s;
}

.quiz-result.hidden {
    display: none;
}

.result-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.result-stats div {
    background: #F5F5F5;
    border-radius: 15px;
    padding: 15px;
    font-size: 16px;
}

.result-stats div span {
    display: block;
    color: #666;
    margin-bottom: 5px;
}

.result-stats div strong {
    font-size: 24px;
    color: #333;
}

.result-stats div.correct strong {
    color: #4CAF50;
}

.result-stats div.wrong strong {
    color: #FF5252;
}

.result-stars {
    font-size: 40px;
    color: #FFC107;
    margin: 20px 0;
}

.result-actions {
    display: flex;
    gap: 20px;
    margin-top: 30px;
}

.btn-big {
    flex: 1;
    background: #58CC02;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 20px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-big:hover {
    background: #4CAF50;
    transform: translateY(-2px);
}

.btn-big.btn-outline {
    background: white;
    border: 3px solid #58CC02;
    color: #58CC02;
}

.btn-big.btn-outline:hover {
    background: #f0f9f0;
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

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

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

@keyframes popIn {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* 响应式 */
@media (max-width: 768px) {
    .courses-grid {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    
    .course-card {
        padding: 20px;
    }
    
    .word-card {
        padding: 30px 20px;
    }
    
    .card-emoji {
        font-size: 80px;
    }
    
    .card-word-en {
        font-size: 36px;
    }
    
    .card-word-cn {
        font-size: 24px;
    }
    
    .quiz-options {
        grid-template-columns: 1fr;
    }
    
    .quiz-option {
        min-height: 100px;
        font-size: 20px;
    }
    
    .result-actions {
        flex-direction: column;
    }
}

/* 触摸优化 */
@media (hover: none) and (pointer: coarse) {
    .course-card:hover,
    .btn-audio:hover,
    .btn-nav:hover,
    .btn-big:hover,
    .quiz-option:hover {
        transform: none;
    }
    
    .course-card:active,
    .btn-audio:active,
    .btn-nav:active,
    .btn-big:active,
    .quiz-option:active {
        transform: scale(0.98);
    }
}

/* 全屏按钮 */
.btn-fullscreen {
    background: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 16px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
}

.btn-fullscreen:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

.btn-fullscreen:active {
    background: #e0e0e0;
}

/* 全屏模式 */
:fullscreen {
    background: linear-gradient(135deg, #58CC02 0%, #1CB0F6 100%);
}

:-webkit-full-screen {
    background: linear-gradient(135deg, #58CC02 0%, #1CB0F6 100%);
}

:-moz-full-screen {
    background: linear-gradient(135deg, #58CC02 0%, #1CB0F6 100%);
}