/* 独立响应式层：不改动学习内容，仅适配窄屏阅读、触控与后台表单。 */
@media (max-width: 1180px) {
  html, body { min-width: 0 !important; }
  .sidebar { grid-template-columns: 220px minmax(0, 1fr) 112px; padding-inline: 20px; }
  .sidebar nav { overflow-x: auto; justify-content: flex-start; scrollbar-width: thin; }
  .nav-button { min-width: 74px; flex-basis: 84px; }
  main { padding-inline: clamp(20px, 4vw, 40px); }
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid, .two-column { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 14px; }
  .sidebar { grid-template-columns: 1fr auto; min-height: 66px; height: auto; padding: 7px 14px; }
  .sidebar .brand { min-width: 0; }.sidebar .brand small { display: none; }.sidebar nav { display: none; }
  .flow-menu-toggle { top: 13px; right: 13px; }
  main { padding: 22px 16px 58px; }.topbar { min-height: 0; }.topbar h1 { font-size: clamp(2rem, 11vw, 3rem); }
  .focus-card { min-height: 0; padding: 27px 24px; }.focus-card::after { display: none; }.focus-card h2 { font-size: 1.9rem; }
  .plan-grid, .metric-row, .mock-overview { grid-template-columns: 1fr; }.panel, .progress-card { padding: 20px; }
  .knowledge-card summary { grid-template-columns: 16px minmax(0, 1fr) auto; }.knowledge-meaning { grid-column: 2 / -1; }.knowledge-body { padding: 17px; }.knowledge-body dl { grid-template-columns: 1fr; }.knowledge-footer { grid-template-columns: 1fr; }
  .schedule-course, .exam-paper-card, .mock-question, .practice-setup { grid-template-columns: 1fr; }.schedule-course { gap: 10px; }.course-state { justify-self: start; }.mock-question { padding: 18px; }
  .admin-header { min-height:66px; padding-inline:16px; }.admin-brand strong { font-size:.84rem; }.admin-main { width:min(100% - 28px,1120px); padding-top:52px; }.login-card,.admin-panel { padding:22px; }.dashboard-grid { grid-template-columns:1fr; }.admin-title h1 { font-size:2.35rem; }
}

/* 手机端学习界面：保留学习顺序，减少横向滚动与遮挡。 */
@media (max-width: 760px) {
  html, body, #root, .react-shell, .app-shell { width: 100%; max-width: 100%; overflow-x: clip; }
  body { min-width: 0 !important; -webkit-text-size-adjust: 100%; }
  button, .primary, .secondary, .file-button, .nav-button, .text-button { min-height: 42px; }
  .sidebar { position: sticky; z-index: 100; grid-template-columns: minmax(0, 1fr) auto; min-height: 62px; height: 62px; padding: 5px 15px; }
  .sidebar .brand { min-width: 0; }.sidebar .brand strong { font-size: .82rem; }.sidebar .brand-mark { width: 37px; height: 37px; font-size: 30px; }.sidebar .timer-nav-widget { display: none; }
  .flow-menu-toggle { z-index: 180; top: 12px; right: 12px; width: 42px; height: 42px; }
  .flowing-menu-overlay { z-index: 170; inset: 0; padding-top: 66px; }
  main { width: 100%; padding: 0 15px 94px; }
  .topbar { min-height: 0; margin: 0 -15px 20px; padding: 29px 22px 25px; }.topbar:before { display: none; }.topbar:after { opacity: .45; }.topbar>div:first-child { width: 100%; min-width: 0; }.topbar h1 { max-width: 100%; margin: 8px 0 0; font-size: clamp(2.15rem, 12vw, 3.15rem); line-height: 1.08; }.topbar .target-chip { display: none; }
  .section-heading, .section-heading.first-heading { align-items: flex-start; flex-direction: column; gap: 10px; margin: 28px 0 14px; }.section-heading h2 { font-size: 1.45rem; }.section-heading .toolbar, .section-heading .schedule-actions, .section-heading .mock-mode-switch { width: 100%; }
  #dashboardView .plan-grid { grid-template-columns: 1fr; gap: 8px; }.plan-item, #dashboardView .plan-item { min-height: 76px; padding: 14px; }.dashboard-grid, .two-column, .form-layout { grid-template-columns: 1fr; gap: 10px; }.focus-card { padding: 24px 22px; border-radius: 3px 12px 3px 3px; }.focus-card h2 { font-size: 1.75rem; }.progress-card { align-items: flex-start; gap: 18px; }.metric-row { grid-template-columns: repeat(3, minmax(0,1fr)); }.metric-row div { min-width: 0; padding: 12px 7px; }
  #knowledgeList { grid-template-columns: 1fr; max-height: none; padding: 4px 0 12px; overflow: visible; }.knowledge-card.knowledge-flip-card { --fc-h: 350px; }.knowledge-flip-card .flip-card__face { overflow-y: auto; }.toolbar { display: grid; grid-template-columns: 1fr; width: 100%; }.segmented, .search, .select-label { width: 100%; }.segmented button { flex: 1; min-height: 42px; }.search input, .select-label select { min-height: 43px; }
  .mock-heading, .schedule-heading { align-items: flex-start; flex-direction: column; }.mock-mode-switch, .schedule-switch { width: 100%; }.mock-mode-switch button, .schedule-switch button { flex: 1; min-height: 42px; }.schedule-actions { align-items: stretch; flex-direction: column; }.schedule-download { width: 100%; }.schedule-summary { align-items: flex-start; flex-direction: column; gap: 9px; padding: 15px; }.schedule-week-grid { grid-template-columns: 1fr; }.schedule-course, .schedule-course.compact { grid-template-columns: 1fr; min-height: 0; padding: 16px; }.course-state { justify-self: start; }
  .mock-overview { grid-template-columns: 1fr; }.exam-paper-card { align-items: flex-start; flex-direction: column; gap: 14px; padding: 18px; }.exam-paper-card button, .practice-setup button { width: 100%; }.practice-setup { grid-template-columns: 1fr; padding: 16px; }.practice-setup fieldset { grid-column: auto; }.exam-runner-head { position: static; align-items: flex-start; flex-direction: column; padding: 15px; }.exam-runner-head>div:last-child { width: 100%; justify-content: space-between; }.mock-question { grid-template-columns: 1fr; gap: 9px; padding: 17px; }.question-number { width: 32px; height: 32px; }.question-content h3, .practice-question-card h3 { font-size: 1.08rem; line-height: 1.72; }.question-passage { padding: 14px; font-size: .93rem; }.mock-option { padding: 11px; }.exam-result { min-height: 280px; }.score-hero strong { font-size: 4rem; }.score-actions { width: 100%; flex-direction: column; }.score-actions button { width: 100%; }
  .tool-card-grid { grid-template-columns: 1fr; }.external-tool-card { grid-template-columns: 46px minmax(0,1fr); min-height: 0; padding: 16px; }.tool-availability, .tool-open { grid-column: 1 / -1; }.tool-open { width: 100%; }.tool-workspace { margin-top: 15px; }.tool-workspace-head { align-items: flex-start; flex-direction: column; }.tool-workspace-actions { width: 100%; justify-content: space-between; }.tool-embed, .tool-embed iframe, .tool-loading { min-height: 66vh; height: 66vh; }
  .mistake-form, .profile-form { position: static; }.mistake-form, .profile-form, .data-actions, .notice { padding: 18px; }.mistake-form label, .profile-form label { min-width: 0; }.review-metrics { grid-template-columns: 1fr 1fr; }.review-metrics article { min-width: 0; padding: 14px 10px; }.timeline-item, .weak-item { padding: 14px; }
  .timer-widget.timer-floating-dock { right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); left: 10px; top: auto; width: auto !important; height: 58px !important; }.timer-floating-dock .timer-body { padding: 6px 11px; }.timer-floating-dock .timer-task { max-width: 60%; }.timer-floating-dock .timer-display { font-size: 1.06rem; }.toast { right: 12px; bottom: 78px; left: 12px; text-align: center; }
}

@media (max-width: 390px) {
  .topbar h1 { font-size: 2.05rem; }.metric-row { grid-template-columns: 1fr; }.metric-row div { padding: 10px 12px; }.review-metrics { grid-template-columns: 1fr; }.sidebar .brand strong { display: none; }.flow-menu-toggle { right: 9px; }.schedule-switch button, .mock-mode-switch button { padding-inline: 7px; font-size: .82rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
