:root {
    --brand: #FA7800;
    --brand-dark: #d95f00;
    --bg: #f8fafc;
    --panel: #ffffff;
    --text: #1f2937;
    --muted: #64748b;
    --line: #e5e7eb;
    --soft: #fff7ed;
    --green: #059669;
    --green-soft: #ecfdf5;
    --red: #dc2626;
    --red-soft: #fef2f2;
    --yellow: #d97706;
    --yellow-soft: #fffbeb;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.topbar {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
}

.back-link {
    color: #334155;
    text-decoration: none;
    font-size: 15px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 18px;
}

.brand img {
    width: 28px;
    height: 28px;
    border-radius: 7px;
}

.page-shell {
    width: min(980px, calc(100vw - 32px));
    margin: 28px auto 48px;
}

.hero-panel {
    background: linear-gradient(135deg, #fff7ed 0%, #ffffff 68%);
    border: 1px solid #fed7aa;
    border-radius: 18px;
    padding: 24px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.04);
}

.hero-panel h1 { margin: 0 0 8px; font-size: 24px; }
.hero-panel p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(76px, 1fr));
    gap: 12px;
    min-width: 392px;
}

.stat-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
    text-align: center;
}

.stat-card strong { display: block; color: var(--brand-dark); font-size: 24px; }
.stat-card span { color: var(--muted); font-size: 12px; }

.growth-panel {
    margin-top: 14px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.035);
}

.growth-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.growth-heading h2 {
    margin: 0;
    font-size: 17px;
}

.growth-heading p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.compact-btn {
    padding: 8px 12px;
    border-radius: 12px;
    white-space: nowrap;
}

.growth-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.growth-summary div {
    border: 1px solid #fed7aa;
    background: linear-gradient(135deg, #fff7ed 0%, #fff 72%);
    border-radius: 14px;
    padding: 12px;
}

.growth-summary span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.growth-summary strong {
    display: block;
    color: var(--text);
    font-size: 19px;
    margin-top: 4px;
}

.badge-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.growth-badge {
    min-width: 150px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 14px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.growth-badge.earned {
    border-color: rgba(5, 150, 105, .22);
    background: linear-gradient(135deg, #ecfdf5 0%, #fff 82%);
}

.growth-badge.pending {
    background: #f8fafc;
    color: #64748b;
}

.badge-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .08);
    color: var(--brand-dark);
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .05);
}

.badge-mark.locked {
    opacity: .55;
    filter: grayscale(.65);
}

.badge-copy {
    min-width: 0;
    flex: 1;
}

.growth-badge strong {
    display: block;
    color: var(--text);
    font-size: 13px;
}

.growth-badge span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 3px;
}

.badge-practice .badge-mark {
    background: #fff7ed;
    color: #c2410c;
}

.badge-streak .badge-mark {
    background: #fef2f2;
    color: #dc2626;
}

.badge-upload .badge-mark {
    background: #eff6ff;
    color: #2563eb;
}

.badge-words .badge-mark {
    background: #ecfdf5;
    color: #059669;
}

.badge-xp .badge-mark {
    background: #f5f3ff;
    color: #7c3aed;
}

.badge-progress {
    height: 6px;
    margin-top: 8px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.badge-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand), #f59e0b);
}

.badge-empty {
    width: 100%;
    color: var(--muted);
    font-size: 13px;
    padding: 4px 2px;
}

.share-card-panel {
    margin-top: 14px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.share-card-panel.capture-only {
    position: fixed;
    left: -9999px;
    top: 0;
    width: 540px;
    border: 0;
    padding: 0;
    margin: 0;
    pointer-events: none;
    opacity: 1;
    z-index: -1;
}

.share-card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.share-card {
    max-width: 520px;
    overflow: hidden;
    border-radius: 22px;
    background: #fff;
    color: #0b0f19;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .18);
}

.share-card-hero {
    position: relative;
    overflow: hidden;
    padding: 28px;
    background:
        radial-gradient(circle at 88% 12%, rgba(255, 207, 82, .42), transparent 28%),
        linear-gradient(135deg, #ff6a3d 0%, #ff4f45 54%, #ff8a1f 100%);
}

.share-card-brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff7ed;
    font-size: 18px;
    font-weight: 900;
}

.share-card-brand img {
    width: 34px;
    height: 34px;
    border-radius: 9px;
}

.share-card-title {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 10px;
    margin-top: 30px;
}

.share-card-title span {
    width: fit-content;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 18px;
    border-radius: 999px;
    background: #ffe1d6;
    color: #050505;
    font-size: 15px;
    font-weight: 900;
}

.share-card-title strong {
    display: block;
    color: #fff;
    font-size: 42px;
    font-weight: 1000;
    line-height: 1.1;
}

.share-card-title p {
    max-width: 390px;
    margin: 0;
    color: rgba(255, 255, 255, .86);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.55;
}

.share-card-metrics {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 24px;
}

.share-card-season {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 88px 1fr;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 18px;
    padding: 12px;
    background: rgba(0, 0, 0, .18);
    backdrop-filter: blur(10px);
}

.season-art {
    position: relative;
    width: 88px;
    height: 70px;
    overflow: hidden;
    border-radius: 16px;
    background:
        radial-gradient(circle at 72% 24%, rgba(255, 255, 255, .95) 0 9px, transparent 10px),
        linear-gradient(160deg, #ffdf8b 0%, #ff8a3d 52%, #e43f2f 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
}

.season-art::before,
.season-art::after {
    content: "";
    position: absolute;
    inset: auto 9px 10px 9px;
    height: 20px;
    border-radius: 999px 999px 8px 8px;
    background: rgba(255, 255, 255, .28);
}

.season-art::after {
    inset: auto 0 0 0;
    height: 18px;
    border-radius: 55% 55% 0 0;
    background: rgba(0, 0, 0, .18);
}

.season-spring {
    background:
        radial-gradient(circle at 70% 24%, rgba(255, 255, 255, .95) 0 9px, transparent 10px),
        radial-gradient(circle at 30% 70%, rgba(132, 204, 22, .7) 0 14px, transparent 15px),
        linear-gradient(160deg, #ffe9a8 0%, #7bd88f 48%, #18a999 100%);
}

.season-summer {
    background:
        radial-gradient(circle at 72% 24%, rgba(255, 255, 255, .95) 0 9px, transparent 10px),
        linear-gradient(160deg, #fff09a 0%, #ff9f43 50%, #ef4444 100%);
}

.season-autumn {
    background:
        radial-gradient(circle at 72% 24%, rgba(255, 255, 255, .95) 0 9px, transparent 10px),
        radial-gradient(circle at 34% 76%, rgba(251, 191, 36, .74) 0 13px, transparent 14px),
        linear-gradient(160deg, #ffe1a6 0%, #f59e0b 52%, #b45309 100%);
}

.season-winter {
    background:
        radial-gradient(circle at 72% 24%, rgba(255, 255, 255, .95) 0 9px, transparent 10px),
        radial-gradient(circle at 28% 70%, rgba(219, 234, 254, .78) 0 14px, transparent 15px),
        linear-gradient(160deg, #dbeafe 0%, #60a5fa 52%, #1d4ed8 100%);
}

.share-card-season span,
.share-card-season strong,
.share-card-season em {
    display: block;
}

.share-card-season span {
    width: fit-content;
    border-radius: 999px;
    padding: 4px 9px;
    background: rgba(255, 255, 255, .9);
    color: #111827;
    font-size: 12px;
    font-weight: 1000;
}

.share-card-season strong {
    margin-top: 8px;
    color: #fff;
    font-size: 17px;
    font-weight: 1000;
    line-height: 1.25;
}

.share-card-season em {
    margin-top: 5px;
    color: rgba(255, 255, 255, .74);
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
}

.share-metric {
    min-height: 104px;
    border-radius: 18px;
    padding: 17px 16px;
    color: #050505;
}

.share-metric.light {
    background: rgba(255, 242, 239, .92);
}

.share-metric.accent {
    background: #ffc431;
}

.share-metric span,
.share-metric em {
    display: block;
    font-size: 14px;
    font-style: normal;
    font-weight: 900;
}

.share-metric em {
    color: rgba(0, 0, 0, .68);
}

.share-metric strong {
    display: block;
    margin-top: 9px;
    font-size: 26px;
    font-weight: 1000;
    line-height: 1.05;
}

.share-metric strong b {
    font-size: 46px;
    font-weight: 1000;
}

.share-card-highlight {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 4px 12px;
    margin-top: 14px;
    border-radius: 18px;
    background: #050505;
    color: #fff;
    padding: 16px;
}

.share-card-highlight span {
    grid-row: span 2;
    color: #ffc431;
    font-size: 34px;
    font-weight: 1000;
}

.share-card-highlight strong,
.share-card-highlight em {
    margin: 0;
    display: block;
}

.share-card-highlight strong {
    font-size: 17px;
    font-weight: 900;
}

.share-card-highlight em {
    color: rgba(255, 255, 255, .62);
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
}

.share-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 28px;
    background: #fff;
}

.share-card-footer strong,
.share-card-footer span,
.share-card-footer em {
    display: block;
}

.share-card-footer strong {
    color: #111827;
    font-size: 24px;
    font-weight: 1000;
}

.share-card-footer span {
    margin-top: 8px;
    color: #333;
    font-size: 15px;
    font-weight: 800;
}

.share-card-footer em {
    margin-top: 7px;
    color: #777;
    font-size: 14px;
    font-style: normal;
}

.share-card-qr {
    display: grid;
    justify-items: center;
    gap: 6px;
    flex: 0 0 88px;
}

.share-card-qr img {
    width: 88px;
    height: 88px;
    border: 1px solid #e5e7eb;
    background: #fff;
}

.share-card-qr span {
    color: #111827;
    font-size: 12px;
    font-weight: 900;
}

.share-card-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, .42);
}

.share-card-modal-card {
    width: min(560px, 100%);
    max-height: min(92vh, 860px);
    display: flex;
    flex-direction: column;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #fff;
    padding: 16px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .26);
}

.share-card-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.share-card-modal-head h2 {
    margin: 0;
    font-size: 20px;
}

.share-card-modal-head p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.share-card-preview-wrap {
    min-height: 0;
    overflow: auto;
    display: grid;
    justify-items: center;
    border-radius: 18px;
    background: #f8fafc;
    padding: 12px;
}

.share-card-preview-img {
    width: min(360px, 100%);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 16px 42px rgba(15, 23, 42, .18);
    background: #ff5b45;
    -webkit-touch-callout: default;
    user-select: auto;
}

.share-card-modal-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.setup-panel,
.study-panel,
.complete-panel {
    margin-top: 18px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.035);
}

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

.section-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title h2 { margin: 0; font-size: 18px; }
.section-title p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.chips { display: flex; flex-direction: column; gap: 14px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chip-group { display: flex; flex-direction: column; gap: 8px; }
.chip-group-title {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .03em;
}
.chip {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    border-radius: 999px;
    padding: 9px 16px;
    font-weight: 700;
    cursor: pointer;
}
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.chip.school-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.chip-check {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid currentColor;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    flex: 0 0 auto;
}

.wordbook-directory {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

.directory-group {
    border: 1px solid var(--line);
    background: linear-gradient(135deg, #fff7ed 0%, #fff 72%);
    border-radius: 16px;
    padding: 12px;
}

.directory-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    list-style: none;
}

.directory-heading::-webkit-details-marker { display: none; }

.directory-heading strong {
    display: block;
    font-size: 14px;
}

.directory-heading span,
.directory-heading em {
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.directory-heading em::after {
    content: "展开";
    display: inline-flex;
    margin-left: 8px;
    color: var(--brand-dark);
    font-weight: 800;
}

.directory-group[open] .directory-heading {
    margin-bottom: 12px;
}

.directory-group[open] .directory-heading em::after { content: "收起"; }

.directory-modules {
    display: grid;
    gap: 10px;
}

.directory-module {
    border-top: 1px solid rgba(250, 120, 0, .14);
    padding-top: 10px;
}

.directory-module-title {
    color: var(--brand-dark);
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    list-style: none;
    margin-bottom: 8px;
}

.directory-module-title::-webkit-details-marker { display: none; }

.directory-module-title span {
    color: var(--muted);
    font-weight: 600;
    margin-left: 6px;
}

.directory-module-title::after {
    content: "展开";
    color: var(--muted);
    margin-left: 8px;
}

.directory-module[open] .directory-module-title::after { content: "收起"; }

.directory-books {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, .24);
    padding: 2px 6px;
    margin-left: 4px;
    font-size: 11px;
}

.chip:not(.active) .chip-badge {
    background: var(--soft);
    color: var(--brand-dark);
}

.custom-wordbook-status {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.wordbook-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.wordbook-toolbar .chips {
    flex: 1;
}

.import-panel {
    margin-top: 16px;
    border: 1px solid #fed7aa;
    background: linear-gradient(135deg, #fff7ed 0%, #fff 76%);
    border-radius: 18px;
    padding: 18px;
}

.import-panel h3 {
    margin: 0;
    font-size: 17px;
}

.import-panel textarea {
    width: 100%;
    min-height: 150px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
    resize: vertical;
    outline: none;
}

.import-panel textarea:focus,
.import-panel input:focus {
    border-color: #fdba74;
    box-shadow: 0 0 0 3px rgba(250, 120, 0, .12);
}

.import-preview {
    margin-top: 12px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
    padding: 12px;
}

.ocr-import-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px dashed #fdba74;
    background: rgba(255, 255, 255, .72);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 10px;
}

.ocr-import-card strong {
    display: block;
    color: var(--text);
    font-size: 14px;
}

.ocr-import-card p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.ocr-import-actions {
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

.ocr-import-status {
    margin: -2px 0 10px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.ocr-import-status[data-tone="success"] { color: var(--green); }
.ocr-import-status[data-tone="error"] { color: var(--red); }

.import-drafts-panel {
    margin-top: 16px;
    border: 1px solid #fed7aa;
    background: rgba(255, 255, 255, .76);
    border-radius: 16px;
    padding: 14px;
}

.import-drafts-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.import-drafts-head h3 {
    margin: 0;
    font-size: 15px;
}

.import-drafts-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.import-drafts-list {
    display: grid;
    gap: 10px;
}

.import-draft-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 14px;
    padding: 12px;
}

.import-draft-title {
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
}

.import-draft-meta,
.import-draft-note,
.import-draft-empty {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.import-draft-note { margin-top: 4px; }

.import-draft-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.import-draft-status {
    border-radius: 999px;
    padding: 4px 8px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.import-draft-status[data-status="submitted"],
.import-draft-status[data-status="in_review"] {
    background: var(--yellow-soft);
    color: var(--yellow);
}

.import-draft-status[data-status="approved"],
.import-draft-status[data-status="promoted"] {
    background: var(--green-soft);
    color: var(--green);
}

.import-draft-status[data-status="rejected"] {
    background: var(--red-soft);
    color: var(--red);
}

.supplemental-panel {
    margin: 14px 0;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    border-radius: 16px;
    padding: 14px;
}

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

.supplemental-head h3 {
    margin: 0;
    font-size: 15px;
}

.supplemental-head p {
    margin: 4px 0 0;
    color: #475569;
    font-size: 12px;
}

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

.supplemental-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #dbeafe;
    background: #fff;
    border-radius: 14px;
    padding: 12px;
}

.supplemental-item strong {
    display: block;
    color: var(--text);
    font-size: 14px;
}

.supplemental-item span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.supplemental-practice {
    margin-top: 12px;
    border: 1px solid #bfdbfe;
    background: #fff;
    border-radius: 14px;
    padding: 14px;
}

.supplemental-practice-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.supplemental-practice-head strong {
    display: block;
    color: var(--text);
    font-size: 15px;
}

.supplemental-practice-head p,
.supplemental-result {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.supplemental-question {
    margin: 0 0 10px;
    border: 1px dashed #93c5fd;
    background: #eff6ff;
    color: #1e3a8a;
    border-radius: 12px;
    padding: 12px;
    font-weight: 800;
    line-height: 1.7;
}

.supplemental-question small {
    display: block;
    margin-top: 6px;
    color: #64748b;
    font-weight: 600;
}

.supplemental-answer {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
    outline: none;
}

.supplemental-answer:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
}

.supplemental-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.supplemental-result[data-tone="success"] { color: var(--green); }
.supplemental-result[data-tone="error"] { color: var(--red); }

.weekly-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 14px 0;
}

.chip-group {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.chip-group + .chip-group { margin-top: 10px; }

.chip-group-title {
    width: 100%;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

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

.field label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.field select,
.field input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
    outline: none;
}

.primary-btn,
.secondary-btn {
    border: 0;
    border-radius: 14px;
    padding: 12px 20px;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
}
.primary-btn { background: var(--brand); color: #fff; box-shadow: 0 8px 18px rgba(250, 120, 0, 0.18); }
.secondary-btn { background: #fff; color: var(--brand-dark); border: 1px solid #fed7aa; }
.primary-btn:disabled,
.secondary-btn:disabled { opacity: .55; cursor: not-allowed; }

.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.resume-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid #fed7aa;
    background: linear-gradient(135deg, #fff7ed 0%, #fff 80%);
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.resume-panel strong { color: var(--text); }
.resume-panel p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.resume-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.progress-line { height: 8px; background: #f1f5f9; border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--brand), #f59e0b); border-radius: inherit; transition: width .25s; }

.task-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.task-pill {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 11px 12px;
    color: var(--muted);
    font-size: 13px;
}

.task-pill strong {
    display: block;
    color: var(--text);
    font-size: 18px;
    margin-top: 2px;
}

.word-card {
    min-height: 250px;
    border: 1px solid #fed7aa;
    background: radial-gradient(circle at top right, #fff7ed 0, #fff 46%);
    border-radius: 22px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}

.word-card.flip-enabled {
    cursor: pointer;
    background: radial-gradient(circle at top right, #fff7ed 0, #fff 52%);
}

.word-card.flip-enabled:not(.is-flipped) {
    box-shadow: inset 0 0 0 2px rgba(250, 120, 0, .08);
}

.word-card.flip-enabled:not(.is-flipped) .answer-detail {
    opacity: 0;
    max-height: 0;
    margin: 0;
    overflow: hidden;
    pointer-events: none;
}

.word-card.is-flipped {
    transform: translateY(-2px);
    box-shadow: 0 16px 38px rgba(15, 23, 42, .08);
}

.word-card .word { font-size: clamp(42px, 9vw, 78px); font-weight: 900; letter-spacing: -1px; margin-bottom: 10px; }
.word-card .meta { color: var(--muted); font-size: 14px; margin-top: 10px; }
.word-card .hint { margin-top: 16px; color: var(--brand-dark); font-size: 13px; }
.word-card .phonetic { color: var(--brand-dark); font-size: 15px; font-weight: 800; min-height: 22px; }
.word-card .meaning { color: var(--text); font-size: 20px; font-weight: 800; margin-top: 10px; }
.word-card .meaning.muted { color: var(--muted); font-size: 15px; font-weight: 600; }
.word-card .example { color: var(--muted); font-size: 14px; line-height: 1.7; margin-top: 10px; max-width: 620px; }

.flip-btn { margin-top: 14px; }
.word-card:not(.flip-enabled) .flip-btn,
.word-card.is-flipped .flip-btn { display: none; }

.mode-badge,
.mastery-badge {
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 800;
}

.mode-badge {
    background: var(--soft);
    color: var(--brand-dark);
    margin-bottom: 12px;
}

.mastery-badge {
    background: #f1f5f9;
    color: #475569;
    margin-top: 12px;
}

.rate-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.rate-btn {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px 10px;
    background: #fff;
    cursor: pointer;
    font-weight: 800;
    font-family: inherit;
}
.rate-btn small { display: block; margin-top: 4px; color: var(--muted); font-weight: 500; }
.rate-btn.wrong { border-color: #fecaca; background: var(--red-soft); color: var(--red); }
.rate-btn.fuzzy { border-color: #fde68a; background: var(--yellow-soft); color: var(--yellow); }
.rate-btn.correct { border-color: #bbf7d0; background: var(--green-soft); color: var(--green); }
.rate-grid.waiting-reveal .rate-btn { opacity: .45; cursor: not-allowed; }

.practice-panel {
    margin-top: 16px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 18px;
    padding: 16px;
}

.practice-prompt {
    margin: 0 0 12px;
    color: var(--text);
    font-weight: 800;
}

.practice-help {
    margin: -4px 0 12px;
    color: var(--muted);
    font-size: 13px;
}

.choice-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.choice-btn {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8fafc;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    min-height: 52px;
    padding: 12px;
    text-align: left;
}

.choice-btn:disabled { opacity: .72; cursor: not-allowed; }

.spell-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.spell-form input {
    border: 1px solid var(--line);
    border-radius: 14px;
    font: inherit;
    padding: 12px 14px;
    outline: none;
}

.spell-form input:focus {
    border-color: #fdba74;
    box-shadow: 0 0 0 3px rgba(250, 120, 0, .12);
}

.objective-sentence {
    margin: 0 0 12px;
    border: 1px dashed #fdba74;
    border-radius: 14px;
    background: var(--soft);
    color: var(--brand-dark);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.7;
    padding: 14px;
}

.listening-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.compact-actions {
    justify-content: flex-start;
    margin-top: 10px;
}

.access-card {
    max-width: 520px;
    margin: 6px auto;
    border: 1px solid #fed7aa;
    border-radius: 20px;
    background: linear-gradient(135deg, #fff7ed 0%, #fff 72%);
    padding: 28px;
    text-align: center;
}

.access-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(250, 120, 0, .12);
    font-size: 26px;
    margin-bottom: 12px;
}

.access-card h2 {
    margin: 0 0 8px;
    font-size: 20px;
}

.access-card p {
    margin: 0 0 18px;
    color: var(--muted);
    line-height: 1.7;
}

.status { margin-top: 14px; color: var(--muted); font-size: 14px; }
.hidden { display: none; }

.complete-panel { text-align: center; }
.complete-icon { font-size: 48px; margin-bottom: 12px; }
.summary-list { margin: 18px auto 0; max-width: 520px; text-align: left; }
.summary-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.summary-row strong { color: var(--text); }

@media (max-width: 720px) {
    .topbar { padding: 0 16px; }
    .brand { font-size: 16px; }
    .hero-panel { grid-template-columns: 1fr; }
    .stats { min-width: 0; }
    .growth-heading { flex-direction: column; }
    .growth-heading .secondary-btn { width: 100%; }
    .growth-summary { grid-template-columns: repeat(2, 1fr); }
    .share-card-actions { flex-direction: column; align-items: stretch; }
    .share-card { max-width: 100%; }
    .share-card-hero { padding: 22px 16px; }
    .share-card-title { margin-top: 24px; }
    .share-card-title strong { font-size: 30px; }
    .share-card-title p { font-size: 15px; }
    .share-card-season { grid-template-columns: 72px 1fr; gap: 10px; padding: 10px; }
    .season-art { width: 72px; height: 60px; border-radius: 14px; }
    .share-card-season strong { font-size: 14px; }
    .share-card-metrics { gap: 10px; margin-top: 20px; }
    .share-metric { min-height: 92px; padding: 15px 13px; border-radius: 16px; }
    .share-metric strong { font-size: 24px; }
    .share-metric strong b { font-size: 40px; }
    .share-metric span,
    .share-metric em { font-size: 13px; }
    .share-card-highlight { padding: 14px; }
    .share-card-footer { align-items: flex-start; padding: 22px 16px; }
    .share-card-footer strong { font-size: 20px; }
    .task-overview { grid-template-columns: 1fr; }
    .wordbook-toolbar { flex-direction: column; }
    .wordbook-toolbar .secondary-btn { width: 100%; }
    .plan-row,
    .weekly-meta-grid { grid-template-columns: 1fr; }
    .ocr-import-card { flex-direction: column; align-items: stretch; }
    .ocr-import-actions .secondary-btn { width: 100%; }
    .import-drafts-head,
    .import-draft-item {
        flex-direction: column;
        align-items: stretch;
    }
    .import-draft-side {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    .supplemental-head,
    .supplemental-item,
    .supplemental-practice-head {
        flex-direction: column;
        align-items: stretch;
    }
    .supplemental-item .secondary-btn,
    .supplemental-actions .primary-btn,
    .supplemental-actions .secondary-btn {
        width: 100%;
    }
    .rate-grid { grid-template-columns: 1fr; }
    .choice-options { grid-template-columns: 1fr; }
    .spell-form { grid-template-columns: 1fr; }
}

@media (max-width: 460px) {
    .growth-summary { grid-template-columns: 1fr; }
    .growth-badge { width: 100%; }
    .share-card-footer { flex-direction: column; }
}
