/* 🦞 小龙虾学习系统 — 儿童友好样式 */
:root {
    --primary: #FF6B35;
    --secondary: #FFB347;
    --accent: #4ECDC4;
    --bg: #FFF8F0;
    --card-bg: #FFFFFF;
    --text: #2D3436;
    --text-light: #636E72;
    --success: #00B894;
    --danger: #E17055;
    --warning: #FDCB6E;
    --radius: 20px;
    --shadow: 0 4px 15px rgba(0,0,0,0.08);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    padding-bottom: 80px;
}

/* ─── 顶部栏 ─── */
.top-bar {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 20px;
    text-align: center;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow);
}

.top-bar h1 { font-size: 28px; margin-bottom: 4px; }
.top-bar .subtitle { font-size: 14px; opacity: 0.9; }

/* ─── 段位卡片 ─── */
.rank-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    margin: 16px;
    box-shadow: var(--shadow);
    text-align: center;
}

.rank-emoji { font-size: 64px; display: block; margin-bottom: 8px; }
.rank-name { font-size: 24px; font-weight: bold; color: var(--primary); }
.rank-stars { font-size: 16px; color: var(--text-light); margin: 4px 0 12px; }

.progress-bar {
    background: #F0F0F0;
    border-radius: 20px;
    height: 20px;
    overflow: hidden;
    margin: 8px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    border-radius: 20px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    font-weight: bold;
    min-width: 30px;
}

.next-rank {
    font-size: 14px;
    color: var(--text-light);
}

/* ─── 今日概览 ─── */
.today-stats {
    display: flex;
    justify-content: space-around;
    background: var(--card-bg);
    margin: 0 16px 16px;
    padding: 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.today-stat {
    text-align: center;
}

.today-stat .num {
    font-size: 28px;
    font-weight: bold;
    color: var(--primary);
}

.today-stat .label {
    font-size: 12px;
    color: var(--text-light);
}

/* ─── 科目网格 ─── */
.section-title {
    font-size: 18px;
    font-weight: bold;
    margin: 20px 16px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.subject-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 16px;
}

.subject-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px 16px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
    text-align: center;
    transition: transform 0.15s;
}

.subject-card:active { transform: scale(0.96); }

.subject-icon { font-size: 48px; display: block; margin-bottom: 8px; }
.subject-name { font-size: 18px; font-weight: bold; }
.subject-stars { font-size: 13px; color: var(--text-light); margin-top: 4px; }

/* ─── 最新动态 ─── */
.recent-list {
    margin: 0 16px;
}

.recent-item {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 8px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.recent-item .emoji { font-size: 24px; }
.recent-item .info { flex: 1; }
.recent-item .info .module { font-weight: bold; }
.recent-item .info .time { font-size: 12px; color: var(--text-light); }
.recent-item .stars-badge {
    background: var(--warning);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: bold;
}

/* ─── 学习曲线 ─── */
.chart-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    margin: 0 16px 16px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.chart-container canvas {
    width: 100% !important;
    height: 200px !important;
}

/* ─── 模块列表（科目页面） ─── */
.module-list {
    margin: 0 16px;
}

.module-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
    display: block;
}

.module-card:active { transform: scale(0.98); }

.module-card h3 { font-size: 18px; margin-bottom: 4px; }
.module-card .desc { font-size: 13px; color: var(--text-light); margin-bottom: 8px; }
.module-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-light);
}

.difficulty {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    background: #f0f0f0;
}

/* ─── 游戏页面 ─── */
.game-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

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

.game-header h2 { font-size: 22px; display: flex; align-items: center; gap: 8px; justify-content: center; }

.game-area {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow);
    text-align: center;
    margin-bottom: 16px;
}

/* ─── 按钮 ─── */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border: none;
    border-radius: 14px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.1s;
    text-decoration: none;
}

.btn:active { transform: scale(0.95); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

/* ─── 反馈 ─── */
.feedback {
    padding: 16px;
    border-radius: 14px;
    margin-top: 16px;
    font-size: 16px;
    font-weight: bold;
    display: none;
}

.feedback.correct {
    display: block;
    background: #E8F8F5;
    color: var(--success);
}

.feedback.wrong {
    display: block;
    background: #FFF5F5;
    color: var(--danger);
}

/* ─── 通用 ─── */
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
