/* ===== 移动端适配补丁（中英文站共用） ===== */

/* 媒体与富文本不撑破内容区 */
img, video, iframe { max-width: 100%; }
.cb-rich img, .richtext img { height: auto; }

@media (max-width: 767.98px) {
  /* 表单控件统一 16px，避免 iOS 聚焦时页面被自动放大 */
  .form-control, .form-select, textarea,
  input[type="text"], input[type="password"], input[type="email"],
  input[type="search"], input[type="tel"], input[type="number"] { font-size: 16px; }

  /* 触控区域不小于 40px，避免误触 */
  .btn { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
  .btn-sm { min-height: 34px; }

  /* 分页条：允许换行，避免数字条挤在一起 */
  .pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; }
  .pagination .page-link,
  .pagination .page-item {
    border-radius: 8px !important; margin: 0 !important;
    min-width: 40px; min-height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .9rem;
  }

  /* 富文本：超长英文/链接强制断行，表格改为横向滑动而不是压缩列宽 */
  .cb-rich, .richtext { word-break: break-word; overflow-wrap: anywhere; }
  .cb-rich table, .richtext table {
    display: block; width: 100%; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 旧版页头横幅：压缩高度，避免首屏被吃掉 */
  .jumbotron.jumbotron-fluid { padding: 18px 0 !important; margin-bottom: 12px !important; }
  .jumbotron.jumbotron-fluid h1 { font-size: 1.25rem !important; margin-bottom: 4px; }
  .jumbotron.jumbotron-fluid p { font-size: .85rem !important; margin-bottom: 0; }
}

@media (max-width: 575.98px) {
  /* 通用「表格转卡片」：给表格加 class="table-stack" 并在 td 上写 data-label */
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr {
    background: #f8fafc; border: 1px solid #eef2f7; border-radius: 12px;
    padding: 12px 14px; margin-bottom: 12px;
  }
  .table-stack td {
    border: none !important; padding: 5px 0 !important;
    display: flex; gap: 10px; align-items: flex-start; font-size: .92rem;
  }
  .table-stack td::before {
    content: attr(data-label); flex: 0 0 54px;
    color: #94a3b8; font-size: .82rem; line-height: 1.7;
  }
  .table-stack td:empty { display: none; }
}
