:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #24372d;
  background: #f5f6f2;
  font-synthesis: none;
  --green: #245c44;
  --muted: #63716a;
  --line: #dce3dc;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; min-height: 44px; }
button:disabled { cursor: default; opacity: .4; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #a4b892; outline-offset: 3px; }
.page { width: min(100% - 40px, 780px); margin: 0 auto; padding: 48px 0 30px; }
.page-header { margin-bottom: 28px; }
.eyebrow { font-size: 12px; letter-spacing: .11em; color: var(--green); margin: 0 0 10px; }
h1 { font-size: clamp(28px, 5vw, 36px); letter-spacing: -.03em; line-height: 1.25; margin: 0 0 12px; }
.intro { color: var(--muted); font-size: 15px; line-height: 1.7; margin: 0 0 8px; }
.collection { font-size: 13px; color: var(--muted); margin: 0; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 18px; }
.mode-switch button { border: 1px solid var(--line); border-radius: 10px; background: #edf1e9; color: var(--green); padding: 11px; }
.mode-switch button[aria-pressed="true"] { border-color: var(--green); background: #fff; font-weight: 600; }
.filters { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin-bottom: 18px; }
.filters button { border: 1px solid var(--line); border-radius: 10px; padding: 9px 8px; background: #fff; color: var(--muted); font-size: 14px; }
.filters button[aria-pressed="true"] { background: var(--green); color: #fff; border-color: var(--green); }
.filters button:hover { border-color: var(--green); }
.search-label { display: block; font-size: 13px; margin: 0 0 7px; color: var(--muted); }
input[type="search"] { width: 100%; min-height: 45px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; color: #24372d; background: #fff; }
select { width: 100%; min-height: 45px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; color: #24372d; background: #fff; }
input::placeholder { color: #87938a; }
.progress-row { display: flex; justify-content: space-between; gap: 12px; margin: 12px 1px 14px; color: var(--muted); font-size: 12px; }
.progress-row p { margin: 0; line-height: 1.6; }
.word-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 30px; box-shadow: 0 6px 24px rgb(38 61 42 / 4%); }
.card-meta { display: flex; gap: 12px; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; line-height: 1.5; margin-bottom: 24px; }
.word-row { display: flex; align-items: flex-start; gap: 16px; }
.word-row h2 { flex: 1; min-width: 0; margin: 0; font-size: clamp(26px, 5vw, 38px); line-height: 1.25; letter-spacing: -.025em; color: #214b37; overflow-wrap: anywhere; }
.listen-button { flex: none; border: 1px solid var(--line); border-radius: 9px; background: #f7f9f5; color: var(--green); padding: 7px 11px; font-size: 13px; }
.example-label, .usage-label { color: var(--muted); font-size: 12px; margin: 22px 0 8px; }
.example { color: #44564b; font-size: 17px; line-height: 1.7; margin: 0; overflow-wrap: anywhere; }
.rating { font-size: 12px; color: var(--muted); margin: 18px 0 14px; }
.reveal-button { width: 100%; border: 1px solid var(--green); border-radius: 10px; background: var(--green); color: #fff; padding: 13px 12px; }
.reveal-button:hover { background: #1b4d36; }
.answer { padding: 20px 1px 4px; }
.meaning { margin: 0; font-size: 21px; line-height: 1.5; font-weight: 600; overflow-wrap: anywhere; }
.usage-label { margin-top: 16px; }
.usage { margin: 0; color: #526357; font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; }
.rating-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.rating-actions button { border: 1px solid var(--line); border-radius: 10px; background: #f8f9f6; color: #3f5748; padding: 10px; }
.rating-actions button[aria-pressed="true"] { border-color: var(--green); background: #eaf0e5; }
.rating-actions button:hover { border-color: var(--green); }
.navigation { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; border-top: 1px solid #e9eee7; margin-top: 24px; padding-top: 17px; }
.navigation button { color: var(--green); border: none; background: transparent; padding: 8px 0; }
.navigation button:first-child { text-align: left; }
.navigation button:last-child { text-align: right; }
#position { color: var(--muted); font-size: 12px; }
.empty-state { border: 1px dashed #c6d2c7; background: #fff; border-radius: 20px; text-align: center; padding: 40px 24px; }
.empty-state h2 { font-size: 20px; line-height: 1.5; margin: 0 0 12px; }
.empty-state p { color: var(--muted); font-size: 14px; line-height: 1.7; margin: 0 0 18px; }
.empty-state button, .export-button { border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--green); padding: 9px 14px; font-size: 13px; }
.notice { color: var(--green); font-size: 13px; line-height: 1.6; min-height: 21px; margin: 14px 1px 12px; }
.page-footer { color: var(--muted); font-size: 12px; line-height: 1.8; }
.page-footer p { margin: 9px 0 0; }
.backup-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.undo-panel { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; background: #edf3e8; border: 1px solid #cbd9c5; border-radius: 10px; margin-top: 14px; font-size: 13px; }
.undo-panel button { border: none; background: transparent; color: var(--green); padding: 6px; flex: none; }
.test-setup h2, #test-results h2 { margin: 0 0 12px; font-size: 24px; line-height: 1.4; }
.test-setup > p { color: var(--muted); font-size: 14px; line-height: 1.8; margin: 0 0 20px; }
.test-setup .setup-count { margin: 12px 0; font-size: 13px; }
.secondary-button { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #f8f9f6; color: var(--green); padding: 11px; margin-top: 10px; }
.test-progress { color: var(--muted); font-size: 13px; margin: 0 0 24px; }
.test-prompt { color: var(--muted); font-size: 14px; line-height: 1.7; margin: 24px 0 18px; }
.result-intro, .result-note { color: var(--muted); font-size: 14px; line-height: 1.8; }
.result-counts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.result-counts p { margin: 4px 0 12px; background: #f3f6ef; border-radius: 10px; padding: 16px; }
.result-counts strong { display: block; font-size: 30px; line-height: 1.2; color: var(--green); }
.result-counts span { font-size: 12px; color: var(--muted); }
.result-list { list-style: none; padding: 0; margin: 20px 0; }
.result-list li { display: flex; gap: 12px; justify-content: space-between; padding: 13px 0; border-top: 1px solid var(--line); }
.result-list li > div { min-width: 0; }
.result-list strong { font-size: 16px; overflow-wrap: anywhere; }
.result-list p { font-size: 13px; line-height: 1.7; color: var(--muted); margin: 5px 0 0; overflow-wrap: anywhere; }
.result-list li > span { flex: none; font-size: 12px; line-height: 1.7; }
.result-recalled { color: var(--green); }
.result-forgotten { color: #946340; }
@media (max-width: 520px) {
  .page { width: calc(100% - 28px); padding-top: 28px; }
  .page-header { margin-bottom: 22px; }
  .filters { grid-template-columns: repeat(2, 1fr); }
  .filters button:last-child { grid-column: 1 / -1; }
  .word-card { padding: 22px 18px; border-radius: 16px; }
  .card-meta { font-size: 11px; gap: 8px; margin-bottom: 20px; }
  .word-row { gap: 10px; flex-wrap: wrap; }
  .word-row h2 { font-size: 29px; flex-basis: 220px; }
  .listen-button { padding: 6px 9px; }
  .example { font-size: 16px; }
  .meaning { font-size: 20px; }
  .progress-row { font-size: 11px; }
}
@media (prefers-reduced-motion: no-preference) {
  button { transition: background .15s, border-color .15s; }
}
