:root {
    --ink: #17202a;
    --muted: #667085;
    --line: #d9e2ec;
    --panel: #ffffff;
    --surface: #ffffff;
    --page: #f4f7fb;
    --primary: #2454d6;
    --primary-strong: #163aa2;
    --accent: #0f8b8d;
    --warn: #b45f06;
    --danger: #b42318;
    --soft-blue: #eaf1ff;
    --soft-green: #e7f6f2;
    --shadow: 0 16px 40px rgba(24, 39, 75, 0.10);
    --workbench-line: #d9e0ea;
    --workbench-shadow: 0 10px 28px rgba(16, 24, 40, 0.055);
    --workbench-shadow-strong: 0 14px 34px rgba(16, 24, 40, 0.075);
    --article-workbench-height: 820px;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--ink);
    background: var(--page);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

.app-container {
    max-width: 1440px;
    padding-left: 24px;
    padding-right: 24px;
}

.app-nav {
    min-height: 64px;
    background:
        linear-gradient(90deg, rgba(36, 84, 214, 0.08), rgba(15, 139, 141, 0.10)),
        #ffffff;
    border-bottom: 1px solid #c9d7ef;
    box-shadow: 0 8px 22px rgba(36, 84, 214, 0.08);
}

.app-nav .navbar-collapse {
    min-width: 0;
}

.app-nav .navbar-nav {
    align-items: center;
    flex-wrap: nowrap;
    gap: 2px;
    min-height: 42px;
}

.nav-label-en {
    display: none;
}

html[lang="en"] .nav-label-zh {
    display: none;
}

html[lang="en"] .nav-label-en {
    display: inline;
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 40px;
    color: #17202a;
    font-weight: 820;
    text-decoration: none;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
}

.brand-logo img {
    display: block;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    filter: drop-shadow(0 9px 16px rgba(66, 133, 244, 0.18));
}

.navbar-brand:hover,
.navbar-brand:focus {
    color: #163aa2;
}

.app-nav .nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    margin-left: 4px;
    padding: 7px 12px;
    border-radius: 8px;
    color: #475467;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.language-switcher-item {
    display: flex;
    align-items: center;
    margin-left: 14px;
}

.language-switcher {
    display: inline-flex;
    align-items: center;
    gap: 0;
    min-height: 28px;
    padding: 1px;
    border: 0;
    border-radius: 8px;
    background: #f6f8fb;
    box-shadow: none;
}

.language-switcher button {
    min-width: 24px;
    min-height: 24px;
    padding: 2px 4px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 780;
    line-height: 1;
    letter-spacing: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.language-switcher button.active {
    background: #eef4ff;
    color: var(--primary-strong);
    box-shadow: none;
}

.language-switcher button:not(.active):hover {
    background: #f6f8fb;
    color: var(--primary);
}

.app-nav .nav-link.active,
.app-nav .nav-link:hover {
    background: #eaf1ff;
    color: var(--primary-strong);
}

.app-nav .navbar-toggler {
    border-color: #b8c7e6;
}

.app-nav .navbar-toggler-icon {
    filter: none;
}

@media (min-width: 1280px) {
    .app-nav .navbar-collapse {
        flex: 1 1 auto;
    }

    .app-nav-list {
        width: 100%;
        justify-content: flex-end;
    }

    .language-switcher-item {
        flex: 0 0 52px;
        width: 52px;
    }

    .account-menu-item {
        flex: 0 0 148px;
        margin-left: 10px;
        width: 148px;
    }
}

.app-main {
    flex: 1;
}

.workspace-band {
    padding: 28px 0 36px;
}

.workspace-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: end;
    margin-bottom: 22px;
}

.workspace-header h1,
.tool-panel h2 {
    margin: 0;
    line-height: 1.1;
    font-weight: 780;
}

.workspace-header h1 {
    font-size: 28px;
    max-width: 980px;
}

.tool-panel h2 {
    font-size: 21px;
}

.section-kicker {
    margin: 0 0 6px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 750;
    text-transform: uppercase;
}

.status-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.status-strip span,
.status-pill,
.time-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    color: #344054;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.status-pill.online {
    color: #027a48;
    border-color: #abefc6;
    background: #ecfdf3;
}

.status-pill.offline {
    color: #b42318;
    border-color: #fecdca;
    background: #fef3f2;
}

.workspace-meta-strip {
    align-items: center;
    gap: 0;
    max-width: 620px;
    padding: 0;
    color: #536273;
}

.workspace-meta-strip span {
    position: relative;
    min-height: 22px;
    padding: 0 0 0 14px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font-size: 12px;
    font-weight: 720;
    line-height: 1.35;
    white-space: nowrap;
}

.workspace-meta-strip span::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #2dd4bf;
    transform: translateY(-50%);
}

.workspace-meta-strip span + span {
    margin-left: 16px;
}

.tool-panel {
    height: 100%;
    padding: 24px;
    border: 1px solid var(--workbench-line);
    border-radius: 10px;
    background: var(--panel);
    box-shadow: var(--workbench-shadow);
}

.input-panel {
    background: #ffffff;
}

.result-panel {
    background: #ffffff;
    border-color: #cfd8e6;
    box-shadow: var(--workbench-shadow-strong);
}

.tool-panel-spacious {
    padding: 24px;
}

.ui-small-text {
    font-size: 13px;
}

.table-responsive {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-gutter: stable;
    touch-action: pan-x pan-y;
    border-radius: 8px;
    box-shadow: inset -12px 0 14px -16px rgba(15, 23, 42, 0.55);
}

.table-responsive table {
    width: 100%;
    margin-bottom: 0;
}

.table-responsive th {
    white-space: nowrap;
}

#loadingSpinner,
#resultsContent,
#articleLoadingSpinner,
#articleResultsContent,
#corpusSavedPill,
#tooltip {
    display: none;
}

.status-pill-saved {
    color: #027a48;
    border-color: #6ce9a6;
}

.corpus-filter-level {
    width: 140px;
}

.corpus-filter-year {
    width: 130px;
}
.corpus-filter-topic {
    width: 220px;
}

.vocab-pos-code {
    font-size: 12px;
}

.legend-dot-cet4 {
    background: #3b82f6;
}

.legend-dot-cet6 {
    background: #22c55e;
}

.legend-dot-other {
    background: #94a3b8;
}

.legend-dot-difficulty {
    background: #f59e0b;
}

.admin-login-wrap {
    min-height: calc(100vh - 128px);
    display: grid;
    place-items: center;
    padding: 32px 16px;
}

.admin-login-panel {
    width: min(420px, 100%);
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.admin-login-panel h1 {
    margin-bottom: 8px;
    font-size: 24px;
}

.admin-login-error {
    font-size: 13px;
}

.admin-batch-progress {
    height: 8px;
}

.topic-legend {
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    text-align: left;
}

.topic-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 28px;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: #344054;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.25;
}

.topic-legend-dot {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    border-radius: 50%;
}

.topic-legend-label {
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topic-donut-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 300px;
    overflow: visible;
}

.topic-donut-figure {
    flex: 0 0 auto;
    line-height: 0;
}

.topic-donut-figure svg {
    display: block;
    max-width: 100%;
    height: auto;
}

#topicDonut {
    text-align: center;
}

.sent-explain-toggle {
    margin-top: 6px;
    cursor: pointer;
}

.sent-explain-label {
    font-size: 11px;
}

.sentence-detail-meta-spaced {
    margin-top: 6px;
}

.corpus-empty-icon {
    margin-bottom: 12px;
    font-size: 40px;
}

.panel-heading,
.result-topline,
.sample-header,
.action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.form-label {
    margin-top: 18px;
    color: #344054;
    font-size: 13px;
    font-weight: 700;
}

.sentence-box {
    min-height: 190px;
    resize: vertical;
    border-color: #d0d5dd;
    border-radius: 8px;
    background: #fbfcfe;
    font-size: 15px;
    line-height: 1.6;
    transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.sentence-box:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(36, 84, 214, 0.12);
}

.sentence-input-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.switch-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #344054;
    font-weight: 650;
    line-height: 1.25;
}

.switch-line input {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    margin: 0;
}

.sentence-stats {
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

.corpus-save-quota {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}

.corpus-save-quota.is-exhausted {
    color: #b42318;
}

.corpus-save-quota.is-unlimited {
    color: #027a48;
}

.sample-area {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #edf0f4;
}

.home-sample-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid #dce8fb;
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(36, 84, 214, 0.07), rgba(15, 139, 141, 0.08)),
        #fbfdff;
}

.sample-entry-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.sample-header {
    align-items: center;
    margin-bottom: 12px;
}

.sample-title {
    min-width: 0;
}

.sample-title span {
    display: block;
    color: #344054;
    font-size: 13px;
    font-weight: 750;
}

.sample-title small {
    display: block;
    margin-top: 3px;
    color: #667085;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.35;
}

.sample-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: min(100%, 320px);
}

.sample-controls .form-select {
    max-width: 130px;
    border-radius: 8px;
    color: #344054;
    font-size: 12px;
    font-weight: 700;
}

.sample-run-btn {
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid #1b65d8;
    border-radius: 8px;
    background:
        linear-gradient(135deg, #2454d6, #0f8b8d);
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    box-shadow: 0 10px 22px rgba(36, 84, 214, 0.18);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, filter 0.15s ease;
}

.sample-run-btn:hover,
.sample-run-btn:focus {
    border-color: #0f8b8d;
    box-shadow: 0 12px 26px rgba(15, 139, 141, 0.22);
    filter: saturate(1.06);
    outline: 3px solid rgba(36, 84, 214, 0.14);
    outline-offset: 1px;
    transform: translateY(-1px);
}

.sample-library-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid #b7c8ea;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
    color: #163aa2;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.sample-library-link:hover,
.sample-library-link:focus {
    background: #ffffff;
    border-color: #2454d6;
    color: #0f3c9e;
    box-shadow: 0 10px 20px rgba(36, 84, 214, 0.12);
    outline: 3px solid rgba(36, 84, 214, 0.10);
    outline-offset: 1px;
    transform: translateY(-1px);
}

.sample-entry-actions .sample-run-btn::after,
.sample-entry-actions .sample-library-link::after,
.example-sample-card .sample-library-link::after {
    content: ">";
    margin-left: 8px;
    font-weight: 900;
}

.sample-chips {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.sample-chip {
    min-height: 112px;
    padding: 12px;
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    background: #ffffff;
    color: #182230;
    text-align: left;
    width: 100%;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.sample-chip strong,
.sample-chip span,
.sample-chip small {
    display: block;
    min-width: 0;
}

.sample-chip strong {
    width: fit-content;
    max-width: 100%;
    padding: 2px 7px;
    border-radius: 999px;
    background: #f2f4f7;
    color: #344054;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
}

.sample-chip span {
    display: -webkit-box;
    margin-top: 9px;
    color: #182230;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.sample-chip small {
    margin-top: 7px;
    color: #667085;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.35;
}

.sample-chip:hover,
.sample-chip:focus {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 6px 14px rgba(16, 24, 40, 0.08);
    outline: 3px solid rgba(52, 64, 84, 0.08);
    outline-offset: 1px;
    transform: translateY(-1px);
}

.action-row {
    margin-top: 22px;
}

.examples-header {
    align-items: end;
}

.examples-intro {
    max-width: 620px;
    margin: 8px 0 0;
    color: #667085;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.6;
}

.examples-panel {
    margin-top: 8px;
}

.example-sample-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.example-sample-card {
    min-width: 0;
    padding: 16px;
    border: 1px solid #dce5f3;
    border-radius: 8px;
    background:
        linear-gradient(180deg, #ffffff, #fbfdff);
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.045);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.example-sample-card:hover {
    border-color: #b7c8ea;
    box-shadow: 0 14px 30px rgba(36, 84, 214, 0.085);
    transform: translateY(-1px);
}

.example-sample-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.example-sample-head strong {
    min-width: 0;
    color: #182230;
    font-size: 13px;
    font-weight: 800;
}

.example-sample-head span {
    flex: 0 0 auto;
    padding: 2px 7px;
    border-radius: 8px;
    background: #eaf1ff;
    color: #163aa2;
    font-size: 11px;
    font-weight: 750;
}

.example-sample-card p {
    margin: 12px 0 8px;
    color: #182230;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.55;
}

.example-sample-card small {
    display: block;
    min-height: 32px;
    color: #667085;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.4;
}

.example-sample-card .sample-library-link {
    margin-top: 12px;
    background: #f7fbff;
}

.action-row .btn-outline-secondary {
    min-width: 92px;
}

.action-row .btn-primary {
    min-width: 132px;
}

.btn {
    --bs-btn-padding-x: 14px;
    --bs-btn-padding-y: 8px;
    --bs-btn-border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 0;
    box-shadow: 0 2px 7px rgba(24, 39, 75, 0.06);
    transition:
        background 0.16s ease,
        border-color 0.16s ease,
        color 0.16s ease,
        box-shadow 0.16s ease,
        transform 0.16s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(24, 39, 75, 0.08);
}

.btn:focus-visible {
    outline: 3px solid rgba(36, 84, 214, 0.20);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(36, 84, 214, 0.10);
}

.btn:disabled,
.btn.disabled {
    transform: none;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.58;
}

.btn-sm {
    --bs-btn-padding-x: 10px;
    --bs-btn-padding-y: 5px;
    min-height: 28px;
    font-size: 12px;
    font-weight: 800;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(36, 84, 214, 0.18);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--primary-strong);
    border-color: var(--primary-strong);
    color: #ffffff;
    box-shadow: 0 9px 18px rgba(36, 84, 214, 0.22);
}

.btn-outline-primary {
    background: #f5f8ff;
    border-color: #b9c9ec;
    color: var(--primary-strong);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: #eaf1ff;
    border-color: var(--primary);
    color: var(--primary-strong);
    box-shadow: 0 6px 14px rgba(36, 84, 214, 0.13);
}

.btn-outline-secondary {
    background: #ffffff;
    border-color: #cfd8e6;
    color: #344054;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background: #f6f8fb;
    border-color: #98a7bc;
    color: #182230;
    box-shadow: 0 6px 14px rgba(24, 39, 75, 0.10);
}

.btn-outline-danger {
    background: #fff8f7;
    border-color: #f4b5b0;
    color: var(--danger);
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
    background: #fee4e2;
    border-color: #f97066;
    color: #912018;
    box-shadow: 0 6px 14px rgba(180, 35, 24, 0.13);
}

.btn-close {
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 999px;
    background-color: #f8fafc;
    border: 1px solid #d8e1ee;
    background-size: 10px;
    opacity: 1;
    transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.btn-close:hover,
.btn-close:focus {
    background-color: #eef4ff;
    border-color: #b9c9ec;
    box-shadow: 0 5px 12px rgba(36, 84, 214, 0.12);
    transform: translateY(-1px);
}

.result-panel {
    min-height: 540px;
}

.empty-state,
.loading-state {
    display: flex;
    height: 100%;
    min-height: 420px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--muted);
}

.result-panel .empty-state,
.result-panel .loading-state {
    border-radius: 10px;
    background: #fbfcfe;
}

.empty-state h2 {
    color: var(--ink);
    margin-bottom: 8px;
    font-weight: 800;
}

.empty-state p {
    max-width: 520px;
    margin: 0;
}

.loading-state p {
    margin: 12px 0 0;
    font-weight: 700;
}

.error-main {
    min-height: calc(100vh - 88px);
    display: flex;
    align-items: center;
}
.error-shell {
    max-width: 720px;
    margin: 0 auto;
    padding: 48px 0;
    text-align: center;
}
.error-code {
    margin: 0;
    font-size: clamp(64px, 12vw, 132px);
    line-height: .9;
    font-weight: 900;
    color: var(--primary);
}
.error-shell h1 {
    margin: 14px 0 10px;
    font-size: clamp(28px, 5vw, 44px);
    font-weight: 900;
}
.error-message {
    max-width: 560px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.7;
}
.error-path {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    margin: 18px 0 0;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    font-size: 13px;
}
.error-path code {
    color: var(--ink);
    white-space: normal;
    overflow-wrap: anywhere;
}
.error-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.loading-estimate {
    display: block;
    max-width: 460px;
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
}

.loading-steps {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 520px;
    margin-top: 16px;
}

.loading-step {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.loading-step::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #c8d2e0;
}

.loading-step.is-active {
    border-color: #b9c9ec;
    background: #f4f7ff;
    color: var(--primary);
}

.loading-step.is-active::before {
    background: var(--primary);
    box-shadow: 0 0 0 4px rgba(36, 84, 214, 0.12);
}

.loading-step.is-done {
    color: var(--ink);
}

.loading-step.is-done::before {
    background: #16a34a;
}

.result-topline {
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

#resultsContent > .result-topline {
    padding-bottom: 0;
    border-bottom: 0;
}

.result-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

#sentenceType {
    font-size: 23px;
}

.summary-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 5px 14px;
    margin: 11px 0 9px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.summary-item {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    min-width: 0;
}

.summary-item span {
    display: inline;
    color: var(--muted);
    font-size: inherit;
    font-weight: 700;
    white-space: nowrap;
}

.summary-item span::after {
    content: ":";
}

.summary-item strong {
    display: inline;
    margin-top: 0;
    color: #182230;
    font-size: inherit;
    font-weight: 750;
    line-height: 1.15;
    white-space: normal;
    overflow-wrap: anywhere;
}

.confidence-warning {
    border: 1px solid rgba(217, 119, 6, 0.28);
    border-radius: 6px;
    margin: 0 0 8px;
    padding: 5px 8px;
    background: #fff7ed;
    color: #7c2d12;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.confidence-warning strong {
    display: inline;
    font-size: 11.5px;
    margin-right: 6px;
}

.confidence-warning p {
    display: inline;
    margin: 0;
    color: inherit;
    font-size: 11px;
    line-height: 1.25;
}

.confidence-warning-medium {
    border-color: rgba(37, 99, 235, 0.22);
    background: #eff6ff;
    color: #1e3a8a;
}

.learning-guide-panel {
    margin: 4px 0 18px;
    padding: 0;
    border: 0;
    background: transparent;
}

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

.learning-guide-head h3 {
    margin: 0;
    color: #182230;
    font-size: 17px;
    line-height: 1.25;
    font-weight: 780;
}

.reading-difficulty {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 1px 0 1px 9px;
    border-left: 3px solid #2dd4bf;
    background: transparent;
    color: #0f766e;
    font-size: 12px;
    font-weight: 780;
    line-height: 1.25;
    white-space: nowrap;
}

.sentence-core-grid {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) minmax(198px, 1.55fr) minmax(86px, 0.72fr) minmax(120px, 1fr);
    gap: 0;
    border-top: 1px solid #e4e7ec;
    border-right: 1px solid #e4e7ec;
    border-bottom: 1px solid #e4e7ec;
    border-left: 1px solid #e4e7ec;
}

.sentence-core-grid div {
    min-height: 74px;
    padding: 10px 12px;
    border: 0;
    border-left: 1px solid #e4e7ec;
    background: transparent;
}

.sentence-core-grid div:first-child {
    border-left: 0;
}

.sentence-core-grid span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.sentence-core-grid strong {
    display: block;
    color: #182230;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 780;
    overflow-wrap: break-word;
    white-space: pre-line;
}

.reading-tip-box {
    margin-top: 10px;
    padding: 1px 0 1px 10px;
    border: 0;
    border-left: 3px solid #99f6e4;
    background: transparent;
}

.reading-tip-box p {
    margin: 0;
    color: #184e4f;
    font-size: 11px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.explanation-focus-panel {
    margin: 0 0 18px;
    padding: 14px 16px;
    border: 1px solid #d5e3f8;
    border-radius: 8px;
    background: #f8fbff;
}

.explanation-focus-panel .section-heading-row {
    margin-bottom: 8px;
}

.analysis-feedback-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: #64748b;
    font-size: 11px;
    font-weight: 750;
    line-height: 1;
    padding: 6px 8px;
    white-space: nowrap;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.analysis-feedback-btn::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.12);
}

.analysis-feedback-btn:hover:not(:disabled) {
    border-color: #cbd5e1;
    background: #ffffff;
    color: #334155;
}

.analysis-feedback-btn:hover:not(:disabled)::before {
    background: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.analysis-feedback-btn:disabled {
    opacity: 0.72;
    cursor: default;
}

.analysis-feedback-btn.is-saved {
    border-color: #bbf7d0;
    color: #057647;
    background: #f0fdf4;
}

.analysis-feedback-btn.is-saved::before {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.analysis-save-btn,
.vocab-save-btn {
    border: 1px solid #bcd1f8;
    border-radius: 999px;
    background: #ffffff;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    padding: 6px 9px;
    white-space: nowrap;
}

.analysis-save-btn:hover:not(:disabled),
.vocab-save-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary-strong);
}

.analysis-save-btn:disabled,
.vocab-save-btn:disabled {
    opacity: 0.78;
}

.analysis-save-btn.is-saved,
.vocab-save-btn.is-saved {
    border-color: #99d5b8;
    background: #ecfdf3;
    color: #057647;
}

.parser-debug-panel {
    min-height: 160px;
    margin: 0;
    padding: 12px;
    border-radius: 8px;
    background: #101828;
    color: #d0d5dd;
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.explanation-focus-panel h3 {
    margin: 0;
    color: #182230;
    font-size: 17px;
    line-height: 1.3;
    font-weight: 800;
}

.explanation-focus-panel .explanation-container {
    padding: 0;
    border: 0;
    background: transparent;
}

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

.section-heading-row h3 {
    margin: 0;
    color: #182230;
    font-size: 17px;
    line-height: 1.25;
    font-weight: 780;
}

.step-meta {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #ffffff;
    color: #475467;
    font-size: 12px;
    font-weight: 750;
}

.advanced-result-panel {
    margin-top: 16px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.advanced-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid #cfd8e6;
    border-radius: 999px;
    background: #ffffff;
    color: #182230;
    text-align: left;
    font-weight: 800;
    box-shadow: 0 2px 7px rgba(24, 39, 75, 0.05);
    transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.advanced-toggle:hover,
.advanced-toggle:focus-visible {
    background: #f6f8fb;
    border-color: #b9c9ec;
    box-shadow: 0 6px 14px rgba(24, 39, 75, 0.09);
    transform: translateY(-1px);
}

.advanced-toggle:focus-visible {
    outline: 3px solid rgba(36, 84, 214, 0.14);
    outline-offset: 2px;
}

.advanced-toggle > span {
    flex: 0 0 auto;
    white-space: nowrap;
}

.advanced-toggle small {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.advanced-toggle::after {
    content: "";
    display: block;
    flex: 0 0 auto;
    width: 0;
    height: 0;
    margin: 0 6px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 6px solid currentColor;
    color: var(--muted);
    align-self: center;
}

.advanced-toggle.collapsed::after {
    content: "";
    border-top: 6px solid currentColor;
    border-bottom: 0;
}

.advanced-result-panel .collapse,
.advanced-result-panel .collapsing {
    padding-top: 14px;
}

.component-mark {
    display: inline;
    padding: 0 2px 3px;
    border-radius: 3px;
    font-weight: 720;
    text-underline-offset: 5px;
    text-decoration-thickness: 2px;
}

.mark-subject {
    color: #b42318;
    text-decoration-line: underline;
    text-decoration-style: double;
    text-decoration-color: #d92d20;
}

.mark-predicate {
    color: #9c5f00;
    text-decoration-line: underline;
    text-decoration-style: wavy;
    text-decoration-color: #f4b400;
}

.mark-object {
    color: #175cd3;
    text-decoration-line: underline;
    text-decoration-style: solid;
    text-decoration-color: #175cd3;
}

.mark-predicative {
    color: #7f56d9;
    text-decoration-line: underline;
    text-decoration-style: dashed;
    text-decoration-color: #7f56d9;
}

.mark-attributive {
    color: #0f766e;
}

.mark-attributive::before {
    content: "(";
    color: #0f766e;
    font-weight: 850;
}

.mark-attributive::after {
    content: ")";
    color: #0f766e;
    font-weight: 850;
}

.mark-adverbial {
    color: #854d0e;
}

.mark-adverbial::before {
    content: "[";
    color: #854d0e;
    font-weight: 850;
}

.mark-adverbial::after {
    content: "]";
    color: #854d0e;
    font-weight: 850;
}

.mark-complement {
    color: #c11574;
}

.mark-complement::before {
    content: "\3008";
    color: #c11574;
    font-weight: 850;
}

.mark-complement::after {
    content: "\3009";
    color: #c11574;
    font-weight: 850;
}

.legend-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 22px;
    padding: 0 5px;
    border-radius: 5px;
    background: #ffffff;
    font-style: normal;
    font-size: 12px;
    line-height: 1;
}

.result-tabs {
    gap: 6px;
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
}

.result-tabs .nav-link {
    min-height: 32px;
    padding: 6px 12px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: #ffffff;
    color: #475467;
    font-size: 13px;
    font-weight: 750;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.result-tabs .nav-link:hover,
.result-tabs .nav-link:focus-visible {
    background: #f5f8ff;
    border-color: #c8d6f2;
    color: var(--primary-strong);
    box-shadow: 0 4px 10px rgba(36, 84, 214, 0.10);
}

.result-tabs .nav-link.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 5px 12px rgba(36, 84, 214, 0.16);
}

.article-vocab-drawer-btn {
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.article-result-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0 10px;
}

.article-result-section-head h3 {
    margin: 0;
    color: #182230;
    font-size: 15px;
    font-weight: 840;
}

.result-tab-content {
    padding-top: 16px;
}

.explanation-container {
    min-height: 240px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
    color: #1f2937;
    line-height: 1.65;
    white-space: pre-line;
}

.analysis-table {
    margin-bottom: 0;
    min-width: 620px;
    border-color: var(--line);
}

.analysis-table th {
    color: #344054;
    background: #f8fafc;
    font-size: 12px;
    text-transform: uppercase;
}

.analysis-table td {
    vertical-align: top;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--soft-green);
    color: #096b5a;
    font-size: 12px;
    font-weight: 750;
}

.vocabulary-stats {
    margin-bottom: 14px;
}

.vocabulary-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.vocabulary-stat-grid div {
    min-height: 70px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
}

.vocabulary-stat-grid span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    text-transform: uppercase;
}

.vocabulary-stat-grid strong {
    display: block;
    margin-top: 6px;
    color: var(--ink);
    font-size: 22px;
    line-height: 1;
}

.vocab-level {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3538cd;
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

.vocab-level.cet4 {
    background: #ecfdf3;
    color: #027a48;
}

.vocab-level.cet6 {
    background: #fff7ed;
    color: #c2410c;
}

.vocab-level.both {
    background: #eff8ff;
    color: #175cd3;
}

.vocab-level.kaoyan {
    background: #f5f3ff;
    color: #6d28d9;
}

.vocab-level.out_of_list {
    background: #fef3f2;
    color: #b42318;
}

.article-box {
    min-height: clamp(460px, 58vh, 760px);
    resize: vertical;
    border-color: #cbd5e1;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.65;
}

.article-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 8px;
    margin-bottom: 4px;
}

.article-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0;
}

.article-metric-grid div {
    min-height: 76px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
}

.article-metric-grid span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    text-transform: uppercase;
}

.article-metric-grid strong {
    display: block;
    margin-top: 6px;
    color: var(--ink);
    font-size: 23px;
    line-height: 1;
}

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

.article-analysis-workbench {
    --article-workbench-height: clamp(600px, calc(100vh - 285px), 860px);
    display: grid;
    grid-template-columns: minmax(420px, 47fr) minmax(560px, 53fr);
    gap: 18px;
    align-items: stretch;
    min-height: var(--article-workbench-height);
}

.article-workbench-input,
.article-workbench-result {
    min-width: 0;
}

.article-analysis-workbench .tool-panel {
    height: 100%;
    min-height: var(--article-workbench-height);
}

.article-analysis-workbench .input-panel,
.article-analysis-workbench .result-panel {
    display: flex;
    flex-direction: column;
}

.article-analysis-workbench .input-panel {
    padding: 22px;
}

.article-analysis-workbench .result-panel {
    padding: 22px;
}

.article-analysis-workbench .panel-heading {
    margin-bottom: 12px;
}

.article-analysis-workbench #articleText {
    flex: 0 1 auto;
    height: clamp(340px, calc(100vh - 560px), 460px);
    min-height: 340px;
    max-height: 600px;
}

.article-analysis-workbench .action-row {
    margin-top: 14px;
}

.article-analysis-workbench .results-content {
    flex: 1 1 auto;
    min-height: 0;
}

.article-analysis-workbench .empty-state,
.article-analysis-workbench .loading-state {
    flex: 1 1 auto;
    min-height: 0;
}

.article-result-panel {
    min-height: 240px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
}

.article-result-panel h3 {
    margin: 0 0 12px;
    color: #182230;
    font-size: 16px;
    font-weight: 780;
}

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

.distribution-item {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) 120px 42px;
    gap: 10px;
    align-items: center;
}

.distribution-item strong,
.distribution-item span {
    display: block;
}

.distribution-item strong {
    color: #182230;
    font-size: 13px;
}

.distribution-item span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.distribution-bar {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e4e7ec;
}

.distribution-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
}

.reading-signal p {
    margin: 0 0 10px;
    color: #475467;
    line-height: 1.65;
}

.reading-signal p:last-child {
    margin-bottom: 0;
}

.article-stats-summary-panel {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 0;
    height: 26px;
    margin: 0 0 4px;
    padding: 0 !important;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
}

.article-stats-label {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    line-height: 1;
    text-transform: uppercase;
}

.article-summary-grid {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.article-summary-grid::-webkit-scrollbar {
    display: none;
}

.article-stat-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    min-height: 22px;
}

.article-stat-item span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 760;
    line-height: 1;
    white-space: nowrap;
}

.article-stat-item strong {
    color: #182230;
    font-size: 12px;
    line-height: 1;
    font-weight: 850;
}

@media (max-width: 576px) {
    .article-stats-summary-panel {
        height: 26px;
    }
}

@media (max-width: 1279px) {
    .app-nav.navbar-expand-lg .navbar-toggler {
        display: block;
    }

    .app-nav.navbar-expand-lg .navbar-collapse {
        flex-basis: 100%;
        flex-grow: 1;
    }

    .app-nav.navbar-expand-lg .navbar-collapse:not(.show) {
        display: none !important;
    }

    .app-nav.navbar-expand-lg .navbar-collapse.show,
    .app-nav.navbar-expand-lg .navbar-collapse.collapsing {
        display: block !important;
    }

    .app-nav.navbar-expand-lg .navbar-nav {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 0 4px;
    }

    .language-switcher-item {
        align-items: center;
        align-self: flex-start;
        margin: 12px 0 0;
        padding: 12px 0 0;
        border-top: 1px solid var(--line);
    }

    .language-switcher {
        justify-content: center;
        width: fit-content;
    }

    .account-menu-item {
        align-items: center;
        align-self: flex-start;
        justify-content: flex-start;
        gap: 8px;
        width: fit-content;
        max-width: 100%;
        margin: 8px 0 0;
        padding-left: 0;
    }

    .account-menu-item::before {
        display: none;
    }

    .account-menu-toggle {
        justify-content: center;
        width: auto;
        min-width: 112px;
        max-width: min(100%, 180px);
    }

    .account-panel {
        position: static;
        width: min(320px, calc(100vw - 32px));
        margin-top: 8px;
        box-shadow: var(--workbench-shadow);
    }
}

.reading-signal-tip {
    display: flex;
    align-items: center;
    min-height: 26px;
    margin: 0 0 10px;
    padding: 5px 8px;
    border-left: 3px solid var(--accent);
    border-radius: 6px;
    background: #f0fdfa;
    overflow-wrap: anywhere;
}

.reading-signal-tip p {
    margin: 0;
    color: #184e4f;
    font-size: 12px;
    line-height: 1.35;
}

.article-hidden-metrics {
    display: none;
}

.article-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 10px;
}

.article-panel-head h3 {
    margin-bottom: 0;
}

.article-panel-head span {
    font-size: 12px;
    font-weight: 750;
    text-transform: uppercase;
}

.word-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.word-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid #dbe4f0;
    border-radius: 999px;
    background: #ffffff;
}

.word-chip strong {
    color: #182230;
    font-size: 13px;
}

.word-chip em {
    color: var(--primary);
    font-size: 12px;
    font-style: normal;
    font-weight: 750;
}

.word-chip small {
    color: var(--muted);
    font-size: 12px;
}

.article-vocabulary-drawer {
    --bs-offcanvas-width: min(420px, 92vw);
}

.article-vocabulary-drawer .offcanvas-header {
    border-bottom: 1px solid var(--line);
}

.article-vocabulary-drawer .offcanvas-body {
    display: grid;
    align-content: start;
    gap: 14px;
    background: #f8fafc;
}

.article-drawer-section {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.article-drawer-section h3 {
    margin: 0 0 10px;
    color: #182230;
    font-size: 14px;
    font-weight: 820;
}

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

.article-sentences-pane .sentence-detail-list {
    max-height: clamp(420px, calc(var(--article-workbench-height, 820px) - 330px), 720px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 6px;
}

.article-sentences-pane .sentence-detail-list::-webkit-scrollbar {
    width: 8px;
}

.article-sentences-pane .sentence-detail-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #cbd5e1;
}

.article-sentences-pane .sentence-detail-list::-webkit-scrollbar-track {
    background: transparent;
}

.sentence-detail-item {
    position: relative;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
}

.sentence-detail-recommended {
    border-color: #93c5fd;
    background: #f8fbff;
    box-shadow: inset 3px 0 0 #3b82f6;
}

.close-reading-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8 !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    text-transform: none !important;
}

.sentence-detail-head,
.sentence-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}

.sentence-detail-head span,
.sentence-detail-meta span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    text-transform: uppercase;
}

.sentence-detail-head strong {
    color: var(--primary);
    font-size: 13px;
}

.sentence-detail-item p {
    margin: 10px 0;
    color: #182230;
    line-height: 1.65;
}

.syntax-tree-container {
    width: 100%;
    height: 430px;
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.syntax-tree-container svg {
    display: block;
    max-width: none;
}

.syntax-tree-scrollable {
    cursor: grab;
}

.legend-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
    color: #475467;
    font-size: 13px;
    font-weight: 650;
}

.legend-circle {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    margin-right: 5px;
}

.legend-circle.sentence { background-color: #4c6fff; }
.legend-circle.np { background-color: #16a085; }
.legend-circle.vp { background-color: #f97316; }
.legend-circle.noun { background-color: #dc2626; }
.legend-circle.verb { background-color: #0284c7; }
.legend-circle.adj { background-color: #7c3aed; }
.legend-circle.prep { background-color: #65a30d; }

.node circle {
    fill: #fff;
    stroke-width: 1.5px;
}

.node text {
    font: 12px sans-serif;
    paint-order: stroke;
    stroke: #ffffff;
    stroke-width: 3px;
    stroke-linejoin: round;
    fill: #1f2937;
}

.link {
    fill: none;
    stroke: #cbd5e1;
    stroke-width: 1.5px;
}

.footer {
    padding: 18px 0;
    color: #667085;
    background: #ffffff;
    border-top: 1px solid var(--line);
    font-size: 13px;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 18px;
}

.footer-primary {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
}

.footer-copy {
    display: inline;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.beian-links {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 20px;
}

.beian-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #749ae3;
    text-decoration: none;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    color: #667085;
    font-weight: 700;
    text-decoration: none;
}

.footer-link:hover,
.footer-link:focus,
.beian-link:hover,
.beian-link:focus {
    color: var(--primary);
    text-decoration: underline;
}

.about-hero {
    padding: 30px 0 18px;
}

.about-hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
    align-items: stretch;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.about-hero-copy {
    display: flex;
    min-height: 236px;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
}

.about-hero h1 {
    max-width: 820px;
    margin: 0;
    color: var(--ink);
    font-size: 28px;
    line-height: 1.1;
    font-weight: 780;
}

@media (min-width: 768px) {
    .workspace-header h1 {
        white-space: nowrap;
    }
}

.about-lead {
    max-width: 860px;
    margin: 16px 0 0;
    color: #475467;
    font-size: 17px;
    line-height: 1.7;
}

.about-lead-secondary {
    margin-top: 10px;
    font-size: 15px;
    line-height: 1.65;
}

.about-purpose-points {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.about-purpose-points span {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid #c9d7ef;
    border-radius: 999px;
    background: #f7faff;
    color: #2454d6;
    font-size: 12px;
    font-weight: 750;
}

.about-metrics,
.about-signal-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-self: stretch;
}

.about-metrics div {
    min-height: 72px;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
}

.about-metrics strong {
    display: block;
    color: var(--primary);
    font-size: 25px;
    line-height: 1;
}

.about-metrics span {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    text-transform: uppercase;
}

.about-signal-card {
    padding: 18px;
    border: 1px solid #cfd9ea;
    border-radius: 8px;
    background: #fbfdff;
}

.about-signal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #dbe4f0;
}

.about-signal-header span {
    min-width: 0;
    color: #344054;
    font-size: 13px;
    font-weight: 780;
    overflow-wrap: anywhere;
}

.about-signal-header strong {
    flex: 0 0 auto;
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
}

.about-signal-list {
    display: grid;
    gap: 14px;
    padding: 14px 0;
}

.about-signal-row {
    display: grid;
    grid-template-columns: minmax(104px, 0.7fr) minmax(0, 1fr) minmax(72px, auto);
    gap: 10px;
    align-items: center;
    min-width: 0;
}

.about-signal-row > span {
    min-width: 0;
    color: #475467;
    font-size: 12px;
    font-weight: 760;
    overflow-wrap: anywhere;
}

.about-signal-row em {
    min-width: 0;
    color: #667085;
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
    text-align: right;
    overflow-wrap: anywhere;
}

.about-signal-track {
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: #e7edf7;
}

.about-signal-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb 0%, #20b486 100%);
}

.about-signal-track-core span {
    width: 88%;
}

.about-signal-track-vocab span {
    width: 74%;
}

.about-signal-track-review span {
    width: 62%;
}

.about-signal-footer {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.about-signal-footer div {
    min-height: 64px;
    padding: 10px;
    border: 1px solid #dbe4f0;
    border-radius: 8px;
    background: #ffffff;
}

.about-signal-footer strong {
    display: block;
    color: var(--ink);
    font-size: 15px;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.about-signal-footer span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
    overflow-wrap: anywhere;
}

.about-content-band {
    padding: 8px 0 38px;
}

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

.about-panel {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(24, 39, 75, 0.07);
}

.about-panel-main,
.about-panel-wide {
    grid-column: 1 / -1;
}

.about-panel h2 {
    margin: 0 0 12px;
    color: #182230;
    font-size: 21px;
    line-height: 1.25;
    font-weight: 780;
}

.about-panel p {
    margin: 0 0 12px;
    color: #475467;
    line-height: 1.75;
}

.about-panel p:last-child {
    margin-bottom: 0;
}

.about-panel-visual {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.feature-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.feature-list li {
    position: relative;
    padding-left: 18px;
    color: #475467;
    line-height: 1.6;
}

.feature-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
}

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

.roadmap-grid div {
    min-height: 132px;
    padding: 14px;
    border: 1px solid #dbe4f0;
    border-radius: 8px;
    background: #fbfdff;
}

.roadmap-grid strong {
    display: block;
    margin-bottom: 8px;
    color: #182230;
    font-size: 15px;
}

.roadmap-grid span {
    display: block;
    color: #667085;
    font-size: 13px;
    line-height: 1.6;
}

.about-loop-chart {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.about-loop-chart div {
    position: relative;
    min-height: 106px;
    padding: 14px;
    border: 1px solid #dbe4f0;
    border-radius: 8px;
    background: #ffffff;
}

.about-loop-chart div:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -8px;
    width: 14px;
    height: 2px;
    background: #b8c7df;
}

.about-loop-chart span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 24px;
    margin-bottom: 12px;
    border-radius: 999px;
    background: #eff6ff;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
}

.about-loop-chart strong {
    display: block;
    color: var(--ink);
    font-size: 15px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

@media (max-width: 991px) {
    .workspace-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .status-strip {
        justify-content: flex-start;
    }

    .workspace-meta-strip {
        max-width: 100%;
    }

    .about-hero-inner,
    .about-grid,
    .about-loop-chart,
    .roadmap-grid,
    .article-section-grid {
        grid-template-columns: 1fr;
    }

    .article-analysis-workbench {
        --article-workbench-height: auto;
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .article-analysis-workbench .tool-panel {
        min-height: auto;
    }

    .article-analysis-workbench .result-panel {
        min-height: 480px;
    }

    .article-analysis-workbench .result-panel .empty-state,
    .article-analysis-workbench .result-panel .loading-state {
        min-height: 360px;
    }

    .article-analysis-workbench #articleText {
        min-height: clamp(420px, 56vh, 640px);
    }

    .article-sentences-pane .sentence-detail-list {
        max-height: none;
    }

    .notebook-workbench {
        grid-template-columns: 1fr;
    }

    .article-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sentence-core-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sentence-core-grid div {
        border-left: 0;
        border-top: 1px solid #e4e7ec;
    }

    .sentence-core-grid div:nth-child(-n + 2) {
        border-top: 0;
    }

    .sentence-core-grid div:nth-child(even) {
        border-left: 1px solid #e4e7ec;
    }
}

@media (max-width: 640px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .app-container {
        padding-left: 14px;
        padding-right: 14px;
    }

    .workspace-band {
        padding-top: 18px;
    }

    .workspace-header h1,
    .about-hero h1 {
        font-size: 24px;
    }

    .about-hero-inner {
        padding: 20px;
    }

    .about-hero-copy {
        min-height: 0;
        justify-content: flex-start;
    }

    .about-lead {
        font-size: 15px;
    }

    .about-signal-card {
        padding: 16px;
    }

    .about-signal-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .about-signal-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .about-signal-row em {
        text-align: left;
    }

    .about-signal-footer {
        grid-template-columns: 1fr;
    }

    .about-loop-chart div {
        min-height: auto;
    }

    .about-loop-chart div:not(:last-child)::after {
        top: auto;
        right: auto;
        bottom: -7px;
        left: 22px;
        width: 2px;
        height: 12px;
    }

    .tool-panel {
        padding: 16px;
        min-width: 0;
        max-width: 100%;
    }

    .workspace-header,
    .result-panel,
    .input-panel,
    .table-responsive,
    .modal-content,
    .offcanvas,
    .tab-content,
    .tab-pane {
        min-width: 0;
        max-width: 100%;
    }

    .table-responsive {
        border: 1px solid var(--line);
        border-radius: 8px;
    }

    .table-responsive table {
        min-width: 620px;
    }

    .workspace-header h1,
    .tool-panel h2,
    .modal-title,
    .offcanvas-title,
    .section-kicker,
    .status-strip:not(.workspace-meta-strip) span,
    .status-pill,
    .time-pill {
        overflow-wrap: anywhere;
    }

    .modal-dialog {
        margin-left: 10px;
        margin-right: 10px;
    }

    .offcanvas-end {
        width: min(100vw, 420px);
    }

    .page-tabs-nav {
        width: 100%;
        gap: 18px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .sample-header,
    .panel-heading,
    .action-row {
        align-items: stretch;
        flex-direction: column;
    }

    .home-sample-entry,
    .examples-header {
        align-items: stretch;
        flex-direction: column;
    }

    .home-sample-entry {
        gap: 8px;
        padding: 10px;
    }

    .home-sample-entry .sample-title span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .home-sample-entry .sample-title small {
        display: none;
    }

    .sample-entry-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    .sample-entry-actions .sample-run-btn,
    .sample-entry-actions .sample-library-link {
        width: 100%;
        min-height: 34px;
        padding: 7px 8px;
        font-size: 0;
        white-space: nowrap;
    }

    .sample-entry-actions .sample-run-btn::before,
    .sample-entry-actions .sample-library-link::before,
    .sample-entry-actions .sample-run-btn::after,
    .sample-entry-actions .sample-library-link::after {
        font-size: 11px;
        font-weight: 850;
    }

    .sample-entry-actions .sample-run-btn::before {
        content: "推荐示例";
    }

    .sample-entry-actions .sample-library-link::before {
        content: "示例库";
    }

    html[lang="en"] .sample-entry-actions .sample-run-btn::before {
        content: "Try Sample";
    }

    html[lang="en"] .sample-entry-actions .sample-library-link::before {
        content: "Library";
    }

    .result-topline {
        align-items: center;
        flex-direction: row;
    }

    .sample-controls {
        align-items: stretch;
        flex-direction: column;
        min-width: 0;
    }

    .sample-controls .form-select,
    .sample-run-btn {
        width: 100%;
        max-width: none;
    }

    .sample-chips {
        grid-template-columns: 1fr;
    }

    .example-sample-grid {
        grid-template-columns: 1fr;
    }

    .summary-grid {
        font-size: 12px;
        gap: 3px 10px;
    }

    .article-meta-grid,
    .article-metric-grid {
        grid-template-columns: 1fr;
    }

    .vocabulary-stat-grid {
        grid-template-columns: 1fr;
    }

    .learning-guide-head {
        flex-direction: column;
    }

    .sentence-core-grid {
        grid-template-columns: 1fr;
    }

    .sentence-core-grid div,
    .sentence-core-grid div:nth-child(even) {
        border-left: 0;
    }

    .sentence-core-grid div:nth-child(-n + 2) {
        border-top: 1px solid #e4e7ec;
    }

    .sentence-core-grid div:first-child {
        border-top: 0;
    }

    .advanced-toggle {
        align-items: center;
        flex-wrap: wrap;
        gap: 4px 10px;
        min-height: 44px;
        padding: 9px 12px;
        border-radius: 14px;
    }

    .advanced-toggle span {
        flex: 1 1 auto;
    }

    .advanced-toggle small {
        flex: 0 0 100%;
        order: 3;
        padding-right: 34px;
        font-size: 11px;
        line-height: 1.35;
    }

    .advanced-toggle::after {
        order: 2;
        margin: 0 6px;
    }

    .action-row .btn,
    .modal-footer .btn,
    .notebook-source-link {
        width: 100%;
    }

    .notebook-workbench-item {
        grid-template-columns: 1fr;
    }

    .notebook-workbench-item h3 {
        white-space: normal;
    }

    .pagination-row,
    .admin-pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .pagination-row > div,
    .admin-pagination > div {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .admin-account-table-head {
        display: none;
    }

    .admin-account-row {
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 6px;
        min-height: 0;
        padding: 10px 12px;
    }

    .admin-account-row > span {
        display: grid;
        grid-template-columns: 82px minmax(0, 1fr);
        gap: 8px;
        white-space: normal;
    }

    .admin-account-row > span::before {
        content: attr(data-label);
        color: var(--muted);
        font-weight: 850;
    }

    .admin-account-primary strong,
    .admin-account-primary small {
        white-space: normal;
    }

    .admin-account-row-actions {
        justify-content: stretch;
    }

    .admin-account-row-actions .btn {
        display: inline-flex;
        justify-content: center;
        width: 100%;
    }

    .admin-account-edit-grid {
        grid-template-columns: 1fr;
    }

    .admin-compensation-grid {
        grid-template-columns: 1fr;
    }
}

/* Consolidated page styles */

/* Page styles moved from admin.html */
.admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
}
.admin-section-security {
    order: 1;
}
.admin-section-audit {
    order: 2;
}
.admin-section-accounts {
    order: 3;
}
.admin-section-quality {
    order: 4;
}
.admin-section-corpus {
    order: 5;
}
.admin-section-vocabulary {
    order: 6;
}
.admin-compact-panel {
    padding: 16px 18px;
}
.admin-import-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
}
.import-zone {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
    min-height: 76px;
    text-align: left;
    background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(248,250,252,.88));
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.import-zone:hover {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 5%, transparent);
    transform: translateY(-1px);
}
.import-zone input[type=file] {
    display: none;
}
.import-zone label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    width: 100%;
    height: 100%;
    margin: 0;
}
.import-icon {
    display: inline-grid;
    grid-template-columns: repeat(3, 5px);
    align-items: end;
    gap: 3px;
    width: 34px;
    height: 34px;
    padding: 7px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--primary) 12%, white);
    color: var(--primary);
    flex: 0 0 auto;
}
.import-icon i {
    display: block;
    width: 5px;
    border-radius: 3px 3px 1px 1px;
    background: currentColor;
}
.import-icon i:nth-child(1) { height: 10px; opacity: .65; }
.import-icon i:nth-child(2) { height: 16px; opacity: .95; }
.import-icon i:nth-child(3) { height: 12px; opacity: .78; }
.import-label {
    display: block;
    font-weight: 800;
    margin-bottom: 2px;
}
.import-hint {
    display: block;
    font-size: 12px;
    color: var(--muted);
}
.admin-logout-item {
    display: flex;
    align-items: center;
    margin-left: 8px;
    padding-left: 10px;
    border-left: 1px solid rgba(180, 95, 6, 0.16);
}
.admin-logout-form {
    display: flex;
    align-items: center;
    margin: 0;
}
.admin-logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 25px;
    padding: 3px 9px;
    border: 1px solid #f4b5b0;
    border-radius: 999px;
    background: #fff8f7;
    color: #b42318;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 2px 7px rgba(180, 35, 24, 0.07);
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.admin-logout-btn:hover {
    background: #fee4e2;
    border-color: #f97066;
    color: #912018;
    box-shadow: 0 5px 12px rgba(180, 35, 24, 0.13);
    transform: translateY(-1px);
}
.admin-logout-btn:focus-visible {
    outline: 3px solid rgba(249, 112, 102, 0.28);
    outline-offset: 2px;
}
.admin-logout-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(180, 35, 24, 0.10);
}
.admin-logout-icon {
    position: relative;
    width: 11px;
    height: 11px;
    flex: 0 0 auto;
}
.admin-logout-icon::before {
    content: "";
    position: absolute;
    inset: 2px 1px 1px;
    border: 1.7px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
}
.admin-logout-icon::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    width: 1.8px;
    height: 6px;
    border-radius: 999px;
    background: currentColor;
    transform: translateX(-50%);
}
.admin-import-format {
    font-size: 12px;
    color: var(--muted);
}
.admin-import-format summary {
    cursor: pointer;
    color: var(--muted);
    font-weight: 700;
}
.admin-maintenance-actions {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--line);
}
.admin-maintenance-actions .admin-small-text {
    min-width: 0;
}
.admin-maintenance-actions .btn {
    flex: 0 0 auto;
}
.admin-section-title-sm {
    font-size: 18px;
    margin-bottom: 4px;
}
.admin-section-title {
    font-size: 20px;
    margin-bottom: 6px;
}
.admin-small-text {
    font-size: 13px;
}
.admin-import-errors {
    font-size: 12px;
}
.admin-pending-note {
    font-size: 13px;
}
.admin-panel-spacious {
    padding: 24px;
}
.admin-format-list {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    font-size: 13px;
}
#importResult {
    font-size: 13px;
}
.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}
.admin-toolbar .form-select,
.admin-toolbar .form-control {
    width: 150px;
}
.admin-toolbar .status-select {
    width: 170px;
}
.admin-toolbar .topic-select {
    width: 220px;
}
.admin-batch-status {
    display: none;
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    font-size: 13px;
}
.admin-batch-status-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    color: var(--muted);
}
.admin-batch-errors {
    margin: 8px 0 0;
    padding-left: 18px;
    color: #b42318;
    font-size: 12px;
}
.admin-batch-confirm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.admin-feedback {
    display: none;
    margin-bottom: 14px;
    font-size: 13px;
}
.admin-article-list {
    display: grid;
    gap: 12px;
}
.admin-account-list {
    display: grid;
    gap: 8px;
}
.admin-audit-list {
    display: grid;
    gap: 8px;
}
.admin-security-metrics {
    display: grid;
    gap: 12px;
}
.admin-security-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.admin-security-card {
    min-height: 88px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    display: grid;
    align-content: start;
    gap: 4px;
}
.admin-security-card span,
.admin-security-card small {
    color: var(--muted);
    font-size: 12px;
}
.admin-security-card strong {
    color: var(--ink);
    font-size: 22px;
    line-height: 1.1;
}
.admin-security-top-ip {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
}
.admin-security-top-head,
.admin-security-ip-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 38px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
}
.admin-security-top-head {
    background: #f8fafc;
}
.admin-security-top-head span {
    color: var(--muted);
    font-size: 12px;
}
.admin-security-ip-row:last-child {
    border-bottom: 0;
}
.admin-security-ip-row span {
    min-width: 0;
    color: var(--ink);
    font-size: 13px;
    overflow-wrap: anywhere;
}
.admin-security-ip-row strong {
    justify-self: end;
    color: var(--ink);
    font-size: 13px;
}
.admin-account-table,
.admin-audit-table {
    display: grid;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--panel);
}
.admin-account-table-head,
.admin-account-row,
.admin-audit-table-head,
.admin-audit-row {
    display: grid;
    grid-template-columns: minmax(140px, 1.05fr) minmax(180px, 1.25fr) 78px 112px 86px 92px 98px 72px;
    align-items: center;
    gap: 10px;
}
.admin-audit-table-head,
.admin-audit-row {
    grid-template-columns: minmax(130px, .9fr) minmax(150px, 1fr) minmax(130px, .9fr) 90px minmax(220px, 1.5fr);
}
.admin-account-table-head,
.admin-account-row {
    grid-template-columns: minmax(140px, 1.05fr) minmax(180px, 1.25fr) 78px 112px 86px 92px 98px 72px;
}
.admin-account-table-head,
.admin-audit-table-head {
    min-height: 34px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}
.admin-account-row,
.admin-audit-row {
    width: 100%;
    min-height: 46px;
    padding: 8px 12px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: #ffffff;
    color: var(--ink);
    text-align: left;
    transition: background 0.14s ease;
}

.admin-account-usage-section {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.admin-account-ops-section {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.admin-account-ops-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.admin-account-ops-summary span {
    padding: 4px 7px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.admin-compensation-grid {
    display: grid;
    grid-template-columns: minmax(130px, .8fr) 92px minmax(180px, 1.2fr);
    gap: 8px;
    margin-top: 9px;
}

.admin-account-usage-title {
    margin: 0;
    color: var(--ink);
    font-size: 13px;
    font-weight: 850;
}

.admin-account-usage-list {
    margin-top: 8px;
}

.admin-usage-table {
    display: grid;
    gap: 6px;
}

.admin-usage-row {
    display: grid;
    grid-template-columns: minmax(130px, .9fr) minmax(90px, .75fr) 72px 86px minmax(160px, 1fr);
    gap: 8px;
    align-items: center;
    padding: 8px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.admin-usage-row strong {
    color: var(--ink);
}

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

.admin-quality-grid {
    display: grid;
    grid-template-columns: minmax(280px, .9fr) minmax(0, 1.1fr);
    gap: 14px;
    align-items: start;
}

.admin-quality-form,
.admin-quality-list {
    display: grid;
    gap: 9px;
}

.admin-quality-form-row,
.admin-quality-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.admin-quality-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 9px;
}

.admin-quality-check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 31px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.admin-quality-card {
    display: grid;
    gap: 8px;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.admin-quality-card.is-golden {
    border-color: rgba(2, 122, 72, .28);
    background: #f6fef9;
}

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

.admin-quality-card-head > div {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    min-width: 0;
}

.admin-quality-card-head .form-select {
    width: 128px;
    flex: 0 0 auto;
}

.admin-quality-article-id,
.admin-quality-meta,
.admin-quality-result-row,
.admin-quality-resolution {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.admin-quality-source {
    margin: 0;
    color: var(--ink);
    font-size: 13px;
    line-height: 1.5;
}

.admin-quality-result-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.admin-quality-result-row strong {
    color: var(--ink);
}

.admin-quality-resolution {
    margin: 0;
    padding: 7px 8px;
    border-radius: 8px;
    background: #f8fafc;
}

@media (max-width: 980px) {
    .admin-quality-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .admin-coach-filter-row,
    .admin-quality-form-row,
    .admin-quality-toolbar,
    .admin-quality-result-row {
        grid-template-columns: 1fr;
    }

    .admin-quality-card-head {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-quality-card-head .form-select {
        width: 100%;
    }
}
.admin-account-row:last-child,
.admin-audit-row:last-child {
    border-bottom: 0;
}
.admin-account-row:hover,
.admin-audit-row:hover {
    background: #f8fbff;
}
.admin-account-row > span,
.admin-audit-row > span {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-account-primary strong {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: 13px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-account-primary small {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-account-row em,
.admin-audit-row em {
    display: inline-flex;
    max-width: 100%;
    padding: 3px 8px;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    background: #f8fbff;
    color: var(--primary);
    font-size: 11px;
    font-style: normal;
    font-weight: 820;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-account-row em.is-active,
.admin-audit-row em.is-active {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}
.admin-account-row em.is-disabled,
.admin-audit-row em.is-disabled {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}
.admin-account-row em.is-warning,
.admin-audit-row em.is-warning {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}
.admin-account-row-actions {
    display: flex;
    justify-content: flex-end;
}
.admin-account-modal-meta {
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 12px;
}
.admin-account-edit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.admin-account-edit-grid label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 760;
}
.admin-account-modal-check {
    align-content: end;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    min-height: 48px;
}

@media (max-width: 767px) {
    .admin-account-table-head,
    .admin-audit-table-head {
        display: none;
    }
    .admin-security-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-account-row,
    .admin-audit-row {
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 6px;
        min-height: 0;
        padding: 10px 12px;
    }

    .admin-account-row > span,
    .admin-audit-row > span {
        display: grid;
        grid-template-columns: 82px minmax(0, 1fr);
        gap: 8px;
        white-space: normal;
    }

    .admin-account-row > span::before,
    .admin-audit-row > span::before {
        content: attr(data-label);
        color: var(--muted);
        font-weight: 850;
    }

    .admin-account-primary strong {
        white-space: normal;
    }

    .admin-account-row-actions {
        justify-content: stretch;
    }

    .admin-account-row-actions .btn {
        display: inline-flex;
        justify-content: center;
        width: 100%;
    }

    .admin-account-edit-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .admin-security-grid {
        grid-template-columns: 1fr;
    }

    .admin-security-top-head,
    .admin-security-ip-row {
        grid-template-columns: minmax(0, 1fr) 64px;
    }
}
.admin-article-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: var(--panel);
}
.admin-article-card.has-word-count-warning {
    border-color: rgba(180, 95, 6, .38);
    background: #fffaf2;
}
.admin-article-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 8px;
}
.admin-article-title-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.admin-article-title {
    font-weight: 800;
}
.admin-article-meta {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 10px;
}
.admin-article-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    position: relative;
}
.admin-stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.admin-stat-row span {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
    color: var(--muted);
}
.admin-stat-row span.admin-stat-warning {
    border-color: rgba(180, 95, 6, .38);
    background: #fff3df;
    color: #9a4b00;
}
.admin-word-warning {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    position: relative;
    margin: 8px 0;
    padding: 7px 9px;
    border: 1px solid rgba(180, 95, 6, .24);
    border-radius: 8px;
    background: #fff7ea;
    color: #8a4400;
    font-size: 12px;
}
.admin-word-warning strong {
    color: #7c3f00;
}
.admin-word-warning .admin-confirm-popover {
    position: static;
    flex: 1 1 100%;
    white-space: normal;
}
.admin-word-warning .admin-confirm-popover::before {
    content: none;
}
.admin-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
}
.admin-article-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    font-size: 14px;
    line-height: 1.65;
    white-space: pre-wrap;
    resize: none;
}
.admin-article-edit-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 140px 120px minmax(190px, 240px);
    gap: 8px;
    margin-bottom: 10px;
}
.admin-article-edit-grid .form-label {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}
.admin-article-edit-grid .form-control,
.admin-article-edit-grid .form-select {
    min-height: 34px;
    padding-top: 5px;
    padding-bottom: 5px;
    font-size: 13px;
}
.admin-confirm-popover {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
    font-size: 12px;
    white-space: nowrap;
}
.admin-confirm-popover::before {
    content: "";
    position: absolute;
    right: 44px;
    bottom: -6px;
    width: 10px;
    height: 10px;
    background: var(--panel);
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    transform: rotate(45deg);
}
@media (max-width: 576px) {
    .admin-confirm-popover {
        left: 0;
        right: 0;
        width: auto;
        white-space: normal;
    }

    .admin-import-head,
    .admin-maintenance-actions,
    .admin-batch-status-head {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-panel-spacious,
    .admin-compact-panel {
        padding: 16px;
    }

    .admin-toolbar {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .admin-toolbar .form-select,
    .admin-toolbar .form-control,
    .admin-toolbar .status-select,
    .admin-toolbar .topic-select,
    .admin-toolbar .btn {
        width: 100%;
        min-width: 0;
    }

    .admin-article-card {
        padding: 12px;
    }

    .admin-article-title,
    .admin-article-meta {
        overflow-wrap: anywhere;
    }

    .admin-article-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .admin-article-actions .btn {
        width: 100%;
    }

    .admin-stat-row span {
        max-width: 100%;
    }
}
@media (max-width: 992px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
    .admin-logout-item {
        justify-content: flex-start;
        margin: 8px 0 0;
        padding: 8px 0 0;
        border-left: 0;
        border-top: 1px solid rgba(180, 95, 6, 0.16);
    }
    .language-switcher-item {
        align-items: center;
        align-self: flex-start;
        margin: 12px 0 0;
        padding: 12px 0 0;
        border-top: 1px solid var(--line);
    }
    .language-switcher {
        justify-content: center;
        width: fit-content;
    }
    .account-menu-item {
        align-items: center;
        align-self: flex-start;
        justify-content: flex-start;
        gap: 8px;
        width: fit-content;
        max-width: 100%;
        margin: 8px 0 0;
        padding-left: 0;
    }
    .account-menu-item::before {
        display: none;
    }
    .account-menu-toggle {
        justify-content: center;
        width: auto;
        min-width: 112px;
        max-width: min(100%, 180px);
    }
    .account-panel {
        position: static;
        width: min(320px, calc(100vw - 32px));
        margin-top: 8px;
        box-shadow: var(--workbench-shadow);
    }
    .admin-article-head {
        flex-direction: column;
    }
    .admin-article-actions {
        justify-content: flex-start;
    }
    .admin-article-edit-grid {
        grid-template-columns: 1fr;
    }
}

/* Page styles moved from articles.html */
/* ── Corpus list styles ── */
.corpus-article-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
    transition: box-shadow 0.15s;
}
.corpus-article-card:hover { box-shadow: 0 4px 12px rgba(24,39,75,0.08); }
.corpus-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 6px;
}
.corpus-card-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--ink);
}
.corpus-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.corpus-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: var(--soft-blue);
    color: var(--primary);
}
.corpus-topic-badge {
    max-width: 190px;
    overflow: hidden;
    background: #f0fdf4;
    color: #15803d;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.corpus-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.corpus-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
    min-width: 56px;
}
.corpus-stat strong { font-size: 16px; font-weight: 800; }
.corpus-stat span   { color: var(--muted); font-weight: 600; }
/* AI topic badge */
.topic-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
    vertical-align: middle;
}
/* Long sentence explanation */
.sent-explain-box {
    background: #f8fafc;
    border-left: 3px solid var(--primary);
    border-radius: 0 6px 6px 0;
    padding: 8px 12px;
    font-size: 12px;
    color: var(--ink);
    margin-top: 4px;
    line-height: 1.7;
}
.article-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 8px;
    margin-bottom: 4px;
}
.article-title-field {
    grid-column: 1 / -1;
}
.article-meta-grid .form-label,
label[for="articleText"] {
    margin-top: 0;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}
.article-meta-grid .form-control,
.article-meta-grid .form-select {
    min-height: 34px;
    padding-top: 5px;
    padding-bottom: 5px;
    font-size: 13px;
}
.article-box {
    min-height: clamp(460px, 58vh, 760px);
}
#pageTabs + .tab-content {
    min-height: calc(100vh - 310px);
}
#tabAnalyze,
#tabAnalyze > .article-analysis-workbench {
    min-height: inherit;
}
#tabAnalyze .input-panel {
    display: flex;
    flex-direction: column;
}
#articleText {
    flex: 1 1 auto;
}
.article-options {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin-top: 8px;
}
.article-options .switch-line {
    flex: 0 0 auto;
}
.article-options .switch-line span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
}
.article-options .corpus-save-quota {
    display: inline-flex;
    align-items: center;
    flex: 1 1 180px;
    min-width: 0;
    min-height: 18px;
    line-height: 1.25;
    white-space: normal;
}
.article-options .sentence-stats {
    margin-left: 0;
    text-align: right;
    white-space: nowrap;
}
.sent-explain-toggle:hover small { text-decoration: underline; }
.page-tabs-nav {
    display: inline-flex;
    align-items: flex-end;
    gap: 24px;
    padding: 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    margin-bottom: 14px;
}
.page-tabs-nav .nav-link {
    position: relative;
    min-height: 32px;
    border: 0;
    border-radius: 0;
    padding: 0 0 9px;
    background: transparent;
    font-size: 14px;
    font-weight: 800;
    color: var(--muted);
    transition: color 0.16s ease;
}
.page-tabs-nav .nav-link:hover {
    color: var(--primary-strong);
}
.page-tabs-nav .nav-link.active {
    color: var(--primary);
    background: transparent;
    box-shadow: none;
}
.page-tabs-nav .nav-link.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    border-radius: 999px;
    background: var(--primary);
}
.corpus-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    align-items: center;
}
#corpusListArea { min-height: 200px; }
.snapshot-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    background: #dcfce7;
    color: #15803d;
}
.no-snapshot-badge {
    background: #f1f5f9;
    color: #64748b;
}
.student-article-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    line-height: 1.75;
    font-size: 15px;
    color: var(--ink);
}
.article-view-modal-content {
    height: min(82vh, 760px);
}
.article-view-modal-content .modal-body {
    display: flex;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
}
.admin-article-modal-content .modal-body {
    gap: 0;
}
.corpus-snapshot-overview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}
.corpus-snapshot-stat {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}
.corpus-snapshot-stat strong {
    order: 2;
    color: var(--ink);
    font-size: 13px;
    font-weight: 820;
    line-height: 1.1;
}
.corpus-snapshot-stat em {
    color: var(--muted);
    font-size: 11px;
    font-style: normal;
    font-weight: 750;
}
.corpus-snapshot-signal {
    margin-bottom: 8px;
    padding: 8px 10px;
    font-size: 12px;
}
.corpus-reader-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    padding-top: 2px;
}
.corpus-reader-toolbar strong {
    display: block;
    color: var(--ink);
    font-size: 13px;
    font-weight: 760;
}
.corpus-reading-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
    gap: 16px;
    align-items: start;
}
.corpus-reading-text {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}
.corpus-reading-text p {
    margin: 0 0 16px;
    color: var(--ink);
    font-size: 15px;
    line-height: 1.9;
}
.corpus-reading-text p:last-child {
    margin-bottom: 0;
}
.corpus-reading-sentence {
    display: inline;
}
.corpus-reading-highlight {
    display: inline;
    padding: 1px 4px;
    border: 0;
    border-bottom: 2px solid #93c5fd;
    border-radius: 4px;
    background: #eff6ff;
    color: var(--ink);
    font: inherit;
    line-height: inherit;
    text-align: left;
}
.corpus-reading-highlight:hover {
    background: #dbeafe;
}
.corpus-reading-highlight sup {
    margin-right: 3px;
    color: var(--primary);
    font-size: 10px;
    font-weight: 850;
}
.corpus-reading-detail {
    display: block;
    margin: 8px 0 12px;
    padding: 10px 12px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #f8fbff;
}
.corpus-reading-detail-head,
.corpus-reading-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.corpus-reading-detail-head strong {
    color: var(--primary);
    font-size: 13px;
}
.corpus-reading-detail-head em,
.corpus-reading-detail-meta {
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
    font-weight: 720;
}
.corpus-reading-detail .sent-explain-box {
    display: block;
    margin-top: 8px;
}
.corpus-reading-detail-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.corpus-notebook-feedback {
    display: inline-flex;
    margin-left: 10px;
    font-weight: 760;
}
.corpus-key-panel {
    position: sticky;
    top: 12px;
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}
.corpus-key-panel h3 {
    margin: 0 0 4px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 820;
}
.corpus-key-item {
    display: grid;
    gap: 3px;
    width: 100%;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: inherit;
    text-align: left;
}
.corpus-key-item:hover {
    border-color: #93c5fd;
    background: #f8fbff;
}
.corpus-key-item span,
.corpus-key-item em {
    color: var(--muted);
    font-size: 11px;
    font-style: normal;
    font-weight: 720;
}
.corpus-key-item strong {
    color: var(--primary);
    font-size: 12px;
}
.corpus-key-item small {
    display: -webkit-box;
    overflow: hidden;
    color: var(--ink);
    font-size: 12px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.account-menu-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-left: 10px;
    padding-left: 10px;
}

.account-menu-item::before {
    content: "";
    display: block;
    width: 1px;
    height: 24px;
    background: #d9e2ec;
}

.account-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: 112px;
    min-height: 32px;
    padding: 4px 10px 4px 5px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    color: var(--ink);
    font-size: 13px;
    font-weight: 820;
    line-height: 1;
    box-shadow: var(--workbench-shadow);
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.account-menu-toggle:hover {
    border-color: rgba(37, 99, 235, 0.28);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.account-menu-toggle:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.22);
    outline-offset: 2px;
}

.account-avatar {
    flex: 0 0 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
}

.account-menu-label {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 1060;
    display: none;
    width: min(320px, calc(100vw - 28px));
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.account-panel.is-open {
    display: block;
}

.account-form,
.account-signed-in {
    display: grid;
    gap: 11px;
    min-width: 0;
}

.account-panel-title {
    margin: 0 0 4px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 850;
}

.account-panel-copy {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.account-entitlement-summary {
    display: grid;
    gap: 6px;
    padding: 9px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
}

.account-entitlement-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.account-entitlement-row strong {
    color: var(--ink);
    font-weight: 850;
    text-align: right;
}

.account-mode-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.account-mode-switch button {
    min-height: 28px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.account-mode-switch button.is-active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 1px 5px rgba(15, 23, 42, 0.08);
}

.account-field {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 760;
}

.account-password-policy {
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.35;
}

.account-menu-link {
    display: grid;
    gap: 3px;
    padding: 10px 11px;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: #f8fbff;
    color: var(--ink);
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.account-menu-link:hover {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: var(--primary-strong);
}

.account-menu-link span {
    font-size: 13px;
    font-weight: 850;
}

.account-menu-link small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.45;
}

.account-text-button {
    justify-self: start;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.3;
}

.account-text-button:hover {
    color: var(--primary-strong);
    text-decoration: underline;
}

.account-feedback {
    min-width: 0;
    max-width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 760;
    line-height: 1.45;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.account-feedback-success {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.account-feedback-warning {
    border: 1px solid #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.account-feedback-danger {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.account-global-feedback {
    position: fixed;
    top: 72px;
    right: 18px;
    z-index: 1080;
    display: block;
    max-width: min(360px, calc(100vw - 32px));
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 780;
    line-height: 1.45;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    overflow-wrap: anywhere;
}

.account-global-feedback.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 992px) {
    .language-switcher-item {
        align-items: center;
        align-self: flex-start;
        margin: 12px 0 0;
        padding: 12px 0 0;
        border-top: 1px solid var(--line);
    }
    .language-switcher {
        justify-content: center;
        width: fit-content;
    }
    .account-menu-item {
        align-items: center;
        align-self: flex-start;
        justify-content: flex-start;
        gap: 8px;
        width: fit-content;
        max-width: 100%;
        margin: 8px 0 0;
        padding-left: 0;
    }
    .account-menu-item::before {
        display: none;
    }
    .account-menu-toggle {
        justify-content: center;
        width: auto;
        min-width: 112px;
        max-width: min(100%, 180px);
    }
    .account-panel {
        position: static;
        width: min(320px, calc(100vw - 32px));
        margin-top: 8px;
        box-shadow: var(--workbench-shadow);
    }
}

@media (max-width: 1279px) {
    .language-switcher-item {
        align-items: center;
        align-self: flex-start;
        margin: 12px 0 0;
        padding: 12px 0 0;
        border-top: 1px solid var(--line);
    }

    .language-switcher {
        justify-content: center;
        width: fit-content;
    }

    .account-menu-item {
        flex-direction: column;
        align-items: flex-start;
        align-self: flex-start;
        justify-content: flex-start;
        width: fit-content;
        max-width: 100%;
        gap: 8px;
        margin: 8px 0 0;
        padding-left: 0;
    }

    .account-menu-item::before {
        display: none;
    }

    .account-menu-toggle {
        justify-content: center;
        width: auto;
        max-width: min(100%, 180px);
        min-height: 36px;
    }

    .account-menu-label {
        flex: 0 1 auto;
        max-width: none;
    }

    .account-panel {
        position: static;
        width: min(320px, calc(100vw - 32px));
        margin-top: 0;
        box-shadow: var(--workbench-shadow);
    }

    .account-global-feedback {
        top: 64px;
        right: 12px;
        left: 12px;
        max-width: none;
    }
}

.notebook-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}

.notebook-status-filter {
    max-width: 180px;
}

.notebook-command-center {
    display: grid;
    grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.1fr);
    gap: 14px;
    align-items: stretch;
    margin-bottom: 16px;
}

.notebook-today-panel {
    display: grid;
    gap: 12px;
    min-width: 0;
    padding: 16px;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.notebook-today-head,
.notebook-insights-head,
.notebook-assets-head {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    justify-content: space-between;
}

.notebook-today-head h2,
.notebook-insights-head h2,
.notebook-assets-head h2 {
    margin: 0;
    color: var(--ink);
    font-size: 17px;
    font-weight: 860;
    line-height: 1.2;
}

.notebook-today-link {
    align-self: flex-start;
}

.notebook-primary-metric {
    display: grid;
    gap: 4px;
    align-content: center;
    min-height: 112px;
    padding: 14px 0;
}

.notebook-primary-metric span {
    color: var(--ink);
    font-size: 54px;
    font-weight: 920;
    line-height: 0.95;
}

.notebook-primary-metric small {
    color: var(--muted);
    font-size: 13px;
    font-weight: 820;
}

.notebook-learning-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.notebook-learning-metric {
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.notebook-learning-metric span {
    display: block;
    overflow: hidden;
    color: var(--ink);
    font-size: 20px;
    font-weight: 900;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notebook-learning-metric small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 780;
}

.notebook-coach {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.notebook-coach-head {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    justify-content: space-between;
}

.notebook-coach-head h2 {
    margin: 0;
    color: var(--ink);
    font-size: 16px;
    font-weight: 850;
}

.notebook-coach-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.notebook-coach-item {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 8px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.notebook-coach-item:first-child {
    border-color: #bbf7d0;
    background: #f7fef9;
}

.notebook-coach-item h3 {
    margin: 6px 0 4px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 850;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.notebook-coach-item p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.notebook-coach-actions {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.notebook-coach-feedback {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.notebook-coach-feedback-btn {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
    line-height: 1;
    padding: 6px 8px;
}

.notebook-coach-feedback-btn:hover,
.notebook-coach-feedback-btn.is-selected {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

.notebook-efficiency-summary {
    display: grid;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.notebook-efficiency-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.notebook-efficiency-head strong {
    color: var(--ink);
    font-size: 15px;
}

.notebook-efficiency-summary p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.notebook-efficiency-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.notebook-efficiency-metrics span {
    padding: 4px 8px;
    border-radius: 6px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 12px;
    font-weight: 720;
}

.notebook-phase-report {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.notebook-phase-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.notebook-phase-window {
    display: inline-flex;
    gap: 4px;
    padding: 2px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f8fafc;
}

.notebook-phase-window button {
    min-width: 36px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 820;
    line-height: 1;
    padding: 6px 8px;
}

.notebook-phase-window button.is-active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.notebook-phase-body {
    display: grid;
    gap: 6px;
}

.notebook-phase-body p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.notebook-phase-body strong {
    color: var(--ink);
}

.notebook-phase-metrics,
.notebook-phase-weak-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.notebook-phase-metrics span,
.notebook-phase-weak-list span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    color: var(--muted);
    font-size: 11px;
    font-weight: 740;
    overflow-wrap: anywhere;
}

.notebook-phase-weak-list strong {
    min-width: 18px;
    padding: 1px 5px;
    border-radius: 999px;
    background: #eff6ff;
    color: var(--primary);
    text-align: center;
}

.notebook-insights {
    display: grid;
    gap: 10px;
    margin: 16px 0;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.notebook-weak-topics {
    margin-bottom: 0;
    padding: 10px 0 0;
    border: 1px solid var(--line);
    border-width: 1px 0 0;
    border-radius: 8px;
    background: transparent;
}

.notebook-weak-topics-label {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 780;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.notebook-weak-topics-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.notebook-weak-topic-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface, #fff);
    font-size: 13px;
}

.notebook-weak-topic-count {
    display: inline-block;
    min-width: 18px;
    padding: 0 4px;
    border-radius: 10px;
    background: var(--accent, #e8eaf6);
    color: var(--ink);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.notebook-distribution-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 0;
}

.notebook-distribution-panel {
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.notebook-workbench {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.65fr);
    gap: 12px;
    margin-bottom: 16px;
}

.notebook-workbench-section {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.notebook-workbench-primary {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.notebook-side-rail {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.notebook-workbench-head {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    justify-content: space-between;
}

.notebook-workbench-head h2 {
    margin: 0;
    color: var(--ink);
    font-size: 16px;
    font-weight: 850;
}

.notebook-workbench-count {
    color: var(--muted);
    font-size: 12px;
    font-weight: 820;
}

.notebook-workbench-list {
    display: grid;
    gap: 6px;
    align-content: start;
}

.notebook-workbench-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.notebook-workbench-item-main {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.notebook-workbench-item-head {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.notebook-type-pill,
.notebook-workbench-badge {
    display: inline-flex;
    align-items: center;
    min-height: 21px;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 850;
    white-space: nowrap;
}

.notebook-type-pill {
    border: 1px solid #d1fae5;
    background: #ecfdf5;
    color: #047857;
}

.notebook-workbench-badge {
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: var(--primary);
}

.notebook-workbench-item h3 {
    margin: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: 13px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notebook-workbench-item p {
    margin: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: 12px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notebook-workbench-item .notebook-review-reason {
    margin-top: 6px;
    overflow: visible;
    color: #64748b;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
}

.notebook-source-link {
    color: var(--primary);
    font-size: 12px;
    font-weight: 760;
    text-decoration: none;
    white-space: nowrap;
}

.notebook-source-link:hover {
    color: var(--primary-strong);
    text-decoration: underline;
}

.notebook-workbench-empty {
    min-height: 96px;
}

.notebook-history-modal-content {
    border-radius: 8px;
}

.notebook-review-history-body {
    display: grid;
    gap: 10px;
}

.notebook-review-history-item {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.notebook-review-history-head,
.notebook-review-history-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.notebook-review-history-head time,
.notebook-review-history-meta {
    color: var(--muted);
    font-size: 12px;
}

.notebook-review-history-item p {
    margin: 0;
    color: var(--ink);
    font-size: 13px;
    line-height: 1.5;
}

.notebook-tabs {
    margin-top: 8px;
    margin-bottom: 12px;
}

.notebook-assets-head {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.notebook-tab-content {
    min-height: 320px;
}

@media (max-width: 767px) {
    .notebook-command-center {
        grid-template-columns: 1fr;
    }

    .notebook-primary-metric {
        min-height: 88px;
        padding: 6px 0;
    }

    .notebook-primary-metric span {
        font-size: 42px;
    }

    .notebook-learning-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .notebook-distribution-grid {
        grid-template-columns: 1fr;
    }

    .notebook-coach-list {
        grid-template-columns: 1fr;
    }

    .notebook-workbench {
        display: grid;
        grid-template-columns: 1fr;
        gap: 14px;
        width: 100%;
        min-width: 0;
    }

    .notebook-workbench-section {
        min-width: 0;
        overflow: hidden;
    }

    .notebook-workbench-head {
        align-items: flex-start;
        gap: 6px 10px;
    }

    .notebook-workbench-list {
        min-width: 0;
    }

    .notebook-workbench-item {
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 7px;
        min-width: 0;
        padding: 9px 10px;
    }

    .notebook-workbench-item-main {
        min-width: 0;
    }

    .notebook-workbench-item h3,
    .notebook-workbench-item p {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .notebook-workbench-item p {
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .notebook-source-link {
        width: 100%;
        min-height: 30px;
        justify-content: center;
        padding: 5px 9px;
        border: 1px solid #dbeafe;
        border-radius: 6px;
        background: #f8fbff;
        text-align: center;
    }
}

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

.sentence-notebook-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.sentence-notebook-card-head,
.sentence-notebook-card-foot {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
}

.sentence-notebook-card-head > div,
.word-notebook-card-head > div {
    min-width: 0;
}

.sentence-notebook-source {
    margin: 0 0 3px;
    overflow: hidden;
    color: var(--ink);
    font-size: 14px;
    font-weight: 820;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sentence-notebook-meta,
.sentence-notebook-signals {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 720;
}

.sentence-notebook-meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sentence-notebook-sentence {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.sentence-notebook-signals {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.sentence-notebook-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
    white-space: nowrap;
}

.sentence-notebook-actions .btn {
    min-height: 30px;
    padding: 4px 9px;
    font-size: 12px;
    line-height: 1.2;
}

.notebook-hidden {
    display: none;
}

/* V0.4.3: 复习评分按钮组 */
.notebook-rating-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.btn-rating {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    min-height: 28px;
    border-radius: 6px;
    border-width: 1.5px;
    line-height: 1.2;
    white-space: nowrap;
    transition: background 0.12s, transform 0.08s;
}

.btn-rating:active {
    transform: scale(0.96);
}

.btn-rating:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-rating-easy {
    color: #166534;
    border-color: #86efac;
    background: #f0fdf4;
}

.btn-rating-easy:hover {
    background: #dcfce7;
    border-color: #4ade80;
    color: #15803d;
}

.btn-rating-hard {
    color: #92400e;
    border-color: #fcd34d;
    background: #fffbeb;
}

.btn-rating-hard:hover {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #b45309;
}

.btn-rating-again {
    color: #991b1b;
    border-color: #fca5a5;
    background: #fff1f2;
}

.btn-rating-again:hover {
    background: #ffe4e6;
    border-color: #f87171;
    color: #b91c1c;
}

/* 旧版确认弹出层（保留用于向后兼容，不再主动使用） */
.notebook-review-confirm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    max-width: 100%;
    padding: 4px 6px 4px 9px;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    background: #f0fdf4;
    color: #166534;
    font-size: 12px;
    font-weight: 760;
    line-height: 1.25;
    white-space: normal;
}

.notebook-review-confirm span {
    white-space: nowrap;
}

.notebook-review-confirm .btn {
    min-height: 24px;
    padding: 2px 7px;
}

.notebook-status-control {
    position: relative;
    width: 116px;
    min-width: 116px;
}

.notebook-status-toggle {
    width: 100%;
    justify-content: center;
}

.notebook-status-menu {
    position: absolute;
    z-index: 20;
    top: calc(100% + 4px);
    right: 0;
    display: none;
    width: 148px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}

.notebook-status-control.is-open .notebook-status-menu {
    display: grid;
    gap: 2px;
}

.notebook-status-option {
    width: 100%;
    min-height: 30px;
    padding: 5px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ink);
    font-size: 13px;
    font-weight: 760;
    line-height: 1.25;
    text-align: left;
}

.notebook-status-option:hover,
.notebook-status-option.is-active {
    background: #eff6ff;
    color: var(--primary);
}

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

.word-notebook-card {
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.word-notebook-card-head,
.word-notebook-card-foot {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
}

.word-notebook-card h2 {
    margin: 0 0 3px;
    overflow: hidden;
    color: var(--ink);
    font-size: 17px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.word-notebook-meta {
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    font-weight: 720;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.word-notebook-meaning {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: 13px;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

@media (max-width: 640px) {
    .sentence-notebook-card,
    .word-notebook-card {
        padding: 11px;
    }
    .sentence-notebook-card-head,
    .sentence-notebook-card-foot,
    .word-notebook-card-head,
    .word-notebook-card-foot {
        align-items: flex-start;
    }
    .sentence-notebook-card-foot,
    .word-notebook-card-foot {
        display: grid;
        grid-template-columns: 1fr;
    }
    .sentence-notebook-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        overflow: visible;
        white-space: normal;
    }
    .sentence-notebook-actions .btn,
    .notebook-status-control {
        width: 100%;
        min-width: 0;
        justify-content: center;
    }
    /* V0.4.3: 移动端评分按钮组全宽撑开 */
    .notebook-rating-group {
        grid-column: 1 / -1;
        width: 100%;
        justify-content: stretch;
    }
    .notebook-rating-group .btn-rating {
        flex: 1;
        font-size: 12px;
    }
    .notebook-status-menu {
        right: auto;
        left: 0;
        width: 100%;
    }
    .notebook-status-option {
        min-height: 36px;
        font-size: 14px;
    }
    .notebook-review-confirm {
        grid-column: 1 / -1;
        width: 100%;
        justify-content: space-between;
    }
}

.empty-state.compact {
    min-height: 260px;
    padding: 24px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: #fbfcfe;
}

.empty-state.compact p {
    margin-bottom: 14px;
}

@media (max-width: 992px) {
    .corpus-snapshot-overview {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .corpus-reading-layout {
        grid-template-columns: 1fr;
    }
    .corpus-key-panel {
        position: static;
    }
}

@media (max-width: 640px) {
    .article-box {
        min-height: 340px;
    }

    .article-analysis-workbench {
        gap: 12px;
    }

    .article-analysis-workbench .input-panel,
    .article-analysis-workbench .result-panel {
        padding: 16px;
    }

    .article-analysis-workbench .result-panel {
        min-height: 420px;
    }

    .article-analysis-workbench .result-panel .empty-state,
    .article-analysis-workbench .result-panel .loading-state {
        min-height: 320px;
    }

    .article-analysis-workbench #articleText {
        min-height: 340px;
    }

    .article-options {
        align-items: center;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px 8px;
    }

    .article-options .sentence-stats {
        margin-left: auto;
    }

    .article-stats-summary-panel {
        align-items: flex-start;
        height: auto;
        flex-direction: column;
        gap: 6px;
        margin-bottom: 8px;
    }

    .article-summary-grid {
        width: 100%;
        flex-wrap: wrap;
        overflow-x: visible;
    }

    .distribution-item {
        grid-template-columns: minmax(0, 1fr);
        gap: 4px;
    }

    .corpus-filters {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .corpus-filters .form-select,
    .corpus-filters .form-control,
    .corpus-filters .btn {
        width: 100%;
        min-width: 0;
    }

    .corpus-card-head,
    .corpus-reader-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

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

    .corpus-topic-badge {
        max-width: 100%;
    }

    .corpus-snapshot-overview {
        display: grid;
        grid-template-columns: 1fr;
    }

    .article-view-modal-content {
        height: 92vh;
    }

    .article-view-modal-content .modal-body {
        padding: 12px;
    }

    .corpus-reading-text,
    .corpus-key-panel {
        padding: 12px;
    }

    .corpus-reading-text p {
        font-size: 14px;
        line-height: 1.8;
    }
}

/* Page styles moved from stats.html */
/* ── Stats page extras ── */
.stats-kpi-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.kpi-chip {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 156px;
    min-height: 58px;
    padding: 10px 12px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}
.kpi-chip .kpi-value {
    font-size: 21px;
    font-weight: 800;
    line-height: 1;
    order: 2;
}
.kpi-chip .kpi-label {
    font-size: 11px;
    color: var(--muted);
    font-weight: 750;
    text-transform: uppercase;
    margin-top: 0;
    text-align: center;
}
.chart-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 20px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}
.chart-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: .05em;
    margin-bottom: 6px;
}
.scope-note {
    margin: 0 0 14px;
    color: #667085;
    font-size: 12px;
    line-height: 1.45;
}
.scope-note strong {
    color: #344054;
    font-weight: 800;
}
.stats-scope-summary {
    margin: -4px 0 18px;
    color: #475467;
    font-size: 13px;
    line-height: 1.55;
}
svg text { font-family: inherit; }
.axis line, .axis path { stroke: var(--line); }
.axis text { fill: var(--muted); font-size: 11px; }
.grid line { stroke: var(--line); stroke-dasharray: 3,3; }
.chart-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}
.chart-scroll svg {
    display: block;
}
.x-year-label text {
    text-anchor: end;
}
.bar-cet4  { fill: #3b82f6; }
.bar-cet6  { fill: #22c55e; }
.bar-other { fill: #94a3b8; }
.line-difficulty { fill: none; stroke: #f59e0b; stroke-width: 2.5; }
.line-cet4  { fill: none; stroke: #3b82f6; stroke-width: 2; }
.line-cet6  { fill: none; stroke: #22c55e; stroke-width: 2; }
.dot { cursor: pointer; }
.tooltip-box {
    position: absolute;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
    z-index: 100;
}
.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(320px, .9fr);
    gap: 20px;
    align-items: start;
}
.dashboard-grid > * {
    min-width: 0;
}
.insight-panel {
    background: linear-gradient(135deg, #ffffff 0%, #f6fbff 100%);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 20px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}
.insight-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    min-width: 0;
}
.signal-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 12px;
    min-height: 112px;
    min-width: 0;
    overflow-wrap: anywhere;
}
.signal-card strong {
    display: block;
    font-size: 22px;
    line-height: 1;
    margin: 8px 0;
}

.coach-quality-breakdown {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.coach-quality-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.coach-quality-table {
    min-width: 620px;
    margin-bottom: 0;
    font-size: 12px;
}

.coach-quality-strategy-table {
    min-width: 820px;
}

.admin-coach-filter-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(190px, 1fr)) repeat(3, minmax(150px, .8fr)) repeat(2, minmax(132px, .7fr)) auto;
    gap: 8px;
    align-items: center;
}

.coach-feedback-legend {
    justify-content: flex-start;
}

.coach-batch-chip {
    cursor: pointer;
}

@media (max-width: 767px) {
    .admin-grid .form-select,
    .admin-toolbar .form-select,
    .admin-quality-card-head .form-select,
    .admin-account-edit-grid .form-select,
    .admin-article-edit-grid .form-select,
    .admin-coach-filter-row .form-select {
        min-height: 38px;
        padding-top: 7px;
        padding-bottom: 7px;
        font-size: 14px;
        line-height: 1.35;
        background-position: right 10px center;
        background-size: 12px 10px;
    }

    .admin-coach-filter-row {
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .admin-coach-filter-row .form-select,
    .admin-coach-filter-row .form-control,
    .admin-coach-filter-row .btn {
        width: 100%;
        min-width: 0;
    }
}
.signal-card span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}
.signal-card p {
    margin: 0;
    color: #475467;
    font-size: 12px;
    line-height: 1.45;
}
.signal-good { border-color: #abefc6; background: #f6fef9; }
.signal-warn { border-color: #fedf89; background: #fffcf5; }
.signal-risk { border-color: #fecdca; background: #fffbfa; }
.recent-list {
    display: grid;
    gap: 10px;
}
.recent-item {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.recent-title {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    font-weight: 750;
}
.recent-meta,
.recent-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
}
.recent-metrics span {
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #f2f4f7;
    color: #344054;
    font-weight: 700;
}
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; font-size: 12px; }
.legend-item { display: flex; align-items: center; gap: 5px; }
.legend-dot  { width: 10px; height: 10px; border-radius: 50%; }
.loading-placeholder {
    display: flex; align-items: center; justify-content: center;
    height: 170px; color: var(--muted); font-size: 14px;
    text-align: center;
}
#noDataNote,
#noAnalysisNote { display: none; }
@media (max-width: 991px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .insight-grid { grid-template-columns: 1fr; }
}

@media (max-width: 575px) {
    .stats-kpi-bar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .kpi-chip {
        width: 100%;
        min-width: 0;
        padding: 9px 10px;
    }

    .chart-panel,
    .insight-panel {
        padding: 14px;
        border-radius: 10px;
        margin-bottom: 14px;
    }

    .chart-scroll {
        margin-right: -6px;
        padding-right: 6px;
    }

    .axis text {
        font-size: 10px;
    }

    .topic-donut-chart {
        min-height: 320px;
    }

    .topic-legend {
        min-width: 0;
    }

    .topic-legend-item {
        max-width: 100%;
    }

    .signal-card {
        min-height: 0;
    }
}

/* Page styles moved from vocabulary.html */
/* ── Vocab page extras ── */
.vocab-stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.vocab-stat-chip {
    display: grid;
    align-content: center;
    gap: 6px;
    min-width: 0;
    min-height: 64px;
    padding: 10px 14px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}
.vocab-stat-chip .chip-count {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.1;
    min-width: 0;
    overflow-wrap: anywhere;
}
.vocab-stat-chip .chip-label {
    font-size: 11px;
    color: var(--muted);
    font-weight: 750;
    text-transform: uppercase;
    margin-top: 0;
    min-width: 0;
    line-height: 1.2;
    overflow-wrap: anywhere;
}
.level-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}
.level-CET4  { background: #dbeafe; color: #1d4ed8; }
.level-CET6  { background: #dcfce7; color: #15803d; }
.level-BOTH  { background: #fef3c7; color: #b45309; }
.level-KAOYAN { background: #f3e8ff; color: #7e22ce; }
.level-OTHER { background: #f1f5f9; color: #64748b; }

.difficulty-bar {
    display: inline-block;
    width: 48px;
    height: 6px;
    border-radius: 3px;
    background: var(--line);
    position: relative;
    vertical-align: middle;
}
.difficulty-bar i {
    position: absolute; left: 0; top: 0; height: 100%;
    border-radius: 3px;
    background: var(--primary);
}
.vocab-table td, .vocab-table th {
    vertical-align: middle;
    font-size: 14px;
    padding: .42rem .5rem;
}
.vocab-table thead th {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
    border-top: none;
}
.vocab-meaning-cell {
    min-width: 240px;
    max-width: 420px;
}
.vocab-meaning-short {
    display: inline;
    color: var(--ink);
    line-height: 1.45;
}
.vocab-meaning-action {
    margin-left: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}
.vocab-meaning-action:hover,
.vocab-meaning-action:focus {
    color: var(--primary-strong);
    text-decoration: underline;
}
.vocab-detail-drawer .offcanvas-header {
    border-bottom: 1px solid var(--line);
}
.vocab-detail-drawer .offcanvas-body {
    display: grid;
    align-content: start;
    gap: 16px;
}
.vocab-detail-word {
    display: grid;
    gap: 6px;
}
.vocab-detail-word h2 {
    margin: 0;
    font-size: 26px;
}
.vocab-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.vocab-detail-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px 9px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}
.vocab-detail-section h3 {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--muted);
    font-weight: 850;
    text-transform: uppercase;
}
.vocab-detail-meaning {
    margin: 0;
    line-height: 1.7;
    white-space: pre-wrap;
}
.pagination-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

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

.status-strip a {
    color: inherit;
    font-weight: 850;
    text-decoration: none;
}

.status-strip a:hover,
.status-strip a:focus {
    text-decoration: underline;
}

.public-corpus-intro,
.public-article-links {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.public-return-slot {
    margin-bottom: 12px;
}

.public-return-slot[hidden] {
    display: none;
}

.public-return-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 820;
    text-decoration: none;
}

.public-return-link:hover {
    color: var(--primary-strong);
    text-decoration: underline;
}

.public-corpus-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.public-corpus-grid .corpus-article-card {
    min-height: 180px;
}

.public-corpus-metrics {
    margin-top: 14px;
}

.public-article-grid {
    align-items: stretch;
    margin-bottom: 24px;
}

.public-article-summary {
    margin-top: 16px;
}

.public-article-meta {
    display: grid;
    gap: 12px;
    margin: 16px 0;
}

.public-article-meta div {
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding-bottom: 10px;
}

.public-article-meta dt {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.public-article-meta dd {
    color: var(--ink);
    font-weight: 800;
    margin: 0;
    text-align: right;
}

.public-article-copy,
.public-article-preview p {
    color: var(--ink);
    line-height: 1.8;
}

.public-article-preview {
    margin-bottom: 18px;
}

@media (max-width: 640px) {
    .vocab-stats-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .vocab-stat-chip {
        padding: 9px 10px;
    }

    .vocab-table {
        min-width: 760px;
    }

    .vocab-meaning-cell {
        min-width: 220px;
        max-width: 320px;
    }

    .vocab-detail-drawer {
        width: min(100vw, 420px);
    }

    .vocab-detail-word h2 {
        font-size: 22px;
        overflow-wrap: anywhere;
    }

    .public-corpus-intro,
    .public-article-links {
        align-items: stretch;
        flex-direction: column;
    }
}
