/* IO信息学 C++课件 - Style A: 活泼卡通风（动态背景+响应式） */
:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #10b981;
    --accent: #f59e0b;
    --accent2: #ec4899;
    --bg: #f0f4ff;
    --white: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --code-bg: #1e293b;
    --code-text: #e2e8f0;
    --correct: #10b981;
    --wrong: #ef4444;
    --radius: 20px;
    --radius-sm: 12px;
    --shadow: 0 4px 24px rgba(99,102,241,0.12);
    --shadow-lg: 0 8px 40px rgba(99,102,241,0.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== 动态背景 ===== */
body {
    font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* 背景装饰层 */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(circle at 10% 20%, rgba(99,102,241,0.06) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(236,72,153,0.05) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(16,185,129,0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* 飘动的云朵 */
.cloud {
    position: fixed;
    background: rgba(255,255,255,0.6);
    border-radius: 50%;
    filter: blur(1px);
    pointer-events: none;
    z-index: 0;
    animation: float-cloud linear infinite;
}
.cloud::before, .cloud::after {
    content: '';
    position: absolute;
    background: inherit;
    border-radius: 50%;
}
.cloud-1 { width: 80px; height: 32px; top: 8%; left: -100px; animation-duration: 45s; }
.cloud-1::before { width: 40px; height: 40px; top: -20px; left: 12px; }
.cloud-1::after { width: 50px; height: 50px; top: -25px; left: 30px; }
.cloud-2 { width: 100px; height: 40px; top: 25%; left: -120px; animation-duration: 60s; animation-delay: -20s; }
.cloud-2::before { width: 50px; height: 50px; top: -25px; left: 15px; }
.cloud-2::after { width: 60px; height: 60px; top: -30px; left: 40px; }
.cloud-3 { width: 70px; height: 28px; top: 45%; left: -90px; animation-duration: 55s; animation-delay: -35s; }
.cloud-3::before { width: 35px; height: 35px; top: -18px; left: 10px; }
.cloud-3::after { width: 45px; height: 45px; top: -22px; left: 25px; }
.cloud-4 { width: 90px; height: 36px; top: 70%; left: -110px; animation-duration: 70s; animation-delay: -10s; }
.cloud-4::before { width: 45px; height: 45px; top: -22px; left: 12px; }
.cloud-4::after { width: 55px; height: 55px; top: -28px; left: 35px; }

@keyframes float-cloud {
    from { transform: translateX(0); }
    to { transform: translateX(calc(100vw + 200px)); }
}

/* 浮动几何装饰 */
.deco {
    position: fixed;
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}
.deco-circle {
    border-radius: 50%;
    animation: float-deco 8s ease-in-out infinite;
}
.deco-ring {
    border-radius: 50%;
    border: 3px solid;
    animation: float-deco 10s ease-in-out infinite reverse;
}
.deco-cross {
    width: 20px; height: 20px;
    position: relative;
    animation: spin-slow 20s linear infinite;
}
.deco-cross::before, .deco-cross::after {
    content: '';
    position: absolute;
    background: currentColor;
    border-radius: 2px;
}
.deco-cross::before { width: 100%; height: 4px; top: 8px; }
.deco-cross::after { width: 4px; height: 100%; left: 8px; }

@keyframes float-deco {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(10deg); }
}
@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 背景网格线条 */
.bg-grid {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
        linear-gradient(rgba(99,102,241,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99,102,241,0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

/* 波浪装饰 */
.wave-decoration {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.3;
}

/* ===== 顶部导航 - 磨砂玻璃 ===== */
.top-nav {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 2px solid rgba(99,102,241,0.15);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(99,102,241,0.08);
}
.top-nav .logo {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 2px 8px rgba(99,102,241,0.15);
}
.top-nav .logo span { color: var(--accent2); }
.top-nav .logo::before {
    content: '🚀';
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}
.nav-links { display: flex; gap: 10px; flex-wrap: wrap; }
.nav-links a {
    color: var(--text-light);
    font-size: 14px;
    font-weight: 700;
    padding: 8px 20px;
    border-radius: 50px;
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(99,102,241,0.04));
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.3px;
}
.nav-links a:hover {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--white);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99,102,241,0.35);
}
/* ===== 移动端汉堡菜单 ===== */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(236,72,153,0.08));
    border: 2px solid rgba(99,102,241,0.2);
    border-radius: 12px;
    cursor: pointer;
    padding: 0;
    position: relative;
    z-index: 200;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(99,102,241,0.1);
}
.mobile-menu-btn:hover {
    background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(236,72,153,0.15));
    border-color: var(--primary);
    transform: scale(1.05);
}
.mobile-menu-btn svg {
    width: 22px;
    height: 22px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.mobile-menu-btn .icon-close { opacity: 0; pointer-events: none; }
.mobile-menu-btn.active .icon-burger { opacity: 0; pointer-events: none; transform: translate(-50%, -50%) rotate(90deg); }
.mobile-menu-btn.active .icon-close { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) rotate(0deg); }
.mobile-menu-btn svg line {
    stroke: var(--primary);
    stroke-width: 2.5;
    stroke-linecap: round;
}


/* ===== 整体布局 - 铺满全屏 ===== */
.layout {
    display: flex;
    min-height: calc(100vh - 70px);
    position: relative;
    z-index: 1;
}

/* ===== 侧边栏 ===== */
.sidebar {
    width: 270px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 2px solid rgba(99,102,241,0.12);
    padding: 20px 0;
    flex-shrink: 0;
    overflow-y: auto;
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
    box-shadow: 4px 0 24px rgba(99,102,241,0.06);
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.2); border-radius: 4px; }

.sidebar-title {
    font-size: 11px;
    color: var(--primary);
    padding: 8px 20px 14px;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    border-bottom: 2px solid rgba(99,102,241,0.1);
    margin-bottom: 4px;
}
.chapter-group { margin-bottom: 2px; }
.chapter-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    border-left: 4px solid transparent;
    transition: all 0.2s;
}
.chapter-title:hover {
    background: linear-gradient(90deg, rgba(99,102,241,0.08), transparent);
    border-left-color: var(--primary);
    color: var(--primary);
}
.chapter-title .ch-num {
    background: linear-gradient(135deg, var(--primary), var(--accent2));
    color: var(--white);
    width: 26px; height: 26px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}
.lesson-list { display: none; }
.chapter-group.open .lesson-list { display: block; }
.lesson-link {
    display: block;
    padding: 7px 16px 7px 50px;
    font-size: 13px;
    color: var(--text-light);
    border-left: 4px solid transparent;
    transition: all 0.15s;
    font-weight: 500;
}
.lesson-link:hover {
    background: linear-gradient(90deg, rgba(16,185,129,0.08), transparent);
    color: var(--secondary);
    border-left-color: var(--secondary);
}
.lesson-link.active {
    background: linear-gradient(90deg, rgba(16,185,129,0.12), transparent);
    color: var(--secondary);
    border-left-color: var(--secondary);
    font-weight: 700;
}

/* ===== 主内容区 ===== */
.main {
    flex: 1;
    padding: 32px 40px;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

/* 章节首页 */
.chapter-header {
    background: linear-gradient(135deg, #6366f1 0%, #ec4899 50%, #f59e0b 100%);
    color: var(--white);
    padding: 40px 48px;
    border-radius: var(--radius);
    margin-bottom: 28px;
    box-shadow: var(--shadow-lg);
    border: 3px solid rgba(255,255,255,0.2);
    position: relative;
    overflow: hidden;
}
.chapter-header::before {
    content: '';
    position: absolute;
    top: -50px; right: -50px;
    width: 200px; height: 200px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}
.chapter-header::after {
    content: '';
    position: absolute;
    bottom: -30px; left: 30px;
    width: 100px; height: 100px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.chapter-header h1 { font-size: 30px; margin-bottom: 10px; position: relative; z-index: 1; font-weight: 800; }
.chapter-header p { opacity: 0.9; font-size: 15px; position: relative; z-index: 1; }

.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
    margin-top: 20px;
}
.home-chapter-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px 20px;
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
    display: block;
    position: relative;
    overflow: hidden;
}

/* 章节页课程卡片 */
.lesson-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
    display: block;
    position: relative;
    overflow: hidden;
}
.lesson-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}
.lesson-card .lesson-num {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent2));
    color: var(--white);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 800;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.lesson-card h3 { font-size: 15px; margin: 0; font-weight: 700; color: var(--text); }
.lesson-card .lesson-desc {
    font-size: 12px;
    color: var(--text-light);
    margin: 6px 0 0 0;
    line-height: 1.5;
    min-height: 36px;
}
.lesson-card .lesson-num {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent2));
    color: var(--white);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 800;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

.home-chapter-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}
.home-chapter-card .ch-num {
    width: 50px; height: 50px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--accent2));
    color: var(--white);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 800;
    margin-bottom: 14px;
    box-shadow: 0 4px 16px rgba(99,102,241,0.35);
}
.home-chapter-card h3 { font-size: 17px; margin-bottom: 6px; font-weight: 700; color: var(--text); }
.home-chapter-card p { font-size: 13px; color: var(--text-light); line-height: 1.5; }
.home-chapter-card .lesson-count {
    display: inline-block;
    margin-top: 12px;
    font-size: 12px;
    padding: 4px 14px;
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(236,72,153,0.1));
    color: var(--primary);
    border-radius: 50px;
    font-weight: 700;
    border: 1px solid rgba(99,102,241,0.2);
}

/* 课程页 */
.lesson-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 3px solid var(--border);
}
.lesson-header .breadcrumb {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 8px;
    font-weight: 600;
}
.lesson-header .breadcrumb a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.lesson-header .breadcrumb a:hover { color: var(--primary-light); }
.lesson-header h1 { font-size: 26px; color: var(--text); font-weight: 800; }

.section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
}
.section h2 {
    font-size: 18px;
    color: var(--primary);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
    display: flex; align-items: center; gap: 10px;
    font-weight: 800;
}
.section h2 .icon { font-size: 22px; }
.section h3 { font-size: 16px; color: var(--text); margin: 18px 0 10px; font-weight: 700; }
.section p { margin-bottom: 12px; font-size: 15px; }
.section ul, .section ol { padding-left: 22px; margin-bottom: 12px; }
.section li { margin-bottom: 6px; font-size: 15px; }

/* 代码块 */
.code-block {
    background: var(--code-bg);
    color: var(--code-text);
    border-radius: var(--radius);
    padding: 18px 22px;
    margin: 14px 0;
    font-family: "Cascadia Code", "Fira Code", "Consolas", monospace;
    font-size: 14px;
    line-height: 1.7;
    overflow-x: auto;
    position: relative;
    border: 2px solid rgba(99,102,241,0.2);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.2);
}
.code-block .label {
    position: absolute; top: 0; right: 0;
    background: linear-gradient(135deg, var(--primary), var(--accent2));
    color: var(--white);
    font-size: 11px; padding: 4px 14px;
    border-radius: 0 var(--radius) 0 var(--radius);
    font-weight: 800;
}
.code-keyword { color: #93c5fd; }
.code-string { color: #86efac; }
.code-comment { color: #94a3b8; font-style: italic; }
.code-number { color: #fca5a5; }
.code-output { color: #fde68a; }

/* 提示框 */
.tip-box {
    background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(236,72,153,0.04));
    border-left: 5px solid var(--primary);
    padding: 14px 18px;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 14px 0;
    font-size: 14px;
}
.tip-box.warning { border-left-color: var(--accent); background: linear-gradient(135deg, rgba(245,158,11,0.06), rgba(239,68,68,0.04)); }
.tip-box.success { border-left-color: var(--secondary); background: linear-gradient(135deg, rgba(16,185,129,0.06), rgba(6,182,212,0.04)); }

/* 选择题 */
.quiz-item { margin-bottom: 22px; padding-bottom: 22px; border-bottom: 2px solid var(--border); }
.quiz-item:last-child { border-bottom: none; }
.quiz-q { font-size: 15px; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.quiz-options { display: flex; flex-direction: column; gap: 8px; }
.quiz-opt {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
    background: var(--white);
}
.quiz-opt:hover { border-color: var(--primary); background: rgba(99,102,241,0.04); transform: translateX(6px); }
.quiz-opt.selected { border-color: var(--primary); background: rgba(99,102,241,0.08); }
.quiz-opt.correct { border-color: var(--correct); background: rgba(16,185,129,0.08); }
.quiz-opt.wrong { border-color: var(--wrong); background: rgba(239,68,68,0.06); }
.quiz-opt .opt-letter {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--border);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
    flex-shrink: 0; transition: all 0.2s;
}
.quiz-opt.correct .opt-letter { background: var(--correct); color: var(--white); }
.quiz-opt.wrong .opt-letter { background: var(--wrong); color: var(--white); }
.quiz-feedback { margin-top: 10px; font-size: 14px; font-weight: 700; display: none; }
.quiz-feedback.show { display: block; }
.quiz-feedback.correct { color: var(--correct); }
.quiz-feedback.wrong { color: var(--wrong); }
.quiz-check-btn {
    margin-top: 12px;
    padding: 8px 22px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--white);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}
.quiz-check-btn:hover { transform: scale(1.05); box-shadow: 0 6px 24px rgba(99,102,241,0.45); }
.quiz-check-btn:disabled { background: var(--border); cursor: not-allowed; transform: none; box-shadow: none; }

/* 编程题 */
.prog-problem {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 18px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.prog-problem-header {
    background: linear-gradient(135deg, var(--secondary), #059669);
    color: var(--white);
    padding: 12px 20px;
    font-weight: 700;
    font-size: 15px;
    display: flex; align-items: center; gap: 10px;
}
.prog-problem-body { padding: 18px; }
.prog-problem-body h4 { font-size: 14px; color: var(--primary); margin: 14px 0 8px; font-weight: 700; }
.prog-problem-body h4:first-child { margin-top: 0; }
.io-sample {
    background: #f8fafc;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-family: "Consolas", monospace;
    font-size: 14px;
    margin: 8px 0;
    border: 1px solid var(--border);
}
.io-sample .io-label { font-weight: 700; color: var(--primary); margin-right: 6px; }

/* 导航按钮 */
.lesson-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 3px solid var(--border);
}
.nav-btn {
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s;
    text-decoration: none;
}
.nav-btn.prev {
    background: var(--white);
    border: 2px solid var(--border);
    color: var(--text);
}
.nav-btn.prev:hover { border-color: var(--primary); color: var(--primary); transform: translateX(-4px); }
.nav-btn.next {
    background: linear-gradient(135deg, var(--primary), var(--accent2));
    border: 2px solid var(--primary);
    color: var(--white);
    box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}
.nav-btn.next:hover { transform: translateX(4px); box-shadow: 0 6px 24px rgba(99,102,241,0.5); }
.nav-btn.disabled { opacity: 0.4; pointer-events: none; }

/* GESP考点高亮 */
.gesp-highlight {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 22px 28px;
    margin-top: 24px;
    box-shadow: 0 4px 20px rgba(245,158,11,0.2);
}
.gesp-highlight h2 {
    color: #92400e;
    border-bottom-color: rgba(245,158,11,0.3);
    font-size: 18px;
}
.gesp-highlight ul { padding-left: 24px; margin: 0; }
.gesp-highlight li { margin-bottom: 6px; font-size: 14px; color: #92400e; }

/* ===== 响应式 ===== */
@media (max-width: 1200px) {
    .sidebar { width: 240px; }
    .main { padding: 24px 32px; }
}
@media (max-width: 900px) {
    .sidebar { width: 200px; }
    .main { padding: 20px 24px; }
    .home-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
@media (max-width: 768px) {
    .mobile-menu-btn { display: flex; }
    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: rgba(255,255,255,0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 20px;
        gap: 12px;
        box-shadow: 0 8px 32px rgba(99,102,241,0.15);
        transform: translateY(-120%);
        transition: transform 0.3s ease;
        z-index: 99;
    }
    .nav-links.active {
        transform: translateY(0);
    }
    .nav-links a {
        text-align: center;
        padding: 12px 20px;
        background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(99,102,241,0.04));
        border-radius: 12px;
    }
    .sidebar { display: none; }
    .main { padding: 16px 20px; }
    .chapter-header { padding: 24px; }
    .chapter-header h1 { font-size: 22px; }
    .home-grid { grid-template-columns: 1fr; }
    .section { padding: 20px; }
}
@media (max-width: 480px) {
    .top-nav { padding: 0 16px; height: 56px; }
    .top-nav .logo { font-size: 18px; }
    .main { padding: 12px; }
    .chapter-header { padding: 18px; border-radius: 14px; }
    .chapter-header h1 { font-size: 18px; }
    .section { padding: 16px; border-radius: 14px; }
}

/* 打印 */
@media print {
    .top-nav, .sidebar, .lesson-nav, .quiz-check-btn, .cloud, .deco, .bg-grid, .wave-decoration {
        display: none !important;
    }
    .main { max-width: 100%; padding: 0; }
    .section { box-shadow: none; border: 1px solid #ddd; }
}

/* 各章节课程卡片主题色 */
@supports (color: var(--chapter-color, initial)) {
    .lesson-card .lesson-num {
        background: linear-gradient(135deg, var(--chapter-color, var(--primary)), var(--accent2));
        box-shadow: 0 4px 12px color-mix(in srgb, var(--chapter-color, var(--primary)) 30%, transparent);
    }
    .lesson-card:hover {
        border-color: var(--chapter-color, var(--primary));
    }
}



/* ===== 正确率悬浮球 ===== */
.quiz-ball {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 2px solid rgba(99,102,241,0.18);
    box-shadow: 0 6px 24px rgba(99,102,241,0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: box-shadow 0.5s ease, transform 0.3s ease;
    cursor: default;
    user-select: none;
}
.quiz-ball:hover { transform: scale(1.08); }
.quiz-ball svg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    transform: rotate(-90deg);
}
.quiz-ball .ring-bg {
    fill: none;
    stroke: rgba(99,102,241,0.10);
    stroke-width: 5;
}
.quiz-ball .ring-fg {
    fill: none;
    stroke: url(#ball-gradient);
    stroke-width: 5;
    stroke-linecap: round;
    stroke-dasharray: 226.19;
    stroke-dashoffset: 226.19;
    transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.quiz-ball .ball-text {
    position: relative;
    z-index: 1;
    text-align: center;
    line-height: 1.2;
}
.quiz-ball .ball-num {
    font-size: 20px;
    font-weight: 800;
    color: #6366f1;
    letter-spacing: -0.5px;
}
.quiz-ball .ball-label {
    font-size: 9px;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 1px;
}
.quiz-ball.glow-good {
    box-shadow: 0 0 24px rgba(16,185,129,0.45), 0 6px 24px rgba(16,185,129,0.15);
}
.quiz-ball.glow-good .ball-num { color: #10b981; }
.quiz-ball.glow-mid {
    box-shadow: 0 0 24px rgba(245,158,11,0.35), 0 6px 24px rgba(245,158,11,0.12);
}
.quiz-ball.glow-mid .ball-num { color: #f59e0b; }
.quiz-ball.glow-bad {
    box-shadow: 0 0 24px rgba(239,68,68,0.35), 0 6px 24px rgba(239,68,68,0.12);
}
.quiz-ball.glow-bad .ball-num { color: #ef4444; }
@keyframes ball-pop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.2); }
    100% { transform: scale(1); }
}
.quiz-ball.pop { animation: ball-pop 0.4s ease; }


.quiz-shuffle-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
    background: rgba(99,102,241,0.06);
    padding: 4px 12px;
    border-radius: 20px;
    margin-left: 12px;
    font-weight: 500;
}
.quiz-shuffle-hint svg { width: 14px; height: 14px; }
.site-footer {
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(99,102,241,0.15);
  padding: 18px 20px;
  text-align: center;
  font-size: 13px;
  color: #6b7280;
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}



/* ===== GESP 官网跳转按钮 ===== */
.gesp-link-wrap {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}
.gesp-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 50px;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.gesp-link-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.gesp-link-btn:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 28px rgba(245, 158, 11, 0.45);
}
.gesp-link-btn .gesp-link-arrow {
    transition: transform 0.25s ease;
}
.gesp-link-btn:hover .gesp-link-arrow {
    transform: translateX(6px);
}
.gesp-link-btn:active {
    transform: translateY(-1px) scale(0.99);
}
