@media (max-width: 900px) {
  body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; }
  .topbar { padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); }
  .topbar .quiet, .preview-note { display: none; }
  .brand { min-height: 30px; font-size: 14px; }
  main { padding: 18px max(16px, env(safe-area-inset-right)) calc(var(--player-height, 190px) + 24px) max(16px, env(safe-area-inset-left)); }
  .lesson-title { display: block; margin-bottom: 16px; }
  .lesson-title h1 { font: 700 28px/1.3 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; margin-bottom: 8px; }
  .lesson-title p { font-size: 11px; }
  .lesson-title p span { display: block; margin: 3px 0 0; font-size: 10px; }
  .page-label { display: none; }
  .page-label span { font-size: 10px; }
  .workspace { display: block; }
  .tabs { position: sticky; top: 0; z-index: 12; gap: 20px; background: #f6f2e9; }
  .tabs button { min-height: 48px; padding-block: 10px; font-size: 14px; white-space: nowrap; }
  .reading-switch { margin: 16px 0; }
  .reading-switch button { min-height: 44px; font-size: 13px; }
  .score-tools { margin: 0 0 10px; }
  .score-tools > p, .score-caption, .score-viewer-tools span { display: none; }
  .page-nav { gap: 8px; }
  .page-nav button, .page-nav select { min-height: 44px; font-size: 13px; }
  .score-viewer-tools { gap: 6px; padding: 8px; }
  .score-viewer-tools button { padding: 7px 10px; }
  .score-viewer-tools output { min-width: 40px; }
  .score-scroll { height: 54vh; height: 54dvh; min-height: 280px; max-height: 620px; }
  .score-scroll .a4-sheet { padding: 12px 8px; }
  .player { padding-bottom: env(safe-area-inset-bottom); }
  .player-inner { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)); }
  .audio-choice { width: 100%; }
  .modes { width: 100%; padding: 2px; }
  .modes button { flex: 1; min-height: 44px; padding: 7px 10px; }
  .transport { flex-basis: 100%; gap: 8px; }
  .play { width: 48px; height: 48px; flex-shrink: 0; }
  .icon-button { width: 44px; min-height: 44px; }
  .timeline { min-width: 0; line-height: 1; }
  .timeline > div { font-size: 11px; line-height: 1.4; min-height: 16px; }
  .timeline input { display: block; min-height: 28px; height: 28px; margin-block: 0; }
  .player-options { display: flex; flex-direction: row; align-items: center; justify-content: flex-end; flex-basis: 100%; gap: 18px; font-size: 13px; }
  .player-options label { min-height: 40px; }
  .player-options input[type="checkbox"] { width: 18px; height: 18px; }
  .speed-label select { min-height: 38px; padding: 4px 8px; font-size: 14px; }
  body[data-audio="reading"][data-unit="word"] .player-options label:first-child,
  body[data-audio="reading"][data-unit="full"] .player-options label:first-child { display: none; }
  body[data-view="lyrics"] .word { min-height: 44px; padding: 5px 8px; font-size: 23px; }
  body[data-view="lyrics"] .phrase-play { min-height: 44px; }
  body[data-view="lyrics"] .reading-switch { margin: 18px 0 24px; }
  #word-popover { max-height: calc(100vh - 170px); max-height: calc(100dvh - 170px); padding-top: 30px; }
  #definition-word { padding-right: 20px; }
  #definition-close { width: 44px; height: 44px; }
  #definition-senses { font-size: 14px; }
  #definition-links a { min-height: 44px; display: inline-flex; align-items: center; font-size: 13px; }
  .story-group summary { min-height: 48px; }
  .story-group-content { font-size: 16px; line-height: 1.9; }
  .story-group-content .table-scroll { -webkit-overflow-scrolling: touch; }
}
@media (max-width: 900px) and (max-height: 700px) {
  .topbar { display: none; }
  main { padding-top: 12px; }
  .lesson-title p span { display: none; }
  .lesson-title { margin-bottom: 10px; }
  .reading-switch { margin-block: 10px; }
}
@media (max-width: 360px) {
  main { padding-inline: 12px; }
  .lesson-title h1 { font-size: 25px; }
  .tabs { gap: 18px; }
  .score-viewer-tools { gap: 4px; padding: 6px; }
  .score-viewer-tools button { padding-inline: 8px; }
  .score-viewer-tools output { min-width: 36px; }
}
@media (max-width: 900px) and (max-height: 500px) {
  .player-inner { padding-block: 5px; }
  .audio-choice { width: auto; flex-basis: 32%; }
  .transport { flex-basis: 65%; }
  body[data-view="lyrics"] .transport { flex-basis: 100%; }
  .player-options { min-height: 36px; }
  .score-scroll { height: 70dvh; min-height: 220px; }
}
