/* ==========================================================================
   SafeCirk — Mobile / Small-screen Responsive Patch
   引入方式：在 meta.html / meta-light.html 里 <link rel="stylesheet" href="/css-1/mobile.css">
   ========================================================================== */

/* ====== 全局基础 ====== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -moz-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-x: hidden; }
img { max-width: 100%; height: auto; }
table { max-width: 100%; }

/* ====== 1200px 以下（平板横屏 / 小桌面） ====== */
@media (max-width: 1200px) {
  .sc-h-container { width: 94%; }
  .lem2-container { width: 94%; }
  .lem-container { width: 94%; }
}

/* ====== 900px 以下（平板竖屏 / 大手机） ====== */
@media (max-width: 900px) {
  /* --- Header 主栏高度 --- */
  .sc-mainbar-inner { height: 64px; gap: 14px; }
  .sc-logo img { height: 36px; }
  .sc-topbar { font-size: 11px; }
  .sc-topbar-inner { height: 30px; }

  /* --- 通用容器 --- */
  .sc-h-container, .lem2-container, .lem-container { width: 95%; padding: 0 10px; }

  /* --- 首页 Hero --- */
  .hm2-hero h1 { font-size: 30px; line-height: 1.25; }
  .hm2-hero form.hm2-search { width: 100%; }
  .hm2-why-grid { grid-template-columns: 1fr 1fr; }
  .hm2-quote-grid { grid-template-columns: 1fr; }

  /* --- List 页：sidebar 移到底部 --- */
  .lem2-layout { grid-template-columns: 1fr !important; }
  .lem2-sidebar { order: 2; padding: 16px; border-right: none; border-top: 1px solid #e5e7eb; }
  .lem2-series-body { order: 1; }
  .lem2-layout .lem-quote-panel { order: 3; margin-top: 16px; }
  /* --- Why Buy 四项：纵向排布时统一左对齐、行间留距（与 lem-list-v2.css 保持一致） --- */
  .lem2-features { grid-template-columns: 1fr; gap: 0; }
  .lem2-feature { padding: 0; border-right: none; align-items: center; gap: 12px; }
  .lem2-feature + .lem2-feature { border-top: 1px solid #d1d5db; padding-top: 14px; margin-top: 14px; }
  .lem2-feature > div { min-width: 0; }

  /* --- 面包屑 --- */
  .lem2-crumbbar, .lem-crumbbar, .sc-crumbbar, .ab-crumbbar, .cs-crumbbar, .lg-crumbbar, .ti-crumbbar, .ni-crumbbar {
    padding: 8px 0; font-size: 12px;
  }

  /* --- 搜索页 --- */
  .lem-search-exact-card { grid-template-columns: 1fr; }
  .lem-search-exact-img { border-right: none; border-bottom: 1px solid #e5e7eb; }
  .lem-search-exact-main { border-right: none; }
  .lem-search-exact-actions { background: #fff; border-top: 1px solid #e5e7eb; padding: 16px; flex-direction: row; flex-wrap: wrap; gap: 8px; justify-content: center; }
  .lem-search-exact-actions .lem-btn-exact { width: auto; flex: 1 1 auto; min-width: 120px; }
  .lem-search-empty { padding: 24px 16px; flex-direction: column; gap: 16px; text-align: center; }
  .lem-search-empty-icon { flex-shrink: 0; }
  .lem-search-empty-body h2 { font-size: 18px; white-space: normal !important; }

  /* --- PDP 详情页 --- */
  .lem-pdp .lem-hero-grid { grid-template-columns: 1fr !important; }
  .lem-quote-panel { position: static !important; margin-top: 20px; }
  .lem-related-wrap { padding: 0; }

  /* --- Footer --- */
  .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 20px; }
}

/* ====== 600px 以下（小手机） ====== */
@media (max-width: 600px) {
  /* --- Header 压缩 --- */
  .sc-topbar-inner { flex-wrap: wrap; height: auto; padding: 6px 0; gap: 6px; }
  .sc-top-tagline { font-size: 10.5px; }
  .sc-top-links { gap: 12px; font-size: 11px; }
  .sc-mainbar-inner { height: 56px; }
  .sc-logo img { height: 30px; }
  .sc-rfq { padding: 8px 12px; font-size: 12px; }

  /* --- 首页 Hero --- */
  .hm2-hero h1 { font-size: 24px; }
  .hm2-hero p.hm2-lead { font-size: 14px; }
  .hm2-search input { height: 44px; font-size: 15px; }
  .hm2-search button { height: 44px; padding: 0 18px; }
  .hm2-brand-row { gap: 16px; }
  .hm2-brand-row img { max-height: 22px; }

  /* --- 搜索页 --- */
  .lem-search-banner { font-size: 12.5px; padding: 10px 14px; gap: 8px; }
  .lem-search-banner i { width: 22px; height: 22px; font-size: 11px; }
  .lem-search-exact-model { font-size: 20px; }
  .lem-search-exact-badge { font-size: 10px; padding: 3px 7px; }
  .lem-search-exact-spec { grid-template-columns: 85px 1fr; font-size: 12px; }
  .lem-search-exact-spec-label, .lem-search-exact-spec-value { padding: 7px 10px; }
  .lem-search-fuzzy-title { font-size: 13px; white-space: normal !important; }
  .lem-search-empty-actions { flex-direction: column; gap: 10px; }
  .lem-search-empty-actions .lem-btn-primary,
  .lem-search-empty-actions .lem-btn-secondary { width: 100%; }

  /* --- List 页表格 --- */
  .lem-search-table thead th,
  .lem-search-table tbody td { padding: 10px 12px; font-size: 12.5px; }
  .lem-pager { gap: 4px; font-size: 12px; }
  .lem-pager button, .lem-pager a { min-width: 30px; height: 30px; line-height: 30px; padding: 0 6px; }

  /* --- 面包屑 --- */
  .lem2-crumbbar, .lem-crumbbar, .sc-crumbbar { padding: 6px 0; font-size: 11.5px; }

  /* --- Footer --- */
  .footer-grid { grid-template-columns: 1fr !important; }
  .footer-bottom { flex-direction: column; gap: 10px; text-align: center; }

  /* --- 通用按钮 --- */
  .lem-btn-primary, .lem-btn-secondary { padding: 10px 16px; font-size: 13px; }
}

/* ====== 400px 以下（超小屏） ====== */
@media (max-width: 400px) {
  .hm2-hero h1 { font-size: 20px; }
  .sc-logo img { height: 26px; }
  .sc-rfq { display: none; }
  .lem-search-exact-spec { grid-template-columns: 75px 1fr; font-size: 11.5px; }
}

/* ====== 防止 iOS 横屏自动放大 ====== */
@media (orientation: landscape) and (max-height: 500px) {
  .hm2-hero h1 { font-size: 22px; }
  .sc-mainbar-inner { height: 52px; }
}
