:root {
  color-scheme: light;
  --bg: #f6f7f5;
  --panel: #fff;
  --panel-strong: #edf1e9;
  --text: #29352d;
  --muted: #697469;
  --line: #dfe5dc;
  --brand: #52664a;
  --brand-dark: #394e33;
  --accent: #a95147;
  --gold: #8c7138;
  --good: #35704b;
  --bad: #ac403e;
  --shadow: 0 4px 16px rgb(41 53 45 / 4%);
}
* { box-sizing: border-box; letter-spacing: 0; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; font-size: 14px; line-height: 1.6; }
button, input, textarea { font: inherit; }
button { cursor: pointer; border: 0; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; opacity: .55; }
button, a { touch-action: manipulation; }
button:focus-visible, a:focus-visible { outline: 3px solid #a0b58f; outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
h2 { font-size: 21px; margin-bottom: 0; }
h3 { font-size: 17px; }
b, strong { font-weight: 650; }
svg.lucide { width: 20px; height: 20px; stroke-width: 1.7; flex: 0 0 auto; vertical-align: middle; }
.app-shell { width: min(1240px, calc(100% - 64px)); margin: 0 auto; padding: 26px 0 48px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-bottom: 24px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-symbol { display: grid; place-items: center; width: 44px; height: 44px; background: var(--brand); color: #fff; border-radius: 8px; }
.brand-symbol svg { width: 25px; height: 25px; }
.topbar h1 { font-size: 23px; margin: 0; }
.eyebrow { font-size: 11px; font-weight: 600; color: var(--muted); margin: 0 0 4px; }
.brand-lockup .eyebrow { margin: 1px 0 0; font-size: 10px; }
.user-pill { display: flex; align-items: center; gap: 14px; font-size: 13px; min-width: 0; }
#userName { overflow-wrap: anywhere; }
.auth-panel { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); align-items: center; gap: 64px; padding: 30px 0; }
.auth-copy { min-height: 530px; padding: 56px 44px; background: #52664a; color: #fff; display: flex; flex-direction: column; justify-content: center; position: relative; }
.auth-emblem { margin-bottom: 42px; color: #dce6d1; }
.auth-emblem svg { width: 52px; height: 52px; stroke-width: 1.2; }
.auth-copy h2 { font-size: 46px; font-weight: 650; line-height: 1.5; }
.auth-copy .auth-translation { margin: 24px 0 0; max-width: 330px; font-size: 16px; line-height: 1.9; color: #e1e8da; }
.auth-card { display: flex; flex-direction: column; gap: 22px; width: 100%; max-width: 380px; justify-self: center; padding: 30px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: #f1f3ee; padding: 4px; border-radius: 8px; margin-bottom: 8px; }
.tab { color: var(--muted); background: transparent; border-radius: 6px; min-height: 40px; font-weight: 600; }
.tab.active { background: #fff; color: var(--brand-dark); box-shadow: 0 1px 5px rgb(41 53 45 / 8%); }
.auth-card .full { min-height: 46px; }
#authMsg:empty { display: none; }
.primary, .secondary, .ghost, .link-button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 42px; padding: 9px 16px; border: 1px solid transparent; border-radius: 6px; font-weight: 600; line-height: 1.5; text-align: center; text-decoration: none; transition: background .16s, border-color .16s; }
.primary { color: #fff; background: var(--brand); }
.primary:hover:not(:disabled) { background: var(--brand-dark); }
.secondary, .link-button { background: #fff; border-color: var(--line); color: var(--text); }
.ghost { background: transparent; color: var(--muted); }
.secondary:hover:not(:disabled), .link-button:hover, .ghost:hover { background: var(--panel-strong); border-color: #c5d0be; }
.compact { min-height: 36px; padding: 6px 11px; font-size: 13px; }
.full { width: 100%; }
.icon-only { width: 38px; height: 38px; padding: 0; flex: 0 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
label { display: grid; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 550; min-width: 0; }
input, textarea { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 6px; padding: 11px 12px; color: var(--text); background: #fff; outline: none; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #7c857c; font-weight: 400; }
input:focus, textarea:focus { border-color: #829a73; box-shadow: 0 0 0 3px rgb(130 154 115 / 13%); }
input:disabled { background: #f1f3ef; }
.hint, .notice { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.notice[data-tone="good"], .good { color: var(--good); }
.notice[data-tone="bad"], .bad { color: var(--bad); }
.dashboard { display: grid; grid-template-columns: 158px minmax(0, 1fr); gap: 24px 30px; align-items: start; }
.section-tabs { grid-column: 1; grid-row: 1 / 5; position: sticky; top: 24px; display: flex; flex-direction: column; gap: 8px; padding-right: 18px; }
.nav-tab { position: relative; display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 12px 16px; background: transparent; border-radius: 6px; color: var(--muted); font-weight: 550; white-space: nowrap; }
.nav-tab:hover { background: #edf1e9; }
.nav-tab.active { color: var(--brand-dark); background: #e3eadb; font-weight: 650; }
.nav-tab[data-view="admin"] { order: -1; }
.nav-tab.has-unread::after { content: ""; position: absolute; top: 10px; right: 12px; width: 7px; height: 7px; background: #c74746; border-radius: 50%; box-shadow: 0 0 0 2px #fff; }
.welcome-band, .stats-grid, .view-pane { grid-column: 2; min-width: 0; }
.welcome-band { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 28px 32px; background: #e4ebdd; border-left: 3px solid #95a786; }
.welcome-date { color: #56684e; font-size: 12px; margin-bottom: 10px; }
.welcome-band h2 { font-size: 26px; color: #354c2e; }
.welcome-band p:last-child { color: #5e7055; margin: 8px 0 0; font-size: 13px; }
.welcome-art.lucide { width: 68px; height: 68px; color: #829773; stroke-width: 1; margin-right: 12px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stats-grid.admin-mode { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat { position: relative; border-radius: 8px; border: 1px solid var(--line); background: #fff; padding: 18px 20px; min-height: 110px; text-align: left; }
.stat-icon.lucide { position: absolute; right: 16px; bottom: 20px; width: 24px; height: 24px; color: #8a9c7d; }
.stat span { display: block; color: var(--muted); font-size: 12px; padding-right: 6px; }
.stat strong { display: block; margin-top: 12px; padding-right: 30px; font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.user-stat:nth-child(4) { background: #f7eeea; border-color: #eaded6; }
.user-stat:nth-child(4) .stat-icon { color: #b98e77; }
.user-stat:nth-child(5) { background: #edf2f6; border-color: #dce4eb; }
.user-stat:nth-child(5) .stat-icon { color: #7c98ac; }
.stat-action { color: var(--text); width: 100%; }
.stat-action:disabled { cursor: default; opacity: 1; }
.stat-action.highlight { background: #f8ebe6; border-color: #e8cfc2; }
.stat-action.highlight .stat-icon { color: #ac7056; }
.stat-action.highlight:hover { background: #f2dfd5; }
.view-pane { display: none; }
.view-pane.active { display: block; }
.table-panel, .side-panel, .admin-form { padding: 22px 0; background: transparent; border-top: 1px solid var(--line); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; }
.panel-head > div { min-width: 0; }
.panel-head h2 { font-size: 19px; }
.panel-head .eyebrow { display: none; }
.practice-panel { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 22px 24px; margin-bottom: 20px; border: 1px solid #e7dbc7; border-radius: 8px; background: #fff0dd; color: #443a2c; }
.practice-panel h2 { font-size: 22px; color: #3c4d37; }
.practice-panel p:last-child { margin: 6px 0 0; color: #7a6d5c; font-size: 13px; }
.practice-panel .primary { background: #9b7048; flex: 0 0 auto; }
.practice-panel .primary:hover:not(:disabled) { background: #775335; }
.task-panel { padding-top: 0; border: 0; margin-bottom: 20px; }
.task-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.task-card { display: grid; align-content: start; gap: 12px; min-height: 115px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: #fff; text-align: left; }
.task-card strong { font-size: 13px; line-height: 1.7; }
.task-card span { font-size: 12px; color: var(--muted); }
.task-card.past { background: #eef0ec; }
.task-card.current { background: #e6eedf; color: #3f5835; border-color: #c9d8bd; }
.task-card.current span { color: #506a42; }
.task-card:hover { border-color: #8d9e80; }
.task-card.selected { color: #fff; background: var(--brand); border-color: var(--brand); }
.task-card.selected span { color: #e6eddf; }
.batch-banner { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 18px 0; border-top: 1px solid var(--line); margin-bottom: 6px; }
.batch-banner h2 { font-size: 18px; }
.batch-banner .eyebrow { font-size: 10px; }
.batch-meta { display: grid; gap: 3px; text-align: right; color: var(--muted); font-size: 12px; flex-shrink: 0; }
#batchProgress { color: var(--brand); font-size: 15px; font-weight: 650; }
.learn-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 24px; }
.question-panel { padding: 28px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.question-top { display: flex; justify-content: space-between; gap: 16px; }
.question-panel h2 { font-size: 32px; line-height: 1.45; margin: 14px 0 0; }
.phonetic { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.example { color: var(--muted); min-height: 25px; margin: 20px 0; font-size: 14px; overflow-wrap: anywhere; }
.answer-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.answer-form input { min-height: 48px; font-size: 18px; }
.answer-form button { min-width: 78px; }
.timer-wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 42px; align-items: center; gap: 12px; margin: 18px 0; }
.timer-wrap::before { content: ""; position: absolute; left: 0; right: 54px; height: 6px; border-radius: 4px; background: #edf1e9; }
.timer-bar { position: relative; width: 100%; height: 6px; border-radius: 4px; background: #829970; transition: width .25s linear; }
.timer-bar[data-low="true"] { background: var(--accent); }
.timer-wrap strong { text-align: right; color: var(--brand); font-size: 15px; font-variant-numeric: tabular-nums; }
.question-actions, .row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.question-panel:is([data-phase="idle"], [data-phase="ready"], [data-phase="review"]) :is(.timer-wrap, .answer-form, #nextBtn) { display: none; }
.question-panel:is([data-phase="idle"], [data-phase="review"]) .question-actions { margin-top: 0; }
.ready-next:disabled { background: #e9eee4; color: var(--muted); }
.ready-next.pulse { background: var(--brand-dark); box-shadow: 0 0 0 3px #dce7d3; }
.side-panel { padding: 12px 0; border: 0; }
.side-panel h3 { margin: 0 0 14px; font-size: 15px; }
.recent-list, .leader-list, .word-list, .notification-list, .result-list, .summary-list, .admin-detail-list { display: grid; gap: 0; min-width: 0; }
.recent-item, .leader-item, .word-row, .result-row, .summary-row, .admin-detail-row { display: grid; gap: 8px; padding: 15px 4px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.recent-item { grid-template-columns: minmax(0, 1fr) auto; align-items: center; font-size: 13px; }
.recent-item span, .word-row span, .word-row small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.leader-item { grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; padding: 18px 12px; }
.leader-item:first-child { background: #edf1e6; }
.rank { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 6px; color: var(--brand); background: #e6eddc; font-size: 14px; font-variant-numeric: tabular-nums; }
.rank-person { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; min-width: 0; }
.like-button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 54px; min-height: 36px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; padding: 5px 8px; }
.like-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; }
.like-button[aria-pressed="true"] { background: #e3edda; color: var(--brand); border-color: #bdd0ac; opacity: 1; }
.like-button[aria-pressed="true"] svg { fill: currentColor; }
.like-button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.speech-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 14px 0; }
.speech-toggle { display: inline-flex; align-items: center; gap: 7px; }
.speech-toggle input { width: 17px; height: 17px; accent-color: var(--brand); }
.speech-controls .hint { flex-basis: 100%; }
.speech-controls .hint:empty { display: none; }
.question-panel:is([data-phase="idle"], [data-phase="review"]) .speech-controls { display: none; }
.leader-item:first-child .rank { background: var(--brand); color: #fff; }
.empty { color: var(--muted); margin: 0; padding: 28px 8px; font-size: 13px; text-align: center; }
.task-list > .empty { grid-column: 1 / -1; background: #edf1e9; }
.result-panel { margin-top: 24px; }
.result-list { gap: 8px; }
.result-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) auto; padding: 14px; border: 1px solid var(--line); border-radius: 6px; align-items: center; }
.result-row.correct { background: #eaf5e9; border-color: #c9dfc4; }
.result-row.wrong { background: #fbeceb; border-color: #edceca; }
.result-row small, .summary-row small, .admin-detail-row small { color: var(--muted); }
#resultScore { color: var(--brand); font-size: 23px; }
.wrongbook-panel { margin-top: 24px; }
.filter-row { display: grid; grid-template-columns: repeat(2, minmax(0, 180px)) minmax(0, 1fr); gap: 12px; align-items: end; margin-bottom: 18px; }
.filter-row button { justify-self: end; }
.admin-pages, .admin-page { display: grid; gap: 22px; }
.admin-notice:empty { display: none; }
.admin-notice:not(:empty) { padding: 12px 16px; background: #edf1e9; border-left: 3px solid #a6b897; }
.section-heading { display: flex; justify-content: space-between; align-items: center; }
.section-heading h2 { font-size: 19px; }
.section-heading > span { color: var(--muted); font-size: 12px; }
.admin-feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.admin-feature-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 172px; padding: 22px 18px; background: #fff; border: 1px solid var(--line); border-radius: 8px; text-align: left; color: var(--text); transition: border-color .18s, box-shadow .18s; }
.admin-feature-card:hover { border-color: #8eaa7c; box-shadow: var(--shadow); }
.feature-icon.lucide { width: 44px; height: 44px; padding: 10px; border-radius: 8px; background: #e7eedf; color: #526b41; margin-bottom: 12px; }
.admin-feature-card:nth-child(2) .feature-icon { background: #f6e8e0; color: #99664d; }
.admin-feature-card:nth-child(3) .feature-icon { background: #e6edf4; color: #52738e; }
.admin-feature-card:nth-child(4) .feature-icon { background: #f2ecda; color: #887239; }
.feature-arrow.lucide { position: absolute; right: 16px; top: 22px; color: #96a08e; width: 16px; height: 16px; }
.admin-feature-card > span { font-size: 17px; font-weight: 650; }
.admin-feature-card small { color: var(--muted); font-size: 11px; }
.admin-page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 0 0 18px; border-bottom: 1px solid var(--line); }
.admin-page-head h2 { font-size: 22px; }
.admin-page-head .eyebrow { font-size: 11px; }
.admin-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 32px; align-items: start; }
.admin-wide { grid-column: 1 / -1; }
.admin-form { display: flex; flex-direction: column; gap: 18px; min-width: 0; padding-top: 0; border: 0; }
.admin-form h2 { font-size: 17px; }
.admin-form > .primary { align-self: start; }
#importForm { min-height: 200px; padding: 0 0 0 28px; border-left: 1px solid var(--line); }
.permission-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.permission-actions > * { font-size: 13px; }
.word-row:has(> button), .draft-word-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.word-row > .reset-user-password { justify-self: end; }
.summary-row { grid-template-columns: 36px minmax(0, 1fr) auto auto; align-items: center; }
.admin-summary-row { grid-template-columns: 34px minmax(90px, 1fr) auto auto auto auto; gap: 12px; font-size: 12px; padding: 18px 4px; }
.admin-summary-row strong, .admin-summary-row small { display: block; }
.admin-summary-row > span { color: var(--muted); }
.admin-summary-row > b { font-size: 16px; color: var(--brand); }
.admin-detail-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr) auto; align-items: center; }
.notification-row { padding: 22px 0; border-bottom: 1px solid var(--line); }
.notification-row.latest { padding: 20px; border: 1px solid #cedbc3; border-radius: 8px; background: #edf3e7; margin-bottom: 12px; }
.notification-head { display: flex; justify-content: space-between; align-items: start; gap: 14px; margin-bottom: 12px; }
.notification-head strong { display: block; font-size: 17px; overflow-wrap: anywhere; }
.notification-head span, .notification-head small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.notification-head small { flex-shrink: 0; }
.notification-body { line-height: 1.9; overflow-wrap: anywhere; }
.message-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; }
.message-sidebar { display: grid; align-content: start; gap: 12px; min-width: 0; }
.message-privacy { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.message-mode-tabs { max-width: 320px; margin-bottom: 18px; }
.message-history { overflow: auto; min-height: 0; display: flex; flex-direction: column; }
.message-history > button { align-self: center; margin-top: 10px; }
.message-history .message-list { overflow: visible; }
#messageError:not(:empty) { padding: 12px; }
#messageError:empty { display: none; }
.message-layout:has(.message-contacts[hidden]) { grid-template-columns: minmax(0, 1fr); }
.message-contacts { display: grid; align-content: start; gap: 6px; max-height: 600px; overflow: auto; }
.message-contact { position: relative; display: grid; gap: 5px; padding: 14px; border-radius: 6px; color: var(--text); text-align: left; background: #edf0ea; }
.message-contact span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-size: 12px; }
.message-contact.selected { background: var(--brand); color: #fff; }
.message-contact.selected span { color: #e0e8d9; }
.message-unread-dot { position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: #c74746; box-shadow: 0 0 0 2px white; }
.message-thread { display: grid; grid-template-rows: auto minmax(260px, 48vh) auto; min-width: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.message-thread-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.message-thread-head span { color: var(--muted); font-size: 12px; }
.message-list { display: grid; align-content: start; gap: 16px; overflow: auto; padding: 20px; background: #f9faf7; }
.message-row { display: flex; }
.message-row.mine { justify-content: flex-end; }
.message-row > div { max-width: 82%; padding: 12px 16px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.message-row.mine > div { background: #e5eddc; border-color: #d5e0ca; }
.message-row p { margin: 0; overflow-wrap: anywhere; }
.message-row small { display: block; color: var(--muted); margin-top: 8px; font-size: 11px; }
.message-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 14px; border-top: 1px solid var(--line); align-items: end; }
.message-form textarea { min-height: 70px; }
.notice-modal-backdrop { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: rgb(30 42 29 / 40%); backdrop-filter: blur(3px); }
.notice-dialog { width: min(520px, 100%); max-height: calc(100dvh - 40px); overflow: auto; padding: 30px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 24px 80px rgb(30 42 29 / 16%); }
.notice-dialog h2 { font-size: 24px; margin-bottom: 10px; }
.notice-dialog .notification-body { padding: 22px 0; margin: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
@media (max-width: 1100px) {
  .app-shell { width: calc(100% - 40px); }
  .dashboard { grid-template-columns: 128px minmax(0, 1fr); gap: 22px; }
  .section-tabs { padding-right: 0; }
  .auth-panel { gap: 32px; }
  .auth-copy { padding: 40px 30px; }
  .auth-copy h2 { font-size: 38px; }
  .admin-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-feature-card { min-height: 164px; }
  .learn-layout { grid-template-columns: minmax(0, 1fr); }
  .recent-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
  .admin-summary-row { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .admin-summary-row > span:nth-child(3) { grid-column: 2; }
  .admin-summary-row > span:nth-child(5) { grid-column: 2; }
  .admin-summary-row > b { grid-column: 3; grid-row: 1; }
}
@media (max-width: 760px) {
  .app-shell { width: calc(100% - 32px); padding: 20px 0 28px; }
  .topbar { padding-bottom: 18px; margin-bottom: 20px; }
  .brand-symbol { width: 38px; height: 38px; }
  .brand-lockup { gap: 9px; }
  .topbar h1 { font-size: 20px; }
  .user-pill { gap: 6px; max-width: 48%; font-size: 12px; }
  .dashboard { display: flex; flex-direction: column; gap: 20px; padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
  .dashboard > :not(.section-tabs) { width: 100%; }
  .section-tabs { position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 25; display: flex; flex-direction: row; justify-content: space-evenly; gap: 6px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fcfdfa; }
  .nav-tab { flex: 1 1 0; max-width: 160px; min-height: 54px; padding: 6px 10px; flex-direction: column; justify-content: center; gap: 3px; font-size: 11px; }
  .nav-tab.active { background: #e8efdf; }
  .nav-tab.has-unread::after { right: calc(50% - 17px); top: 5px; }
  .welcome-band { padding: 24px; gap: 12px; }
  .welcome-band h2 { font-size: 22px; }
  .welcome-art.lucide { width: 48px; height: 48px; margin: 0; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 16px; min-height: 100px; }
  .stat strong { font-size: 26px; }
  .stat-icon.lucide { width: 22px; height: 22px; right: 14px; bottom: 18px; }
  .auth-panel { grid-template-columns: 1fr; gap: 26px; padding: 0 0 20px; }
  .auth-copy { min-height: 290px; padding: 28px; }
  .auth-emblem { margin-bottom: 20px; }
  .auth-emblem svg { width: 32px; height: 32px; }
  .auth-copy h2 { font-size: 32px; line-height: 1.5; }
  .auth-copy .auth-translation { font-size: 13px; max-width: 270px; margin-top: 16px; }
  .auth-card { max-width: 460px; padding: 24px; gap: 18px; }
  input, textarea { font-size: 16px; }
  .practice-panel { align-items: flex-start; flex-direction: column; padding: 20px; }
  .practice-panel .primary { width: 100%; }
  .task-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-card { padding: 14px; min-height: 106px; gap: 10px; }
  .batch-banner { flex-direction: column; align-items: start; gap: 8px; }
  .batch-meta { width: 100%; display: flex; justify-content: space-between; align-items: center; text-align: left; flex-wrap: wrap; gap: 8px; }
  .question-panel { padding: 22px 18px; }
  .question-panel h2 { font-size: 28px; }
  .answer-form button { min-width: 70px; padding: 9px 12px; }
  .panel-head { flex-wrap: wrap; gap: 12px; }
  .panel-head h2 { font-size: 18px; }
  .table-panel { padding: 20px 0; }
  .task-panel { padding-top: 0; }
  .filter-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-row button { grid-column: 1 / -1; width: 100%; }
  .permission-actions > * { flex: 1 1 auto; }
  .admin-layout { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  #importForm { min-height: auto; border-left: 0; border-top: 1px solid var(--line); padding: 20px 0 0; }
  .admin-feature-grid { gap: 12px; }
  .admin-feature-card { padding: 18px; min-height: 162px; }
  .admin-feature-card > span { font-size: 16px; }
  .admin-feature-card small { font-size: 11px; }
  .feature-arrow.lucide { right: 12px; top: 18px; }
  .admin-page-head h2 { font-size: 21px; }
  .result-row, .admin-detail-row { grid-template-columns: repeat(2, minmax(0, 1fr)); font-size: 13px; }
  .message-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .message-contacts { display: flex; overflow-x: auto; max-height: none; padding-bottom: 6px; }
  .message-contact { flex: 0 0 156px; }
  .message-thread { grid-template-rows: auto minmax(240px, 42vh) auto; }
  .message-thread-head { padding: 14px; flex-wrap: wrap; }
  .message-list { padding: 14px; }
  .message-row > div { max-width: 90%; }
  .message-form { padding: 10px; }
  .message-form .primary { padding: 10px; }
  .notice-dialog { padding: 24px; }
}
@media (max-width: 360px) {
  .app-shell { width: calc(100% - 24px); }
  .auth-copy { padding: 24px 20px; }
  .auth-copy h2 { font-size: 28px; }
  .welcome-band { padding: 20px 16px; }
  .welcome-art { display: none; }
  .stat span { font-size: 11px; }
  .admin-feature-card { padding: 16px 12px; }
  .admin-feature-card > span { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
