/* =====================================================
   绿安消防办公平台 - 公共样式
   ===================================================== */

/* 表格容器内部滚动，表头固定 */
.card, div:has(> table) {
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  overflow-x: auto;
}
table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f0f5fa !important;
  color: #2c3e50 !important;
  box-shadow: 0 1px 0 #c5d5e8;
}

/* =====================================================
   手机端适配（自动注入所有页面）
   适用宽度 <= 820px（手机/平板竖屏）
   ===================================================== */
@media (max-width: 820px) {
  html, body { font-size: 15px; }
  * { box-sizing: border-box; }
  body { overflow-x: hidden; }

  /* ---- 表格：横向滚动，避免挤压/重叠/显示不全 ---- */
  table {
    display: block;
    overflow-x: auto;
    max-width: 100%;
    border-collapse: collapse;
    -webkit-overflow-scrolling: touch;
  }
  td, th {
    white-space: nowrap;
    padding: 6px 8px;
    font-size: 13.5px;
  }

  /* ---- 通用容器防溢出 ---- */
  .container, .wrap, .main, .content, .page, .panel, .box, .card,
  div[class*="card"], div[class*="box"], div[class*="panel"], div[class*="wrap"],
  form, .row, .grid, .header, .footer, .navbar, .nav, .tabs {
    max-width: 100% !important;
    overflow-wrap: break-word;
  }

  /* ---- 表单适配（防 iOS 自动放大 + 防溢出） ---- */
  input, select, textarea {
    font-size: 16px;
    max-width: 100%;
  }
  button, .btn {
    font-size: 15px;
    max-width: 100%;
  }

  /* ---- 文本换行，防文字重叠/截断 ---- */
  p, h1, h2, h3, h4, h5, li, span, div, label, a {
    overflow-wrap: break-word;
  }
  h1 { font-size: 19px; }
  h2 { font-size: 17px; }
  h3 { font-size: 16px; }

  /* ---- iframe（门户内嵌）自适应 ---- */
  iframe { width: 100% !important; }

  /* ---- 弹窗/模态框自适应 ---- */
  .modal, .dialog, .popup, div[class*="modal"], div[class*="dialog"] {
    max-width: 96% !important;
    margin: 0 auto;
    left: 2% !important;
    right: 2% !important;
  }

  /* ---- 固定定位的侧栏/菜单收窄 ---- */
  .sidebar, .aside, div[class*="sidebar"] {
    max-width: 70vw;
  }
}
