/* ============================================================
   正彤智护·全域智管平台 移动端适配层 v20260809
   桌面端零影响（所有规则都在 
/* R19g 移动端：隐藏公司名口号，避免与发布通知按钮重叠 */
@media (max-width:900px){
.app-header .header-info #headerName{display:none!important}
}

@media 内），仅 <768px 生效
   ============================================================ */
.app-tabbar, .mob-sidebar-mask, .mob-img-viewer, .mob-load-more, .mob-filter-toggle{display:none}

@media (max-width:768px){
  /* ========== 全局 ========== */
  body{padding-bottom:66px;font-size:15px}
  .wrap,.app-main{max-width:100%!important;padding:10px 12px!important}
  .content-body{padding:8px 0}
  .view-body{padding:8px 0}
  .table-wrap{overflow:visible!important;padding:0}
  .section-title{font-size:16px}
  .app-content{padding:8px 0}

  /* ========== 顶栏 ========== */
  .app-header{position:sticky;top:0;z-index:1500}

  /* ---------- 顶部 header 移动端重排（防 logo/公司名挤乱竖排） ---------- */
  .app-header{display:flex!important;align-items:center;padding:6px 8px!important;gap:5px;flex-wrap:nowrap!important;height:auto!important;min-height:52px}
  .app-header #hamburger{display:block!important;font-size:24px!important;margin-right:2px!important;flex:0 0 auto}
  .app-header .header-left{flex:0 1 auto!important;min-width:0!important;display:flex;align-items:center;gap:4px}
  .app-header .logo-img{width:28px!important;height:28px!important;flex:0 0 auto}
  .app-header .sys-name{font-size:15px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;max-width:92px}
  .app-header #companyArrow{font-size:8px!important;padding:2px!important}
  .app-header .header-info{flex:0 1 auto!important;min-width:0!important;margin-left:auto!important;margin-right:2px!important}
  .app-header .header-info .info-item .value{font-size:11px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;max-width:68px;display:inline-block}
  .app-header #msgBell{margin-right:0!important;font-size:18px!important;flex:0 0 auto}
  .app-header .app-userinfo{font-size:11px!important;max-width:54px;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;flex:0 0 auto}
  .app-header .company-switcher{margin-right:2px!important}
  .app-header .btn-notice-pub, .app-header .btn-notice-hist{font-size:12px;padding:4px 8px;margin-left:6px;flex:0 0 auto}

  .topnav-items{display:none!important}
  .header-nav{display:none}
  .header-info{font-size:12px;gap:6px}

  /* ========== 侧边栏 → 抽屉（更多按钮打开） ========== */
  .app-sidebar{position:fixed!important;left:0!important;top:0!important;bottom:0!important;width:300px!important;max-width:85vw;z-index:99989;transition:transform .25s ease!important;transform:translateX(-105%)!important;box-shadow:none!important}
  .app-sidebar.sb-open{transform:translateX(0)!important;box-shadow:0 0 48px rgba(15,23,42,.35)!important}
  .mob-sidebar-mask{position:fixed;inset:0;background:rgba(15,23,42,.5);z-index:99988}

  /* ========== 底部导航（5 大按钮） ========== */
  .app-tabbar{display:flex!important;position:fixed;left:0;right:0;bottom:0;height:60px;background:#fff;border-top:1px solid #E2E8F0;z-index:100020;box-shadow:0 -2px 14px rgba(0,0,0,.08);padding-bottom:env(safe-area-inset-bottom)}
  .app-tabbar .tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:11px;color:#64748B;min-height:48px;cursor:pointer;background:none;border:none;padding:5px 0 4px}
  .app-tabbar .tab .ic{font-size:21px;line-height:1;height:22px}
  .app-tabbar .tab.on{color:#FF7D00;font-weight:700}
  .app-tabbar .tab:active{background:#FFF7ED}

  /* ========== 表格 → 卡片 ========== */
  .data-table{display:block!important;width:100%!important;border:none!important;background:transparent!important}
  .data-table thead{display:none!important}
  .data-table tbody{display:block!important}
  .data-table tbody tr{display:block!important;border:1px solid #E2E8F0!important;border-radius:14px;margin:0 0 12px!important;padding:4px 14px 12px!important;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.05)}
  .data-table tbody td{display:flex!important;justify-content:space-between;align-items:center;gap:10px;border:none!important;padding:7px 0!important;font-size:14px!important;text-align:left!important;white-space:normal!important;min-height:26px;width:auto!important;min-width:0!important}
  .data-table tbody td::before{content:attr(data-label);color:#94A3B8;font-size:12px;flex-shrink:0;max-width:40%;text-align:left}
  .data-table tbody td:first-child{justify-content:flex-start}
  .data-table tbody td:last-child{justify-content:flex-start;flex-wrap:wrap;gap:8px;border-top:1px dashed #E2E8F0!important;margin-top:6px;padding-top:10px!important}
  .data-table tbody td:last-child::before{content:'操作';color:#FF7D00;font-weight:700;font-size:13px}
  .data-table tbody td .actions{justify-content:flex-end}
  .data-table tbody tr:hover{background:#fff}

  /* ========== 按钮 / 点击目标 ≥48px ========== */
  .btn,.btn-add,.btn-edit,.btn-del,.btn-primary,.btn-danger,.btn-import,.btn-cancel,.btn-query,.btn-reset,.btn-link,.btn-sel,.btn-selw,.btn-notice-pub,.btn-notice-hist,.btn-date-pick,.btn-add-project{min-height:48px;font-size:15px;display:inline-flex!important;align-items:center;justify-content:center;padding:0 16px!important;border-radius:10px}
  
  .sub-tab-btn,.mgmt-tab{min-height:48px!important;font-size:15px!important;display:flex!important;align-items:center}
  .action-btn{min-height:48px!important;font-size:15px!important;padding:0 14px!important;border-radius:8px;display:inline-flex!important;align-items:center;justify-content:center;white-space:nowrap}
  td .btn,td button,.table button{min-height:48px!important}
  .sidebar-menu a,.sidebar-menu button,.side-menu-item{min-height:48px!important;font-size:15px!important;display:flex!important;align-items:center}

  input[type=checkbox]{width:22px;height:22px;accent-color:#FF7D00}
  input[type=radio]{width:20px;height:20px;accent-color:#FF7D00}
  select,input,textarea{min-height:44px;font-size:16px}
  .page-btn,.pager-btn,.pager-num{min-width:44px;min-height:44px;font-size:15px;border-radius:8px}
  .mob-filter-toggle{display:flex!important;width:100%;min-height:44px;align-items:center;justify-content:center;gap:6px;background:#fff;border:1px solid #E2E8F0;border-radius:12px;color:#FF7D00;font-size:15px;font-weight:700;cursor:pointer;margin-bottom:10px;padding:0 16px}
  .filter-bar.mob-collapsed{display:none!important}

  /* ========== 弹窗 90% + 底部固定按钮 ========== */
  .modal,.modal-box{width:90%!important;max-width:90%!important;left:5%!important;right:5%!important;max-height:86vh!important;border-radius:16px;overflow-y:auto}
  .modal-actions,.modal-footer{position:sticky;bottom:-22px;background:#fff;padding:12px 22px 10px;display:flex;gap:10px;border-top:1px solid #F1F5F9;margin:8px -22px -22px}
  .modal-actions .btn,.modal-footer .btn{flex:1;min-height:48px}
  .confirm-overlay .modal-box,.quote-overlay .modal-box{width:90%!important;max-width:90%!important}

  /* ========== 分页 → 加载更多 ========== */
  .pager,.pagination,[id$="Pagination"],[id$="pagination"]{display:none!important}
  .mob-load-more{display:flex!important;width:100%;margin:14px 0 4px;min-height:48px;align-items:center;justify-content:center;gap:8px;background:#fff;border:1.5px solid #FF7D00;border-radius:12px;color:#FF7D00;font-size:15px;font-weight:700;cursor:pointer}
  .mob-load-more:active{background:#FFF7ED}

  /* ========== 电话 ========== */
  a[href^="tel:"]{color:#FF7D00;font-weight:700;text-decoration:none}

  /* ========== 筛选栏 ========== */
  .filter-bar{flex-wrap:wrap;gap:8px;background:#fff;border-radius:12px;padding:10px;margin-bottom:10px}
  .filter-bar .filter-select,.filter-bar select{flex:1 1 calc(50% - 8px);min-width:calc(50% - 8px);min-height:44px;font-size:15px}
  .content-toolbar{flex-wrap:wrap;gap:8px;padding:8px 0}
  .content-toolbar .filter-label{width:100%}
  .content-toolbar .search-wrap{flex:1 1 100%;min-height:44px}
  .content-toolbar .search-input{min-height:44px;font-size:16px}
  .content-toolbar .btn{min-height:44px}
  .content-toolbar .spacer{display:none}
  .content-toolbar .btn-notice-pub{min-height:44px;padding:0 14px!important}

  /* ========== 登录页 ========== */
  .login-box{width:90%!important;max-width:420px!important;padding:26px 20px!important;border-radius:18px}
  .login-box input:not([type=checkbox]){width:100%!important;min-height:50px;font-size:16px;border-radius:10px}
  .login-btn{width:100%!important;min-height:52px;font-size:17px;border-radius:12px}
  .login-check-row label{font-size:14px;display:flex;align-items:center;gap:6px;min-height:40px}
  .login-topnav{display:none}
  .login-header .login-logo{font-size:20px}
  .login-footer{font-size:12px}

  /* ========== 首页/监控 ========== */
  /* 统计条：map-left-panel 整体浮在地图上（transform:none 防包含块劫持），班组列表移出隐藏 */
  .map-left-panel{position:absolute!important;top:8px!important;left:8px!important;right:8px!important;width:auto!important;max-height:none!important;overflow:visible!important;background:transparent!important;border:none!important;padding:0!important;transform:none!important;z-index:300!important}
  .map-left-panel .section-title,.map-left-panel .team-list{display:none!important}
  .stat-grid{grid-template-columns:repeat(4,1fr)!important;gap:6px;margin-bottom:0;position:static!important;background:rgba(255,255,255,.92);padding:6px 8px;border-radius:12px;box-shadow:0 2px 10px rgba(0,0,0,.12)}
  .stat-grid .stat-item{min-height:0!important;height:56px;border-radius:10px;display:flex;flex-direction:column;align-items:center;justify-content:center;background:#fff;border:1px solid #E2E8F0;box-shadow:0 2px 8px rgba(0,0,0,.06);padding:2px 0}
  .stat-grid .stat-item .num{font-size:20px!important;line-height:1.2}
  .stat-grid .stat-item .lbl{font-size:11px!important;line-height:1.3}
  /* 地图全宽 + 固定高度 */
  .map-panel{position:relative!important;display:flex!important;flex-direction:column!important;height:auto!important;overflow:visible!important;border-radius:14px;margin-bottom:12px}
  #mapCanvas{position:static!important;display:block!important;width:100%!important;height:38vh!important;min-height:240px!important;border-radius:14px}
  /* 右侧通知/预警浮层：移动端窄面板 + 空白穿透，不挡地图 */
  .rp-toggles{position:absolute!important;top:98px!important;right:8px!important;z-index:315!important;display:flex;gap:8px}
.rp-toggle-btn{width:38px;height:38px;border-radius:50%;background:rgba(15,23,42,.55);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border:1px solid rgba(148,163,184,.32);color:#e2e8f0;display:flex;align-items:center;justify-content:center;cursor:pointer;position:relative}
.rp-toggle-btn svg{width:18px;height:18px}
.rp-toggle-dot{position:absolute;top:-3px;right:-3px;min-width:16px;height:16px;border-radius:8px;background:#ef4444;color:#fff;font-size:10px;font-weight:700;line-height:16px;text-align:center;padding:0 3px;box-sizing:border-box;display:none;border:1.5px solid #fff}
.right-panel{display:none!important}
.right-panel.open{display:flex!important;animation:rpIn .28s ease}
.right-panel{position:absolute!important;top:98px!important;right:8px!important;left:auto!important;width:62vw!important;min-width:0!important;max-width:300px!important;max-height:46vh!important;border-radius:12px!important;z-index:310!important;pointer-events:none!important}
  .right-panel .rp-notices,.right-panel .rp-alerts,.right-panel .rp-header,.right-panel .rp-notices-body,.right-panel .rp-alerts-body,.right-panel .pub-btn,.right-panel .hist-btn,.right-panel .alert-flt{pointer-events:auto!important}
  .right-panel .rp-notices{flex:0 0 auto!important;max-height:30vh;overflow-y:auto!important}

  /* 班组列表 / 预警列表：地图下方卡片 */
  .team-list,.rp-alerts-body{background:#fff;border-radius:14px;padding:12px;margin-bottom:12px;border:1px solid #E2E8F0}
  .team-item{padding:12px;border-bottom:1px solid #F1F5F9;border-radius:10px}
  .team-item .team-extra-btn,.team-item .team-detail-btn{min-height:44px;font-size:14px}
  .rp-notice-item,.alert-item{padding:12px;font-size:14px}
  .alert-title{font-size:15px!important}
  .btn-notice-pub,.btn-notice-hist{min-height:44px;padding:0 14px!important}
  /* 地图控件放大 */
  .leaflet-control-zoom a{width:40px!important;height:40px!important;line-height:40px!important;font-size:20px!important}

  /* ========== 数据大屏（移动端简易版） ========== */
  /* bigscreen.html 是独立页：见 bigscreen.html 内联处理 */

  /* ========== 模板库卡片 ========== */
  .template-grid,.template-list{grid-template-columns:1fr!important}
  .template-card{width:100%!important;max-width:none!important}
  .template-card .btn{min-height:48px}

  /* ========== 筛选栏横向滑动 ========== */
  .filter-bar,.filter-row,.filters,.search-bar{flex-wrap:nowrap!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch;scrollbar-width:none;padding-bottom:2px}
  .filter-bar::-webkit-scrollbar,.filter-row::-webkit-scrollbar,.filters::-webkit-scrollbar,.search-bar::-webkit-scrollbar{display:none}
  .filter-bar > *,.filter-row > *{flex:0 0 auto}

  /* ========== 隐藏列宽按钮 ========== */
  .btn-selw{display:none!important}

  /* ========== toast：移到屏幕下方中部，不挡内容 ========== */
  .toast{top:auto!important;bottom:76px!important;left:50%!important;right:auto!important;transform:translateX(-50%)!important;max-width:84vw;font-size:14px;padding:10px 18px;border-radius:12px;z-index:5000}
  .success{top:auto!important;bottom:76px!important}

  /* ========== 图片查看器 ========== */
  .mob-img-viewer{display:none;position:fixed;inset:0;background:rgba(0,0,0,.92);z-index:6000;align-items:center;justify-content:center;flex-direction:column}
  .mob-img-viewer.show{display:flex}
  .mob-img-viewer img{max-width:94vw;max-height:80vh;object-fit:contain;transition:transform .15s;user-select:none;-webkit-user-drag:none}
  .mob-img-viewer .miv-tip{color:#94A3B8;font-size:12px;margin-top:12px}
  .mob-img-viewer .miv-close{position:absolute;top:14px;right:16px;color:#fff;font-size:26px;width:48px;height:48px;display:flex;align-items:center;justify-content:center;cursor:pointer}

  /* ========== 禁项：操作按钮字不小于16px ========== */
  .btn-add,.action-btn,.pub-btn,.hist-btn,.btn-notice-pub,.btn-notice-hist,.btn-primary{font-size:16px!important;min-height:40px;line-height:1.3}
  #hazardModalWrap button,#hzHandleWrap button,#hzReviewWrap button,#bfModalWrap button,#certModalWrap button,#wsModal button,#noticeModalWrap button,#hzDetailWrap button,#bfDetailWrap button{font-size:16px!important;min-height:40px;line-height:1.3}
  /* 弹窗底部安全区适配（iPhone 下巴） */
  #hazardModalWrap>div,#hzHandleWrap>div,#hzReviewWrap>div,#bfModalWrap>div,#certModalWrap>div,#noticeModalWrap>div,#hzDetailWrap>div,#bfDetailWrap>div,#wsModal>div,#msgCenterModal>div{padding-bottom:max(18px,env(safe-area-inset-bottom))!important}

  /* ========== 其他 ========== */
  .quick-panel,.quick-grid{grid-template-columns:repeat(2,1fr)!important;gap:8px}
  .view-header{flex-wrap:wrap;gap:8px}
  .view-header .actions{width:100%;display:flex;gap:8px}
  .view-header .actions .btn{flex:1}
  .data-table img{max-width:100%}
}

@media (max-width:400px){
  .stat-grid .stat-item .num{font-size:22px!important}
  .app-tabbar .tab{font-size:10px}
}

/* R19: 移动端通知按钮防遮挡 */
@media (max-width:768px){
  .content-toolbar .btn-notice-pub,.content-toolbar .btn-notice-hist{position:relative;z-index:5;flex:0 0 auto;white-space:nowrap;overflow:visible;padding:4px 10px !important;line-height:1.4}
  /* P0-3：手机端今日现场卡片改为顶部横幅（左右自适应，不压成竖条、不遮地图） */
  #todaySiteCard{left:12px!important;right:12px!important;top:12px!important;width:auto!important;max-width:none!important;flex-wrap:wrap!important;gap:8px!important;padding:12px 14px!important}
  #todaySiteCard img{width:36px!important;height:36px!important}
}

/* P2-8：手机端人员页工具条「更多 ▾」导出菜单隐藏（行级「更多 ▼」操作保留，避免两个「更多」混淆） */
@media (max-width:768px){
  .zt-toolbar .zt-more{display:none!important}
  .worker-toolbar .zt-more{display:none!important}
}

