:root {
    --ink: #172520;
    --ink-soft: #31443c;
    --paper: #f7f3ea;
    --paper-deep: #eee8dc;
    --white: #fffdf8;
    --sage: #9db8a2;
    --sage-light: #dce7dc;
    --coral: #ee7257;
    --coral-dark: #d85d43;
    --line: rgba(23, 37, 32, .13);
    --muted: #6d7772;
    --shadow: 0 24px 70px rgba(31, 49, 42, .09);
    --radius-lg: 32px;
    --radius-md: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    min-height: 100vh;
    color: var(--ink);
    background: var(--paper);
    font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    letter-spacing: .01em;
    overflow-x: hidden;
}
a { color: inherit; }
.page-glow {
    position: fixed;
    z-index: -1;
    border-radius: 999px;
    filter: blur(2px);
    opacity: .52;
    pointer-events: none;
}
.page-glow-one {
    width: 440px;
    height: 440px;
    right: -180px;
    top: 80px;
    background: radial-gradient(circle, rgba(238, 114, 87, .20), transparent 68%);
}
.page-glow-two {
    width: 520px;
    height: 520px;
    left: -260px;
    top: 520px;
    background: radial-gradient(circle, rgba(117, 159, 130, .22), transparent 70%);
}

.site-nav {
    padding: 20px 0;
    background: rgba(247, 243, 234, .86);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(23, 37, 32, .08);
    position: sticky;
    top: 0;
    z-index: 100;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    color: var(--paper);
    background: var(--ink);
    border-radius: 13px 13px 13px 4px;
    font-family: Georgia, "Songti SC", serif;
    font-size: 22px;
}
.brand strong { display: block; font-size: 17px; line-height: 1.1; }
.brand small { display: block; margin-top: 4px; font-size: 8px; letter-spacing: .18em; color: var(--muted); }
.site-nav .nav-link {
    color: var(--ink-soft);
    padding: 9px 14px !important;
    font-size: 14px;
    font-weight: 600;
}
.site-nav .nav-link:hover { color: var(--coral-dark); }
.navbar-toggler { border: 0; box-shadow: none !important; }
.profile-button {
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--white);
    font-weight: 700;
}
.profile-button::after { display: none; }
.dropdown-menu {
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.site-main { min-height: calc(100vh - 190px); padding-top: 54px; padding-bottom: 90px; }
.site-footer {
    padding: 28px 0;
    color: var(--muted);
    border-top: 1px solid var(--line);
    font-size: 13px;
}
.eyebrow {
    display: inline-block;
    color: #65776e;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .18em;
}
.btn {
    border-radius: 999px;
    padding: 11px 21px;
    border-width: 1px;
    font-weight: 700;
    font-size: 14px;
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-sm { padding: 9px 17px; }
.btn-lg { padding: 14px 25px; font-size: 15px; }
.btn-ink { color: white; background: var(--ink); border-color: var(--ink); }
.btn-ink:hover { color: white; background: #263a32; border-color: #263a32; }
.btn-coral {
    color: white;
    background: var(--coral);
    border-color: var(--coral);
    box-shadow: 0 10px 26px rgba(238, 114, 87, .22);
}
.btn-coral:hover { color: white; background: var(--coral-dark); border-color: var(--coral-dark); }
.btn-ghost { color: var(--ink); border-color: var(--line); background: rgba(255, 253, 248, .45); }
.btn-ghost:hover { color: var(--ink); background: var(--white); border-color: rgba(23, 37, 32, .25); }
.message-stack { max-width: 760px; margin: 0 auto 25px; }
.alert { border: 0; border-radius: 15px; box-shadow: 0 12px 35px rgba(31, 49, 42, .08); }

.landing-hero {
    min-height: 620px;
    display: grid;
    grid-template-columns: 1.05fr .8fr;
    align-items: center;
    gap: 80px;
    padding: 35px 0 70px;
}
.hero-copy h1, .dashboard-hero h1, .page-heading h1, .auth-copy h1, .article-header h1 {
    font-family: Georgia, "Songti SC", "STSong", serif;
    font-weight: 600;
    letter-spacing: -.045em;
}
.hero-copy h1 {
    margin: 20px 0 25px;
    font-size: clamp(52px, 6.4vw, 84px);
    line-height: 1.05;
}
.hero-copy h1 em { color: var(--coral); font-style: normal; }
.hero-copy > p { max-width: 610px; color: var(--ink-soft); font-size: 18px; line-height: 1.9; }
.hero-actions { display: flex; gap: 12px; margin-top: 34px; }
.trust-line { display: flex; flex-wrap: wrap; gap: 21px; margin-top: 29px; color: var(--muted); font-size: 13px; }
.lesson-preview {
    position: relative;
    padding: 35px 38px;
    min-height: 515px;
    color: #f8f5eb;
    background: var(--ink);
    border-radius: 38px 38px 38px 8px;
    box-shadow: 24px 28px 0 var(--sage-light), var(--shadow);
    transform: rotate(1.5deg);
}
.lesson-preview::before {
    content: "";
    position: absolute;
    width: 110px;
    height: 110px;
    right: 28px;
    top: 72px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.14);
    box-shadow: inset 0 0 0 22px rgba(255,255,255,.025);
}
.preview-topline, .preview-footer { display: flex; justify-content: space-between; font-size: 10px; letter-spacing: .16em; color: #afbbb5; }
.preview-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); }
.preview-kicker { margin: 70px 0 12px; color: #a9b9b0; font-size: 11px; letter-spacing: .15em; }
.lesson-preview h2 { position: relative; font-family: Georgia, serif; font-size: 37px; line-height: 1.15; }
.preview-translation { margin-top: 18px; color: #cbd4cf; }
.word-chip { margin: 55px 0 43px; padding: 20px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); border-radius: 17px; }
.word-chip strong { font-family: Georgia, serif; font-size: 22px; }
.word-chip span { margin-left: 7px; color: #aebbb4; font-size: 12px; }
.word-chip p { margin: 8px 0 0; color: #dfe5e1; font-size: 13px; }

.feature-strip {
    display: grid;
    grid-template-columns: 1.2fr repeat(3, 1fr);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.feature-intro, .feature-item { padding: 42px 30px; }
.feature-intro { padding-left: 0; }
.feature-intro h2 { margin-top: 12px; font-family: Georgia, "Songti SC", serif; font-size: 32px; }
.feature-item { border-left: 1px solid var(--line); }
.feature-item > span { color: var(--coral); font-family: Georgia, serif; font-size: 14px; }
.feature-item h3 { margin: 22px 0 12px; font-size: 18px; }
.feature-item p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.75; }

.dashboard-hero {
    display: grid;
    grid-template-columns: 1.2fr .7fr;
    gap: 50px;
    align-items: center;
    padding: 55px 60px;
    color: white;
    background: var(--ink);
    border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 8px;
    overflow: hidden;
    position: relative;
}
.dashboard-hero::after {
    content: "";
    position: absolute;
    width: 300px;
    height: 300px;
    right: -100px;
    top: -140px;
    border: 55px solid rgba(255,255,255,.035);
    border-radius: 50%;
}
.dashboard-hero .eyebrow { color: #a9b9b0; }
.dashboard-hero h1 { margin: 15px 0; font-size: clamp(37px, 5vw, 58px); }
.dashboard-hero p { max-width: 640px; color: #bdc9c3; line-height: 1.8; }
.dashboard-hero .btn { margin-top: 13px; }
.stats-panel {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 30px;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 24px;
    backdrop-filter: blur(8px);
}
.stats-panel div:not(.stats-divider) { text-align: center; }
.stats-panel strong { display: block; font-family: Georgia, serif; font-size: 42px; }
.stats-panel span { color: #b9c5bf; font-size: 12px; }
.stats-divider { width: 1px; height: 52px; background: rgba(255,255,255,.12); }
.section-block { margin-top: 70px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 26px; }
.section-heading h2, .learning-heading h2 { margin: 7px 0 0; font-family: Georgia, "Songti SC", serif; font-size: 34px; }
.text-link { color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 700; }
.text-link span { color: var(--coral); }
.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.article-card {
    display: flex;
    flex-direction: column;
    min-height: 280px;
    padding: 27px;
    text-decoration: none;
    background: rgba(255,253,248,.72);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.article-card:hover { color: var(--ink); transform: translateY(-5px); border-color: rgba(238,114,87,.45); box-shadow: var(--shadow); }
.article-date { color: var(--coral-dark); font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.article-card h3 { margin: 26px 0 13px; font-family: Georgia, "Songti SC", serif; font-size: 24px; line-height: 1.35; }
.article-card p { color: var(--muted); font-size: 14px; line-height: 1.8; }
.article-meta { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.round-arrow { width: 30px; height: 30px; display: grid; place-items: center; color: white; background: var(--ink); border-radius: 50%; }

.page-heading { max-width: 850px; margin: 15px 0 45px; }
.page-heading h1 { margin: 14px 0; font-size: clamp(40px, 5vw, 64px); }
.page-heading > p, .page-heading > div > p { color: var(--muted); font-size: 16px; line-height: 1.7; }
.page-heading-row { max-width: none; display: flex; justify-content: space-between; align-items: end; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .65fr); gap: 24px; align-items: start; }
.editor-card, .form-shell, .auth-card {
    padding: 38px;
    background: rgba(255,253,248,.9);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.field-group { margin-bottom: 25px; }
.field-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.field-label label, .field-group > label, .vocabulary-form label { font-size: 14px; font-weight: 750; }
.field-label span, .form-help { color: var(--muted); font-size: 11px; }
.form-control {
    padding: 13px 15px;
    color: var(--ink);
    background: var(--white);
    border: 1px solid rgba(23,37,32,.16);
    border-radius: 13px;
}
.form-control:focus { background: white; border-color: var(--sage); box-shadow: 0 0 0 4px rgba(157,184,162,.18); }
textarea.form-control { line-height: 1.75; resize: vertical; }
.editor-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 28px; padding-top: 25px; border-top: 1px solid var(--line); }
.field-error { margin-top: 7px; color: #b34733; font-size: 12px; }
.process-card { padding: 32px; color: white; background: var(--ink); border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 8px; }
.process-card .eyebrow { color: #9eb0a6; }
.process-card h2 { margin: 14px 0 30px; font-family: Georgia, "Songti SC", serif; font-size: 29px; }
.process-list { list-style: none; padding: 0; margin: 0; }
.process-list li { display: flex; gap: 15px; margin: 22px 0; }
.process-list li > span { flex: 0 0 30px; width: 30px; height: 30px; display: grid; place-items: center; color: var(--ink); background: var(--sage-light); border-radius: 50%; font: 700 13px Georgia, serif; }
.process-list strong, .process-list small { display: block; }
.process-list strong { font-size: 14px; }
.process-list small { margin-top: 4px; color: #aebbb4; font-size: 11px; }
.privacy-note { margin: 30px 0 0; padding-top: 20px; color: #9eaca5; border-top: 1px solid rgba(255,255,255,.1); font-size: 11px; }

.article-header { max-width: 980px; margin: 5px auto 50px; text-align: center; }
.back-link { display: block; width: fit-content; margin: 0 auto 38px; color: var(--muted); text-decoration: none; font-size: 13px; }
.back-link:hover { color: var(--coral-dark); }
.article-header h1 { margin: 16px auto 24px; font-size: clamp(42px, 6vw, 72px); line-height: 1.15; }
.reading-summary { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.reading-summary span { padding: 7px 13px; color: var(--muted); background: rgba(255,255,255,.55); border: 1px solid var(--line); border-radius: 999px; font-size: 11px; }
.annotation-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 18px;
    margin: -25px 0 24px;
    color: var(--muted);
    font-size: 11px;
}
.annotation-legend span { display: flex; align-items: center; gap: 7px; }
.annotation-legend i { width: 22px; height: 7px; display: inline-block; }
.legend-vocabulary { border-bottom: 2px solid var(--coral); }
.legend-lookup { border-bottom: 1px dotted #8d9892; }
.legend-grammar { background: rgba(157,184,162,.3); border-bottom: 2px solid #76967d; }
.parallel-reading { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.parallel-reading-heading { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: rgba(255,253,248,.95); }
.parallel-reading-heading .panel-heading { padding: 25px 38px 22px; }
.parallel-reading-heading .panel-heading + .panel-heading { background: #e8eee7; border-left: 1px solid var(--line); }
.panel-heading { border-bottom: 1px solid var(--line); }
.panel-heading span { color: var(--coral-dark); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.panel-heading h2 { margin: 5px 0 0; font: 600 25px Georgia, "Songti SC", serif; }
.reading-pairs { background: rgba(255,253,248,.85); }
.reading-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.reading-pair:last-child { border-bottom: 0; }
.reading-pair-column { min-width: 0; padding: 30px 38px 34px; }
.translated-column { background: #e8eee7; border-left: 1px solid var(--line); }
.reading-pair .article-copy p:first-child { margin-top: 0; }
.reading-pair .article-copy p:last-child { margin-bottom: 0; }
.mobile-column-label { display: none; margin-bottom: 12px; color: var(--coral-dark); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.article-copy { color: #293a33; font-family: Georgia, "Noto Serif SC", "Songti SC", serif; font-size: 17px; line-height: 2.05; }
.article-copy p:last-child { margin-bottom: 0; }
.inline-annotation {
    display: inline;
    padding: 0 1px;
    color: inherit;
    background: transparent;
    border: 0;
    border-radius: 3px;
    font: inherit;
    line-height: inherit;
    text-align: inherit;
    cursor: pointer;
    transition: color .2s ease, background .2s ease, box-shadow .2s ease;
}
.vocabulary-annotation {
    color: #b04d38;
    border-bottom: 2px solid rgba(238,114,87,.75);
}
.vocabulary-annotation:hover, .vocabulary-annotation:focus-visible {
    color: #8f3623;
    background: rgba(238,114,87,.12);
    outline: none;
}
.lookup-word {
    border-bottom: 1px dotted transparent;
}
.lookup-word:hover, .lookup-word:focus-visible {
    color: #526b5b;
    background: rgba(157,184,162,.12);
    border-bottom-color: #7e9585;
    outline: none;
}
.cached-lookup-annotation {
    color: #536f5c;
    background: rgba(157,184,162,.12);
    border-bottom: 1px dotted #6e8c75;
}
.cached-lookup-annotation:hover, .cached-lookup-annotation:focus-visible {
    background: rgba(157,184,162,.25);
    outline: none;
}
.grammar-annotation {
    padding: 1px 3px;
    background: rgba(157,184,162,.27);
    border-bottom: 2px solid #799b80;
}
.grammar-annotation:hover, .grammar-annotation:focus-visible {
    background: rgba(157,184,162,.5);
    outline: none;
}
.learning-section { margin-top: 75px; }
.learning-heading { display: flex; align-items: center; gap: 20px; margin-bottom: 27px; }
.section-index { width: 49px; height: 49px; display: grid; place-items: center; color: white; background: var(--coral); border-radius: 50%; font: 600 14px Georgia, serif; }
.grammar-card { padding: 40px; background: var(--ink); border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 8px; }
.grammar-card .learning-heading { color: white; }
.grammar-card .eyebrow { color: #9eaca5; }
.grammar-copy { padding: 28px; color: #dde5e0; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: var(--radius-md); line-height: 1.9; }
.grammar-notes-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grammar-note {
    position: relative;
    padding: 25px;
    color: #dce5df;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 17px;
    transition: background .25s ease, border-color .25s ease, transform .25s ease;
}
.grammar-note.is-focused {
    transform: translateY(-3px);
    background: rgba(157,184,162,.16);
    border-color: rgba(157,184,162,.7);
}
.grammar-note-index { color: var(--coral); font: 600 12px Georgia, serif; letter-spacing: .1em; }
.grammar-note h3 { margin: 12px 0 15px; color: white; font: 600 19px/1.4 Georgia, "Songti SC", serif; }
.grammar-note blockquote {
    margin: 0 0 16px;
    padding: 12px 14px;
    color: #c5d1ca;
    background: rgba(0,0,0,.13);
    border-left: 2px solid var(--sage);
    border-radius: 0 9px 9px 0;
    font: italic 13px/1.65 Georgia, serif;
}
.grammar-note > p { margin: 0; color: #b8c6be; font-size: 13px; line-height: 1.8; }
.vocabulary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.vocabulary-card, .personal-vocab-card { padding: 29px; background: rgba(255,253,248,.8); border: 1px solid var(--line); border-radius: var(--radius-md); }
.vocab-card-heading { display: flex; align-items: start; justify-content: space-between; gap: 15px; }
.vocab-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 15px; }
.vocab-title h3, .personal-vocab-card h2 { margin: 0; font: 600 27px Georgia, serif; }
.vocab-title span, .vocab-card-top > div > span { color: var(--muted); font-size: 12px; }
.lookup-vocabulary-card { border-color: rgba(118,150,125,.45); box-shadow: inset 3px 0 0 rgba(118,150,125,.7); }
.lookup-source { margin-bottom: 12px; color: #66806d; font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.vocab-card-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; }
.definition-en { margin: 9px 0; color: var(--ink-soft); font-family: Georgia, serif; line-height: 1.65; }
.definition-zh { margin: 9px 0; color: var(--coral-dark); font-weight: 700; }
.example-box { margin-top: 18px; padding: 16px; background: var(--paper-deep); border-radius: 12px; }
.example-box p { margin: 0; color: var(--ink-soft); font: italic 14px/1.65 Georgia, serif; }
.example-box span { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; }
.save-word-button {
    flex: 0 0 auto;
    padding: 6px 10px;
    color: var(--coral-dark);
    background: rgba(238,114,87,.08);
    border: 1px solid rgba(238,114,87,.28);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 750;
}
.save-word-button:hover { background: rgba(238,114,87,.16); }
.save-word-button.is-saved { color: #66806d; background: rgba(157,184,162,.14); border-color: rgba(118,150,125,.35); }
.remove-feature-button {
    padding: 6px 10px;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 750;
}
.remove-feature-button:hover { color: #b34733; background: rgba(179,71,51,.07); border-color: rgba(179,71,51,.3); }
.vocabulary-empty-message { margin: 0; padding: 34px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius-md); }
.annotation-inspector {
    position: fixed;
    z-index: 150;
    right: 28px;
    bottom: 28px;
    width: min(390px, calc(100vw - 32px));
    max-height: min(610px, calc(100vh - 56px));
    overflow-y: auto;
    padding: 30px;
    color: var(--ink);
    background: rgba(255,253,248,.97);
    border: 1px solid var(--line);
    border-radius: 24px 24px 24px 7px;
    box-shadow: 0 28px 90px rgba(23,37,32,.24);
    backdrop-filter: blur(18px);
}
.annotation-inspector[hidden] { display: none; }
.inspector-close {
    position: absolute;
    right: 17px;
    top: 14px;
    width: 32px;
    height: 32px;
    color: var(--muted);
    background: transparent;
    border: 0;
    font-size: 25px;
}
.annotation-inspector h2 { margin: 10px 35px 5px 0; font: 600 30px Georgia, "Songti SC", serif; }
.inspector-phonetic { color: var(--muted); font-size: 12px; }
.annotation-inspector blockquote {
    margin: 18px 0;
    padding: 13px 15px;
    color: var(--ink-soft);
    background: var(--paper-deep);
    border-left: 3px solid var(--sage);
    border-radius: 0 10px 10px 0;
    font: italic 14px/1.65 Georgia, serif;
}
.inspector-explanation { color: var(--ink-soft); font-size: 14px; line-height: 1.8; }
.inspector-save { margin-top: 18px; width: 100%; }
.inspector-message { margin: 11px 0 0; color: #66806d; text-align: center; font-size: 11px; }

.library-list { border-top: 1px solid var(--line); }
.library-row { display: grid; grid-template-columns: 90px 1fr 210px; gap: 25px; align-items: center; padding: 31px 15px; border-bottom: 1px solid var(--line); transition: background .2s ease, padding .2s ease; }
.library-row:hover { padding-left: 25px; background: rgba(255,253,248,.55); }
.library-row a { color: inherit; text-decoration: none; }
.library-date { text-align: center; }
.library-date strong { display: block; font: 600 34px Georgia, serif; }
.library-date span { color: var(--muted); font-size: 9px; letter-spacing: .1em; }
.library-main h2 { margin: 0 0 8px; font: 600 24px Georgia, "Songti SC", serif; }
.library-main p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.library-meta { display: flex; align-items: center; justify-content: flex-end; gap: 18px; color: var(--muted); font-size: 11px; }
.library-meta form { margin: 0; }
.library-meta .round-arrow:hover { color: white; background: var(--coral-dark); }
.article-dialog-icon { font-style: normal; }
.empty-state { padding: 70px 25px; text-align: center; background: rgba(255,253,248,.52); border: 1px dashed rgba(23,37,32,.23); border-radius: var(--radius-lg); }
.empty-number { display: block; color: var(--coral); font: 600 42px Georgia, serif; }
.empty-state h3 { margin: 14px 0 8px; font: 600 27px Georgia, "Songti SC", serif; }
.empty-state p { color: var(--muted); }
.empty-state .btn { margin-top: 10px; }

.personal-vocab-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.vocab-card-top { display: flex; justify-content: space-between; align-items: start; margin-bottom: 20px; }
.delete-button { padding: 5px 0; color: var(--muted); background: transparent; border: 0; border-bottom: 1px solid transparent; font-size: 11px; }
.delete-button:hover { color: #b34733; border-color: #b34733; }
.remove-word-dialog {
    width: min(440px, calc(100vw - 32px));
    padding: 0;
    color: var(--ink);
    background: transparent;
    border: 0;
    overflow: visible;
}
.remove-word-dialog::backdrop {
    background: rgba(23,37,32,.48);
    backdrop-filter: blur(7px);
}
.remove-dialog-card {
    position: relative;
    padding: 38px;
    text-align: center;
    background: var(--white);
    border: 1px solid rgba(255,255,255,.6);
    border-radius: 28px 28px 28px 8px;
    box-shadow: 0 32px 100px rgba(17,30,25,.3);
    animation: remove-dialog-in .2s ease-out;
}
.remove-dialog-icon {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    margin: 0 auto 22px;
    color: var(--coral-dark);
    background: rgba(238,114,87,.12);
    border: 1px solid rgba(238,114,87,.2);
    border-radius: 20px 20px 20px 6px;
    font: italic 600 20px Georgia, serif;
}
.remove-dialog-card h2 { margin: 10px 0 12px; font: 600 31px Georgia, "Songti SC", serif; }
.remove-dialog-card > p { max-width: 330px; margin: 0 auto; color: var(--muted); font-size: 14px; line-height: 1.75; }
.remove-dialog-card > p strong { color: var(--ink); font-family: Georgia, serif; }
.remove-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 29px; }
.dialog-cancel-button, .dialog-confirm-button {
    padding: 12px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 750;
    transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.dialog-cancel-button { color: var(--ink-soft); background: transparent; border: 1px solid var(--line); }
.dialog-cancel-button:hover { background: var(--paper-deep); border-color: rgba(23,37,32,.22); }
.dialog-confirm-button { color: white; background: var(--coral-dark); border: 1px solid var(--coral-dark); }
.dialog-confirm-button:hover { background: #bf4932; border-color: #bf4932; }
.dialog-cancel-button:active, .dialog-confirm-button:active { transform: scale(.98); }
@keyframes remove-dialog-in {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.vocab-notes { display: flex; gap: 10px; margin-top: 15px; color: var(--muted); font-size: 12px; }
.vocab-notes strong { color: var(--ink); }
.created-date { display: block; margin-top: 20px; padding-top: 14px; color: #919a95; border-top: 1px solid var(--line); }
.form-shell { max-width: 920px; }
.vocabulary-form label { display: block; margin-bottom: 9px; }
.vocabulary-form label span { color: var(--coral); }
.status-in-progress { color: var(--coral-dark); font-weight: 750; }

.processing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 35px;
    margin: 10px 0 35px;
}
.processing-header h1 {
    max-width: 850px;
    margin: 12px 0 9px;
    font: 600 clamp(38px, 5vw, 62px)/1.15 Georgia, "Songti SC", serif;
    letter-spacing: -.035em;
}
.processing-header p { margin: 0; color: var(--muted); }
.progress-orbit {
    flex: 0 0 128px;
    width: 128px;
    height: 128px;
    display: grid;
    place-content: center;
    text-align: center;
    background: var(--ink);
    color: white;
    border-radius: 50% 50% 50% 12px;
    box-shadow: 12px 13px 0 var(--sage-light);
}
.progress-orbit strong { font: 600 31px Georgia, serif; }
.progress-orbit span { margin-top: 4px; color: #9eaca5; font-size: 8px; letter-spacing: .14em; }
.processing-status {
    padding: 27px 31px;
    background: rgba(255,253,248,.78);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}
.progress-track { height: 5px; overflow: hidden; background: var(--paper-deep); border-radius: 999px; }
.progress-fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--sage), var(--coral));
    border-radius: inherit;
    transition: width .5s ease;
}
.phase-row { display: flex; align-items: center; margin-top: 23px; }
.phase-item { display: flex; align-items: center; gap: 10px; color: #929a96; }
.phase-item > span {
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    font: 600 10px Georgia, serif;
}
.phase-item strong, .phase-item small { display: block; }
.phase-item strong { font-size: 12px; }
.phase-item small { margin-top: 2px; font-size: 9px; }
.phase-item.active { color: var(--ink); }
.phase-item.active > span { color: white; background: var(--coral); border-color: var(--coral); }
.phase-item.done > span { color: white; background: var(--ink); border-color: var(--ink); }
.phase-line { flex: 1; height: 1px; margin: 0 18px; background: var(--line); }
.live-segments { margin-top: 28px; }
.live-segment {
    position: relative;
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 20px;
    margin-bottom: 18px;
    padding: 28px;
    background: rgba(255,253,248,.65);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    opacity: .72;
    transition: opacity .35s ease, border-color .35s ease, box-shadow .35s ease;
}
.live-segment.is-complete { opacity: 1; border-color: rgba(157,184,162,.65); box-shadow: 0 18px 48px rgba(31,49,42,.07); }
.segment-number {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: var(--coral-dark);
    background: var(--paper-deep);
    border-radius: 50%;
    font: 600 13px Georgia, serif;
}
.segment-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 35px; }
.segment-original, .segment-translation { min-width: 0; }
.segment-original > div, .translation-content {
    margin-top: 12px;
    color: var(--ink-soft);
    font: 15px/1.85 Georgia, "Songti SC", serif;
}
.segment-original p:last-child, .translation-content p:last-child { margin-bottom: 0; }
.segment-translation { padding-left: 30px; border-left: 1px solid var(--line); }
.translation-placeholder { display: flex; align-items: center; gap: 9px; color: #929a96; font-family: Inter, sans-serif; font-style: normal; font-size: 12px; }
.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--sage);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: .35; transform: scale(.8); }
    50% { opacity: 1; transform: scale(1.15); }
}
.processing-error {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 25px;
    margin-top: 25px;
    padding: 22px 25px;
    color: #7a3022;
    background: #fae2dc;
    border-radius: var(--radius-md);
}
.processing-error p { margin: 5px 0 0; font-size: 13px; }
.processing-note { margin: 26px auto 0; max-width: 700px; color: var(--muted); text-align: center; font-size: 12px; }

.auth-layout { display: grid; grid-template-columns: 1fr 480px; gap: 100px; align-items: center; max-width: 1100px; min-height: 600px; margin: 0 auto; }
.auth-copy h1 { margin: 18px 0 25px; font-size: clamp(46px, 6vw, 70px); line-height: 1.13; }
.auth-copy > p { max-width: 520px; color: var(--muted); font-size: 17px; line-height: 1.8; }
.auth-copy blockquote { margin-top: 55px; padding-left: 19px; color: var(--ink-soft); border-left: 3px solid var(--coral); font: italic 16px Georgia, serif; }
.auth-points { display: flex; gap: 8px; margin-top: 35px; }
.auth-points span { padding: 7px 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; font-size: 11px; }
.auth-card h2 { margin: 0 0 8px; font: 600 31px Georgia, "Songti SC", serif; }
.auth-card > p { margin-bottom: 30px; color: var(--muted); font-size: 13px; }
.auth-card > p a { color: var(--coral-dark); font-weight: 700; }
.auth-card ul { margin: 6px 0 0; padding-left: 17px; color: var(--muted); font-size: 11px; }
.auth-card .form-help { display: block; margin-top: 6px; line-height: 1.5; }

@media (max-width: 991px) {
    .site-nav .navbar-collapse { padding-top: 16px; }
    .landing-hero { grid-template-columns: 1fr; gap: 55px; }
    .lesson-preview { max-width: 580px; }
    .feature-strip { grid-template-columns: 1fr 1fr; }
    .feature-intro { padding-left: 30px; border-bottom: 1px solid var(--line); }
    .feature-item { border-bottom: 1px solid var(--line); }
    .dashboard-hero { grid-template-columns: 1fr; }
    .article-grid { grid-template-columns: repeat(2, 1fr); }
    .editor-layout { grid-template-columns: 1fr; }
    .process-card { order: -1; }
    .auth-layout { grid-template-columns: 1fr; gap: 45px; }
    .auth-copy { display: none; }
    .auth-card { max-width: 560px; width: 100%; margin: 35px auto; }
}

@media (max-width: 767px) {
    .site-main { padding-top: 35px; padding-bottom: 65px; }
    .landing-hero { min-height: auto; padding: 25px 0 65px; }
    .hero-copy h1 { font-size: 51px; }
    .hero-copy > p { font-size: 16px; }
    .hero-actions { flex-direction: column; align-items: stretch; }
    .lesson-preview { min-height: 475px; padding: 29px; box-shadow: 12px 15px 0 var(--sage-light); }
    .lesson-preview h2 { font-size: 31px; }
    .feature-strip { grid-template-columns: 1fr; }
    .feature-intro, .feature-item { padding: 30px 20px; border-left: 0; }
    .dashboard-hero { padding: 38px 25px; }
    .stats-panel { padding: 22px 12px; }
    .stats-panel strong { font-size: 34px; }
    .article-grid, .vocabulary-grid, .personal-vocab-grid { grid-template-columns: 1fr; }
    .section-heading, .page-heading-row { align-items: start; flex-direction: column; gap: 18px; }
    .page-heading h1 { font-size: 43px; }
    .editor-card, .form-shell, .auth-card { padding: 24px; border-radius: 23px; }
    .process-card { padding: 25px; }
    .editor-actions { flex-direction: column-reverse; }
    .editor-actions .btn { width: 100%; }
    .parallel-reading-heading { display: none; }
    .reading-pair { grid-template-columns: 1fr; }
    .reading-pair-column { padding: 26px; }
    .translated-column { border-top: 1px solid var(--line); border-left: 0; }
    .mobile-column-label { display: block; }
    .article-copy { font-size: 16px; line-height: 1.9; }
    .grammar-card { padding: 24px; }
    .grammar-copy { padding: 20px; }
    .grammar-notes-grid { grid-template-columns: 1fr; }
    .lookup-vocabulary-card .vocab-card-heading { flex-direction: column; }
    .vocab-card-actions { flex-wrap: wrap; }
    .annotation-inspector { right: 16px; bottom: 16px; max-height: calc(100vh - 32px); }
    .remove-dialog-card { padding: 31px 24px 24px; }
    .remove-dialog-actions { grid-template-columns: 1fr; }
    .dialog-confirm-button { order: -1; }
    .library-row { grid-template-columns: 60px 1fr; gap: 15px; }
    .library-meta { grid-column: 2; justify-content: flex-start; margin-top: -8px; }
    .library-meta > span, .library-meta .round-arrow { display: none; }
    .library-main p { display: none; }
    .auth-layout { min-height: auto; }
    .processing-header { align-items: flex-start; }
    .progress-orbit { flex-basis: 96px; width: 96px; height: 96px; }
    .progress-orbit strong { font-size: 24px; }
    .processing-status { padding: 22px 18px; }
    .phase-item small { display: none; }
    .phase-line { margin: 0 8px; }
    .live-segment { grid-template-columns: 1fr; padding: 22px; }
    .segment-columns { grid-template-columns: 1fr; gap: 24px; }
    .segment-translation { padding: 22px 0 0; border-left: 0; border-top: 1px solid var(--line); }
    .processing-error { align-items: stretch; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
