/* ═══════════════════════════════════════════════════════════════
   Rays Chinese Class — design system
   Palette: deep navy #14273f · gold #f0b429 · cream #faf7f1 · red #e35d5b
   ═══════════════════════════════════════════════════════════════ */

:root {
    --navy-900: #0e1c2e;
    --navy-800: #14273f;
    --navy-700: #1d3a5f;
    --navy-600: #27507f;
    --gold-500: #f0b429;
    --gold-400: #f7c948;
    --gold-100: #fdf3d7;
    --red-500: #e35d5b;
    --red-100: #fdeceb;
    --jade-500: #2f9e77;
    --jade-100: #e3f5ee;
    --cream: #faf7f1;
    --paper: #ffffff;
    --ink-900: #1c2733;
    --ink-600: #4a5a6a;
    --ink-400: #8494a4;
    --line: #e7e1d6;
    --radius: 14px;
    --radius-lg: 22px;
    --shadow-sm: 0 1px 3px rgba(20, 39, 63, .07), 0 1px 2px rgba(20, 39, 63, .04);
    --shadow-md: 0 6px 18px rgba(20, 39, 63, .09);
    --shadow-lg: 0 18px 44px rgba(20, 39, 63, .16);
    --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    --font-display: "Fraunces", "Noto Serif SC", "Songti SC", "SimSun", serif;
    --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.65;
    color: var(--ink-900);
    background: var(--cream);
}
img { max-width: 100%; height: auto; }
a { color: var(--navy-700); }
h1, h2, h3, h4 { line-height: 1.25; color: var(--navy-800); margin: 0 0 .5em; font-weight: 800; }
h1, h2 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.muted { color: var(--ink-600); }
.center { text-align: center; }

.container { width: min(1160px, 100% - 2.5rem); margin-inline: auto; }
#main { min-height: 58vh; }
.container.narrow { max-width: 800px; }

.visually-hidden, .skip-link {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link:focus {
    width: auto; height: auto; clip: auto; z-index: 100;
    left: 1rem; top: 1rem; background: var(--gold-500); color: var(--navy-900);
    padding: .6rem 1rem; border-radius: 8px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .62rem 1.25rem; border-radius: 999px;
    font: 700 .95rem var(--font-sans);
    text-decoration: none; cursor: pointer; border: 2px solid transparent;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn-gold { background: linear-gradient(180deg, var(--gold-400), var(--gold-500)); color: var(--navy-900); box-shadow: 0 2px 0 rgba(138,100,20,.35), 0 6px 16px rgba(240,180,41,.25); }
.btn-gold:hover { background: var(--gold-400); }
.btn-navy { background: var(--navy-800); color: #fff; }
.btn-navy:hover { background: var(--navy-700); }
.btn-red { background: var(--red-500); color: #fff; }
.btn-outline { background: transparent; color: var(--navy-800); border-color: var(--navy-800); }
.btn-ghost { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .45); }
.btn-ghost:hover { background: rgba(255, 255, 255, .22); }
.btn-google { background: #fff; color: var(--ink-900); border: 1.5px solid var(--line); }
.btn-lg { padding: .85rem 1.8rem; font-size: 1.05rem; }
.btn-sm { padding: .4rem .9rem; font-size: .85rem; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; color: var(--navy-700); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }

.badge {
    display: inline-block; padding: .18rem .6rem; border-radius: 999px;
    font-size: .72rem; font-weight: 700; letter-spacing: .02em; text-decoration: none;
}
.badge-soft { background: var(--navy-800); background: #edf2f9; color: var(--navy-700); }
.badge-gold { background: var(--gold-100); color: #8a6414; }
.badge-free { background: var(--jade-100); color: var(--jade-500); }
.badge-paid { background: var(--gold-100); color: #8a6414; }
.badge-member { background: #efe7fb; color: #6b3fa0; }
.badge-daily { background: var(--red-100); color: var(--red-500); }
.badge-level { background: rgba(20, 39, 63, .78); color: #fff; }

/* ── Header / nav ───────────────────────────────────────── */
.site-header {
    position: sticky; top: 0; z-index: 50;
    /* no backdrop-filter: it would turn the header into the containing
       block for the fixed mobile drawer (Chrome) and break the menu */
    background: rgba(255, 255, 255, .97);
    border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--navy-800); }
.brand img { border-radius: 12px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.02rem; font-weight: 800; }
.brand-text small { color: var(--ink-400); font-size: .68rem; }

.main-nav { margin-left: auto; display: flex; align-items: center; gap: 1rem; }
.main-nav ul { list-style: none; display: flex; align-items: center; gap: .1rem; margin: 0; padding: 0; }
.main-nav ul a, .nav-drop-btn {
    display: block; padding: .5rem .75rem; border-radius: 8px;
    color: var(--ink-600); text-decoration: none; font-weight: 600; font-size: .93rem;
    background: none; border: 0; cursor: pointer; font-family: inherit;
}
.main-nav ul a:hover, .nav-drop-btn:hover { color: var(--navy-800); background: #f1ede4; }
.main-nav ul a.active { color: var(--navy-800); background: var(--gold-100); }
.has-dropdown { position: relative; }
.dropdown {
    position: absolute; top: 100%; left: 0; min-width: 210px;
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    box-shadow: var(--shadow-lg); padding: .4rem !important;
    display: none !important; flex-direction: column; align-items: stretch;
}
.has-dropdown.open .dropdown { display: flex !important; }
.dropdown a { padding: .55rem .8rem; }
.caret { font-size: .7em; }
.nav-actions { display: flex; align-items: center; gap: .5rem; }
.nav-avatar { width: 22px; height: 22px; border-radius: 50%; }
.lang-flag { font-size: 1.05em; margin-right: .15rem; }

/* Account chip — gold "seal stamp" identity */
.nav-account {
    display: inline-flex; align-items: center; gap: .55rem;
    padding: .28rem .85rem .28rem .3rem; border: 1.5px solid var(--line); border-radius: 999px;
    text-decoration: none; color: var(--navy-800); font-weight: 700; font-size: .88rem;
    background: #fff; transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.nav-account:hover { border-color: var(--gold-500); background: var(--gold-100); transform: translateY(-1px); }
.nav-seal { width: 28px; height: 28px; border-radius: 9px; object-fit: cover; display: block; }
.nav-seal-letter {
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
    color: var(--navy-900); font: 700 .85rem var(--font-display);
    box-shadow: inset 0 -1px 0 rgba(138, 100, 20, .4);
}
.lang-switch {
    font-weight: 800; font-size: .8rem; color: var(--ink-600); text-decoration: none;
    border: 1.5px solid var(--line); padding: .3rem .6rem; border-radius: 8px;
}
.lang-dropdown .dropdown { left: auto; right: 0; min-width: 150px; }
.lang-dropdown .dropdown a.active { color: var(--navy-800); background: var(--gold-100); font-weight: 700; }

/* ── Burmese (Myanmar script) typography ─────────────────────────────
   Taller glyph stacks need a Myanmar-capable font chain + extra leading.
   Scoped with :lang(my) so Latin/CJK are unaffected. */
:lang(my) body,
:lang(my) .main-nav a, :lang(my) .nav-drop-btn, :lang(my) .btn,
:lang(my) p, :lang(my) li, :lang(my) label, :lang(my) input, :lang(my) textarea, :lang(my) select {
    font-family: "Plus Jakarta Sans", "Noto Sans Myanmar", "Padauk", "Pyidaungsu", "Myanmar Text", sans-serif;
}
:lang(my) h1, :lang(my) h2, :lang(my) h3, :lang(my) h4 {
    font-family: "Fraunces", "Noto Sans Myanmar", "Padauk", "Pyidaungsu", "Myanmar Text", serif;
    line-height: 1.6;
}
:lang(my) p, :lang(my) li { line-height: 2; }
:lang(my) .btn { line-height: 1.8; white-space: nowrap; }
:lang(my) .main-nav > ul > li > a, :lang(my) .nav-drop-btn, :lang(my) .nav-actions .btn {
    white-space: nowrap; font-size: .84rem; padding-left: .55rem; padding-right: .55rem;
}
:lang(my) .mobile-tabbar a { font-size: .54rem; }

.nav-toggle {
    display: none; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; margin-left: auto;
    background: none; border: 0; cursor: pointer; padding: 10px;
}
.nav-toggle span { display: block; height: 2.5px; background: var(--navy-800); border-radius: 2px; transition: .25s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }
.nav-overlay { position: fixed; inset: 0; background: rgba(14, 28, 46, .5); z-index: 49; }

/* Flash + alerts */
.flash { padding: .8rem 0; font-weight: 600; }
.flash-error { background: var(--red-100); color: #9e2b29; }
.flash-success { background: var(--jade-100); color: #1d6b50; }
.alert { padding: .9rem 1.1rem; border-radius: 10px; margin-bottom: 1.2rem; font-weight: 600; }
.alert-success { background: var(--jade-100); color: #1d6b50; }

/* ── Hero ───────────────────────────────────────────────── */
.hero {
    background:
        radial-gradient(1000px 500px at 85% -10%, rgba(240, 180, 41, .18), transparent 60%),
        radial-gradient(700px 400px at -10% 110%, rgba(47, 158, 119, .12), transparent 55%),
        linear-gradient(160deg, var(--navy-900) 0%, var(--navy-800) 55%, var(--navy-700) 100%);
    color: #eef3f9; padding: clamp(3rem, 8vw, 5.5rem) 0;
    overflow: hidden;
}
.hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; }
.hero h1 { color: #fff; margin: .2em 0 .25em; }
.hero-eyebrow { color: var(--gold-400); font-weight: 700; letter-spacing: .06em; margin: 0; font-size: .9rem; }
.hero-sub-zh { font-size: clamp(1.05rem, 2.6vw, 1.35rem); font-weight: 700; color: var(--gold-100); margin-bottom: .2em; }
.hero-sub { color: #c3d0de; max-width: 34rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.4rem 0; }
.hero-cta.center { justify-content: center; }
.hero-quote { margin: 1.6rem 0 0; padding-left: 1rem; border-left: 3px solid var(--gold-500); }
.hero-quote p { margin: 0; font-weight: 700; color: #ffffffd9; font-family: var(--font-display); }
.hero-quote .en { font-weight: 400; color: #a9bacb; font-size: .9rem; }

.hero-visual { position: relative; min-height: 320px; }
.hero-visual::before {
    content: "学"; position: absolute; right: -4%; top: 46%; transform: translateY(-50%);
    font-family: var(--font-display); font-size: 21rem; line-height: 1;
    color: rgba(240, 180, 41, .07); pointer-events: none; user-select: none;
}
.hero-card {
    position: absolute; background: #fff; color: var(--ink-900);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    padding: 1rem 1.3rem; display: flex; flex-direction: column; align-items: center; gap: .1rem;
    animation: floaty 5s ease-in-out infinite;
}
.hero-card small { color: var(--ink-400); }
.hero-card-main { top: 8%; left: 14%; padding: 1.6rem 2.2rem; z-index: 2; }
.hero-hanzi { font-size: 3.2rem; font-weight: 800; line-height: 1.1; color: var(--navy-800); }
.hero-pinyin { color: var(--jade-500); font-weight: 700; font-size: 1.15rem; }
.hero-en { color: var(--ink-400); }
.hero-card-a { bottom: 12%; left: 0; animation-delay: .8s; }
.hero-card-a .tone-mark { font-weight: 800; color: var(--red-500); font-size: 1.2rem; }
.hero-card-b { top: 0; right: 4%; animation-delay: 1.6s; }
.hero-card-c { bottom: 4%; right: 10%; animation-delay: 2.4s; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@media (prefers-reduced-motion: reduce) { .hero-card { animation: none; } }

/* ── Stats strip ────────────────────────────────────────── */
.stats-strip { background: var(--navy-900); border-top: 1px solid rgba(255,255,255,.06); }
.stats-strip-inner { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; padding: 1.2rem 0; }
.stat-item { text-align: center; color: #b9c8d8; }
.stat-item b { display: block; font-family: var(--font-display); font-size: 1.7rem; color: var(--gold-400); line-height: 1.2; }
.stat-item span { font-size: .78rem; font-weight: 600; }
@media (max-width: 700px) { .stats-strip-inner { grid-template-columns: repeat(2, 1fr); row-gap: 1.2rem; } }

/* ── Scroll reveal ──────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
    .reveal-init { opacity: 0; transform: translateY(22px); }
    .reveal-in { opacity: 1; transform: none; transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.3,1); }
}

/* ── Pricing ────────────────────────────────────────────── */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.3rem; align-items: stretch; }
.pricing-card { display: flex; flex-direction: column; position: relative; padding-top: 1.8rem; }
.pricing-card.is-popular { border: 2px solid var(--gold-500); box-shadow: var(--shadow-lg); }
.pricing-flag {
    position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
    background: linear-gradient(180deg, var(--gold-400), var(--gold-500)); color: var(--navy-900);
    font-size: .72rem; font-weight: 800; padding: .25rem .9rem; border-radius: 999px; white-space: nowrap;
}
.pricing-name { font-size: 1.3rem; margin-bottom: .2rem; }
.pricing-desc { color: var(--ink-600); font-size: .85rem; min-height: 2.6em; }
.pricing-price { margin: .4rem 0 1rem; }
.pricing-price strong { font-family: var(--font-display); font-size: 2.1rem; color: var(--navy-800); }
.pricing-price span { color: var(--ink-400); font-weight: 600; margin-left: .25rem; }
.pricing-price small { display: block; color: var(--ink-400); }
.pricing-features { list-style: none; margin: 0 0 1.2rem; padding: 0; flex: 1; }
.pricing-features li { padding: .34rem 0; font-size: .86rem; border-bottom: 1px dashed var(--line); }
.pricing-features li.has { color: var(--ink-900); font-weight: 600; }
.pricing-features li.not { color: var(--ink-400); opacity: .6; }
.pricing-note { margin-top: 1.6rem; background: linear-gradient(120deg, #fff, var(--gold-100)); }
.auth-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.auth-forgot { font-size: .85rem; font-weight: 700; }
.lesson-progress-track { height: 5px; background: rgba(255,255,255,.14); border-radius: 99px; max-width: 300px; margin: .3rem 0 .9rem; overflow: hidden; }
.lesson-progress-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-500), var(--gold-400)); border-radius: 99px; }

/* ── Sections ───────────────────────────────────────────── */
.section { padding: clamp(2.6rem, 6vw, 4.5rem) 0; }
.section-alt { background: #f3efe6; }
.section-navy { background: linear-gradient(160deg, var(--navy-900), var(--navy-800)); color: #dfe8f2; }
.section-navy h2 { color: #fff; }
.section-head { max-width: 760px; margin: 0 auto 2.2rem; text-align: center; }
.eyebrow {
    display: inline-block; font-family: var(--font-sans); font-size: .72rem; font-weight: 800;
    letter-spacing: .18em; text-transform: uppercase; color: #b28312;
    background: var(--gold-100); border-radius: 999px; padding: .28rem .9rem; margin-bottom: .9rem;
}
.section-navy .eyebrow, .page-hero .eyebrow { background: rgba(240,180,41,.14); color: var(--gold-400); }
.section-head h2::after {
    content: ""; display: block; width: 56px; height: 3px; margin: .6rem auto 0;
    background: linear-gradient(90deg, var(--gold-500), transparent); border-radius: 2px;
}
.section-head-row h2::after { margin-left: 0; }
.section-head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; max-width: none; text-align: left; margin-bottom: 1.6rem; }
.head-en { display: inline-block; font-weight: 600; color: var(--ink-400); font-size: .72em; }
.section-navy .head-en, .page-hero .head-en { color: var(--gold-400); }
.see-all { font-weight: 700; text-decoration: none; color: var(--navy-700); white-space: nowrap; }

.grid { display: grid; gap: 1.3rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
    background: var(--paper); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    padding: 1.4rem;
}

/* Feature cards */
.feature-card { text-align: center; transition: transform .2s ease, box-shadow .2s ease; position: relative; overflow: hidden; }
.feature-card::before {
    content: ""; position: absolute; inset: 0 auto auto 0; width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--gold-500), var(--red-500), var(--jade-500));
    opacity: 0; transition: opacity .2s;
}
.feature-card:hover::before { opacity: 1; }
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.feature-icon { font-size: 2.1rem; display: inline-block; margin-bottom: .5rem; }
.feature-card h3 { font-size: 1.02rem; }
.feature-card h3 em { display: block; font-style: normal; font-size: .82em; color: var(--ink-400); font-weight: 600; }
.feature-card p { font-size: .88rem; color: var(--ink-600); margin: 0; }

/* Path / resource cards */
.path-card { display: block; text-decoration: none; transition: transform .2s, box-shadow .2s; position: relative; }
.path-step {
    position: absolute; top: 1rem; right: 1.1rem;
    font-family: var(--font-display); font-weight: 700; font-size: 1.9rem;
    color: rgba(20, 39, 63, .10); line-height: 1;
}
.path-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--gold-500); }
.path-icon { font-size: 2rem; }
.path-card h3 { margin: .5rem 0 .4rem; }
.path-card p { color: var(--ink-600); font-size: .92rem; }
.card-link { font-weight: 800; color: var(--navy-700); }
.resource-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .2rem; text-decoration: none; padding: 1.2rem .8rem; transition: transform .2s, box-shadow .2s; }
.resource-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.resource-card span { font-size: 1.7rem; }
.resource-card small { color: var(--ink-400); }

.premium-teaser { margin-top: 1.6rem; display: flex; align-items: center; justify-content: space-between; gap: 1.4rem; flex-wrap: wrap; background: linear-gradient(120deg, #fff, var(--gold-100)); }
.premium-teaser h3 { margin-bottom: .3rem; }
.premium-teaser p { margin: 0; color: var(--ink-600); }

/* Post / course cards */
.post-card, .course-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.post-card:hover, .course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.post-card-media, .course-card-media { display: block; aspect-ratio: 16 / 8.4; background: linear-gradient(140deg, var(--navy-700), var(--navy-800)); position: relative; overflow: hidden; }
.post-card-media img, .course-card-media img { width: 100%; height: 100%; object-fit: cover; }
.post-card-placeholder, .course-card-placeholder {
    position: absolute; inset: 0; display: grid; place-items: center;
    font-size: 3rem; font-weight: 800; color: rgba(255, 255, 255, .22);
}
.badge-level { position: absolute; left: .8rem; bottom: .8rem; }
.post-card-body { padding: 1.1rem 1.2rem 1.2rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.post-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; font-size: .78rem; color: var(--ink-400); }
.post-card-body h3 { font-size: 1.05rem; margin: 0; }
.post-card-body h3 a { color: var(--navy-800); text-decoration: none; }
.post-card-body h3 a:hover { color: var(--navy-600); }
.post-card-body h3 small { color: var(--ink-400); font-weight: 600; }
.post-card-body p { color: var(--ink-600); font-size: .9rem; margin: 0; flex: 1; }
.course-card-foot { display: flex; gap: 1rem; color: var(--ink-400); font-size: .82rem; }

/* About band */
.about-band-inner { display: grid; grid-template-columns: 240px 1fr; gap: 2.4rem; align-items: center; }
.about-band-media img { border-radius: 24px; box-shadow: var(--shadow-lg); width: 100%; }
.about-band .muted { color: #a9bacb; }
.about-band-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.2rem; }

/* YouTube / newsletter bands */
.youtube-band { background: linear-gradient(120deg, #2b0d0d, #6d1f1f); color: #ffe9e9; }
.youtube-band h2 { color: #fff; }
.youtube-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.newsletter-band {
    background:
        radial-gradient(600px 300px at 90% 0%, rgba(240,180,41,.35), transparent 60%),
        linear-gradient(120deg, #fdf3d7, #faeec4);
    border-block: 1px solid #f0e2b4;
}
.newsletter-inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; align-items: center; }
.newsletter-form { display: flex; gap: .6rem; }
.newsletter-form input {
    flex: 1; padding: .8rem 1.1rem; border-radius: 999px; border: 2px solid var(--line);
    font: inherit; min-width: 0;
}
.newsletter-msg { grid-column: 1 / -1; font-weight: 700; color: var(--jade-500); margin: 0; }
.final-cta { text-align: center; }
.final-cta p { color: #b9c8d8; }

/* ── Page hero (inner pages) ────────────────────────────── */
.page-hero {
    background: linear-gradient(160deg, var(--navy-900), var(--navy-700));
    color: #dfe8f2; padding: clamp(2.2rem, 5vw, 3.6rem) 0;
}
.page-hero h1 { color: #fff; margin-bottom: .25em; }
.page-hero p { color: #b9c8d8; max-width: 46rem; margin-bottom: 0; }
.page-search { display: flex; gap: .6rem; margin-top: 1.2rem; max-width: 460px; }
.page-search input { flex: 1; padding: .7rem 1rem; border-radius: 999px; border: 0; font: inherit; min-width: 0; }

.breadcrumbs { font-size: .82rem; margin-bottom: .8rem; color: var(--ink-400); }
.breadcrumbs a { color: inherit; text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs-light { color: #9fb2c6; }

/* ── About page ─────────────────────────────────────────── */
.about-block { margin-bottom: 2.4rem; }
.about-block-icon { font-size: 2rem; }

/* ── Contact ────────────────────────────────────────────── */
.contact-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 1.6rem; align-items: start; }
.contact-brand-card { text-align: center; }
.contact-glyph {
    display: inline-grid; place-items: center; width: 74px; height: 74px;
    background: linear-gradient(140deg, var(--navy-800), var(--navy-600));
    color: var(--gold-400); font-size: 2rem; font-weight: 800; border-radius: 20px;
    margin-bottom: .6rem;
}
.contact-links { display: flex; flex-direction: column; gap: .5rem; margin-top: .8rem; }
.contact-links a { text-decoration: none; font-weight: 700; }

.form-group { margin-bottom: 1rem; display: flex; flex-direction: column; gap: .3rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form label { font-weight: 700; font-size: .9rem; }
.form input, .form select, .form textarea {
    padding: .7rem .9rem; border: 1.5px solid var(--line); border-radius: 10px;
    font: inherit; background: #fff; width: 100%;
}
.form input:focus, .form select:focus, .form textarea:focus {
    outline: 2px solid var(--gold-500); outline-offset: 1px; border-color: var(--gold-500);
}
.check-label { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; font-size: .9rem; }

/* ── Blog layout ────────────────────────────────────────── */
.blog-layout, .article-layout, .course-layout { display: grid; grid-template-columns: 1fr 300px; gap: 2rem; align-items: start; }
.sidebar-card h3 { font-size: 1rem; }
.sidebar-list { list-style: none; margin: 0; padding: 0; }
.sidebar-list li + li { border-top: 1px dashed var(--line); }
.sidebar-list a { display: flex; justify-content: space-between; gap: .5rem; padding: .55rem 0; text-decoration: none; font-weight: 600; color: var(--ink-600); }
.sidebar-list a:hover { color: var(--navy-800); }
.sidebar-list .count { color: var(--ink-400); font-weight: 700; }
.sticky-sidebar { position: sticky; top: calc(var(--header-h) + 1rem); display: flex; flex-direction: column; gap: 1.2rem; }
.blog-sidebar { display: flex; flex-direction: column; gap: 1.2rem; }

.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 2rem; }
.pager-btn { text-decoration: none; font-weight: 700; padding: .5rem 1.1rem; border: 2px solid var(--navy-800); border-radius: 999px; color: var(--navy-800); }
.pager-info { color: var(--ink-400); font-weight: 600; }

/* Article */
.article-hero { background: linear-gradient(160deg, var(--navy-900), var(--navy-700)); color: #dfe8f2; padding: 2.4rem 0; }
.article-hero h1 { color: #fff; }
.article-meta { display: flex; flex-wrap: wrap; gap: 1rem; color: #9fb2c6; font-size: .88rem; align-items: center; }
.article-layout { padding-top: 2rem; padding-bottom: 3rem; }
.article-cover { border-radius: var(--radius); margin-bottom: 1.4rem; width: 100%; }
.article-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.6rem 0; }
.article-share { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding-top: 1rem; border-top: 1px solid var(--line); font-weight: 600; }
.related-title { margin-bottom: 1.4rem; }

.rich-text { font-size: 1.03rem; }
.rich-text h2 { margin-top: 1.6em; }
.rich-text h3 { margin-top: 1.3em; }
.rich-text img { border-radius: 10px; }
.rich-text blockquote {
    margin: 1.2em 0; padding: .9em 1.2em; background: var(--gold-100);
    border-left: 4px solid var(--gold-500); border-radius: 8px;
}
.rich-text blockquote p { margin: 0; }
.rich-text pre { background: var(--navy-900); color: #d9e6f2; padding: 1em 1.2em; border-radius: 10px; overflow-x: auto; }
.rich-text code { background: #eee9dd; padding: .1em .35em; border-radius: 5px; font-size: .92em; }
.rich-text pre code { background: none; padding: 0; }
.rich-text table { width: 100%; border-collapse: collapse; margin: 1.2em 0; background: #fff; border-radius: 10px; overflow: hidden; }
.rich-text th, .rich-text td { padding: .65em .8em; border-bottom: 1px solid var(--line); text-align: left; }
.rich-text th { background: #f3efe6; }
.rc-cta { background: var(--jade-100); padding: .9em 1.2em; border-radius: 10px; }

/* ── Course pages ───────────────────────────────────────── */
.course-hero { padding-bottom: 2.6rem; }
.course-hero-inner { display: grid; grid-template-columns: 1.4fr .6fr; gap: 2rem; align-items: start; }
.course-hero-meta { display: flex; flex-wrap: wrap; gap: .9rem; color: #b9c8d8; font-size: .9rem; align-items: center; }
.course-cta-card { color: var(--ink-900); text-align: center; }
.course-price { font-size: 1.5rem; font-weight: 800; color: var(--navy-800); margin-bottom: .8rem; }
.course-price.free { color: var(--jade-500); }
.course-price.owned { color: var(--jade-500); font-size: 1.1rem; }
.course-price s { color: var(--ink-400); font-size: .8em; font-weight: 600; }
.course-cta-note { font-size: .8rem; color: var(--ink-400); margin: .7rem 0 0; }
.info-card { margin: 1.4rem 0; }
.checklist, .info-card ul { padding-left: 1.2rem; }
.checklist li::marker { content: "✅ "; }

.lesson-list { list-style: none; margin: 1rem 0 2rem; padding: 0; counter-reset: none; }
.lesson-row + .lesson-row { margin-top: .55rem; }
.lesson-row a, .lesson-locked {
    display: flex; align-items: center; gap: 1rem;
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    padding: .8rem 1.1rem; text-decoration: none; color: var(--ink-900);
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.lesson-row a:hover { transform: translateX(4px); border-color: var(--gold-500); box-shadow: var(--shadow-sm); }
.lesson-row.is-done a { background: var(--jade-100); }
.lesson-num {
    display: grid; place-items: center; width: 40px; height: 40px; flex: none;
    background: var(--navy-800); color: var(--gold-400); font-weight: 800; border-radius: 10px;
}
.lesson-titles { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.lesson-titles small { color: var(--ink-400); }
.lesson-state { margin-left: auto; font-size: 1.1rem; color: var(--ink-400); }
.lesson-locked { opacity: .65; }

.faq-list { display: flex; flex-direction: column; gap: .7rem; margin-bottom: 1.6rem; }
.faq-item summary { font-weight: 700; cursor: pointer; }
.faq-item p { margin: .7em 0 0; color: var(--ink-600); }

/* ── Lesson page ────────────────────────────────────────── */
.lesson-hero { background: linear-gradient(160deg, var(--navy-900), var(--navy-700)); color: #dfe8f2; padding: 2.4rem 0 2rem; }
.lesson-hero h1 { color: #fff; margin-bottom: .1em; font-size: clamp(1.7rem, 4vw, 2.4rem); }
.lesson-hero .head-en { font-size: 1.05rem; }
.lesson-day-badge { display: inline-block; background: rgba(240, 180, 41, .18); color: var(--gold-400); font-weight: 800; font-size: .8rem; padding: .25rem .8rem; border-radius: 999px; margin-bottom: .6rem; }
.lesson-intro { color: #b9c8d8; }
.lesson-toolbar { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.1rem; }
.lesson-toolbar .btn-outline { color: #fff; border-color: rgba(255, 255, 255, .5); }
.lesson-toolbar .btn-outline:hover { background: rgba(255, 255, 255, .12); }
.js-favorite.is-active { background: var(--gold-500); color: var(--navy-900); border-color: var(--gold-500); }

.lesson-body { padding: 2rem 0 3rem; }
.lesson-section { margin-bottom: 2.2rem; }
.lesson-section-title { font-size: 1.2rem; display: flex; align-items: center; gap: .5rem; }
.lesson-section-title::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, var(--gold-500), transparent); border-radius: 2px; }

.hanzi-text { font-size: 1.35rem; line-height: 2.6; text-align: center; }
.hanzi-text ruby { margin: 0 .12em; font-weight: 700; }
.hanzi-text rt { font-size: .5em; color: var(--jade-500); font-weight: 600; letter-spacing: .02em; }
.rc-punct { color: var(--ink-600); }
.text-card { padding: 1.8rem 1.4rem; }
.text-plain-toggle { margin-top: .8rem; }
.text-plain-toggle summary { cursor: pointer; font-weight: 700; color: var(--ink-600); }
.text-plain { margin-top: .6rem; }
.hanzi-plain { font-size: 1.15rem; font-weight: 700; }
.pinyin-plain { color: var(--jade-500); }

.grammar-card { background: #f6f9ff; border-color: #dbe7f8; }
.practice-card { background: #fff8f5; border-color: #fbdcd0; }
.tip-card { background: var(--jade-100); border-color: #bfe8d8; }
.tip-card h3 { margin-bottom: .4rem; }
.tip-card p { margin: 0; }

.dialogue-wrap { display: flex; flex-direction: column; gap: 1rem; }
.bubble { max-width: 85%; padding: 1rem 1.2rem; border-radius: 18px; box-shadow: var(--shadow-sm); }
.bubble-left { background: #eaf3fd; align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble-right { background: #fdf3dd; align-self: flex-end; border-bottom-right-radius: 4px; }
.bubble-speaker { font-size: .78rem; font-weight: 800; color: var(--ink-400); display: block; margin-bottom: .3rem; letter-spacing: .03em; }
.bubble .hanzi-text { font-size: 1.15rem; line-height: 2.3; text-align: left; }
.bubble-trans { display: block; font-size: .85rem; color: var(--ink-600); border-top: 1px dashed rgba(0, 0, 0, .12); margin-top: .5rem; padding-top: .4rem; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
.vocab-table { width: 100%; border-collapse: collapse; min-width: 420px; }
.vocab-table th { background: var(--navy-800); color: #fff; text-align: left; padding: .75rem 1rem; font-size: .85rem; }
.vocab-table td { padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
.vocab-table tr:last-child td { border-bottom: 0; }
.vocab-table tr:nth-child(even) td { background: #faf7f1; }
.v-zh { font-size: 1.15rem; font-weight: 800; }
.v-py { color: var(--jade-500); font-weight: 700; }
.v-en { color: var(--ink-600); }

.locked-card { text-align: center; padding: 2.4rem 1.6rem; }
.lesson-complete { text-align: center; margin: 2.4rem 0; }
.lesson-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; border-top: 1px solid var(--line); padding-top: 1.6rem; }
.lesson-nav-btn {
    display: flex; flex-direction: column; gap: .15rem; text-decoration: none;
    background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1.1rem;
    color: var(--navy-800); transition: border-color .15s, transform .15s;
}
.lesson-nav-btn:hover { border-color: var(--gold-500); transform: translateY(-2px); }
.lesson-nav-btn.next { text-align: right; align-items: flex-end; }
.lesson-nav-btn small { color: var(--ink-400); font-weight: 700; }
.video-embed { position: relative; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ── Tools: pinyin chart + tones ────────────────────────── */
.tool-search input {
    width: min(420px, 100%); padding: .75rem 1.2rem; border-radius: 999px; border: 0;
    font: inherit; margin-top: 1.2rem; box-shadow: var(--shadow-md);
}
.tool-section { margin-bottom: 2.4rem; }
.tool-section-head { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tool-section-head h2 { margin: 0; }
.tool-section-head p { margin: 0; color: var(--ink-400); font-size: .9rem; }
.pinyin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .7rem; }
.pinyin-card {
    display: flex; flex-direction: column; align-items: center; gap: .05rem;
    background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
    padding: .7rem .4rem .6rem; cursor: pointer; font-family: inherit;
    transition: transform .12s, border-color .12s, box-shadow .12s;
}
.pinyin-card:hover { transform: translateY(-3px); border-color: var(--gold-500); box-shadow: var(--shadow-sm); }
.pinyin-card.playing { border-color: var(--jade-500); background: var(--jade-100); }
.pinyin-card .py { font-size: 1.25rem; font-weight: 800; color: var(--navy-800); }
.pinyin-card .example { font-size: .95rem; color: var(--ink-600); }
.pinyin-card .speaker-ic { font-size: .75rem; color: var(--ink-400); }

.tone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .9rem; }
.tone-family { background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.tone-family-head { font-weight: 800; color: var(--navy-800); margin-bottom: .6rem; }
.tone-family-head small { color: var(--ink-400); font-weight: 600; }
.tone-btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem; }
.tone-btn {
    display: flex; flex-direction: column; align-items: center; gap: 0;
    border: 1.5px solid var(--line); background: var(--cream); border-radius: 10px;
    padding: .5rem .2rem; cursor: pointer; font-family: inherit;
    transition: transform .12s, border-color .12s;
}
.tone-btn:hover { transform: translateY(-2px); border-color: var(--gold-500); }
.tone-btn.playing { border-color: var(--jade-500); background: var(--jade-100); }
.tone-btn .t { font-size: 1.15rem; font-weight: 800; color: var(--navy-800); }
.tone-btn .n { font-size: .62rem; color: var(--ink-400); }
.tone-btn[data-tone="1"] .t { color: #c99b06; }
.tone-btn[data-tone="2"] .t { color: var(--jade-500); }
.tone-btn[data-tone="3"] .t { color: var(--navy-600); }
.tone-btn[data-tone="4"] .t { color: var(--red-500); }
.tool-note { color: var(--ink-400); font-size: .88rem; margin-top: 1rem; }
.tool-hidden { display: none !important; }

/* Converter */
.converter-card { display: flex; flex-direction: column; gap: .9rem; }
.converter-card textarea {
    width: 100%; padding: .9rem 1rem; border: 1.5px solid var(--line); border-radius: 10px;
    font: inherit; font-size: 1.1rem; resize: vertical;
}
.converter-modes { display: flex; flex-wrap: wrap; gap: 1rem; font-weight: 600; font-size: .92rem; }
.converter-modes label { display: flex; align-items: center; gap: .4rem; cursor: pointer; }
.converter-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.converter-output {
    min-height: 90px; background: var(--cream); border: 1.5px dashed var(--line);
    border-radius: 10px; padding: .9rem 1rem; font-size: 1.15rem; line-height: 1.9; color: var(--ink-900);
    white-space: pre-wrap; word-break: break-word;
}
.converter-msg { font-weight: 700; color: var(--jade-500); }

/* ── Auth pages ─────────────────────────────────────────── */
.auth-section { display: grid; place-items: center; min-height: 60vh; }
.auth-card { width: min(430px, 100%); text-align: center; padding: 2rem 1.8rem; }
.auth-logo { border-radius: 16px; margin-bottom: .6rem; }
.auth-card h1 { font-size: 1.5rem; }
.auth-card .form { text-align: left; margin-top: 1rem; }
.auth-divider { display: flex; align-items: center; gap: .8rem; color: var(--ink-400); margin: 1.1rem 0; font-size: .85rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-alt { margin-top: 1.1rem; font-size: .92rem; }
.auth-terms { font-size: .78rem; margin-top: .6rem; }

/* ── Dashboard ──────────────────────────────────────────── */
.dash-hero { padding-bottom: 1.6rem; }
.dash-hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.dash-user { display: flex; align-items: center; gap: 1rem; }
.dash-seal { width: 68px; height: 68px; border-radius: 18px; object-fit: cover; display: block; }
.dash-seal-letter {
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
    color: var(--navy-900); font: 700 1.9rem var(--font-display);
    box-shadow: 0 4px 14px rgba(240, 180, 41, .35), inset 0 -2px 0 rgba(138, 100, 20, .4);
}
.dash-hero h1 { font-size: 1.65rem; margin: 0 0 .15rem; }
.dash-hero .muted { color: #9fb3c8; margin: 0; }
.dash-actions { display: flex; gap: .5rem; }

/* stat chips */
.dash-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.6rem; }
.dash-stat {
    display: flex; align-items: center; gap: .85rem;
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    padding: .95rem 1.1rem; box-shadow: var(--shadow-sm);
}
.ds-icon {
    flex: none; width: 44px; height: 44px; border-radius: 13px;
    display: grid; place-items: center; font-size: 1.25rem;
}
.ds-jade { background: var(--jade-100); }
.ds-navy { background: #e6eef8; }
.ds-gold { background: var(--gold-100); color: #b7791f; }
.ds-red { background: var(--red-100); }
.dash-stat strong { display: block; font-size: 1.25rem; line-height: 1.2; color: var(--navy-800); }
.dash-stat small { color: var(--ink-600); font-size: .78rem; line-height: 1.35; display: block; }
.ds-upgrade { color: #b7791f; font-weight: 800; text-decoration: none; white-space: nowrap; }
.ds-upgrade:hover { text-decoration: underline; }

/* primary "continue / start" card */
.dash-primary {
    position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: space-between; gap: 1.6rem; flex-wrap: wrap;
    background: linear-gradient(135deg, var(--navy-800), var(--navy-600));
    border-radius: var(--radius-lg); padding: 1.9rem 2.2rem; margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}
.dash-primary-hanzi {
    position: absolute; right: -1.2rem; top: 50%; transform: translateY(-52%) rotate(-6deg);
    font: 700 11rem var(--font-display); color: rgba(255, 255, 255, .06);
    pointer-events: none; user-select: none; line-height: 1;
}
.dash-primary-copy { position: relative; }
.dash-primary-eyebrow {
    margin: 0 0 .3rem; color: var(--gold-400);
    font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
}
.dash-primary h2 { color: #fff; font-size: 1.55rem; margin: 0 0 .15rem; }
.dash-primary-sub { color: #b9c8d8; margin: 0; }
.dash-primary .btn { position: relative; }

/* study tools row */
.dash-tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.dash-tool {
    display: flex; align-items: center; gap: .85rem;
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    padding: .9rem 1.1rem; text-decoration: none; color: var(--navy-800); font-weight: 700;
    box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.dash-tool:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--gold-500); }
.dash-tool-glyph {
    flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
    background: var(--navy-800); color: var(--gold-400); font: 700 1.15rem var(--font-display);
}
.dash-tool-name { flex: 1; }
.dash-tool-arrow { color: var(--ink-400); transition: transform .15s ease, color .15s ease; }
.dash-tool:hover .dash-tool-arrow { transform: translateX(3px); color: var(--gold-500); }

/* two-column lists */
.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; align-items: start; }
.dash-list-card { padding: .4rem 1.1rem; }

@media (max-width: 900px) {
    .dash-stats { grid-template-columns: repeat(2, 1fr); }
    .dash-tools { grid-template-columns: 1fr; }
    .dash-cols { grid-template-columns: 1fr; }
    .dash-primary { padding: 1.5rem 1.4rem; }
    .dash-primary .btn { width: 100%; }
}

/* legacy shared pieces */
.continue-card { display: flex; align-items: center; justify-content: space-between; gap: 1.4rem; flex-wrap: wrap; margin-bottom: 1.8rem; background: linear-gradient(120deg, #fff, var(--gold-100)); }
.continue-card h2 { font-size: 1.15rem; margin-bottom: .2rem; }
.continue-card p { margin: 0; }
.dash-section-title { font-size: 1.2rem; margin: 1.8rem 0 1rem; }
.course-progress-card { text-decoration: none; display: block; }
.progress-bar { height: 8px; background: #eee7d8; border-radius: 99px; overflow: hidden; margin: .6rem 0 .4rem; }
.progress-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--jade-500), var(--gold-500)); border-radius: 99px; }
.recent-list { list-style: none; padding: 0; margin: 0; }
.recent-list li + li { border-top: 1px dashed var(--line); }
.recent-list a { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: .7rem .2rem; text-decoration: none; color: var(--ink-900); font-weight: 600; }
.recent-list a:hover { color: var(--navy-600); }
.recent-list small { color: var(--ink-400); flex: none; }

/* ── Ads ────────────────────────────────────────────────── */
.ad-slot { margin: 1.6rem auto; text-align: center; max-width: 1160px; padding: 0 1.25rem; }
.ad-placeholder {
    border: 2px dashed var(--line); border-radius: 10px; color: var(--ink-400);
    padding: 2rem 1rem; font-size: .82rem; font-weight: 700; letter-spacing: .05em;
    background: repeating-linear-gradient(45deg, #fdfcf9, #fdfcf9 12px, #f6f2e9 12px, #f6f2e9 24px);
}

/* ── Cookie banner ──────────────────────────────────────── */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 90;
    background: var(--navy-900); color: #dfe8f2; border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: 1rem 1.2rem;
    display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap;
    max-width: 720px; margin-inline: auto;
}
.cookie-banner p { margin: 0; flex: 1 1 320px; font-size: .85rem; }
.cookie-banner a { color: var(--gold-400); }
.cookie-actions { display: flex; gap: .5rem; }
.cookie-banner .btn-outline { color: #fff; border-color: rgba(255,255,255,.5); }

/* ── Mobile bottom tab bar (app-style) ──────────────────── */
.mobile-tabbar { display: none; }
@media (max-width: 768px) {
    .mobile-tabbar {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
        background: rgba(255, 255, 255, .97);
        -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
        border-top: 1px solid var(--line);
        padding: .3rem .35rem calc(.3rem + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -6px 24px rgba(20, 39, 63, .08);
    }
    .mobile-tabbar a {
        flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
        padding: .32rem 0 .22rem; text-decoration: none;
        color: var(--ink-400); font-size: .6rem; font-weight: 700; line-height: 1.1;
        border-radius: 12px; transition: color .15s ease;
    }
    .mobile-tabbar svg { width: 22px; height: 22px; }
    .mobile-tabbar a.active { color: var(--navy-800); }
    .mobile-tabbar a.active svg { stroke: var(--gold-500); }
    .mobile-tabbar a:active { background: var(--gold-100); }
    body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
    .cookie-banner { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
}

/* ── Footer ─────────────────────────────────────────────── */
.site-footer { background: var(--navy-900); color: #b9c8d8; margin-top: 0; position: relative; }
.site-footer::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--gold-500), var(--red-500), var(--jade-500), var(--navy-600));
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; padding: 3rem 0 2rem; }
.footer-brand { display: flex; align-items: center; gap: .6rem; color: #fff; margin-bottom: .7rem; }
.footer-brand img { border-radius: 10px; }
.footer-col h4 { color: var(--gold-400); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .8rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li + li { margin-top: .45rem; }
.footer-col a { color: #b9c8d8; text-decoration: none; }
.footer-col a:hover { color: #fff; }
.footer-zh { font-size: .85rem; color: #7e93a8; }
.footer-follow { margin-top: 1.2rem; }
.social-links { display: flex; flex-direction: column; gap: .45rem; }
.social-links a { color: #b9c8d8; text-decoration: none; font-weight: 600; }
.social-links a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .09); padding: 1.1rem 0; font-size: .85rem; }
.footer-bottom p { margin: 0; }

/* 404 */
.notfound-hanzi { font-size: 4rem; font-weight: 800; color: var(--gold-500); margin-bottom: 0; }

/* ── Legal pages ────────────────────────────────────────── */
.legal h2 { margin-top: 1.8em; font-size: 1.25rem; }
.legal h3 { margin-top: 1.2em; }
.legal hr { border: 0; border-top: 2px dashed var(--line); margin: 2.5rem 0; }

/* ═══ Responsive ═══ */
@media (max-width: 1020px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .blog-layout, .article-layout, .course-layout { grid-template-columns: 1fr; }
    .sticky-sidebar { position: static; }
    .course-hero-inner { grid-template-columns: 1fr; }
}

@media (max-width: 1080px) {
    /* Mobile nav drawer */
    .nav-toggle { display: flex; }
    .main-nav {
        position: fixed; top: 0; right: 0; bottom: 0; z-index: 60;
        width: min(320px, 86vw);
        background: #fff; box-shadow: var(--shadow-lg);
        flex-direction: column; align-items: stretch; gap: 0;
        padding: calc(var(--header-h) + .5rem) 1.2rem 2rem;
        transform: translateX(105%); transition: transform .28s ease;
        overflow-y: auto; overscroll-behavior: contain;
    }
    .main-nav.open { transform: translateX(0); }
    .main-nav ul { flex-direction: column; align-items: stretch; gap: .15rem; }
    .main-nav ul a, .nav-drop-btn { padding: .8rem .6rem; font-size: 1.02rem; width: 100%; text-align: left; }
    .dropdown { position: static; box-shadow: none; border: 0; padding-left: 1rem !important; }
    .nav-actions { flex-direction: column; align-items: stretch; gap: .6rem; margin-top: 1rem; border-top: 1px solid var(--line); padding-top: 1rem; }
    .nav-actions .btn { justify-content: center; }
    .lang-switch { text-align: center; }
    body.nav-locked { overflow: hidden; }
}

@media (max-width: 860px) {
    :root { --header-h: 62px; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .hero-inner { grid-template-columns: 1fr; gap: 2rem; }
    .hero-visual { min-height: 260px; max-width: 460px; margin-inline: auto; width: 100%; }
    .newsletter-inner { grid-template-columns: 1fr; }
    .about-band-inner { grid-template-columns: 1fr; text-align: center; }
    .about-band-media img { max-width: 200px; }
    .about-band-actions { justify-content: center; }
    .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .hero { padding: 2.4rem 0 3rem; }
    .hero-cta .btn { width: 100%; justify-content: center; }
    .hero-card-main { position: relative; inset: auto; margin-inline: auto; }
    .hero-card-a, .hero-card-b, .hero-card-c { display: none; }
    .hero-visual { min-height: 0; }
    .section-head-row { flex-direction: column; gap: .3rem; }
    .lesson-nav { grid-template-columns: 1fr; }
    .lesson-nav-btn.next { text-align: left; align-items: flex-start; }
    .bubble { max-width: 94%; }
    .hanzi-text { font-size: 1.2rem; }
    .pinyin-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: .5rem; }
    .tone-grid { grid-template-columns: 1fr 1fr; }
    .tone-btns { grid-template-columns: repeat(2, 1fr); }
    .newsletter-form { flex-direction: column; }
    .newsletter-form .btn { width: 100%; }
    .premium-teaser, .continue-card { flex-direction: column; align-items: flex-start; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.4rem; }
    .footer-about { grid-column: 1 / -1; }
    .page-search { flex-direction: column; }
    .page-search .btn { width: 100%; }
}

@media (max-width: 400px) {
    .tone-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
}

/* ── Print (lesson PDF) ─────────────────────────────────── */
@media print {
    .site-header, .site-footer, .lesson-toolbar, .lesson-nav, .lesson-complete,
    .cookie-banner, .ad-slot, .breadcrumbs, .blog-sidebar, .mobile-tabbar { display: none !important; }
    body { background: #fff; }
    .lesson-hero { background: none; color: #000; padding: 0; }
    .lesson-hero h1 { color: #000; }
    .card { box-shadow: none; }
}
