* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Neue', cursive;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
    min-height: 100vh;
    color: #333;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* 分组选择样式 */
.group-selection {
    text-align: center;
}

.group-selection h2 {
    color: #ff6b6b;
    margin-bottom: 30px;
    font-size: 28px;
}

.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.group-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 20px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.group-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.group-card h3 {
    font-size: 22px;
    margin-bottom: 10px;
}

.group-card p {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 15px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #ffd700;
    width: 0%;
    transition: width 0.3s ease;
}

/* 分组学习区域 */
.group-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 20px;
}

.back-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #ff5252;
    transform: scale(1.05);
}

#currentGroupName {
    font-size: 20px;
    color: #333;
    font-weight: bold;
}

#wordCounter {
    font-size: 18px;
    color: #666;
}

.phonetic {
    font-size: 16px;
    color: #666;
    margin: 5px 0;
    font-style: italic;
}

.card-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.prev-btn, .next-btn, .learned-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.prev-btn:hover, .next-btn:hover, .learned-btn:hover {
    background: #45a049;
    transform: scale(1.05);
}

.prev-btn:disabled, .next-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.learned-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin-left: 10px;
}

.learned-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* 顶部样式 */
.header {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.header h1 {
    color: white;
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.score-board {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 1.2em;
    color: white;
}

/* 单词卡片样式 */
.word-section {
    margin-bottom: 30px;
}

.card-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.word-card {
    width: 300px;
    height: 200px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    cursor: pointer;
}

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

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.card-front {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.card-back {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    transform: rotateY(180deg);
}

.card-front h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
}

.play-sound {
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5em;
    cursor: pointer;
    transition: transform 0.3s;
}

.play-sound:hover {
    transform: scale(1.1);
}

.card-back h3 {
    font-size: 2em;
    margin-bottom: 10px;
}

.card-back p {
    font-size: 1.2em;
    opacity: 0.9;
    margin: 0;
}

.example-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.play-sentence-btn {
    background: linear-gradient(135deg, #48bb78, #38a169);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.3);
}

.play-sentence-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.5);
}

.play-sentence-btn:active {
    transform: scale(0.9);
}

.flip-btn {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1em;
    cursor: pointer;
    transition: transform 0.3s;
}

.flip-btn:hover {
    transform: translateY(-3px);
}

/* 功能按钮 */
.features {
    margin-bottom: 30px;
}

.feature-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.feature-btn {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    border: none;
    padding: 20px;
    border-radius: 15px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.feature-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

/* 练习区域 */
.practice-area {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    margin-top: 20px;
}

.practice-section h3 {
    color: #ff6b6b;
    margin-bottom: 20px;
    font-size: 1.5em;
}

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

.option-btn {
    background: #f0f0f0;
    border: 2px solid transparent;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.1em;
}

.option-btn:hover {
    border-color: #ff6b6b;
    background: #fff5f5;
}

.option-btn.correct {
    background: #4caf50;
    color: white;
}

.option-btn.incorrect {
    background: #f44336;
    color: white;
}

.spelling-section input {
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    border: 2px solid #ddd;
    border-radius: 10px;
    margin: 10px 0;
}

.spelling-section button {
    background: #4ecdc4;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1em;
}

/* 配对游戏 */
.matching-game {
    display: flex;
    justify-content: space-around;
    gap: 30px;
    margin-top: 20px;
}

.matching-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.match-item, .match-target {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    min-width: 100px;
}

.match-item:hover, .match-target:hover {
    transform: scale(1.05);
}

.match-item.dragging {
    opacity: 0.5;
}

.match-target.highlight {
    background: #4caf50;
}

/* 进度样式 */
.progress-stats {
    text-align: center;
}

.progress-stats p {
    font-size: 1.2em;
    margin: 10px 0;
    color: #666;
}

.word-list ul {
    list-style: none;
    margin-top: 20px;
}

.word-list li {
    background: #f0f0f0;
    margin: 5px 0;
    padding: 10px;
    border-radius: 10px;
    color: #333;
}

/* 奖励动画 */
.reward-animation {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
    color: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    z-index: 1000;
}

.star {
    font-size: 3em;
    animation: twinkle 1s ease-in-out infinite alternate;
}

@keyframes twinkle {
    from { transform: scale(1); }
    to { transform: scale(1.2); }
}

/* 响应式设计 */
@media (max-width: 600px) {
    .app-container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .word-card {
        width: 250px;
        height: 150px;
    }
    
    .feature-buttons {
        grid-template-columns: 1fr 1fr;
    }
    
    .matching-game {
        flex-direction: column;
    }
}