/* Math Magic Game Styles */

/* Game Card Style */
.game-card.mathmagic {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    transition: all 0.3s ease;
}

.game-card.mathmagic:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

/* Math Magic Control Layout */
.mathmagic-control-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
    padding: 8px 0;
    flex-shrink: 0;
}

.mathmagic-controls-row {
    display: flex;
    justify-content: center;
    width: 100%;
}

.mathmagic-status-row {
    display: flex;
    justify-content: center;
    width: 100%;
}

.mathmagic-controls-row .primary-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.mathmagic-status-row .status-info {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: nowrap;
    align-items: center;
}

/* Main Game Area */
.mathmagic-game-area {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 10px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 20px;
    min-height: calc(100vh - 160px);
    height: fit-content;
    color: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Learning Modules Container */
.learning-modules {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.learning-module {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.learning-module:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.25);
}

.learning-module.completed {
    background: rgba(76, 175, 80, 0.3);
    border-color: rgba(76, 175, 80, 0.5);
}

.learning-module.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.module-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.module-icon {
    font-size: 2.5em;
    margin-right: 15px;
}

.module-title {
    font-size: 1.4em;
    font-weight: bold;
    margin-bottom: 5px;
}

.module-description {
    font-size: 0.9em;
    opacity: 0.9;
    line-height: 1.4;
}

.module-progress {
    margin-top: 15px;
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50 0%, #8BC34A 100%);
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 0.8em;
    margin-top: 5px;
    text-align: center;
}

/* Interactive Learning Area */
.interactive-area {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow-y: visible;
    min-height: 0;
    height: fit-content;
}

.lesson-header {
    text-align: center;
    margin-bottom: 20px;
}

.lesson-title {
    font-size: 1.8em;
    color: #667eea;
    margin-bottom: 8px;
}

.lesson-subtitle {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 15px;
}

.lesson-objective {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 15px;
    font-size: 1em;
    text-align: center;
}

/* Math Expression Display */
.math-expression-display {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 30px;
    margin: 10px 0;
    font-size: 2rem;
    font-weight: bold;
    font-family: 'Arial', monospace;
    flex-wrap: wrap;
    min-height: 60px;
    gap: 10px;
    height: fit-content;
    overflow: visible;
}

.math-component {
    padding: 10px 18px;
    margin: 0 5px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-width: 60px;
    text-align: center;
    flex-shrink: 0;
    white-space: nowrap;
}

.math-component:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.math-component.addend {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: #333;
}

.math-component.sum {
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
    color: white;
}

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

.math-component.subtrahend {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.math-component.difference {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #333;
}

.math-component.selected {
    animation: pulse 1s infinite;
    border: 3px solid #FFD700;
}

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

.component-label {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.4em;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.math-component:hover .component-label,
.math-component.selected .component-label {
    opacity: 1;
}

.operator {
    font-size: 1em;
    color: #333;
    margin: 0 10px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Interactive Exercises */
.exercise-area {
    margin: 30px 0;
}

.exercise-question {
    font-size: 1.4em;
    text-align: center;
    margin-bottom: 20px;
    color: #667eea;
    font-weight: bold;
}

.drag-drop-area {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
    min-height: 120px;
}

.drop-zone {
    width: 100px;
    height: 100px;
    border: 3px dashed #ccc;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 10px;
    transition: all 0.3s ease;
    font-size: 1.2em;
    color: #666;
}

.drop-zone.active {
    border-color: #4ECDC4;
    background: rgba(78, 205, 196, 0.1);
}

.drop-zone.filled {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.2);
    color: #333;
    font-weight: bold;
}

.draggable-item {
    padding: 15px 20px;
    margin: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    cursor: grab;
    transition: all 0.3s ease;
    user-select: none;
}

.draggable-item:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.draggable-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

/* Feedback System */
.feedback-area {
    text-align: center;
    margin: 10px 0;
    min-height: 40px;
}

.feedback-message {
    font-size: 1.1em;
    font-weight: bold;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.feedback-message.correct {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: 2px solid #4CAF50;
}

.feedback-message.incorrect {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: 2px solid #f44336;
}

.feedback-message.hint {
    background: rgba(255, 193, 7, 0.2);
    color: #FF9800;
    border: 2px solid #FF9800;
}

/* Achievement System */
.achievement-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: achievementPop 0.5s ease-out;
}

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

.achievement-icon {
    font-size: 4em;
    margin-bottom: 15px;
}

.achievement-title {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.achievement-description {
    font-size: 1em;
    opacity: 0.9;
}

/* Navigation Controls */
.lesson-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
}

.nav-btn {
    display: inline-block;
    margin: 0 10px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    text-decoration: none;
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    background: linear-gradient(135deg, #5a6fd8, #6a4c93);
}

.nav-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Additional Styles for Interactive Elements */
.lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

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

.lesson-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.lesson-number {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 10px;
}

.lesson-name {
    font-size: 1.2em;
    margin-bottom: 10px;
}

.lesson-status {
    font-size: 1.5em;
}

.practice-expressions {
    margin: 20px 0;
}

.practice-expression {
    font-size: 1.5em;
    margin: 15px 0;
    padding: 15px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.practice-expression:hover {
    background: rgba(255, 255, 255, 0.2);
}

.clickable-component {
    padding: 5px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clickable-component:hover {
    transform: scale(1.1);
}

.math-expression-interactive {
    font-size: 2em;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.draggable-numbers {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.fill-blanks-exercise {
    margin: 20px 0;
}

.blank-expression {
    font-size: 1.8em;
    margin: 15px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.number-input {
    width: 80px;
    height: 50px;
    font-size: 1.2em;
    text-align: center;
    border: 2px solid #ccc;
    border-radius: 10px;
    background: white;
}

.number-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.conversion-exercise {
    margin: 30px 0;
}

.conversion-pair {
    text-align: center;
}

.original-expression {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.arrow {
    font-size: 2em;
    color: #667eea;
    margin: 15px 0;
}

.converted-expressions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.conversion-option {
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2em;
    min-width: 200px;
}

.conversion-option:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.quick-practice-area {
    text-align: center;
    margin: 20px 0;
}

.practice-question {
    margin: 20px 0;
}

.practice-options {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.practice-option {
    padding: 15px 25px;
    font-size: 1.2em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.practice-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.practice-option:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.practice-score {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
    font-size: 1.2em;
    font-weight: bold;
}

.practice-question-text {
    font-size: 1.3em;
    margin: 15px 0;
    color: #667eea;
    font-weight: bold;
}

/* Lesson Progress */
.lesson-progress {
    font-size: 1em;
    color: #667eea;
    font-weight: bold;
    margin-top: 10px;
    padding: 8px 16px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 20px;
    display: inline-block;
}

/* Sum Exercise Grid */
.sum-exercise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.practice-instruction {
    font-size: 1.2em;
    color: #667eea;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
    padding: 15px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
}

/* Answer Options */
.answer-options {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.answer-btn {
    padding: 12px 20px;
    font-size: 1.2em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 70px;
}

.answer-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.answer-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Number Input Area */
.number-input-area {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}

.number-input-area input {
    width: 120px;
    height: 50px;
    font-size: 1.5em;
    text-align: center;
    border: 2px solid #ccc;
    border-radius: 10px;
    background: white;
}

.number-input-area input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.submit-btn {
    padding: 12px 24px;
    font-size: 1.2em;
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Family Equations */
.family-equations {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.family-option {
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
}

.family-option:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.family-option.selected {
    border-color: #4ECDC4;
    background: rgba(78, 205, 196, 0.2);
}

.family-option.correct {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.2);
}

.family-option.incorrect {
    border-color: #f44336;
    background: rgba(244, 67, 54, 0.2);
}

.base-equation {
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
    text-align: center;
    padding: 20px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 15px;
    margin: 20px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .learning-modules {
        grid-template-columns: 1fr;
    }

    .lessons-grid {
        grid-template-columns: 1fr;
    }

    .math-expression-display {
        font-size: 2.2em;
        flex-wrap: wrap;
        padding: 10px;
        justify-content: center;
        overflow: visible;
    }

    .math-component {
        margin: 0 5px;
        padding: 10px 15px;
        min-width: 60px;
        flex-shrink: 0;
    }

    .operator {
        margin: 0 5px;
        flex-shrink: 0;
    }

    .interactive-area {
        padding: 20px;
        overflow-y: visible;
    }

    .lesson-title {
        font-size: 1.5em;
    }

    .practice-options {
        flex-direction: column;
        align-items: center;
    }

    .practice-option {
        width: 200px;
    }

    .converted-expressions {
        gap: 15px;
    }

    .conversion-option {
        min-width: 250px;
    }

    .draggable-numbers {
        flex-wrap: wrap;
    }

    .blank-expression {
        font-size: 1.4em;
        flex-wrap: wrap;
        justify-content: center;
    }

    .mathmagic-controls-row .primary-controls {
        flex-wrap: wrap;
        gap: 8px;
    }

    .mathmagic-status-row .status-info {
        flex-wrap: wrap;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .math-expression-display {
        font-size: 1.8em;
        overflow: visible;
    }

    .math-component {
        padding: 8px 12px;
        min-width: 50px;
        margin: 0 3px;
    }

    .operator {
        margin: 0 3px;
    }
}

/* Tablet/iPad Responsive */
@media (min-width: 601px) and (max-width: 1024px) {
    .mathmagic-game-area {
        max-width: 700px;
        padding: 30px;
        margin: 0 auto;
    }

    .math-expression-display {
        font-size: 2.8em;
        padding: 25px;
        margin: 25px 0;
        border-radius: 20px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        overflow: visible;
    }

    .math-component {
        padding: 15px 25px;
        margin: 0 8px;
        font-size: 1.3em;
        border-radius: 15px;
        transition: all 0.3s ease;
    }

    .math-component:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }

    .operator {
        margin: 0 8px;
        font-size: 1.4em;
    }

    .learning-modules {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
        margin: 30px 0;
    }

    .learning-module {
        padding: 30px;
        border-radius: 20px;
        transition: all 0.3s ease;
    }

    .learning-module:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    }

    .module-title {
        font-size: 1.4em;
        margin-bottom: 15px;
    }

    .module-description {
        font-size: 1em;
        margin-bottom: 20px;
    }

    .lessons-grid {
        gap: 15px;
    }

    .lesson-item {
        padding: 15px;
        border-radius: 12px;
        transition: all 0.3s ease;
    }

    .lesson-item:hover {
        transform: scale(1.05);
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }

    .lesson-number {
        width: 35px;
        height: 35px;
        font-size: 1.1em;
    }

    .lesson-name {
        font-size: 1.1em;
    }

    .lesson-status {
        font-size: 1.3em;
    }

    .game-info {
        padding: 30px;
        border-radius: 20px;
    }

    .control-section {
        margin: 25px 0;
    }

    .primary-controls {
        gap: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .btn {
        padding: 15px 25px;
        font-size: 1.1em;
        min-width: 140px;
        border-radius: 25px;
    }
}

/* Large Desktop/Monitor Responsive */
@media (min-width: 1025px) {
    .mathmagic-game-area {
        max-width: 900px;
        padding: 40px;
        margin: 0 auto;
    }

    .math-expression-display {
        font-size: 3.5em;
        padding: 35px;
        margin: 35px 0;
        border-radius: 25px;
        box-shadow: 0 6px 25px rgba(0,0,0,0.15);
        background: linear-gradient(135deg, #f8f9fa, #ffffff);
        overflow: visible;
    }

    .math-component {
        padding: 20px 35px;
        margin: 0 12px;
        font-size: 1.5em;
        border-radius: 20px;
        transition: all 0.3s ease;
        box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    }

    .math-component:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    }

    .math-component.selected {
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    }

    .operator {
        margin: 0 12px;
        font-size: 1.6em;
        font-weight: bold;
    }

    .learning-modules {
        grid-template-columns: repeat(2, 1fr);
        gap: 35px;
        margin: 40px 0;
    }

    .learning-module {
        padding: 40px;
        border-radius: 25px;
        transition: all 0.3s ease;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    }

    /* 数字键盘样式 */
    .number-keyboard {
        display: grid;
        gap: 10px;
        max-width: 300px;
        margin: 20px auto;
        padding: 20px;
        background: #f8f9fa;
        border-radius: 15px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    .keyboard-row {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .number-btn {
        width: 60px;
        height: 60px;
        border: none;
        border-radius: 12px;
        font-size: 1.4em;
        font-weight: bold;
        background: linear-gradient(135deg, #667eea, #764ba2);
        color: white;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    }

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

    .number-btn:active {
        transform: translateY(0);
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }

    .number-btn.clear-btn {
        background: linear-gradient(135deg, #ff6b6b, #ee5a52);
        font-size: 1em;
    }

    .number-btn.delete-btn {
        background: linear-gradient(135deg, #ffa726, #ff9800);
        font-size: 1em;
    }

    .number-input-area {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
        margin: 20px 0;
    }

    .number-input-area input {
        width: 200px;
        height: 50px;
        font-size: 1.5em;
        text-align: center;
        border: 3px solid #ddd;
        border-radius: 25px;
        background: white;
        box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
    }

    .number-input-area input:focus {
        border-color: #667eea;
        outline: none;
        box-shadow: 0 0 15px rgba(102, 126, 234, 0.3);
    }

    .submit-btn {
        padding: 12px 30px;
        font-size: 1.2em;
        font-weight: bold;
        background: linear-gradient(135deg, #4CAF50, #45a049);
        color: white;
        border: none;
        border-radius: 25px;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    }

    .submit-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    }

    .submit-btn:disabled {
        background: #ccc;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

    /* 练习模式样式 */
    .practice-mode, .challenge-mode {
        max-width: 800px;
        margin: 0 auto;
        padding: 20px;
    }

    .mode-header {
        text-align: center;
        margin-bottom: 30px;
        padding: 20px;
        background: linear-gradient(135deg, #667eea, #764ba2);
        color: white;
        border-radius: 20px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    }

    .mode-title {
        font-size: 2.5em;
        font-weight: bold;
        margin-bottom: 10px;
    }

    .mode-subtitle {
        font-size: 1.2em;
        opacity: 0.9;
    }

    .practice-categories, .challenge-categories {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 20px;
        margin-top: 30px;
    }

    .practice-category, .challenge-item {
        background: white;
        border-radius: 15px;
        padding: 25px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        transition: all 0.3s ease;
        cursor: pointer;
        border: 2px solid transparent;
    }

    .practice-category:hover, .challenge-item:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.2);
        border-color: #667eea;
    }

    .challenge-item.locked {
        opacity: 0.6;
        cursor: not-allowed;
        background: #f5f5f5;
    }

    .challenge-item.locked:hover {
        transform: none;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        border-color: transparent;
    }

    .category-icon, .challenge-icon {
        font-size: 3em;
        text-align: center;
        margin-bottom: 15px;
    }

    .category-title, .challenge-title {
        font-size: 1.4em;
        font-weight: bold;
        color: #333;
        margin-bottom: 10px;
        text-align: center;
    }

    .category-desc, .challenge-desc {
        color: #666;
        text-align: center;
        margin-bottom: 15px;
        line-height: 1.5;
    }

    .category-stats, .challenge-reward, .challenge-requirement {
        text-align: center;
        font-size: 0.9em;
        padding: 8px 12px;
        border-radius: 20px;
        margin-top: 10px;
    }

    .category-stats {
        background: #e3f2fd;
        color: #1976d2;
    }

    .challenge-reward {
        background: #fff3e0;
        color: #f57c00;
        font-weight: bold;
    }

    .challenge-requirement {
        background: #f3e5f5;
        color: #7b1fa2;
    }

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

    .challenge-lock {
        font-size: 1.5em;
    }

    /* 进度条样式 */
    .progress-bar {
        width: 100%;
        height: 20px;
        background: #e0e0e0;
        border-radius: 10px;
        overflow: hidden;
        margin: 15px 0;
        box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
    }

    .progress-fill {
        height: 100%;
        background: linear-gradient(90deg, #4CAF50, #45a049);
        transition: width 0.3s ease;
        border-radius: 10px;
    }

    /* 统计卡片样式 */
    .result-stats {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 20px;
        margin: 30px 0;
    }

    .stat-card {
        background: white;
        padding: 20px;
        border-radius: 15px;
        text-align: center;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        border: 2px solid #f0f0f0;
    }

    .stat-number {
        font-size: 2em;
        font-weight: bold;
        color: #667eea;
        margin-bottom: 5px;
    }

    .stat-label {
        color: #666;
        font-size: 0.9em;
    }

    /* 复用口算挑战的键盘样式 */
    .custom-math-keyboard {
        background: rgba(255, 255, 255, 0.95);
        border-radius: 20px;
        padding: 20px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.3);
        max-width: 400px;
        margin: 20px auto;
    }

    .keyboard-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        margin-bottom: 15px;
    }

    .keyboard-actions {
        display: flex;
        justify-content: space-between;
        gap: 15px;
        margin-top: 15px;
    }

    .key-btn {
        border: none;
        border-radius: 12px;
        font-size: 1.2em;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        position: relative;
        overflow: hidden;
        min-height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .key-btn.number {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        min-width: 60px;
    }

    .key-btn.special {
        background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
        color: white;
        min-width: 60px;
    }

    .key-btn.action {
        background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
        color: white;
        padding: 12px 20px;
        font-size: 1.1em;
        min-width: 100px;
        flex: 1;
    }

    .key-btn.submit {
        background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
        color: white;
        font-size: 1.2em;
        font-weight: bold;
        min-height: 55px;
        flex: 1;
    }

    .key-btn.clear {
        background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
        color: white;
        flex: 1;
    }

    .key-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    }

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

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

    .math-answer-display-area {
        text-align: center;
        margin: 20px 0;
    }

    .math-answer-display {
        background: rgba(255, 255, 255, 0.9);
        border: 3px solid #667eea;
        border-radius: 15px;
        padding: 15px 25px;
        font-size: 2em;
        font-weight: bold;
        color: #333;
        min-height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto 15px auto;
        max-width: 200px;
        box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    .math-keyboard-area {
        margin: 20px 0;
    }

    .math-question-area {
        text-align: center;
        margin: 20px 0;
    }

    .question-display {
        font-size: 2.5em;
        font-weight: bold;
        color: #333;
        margin: 20px 0;
        padding: 20px;
        background: linear-gradient(135deg, #f8f9fa, #e9ecef);
        border-radius: 15px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: center;
    }

    /* 确保导航按钮正确显示 */
    .lesson-navigation {
        margin-top: auto;
        padding-top: 20px;
        text-align: center;
        border-top: 1px solid rgba(0,0,0,0.1);
    }

    .lesson-navigation .nav-btn {
        display: inline-block !important;
        margin: 0 10px;
        padding: 12px 24px;
        background: linear-gradient(135deg, #667eea, #764ba2) !important;
        color: white !important;
        border: none !important;
        border-radius: 25px;
        font-size: 1.1em;
        font-weight: bold;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
        text-decoration: none;
    }

    .lesson-navigation .nav-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0,0,0,0.3);
        background: linear-gradient(135deg, #5a6fd8, #6a4c93) !important;
    }

    .lesson-navigation .nav-btn[style*="display: none"] {
        display: none !important;
    }

    .lesson-navigation .nav-btn[style*="display: inline-block"] {
        display: inline-block !important;
    }

    /* 响应式设计 */
    @media (max-width: 768px) {
        .mathmagic-game-area {
            max-height: 90vh;
            padding: 15px;
        }

        .interactive-area {
            padding: 20px;
            min-height: 300px;
            overflow-y: visible;
        }

        .lesson-navigation .nav-btn {
            margin: 5px;
            padding: 10px 20px;
            font-size: 1em;
        }
    }

    @media (max-width: 480px) {
        .mathmagic-game-area {
            max-height: 95vh;
            padding: 10px;
        }

        .interactive-area {
            padding: 15px;
            overflow-y: visible;
        }

        .lesson-navigation .nav-btn {
            display: block !important;
            margin: 10px auto;
            width: 80%;
            max-width: 200px;
        }
    }

    .learning-module:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    }

    .module-title {
        font-size: 1.6em;
        margin-bottom: 20px;
    }

    .module-description {
        font-size: 1.1em;
        margin-bottom: 25px;
        line-height: 1.6;
    }

    .lessons-grid {
        gap: 20px;
    }

    .lesson-item {
        padding: 20px;
        border-radius: 15px;
        transition: all 0.3s ease;
        cursor: pointer;
    }

    .lesson-item:hover {
        transform: scale(1.08);
        box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    }

    .lesson-number {
        width: 40px;
        height: 40px;
        font-size: 1.2em;
        border-radius: 20px;
    }

    .lesson-name {
        font-size: 1.2em;
        font-weight: 600;
    }

    .lesson-status {
        font-size: 1.5em;
    }

    .game-info {
        padding: 40px;
        border-radius: 25px;
        max-width: 1000px;
        margin: 0 auto;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    }

    .game-header {
        margin-bottom: 30px;
    }

    .game-title-section h1 {
        font-size: 2.5em;
        margin-bottom: 10px;
    }

    .game-subtitle {
        font-size: 1.3em;
    }

    .control-section {
        margin: 30px 0;
    }

    .primary-controls {
        gap: 25px;
        margin: 25px 0;
    }

    .btn {
        padding: 18px 35px;
        font-size: 1.2em;
        min-width: 160px;
        border-radius: 30px;
        transition: all 0.3s ease;
        box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    }

    .btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    }

    .status-info {
        gap: 30px;
        margin: 25px 0;
    }

    .moves-counter {
        font-size: 1.2em;
        padding: 15px 25px;
        border-radius: 25px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
}
