/* ============================================================
   全站移动端适配（share5.cn）
   覆盖：报警详情页 / 信号详情页 / 列表页 / 工具页
   说明：页面主体为内联 style，此处需用 !important 覆盖
   ============================================================ */

/* ---------- 基础防溢出（所有屏幕） ---------- */
img, video, iframe { max-width: 100% !important; height: auto !important; }
pre { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- 手机端（≤640px） ---------- */
@media (max-width: 640px) {

  /* 外层 main：内边距收窄 */
  body > main { padding: 0 10px !important; }

  /* 文章卡片容器：双层 padding 压缩，留足内容宽度 */
  body > main > div {
    padding: 20px 14px !important;
    margin: 16px auto !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06) !important;
  }

  /* 标题与正文字号 */
  h1 { font-size: 1.45em !important; line-height: 1.35 !important; }
  h2 { font-size: 1.25em !important; }
  h3 { font-size: 1.12em !important; }
  #article-content { font-size: 1em !important; line-height: 1.75 !important; }

  /* ---- 表格（信号速查表 / 报警处理表等）---- */
  #article-content table {
    display: block;
    width: 100% !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-collapse: collapse;
    font-size: 0.92em;
    margin: 14px 0 !important;
  }
  #article-content th,
  #article-content td {
    padding: 8px 10px !important;
    border: 1px solid #e5e7eb !important;
    vertical-align: top;
    word-break: break-word;
  }
  #article-content th { background: #f3f4f6; white-space: nowrap; }
  /* 两列规格表：标签列不再逐字换行 */
  #article-content td:first-child {
    white-space: nowrap;
    width: 1%;
    font-weight: 600;
    color: #374151;
    background: #f9fafb;
  }
  /* 表格横向滚动提示（宽表可滑动） */
  #article-content table { border: 1px solid #e5e7eb; border-radius: 6px; }

  /* ---- 代码 ---- */
  #article-content code {
    word-break: break-all;
    font-size: 0.95em;
  }

  /* ---- 面包屑 / 元信息 ---- */
  nav[aria-label="面包屑导航"] { font-size: 0.85em !important; line-height: 1.6; }

  /* ---- 资料获取下载框 ---- */
  body > main > div > div[style*="f0f7ff"] {
    padding: 22px 12px !important;
  }
  body > main > div > div[style*="f0f7ff"] h3 { font-size: 1.2em !important; }
  body > main > div > div[style*="f0f7ff"] a,
  body > main > div > div[style*="f0f7ff"] span {
    max-width: 100% !important;
    box-sizing: border-box;
  }
  /* 下载按钮：缩小内边距，避免溢出 */
  body > main > div > div[style*="f0f7ff"] a[style*="padding: 15px 45px"],
  body > main > div > div[style*="f0f7ff"] a[style*="padding:15px 45px"],
  body > main > div > div[style*="f0f7ff"] span[style*="padding: 15px 45px"],
  body > main > div > div[style*="f0f7ff"] span[style*="padding:15px 45px"] {
    padding: 12px 22px !important;
    font-size: 1.05em !important;
    white-space: nowrap;
  }

  /* ---- 报警页徽章行 / 上一下一 ---- */
  div[style*="display: flex"][style*="gap: 8px"] { gap: 6px !important; }
  div[style*="display:flex"][style*="gap:10px"] { font-size: 0.85em !important; }

  /* ---- 相关文章推荐：单列 ---- */
  div[style*="grid-template-columns: repeat(auto-fit"] {
    grid-template-columns: 1fr !important;
  }

  /* ---- 页脚：单列堆叠 ---- */
  footer div[style*="display: flex"][style*="flex-wrap"] {
    flex-direction: column !important;
    gap: 16px !important;
  }
}

/* ---------- 小屏桌面 / 大屏手机（641px~768px） ---------- */
@media (min-width: 641px) and (max-width: 768px) {
  body > main > div { padding: 28px 20px !important; }
}
