:root {
    color-scheme: light;
    --ink: #242d29;
    --muted: #606c65;
    --green: #287450;
    --line: #d7dfda;
    --paper: #ffffff;
}
* { box-sizing: border-box; letter-spacing: 0; }
[hidden] { display: none !important; }
body {
    margin: 0;
    background: #f5f7f6;
    color: var(--ink);
    font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
main { max-width: 960px; margin: auto; padding: 0 24px 48px; }
h1, h2, h3, p { margin: 0; overflow-wrap: anywhere; }
h1 { font-size: 24px; line-height: 1.4; }
h2 { font-size: 19px; line-height: 1.5; }
h3 { font-size: 14px; font-weight: 500; color: var(--muted); }
a { color: var(--green); text-underline-offset: 3px; overflow-wrap: anywhere; }
button, input, select { font: inherit; color: inherit; }
button, input:not([type="checkbox"]), select { min-height: 44px; border: 1px solid #a9b9af; border-radius: 6px; background: var(--paper); }
button { padding: 8px 14px; cursor: pointer; line-height: 1.4; overflow-wrap: anywhere; }
button:hover:not(:disabled) { border-color: var(--green); background: #edf6f0; }
button:disabled { cursor: default; opacity: .5; }
button.primary { background: var(--green); border-color: var(--green); color: white; font-weight: 600; }
button.primary:hover:not(:disabled) { background: #205e40; }
button.quiet { background: transparent; border-color: transparent; padding-inline: 8px; color: var(--green); }
button.icon-button { width: 44px; height: 44px; flex: 0 0 44px; padding: 4px; font-size: 23px; }
input:not([type="checkbox"]), select { width: 100%; min-width: 0; padding: 8px 10px; }
input[type="checkbox"] { width: 18px; height: 18px; flex: 0 0 18px; accent-color: var(--green); margin: 0; }
label { display: block; font-size: 14px; margin-bottom: 5px; }
:focus-visible { outline: 3px solid #2778a0; outline-offset: 3px; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 88px; padding-block: 16px; border-bottom: 1px solid var(--line); }
.account { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.account button { white-space: nowrap; }
.notice { margin-top: 16px; padding: 10px 12px; border-left: 3px solid #a74e30; background: #fff1e9; color: #74381f; font-size: 14px; }
.login-view { max-width: 360px; margin: 32px auto; }
.login-view h2 { margin-bottom: 20px; }
.login-view select { margin-bottom: 18px; }
.login-view .primary { width: 100%; }
.check-row { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0; cursor: pointer; overflow-wrap: anywhere; }
.remember { margin: 12px 0 20px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0 16px; }
.muted { color: var(--muted); font-size: 14px; font-weight: 400; }
#total-count { margin-left: 6px; font-variant-numeric: tabular-nums; }
.filters { border: 0; margin: 0; padding: 0; min-width: 0; }
.filter-row { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 16px; }
.search-input { display: flex; gap: 6px; }
.search-input input { flex: 1; }
.deck-filter { border-block: 1px solid var(--line); margin-top: 20px; padding: 10px 0; }
.deck-filter summary { cursor: pointer; padding: 6px 2px; min-height: 38px; font-size: 14px; overflow-wrap: anywhere; }
#deck-summary { color: var(--muted); margin-left: 10px; }
.all-decks { margin-top: 10px; font-weight: 600; }
.deck-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 20px; padding-block: 4px 8px; max-height: 300px; overflow-y: auto; }
.deck-options label { min-width: 0; padding: 5px 2px; }
.deck-options span { min-width: 0; }
.pool-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-block: 20px; }
#pool-count { font-size: 14px; color: var(--muted); }
.state-view, .empty { padding: 28px 0; color: var(--muted); }
.state-view button { margin-top: 12px; }
.card-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.card-list:empty { border: 0; }
.card-list li { border-bottom: 1px solid var(--line); }
.card-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; width: 100%; text-align: left; padding: 14px 4px; background: transparent; border: 0; border-radius: 0; }
.row-prompt { grid-column: 1; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.row-deck { grid-column: 1; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.row-status { grid-column: 2; grid-row: 1 / 3; align-self: center; font-size: 13px; }
.status-label, .row-status { color: #81522b; }
.is-mastered { color: var(--green); }
.show-more { display: block; margin: 20px auto 0; }
.review-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; font-variant-numeric: tabular-nums; }
.source-line { font-size: 14px; color: var(--muted); margin: 8px 0 16px; overflow-wrap: anywhere; }
.flashcard { border: 1px solid var(--line); border-radius: 8px; background: var(--paper); padding: 20px 24px; }
.side-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.side-heading button { font-size: 14px; }
.card-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 24px; line-height: 1.65; }
#prompt { padding: 12px 0 24px; min-height: 104px; }
.answer-side { border-top: 1px solid var(--line); padding-top: 8px; }
.answer-content { min-height: 128px; display: flex; align-items: flex-start; padding-top: 12px; }
#answer { font-size: 22px; color: #205e40; }
#reveal { margin-top: 6px; }
.speech-toolbar { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.speech-state { min-height: 26px; font-size: 13px; color: var(--muted); margin: 4px 0 8px; }
.mark-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mark-actions button { min-height: 48px; }
.save-state { min-height: 32px; font-size: 14px; color: var(--green); padding-top: 6px; }
.save-state.is-error { color: #9c3829; }
.review-navigation { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 560px) {
    main { padding-inline: 16px; }
    .page-header { min-height: 78px; gap: 8px; }
    h1 { font-size: 21px; }
    .account { gap: 2px; }
    .account button { padding-inline: 4px; }
    .filter-row { grid-template-columns: minmax(0, 1fr) 106px; gap: 10px; }
    .filter-row select { padding-inline: 6px; }
    .search-input { gap: 4px; }
    .search-input .icon-button { width: 36px; flex-basis: 36px; }
    .deck-options { grid-template-columns: minmax(0, 1fr); }
    .flashcard { padding: 12px 16px; }
    .card-text { font-size: 22px; }
    #answer { font-size: 20px; }
    .mark-actions { gap: 8px; }
    .mark-actions button { padding-inline: 8px; }
    .speech-toolbar { gap: 8px; }
}
