/* version: 0002 */
:root {
    --navy: #123a5a;
    --navy-deep: #092941;
    --teal: #17a99b;
    --teal-dark: #0c8178;
    --coral: #ff7c66;
    --yellow: #f5c94a;
    --sky: #eaf7fb;
    --mint: #e8f8f3;
    --cream: #fff8e8;
    --paper: #ffffff;
    --ink: #17344b;
    --muted: #657687;
    --line: #dce7ec;
    --success: #138a68;
    --danger: #c74747;
    --shadow: 0 18px 50px rgba(18, 58, 90, 0.12);
    --shadow-soft: 0 10px 28px rgba(18, 58, 90, 0.09);
    --radius: 22px;
    --page-width: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    color-scheme: light;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #f7fbfc;
    color: var(--ink);
    font-family: Inter, ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.55;
}

button,
input,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    color: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3,
strong {
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2.25rem, 5vw, 4.25rem);
    line-height: 1.04;
}

h2 {
    font-size: clamp(1.65rem, 3vw, 2.35rem);
    line-height: 1.15;
}

h3 {
    font-size: 1.35rem;
    line-height: 1.25;
}

:focus-visible {
    outline: 4px solid rgba(245, 201, 74, 0.75);
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.muted {
    color: var(--muted);
}

.zh-help {
    font-family: "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}

.chinese-hidden .zh-help {
    display: none !important;
}

.block-zh,
.heading-zh {
    display: block;
    margin-top: 5px;
    color: var(--teal-dark);
    font-size: 0.78em;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.45;
}

.block-zh {
    font-size: 0.92em;
}

.nav-zh {
    margin-left: 3px;
    color: var(--teal-dark);
    font-size: 0.76em;
}

.bilingual-button {
    flex-direction: column;
    gap: 2px;
}

.bilingual-button .zh-help {
    font-size: 0.76em;
    font-weight: 700;
}

.eyebrow {
    display: block;
    margin-bottom: 8px;
    color: var(--teal-dark);
    font-size: 0.75rem;
    font-weight: 850;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.eyebrow-light {
    color: #a7eee6;
}

.button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 11px 20px;
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 800;
    line-height: 1.2;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button-primary {
    background: var(--teal-dark);
    color: white;
    box-shadow: 0 8px 20px rgba(12, 129, 120, 0.22);
}

.button-primary:hover {
    background: #086f68;
}

.button-light {
    background: white;
    color: var(--navy);
    box-shadow: 0 10px 25px rgba(7, 34, 53, 0.16);
}

.button-ghost-light {
    border: 2px solid rgba(255, 255, 255, 0.38);
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.button-soft {
    background: var(--mint);
    color: var(--teal-dark);
}

.button-large {
    min-height: 54px;
    padding: 14px 24px;
}

.button-block {
    width: 100%;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.text-button,
.text-link {
    padding: 4px;
    border: 0;
    background: transparent;
    color: var(--teal-dark);
    cursor: pointer;
    font-weight: 800;
}

.site-header {
    position: sticky;
    z-index: 40;
    top: 0;
    display: grid;
    min-height: 74px;
    align-items: center;
    grid-template-columns: auto 1fr auto;
    gap: 28px;
    padding: 10px max(24px, calc((100vw - var(--page-width)) / 2));
    border-bottom: 1px solid rgba(18, 58, 90, 0.08);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--navy);
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 14px 14px 14px 5px;
    background: var(--coral);
    color: white;
    font-size: 1.45rem;
    font-weight: 950;
    box-shadow: 0 7px 18px rgba(255, 124, 102, 0.28);
}

.brand span:last-child {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.brand strong {
    font-size: 1.02rem;
}

.brand small {
    margin-top: 4px;
    color: var(--teal-dark);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.main-nav a {
    padding: 9px 14px;
    border-radius: 10px;
    color: #486174;
    font-weight: 750;
}

.main-nav a:hover {
    background: var(--sky);
    color: var(--navy);
}

.account {
    display: flex;
    align-items: center;
    gap: 9px;
}

.chinese-toggle {
    min-height: 38px;
    padding: 7px 11px;
    border: 1px solid #b9dfd9;
    border-radius: 999px;
    background: var(--mint);
    color: var(--teal-dark);
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 850;
}

.chinese-toggle[aria-pressed="false"] {
    border-color: var(--line);
    background: #f3f6f7;
    color: var(--muted);
}

.account-avatar,
.student-avatar {
    display: inline-grid;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: var(--yellow);
    color: var(--navy);
    font-weight: 900;
}

.account-name {
    font-size: 0.9rem;
    font-weight: 800;
}

.nav-toggle {
    display: none;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: white;
    font-weight: 800;
}

.site-footer {
    display: flex;
    max-width: var(--page-width);
    justify-content: space-between;
    margin: 60px auto 0;
    padding: 26px 24px 34px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.88rem;
}

.flash {
    position: fixed;
    z-index: 100;
    top: 86px;
    left: 50%;
    max-width: calc(100vw - 32px);
    padding: 12px 18px;
    transform: translateX(-50%);
    border-radius: 12px;
    background: var(--navy);
    color: white;
    box-shadow: var(--shadow-soft);
    font-weight: 750;
}

.page-shell {
    width: min(calc(100% - 36px), var(--page-width));
    margin: 0 auto;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 28px 0 20px;
    color: var(--muted);
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--teal-dark);
    font-weight: 750;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.section-heading h2 {
    margin-bottom: 0;
}

/* Login */
.login-page {
    overflow-x: hidden;
    background: white;
}

.login-layout {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
}

.login-story {
    position: relative;
    display: flex;
    overflow: hidden;
    min-height: 700px;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(34px, 6vw, 76px);
    background:
        radial-gradient(circle at 82% 23%, rgba(245, 201, 74, 0.94) 0 8%, transparent 8.3%),
        radial-gradient(circle at 18% 78%, rgba(255, 124, 102, 0.72) 0 13%, transparent 13.3%),
        linear-gradient(145deg, #0b6f70, #123a5a 72%);
    color: white;
}

.login-story::after {
    position: absolute;
    right: -130px;
    bottom: -100px;
    width: 440px;
    height: 440px;
    border: 70px solid rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    content: "";
}

.brand-light {
    position: relative;
    z-index: 2;
    color: white;
}

.brand-light small {
    color: #a7eee6;
}

.login-message {
    position: relative;
    z-index: 2;
    max-width: 660px;
    padding: 80px 0;
}

.login-message h1 {
    max-width: 700px;
    margin-bottom: 24px;
}

.login-message p {
    max-width: 530px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 1.2rem;
}

.floating-words {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 12px;
}

.floating-words span {
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    font-weight: 800;
}

.login-panel {
    display: grid;
    min-height: 700px;
    place-items: center;
    padding: 38px;
}

.login-card {
    width: min(100%, 430px);
}

.login-card h2 {
    margin-bottom: 8px;
}

.login-card > label {
    display: block;
    margin: 20px 0;
}

.login-card > label span {
    display: block;
    margin-bottom: 7px;
    font-weight: 800;
}

.login-card input {
    width: 100%;
    min-height: 52px;
    padding: 12px 14px;
    border: 1.5px solid #cbdade;
    border-radius: 13px;
    background: #fbfdfe;
    color: var(--ink);
}

.login-card input:focus {
    border-color: var(--teal);
    outline: 4px solid rgba(23, 169, 155, 0.12);
}

.form-error {
    margin-top: 18px;
    padding: 11px 13px;
    border-radius: 10px;
    background: #fff0ef;
    color: #a73c36;
    font-weight: 750;
}

.demo-logins {
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.demo-logins > p {
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.demo-logins button {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
    cursor: pointer;
    text-align: left;
}

.demo-logins button:hover {
    border-color: var(--teal);
    background: var(--mint);
}

.demo-logins span {
    color: var(--muted);
    font-size: 0.78rem;
}

/* Dashboard */
.welcome-band {
    position: relative;
    display: grid;
    overflow: hidden;
    min-height: 380px;
    align-items: center;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    gap: 30px;
    margin-top: 34px;
    padding: clamp(34px, 5vw, 66px);
    border-radius: 32px;
    background: linear-gradient(135deg, #123a5a 0%, #0e7272 100%);
    color: white;
    box-shadow: var(--shadow);
}

.welcome-band::before {
    position: absolute;
    top: -110px;
    right: -40px;
    width: 360px;
    height: 360px;
    border: 60px solid rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    content: "";
}

.welcome-student {
    background: linear-gradient(135deg, #123a5a 0%, #0d8e84 100%);
}

.welcome-band > div:first-child {
    position: relative;
    z-index: 2;
}

.welcome-band h1 {
    max-width: 760px;
    margin-bottom: 18px;
}

.welcome-band p {
    max-width: 650px;
    margin-bottom: 28px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.08rem;
}

.welcome-object {
    position: relative;
    z-index: 1;
    align-self: end;
}

.welcome-object img {
    width: min(100%, 320px);
    max-height: 285px;
    margin: 0 auto -24px;
    object-fit: contain;
    filter: drop-shadow(0 22px 26px rgba(4, 26, 39, 0.24));
}

.welcome-bubble {
    position: absolute;
    top: 5%;
    right: 0;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--yellow);
    color: var(--navy);
    font-weight: 900;
    transform: rotate(4deg);
}

.dashboard-section,
.unit-map {
    padding-top: 54px;
}

.teacher-action-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.feature-card {
    display: flex;
    min-height: 190px;
    flex-direction: column;
    padding: 25px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: white;
    box-shadow: var(--shadow-soft);
    transition: transform 160ms ease, border-color 160ms ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--teal);
}

.feature-card strong {
    margin: 20px 0 6px;
    font-size: 1.2rem;
}

.feature-card > span:last-child {
    color: var(--muted);
}

.feature-present {
    border: 0;
    background: var(--cream);
}

.feature-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 15px;
    background: var(--mint);
    color: var(--teal-dark);
    font-size: 1.2rem;
    font-weight: 900;
}

.continue-card {
    display: grid;
    overflow: hidden;
    grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
    border: 1px solid var(--line);
    border-radius: 26px;
    background: white;
    box-shadow: var(--shadow-soft);
}

.continue-card > img {
    width: 100%;
    height: 100%;
    min-height: 310px;
    object-fit: cover;
}

.continue-content {
    padding: clamp(28px, 5vw, 54px);
}

.lesson-pill {
    display: inline-flex;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--mint);
    color: var(--teal-dark);
    font-size: 0.8rem;
    font-weight: 850;
}

.continue-content h3 {
    margin: 18px 0 8px;
    font-size: 2rem;
}

.linear-progress,
.table-progress {
    overflow: hidden;
    height: 9px;
    border-radius: 999px;
    background: #e4eef1;
}

.linear-progress {
    margin: 26px 0;
}

.linear-progress span,
.table-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--teal), var(--yellow));
}

.unit-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.unit-card {
    display: flex;
    min-height: 92px;
    align-items: center;
    gap: 14px;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: white;
}

.unit-card > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.unit-card span:last-child {
    color: var(--muted);
    font-size: 0.82rem;
}

.unit-number {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 13px;
    background: #edf3f5;
    color: var(--navy);
    font-weight: 900;
}

.unit-current {
    border-color: rgba(23, 169, 155, 0.42);
    background: var(--mint);
}

.unit-current .unit-number {
    background: var(--teal-dark);
    color: white;
}

.unit-locked {
    opacity: 0.62;
}

/* Lesson */
.lesson-hero {
    display: grid;
    min-height: 300px;
    align-items: center;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 28px;
    padding: clamp(32px, 5vw, 58px);
    border-radius: 30px;
    background:
        radial-gradient(circle at 90% 20%, rgba(245, 201, 74, 0.62), transparent 18%),
        var(--sky);
}

.lesson-hero h1 {
    margin: 16px 0 13px;
    color: var(--navy);
}

.lesson-hero p {
    color: #4b687a;
    font-size: 1.12rem;
}

.lesson-hero img {
    width: 100%;
    max-height: 230px;
    object-fit: contain;
    filter: drop-shadow(0 17px 23px rgba(18, 58, 90, 0.17));
}

.lesson-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.lesson-meta span {
    padding: 6px 10px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.68);
    color: var(--navy);
    font-size: 0.82rem;
    font-weight: 800;
}

.lesson-section {
    padding-top: 54px;
}

.vocabulary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.vocabulary-card {
    position: relative;
    display: grid;
    min-height: 280px;
    place-items: center;
    padding: 24px 20px 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: white;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(18, 58, 90, 0.07);
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.vocabulary-card:hover,
.vocabulary-card.is-speaking {
    transform: translateY(-4px);
    border-color: var(--teal);
    background: var(--mint);
}

.vocabulary-card img {
    width: 100%;
    height: 170px;
    object-fit: contain;
}

.word-number {
    position: absolute;
    top: 14px;
    left: 14px;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: var(--coral);
    color: white;
    font-weight: 900;
}

.word-text {
    color: var(--navy);
    font-size: 1.32rem;
    font-weight: 900;
}

.word-text small {
    color: var(--teal-dark);
    font-size: 0.86rem;
}

.word-zh {
    color: var(--teal-dark);
    font-size: 1rem;
    font-weight: 850;
}

.tap-hint {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 750;
}

.audio-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.audio-card {
    display: grid;
    min-height: 88px;
    align-items: center;
    grid-template-columns: 48px 1fr 42px;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: white;
    cursor: pointer;
    text-align: left;
}

.audio-card:hover {
    border-color: var(--teal);
    background: var(--mint);
}

.audio-card-number,
.audio-play {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 50%;
    background: var(--teal);
    color: white;
    font-weight: 900;
}

.audio-card > span:nth-child(2) {
    display: flex;
    flex-direction: column;
}

.audio-card small {
    margin-top: 3px;
    color: var(--muted);
}

.audio-card .audio-title-zh {
    color: var(--teal-dark);
    font-size: 0.76rem;
    font-weight: 750;
}

.audio-play {
    width: 38px;
    height: 38px;
    background: var(--navy);
    font-size: 0.8rem;
}

.language-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 54px;
    padding: clamp(28px, 5vw, 50px);
    border-radius: 26px;
    background: var(--cream);
}

.language-card h2 {
    margin-bottom: 12px;
}

.model-sentence {
    color: var(--navy);
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 800;
}

.model-sentence strong {
    color: var(--coral);
}

.lesson-next-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 30px;
    padding: 32px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: white;
    box-shadow: var(--shadow-soft);
}

.lesson-next-card h2 {
    margin-bottom: 6px;
}

.lesson-next-card p {
    margin-bottom: 0;
    color: var(--muted);
}

/* Audio dock */
.audio-dock {
    position: fixed;
    z-index: 120;
    right: 24px;
    bottom: 22px;
    left: 24px;
    display: grid;
    max-width: 720px;
    min-height: 70px;
    align-items: center;
    grid-template-columns: 48px minmax(0, 1fr) auto 40px auto;
    gap: 12px;
    margin: 0 auto;
    padding: 10px 13px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    background: rgba(9, 41, 65, 0.96);
    color: white;
    box-shadow: 0 18px 54px rgba(4, 24, 38, 0.34);
    backdrop-filter: blur(16px);
}

.audio-main-button,
.audio-small-button {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--coral);
    color: white;
    cursor: pointer;
    font-weight: 900;
}

.audio-small-button {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.12);
}

.audio-meta {
    min-width: 0;
}

.audio-meta strong {
    display: block;
    overflow: hidden;
    font-size: 0.86rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.audio-progress {
    overflow: hidden;
    height: 4px;
    margin-top: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
}

.audio-progress span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--yellow);
}

.audio-time {
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
}

.audio-speed {
    min-height: 36px;
    border: 0;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.12);
    color: white;
}

/* Practice */
.practice-page {
    max-width: 900px;
}

.practice-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 0 12px;
}

.practice-header h1 {
    margin-bottom: 10px;
}

.score-orbit {
    display: grid;
    width: 112px;
    height: 112px;
    flex: 0 0 auto;
    place-content: center;
    border: 12px solid var(--mint);
    border-radius: 50%;
    background: white;
    text-align: center;
}

.score-orbit strong {
    color: var(--teal-dark);
    font-size: 2.1rem;
    line-height: 1;
}

.practice-list {
    display: grid;
    gap: 20px;
    padding: 24px 0 80px;
}

.practice-card {
    padding: clamp(23px, 4vw, 38px);
    border: 1px solid var(--line);
    border-radius: 24px;
    background: white;
    box-shadow: var(--shadow-soft);
}

.practice-card > header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 24px;
}

.practice-card header strong {
    display: block;
    color: var(--navy);
    font-size: 1.25rem;
}

.practice-card header p {
    margin: 2px 0 0;
    color: var(--muted);
}

.question-number {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 13px;
    background: var(--coral);
    color: white;
    font-size: 1.05rem;
    font-weight: 900;
}

.hear-word {
    min-height: 50px;
    padding: 10px 18px;
    border: 0;
    border-radius: 14px;
    background: var(--navy);
    color: white;
    cursor: pointer;
    font-weight: 850;
}

.picture-choices {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 13px;
    margin-top: 20px;
}

.picture-choices button {
    display: grid;
    min-height: 190px;
    place-items: center;
    padding: 12px;
    border: 2px solid var(--line);
    border-radius: 17px;
    background: #fbfdfe;
    cursor: pointer;
    font-weight: 850;
}

.picture-choices img {
    width: 100%;
    height: 130px;
    object-fit: contain;
}

.picture-choices button.selected,
.text-choices button.selected {
    border-color: var(--teal);
    background: var(--mint);
}

.picture-choices button.correct,
.text-choices button.correct {
    border-color: var(--success);
    background: #e4f8ef;
}

.picture-choices button.incorrect,
.text-choices button.incorrect {
    border-color: var(--danger);
    background: #fff0ef;
}

.text-choices {
    display: flex;
    gap: 14px;
}

.text-choices button {
    min-width: 120px;
    min-height: 70px;
    padding: 14px 26px;
    border: 2px solid var(--line);
    border-radius: 16px;
    background: white;
    cursor: pointer;
    color: var(--navy);
    font-size: 1.5rem;
    font-weight: 900;
}

.spelling-row {
    display: grid;
    align-items: center;
    grid-template-columns: 140px 1fr;
    gap: 24px;
}

.spelling-row img {
    width: 140px;
    height: 110px;
    object-fit: contain;
}

.spelling-row input {
    width: 100%;
    min-height: 60px;
    padding: 12px 17px;
    border: 2px solid var(--line);
    border-radius: 15px;
    color: var(--navy);
    font-size: 1.35rem;
    font-weight: 800;
}

.spelling-row input.correct {
    border-color: var(--success);
    background: #e4f8ef;
}

.spelling-row input.incorrect {
    border-color: var(--danger);
    background: #fff0ef;
}

.sentence-answer {
    display: flex;
    min-height: 72px;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border: 2px dashed #b9cbd2;
    border-radius: 15px;
    background: #fbfdfe;
}

.sentence-answer span {
    color: #92a2ad;
}

.sentence-answer button,
.word-bank button {
    min-height: 46px;
    padding: 9px 16px;
    border: 0;
    border-radius: 12px;
    background: var(--sky);
    color: var(--navy);
    cursor: pointer;
    font-weight: 900;
}

.word-bank {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.word-bank button {
    background: var(--navy);
    color: white;
}

.word-bank button:disabled {
    opacity: 0.25;
}

.reset-sequence {
    margin-top: 10px;
}

.question-feedback {
    min-height: 24px;
    margin: 15px 0 0;
    font-weight: 800;
}

.question-feedback.is-correct {
    color: var(--success);
}

.question-feedback.is-incorrect {
    color: var(--danger);
}

.practice-submit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 25px;
    border-radius: 22px;
    background: var(--cream);
}

.practice-submit > div {
    display: flex;
    flex-direction: column;
}

.practice-submit span {
    color: var(--muted);
}

.result-modal {
    position: fixed;
    z-index: 200;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(9, 41, 65, 0.68);
    backdrop-filter: blur(7px);
}

.result-card {
    width: min(100%, 430px);
    padding: 40px;
    border-radius: 28px;
    background: white;
    box-shadow: var(--shadow);
    text-align: center;
}

.result-star {
    display: grid;
    width: 82px;
    height: 82px;
    place-items: center;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: var(--yellow);
    color: white;
    font-size: 2.7rem;
}

.result-card .button-row {
    justify-content: center;
    margin-top: 26px;
}

/* Progress */
.page-title-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 0 28px;
}

.page-title-row h1 {
    margin-bottom: 5px;
}

.page-title-row p {
    margin-bottom: 0;
    color: var(--muted);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 22px;
}

.stat-grid article {
    display: flex;
    min-height: 120px;
    flex-direction: column;
    justify-content: center;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: white;
}

.stat-grid span {
    color: var(--muted);
    font-weight: 750;
}

.stat-grid strong {
    color: var(--navy);
    font-size: 2.2rem;
}

.progress-table-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: white;
}

.progress-table {
    width: 100%;
    border-collapse: collapse;
}

.progress-table th,
.progress-table td {
    padding: 17px 20px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.progress-table th {
    background: #f2f7f8;
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.progress-table tr:last-child td {
    border-bottom: 0;
}

.progress-table td:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-table td:nth-child(2) {
    display: grid;
    align-items: center;
    grid-template-columns: minmax(100px, 1fr) 42px;
    gap: 9px;
}

.status-pill {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 850;
}

.status-mastered {
    background: #e4f8ef;
    color: var(--success);
}

.status-developing {
    background: var(--cream);
    color: #8a6510;
}

.status-starting {
    background: var(--sky);
    color: var(--navy);
}

/* Presentation mode */
.presentation-page {
    overflow: hidden;
    background: #0a2235;
}

.presentation-header {
    position: relative;
    z-index: 80;
    display: grid;
    height: 66px;
    align-items: center;
    grid-template-columns: 230px 1fr auto;
    gap: 16px;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--navy-deep);
    color: white;
}

.presentation-brand {
    font-weight: 900;
}

.presentation-brand span {
    margin-right: 8px;
    color: #84d9d0;
    font-size: 1.25rem;
}

.presentation-title {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    line-height: 1.18;
}

.presentation-title span {
    color: #9bb5c5;
    font-size: 0.78rem;
}

.presentation-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.presentation-header-actions button {
    min-height: 42px;
    padding: 8px 13px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    cursor: pointer;
    font-weight: 800;
}

.presentation-header-actions button[aria-pressed="true"] {
    border-color: var(--yellow);
    background: var(--yellow);
    color: var(--navy);
}

.teacher-chip {
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--teal-dark);
    font-size: 0.82rem;
    font-weight: 800;
}

.presentation-layout {
    display: grid;
    height: calc(100vh - 66px);
    min-height: 0;
    grid-template-columns: 210px minmax(460px, 1fr) 300px;
    overflow: hidden;
}

.presentation-pages,
.presentation-panel {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    background: #102d42;
    color: white;
}

.presentation-pages {
    padding: 14px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.book-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    padding: 4px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.07);
}

.book-tabs button {
    min-height: 38px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #a8bdca;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 850;
}

.book-tabs button.active {
    background: white;
    color: var(--navy);
}

.page-thumbnails {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.page-thumbnails button {
    overflow: hidden;
    padding: 6px;
    border: 2px solid transparent;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: white;
    cursor: pointer;
}

.page-thumbnails button.active {
    border-color: var(--yellow);
    background: rgba(245, 201, 74, 0.12);
}

.page-thumbnails button.filtered-out {
    display: none;
}

.page-thumbnails img {
    width: 100%;
    aspect-ratio: 210 / 297;
    border-radius: 7px;
    background: white;
    object-fit: cover;
    object-position: top;
}

.page-thumbnails span {
    display: block;
    padding-top: 5px;
    font-size: 0.73rem;
    font-weight: 800;
}

.keyboard-help {
    display: grid;
    gap: 5px;
    margin-top: 22px;
    padding: 12px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.05);
    color: #a8bdca;
    font-size: 0.72rem;
}

.keyboard-help strong {
    color: white;
}

.presentation-workspace {
    display: grid;
    min-height: 0;
    min-width: 0;
    grid-template-rows: 54px minmax(0, 1fr) 48px;
    overflow: hidden;
    background: #d9e3e7;
}

.presentation-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 12px;
    background: white;
    box-shadow: 0 2px 12px rgba(18, 58, 90, 0.12);
}

.presentation-toolbar button {
    min-width: 42px;
    min-height: 38px;
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: white;
    cursor: pointer;
    color: var(--navy);
    font-weight: 850;
}

.presentation-toolbar button:hover,
.presentation-toolbar button[aria-pressed="true"] {
    border-color: var(--teal);
    background: var(--mint);
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    margin: 0 5px;
    background: var(--line);
}

.presentation-viewport {
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: 18px;
}

.presentation-stage {
    position: relative;
    display: grid;
    min-width: 100%;
    min-height: 100%;
    place-items: center;
    --spot-x: 50%;
    --spot-y: 50%;
}

.presentation-stage.spotlight-on::after {
    position: fixed;
    z-index: 25;
    inset: 120px 300px 48px 210px;
    pointer-events: none;
    background: radial-gradient(circle 150px at var(--spot-x) var(--spot-y), transparent 0 55%, rgba(3, 19, 31, 0.78) 72%);
    content: "";
}

.book-page {
    position: relative;
    width: min(100%, 820px);
    max-width: none;
    transition: width 120ms ease;
}

.book-page > img {
    width: 100%;
    border-radius: 5px;
    background: white;
    box-shadow: 0 18px 42px rgba(5, 27, 42, 0.26);
    user-select: none;
}

[data-draw-canvas] {
    position: absolute;
    z-index: 15;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    touch-action: none;
}

[data-draw-canvas].drawing-active {
    pointer-events: auto;
    cursor: crosshair;
}

[data-draw-canvas].erasing-active {
    pointer-events: auto;
    cursor: cell;
}

.page-text-layer {
    position: absolute;
    z-index: 16;
    inset: 0;
    pointer-events: none;
}

.page-text-layer.text-tool-active {
    pointer-events: auto;
    cursor: text;
}

.page-text-note {
    position: absolute;
    display: grid;
    min-width: 170px;
    min-height: 52px;
    grid-template-columns: minmax(0, 1fr) 28px;
    padding: 7px 7px 7px 11px;
    border: 2px solid #e0ad18;
    border-radius: 10px;
    background: rgba(255, 249, 204, 0.96);
    box-shadow: 0 7px 20px rgba(7, 34, 53, 0.22);
    color: #14354d;
    pointer-events: auto;
    resize: both;
    overflow: auto;
}

.text-note-editor {
    min-width: 120px;
    min-height: 34px;
    padding: 3px;
    outline: 0;
    font-family: "Arial Rounded MT Bold", Inter, system-ui, sans-serif;
    font-size: clamp(18px, 2.2vw, 30px);
    font-weight: 800;
    line-height: 1.25;
}

.text-note-editor:empty::before {
    color: #8a773b;
    content: attr(data-placeholder);
    font-size: 0.7em;
    font-weight: 650;
}

.text-note-remove {
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f05b54;
    color: white;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1;
}

.page-audio-hotspots {
    position: absolute;
    z-index: 18;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
}

.page-audio-hotspots button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border: 3px solid white;
    border-radius: 999px;
    background: var(--teal-dark);
    color: white;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(7, 34, 53, 0.3);
    font-weight: 900;
}

.presentation-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    background: white;
}

.presentation-pager button {
    min-height: 36px;
    padding: 6px 12px;
    border: 0;
    border-radius: 8px;
    background: var(--sky);
    color: var(--navy);
    cursor: pointer;
    font-weight: 800;
}

.presentation-panel {
    padding: 16px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-section {
    margin-bottom: 14px;
    padding: 14px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.07);
}

.panel-section .eyebrow {
    color: #84d9d0;
}

.presentation-audio-list {
    display: grid;
    gap: 7px;
}

.presentation-audio-list button {
    display: grid;
    min-height: 52px;
    align-items: center;
    grid-template-columns: 35px 1fr;
    gap: 9px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.06);
    color: white;
    cursor: pointer;
    text-align: left;
}

.presentation-audio-list button span:first-child {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: var(--coral);
    font-weight: 900;
}

.presentation-audio-list small {
    display: block;
    color: #9db5c3;
}

.mini-word-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 7px;
}

.mini-word-grid button {
    overflow: hidden;
    padding: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: white;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 800;
}

.mini-word-grid button:hover {
    border-color: var(--yellow);
    background: rgba(245, 201, 74, 0.12);
}

.mini-word-grid img {
    width: 100%;
    height: 54px;
    border-radius: 7px;
    background: white;
    object-fit: contain;
}

.class-challenge [data-challenge-card] {
    display: grid;
    min-height: 105px;
    place-content: center;
    margin-bottom: 10px;
    padding: 12px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    text-align: center;
}

.class-challenge [data-challenge-card] img {
    width: 100%;
    height: 110px;
    object-fit: contain;
}

.class-challenge p {
    margin: 4px 0 0;
    color: #a8bdca;
    font-size: 0.8rem;
}

.answer-panel {
    border: 1px solid rgba(245, 201, 74, 0.4);
    background: rgba(245, 201, 74, 0.11);
}

.answer-panel ol {
    margin: 0;
    padding-left: 21px;
}

.answer-panel li {
    margin-top: 8px;
    color: #f7f9fa;
    font-size: 0.83rem;
}

/* Empty/error */
.centered-page {
    display: grid;
    min-height: 65vh;
    place-items: center;
    padding: 30px;
}

.empty-state {
    max-width: 520px;
    padding: 42px;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: white;
    box-shadow: var(--shadow-soft);
    text-align: center;
}

.empty-icon {
    display: grid;
    width: 62px;
    height: 62px;
    place-items: center;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: var(--cream);
    color: #9b6715;
    font-size: 1.8rem;
    font-weight: 900;
}

@media (max-width: 1050px) {
    .site-header {
        grid-template-columns: auto auto 1fr;
    }

    .nav-toggle {
        display: inline-block;
    }

    .main-nav {
        position: absolute;
        z-index: 50;
        top: 67px;
        left: 18px;
        display: none;
        width: 220px;
        align-items: stretch;
        flex-direction: column;
        padding: 10px;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: white;
        box-shadow: var(--shadow);
    }

    .main-nav.open {
        display: flex;
    }

    .account {
        justify-self: end;
    }

    .teacher-action-grid,
    .vocabulary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .unit-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .presentation-layout {
        grid-template-columns: 150px minmax(430px, 1fr) 250px;
    }

    .presentation-stage.spotlight-on::after {
        right: 250px;
        left: 150px;
    }

    .presentation-header {
        grid-template-columns: 160px 1fr auto;
    }

    .teacher-chip {
        display: none;
    }
}

@media (max-width: 820px) {
    .login-layout {
        grid-template-columns: 1fr;
    }

    .login-story {
        min-height: 380px;
    }

    .login-message {
        padding: 55px 0 20px;
    }

    .login-panel {
        min-height: auto;
        padding: 48px 24px;
    }

    .welcome-band,
    .lesson-hero {
        grid-template-columns: 1fr;
    }

    .welcome-object {
        display: none;
    }

    .lesson-hero img {
        max-height: 200px;
    }

    .continue-card {
        grid-template-columns: 1fr;
    }

    .continue-card > img {
        min-height: 220px;
        max-height: 260px;
    }

    .language-card,
    .lesson-next-card,
    .practice-submit,
    .page-title-row {
        align-items: stretch;
        flex-direction: column;
    }

    .progress-table-card {
        overflow-x: auto;
    }

    .progress-table {
        min-width: 720px;
    }

    .presentation-layout {
        grid-template-columns: 110px minmax(420px, 1fr);
    }

    .presentation-panel {
        position: fixed;
        z-index: 60;
        top: 66px;
        right: 0;
        bottom: 0;
        width: 280px;
        transform: translateX(100%);
        transition: transform 180ms ease;
    }

    .presentation-page.panel-open .presentation-panel {
        transform: translateX(0);
    }

    .presentation-stage.spotlight-on::after {
        right: 0;
        left: 110px;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 16px;
    }

    .site-header {
        grid-template-columns: auto auto 1fr;
        padding: 10px 14px;
    }

    .brand span:last-child,
    .account-name {
        display: none;
    }

    .account {
        gap: 4px;
    }

    .chinese-toggle {
        max-width: 78px;
        padding: 6px 8px;
        font-size: 0.7rem;
    }

    .account .text-button {
        font-size: 0.78rem;
    }

    .page-shell {
        width: min(calc(100% - 24px), var(--page-width));
    }

    .welcome-band {
        min-height: 420px;
        margin-top: 16px;
        padding: 30px 24px;
        border-radius: 24px;
    }

    .teacher-action-grid,
    .vocabulary-grid,
    .audio-card-grid,
    .unit-grid,
    .stat-grid {
        grid-template-columns: 1fr;
    }

    .section-heading,
    .practice-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .lesson-hero {
        padding: 28px 22px;
        border-radius: 22px;
    }

    .vocabulary-card {
        min-height: 230px;
    }

    .vocabulary-card img {
        height: 135px;
    }

    .picture-choices {
        grid-template-columns: 1fr;
    }

    .picture-choices button {
        min-height: 150px;
    }

    .spelling-row {
        grid-template-columns: 90px 1fr;
    }

    .spelling-row img {
        width: 90px;
        height: 90px;
    }

    .score-orbit {
        width: 86px;
        height: 86px;
        border-width: 9px;
    }

    .audio-dock {
        right: 10px;
        bottom: 10px;
        left: 10px;
        grid-template-columns: 43px minmax(0, 1fr) auto;
    }

    .audio-time,
    .audio-small-button {
        display: none;
    }

    .audio-speed {
        width: 65px;
    }

    .site-footer {
        align-items: center;
        flex-direction: column;
        gap: 5px;
    }

    .presentation-header {
        grid-template-columns: auto 1fr auto;
        padding: 7px 9px;
    }

    .presentation-title strong {
        font-size: 0.82rem;
    }

    .presentation-header-actions button:first-child {
        display: none;
    }

    .presentation-layout {
        grid-template-columns: 1fr;
    }

    .presentation-pages {
        display: none;
    }

    .presentation-workspace {
        grid-template-rows: auto minmax(0, 1fr) 44px;
    }

    .presentation-toolbar {
        overflow-x: auto;
        justify-content: flex-start;
    }

    .presentation-toolbar button {
        flex: 0 0 auto;
    }

    .presentation-stage.spotlight-on::after {
        top: 120px;
        right: 0;
        bottom: 44px;
        left: 0;
    }

    .page-audio-hotspots {
        top: 6px;
        right: 6px;
        flex-direction: column;
    }

    .page-audio-hotspots button {
        min-height: 42px;
        padding: 7px 10px;
        border-width: 2px;
        font-size: 0.76rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
