/* Mobile SaaS shell */
.mobile-menu-toggle,.mobile-nav-backdrop,.mobile-bottom-nav{display:none}
@media (max-width:860px){
body:not(:has(.admin-sidebar)) .mobile-menu-toggle{display:none!important}
body:not(:has(.admin-sidebar)) .topbar .brand{margin-left:12px}
/* 20260926 精确底部留白：底部导航实际占 58px 高 + 10px 下边距 = 68px，再加安全区。
   原先 body 一律给 96px，多出约 28px 空白；同时 style.css 的 .container padding-bottom:0
   只让 main 归零、由 body 兜底，容易误读成「内容被遮挡」。这里统一到一处，避免再被覆盖。 */
body{padding-bottom:calc(78px + env(safe-area-inset-bottom, 0px))}
@media (max-width:720px){
  body:not(.admin-page),
  main.container:not(.admin-container){padding-bottom:calc(78px + env(safe-area-inset-bottom, 0px))!important}
  /* 教师端工作台自己给了 150px，保持更宽松，不降级 */
  body:has(#v2-stats) .container{padding-bottom:calc(78px + env(safe-area-inset-bottom, 0px))!important}
}.mobile-menu-toggle{display:flex;position:absolute;left:12px;top:17px;width:32px;height:28px;padding:5px;border:0;background:transparent;flex-direction:column;justify-content:space-around;z-index:120}.mobile-menu-toggle span{height:2px;width:21px;border-radius:2px;background:#334155}.mobile-nav-backdrop{display:block;position:fixed;inset:0;background:rgba(15,23,42,.35);opacity:0;pointer-events:none;transition:.2s;z-index:90}body.mobile-nav-open{overflow:hidden}body.mobile-nav-open .mobile-nav-backdrop{opacity:1;pointer-events:auto}.admin-sidebar{position:fixed!important;left:0;top:0;bottom:0;width:min(84vw,330px)!important;margin:0!important;border-radius:0 18px 18px 0!important;transform:translateX(-105%);transition:transform .25s ease;z-index:100;overflow:auto;padding-top:72px}body.mobile-nav-open .admin-sidebar{transform:translateX(0)}.mobile-bottom-nav{display:flex;position:fixed;left:10px;right:10px;bottom:calc(10px + env(safe-area-inset-bottom,0px));height:58px;z-index:80;align-items:center;justify-content:space-around;border:1px solid rgba(148,163,184,.22);border-radius:18px;background:rgba(255,255,255,.94);box-shadow:0 8px 30px rgba(15,23,42,.16);backdrop-filter:blur(14px)}.mobile-bottom-nav a{min-width:0;text-align:center;color:#64748b;text-decoration:none;font-size:11px;flex:1 1 0;display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%}.mobile-bottom-nav em{display:block;font-style:normal;margin-top:3px;white-space:nowrap}.mi{display:inline-block;width:18px;height:18px;position:relative;color:#64748b}.mi:before,.mi:after{content:"";position:absolute;border:1.6px solid currentColor}.mi-home:before{left:2px;top:7px;width:14px;height:9px;border-radius:2px}.mi-home:after{left:4px;top:2px;width:10px;height:10px;transform:rotate(45deg);border-right:0;border-bottom:0}.mi-data:before{left:2px;bottom:2px;width:3px;height:9px;border-radius:1px;box-shadow:5px -5px 0 -1px #fff,5px -5px 0 0 currentColor,10px -9px 0 -1px #fff,10px -9px 0 0 currentColor}.mi-alert:before{left:3px;top:2px;width:12px;height:12px;border-radius:50%}.mi-calendar:before{left:2px;top:3px;width:14px;height:12px;border-radius:2px}.mi-entry:before{left:3px;top:2px;width:12px;height:13px;border-radius:2px;clip-path:polygon(0 22%,62% 22%,100% 0,100% 100%,0 100%)}.topbar .brand{margin-left:36px}.topbar .nav{display:none!important}.mobile-logout{display:block;position:absolute;right:14px;top:20px;color:#475569;font-size:13px;text-decoration:none}.v2-tabbar{overflow-x:auto;white-space:nowrap}body:has(#v2-stats) .topbar .brand{display:none}body:has(#v2-stats) .topbar{justify-content:center}body:has(#v2-stats) .container{padding:10px 12px 150px!important}body:has(#v2-stats) .teacher-care-card{margin-top:8px;padding:10px 12px;border-radius:14px}body:has(#v2-stats) .teacher-care-icon{width:34px;height:34px;font-size:18px}body:has(#v2-stats) .teacher-care-title{font-size:14px;line-height:1.4}body:has(#v2-stats) .teacher-care-meta{margin-top:4px;gap:5px}body:has(#v2-stats) .teacher-care-meta span{padding:3px 7px}body:has(#v2-stats) .teacher-care-detail{margin-top:3px;font-size:11px}body:has(#v2-stats) #v2-stats{display:grid!important;grid-template-columns:repeat(3,1fr);gap:8px;margin:8px 0!important}body:has(#v2-stats) #v2-stats .stat-card{min-height:86px;padding:12px 8px!important}body:has(#v2-stats) #v2-stats .stat-card .stat-number{font-size:27px!important}body:has(#v2-stats) #v2-tabbar{position:sticky;top:58px;z-index:10;margin:8px 0!important}body:has(#v2-stats) #fitness-records{margin-top:8px!important}body:has(#v2-stats) #fitness-records .card{padding:16px!important}body:has(#v2-stats) .analysis-section{margin-top:8px!important}
/* 2026-09-13 教师端移动端修复：统计卡/评级卡竖排居中，杜绝文字挤压竖排 */
body:has(#v2-stats) #v2-stats .stat-card{flex-direction:column!important;justify-content:center!important;align-items:center!important;text-align:center!important;gap:2px!important;padding:10px 4px!important;min-height:88px!important}
body:has(#v2-stats) #v2-stats .stat-card .stat-icon{width:30px!important;height:30px!important;font-size:15px!important;flex:none!important}
body:has(#v2-stats) #v2-stats .stat-card .stat-icon svg{width:17px!important;height:17px!important}
body:has(#v2-stats) #v2-stats .stat-card .stat-info{width:100%!important;display:flex!important;flex-direction:column!important;align-items:center!important;gap:1px!important;min-width:0!important}
body:has(#v2-stats) #v2-stats .stat-card .stat-number{font-size:22px!important;line-height:1.15!important}
body:has(#v2-stats) #v2-stats .stat-card .stat-label{white-space:nowrap!important;margin:0!important;font-size:11.5px!important;letter-spacing:0!important}
body:has(#v2-stats) .stats-grid.overview-stats .card.stat-card{flex-direction:column!important;align-items:center!important;justify-content:center!important;text-align:center!important;gap:2px!important;padding:12px 8px!important;min-height:88px!important}
body:has(#v2-stats) .stats-grid.overview-stats .card.stat-card .stat-label{margin:0!important;white-space:nowrap!important;font-size:12px!important}
body:has(#v2-stats) .stats-grid.overview-stats .card.stat-card .stat-number{font-size:26px!important;line-height:1.2!important}
body:has(#v2-stats) .stats-grid.overview-stats .card.stat-card .muted{margin:0!important;white-space:nowrap!important;font-size:11.5px!important}

/* 2026-09-13 教师端移动端修复2：录入体测表单/重点关注面板 紧凑双列布局 */
body:has(#v2-stats) #fitnessEntryForm{grid-template-columns:1fr!important;gap:8px!important}
body:has(#v2-stats) #fitnessEntryForm>label{display:flex!important;flex-direction:row!important;align-items:center!important;gap:10px!important;min-height:44px!important}
body:has(#v2-stats) #fitnessEntryForm>label>span{flex:0 0 104px!important;font-size:13px!important;color:#475569!important;font-weight:600!important}
body:has(#v2-stats) #fitnessEntryForm>label>input,body:has(#v2-stats) #fitnessEntryForm>label>select{flex:1!important;min-width:0!important;height:42px!important;margin:0!important}
body:has(#v2-stats) #fitnessEntryForm #fitnessEntrySelectionHint{grid-column:1/-1!important;margin-top:0!important}
body:has(#v2-stats) #fitnessEntryBatchForm{grid-template-columns:1fr!important}
body:has(#v2-stats) #fitnessEntryBatchForm>label{display:flex!important;flex-direction:row!important;align-items:center!important;gap:10px!important}
body:has(#v2-stats) #fitnessEntryBatchForm>label>span{flex:0 0 104px!important;font-size:13px!important}
body:has(#v2-stats) #fitnessEntryBatchForm>label>select{flex:1!important;min-width:0!important;height:42px!important}
body:has(#v2-stats) .venue-attention-form label{display:flex!important;flex-direction:row!important;align-items:center!important;gap:10px!important;min-height:44px!important}
body:has(#v2-stats) .venue-attention-form label>span{flex:0 0 104px!important;font-size:13px!important}
body:has(#v2-stats) .venue-attention-form label>input,body:has(#v2-stats) .venue-attention-form label>select{flex:1!important;min-width:0!important;height:42px!important;margin:0!important}
body:has(#v2-stats) .venue-attention-form-actions{flex-direction:row!important;align-items:center!important;gap:10px!important}
body:has(#v2-stats) .venue-attention-form-actions .btn{min-height:44px!important;width:auto!important;padding:0 24px!important}
body:has(#v2-stats) .venue-attention-current-meta{flex-direction:row!important;align-items:center!important;flex-wrap:wrap!important;gap:8px!important}
body:has(#v2-stats) .venue-attention-current-item{padding:10px 12px!important;gap:8px!important}

/* 2026-09-13 教师端移动端修复3：趋势洞察卡单列全宽，杜绝文字重叠 */
body:has(#v2-stats) .trend-insight-grid{grid-template-columns:1fr!important;gap:10px!important}
body:has(#v2-stats) .trend-insight-card{padding:12px 14px!important}
body:has(#v2-stats) .trend-insight-head{flex-wrap:wrap!important;row-gap:4px!important;align-items:center!important}
body:has(#v2-stats) .trend-insight-head .trend-insight-now{white-space:nowrap!important}
}

/* 2026-09-20 导航精简：手机端只保留底部导航，隐藏顶栏与退出浮标 */
@media (max-width:860px){
.topbar{display:none!important}
/* 修复20260921：汉堡按钮原先嵌在顶栏内，顶栏隐藏后侧边栏入口丢失。挪出顶栏固定左上角（仅管理端页面渲染此按钮，教师端不受影响） */
.mobile-menu-toggle{display:flex!important;position:fixed!important;left:10px;top:14px;z-index:120;background:rgba(255,255,255,.94);border:1px solid rgba(148,163,184,.22);border-radius:10px;width:38px;height:34px;box-shadow:0 2px 10px rgba(15,23,42,.10);backdrop-filter:blur(8px)}
.mobile-logout{display:none!important}
.user-pill-tab-nav{display:none!important}
}
/* 底部导航选中态 */
.mobile-bottom-nav a.bn-active{color:#4f46e5}
.mobile-bottom-nav a.bn-active .mi{color:#4f46e5}
.mobile-bottom-nav a.bn-active em{font-weight:600}
.mobile-bottom-nav a.bn-active:before{content:"";display:block;width:16px;height:3px;border-radius:2px;background:#4f46e5;margin:0 auto 2px}
/* 20260926：「更多」按钮的选中态（它与教师端其余项同级，样式需一致） */
.mobile-bottom-nav .bn-group-active .bn-group-btn{color:#4f46e5;font-weight:600}
.mobile-bottom-nav .bn-group-active .bn-group-btn .mi{color:#4f46e5}
.mobile-bottom-nav .bn-group-active .bn-group-btn:before{content:"";display:block;width:16px;height:3px;border-radius:2px;background:#4f46e5;margin:0 auto 1px}
/* 教师端底部导航项：min-width 降到 40px 且允许收缩，7 项也在 320px 内放得下 */
.mobile-bottom-nav[aria-label="移动端主导航"] a,
.mobile-bottom-nav[aria-label="移动端主导航"] .bn-group{min-width:0}
.mi-more:before{left:2px;top:2px;width:4px;height:4px;border-radius:50%;box-shadow:6px 0 0 0 currentColor,12px 0 0 0 currentColor}
.mi-more:after{left:2px;top:10px;width:4px;height:4px;border-radius:50%;box-shadow:6px 0 0 0 currentColor,12px 0 0 0 currentColor}
/* 手环底部导航图标 */
.mi-band:before{left:1px;top:4px;width:12px;height:12px;border-radius:4px}
.mi-band:after{left:5px;top:0;width:5px;height:3px;border-radius:2px 2px 0 0;border-bottom:0}

/* 2026-09-20 手环页移动端紧凑布局：一行2张卡，减少滚动 */
@media (max-width:860px){
  /* 班级分组内边距收紧 */
  .band-group{margin:0 8px 10px}
  .band-group-head{padding:9px 10px}
  .band-group-body{padding:8px 0 4px}
  .band-group-tools{margin:0 8px 10px}
  /* 两列网格 */
  .band-band-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px}
  /* 紧凑卡片：隐藏MAC长串(信息在曲线下拉里有)，保留在线状态点/孩子名/心率/体温/电量 */
  .band-band-card{padding:8px 10px 10px;border-radius:12px}
  .band-band-card .head .mac{display:none}
  .band-band-card .head{gap:5px;font-size:11px}
  .band-band-card .head .state{font-size:10px}
  .band-band-card .child{font-size:13px;margin:4px 0 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .band-band-card .child .ph{width:20px;height:20px;font-size:11px}
  .band-band-card .child span:last-child{color:#0f172a;font-weight:600}
  /* 指标 2x2 网格：心率/体温/血氧/电量（血压和步数手机端隐藏） */
  .band-band-card .metrics{grid-template-columns:1fr 1fr!important;gap:2px 6px!important;margin-top:6px!important;padding-top:6px!important}
  .band-band-card .metrics .m{margin:0}
  .band-band-card .metrics .m{display:flex;align-items:center;gap:4px;min-width:0}
  .band-band-card .metrics .m b{font-size:13px}
  .band-band-card .metrics .m span:not(.dk){font-size:10px;color:#94a3b8}
  /* 隐藏次要指标：血压(第4个)与步数(第6个)，2x2正好装下心率/体温/血氧/电量 */
  .band-band-card .metrics .m:nth-child(4),
  .band-band-card .metrics .m:nth-child(6){display:none}
}

/* 2026-09-20 教师首页"班级数据大屏"快捷入口 + 大屏底部图标 */
.screen-shortcut{display:flex;align-items:center;gap:10px;margin:10px 0 0;padding:12px 14px;border-radius:14px;background:linear-gradient(135deg,#6366f1,#8b5cf6);color:#fff;text-decoration:none;box-shadow:0 6px 18px -6px rgba(99,102,241,.45)}
.screen-shortcut .ss-ic{font-size:22px}
.screen-shortcut .ss-tx{flex:1;display:flex;flex-direction:column;line-height:1.3}
.screen-shortcut .ss-tx b{font-size:14.5px}
.screen-shortcut .ss-tx i{font-style:normal;font-size:11.5px;opacity:.85}
.screen-shortcut .ss-go{font-size:20px;opacity:.8}
.mi-screen:before{left:2px;top:3px;width:13px;height:10px;border-radius:2px}
.mi-screen:after{left:6px;top:14px;width:6px;height:2px;border-radius:1px}
/* 手环班教师：隐藏药丸导航（双保险，include已删） */
body:has(.screen-shortcut) .user-pill-tab-nav{display:none!important}

/* 20260921 管理端手机端布局修复：关注面板表格溢出+编辑表单双列过挤 */
@media (max-width:860px){
  /* 关注名单表：隐藏「有效期」「标签」列（编辑卡内可见可改），表格收敛进屏宽 */
  .attention-table th:nth-child(5), .attention-table td:nth-child(5),
  .attention-table th:nth-child(6), .attention-table td:nth-child(6){display:none}
  /* 关注名单表放开全局min-width，配合隐藏列后可完全收进屏宽 */
  .attention-table{min-width:0!important}
  .attention-table td,.attention-table th{white-space:normal}
  /* 关注编辑表单：单列排布 */
  .attn-ed-form{grid-template-columns:1fr!important}
  /* 管理端容器底部留出底部导航高度，避免内容被遮挡 */
  .container.admin-container{padding-bottom:120px!important}
  /* 汉堡按钮固定左上后，管理端 hero 徽标/标题避开按钮区域 */
  .container .admin-hero{padding-left:14px!important} /* 20260927: 58px是为已隐藏的汉堡按钮留的，改14px与趋势卡对齐 */
  /* 使用建议卡：手机端压缩行距与字号，减少首屏占用 */
  .tips.compact{font-size:12.5px;line-height:1.55}
}

/* 20260921 底部导航改版：管理端4大项+二级弹出菜单；手机端移除侧边栏与汉堡按钮 */
@media (max-width:860px){
  /* 侧边栏与汉堡彻底退场（桌面不受影响） */
  .admin-sidebar{display:none!important}
  .mobile-menu-toggle{display:none!important}
  .admin-layout.shell-layout{display:block!important}
  .admin-main.shell-main{margin-left:0!important;width:100%!important}
  /* 4 大项 */
  .bn-group{position:relative;flex:1;display:flex;flex-direction:column;align-items:center}
  .bn-group-btn{background:none;border:0;padding:6px 0;display:flex;flex-direction:column;align-items:center;gap:3px;color:#64748b;font-size:11px;min-width:52px}
  .bn-group-btn em{font-style:normal}
  .bn-group-active .bn-group-btn,.bn-group-active .bn-group-btn .mi{color:#4f46e5;font-weight:600}
  .bn-group-active .bn-group-btn:before{content:"";display:block;width:16px;height:3px;border-radius:2px;background:#4f46e5;margin:0 auto 1px}
  /* 二级弹出菜单：从底部导航上方弹出 */
  .bn-submenu{display:none;position:fixed;left:10px;right:10px;bottom:78px;z-index:130;background:#fff;border:1px solid rgba(148,163,184,.25);border-radius:16px;box-shadow:0 12px 40px rgba(15,23,42,.22);backdrop-filter:blur(14px);padding:8px;max-height:56vh;overflow:auto}
  .bn-submenu.open{display:block;animation:bnPop .18s ease-out}
  @keyframes bnPop{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
  .bn-submenu a{display:flex;align-items:center;gap:10px;padding:11px 12px;border-radius:10px;color:#334155;text-decoration:none;font-size:13.5px}
  .bn-submenu a:active{background:#eef2ff}
  .bn-sub-ico{font-size:16px;width:22px;text-align:center}
  /* 大项图标 */
  .mi-radar:before{left:3px;top:3px;width:12px;height:12px;border-radius:50%;border:1.6px solid currentColor}
  .mi-radar:after{left:8px;top:8px;width:7px;height:1.6px;background:currentColor;transform:rotate(45deg);transform-origin:left center}
  .mi-run:before{left:4px;top:2px;width:6px;height:6px;border-radius:50%}
  .mi-run:after{left:6px;top:7px;width:2px;height:9px;transform:skewX(-12deg)}
  .mi-school:before{left:2px;top:4px;width:14px;height:10px;border-radius:2px 2px 0 0;border-bottom:0}
  .mi-school:after{left:0;top:1px;width:0;height:0;border-left:9px solid transparent;border-right:9px solid transparent;border-bottom:5px solid currentColor}
  .mi-gear:before{left:3px;top:3px;width:12px;height:12px;border-radius:50%;border:1.6px solid currentColor}
  .mi-gear:after{left:7.5px;top:0;width:3px;height:18px;background:linear-gradient(to bottom,transparent 6px,currentColor 6px,currentColor 12px,transparent 12px)}
}

/* 20260921b 手机端分页控件：恢复横排（历史column规则导致竖排挤占+被底部导航遮挡） */
@media (max-width:860px){
  .pagination-bar{flex-direction:row!important;flex-wrap:wrap!important;justify-content:center!important;align-items:center!important;gap:6px!important;padding:8px 4px!important}
  .pagination-link{min-width:34px!important;height:34px!important;display:inline-flex;align-items:center;justify-content:center}
  .pagination-nav{min-width:64px!important}
  /* 「每页N条」选择器独占一行居中，与页码分离 */
  .table-pagination-bar{flex-direction:column!important;align-items:center!important}
}
