/* 学习空间：沿用深色青蓝系统，将练习与学习记录放在同一视野。 */
:root {
  --surface-base: #111b24;
  --surface-raised: #182630;
  --surface-overlay: #20343f;
  --surface-sunken: #0d161e;
  --text-primary: #edf3f4;
  --text-secondary: #b3c4cc;
  --text-tertiary: #99aeb9;
  --accent: #71d7cf;
  --accent-hover: #93e8e1;
  --accent-active: #52bfb7;
  --accent-subtle: #1c4144;
  --accent-on: #102b2b;
  --border: #2b3e49;
  --border-strong: #516c7b;
  --border-accent: #4c9d98;
  --focus-ring: #93e8e1;
  --maxw: 1256px;
}
body { background: var(--surface-base); }
button, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--focus-ring); outline-offset: 4px;
}
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 200; padding: 12px 20px; background: var(--accent); color: var(--accent-on); }
.skip-link:focus { top: 12px; }
.boot-status { min-height: 100dvh; display: grid; place-content: center; color: var(--text-secondary); }
.workspace-bar { display: flex; justify-content: space-between; gap: 16px; color: var(--text-tertiary); font-size: 12px; padding-bottom: 36px; }
.page-head { margin-bottom: 32px; }
.page-title { font-size: 30px; line-height: 1.4; text-wrap: balance; overflow-wrap: anywhere; }
.page-desc { font-size: 14px; line-height: 1.8; margin-top: 10px; }
.section-title { font-size: 17px; font-weight: 600; line-height: 1.5; }
.practice-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(250px, 1fr); gap: 40px; }
.practice-config, .study-rail { min-width: 0; }
.practice-config .card { padding: 0; }
.practice-config .card__body { padding: 28px; }
.practice-config .label { margin-bottom: 12px; }
.practice-config .segmented__opt span { padding-block: 12px; }
.practice-config .btn--lg { min-width: 174px; }
.study-overview { padding: 4px 0 28px; border-bottom: 1px solid var(--border); }
.study-numbers { margin: 24px 0 20px; display: flex; gap: 24px; flex-wrap: wrap; }
.study-numbers dt { font-size: 12px; color: var(--text-tertiary); }
.study-numbers dd { font-size: 26px; margin: 6px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.study-numbers small { font-size: 12px; font-weight: 400; color: var(--text-secondary); }
.text-action { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 12px 0; text-align: left; font-size: 13px; }
.text-action:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 4px; }
.study-next { padding-top: 28px; }
.study-next button { display: flex; width: 100%; flex-direction: column; gap: 5px; padding: 18px 0; text-align: left; border: 0; border-bottom: 1px solid var(--border); color: var(--text-primary); background: transparent; cursor: pointer; }
.study-next button strong { font-size: 14px; font-weight: 500; }
.study-next button span { font-size: 12px; color: var(--text-tertiary); }
.study-next button:hover strong { color: var(--accent); }
.resume-notice { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 24px; margin-bottom: 24px; background: var(--accent-subtle); border: 1px solid var(--border-accent); border-radius: 12px; }
.resume-notice strong { font-weight: 600; }
.resume-notice p { color: var(--text-secondary); font-size: 13px; margin-top: 6px; }
.search-field { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--text-secondary); max-width: 400px; margin-bottom: 24px; }
.filter-bar, .subtabs { overflow-x: auto; max-width: 100%; }
.subtabs { flex-wrap: wrap; }
.card:not(.card--flush):has(> .card__body) { padding: 0; }
.quiz { max-width: 820px; margin-inline: auto; }
#quizStage > .progress { max-width: 820px; margin-inline: auto; }
.quiz__prompt { padding: 44px 28px; }
.quiz__word { font-family: Georgia, 'Times New Roman', serif; font-size: 52px; }
.quiz__word--cn { font-family: var(--font-sans); font-size: 28px; }
.option { min-height: 64px; }
.option--correct .option__mark:last-child, .option--wrong .option__mark:not(:last-child) { display: none; }
.subtab { border-radius: 0; }
.solution__body { overflow-wrap: anywhere; }
.result-hero { max-width: 680px; margin-inline: auto; }
.mobile-menu-toggle { display: none; }
.brand__mark { color: var(--accent); }
.auth { max-width: 1320px; margin-inline: auto; gap: 72px; }
.auth__aside { padding-inline: 32px; }
.auth__aside .auth__title { font-size: 38px; max-width: 13ch; line-height: 1.55; letter-spacing: -.025em; }
.auth__sub { line-height: 1.9; }
.auth__facts { gap: 20px; }
.auth__fact { border-left: 0; padding: 0 0 20px; border-bottom: 1px solid var(--border); }
.auth__fact-value { color: var(--accent); }
.auth__panel { max-width: 420px; padding: 36px; border-radius: 16px; background: var(--surface-raised); }
.auth__panel > .auth__wordmark { display: none; }
.draft-editor { padding: 28px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-raised); }
.draft-editor textarea { display: block; width: 100%; min-height: 340px; margin: 20px 0; resize: vertical; color: var(--text-primary); background: var(--surface-sunken); padding: 20px; border: 1px solid var(--border); border-radius: 8px; font: 17px/1.9 Georgia, 'Times New Roman', serif; }
.draft-editor .field__hint { margin: 12px 0; }
.draft-editor__status { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-secondary); }
.audio-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 8px 0 16px; font-size: 12px; color: var(--text-secondary); }
.audio-tools select { background: var(--surface-sunken); color: var(--text-primary); border: 1px solid var(--border); padding: 8px; border-radius: 6px; }
.lyric-line { width: 100%; background: transparent; border: 0; color: inherit; text-align: left; font: inherit; }
.lyric-line.is-active { color: var(--accent); }
.search-empty { padding: 32px; text-align: center; color: var(--text-secondary); }
.copy-item { display: flex; align-items: baseline; gap: 12px; width: 100%; padding: 12px 8px; background: transparent; color: inherit; border: 0; text-align: left; cursor: pointer; font: inherit; }
.copy-item:hover { color: var(--accent); background: var(--surface-overlay); }
.word-list li:has(.copy-item) { display: block; padding: 0; }
[data-search-hidden] { display: none !important; }
@media (min-width: 1100px) {
  .topbar { position: fixed; inset: 0 auto 0 0; width: 208px; border-bottom: 0; border-right: 1px solid var(--border); background: var(--surface-sunken); backdrop-filter: none; }
  .topbar__inner { height: 100%; flex-direction: column; align-items: stretch; padding: 32px 16px 24px; gap: 0; }
  .brand { font-size: 16px; padding: 0 6px; }
  .nav { flex: 1; flex-direction: column; align-items: stretch; margin: 44px 0 0; gap: 8px; }
  .nav__link { min-height: 46px; padding: 12px 16px; font-size: 14px; gap: 12px; }
  .nav__link[aria-current="page"] { color: var(--accent); background: var(--accent-subtle); }
  .nav__user { margin: auto 0 0; padding: 20px 8px 0; border-left: 0; border-top: 1px solid var(--border); justify-content: space-between; }
  .main { margin-left: 208px; padding: 30px 26px 64px; }
  .tabbar { display: none; }
}
@media (max-width: 1099px) {
  .topbar { background: var(--surface-sunken); backdrop-filter: none; }
  .topbar__inner { height: 64px; justify-content: space-between; }
  .mobile-menu-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; top: 64px; right: 16px; left: 16px; margin: 0; background: var(--surface-raised); padding: 16px; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 28px #07101680; }
  .nav.is-open { display: grid; grid-template-columns: 1fr 1fr; }
  .nav__link { min-height: 48px; }
  .nav__user { grid-column: 1/-1; margin: 12px 0 0; padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--border); justify-content: space-between; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; background: var(--surface-sunken); backdrop-filter: none; }
  .tabbar__item { min-height: 62px; justify-content: center; padding-bottom: 8px; }
  .main { padding-block: 24px calc(96px + env(safe-area-inset-bottom, 0px)); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .workspace-bar { padding-bottom: 28px; }
}
@media (max-width: 820px) {
  .practice-layout { grid-template-columns: 1fr; gap: 36px; }
  .study-rail { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
  .study-overview { border-bottom: 0; }
  .study-next { padding-top: 4px; }
  .study-numbers { gap: 18px; }
}
@media (max-width: 600px) {
  .workspace-bar { padding-bottom: 16px; }
  .practice-config .mt-6 { margin-top: 16px; }
  .workspace-bar span:last-child { display: none; }
  .page-title { font-size: 25px; }
  .page-head { margin-bottom: 24px; }
  .page-desc { font-size: 13px; }
  .practice-config .card__body { padding: 20px; gap: 16px; }
  .practice-config .label { margin-bottom: 8px; }
  .practice-config .segmented { gap: 8px; }
  .practice-config .segmented__opt span { padding: 10px 8px; font-size: 12px; }
  .practice-config .btn--lg { width: 100%; }
  .practice-config > .row > .text-sm { display: none; }
  .practice-config .field:nth-of-type(2) .segmented__opt:first-child { flex-basis: 100%; }
  .study-rail { grid-template-columns: 1fr; gap: 20px; }
  .study-overview { border-bottom: 1px solid var(--border); }
  .study-numbers { gap: 36px; }
  .resume-notice { padding: 18px; align-items: flex-start; flex-direction: column; }
  .quiz__word { font-size: 40px; }
  .quiz__word--cn { font-size: 24px; }
  .quiz__prompt { padding: 32px 20px; }
  .card { padding: 20px; }
  .card--flush { padding: 0; }
  .auth { gap: 24px; padding: 24px; }
  .auth__panel { padding: 28px 24px; }
  .auth__panel > .auth__wordmark { display: flex; visibility: visible !important; margin-bottom: 32px; color: var(--accent); }
  .draft-editor { padding: 20px; }
  .draft-editor textarea { padding: 14px; }
  .wrong-item { flex-wrap: wrap; }
  .wrong-item__stats { flex-wrap: wrap; }
  .search-field { max-width: none; }
}
