/* Mobile-only viewport fit for the authentication screen and teacher workbench. */
@media (max-width: 760px) {
  .auth-body:not(.recruit-teach-body) .auth-tabs {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 5px !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 5px !important;
    overflow: visible !important;
    touch-action: pan-y !important;
  }

  .auth-body:not(.recruit-teach-body) .auth-tabs > button {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 42px !important;
    padding: 6px 3px !important;
    font-size: clamp(11px, 3.2vw, 13px) !important;
    line-height: 1.2 !important;
    white-space: normal !important;
  }

  .recruit-teach-body[data-work-mode="teacher"] { overflow-x: hidden; }

  .recruit-teach-body[data-work-mode="teacher"] :is(
    .recruit-teach-page, .recruit-teach-shell, .recruit-teach-grid,
    .work-panel.teacher-work, .teacher-tab-panel, .teacher-homework-subpanel,
    .teacher-homework-form, .student-management-shell, .student-record-section,
    .student-batch-list, .student-batch-card
  ) {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }

  .recruit-teach-body[data-work-mode="teacher"] .work-panel.teacher-work {
    padding: 12px;
    overflow: hidden;
  }

  .recruit-teach-body[data-work-mode="teacher"] .teacher-work > .teacher-work-tabs {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 4px !important;
    overflow: visible !important;
    touch-action: pan-y !important;
  }

  .recruit-teach-body[data-work-mode="teacher"] .teacher-work > .teacher-work-tabs > button {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 42px !important;
    padding: 5px 2px !important;
    font-size: clamp(10px, 2.8vw, 12px) !important;
    line-height: 1.15 !important;
    white-space: normal !important;
  }

  .recruit-teach-body[data-work-mode="teacher"] .teacher-homework-subtabs {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100%;
    min-width: 0;
    overflow: visible !important;
  }

  .recruit-teach-body[data-work-mode="teacher"] .teacher-homework-subtabs > button {
    width: 100%;
    min-width: 0;
  }

  .recruit-teach-body[data-work-mode="teacher"] .teacher-homework-form {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .recruit-teach-body[data-work-mode="teacher"] .teacher-homework-form > *,
  .recruit-teach-body[data-work-mode="teacher"] .teacher-homework-form :is(label, select, input, textarea, small) {
    max-width: 100%;
    min-width: 0;
  }

  .recruit-teach-body[data-work-mode="teacher"] :is(.teacher-auto-publish, .teacher-auto-fields) {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .recruit-teach-body[data-work-mode="teacher"] .teacher-auto-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .recruit-teach-body[data-work-mode="teacher"] .teacher-auto-weekdays {
    grid-column: 1 / -1;
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    gap: 4px !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    overflow: visible !important;
    touch-action: pan-y !important;
  }

  .recruit-teach-body[data-work-mode="teacher"] .teacher-auto-weekdays > span:first-child {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .recruit-teach-body[data-work-mode="teacher"] .teacher-auto-weekdays .teacher-auto-day {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 38px !important;
    padding: 4px 1px !important;
    gap: 2px !important;
    justify-content: center;
    font-size: 10px !important;
  }

  .recruit-teach-body[data-work-mode="teacher"] .teacher-auto-weekdays .teacher-auto-day input {
    width: 12px;
    height: 12px;
    margin: 0;
  }

  .recruit-teach-body[data-work-mode="teacher"] .teacher-auto-fields > label,
  .recruit-teach-body[data-work-mode="teacher"] .teacher-auto-fields > button {
    width: 100%;
    min-width: 0;
    max-width: none;
    flex: none;
  }

  .recruit-teach-body[data-work-mode="teacher"] .student-batch-card summary,
  .recruit-teach-body[data-work-mode="teacher"] .student-batch-meta {
    grid-template-columns: minmax(0, 1fr);
  }

  .recruit-teach-body[data-work-mode="teacher"] .student-table-wrap {
    overflow: visible !important;
    touch-action: pan-y !important;
  }

  .recruit-teach-body[data-work-mode="teacher"] .student-management-table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    border: 0;
    background: transparent;
  }

  .recruit-teach-body[data-work-mode="teacher"] .student-management-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .recruit-teach-body[data-work-mode="teacher"] .student-management-table tbody {
    display: grid;
    gap: 10px;
  }

  .recruit-teach-body[data-work-mode="teacher"] .student-management-table tr {
    display: grid;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #dce7f3;
    border-radius: 8px;
    background: #fff;
  }

  .recruit-teach-body[data-work-mode="teacher"] .student-management-table td {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 8px;
    width: 100%;
    min-width: 0;
    padding: 10px;
    box-sizing: border-box;
    overflow-wrap: anywhere;
  }

  .recruit-teach-body[data-work-mode="teacher"] .student-management-table td::before {
    color: #58708c;
    font-size: 12px;
    font-weight: 900;
  }

  .recruit-teach-body[data-work-mode="teacher"] .student-management-table td:nth-child(1)::before { content: "学员信息"; }
  .recruit-teach-body[data-work-mode="teacher"] .student-management-table td:nth-child(2)::before { content: "当节课成绩"; }
  .recruit-teach-body[data-work-mode="teacher"] .student-management-table td:nth-child(3)::before { content: "以往成绩"; }
  .recruit-teach-body[data-work-mode="teacher"] .student-management-table td:nth-child(4)::before { content: "证书颁发"; }

  .recruit-teach-body[data-work-mode="teacher"] .student-management-table td[colspan] {
    display: block;
    text-align: center;
  }

  .recruit-teach-body[data-work-mode="teacher"] .student-management-table td[colspan]::before { content: none; }
}
