/* ============================================================
   移动端 H5（教师端 / 家长端）— 20261020-v3.1
   对标校宝微信小程序：顶部头部 + 内容区 + 底部固定导航
   ============================================================ */

.m-root {
  min-height: 100dvh;
  background: #f4f6fb;
  color: var(--ink-1, #1c2130);
  font-family: inherit;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
  max-width: 560px;
  margin: 0 auto;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- 顶部头部 ---------- */
.m-head {
  position: sticky;
  top: 0;
  z-index: 30;
  background: linear-gradient(135deg, #4f6ef7 0%, #6a5cf0 60%, #7c3aed 100%);
  color: #fff;
  padding: calc(10px + env(safe-area-inset-top)) 14px 12px;
  border-radius: 0 0 18px 18px;
  box-shadow: 0 6px 18px rgba(79, 110, 247, 0.25);
}
.m-head-row { display: flex; align-items: center; gap: 8px; }
.m-head-title { font-size: 17px; font-weight: 800; letter-spacing: 0.5px; }
.m-head-sub { font-size: 11px; opacity: 0.85; margin-top: 1px; }

/* 校区下拉 */
.m-school {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  border-radius: 999px;
  padding: 5px 10px 5px 12px;
  font-size: 12.5px;
  font-weight: 700;
  max-width: 46%;
  cursor: pointer;
  position: relative;
}
.m-school span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-school-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  color: var(--ink-1, #1c2130);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(20, 30, 60, 0.18);
  min-width: 150px;
  padding: 6px;
  display: none;
  z-index: 40;
}
.m-school-menu.open { display: block; }
.m-school-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 9px 10px;
  font-size: 13px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}
.m-school-menu button:active { background: #eef1ff; }
.m-school-menu button.on { color: #4f6ef7; background: #eef1ff; }

/* 时间切换标签 */
.m-tabs {
  display: flex;
  gap: 6px;
  margin-top: 11px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 3px;
  width: max-content;
}
.m-tabs button {
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.85);
  font-size: 12.5px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.m-tabs button.on { background: #fff; color: #4f6ef7; }

/* ---------- 指标卡（横向滚动） ---------- */
.m-metrics {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 12px 14px 2px;
  scrollbar-width: none;
  margin-top: -26px;
}
.m-metrics::-webkit-scrollbar { display: none; }
.m-mcard {
  flex: 0 0 auto;
  min-width: 108px;
  background: #fff;
  border-radius: 14px;
  padding: 11px 12px;
  box-shadow: 0 4px 14px rgba(30, 40, 80, 0.07);
}
.m-mcard .k { font-size: 11px; color: var(--ink-4, #98a0b3); display: flex; align-items: center; gap: 4px; }
.m-mcard .v { font-size: 21px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.m-mcard .u { font-size: 11px; font-weight: 600; color: var(--ink-4, #98a0b3); margin-left: 2px; }
.m-mcard .d { font-size: 10.5px; color: var(--ink-4, #98a0b3); margin-top: 2px; }
.m-mcard.c1 .v { color: #4f6ef7; }
.m-mcard.c2 .v { color: #7c3aed; }
.m-mcard.c3 .v { color: #e8830c; }
.m-mcard.c4 .v { color: #12a05c; }

/* ---------- 区块 ---------- */
.m-sec { margin: 12px 14px 0; }
.m-sec-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.m-sec-h h2 { font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.m-sec-h .more { font-size: 12px; color: var(--ink-4, #98a0b3); background: none; border: 0; cursor: pointer; padding: 2px; }

/* 功能网格 */
.m-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: #fff;
  border-radius: 16px;
  padding: 12px 4px;
  box-shadow: 0 4px 14px rgba(30, 40, 80, 0.07);
}
.m-grid.cols3 { grid-template-columns: repeat(3, 1fr); }
.m-grid button {
  border: 0;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 2px 9px;
  cursor: pointer;
  position: relative;
  border-radius: 12px;
}
.m-grid button:active { background: #f2f4ff; }
.m-ico {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.m-grid button .t { font-size: 12px; font-weight: 700; color: var(--ink-1, #1c2130); }
.m-grid button .bdg {
  position: absolute;
  top: 4px;
  right: 14%;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #f2414f;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ---------- 列表卡 ---------- */
.m-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(30, 40, 80, 0.07);
  overflow: hidden;
}
.m-li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #f0f2f8;
  cursor: pointer;
}
.m-li:last-child { border-bottom: 0; }
.m-li:active { background: #f8f9ff; }
.m-li .grow { flex: 1; min-width: 0; }
.m-li .t1 { font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-li .t2 { font-size: 11.5px; color: var(--ink-4, #98a0b3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-li .r { text-align: right; flex: 0 0 auto; }
.m-li .rv { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.m-li .rs { font-size: 10.5px; color: var(--ink-4, #98a0b3); margin-top: 2px; }

.m-empty { padding: 26px 0; text-align: center; font-size: 12.5px; color: var(--ink-4, #98a0b3); }

/* 徽章 */
.m-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
}
.m-badge.ok { background: #e9f7ef; color: #12805c; }
.m-badge.warn { background: #fff7e6; color: #b7791f; }
.m-badge.info { background: #eaf0ff; color: #3f5ce0; }
.m-badge.bad { background: #fdeef0; color: #e0344a; }
.m-badge.mute { background: #eef0f5; color: #8a92a6; }

/* 头像 */
.m-ava {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #4f6ef7, #7c3aed);
}

/* ---------- 底部导航 ---------- */
.m-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 560px;
  background: #fff;
  border-top: 1px solid #eef0f5;
  display: flex;
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom);
}
.m-nav button {
  flex: 1;
  border: 0;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 0 7px;
  font-size: 10.5px;
  font-weight: 700;
  color: #9aa1b5;
  cursor: pointer;
}
.m-nav button.on { color: #4f6ef7; }

/* ---------- 我的页 ---------- */
.m-me-head {
  background: linear-gradient(135deg, #4f6ef7, #7c3aed);
  color: #fff;
  padding: calc(26px + env(safe-area-inset-top)) 18px 22px;
  display: flex;
  align-items: center;
  gap: 13px;
}
.m-me-head .m-ava { width: 56px; height: 56px; font-size: 22px; border-radius: 16px; background: rgba(255, 255, 255, 0.22); }
.m-me-head .nm { font-size: 18px; font-weight: 800; }
.m-me-head .rl { font-size: 12px; opacity: 0.88; margin-top: 3px; }
.m-me-cells { margin: 14px 14px 0; }
.m-me-cell {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px;
  background: #fff;
  border-bottom: 1px solid #f0f2f8;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}
.m-me-cells .m-card:first-child .m-me-cell:first-child { border-radius: 14px 14px 0 0; }
.m-me-cell .ico-wrap {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex: 0 0 auto;
}
.m-me-cell .sub { margin-left: auto; font-size: 11.5px; color: var(--ink-4, #98a0b3); font-weight: 500; display: flex; align-items: center; gap: 2px; }

/* 进度条（课时/资源） */
.m-bar { height: 7px; border-radius: 999px; background: #eef0f5; overflow: hidden; }
.m-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #4f6ef7, #7c3aed); }
.m-bar i.warn { background: linear-gradient(90deg, #f0a13c, #e8830c); }
.m-bar i.bad { background: linear-gradient(90deg, #f2606d, #e0344a); }

/* 返回条（子页） */
.m-subbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: #fff;
  border-bottom: 1px solid #eef0f5;
  position: sticky;
  top: 0;
  z-index: 30;
}
.m-subbar b { font-size: 15.5px; font-weight: 800; }
.m-subbar button { border: 0; background: none; color: var(--ink-4, #98a0b3); cursor: pointer; padding: 4px; display: flex; }

/* 搜索 */
.m-search {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #fff;
  border-radius: 999px;
  margin: 12px 14px 0;
  padding: 9px 14px;
  box-shadow: 0 4px 14px rgba(30, 40, 80, 0.07);
}
.m-search input { border: 0; outline: none; flex: 1; font-size: 13.5px; background: none; }

/* 浮层弹窗 */
.m-sheet-mask {
  position: fixed;
  inset: 0;
  background: rgba(18, 24, 44, 0.45);
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: mFade 0.18s ease;
}
.m-sheet {
  background: #fff;
  width: 100%;
  max-width: 560px;
  border-radius: 20px 20px 0 0;
  padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
  max-height: 82dvh;
  overflow-y: auto;
  animation: mUp 0.22s ease;
}
.m-sheet h3 { font-size: 15.5px; font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; }
.m-sheet h3 button { margin-left: auto; border: 0; background: none; color: var(--ink-4, #98a0b3); cursor: pointer; padding: 2px; display: flex; }
.m-sheet .fld { margin-bottom: 11px; }
.m-sheet .fld label { display: block; font-size: 12px; font-weight: 700; color: var(--ink-3, #5a6378); margin-bottom: 5px; }
.m-sheet .fld input, .m-sheet .fld select, .m-sheet .fld textarea {
  width: 100%;
  border: 1px solid #e3e6ef;
  border-radius: 10px;
  padding: 10px 11px;
  font-size: 13.5px;
  background: #fafbfe;
  outline: none;
}
.m-sheet .fld textarea { min-height: 72px; resize: vertical; }
.m-sheet .okbtn {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f6ef7, #6a5cf0);
  color: #fff;
  font-size: 14.5px;
  font-weight: 800;
  padding: 12px;
  cursor: pointer;
  margin-top: 4px;
}
@keyframes mUp { from { transform: translateY(40%); opacity: 0.4; } to { transform: none; opacity: 1; } }
@keyframes mFade { from { opacity: 0; } to { opacity: 1; } }

/* 登录页移动化 */
.m-login-wrap { max-width: 560px; margin: 0 auto; min-height: 100dvh; background: #f4f6fb; padding: 14px; padding-top: max(14px, env(safe-area-inset-top)); }
.m-login-wrap .login-card, .m-login-wrap .card { box-shadow: 0 8px 30px rgba(30, 40, 80, 0.1) !important; border-radius: 18px !important; }

/* 小屏适配 */
@media (max-width: 380px) {
  .m-grid { grid-template-columns: repeat(4, 1fr); }
  .m-mcard { min-width: 100px; }
  .m-mcard .v { font-size: 19px; }
}

/* ===== v4.6 微信端统一入口（公众号菜单直达） ===== */
.wx-root { max-width: 560px; margin: 0 auto; min-height: 100dvh; background: #f4f6fb; }
.wx-hero { position: relative; overflow: hidden; color: #fff; padding: max(26px, env(safe-area-inset-top)) 20px 46px;
  background: linear-gradient(135deg, #4f6ef7 0%, #6a5cf0 55%, #7c3aed 100%); border-radius: 0 0 22px 22px; }
.wx-brand { display: flex; align-items: center; gap: 11px; }
.wx-logo { width: 46px; height: 46px; border-radius: 13px; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.wx-brand-name { font-size: 16px; font-weight: 800; letter-spacing: .3px; }
.wx-brand-sub { font-size: 11px; opacity: .8; margin-top: 2px; letter-spacing: 1px; }
.wx-hero-title { font-size: 22px; font-weight: 800; margin-top: 26px; line-height: 1.3; }
.wx-hero-desc { font-size: 12.5px; opacity: .88; margin-top: 8px; line-height: 1.7; }
.wx-hero-deco { position: absolute; right: -18px; top: 52px; opacity: .1; }
.wx-body { padding: 0 14px 22px; margin-top: -22px; position: relative; }
.wx-hi { background: #fff; border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; font-size: 13px; font-weight: 700; color: var(--ink-1);
  box-shadow: 0 4px 16px rgba(30,40,80,.08); display: flex; align-items: center; gap: 6px; }
.wx-hi svg { color: #e8830c; }
.wx-hi-tip { margin-left: auto; font-size: 10.5px; font-weight: 500; color: var(--ink-4); }
.wx-cards { display: flex; flex-direction: column; gap: 12px; }
.wx-card { display: flex; align-items: center; gap: 13px; background: #fff; border-radius: 16px; padding: 17px 15px; text-decoration: none;
  box-shadow: 0 6px 20px rgba(30,40,80,.09); transition: .16s; border: 1px solid rgba(0,0,0,.03); }
.wx-card:active { transform: scale(.98); }
.wx-card-ico { width: 54px; height: 54px; border-radius: 15px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; color: #fff; }
.wx-card-teacher .wx-card-ico { background: linear-gradient(135deg, #4f6ef7, #6a5cf0); }
.wx-card-parent .wx-card-ico { background: linear-gradient(135deg, #12a05c, #0ea5b7); }
.wx-card-main { flex: 1; min-width: 0; }
.wx-card-title { font-size: 15.5px; font-weight: 800; color: var(--ink-1); }
.wx-card-sub { font-size: 11px; color: var(--ink-4); margin-top: 5px; line-height: 1.5; }
.wx-card-go { display: flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 700; color: var(--brand); flex: 0 0 auto; }
.wx-note { margin-top: 16px; background: #fff; border-radius: 14px; padding: 13px 14px; }
.wx-note-row { display: flex; align-items: flex-start; gap: 8px; font-size: 11.5px; color: var(--ink-3); margin: 7px 0; line-height: 1.5; }
.wx-note-row:first-child { margin-top: 0; }
.wx-note-row svg { color: var(--ink-4); flex: 0 0 auto; margin-top: 1px; }
.wx-note-wx { color: #b7791f; }
.wx-note-wx svg { color: #b7791f; }
.wx-foot { text-align: center; font-size: 10.5px; color: var(--ink-4); margin-top: 18px; }
