:root {
  --ink: #1e2933;
  --muted: #6f7b83;
  --line: #dfe4e6;
  --paper: #f7f8f7;
  --panel: #ffffff;
  --green: #176b5b;
  --green-dark: #0e4e43;
  --green-pale: #e6f2ee;
  --gold: #c47b32;
  --gold-pale: #fff2df;
  --red: #b45145;
  --shadow: 0 12px 32px rgba(30, 41, 51, .07);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; }
.topbar { height: 78px; padding: 0 38px; background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.brand-lockup { display: flex; align-items: center; gap: 14px; }
.brand-mark { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--green); color: white; font-size: 13px; font-weight: 800; letter-spacing: .08em; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 16px; letter-spacing: .01em; }
.brand-lockup p { color: var(--muted); font-size: 12px; margin-top: 3px; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.theme-toggle { border: 1px solid var(--line); border-radius: 6px; color: var(--green); padding: 8px 10px; }
.status-pill { color: var(--green); background: var(--green-pale); border-radius: 99px; padding: 7px 11px; font-size: 12px; }
.button { border: 0; border-radius: 7px; padding: 11px 16px; transition: .18s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--green); color: white; min-width: 150px; }
.button-primary:hover { background: var(--green-dark); }
.button-outline { background: white; color: var(--green); border: 1px solid var(--green); }
.button-quiet { background: transparent; color: var(--muted); padding: 8px 5px; }
.workspace { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: calc(100vh - 78px); }
.sidebar { background: #eef1f0; border-right: 1px solid var(--line); padding: 34px 20px; }
.side-section { padding: 0 4px 26px; margin-bottom: 25px; border-bottom: 1px solid #d9dfdd; }
.side-section:last-child { border-bottom: 0; }
.section-kicker { color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-size: 10px; font-weight: 700; margin-bottom: 12px; }
.library-option { display: flex; align-items: center; gap: 9px; padding: 9px 0; font-size: 14px; }
.library-option input { accent-color: var(--green); width: 15px; height: 15px; }
.library-option small { margin-left: auto; color: var(--muted); font-size: 11px; }
.weight-section { padding-bottom: 22px; }
.weight-presets { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 13px; }
.weight-preset { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 5px; padding: 5px 7px; font-size: 10px; }
.weight-preset:hover, .weight-preset.active { border-color: var(--green); color: var(--green); background: var(--green-pale); }
.weight-controls { display: grid; gap: 9px; }
.weight-control { display: grid; gap: 4px; }
.weight-control > span { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.weight-control b { color: var(--ink); font-weight: 600; }
.weight-control output { color: var(--green); font-variant-numeric: tabular-nums; }
.weight-control input { width: 100%; height: 4px; accent-color: var(--green); cursor: pointer; }
.weight-control.is-disabled { opacity: .48; }
.weight-control.is-disabled input { cursor: not-allowed; }
.weight-actions { display: flex; align-items: center; gap: 7px; margin-top: 12px; }
.weight-actions .button { padding: 6px 8px; font-size: 10px; white-space: nowrap; }
.weight-actions span { color: var(--muted); font-size: 10px; line-height: 1.4; }
.weight-section > p { color: var(--muted); font-size: 11px; line-height: 1.6; margin-top: 11px; }
.mode-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 3px; background: #dfe6e3; border-radius: 7px; }
.mode-button { border: 0; background: transparent; color: var(--muted); border-radius: 5px; padding: 8px 2px; font-size: 12px; }
.mode-button.active { background: white; color: var(--green); box-shadow: 0 1px 3px rgba(0,0,0,.08); font-weight: 700; }
.direction-switch { grid-template-columns: repeat(2, 1fr); }.direction-switch .mode-button.active { background: var(--green-pale); }
.daily-target { display: flex; align-items: baseline; gap: 4px; color: var(--muted); }
.daily-target strong { color: var(--ink); font-size: 30px; line-height: 1; }
.daily-target span { font-size: 12px; }
.progress-track { height: 6px; margin: 13px 0 12px; border-radius: 6px; background: #d9dfdd; overflow: hidden; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--gold); transition: width .25s ease; }
.daily-setting { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 0 12px; color: var(--muted); font-size: 11px; }.daily-setting input { width: 62px; border: 1px solid var(--line); border-radius: 5px; padding: 6px 7px; color: var(--ink); background: white; font-size: 12px; }
.side-tip p { color: var(--muted); font-size: 12px; line-height: 1.7; }
.data-backup-actions { display: grid; gap: 7px; }
.data-backup-actions .button { width: 100%; padding: 8px 9px; font-size: 11px; }
.button-danger { background: transparent; color: var(--red); border: 1px solid var(--red); }
.button-danger:hover { background: color-mix(in srgb, var(--red) 10%, transparent); }
.data-backup-section > p { color: var(--muted); font-size: 10px; line-height: 1.5; margin-top: 10px; }
.main-content { width: min(1100px, 100%); margin: 0 auto; padding: 34px 42px 60px; }
.content-heading, .lookup-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
h2 { font-size: 28px; letter-spacing: -.03em; }
.search-box { display: flex; align-items: center; gap: 8px; width: 320px; border: 1.5px solid #a9cfc3; background: #fbfefd; border-radius: 7px; padding: 10px 13px; color: var(--green); box-shadow: 0 2px 8px rgba(23, 107, 91, .06); transition: border-color .18s ease, box-shadow .18s ease; }
.search-box:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23, 107, 91, .12); }.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; }
.study-panel { margin-top: 24px; scroll-margin-top: 24px; }
.study-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin: 0 5px 9px; }
.study-card { --word-font-size: clamp(38px, 6vw, 62px); --prompt-font-size: 26px; --definition-font-size: 22px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; min-height: 375px; padding: 28px 34px 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; text-align: center; }
.study-card.word-transition { animation: wordTransition .38s ease both; }
@keyframes wordTransition { from { opacity: .2; transform: translateX(16px); } 65% { opacity: 1; transform: translateX(-2px); } to { opacity: 1; transform: translateX(0); } }
.word-line { width: 100%; display: flex; justify-content: space-between; align-items: center; }
.level-tag { padding: 5px 8px; border-radius: 5px; background: var(--gold-pale); color: var(--gold); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.word-index { color: var(--muted); font-size: 12px; }
.word { width: min(100%, 920px); margin-top: 33px; font-family: Georgia, serif; font-size: var(--word-font-size); letter-spacing: -.04em; line-height: 1; overflow-wrap: anywhere; }
.word.meaning-prompt { max-width: 920px; font-family: "Segoe UI", "Microsoft YaHei", sans-serif; font-size: var(--prompt-font-size); letter-spacing: 0; line-height: 1.45; }
.word-phonetic { min-height: 20px; margin-top: 12px; color: var(--muted); font-family: Georgia, serif; font-size: 15px; letter-spacing: .02em; }
.word-source { color: var(--muted); font-size: 12px; margin-top: 10px; }
.definition { width: min(100%, 730px); max-width: 730px; margin-top: 24px; padding: 13px 20px; border: 1px solid transparent; border-radius: 8px; font-size: var(--definition-font-size); font-weight: 700; line-height: 1.6; overflow-wrap: anywhere; transition: color .25s ease, background-color .25s ease, border-color .25s ease; }
.definition.direction-en-zh { color: #0b5b48; background: #e9f7f0; border-color: #9dd7c2; }
.definition.direction-zh-en { color: #75430f; background: #fff3dc; border-color: #e2b86f; }
.definition.is-revealed { animation: definitionReveal .55s ease both; }
.definition.definition-flash.direction-en-zh { animation: definitionFlashGreen 1.25s ease both; }
.definition.definition-flash.direction-zh-en { animation: definitionFlashGold 1.25s ease both; }
@keyframes definitionReveal { from { opacity: .35; transform: translateY(4px); box-shadow: 0 0 0 rgba(23, 107, 91, 0); } 60% { box-shadow: 0 0 0 5px rgba(196, 123, 50, .12); } to { opacity: 1; transform: translateY(0); box-shadow: 0 0 0 0 rgba(23, 107, 91, 0); } }
@keyframes definitionFlashGreen { 0%, 100% { background: #e9f7f0; color: #0b5b48; border-color: #9dd7c2; } 35% { background: #bfe8d5; color: #063d30; border-color: #55b991; box-shadow: 0 0 0 5px rgba(85, 185, 145, .18); } 70% { background: #e9f7f0; color: #0b5b48; border-color: #9dd7c2; } }
@keyframes definitionFlashGold { 0%, 100% { background: #fff3dc; color: #75430f; border-color: #e2b86f; } 35% { background: #ffe0a3; color: #5b3005; border-color: #d28a27; box-shadow: 0 0 0 5px rgba(210, 138, 39, .18); } 70% { background: #fff3dc; color: #75430f; border-color: #e2b86f; } }
.definition span { display: inline-block; margin: 0 4px 5px; }
.definition em { color: var(--muted); font-size: 11px; font-style: normal; margin-left: 3px; }
.phrases { max-width: 750px; border-top: 1px solid var(--line); margin-top: 17px; padding-top: 13px; display: grid; gap: 5px; color: var(--muted); font-size: 12px; text-align: left; width: 100%; }
.phrases strong { color: var(--ink); font-weight: 600; margin-right: 7px; }
.sentences { max-width: 750px; border-top: 1px solid var(--line); margin-top: 15px; padding-top: 13px; display: grid; gap: 9px; color: var(--ink); font-size: 12px; line-height: 1.6; text-align: left; width: 100%; }
.sentences > div { display: grid; grid-template-columns: 34px 1fr; column-gap: 7px; }
.sentences strong { color: var(--green); font-size: 10px; font-weight: 700; }
.sentences span { grid-column: 2; color: var(--muted); }
.answer-hint { color: var(--red); font-size: 13px; margin-top: 20px; }
.card-actions { margin-top: auto; padding-top: 23px; display: flex; gap: 9px; }
.rating-actions { display: flex; width: min(560px, 100%); gap: 8px; margin-top: 16px; }
.rating-button { flex: 1; background: white; border: 1px solid var(--line); border-radius: 7px; padding: 10px; color: var(--ink); display: flex; justify-content: space-between; align-items: center; }
.rating-button small, .key-hint { color: var(--muted); font-size: 10px; }
.rating-hard:hover { border-color: var(--red); color: var(--red); }
.rating-mid:hover { border-color: var(--gold); color: var(--gold); }
.rating-easy:hover { border-color: var(--green); color: var(--green); }
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.quiz-option { background: white; border: 1px solid var(--line); border-radius: 7px; padding: 15px; text-align: left; color: var(--ink); }
.quiz-option:hover { border-color: var(--green); background: var(--green-pale); }
.quiz-option.correct { border-color: var(--green); background: var(--green-pale); }
.quiz-option.wrong { border-color: var(--red); background: #fff0ee; }
.empty-state { background: white; border: 1px solid var(--line); border-radius: 10px; text-align: center; padding: 60px 20px; }
.empty-icon { width: 38px; height: 38px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 50%; background: var(--green-pale); color: var(--green); font-weight: 700; }
.empty-state h3 { font-size: 18px; margin-bottom: 7px; }.empty-state p { color: var(--muted); font-size: 13px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.stat-card { background: white; border: 1px solid var(--line); border-radius: 8px; padding: 15px 16px; }.stat-card span, .stat-card small { display: block; color: var(--muted); font-size: 11px; }.stat-card strong { display: inline-block; margin: 7px 4px 3px 0; font-size: 24px; }.stat-card small { font-size: 10px; }
.lookup-section { margin-top: 38px; }.lookup-heading h3 { font-size: 17px; }.lookup-heading > span { color: var(--muted); font-size: 12px; }
.result-list { margin-top: 13px; border-top: 1px solid var(--line); }.result-row { display: grid; grid-template-columns: 1.1fr 2fr 90px; align-items: center; gap: 15px; padding: 13px 7px; border-bottom: 1px solid var(--line); }.result-word { font-family: Georgia, serif; font-size: 18px; }.result-meaning { color: var(--muted); font-size: 12px; }.result-source { color: var(--green); font-size: 10px; text-align: right; }
.export-section { margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--line); }.export-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 9px; margin-top: 16px; }.export-toolbar label, .export-search, .export-pagination label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }.export-toolbar input, .export-search input, .export-pagination input { border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; color: var(--ink); background: white; font-size: 12px; }.export-toolbar input { width: 190px; }.export-toolbar .button { padding: 10px 13px; }.export-view-controls { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 14px; }.export-search { flex: 1 1 260px; }.export-search input { width: min(100%, 360px); }.export-pagination { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 11px; }.export-pagination .button { padding: 8px 10px; }.export-pagination span { align-self: center; min-width: 74px; text-align: center; font-variant-numeric: tabular-nums; }.export-pagination label input { width: 72px; }.export-pagination button:disabled { opacity: .45; cursor: not-allowed; transform: none; }.export-note { color: var(--muted); font-size: 11px; margin: 12px 0; }.export-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 7px; background: white; }.export-table { width: 100%; border-collapse: collapse; min-width: 650px; font-size: 12px; }.export-table th { background: #f0f3f2; color: var(--muted); font-size: 10px; font-weight: 700; text-align: left; white-space: nowrap; }.export-table th:nth-child(2) { min-width: 78px; }.export-table th, .export-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }.export-table tr:last-child td { border-bottom: 0; }.export-table td:first-child { font-family: Georgia, serif; font-size: 16px; }.export-table td:nth-child(2) { color: var(--green); white-space: nowrap; }.export-table td:nth-child(3), .export-table td:nth-child(4) { color: var(--muted); line-height: 1.6; }
.is-hidden { display: none !important; }
.export-pagination span { white-space: nowrap; }
body[data-theme="night"] { --ink: #e7efeb; --muted: #a1b1aa; --line: #35453f; --paper: #141b18; --panel: #202b27; --green: #69c9a6; --green-dark: #9ce2c3; --green-pale: #214239; --gold: #e5b66e; --gold-pale: #443724; --red: #ef978b; --shadow: 0 12px 32px rgba(0, 0, 0, .24); }
body[data-theme="night"] .sidebar { background: #19231f; border-color: var(--line); }
body[data-theme="night"] .mode-switch { background: #2b3934; }
body[data-theme="night"] .mode-button.active { background: #263832; }
body[data-theme="night"] .weight-preset { background: transparent; color: var(--muted); }
body[data-theme="night"] .weight-preset:hover, body[data-theme="night"] .weight-preset.active { background: var(--green-pale); color: var(--green); }
body[data-theme="night"] .search-box, body[data-theme="night"] .daily-setting input, body[data-theme="night"] .export-toolbar input, body[data-theme="night"] .export-search input, body[data-theme="night"] .export-pagination input, body[data-theme="night"] .button-outline, body[data-theme="night"] .rating-button, body[data-theme="night"] .quiz-option, body[data-theme="night"] .stat-card, body[data-theme="night"] .empty-state, body[data-theme="night"] .export-table-wrap { background: var(--panel); color: var(--ink); }
body[data-theme="night"] .search-box { background: #1b2924; }
body[data-theme="night"] .progress-track { background: #30403a; }
body[data-theme="night"] .export-table th { background: #293832; }
body[data-theme="night"] .definition.direction-en-zh { color: #b9efd7; background: #1d493d; border-color: #438f76; }
body[data-theme="night"] .definition.direction-zh-en { color: #ffe0a3; background: #4a3b25; border-color: #a97d3e; }
body[data-theme="night"] .definition.definition-flash.direction-en-zh { animation-name: definitionFlashGreenNight; }
body[data-theme="night"] .definition.definition-flash.direction-zh-en { animation-name: definitionFlashGoldNight; }
@keyframes definitionFlashGreenNight { 0%, 100% { background: #1d493d; color: #b9efd7; border-color: #438f76; } 35% { background: #286452; color: #e1fff1; border-color: #69c9a6; box-shadow: 0 0 0 5px rgba(105, 201, 166, .2); } 70% { background: #1d493d; color: #b9efd7; border-color: #438f76; } }
@keyframes definitionFlashGoldNight { 0%, 100% { background: #4a3b25; color: #ffe0a3; border-color: #a97d3e; } 35% { background: #654c29; color: #fff0c9; border-color: #e5b66e; box-shadow: 0 0 0 5px rgba(229, 182, 110, .2); } 70% { background: #4a3b25; color: #ffe0a3; border-color: #a97d3e; } }
@media (max-width: 780px) { body { min-height: 100dvh; padding-bottom: env(safe-area-inset-bottom); overscroll-behavior-y: none; }.topbar { min-height: 64px; height: auto; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); gap: 8px; }.brand-lockup { min-width: 0; gap: 8px; }.brand-mark { width: 34px; height: 34px; font-size: 10px; }.brand-lockup h1 { font-size: 13px; white-space: nowrap; }.brand-lockup p { font-size: 9px; white-space: nowrap; }.topbar-actions { gap: 3px; }.topbar-actions .status-pill { display: none; }.topbar-actions .button { display: none; }.topbar-actions .theme-toggle, .topbar-actions .install-pwa { display: block; padding: 6px 7px; font-size: 10px; white-space: nowrap; }.workspace { display: block; }.sidebar { padding: 13px 14px 10px; border-right: 0; border-bottom: 1px solid var(--line); display: block; }.side-section { margin: 0 0 12px; padding: 0 0 12px; border-bottom: 1px solid var(--line); }.side-section:last-child { border-bottom: 0; margin-bottom: 0; }.section-kicker { margin-bottom: 8px; font-size: 9px; }.library-option { display: inline-flex; width: 49%; padding: 5px 0; font-size: 13px; }.weight-section { padding-bottom: 11px; }.weight-presets { gap: 4px; margin-bottom: 9px; }.weight-preset { padding: 5px 6px; font-size: 9px; }.weight-controls { grid-template-columns: 1fr 1fr; gap: 7px 12px; }.weight-control > span { font-size: 10px; }.weight-control input { height: 3px; }.weight-actions { margin-top: 9px; }.weight-section > p, .side-tip p, .data-backup-section > p { font-size: 10px; line-height: 1.45; }.mode-switch { max-width: 360px; }.daily-target { display: inline-flex; margin-right: 12px; }.daily-target strong { font-size: 25px; }.progress-track { display: inline-block; width: calc(100% - 100px); margin: 0; vertical-align: middle; }.daily-setting { margin: 8px 0 0; font-size: 10px; }.daily-setting input { width: 60px; padding: 5px 6px; }.side-tip { display: block; }.data-backup-actions { grid-template-columns: 1fr 1fr; gap: 6px; }.data-backup-actions .button { min-height: 36px; padding: 6px 5px; font-size: 10px; }.data-backup-actions .button-danger { grid-column: 1 / -1; }.main-content { padding: 20px 14px 38px; }.content-heading { align-items: start; flex-direction: column; gap: 12px; }.content-heading h2 { font-size: 24px; }.search-box { width: 100%; min-height: 42px; }.study-panel { margin-top: 18px; }.study-card { padding: 20px 15px; min-height: 340px; }.word { margin-top: 34px; }.word.meaning-prompt { --prompt-font-size: 21px; }.rating-button, .button { min-height: 40px; }.stats-grid { grid-template-columns: 1fr 1fr; gap: 7px; }.stat-card { padding: 12px; }.result-row { grid-template-columns: 1fr 2fr; }.result-source { display: none; }.quiz-options { grid-template-columns: 1fr; }.export-toolbar { align-items: stretch; }.export-toolbar label { flex: 1 1 100%; }.export-toolbar input { width: 100%; min-height: 40px; }.export-view-controls { display: grid; align-items: stretch; }.export-search input { width: 100%; min-height: 40px; }.export-pagination { justify-content: space-between; }.export-pagination span { order: -1; flex: 1 1 100%; text-align: left; } }
