/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #74b9ff, #0984e3, #a29bfe, #6c5ce7);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
    min-height: 100vh;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* 标题区域 */
.header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: #2d3436;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.subtitle {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: #636e72;
    font-weight: bold;
}

/* 导航菜单 */
.nav-menu {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 40px;
}

.nav-btn {
    background: linear-gradient(45deg, #ff7675, #fd79a8);
    border: none;
    border-radius: 25px;
    padding: 15px 25px;
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    min-width: 120px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.nav-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.nav-btn.active {
    background: linear-gradient(45deg, #00b894, #00cec9);
    transform: scale(1.1);
}

/* 学习区域 */
.learning-area {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.learning-section {
    display: none;
}

.learning-section.active {
    display: block;
}

.section-title {
    text-align: center;
    font-size: clamp(2rem, 4vw, 3rem);
    color: #2d3436;
    margin-bottom: 30px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
}

/* 学习项目网格 */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    justify-items: center;
}

.learning-item {
    background: white;
    border-radius: 25px;
    padding: 35px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border: 6px solid transparent;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    /* 更大的触摸区域 */
    min-width: 200px;
}

.learning-item:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border-color: #74b9ff;
}

.learning-item:active {
    transform: scale(0.95);
}

.item-label {
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    font-weight: bold;
    color: #2d3436;
    margin-top: 15px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* 颜色样式 */
.color-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto;
    border: 4px solid white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.color-item:hover .color-circle {
    transform: scale(1.2) rotate(360deg);
}

.red { background: linear-gradient(45deg, #ff7675, #e17055); }
.blue { background: linear-gradient(45deg, #74b9ff, #0984e3); }
.yellow { background: linear-gradient(45deg, #fdcb6e, #f39c12); }
.green { background: linear-gradient(45deg, #00b894, #00cec9); }
.purple { background: linear-gradient(45deg, #a29bfe, #6c5ce7); }
.orange { background: linear-gradient(45deg, #fd79a8, #e84393); }

/* 动物样式 */
.animal-emoji {
    font-size: 4rem;
    margin: 10px 0;
    transition: all 0.3s ease;
}

.animal-item:hover .animal-emoji {
    transform: scale(1.3) rotate(10deg);
    animation: wiggle 0.6s ease-in-out;
}

@keyframes wiggle {
    0%, 100% { transform: scale(1.3) rotate(10deg); }
    25% { transform: scale(1.3) rotate(-10deg); }
    75% { transform: scale(1.3) rotate(10deg); }
}

/* 数字样式 */
.number-display {
    font-size: 4rem;
    font-weight: bold;
    color: #0984e3;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
}

.dots {
    font-size: 1.5rem;
    line-height: 1.2;
    margin: 10px 0;
    color: #e17055;
}

.number-item:hover .number-display {
    animation: pulse 0.6s ease-in-out;
    color: #fd79a8;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* 形状样式 */
.shape {
    width: 70px;
    height: 70px;
    margin: 10px auto;
    transition: all 0.3s ease;
}

.circle-shape {
    background: linear-gradient(45deg, #ff7675, #fd79a8);
    border-radius: 50%;
}

.square-shape {
    background: linear-gradient(45deg, #74b9ff, #0984e3);
    border-radius: 10px;
}

.triangle-shape {
    width: 0;
    height: 0;
    border-left: 35px solid transparent;
    border-right: 35px solid transparent;
    border-bottom: 60px solid #00b894;
    background: none;
}

.heart-shape,
.star-shape {
    font-size: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
}

.shape-item:hover .shape {
    transform: scale(1.3) rotate(15deg);
}

/* 音效指示器 */
.sound-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: linear-gradient(45deg, #00b894, #00cec9);
    color: white;
    padding: 20px 40px;
    border-radius: 50px;
    font-size: 2rem;
    font-weight: bold;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.sound-indicator.show {
    transform: translate(-50%, -50%) scale(1);
    animation: soundPop 1s ease-in-out;
}

@keyframes soundPop {
    0% { transform: translate(-50%, -50%) scale(0); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* 鼓励动画 */
.encouragement {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%) scale(0);
    background: linear-gradient(45deg, #fd79a8, #fdcb6e);
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 1.8rem;
    font-weight: bold;
    z-index: 1000;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transition: all 0.4s ease;
}

.encouragement.show {
    transform: translateX(-50%) scale(1);
    animation: encourage 2s ease-in-out;
}

@keyframes encourage {
    0% { transform: translateX(-50%) scale(0) rotate(-10deg); }
    20% { transform: translateX(-50%) scale(1.1) rotate(5deg); }
    40% { transform: translateX(-50%) scale(0.9) rotate(-2deg); }
    60% { transform: translateX(-50%) scale(1.05) rotate(1deg); }
    100% { transform: translateX(-50%) scale(1) rotate(0deg); }
}

/* 点击效果 */
.learning-item.clicked {
    animation: clickEffect 0.6s ease-in-out;
}

@keyframes clickEffect {
    0% { transform: scale(1); }
    25% { transform: scale(0.9); box-shadow: 0 0 20px #ff7675; }
    50% { transform: scale(1.1); box-shadow: 0 0 30px #74b9ff; }
    75% { transform: scale(0.95); box-shadow: 0 0 25px #00b894; }
    100% { transform: scale(1); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .items-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 20px;
    }
    
    .learning-item {
        padding: 20px;
        min-height: 150px;
    }
    
    .color-circle {
        width: 60px;
        height: 60px;
    }
    
    .animal-emoji {
        font-size: 3rem;
    }
    
    .number-display {
        font-size: 3rem;
    }
    
    .heart-shape,
    .star-shape {
        font-size: 3rem;
    }
}

/* 家长控制面板 */
.parent-controls {
    position: fixed;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0 0 20px 20px;
    padding: 10px 20px;
    display: flex;
    gap: 15px;
    z-index: 1000;
    transition: top 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.parent-controls.show {
    top: 0;
}

.control-btn {
    background: linear-gradient(45deg, #636e72, #2d3436);
    color: white;
    border: none;
    border-radius: 15px;
    padding: 8px 15px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    transform: scale(1.05);
    background: linear-gradient(45deg, #74b9ff, #0984e3);
}

.parent-toggle {
    position: absolute;
    top: 10px;
    right: 20px;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.parent-toggle:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 1);
}

/* 重复练习区域 */
.repeat-zone {
    position: fixed;
    bottom: -200px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(45deg, #fd79a8, #fdcb6e);
    border-radius: 20px 20px 0 0;
    padding: 20px;
    z-index: 999;
    transition: bottom 0.4s ease;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.2);
    min-width: 300px;
    text-align: center;
}

.repeat-zone.show {
    bottom: 0;
}

.repeat-content {
    color: white;
}

.repeat-item {
    font-size: 3rem;
    margin-bottom: 15px;
    animation: bounce 1s ease-in-out infinite;
}

.repeat-btn {
    background: white;
    color: #fd79a8;
    border: none;
    border-radius: 25px;
    padding: 12px 25px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.repeat-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* 进度指示器 */
.progress-indicator {
    position: fixed;
    top: 50%;
    right: -250px;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px 0 0 20px;
    padding: 20px;
    z-index: 998;
    transition: right 0.4s ease;
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.progress-indicator.show {
    right: 0;
}

.progress-stars {
    margin-bottom: 10px;
}

.star {
    font-size: 2rem;
    margin: 0 5px;
    transition: all 0.3s ease;
    opacity: 0.3;
}

.star.active {
    opacity: 1;
    animation: starTwinkle 1s ease-in-out;
}

@keyframes starTwinkle {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.progress-text {
    font-size: 1rem;
    color: #2d3436;
    font-weight: bold;
}

/* 睡前模式样式 */
.sleepy-mode {
    filter: brightness(0.6) saturate(0.7);
}

.sleepy-mode .learning-item {
    animation: none !important;
}

.sleepy-mode .title {
    animation: none !important;
}

/* 增强的动画效果 */
@keyframes gentlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.learning-item.highlight {
    animation: gentlePulse 2s ease-in-out infinite;
    border-color: #00b894;
    box-shadow: 0 0 20px rgba(0, 184, 148, 0.4);
}

/* 更大字体适应小宝宝 */
.item-label {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: bold;
    color: #2d3436;
    margin-top: 15px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

@media (max-width: 480px) {
    .nav-menu {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-btn {
        width: 80%;
        max-width: 250px;
    }
    
    .items-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .parent-controls {
        padding: 8px 15px;
        gap: 10px;
    }

    .control-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .progress-indicator {
        right: -200px;
        padding: 15px;
    }

    .repeat-zone {
        min-width: 250px;
        padding: 15px;
    }
} 