/* =========================================================
   琉璃英语 — public site styles
   A single, dependency-free stylesheet designed for shared hosting.
   ========================================================= */

:root {
    --bg: #f7f4fb;
    --bg-soft: #f1ecf9;
    --surface: #ffffff;
    --surface-2: #fbf9ff;
    --ink: #1c1233;
    --ink-2: #35254f;
    --muted: #746986;
    --muted-2: #9a8fab;
    --line: #e9e2f2;
    --line-strong: #ddd2ec;
    --violet: #6d47f5;
    --violet-deep: #5730df;
    --violet-soft: #eee8ff;
    --violet-pale: #f7f3ff;
    --deep: #170c2d;
    --deep-2: #241041;
    --deep-3: #321559;
    --peach: #ff9d6b;
    --orange: #ff8a4c;
    --green: #19a97b;
    --green-soft: #e5f8f1;
    --rose: #ef5d88;
    --rose-soft: #ffedf3;
    --sky: #4d8ef7;
    --shadow-xs: 0 2px 8px rgba(33, 17, 61, .05);
    --shadow-sm: 0 8px 24px rgba(35, 18, 67, .07);
    --shadow-md: 0 20px 50px rgba(31, 16, 59, .10);
    --shadow-lg: 0 36px 90px rgba(27, 12, 54, .18);
    --radius-sm: 12px;
    --radius: 18px;
    --radius-lg: 26px;
    --radius-xl: 34px;
    --container: 1240px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    --font-en: "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --ease: cubic-bezier(.22, .8, .28, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.no-scroll {
    overflow: hidden;
}

[hidden] {
    display: none !important;
}

img,
video,
svg {
    display: block;
}

img {
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

input[type="checkbox"],
input[type="radio"] {
    width: 15px;
    height: 15px;
    min-height: 0;
    padding: 0;
    accent-color: var(--violet);
    flex: none;
    box-shadow: none;
    border-radius: 4px;
}

button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

h1,
h2,
h3,
h4,
p {
    margin: 0;
}

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

::selection {
    background: #d9ccff;
    color: #281149;
}

:focus-visible {
    outline: 3px solid rgba(109, 71, 245, .38);
    outline-offset: 3px;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 28px;
}

.skip-link {
    position: fixed;
    top: -80px;
    left: 20px;
    z-index: 9999;
    background: var(--ink);
    color: #fff;
    padding: 10px 18px;
    border-radius: 10px;
    transition: top .2s;
}

.skip-link:focus {
    top: 16px;
}

/* ---------- scrollbar ---------- */
* {
    scrollbar-width: thin;
    scrollbar-color: #cfc2e3 transparent;
}

*::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

*::-webkit-scrollbar-thumb {
    background: #cfc2e3;
    border-radius: 20px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

/* =========================================================
   Brand
   ========================================================= */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    flex-shrink: 0;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(145deg, #a58bff, #5b35e8 70%);
    display: grid;
    place-items: center;
    color: #fff;
    box-shadow: 0 8px 20px rgba(94, 54, 233, .34), inset 0 1px 0 rgba(255, 255, 255, .34);
    position: relative;
    overflow: hidden;
}

.brand-mark::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 11px;
    border: 1px solid rgba(255, 255, 255, .22);
}

.brand-wave {
    width: 21px;
    height: 21px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.brand-text strong {
    font-size: 18px;
    line-height: 1.25;
    font-weight: 750;
    letter-spacing: -.02em;
}

.brand-text small {
    font-size: 8px;
    letter-spacing: .14em;
    color: var(--muted-2);
    font-weight: 700;
    line-height: 1.3;
}

.brand--light .brand-text strong {
    color: #fff;
}

.brand--light .brand-text small {
    color: rgba(255, 255, 255, .46);
}

.brand--footer .brand-text strong {
    color: #fff;
}

.brand--footer .brand-text small {
    color: rgba(255, 255, 255, .4);
}

.brand--compact .brand-text strong {
    font-size: 17px;
}

/* =========================================================
   Buttons, chips, basic form controls
   ========================================================= */
.btn {
    --btn-bg: transparent;
    --btn-color: var(--ink);
    --btn-border: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 21px;
    border: 1px solid var(--btn-border);
    border-radius: 999px;
    background: var(--btn-bg);
    color: var(--btn-color);
    font-size: 14px;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
    transition: transform .22s var(--ease), box-shadow .22s var(--ease), background .22s, color .22s, border-color .22s;
    position: relative;
    isolation: isolate;
}

.btn svg {
    flex: none;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    --btn-bg: linear-gradient(135deg, #7c56ff, #5a30e2);
    --btn-color: #fff;
    box-shadow: 0 10px 26px rgba(93, 52, 230, .30), inset 0 1px 0 rgba(255, 255, 255, .24);
}

.btn-primary:hover {
    box-shadow: 0 14px 32px rgba(93, 52, 230, .38), inset 0 1px 0 rgba(255, 255, 255, .26);
}

.btn-secondary {
    --btn-bg: #fff;
    --btn-color: var(--ink);
    --btn-border: var(--line);
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
    --btn-border: #d7c9eb;
    box-shadow: var(--shadow-sm);
}

.btn-ghost {
    --btn-bg: transparent;
    --btn-color: var(--ink-2);
    --btn-border: var(--line);
}

.btn-ghost:hover {
    --btn-bg: #f8f4ff;
    --btn-border: #dacdf0;
}

.btn-white {
    --btn-bg: #fff;
    --btn-color: #2b1750;
    box-shadow: 0 16px 34px rgba(0, 0, 0, .2);
}

.btn-white:hover {
    --btn-bg: #fdfbff;
}

.btn-outline-light {
    --btn-bg: rgba(255, 255, 255, .06);
    --btn-color: #fff;
    --btn-border: rgba(255, 255, 255, .28);
    backdrop-filter: blur(10px);
}

.btn-outline-light:hover {
    --btn-bg: rgba(255, 255, 255, .13);
}

.btn-lg {
    min-height: 52px;
    padding: 0 27px;
    font-size: 15px;
}

.btn-sm {
    min-height: 38px;
    padding: 0 16px;
    font-size: 13px;
}

.btn-xs {
    min-height: 31px;
    padding: 0 12px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

.btn[disabled] {
    pointer-events: none;
}

.icon-btn {
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(255, 255, 255, .8);
    display: inline-grid;
    place-items: center;
    color: var(--ink-2);
    transition: background .2s, border-color .2s, transform .2s, color .2s;
    flex: none;
}

.icon-btn:hover {
    background: #fff;
    border-color: #d7c8ed;
    transform: translateY(-1px);
}

.icon-btn.is-active {
    color: var(--violet);
    background: var(--violet-soft);
    border-color: #d9caff;
}

.icon-btn-sm {
    width: 34px;
    height: 34px;
}

.icon-btn-sm svg {
    width: 16px;
    height: 16px;
}

.text-btn {
    border: 0;
    background: none;
    padding: 0;
    color: var(--muted);
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.text-btn:hover {
    color: var(--violet);
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--violet);
    font-size: 14px;
    font-weight: 650;
}

.text-link:hover {
    gap: 10px;
}

.text-danger-btn {
    border: 0;
    background: none;
    padding: 6px 0;
    color: #d24553;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.chip {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    border-radius: 999px;
    min-height: 38px;
    padding: 0 15px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 550;
    white-space: nowrap;
    transition: all .2s var(--ease);
}

.chip em {
    font-style: normal;
    font-size: 10px;
    color: var(--muted-2);
    background: #f1ecf7;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: inline-grid;
    place-items: center;
    padding: 0 5px;
}

.chip:hover {
    border-color: #d5c7ea;
    color: var(--ink);
    transform: translateY(-1px);
}

.chip.is-active {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
    box-shadow: 0 6px 16px rgba(28, 18, 51, .18);
}

.chip.is-active em {
    background: rgba(255, 255, 255, .16);
    color: #fff;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 600;
    white-space: nowrap;
}

.category-pill--peach {
    color: #a14b1f;
    background: #fff0e7;
}

.category-pill--blue,
.category-pill--sky {
    color: #2f5da8;
    background: #e9f1ff;
}

.category-pill--green,
.category-pill--teal {
    color: #11765c;
    background: #e5f7f0;
}

.category-pill--pink,
.category-pill--rose {
    color: #ab3a64;
    background: #ffeaf2;
}

.category-pill--orange {
    color: #a35617;
    background: #fff1df;
}

.category-pill--violet,
.category-pill--indigo {
    color: #5730c8;
    background: #efe9ff;
}

.category-pill--red {
    color: #b23932;
    background: #ffece9;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #1fbd8b;
    display: inline-block;
    box-shadow: 0 0 0 4px rgba(31, 189, 139, .12);
    flex: none;
}

.status-dot.is-online {
    background: #20c997;
}

/* fields */
.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.field > span {
    font-size: 12.5px;
    font-weight: 650;
    color: var(--ink-2);
    display: flex;
    align-items: center;
    gap: 6px;
}

.field > span em {
    font-style: normal;
    color: #e04b5d;
}

.field input,
.field select,
.field textarea,
.form-grid input,
.form-grid select,
.form-grid textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: #fcfaff;
    border-radius: 11px;
    padding: 11px 13px;
    font-size: 14px;
    color: var(--ink);
    transition: border-color .2s, box-shadow .2s, background .2s;
    min-height: 44px;
}

.field textarea,
.form-grid textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.6;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
    outline: none;
    border-color: #b8a1f4;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(109, 71, 245, .10);
}

.field input[type="checkbox"],
.field input[type="radio"] {
    width: 15px;
    height: 15px;
    min-height: 0;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
}

.field-hint {
    font-size: 11.5px;
    color: var(--muted-2);
    line-height: 1.5;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.field--full {
    grid-column: 1 / -1;
}

.check-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--muted);
    cursor: pointer;
    margin-top: 8px;
}

.check-line input {
    accent-color: var(--violet);
    width: 15px;
    height: 15px;
}

.check-line--boxed {
    border: 1px solid var(--line);
    background: #fbf9ff;
    border-radius: 10px;
    padding: 10px 12px;
    margin-top: 0;
}

/* =========================================================
   Header / navigation
   ========================================================= */
.site-header {
    position: relative;
    z-index: 100;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(233, 226, 242, .8);
}

.site-header--light {
    position: sticky;
    top: 0;
}

.site-header--dark {
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    backdrop-filter: none;
    color: #fff;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

.site-header--dark .brand-text small {
    color: rgba(255, 255, 255, .45);
}

.site-header--dark .brand-text strong {
    color: #fff;
}

.site-header--dark .nav-link {
    color: rgba(255, 255, 255, .68);
}

.site-header--dark .nav-link:hover,
.site-header--dark .nav-link.is-active {
    color: #fff;
}

.site-header--dark .nav-link::after {
    background: #c5b3ff;
}

.site-header--dark .header-search {
    color: rgba(255, 255, 255, .7);
    border-color: rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .06);
}

.site-header--dark .header-cta {
    background: #fff;
    color: var(--ink);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
}

.site-header--dark .mobile-menu-btn {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .16);
    color: #fff;
}

.header-inner {
    height: 82px;
    display: flex;
    align-items: center;
    gap: 30px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 26px;
    margin-left: 12px;
}

.nav-link {
    position: relative;
    font-size: 13.5px;
    font-weight: 560;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
    transition: color .2s;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 0;
    border-radius: 3px;
    background: var(--violet);
    transition: width .22s var(--ease);
}

.nav-link:hover,
.nav-link.is-active {
    color: var(--ink);
}

.nav-link:hover::after,
.nav-link.is-active::after {
    width: 100%;
}

.nav-badge {
    font-style: normal;
    background: var(--violet-soft);
    color: var(--violet);
    font-size: 10px;
    line-height: 1;
    border-radius: 20px;
    padding: 4px 6px;
    font-weight: 700;
}

.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-search {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--line);
    color: var(--muted);
    transition: all .2s;
}

.header-search:hover {
    color: var(--violet);
    border-color: #d8c8f2;
}

.header-cta {
    min-height: 40px;
    padding: 0 17px;
}

.mobile-menu-btn {
    display: none;
}

.mobile-drawer {
    position: absolute;
    top: calc(100% + 10px);
    right: 20px;
    width: min(320px, calc(100vw - 40px));
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 12px;
    box-shadow: var(--shadow-lg);
    animation: dropIn .2s var(--ease);
}

@keyframes dropIn {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.mobile-drawer a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 550;
    color: var(--ink-2);
}

.mobile-drawer a:hover {
    background: var(--violet-pale);
    color: var(--violet);
}

.mobile-drawer a svg {
    color: var(--violet);
}

.mobile-drawer-foot {
    border-top: 1px solid var(--line);
    margin-top: 8px;
    padding: 14px 12px 4px;
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--muted-2);
}

.mobile-drawer-foot a {
    padding: 0;
    font-size: 11px;
    color: var(--muted);
}

/* announcement */
.announcement-bar {
    background: #23113f;
    color: #dcd1f3;
    font-size: 11.5px;
    text-align: center;
    padding: 0 18px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 9px;
    line-height: 1.5;
    overflow: hidden;
}

.announcement-bar > span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.announcement-bar strong {
    color: #fff;
    font-size: 9px;
    letter-spacing: .12em;
    background: rgba(255, 255, 255, .1);
    border-radius: 4px;
    padding: 2px 6px;
    flex: none;
}

body.has-announcement .site-header--dark {
    top: 36px;
}

/* footer */
.site-footer {
    background: #140b26;
    color: rgba(255, 255, 255, .58);
    padding: 58px 0 30px;
    margin-top: 0;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1.3fr .8fr auto;
    gap: 40px;
    align-items: start;
}

.footer-brand p {
    margin-top: 16px;
    font-size: 12.5px;
    color: rgba(255, 255, 255, .42);
    max-width: 300px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 28px;
    font-size: 13px;
    padding-top: 8px;
}

.footer-links a {
    color: rgba(255, 255, 255, .58);
    transition: color .2s;
}

.footer-links a:hover {
    color: #fff;
}

.footer-meta {
    text-align: right;
    font-size: 11.5px;
    color: rgba(255, 255, 255, .34);
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 8px;
}

.footer-admin {
    color: rgba(255, 255, 255, .3) !important;
    font-size: 10px;
}

.footer-admin:hover {
    color: rgba(255, 255, 255, .7) !important;
}

.site-footer--compact {
    padding: 36px 0 24px;
}

.site-footer--compact .footer-inner {
    align-items: center;
}

.site-footer--compact .footer-brand p,
.site-footer--compact .footer-meta {
    display: none;
}

/* bottom mobile nav */
.bottom-nav {
    display: none;
}

.toast-stack {
    position: fixed;
    z-index: 400;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    pointer-events: none;
    width: min(420px, calc(100vw - 32px));
}

.toast {
    background: #211238;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 13px;
    padding: 12px 17px;
    font-size: 13px;
    box-shadow: 0 18px 45px rgba(15, 6, 30, .3);
    display: flex;
    align-items: center;
    gap: 9px;
    animation: toastIn .28s var(--ease);
    pointer-events: auto;
    max-width: 100%;
}

.toast svg {
    color: #a98dff;
    flex: none;
}

.toast--success svg {
    color: #4ddfad;
}

.toast--error svg {
    color: #ff8896;
}

.toast.is-out {
    animation: toastOut .22s ease forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(.97);
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateY(8px) scale(.97);
    }
}

.back-top {
    position: fixed;
    right: 22px;
    bottom: 26px;
    z-index: 120;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 50%;
    background: #211238;
    color: #fff;
    display: grid;
    place-items: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all .25s;
    box-shadow: var(--shadow-md);
}

.back-top svg {
    transform: rotate(90deg);
}

.back-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: none;
}

/* =========================================================
   Home
   ========================================================= */
.page-home {
    background: #f8f5fc;
}

.hero {
    position: relative;
    background: radial-gradient(1200px 700px at 78% 8%, #3e1f78 0%, transparent 62%),
        radial-gradient(900px 700px at 8% 50%, #241143 0%, transparent 64%),
        linear-gradient(150deg, #150a2b 0%, #1d0d39 58%, #170b2d 100%);
    color: #fff;
    overflow: hidden;
    padding-top: 82px;
}

.hero-grid-bg {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
    background-size: 68px 68px;
    mask-image: radial-gradient(700px 500px at 70% 30%, #000 0%, transparent 75%);
    opacity: .55;
    pointer-events: none;
}

.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(30px);
    pointer-events: none;
}

.hero-orb--one {
    width: 520px;
    height: 520px;
    right: -140px;
    top: -100px;
    background: radial-gradient(circle, rgba(119, 77, 255, .42), transparent 68%);
}

.hero-orb--two {
    width: 400px;
    height: 400px;
    left: -120px;
    bottom: -180px;
    background: radial-gradient(circle, rgba(255, 147, 91, .16), transparent 66%);
}

.hero-inner {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
    gap: 44px;
    align-items: center;
    padding-top: 56px;
    padding-bottom: 66px;
    min-height: 660px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .055);
    border-radius: 999px;
    padding: 7px 13px;
    font-size: 11.5px;
    color: rgba(255, 255, 255, .72);
    letter-spacing: .05em;
    backdrop-filter: blur(10px);
}

.eyebrow-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #a98dff;
    box-shadow: 0 0 0 4px rgba(169, 141, 255, .14);
}

.hero-title {
    font-size: clamp(46px, 5.2vw, 74px);
    line-height: 1.16;
    letter-spacing: -.055em;
    font-weight: 820;
    margin-top: 24px;
    max-width: 660px;
}

.hero-title-accent {
    background: linear-gradient(100deg, #d3c4ff 10%, #9b7bff 52%, #ffc59d 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-lead {
    margin-top: 22px;
    max-width: 520px;
    color: rgba(255, 255, 255, .62);
    font-size: 16px;
    line-height: 1.85;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.hero-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 24px;
    color: rgba(255, 255, 255, .48);
    font-size: 11.5px;
}

.hero-trust span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.hero-trust svg {
    color: #7fe2bd;
}

.hero-stats {
    display: flex;
    gap: 32px;
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, .1);
    max-width: 560px;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hero-stat strong {
    font-size: 21px;
    letter-spacing: -.02em;
    font-weight: 750;
    color: #fff;
    line-height: 1.3;
}

.hero-stat span {
    font-size: 10.5px;
    color: rgba(255, 255, 255, .4);
}

.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    min-height: 520px;
}

.hero-phone-wrap {
    position: relative;
    width: 350px;
    transform: rotate(-2.5deg);
    transition: transform .5s var(--ease);
}

.hero-phone-wrap:hover {
    transform: rotate(-1deg) translateY(-5px);
}

.hero-phone {
    width: 350px;
    min-height: 540px;
    background: #fbf9ff;
    border-radius: 38px;
    padding: 13px 13px 0;
    color: var(--ink);
    box-shadow: 0 50px 100px rgba(0, 0, 0, .42), 0 0 0 7px #0f081c, 0 0 0 8px rgba(255, 255, 255, .16);
    overflow: hidden;
    position: relative;
}

.hero-phone::before {
    content: "";
    position: absolute;
    top: 9px;
    left: 50%;
    transform: translateX(-50%);
    width: 82px;
    height: 19px;
    border-radius: 20px;
    background: #0d0718;
    z-index: 5;
}

.phone-status {
    display: flex;
    justify-content: space-between;
    padding: 11px 12px 10px;
    font-size: 9.5px;
    font-weight: 650;
    color: #2e2044;
}

.phone-status-icons {
    letter-spacing: 1px;
    color: #4b3b61;
    font-size: 8px;
}

.phone-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 7px 10px;
    font-size: 12px;
    font-weight: 700;
}

.phone-streak {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #d46c26;
    background: #fff1e4;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 9px;
}

.phone-video {
    height: 185px;
    border-radius: 20px;
    background: linear-gradient(145deg, #c8b6f2, #7551d8);
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.phone-ep {
    position: absolute;
    left: 11px;
    top: 11px;
    background: rgba(14, 7, 28, .45);
    color: #fff;
    border-radius: 8px;
    padding: 4px 7px;
    font-size: 8px;
    letter-spacing: .04em;
    backdrop-filter: blur(10px);
}

.phone-play {
    position: absolute;
    left: 50%;
    top: 42%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .2);
    border: 1px solid rgba(255, 255, 255, .38);
    color: #fff;
    display: grid;
    place-items: center;
    backdrop-filter: blur(14px);
}

.phone-caption {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    color: #fff;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.45;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .3);
}

.phone-caption mark,
.phone-cue mark {
    color: #6d47f5;
    background: #e8ddff;
    border-radius: 4px;
    padding: 0 2px;
}

.phone-video .phone-caption mark {
    color: #fff;
    background: rgba(255, 255, 255, .22);
}

.phone-progress {
    height: 4px;
    background: #ece6f7;
    border-radius: 4px;
    margin: 11px 4px 0;
    overflow: hidden;
}

.phone-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #8f6dff, #5f36e6);
}

.phone-cue {
    margin: 12px 2px 0;
    background: #f2edff;
    border: 1px solid #e5dbff;
    border-radius: 14px;
    padding: 10px 12px;
}

.phone-cue-en {
    font-family: var(--font-en);
    font-size: 11.5px;
    line-height: 1.55;
    color: #2a1b44;
}

.phone-cue-zh {
    margin-top: 4px;
    font-size: 9.5px;
    color: #897b9d;
}

.phone-word-card {
    margin: 9px 2px 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 10px 12px;
    box-shadow: 0 10px 25px rgba(40, 20, 76, .09);
}

.pwc-top {
    display: flex;
    align-items: baseline;
    gap: 5px;
    flex-wrap: wrap;
}

.pwc-top strong {
    font-size: 14px;
    font-family: var(--font-en);
}

.pwc-top span {
    font-size: 8px;
    color: #8b7c9e;
    background: #f2edfa;
    border-radius: 4px;
    padding: 1px 4px;
}

.pwc-top em {
    font-style: normal;
    font-size: 9px;
    color: #9d8db1;
}

.phone-word-card p {
    font-size: 9.5px;
    color: #75688a;
    line-height: 1.5;
    margin-top: 5px;
}

.pwc-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f0ebf7;
    margin-top: 7px;
    padding-top: 7px;
    color: var(--violet);
    font-size: 9px;
    font-weight: 650;
}

.pwc-plus {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--violet-soft);
    display: grid;
    place-items: center;
    font-size: 12px;
}

.phone-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 55px;
    margin-top: 8px;
    color: #b4a8c2;
    border-top: 1px solid #f1ecf7;
}

.phone-nav span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
}

.phone-nav .is-on {
    color: var(--violet);
    background: var(--violet-soft);
}

.float-pill {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, .16);
    background: rgba(34, 18, 59, .68);
    color: rgba(255, 255, 255, .8);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 10.5px;
    backdrop-filter: blur(14px);
    box-shadow: 0 14px 35px rgba(0, 0, 0, .24);
    z-index: 6;
}

.float-pill svg {
    color: #b8a2ff;
}

.float-pill--one {
    top: 50px;
    left: -42px;
    animation: floatY 5s ease-in-out infinite;
}

.float-pill--two {
    right: -32px;
    bottom: 150px;
    animation: floatY 6s ease-in-out infinite reverse;
}

.float-card {
    position: absolute;
    right: -36px;
    top: 220px;
    z-index: 6;
    display: flex;
    align-items: center;
    gap: 9px;
    background: rgba(255, 255, 255, .95);
    color: var(--ink);
    border-radius: 13px;
    padding: 9px 12px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, .26);
    animation: floatY 7s ease-in-out infinite;
}

.float-card-icon {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: #fff;
    background: linear-gradient(135deg, #ff9d6b, #f45f88);
}

.float-card div {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.float-card strong {
    font-size: 10px;
}

.float-card small {
    font-size: 8px;
    color: var(--muted);
}

@keyframes floatY {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.hero-marquee {
    position: relative;
    z-index: 2;
    border-top: 1px solid rgba(255, 255, 255, .08);
    overflow: hidden;
    padding: 15px 0;
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee-track {
    display: flex;
    gap: 24px;
    align-items: center;
    width: max-content;
    animation: marquee 38s linear infinite;
    color: rgba(255, 255, 255, .28);
    font-size: 10px;
    letter-spacing: .24em;
    font-weight: 650;
}

.marquee-track i {
    font-style: normal;
    color: rgba(255, 255, 255, .14);
}

@keyframes marquee {
    to {
        transform: translateX(-50%);
    }
}

/* continue panel */
.continue-wrap {
    margin-top: -34px;
    position: relative;
    z-index: 4;
}

.resume-panel {
    background: #fff;
    border: 1px solid rgba(233, 226, 242, .9);
    border-radius: 22px;
    box-shadow: var(--shadow-md);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    overflow: hidden;
}

.resume-main {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 22px;
    transition: background .2s;
}

.resume-main:hover {
    background: #fdfbff;
}

.resume-cover {
    width: 138px;
    height: 84px;
    border-radius: 13px;
    overflow: hidden;
    position: relative;
    flex: none;
    background: var(--violet-soft);
}

.resume-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.resume-cover > span {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(15, 8, 30, .25);
    color: #fff;
}

.resume-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.resume-kicker {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--violet);
    font-size: 10px;
    font-weight: 650;
}

.resume-copy strong {
    font-size: 16px;
    letter-spacing: -.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 460px;
}

.resume-copy small {
    color: var(--muted-2);
    font-size: 11px;
}

.resume-action {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--violet);
    font-size: 12.5px;
    font-weight: 650;
    white-space: nowrap;
}

.resume-side {
    background: linear-gradient(140deg, #f7f2ff, #fdfbff);
    border-left: 1px solid var(--line);
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
}

.resume-side-label {
    font-size: 9.5px;
    letter-spacing: .12em;
    color: var(--violet);
    font-weight: 700;
}

.resume-side strong {
    font-size: 12.5px;
    font-weight: 650;
}

.resume-steps {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 6px;
    font-size: 9.5px;
    color: var(--muted);
}

.resume-steps i {
    flex: 1;
    max-width: 22px;
    height: 1px;
    background: #d9cce9;
}

.resume-empty {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.resume-empty strong {
    font-size: 15px;
}

.resume-empty span {
    color: var(--muted);
    font-size: 12px;
}

/* library */
.library-section {
    padding: 78px 0 92px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 30px;
    margin-bottom: 34px;
}

.section-heading > div:first-child {
    max-width: 700px;
}

.section-kicker {
    font-size: 9.5px;
    letter-spacing: .2em;
    font-weight: 750;
    color: var(--violet);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.section-kicker::before {
    content: "";
    width: 16px;
    height: 1px;
    background: currentColor;
}

.section-heading h2 {
    font-size: clamp(27px, 3.1vw, 38px);
    line-height: 1.22;
    letter-spacing: -.045em;
    font-weight: 790;
}

.section-heading p {
    margin-top: 10px;
    color: var(--muted);
    font-size: 13.5px;
}

.section-heading--light {
    color: #fff;
}

.section-heading--light .section-kicker {
    color: #b9a2ff;
}

.section-heading--light p {
    color: rgba(255, 255, 255, .48);
}

.section-heading--row {
    margin-bottom: 24px;
}

.library-count {
    display: flex;
    align-items: baseline;
    gap: 4px;
    padding-bottom: 5px;
    color: var(--muted);
    white-space: nowrap;
}

.library-count strong {
    font-size: 32px;
    line-height: 1;
    letter-spacing: -.04em;
    color: var(--ink);
    font-weight: 790;
}

.library-count span {
    font-size: 11px;
}

.library-toolbar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 25px;
}

.filter-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 3px;
    scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
    display: none;
}

.library-search {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

.library-search form {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 1;
    max-width: 480px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 999px;
    padding: 4px 5px 4px 15px;
    color: var(--muted-2);
    box-shadow: var(--shadow-xs);
}

.library-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    outline: none;
    font-size: 13px;
    height: 36px;
}

.search-submit {
    border: 0;
    background: #f4effc;
    color: var(--ink-2);
    border-radius: 999px;
    height: 34px;
    padding: 0 15px;
    font-size: 12px;
    font-weight: 600;
}

.difficulty-select {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11.5px;
    color: var(--muted);
    white-space: nowrap;
}

.difficulty-select select {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 999px;
    padding: 8px 28px 8px 12px;
    font-size: 12px;
    outline: none;
}

.episode-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.episode-card {
    background: #fff;
    border: 1px solid rgba(233, 226, 242, .9);
    border-radius: 20px;
    overflow: hidden;
    transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
    position: relative;
}

.episode-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: #e0d5f0;
}

.episode-cover {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #e8e0f5;
    overflow: hidden;
}

.episode-cover-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.episode-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s var(--ease);
}

.episode-card:hover .episode-cover img {
    transform: scale(1.035);
}

.cover-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 8, 27, .05) 30%, rgba(15, 8, 27, .56) 100%);
}

.episode-no {
    position: absolute;
    top: 11px;
    left: 11px;
    background: rgba(16, 8, 30, .48);
    color: rgba(255, 255, 255, .82);
    border: 1px solid rgba(255, 255, 255, .16);
    backdrop-filter: blur(10px);
    border-radius: 7px;
    padding: 3px 7px;
    font-size: 8px;
    letter-spacing: .08em;
    font-weight: 650;
}

.cover-play {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(.9);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    background: rgba(24, 12, 44, .36);
    border: 1px solid rgba(255, 255, 255, .36);
    backdrop-filter: blur(12px);
    opacity: 0;
    transition: all .28s var(--ease);
}

.episode-card:hover .cover-play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.cover-duration {
    position: absolute;
    right: 11px;
    bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #fff;
    font-size: 9.5px;
    letter-spacing: .02em;
    background: rgba(15, 8, 27, .45);
    border-radius: 6px;
    padding: 3px 7px;
    backdrop-filter: blur(8px);
    font-variant-numeric: tabular-nums;
}

.cover-favorite {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .22);
    background: rgba(15, 8, 27, .3);
    color: #fff;
    display: grid;
    place-items: center;
    backdrop-filter: blur(10px);
    transition: all .2s;
    z-index: 3;
}

.cover-favorite:hover {
    background: rgba(255, 255, 255, .22);
}

.cover-favorite.is-active {
    color: #ff799d;
    background: rgba(255, 255, 255, .92);
}

.cover-favorite.is-active svg {
    fill: currentColor;
}

.cover-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(255, 255, 255, .18);
    z-index: 2;
}

.cover-progress i {
    display: block;
    height: 100%;
    background: #9b7bff;
}

.episode-body {
    padding: 14px 16px 15px;
}

.episode-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.episode-level {
    font-size: 9px;
    color: var(--muted-2);
    white-space: nowrap;
}

.episode-title {
    font-size: 16px;
    line-height: 1.42;
    font-weight: 680;
    letter-spacing: -.02em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 45px;
}

.episode-title a:hover {
    color: var(--violet);
}

.episode-sub {
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.55;
    margin-top: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.episode-tags {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    min-height: 16px;
}

.episode-tags span {
    font-size: 9.5px;
    color: #8a77a3;
    white-space: nowrap;
}

.episode-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 11px;
    padding-top: 10px;
    border-top: 1px solid #f1ecf7;
    color: var(--muted-2);
    font-size: 9.5px;
}

.episode-source,
.episode-views {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.episode-source {
    max-width: 68%;
}

.episode-card.is-filtered {
    display: none;
}

.library-invite {
    min-height: 100%;
    border: 1px dashed #d9cceb;
    border-radius: 20px;
    background: radial-gradient(450px 230px at 85% 15%, #f1e8ff, transparent 65%), #fcfaff;
    padding: 24px 26px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 14px;
    position: relative;
    overflow: hidden;
}

.library-invite::after {
    content: "";
    position: absolute;
    right: -50px;
    bottom: -70px;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    border: 1px solid #e5d7f7;
}

.library-invite-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: #eee6ff;
    color: var(--violet);
    display: grid;
    place-items: center;
    flex: none;
}

.library-invite-copy {
    max-width: 460px;
}

.library-invite-copy > span {
    font-size: 8px;
    letter-spacing: .16em;
    color: var(--violet);
    font-weight: 700;
}

.library-invite-copy > strong {
    display: block;
    font-size: 16px;
    letter-spacing: -.02em;
    margin-top: 3px;
}

.library-invite-copy p {
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.75;
    margin-top: 5px;
}

.library-invite-steps {
    display: flex;
    gap: 13px;
    margin-top: 13px;
}

.library-invite-steps span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 9px;
    color: var(--muted-2);
}

.library-invite-steps i {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e3d6f4;
    display: grid;
    place-items: center;
    font-style: normal;
    font-size: 7px;
    color: var(--violet);
}

.library-invite-link {
    margin-left: auto;
    align-self: flex-end;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--violet);
    font-size: 10px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.empty-state {
    text-align: center;
    padding: 68px 24px;
    border: 1px dashed var(--line-strong);
    border-radius: 22px;
    background: rgba(255, 255, 255, .54);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.empty-state h3 {
    font-size: 18px;
    letter-spacing: -.02em;
}

.empty-state p {
    color: var(--muted);
    font-size: 12.5px;
    max-width: 380px;
    margin-bottom: 10px;
}

.empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: var(--violet-soft);
    color: var(--violet);
    display: grid;
    place-items: center;
    margin-bottom: 8px;
}

.empty-state--compact {
    padding: 36px 20px;
    background: transparent;
    border-style: solid;
}

/* modes */
.modes-section {
    background: #170d2d;
    color: #fff;
    padding: 85px 0 95px;
    position: relative;
    overflow: hidden;
}

.modes-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: linear-gradient(180deg, #000, transparent 75%);
}

.modes-glow {
    position: absolute;
    width: 700px;
    height: 700px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(107, 71, 245, .22), transparent 65%);
    top: -220px;
    right: -180px;
    pointer-events: none;
}

.modes-section .container {
    position: relative;
    z-index: 2;
}

.modes-groups {
    display: flex;
    flex-direction: column;
    gap: 26px;
    margin-top: 14px;
}

.mode-group-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, .75);
    font-size: 12px;
    font-weight: 650;
}

.mode-group-head i {
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, .1);
}

.mode-group-head small {
    color: rgba(255, 255, 255, .35);
    font-size: 10.5px;
    font-weight: 400;
}

.mode-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 11px;
}

.mode-card {
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .045);
    border-radius: 17px;
    padding: 17px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 92px;
    position: relative;
    transition: background .22s, border-color .22s, transform .22s;
    overflow: hidden;
}

.mode-card::after {
    content: "";
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    right: -50px;
    bottom: -60px;
    background: var(--mode-color, #8b6bff);
    opacity: .12;
    filter: blur(15px);
}

.mode-card:hover {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .2);
    transform: translateY(-2px);
}

.mode-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .08);
    color: var(--mode-color, #b6a1ff);
    flex: none;
}

.mode-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.mode-copy strong {
    font-size: 13.5px;
    font-weight: 650;
}

.mode-copy small {
    font-size: 10px;
    color: rgba(255, 255, 255, .4);
    line-height: 1.45;
}

.mode-arrow {
    margin-left: auto;
    color: rgba(255, 255, 255, .25);
    flex: none;
    transition: transform .2s, color .2s;
}

.mode-card:hover .mode-arrow {
    color: #fff;
    transform: translate(2px, -2px);
}

.mode-card--lavender {
    --mode-color: #b6a1ff;
}

.mode-card--sky {
    --mode-color: #7ab6ff;
}

.mode-card--mint {
    --mode-color: #63dfbb;
}

.mode-card--peach {
    --mode-color: #ffb28a;
}

.mode-card--rose {
    --mode-color: #ff9ab3;
}

/* detail */
.detail-section {
    padding: 96px 0;
    background: #fbf9ff;
}

.detail-section .container {
    display: grid;
    grid-template-columns: .75fr 1.25fr;
    gap: 64px;
    align-items: center;
}

.detail-copy h2 {
    font-size: clamp(30px, 3.3vw, 43px);
    line-height: 1.28;
    letter-spacing: -.05em;
    margin-top: 4px;
}

.detail-copy > p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.85;
    margin-top: 18px;
    max-width: 360px;
}

.detail-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 18px;
    margin-top: 28px;
}

.detail-features span {
    font-size: 11.5px;
    color: var(--ink-2);
    display: flex;
    align-items: center;
    gap: 7px;
}

.detail-features svg {
    color: var(--violet);
}

.detail-visual {
    position: relative;
}

.detail-window {
    background: #1d1134;
    border-radius: 20px;
    padding: 10px;
    box-shadow: 0 35px 80px rgba(34, 17, 62, .2);
    transform: perspective(1200px) rotateY(-3deg) rotateX(1.5deg);
}

.window-dots {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 7px 10px;
    color: rgba(255, 255, 255, .35);
    font-size: 8px;
}

.window-dots i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
}

.window-dots span {
    margin-left: 8px;
    letter-spacing: .06em;
}

.detail-screen {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 8px;
    background: #f9f6ff;
    border-radius: 13px;
    padding: 8px;
}

.detail-video {
    min-height: 285px;
    border-radius: 9px;
    background: linear-gradient(145deg, #cfc0ef, #6d4fce);
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.detail-play {
    position: absolute;
    left: 50%;
    top: 45%;
    transform: translate(-50%, -50%);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .2);
    border: 1px solid rgba(255, 255, 255, .38);
    color: #fff;
    display: grid;
    place-items: center;
}

.detail-controls {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 10px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: rgba(255, 255, 255, .75);
    font-size: 7px;
}

.detail-controls i {
    flex: 1;
    height: 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .25);
}

.detail-controls b {
    display: block;
    height: 100%;
    background: #fff;
    border-radius: inherit;
}

.detail-controls em {
    font-style: normal;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 3px;
    padding: 1px 3px;
}

.detail-cues {
    padding: 4px 2px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-cue {
    border-radius: 8px;
    padding: 8px 9px;
    background: #fff;
    border: 1px solid #eee7f8;
}

.detail-cue.is-active {
    background: #eee7ff;
    border-color: #d8c7ff;
}

.dc-time {
    font-size: 7px;
    color: #a495b6;
}

.detail-cue p {
    font-family: var(--font-en);
    font-size: 9.5px;
    line-height: 1.5;
    color: #2b1c44;
    margin-top: 2px;
}

.detail-cue small {
    display: block;
    font-size: 8px;
    color: #9285a4;
    margin-top: 2px;
}

.detail-cue mark {
    background: #ffe0ce;
    color: #b75a2b;
    border-radius: 3px;
    padding: 0 2px;
}

.detail-float {
    position: absolute;
    right: -26px;
    bottom: -26px;
    display: flex;
    gap: 10px;
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 12px 16px;
    box-shadow: var(--shadow-md);
    color: var(--violet);
}

.detail-float span {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

.detail-float strong {
    font-size: 11px;
    color: var(--ink);
}

.detail-float small {
    font-size: 9px;
    color: var(--muted);
}

/* CTA */
.cta-section {
    padding: 60px 0 96px;
    background: #fbf9ff;
}

.cta-card {
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    background: linear-gradient(130deg, #2a1150 0%, #3c1977 52%, #5526a0 100%);
    color: #fff;
    padding: 64px 64px;
    min-height: 330px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cta-orb {
    position: absolute;
    width: 480px;
    height: 480px;
    right: -80px;
    top: -180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(160, 120, 255, .4), transparent 65%);
    filter: blur(10px);
}

.cta-card h2 {
    font-size: clamp(30px, 3.8vw, 48px);
    line-height: 1.24;
    letter-spacing: -.05em;
    margin-top: 4px;
    position: relative;
    z-index: 2;
}

.cta-card p {
    margin-top: 16px;
    color: rgba(255, 255, 255, .55);
    font-size: 13.5px;
    position: relative;
    z-index: 2;
}

.cta-card .section-kicker {
    color: #cbb8ff;
    position: relative;
    z-index: 2;
}

.cta-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 28px;
    position: relative;
    z-index: 2;
}

/* =========================================================
   Watch page
   ========================================================= */
.page-watch {
    background: #f2edf8;
}

.watch-header {
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 80;
    backdrop-filter: blur(18px);
}

.watch-header-inner {
    max-width: 1480px;
    margin: 0 auto;
    padding: 0 26px;
    height: 68px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.watch-back {
    width: 37px;
    height: 37px;
    border-radius: 50%;
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
    color: var(--muted);
    flex: none;
    transition: all .2s;
}

.watch-back:hover {
    color: var(--violet);
    border-color: #d8c8f2;
    background: #fff;
}

.watch-divider {
    width: 1px;
    height: 24px;
    background: var(--line);
    flex: none;
}

.watch-title {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.watch-title span {
    color: var(--violet);
    font-size: 8.5px;
    letter-spacing: .1em;
    font-weight: 700;
}

.watch-title strong {
    font-size: 13px;
    font-weight: 650;
    max-width: 420px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.watch-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 7px;
}

.watch-actions .icon-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border-color: transparent;
    color: var(--muted);
}

.watch-actions .icon-btn:hover {
    background: #f5f0fc;
}

.watch-actions .favorite-btn.is-active {
    color: #f4547d;
}

.watch-actions .favorite-btn.is-active svg {
    fill: currentColor;
}

.watch-next-btn {
    min-height: 37px;
    margin-left: 5px;
}

.watch-main {
    padding: 22px 0 42px;
}

.watch-layout {
    max-width: 1480px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 448px;
    gap: 20px;
    align-items: start;
}

.player-column {
    min-width: 0;
}

.video-shell {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 22px;
    overflow: hidden;
    background: #080510;
    box-shadow: 0 22px 55px rgba(25, 10, 48, .2);
    isolation: isolate;
}

.video-backdrop {
    position: absolute;
    inset: -8%;
    background-size: cover;
    background-position: center;
    filter: blur(34px) brightness(.45) saturate(.9);
    opacity: .6;
    z-index: 0;
}

.video-vignette {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(6, 4, 13, .42) 0%, transparent 20%, transparent 58%, rgba(6, 4, 13, .78) 100%);
    opacity: 1;
    transition: opacity .3s;
}

.lesson-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
    background: transparent;
}

.video-topline {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 14px 16px;
    color: rgba(255, 255, 255, .82);
    font-size: 10px;
    transition: opacity .25s;
}

.video-badge {
    background: rgba(255, 255, 255, .13);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 6px;
    padding: 3px 6px;
    font-size: 8px;
    letter-spacing: .08em;
    backdrop-filter: blur(8px);
}

.video-topline-title {
    max-width: 50%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: rgba(255, 255, 255, .6);
}

.video-topline-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid rgba(255, 255, 255, .16);
    background: rgba(10, 5, 18, .28);
    color: rgba(255, 255, 255, .7);
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 9px;
    backdrop-filter: blur(8px);
}

.video-topline-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, .13);
}

.video-big-play {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .34);
    background: rgba(255, 255, 255, .15);
    color: #fff;
    display: grid;
    place-items: center;
    z-index: 4;
    backdrop-filter: blur(14px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, .3);
    transition: all .25s var(--ease);
}

.video-big-play:hover {
    transform: translate(-50%, -50%) scale(1.06);
    background: rgba(255, 255, 255, .24);
}

.video-shell.is-playing .video-big-play {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(.8);
}

.video-overlay-caption {
    position: absolute;
    left: 7%;
    right: 7%;
    bottom: 90px;
    z-index: 3;
    text-align: center;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .9);
    pointer-events: none;
}

.video-overlay-caption p {
    color: #fff;
    font-size: clamp(16px, 1.7vw, 24px);
    font-weight: 600;
    line-height: 1.4;
    font-family: var(--font-en);
}

.video-overlay-caption span {
    display: block;
    color: rgba(255, 255, 255, .72);
    font-size: clamp(11px, 1vw, 14px);
    margin-top: 4px;
}

.video-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    padding: 0 18px 12px;
    transition: opacity .25s, transform .25s;
}

.video-shell.is-controls-hidden .video-controls,
.video-shell.is-controls-hidden .video-topline {
    opacity: 0;
    pointer-events: none;
}

.video-shell.is-controls-hidden {
    cursor: none;
}

.progress-wrap {
    padding: 8px 0 5px;
    cursor: pointer;
}

.progress-rail {
    height: 4px;
    background: rgba(255, 255, 255, .2);
    border-radius: 4px;
    position: relative;
    outline: none;
}

.progress-buffer,
.progress-played {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    border-radius: 4px;
    width: 0;
}

.progress-buffer {
    background: rgba(255, 255, 255, .18);
}

.progress-played {
    background: linear-gradient(90deg, #b39bff, #7b53ff);
}

.progress-thumb {
    position: absolute;
    top: 50%;
    left: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    transform: translate(-50%, -50%) scale(.7);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
    opacity: 0;
    transition: transform .15s, opacity .15s;
}

.progress-rail:hover .progress-thumb,
.progress-rail:focus .progress-thumb {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.progress-tooltip {
    position: absolute;
    bottom: 14px;
    transform: translateX(-50%);
    background: rgba(8, 4, 16, .85);
    color: #fff;
    border-radius: 5px;
    padding: 3px 6px;
    font-size: 8px;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

.controls-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.vc-btn {
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, .82);
    border-radius: 7px;
    display: grid;
    place-items: center;
    transition: background .18s, color .18s;
}

.vc-btn:hover {
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.vc-btn.is-active {
    color: #b7a0ff;
    background: rgba(255, 255, 255, .1);
}

.vc-play {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, .14);
    color: #fff;
}

.vc-text-btn {
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, .68);
    height: 30px;
    border-radius: 6px;
    padding: 0 6px;
    font-size: 9.5px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

.vc-text-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

.volume-wrap {
    display: flex;
    align-items: center;
    gap: 0;
}

.volume-slider {
    width: 0;
    opacity: 0;
    accent-color: #9b7bff;
    transition: width .25s, opacity .25s, margin .25s;
    cursor: pointer;
    height: 3px;
}

.volume-wrap:hover .volume-slider {
    width: 62px;
    opacity: 1;
    margin-left: 2px;
}

.time-display {
    margin-left: 8px;
    color: rgba(255, 255, 255, .62);
    font-size: 9px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.controls-spacer {
    flex: 1;
}

.speed-wrap {
    position: relative;
}

.speed-menu {
    position: absolute;
    right: 0;
    bottom: 37px;
    background: rgba(20, 11, 35, .96);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 10px;
    padding: 5px;
    display: flex;
    flex-direction: column;
    min-width: 74px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, .35);
    backdrop-filter: blur(15px);
}

.speed-menu button {
    border: 0;
    background: none;
    color: rgba(255, 255, 255, .65);
    text-align: left;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 10px;
}

.speed-menu button:hover,
.speed-menu button.is-active {
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.video-loading {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(8, 4, 16, .35);
    z-index: 6;
}

.video-loading span {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .2);
    border-top-color: #fff;
    animation: spin .7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.video-toast {
    position: absolute;
    left: 50%;
    top: 18px;
    transform: translateX(-50%);
    background: rgba(12, 6, 22, .8);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 999px;
    color: #fff;
    padding: 6px 14px;
    font-size: 10px;
    z-index: 8;
    backdrop-filter: blur(10px);
}

.video-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: rgba(255, 255, 255, .45);
    text-align: center;
    padding: 24px;
}

.video-empty h2 {
    color: #fff;
    font-size: 20px;
    margin-top: 5px;
}

.video-empty p {
    font-size: 11px;
}

/* mode tabs / player bar */
.player-actions-bar {
    margin-top: 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 15px;
    display: flex;
    align-items: center;
    padding: 6px 8px;
    gap: 12px;
    box-shadow: var(--shadow-xs);
}

.mode-tabs {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
}

.mode-tabs::-webkit-scrollbar {
    display: none;
}

.mode-tab {
    border: 0;
    background: transparent;
    color: var(--muted);
    border-radius: 9px;
    padding: 8px 11px;
    font-size: 10.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    transition: all .18s;
}

.mode-tab:hover {
    background: #f7f2ff;
    color: var(--ink);
}

.mode-tab.is-active {
    background: var(--ink);
    color: #fff;
    box-shadow: 0 5px 12px rgba(28, 18, 51, .18);
}

.player-tools {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 2px;
    padding-left: 8px;
    border-left: 1px solid var(--line);
}

.tool-btn {
    border: 0;
    background: none;
    color: var(--muted);
    padding: 7px 8px;
    font-size: 9.5px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.tool-btn:hover {
    background: #f7f2ff;
    color: var(--violet);
}

/* lesson intro */
.lesson-intro {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    margin-top: 14px;
    padding: 26px 28px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 30px;
    box-shadow: var(--shadow-xs);
}

.lesson-kicker {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted-2);
    font-size: 10px;
}

.lesson-intro h1 {
    font-size: 27px;
    line-height: 1.3;
    letter-spacing: -.04em;
    margin-top: 12px;
    font-weight: 760;
}

.lesson-subtitle {
    margin-top: 7px;
    color: var(--muted);
    font-size: 12.5px;
}

.lesson-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 13px;
    margin-top: 14px;
    color: var(--muted-2);
    font-size: 10px;
}

.lesson-meta span,
.lesson-meta a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.lesson-meta a {
    color: var(--violet);
}

.lesson-description {
    border-top: 1px solid #f2edf8;
    margin-top: 16px;
    padding-top: 15px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.85;
}

.lesson-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 12px;
}

.lesson-tags span {
    font-size: 9.5px;
    color: #7f6d97;
    background: #f7f3fc;
    border-radius: 999px;
    padding: 4px 9px;
}

.lesson-progress-card {
    border-left: 1px solid #f1ecf7;
    padding-left: 25px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.lpc-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 10px;
    color: var(--muted);
}

.lpc-head strong {
    font-size: 20px;
    color: var(--ink);
    letter-spacing: -.03em;
}

.lpc-bar {
    height: 5px;
    border-radius: 5px;
    background: #f0eaf7;
    margin-top: 8px;
    overflow: hidden;
}

.lpc-bar i {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #9b7bff, #6d47f5);
    border-radius: inherit;
    transition: width .3s;
}

.lpc-stats {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 14px 0 13px;
}

.lpc-stats div {
    display: flex;
    flex-direction: column;
}

.lpc-stats strong {
    font-size: 14px;
    line-height: 1.2;
}

.lpc-stats span {
    font-size: 8.5px;
    color: var(--muted-2);
}

.lesson-progress-card .btn {
    min-height: 34px;
    padding: 0 10px;
    font-size: 10px;
}

/* related */
.related-section {
    margin-top: 26px;
}

.related-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.related-head h2 {
    font-size: 17px;
    letter-spacing: -.02em;
}

.related-head a {
    color: var(--muted);
    font-size: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.related-card {
    display: flex;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 7px;
    align-items: center;
    min-width: 0;
    transition: all .2s;
}

.related-card:hover {
    border-color: #d8c8f2;
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.related-cover {
    width: 80px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    flex: none;
    background: var(--violet-soft);
}

.related-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-cover i {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(15, 8, 27, .25);
    color: #fff;
}

.related-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 1px;
}

.related-copy small {
    font-size: 7.5px;
    color: var(--violet);
    letter-spacing: .03em;
}

.related-copy strong {
    font-size: 10px;
    line-height: 1.4;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =========================================================
   Study panel
   ========================================================= */
.study-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 88px;
    height: calc(100vh - 110px);
    min-height: 560px;
    max-height: 900px;
    overflow: hidden;
}

.study-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 17px 18px 10px;
    flex: none;
}

.study-eyebrow {
    font-size: 8px;
    letter-spacing: .14em;
    color: var(--violet);
    font-weight: 700;
}

.study-head h2 {
    font-size: 18px;
    letter-spacing: -.025em;
    line-height: 1.3;
    margin-top: 2px;
}

.study-head-actions {
    display: flex;
    gap: 4px;
}

.study-head-actions .icon-btn-sm {
    width: 30px;
    height: 30px;
    background: #faf7ff;
}

.study-head-actions .icon-btn-sm.is-active {
    color: var(--violet);
    background: var(--violet-soft);
}

.study-subbar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 18px 11px;
    color: var(--muted-2);
    font-size: 8.5px;
    border-bottom: 1px solid #f3eef8;
    flex: none;
}

.study-subbar-dot {
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: #c6b9d6;
}

.study-subbar-link {
    margin-left: auto;
    border: 0;
    background: none;
    color: var(--violet);
    font-size: 8.5px;
    padding: 0;
}

.study-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
}

.cue-list {
    padding: 6px 10px 16px;
}

.cue {
    display: grid;
    grid-template-columns: 55px minmax(0, 1fr);
    gap: 4px;
    padding: 10px 7px;
    border-radius: 11px;
    border: 1px solid transparent;
    position: relative;
    transition: background .18s, border-color .18s;
}

.cue:hover {
    background: #fbf9ff;
}

.cue.is-active {
    background: #f4efff;
    border-color: #e5dbff;
}

.cue-rail {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    padding-left: 1px;
}

.cue-index {
    border: 0;
    background: none;
    padding: 0;
    color: var(--violet);
    font-size: 9px;
    font-weight: 650;
    line-height: 1.4;
}

.cue-time {
    color: var(--muted-2);
    font-size: 7.5px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.cue-line {
    width: 1px;
    flex: 1;
    min-height: 12px;
    background: #eee7f6;
    margin-top: 3px;
    margin-left: 3px;
}

.cue.is-active .cue-line {
    background: #d4c3f5;
}

.cue-content {
    min-width: 0;
}

.cue-en {
    font-family: var(--font-en);
    font-size: 12.5px;
    line-height: 1.58;
    color: #34254b;
    letter-spacing: -.005em;
}

.cue.is-active .cue-en {
    color: #1f1237;
}

.cue-zh {
    margin-top: 3px;
    color: #94869f;
    font-size: 10px;
    line-height: 1.6;
}

.cue.is-active .cue-zh {
    color: #7c6a90;
}

.cue .word {
    cursor: pointer;
    border-radius: 3px;
    transition: background .15s, color .15s;
    padding: 0 1px;
}

.cue .word:hover {
    background: #e5d9ff;
    color: #4c25c7;
}

.cue .word.is-saved {
    background: #e2f8ef;
    color: #0b7e5b;
}

.cue-tools {
    display: flex;
    gap: 2px;
    margin-top: 5px;
    opacity: 0;
    transform: translateY(2px);
    transition: opacity .18s, transform .18s;
}

.cue:hover .cue-tools,
.cue.is-active .cue-tools {
    opacity: 1;
    transform: none;
}

.cue-tools button {
    border: 0;
    background: transparent;
    color: #a798b5;
    width: 22px;
    height: 20px;
    border-radius: 5px;
    display: grid;
    place-items: center;
}

.cue-tools button:hover {
    background: #fff;
    color: var(--violet);
    box-shadow: var(--shadow-xs);
}

.cue-tools button.is-active {
    color: var(--violet);
}

.cue-note-editor {
    margin-top: 5px;
    border: 1px solid #e4d9f7;
    background: #fff;
    border-radius: 8px;
    padding: 6px;
}

.cue-note-editor textarea {
    width: 100%;
    border: 0;
    outline: 0;
    resize: vertical;
    min-height: 42px;
    font-size: 10px;
    line-height: 1.5;
    background: transparent;
}

.cue-note-editor > div {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 4px;
}

.cue-note-editor button {
    border: 0;
    background: none;
    font-size: 8.5px;
    color: var(--muted);
    padding: 2px 4px;
}

.cue-note-editor button:first-child {
    color: var(--violet);
    font-weight: 650;
}

.cue-note-text {
    margin-top: 5px;
    border-left: 2px solid #d8c7ef;
    padding-left: 7px;
    color: #8b789f;
    font-size: 9px;
    line-height: 1.55;
    white-space: pre-wrap;
}

.cue-explain {
    border: 1px solid #e4d9f7;
    background: #fbf8ff;
    color: var(--violet);
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 8.5px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-top: 6px;
}

.intensive-extra {
    display: none;
}

.study-panel[data-mode="intensive"] .intensive-extra {
    display: block;
}

.intensive-words {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.intensive-words button {
    border: 1px solid #e9dff8;
    background: #fff;
    border-radius: 7px;
    padding: 3px 7px;
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: 9px;
}

.intensive-words button strong {
    color: var(--violet);
    font-weight: 650;
}

.intensive-words button span {
    color: var(--muted-2);
    font-size: 8px;
}

.study-panel[data-mode="english"] .cue-zh {
    display: none;
}

.study-panel[data-mode="chinese"] .cue-en {
    display: none;
}

.study-panel[data-mode="chinese"] .cue-zh {
    margin-top: 0;
    font-size: 12px;
    color: #433252;
}

.study-panel[data-mode="chinese"] .intensive-extra,
.study-panel[data-mode="chinese"] .cue-tools button[data-play-cue],
.study-panel[data-mode="chinese"] .cue-tools button[data-copy-cue] {
    display: none;
}

.study-panel[data-mode="dictation"] .cue-list,
.study-panel[data-mode="shadow"] .cue-list,
.study-panel[data-mode="cloze"] .cue-list,
.study-panel[data-mode="cards"] .cue-list {
    display: none;
}

.study-panel.font-small .cue-en {
    font-size: 11.5px;
}

.study-panel.font-small .cue-zh {
    font-size: 9px;
}

.study-panel.font-large .cue-en {
    font-size: 14.5px;
}

.study-panel.font-large .cue-zh {
    font-size: 11.5px;
}

.study-note-card {
    display: flex;
    gap: 9px;
    margin: 2px 14px 16px;
    padding: 11px 12px;
    border: 1px solid #eee5fa;
    background: linear-gradient(135deg, #faf7ff, #fdfbff);
    border-radius: 11px;
}

.study-note-icon {
    width: 25px;
    height: 25px;
    border-radius: 7px;
    background: #efe7ff;
    color: #7a55ee;
    display: grid;
    place-items: center;
    flex: none;
}

.study-note-card strong {
    display: block;
    font-size: 9px;
    color: #5c4776;
}

.study-note-card p {
    font-size: 8.5px;
    line-height: 1.65;
    color: #9a89ab;
    margin-top: 2px;
}

.study-panel[data-mode="dictation"] .study-note-card,
.study-panel[data-mode="shadow"] .study-note-card,
.study-panel[data-mode="cloze"] .study-note-card,
.study-panel[data-mode="cards"] .study-note-card {
    display: none;
}

.study-panel[data-mode="cards"] .study-subbar,
.study-panel[data-mode="dictation"] .study-subbar,
.study-panel[data-mode="shadow"] .study-subbar,
.study-panel[data-mode="cloze"] .study-subbar {
    display: none;
}

.study-panel[data-mode="cards"] .study-head,
.study-panel[data-mode="dictation"] .study-head,
.study-panel[data-mode="shadow"] .study-head,
.study-panel[data-mode="cloze"] .study-head {
    padding-bottom: 12px;
}

.study-foot {
    border-top: 1px solid #f3eef8;
    padding: 9px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex: none;
    background: #fff;
}

.study-foot-left {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted-2);
    font-size: 8px;
}

.study-foot-right {
    display: flex;
    gap: 8px;
}

.study-foot-right button:disabled {
    opacity: .35;
}

.panel-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--muted-2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 11px;
}

.panel-empty svg {
    color: #c5b4dd;
}

/* practice */
.practice-view {
    padding: 6px 16px 20px;
}

.practice-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 6px 0 12px;
}

.practice-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 9.5px;
    color: var(--violet);
    font-weight: 650;
}

.practice-sub {
    color: var(--muted-2);
    font-size: 8.5px;
}

.dictation-stats {
    display: flex;
    gap: 11px;
    color: var(--muted-2);
    font-size: 7.5px;
}

.dictation-stats span {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.4;
}

.dictation-stats strong {
    font-size: 12px;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.practice-card {
    border: 1px solid #eee7f7;
    border-radius: 14px;
    background: #fdfbff;
    padding: 14px;
}

.practice-play-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.practice-play-row > div {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.practice-play-row strong {
    font-size: 11px;
    font-weight: 650;
}

.practice-play-row span {
    font-size: 8.5px;
    color: var(--muted-2);
}

.practice-play-row .icon-btn {
    margin-left: auto;
    width: 30px;
    height: 30px;
    background: #fff;
}

.round-play {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    display: grid;
    place-items: center;
    flex: none;
    box-shadow: 0 7px 18px rgba(28, 18, 51, .2);
}

.dictation-input {
    width: 100%;
    min-height: 84px;
    border: 1px solid #e9e1f4;
    border-radius: 10px;
    background: #fff;
    padding: 10px;
    font-family: var(--font-en);
    font-size: 12px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
}

.dictation-input:focus {
    border-color: #c3aefa;
    box-shadow: 0 0 0 3px rgba(109, 71, 245, .09);
}

.practice-actions {
    display: flex;
    justify-content: flex-end;
    gap: 7px;
    margin-top: 11px;
}

.practice-actions .btn {
    min-height: 33px;
    padding: 0 11px;
    font-size: 10px;
}

.dictation-result {
    margin-top: 12px;
    border-radius: 10px;
    padding: 10px;
    font-size: 10px;
    line-height: 1.6;
    border: 1px solid #e9e1f4;
    background: #fff;
}

.dictation-result.is-correct {
    background: #edfbf5;
    border-color: #c7f0df;
    color: #137655;
}

.dictation-result.is-wrong {
    background: #fff6f2;
    border-color: #f6d8c9;
    color: #8f4a2d;
}

.dr-score {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 650;
    margin-bottom: 5px;
}

.dr-score strong {
    font-size: 15px;
}

.dr-answer {
    font-family: var(--font-en);
    color: var(--ink);
    font-size: 11px;
    background: #f7f2ff;
    border-radius: 6px;
    padding: 6px 8px;
    margin-top: 5px;
}

.dr-answer mark {
    background: #ffe1d3;
    color: #b35327;
    border-radius: 3px;
    padding: 0 2px;
}

.dr-answer mark.ok {
    background: #d7f7e9;
    color: #0b7b58;
}

.practice-tip {
    display: flex;
    gap: 5px;
    margin-top: 10px;
    color: var(--muted-2);
    font-size: 8.5px;
    line-height: 1.55;
}

.practice-tip svg {
    flex: none;
    margin-top: 1px;
}

.shadow-sentence {
    font-family: var(--font-en);
    font-size: 17px;
    line-height: 1.55;
    color: var(--ink);
    font-weight: 550;
    letter-spacing: -.01em;
}

.shadow-zh {
    margin-top: 5px;
    color: var(--muted);
    font-size: 10px;
}

.shadow-wave {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 66px;
    margin: 14px 0 4px;
}

.shadow-wave i {
    width: 3px;
    height: var(--h);
    min-height: 5px;
    border-radius: 4px;
    background: #e4d8f6;
    transition: height .25s, background .25s;
}

.shadow-wave.is-recording i {
    background: linear-gradient(180deg, #9b7bff, #6d47f5);
    animation: wavePulse 1.1s ease-in-out infinite alternate;
    animation-delay: calc(var(--h) * -9ms);
}

@keyframes wavePulse {
    to {
        transform: scaleY(.55);
    }
}

.shadow-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 8px;
}

.record-btn {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 4px solid #f1eaff;
    background: linear-gradient(135deg, #ff8b95, #e74d75);
    color: #fff;
    display: grid;
    place-items: center;
    position: relative;
    box-shadow: 0 10px 25px rgba(231, 77, 117, .28);
    transition: transform .2s, border-color .2s;
}

.record-btn span {
    position: absolute;
    inset: -9px;
    border-radius: 50%;
    border: 1px solid rgba(231, 77, 117, .18);
}

.record-btn:hover {
    transform: scale(1.04);
}

.record-btn.is-recording {
    background: #27123f;
    border-color: #f2d4de;
    animation: recPulse 1.5s infinite;
}

.record-btn.is-recording svg {
    animation: none;
}

@keyframes recPulse {
    50% {
        box-shadow: 0 0 0 12px rgba(231, 77, 117, .09);
    }
}

.shadow-status {
    text-align: center;
    color: var(--muted-2);
    font-size: 9px;
    margin-top: 11px;
}

.shadow-status.is-ready {
    color: var(--green);
}

.shadow-controls .btn {
    min-height: 34px;
    font-size: 9.5px;
}

.cloze-sentence {
    font-family: var(--font-en);
    font-size: 16px;
    line-height: 1.65;
    color: var(--ink);
    font-weight: 500;
}

.cloze-sentence .blank {
    display: inline-block;
    min-width: 76px;
    border-bottom: 2px solid #bfa7f2;
    color: var(--violet);
    text-align: center;
    font-weight: 650;
    margin: 0 3px;
}

.cloze-zh {
    margin-top: 7px;
    font-size: 10px;
    color: var(--muted);
}

.cloze-input-row {
    display: flex;
    gap: 7px;
    margin-top: 14px;
}

.cloze-input-row input {
    flex: 1;
    min-width: 0;
    border: 1px solid #e8dff4;
    border-radius: 9px;
    background: #fff;
    padding: 9px 11px;
    font-size: 12px;
    font-family: var(--font-en);
    outline: none;
}

.cloze-input-row input:focus {
    border-color: #bda6f5;
    box-shadow: 0 0 0 3px rgba(109, 71, 245, .09);
}

.cloze-input-row .btn {
    min-height: 38px;
    padding: 0 14px;
    font-size: 10px;
}

.cloze-feedback {
    margin-top: 10px;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 10px;
    background: #fff5f2;
    color: #a54d2a;
    border: 1px solid #f5dbcf;
}

.cloze-feedback.is-correct {
    background: #ebfaf4;
    color: #0e7b59;
    border-color: #c9f0df;
}

.cards-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 2px 12px;
    color: var(--muted);
    font-size: 9px;
}

.cards-head .btn {
    min-height: 28px;
    padding: 0 8px;
    font-size: 8.5px;
}

.word-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 12px;
}

.word-card {
    border: 1px solid #ece5f6;
    background: #fff;
    border-radius: 14px;
    padding: 14px 15px 12px;
    box-shadow: 0 6px 16px rgba(35, 18, 67, .04);
    position: relative;
    overflow: hidden;
}

.word-card::before {
    content: "";
    position: absolute;
    right: -30px;
    top: -34px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: #f1eaff;
}

.word-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.word-pos {
    font-size: 8px;
    color: var(--violet);
    background: #f1eaff;
    border-radius: 4px;
    padding: 2px 5px;
}

.word-speak {
    border: 0;
    background: none;
    color: #ab9abb;
    padding: 2px;
}

.word-speak:hover {
    color: var(--violet);
}

.word-card h3 {
    font-family: var(--font-en);
    font-size: 21px;
    letter-spacing: -.03em;
    margin-top: 6px;
    line-height: 1.2;
    position: relative;
    z-index: 1;
}

.word-phonetic {
    font-size: 9px;
    color: #a191b2;
    margin-top: 1px;
    display: block;
}

.word-card p {
    font-size: 11px;
    line-height: 1.65;
    color: #6e5e82;
    margin-top: 8px;
}

.word-card blockquote {
    margin: 9px 0 0;
    border-left: 2px solid #dfd1f4;
    padding: 1px 0 1px 8px;
    font-family: var(--font-en);
    font-size: 9.5px;
    color: #7f6c96;
    line-height: 1.55;
}

.word-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #f3edfa;
    margin-top: 10px;
    padding-top: 8px;
}

.word-card-actions button {
    border: 0;
    background: none;
    color: var(--violet);
    font-size: 9px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 0;
}

.word-card-actions button:last-child {
    color: #9f8cb2;
}

.word-card.is-saved {
    border-color: #caeddf;
}

.word-card.is-saved::after {
    content: "已加入";
    position: absolute;
    top: 11px;
    right: 39px;
    font-size: 7px;
    color: var(--green);
    background: var(--green-soft);
    border-radius: 3px;
    padding: 2px 5px;
}

/* word drawer */
.word-drawer,
.shortcuts-modal,
.mode-help-modal,
.review-modal,
.explain-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 7, 28, .48);
    backdrop-filter: blur(4px);
    animation: fadeIn .2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
}

.word-sheet {
    position: relative;
    width: min(520px, 100%);
    max-height: min(760px, 88vh);
    background: #fff;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -20px 60px rgba(15, 7, 30, .22);
    display: flex;
    flex-direction: column;
    animation: sheetUp .28s var(--ease);
    overflow: hidden;
}

@keyframes sheetUp {
    from {
        transform: translateY(28px);
        opacity: .7;
    }
}

.sheet-handle {
    width: 38px;
    height: 4px;
    border-radius: 4px;
    background: #e4dcee;
    margin: 8px auto 0;
    flex: none;
}

.word-sheet-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    padding: 14px 22px 12px;
    border-bottom: 1px solid #f3eef8;
    flex: none;
}

.word-sheet-line {
    display: flex;
    align-items: center;
    gap: 7px;
}

.word-sheet-line h2 {
    font-family: var(--font-en);
    font-size: 28px;
    letter-spacing: -.035em;
    line-height: 1.2;
}

.speak-btn {
    border: 0;
    background: #f4efff;
    color: var(--violet);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
}

.word-sheet-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 3px;
    color: #9d8db0;
    font-size: 10px;
    flex-wrap: wrap;
}

.word-sheet-meta .ai-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--violet);
    background: #f1eaff;
    border-radius: 4px;
    padding: 2px 5px;
    font-size: 8px;
}

.word-sheet-scroll {
    overflow-y: auto;
    padding: 16px 22px 20px;
    flex: 1;
}

.word-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 46px 0;
    color: var(--muted);
    font-size: 11px;
}

.word-loading span {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #eee4fb;
    border-top-color: var(--violet);
    animation: spin .8s linear infinite;
}

.word-content > div {
    margin-bottom: 15px;
}

.word-content > div > span,
.word-collocations > span,
.word-tip > span {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #a596b6;
    font-size: 8px;
    letter-spacing: .05em;
    text-transform: uppercase;
    font-weight: 650;
    margin-bottom: 4px;
}

.word-definition p {
    font-size: 17px;
    line-height: 1.55;
    color: var(--ink);
    letter-spacing: -.01em;
}

.word-en-def {
    padding: 9px 12px;
    background: #faf7ff;
    border-radius: 8px;
    display: grid;
    grid-template-columns: 30px 1fr;
    gap: 5px;
}

.word-en-def > span {
    margin: 1px 0 0 !important;
}

.word-en-def p {
    font-family: var(--font-en);
    font-size: 11px;
    color: #79668f;
    line-height: 1.6;
}

.word-context p {
    font-family: var(--font-en);
    font-size: 12px;
    line-height: 1.6;
    color: #5e4b75;
    background: #fdfbff;
    border-left: 2px solid #d6c2f4;
    padding-left: 10px;
}

.word-example p {
    font-family: var(--font-en);
    font-size: 12.5px;
    color: #3d2b57;
    line-height: 1.6;
}

.word-example small {
    display: block;
    margin-top: 2px;
    color: #9f8db1;
    font-size: 10px;
}

.word-collocations > div {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.word-collocations > div span {
    border: 1px solid #ece3f8;
    background: #fcfaff;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 9.5px;
    color: #6f5b84;
}

.word-tip {
    background: #f5efff;
    border-radius: 10px;
    padding: 10px 12px;
}

.word-tip p {
    font-size: 10px;
    line-height: 1.65;
    color: #6d5786;
}

.word-fallback-note:not(:empty) {
    font-size: 9.5px;
    color: #9a7a4f;
    background: #fff9ed;
    border: 1px solid #f3e6c9;
    border-radius: 8px;
    padding: 8px 10px;
    line-height: 1.6;
}

.word-local-note {
    font-size: 9px;
    color: #14805f;
    background: #edfaf5;
    border: 1px solid #d1f0e4;
    border-radius: 8px;
    padding: 7px 10px;
    line-height: 1.55;
    margin-top: 8px;
}

.word-error {
    text-align: center;
    padding: 35px 0;
    font-size: 11px;
    color: #a64a56;
}

.word-error .btn {
    margin-top: 10px;
}

.word-sheet-foot {
    display: flex;
    gap: 8px;
    padding: 12px 22px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid #f3eef8;
    flex: none;
}

.word-sheet-foot .btn {
    flex: 1;
    min-height: 42px;
    font-size: 12px;
}

.word-sheet-foot .btn-ghost {
    flex: .8;
}

/* shortcuts / mode help / explain modals */
.shortcuts-modal,
.mode-help-modal,
.explain-modal {
    align-items: center;
}

.shortcuts-card,
.mode-help-card,
.explain-card {
    position: relative;
    width: min(460px, calc(100vw - 32px));
    background: #fff;
    border-radius: 22px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    animation: sheetUp .25s var(--ease);
}

.shortcuts-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.shortcuts-head h3 {
    font-size: 17px;
    letter-spacing: -.02em;
}

.shortcut-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 18px;
}

.shortcut-grid div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f4eef9;
    padding: 7px 0;
    font-size: 10px;
    color: var(--muted);
}

kbd {
    font-family: var(--font-en);
    font-size: 8px;
    background: #f5f1fa;
    border: 1px solid #e5dcf0;
    border-bottom-width: 2px;
    border-radius: 4px;
    padding: 2px 5px;
    color: #6c5b7e;
}

.shortcuts-note {
    margin-top: 15px;
    font-size: 9px;
    color: var(--muted-2);
}

.mode-help-card {
    text-align: center;
    width: min(380px, calc(100vw - 32px));
}

.mode-help-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--violet-soft);
    color: var(--violet);
    display: grid;
    place-items: center;
    margin: 0 auto 12px;
}

.mode-help-card h3 {
    font-size: 18px;
    letter-spacing: -.02em;
}

.mode-help-card p {
    margin: 8px 0 18px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.75;
}

.explain-card {
    width: min(560px, calc(100vw - 32px));
    max-height: min(720px, 88vh);
    overflow-y: auto;
}

.explain-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    border-bottom: 1px solid #f2edf8;
    padding-bottom: 12px;
    margin-bottom: 14px;
}

.explain-head h3 {
    font-size: 19px;
    letter-spacing: -.03em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.explain-head p {
    font-family: var(--font-en);
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
    line-height: 1.55;
}

.explain-loading {
    padding: 40px;
    text-align: center;
    color: var(--muted);
    font-size: 11px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.spinner {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid #eee4fb;
    border-top-color: var(--violet);
    animation: spin .8s linear infinite;
    display: inline-block;
}

.explain-summary {
    background: #f6f1ff;
    border-radius: 10px;
    padding: 11px 13px;
    font-size: 11.5px;
    line-height: 1.75;
    color: #5d4877;
    margin-bottom: 13px;
}

.explain-chunk {
    display: flex;
    gap: 9px;
    padding: 8px 0;
    border-bottom: 1px solid #f5effa;
}

.explain-chunk strong {
    font-family: var(--font-en);
    font-size: 11px;
    color: var(--violet);
    flex: none;
    max-width: 45%;
}

.explain-chunk span {
    font-size: 10px;
    color: var(--muted);
    line-height: 1.6;
}

.explain-block {
    margin-top: 12px;
    font-size: 10.5px;
    line-height: 1.7;
    color: var(--muted);
}

.explain-block strong {
    display: block;
    font-size: 8px;
    letter-spacing: .08em;
    color: #a495b7;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.explain-block em {
    font-style: normal;
    font-family: var(--font-en);
    color: #4a3663;
}

/* =========================================================
   Notebook page
   ========================================================= */
.page-notebook {
    background: #f8f5fc;
}

.notebook-hero {
    position: relative;
    background: linear-gradient(120deg, #f0e8ff, #faf7ff 55%, #fff0e8);
    padding: 48px 0 28px;
    overflow: hidden;
    border-bottom: 1px solid #ece4f6;
}

.notebook-orb {
    position: absolute;
    width: 560px;
    height: 560px;
    border-radius: 50%;
    right: -100px;
    top: -330px;
    background: radial-gradient(circle, rgba(155, 123, 255, .24), transparent 65%);
}

.notebook-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 30px;
}

.notebook-hero h1 {
    font-size: clamp(32px, 3.6vw, 46px);
    letter-spacing: -.055em;
    line-height: 1.2;
    font-weight: 800;
}

.notebook-hero p {
    color: var(--muted);
    font-size: 13px;
    margin-top: 7px;
    max-width: 560px;
}

.review-cta {
    flex: none;
    position: relative;
}

.review-cta em {
    font-style: normal;
    margin-left: 2px;
    background: rgba(255, 255, 255, .2);
    border-radius: 999px;
    min-width: 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    font-size: 9px;
}

.notebook-stats {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 30px;
}

.nb-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, .68);
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 14px;
    padding: 11px 13px;
    backdrop-filter: blur(12px);
}

.nb-stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex: none;
}

.nb-stat-icon--violet {
    background: #eee7ff;
    color: #7049e8;
}

.nb-stat-icon--orange {
    background: #fff0e4;
    color: #da742f;
}

.nb-stat-icon--green {
    background: #e5f8ef;
    color: #16956f;
}

.nb-stat-icon--rose {
    background: #ffeaf1;
    color: #db5079;
}

.nb-stat div {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.nb-stat strong {
    font-size: 19px;
    letter-spacing: -.02em;
}

.nb-stat span {
    font-size: 9px;
    color: var(--muted);
}

.notebook-main {
    padding: 30px 0 70px;
}

.notebook-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 22px;
    align-items: start;
}

.notebook-content {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 18px;
    min-height: 480px;
    box-shadow: var(--shadow-xs);
}

.notebook-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.segmented {
    display: inline-flex;
    gap: 2px;
    background: #f5f1fb;
    border-radius: 10px;
    padding: 3px;
}

.segmented button {
    border: 0;
    background: transparent;
    color: var(--muted);
    border-radius: 7px;
    padding: 7px 11px;
    font-size: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.segmented button em {
    font-style: normal;
    font-size: 8px;
    color: var(--muted-2);
}

.segmented button.is-active {
    background: #fff;
    color: var(--ink);
    box-shadow: 0 2px 8px rgba(35, 18, 67, .08);
}

.segmented button.is-active em {
    color: var(--violet);
}

.notebook-search {
    display: flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 12px;
    height: 34px;
    color: var(--muted-2);
}

.notebook-search input {
    border: 0;
    background: none;
    outline: none;
    width: 150px;
    font-size: 10px;
}

.word-list-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 17px 2px 10px;
    color: var(--muted);
    font-size: 9px;
}

.word-sort .text-btn {
    font-size: 9px;
}

.notebook-word-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.nb-word {
    border: 1px solid #eee7f7;
    background: #fdfbff;
    border-radius: 13px;
    padding: 12px 13px;
    position: relative;
    transition: all .2s;
}

.nb-word:hover {
    border-color: #dccdf0;
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.nb-word-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.nb-word-head h3 {
    font-family: var(--font-en);
    font-size: 18px;
    line-height: 1.25;
    letter-spacing: -.03em;
}

.nb-word-head h3 span {
    font-family: var(--font);
    font-style: normal;
    font-size: 8px;
    color: var(--violet);
    background: #f1eaff;
    border-radius: 3px;
    padding: 1px 4px;
    vertical-align: middle;
    margin-left: 3px;
}

.nb-word-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity .2s;
}

.nb-word:hover .nb-word-actions {
    opacity: 1;
}

.nb-word-actions button {
    border: 0;
    background: none;
    color: #a99ab8;
    padding: 2px;
}

.nb-word-actions button:hover {
    color: var(--violet);
}

.nb-word-phonetic {
    color: #a091b1;
    font-size: 8.5px;
    margin-top: 1px;
}

.nb-word-def {
    margin-top: 6px;
    font-size: 10.5px;
    line-height: 1.6;
    color: #665278;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nb-word-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #f3edf9;
    padding-top: 7px;
    margin-top: 9px;
    color: #a696b5;
    font-size: 8px;
}

.nb-word-foot span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    max-width: 72%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nb-status {
    border-radius: 999px;
    padding: 2px 6px;
    font-size: 7.5px;
    font-style: normal;
}

.nb-status--learning {
    color: #b26c23;
    background: #fff3e3;
}

.nb-status--known {
    color: #11805e;
    background: #e8f9f1;
}

.nb-status--due {
    color: #c1475b;
    background: #ffedf0;
}

.notebook-empty {
    margin-top: 16px;
    display: none;
}

.notebook-empty.is-visible {
    display: flex;
}

.notebook-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.side-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 17px;
    padding: 15px 16px;
    box-shadow: var(--shadow-xs);
}

.side-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    font-weight: 650;
    color: var(--ink-2);
    margin-bottom: 12px;
}

.side-card-head > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.side-card-head svg {
    color: var(--violet);
}

.review-ring-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.review-ring {
    --p: 0;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: conic-gradient(var(--violet) calc(var(--p) * 1%), #f0eaf8 0);
    display: grid;
    place-items: center;
    flex: none;
    position: relative;
}

.review-ring::before {
    content: "";
    position: absolute;
    inset: 7px;
    border-radius: 50%;
    background: #fff;
}

.review-ring > div {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}

.review-ring strong {
    font-size: 18px;
    letter-spacing: -.02em;
}

.review-ring span {
    font-size: 7.5px;
    color: var(--muted-2);
}

.review-ring-copy strong {
    font-size: 10.5px;
    display: block;
    line-height: 1.4;
}

.review-ring-copy p {
    color: var(--muted-2);
    font-size: 8.5px;
    line-height: 1.55;
    margin-top: 3px;
}

.review-bars {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.review-bars > div {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 8px;
    color: var(--muted-2);
}

.review-bars span {
    width: 34px;
    flex: none;
}

.review-bars i {
    flex: 1;
    height: 4px;
    background: #f1ebf9;
    border-radius: 4px;
    overflow: hidden;
}

.review-bars b {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--violet);
}

.review-bars b.bar-orange {
    background: var(--peach);
}

.review-bars em {
    font-style: normal;
    width: 24px;
    text-align: right;
}

.side-actions {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.side-action {
    display: flex;
    align-items: center;
    gap: 9px;
    border: 0;
    background: none;
    text-align: left;
    padding: 8px 3px;
    border-radius: 8px;
    color: var(--muted);
    cursor: pointer;
}

.side-action:hover {
    background: #fbf8ff;
}

.side-action svg {
    color: #9e8bb4;
    flex: none;
}

.side-action span {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

.side-action strong {
    font-size: 9.5px;
    color: var(--ink-2);
    font-weight: 600;
}

.side-action small {
    font-size: 7.5px;
    color: var(--muted-2);
}

.side-action--danger strong,
.side-action--danger svg {
    color: #c05462;
}

.mini-quote {
    background: linear-gradient(140deg, #24103f, #3b1c63);
    color: #fff;
    border-color: transparent;
}

.mini-quote > span {
    color: #bda6ff;
}

.mini-quote p {
    color: rgba(255, 255, 255, .63);
    font-size: 10px;
    line-height: 1.75;
    margin-top: 7px;
}

.notebook-section {
    padding: 30px 0 40px;
    border-top: 1px solid #eee6f7;
    background: #fbf9ff;
}

.notebook-section#favorites {
    background: #f8f5fc;
}

.section-side-count {
    font-size: 10px;
    color: var(--muted-2);
}

.favorites-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.fav-card {
    display: flex;
    gap: 11px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 8px;
    transition: all .2s;
}

.fav-card:hover {
    border-color: #d9c9ef;
    box-shadow: var(--shadow-sm);
}

.fav-cover {
    width: 100px;
    height: 62px;
    border-radius: 8px;
    overflow: hidden;
    flex: none;
    background: var(--violet-soft);
}

.fav-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fav-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    gap: 1px;
}

.fav-copy small {
    font-size: 7.5px;
    color: var(--violet);
    letter-spacing: .04em;
}

.fav-copy strong {
    font-size: 10.5px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fav-copy span {
    font-size: 8px;
    color: var(--muted-2);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 9px 11px;
}

.history-cover {
    width: 86px;
    height: 52px;
    border-radius: 7px;
    overflow: hidden;
    flex: none;
}

.history-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-main {
    flex: 1;
    min-width: 0;
}

.history-main strong {
    font-size: 11px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-main span {
    font-size: 8px;
    color: var(--muted-2);
}

.history-progress {
    width: 150px;
    flex: none;
}

.history-progress i {
    display: block;
    height: 4px;
    background: #f0eaf8;
    border-radius: 4px;
    overflow: hidden;
}

.history-progress b {
    display: block;
    height: 100%;
    background: var(--violet);
    border-radius: inherit;
}

.history-progress em {
    display: block;
    font-style: normal;
    font-size: 7.5px;
    color: var(--muted-2);
    margin-top: 3px;
    text-align: right;
}

.history-play {
    width: 31px;
    height: 31px;
    border-radius: 50%;
    background: #f4efff;
    color: var(--violet);
    display: grid;
    place-items: center;
    flex: none;
}

/* review modal */
.review-modal {
    align-items: center;
}

.review-dialog {
    position: relative;
    width: min(560px, calc(100vw - 30px));
    background: #fff;
    border-radius: 24px;
    padding: 22px;
    box-shadow: var(--shadow-lg);
    animation: sheetUp .25s var(--ease);
    max-height: calc(100vh - 30px);
    overflow-y: auto;
}

.review-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.review-kicker {
    font-size: 8px;
    letter-spacing: .14em;
    color: var(--violet);
    font-weight: 700;
}

.review-head h3 {
    font-size: 20px;
    letter-spacing: -.03em;
    margin-top: 2px;
}

.review-progress {
    height: 4px;
    background: #f1ebf9;
    border-radius: 4px;
    margin-top: 15px;
    overflow: hidden;
}

.review-progress i {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #9b7bff, #6d47f5);
    border-radius: inherit;
    transition: width .25s;
}

.review-meta {
    display: flex;
    justify-content: space-between;
    color: var(--muted-2);
    font-size: 8.5px;
    margin-top: 5px;
}

.review-card {
    margin-top: 12px;
    border: 1px solid #eee6f7;
    background: #fdfbff;
    border-radius: 17px;
    padding: 24px;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    position: relative;
}

.review-source {
    font-size: 8px;
    color: var(--violet);
    background: #f0e8ff;
    border-radius: 4px;
    padding: 2px 6px;
    display: inline-block;
    align-self: center;
}

.review-card-front h2 {
    font-family: var(--font-en);
    font-size: 34px;
    letter-spacing: -.04em;
    margin-top: 10px;
    line-height: 1.2;
}

.review-phonetic {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: #9d8caf;
    font-size: 10px;
    margin-top: 2px;
}

.review-phonetic button {
    border: 0;
    background: #f2ebff;
    color: var(--violet);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: grid;
    place-items: center;
}

.review-hint {
    margin-top: 20px;
    color: var(--muted-2);
    font-size: 9px;
}

.review-answer {
    text-align: left;
    margin-top: 10px;
}

.review-pos {
    font-size: 8px;
    color: var(--violet);
    background: #f1eaff;
    border-radius: 3px;
    padding: 2px 5px;
}

.review-def {
    font-size: 17px;
    line-height: 1.55;
    margin-top: 7px;
    letter-spacing: -.01em;
}

.review-en {
    font-family: var(--font-en);
    color: #8d7ba0;
    font-size: 10px;
    margin-top: 3px;
}

.review-answer blockquote {
    margin: 12px 0 0;
    background: #f7f2ff;
    border-radius: 8px;
    padding: 9px 11px;
    font-family: var(--font-en);
    font-size: 10.5px;
    line-height: 1.6;
    color: #5d4974;
}

.review-answer small {
    display: block;
    color: #9a88ab;
    font-size: 8.5px;
    margin-top: 3px;
}

.review-context {
    margin-top: 10px;
    font-size: 8.5px;
    color: #a291b3;
    line-height: 1.55;
}

.review-context span {
    color: var(--violet);
    margin-right: 4px;
}

.review-context em {
    font-style: normal;
    font-family: var(--font-en);
}

.review-reveal {
    border: 1px solid #e2d5f5;
    background: #fff;
    color: var(--ink-2);
    border-radius: 9px;
    padding: 9px 13px;
    font-size: 10px;
    margin: 16px auto 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.review-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 11px;
}

.review-btn {
    border: 1px solid #eee6f7;
    background: #fdfbff;
    border-radius: 11px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    position: relative;
    text-align: left;
}

.review-btn span {
    font-size: 11px;
    font-weight: 650;
}

.review-btn small {
    font-size: 8px;
    color: var(--muted-2);
}

.review-btn kbd {
    position: absolute;
    right: 8px;
    top: 9px;
}

.review-btn--again:hover {
    border-color: #f2c5ce;
    background: #fff8f9;
}

.review-btn--good:hover {
    border-color: #bfe9d8;
    background: #f5fdf9;
}

.review-done {
    text-align: center;
    padding: 32px 10px 8px;
}

.review-done-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--green-soft);
    color: var(--green);
    display: grid;
    place-items: center;
    margin: 0 auto 12px;
}

.review-done h3 {
    font-size: 20px;
}

.review-done p {
    font-size: 10px;
    color: var(--muted);
    margin: 5px 0 18px;
}

/* error page */
.error-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
    background: radial-gradient(700px 500px at 50% 20%, #2b1450, #150b27);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.error-orb {
    position: absolute;
    width: 440px;
    height: 440px;
    border-radius: 50%;
    background: rgba(109, 71, 245, .2);
    filter: blur(50px);
}

.error-page > span {
    font-size: 80px;
    font-weight: 800;
    letter-spacing: -.07em;
    color: rgba(255, 255, 255, .12);
    line-height: 1;
    position: relative;
}

.error-page h1 {
    font-size: 27px;
    margin: 10px 0;
    position: relative;
}

.error-page p {
    color: rgba(255, 255, 255, .5);
    font-size: 13px;
    margin-bottom: 22px;
    position: relative;
}

.error-page .btn {
    position: relative;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1180px) {
    .hero-inner {
        grid-template-columns: minmax(0, 1fr) 340px;
        gap: 20px;
    }

    .hero-phone-wrap,
    .hero-phone {
        width: 320px;
    }

    .hero-phone {
        min-height: 510px;
    }

    .hero-title {
        font-size: clamp(42px, 4.8vw, 62px);
    }

    .float-pill--one {
        left: -18px;
    }

    .float-pill--two {
        right: -10px;
    }

    .float-card {
        right: -8px;
    }

    .watch-layout {
        grid-template-columns: minmax(0, 1fr) 410px;
    }

    .episode-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }

    .detail-section .container {
        gap: 40px;
    }
}

@media (max-width: 1020px) {
    .main-nav {
        gap: 16px;
    }

    .nav-link {
        font-size: 12.5px;
    }

    .header-search {
        display: none;
    }

    .hero-inner {
        grid-template-columns: 1fr;
        padding-top: 46px;
        min-height: 0;
    }

    .hero-copy {
        max-width: 680px;
    }

    .hero-visual {
        display: none;
    }

    .hero {
        padding-bottom: 0;
    }

    .hero-title {
        font-size: clamp(42px, 6vw, 60px);
    }

    .resume-panel {
        grid-template-columns: 1fr;
    }

    .resume-side {
        border-left: 0;
        border-top: 1px solid var(--line);
        flex-direction: row;
        align-items: center;
        gap: 16px;
    }

    .resume-steps {
        margin: 0 0 0 auto;
        max-width: 180px;
        flex: 1;
    }

    .episode-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mode-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-section .container {
        grid-template-columns: 1fr;
        gap: 42px;
    }

    .detail-copy > p {
        max-width: 560px;
    }

    .detail-features {
        max-width: 470px;
    }

    .detail-window {
        max-width: 760px;
        transform: none;
    }

    .watch-layout {
        grid-template-columns: 1fr;
    }

    .study-panel {
        position: relative;
        top: 0;
        height: auto;
        max-height: none;
        min-height: 460px;
    }

    .study-body {
        max-height: 560px;
    }

    .lesson-intro {
        grid-template-columns: minmax(0, 1fr) 200px;
    }

    .notebook-layout {
        grid-template-columns: 1fr;
    }

    .notebook-side {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .mini-quote {
        grid-column: 1 / -1;
    }

    .notebook-stats {
        grid-template-columns: repeat(4, 1fr);
    }

    .settings-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    body {
        font-size: 14px;
    }

    .container {
        padding: 0 17px;
    }

    .page-home {
        padding-bottom: 64px;
    }

    .site-header {
        position: sticky;
        top: 0;
    }

    .site-header--dark {
        position: absolute;
        background: transparent;
    }

    .header-inner {
        height: 64px;
        gap: 12px;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    .brand-text strong {
        font-size: 16px;
    }

    .brand-text small {
        font-size: 6.5px;
    }

    .main-nav {
        display: none;
    }

    .header-cta {
        display: none;
    }

    .mobile-menu-btn {
        display: grid;
    }

    .header-actions {
        gap: 6px;
    }

    .hero {
        padding-top: 64px;
    }

    .hero-inner {
        padding-top: 38px;
        padding-bottom: 44px;
        gap: 20px;
    }

    .eyebrow {
        font-size: 9.5px;
        padding: 6px 10px;
    }

    .hero-title {
        font-size: clamp(35px, 10vw, 46px);
        margin-top: 18px;
        line-height: 1.18;
        letter-spacing: -.045em;
    }

    .hero-lead {
        font-size: 13px;
        line-height: 1.8;
        margin-top: 16px;
    }

    .hero-actions {
        margin-top: 23px;
        gap: 9px;
    }

    .hero-actions .btn {
        min-height: 46px;
        padding: 0 19px;
        font-size: 13px;
    }

    .hero-trust {
        gap: 10px 14px;
        margin-top: 18px;
        font-size: 9.5px;
    }

    .hero-stats {
        gap: 0;
        justify-content: space-between;
        margin-top: 25px;
        padding-top: 18px;
    }

    .hero-stat strong {
        font-size: 17px;
    }

    .hero-stat span {
        font-size: 8px;
    }

    .hero-marquee {
        padding: 11px 0;
    }

    .continue-wrap {
        margin-top: -14px;
    }

    .resume-main {
        padding: 12px;
        gap: 11px;
        flex-wrap: wrap;
    }

    .resume-cover {
        width: 92px;
        height: 60px;
    }

    .resume-copy strong {
        font-size: 12.5px;
        max-width: 43vw;
    }

    .resume-kicker {
        font-size: 8px;
    }

    .resume-copy small {
        font-size: 8px;
    }

    .resume-action {
        width: 100%;
        margin: 2px 0 0 103px;
        font-size: 10px;
    }

    .resume-side {
        padding: 13px 14px;
        display: none;
    }

    .library-section {
        padding: 45px 0 50px;
    }

    .section-heading {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 22px;
    }

    .section-heading h2 {
        font-size: 28px;
    }

    .section-heading p {
        font-size: 11.5px;
        margin-top: 7px;
    }

    .library-count {
        display: none;
    }

    .library-search {
        flex-direction: column;
        align-items: stretch;
        gap: 9px;
        padding-top: 12px;
    }

    .library-search form {
        max-width: none;
    }

    .difficulty-select {
        justify-content: flex-end;
    }

    .episode-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .episode-card {
        border-radius: 17px;
    }

    .library-invite {
        grid-column: span 1 !important;
        min-height: 0;
        padding: 19px;
        border-radius: 17px;
    }

    .library-invite-copy > strong {
        font-size: 14px;
    }

    .library-invite-copy p {
        font-size: 10px;
    }

    .library-invite-link {
        margin-left: 54px;
        align-self: flex-start;
    }

    .episode-body {
        padding: 12px 14px;
    }

    .episode-title {
        font-size: 15px;
        min-height: 0;
    }

    .episode-cover {
        aspect-ratio: 16 / 8.7;
    }

    .cover-play {
        opacity: 1;
        transform: translate(-50%, -50%) scale(.9);
        width: 42px;
        height: 42px;
    }

    .modes-section {
        padding: 52px 0 56px;
    }

    .section-heading--light {
        gap: 14px;
    }

    .section-heading--light .text-link {
        margin-top: 3px;
    }

    .mode-grid {
        grid-template-columns: 1fr 1fr;
        gap: 7px;
    }

    .mode-card {
        min-height: 104px;
        padding: 12px 10px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .mode-icon {
        width: 32px;
        height: 32px;
        border-radius: 9px;
    }

    .mode-copy strong {
        font-size: 12px;
    }

    .mode-copy small {
        font-size: 8.5px;
    }

    .mode-arrow {
        position: absolute;
        right: 10px;
        top: 13px;
    }

    .mode-group-head small {
        display: none;
    }

    .detail-section {
        padding: 55px 0;
    }

    .detail-section .container {
        gap: 28px;
    }

    .detail-copy h2 {
        font-size: 30px;
    }

    .detail-copy > p {
        font-size: 12px;
    }

    .detail-features {
        gap: 9px 10px;
    }

    .detail-features span {
        font-size: 9.5px;
    }

    .detail-screen {
        grid-template-columns: 1fr;
    }

    .detail-video {
        min-height: 210px;
    }

    .detail-cues {
        display: none;
    }

    .detail-float {
        right: 8px;
        bottom: -18px;
        padding: 9px 12px;
    }

    .cta-section {
        padding: 16px 0 54px;
    }

    .cta-card {
        padding: 34px 23px;
        border-radius: 24px;
        min-height: 290px;
    }

    .cta-card h2 {
        font-size: 30px;
    }

    .cta-actions {
        gap: 8px;
    }

    .cta-actions .btn {
        font-size: 12px;
        padding: 0 16px;
    }

    .site-footer {
        padding: 38px 0 80px;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .footer-meta {
        text-align: left;
        padding-top: 0;
    }

    .footer-links {
        padding-top: 0;
        gap: 12px 22px;
        font-size: 12px;
    }

    .site-footer--compact {
        padding: 24px 0 30px;
    }

    .back-top {
        bottom: 82px;
        right: 14px;
        width: 37px;
        height: 37px;
    }

    .bottom-nav {
        display: flex;
        position: fixed;
        z-index: 150;
        left: 10px;
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        height: 58px;
        border: 1px solid rgba(232, 224, 243, .9);
        background: rgba(255, 255, 255, .94);
        backdrop-filter: blur(20px);
        border-radius: 19px;
        box-shadow: 0 15px 40px rgba(32, 16, 60, .14);
        align-items: center;
        justify-content: space-around;
        padding: 0 7px;
    }

    .bottom-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        font-size: 8px;
        color: #a091b2;
        width: 60px;
        height: 46px;
        justify-content: center;
        border-radius: 12px;
        position: relative;
    }

    .bottom-nav a.is-active {
        color: var(--violet);
    }

    .bottom-nav a.is-active::before {
        content: "";
        position: absolute;
        bottom: 0;
        width: 14px;
        height: 2px;
        border-radius: 2px;
        background: var(--violet);
    }

    .bottom-badge {
        position: absolute;
        top: 5px;
        right: 16px;
        min-width: 13px;
        height: 13px;
        padding: 0 3px;
        border-radius: 7px;
        background: #f4567f;
        color: #fff;
        font-size: 7px;
        display: grid;
        place-items: center;
    }

    /* watch mobile */
    .watch-header-inner {
        height: 58px;
        padding: 0 12px;
        gap: 8px;
    }

    .watch-back {
        width: 33px;
        height: 33px;
    }

    .watch-header .brand-text,
    .watch-divider,
    .watch-title span {
        display: none;
    }

    .watch-title strong {
        font-size: 11px;
        max-width: 34vw;
    }

    .watch-actions {
        gap: 1px;
    }

    .watch-actions .icon-btn {
        width: 30px;
        height: 30px;
    }

    .watch-actions .icon-btn[data-share],
    .watch-actions .icon-btn[href*="download"] {
        display: none;
    }

    .watch-next-btn {
        min-height: 32px;
        padding: 0 10px;
        font-size: 9px;
        margin-left: 2px;
    }

    .watch-main {
        padding: 10px 0 30px;
    }

    .watch-layout {
        gap: 12px;
    }

    .video-shell {
        border-radius: 15px;
        aspect-ratio: 16 / 10;
    }

    .video-topline {
        padding: 8px 10px;
    }

    .video-topline-title {
        max-width: 38%;
    }

    .video-big-play {
        width: 54px;
        height: 54px;
    }

    .video-big-play svg {
        width: 24px;
        height: 24px;
    }

    .video-controls {
        padding: 0 9px 7px;
    }

    .controls-row {
        gap: 1px;
    }

    .vc-btn {
        width: 28px;
        height: 28px;
    }

    .vc-play {
        width: 31px;
        height: 31px;
    }

    .vc-btn[data-skip="-5"],
    .vc-btn[data-skip="5"],
    .volume-slider,
    .vc-text-btn span,
    .time-display .divider {
        display: none;
    }

    .time-display {
        margin-left: 3px;
        font-size: 8px;
    }

    .controls-spacer {
        flex: 1;
    }

    .vc-text-btn {
        padding: 0 4px;
        height: 28px;
    }

    .video-overlay-caption {
        bottom: 57px;
    }

    .player-actions-bar {
        margin-top: 8px;
        border-radius: 12px;
        padding: 5px 6px;
        gap: 4px;
        display: block;
    }

    .mode-tabs {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 2px;
        overflow: visible;
    }

    .mode-tab {
        padding: 7px 4px;
        font-size: 9.5px;
        justify-content: center;
        gap: 3px;
    }

    .mode-tab svg {
        width: 13px;
        height: 13px;
    }

    .player-tools {
        display: none;
    }

    .lesson-intro {
        grid-template-columns: 1fr;
        padding: 18px;
        gap: 18px;
        border-radius: 16px;
        margin-top: 9px;
    }

    .lesson-intro h1 {
        font-size: 21px;
        margin-top: 9px;
    }

    .lesson-progress-card {
        border-left: 0;
        border-top: 1px solid #f1ecf7;
        padding-left: 0;
        padding-top: 14px;
    }

    .lpc-stats {
        margin: 10px 0;
    }

    .lesson-description {
        font-size: 11.5px;
    }

    .related-section {
        margin-top: 18px;
    }

    .related-grid {
        display: flex;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 4px;
    }

    .related-card {
        min-width: 230px;
    }

    .study-panel {
        border-radius: 18px;
        min-height: 480px;
    }

    .study-head {
        padding: 14px 14px 9px;
    }

    .study-head h2 {
        font-size: 16px;
    }

    .study-subbar {
        padding: 0 14px 9px;
    }

    .cue {
        grid-template-columns: 45px minmax(0, 1fr);
        padding: 9px 5px;
    }

    .cue-en {
        font-size: 12.5px;
    }

    .cue-zh {
        font-size: 10.5px;
    }

    .cue-tools {
        opacity: 1;
        transform: none;
        gap: 4px;
    }

    .cue-tools button {
        width: 26px;
        height: 24px;
    }

    .practice-view {
        padding: 4px 12px 16px;
    }

    .word-sheet {
        max-height: 88vh;
        border-radius: 21px 21px 0 0;
    }

    .word-drawer {
        align-items: flex-end;
    }

    .shortcut-grid {
        grid-template-columns: 1fr;
    }

    .notebook-hero {
        padding: 30px 0 20px;
    }

    .notebook-hero-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .notebook-hero h1 {
        font-size: 34px;
    }

    .notebook-hero p {
        font-size: 11px;
    }

    .review-cta {
        width: 100%;
        min-height: 46px;
    }

    .notebook-stats {
        grid-template-columns: 1fr 1fr;
        gap: 7px;
        margin-top: 20px;
    }

    .nb-stat {
        padding: 9px 10px;
    }

    .notebook-main {
        padding: 17px 0 44px;
    }

    .notebook-content {
        padding: 12px;
        border-radius: 16px;
    }

    .notebook-toolbar {
        gap: 9px;
    }

    .segmented {
        width: 100%;
        justify-content: space-between;
    }

    .segmented button {
        flex: 1;
        justify-content: center;
        font-size: 9px;
        padding: 7px 5px;
    }

    .notebook-search {
        width: 100%;
    }

    .notebook-search input {
        width: 100%;
    }

    .notebook-word-grid {
        grid-template-columns: 1fr;
    }

    .notebook-side {
        grid-template-columns: 1fr;
    }

    .notebook-section {
        padding: 24px 0 30px;
    }

    .favorites-grid {
        grid-template-columns: 1fr;
    }

    .history-progress {
        width: 72px;
    }

    .history-item {
        gap: 8px;
        padding: 7px 8px;
    }

    .history-cover {
        width: 63px;
        height: 40px;
    }

    .review-dialog {
        padding: 17px;
        border-radius: 20px;
    }

    .review-card {
        min-height: 230px;
        padding: 18px 14px;
    }

    .review-card-front h2 {
        font-size: 29px;
    }

    .review-def {
        font-size: 15px;
    }

    .notebook-section#progress {
        padding-bottom: 20px;
    }

    .toast-stack {
        bottom: 82px;
    }

    .page-notebook .toast-stack {
        bottom: 82px;
    }
}

@media (max-width: 380px) {
    .hero-title {
        font-size: 33px;
    }

    .hero-stat strong {
        font-size: 15px;
    }

    .hero-stat span {
        font-size: 7px;
    }

    .mode-grid {
        grid-template-columns: 1fr;
    }

    .mode-card {
        min-height: 78px;
        flex-direction: row;
        align-items: center;
    }

    .mode-arrow {
        position: static;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* =========================================================
   Study stage 2.0 — video-first, one-sentence-at-a-time flow
   ========================================================= */
.page-watch {
    background: #f3eef9;
}

.watch-main {
    padding: 16px 0 40px;
}

.watch-layout {
    max-width: 1040px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
}

.player-column {
    display: contents;
}

.video-shell { order: 1; }
.study-dock { order: 2; }
.player-actions-bar { order: 3; }
.study-panel { order: 4; }
.lesson-intro { order: 5; }
.related-section { order: 6; }

.video-shell {
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(25, 10, 48, .2);
    aspect-ratio: 16 / 9;
}

.study-dock {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    height: 62px;
    padding: 7px 12px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-xs);
}

.dock-left { display: flex; align-items: center; }
.dock-center { display: flex; align-items: center; justify-content: center; gap: 15px; }
.dock-right { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }

.dock-speed {
    border: 1px solid #e8dff3;
    background: #faf7ff;
    color: var(--ink-2);
    border-radius: 9px;
    min-width: 58px;
    height: 40px;
    padding: 3px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
}

.dock-speed span { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dock-speed small { font-size: 7px; color: var(--muted-2); margin-top: 2px; }
.dock-speed:hover { border-color: #cbb5f2; background: #f6f0ff; }

.dock-side-btn {
    border: 0;
    background: transparent;
    color: var(--muted);
    height: 38px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 7px;
    font-size: 10px;
}

.dock-side-btn:hover { background: #f7f2ff; color: var(--violet); }

.dock-play {
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: #211337;
    color: #fff;
    display: grid;
    place-items: center;
    box-shadow: 0 8px 20px rgba(31, 18, 50, .22);
    transition: transform .2s, background .2s;
}

.dock-play:hover { transform: scale(1.04); background: #5a30df; }

.dock-icon-btn {
    border: 0;
    background: transparent;
    color: #9a89ad;
    min-width: 40px;
    height: 42px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    font-size: 7px;
    padding: 0 4px;
}

.dock-icon-btn:hover { background: #f7f2ff; color: var(--violet); }
.dock-icon-btn.is-active { color: var(--violet); background: var(--violet-soft); }

.player-actions-bar {
    margin-top: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    min-height: 50px;
    padding: 5px 8px;
}

.mode-tab {
    padding: 7px 12px;
    font-size: 11px;
}

.study-panel {
    position: static;
    height: auto;
    max-height: none;
    min-height: 0;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.study-head {
    padding: 17px 22px 9px;
}

.study-head h2 {
    font-size: 19px;
}

.study-subbar {
    padding: 0 22px 12px;
    font-size: 9.5px;
}

.study-body {
    flex: none;
    max-height: 450px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
    scroll-padding: 12px;
    background: #fbf9ff;
    border-top: 1px solid #f5effa;
    border-bottom: 1px solid #f5effa;
}

.cue-list {
    padding: 10px 12px 14px;
}

.cue {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 5px;
    padding: 17px 17px 15px 10px;
    margin: 4px 0;
    border: 1px solid transparent;
    border-radius: 15px;
    background: transparent;
    transition: background .25s var(--ease), border-color .25s, box-shadow .25s, opacity .25s, transform .25s var(--ease);
    scroll-margin: 16px;
    opacity: .65;
}

.cue + .cue {
    box-shadow: inset 0 1px 0 #f1ecf7;
}

.cue:hover {
    opacity: 1;
    background: #fff;
}

.cue.is-active {
    opacity: 1;
    background: linear-gradient(120deg, #f8f3ff, #fdfbff);
    border-color: #e0d1f8;
    box-shadow: 0 10px 30px rgba(76, 42, 139, .09), inset 3px 0 0 #8b63f6;
    transform: translateY(-1px);
    animation: cuePop .32s var(--ease);
}

@keyframes cuePop {
    0% { transform: translateY(5px) scale(.995); opacity: .5; }
    100% { transform: translateY(-1px) scale(1); opacity: 1; }
}

.cue-rail {
    gap: 2px;
    padding-left: 5px;
}

.cue-index {
    font-size: 10px;
    font-weight: 750;
    color: #9a89b1;
}

.cue.is-active .cue-index { color: var(--violet); }

.cue-time {
    font-size: 8.5px;
    color: #b1a3c0;
}

.cue-line {
    width: 1px;
    min-height: 18px;
    margin-top: 5px;
    margin-left: 4px;
    background: #ece4f5;
}

.cue.is-active .cue-line { background: #cdb8f4; }

.cue-en {
    font-size: 15.5px;
    line-height: 1.7;
    color: #3c2c54;
    letter-spacing: -.01em;
}

.cue.is-active .cue-en {
    font-size: 20px;
    line-height: 1.62;
    color: #1e1038;
    font-weight: 500;
}

.cue-zh {
    font-size: 11.5px;
    line-height: 1.7;
    color: #a191ad;
    margin-top: 5px;
}

.cue.is-active .cue-zh {
    font-size: 13.5px;
    color: #7a6690;
    margin-top: 7px;
}

.cue .word {
    padding: 0 1px;
    border-radius: 3px;
}

.cue .word:hover {
    background: #e8ddff;
}

.word.kw-1, .overlay-kw.kw-1 { color: #6d3df0; background: #ede5ff; }
.word.kw-2, .overlay-kw.kw-2 { color: #c85b1f; background: #fff0e6; }
.word.kw-3, .overlay-kw.kw-3 { color: #137e67; background: #e5f8f0; }
.word.kw-4, .overlay-kw.kw-4 { color: #b13c6c; background: #ffeaf2; }
.word.kw-5, .overlay-kw.kw-5 { color: #2c65b5; background: #e9f1ff; }

.cue .word.is-keyword {
    font-weight: 750;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    text-decoration-color: currentColor;
}

.cue.is-active .word.is-keyword {
    text-decoration-thickness: 2px;
}

.cue-tools {
    margin-top: 8px;
    opacity: 0;
}

.cue.is-active .cue-tools,
.cue:hover .cue-tools {
    opacity: 1;
}

.cue-tools button {
    width: 26px;
    height: 24px;
    color: #a08caf;
}

.cue-tools button:hover {
    color: var(--violet);
}

.cue-keywords-inline {
    display: none;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 9px;
}

.cue.is-active .cue-keywords-inline {
    display: flex;
}

.cue-kw {
    border: 1px solid #e8dcf8;
    background: #fff;
    border-radius: 7px;
    padding: 3px 7px;
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    max-width: 100%;
}

.cue-kw strong {
    color: var(--violet);
    font-size: 9px;
    font-weight: 700;
}

.cue-kw span {
    color: #a08eaf;
    font-size: 7.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.cue-kw:hover { border-color: #cbb5f2; background: #faf7ff; }

.study-note-card {
    margin: 10px 16px 16px;
}

.study-foot {
    background: #fff;
    padding: 10px 18px;
}

.video-overlay-caption p {
    font-size: clamp(17px, 1.9vw, 27px);
}

.overlay-kw {
    font-weight: 800;
    border-radius: 4px;
    padding: 0 3px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.lesson-intro {
    margin-top: 4px;
}

.related-section {
    margin-top: 12px;
}

/* Word drawer extras */
.word-exam-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 7px;
}

.word-exam-tags span {
    font-size: 8px;
    color: #6d5b82;
    background: #f4eefb;
    border: 1px solid #ece2f8;
    border-radius: 4px;
    padding: 2px 5px;
}

.word-sheet-meta .local-chip {
    color: #167a5c;
    background: #e8f8f1;
}

.word-sheet-meta .cache-chip {
    color: #8b6924;
    background: #fff6df;
}

@media (max-width: 1020px) {
    .watch-layout { max-width: 100%; }
    .study-body { max-height: 430px; }
}

@media (max-width: 760px) {
    .watch-main { padding: 8px 0 24px; }
    .watch-layout { gap: 8px; }
    .video-shell { border-radius: 14px; aspect-ratio: 16 / 10; }
    .study-dock {
        height: 54px;
        border-radius: 13px;
        padding: 5px 8px;
        grid-template-columns: auto 1fr auto;
        gap: 4px;
    }
    .dock-speed { min-width: 48px; height: 36px; padding: 2px 5px; }
    .dock-speed span { font-size: 11px; }
    .dock-speed small { font-size: 6px; }
    .dock-center { gap: 8px; }
    .dock-side-btn { height: 34px; padding: 0 3px; }
    .dock-side-btn span { display: none; }
    .dock-play { width: 43px; height: 43px; }
    .dock-right { gap: 0; }
    .dock-icon-btn { min-width: 32px; height: 38px; font-size: 6px; }
    .dock-icon-btn[data-open-shortcuts] { display: none; }
    .player-actions-bar {
        border-radius: 12px;
        padding: 5px 6px;
    }
    .mode-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .mode-tab { font-size: 9.5px; padding: 7px 3px; }
    .study-panel { border-radius: 16px; }
    .study-head { padding: 13px 14px 8px; }
    .study-head h2 { font-size: 16px; }
    .study-subbar { padding: 0 14px 9px; font-size: 8.5px; }
    .study-body { max-height: 410px; }
    .cue-list { padding: 7px 7px 10px; }
    .cue {
        grid-template-columns: 48px minmax(0, 1fr);
        padding: 13px 11px 12px 7px;
        border-radius: 12px;
    }
    .cue-en { font-size: 14px; }
    .cue.is-active .cue-en { font-size: 18px; line-height: 1.62; }
    .cue-zh { font-size: 10.5px; }
    .cue.is-active .cue-zh { font-size: 12px; }
    .cue-tools { opacity: 1; }
    .cue-index { font-size: 9px; }
    .cue-time { font-size: 7px; }
    .cue.is-active .cue-keywords-inline { display: flex; }
    .cue-kw span { max-width: 110px; }
    .study-note-card { margin: 6px 10px 12px; }
    .study-foot { padding: 8px 12px; }
    .lesson-intro { margin-top: 5px; }
}

/* Font scale must win over the active-sentence size. */
.study-panel.font-small .cue-en { font-size: 14px; }
.study-panel.font-small .cue.is-active .cue-en { font-size: 18px; }
.study-panel.font-small .cue-zh { font-size: 10.5px; }
.study-panel.font-small .cue.is-active .cue-zh { font-size: 12px; }
.study-panel.font-large .cue-en { font-size: 17px; }
.study-panel.font-large .cue.is-active .cue-en { font-size: 23px; }
.study-panel.font-large .cue-zh { font-size: 12.5px; }
.study-panel.font-large .cue.is-active .cue-zh { font-size: 15px; }
@media (max-width: 760px) {
    .study-panel.font-small .cue.is-active .cue-en { font-size: 16px; }
    .study-panel.font-large .cue.is-active .cue-en { font-size: 21px; }
}

.study-legend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #a08eaf;
    font-size: 8px;
    margin-left: auto;
}

.study-legend i {
    width: 6px;
    height: 6px;
    border-radius: 2px;
    background: #8b63f6;
    box-shadow: 5px 0 0 #ff9d6b, 10px 0 0 #3ab893;
}

.study-legend + .study-subbar-link {
    margin-left: 9px;
}

@media (max-width: 760px) {
    .study-legend { display: none; }
}

.study-meta-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 9px 22px;
    background: #fbf9ff;
    border-top: 1px solid #f5effa;
    color: #9d8db0;
    font-size: 8.5px;
}

.study-meta-bar span { display: inline-flex; align-items: baseline; gap: 3px; }
.study-meta-bar b { color: #4d3a65; font-size: 11px; font-weight: 700; }
.study-meta-bar button {
    margin-left: auto;
    border: 1px solid #e5d8f6;
    background: #fff;
    color: #6d47f5;
    border-radius: 999px;
    padding: 4px 9px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 8px;
    font-weight: 600;
}
.study-meta-bar button:hover { background: #f6f0ff; }

@media (max-width: 760px) {
    .study-meta-bar { padding: 7px 14px; gap: 10px; font-size: 8px; }
    .study-meta-bar b { font-size: 10px; }
    .study-meta-bar button { font-size: 7.5px; padding: 4px 7px; }
}

/* =========================================================
   Final study flow: video → sentence → controls → modes
   ========================================================= */
.study-panel {
    display: contents;
}

.study-head,
.study-subbar {
    display: none !important;
}

.video-shell { order: 1; }
.study-body { order: 2; }
.study-meta-bar { order: 3; }
.study-dock { order: 4; }
.player-actions-bar { order: 5; }
.study-foot { order: 6; }
.lesson-intro { order: 7; }
.related-section { order: 8; }

.study-body {
    border: 1px solid #e9e1f3;
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
    background: #fff;
    box-shadow: 0 12px 32px rgba(34, 17, 60, .06);
    max-height: 500px;
}

.study-panel[data-mode="dictation"] .study-body,
.study-panel[data-mode="shadow"] .study-body,
.study-panel[data-mode="cloze"] .study-body {
    max-height: 620px;
}

.study-panel[data-mode="cards"] .study-body {
    max-height: 560px;
}

.study-meta-bar {
    border: 1px solid #e9e1f3;
    border-top: 1px solid #f5effa;
    border-radius: 0 0 18px 18px;
    background: #fff;
    padding: 8px 16px;
    box-shadow: 0 12px 32px rgba(34, 17, 60, .06);
    gap: 13px;
}

.study-meta-bar > span:first-child {
    color: #6b47dc;
    font-weight: 650;
}

.study-meta-bar .meta-download {
    margin-left: auto;
    border: 1px solid #e5d8f6;
    background: #fff;
    color: #6d47f5;
    border-radius: 999px;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
}

.study-meta-bar .meta-download:hover { background: #f6f0ff; }

.study-meta-bar button {
    margin-left: 0;
}

.study-dock {
    height: 54px;
    border-radius: 14px;
    margin-top: 2px;
}

.player-actions-bar {
    min-height: 44px;
    padding: 4px 7px;
}

.mode-tab {
    min-height: 32px;
    padding: 6px 12px;
}

.study-foot {
    border: 1px solid #e9e1f3;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(34, 17, 60, .03);
}

@media (max-width: 760px) {
    .video-shell { aspect-ratio: 16 / 10; }
    .study-body { max-height: 410px; border-radius: 14px 14px 0 0; }
    .study-panel[data-mode="dictation"] .study-body,
    .study-panel[data-mode="shadow"] .study-body,
    .study-panel[data-mode="cloze"] .study-body { max-height: 540px; }
    .study-meta-bar {
        padding: 7px 10px;
        gap: 8px;
        border-radius: 0 0 14px 14px;
        overflow-x: auto;
        white-space: nowrap;
    }
    .study-meta-bar::-webkit-scrollbar { display: none; }
    .study-meta-bar span { font-size: 8px; }
    .study-meta-bar b { font-size: 10px; }
    .study-meta-bar button { font-size: 8px; padding: 4px 7px; }
    .study-meta-bar .meta-download { width: 24px; height: 24px; flex: none; }
    .study-dock { height: 51px; margin-top: 1px; border-radius: 12px; }
    .player-actions-bar {
        min-height: 39px;
        padding: 4px 5px;
        border-radius: 12px;
    }
    .mode-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 2px;
        width: 100%;
        scrollbar-width: none;
    }
    .mode-tabs::-webkit-scrollbar { display: none; }
    .mode-tab {
        flex: 0 0 auto;
        min-height: 29px;
        padding: 6px 10px;
        font-size: 9px;
    }
    .mode-tab svg { width: 12px; height: 12px; }
    .study-foot { margin-top: 1px; }
}

/* Keep the video, current sentences and control dock inside one viewport. */
.video-shell {
    width: min(100%, calc(46vh * 16 / 9));
    margin-left: auto;
    margin-right: auto;
}

.study-body {
    max-height: clamp(185px, 21vh, 320px);
}

@media (max-width: 760px) {
    .video-shell {
        width: 100%;
    }
    .study-body {
        max-height: clamp(220px, 34vh, 330px);
    }
}


/* One aligned study column: video, sentence feed, dock, modes. */
.watch-layout {
    --stage-width: min(100%, calc(46vh * 16 / 9));
}

.video-shell,
.study-body,
.study-meta-bar,
.seek-strip,
.study-dock,
.player-actions-bar,
.study-foot {
    width: var(--stage-width);
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 760px) {
    .watch-layout { --stage-width: 100%; }
}

@media (max-width: 760px) {
    .mode-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
    }
}
.study-body { scrollbar-width: none; }
.study-body::-webkit-scrollbar { width: 0; height: 0; }

/* Mobile reference layout: clean video subtitle, taller sentence feed, compact controls. */
@media (max-width: 760px) {
    .study-meta-bar,
    .study-foot {
        display: none !important;
    }

    .study-body {
        max-height: clamp(260px, 42vh, 360px);
        border-bottom: 1px solid #e9e1f3;
        border-radius: 14px;
    }

    .study-dock {
        margin-top: 6px;
    }

    .dock-icon-btn[data-open-shortcuts] {
        display: none !important;
    }

    .dock-icon-btn[data-toggle-captions] {
        display: flex !important;
    }

    .study-meta-bar + .study-dock {
        margin-top: 6px;
    }
}
@media (max-width: 760px) {
    .mode-tab {
        padding: 6px 6px;
        font-size: 8.5px;
        gap: 2px;
    }
    .mode-tab svg { width: 11px; height: 11px; }
}

.cue .word.is-speaking {
    color: #2a183d !important;
    background: #ffe08a !important;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(255, 196, 0, .28);
    font-weight: 800;
}

.cue [data-loop-this].is-active {
    color: #6d3df0;
    background: #f1e9ff;
}

@media (max-width: 760px) {
    body.page-watch {
        height: 100dvh;
        overflow: hidden;
    }

    .page-watch .watch-main {
        height: calc(100dvh - 58px);
        padding: 6px 0 8px;
        overflow: hidden;
    }

    .page-watch .watch-layout {
        height: 100%;
        min-height: 0;
        gap: 6px;
        overflow: hidden;
    }

    .page-watch .video-shell {
        flex: 0 0 auto;
    }

    .page-watch .study-body {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
    }

    .page-watch .study-dock,
    .page-watch .player-actions-bar {
        flex: 0 0 auto;
        margin-top: 0;
    }

    .page-watch .lesson-intro,
    .page-watch .related-section,
    .page-watch .site-footer,
    .page-watch .study-meta-bar,
    .page-watch .study-foot {
        display: none !important;
    }
}

@media (max-width: 760px) {
    body.page-watch { height: 100vh; height: 100dvh; }
    .page-watch .watch-main {
        height: calc(100vh - 58px);
        height: calc(100dvh - 58px);
    }
}

/* Clean per-sentence card: no left rail, full-width sentence. */
.cue {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px 16px;
}

.study-dock {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.dock-center {
    justify-self: center;
}

.dock-right {
    min-width: 0;
}

@media (max-width: 760px) {
    html,
    body.page-watch {
        overscroll-behavior: none;
        -webkit-text-size-adjust: 100%;
        touch-action: manipulation;
    }

    .page-watch textarea,
    .page-watch input,
    .page-watch select {
        font-size: 16px !important;
    }

    .page-watch .video-controls {
        display: none !important;
    }

    .page-watch .video-overlay-caption {
        left: 5%;
        right: 5%;
        bottom: 12px;
    }

    .page-watch .video-overlay-caption p {
        font-size: 13px;
        line-height: 1.3;
        font-weight: 600;
    }

    .page-watch .video-overlay-caption span {
        font-size: 10px;
        line-height: 1.3;
        margin-top: 2px;
    }
}
@media (max-width: 760px) {
    .page-watch .study-dock { position: relative; }
    .page-watch .dock-center {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        justify-self: auto;
        z-index: 1;
    }
}
.study-dock {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
}
.dock-left { justify-self: start; }
.dock-center { justify-self: center; position: static; left: auto; transform: none; }
.dock-right { justify-self: end; }

@media (max-width: 760px) {
    .page-watch .dock-center {
        position: static;
        left: auto;
        transform: none;
    }
}
@media (max-width: 760px) {
    body.page-watch {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100vh;
        height: 100svh;
        overflow: hidden;
    }

    .page-watch .watch-main {
        height: calc(100vh - 58px);
        height: calc(100svh - 58px);
    }
}
.study-dock { position: relative; }
.dock-center {
    position: relative;
    width: 176px;
    justify-content: space-between;
    gap: 0;
}
.dock-play {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.dock-play:hover { transform: translateX(-50%) scale(1.04); }

@media (max-width: 760px) {
    .page-watch .dock-center { width: 128px; }
}


/* Sentence footer: number + start time + audio waveform on the left, tools on the right. */
.cue-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 9px;
    padding-top: 8px;
    border-top: 1px dashed #eee5f7;
}

.cue-inline-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.cue-no {
    color: #7b4cf0;
    font-size: 10px;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

.cue-start {
    color: #8c7aa1;
    background: #f4effc;
    border-radius: 5px;
    padding: 3px 6px;
    font-size: 8.5px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.cue-wave {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    height: 14px;
    margin-left: 1px;
}

.cue-wave i {
    display: block;
    width: 2px;
    height: 5px;
    border-radius: 2px;
    background: #cbb9e8;
    transform-origin: center;
}

.cue.is-active .cue-wave i {
    background: #8b63f6;
    animation: cueWave .75s ease-in-out infinite alternate;
}
.cue.is-active .cue-wave i:nth-child(2) { animation-delay: .12s; }
.cue.is-active .cue-wave i:nth-child(3) { animation-delay: .24s; }
.cue.is-active .cue-wave i:nth-child(4) { animation-delay: .36s; }

@keyframes cueWave {
    from { height: 4px; opacity: .55; }
    to { height: 14px; opacity: 1; }
}

.cue-footer .cue-tools {
    margin: 0;
    padding: 0;
    justify-content: flex-end;
    flex: none;
}

@media (max-width: 760px) {
    .cue-footer { margin-top: 7px; padding-top: 7px; gap: 6px; }
    .cue-inline-meta { gap: 5px; }
    .cue-no { font-size: 9px; }
    .cue-start { font-size: 8px; padding: 3px 5px; }
    .cue-wave { height: 12px; }
    .cue-footer .cue-tools { gap: 2px; }
    .cue-footer .cue-tools button { width: 28px; height: 28px; }
}

.seek-strip {
    order: 4;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 26px;
    padding: 0 6px;
    color: #8f7da4;
    font-size: 8.5px;
    font-variant-numeric: tabular-nums;
}

.seek-strip > span { flex: none; min-width: 30px; text-align: center; }

.seek-track {
    position: relative;
    flex: 1 1 auto;
    height: 22px;
    display: flex;
    align-items: center;
    cursor: pointer;
    touch-action: none;
    outline: none;
}

.seek-track::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 999px;
    background: #ebe3f5;
}

.seek-buffer,
.seek-played {
    position: absolute;
    left: 0;
    height: 4px;
    border-radius: 999px;
    width: 0;
}

.seek-buffer { background: #d9cdf0; }
.seek-played { background: linear-gradient(90deg, #6d3df0, #ad7cff); }

.seek-thumb {
    position: absolute;
    left: 0;
    width: 12px;
    height: 12px;
    margin-left: -6px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #7a4cf0;
    box-shadow: 0 1px 5px rgba(88, 47, 190, .28);
    pointer-events: none;
}

.seek-track:focus-visible::before { box-shadow: 0 0 0 2px rgba(109, 61, 240, .2); }

.study-dock { order: 5; }
.player-actions-bar { order: 6; }
.study-foot { order: 7; }

@media (max-width: 760px) {
    .page-watch .seek-strip {
        flex: 0 0 auto;
        height: 23px;
        padding: 0 2px;
        gap: 4px;
        font-size: 8px;
    }
    .page-watch .seek-strip > span { min-width: 28px; }
    .page-watch .seek-track { height: 20px; }
    .page-watch .seek-thumb { width: 11px; height: 11px; margin-left: -5.5px; border-width: 3px; }
}



/* Mobile app bar */
@media (max-width: 760px) {
    .watch-header-inner {
        height: 52px;
        padding: 0 10px;
        gap: 8px;
    }
    .watch-header .brand {
        display: none !important;
    }
    .watch-back {
        width: 34px;
        height: 34px;
        background: #fff;
    }
    .watch-title {
        gap: 0;
    }
    .watch-title span {
        display: block;
        font-size: 8px;
        font-weight: 600;
        letter-spacing: .02em;
        color: #a18fae;
    }
    .watch-title strong {
        font-size: 13px;
        max-width: 44vw;
    }
    .watch-actions {
        gap: 3px;
    }
    .watch-actions .icon-btn {
        width: 31px;
        height: 31px;
    }
    .watch-actions .watch-fullscreen {
        display: grid;
    }
    .watch-next-btn {
        width: 32px;
        height: 32px;
        min-height: 32px;
        padding: 0;
        margin-left: 1px;
        border-radius: 50%;
        border: 1px solid #e9e0f4 !important;
        background: #fff !important;
        color: #5d4a72 !important;
        box-shadow: none !important;
        font-size: 0;
        display: grid;
        place-items: center;
    }
    .watch-next-btn svg {
        width: 15px;
        height: 15px;
    }

    /* Tighten the stage so more sentence content is visible. */
    body.page-watch,
    .page-watch .watch-main {
        height: calc(100svh - 52px);
    }
    .page-watch .watch-main {
        padding: 4px 0 5px;
    }
    .page-watch .watch-layout {
        gap: 4px;
    }
    .page-watch .video-shell {
        aspect-ratio: 16 / 9;
    }
    .page-watch .seek-strip {
        height: 20px;
    }
    .page-watch .study-dock {
        height: 46px;
        padding: 4px 8px;
    }
    .page-watch .dock-play {
        width: 40px;
        height: 40px;
    }
    .page-watch .dock-side-btn {
        height: 30px;
    }
    .page-watch .dock-icon-btn {
        height: 32px;
        min-width: 30px;
    }
    .page-watch .dock-speed {
        height: 34px;
        min-width: 48px;
    }
    .page-watch .player-actions-bar {
        min-height: 33px;
        padding: 3px 5px;
    }
    .page-watch .mode-tab {
        min-height: 27px;
        padding: 4px 7px;
        font-size: 8px;
    }
    .page-watch .mode-tab svg {
        width: 10px;
        height: 10px;
    }
}

/* Quiet app-bar treatment for the watch header (desktop + mobile). */
.watch-header .brand,
.watch-header .watch-divider {
    display: none !important;
}

.watch-header-inner {
    height: 60px;
    padding: 0 20px;
    gap: 10px;
}

.watch-title span {
    color: #a18fae;
    font-size: 8.5px;
    letter-spacing: .03em;
}

.watch-title strong {
    font-size: 14px;
}

.watch-next-btn {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #e8e0f2 !important;
    background: #fff !important;
    color: #3a294d !important;
    box-shadow: none !important;
    font-size: 10px;
    font-weight: 650;
}

.watch-next-btn:hover {
    background: #faf7ff !important;
    border-color: #d9c9f0 !important;
}

.watch-fullscreen {
    color: #7f6c93;
}
@media (max-width: 760px) {
    .watch-header-inner {
        height: 52px;
        padding: 0 10px;
        gap: 8px;
    }
    .watch-title strong {
        font-size: 13px;
        max-width: 44vw;
    }
    .watch-next-btn {
        width: 32px;
        height: 32px;
        min-height: 32px;
        padding: 0;
        margin-left: 1px;
        border-radius: 50%;
        font-size: 0;
        display: grid;
        place-items: center;
    }
    .watch-next-btn svg {
        width: 15px;
        height: 15px;
    }
}

/* Keep the new app bar, restore the previous content/controls sizing. */
@media (max-width: 760px) {
    .page-watch .watch-main {
        height: calc(100svh - 52px);
        padding: 6px 0 8px;
    }

    .page-watch .watch-layout {
        gap: 6px;
    }

    .page-watch .video-shell {
        aspect-ratio: 16 / 10;
    }

    .page-watch .seek-strip {
        height: 23px;
    }

    .page-watch .study-dock {
        height: 51px;
        padding: 7px 10px;
    }

    .page-watch .dock-play {
        width: 43px;
        height: 43px;
    }

    .page-watch .dock-side-btn {
        height: 34px;
    }

    .page-watch .dock-icon-btn {
        height: 38px;
        min-width: 32px;
    }

    .page-watch .dock-speed {
        height: 40px;
        min-width: 52px;
    }

    .page-watch .player-actions-bar {
        min-height: 39px;
        padding: 4px 5px;
    }

    .page-watch .mode-tab {
        min-height: 29px;
        padding: 6px 8px;
        font-size: 9px;
    }

    .page-watch .mode-tab svg {
        width: 12px;
        height: 12px;
    }

    .watch-title strong {
        max-width: 38vw;
    }

    .watch-next-btn {
        width: auto;
        min-width: 54px;
        height: 32px;
        padding: 0 9px;
        border-radius: 999px;
        font-size: 9px;
        font-weight: 650;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 3px;
        white-space: nowrap;
    }

    .watch-next-btn svg {
        width: 13px;
        height: 13px;
    }
}

/* Match the compact control layout from the version in the reference image. */
@media (max-width: 760px) {
    .page-watch .video-shell {
        aspect-ratio: 16 / 9;
    }
    .page-watch .seek-strip {
        height: 20px;
    }
    .page-watch .study-dock {
        height: 46px;
        padding: 4px 8px;
    }
    .page-watch .dock-play {
        width: 40px;
        height: 40px;
    }
    .page-watch .dock-side-btn {
        height: 30px;
    }
    .page-watch .dock-icon-btn {
        height: 32px;
        min-width: 30px;
    }
    .page-watch .dock-speed {
        height: 34px;
        min-width: 48px;
    }
    .page-watch .player-actions-bar {
        min-height: 33px;
        padding: 3px 5px;
    }
    .page-watch .mode-tab {
        min-height: 27px;
        padding: 4px 6px;
        font-size: 8px;
    }
    .page-watch .mode-tab svg {
        width: 10px;
        height: 10px;
    }
}

/* PWA / notch safe areas: keep the app bar below the status bar and fill the bottom. */
@media (max-width: 760px) {
    html {
        height: 100%;
    }

    body.page-watch {
        height: 100% !important;
        min-height: 0;
        padding-top: constant(safe-area-inset-top);
        padding-top: env(safe-area-inset-top, 0px);
        padding-bottom: constant(safe-area-inset-bottom);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-sizing: border-box;
    }

    .page-watch .watch-main {
        height: calc(100% - 52px) !important;
        min-height: 0;
    }
}


/* Use most of the bottom safe area for content, while keeping the tab row above the home indicator. */
@media (max-width: 760px) {
    body.page-watch {
        padding-bottom: max(8px, calc(env(safe-area-inset-bottom, 0px) - 12px)) !important;
    }
    .page-watch .watch-main {
        padding-bottom: 0 !important;
    }
}
@media (max-width: 760px) {
    body.page-watch {
        padding-bottom: max(4px, calc(env(safe-area-inset-bottom, 0px) - 30px)) !important;
    }
}

/* Tablet landscape / desktop: video controls left, subtitle study panel right. */
@media (min-width: 768px) {
    .watch-layout {
        --stage-width: 100%;
        max-width: 1280px;
        display: grid;
        grid-template-columns: minmax(0, 1.35fr) minmax(340px, .85fr);
        grid-template-areas:
            "video study"
            "seek study"
            "dock study"
            "tabs meta"
            "intro intro"
            "related related";
        gap: 12px 18px;
        align-items: start;
    }

    .watch-layout .video-shell {
        grid-area: video;
        width: 100%;
        max-height: none;
    }

    .watch-layout .study-body {
        grid-area: study;
        width: 100%;
        height: 100%;
        min-height: 0;
        max-height: none;
        overflow: auto;
        border: 1px solid #e9e1f3;
        border-radius: 18px;
        background: #fff;
    }

    .watch-layout .seek-strip {
        grid-area: seek;
        width: 100%;
    }

    .watch-layout .study-dock {
        grid-area: dock;
        width: 100%;
        margin: 0;
    }

    .watch-layout .player-actions-bar {
        grid-area: tabs;
        width: 100%;
        margin: 0;
    }

    .watch-layout .study-meta-bar {
        grid-area: meta;
        width: 100%;
        margin: 0;
        border: 1px solid #e9e1f3;
        border-radius: 14px;
    }

    .watch-layout .lesson-intro {
        grid-area: intro;
        width: 100%;
    }

    .watch-layout .related-section {
        grid-area: related;
        width: 100%;
    }

    .watch-layout .study-foot {
        display: none !important;
    }
}


/* Portrait tablet: keep two columns but give the video/control column more room. */
@media (min-width: 768px) and (max-width: 1199px) {
    .watch-layout {
        grid-template-columns: minmax(0, 1.55fr) minmax(300px, .8fr);
    }
    .watch-layout .study-dock {
        height: 46px;
        padding: 4px 8px;
    }
    .watch-layout .dock-speed {
        height: 34px;
        min-width: 48px;
    }
    .watch-layout .dock-play {
        width: 40px;
        height: 40px;
    }
    .watch-layout .dock-center {
        width: 128px;
    }
    .watch-layout .dock-side-btn {
        height: 30px;
    }
    .watch-layout .dock-icon-btn {
        height: 32px;
        min-width: 30px;
    }
    .watch-layout .dock-icon-btn[data-open-shortcuts] {
        display: none !important;
    }
    .watch-layout .player-actions-bar {
        min-height: 33px;
        padding: 3px 5px;
    }
    .watch-layout .mode-tab {
        min-height: 27px;
        padding: 4px 6px;
        font-size: 8px;
    }
    .watch-layout .mode-tab svg {
        width: 10px;
        height: 10px;
    }
    .watch-layout .mode-tabs {
        overflow-x: auto;
    }
    .watch-layout .cue.is-active .cue-en {
        font-size: 18px;
    }
}

/* Tablet two-column: icon-only controls, all modes visible. */
@media (min-width: 768px) and (max-width: 1199px) {
    .watch-layout .study-meta-bar {
        display: none !important;
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .watch-layout .dock-side-btn span,
    .watch-layout .dock-icon-btn span {
        display: none;
    }
    .watch-layout .player-tools {
        display: none !important;
    }
    .watch-layout .mode-tabs {
        justify-content: space-between;
    }
}
@media (min-width: 768px) and (max-width: 1199px) {
    .watch-layout .study-body {
        grid-row: 1 / 5;
    }
}


/* Keep the center transport group truly centered and prevent overlap with the right tools. */
.study-dock {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

@media (max-width: 760px) {
    .page-watch .dock-center {
        width: 120px;
    }
    .page-watch .dock-side-btn {
        min-width: 30px;
        padding: 0;
    }
    .page-watch .dock-right {
        min-width: 90px;
    }
}
@media (max-width: 340px) {
    .page-watch .dock-icon-btn {
        min-width: 27px;
        width: 27px;
    }
    .page-watch .dock-icon-btn span {
        display: none;
    }
    .page-watch .dock-right {
        min-width: 81px;
    }
}
@media (max-width: 340px) {
    .page-watch .dock-icon-btn[data-auto-pause] {
        display: none;
    }
    .page-watch .dock-right {
        min-width: 54px;
    }
}

/* Home hero secondary CTA: glass on dark, never a stark white default pill. */
.hero-actions .btn-ghost {
    --btn-bg: rgba(255, 255, 255, .055);
    --btn-color: #fff;
    --btn-border: rgba(255, 255, 255, .22);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.hero-actions .btn-ghost:hover {
    --btn-bg: rgba(255, 255, 255, .11);
    --btn-border: rgba(255, 255, 255, .34);
    --btn-color: #fff;
}

/* The transport play button is positioned against the dock itself, not the middle flex group. */
.study-dock {
    position: relative;
}

.study-dock .dock-center {
    position: static;
}

.study-dock .dock-play {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.study-dock .dock-play:hover {
    transform: translateX(-50%) scale(1.04);
}

/* Center the transport glyph geometrically inside its circular button. */
.study-dock .dock-play {
    padding: 0;
    line-height: 0;
}

.study-dock .dock-play svg {
    display: block;
    width: 20px;
    height: 20px;
}

.study-dock .dock-play.is-paused-icon svg {
    transform: translateX(-1px);
}

/* PWA safe area for normal site pages (home, member, notebook). */
@supports (padding: max(0px)) {
    .site-header {
        padding-top: env(safe-area-inset-top, 0px);
        box-sizing: border-box;
    }

    .announcement-bar {
        padding-top: env(safe-area-inset-top, 0px);
    }
}

/* Remove the old "内容后台" link from the mobile drawer. */
.mobile-drawer-foot a[href*="admin"] {
    display: none !important;
}

/* Home course pagination */
.library-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
    margin: 16px 0 4px;
}
.library-page-numbers {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}
.library-page-btn {
    min-width: 27px;
    height: 27px;
    padding: 0 6px;
    border: 1px solid #e7def2;
    border-radius: 7px;
    background: #fff;
    color: #6b577f;
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
}
.library-page-btn:hover {
    border-color: #bda6e8;
    color: #6d3df0;
}
.library-page-btn.is-active {
    border-color: #6d3df0;
    background: #6d3df0;
    color: #fff;
}
.library-page-btn:disabled {
    opacity: .38;
    cursor: not-allowed;
}
.library-page-jump {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #9a89ad;
    font-size: 9px;
    margin-left: 2px;
}
.library-page-jump input {
    width: 36px;
    height: 27px;
    border: 1px solid #e7def2;
    border-radius: 7px;
    text-align: center;
    color: #4f3869;
    background: #fff;
    font-size: 10px;
    padding: 0 2px;
}
@media (max-width: 760px) {
    .library-pagination {
        gap: 4px;
        margin: 12px 0 2px;
    }
    .library-page-jump {
        flex-basis: auto;
        justify-content: center;
        margin: 0 0 0 2px;
    }
}

/* Faceted glass brand mark */
.brand-mark.brand-mark--logo {
    background: transparent;
    box-shadow: none;
    overflow: visible;
    border-radius: 12px;
}
.brand-mark.brand-mark--logo::after {
    display: none;
}
.brand-mark.brand-mark--logo img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(54, 30, 96, .22);
}

/* Admin-only live controls over the real watch page */
.live-admin-panel {
    position: fixed;
    right: 18px;
    bottom: 20px;
    z-index: 95;
    width: 270px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 14px;
    background: rgba(20,11,37,.92);
    color: #fff;
    box-shadow: 0 18px 55px rgba(0,0,0,.3);
    backdrop-filter: blur(18px);
    overflow: hidden;
}
.live-admin-panel summary {
    display: flex; align-items: center; gap: 7px;
    padding: 10px 12px;
    color: rgba(255,255,255,.76);
    font-size: 10px; cursor: pointer; list-style: none;
}
.live-admin-panel summary::-webkit-details-marker { display: none; }
.live-admin-panel summary::after { content: "⌄"; margin-left: auto; color: rgba(255,255,255,.4); }
.live-admin-panel[open] summary::after { content: "⌃"; }
.live-admin-panel form { display: grid; gap: 9px; padding: 0 12px 12px; }
.live-admin-head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.1); font-size: 10px; }
.live-admin-head a { color: #a992ff; font-size: 8px; text-decoration: none; }
.live-admin-panel label { display: grid; gap: 4px; }
.live-admin-panel label > span { color: rgba(255,255,255,.48); font-size: 8px; }
.live-admin-panel select, .live-admin-panel input[type="number"] {
    width: 100%; height: 30px; border: 1px solid rgba(255,255,255,.15); border-radius: 7px;
    background: rgba(255,255,255,.08); color: #fff; padding: 0 8px; font-size: 10px;
}
.live-admin-panel select option { color: #2c1647; background: #fff; }
.live-admin-range { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.live-admin-check { display: flex !important; align-items: center; gap: 6px !important; color: rgba(255,255,255,.6); font-size: 9px; }
.live-admin-check input { accent-color: #8d67ff; }
.live-admin-panel .btn { padding: 7px 9px; font-size: 10px; }
@media (max-width: 760px) {
    .live-admin-panel { right: 10px; bottom: 86px; width: calc(100% - 20px); }
}

/* Explicit unmute control (important on iOS, where the native volume UI has no mute toggle) */
.video-unmute-prompt {
    position: absolute;
    left: 14px;
    bottom: 66px;
    z-index: 18;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 999px;
    background: rgba(255,255,255,.94);
    color: #2b1646;
    padding: 9px 13px;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 10px 28px rgba(0,0,0,.25);
    cursor: pointer;
}
.video-unmute-prompt[hidden] { display: none; }
.video-unmute-prompt:hover { background: #fff; }
.video-unmute-prompt::before {
    content: "";
    width: 6px; height: 6px; border-radius: 50%;
    background: #ff9d6b;
    box-shadow: 0 0 0 4px rgba(255,157,107,.18);
}
@media (max-width: 760px) {
    .video-unmute-prompt { bottom: 58px; left: 10px; padding: 8px 11px; font-size: 10px; }
}

/* Tablet tune: keep the hero phone inside the viewport and use the menu drawer
   instead of squeezing all desktop nav links into one row. */
@media (max-width: 1250px) and (min-width: 1021px) {
    .hero-inner {
        grid-template-columns: minmax(0, 1fr) 310px;
        gap: 22px;
    }
    .hero-phone-wrap,
    .hero-phone {
        width: 298px;
    }
    .hero-phone {
        min-height: 485px;
    }
}

@media (max-width: 900px) and (min-width: 761px) and (min-height: 600px) {
    .main-nav {
        display: none;
    }
    .mobile-menu-btn {
        display: grid;
    }
    .header-inner {
        gap: 14px;
    }
    .mobile-drawer {
        left: 17px;
        right: 17px;
    }
}

/* iPad split view / small tablet: don't lock the watch page to one viewport
   height; allow the page to scroll instead of clipping the study panel. */
@media (min-width: 521px) and (max-width: 760px) and (min-height: 700px) {
    body.page-watch {
        position: static;
        inset: auto;
        width: auto;
        height: auto;
        min-height: 100vh;
        overflow: auto;
        padding-bottom: 12px;
    }
    .page-watch .watch-main {
        height: auto;
        min-height: 0;
        padding-bottom: 18px;
        overflow: visible;
    }
    .page-watch .watch-layout {
        height: auto;
        min-height: 0;
        overflow: visible;
    }
}

@media (min-width: 521px) and (max-width: 760px) and (min-height: 700px) {
    body.page-watch {
        height: auto !important;
        min-height: 100vh;
        overflow: auto !important;
    }
    .page-watch .watch-main {
        height: auto !important;
        overflow: visible !important;
    }
    .page-watch .watch-layout {
        height: auto !important;
        overflow: visible !important;
    }
}

@media (max-width: 1250px) and (min-width: 1021px) {
    .hero-phone-wrap {
        transform: rotate(-1.5deg) translateX(-16px);
    }
    .hero-phone-wrap:hover {
        transform: rotate(-.8deg) translateX(-16px) translateY(-4px);
    }
}

/* iPad portrait / 1024 landscape: one readable column beats two cramped columns. */
@media (min-width: 768px) and (max-width: 1100px) and (min-height: 700px) {
    .watch-layout {
        display: flex;
        flex-direction: column;
        gap: 14px;
        max-width: 100%;
    }
    .watch-layout .video-shell,
    .watch-layout .study-body,
    .watch-layout .study-meta-bar,
    .watch-layout .seek-strip,
    .watch-layout .study-dock,
    .watch-layout .player-actions-bar,
    .watch-layout .mode-tabs {
        width: 100%;
        max-width: 100%;
    }
    .watch-layout .study-body {
        max-height: 430px;
        border-radius: 14px;
    }
    .watch-layout .study-meta-bar {
        border-radius: 0 0 14px 14px;
    }
    .watch-layout .study-dock {
        margin-top: 0;
    }
}

/* iOS Safari: border-radius + overflow clipping can swallow the hardware video layer. */
@media (min-width: 521px) and (max-width: 1366px) and (min-height: 700px) {
    .video-shell {
        isolation: auto;
        background: #080510;
        -webkit-mask-image: -webkit-radial-gradient(white, black);
        mask-image: radial-gradient(white, black);
    }
    .lesson-video {
        z-index: 2;
        background: #000;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        will-change: transform;
    }
    .video-vignette {
        z-index: 3;
    }
    .video-backdrop {
        display: none !important;
    }
}

/* Tablet single-column order: video, controls, then sentence list. */
@media (min-width: 521px) and (max-width: 1100px) and (min-height: 700px) {
    .watch-layout .video-shell { order: 1; }
    .watch-layout .seek-strip { order: 2; }
    .watch-layout .study-dock { order: 3; }
    .watch-layout .player-actions-bar { order: 4; }
    .watch-layout .mode-tabs { order: 5; }
    .watch-layout .study-body { order: 6; }
    .watch-layout .study-meta-bar { order: 7; }
    .watch-layout .study-foot { order: 8; }
    .watch-layout .lesson-intro { order: 9; }
    .watch-layout .related-section { order: 10; }
}

/* iOS 14 Safari does not support aspect-ratio. Without this fallback the video
   shell and episode covers collapse to zero height (video appears to vanish). */
@supports not (aspect-ratio: 1 / 1) {
    /* Put the video back in normal flow. iOS 14.2 can show a black frame for an
       absolutely-positioned video inside a clipped, rounded shell. */
    .video-shell {
        height: auto;
        padding-top: 0;
        overflow: visible;
        border-radius: 0;
        background: #000;
    }
    .lesson-video {
        position: relative;
        top: auto;
        right: auto;
        bottom: auto;
        left: auto;
        display: block;
        width: 100%;
        height: auto;
        z-index: 1;
        background: #000;
        object-fit: contain;
        -webkit-transform: none;
        transform: none;
        -webkit-backface-visibility: visible;
        backface-visibility: visible;
        will-change: auto;
        -webkit-mask-image: none;
        mask-image: none;
    }
    .episode-cover {
        height: auto;
        padding-top: 56.25%;
    }
    .episode-cover-link {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        height: auto;
    }
}

@media (max-width: 760px) {
    @supports not (aspect-ratio: 1 / 1) {
        .episode-cover {
            padding-top: 54.375%;
        }
    }
}
@media (min-width: 521px) and (max-width: 1366px) and (min-height: 700px) {
    .study-body {
        scroll-behavior: auto;
    }
}
@media (min-width: 521px) and (max-width: 1366px) and (min-height: 700px) {
    .study-body {
        overflow-anchor: none;
    }
}
@media (min-width: 521px) and (max-width: 1366px) and (min-height: 700px) {
    .cue.is-active {
        animation: none;
        transform: none;
    }
}
