:root {
    --page-bg: linear-gradient(180deg, #f2f7fc 0%, #f8fbfe 54%, #ffffff 100%);
    --card-bg: rgba(255, 255, 255, 0.96);
    --surface-muted: #f7fbff;
    --border-color: #dbe4ef;
    --primary-color: #2368c9;
    --primary-dark: #184d96;
    --secondary-color: #f2f6fb;
    --warning-color: #d97c18;
    --success-color: #21805b;
    --danger-color: #b74444;
    --text-main: #18324b;
    --text-muted: #667b92;
    --shadow-soft: 0 16px 34px rgba(35, 82, 145, 0.10);
    --shadow-strong: 0 22px 46px rgba(23, 63, 118, 0.12);
    --radius-large: 18px;
    --radius-medium: 12px;
    --radius-small: 8px;
    --brand-logo-url: url("/static/logo.svg?v=20260729-brand-refresh");
    --brand-logo-width: clamp(116px, 12vw, 148px);
    --page-width: min(1120px, calc(100% - 40px));
    --page-width-wide: min(1320px, calc(100% - 40px));
    --page-width-compact: min(920px, calc(100% - 40px));
    --study-word-size: clamp(1.28rem, 0.75vw + 1.08rem, 1.62rem);
    --study-word-size-mobile: clamp(1.18rem, 5vw, 1.42rem);
    --pronounce-control-min-width: 48px;
    --pronounce-control-height: 34px;
}

html {
    -webkit-text-size-adjust: 100%;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Trebuchet MS", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: clamp(15px, 0.18vw + 14.4px, 17px);
    line-height: 1.6;
    background: var(--page-bg);
    color: var(--text-main);
}

a {
    text-decoration: none;
}

img,
svg {
    max-width: 100%;
}

button,
a.primary-button,
a.secondary-button,
a.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    min-height: 44px;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.2;
    padding: 0.72rem 1.15rem;
    text-align: center;
    white-space: normal;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

button:focus-visible,
a.primary-button:focus-visible,
a.secondary-button:focus-visible,
a.ghost-button:focus-visible,
.text-input:focus-visible,
.text-area:focus-visible,
.text-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(35, 104, 201, 0.14);
}

button.action-button-success {
    background: #e8f6ee;
    color: #186a43;
    box-shadow: 0 0 0 3px rgba(58, 186, 111, 0.14);
}

button.action-button-busy {
    background: linear-gradient(180deg, #edf4ff 0%, #dfeeff 100%);
    color: var(--primary-dark);
    border: 1px solid #c5d8f5;
    box-shadow: 0 6px 14px rgba(35, 104, 201, 0.10);
}

button:hover,
a.primary-button:hover,
a.secondary-button:hover,
a.ghost-button:hover {
    transform: translateY(-1px);
}

.page-shell {
    width: var(--page-width);
    margin: 0 auto;
    padding: clamp(24px, 4vw, 48px) 0 clamp(40px, 6vw, 72px);
}

body[data-page="home"] .page-shell {
    width: var(--page-width-wide);
}

body[data-page="portal"] .page-shell {
    width: min(1040px, calc(100% - 40px));
}

.hero-shell {
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    gap: 24px;
    align-items: stretch;
}

body[data-page="home"] .hero-shell {
    grid-template-columns: minmax(410px, 0.96fr) minmax(620px, 1.04fr);
    gap: 20px;
    align-items: start;
}

.home-primary-column {
    display: grid;
    gap: 20px;
    align-content: start;
}

.compact-shell {
    width: var(--page-width-compact);
}

.portal-shell,
.auth-shell,
.student-home-shell {
    display: grid;
    align-items: center;
    min-height: calc(100vh - 112px);
}

body[data-page="create-vocab"] .compact-shell {
    width: min(1380px, calc(100% - 32px));
}

body[data-page="manage-accounts"] .compact-shell {
    width: min(1240px, calc(100% - 32px));
}

.hero-card,
.study-card,
.info-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(8px);
}

.hero-card {
    padding: clamp(28px, 4vw, 48px);
    position: relative;
    overflow: hidden;
}

.portal-hero-card,
.auth-card,
.student-home-hero,
.student-home-summary-card {
    max-width: none;
}

.portal-hero-card > h1 {
    max-width: 900px;
    font-size: 2.25rem;
    line-height: 1.2;
    letter-spacing: 0;
}

.hero-card::after {
    content: "";
    position: absolute;
    inset: auto -60px -80px auto;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(31, 111, 229, 0.22), rgba(31, 111, 229, 0));
    pointer-events: none;
}

.eyebrow {
    display: inline-flex;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: #dfeeff;
    color: var(--primary-dark);
    font-size: 0.9rem;
    font-weight: 700;
}

.hero-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--brand-logo-width);
    aspect-ratio: 512 / 352;
    height: auto;
    background: center / contain no-repeat var(--brand-logo-url);
    color: transparent;
    font-size: 0;
    line-height: 0;
    overflow: hidden;
    user-select: none;
}

.brand-logo-png {
    --brand-logo-url: url("/static/logo.png");
}

.hero-logo-mark {
    flex: 0 0 auto;
}

.hero-logo-text {
    color: var(--primary-dark);
    font-size: clamp(1.8rem, 4.2vw, 3rem);
    font-weight: 900;
    letter-spacing: 0.02em;
    line-height: 1;
}

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

h1 {
    margin-bottom: 14px;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.1;
}

.hero-text,
.page-header p,
.placeholder-text,
.info-card p {
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.78;
    overflow-wrap: anywhere;
}

.home-profile-picker {
    display: grid;
    gap: 10px;
    max-width: 420px;
    margin: 20px 0 24px;
}

.home-login-panel {
    display: grid;
    grid-template-columns: minmax(320px, 420px);
    gap: 0;
    align-items: start;
    margin: 20px 0 24px;
}

.home-profile-type-select,
.home-profile-select {
    width: 100%;
}

.home-profile-select {
    width: 100%;
}

.home-profile-login-hint {
    margin: 0;
    padding: 0.75rem 0.95rem;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-small);
    background: #f7fbff;
    color: var(--primary-dark);
    font-size: 0.92rem;
    font-weight: 700;
}

.home-profile-note {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.68;
}

/* Small heading shown inside the first card on the learn page */
.small-card-header{padding-bottom:8px}
.small-card-title{
    font-size:18px;
    line-height:1.2;
    margin:0 0 8px 0;
    color:var(--text-main);
    font-weight:700;
}

.portal-entry-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 28px;
}

.portal-entry-card {
    display: grid;
    gap: 8px;
    padding: 22px 24px;
    border: 1px solid #d9e5f4;
    border-radius: var(--radius-medium);
    background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
    box-shadow: 0 10px 20px rgba(35, 104, 201, 0.08);
    color: var(--text-main);
}

.portal-entry-card strong {
    font-size: 1.15rem;
    color: var(--primary-dark);
}

.portal-entry-card span {
    color: var(--text-muted);
    line-height: 1.72;
}

.portal-entry-card-student {
    background: linear-gradient(180deg, #fffdf7 0%, #fff6ea 100%);
}

.auth-form {
    max-width: 420px;
    margin-top: 24px;
    margin-bottom: 0;
    gap: 14px;
}

.auth-topbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2eaf4;
}

.auth-topbar .text-link {
    margin-bottom: 0;
}

.auth-form-actions {
    justify-content: flex-start;
}

body[data-page="admin-login"] .auth-card {
    border-color: #d6e4f7;
    background:
        radial-gradient(circle at top right, rgba(255, 184, 76, 0.18), rgba(255, 184, 76, 0) 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(242, 248, 255, 0.98) 100%);
    box-shadow: 0 24px 48px rgba(24, 73, 133, 0.12);
}

body[data-page="admin-login"] .auth-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #2368c9 0%, #78b0ff 50%, #ffb861 100%);
}

body[data-page="admin-login"] .auth-form {
    max-width: 460px;
    padding: 18px;
    border: 1px solid #d9e7fb;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.84);
}

.auth-hint-card {
    display: grid;
    gap: 6px;
    max-width: 420px;
    margin-top: 20px;
    padding: 16px 18px;
    border: 1px dashed #bfd3ef;
    border-radius: var(--radius-small);
    background: #f7fbff;
    color: var(--primary-dark);
}

.teacher-home-topbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

body[data-page="home"] .hero-card {
    border-color: #cadefb;
    background:
        radial-gradient(circle at top right, rgba(139, 199, 255, 0.18), rgba(139, 199, 255, 0) 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(242, 249, 255, 0.98) 100%);
    box-shadow: 0 20px 42px rgba(36, 97, 170, 0.11);
}

body[data-page="home"] .hero-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #5a9ff0 0%, #89c7ff 52%, #ffd17a 100%);
}

body[data-page="home"] .teacher-home-topbar {
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(241, 211, 183, 0.95);
}

body[data-page="home"] .hero-logo {
    margin-bottom: 22px;
}

body[data-page="home"] .home-login-panel {
    margin: 22px 0 18px;
}

body[data-page="home"] .home-profile-picker {
    max-width: 100%;
    padding: 18px;
    border: 1px solid #d7e5fb;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

body[data-page="home"] .home-profile-login-hint {
    border-style: solid;
    background: linear-gradient(180deg, #f9fcff 0%, #eef6ff 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body[data-page="home"] .home-login-actions {
    gap: 12px;
}

body[data-page="home"] .home-login-actions > * {
    min-width: 180px;
}

.student-home-shell {
    gap: 20px;
}

.student-home-hero {
    border-color: #d7e7fb;
    background:
        radial-gradient(circle at top right, rgba(139, 199, 255, 0.18), rgba(139, 199, 255, 0) 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(242, 249, 255, 0.98) 100%);
    box-shadow: 0 20px 42px rgba(36, 97, 170, 0.11);
}

.student-home-hero::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #5a9ff0 0%, #89c7ff 52%, #ffd17a 100%);
}

.student-home-hero .teacher-home-topbar {
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(212, 227, 247, 0.92);
}

.student-home-hero .hero-logo {
    margin-bottom: 20px;
}

.student-home-hero .home-profile-login-hint {
    border-style: solid;
    background: linear-gradient(180deg, #f9fcff 0%, #eff7ff 100%);
}

.student-home-summary-card {
    border-color: #d8e7f9;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(245, 250, 255, 0.99) 100%);
    box-shadow: 0 18px 40px rgba(30, 79, 136, 0.08);
}

.student-home-summary-card .home-summary-item {
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    border-color: #d7e7f9;
}

.student-home-summary-card .home-inline-panel {
    border-color: #d8e6f8;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.student-home-summary-card .home-summary-tools {
    padding-top: 12px;
    border-top: 1px solid #e2ecf8;
}

.student-home-subgrid {
    margin-top: 18px;
}

.student-home-tools {
    margin-top: 4px;
    padding: 14px 0;
    border-top: 1px solid #e2ecf8;
    border-bottom: 1px solid #e2ecf8;
}

.student-home-tools > * {
    min-width: 220px;
}

.admin-home-shell {
    align-items: start;
}

.admin-home-card {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
    grid-template-areas:
        "topbar topbar"
        "brand brand"
        "intro intro"
        "message message"
        "nav nav"
        "overview overview"
        "list create"
        "list security"
        "audit audit";
    gap: 18px;
    border-color: #d7dee8;
    border-radius: 8px;
    background-color: #f4f7fa;
    background-image: linear-gradient(rgba(24, 50, 75, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(24, 50, 75, 0.035) 1px, transparent 1px);
    background-size: 28px 28px;
    box-shadow: 0 18px 44px rgba(24, 50, 75, 0.10);
}

.admin-home-card .teacher-home-topbar {
    grid-area: topbar;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(212, 227, 247, 0.92);
}

.admin-home-card > .hero-logo {
    grid-area: brand;
    margin-bottom: 0;
}

.admin-home-card > #global-message {
    grid-area: message;
}

.admin-console-intro {
    grid-area: intro;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    padding: 4px 0 8px;
}

.admin-console-intro h1 {
    margin: 8px 0 0;
    font-size: clamp(1.65rem, 3vw, 2.4rem);
    letter-spacing: 0;
}

.admin-console-intro > p {
    max-width: 420px;
    margin: 0;
    color: var(--text-muted);
    text-align: right;
}

.admin-section-nav {
    grid-area: nav;
    position: sticky;
    top: 10px;
    z-index: 8;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 7px;
    border: 1px solid #d7dee8;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 20px rgba(24, 50, 75, 0.08);
}

.admin-section-nav a {
    padding: 8px 12px;
    border-radius: 6px;
    color: #36536d;
    font-size: 0.9rem;
    font-weight: 800;
}

.admin-section-nav a:hover,
.admin-section-nav a:focus-visible {
    background: #eaf2fb;
    color: #174f8f;
}

.admin-home-hint-card {
    max-width: none;
    margin-top: 0;
    border-style: solid;
    background: linear-gradient(180deg, #f9fcff 0%, #eef6ff 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.admin-security-form {
    display: grid;
    gap: 10px;
}

.admin-workspace-panel {
    padding: 22px;
    border-color: #d7dee8;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 8px 20px rgba(24, 50, 75, 0.05);
    scroll-margin-top: 84px;
}

.admin-security-panel {
    grid-area: security;
    align-self: start;
}

.admin-create-panel {
    grid-area: create;
    align-self: start;
}

.admin-list-panel {
    grid-area: list;
}

.admin-audit-panel {
    grid-area: audit;
}

.admin-workspace-create-form {
    display: grid;
    gap: 10px;
}

.admin-workspace-create-grid,
.admin-workspace-edit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.admin-workspace-list {
    display: grid;
    gap: 16px;
}

.admin-audit-log-list {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.admin-audit-quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.admin-audit-quick-filter.active {
    background: var(--primary-dark);
    color: #ffffff;
    border-color: var(--primary-dark);
}

.admin-audit-log-card {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid #d8e5f2;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 5px 14px rgba(24, 50, 75, 0.045);
}

.admin-home-card > .admin-workspace-panel:first-of-type {
    position: relative;
    overflow: hidden;
}

.admin-home-card > .admin-workspace-panel:first-of-type::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, #2368c9 0%, #78b0ff 48%, #ffb861 100%);
}

.admin-audit-log-card-failed {
    border-color: #efc2c2;
    background: linear-gradient(180deg, #fffefe 0%, #fff7f7 100%);
}

.admin-audit-log-card-blocked {
    border-color: #f0cf9b;
    background: linear-gradient(180deg, #fffdf8 0%, #fff9ef 100%);
}

.admin-audit-log-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.admin-audit-log-title-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.admin-audit-log-title-group strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.admin-audit-log-meta,
.admin-audit-log-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.admin-workspace-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid #d8e5f2;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(24, 50, 75, 0.05);
}

.admin-workspace-card:hover {
    border-color: #bfd5f4;
    box-shadow: 0 16px 30px rgba(24, 50, 75, 0.08);
}

.admin-workspace-card-frozen {
    background: linear-gradient(180deg, #fcfdff 0%, #f5f8fc 100%);
    border-style: dashed;
}

.admin-workspace-card-soon {
    border-color: #f0cf9b;
    box-shadow: 0 12px 24px rgba(217, 124, 24, 0.10);
}

.admin-workspace-card-expired {
    border-color: #efc2c2;
    box-shadow: 0 12px 24px rgba(173, 52, 52, 0.10);
}

.admin-workspace-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.admin-workspace-card-title-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.admin-workspace-card-title-group h3 {
    margin: 0;
    font-size: 1.08rem;
}

.admin-workspace-controls {
    display: grid;
    gap: 8px;
}

.admin-workspace-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.admin-workspace-toolbar {
    margin-bottom: 18px;
    padding: 12px;
    border: 1px solid #dfe8f5;
    border-radius: 8px;
    background: #f5f8fb;
}

.admin-workspace-status-select {
    width: min(220px, 100%);
}

.admin-workspace-note-input {
    min-height: 96px;
}

.admin-workspace-password-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.admin-workspace-password-field,
.admin-workspace-password-actions {
    display: grid;
}

.admin-workspace-danger-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.admin-overview-grid {
    grid-area: overview;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin: 0;
}

.admin-overview-card {
    display: grid;
    gap: 8px;
    padding: 16px;
    border: 1px solid #d8e5f2;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(24, 50, 75, 0.05);
}

.admin-overview-card:first-child {
    border-color: #cfe0ff;
    border-top: 4px solid #2368c9;
}

.admin-overview-card:nth-child(2) {
    border-color: #cce8dc;
    border-top: 4px solid #21805b;
}

.admin-overview-card:nth-child(3) {
    border-color: #f0dcc1;
    border-top: 4px solid #d97c18;
}

.admin-overview-card:nth-child(4) {
    border-color: #d8d7e8;
    border-top: 4px solid #625b8f;
}

.admin-overview-label {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 700;
}

.admin-overview-value {
    margin: 0;
    color: var(--primary-dark);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.admin-home-card button,
.admin-home-card a.primary-button,
.admin-home-card a.secondary-button,
.admin-home-card a.ghost-button {
    min-height: 40px;
    padding: 0.68rem 1rem;
    border-radius: 7px;
    font-size: 0.9rem;
}

.admin-overview-note {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.86rem;
}

.admin-workspace-student-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-workspace-students-modal-card {
    width: min(820px, calc(100vw - 32px));
}

.admin-workspace-students-search {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--text-main);
    font-weight: 700;
}

.admin-workspace-students-list {
    display: grid;
    gap: 12px;
}

.admin-student-create-form {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid #d8e5f2;
    border-radius: var(--radius-medium);
    background: #f6fbff;
}

.admin-student-create-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.admin-student-create-actions {
    justify-content: flex-end;
}

.teacher-trial-shell {
    width: min(1080px, calc(100% - 40px));
}

.teacher-trial-card {
    border-radius: 8px;
    border-color: #d7dee8;
    background-color: #f5f8fb;
    background-image: linear-gradient(rgba(24, 50, 75, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(24, 50, 75, 0.035) 1px, transparent 1px);
    background-size: 28px 28px;
}

.teacher-trial-topbar,
.teacher-trial-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.teacher-trial-layout {
    display: grid;
    grid-template-columns: minmax(360px, 0.98fr) minmax(420px, 1.02fr);
    gap: 32px;
    margin-top: 24px;
}

.teacher-trial-summary {
    align-self: start;
    padding: 20px 18px 20px 0;
}

.teacher-trial-summary h1 {
    max-width: 14ch;
    font-size: clamp(2.1rem, 3.3vw, 3.2rem);
    line-height: 1.16;
}

.teacher-trial-summary > p:not(.eyebrow) {
    max-width: 560px;
    color: var(--text-muted);
}

.teacher-trial-facts {
    display: grid;
    gap: 10px;
    margin: 28px 0 0;
}

.teacher-trial-facts > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #d7dee8;
}

.teacher-trial-facts dt {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.teacher-trial-facts dd {
    margin: 0;
    text-align: right;
    font-weight: 800;
}

.teacher-trial-contact-details {
    margin-top: 8px;
}

.teacher-trial-contact-details summary {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.teacher-trial-contact-details summary::-webkit-details-marker {
    display: none;
}

.teacher-trial-contact-details[open] summary {
    color: var(--primary-dark);
}

.teacher-trial-contact-details > span {
    display: block;
    margin-top: 6px;
    color: var(--text-main);
    font-weight: 800;
}

.teacher-trial-form-panel {
    display: grid;
    gap: 16px;
    padding: 26px;
    border: 1px solid #d7dee8;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 12px 28px rgba(24, 50, 75, 0.08);
}

.teacher-trial-form-panel h2 {
    margin: 0 0 4px;
}

.teacher-trial-form {
    display: grid;
    gap: 10px;
}

.teacher-trial-password-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.teacher-trial-password-grid > div {
    display: grid;
    gap: 8px;
}

.teacher-trial-honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.teacher-trial-entry {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #dbe4ef;
    color: var(--text-muted);
}

.teacher-trial-entry .secondary-button {
    min-height: 42px;
    padding: 0.7rem 1rem;
}

.admin-student-card {
    display: grid;
    gap: 10px;
    padding: 18px 20px;
    border: 1px solid #d8e5f2;
    border-radius: var(--radius-medium);
    background: #f9fcff;
}

.admin-student-card-muted {
    background: #f6f7fa;
    border-style: dashed;
}

.admin-student-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.admin-student-card-head h3 {
    margin: 0;
    font-size: 1rem;
}

.admin-student-login-inline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.admin-student-card-actions {
    justify-content: flex-start;
}

.admin-expiry-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.22rem 0.7rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
    background: #eef3fb;
    color: var(--text-muted);
}

.admin-expiry-badge.soon {
    background: #fff4df;
    color: #9a5a00;
}

.admin-expiry-badge.expired {
    background: #fdecec;
    color: #a63c3c;
}

.admin-expiry-badge.normal {
    background: #e8f6ee;
    color: #186a43;
}

.home-create-login-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
    color: var(--text-main);
    font-weight: 600;
}

.home-create-login-toggle input {
    width: 16px;
    height: 16px;
}

.home-create-student-login-fields {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border: 1px dashed #d4e0f1;
    border-radius: var(--radius-small);
    background: #f8fbff;
}

.home-create-profile-message {
    margin: 0;
    box-shadow: none;
}

.vocab-mode-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.22rem 0.7rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

.vocab-mode-badge.private {
    background: #fff4df;
    color: #9a5a00;
    border: 1px solid #f0cf9b;
}

.vocab-mode-badge.shared {
    background: #e7f4ea;
    color: #1d6d36;
    border: 1px solid #b9e0c4;
}

.vocab-mode-badge.system {
    background: #e9eefc;
    color: #314da1;
    border: 1px solid #c6d2f7;
}

.action-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 30px;
}

.home-login-actions {
    margin-top: 8px;
}

body[data-page="home"] .hero-card > .home-login-actions:last-child {
    display: inline-flex;
    flex-wrap: wrap;
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid #e6eefc;
    background: linear-gradient(180deg, rgba(247, 250, 255, 0.96) 0%, rgba(240, 246, 255, 0.96) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body[data-page="home"] #home-create-vocab-button,
body[data-page="home"] #home-manage-vocab-button,
body[data-page="home"] #home-manage-accounts-button {
    background: transparent;
    border-color: transparent;
    padding: 0;
    color: var(--primary-dark);
    box-shadow: none;
}

body[data-page="home"] #home-create-vocab-button:hover,
body[data-page="home"] #home-manage-vocab-button:hover,
body[data-page="home"] #home-manage-accounts-button:hover {
    background: transparent;
    color: var(--primary-color);
    transform: none;
}

.manage-accounts-page {
    display: grid;
    gap: 20px;
}

.manage-accounts-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.manage-accounts-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.manage-accounts-filter-select {
    width: min(220px, 100%);
}

.manage-accounts-list {
    display: grid;
    gap: 14px;
}

.manage-account-card {
    padding: 18px 20px;
    border: 1px solid #d8e5f2;
    border-radius: var(--radius-medium);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfe 100%);
    box-shadow: 0 12px 28px rgba(24, 50, 75, 0.05);
    display: grid;
    gap: 12px;
}

.manage-account-card.archived {
    border-style: dashed;
    background: linear-gradient(180deg, #fcfdff 0%, #f5f8fc 100%);
}

.manage-account-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.manage-account-card-title-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.manage-account-card-title-group h3 {
    margin: 0;
    font-size: 1.06rem;
    color: var(--text-main);
}

.manage-account-status {
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 700;
    white-space: nowrap;
}

.manage-account-note {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.7;
}

.manage-account-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.manage-account-actions {
    justify-content: flex-start;
}

.manage-accounts-section-muted {
    background: linear-gradient(180deg, #fbfcfe 0%, #f5f8fc 100%);
}

.manage-account-modal-card {
    width: min(560px, calc(100% - 24px));
}

.manage-account-modal-actions {
    justify-content: flex-end;
}

.manage-class-members-modal-card {
    width: min(880px, calc(100% - 24px));
}

.manage-class-members-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 18px;
}

.manage-class-members-panel {
    padding: 0;
}

.manage-class-members-list {
    display: grid;
    gap: 12px;
}

.manage-class-member-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid #dbe5f1;
    border-radius: var(--radius-small);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.manage-class-member-main {
    display: grid;
    gap: 4px;
}

.manage-class-member-main strong {
    color: var(--text-main);
}

.manage-class-member-main span {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.65;
}

.manage-class-member-actions {
    flex-shrink: 0;
}

.manage-class-members-actions {
    justify-content: flex-start;
}

.manage-student-login-modal-card {
    width: min(820px, calc(100% - 24px));
}

.manage-student-login-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
    gap: 18px;
}

.manage-student-login-panel {
    padding: 0;
}

.manage-student-login-status-card {
    display: grid;
    gap: 12px;
}

.manage-student-login-account-block {
    display: grid;
    gap: 6px;
    padding: 16px 18px;
    border: 1px solid #dbe5f1;
    border-radius: var(--radius-small);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.manage-student-login-account-block strong {
    color: var(--text-main);
}

.manage-student-login-account-block span {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.manage-student-login-actions {
    justify-content: flex-start;
}

.manage-student-login-status-actions {
    justify-content: flex-start;
    margin-top: 12px;
}

.primary-button {
    background: linear-gradient(180deg, #2c75db 0%, var(--primary-color) 100%);
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(35, 104, 201, 0.22);
}

.primary-button:hover {
    background: var(--primary-dark);
}

.secondary-button {
    background: var(--secondary-color);
    color: var(--primary-dark);
    border: 1px solid #d7e2f0;
    box-shadow: 0 4px 12px rgba(27, 60, 102, 0.04);
}

.secondary-button:hover {
    border-color: #bfd3ef;
    background: linear-gradient(180deg, #f7fbff 0%, #eef5ff 100%);
}

.ghost-button {
    background: #fbfdff;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.ghost-button:hover {
    border-color: #c8d8eb;
    background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
}

.warning-button {
    background: #fff3e2;
    color: #b56400;
}

.button-disabled {
    opacity: 0.55;
    pointer-events: none;
    box-shadow: none;
}

.info-panel {
    display: grid;
    gap: 20px;
}

body[data-page="home"] .info-panel {
    gap: 22px;
    align-content: start;
}

.info-card {
    padding: 28px;
}

body[data-page="home"] .info-card {
    position: relative;
    padding: 34px 32px;
    overflow: hidden;
}

body[data-page="home"] .info-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(31, 111, 229, 0.18), rgba(255, 179, 71, 0.32), rgba(31, 111, 229, 0.08));
}

body[data-page="home"] .info-card > * {
    position: relative;
    z-index: 1;
}

body[data-page="home"] .info-card h2 {
    margin-bottom: 10px;
    font-size: clamp(1.4rem, 2.2vw, 1.8rem);
    line-height: 1.24;
}

body[data-page="home"] .info-card .section-summary,
body[data-page="home"] .info-card p,
body[data-page="home"] .info-card .placeholder-text {
    font-size: 1rem;
    line-height: 1.8;
}

body[data-page="home"] .info-card:not(.home-summary-card) {
    min-height: 214px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 249, 255, 0.96) 100%);
}

body[data-page="home"] .home-create-card {
    justify-self: stretch;
    width: 100%;
    min-height: 0;
    padding: 28px;
    border-color: #f1d3b7;
    background:
        radial-gradient(circle at top right, rgba(255, 184, 76, 0.18), rgba(255, 184, 76, 0) 30%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(255, 248, 240, 0.95) 100%);
    box-shadow: 0 22px 44px rgba(175, 96, 37, 0.12);
}

body[data-page="home"] .home-create-card form {
    padding: 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(241, 211, 183, 0.95);
}

body[data-page="home"] .home-create-card::before {
    height: 5px;
    background: linear-gradient(90deg, #ffb347 0%, #ff8c42 48%, rgba(31, 111, 229, 0.38) 100%);
}

body[data-page="home"] .home-create-card .section-head {
    margin-bottom: 18px;
}

body[data-page="home"] .home-create-card .section-title-group {
    display: grid;
    gap: 6px;
}

body[data-page="home"] .home-create-card .button-row {
    justify-content: flex-start;
    margin-top: 4px;
}

body[data-page="home"] .home-create-card .placeholder-text {
    margin-top: 18px;
}

.home-summary-card {
    display: grid;
    gap: 16px;
}

body[data-page="home"] .home-summary-card {
    padding: 36px 34px;
    gap: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(240, 247, 255, 0.98) 100%);
    box-shadow: 0 24px 50px rgba(34, 92, 165, 0.12);
}

.home-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.home-summary-item {
    padding: 16px;
    border-radius: var(--radius-medium);
    border: 1px solid var(--border-color);
    background: linear-gradient(180deg, #ffffff 0%, #f5faff 100%);
    box-shadow: 0 12px 24px rgba(35, 92, 161, 0.06);
}

.home-summary-link-button {
    display: grid;
    gap: 6px;
    justify-items: start;
    width: 100%;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    text-align: left;
    color: inherit;
    cursor: pointer;
}

.home-summary-link-button:hover:not(:disabled) {
    transform: none;
}

.home-summary-link-button:disabled {
    cursor: default;
    opacity: 1;
}

.home-summary-link-text {
    color: var(--primary-dark);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.home-summary-link-button:disabled .home-summary-link-text {
    color: var(--text-muted);
    text-decoration: none;
}

.home-summary-label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.home-summary-value {
    display: block;
    color: var(--primary-dark);
    font-size: clamp(1.42rem, 2.4vw, 1.86rem);
    font-weight: 800;
}

.home-summary-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 8px;
}

.home-summary-subgrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

body[data-page="home"] .home-summary-subgrid {
    grid-template-columns: 1fr;
    gap: 16px;
}

.home-inline-panel {
    padding: 18px;
    border-radius: var(--radius-medium);
    border: 1px solid var(--border-color);
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

body[data-page="home"] .home-inline-panel {
    padding: 20px;
    border-color: #d5e3f7;
    box-shadow: 0 12px 28px rgba(29, 78, 138, 0.06);
}

body[data-page="home"] .home-vocab-panel,
body[data-page="home"] .home-calendar-panel {
    min-width: 0;
}

body[data-page="home"] .home-calendar-panel {
    padding: 22px;
}

.compact-section-head {
    margin-bottom: 12px;
}

.home-inline-action {
    align-self: center;
    min-height: 36px;
    padding: 0.5rem 0.8rem;
    font-size: 0.86rem;
    white-space: nowrap;
}

.home-inline-panel h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-main);
}

body[data-page="home"] .home-inline-panel h3 {
    font-size: 1.08rem;
}

.anti-forget-overview-panel {
    display: grid;
    gap: 12px;
}

.anti-forget-status-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.anti-forget-status-card {
    display: grid;
    gap: 6px;
    min-height: 88px;
    padding: 16px;
    border: 1px solid #dce7f5;
    border-radius: 14px;
    background: #ffffff;
}

.anti-forget-status-card-button {
    width: 100%;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.anti-forget-status-card-button:hover,
.anti-forget-status-card-button:focus-visible {
    border-color: #9fc6ff;
    box-shadow: 0 14px 28px rgba(35, 104, 201, 0.12);
    transform: translateY(-1px);
    outline: none;
}

.anti-forget-status-label {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.anti-forget-status-value {
    color: var(--primary-dark);
    font-size: 1.72rem;
    line-height: 1.1;
}

.anti-forget-status-action {
    color: var(--primary-color);
    font-size: 0.78rem;
    font-weight: 800;
}

.home-inline-list,
.home-date-chip-list,
.home-history-date-list {
    display: grid;
    gap: 10px;
}

.home-inline-group {
    display: grid;
    gap: 8px;
}

.home-inline-group + .home-inline-group {
    margin-top: 6px;
}

.home-inline-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.home-inline-group-title {
    color: var(--text-main);
    font-size: 0.94rem;
    font-weight: 800;
}

.home-inline-group-meta {
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.home-inline-group-list {
    display: grid;
    gap: 10px;
}

.home-inline-toggle-card {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
    padding: 14px 16px;
    border: 1px solid #d9e8ff;
    border-radius: 16px;
    background: linear-gradient(180deg, #f9fcff 0%, #edf5ff 100%);
    text-align: left;
    cursor: pointer;
}

.home-inline-toggle-card:hover {
    background: linear-gradient(180deg, #f2f8ff 0%, #e4f0ff 100%);
}

.home-inline-toggle-title {
    color: var(--text-main);
    font-size: 1.08rem;
    font-weight: 800;
}

.home-inline-toggle-text {
    color: var(--primary-dark);
    font-size: 0.94rem;
    font-weight: 800;
    white-space: nowrap;
}

.home-inline-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid #d9e8ff;
    background: #edf5ff;
    color: var(--text-main);
}

.home-inline-link:hover {
    background: #dfeeff;
}

.student-vocab-detail-layout {
    gap: 18px;
}

.student-vocab-summary-panel {
    display: grid;
    gap: 14px;
}

.student-vocab-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.student-vocab-detail-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.42rem 0.78rem;
    border-radius: 999px;
    background: #edf5ff;
    border: 1px solid #d9e8ff;
    color: var(--primary-dark);
    font-size: 0.9rem;
    font-weight: 700;
}

.student-word-list-panel {
    gap: 14px;
}

.home-inline-link-title {
    display: block;
    font-weight: 700;
    color: var(--primary-dark);
}

.home-inline-link-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.home-calendar-action-button {
    padding: 0.72rem 1.1rem;
    font-size: 0.94rem;
}

.home-calendar-shell {
    display: grid;
    gap: 12px;
}

.home-calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid #d9e8ff;
    background: linear-gradient(180deg, #f7fbff 0%, #eef5ff 100%);
}

.home-calendar-nav-button {
    padding: 0.6rem 0.9rem;
    font-size: 0.88rem;
}

.home-calendar-month-label {
    color: var(--primary-dark);
    font-size: 1rem;
    font-weight: 800;
}

.home-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.home-calendar-weekdays span {
    padding: 6px 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-align: center;
}

.home-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.home-calendar-day {
    min-height: 88px;
    padding: 10px 8px;
    border-radius: 14px;
    border: 1px solid #e2ebfb;
    background: #ffffff;
    text-align: left;
}

.home-calendar-day-empty {
    border-style: dashed;
    background: rgba(246, 250, 255, 0.55);
}

.home-calendar-day-idle {
    opacity: 0.7;
}

.home-calendar-day-has-class {
    display: grid;
    gap: 6px;
    align-content: start;
    border-color: #bfe8d6;
    background: linear-gradient(180deg, #f3fffa 0%, #e7fff4 100%);
    cursor: pointer;
}

.home-calendar-day-has-class.active {
    border-color: #2fc18c;
    background: linear-gradient(180deg, #dffff0 0%, #cbf8e1 100%);
    box-shadow: 0 10px 20px rgba(47, 193, 140, 0.16);
}

.home-calendar-day-has-review {
    display: grid;
    gap: 6px;
    align-content: start;
    border-color: #f5d5a5;
    background: linear-gradient(180deg, #fffaf1 0%, #fff0d8 100%);
    cursor: pointer;
}

.home-calendar-day-has-review.active {
    border-color: #f0ac3a;
    background: linear-gradient(180deg, #fff4dd 0%, #ffe6b7 100%);
    box-shadow: 0 10px 20px rgba(240, 172, 58, 0.18);
}

.home-calendar-day-number {
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 800;
}

.home-calendar-day-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
    background: rgba(47, 193, 140, 0.16);
    color: #0e8f61;
    font-size: 0.74rem;
    font-weight: 800;
}

.home-calendar-review-tag {
    background: rgba(240, 172, 58, 0.16);
    color: #b66a00;
}

.home-calendar-review-tag-remember {
    background: rgba(56, 107, 232, 0.14);
    color: #2457c5;
}

.home-calendar-review-tag-forget {
    background: rgba(245, 158, 11, 0.2);
    color: #b54708;
}

.home-calendar-star-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    min-height: 18px;
}

.home-calendar-star {
    color: #f1a400;
    font-size: 0.9rem;
    line-height: 1;
}

.home-calendar-star-extra {
    margin-left: 4px;
    color: #a76400;
    font-size: 0.78rem;
    font-weight: 800;
}

.home-calendar-day-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

.home-calendar-day-meta-link {
    color: var(--primary-dark);
    font-weight: 800;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    cursor: pointer;
}

.home-calendar-day-meta-link:hover {
    color: var(--primary-color);
}

.home-date-chip {
    display: grid;
    gap: 6px;
    justify-items: start;
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid #f2d4b6;
    background: #fff7ef;
    color: var(--text-main);
    box-shadow: none;
    text-align: left;
}

body[data-page="home"] .home-inline-link {
    min-height: 84px;
}

body[data-page="home"] .home-calendar-grid {
    gap: 10px;
}

body[data-page="home"] .home-calendar-day {
    min-height: 96px;
}

@media (max-width: 1320px) {
    body[data-page="home"] .hero-shell {
        grid-template-columns: minmax(320px, 0.92fr) minmax(0, 1.08fr);
    }
}

@media (max-width: 1180px) {
    body[data-page="home"] .hero-shell {
        grid-template-columns: 1fr;
    }
}

.home-date-chip:hover {
    background: #ffeddc;
    transform: none;
}

.home-date-chip-label {
    font-weight: 700;
    color: #a95a00;
}

.home-date-chip-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.page-header {
    margin-bottom: clamp(22px, 3.2vw, 34px);
}

.page-header h1 {
    margin-bottom: 10px;
    font-size: clamp(1.9rem, 3.2vw, 2.9rem);
    line-height: 1.14;
    overflow-wrap: anywhere;
}

.page-header p {
    max-width: 68ch;
    margin-bottom: 0;
}

.text-link {
    display: inline-block;
    margin-bottom: 16px;
    color: var(--primary-dark);
    font-weight: 700;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

.text-link:hover {
    color: var(--primary-color);
}

.study-card {
    padding: clamp(24px, 3vw, 36px);
}

.word-panel {
    margin-bottom: 24px;
    padding: 24px;
    border-radius: var(--radius-medium);
    background: #f6faff;
    border: 1px solid #d9e8ff;
}

.review-panel {
    text-align: center;
}

.review-status-message {
    min-height: 52px;
}

.review-status-message.hidden {
    display: block !important;
    visibility: hidden;
}

.review-top-panel {
    display: grid;
    gap: 12px;
    margin-bottom: 22px;
}

.review-status-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.review-status-chip {
    min-height: 0;
    padding: 13px 14px;
    border-radius: 14px;
    box-shadow: 0 8px 18px rgba(31, 111, 229, 0.06);
}

.review-status-chip .progress-label {
    margin-bottom: 3px;
    font-size: 0.78rem;
}

.review-status-chip .progress-value {
    font-size: clamp(1.22rem, 2.2vw, 1.68rem);
    line-height: 1.15;
}

.review-status-chip-primary {
    border-color: #bcd5fb;
    background: linear-gradient(180deg, #f7fbff 0%, #eaf3ff 100%);
}

.review-status-chip-mode .progress-value {
    font-size: 0.98rem;
}

.review-settings-panel {
    border: 1px solid #d7e4f8;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 10px 22px rgba(35, 104, 201, 0.06);
}

.review-settings-summary {
    cursor: pointer;
    padding: 12px 16px;
    color: var(--primary-dark);
    font-size: 0.94rem;
    font-weight: 800;
    list-style-position: inside;
}

.review-settings-panel[open] .review-settings-summary {
    border-bottom: 1px solid #e2ebf7;
}

.panel-label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.word-main {
    font-size: clamp(2rem, 6vw, 3.4rem);
    font-weight: 800;
    letter-spacing: 0.02em;
}

.progress-value-text {
    font-size: 1.1rem;
    line-height: 1.45;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.review-answer-panel {
    align-content: start;
}

.review-spelling-panel {
    display: grid;
    gap: 12px;
    padding: 20px;
    border: 1px solid #d5e3f7;
    border-radius: var(--radius-medium);
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(24, 50, 75, 0.06);
    margin-bottom: 24px;
}

.review-spelling-head {
    align-items: center;
}

.review-spelling-mode {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 2px 9px;
    border: 1px solid #bfd4f2;
    border-radius: 999px;
    background: #eef5ff;
    color: var(--primary-dark);
    font-size: 0.8rem;
    font-weight: 800;
}

.review-spelling-streak-card {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    white-space: nowrap;
}

.review-spelling-streak-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.review-spelling-streak-value {
    color: var(--primary-dark);
    font-size: 1.1rem;
    line-height: 1.1;
}

.review-spelling-note {
    margin: 0;
    color: var(--text-muted);
}

.review-spelling-cue {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 10px 12px;
    border-left: 3px solid var(--primary);
    background: #f6f9fe;
}

.review-spelling-cue span {
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.review-spelling-cue strong {
    color: var(--text-main);
    font-size: 0.98rem;
    line-height: 1.5;
}

.review-vowel-helper {
    display: grid;
    gap: 8px;
    padding: 8px 0 2px;
}

.review-spelling-input-label {
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.review-vowel-frame {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 10px;
    row-gap: 12px;
    color: var(--primary-dark);
    font-size: 1.18rem;
    line-height: 1.5;
    word-break: break-word;
}

.review-vowel-word {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 48px;
}

.review-vowel-separator {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    color: var(--text-muted);
    font-weight: 800;
    white-space: pre;
}

.review-vowel-space {
    width: 18px;
    min-width: 18px;
}

.review-vowel-text {
    font-weight: 800;
    letter-spacing: 0.04em;
    white-space: pre-wrap;
}

.review-vowel-silent-letter {
    color: #8fa5bf;
    opacity: 0.72;
}

.review-vowel-input {
    width: var(--vowel-input-width, 48px);
    min-width: 40px;
    height: 42px;
    padding: 0 10px 6px;
    border: 0;
    border-radius: 8px;
    background-color: transparent;
    background-image: repeating-linear-gradient(
        to right,
        #2f6feb 0 24px,
        transparent 24px 34px
    );
    background-position: center calc(100% - 3px);
    background-repeat: no-repeat;
    background-size: var(--vowel-background-width, 24px) 3px;
    color: var(--primary-dark);
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    text-transform: lowercase;
    letter-spacing: 10px;
    box-shadow: none;
}

.review-vowel-input:focus {
    background-color: #ffffff;
    outline: 3px solid rgba(47, 111, 235, 0.16);
}

.review-vowel-input.is-error {
    background-color: #fff8f2;
    background-image: repeating-linear-gradient(
        to right,
        #d96f2c 0 24px,
        transparent 24px 34px
    );
}

.review-spelling-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.review-spelling-submit-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.review-spelling-submit-row > button {
    flex: 1 1 150px;
}

.review-spelling-submit-button {
    justify-self: flex-start;
    min-width: 160px;
}

.review-spelling-submit-button:hover {
    background: linear-gradient(180deg, #3d86e3 0%, #2f6feb 100%);
    box-shadow: 0 10px 20px rgba(35, 104, 201, 0.18);
}

.review-spelling-input {
    flex: 1 1 320px;
    min-width: 220px;
}

.review-spelling-feedback {
    margin: 0;
    padding: 12px 14px;
    border-radius: var(--radius-small);
    font-size: 0.95rem;
    line-height: 1.6;
}

.review-spelling-feedback.is-error {
    background: #fff3ec;
    border: 1px solid #f3d2bf;
    color: #a6521c;
}

.review-spelling-feedback.is-success {
    background: #eefaf3;
    border: 1px solid #c5e7d1;
    color: #1d7a49;
}

.memorize-attendance-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.memorize-attendance-item {
    width: auto;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid #d5e3f7;
    border-radius: 8px;
    background: #fff;
}

.home-summary-card.is-class-mode > .home-summary-grid,
.home-summary-card.is-class-mode > .home-summary-tools,
.home-summary-card.is-class-mode > .anti-forget-overview-panel {
    display: none;
}

.class-dashboard-member-list {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.class-dashboard-member-row {
    display: grid;
    grid-template-columns: minmax(120px, 1.3fr) repeat(4, minmax(90px, 1fr)) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e4ebf4;
}

.class-dashboard-lessons-head {
    margin-top: 22px;
}

.class-dashboard-lesson-list {
    display: grid;
    gap: 8px;
}

.class-dashboard-lesson-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(90px, auto) minmax(90px, auto);
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e4ebf4;
}

.home-summary-card.is-class-mode .home-calendar-panel {
    display: none;
}

.manage-class-account-batch-actions,
.manage-class-create-student-form {
    margin-top: 16px;
}

.manage-class-credentials-result {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid #d5e3f7;
    border-radius: 8px;
    background: #f8fbff;
}

.class-credential-row {
    display: grid;
    grid-template-columns: minmax(100px, 1fr) minmax(120px, 1fr) minmax(100px, 1fr);
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #e4ebf4;
}

@media (max-width: 720px) {
    .class-dashboard-member-row {
        grid-template-columns: 1fr 1fr;
    }

    .class-dashboard-lesson-row {
        grid-template-columns: 1fr;
    }
}

.review-word-masked {
    color: #8ba0b8;
    letter-spacing: 0.08em;
}

.review-spelling-actions {
    justify-content: flex-start;
}

.detail-grid-single {
    grid-template-columns: 1fr 1fr;
}

.detail-card {
    min-height: 136px;
    padding: 22px;
    border-radius: var(--radius-medium);
    border: 1px solid #e0e8f2;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(24, 50, 75, 0.04);
}

.detail-card-wide {
    grid-column: 1 / -1;
}

.detail-value {
    font-size: 1rem;
    line-height: 1.78;
    white-space: pre-wrap;
}

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

.button-row > * {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.review-actions {
    align-items: center;
    justify-content: space-between;
}

.review-actions-compact {
    justify-content: center;
    margin-top: 22px;
}

.review-primary-actions {
    justify-content: center;
}

.review-actions button:hover,
.review-actions a:hover {
    transform: none;
}

.status-message {
    margin-bottom: 18px;
    padding: 14px 18px;
    border-radius: var(--radius-small);
    border-left: 4px solid #8db3e8;
    border: 1px solid #cfe0f6;
    background: #f1f7ff;
    color: var(--primary-dark);
    font-weight: 600;
    box-shadow: 0 10px 22px rgba(31, 111, 229, 0.06);
}

.status-message.error {
    border-left-color: #de8c98;
    border-color: #f1c9cf;
    background: #fff4f5;
    color: #af2f3f;
}

.status-message:not(.error) {
    background: linear-gradient(180deg, #f5faff 0%, #eef6ff 100%);
}

.hidden {
    display: none !important;
}

.placeholder-card {
    max-width: 720px;
}

.form-card,
.detail-layout {
    max-width: 820px;
}

.vocab-form {
    display: grid;
    gap: 18px;
    margin-bottom: 28px;
}

.form-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
}

.text-input {
    width: 100%;
    max-width: 100%;
    min-height: 44px;
    padding: 0.72rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    color: var(--text-main);
    background: #fcfdff;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.text-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(31, 111, 229, 0.12);
}

.text-area {
    width: 100%;
    max-width: 100%;
    min-height: 132px;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-medium);
    font-size: 1rem;
    color: var(--text-main);
    background: #fcfdff;
    outline: none;
    resize: vertical;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.text-area:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(31, 111, 229, 0.12);
}

.helper-panel {
    padding: 22px 24px;
    border-radius: var(--radius-medium);
    background: #fafcff;
    border: 1px solid #e1e8f2;
}

.helper-panel h2 {
    margin-bottom: 12px;
}

body[data-page="learn"] .study-card,
body[data-page="review"] .study-card,
body[data-page="memorize"] .study-card {
    border-color: #d2e1f7;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(246, 250, 255, 0.98) 100%);
    box-shadow: 0 22px 46px rgba(28, 79, 145, 0.1);
}

body[data-page="learn"] .page-header,
body[data-page="review"] .page-header,
body[data-page="memorize"] .page-header {
    margin-bottom: 22px;
}

body[data-page="review"] .page-header h1,
body[data-page="memorize"] .page-header h1 {
    margin-bottom: 12px;
}

.learn-filter-panel {
    margin-bottom: 20px;
    border-color: #cfe0ff;
    background: linear-gradient(180deg, #ffffff 0%, #f1f7ff 100%);
    box-shadow: 0 16px 34px rgba(35, 104, 201, 0.08);
}

.learn-filter-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
}

.learn-filter-field {
    flex: 1 1 320px;
}

.learn-filter-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-top: 0;
}

.learn-candidate-panel {
    margin-top: 8px;
    padding: 8px 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.learn-action-row {
    margin-top: 24px;
    justify-content: flex-end;
}

.learn-candidate-table-wrap {
    overflow-x: auto;
    background: transparent;
}

.learn-candidate-table {
    width: 100%;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
    table-layout: fixed;
}

.learn-candidate-table th,
.learn-candidate-table td {
    padding: 14px;
    border-top: 1px solid #dbe8f8;
    border-bottom: 1px solid #dbe8f8;
    text-align: left;
    vertical-align: middle;
    background: #ffffff;
}

.learn-candidate-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f4f8ff;
    color: var(--primary-dark);
    font-size: 0.92rem;
    font-weight: 800;
    border: 0;
}

.learn-candidate-table tbody tr:hover {
    background: #f9fbff;
}

body[data-page="learn"] .learn-candidate-table tbody tr:nth-child(even) td {
    background: #fbfdff;
}

.learn-candidate-word-cell {
    width: auto;
}

.learn-candidate-word-content {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.learn-candidate-row-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #edf5ff;
    color: var(--primary-dark);
    font-size: 0.84rem;
    font-weight: 800;
}

.learn-candidate-word {
    display: block;
    min-width: 0;
    font-size: var(--study-word-size);
    line-height: 1.28;
    font-weight: 800;
    color: var(--text-main);
    word-break: normal;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.learn-candidate-phonetic-cell {
    color: var(--primary-dark);
    font-weight: 700;
    word-break: break-word;
}

.learn-candidate-choice-cell {
    width: 124px;
    min-width: 124px;
    text-align: center !important;
}

.learn-candidate-choice {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--primary-color);
}

.learn-candidate-choice-target {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    padding: 8px 10px;
    border: 1px solid #d7e4f5;
    border-radius: 10px;
    background: #f7faff;
    color: var(--primary-dark);
    font-size: 0.92rem;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.learn-candidate-choice-target:hover {
    border-color: #9fc1ef;
    background: #eef5ff;
}

.learn-candidate-choice-known {
    border-color: #b8decf;
    background: #f2faf6;
    color: #287052;
}

.learn-candidate-choice-known:hover {
    border-color: #78c7a3;
    background: #e8f7ef;
}

.learn-candidate-choice-memorize {
    border-color: #efd3aa;
    background: #fffaf0;
    color: #9a641f;
}

.learn-candidate-choice-memorize:hover {
    border-color: #efb96f;
    background: #fff4df;
}

.learn-candidate-choice-known:has(.learn-candidate-choice:checked) {
    border-color: #78c7a3;
    background: #e8f7ef;
    color: #176a45;
    box-shadow: 0 0 0 3px rgba(33, 128, 91, 0.10);
}

.learn-candidate-choice-memorize:has(.learn-candidate-choice:checked) {
    border-color: #efb96f;
    background: #fff4df;
    color: #91520b;
    box-shadow: 0 0 0 3px rgba(217, 124, 24, 0.10);
}

.learn-candidate-table tbody td:first-child {
    border-left: 1px solid #dbe8f8;
    border-radius: 12px 0 0 12px;
}

.learn-candidate-table tbody td:last-child {
    border-right: 1px solid #dbe8f8;
    border-radius: 0 12px 12px 0;
}

.learn-candidate-table th:first-child,
.learn-candidate-table td:first-child {
    width: auto;
}

.learn-candidate-table th:nth-child(2),
.learn-candidate-table th:nth-child(3),
.learn-candidate-table td:nth-child(2),
.learn-candidate-table td:nth-child(3) {
    width: 124px;
    min-width: 124px;
    text-align: center;
}

.review-filter-panel {
    margin-bottom: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
    align-items: end;
    padding: 16px;
    border: 0;
    border-radius: 0 0 14px 14px;
    border-color: #cfe0ff;
    background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
    box-shadow: none;
}

.review-scope-note {
    grid-column: 1 / -1;
    margin: 0;
}

.memorize-panel {
    padding: 8px 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.memorize-page-header {
    margin-bottom: 18px;
}

.memorize-hero {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr);
    gap: 0;
    align-items: stretch;
    overflow: hidden;
    border: 1px solid #cfe0ff;
    border-radius: var(--radius-large);
    background: linear-gradient(180deg, #ffffff 0%, #f1f7ff 100%);
    box-shadow: 0 18px 38px rgba(35, 104, 201, 0.1);
}

.memorize-hero-main {
    display: grid;
    align-content: center;
    gap: 10px;
    padding: 24px 26px;
    border-right: 1px solid #dbe7f8;
    background: radial-gradient(circle at top right, rgba(255, 184, 76, 0.16), rgba(255, 184, 76, 0) 34%);
}

.memorize-progress-card {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 16px;
    background: transparent;
}

.memorize-progress-item {
    display: grid;
    align-content: center;
    gap: 8px;
    min-width: 0;
    min-height: 116px;
    padding: 14px 16px;
    border-left: 1px solid #dbe7f8;
}

.memorize-progress-item:first-child {
    border-left: 0;
}

body[data-page="paper-box"] .memorize-hero {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.42fr);
}

body[data-page="paper-box"] .memorize-progress-card {
    grid-template-columns: 1fr;
}

body[data-page="paper-box"] .memorize-progress-item {
    min-height: 0;
}

.memorize-progress-label {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0;
}

.memorize-progress-value {
    color: var(--primary-dark);
    font-size: clamp(1.05rem, 1.6vw, 1.35rem);
    font-weight: 800;
    line-height: 1.18;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.memorize-list {
    display: grid;
    gap: 12px;
}

.memorize-card {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    .visually-hidden {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }

    .segmented-control {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px;
        width: 100%;
        padding: 4px;
        border: 1px solid #d8e3f0;
        border-radius: 12px;
        background: #f3f7fb;
    }

    .segmented-control-button {
        min-height: 40px;
        padding: 0.58rem 0.8rem;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: var(--text-muted);
        box-shadow: none;
        font-size: 0.92rem;
        font-weight: 800;
    }

    .segmented-control-button:hover {
        transform: none;
        background: rgba(255, 255, 255, 0.72);
    }

    .segmented-control-button.active {
        background: #ffffff;
        color: var(--primary-dark);
        box-shadow: 0 5px 14px rgba(31, 80, 140, 0.12);
    }

body[data-page="home"] .home-create-card .vocab-form {
    gap: 13px;
    margin-bottom: 0;
}
    min-height: 76px;
    padding: 14px 16px;
    border: 1px solid #d9e7f8;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 5px 14px rgba(35, 82, 145, 0.05);
    text-align: left;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.memorize-card:last-child {
    border-bottom: 1px solid #d9e7f8;
}

.memorize-card-controls {
    display: grid;
    grid-template-columns: auto auto;
    gap: 8px;
    align-items: center;
    justify-items: center;
    flex-shrink: 0;
}

.memorize-card.expanded .memorize-card-controls {
    grid-template-columns: 1fr;
}

.memorize-card:hover {
    transform: none;
    background: #f7faff;
}

.memorize-card.expanded {
    align-items: flex-start;
    min-height: 188px;
    padding: 20px 22px;
    border: 1px solid #9fc2fa;
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(31, 111, 229, 0.1);
    background: #eef6ff;
}

.memorize-card.active {
    background: #f1f7ff;
    box-shadow: inset 3px 0 0 #6b9ff0;
}

.memorize-card.active.expanded {
    border-color: #7eaef7;
    box-shadow: inset 3px 0 0 #4f8eea, 0 8px 20px rgba(31, 111, 229, 0.12);
}

.memorize-card-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #e8f1ff;
    color: var(--primary-dark);
    font-size: 0.88rem;
    font-weight: 800;
}

.memorize-pronounce-wrap {
    display: inline-flex;
}

.memorize-pronounce-button {
    min-width: var(--pronounce-control-min-width);
    min-height: var(--pronounce-control-height);
    padding: 0.28rem 0.54rem;
    border: 1px solid #d5e4fb;
    border-radius: 999px;
    background: #f7fbff;
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: none;
}

.memorize-pronounce-button:hover {
    background: #edf5ff;
}

.memorize-card-body {
    display: grid;
    gap: 6px;
    min-width: 0;
    flex: 1;
}

.memorize-card-word {
    font-size: clamp(1.5rem, 1vw + 1.15rem, 1.9rem);
    color: var(--text-main);
    line-height: 1.28;
    word-break: normal;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.memorize-card-hint {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.memorize-card-meaning {
    margin-top: 2px;
    color: var(--primary-dark);
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.7;
    word-break: break-word;
}

.memorize-card-phonetic {
    color: var(--text-muted);
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.5;
}

.memorize-card-root {
    margin-top: 4px;
    color: #1f6fe5;
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.55;
}

.memorize-card.expanded .memorize-card-body {
    gap: 8px;
}

.memorize-card.expanded .memorize-card-word {
    font-size: clamp(2rem, 1.7vw + 1.25rem, 2.5rem);
    line-height: 1.16;
}

.memorize-action-row {
    margin-top: 24px;
    justify-content: space-between;
    align-items: center;
    padding-top: 18px;
    border-top: 1px solid #e1e9f5;
}

.memorize-action-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.memorize-action-group-end {
    justify-content: flex-end;
}

.memorize-next-button {
    min-width: 164px;
    padding-inline: 2rem;
}

.paper-box-list {
    display: grid;
    gap: 10px;
}

.paper-box-item {
    display: grid;
    grid-template-columns: 54px minmax(220px, 1fr) minmax(116px, auto);
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border: 1px solid #d8e7ff;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    box-shadow: 0 8px 18px rgba(31, 111, 229, 0.08);
}

.paper-box-item.expanded {
    border-color: #8ab4f7;
    background: linear-gradient(180deg, #f7fbff 0%, #eaf4ff 100%);
    box-shadow: 0 12px 26px rgba(31, 111, 229, 0.12);
}

.paper-box-item-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    margin-top: 0;
    border-radius: 999px;
    background: #e8f1ff;
    color: var(--primary-dark);
    font-size: 0.84rem;
    font-weight: 800;
}

.paper-box-item-main {
    display: grid;
    gap: 8px;
    min-width: 0;
    width: 100%;
}

.paper-box-item-word-button {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.paper-box-item-word {
    color: var(--text-main);
    font-size: var(--study-word-size);
    font-weight: 800;
    line-height: 1.28;
    word-break: break-word;
    text-align: left;
}

.paper-box-item-hint {
    display: none;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.5;
}

.paper-box-item-details {
    display: grid;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(232, 241, 255, 0.72);
}

.paper-box-item.expanded {
    align-items: start;
}

.paper-box-detail-row {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}

.paper-box-detail-label {
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.paper-box-detail-value {
    color: var(--primary-dark);
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.65;
    word-break: break-word;
}

.paper-box-item-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(96px, 1fr));
    gap: 10px;
    align-content: center;
    justify-self: end;
    min-width: 220px;
}

.paper-box-result-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.72rem 1rem;
    border: 1px solid #d7e2f0;
    border-radius: 999px;
    background: #ffffff;
    color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(27, 60, 102, 0.04);
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.2;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.paper-box-result-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(31, 111, 229, 0.10);
}

.paper-box-remember-checkbox,
.paper-box-retry-checkbox {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.paper-box-result-button:has(.paper-box-remember-checkbox:focus-visible),
.paper-box-result-button:has(.paper-box-retry-checkbox:focus-visible) {
    outline: 3px solid rgba(31, 111, 229, 0.22);
    outline-offset: 3px;
}

.paper-box-result-button-remember {
    border-color: #c8dcfb;
    color: #0d4b9a;
}

.paper-box-result-button-retry {
    border-color: rgba(221, 138, 47, 0.45);
    color: #9a5a0d;
}

.paper-box-result-button-remember:has(.paper-box-remember-checkbox:checked) {
    background: #eaf4ff;
    border-color: #8ab4f7;
    color: #0d4b9a;
}

.paper-box-result-button-retry:has(.paper-box-retry-checkbox:checked) {
    background: #fff7e8;
    border-color: #f0ac3a;
    color: #8f5308;
}

.learn-vocab-select {
    max-width: 360px;
}

.create-vocab-shared-select {
    min-height: 220px;
}

.create-vocab-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

.create-vocab-filter-bar .learn-vocab-select {
    min-width: 220px;
}

.create-vocab-layout {
    display: grid;
    grid-template-columns: minmax(360px, 0.9fr) minmax(520px, 1.1fr);
    gap: 24px;
    align-items: start;
}

.create-vocab-global-message {
    grid-column: 1 / -1;
    margin-bottom: 0;
}

.create-vocab-builder-card,
.create-vocab-manager-card {
    padding: 28px 30px;
}

.create-vocab-builder-card {
    display: grid;
    gap: 20px;
    border-color: #cfe0ff;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(243, 249, 255, 0.97) 100%);
    box-shadow: 0 22px 44px rgba(34, 92, 165, 0.12);
}

.create-vocab-manager-card {
    display: grid;
    gap: 18px;
    position: sticky;
    top: 24px;
    border-color: #d9e6f6;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 251, 255, 0.98) 100%);
    box-shadow: 0 18px 38px rgba(24, 50, 75, 0.08);
}

.create-vocab-pane-head,
.create-vocab-manager-head {
    margin-bottom: 0;
    padding-bottom: 14px;
    border-bottom: 1px solid #e2ebf7;
}

.create-vocab-helper-panel {
    margin-top: 0;
    border-color: #d8e4f4;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

body[data-page="create-vocab"] .create-vocab-manager-head {
    align-items: flex-start;
    gap: 16px;
}

body[data-page="create-vocab"] .create-vocab-filter-bar {
    justify-content: flex-start;
    padding: 12px;
    border: 1px solid #dfe8f5;
    border-radius: 18px;
    background: #f8fbff;
}

body[data-page="create-vocab"] .create-vocab-filter-bar .learn-vocab-select {
    max-width: none;
}

body[data-page="create-vocab"] .vocab-set-list {
    gap: 14px;
}

body[data-page="create-vocab"] .vocab-set-group {
    gap: 10px;
    padding: 18px;
    border-color: #d6e4f8;
    box-shadow: 0 12px 28px rgba(24, 50, 75, 0.05);
}

body[data-page="create-vocab"] .vocab-set-card {
    padding: 16px 18px;
    border-color: #d6e4f6;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
    box-shadow: 0 10px 22px rgba(24, 50, 75, 0.04);
}

body[data-page="create-vocab"] .vocab-set-list-group-grid {
    gap: 10px;
}

body[data-page="create-vocab"] .vocab-set-group-head h3 {
    font-size: 1rem;
}

body[data-page="create-vocab"] .vocab-set-card-head {
    gap: 10px;
    margin-bottom: 8px;
}

body[data-page="create-vocab"] .vocab-set-card-title-group {
    gap: 8px;
}

body[data-page="create-vocab"] .vocab-set-card-title {
    font-size: 1rem;
}

body[data-page="create-vocab"] .vocab-set-card-meta {
    font-size: 0.9rem;
    line-height: 1.55;
}

body[data-page="create-vocab"] .vocab-set-card .button-row {
    gap: 8px;
}

body[data-page="create-vocab"] .vocab-set-card .edit-word-button,
body[data-page="create-vocab"] .vocab-set-card .delete-word-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0.38rem 0.74rem;
    font-size: 0.84rem;
    line-height: 1;
    text-align: center;
}

body[data-page="create-vocab"] .create-vocab-shared-select {
    min-height: 180px;
}

@media (max-width: 1180px) {
    .create-vocab-layout {
        grid-template-columns: 1fr;
    }

    .create-vocab-manager-card {
        position: static;
        top: auto;
    }
}

@media (max-width: 720px) {
    .create-vocab-builder-card,
    .create-vocab-manager-card {
        padding: 22px 20px;
    }

    body[data-page="create-vocab"] .create-vocab-filter-bar {
        width: 100%;
    }

    body[data-page="create-vocab"] .create-vocab-filter-bar .learn-vocab-select {
        min-width: 0;
        width: 100%;
    }
}

.review-progress-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.progress-card {
    padding: 20px;
    border-radius: var(--radius-medium);
    border: 1px solid var(--border-color);
    background: linear-gradient(180deg, #ffffff 0%, #f6fbff 100%);
    box-shadow: 0 12px 28px rgba(31, 111, 229, 0.08);
}

.progress-label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 700;
}

.progress-value {
    display: block;
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    font-weight: 800;
    color: var(--primary-dark);
}

body[data-page="review"] .review-status-chip:last-child,
body[data-page="review"] .review-status-chip:nth-last-child(2) {
    background: linear-gradient(180deg, #fffefb 0%, #fff7e8 100%);
    border-color: #f0d7aa;
}

.pronunciation-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.pronunciation-item {
    display: grid;
    gap: 6px;
}

.pronunciation-item-centered {
    justify-items: center;
}

.pronunciation-row-centered {
    justify-content: center;
}

.pronunciation-button {
    min-width: var(--pronounce-control-min-width);
    min-height: var(--pronounce-control-height);
    padding: 0.28rem 0.56rem;
    border-radius: 999px;
    border-color: #d5e4fb;
    background: #f7fbff;
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
}

.pronunciation-button:hover {
    background: #edf5ff;
}

.review-phonics-split-button {
    min-height: var(--pronounce-control-height);
    padding: 0.34rem 0.74rem;
    border-color: #d5e4fb;
    background: #f7fbff;
    color: var(--primary-dark);
    font-size: 0.8rem;
    font-weight: 800;
}

.review-phonics-split-button:hover {
    background: #edf5ff;
}

.review-phonics-split-panel {
    display: grid;
    gap: 10px;
    max-width: 620px;
    margin: 16px auto 0;
    padding: 14px 16px;
    border: 1px solid #d7e6f6;
    border-radius: 14px;
    background: #f8fbff;
    text-align: left;
}

.review-memory-hint-row {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}

.review-phonics-split-label,
.review-phonics-split-note {
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.review-phonics-split-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    color: var(--primary-dark);
    font-size: clamp(1.15rem, 2.6vw, 1.48rem);
    font-weight: 800;
    line-height: 1.45;
}

.review-phonics-sound-content,
.review-phonics-root-content {
    color: var(--primary-dark);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.65;
}

.review-phonics-focus-content {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.review-phonics-focus-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #fff7e8;
    border: 1px solid #f0d7aa;
    color: #a6521c;
    font-size: 0.92rem;
    font-weight: 900;
}

.review-phonics-split-word {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.review-phonics-split-dot {
    color: #d96f2c;
    font-weight: 900;
}

.review-phonics-split-space {
    width: 10px;
}

.pronunciation-voice-name {
    max-width: 280px;
    color: var(--text-muted);
    font-size: 0.83rem;
    line-height: 1.5;
    word-break: break-word;
}

.review-example-card {
    background: linear-gradient(180deg, #fffdf6 0%, #fff7e8 100%);
    border-color: #f2d7a8;
}

body[data-page="review"] .word-panel {
    padding: 28px;
    border-color: #cadefb;
    background: radial-gradient(circle at top right, rgba(104, 167, 255, 0.2), rgba(104, 167, 255, 0) 32%), linear-gradient(180deg, #ffffff 0%, #f2f8ff 100%);
    box-shadow: 0 18px 38px rgba(31, 111, 229, 0.1);
}

body[data-page="review"] .review-spelling-panel,
body[data-page="review"] .review-forgotten-panel {
    border-color: #d5e3f7;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 14px 30px rgba(24, 50, 75, 0.06);
}

body[data-page="review"] .detail-card {
    border-color: #d7e4f8;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

body[data-page="review"] .review-actions.review-actions-compact {
    margin-top: 26px;
}

.review-example-sentence {
    color: var(--text-main);
    font-weight: 600;
}

.review-example-note {
    margin: 12px 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.search-toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
}

.search-input {
    flex: 1;
}

.search-button-row {
    flex-wrap: nowrap;
}

.list-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 18px;
}

.sort-toolbar {
    display: grid;
    gap: 10px;
    min-width: 220px;
}

.sort-toolbar .form-label {
    margin: 0;
}

.sort-select {
    min-width: 220px;
}

.import-hint-box {
    margin-bottom: 18px;
    padding: 16px 18px;
    border-radius: var(--radius-medium);
    border: 1px solid #d7e6fb;
    background: linear-gradient(180deg, #ffffff 0%, #f5faff 100%);
}

.import-hint-title {
    margin-bottom: 10px;
    color: var(--primary-dark);
    font-weight: 700;
}

.import-hint-details {
    overflow: hidden;
}

.import-hint-details .import-hint-title {
    margin-bottom: 0;
    cursor: pointer;
    list-style: none;
}

.import-hint-details .import-hint-title::-webkit-details-marker {
    display: none;
}

.import-hint-details .import-hint-title::after {
    content: "展开";
    margin-left: 10px;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.import-hint-details[open] .import-hint-title::after {
    content: "收起";
}

.import-hint-details .import-example {
    margin-top: 12px;
}

.import-example {
    margin: 0;
    white-space: pre-wrap;
    line-height: 1.7;
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: "Consolas", "Courier New", monospace;
}

.import-text-area {
    min-height: 230px;
    resize: vertical;
}

.import-method-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
    gap: 16px;
    align-items: start;
}

.import-method-card {
    display: grid;
    gap: 14px;
    align-content: start;
    padding: 18px;
    border: 1px solid #d7e6fb;
    border-radius: var(--radius-medium);
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(24, 50, 75, 0.04);
}

.import-method-head {
    margin-bottom: 14px;
}

.import-method-head h3 {
    margin: 0;
    font-size: 1.05rem;
}

.file-input {
    cursor: pointer;
    padding: 0.8rem 1rem;
    border-style: dashed;
    background: linear-gradient(180deg, #fcfdff 0%, #f5f9ff 100%);
}

.import-format-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.import-format-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0.32rem 0.75rem;
    border-radius: 999px;
    border: 1px solid #d4e3fb;
    background: #f4f8ff;
    color: var(--primary-dark);
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.2;
}

.field-help-text {
    margin: -6px 0 0;
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 0.92rem;
}

.import-submit-row {
    margin-top: auto;
    justify-content: flex-end;
}

.import-result {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: var(--radius-medium);
    border-left: 4px solid #7fb271;
    border: 1px solid #cbe0ff;
    background: #f3fbf5;
    color: var(--primary-dark);
}

.import-result.error {
    border-left-color: #de8c98;
    border-color: #f1c5c5;
    background: #fff3f3;
    color: #af2f3f;
}

.import-result-summary,
.import-result-note {
    margin: 0;
    line-height: 1.7;
    font-weight: 700;
}

.import-result-note {
    margin-top: 8px;
    font-weight: 600;
}

.import-error-list {
    margin: 10px 0 0;
    padding-left: 20px;
    line-height: 1.7;
}

.import-preview-table-wrap {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    margin-top: 12px;
    overflow-x: auto;
    border: 1px solid #d8e7ff;
    border-radius: 12px;
    background: #ffffff;
}

.import-preview-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.import-preview-table th,
.import-preview-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #e3edf8;
    text-align: left;
    vertical-align: top;
}

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

.import-preview-table tr[data-status="ready"] td:first-child {
    color: #1d7a49;
    font-weight: 800;
}

.import-preview-table tr[data-status="skipped"] td:first-child {
    color: #a76400;
    font-weight: 800;
}

.import-preview-table tr[data-status="error"] td:first-child {
    color: #af2f3f;
    font-weight: 800;
}

.import-preview-actions {
    justify-content: flex-end;
    margin-top: 16px;
}

.import-recent-words-block {
    margin-top: 12px;
}

.import-recent-word-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.import-recent-word-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.34rem 0.72rem;
    border-radius: 999px;
    border: 1px solid #c7dcff;
    background: #ffffff;
    color: var(--primary-dark);
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.3;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.section-head-stackable {
    align-items: flex-start;
}

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

.section-title-group {
    display: grid;
    gap: 6px;
}

.section-summary {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

/* Reduce size for candidate summary inside learn candidate panel */
.learn-candidate-panel .section-summary,
#learn-candidate-summary {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}

.home-inline-link-title-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.home-inline-badge {
    transform: translateY(-1px);
}

#system-vocab-bulk-assign-form {
    margin-bottom: 0;
}

.section-action-row {
    justify-content: flex-end;
}

.enrich-preview-panel {
    margin-bottom: 18px;
    padding: 16px 18px;
    border-radius: var(--radius-medium);
    border-left: 4px solid #8db3e8;
    border: 1px solid #cbe0ff;
    background: #f1f7ff;
    color: var(--primary-dark);
}

.enrich-preview-panel.error {
    border-left-color: #de8c98;
    border-color: #f1c5c5;
    background: #fff3f3;
    color: #af2f3f;
}

.enrich-run-panel {
    margin-bottom: 18px;
    padding: 16px 18px;
    border-radius: var(--radius-medium);
    border-left: 4px solid #8db3e8;
    border: 1px solid #cbe0ff;
    background: #f4f9ff;
    color: var(--primary-dark);
}

.enrich-run-panel.error {
    border-left-color: #dfad6b;
    border-color: #f1c5c5;
    background: #fff8f1;
    color: #8f3b23;
}

.enrich-run-summary-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.enrich-run-metric-card {
    padding: 14px 16px;
    border-radius: var(--radius-small);
    border: 1px solid #d7e6fb;
    background: #ffffff;
}

.enrich-run-metric-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.enrich-run-metric-value {
    display: block;
    color: var(--primary-dark);
    font-size: 1.08rem;
    font-weight: 800;
}

.enrich-run-progress-track {
    overflow: hidden;
    height: 12px;
    border-radius: 999px;
    background: #dfeafe;
}

.enrich-run-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #1f6fe5 0%, #5ba0ff 100%);
    transition: width 0.2s ease;
}

.enrich-run-progress-text {
    margin: 10px 0 0;
    color: var(--text-muted);
    font-weight: 700;
    line-height: 1.7;
}

.enrich-run-failure-block {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px dashed #d3e0f8;
}

.enrich-run-subtitle {
    margin: 0 0 12px;
    font-size: 1rem;
    color: var(--text-main);
}

.enrich-run-failure-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
    max-height: 280px;
    overflow: auto;
}

.enrich-run-failure-item {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border-radius: var(--radius-small);
    border: 1px solid #f1d0c4;
    background: #ffffff;
}

.enrich-run-failure-word {
    color: var(--text-main);
    font-weight: 800;
}

@media (max-width: 768px) {
    .review-filter-panel {
        grid-template-columns: 1fr;
    }

    .review-status-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .review-status-chip-mode {
        grid-column: 1 / -1;
    }

    .review-progress-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .review-actions,
    .review-primary-actions {
        justify-content: stretch;
    }

    .review-actions .memorize-action-group,
    .review-primary-actions {
        width: 100%;
    }

    .review-actions .memorize-action-group > *,
    .review-primary-actions > * {
        flex: 1 1 calc(50% - 12px);
        text-align: center;
    }
}

.enrich-run-failure-message {
    color: var(--text-muted);
    line-height: 1.6;
}

.enrich-retry-button {
    min-width: 132px;
}

.enrich-preview-summary-row {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.enrich-preview-list {
    display: grid;
    gap: 12px;
    max-height: 420px;
    overflow: auto;
    padding-right: 4px;
}

.enrich-preview-item {
    padding: 14px 16px;
    border-radius: var(--radius-small);
    border: 1px solid #d7e6fb;
    background: #ffffff;
    color: var(--text-main);
}

.enrich-preview-item-head,
.enrich-preview-meta-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.enrich-preview-item-head {
    margin-bottom: 10px;
}

.enrich-preview-meta-row + .enrich-preview-meta-row {
    margin-top: 10px;
}

.enrich-preview-item-title {
    margin: 0;
    font-size: 1.05rem;
}

.enrich-preview-meta-label,
.enrich-preview-field-label {
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 700;
}

.enrich-preview-meta-label {
    min-width: 72px;
}

.enrich-preview-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.enrich-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.68rem;
    border-radius: 999px;
    background: #edf5ff;
    border: 1px solid #c5d9fb;
    color: var(--primary-dark);
    font-size: 0.85rem;
    font-weight: 700;
}

.enrich-preview-field-list {
    display: grid;
    gap: 8px;
    flex: 1;
}

.enrich-preview-field-row {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px;
    line-height: 1.6;
}

.enrich-preview-field-value {
    word-break: break-word;
}

.enrich-empty-text {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.7;
}

.placeholder-box {
    margin-top: 14px;
    padding: 18px;
    border: 1px dashed #b5cff7;
    border-radius: var(--radius-small);
    color: var(--text-muted);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.word-list {
    display: grid;
    gap: 14px;
}

.word-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid #d7e6fb;
    border-radius: var(--radius-medium);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 10px 22px rgba(24, 50, 75, 0.04);
}

.word-pagination-summary {
    color: var(--text-muted);
    font-weight: 700;
    line-height: 1.6;
}

.word-pagination-control-group {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 12px;
    flex: 1 1 auto;
    flex-wrap: wrap;
}

.word-pagination-field {
    display: grid;
    gap: 6px;
}

.word-pagination-field-label {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.word-pagination-select,
.word-pagination-input {
    min-width: 120px;
}

.word-pagination-jump-form {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
}

.word-pagination-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.word-pagination-button {
    min-width: 96px;
}

.word-pagination-help-text {
    margin: 10px 0 0;
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.6;
}

@media (max-width: 720px) {
    .word-pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .word-pagination-summary {
        text-align: center;
    }

    .word-pagination-actions {
        justify-content: center;
    }

    .word-pagination-jump-form {
        justify-content: center;
    }
}

.vocab-set-list {
    display: grid;
    gap: 14px;
}

.teacher-detail-layout {
    display: grid;
    gap: 22px;
}

.teacher-workspace-strip {
    display: grid;
    gap: 12px;
}

.teacher-workspace-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.teacher-workspace-nav-item {
    display: grid;
    gap: 6px;
    padding: 16px 18px;
    border: 1px solid #d7e4f2;
    border-radius: var(--radius-medium);
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    color: var(--text-main);
    box-shadow: 0 10px 24px rgba(24, 50, 75, 0.05);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.teacher-workspace-nav-item:hover {
    transform: translateY(-1px);
    border-color: #bcd2ef;
    box-shadow: 0 14px 28px rgba(24, 50, 75, 0.08);
}

.teacher-workspace-nav-item.active {
    border-color: #8fb5e8;
    background: linear-gradient(180deg, #eef5ff 0%, #e3efff 100%);
    box-shadow: inset 0 0 0 1px rgba(35, 104, 201, 0.12), 0 14px 30px rgba(35, 104, 201, 0.10);
}

body[data-page="vocab-detail"] .teacher-workspace-nav-item {
    min-height: 104px;
    align-content: start;
}

.teacher-workspace-nav-label {
    color: var(--primary-dark);
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.35;
}

.teacher-workspace-nav-meta {
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.5;
}

.teacher-workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.78fr);
    gap: 20px;
    align-items: start;
}

.teacher-workspace-grid-single {
    grid-template-columns: minmax(0, 1fr);
}

.teacher-workspace-panel {
    padding: 24px 26px;
    border: 1px solid #d9e5f1;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfe 100%);
    box-shadow: 0 14px 30px rgba(24, 50, 75, 0.05);
}

body[data-page="vocab-detail"] .teacher-workspace-panel {
    border-color: #d4e2f7;
    box-shadow: 0 18px 36px rgba(26, 74, 141, 0.08);
}

.teacher-workspace-panel-strong {
    border-color: #cdddee;
    background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
}

.teacher-workspace-note {
    margin: 0;
    max-width: 42ch;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.7;
}

.teacher-workspace-grid-single .vocab-detail-panel-head {
    display: grid;
    gap: 10px;
}

.teacher-workspace-grid-single .teacher-workspace-note {
    max-width: none;
}

.teacher-workspace-aside {
    display: grid;
    gap: 16px;
}

.teacher-workspace-tip-card {
    padding: 18px 20px;
    border: 1px solid #dae5f2;
    border-radius: var(--radius-medium);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfe 100%);
    box-shadow: 0 10px 24px rgba(24, 50, 75, 0.05);
}

.teacher-workspace-tip-card h3 {
    margin: 8px 0 8px;
    color: var(--primary-dark);
    font-size: 1rem;
}

.teacher-workspace-tip-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.94rem;
    line-height: 1.72;
}

.teacher-workspace-kicker {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    background: #edf4ff;
    color: var(--primary-dark);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.vocab-entry-page {
    display: grid;
    gap: 22px;
}

.vocab-entry-focus {
    padding: 24px;
    border: 1px solid #d7e6fb;
    border-radius: var(--radius-large);
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    box-shadow: 0 12px 28px rgba(31, 111, 229, 0.08);
}

body[data-page="vocab-detail"] .vocab-entry-focus,
body[data-page="vocab-detail"] .vocab-detail-entry-card {
    border-color: #d4e4fb;
    box-shadow: 0 16px 34px rgba(31, 111, 229, 0.09);
}

.vocab-entry-focus-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.vocab-entry-focus-title-group {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.vocab-entry-toolbar {
    justify-content: flex-end;
    flex-wrap: wrap;
}

.vocab-entry-metric-grid {
    margin-bottom: 14px;
}

.vocab-entry-quick-note {
    display: inline-flex;
    flex-direction: column;
    padding: 14px 16px;
    border: 1px solid #dce8fb;
    border-radius: var(--radius-medium);
    background: #ffffff;
}

.vocab-detail-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.9fr) minmax(260px, 0.9fr);
    gap: 20px;
}

.vocab-detail-hero-main,
.vocab-detail-hero-side,
.vocab-detail-entry-card,
.vocab-detail-side-panel {
    border: 1px solid #d7e6fb;
    border-radius: var(--radius-large);
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    box-shadow: 0 12px 28px rgba(31, 111, 229, 0.08);
}

.vocab-detail-hero-main {
    padding: 24px;
    display: grid;
    gap: 20px;
    position: relative;
    overflow: hidden;
    border-color: #cadefb;
    background:
        radial-gradient(circle at top right, rgba(104, 167, 255, 0.2), rgba(104, 167, 255, 0) 34%),
        linear-gradient(180deg, #ffffff 0%, #f2f8ff 100%);
    box-shadow: 0 22px 46px rgba(31, 111, 229, 0.12);
}

.vocab-detail-hero-main::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: linear-gradient(90deg, #2368c9 0%, #69a8ff 46%, #ffb55a 100%);
}

.vocab-detail-hero-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.vocab-detail-heading-group {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.vocab-detail-eyebrow {
    color: var(--primary-dark);
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.vocab-detail-mode-badge-wrap {
    min-height: 32px;
}

.vocab-detail-title {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.35rem);
    line-height: 1.18;
    color: var(--text-main);
}

.vocab-detail-summary-note {
    margin: 0;
    max-width: 52ch;
    color: var(--text-muted);
    line-height: 1.75;
    font-size: 0.98rem;
}

.vocab-detail-heading-group,
.vocab-detail-hero-main > * {
    position: relative;
    z-index: 1;
}

.vocab-detail-hero-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
}

.vocab-detail-hero-actions .is-active {
    box-shadow: inset 0 0 0 1px rgba(31, 111, 229, 0.18);
}

.vocab-detail-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.vocab-detail-metric-card,
.vocab-detail-side-summary-card {
    padding: 16px 18px;
    border-radius: var(--radius-medium);
    border: 1px solid #dce8fb;
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.vocab-detail-metric-label,
.vocab-detail-side-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.vocab-detail-metric-value,
.vocab-detail-side-value {
    display: block;
    color: var(--primary-dark);
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.5;
}

.vocab-detail-hero-side {
    padding: 20px;
    display: grid;
    align-content: start;
    gap: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.vocab-detail-side-text {
    color: var(--text-main);
    line-height: 1.75;
    word-break: break-word;
}

.vocab-detail-quick-links {
    display: grid;
    gap: 10px;
    padding: 4px 2px 0;
}

body[data-page="vocab-detail"] .vocab-detail-quick-links .text-link {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0.62rem 0.9rem;
    border: 1px solid #d9e7fb;
    border-radius: 14px;
    background: #ffffff;
}

body[data-page="vocab-detail"] .vocab-detail-quick-links .text-link:hover {
    background: #f6faff;
}

body[data-page="vocab-detail"] .vocab-detail-quick-links .text-link {
    margin-bottom: 0;
}

.vocab-detail-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.92fr);
    gap: 22px;
    align-items: start;
}

.vocab-detail-workspace-single {
    grid-template-columns: minmax(0, 1fr);
}

.vocab-detail-main-column,
.vocab-detail-side-column {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.vocab-detail-side-column {
    position: sticky;
    top: 18px;
}

body[data-page="vocab-detail"] .detail-card {
    border-color: #d6e4f7;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

body[data-page="vocab-detail"] .panel-label {
    letter-spacing: 0.02em;
}

.vocab-detail-side-panel,
.vocab-detail-entry-card {
    padding: 20px;
}

.vocab-detail-panel-head,
.vocab-detail-import-head {
    margin-bottom: 18px;
}

.vocab-detail-entry-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
}

.manual-word-form {
    gap: 16px;
}

.manual-word-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.manual-word-field {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.import-guidance {
    display: grid;
    gap: 6px;
    margin-top: 14px;
    color: var(--text-muted);
    line-height: 1.65;
}

.import-guidance p {
    margin: 0;
}

.vocab-detail-import-card {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.vocab-detail-entry-card,
.import-method-card,
.vocab-detail-workspace > *,
.vocab-detail-entry-grid > * {
    min-width: 0;
}

.vocab-detail-import-head {
    flex-direction: column;
    align-items: stretch;
}

.vocab-detail-footer-actions {
    justify-content: stretch;
}

.vocab-detail-footer-actions > * {
    flex: 1 1 auto;
    text-align: center;
}

.vocab-set-group {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid #d7e6fb;
    border-radius: var(--radius-medium);
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}
.vocab-set-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.vocab-group-toggle-button {
    padding: 0.38rem 0.82rem;
    font-size: 0.84rem;
}

.vocab-set-group.collapsed .vocab-set-list-group-grid {
    display: none;
}

.vocab-set-group-head h3 {
    margin: 0;
    color: var(--primary-dark);
    font-size: 1.08rem;
}
.vocab-set-list-group-grid {
    display: grid;
    gap: 14px;
}

.vocab-set-card {
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-medium);
    background: #ffffff;
}

.vocab-set-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.vocab-set-card-title-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.vocab-set-card-title {
    margin: 0;
    font-size: 1.15rem;
}

.vocab-set-card-meta {
    color: var(--text-muted);
    line-height: 1.7;
}

.word-item-card {
    padding: 18px;
    border: 1px solid #dce6f1;
    border-radius: var(--radius-medium);
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    box-shadow: 0 10px 22px rgba(24, 50, 75, 0.04);
}

.word-item-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.word-item-head h3 {
    margin: 0;
    font-size: var(--study-word-size);
    line-height: 1.28;
    word-break: break-word;
}

.word-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.word-item-pronunciation-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.word-item-phonetic {
    color: var(--primary-dark);
    font-weight: 700;
}

/* Ensure phonetic / IPA characters use a font that provides the glyphs,
   fall back to common Unicode fonts available on Windows and other OSes. */
.word-item-phonetic,
.learn-candidate-phonetic-cell,
.memorize-card-phonetic,
.home-learned-word-phonetic,
.home-today-learned-phonetic,
.review-phonetic,
.detail-value {
    font-family: "Segoe UI Symbol", "Arial Unicode MS", "Noto Sans", "DejaVu Sans", "Charis SIL", "Doulos SIL", sans-serif;
}

.word-pronunciation-button {
    min-width: var(--pronounce-control-min-width);
    min-height: var(--pronounce-control-height);
    padding: 0.28rem 0.56rem;
    border-radius: 999px;
    border: 1px solid #d5e4fb;
    background: #f7fbff;
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
}

.word-pronunciation-button:hover {
    background: #edf5ff;
}

.word-pronunciation-button.is-loading {
    cursor: wait;
    opacity: 0.72;
}

.delete-word-button {
    padding: 0.48rem 0.9rem;
    border-radius: 999px;
    border: 1px solid #f0c39a;
    background: #fff4ea;
    color: #b25d00;
    font-size: 0.92rem;
    font-weight: 700;
}

.delete-word-button:hover {
    background: #ffe8d2;
}

.edit-word-button {
    padding: 0.48rem 0.9rem;
    border-radius: 999px;
    border: 1px solid #bdd6ff;
    background: #edf5ff;
    color: var(--primary-dark);
    font-size: 0.92rem;
    font-weight: 700;
}

.edit-word-button:hover {
    background: #dfeeff;
}

body[data-page="vocab-detail"] .list-toolbar {
    padding: 16px 18px;
    border: 1px solid #dde7f2;
    border-radius: var(--radius-medium);
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.word-item-row {
    display: flex;
    gap: 10px;
    line-height: 1.7;
    color: var(--text-main);
}

.word-item-column {
    flex-direction: column;
}

.word-item-root-row {
    align-items: baseline;
}

.word-item-root-value {
    min-width: 0;
    overflow-wrap: anywhere;
}

.word-item-label {
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 700;
    min-width: 72px;
}

.keyword-highlight {
    padding: 0 0.2em;
    border-radius: 0.35em;
    background: #fff2a8;
    color: #6b4b00;
    box-shadow: inset 0 -1px 0 rgba(181, 129, 0, 0.12);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px;
    overflow-y: auto;
    background: rgba(11, 33, 61, 0.38);
}

.modal-card {
    width: min(640px, 100%);
    padding: 24px;
    border-radius: var(--radius-large);
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: 0 22px 50px rgba(15, 55, 106, 0.24);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}

.modal-head {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e3ebf6;
}

.home-learned-modal-card {
    width: min(980px, 100%);
    padding: 30px 32px;
    margin: auto 0;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}

.home-learned-history-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 320px));
    gap: 10px 14px;
    align-items: end;
}

.home-learned-history-toolbar .form-label {
    margin: 0;
}

.home-learned-filter-field {
    display: grid;
    gap: 8px;
}

.anti-forget-result-segmented {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    width: min(320px, 100%);
    padding: 4px;
    border: 1px solid #d8e7ff;
    border-radius: 16px;
    background: #f5f9ff;
}

.anti-forget-result-filter-button {
    min-height: 42px;
    padding: 0 0.72rem;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.94rem;
    font-weight: 900;
}

.anti-forget-result-filter-button.active {
    background: #ffffff;
    color: var(--primary-dark);
    box-shadow: 0 8px 18px rgba(31, 111, 229, 0.12);
}

.anti-forget-result-filter-button:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.home-learned-report-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.home-report-button {
    min-width: 170px;
}

.home-learned-date-select {
    max-width: 320px;
}

.home-today-learned-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.home-learned-load-more-row {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}

.home-learned-load-more-row .secondary-button {
    min-width: 180px;
}

.home-learned-footer-tools {
    display: grid;
    gap: 18px;
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid #dbe8ff;
}

.anti-forget-history-filters {
    margin-top: 18px;
    margin-bottom: 18px;
    padding-top: 0;
    padding-bottom: 18px;
    border-top: 0;
    border-bottom: 1px solid #dbe8ff;
}

.home-learned-word-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    border: 1px solid #d8e7ff;
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
    box-shadow: 0 10px 22px rgba(31, 111, 229, 0.08);
    cursor: pointer;
}

.home-learned-word-card:hover {
    border-color: #b9d0f7;
    background: linear-gradient(180deg, #ffffff 0%, #eef5ff 100%);
}

.home-learned-word-card.expanded {
    border-color: #8ab4f7;
    background: linear-gradient(180deg, #f7fbff 0%, #eaf4ff 100%);
    box-shadow: 0 14px 28px rgba(31, 111, 229, 0.14);
}

.home-learned-word-controls {
    display: grid;
    justify-items: center;
    align-self: flex-start;
    flex-shrink: 0;
}

.home-learned-pronounce-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--pronounce-control-min-width);
    height: var(--pronounce-control-height);
    min-width: var(--pronounce-control-min-width);
    min-height: var(--pronounce-control-height);
    padding: 0.28rem 0.56rem;
    border: 1px solid #d5e4fb;
    border-radius: 999px;
    background: #f7fbff;
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: none;
}

.home-learned-pronounce-button:hover {
    background: #edf5ff;
}

.home-learned-word-body {
    display: grid;
    gap: 6px;
    min-width: 0;
    flex: 1;
}

.home-review-record-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.home-review-record-result {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.28rem 0.72rem;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 800;
    white-space: nowrap;
}

.home-review-result-remember {
    background: rgba(47, 193, 140, 0.12);
    border: 1px solid rgba(47, 193, 140, 0.28);
    color: #0e8f61;
}

.home-review-result-forget {
    background: rgba(240, 172, 58, 0.14);
    border: 1px solid rgba(240, 172, 58, 0.34);
    color: #a76400;
}

.home-review-quality-phonics {
    background: #edf5ff;
    border: 1px solid #bfd4f2;
    color: var(--primary-dark);
}

.home-review-quality-assisted {
    background: #fff5e8;
    border: 1px solid #efd1a4;
    color: #9a5817;
}

.home-review-quality-legacy {
    background: #f3f5f8;
    border: 1px solid #d9e0e8;
    color: var(--text-muted);
}

.home-learned-word-title {
    margin: 0;
    color: var(--text-main);
    font-size: var(--study-word-size);
    line-height: 1.28;
    word-break: break-word;
}

.home-learned-word-hint {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.94rem;
    line-height: 1.55;
}

.anti-forget-word-card .anti-forget-forget-count {
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.4;
}

.anti-forget-history-card .home-learned-word-hint {
    font-weight: 700;
}

.home-learned-word-extra {
    display: grid;
    gap: 8px;
    margin-top: 4px;
}

.home-learned-word-meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.home-learned-word-meaning,
.home-learned-word-phonetic,
.home-learned-word-root,
.home-learned-word-vocab {
    margin: 0;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.72;
}

.home-learned-word-meaning {
    color: var(--primary-dark);
    font-weight: 700;
}

.home-learned-word-phonetic {
    color: var(--primary-dark);
    font-size: 0.96rem;
}

.home-learned-word-pos {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.24rem 0.62rem;
    border-radius: 999px;
    background: #edf5ff;
    border: 1px solid #c9dcff;
    color: var(--primary-dark);
    font-size: 0.86rem;
    font-weight: 800;
}

.home-learned-word-root {
    color: var(--text-main);
}

.anti-forget-modal-card {
    width: min(1080px, 100%);
}

.anti-forget-task-list {
    grid-template-columns: 1fr;
}

.anti-forget-view-modes {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.anti-forget-view-modes .secondary-button.active {
    color: #ffffff;
    background: var(--primary);
    border-color: var(--primary);
}

.anti-forget-task-filter {
    display: grid;
    grid-template-columns: minmax(120px, 180px) minmax(220px, 360px);
    gap: 10px 14px;
    align-items: center;
    margin-bottom: 16px;
}

.anti-forget-task-filter .form-label {
    margin: 0;
}

.anti-forget-catalog-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.anti-forget-catalog-toolbar .placeholder-text {
    margin: 0;
}

.anti-forget-catalog-sort-field {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.anti-forget-catalog-sort-field .text-input {
    min-width: 190px;
}

.anti-forget-modal-footer {
    position: sticky;
    bottom: -30px;
    z-index: 2;
    display: flex;
    justify-content: flex-end;
    margin: 18px -32px -30px;
    padding: 14px 32px 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, #ffffff 42%);
    border-top: 1px solid #e3ebf6;
}

.anti-forget-word-card,
.anti-forget-history-card {
    align-items: flex-start;
}

.anti-forget-word-card .home-learned-word-controls,
.anti-forget-history-card .home-learned-word-controls {
    align-self: flex-start;
}

.anti-forget-history-card .anti-forget-word-head {
    align-items: center;
}

.anti-forget-word-card.active {
    border-color: #1f6fe5;
    background: linear-gradient(180deg, #f7fbff 0%, #edf5ff 100%);
    box-shadow: 0 18px 36px rgba(31, 111, 229, 0.22);
}

.anti-forget-word-card.submitting {
    border-color: #f0ac3a;
    box-shadow: 0 18px 36px rgba(240, 172, 58, 0.22);
}

.anti-forget-word-card.completed {
    border-color: rgba(47, 193, 140, 0.38);
    background: linear-gradient(180deg, #ffffff 0%, #f1fff9 100%);
}

.anti-forget-word-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.anti-forget-word-meta {
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.45;
    text-align: right;
}

.anti-forget-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(96px, 1fr));
    gap: 10px;
    align-self: center;
    min-width: 220px;
}

.anti-forget-result-button {
    white-space: nowrap;
    min-height: 48px;
    font-size: 1rem;
    font-weight: 900;
}

.anti-forget-result-button[data-anti-forget-result="forget"] {
    border-color: rgba(221, 138, 47, 0.45);
    color: #9a5a0d;
}

.anti-forget-word-card.active .anti-forget-result-button[data-anti-forget-result="forget"] {
    background: #fff7e8;
    border-color: #f0ac3a;
    color: #8f5308;
}

.anti-forget-word-card.active .anti-forget-result-button[data-anti-forget-result="remember"] {
    background: #eaf4ff;
    border-color: #8ab4f7;
    color: #0d4b9a;
}

.anti-forget-result-button.pending {
    background: #fff2d3 !important;
    border-color: #dd8a2f !important;
    color: #7a4300 !important;
}

.anti-forget-result-button:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.anti-forget-result-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.28rem 0.72rem;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 800;
    white-space: nowrap;
}

.anti-forget-result-pill.remember {
    background: rgba(47, 193, 140, 0.12);
    border: 1px solid rgba(47, 193, 140, 0.28);
    color: #0e8f61;
}

.anti-forget-result-pill.forget {
    background: rgba(240, 172, 58, 0.14);
    border: 1px solid rgba(240, 172, 58, 0.34);
    color: #a76400;
}

@media (max-width: 1180px) {
    .anti-forget-status-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .portal-hero-card > h1 {
        font-size: 2rem;
    }

    .home-learned-modal-card {
        width: min(760px, 100%);
        padding: 24px;
        max-height: calc(100vh - 24px);
    }

    .portal-entry-grid {
        grid-template-columns: 1fr;
    }

    .admin-workspace-create-grid,
    .admin-workspace-edit-grid {
        grid-template-columns: 1fr;
    }

    .admin-home-card {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "topbar"
            "brand"
            "intro"
            "message"
            "nav"
            "overview"
            "list"
            "create"
            "security"
            "audit";
    }

    .admin-console-intro {
        display: grid;
        gap: 10px;
        align-items: start;
    }

    .admin-console-intro > p {
        max-width: none;
        text-align: left;
    }

    .admin-section-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .admin-section-nav a {
        flex: 0 0 auto;
    }

    .admin-workspace-password-row {
        grid-template-columns: 1fr;
    }

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

    .teacher-trial-summary {
        padding-right: 0;
    }

    .home-today-learned-list {
        grid-template-columns: 1fr;
    }

    .anti-forget-status-grid {
        grid-template-columns: 1fr;
    }

    .anti-forget-word-card,
    .anti-forget-history-card,
    .anti-forget-word-head {
        display: grid;
    }

    .anti-forget-word-meta {
        text-align: left;
    }

    .anti-forget-actions {
        width: 100%;
        min-width: 0;
    }

    .anti-forget-modal-footer {
        bottom: -24px;
        margin: 18px -24px -24px;
        padding: 14px 24px 18px;
    }
}

.home-today-learned-phonetic {
    color: var(--primary-dark);
    font-weight: 700;
}

.modal-close-button {
    padding: 0.58rem 1rem;
}

.compact-form {
    margin-bottom: 0;
    gap: 14px;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.72;
    transform: none;
}

.simple-list {
    margin: 0 0 20px;
    padding-left: 20px;
    line-height: 1.8;
    color: var(--text-main);
}

.admin-audit-quick-filter,
.home-inline-toggle-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.admin-audit-quick-filter:hover,
.home-inline-toggle-card:hover {
    box-shadow: 0 10px 22px rgba(24, 50, 75, 0.06);
}

@media (max-width: 860px) {
    .page-shell,
    body[data-page="home"] .page-shell,
    body[data-page="portal"] .page-shell,
    .compact-shell {
        width: min(100% - 24px, 100% - 24px);
    }

    .teacher-workspace-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .teacher-workspace-grid {
        grid-template-columns: 1fr;
    }

    .learn-filter-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .learn-filter-field {
        flex: none;
        width: 100%;
    }

    .learn-filter-actions {
        justify-content: stretch;
    }

    .learn-filter-actions > * {
        flex: 1 1 auto;
        text-align: center;
    }

    .vocab-detail-hero,
    .vocab-detail-workspace,
    .vocab-detail-entry-grid {
        grid-template-columns: 1fr;
    }

    .vocab-detail-side-column {
        position: static;
    }

    .vocab-detail-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .vocab-detail-hero-head {
        flex-direction: column;
    }

    .vocab-detail-hero-actions {
        justify-content: flex-start;
    }

    .home-login-panel {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    body[data-page="home"] .teacher-home-topbar {
        justify-content: flex-start;
        padding-bottom: 10px;
    }

    body[data-page="home"] .home-profile-picker,
    body[data-page="home"] .home-create-card form,
    body[data-page="create-vocab"] .create-vocab-filter-bar,
    body[data-page="admin-login"] .auth-form,
    .admin-workspace-toolbar {
        padding: 14px;
        border-radius: 16px;
    }

    .student-home-hero .teacher-home-topbar,
    .admin-home-card .teacher-home-topbar {
        justify-content: flex-start;
        padding-bottom: 10px;
    }

    .home-summary-subgrid {
        grid-template-columns: 1fr;
    }

    .memorize-hero {
        grid-template-columns: 1fr;
    }

    body[data-page="paper-box"] .memorize-hero {
        grid-template-columns: 1fr;
    }

    .memorize-hero-main {
        border-right: 0;
        border-bottom: 1px solid #dbe7f8;
    }

    .memorize-hero-main,
    .memorize-progress-card,
    body[data-page="review"] .word-panel {
        padding: 20px;
    }

    .hero-shell {
        grid-template-columns: 1fr;
    }

    .hero-card {
        padding: 32px 24px;
    }

    .study-card {
        padding: 24px;
    }

    .info-card,
    .helper-panel,
    .teacher-workspace-panel,
    .vocab-detail-hero-main,
    .vocab-detail-hero-side,
    .vocab-detail-entry-card,
    .vocab-detail-side-panel,
    .word-item-card,
    .vocab-set-card,
    .manage-account-card,
    .admin-overview-card,
    .admin-student-card {
        padding: 18px;
    }

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

    .review-progress-grid {
        grid-template-columns: 1fr;
    }

    .learn-vocab-select {
        max-width: 100%;
    }

    .learn-candidate-table {
        min-width: 100%;
        table-layout: fixed;
    }

    .learn-candidate-table th:first-child,
    .learn-candidate-table td:first-child {
        width: auto;
    }

    .learn-candidate-table th:nth-child(2),
    .learn-candidate-table th:nth-child(3),
    .learn-candidate-table td:nth-child(2),
    .learn-candidate-table td:nth-child(3) {
        width: 96px;
        min-width: 96px;
    }

    .learn-candidate-table th,
    .learn-candidate-table td {
        padding: 10px 8px;
    }

    .learn-candidate-table thead th {
        font-size: 0.88rem;
        line-height: 1.2;
    }

    .learn-candidate-word-content {
        gap: 8px;
    }

    .learn-candidate-choice-cell {
        width: 96px;
        min-width: 96px;
        padding: 6px !important;
    }

    .section-head,
    .word-item-head,
    .word-item-row,
    .word-item-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .word-item-root-row {
        flex-direction: row;
        align-items: baseline;
    }

    .search-toolbar,
    .search-button-row,
    .list-toolbar,
    .pronunciation-row,
    .memorize-action-row {
        flex-direction: column;
        align-items: stretch;
    }

    .home-learned-report-toolbar {
        flex-direction: column;
    }

    .home-report-button {
        width: 100%;
    }

    .memorize-action-group-end {
        width: 100%;
        justify-content: flex-start;
    }

    .review-spelling-form {
        flex-direction: column;
        align-items: stretch;
    }

    .review-spelling-streak-card {
        width: auto;
    }

    .review-spelling-input {
        flex: 0 0 auto;
        width: 100%;
        min-width: 0;
        min-height: 48px;
    }

    .review-spelling-submit-button {
        width: 100%;
        justify-self: stretch;
    }

    .review-spelling-submit-row {
        gap: 8px;
    }

    .review-spelling-submit-row > button {
        flex-basis: 100%;
    }

    .import-method-grid {
        grid-template-columns: 1fr;
    }

    .import-submit-row {
        justify-content: stretch;
    }

    .import-submit-row button {
        width: 100%;
    }

    .home-summary-grid {
        grid-template-columns: 1fr;
    }

    .anti-forget-modal-card {
        padding: 18px 16px;
        max-height: calc(100vh - 18px);
    }

    .home-learned-history-toolbar {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .home-learned-date-select {
        max-width: 100%;
    }

    .home-today-learned-list {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 16px;
    }

    .anti-forget-history-card {
        position: relative;
        display: grid;
        grid-template-columns: 58px minmax(0, 1fr);
        gap: 10px;
        padding: 14px 14px;
        border-radius: 16px;
    }

    .anti-forget-history-card .home-learned-word-controls {
        align-self: start;
        justify-items: start;
    }

    .anti-forget-history-card .home-learned-pronounce-button {
        width: var(--pronounce-control-min-width);
        height: var(--pronounce-control-height);
        min-width: var(--pronounce-control-min-width);
        min-height: var(--pronounce-control-height);
        padding: 0.28rem 0.56rem;
        font-size: 0.78rem;
        border-radius: 999px;
    }

    .anti-forget-history-card .home-learned-word-body {
        gap: 5px;
    }

    .anti-forget-history-card .anti-forget-word-head {
        align-items: flex-start;
        gap: 8px;
    }

    .anti-forget-history-card .home-learned-word-title {
        font-size: var(--study-word-size-mobile);
        line-height: 1.28;
    }

    .anti-forget-history-card .anti-forget-result-pill {
        padding: 0.2rem 0.54rem;
        font-size: 0.76rem;
    }

    .anti-forget-history-card .home-learned-word-hint {
        font-size: 0.84rem;
        line-height: 1.35;
    }

    .anti-forget-history-card .home-learned-word-extra {
        grid-column: 1 / -1;
        margin-top: 8px;
        padding: 10px 12px;
        border-radius: 14px;
        background: rgba(237, 245, 255, 0.72);
    }

    .manage-accounts-grid {
        grid-template-columns: 1fr;
    }

    .manage-account-card-head,
    .manage-account-meta-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .home-summary-tools {
        flex-direction: column;
        align-items: stretch;
    }

    .student-home-tools {
        flex-direction: column;
        align-items: stretch;
    }

    .section-action-row,
    .enrich-preview-item-head,
    .enrich-preview-meta-row,
    .enrich-preview-field-row {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    .enrich-preview-field-row {
        display: flex;
    }

    .search-button-row button {
        width: 100%;
    }

    .pronunciation-button {
        width: 100%;
    }

    .pronunciation-item,
    .pronunciation-voice-name {
        width: 100%;
        max-width: 100%;
    }

    .sort-toolbar,
    .sort-select {
        min-width: 100%;
    }

    .enrich-run-summary-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .import-example {
        font-size: 0.9rem;
    }

    .manage-accounts-toolbar,
    .admin-workspace-toolbar,
    .create-vocab-filter-bar,
    .button-row,
    .action-grid,
    .home-learned-footer-tools,
    .modal-head,
    .vocab-set-card-head,
    .teacher-home-topbar,
    .review-actions {
        align-items: stretch;
    }

    .manage-accounts-toolbar > *,
    .admin-workspace-toolbar > *,
    .create-vocab-filter-bar > *,
    .button-row > *,
    .action-grid > *,
    .review-actions > * {
        width: 100%;
    }
}

@media (max-width: 1260px) {
    .vocab-detail-workspace,
    .vocab-detail-entry-grid {
        grid-template-columns: 1fr;
    }

    .vocab-detail-side-column {
        position: static;
    }
}

@media (max-width: 1080px) {
    .vocab-detail-hero {
        grid-template-columns: 1fr;
    }

    .vocab-entry-focus-head {
        flex-direction: column;
    }

    .vocab-entry-toolbar {
        justify-content: flex-start;
    }

    .vocab-detail-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .vocab-detail-hero-head {
        flex-direction: column;
    }

    .vocab-detail-hero-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 560px) {
    .portal-hero-card > h1 {
        font-size: 1.65rem;
        line-height: 1.25;
    }

    .anti-forget-task-filter {
        grid-template-columns: 1fr;
    }

    .anti-forget-view-modes,
    .anti-forget-catalog-toolbar,
    .anti-forget-catalog-sort-field {
        align-items: stretch;
        flex-direction: column;
    }

    .anti-forget-view-modes .secondary-button,
    .anti-forget-catalog-sort-field .text-input {
        width: 100%;
        min-width: 0;
    }

    .anti-forget-modal-footer {
        bottom: -16px;
        margin: 18px 0 -16px;
        padding: 14px 0 16px;
    }

    .anti-forget-word-card,
    .anti-forget-word-card .home-learned-word-body,
    .anti-forget-actions {
        min-width: 0;
        max-width: 100%;
    }

    :root {
        --page-width: min(100% - 20px, 100% - 20px);
        --page-width-wide: min(100% - 20px, 100% - 20px);
        --page-width-compact: min(100% - 20px, 100% - 20px);
    }

    body[data-page="learn"] .study-card {
        padding: 16px 14px 20px;
    }

    .teacher-workspace-nav {
        grid-template-columns: 1fr;
    }

    .vocab-detail-metric-grid {
        grid-template-columns: 1fr;
    }

    .vocab-detail-hero-main,
    .vocab-detail-hero-side,
    .vocab-detail-entry-card,
    .vocab-detail-side-panel {
        padding: 18px;
    }

    .manual-word-fields,
    .import-method-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .import-method-card {
        padding: 14px;
    }

    .import-hint-box {
        padding: 14px;
    }

    .import-example {
        max-width: 100%;
        overflow-x: auto;
        font-size: 0.86rem;
    }

    .import-text-area {
        min-height: 260px;
    }

    .manual-word-form > .button-row,
    .vocab-detail-import-head .button-row {
        width: 100%;
    }

    .manual-word-form > .button-row button,
    .vocab-detail-import-head .button-row button {
        width: 100%;
    }

    .enrich-run-summary-row {
        grid-template-columns: 1fr;
    }

    .study-card {
        padding: 18px;
    }

    .hero-card {
        padding: 22px 18px;
        border-radius: 20px;
    }

    .hero-logo {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .hero-logo-text {
        max-width: 100%;
        font-size: clamp(2rem, 10vw, 2.8rem);
        line-height: 0.96;
        word-break: normal;
        overflow-wrap: anywhere;
        text-wrap: balance;
    }

    .admin-console-intro h1 {
        max-width: 11ch;
        font-size: 1.7rem;
        line-height: 1.15;
    }

    .admin-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .admin-overview-card {
        min-width: 0;
        padding: 14px;
    }

    .admin-overview-label {
        font-size: 0.82rem;
        line-height: 1.35;
    }

    .admin-audit-log-head {
        display: grid;
    }

    .teacher-trial-shell {
        width: min(100% - 20px, 100% - 20px);
    }

    .teacher-trial-topbar,
    .teacher-trial-entry {
        align-items: stretch;
        flex-direction: column;
    }

    .teacher-trial-password-grid {
        grid-template-columns: 1fr;
    }

    .teacher-trial-form-panel {
        padding: 18px;
    }

    .info-card,
    .helper-panel,
    .teacher-workspace-panel,
    .vocab-detail-hero-main,
    .vocab-detail-hero-side,
    .vocab-detail-entry-card,
    .vocab-detail-side-panel,
    .word-item-card,
    .vocab-set-card,
    .manage-account-card,
    .admin-overview-card,
    .admin-student-card,
    .modal-card,
    .home-learned-modal-card {
        padding: 16px;
        border-radius: 18px;
    }

    .page-header h1,
    .word-main,
    .vocab-detail-title {
        word-break: break-word;
    }

    .home-summary-item,
    .detail-card,
    .home-inline-panel,
    .teacher-workspace-tip-card,
    .word-panel,
    .status-message,
    .helper-panel {
        padding: 14px;
    }

    body[data-page="home"] .home-summary-tools,
    body[data-page="home"] .home-login-actions,
    body[data-page="vocab-detail"] .vocab-detail-hero-actions,
    .student-home-tools {
        gap: 10px;
    }

    body[data-page="home"] .home-login-actions > *,
    body[data-page="home"] .home-summary-tools > *,
    body[data-page="vocab-detail"] .vocab-detail-hero-actions > *,
    .student-home-tools > * {
        width: 100%;
    }

    .modal-overlay {
        padding: 10px;
    }

    .modal-head,
    .vocab-entry-focus-head,
    .vocab-detail-hero-head,
    .admin-student-card-head,
    .home-review-record-head {
        display: grid;
        gap: 10px;
    }

    .text-input,
    .text-area,
    button,
    a.primary-button,
    a.secondary-button,
    a.ghost-button {
        font-size: 16px;
    }

    .home-summary-value,
    .admin-overview-value {
        font-size: clamp(1.45rem, 7vw, 1.9rem);
    }

    .memorize-progress-card {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0;
        padding: 10px;
    }

    .memorize-progress-item {
        min-height: 0;
        padding: 10px 8px;
        border-top: 0;
        border-left: 1px solid #dbe7f8;
    }

    .memorize-progress-item:first-child {
        border-left: 0;
    }

    .memorize-progress-label {
        font-size: 0.72rem;
    }

    .memorize-progress-value {
        font-size: 0.95rem;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .memorize-card {
        align-items: center;
        gap: 12px;
        min-height: 68px;
        padding: 11px 10px;
    }

    .memorize-card.expanded {
        align-items: flex-start;
        min-height: 0;
        padding: 16px 12px;
    }

    .paper-box-item {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
    }

    .paper-box-item-actions {
        grid-column: 2;
        justify-self: stretch;
        min-width: 0;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .memorize-card-controls {
        width: auto;
        flex: 0 0 auto;
        grid-template-columns: auto auto;
        align-items: center;
        justify-items: center;
    }

    .memorize-card.expanded .memorize-card-controls {
        grid-template-columns: 1fr;
    }

    .memorize-card-body {
        width: 0;
        min-width: 0;
        flex: 1 1 auto;
    }

    .memorize-card-word,
    .paper-box-item-word,
    .home-learned-word-title,
    .learn-candidate-word,
    .word-item-head h3 {
        font-size: var(--study-word-size-mobile);
    }

    .memorize-card-word {
        font-size: 1.25rem;
        word-break: normal;
        overflow-wrap: anywhere;
    }

    .memorize-card.expanded .memorize-card-word {
        font-size: clamp(1.75rem, 8vw, 2.15rem);
    }

    .memorize-card-phonetic {
        font-size: 1.08rem;
    }

    .memorize-card-meaning {
        font-size: 1rem;
    }

    .memorize-card-root {
        font-size: 0.96rem;
    }

    .memorize-pronounce-wrap,
    .memorize-pronounce-button {
        width: auto;
    }

    .memorize-pronounce-button,
    .home-learned-pronounce-button,
    .pronunciation-button,
    .word-pronunciation-button {
        min-width: var(--pronounce-control-min-width);
        min-height: var(--pronounce-control-height);
        padding: 0.28rem 0.56rem;
        font-size: 0.78rem;
    }

    body[data-page="review"] .review-primary-actions,
    body[data-page="review"] .memorize-action-group,
    body[data-page="memorize"] .memorize-action-group {
        width: 100%;
    }

    body[data-page="review"] .review-primary-actions > *,
    body[data-page="review"] .memorize-action-group > *,
    body[data-page="memorize"] .memorize-action-group > * {
        width: 100%;
    }

    .review-progress-grid {
        gap: 12px;
    }

    .progress-card,
    .memorize-hero-main,
    .memorize-progress-card,
    body[data-page="review"] .word-panel,
    .learn-filter-panel,
    .learn-candidate-panel,
    .review-filter-panel,
    .memorize-panel {
        padding: 16px;
    }

    body[data-page="learn"] .learn-candidate-panel {
        padding: 4px 0 0;
    }

    body[data-page="memorize"] .memorize-panel {
        padding: 4px 0 0;
    }

    body[data-page="learn"] .learn-candidate-panel .section-head {
        margin-bottom: 10px;
    }

    .learn-candidate-table th,
    .learn-candidate-table td {
        padding: 9px 6px;
        font-size: 0.9rem;
    }

    .learn-candidate-table th:nth-child(2),
    .learn-candidate-table th:nth-child(3),
    .learn-candidate-table td:nth-child(2),
    .learn-candidate-table td:nth-child(3) {
        width: 72px;
        min-width: 72px;
    }

    .learn-candidate-table thead th {
        font-size: 0.76rem;
    }

    .learn-candidate-word-cell {
        gap: 6px;
    }

    .learn-candidate-row-index {
        min-width: 22px;
        height: 22px;
        font-size: 0.76rem;
    }

    .learn-candidate-word {
        font-size: 1.0625rem;
        line-height: 1.22;
        word-break: normal;
        overflow-wrap: anywhere;
    }

    .learn-candidate-choice-cell {
        width: 72px;
        min-width: 72px;
        padding: 5px !important;
    }

    .learn-candidate-choice {
        width: 22px;
        height: 22px;
    }

    .learn-candidate-choice-target {
        min-height: 52px;
        padding: 7px 4px;
        gap: 0;
    }

    .learn-candidate-choice-target span {
        display: none;
    }
}

.portal-admin-entry {
    margin-top: 18px;
}

@media (max-width: 680px) {
    body[data-page="learn"] .study-card,
    body[data-page="learn"] .helper-panel,
    body[data-page="learn"] .learn-filter-panel,
    body[data-page="learn"] .learn-candidate-panel {
        max-width: none;
    }

    body[data-page="learn"] .learn-candidate-table th,
    body[data-page="learn"] .learn-candidate-table td {
        padding: 9px 6px;
    }

    body[data-page="learn"] .learn-candidate-table th:nth-child(2),
    body[data-page="learn"] .learn-candidate-table th:nth-child(3),
    body[data-page="learn"] .learn-candidate-table td:nth-child(2),
    body[data-page="learn"] .learn-candidate-table td:nth-child(3),
    body[data-page="learn"] .learn-candidate-choice-cell {
        width: 72px;
        min-width: 72px;
    }

    body[data-page="learn"] .learn-candidate-choice {
        width: 22px;
        height: 22px;
    }

    body[data-page="learn"] .learn-candidate-table thead th {
        font-size: 0.82rem;
    }
}
