/* BearingHub 移动端适配（2026-11-15）
   加载顺序：位于各页面 inline <style> 之后（</head> 前），
   等特异性选择器按文档顺序覆盖，页面无需改动。 */

/* ============ 通用：触控优化 ============ */
button, a, select, input[type=button] { touch-action: manipulation; -webkit-tap-highlight-color: rgba(24,95,165,.08); }
.tablewrap { -webkit-overflow-scrolling: touch; }

/* ============ 平板/窄窗口 ≤ 820px ============ */
@media (max-width: 820px) {
  /* 页面骨架 */
  .wrap { padding: 16px 12px 32px; }
  h1 { font-size: 18px; }
  .panel { padding: 12px; border-radius: 10px; margin-bottom: 12px; }
  header { gap: 10px; }

  /* 头部登录框：纵向铺满，不再 min-width 260px 顶破屏幕 */
  header { flex-direction: column; align-items: stretch; }
  .authbox { max-width: none; min-width: 0; width: 100%; }
  .authbox .row { flex-wrap: wrap; }
  .authbox input { flex: 1 1 120px; width: auto; min-width: 0; }

  /* 防 iOS 聚焦自动放大：所有可输入控件字号 ≥16px */
  input, select, textarea,
  .searchbar input, .searchbar select,
  .qtyin, .brandin, .modelin, .authbox input,
  .regform input, .regform select,
  .modalbody input, .modalbody textarea {
    font-size: 16px;
  }

  /* 多列表单收成单列 */
  .form2, .regform { grid-template-columns: 1fr; }
  .regform .verifyrow { grid-template-columns: 1fr auto; }

  /* 表格：保持横向滚动（数据表手机上最优解），收一点内距 */
  th, td { padding: 8px 7px; }
  td.vw { max-width: 150px; }

  /* 触控目标放大（原来 11~12px 字号 + 紧内距，手指不好点） */
  .mini { padding: 6px 12px; font-size: 13px; }
  .cartbtn { padding: 6px 12px; font-size: 13px; }
  .btn2, .btn { padding: 8px 14px; font-size: 13px; }
  .navlink { padding: 7px 12px; font-size: 13px; }
  .tabs button { padding: 8px 13px; font-size: 13px; }
  .qtyin { width: 88px; }

  /* 分页/合计居中 */
  .pager { justify-content: center; }
  .total { justify-content: center; flex-wrap: wrap; }

  /* 弹窗不吃满 */
  .modal { width: calc(100vw - 24px); max-width: 460px; }

  /* 管理端统计卡自适应 */
  .stat { gap: 10px; }
  .stat div { flex: 1 1 40%; min-width: 0; }

  /* 管理端若直接放 table 没有 .tablewrap，给面板内表格兜底横向滚动 */
  .panel { overflow-x: auto; }
}

/* ============ 手机 ≤ 520px ============ */
@media (max-width: 520px) {
  .wrap { padding: 12px 10px 28px; }
  h1 { font-size: 17px; }
  .sub { font-size: 12px; }
  .panel { padding: 10px; }

  /* 俄语译名列/备注限宽再收，减少横向滚动距离 */
  td.vw { max-width: 120px; }
  .note { max-width: 160px; }
  table { font-size: 12.5px; }

  /* 快捷 chips 允许横向滚动而不是挤成多行占屏 */
  .chips, .brandchips, .sortbar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .chips button, .brandchips button, .sortbar button { flex: 0 0 auto; white-space: nowrap; }

  /* toast 上移，避开右下角 WhatsApp/客服浮窗 */
  #toast { bottom: 120px; max-width: calc(100vw - 140px); }

  footer { font-size: 11.5px; }

  /* 管理端 tabs 横滑 */
  .tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .tabs button { flex: 0 0 auto; }
}
