/* PyLearn - CSS 樣式 */

/* 深色模式（預設） */
:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #64748b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --radius: 12px;
    --shadow: 0 4px 20px rgba(0,0,0,0.3);
    --code-bg: #0d1117;
}

/* 淺色模式 */
[data-theme="light"] {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #6b7280;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --code-bg: #f1f5f9;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* 導航列 */
.navbar {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar .container { display: flex; justify-content: space-between; align-items: center; }
.nav-right { display: flex; align-items: center; gap: 10px; }
.logo { font-size: 1.5rem; font-weight: 700; color: #ffffff; text-decoration: none; }
.nav-links { display: flex; gap: 25px; list-style: none; align-items: center; }
.nav-links a { color: var(--text-muted); text-decoration: none; transition: color 0.3s; }
.nav-links a:hover { color: var(--text); }

/* 漢堡選單按鈕 */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 28px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 110;
}
.nav-toggle-bar {
    width: 100%;
    height: 3px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s ease;
}
.nav-toggle.active .nav-toggle-bar:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}
.nav-toggle.active .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}
.nav-toggle.active .nav-toggle-bar:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* 小按鈕 */
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }

/* 主題切換開關 */
.theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    width: 56px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 2px;
    position: relative;
    transition: all 0.3s ease;
}
.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
}
.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    position: absolute;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}
.theme-toggle .icon-moon {
    left: 6px;
    opacity: 0.5;
}
.theme-toggle .icon-sun {
    right: 6px;
    opacity: 0.5;
}
.theme-toggle::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: #ffffff;
    border-radius: 50%;
    left: 3px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
[data-theme="light"] .theme-toggle::after {
    left: calc(100% - 25px);
}
[data-theme="light"] .theme-toggle .icon-sun { opacity: 1; }
[data-theme="light"] .theme-toggle .icon-moon { opacity: 0.3; }
.theme-toggle .icon-sun { opacity: 0.3; }
.theme-toggle .icon-moon { opacity: 1; }

/* 按鈕 */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-2px); }
.btn-secondary { background: var(--bg-hover); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: var(--border); }
.btn-success { background: var(--success); color: white; }
.btn-lg { padding: 14px 32px; font-size: 1.1rem; }
.btn-block { width: 100%; display: block; text-align: center; }

/* 主要內容 */
.main-content { padding: 40px 0; min-height: calc(100vh - 140px); }

/* Hero 區塊 */
.hero {
    text-align: center;
    padding: 80px 0;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg) 100%);
}
.hero h1 { font-size: 3rem; margin-bottom: 20px; }
.hero-subtitle { font-size: 1.3rem; color: var(--text-muted); margin-bottom: 40px; }
.hero-buttons { display: flex; gap: 20px; justify-content: center; }

/* 特色區塊 */
.section-title { font-size: 2rem; text-align: center; margin-bottom: 40px; }
.features { padding: 80px 0; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; }
.feature-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--border);
    transition: transform 0.3s, box-shadow 0.3s;
}
.feature-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.feature-icon { font-size: 3rem; margin-bottom: 20px; }

/* 等級卡片 */
.levels-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }
.level-card {
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    text-align: center;
    transition: all 0.3s;
}
.level-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--primary); }
.level-icon { font-size: 2.5rem; margin-bottom: 10px; }
.level-number { color: var(--primary); font-weight: 600; font-size: 0.9rem; }

/* 課程列表 */
.lessons-list { display: flex; flex-direction: column; gap: 15px; }
.lesson-card {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s;
}
.lesson-card:hover { border-color: var(--primary); background: var(--bg-hover); }
.lesson-number { background: var(--primary); color: white; padding: 8px 14px; border-radius: 8px; font-weight: 600; margin-right: 20px; }
.lesson-content { flex: 1; }
.lesson-content h3 { margin-bottom: 5px; }
.lesson-content p { color: var(--text-muted); font-size: 0.9rem; }
.lesson-arrow { color: var(--primary); font-size: 1.5rem; }

/* 難度選擇 */
.difficulty-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 15px; }
.difficulty-card {
    background: var(--bg-card);
    padding: 25px 15px;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    text-decoration: none;
    color: var(--text);
    text-align: center;
    transition: all 0.3s;
}
.difficulty-card:hover { transform: scale(1.05); border-color: var(--primary); }
.difficulty-level { font-weight: 700; font-size: 1.1rem; margin-bottom: 8px; }
.difficulty-stars { font-size: 0.6rem; letter-spacing: -2px; }
.difficulty-desc { font-size: 0.8rem; color: var(--text-muted); margin-top: 8px; }

/* 測驗頁面 */
.exam-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; padding: 20px; background: var(--bg-card); border-radius: var(--radius); }
.exam-timer { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.question-card { background: var(--bg-card); padding: 30px; border-radius: var(--radius); margin-bottom: 20px; }
.question-header { display: flex; justify-content: space-between; margin-bottom: 20px; }
.question-number { color: var(--primary); font-weight: 600; }
.question-type { background: var(--bg-hover); padding: 4px 12px; border-radius: 20px; font-size: 0.85rem; }
.question-text { font-size: 1.2rem; margin-bottom: 25px; line-height: 1.8; }
.options { display: flex; flex-direction: column; gap: 12px; }
.option-label { display: flex; align-items: center; padding: 15px; background: var(--bg-hover); border-radius: 8px; cursor: pointer; transition: all 0.2s; }
.option-label:hover { background: var(--border); }
.option-label input { margin-right: 15px; width: 20px; height: 20px; }
.answer-input input { width: 100%; padding: 15px; background: var(--bg-hover); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 1rem; }
.exam-nav { display: flex; gap: 15px; justify-content: center; margin-top: 30px; }

/* Modal */
.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.8); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-content { background: var(--bg-card); padding: 40px; border-radius: var(--radius); text-align: center; max-width: 800px; width: 90%; max-height: 80vh; overflow-y: auto; }
.result-score { font-size: 4rem; color: var(--primary); font-weight: 700; margin: 20px 0; }
.result-actions { display: flex; gap: 15px; justify-content: center; margin-top: 30px; }
.details-list { text-align: left; margin-top: 30px; }
.detail-item { padding: 20px; margin-bottom: 20px; border-radius: 8px; background: var(--bg-hover); border: 1px solid var(--border); }
.detail-item.correct { border-left: 4px solid var(--success); }
.detail-item.wrong { border-left: 4px solid var(--danger); }
.explanation { color: var(--text-muted); margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--border); }
.explanation strong { color: var(--primary); display: block; margin-bottom: 5px; }

/* 認證頁面 */
.auth-container { display: flex; justify-content: center; align-items: center; min-height: 60vh; }
.auth-card { background: var(--bg-card); padding: 40px; border-radius: var(--radius); width: 100%; max-width: 400px; }
.auth-card h2 { text-align: center; margin-bottom: 30px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; color: var(--text-muted); }
.form-group input { width: 100%; padding: 12px; background: var(--bg-hover); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 1rem; }
.form-group input:focus { outline: none; border-color: var(--primary); }
.auth-link { text-align: center; margin-top: 20px; color: var(--text-muted); }
.auth-link a { color: var(--primary); }

/* 個人資料 */
.profile-header { text-align: center; margin-bottom: 40px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 40px; }
.stat-card { background: var(--bg-card); padding: 25px; border-radius: var(--radius); text-align: center; }
.stat-value { font-size: 2.5rem; font-weight: 700; color: var(--primary); }
.stat-label { color: var(--text-muted); margin-top: 8px; }

/* 表格 */
.data-table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.data-table th, .data-table td { padding: 15px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { background: var(--bg-hover); color: var(--text-muted); }
.score.pass { color: var(--success); font-weight: 700; }
.score.fail { color: var(--danger); font-weight: 700; }

/* Flash 訊息 */
.flash-messages { max-width: 800px; margin: 0 auto 20px; }
.flash { padding: 15px 20px; border-radius: 8px; margin-bottom: 10px; }
.flash-success { background: rgba(34, 197, 94, 0.2); color: var(--success); }
.flash-error { background: rgba(239, 68, 68, 0.2); color: var(--danger); }
.flash-info { background: rgba(59, 130, 246, 0.2); color: var(--primary); }
.flash-warning { background: rgba(245, 158, 11, 0.2); color: var(--warning); }

/* 其他 */
.page-header { margin-bottom: 40px; }
.page-header h1 { margin-bottom: 10px; }
.page-header p { color: var(--text-muted); }
.back-link { color: var(--text-muted); text-decoration: none; display: inline-block; margin-bottom: 15px; }
.back-link:hover { color: var(--text); }
.section { margin: 40px 0; }
.empty-message { color: var(--text-muted); padding: 40px; text-align: center; }
.badge { padding: 4px 10px; border-radius: 20px; font-size: 0.8rem; background: var(--bg-hover); }
.cta { text-align: center; padding: 60px 0; background: var(--bg-card); margin-top: 60px; }
.footer { padding: 30px 0; text-align: center; color: var(--text-muted); border-top: 1px solid var(--border); }

/* ==================== 載入動畫 ==================== */
/* 全頁 Loading 遮罩 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 旋轉載入圈 */
.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--bg-hover);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 20px;
    color: var(--text);
    font-size: 1.1rem;
    animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* 按鈕 loading 狀態 */
.btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}
.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* 進度條動畫 */
.progress-bar-animated .progress-fill {
    animation: progress-stripes 1s linear infinite;
    background-image: linear-gradient(
        45deg,
        rgba(255,255,255,0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255,255,255,0.15) 50%,
        rgba(255,255,255,0.15) 75%,
        transparent 75%,
        transparent
    );
    background-size: 1rem 1rem;
}
@keyframes progress-stripes {
    0% { background-position: 1rem 0; }
    100% { background-position: 0 0; }
}

/* 骨架載入效果 */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-card) 25%,
        var(--bg-hover) 50%,
        var(--bg-card) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 淡入動畫 */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 成功動畫 */
.success-checkmark {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.success-checkmark::after {
    content: '✓';
    font-size: 2.5rem;
    color: white;
}
@keyframes scaleIn {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}
.level-actions { margin-top: 30px; text-align: center; }
.lesson-article { background: var(--bg-card); padding: 40px; border-radius: var(--radius); }
.lesson-nav { display: flex; justify-content: space-between; margin-top: 30px; }
.levels-timeline { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; }
.level-item { display: flex; align-items: center; gap: 15px; }
.level-badge { background: var(--primary); color: white; padding: 10px 16px; border-radius: 50%; font-weight: 700; }

/* 圖表區塊 */
.charts-section { margin-top: 40px; }
.charts-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); 
    gap: 25px; 
    margin-top: 20px;
}
.chart-card { 
    background: var(--bg-card); 
    padding: 25px; 
    border-radius: var(--radius); 
    border: 1px solid var(--border);
}
.chart-card h3 { 
    margin-bottom: 20px; 
    font-size: 1.1rem; 
    color: var(--text-muted);
    text-align: center;
}
.chart-container { 
    position: relative; 
    height: 250px; 
}

/* 結果頁面 */
.result-page { max-width: 800px; margin: 0 auto; }
.result-header { text-align: center; margin-bottom: 30px; }
.result-header h1 { margin-bottom: 15px; }
.result-meta { display: flex; justify-content: center; gap: 15px; align-items: center; }
.result-date { color: var(--text-muted); }

.result-summary { 
    background: var(--bg-card); 
    padding: 40px; 
    border-radius: var(--radius); 
    text-align: center;
    margin-bottom: 30px;
}
.result-score-display { margin-bottom: 25px; }
.score-number { font-size: 5rem; font-weight: 800; }
.score-number.pass { color: var(--success); }
.score-number.fail { color: var(--danger); }
.score-label { font-size: 2rem; color: var(--text-muted); margin-left: 5px; }

.result-stats { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; }
.stat-item { display: flex; align-items: center; gap: 10px; color: var(--text-muted); }
.stat-icon { font-size: 1.2rem; }

.result-details-section { margin-top: 40px; }
.result-details-section h2 { margin-bottom: 20px; }

.detail-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.detail-number { font-weight: 600; color: var(--primary); }
.status-correct { color: var(--success); font-weight: 600; }
.status-wrong { color: var(--danger); font-weight: 600; }
.detail-question { font-size: 1.1rem; margin-bottom: 15px; line-height: 1.7; }
.detail-answers { background: rgba(0,0,0,0.2); padding: 15px; border-radius: 8px; }
.detail-answers p { margin-bottom: 8px; }
.detail-answers p:last-child { margin-bottom: 0; }

.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }

.result-page .result-actions { text-align: center; margin-top: 40px; }

/* 連結按鈕樣式 */
.btn-link { 
    color: var(--primary); 
    text-decoration: none; 
    font-weight: 500;
    transition: color 0.3s;
}
.btn-link:hover { color: var(--primary-dark); text-decoration: underline; }

/* ==================== 響應式設計 ==================== */

/* 大平板 (1024px 以下) */
@media (max-width: 1024px) {
    .container { padding: 0 15px; }
    .charts-grid { grid-template-columns: 1fr; }
    .difficulty-grid { grid-template-columns: repeat(3, 1fr); }
}

/* 平板 (768px 以下) */
@media (max-width: 768px) {
    /* 導航列 - 漢堡選單 */
    .nav-toggle { display: flex; }
    .navbar .container { 
        flex-wrap: wrap;
        position: relative;
    }
    .nav-links { 
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 15px;
        padding: 15px 0;
        border-top: 1px solid var(--border);
        gap: 0;
    }
    .nav-links.active { display: flex; }
    .nav-links li { width: 100%; }
    .nav-links a {
        display: block;
        padding: 12px 0;
        font-size: 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    .nav-links li:last-child a { border-bottom: none; }
    .nav-links .btn { 
        margin-top: 10px;
        text-align: center;
    }
    .logo { font-size: 1.3rem; }
    
    /* Hero 區塊 */
    .hero { padding: 50px 0; }
    .hero h1 { font-size: 2rem; }
    .hero-subtitle { font-size: 1.1rem; }
    .hero-buttons { flex-direction: column; gap: 15px; }
    .hero-buttons .btn { width: 100%; }
    
    /* 網格調整 */
    .difficulty-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stats-grid { grid-template-columns: 1fr; }
    .levels-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .feature-grid { grid-template-columns: 1fr; }
    
    /* 測驗頁面 */
    .exam-header { 
        flex-direction: column; 
        gap: 15px; 
        text-align: center;
    }
    .question-card { padding: 20px; }
    .question-text { font-size: 1.1rem; }
    
    /* 結果頁面 */
    .result-stats { flex-direction: column; gap: 15px; }
    .score-number { font-size: 3.5rem; }
    .result-summary { padding: 25px; }
    
    /* 表格響應式 */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .data-table { min-width: 500px; }
    .data-table th, .data-table td { 
        padding: 12px 10px; 
        font-size: 0.9rem;
    }
    
    /* 課程頁面 */
    .lesson-card { 
        flex-direction: column; 
        text-align: center;
        gap: 15px;
    }
    .lesson-number { margin-right: 0; }
    .lesson-arrow { display: none; }
    
    /* Modal */
    .modal-content { padding: 25px; }
    
    /* 認證頁面 */
    .auth-card { padding: 25px; margin: 0 10px; }
    
    /* 按鈕 */
    .btn { padding: 10px 18px; font-size: 0.95rem; }
    .btn-lg { padding: 12px 24px; font-size: 1rem; }
    
    /* 頁面間距 */
    .main-content { padding: 25px 0; }
    .section { margin: 25px 0; }
    .page-header { margin-bottom: 25px; }
}

/* 手機 (480px 以下) */
@media (max-width: 480px) {
    /* 導航列簡化 */
    .nav-links { 
        gap: 8px;
        font-size: 0.8rem;
    }
    .nav-links li { flex: 1 1 auto; text-align: center; }
    .nav-links .btn-primary { 
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    /* 更小的標題 */
    .hero h1 { font-size: 1.6rem; }
    .section-title { font-size: 1.5rem; }
    .page-header h1 { font-size: 1.4rem; }
    
    /* 網格單欄 */
    .difficulty-grid { grid-template-columns: 1fr; }
    .levels-grid { grid-template-columns: 1fr; }
    
    /* 卡片調整 */
    .level-card { padding: 20px; }
    .difficulty-card { padding: 20px 10px; }
    .feature-card { padding: 25px 20px; }
    .stat-card { padding: 20px; }
    .stat-value { font-size: 2rem; }
    
    /* 結果頁面 */
    .score-number { font-size: 2.8rem; }
    .score-label { font-size: 1.5rem; }
    
    /* 測驗題目 */
    .option-label { padding: 12px; }
    .option-label input { margin-right: 10px; }
    
    /* 底部操作 */
    .level-actions-row {
        flex-direction: column;
        gap: 10px;
    }
    .level-actions-row .btn {
        width: 100%;
        text-align: center;
    }
    
    /* 課程導航 */
    .lesson-nav {
        flex-direction: column;
        gap: 10px;
    }
    .lesson-nav .btn {
        width: 100%;
        text-align: center;
    }
    
    /* 圖表 */
    .chart-container { height: 200px; }
    .chart-card { padding: 15px; }
    .chart-card h3 { font-size: 1rem; }
}

/* 小手機 (360px 以下) */
@media (max-width: 360px) {
    .container { padding: 0 10px; }
    .hero h1 { font-size: 1.4rem; }
    .btn { padding: 8px 14px; font-size: 0.9rem; }
    .score-number { font-size: 2.2rem; }
}
