/* ============================================
   乐学岛 - 儿童教育游戏平台 主样式表
   ============================================ */

/* CSS变量 */
:root {
    --primary: #FF6B6B;
    --primary-light: #FF8E8E;
    --primary-dark: #E55A5A;
    --secondary: #4ECDC4;
    --secondary-light: #7EDDD6;
    --accent: #FFD93D;
    --accent-light: #FFE680;
    --bg-primary: #FFF5F5;
    --bg-secondary: #F0FFF4;
    --text-primary: #2D3436;
    --text-secondary: #636E72;
    --text-muted: #B2BEC3;
    --border: #E8E8E8;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;
    --danger: #E74C3C;
    --success: #27AE60;
    --font: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 重置 */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    color: var(--text-primary);
    background: var(--bg-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* APP容器 */
.app-container {
    max-width: 450px;
    margin: 0 auto;
    min-height: 100vh;
    background: #fff;
    position: relative;
    box-shadow: 0 0 40px rgba(0,0,0,0.05);
}

/* 导航栏 */
.header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.95);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    max-width: 450px;
    margin: 0 auto;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    width: 32px;
    height: 32px;
}

.logo-text {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.nav-links {
    display: none;
    gap: 4px;
}

.nav-item {
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s;
}

.nav-item:hover, .nav-item.active {
    background: var(--primary);
    color: #fff;
}

.menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s;
}

/* 主内容区 */
.main-content {
    padding-bottom: 80px;
}

/* Hero区 */
.hero {
    position: relative;
    padding: 40px 20px 60px;
    text-align: center;
    overflow: hidden;
    background: linear-gradient(135deg, #FFF5F5 0%, #F0FFF4 50%, #FFF8E1 100%);
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(255,107,107,0.08) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(78,205,196,0.08) 0%, transparent 50%),
                radial-gradient(circle at 50% 80%, rgba(255,217,61,0.08) 0%, transparent 50%);
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-logo {
    width: 160px;
    height: auto;
    margin: 0 auto 16px;
}

.hero-slogan {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 12px;
    line-height: 1.3;
}

.hero-desc {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 360px;
    margin: 0 auto 24px;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-shapes {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.15;
}

.shape-1 {
    width: 80px;
    height: 80px;
    background: var(--primary);
    top: 10%;
    left: 10%;
    animation: float 6s ease-in-out infinite;
}

.shape-2 {
    width: 60px;
    height: 60px;
    background: var(--secondary);
    top: 60%;
    right: 15%;
    animation: float 8s ease-in-out infinite;
}

.shape-3 {
    width: 40px;
    height: 40px;
    background: var(--accent);
    bottom: 20%;
    left: 20%;
    animation: float 5s ease-in-out infinite;
}

.shape-4 {
    width: 100px;
    height: 100px;
    background: var(--primary-light);
    top: 30%;
    right: 10%;
    animation: float 7s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(10deg); }
}

/* 通用section */
.section {
    padding: 40px 20px;
}

.section-header {
    text-align: center;
    margin-bottom: 32px;
}

.section-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.section-desc {
    font-size: 15px;
    color: var(--text-secondary);
}

.section-actions {
    text-align: center;
    margin-top: 24px;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px;
    font-family: var(--font);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255,107,107,0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,107,107,0.4);
}

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

.btn-secondary {
    background: #fff;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--bg-primary);
}

.btn-small {
    padding: 8px 20px;
    font-size: 14px;
    min-height: 36px;
}

.btn-lg {
    padding: 16px 40px;
    font-size: 18px;
}

/* 特色功能网格 */
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.feature-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px 16px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 28px;
}

.feature-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* 游戏卡片轮播 */
.games-carousel {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 8px 0;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.game-card {
    flex: 0 0 240px;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    scroll-snap-align: start;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.game-thumb {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}

.game-info {
    padding: 16px;
}

.game-info h4 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.game-info p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.game-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.age-tag, .subject-tag {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.age-tag {
    background: var(--bg-secondary);
    color: var(--secondary);
}

.subject-tag {
    background: var(--bg-primary);
    color: var(--primary);
}

/* 成就统计 */
.achievement-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px 16px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-number {
    font-size: 36px;
    font-weight: 800;
    line-height: 1.2;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* 评价 */
.testimonials-grid {
    display: grid;
    gap: 16px;
}

.testimonial-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.testimonial-stars {
    color: var(--accent);
    font-size: 18px;
    margin-bottom: 8px;
}

.testimonial-text {
    font-size: 15px;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.6;
    margin-bottom: 16px;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.author-name {
    font-weight: 700;
    font-size: 15px;
}

.author-role {
    font-size: 13px;
    color: var(--text-muted);
}

/* CTA */
.cta-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    text-align: center;
    color: #fff;
}

.cta-card h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 12px;
}

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

.cta-card .btn-primary {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.cta-card .btn-primary:hover {
    background: var(--bg-primary);
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 450px;
    margin: 0 auto;
    background: #fff;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    transition: all 0.3s;
    padding: 4px 12px;
    border-radius: 12px;
    min-width: 60px;
}

.bottom-nav-item.active {
    color: var(--primary);
}

.bottom-nav-item:hover {
    color: var(--primary);
}

.nav-icon {
    width: 24px;
    height: 24px;
}

/* 页脚 */
.footer {
    background: var(--text-primary);
    color: #fff;
    padding: 40px 20px 100px;
}

.footer-inner {
    max-width: 450px;
    margin: 0 auto;
}

.footer-brand {
    margin-bottom: 24px;
}

.footer-logo {
    height: 32px;
    margin-bottom: 12px;
    filter: brightness(10);
}

.footer-desc {
    font-size: 14px;
    opacity: 0.8;
    line-height: 1.6;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.footer-col h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--accent);
}

.footer-col a {
    display: block;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 14px;
    padding: 4px 0;
    transition: color 0.3s;
}

.footer-col a:hover {
    color: #fff;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-link {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.social-link:hover {
    background: var(--primary);
}

.social-link svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 16px;
    text-align: center;
    font-size: 13px;
    opacity: 0.6;
}

/* 页面Hero */
.page-hero {
    padding: 32px 20px;
    text-align: center;
    background: linear-gradient(135deg, #FFF5F5 0%, #F0FFF4 100%);
}

.page-hero h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.page-hero p {
    font-size: 16px;
    color: var(--text-secondary);
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 16px 0 0;
    -webkit-overflow-scrolling: touch;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid var(--border);
    background: #fff;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
    font-family: var(--font);
}

.filter-btn.active, .filter-btn:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

/* 游戏库完整网格 */
.games-grid-full {
    display: grid;
    gap: 16px;
}

.game-card-full {
    display: flex;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.game-card-full:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.game-card-full .game-thumb {
    width: 120px;
    min-height: 120px;
    flex-shrink: 0;
}

.game-card-full .game-info {
    flex: 1;
    padding: 16px;
}

/* 学习课程 */
.learning-courses {
    display: grid;
    gap: 16px;
}

.course-card {
    display: flex;
    gap: 16px;
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.course-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.course-info {
    flex: 1;
}

.course-info h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.course-info p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.course-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.course-age, .course-lessons {
    font-size: 13px;
    color: var(--text-muted);
}

.course-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.progress-bar {
    height: 8px;
    background: var(--primary);
    border-radius: 4px;
    flex: 1;
    max-width: 200px;
}

.progress-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

/* 家长中心 */
.parent-dashboard {
    display: grid;
    gap: 16px;
}

.dashboard-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.dashboard-card h3 {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.dashboard-stat {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
}

.dashboard-card p {
    font-size: 14px;
    color: var(--text-muted);
}

.dashboard-card .progress-bar {
    height: 10px;
    background: var(--bg-secondary);
    border-radius: 5px;
    overflow: hidden;
    max-width: 100%;
}

.dashboard-card .progress-bar::after {
    content: '';
    display: block;
    height: 100%;
    background: var(--secondary);
    border-radius: 5px;
}

/* 育儿建议 */
.tips-list {
    display: grid;
    gap: 16px;
}

.tip-card {
    display: flex;
    gap: 16px;
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.tip-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.tip-content h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.tip-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* 关于页 */
.about-story {
    display: grid;
    gap: 16px;
}

.about-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.about-card h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--primary);
}

.about-card p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 12px;
}

/* 联系页 */
.contact-section {
    display: grid;
    gap: 24px;
}

.contact-info {
    display: grid;
    gap: 16px;
}

.contact-item {
    display: flex;
    gap: 16px;
    align-items: center;
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.contact-icon {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-item h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 2px;
}

.contact-item p {
    font-size: 14px;
    color: var(--text-secondary);
}

.contact-form {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.contact-form h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
}

/* 表单 */
.form-group {
    margin-bottom: 16px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: var(--font);
    transition: border-color 0.3s;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* 隐私页 */
.privacy-content {
    display: grid;
    gap: 16px;
}

.privacy-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.privacy-card h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--primary);
}

.privacy-card p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* 响应式 */
@media (min-width: 768px) {
    .app-container {
        max-width: 100%;
        box-shadow: none;
    }
    .header-inner {
        max-width: 1200px;
        padding: 12px 40px;
    }
    .nav-links {
        display: flex;
    }
    .menu-toggle {
        display: none;
    }
    .bottom-nav {
        display: none;
    }
    .footer {
        padding: 40px 40px 40px;
    }
    .footer-inner {
        max-width: 1200px;
    }
    .hero {
        padding: 80px 40px 100px;
    }
    .hero-slogan {
        font-size: 36px;
    }
    .section {
        padding: 60px 40px;
    }
    .features-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .games-carousel {
        justify-content: center;
    }
    .achievement-stats {
        grid-template-columns: repeat(4, 1fr);
    }
    .testimonials-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .games-grid-full {
        grid-template-columns: repeat(2, 1fr);
    }
    .parent-dashboard {
        grid-template-columns: repeat(3, 1fr);
    }
    .footer-links {
        grid-template-columns: repeat(3, 1fr);
    }
    .contact-section {
        grid-template-columns: 1fr 1fr;
    }
    .page-hero {
        padding: 60px 40px;
    }
}

@media (min-width: 1200px) {
    .app-container {
        max-width: 100%;
    }
    .features-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .games-grid-full {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 汉堡菜单展开 */
.nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-bottom: 1px solid var(--border);
}

.nav-links.open .nav-item {
    padding: 12px 16px;
    border-radius: 12px;
}

/* 工具类 */
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}