:root {
  color-scheme: light;
  --ink: #172d40;
  --muted: #506478;
  --blue: #194a86;
  --light: #e9f1ff;
  --green: #17614d;
  --border: #d9e4eb;
  --paper: #f4f7fa;
  --white: #fff;
  --warning: #9b4521;
  --accent: #fbaf52;
  font-family: 'Aptos', 'Microsoft YaHei', 'PingFang SC', 'Noto Sans CJK SC', sans-serif;
  font-size: 100%;
  color: var(--ink);
  background: var(--paper);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .52; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid #396fc5; outline-offset: 3px; }
a { color: var(--blue); }
h1,h2,h3,p { margin: 0; }
p { line-height: 1.65; }
.shell { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.bar { background: #fff; border-bottom: 1px solid var(--border); }
.bar-layout { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; min-height: 76px; }
.brand { display: flex; gap: 12px; align-items: center; justify-self: start; text-align: left; padding: 0; border: 0; background: none; color: var(--ink); font-weight: 800; font-size: 1.2rem; white-space: nowrap; }
.brand small { display: block; color: var(--muted); font-size: .78rem; font-weight: 600; margin-top: 2px; }
.brand-mark { display: grid; place-content: center; width: 42px; height: 42px; border-radius: 12px; background: #193854; color: #fff; font-family: Georgia, serif; font-size: 1.65rem; letter-spacing: -.075em; white-space: nowrap; display: flex; align-items: center; }
.brand-mark span { color: var(--accent); }
nav { display: flex; gap: 8px; }
nav button { background: transparent; border: 0; border-radius: 8px; padding: 10px 14px; color: var(--muted); font-weight: 700; }
nav button:hover { background: #edf2f7; color: var(--ink); }
nav button[aria-current] { color: var(--blue); background: #e9f1ff; }
main { min-height: 65vh; padding-block: 36px 54px; outline: none; }
.hero { background: #183754; color: #fff; border-radius: 24px; padding: clamp(24px,4vw,44px); display: grid; grid-template-columns: 1.15fr 1fr; gap: 26px; align-items: center; overflow: hidden; isolation: isolate; position: relative; }
.hero::after { content: ''; position: absolute; width: 300px; height: 300px; right: -156px; top: -168px; border: 1px solid #5b7995; border-radius: 50%; box-shadow: 0 0 0 32px #31516d,0 0 0 62px #24445f; z-index: -1; }
.hero h1 { font-size: clamp(2.2rem,5.4vw,4rem); line-height: 1.07; margin: 12px 0; letter-spacing: -.055em; }
.hero p { color: #e2edf8; }
.today-label { color: #f7c687; font-weight: 700; font-size: .94rem; }
.unit { font-family: Georgia, 'Times New Roman', serif; font-size: 1.3rem; font-style: italic; margin-top: 5px; }
.rhythm { background: #234461; border: 1px solid #52708a; border-radius: 16px; padding: 24px 20px 19px; }
.rhythm h2 { font-size: 1.04rem; margin-bottom: 17px; }
.track { display: grid; grid-template-columns: repeat(3,1fr); padding: 0; margin: 0; list-style: none; position: relative; }
.track::before { content: ''; position: absolute; top: 6px; inset-inline: 6px 28%; border-top: 1px solid #90a4b8; }
.track li { position: relative; }
.track i { display: block; background: #c9ddf3; width: 13px; height: 13px; border-radius: 50%; margin-bottom: 12px; }
.track li:first-child i { background: #ffbd65; }
.track b { display: block; margin-bottom: 4px; }
.track small { color: #dbe7f4; font-size: .88rem; }
.home-grid,.stats { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.home-grid { margin-top: 20px; }
.card { background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 24px; }
.card h2 { font-size: 1.34rem; margin-bottom: 8px; }
.card p,.muted { color: var(--muted); }
.feature { position: relative; min-height: 205px; display: flex; flex-direction: column; align-items: start; }
.feature .actions { margin-top: auto; padding-top: 18px; }
.feature h2 { margin: 5px 0 9px; }
.feature-top { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 10px; }
.tag { color: var(--blue); background: #e9f1ff; border-radius: 5px; display: inline-block; padding: 3px 7px; font-size: .84rem; font-weight: 700; line-height: 1.38; }
.tag.amber { color: #794319; background: #fff0d7; }
.tag.ok { color: var(--green); background: #e1f4eb; }
.tag.wrong { color: #922d2a; background: #faebe8; }
.tag.neutral { color: #46586b; background: #eef2f5; }
.count { font-size: 2rem; font-variant-numeric: tabular-nums; font-weight: 800; line-height: 1; }
.count small { font-size: .88rem; color: var(--muted); font-weight: 600; margin-left: 3px; }
.btn { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 9px; min-height: 43px; padding: 9px 15px; font-weight: 750; text-align: center; text-decoration: none; color: #fff; background: var(--blue); }
.btn:hover:not(:disabled) { background: #123d70; }
.btn.secondary { background: #fff; color: var(--blue); border-color: #b7cadb; }
.btn.secondary:hover:not(:disabled) { background: #eaf2ff; }
.btn.safe { background: #17614d; }
.btn.safe:hover:not(:disabled) { background: #104c3c; }
.btn.ghost { background: transparent; color: var(--blue); border-color: transparent; }
.btn.ghost:hover { background: #eaf2ff; }
.actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.section-head { margin-bottom: 22px; }
.section-head h1 { font-size: clamp(1.75rem,4vw,2.6rem); margin-bottom: 8px; letter-spacing: -.04em; }
.section-head h1 span[lang=en] { font-family: Georgia, serif; font-weight: 700; }
.section-head p { color: var(--muted); }
.section-title { margin: 26px 0 14px; font-size: 1.23rem; }
.resume { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding-block: 15px; margin-top: 12px; }
.resume b { display: block; margin-bottom: 3px; }
.resume p { font-size: .9rem; }
.toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter { font-weight: 700; color: var(--muted); background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }
.filter[aria-pressed=true] { color: var(--blue); background: #e9f1ff; border-color: #a2bce2; }
.search,.entry { color: var(--ink); background: #fff; border: 1px solid #aec2d5; border-radius: 9px; padding: 10px 12px; }
.search { width: min(270px,100%); }
.word-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 12px; }
.word-row { min-width: 0; min-height: 72px; display: grid; grid-template-columns: 24px minmax(0,1fr) auto; gap: 11px; padding: 11px 14px; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.word-row:has(input:checked) { background: #eaf2ff; border-color: #a3bedf; }
.word-row input { width: 18px; height: 18px; accent-color: var(--blue); }
.word-link { display: block; text-align: left; color: var(--ink); background: none; border: 0; padding: 0; max-width: 100%; overflow-wrap: anywhere; }
.word-link:hover b { text-decoration: underline; }
.word-link b { display: block; font-size: 1.06rem; }
.word-link small { color: var(--muted); font-size: .88rem; }
.word-tags { display: flex; flex-wrap: wrap; justify-content: end; gap: 5px; }
.selection-bar { position: sticky; bottom: 10px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; margin: 18px 0 0; background: #fff; border: 1px solid #b4c6d7; box-shadow: 0 5px 25px #19385421; border-radius: 13px; padding: 12px 15px; z-index: 2; }
.learning { max-width: 800px; margin: 0 auto; }
.learning .section-head { margin-bottom: 14px; }
.learning h1 { font-size: clamp(1.55rem,3.7vw,2rem); }
.learning .card { padding: clamp(19px,4vw,32px); }
.learning .toolbar { margin-bottom: 12px; }
.progress { accent-color: var(--blue); width: 100%; height: 10px; margin-bottom: 15px; display: block; }
.wordcard-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 10px; }
.wordcard-head strong { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(1.95rem,6vw,3.1rem); overflow-wrap: anywhere; }
.word-phonetics { font-size: 1rem; margin: 0 0 12px; overflow-wrap: anywhere; }
.list-phonetics { display: block; color: var(--muted); font-size: .85em; overflow-wrap: anywhere; }
.meaning { color: var(--ink); font-size: 1.13rem; }
.quote { background: #edf4ff; border-left: 4px solid #658fca; border-radius: 0 9px 9px 0; margin: 20px 0 12px; padding: 14px 16px; }
.quote p { color: var(--ink); font-size: 1.15rem; }
.quote small,.source-note { display: block; color: var(--muted); margin-top: 8px; line-height: 1.55; font-size: .9rem; }
mark { background: #ffe4ac; color: inherit; padding-inline: 1px; border-radius: 3px; }
details { margin-top: 12px; }
summary { color: var(--blue); cursor: pointer; padding: 5px 0; font-weight: 700; }
.passage { margin-top: 8px; white-space: pre-line; color: var(--ink); line-height: 1.7; }
.divider { border-top: 1px solid var(--border); margin-top: 22px; padding-top: 17px; }
.test-center { text-align: center; }
.test-center .actions { justify-content: center; }
.test-center .entry { display: block; width: min(350px,100%); margin: 10px auto 14px; font-size: 1.25rem; text-align: center; }
.play { display: inline-flex; align-items: center; gap: 8px; }
.play::before { content: '▶'; font-size: .8em; }
.play.main { min-width: 155px; min-height: 53px; margin: 5px 0 16px; }
.feedback { margin-top: 14px; padding: 14px; border-radius: 10px; background: #ecf7f1; }
.feedback.bad { background: #fff0e4; }
.feedback strong { display: block; font-size: 1.2rem; margin: 2px 0; overflow-wrap: anywhere; }
.hint { margin: 12px 0 5px; color: #795022; background: #fff1db; padding: 8px; border-radius: 7px; }
.speech-status { min-height: 1.2em; color: var(--muted); font-size: .88rem; }
.result-list { margin: 18px 0; }
.result-row,.history-row { display: grid; grid-template-columns: minmax(90px,1fr) repeat(2,minmax(85px,1fr)); gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.result-row b { font-size: 1rem; }
.history-row { grid-template-columns: minmax(92px,.7fr) minmax(90px,1fr) minmax(100px,1fr); }
.collection-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.collection-grid-pair { grid-template-columns: repeat(2,minmax(0,1fr)); }
.vocabulary-section + .vocabulary-section { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }
.vocabulary-section h2 { margin: 0 0 13px; }
.collection { display: flex; justify-content: space-between; align-items: center; text-align: left; gap: 10px; cursor: pointer; color: inherit; }
.collection strong, .collection small { display: block; }
.collection small { color: var(--muted); margin-top: 4px; }
.collection > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.collection > .tag { flex-shrink: 0; white-space: nowrap; }
.collection:hover, .records-cards button:hover { border-color: #a3bedf; }
.select-tools { margin-bottom: 8px; justify-content: flex-start; }
#word-list .word-link { justify-self: start; }
.drag-selection { position: fixed; z-index: 20; pointer-events: none; border: 1px solid #446da7; border-radius: 3px; background: rgba(79,133,207,.20); }
.records-cards { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin: 0 0 18px; }
.records-cards .card { padding: 16px; cursor: pointer; color: inherit; text-align: left; }
.records-cards [aria-pressed="true"] { border-color: #638bc3; background: #edf4ff; }
.records-cards strong { font-size: 1.72rem; display: block; }
.records-cards strong small, .divider h2 small { font-size: .8rem; font-weight: 400; }
.record-range { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.record-range label { display: grid; gap: 4px; }
.record-range input { font: inherit; border: 1px solid var(--border); border-radius: 7px; background: #fff; color: inherit; padding: 6px 8px; min-width: 0; }
.report-word { display: grid; grid-template-columns: minmax(120px,1fr) minmax(0,2fr); align-items: start; gap: 14px; border-top: 1px solid var(--border); padding: 9px 0; }
.report-word ul { padding: 0; margin: 0; list-style: none; }
.report-word li { display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: 8px; padding: 4px 0; }
.pending-word { grid-template-columns: minmax(0,1fr) minmax(65px,auto); }
.footer { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; color: var(--muted); padding-block: 17px 24px; border-top: 1px solid var(--border); font-size: .88rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 760px) {
  .shell { width: calc(100% - 32px); }
  .bar-layout { grid-template-columns: 1fr; gap: 7px; padding-block: 10px; min-height: auto; }
  nav { grid-row: 2; grid-column: 1 / -1; }
  nav button { padding: 8px 12px; }
  main { padding-block: 22px 36px; }
  .hero { grid-template-columns: 1fr; }
  .home-grid,.word-list { grid-template-columns: 1fr; }
  .collection-grid,.records-cards { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .collection { padding: 16px 12px; gap: 6px; }
  .report-word { grid-template-columns: 1fr; gap: 3px; }
  .feature { min-height: 180px; }
}
@media (pointer: coarse) {
  .mouse-help { display: none; }
}
@media (max-width: 375px) {
  .shell { width: calc(100% - 24px); }
  .word-row { padding-inline: 9px; gap: 6px; }
  .records-cards { gap: 5px; }
  .records-cards .card { padding: 9px; }
  .tag { font-size: .8rem; }
}
