/* ============================================================
   新HSK教程3 · 互动学习 - style.css
   蓝色皇家风格 · 正式优雅字体 · 可爱图标
   Aligned with index.html + app.js
   ============================================================ */

/* ---------- Google Fonts MUST be the very first rule ---------- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700;900&family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;500;700&display=swap');

/* ---------- 全局重置 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ---------- 根变量：皇家蓝 + 金色点缀 ---------- */
:root {
    --royal-blue-deep: #0a1f44;
    --royal-blue: #1a3a6b;
    --royal-blue-light: #2a5298;
    --royal-blue-soft: #3b6fd4;
    --gold: #d4af37;
    --gold-light: #f0d98c;
    --cream: #fdfbf6;
    --cream-warm: #f7f1e4;
    --text-dark: #0f1e38;
    --text-medium: #3a4a68;
    --text-light: #6b7a99;
    --accent-coral: #e07c4c;
    --accent-soft: #ffe1cc;
    --white: #ffffff;
    --shadow-royal: rgba(10, 31, 68, 0.25);
    --shadow-gold: rgba(212, 175, 55, 0.3);
}

/* ---------- 基础样式 ---------- */
html {
    scroll-behavior: smooth;
}

body {
    background:
        radial-gradient(circle at 15% 20%, rgba(59, 111, 212, 0.18) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(212, 175, 55, 0.10) 0%, transparent 50%),
        linear-gradient(160deg, #071733 0%, #0a1f44 35%, #132b54 65%, #1a3a6b 100%);
    background-attachment: fixed;
    font-family: 'Georgia', 'Playfair Display', 'Noto Serif SC', 'Songti SC', serif;
    color: var(--cream);
    padding: 1.5rem 1rem 3rem;
    line-height: 1.7;
    min-height: 100vh;
    letter-spacing: 0.2px;
    -webkit-font-smoothing: antialiased;
}

/* 装饰性背景纹理 */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 60px, rgba(212, 175, 55, 0.02) 60px, rgba(212, 175, 55, 0.02) 61px),
        repeating-linear-gradient(-45deg, transparent, transparent 60px, rgba(212, 175, 55, 0.02) 60px, rgba(212, 175, 55, 0.02) 61px);
    pointer-events: none;
    z-index: 0;
}

.app-container {
    max-width: 1300px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ============================================================
   头部 Header —— 皇家徽章风格
   ============================================================ */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, rgba(10, 31, 68, 0.85) 0%, rgba(26, 58, 107, 0.9) 100%);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 1rem 2rem;
    box-shadow:
        0 12px 30px var(--shadow-royal),
        inset 0 1px 0 rgba(212, 175, 55, 0.25);
    border: 1px solid rgba(212, 175, 55, 0.35);
    position: relative;
    overflow: hidden;
}

.site-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), var(--gold-light), var(--gold), transparent);
    opacity: 0.8;
}

.logo h1 {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 1.95rem;
    font-weight: 700;
    color: var(--gold-light);
    display: flex;
    align-items: center;
    gap: 14px;
    letter-spacing: 1.5px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.logo i {
    font-size: 2.3rem;
    color: var(--gold);
    filter: drop-shadow(0 3px 6px rgba(212, 175, 55, 0.5));
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-5px) rotate(3deg); }
}

.logo h1 span {
    font-size: 0.95rem;
    font-weight: 400;
    color: rgba(240, 217, 140, 0.8);
    font-family: 'Georgia', serif;
    letter-spacing: 2px;
}

/* 课程选择器 */
.lesson-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(253, 251, 246, 0.08);
    padding: 0.55rem 1.4rem;
    border-radius: 40px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.lesson-selector:hover {
    border-color: var(--gold);
    box-shadow:
        inset 0 2px 6px rgba(0, 0, 0, 0.2),
        0 0 15px rgba(212, 175, 55, 0.2);
}

.lesson-selector i {
    color: var(--gold);
    font-size: 1.15rem;
}

.lesson-selector select {
    background: transparent;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.4rem 2rem 0.4rem 0.2rem;
    color: var(--cream);
    outline: none;
    cursor: pointer;
    font-family: 'Georgia', serif;
    letter-spacing: 0.5px;

    /* Custom arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d4af37' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.4rem center;
    background-size: 1em;
}

.lesson-selector select option {
    background: var(--royal-blue-deep);
    color: var(--cream);
    padding: 8px;
}

/* ============================================================
   导航选项卡 —— 宝石按钮
   ============================================================ */
.nav-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 2rem;
    justify-content: center;
}

.tab-btn {
    background: linear-gradient(145deg, rgba(26, 58, 107, 0.7) 0%, rgba(42, 82, 152, 0.6) 100%);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 0.9rem 1.8rem;
    border-radius: 40px;
    font-size: 1rem;
    font-weight: 500;
    color: rgba(240, 217, 140, 0.9);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow:
        0 6px 15px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    cursor: pointer;
    font-family: 'Georgia', serif;
    letter-spacing: 0.8px;
    position: relative;
    overflow: hidden;
}

.tab-btn::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: width 0.35s ease;
}

.tab-btn i {
    font-size: 1.2rem;
    color: var(--gold);
    transition: transform 0.3s ease;
}

.tab-btn:hover {
    background: linear-gradient(145deg, rgba(42, 82, 152, 0.85) 0%, rgba(59, 111, 212, 0.75) 100%);
    transform: translateY(-3px);
    box-shadow:
        0 10px 22px rgba(0, 0, 0, 0.35),
        0 0 20px rgba(212, 175, 55, 0.15);
    color: var(--gold-light);
    border-color: var(--gold);
}

.tab-btn:hover::after { width: 60%; }
.tab-btn:hover i      { transform: scale(1.15) rotate(-5deg); }

.tab-btn.active {
    background: linear-gradient(145deg, var(--royal-blue-light) 0%, var(--royal-blue-soft) 100%);
    color: var(--gold-light);
    border-color: var(--gold);
    box-shadow:
        0 10px 25px rgba(59, 111, 212, 0.45),
        0 0 30px rgba(212, 175, 55, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.tab-btn.active::after { width: 80%; }

.tab-btn.active i {
    color: var(--gold-light);
    animation: pulseIcon 1.5s ease-in-out infinite;
}

@keyframes pulseIcon {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.2); }
}

/* ============================================================
   内容面板 —— 羊皮纸与皇家蓝
   ============================================================ */
.panel {
    display: none;
    background: linear-gradient(150deg, rgba(253, 251, 246, 0.97) 0%, rgba(247, 241, 228, 0.98) 100%);
    backdrop-filter: blur(6px);
    border-radius: 28px;
    padding: 2.2rem 2.2rem 2.8rem;
    box-shadow:
        0 25px 60px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(212, 175, 55, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.2);
    animation: fadeInPanel 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    color: var(--text-dark);
    position: relative;
    overflow: hidden;
}

.panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--royal-blue), var(--gold), var(--royal-blue));
    opacity: 0.7;
}

.panel.active { display: block; }

@keyframes fadeInPanel {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.panel h2 {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--royal-blue);
    margin-bottom: 1.6rem;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 3px dashed rgba(212, 175, 55, 0.5);
    padding-bottom: 0.9rem;
    letter-spacing: 0.5px;
}

.panel h2 i {
    font-size: 2.2rem;
    color: var(--gold);
    filter: drop-shadow(0 2px 4px rgba(212, 175, 55, 0.4));
}

.panel h2::after {
    content: "❖";
    font-size: 1.2rem;
    color: var(--gold);
    margin-left: auto;
    opacity: 0.7;
}

/* ============================================================
   词汇卡片 / 通用网格
   ============================================================ */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.4rem;
    margin-top: 1rem;
}

.word-card {
    background: linear-gradient(145deg, var(--white) 0%, var(--cream-warm) 100%);
    border-radius: 22px;
    padding: 1.3rem 1.5rem;
    box-shadow:
        0 6px 16px rgba(26, 58, 107, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(212, 175, 55, 0.25);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.word-card::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.word-card::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 40px;
    background: radial-gradient(circle at bottom right, rgba(212, 175, 55, 0.12), transparent 70%);
    border-radius: 50% 0 0 0;
    pointer-events: none;
}

.word-card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: var(--gold);
    box-shadow:
        0 16px 32px rgba(26, 58, 107, 0.22),
        0 0 25px rgba(212, 175, 55, 0.15);
}

.word-card .pinyin {
    color: var(--royal-blue-light);
    font-size: 0.92rem;
    font-weight: 500;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 4px;
    font-style: italic;
}

.word-card .chinese {
    font-family: 'Noto Serif SC', 'Songti SC', 'Georgia', serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--royal-blue-deep);
    letter-spacing: 2px;
    text-shadow: 0 1px 2px rgba(26, 58, 107, 0.1);
}

.word-card .meaning {
    font-size: 0.95rem;
    color: var(--text-medium);
    margin-top: 10px;
    border-top: 1px dashed rgba(212, 175, 55, 0.4);
    padding-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Georgia', serif;
}

.word-card .meaning i {
    color: var(--gold);
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.word-card:hover .meaning i {
    transform: rotate(72deg) scale(1.2);
}

/* ============================================================
   阅读对话
   ============================================================ */
.dialogue-line {
    display: flex;
    gap: 16px;
    margin-bottom: 1.5rem;
    align-items: flex-start;
    animation: slideIn 0.4s ease both;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-15px); }
    to   { opacity: 1; transform: translateX(0); }
}

.speaker-icon {
    background: linear-gradient(145deg, var(--royal-blue-light), var(--royal-blue));
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--gold-light);
    flex-shrink: 0;
    box-shadow:
        0 6px 14px rgba(26, 58, 107, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(212, 175, 55, 0.4);
}

.dialogue-text {
    background: linear-gradient(135deg, rgba(253, 251, 246, 0.95) 0%, rgba(247, 241, 228, 0.9) 100%);
    padding: 1rem 1.4rem;
    border-radius: 4px 22px 22px 22px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    flex: 1;
    box-shadow: 0 6px 18px rgba(26, 58, 107, 0.08);
    position: relative;
    transition: all 0.3s ease;
}

.dialogue-text:hover {
    border-color: var(--gold);
    box-shadow: 0 8px 24px rgba(26, 58, 107, 0.15);
}

.dialogue-text .pinyin {
    font-size: 0.82rem;
    color: var(--royal-blue-soft);
    margin-bottom: 4px;
    font-style: italic;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.dialogue-text .hanzi {
    font-family: 'Noto Serif SC', 'Songti SC', 'Georgia', serif;
    font-size: 1.22rem;
    font-weight: 600;
    color: var(--text-dark);
    letter-spacing: 0.5px;
    line-height: 1.7;
}

.dialogue-text .trans {
    font-size: 0.88rem;
    color: var(--text-light);
    margin-top: 8px;
    font-style: italic;
    border-top: 1px dashed rgba(212, 175, 55, 0.3);
    padding-top: 6px;
    font-family: 'Georgia', serif;
}

/* ============================================================
   语法卡片
   ============================================================ */
.grammar-card {
    background: linear-gradient(145deg, var(--white) 0%, var(--cream-warm) 100%);
    border-radius: 22px;
    padding: 1.6rem 1.8rem;
    box-shadow:
        0 8px 20px rgba(26, 58, 107, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(212, 175, 55, 0.25);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.grammar-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--royal-blue), var(--gold));
    opacity: 0.7;
}

.grammar-card::after {
    content: "✦";
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 1rem;
    color: var(--gold);
    opacity: 0.4;
}

.grammar-card:hover {
    transform: translateY(-5px);
    border-color: var(--gold);
    box-shadow:
        0 16px 35px rgba(26, 58, 107, 0.2),
        0 0 25px rgba(212, 175, 55, 0.12);
}

.grammar-card h3 {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 1.35rem;
    color: var(--royal-blue);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.grammar-card .pinyin {
    font-size: 0.9rem;
    color: var(--royal-blue-soft);
    margin-bottom: 10px;
    font-style: italic;
    letter-spacing: 0.5px;
}

.grammar-card p {
    color: var(--text-medium);
    font-size: 0.98rem;
    line-height: 1.75;
}

.grammar-example {
    background: linear-gradient(135deg, rgba(42, 82, 152, 0.08) 0%, rgba(212, 175, 55, 0.08) 100%);
    padding: 1rem 1.2rem;
    border-radius: 16px;
    margin-top: 14px;
    font-size: 0.98rem;
    border-left: 5px solid var(--gold);
    color: var(--royal-blue-deep);
    font-weight: 500;
    letter-spacing: 0.3px;
    position: relative;
}

.grammar-example i {
    color: var(--gold);
    margin-right: 6px;
    font-size: 0.85rem;
}

/* ============================================================
   写作活动
   ============================================================ */
.writing-prompt {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0%, rgba(247, 241, 228, 0.9) 100%);
    border-radius: 22px;
    padding: 1.4rem 1.8rem;
    margin-bottom: 1.4rem;
    border-left: 6px solid var(--royal-blue-soft);
    box-shadow: 0 8px 20px rgba(26, 58, 107, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.writing-prompt::before {
    content: "✍";
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 1.3rem;
    color: var(--royal-blue-soft);
    opacity: 0.3;
}

.writing-prompt:hover {
    border-left-color: var(--gold);
    box-shadow: 0 12px 28px rgba(26, 58, 107, 0.18);
    transform: translateX(6px);
}

.writing-prompt .pinyin {
    font-size: 0.88rem;
    color: var(--royal-blue-soft);
    font-style: italic;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.writing-prompt .hanzi {
    font-family: 'Noto Serif SC', 'Songti SC', 'Georgia', serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    letter-spacing: 0.5px;
    line-height: 1.7;
}

.writing-prompt .hint {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(212, 175, 55, 0.4);
    font-style: italic;
}

.writing-prompt .hint i {
    color: var(--gold);
    margin-right: 6px;
}

/* ============================================================
   听力卡片
   ============================================================ */
.listening-card {
    background: linear-gradient(145deg, var(--white) 0%, var(--cream-warm) 100%);
    border-radius: 20px;
    padding: 1.3rem 1.7rem 1.3rem 3.8rem;
    margin-bottom: 1.2rem;
    box-shadow: 0 6px 16px rgba(26, 58, 107, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.25);
    transition: all 0.3s ease;
    position: relative;
}

.listening-card::before {
    content: "\f028";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 1.3rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.6rem;
    color: var(--royal-blue-soft);
    opacity: 0.6;
}

.listening-card:hover {
    border-color: var(--gold);
    box-shadow: 0 12px 28px rgba(26, 58, 107, 0.18);
    transform: translateX(6px);
}

.listening-card:hover::before {
    color: var(--gold);
    animation: pulseIcon 1s ease-in-out infinite;
}

.listening-card .pinyin {
    font-size: 0.85rem;
    color: var(--royal-blue-soft);
    font-style: italic;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.listening-card .hanzi {
    font-family: 'Noto Serif SC', 'Songti SC', 'Georgia', serif;
    font-size: 1.18rem;
    font-weight: 600;
    color: var(--text-dark);
    letter-spacing: 0.5px;
    line-height: 1.7;
}

/* ============================================================
   练习卡片
   ============================================================ */
.exercise-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0%, rgba(247, 241, 228, 0.92) 100%);
    border-radius: 22px;
    padding: 1.5rem 1.8rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 8px 22px rgba(26, 58, 107, 0.12);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.exercise-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--royal-blue-soft), var(--gold), var(--royal-blue-soft));
    opacity: 0.6;
}

.exercise-card::after {
    content: "★";
    position: absolute;
    top: 10px;
    right: 16px;
    font-size: 1rem;
    color: var(--gold);
    opacity: 0.35;
}

.exercise-card:hover {
    border-color: var(--gold);
    box-shadow: 0 14px 32px rgba(26, 58, 107, 0.2);
    transform: translateY(-4px);
}

.exercise-card h4 {
    font-family: 'Playfair Display', 'Georgia', serif;
    color: var(--royal-blue);
    font-size: 1.3rem;
    margin-bottom: 14px;
    display: flex;
    gap: 10px;
    align-items: center;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.exercise-card h4 i {
    color: var(--gold);
    font-size: 1.2rem;
}

.exercise-card ul,
.exercise-card ol {
    padding-left: 1.6rem;
    color: var(--text-medium);
    font-size: 1rem;
    line-height: 1.8;
}

.exercise-card li {
    margin-bottom: 10px;
}

.exercise-card > div {
    color: var(--text-medium);
    font-size: 1rem;
    line-height: 1.8;
}

/* ============================================================
   滚动条美化
   ============================================================ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(10, 31, 68, 0.4);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--royal-blue-light), var(--royal-blue-soft));
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--royal-blue-soft), var(--gold));
}

/* ============================================================
   选中文本
   ============================================================ */
::selection {
    background: var(--royal-blue-soft);
    color: var(--gold-light);
}

::-moz-selection {
    background: var(--royal-blue-soft);
    color: var(--gold-light);
}

/* ============================================================
   响应式设计
   ============================================================ */
@media (max-width: 900px) {
    .site-header {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        border-radius: 22px;
        padding: 1.2rem 1.5rem;
    }

    .logo h1 {
        font-size: 1.5rem;
        justify-content: center;
    }

    .lesson-selector { justify-content: center; }

    .nav-tabs { gap: 8px; }

    .tab-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.88rem;
        border-radius: 30px;
    }

    .tab-btn i { font-size: 1rem; }

    .panel {
        padding: 1.6rem 1.2rem 2rem;
        border-radius: 22px;
    }

    .panel h2 { font-size: 1.6rem; gap: 10px; }
    .panel h2 i { font-size: 1.7rem; }

    .grid-cards {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }

    .word-card .chinese { font-size: 1.45rem; }

    .dialogue-line { gap: 10px; }

    .speaker-icon {
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
    }

    .dialogue-text { padding: 0.8rem 1rem; }
    .dialogue-text .hanzi { font-size: 1.05rem; }
}

@media (max-width: 480px) {
    body { padding: 0.8rem 0.5rem 2rem; }

    .logo h1 {
        font-size: 1.2rem;
        gap: 8px;
    }

    .logo i { font-size: 1.6rem; }
    .logo h1 span { font-size: 0.7rem; }

    .tab-btn {
        padding: 0.55rem 0.9rem;
        font-size: 0.78rem;
        gap: 6px;
    }

    .tab-btn i { font-size: 0.85rem; }

    .panel h2 { font-size: 1.3rem; }

    .grid-cards { grid-template-columns: 1fr; }

    .word-card .chinese { font-size: 1.3rem; }

    .grammar-card h3 { font-size: 1.1rem; }

    .writing-prompt .hanzi { font-size: 1.05rem; }

    .listening-card { padding-left: 3rem; }
    .listening-card::before { left: 0.8rem; font-size: 1.2rem; }
    .listening-card .hanzi { font-size: 1rem; }

    .exercise-card { padding: 1.2rem 1rem; }
    .exercise-card h4 { font-size: 1.1rem; }
}