:root {
  --green-deep: #1f5c3a;
  --green: #3d9a4a;
  --green-bright: #8bc34a;
  --lime: #c6e35b;
  --teal: #5cb8b2;
  --sky: #7ec8d4;
  --ink: #163028;
  --muted: #5f7468;
  --line: #d7e5dc;
  --paper: #f3f8f4;
  --panel: #ffffff;
  --warn: #c97820;
  --danger: #c4453a;
  --shadow: 0 12px 40px rgba(22, 48, 40, 0.08);
  --radius: 14px;
  --font: "Noto Sans SC", "PingFang SC", sans-serif;
  --display: "Source Serif 4", "Noto Serif SC", serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(198, 227, 91, 0.28), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(126, 200, 212, 0.25), transparent 50%),
    linear-gradient(180deg, #eef6f0 0%, var(--paper) 40%, #e8f2ec 100%);
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(31, 92, 58, 0.92), rgba(61, 154, 74, 0.85) 45%, rgba(92, 184, 178, 0.88)),
    url("/img/logo.png") center/cover;
}
.login-panel {
  width: min(420px, 100%);
  background: rgba(255, 255, 255, 0.96);
  border-radius: 22px;
  padding: 36px 32px 28px;
  box-shadow: var(--shadow);
  text-align: center;
}
.login-logo { width: min(280px, 100%); height: auto; }
.login-sub { margin: 8px 0 28px; color: var(--muted); }
.login-panel label {
  display: block;
  text-align: left;
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--muted);
}
.login-panel input {
  width: 100%;
  margin-bottom: 16px;
}
.remember-row {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin: -4px 0 16px;
  font-size: 13px !important;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}
.remember-row input {
  width: auto !important;
  margin: 0 !important;
  min-height: 18px;
}

.app {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
  max-width: 100%;
  min-width: 0;
  overflow-x: clip;
}

.sidebar {
  background: linear-gradient(180deg, #184d32 0%, #1f5c3a 55%, #246847 100%);
  color: #f4fff7;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.brand {
  padding: 8px 8px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.brand img { width: 100%; height: auto; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.2)); }
.nav-item {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.82);
  padding: 11px 14px;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(198, 227, 91, 0.28), rgba(126, 200, 212, 0.18));
  color: #fff;
  font-weight: 600;
}
.logout { margin-top: auto; color: rgba(255,255,255,0.75) !important; }

.main { padding: 22px 28px 40px; min-width: 0; max-width: 100%; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
  min-width: 0;
}
.topbar h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.topbar .muted { margin: 6px 0 0; font-size: 13px; }

.content { display: grid; gap: 16px; min-width: 0; max-width: 100%; }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
}
.stat .label { font-size: 13px; color: var(--muted); }
.stat .value {
  margin-top: 8px;
  font-size: 30px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--green-deep);
}
.stat.warn .value { color: var(--warn); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  min-width: 0;
  max-width: 100%;
}
.panel h2 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 600;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-head h2 { margin: 0; }
.panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}
.panel-actions input[type="search"] {
  width: min(220px, 100%);
}
.panel-actions input[type="date"] {
  width: auto;
  min-width: 9.5rem;
}

.day-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
}
.day-col {
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  min-height: 180px;
}
.day-col h3 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--green-deep);
  display: flex;
  justify-content: space-between;
}
.course-card {
  background: linear-gradient(160deg, #ffffff, #f4fbf5);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
}
.course-card .name { font-weight: 600; font-size: 14px; }
.course-card .meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.course-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.course-card-head .btn { flex-shrink: 0; }
.course-card .students {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(61, 154, 74, 0.1);
  color: var(--green-deep);
  font-size: 12px;
}
.chip.low {
  background: rgba(201, 120, 32, 0.14);
  color: #8a4f0f;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-scroll table { min-width: 640px; }
th, td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
th { color: var(--muted); font-weight: 500; font-size: 12px; }
tr:hover td { background: rgba(61, 154, 74, 0.04); }

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 14px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  background: #e7f1ea;
  color: var(--ink);
}
.btn:hover { filter: brightness(0.98); }
.btn-primary {
  background: linear-gradient(135deg, var(--green-deep), var(--green) 55%, #4aaa6a);
  color: #fff;
}
.btn-accent {
  background: linear-gradient(135deg, #3d9a4a, var(--teal));
  color: #fff;
}
.btn-ghost {
  background: transparent;
  border-color: rgba(255,255,255,0.2);
}
.btn-danger {
  background: rgba(196, 69, 58, 0.1);
  color: var(--danger);
}
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(61, 154, 74, 0.25);
  border-color: var(--green);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-grid .full { grid-column: 1 / -1; }
.form-field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.form-error { color: var(--danger); font-size: 13px; min-height: 1.2em; }

.check-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}
.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfefc;
}
.check-item.selected { border-color: var(--green); background: rgba(61, 154, 74, 0.06); }
.check-item input { width: auto; }
.check-item .grow { flex: 1; }
.check-item select { width: 110px; }

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.toolbar input, .toolbar select { width: auto; min-width: 140px; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(92, 184, 178, 0.18);
  color: #1e6a66;
}
.badge.warn { background: rgba(201, 120, 32, 0.16); color: #8a4f0f; }
.badge.ok { background: rgba(61, 154, 74, 0.14); color: var(--green-deep); }
.badge.muted { background: #eef2f0; color: var(--muted); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 36, 28, 0.45);
}
.modal-panel {
  position: relative;
  width: min(560px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 18px 18px 20px;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.modal-head h3 { margin: 0; font-size: 18px; }
.icon-btn {
  border: 0;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  z-index: 60;
  font-size: 14px;
  box-shadow: var(--shadow);
}

.empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.cal-label {
  min-width: 110px;
  text-align: center;
  font-size: 16px;
  color: var(--green-deep);
}
#week-label { min-width: 210px; font-size: 14px; }

.stat-filters {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.pager-info {
  font-size: 13px;
  color: var(--muted);
}
.pager .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.cal-board { margin-top: 4px; }

.cal-weekhead {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
.cal-grid-week .cal-day {
  min-height: 160px;
}
.cal-date-full {
  display: none;
  margin-left: 6px;
  font-weight: 400;
  font-size: 11px;
}
.cal-grid-week .cal-date-full { display: inline; }

.cal-day {
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfefc;
  padding: 8px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cal-day.pad {
  background: transparent;
  border-color: transparent;
  cursor: default;
  min-height: 0;
}
.cal-day.has {
  background: linear-gradient(160deg, #ffffff, #eef8f0);
  border-color: rgba(61, 154, 74, 0.35);
}
.cal-day:hover:not(.pad) {
  border-color: var(--green);
  box-shadow: 0 6px 18px rgba(31, 92, 58, 0.08);
}
.cal-day.active {
  outline: 2px solid var(--green);
  background: rgba(61, 154, 74, 0.08);
}
.cal-daynum {
  font-weight: 700;
  color: var(--green-deep);
  font-variant-numeric: tabular-nums;
}
.cal-meta { font-size: 11px; color: var(--ink); }
.cal-courses { display: grid; gap: 2px; }
.cal-course-line {
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: rgba(61, 154, 74, 0.08); }

/* —— 桌面默认隐藏手机壳 —— */
.mobile-topbar,
.bottom-nav,
.drawer-backdrop,
.mobile-only { display: none; }
.desktop-only { display: block; }
.topbar.desktop-only { display: flex; }

.mobile-card-list { gap: 10px; }
.m-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(160deg, #ffffff, #f7fbf8);
}
.m-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.m-card-title { font-weight: 600; font-size: 15px; }
  .m-card-meta {
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
.m-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.m-card-actions .btn { flex: 1 1 auto; min-height: 40px; }

.filter-toggle {
  display: none;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.filter-body.collapsed-mobile { display: contents; }

.cal-mobile-list { display: none; gap: 8px; }
.cal-mobile-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfefc;
  padding: 12px;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.cal-mobile-item.has {
  background: linear-gradient(160deg, #ffffff, #eef8f0);
  border-color: rgba(61, 154, 74, 0.35);
}
.cal-mobile-item.active {
  outline: 2px solid var(--green);
  background: rgba(61, 154, 74, 0.08);
}
.cal-mobile-item .row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.cal-mobile-item .meta { font-size: 12px; color: var(--muted); margin-top: 4px; }

.cal-day-detail {
  grid-column: 1 / -1;
  border: 1px solid rgba(61, 154, 74, 0.35);
  border-radius: 12px;
  background: rgba(61, 154, 74, 0.04);
  padding: 12px;
}
.cal-day-detail-title {
  font-weight: 600;
  color: var(--green-deep);
  margin-bottom: 8px;
}
.cal-day-detail .course-card:last-child { margin-bottom: 0; }

.stu-group + .stu-group { margin-top: 16px; }
.stu-group-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--line);
  font-weight: 600;
  color: var(--green-deep);
}
.stu-group-title .muted { font-size: 12px; font-weight: 400; }
.stu-group-boxed {
  border: 1px solid rgba(61, 154, 74, 0.35);
  border-radius: 12px;
  padding: 10px 12px 12px;
  background: rgba(61, 154, 74, 0.03);
}
.stu-group-boxed + .stu-group-boxed { margin-top: 12px; }
.stu-group-boxed .stu-group-title {
  border-bottom: 0;
  padding-bottom: 0;
}
.stu-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.stu-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(160deg, #ffffff, #f4fbf5);
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.stu-card:hover { border-color: var(--green); }
.stu-card.active {
  outline: 2px solid var(--green);
  background: rgba(61, 154, 74, 0.08);
}
.stu-card.low {
  background: linear-gradient(160deg, #fff8d6, #ffefa8);
  border-color: #e0b800;
}
.stu-card.low:hover { border-color: #c79a00; }
.stu-card.low.active { outline-color: #c79a00; }
.stu-card-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stu-card .badge { flex-shrink: 0; }
.stu-panel {
  grid-column: 1 / -1;
  border: 1px solid rgba(61, 154, 74, 0.35);
  border-radius: 12px;
  background: rgba(61, 154, 74, 0.04);
  padding: 12px;
}
.stu-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.stu-panel-meta {
  margin: 6px 0 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.sc-row td:first-child { white-space: nowrap; }
.sc-row.open td { background: rgba(61, 154, 74, 0.08); }
.sc-arrow {
  display: inline-block;
  width: 16px;
  color: var(--muted);
}
.sc-detail > td {
  background: rgba(61, 154, 74, 0.04);
  padding: 10px;
}
.sc-detail .course-card:last-child { margin-bottom: 0; }

@media (max-width: 1100px) {
  .day-board { grid-template-columns: 1fr; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .brand { width: 140px; border: 0; padding: 0; }
  #nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
  .nav-item { width: auto; padding: 8px 10px; }
  .logout { margin: 0; }
  .main { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .cal-grid, .cal-weekhead { grid-template-columns: repeat(7, minmax(72px, 1fr)); }
  .cal-board { overflow-x: auto; }
  .cal-day { min-height: 88px; }
}

/* —— 手机友好版：顶栏 + 内容滚动区 + 底栏 页面壳 —— */
@media (max-width: 768px) {
  html, body {
    height: 100%;
    overflow: hidden;
  }
  .login-screen {
    height: 100%;
    max-height: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .desktop-only,
  .topbar.desktop-only { display: none !important; }
  .mobile-only { display: block; }
  .mobile-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    flex: 0 0 auto;
    z-index: 30;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    padding-top: max(10px, env(safe-area-inset-top));
    background: rgba(243, 248, 244, 0.96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }
  .mobile-topbar-title {
    flex: 1;
    min-width: 0;
  }
  .mobile-topbar-title strong {
    display: block;
    font-size: 17px;
    font-weight: 700;
    color: var(--green-deep);
  }
  .mobile-topbar-logo {
    width: 100px;
    height: 30px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 8px;
  }
  .mobile-menu-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #e7f1ea;
    font-size: 20px;
    flex-shrink: 0;
  }

  .app {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    overflow: hidden;
    padding-bottom: 0;
  }

  .drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(16, 36, 28, 0.45);
    z-index: 40;
  }
  .drawer-backdrop.hidden { display: none !important; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(280px, 86vw);
    z-index: 45;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    padding: 18px 14px;
    padding-top: max(18px, env(safe-area-inset-top));
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    overflow: auto;
  }
  .sidebar.open { transform: translateX(0); }
  .brand { width: auto; border-bottom: 1px solid rgba(255,255,255,0.12); padding: 8px 8px 18px; }
  #nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
  .nav-item {
    width: 100%;
    padding: 14px 14px;
    font-size: 15px;
    min-height: 46px;
  }
  .logout {
    margin-top: auto;
    min-height: 44px;
  }

  .main {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 12px 12px 20px;
  }
  .content {
    gap: 12px;
    min-width: 0;
    max-width: 100%;
  }
  .panel-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .panel-actions {
    width: 100%;
  }
  .panel-actions input[type="search"] {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }
  .panel-actions .btn {
    flex: 0 0 auto;
  }
  .panel { padding: 14px; border-radius: 12px; }
  .panel-head {
    flex-direction: column;
    align-items: stretch;
  }
  .stat .value { font-size: 24px; }

  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: relative;
    flex: 0 0 auto;
    z-index: 35;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 24px rgba(22, 48, 40, 0.06);
  }
  .bottom-nav-item {
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 48px;
    padding: 4px 2px;
    border-radius: 10px;
    cursor: pointer;
  }
  .bottom-nav-item .bn-icon {
    font-size: 16px;
    line-height: 1;
    font-weight: 700;
  }
  .bottom-nav-item.active {
    color: var(--green-deep);
    background: rgba(61, 154, 74, 0.1);
    font-weight: 600;
  }

  .btn {
    min-height: 42px;
    padding: 10px 14px;
  }
  .btn-sm {
    min-height: 38px;
    padding: 8px 12px;
    font-size: 13px;
  }
  .btn-row { gap: 8px; }
  .btn-row .btn { flex: 1 1 calc(50% - 8px); }

  input, select, textarea {
    min-height: 44px;
    font-size: 16px; /* 避免 iOS 聚焦放大 */
    padding: 11px 12px;
  }
  .check-item {
    padding: 12px;
    min-height: 52px;
  }
  .check-item select {
    width: 96px;
    min-height: 40px;
  }

  .toolbar {
    gap: 8px;
  }
  .toolbar input,
  .toolbar select {
    width: 100%;
    min-width: 0;
  }
  .stat-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-toggle {
    display: flex;
    min-height: 42px;
  }
  .filter-body.is-collapsible.collapsed-mobile {
    display: none;
  }

  .table-desktop { display: none; }
  .table-scroll table { min-width: 0; }
  .mobile-only { display: block !important; }
  .mobile-card-list.mobile-only { display: grid !important; }

  .panel p,
  .panel code {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .cal-board .cal-weekhead,
  .cal-board .cal-grid { display: none; }
  .cal-mobile-list { display: grid; }

  .stu-grid { gap: 6px; }
  .stu-group-boxed { padding: 8px; }
  .stu-card {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 8px 6px;
    text-align: center;
  }
  .stu-card-name { font-size: 13px; }
  .stu-card .badge { padding: 1px 4px; font-size: 11px; }
  .stu-panel .btn-row .btn { flex: 1 1 auto; min-height: 40px; }

  #student-course-stats {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal {
    place-items: end center;
    padding: 0;
  }
  .modal-panel {
    width: 100%;
    max-height: min(88vh, 900px);
    border-radius: 18px 18px 0 0;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  }

  .toast {
    bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .pager {
    flex-direction: column;
    align-items: stretch;
  }
  .pager .toolbar { width: 100%; }
  .pager .btn { flex: 1; }

  .course-card-head {
    flex-direction: column;
    align-items: stretch;
  }
  .course-card-head .btn { width: 100%; }
}

