/* =============================================================
   移动端 / iPad 兼容修复层 2026-10-15
   ============================================================= */

/* ---------- 0. 覆盖原样式表的负偏移箭头（iPad 横向滚动根因） ---------- */
.productmainnext { left: 4px !important; }
.productmainprev { right: 4px !important; }

/* ---------- 1. 横向溢出兜底 ---------- */
html, body { max-width: 100%; overflow-x: hidden; }
main, section, .fm-wrap, figure, table { min-width: 0; }
img, svg, video, iframe { max-width: 100%; height: auto; }
.fm-hero-marquee { max-width: 100vw; overflow: hidden; }

/* ---------- 2. 汉堡菜单与移动端导航 ---------- */
@media (max-width: 900px) {
  .fm-burger {
    display: flex !important;
    width: 44px; height: 44px; min-width: 44px;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .fm-mainbar .fm-wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .fm-logo { flex: 1 1 auto; min-width: 0; }
  .fm-logo img { max-height: 40px; width: auto; }

  .fm-navbar { position: relative; z-index: 900; }
  .fm-navbar .fm-wrap { display: block; width: 100%; max-width: 100vw; padding: 0; }
  .fm-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    max-width: 100vw;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background: var(--fm-navy-2, #0b2540);
    padding: 8px 0 20px;
    box-shadow: 0 18px 40px rgba(11, 31, 51, .28);
  }
  .fm-nav.on { display: flex !important; }

  .fm-nav > a,
  .fm-nav-item {
    display: block;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, .08);
  }
  .fm-nav > a,
  .fm-nav-item > a {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    min-width: 0;
    padding: 15px 60px 15px 22px;
    font-size: 15.5px;
    color: #dce8f2;
    overflow-wrap: break-word;
  }
  .fm-nav > a { padding-right: 22px; }
  .fm-nav > a:active,
  .fm-nav-item > a:active { background: rgba(255, 255, 255, .07); }

  .fm-nav-item { position: relative; }
  .fm-subnav-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    right: 0;
    width: 52px;
    height: 100%;
    min-height: 50px;
    margin: 0;
    background: none;
    border: none;
    color: #c6d6e4;
    font-size: 15px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .fm-subnav-toggle i { transition: transform .25s; display: block; }
  .fm-nav-item.open .fm-subnav-toggle i { transform: rotate(45deg); }

  .fm-mega {
    position: static !important;
    display: none;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100%;
    box-shadow: none;
    border-radius: 0;
    background: rgba(0, 0, 0, .22);
    padding: 4px 0;
    z-index: auto;
  }
  .fm-nav-item.open .fm-mega { display: block; }
  .fm-mega > a {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 12px 18px 12px 34px !important;
    font-size: 14px;
    color: #c6d6e4 !important;
    border-radius: 0;
    overflow-wrap: break-word;
  }
  .fm-mega > a:active { background: rgba(255, 255, 255, .09); color: #fff !important; }

  .fm-nav-quote { display: none !important; }
  .fm-nav .fm-nav-quote-m {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 16px 22px 4px;
    width: calc(100% - 44px);
    background: var(--fm-amber, #ff9f1c);
    color: #182430;
    font-weight: 700;
    font-size: 15px;
    padding: 14px 16px;
    border-radius: 999px;
    text-align: center;
  }
}

/* ---------- 3. iPad 641-1100 补齐 ---------- */
@media (min-width: 641px) and (max-width: 1100px) {
  .productmainnext, .productmainprev { display: none !important; }
  .fm-hero-grid { gap: 32px; }
  .detail-content table,
  .magCorpProfTable table,
  .magTableWrap table {
    display: block;
    width: 100% !important;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ---------- 4. 移动端内容可读性 ---------- */
@media (max-width: 640px) {
  .detail-content table,
  .magCorpProfTable table,
  .magTableWrap table,
  .magTableWrap {
    display: block;
    width: 100% !important;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
  }
  .detail-content table td,
  .detail-content table th { white-space: nowrap; }

  .magSubclassRail,
  .magSubclassRailWrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  .productmain .swiper-slide { width: 100% !important; }

  h1, h2, h3, h4, p, a, span, td, th, li { overflow-wrap: break-word; word-break: break-word; }

  .fm-footer-col nav a,
  .fm-footer-legal a { padding: 6px 0; display: inline-block; }

  .modal-box {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    max-height: 88vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 26px 20px !important;
    border-radius: 16px;
  }
  .modal-overlay { padding: 12px; overflow-y: auto; }
  .form-row { grid-template-columns: 1fr !important; }
  .modal-box input,
  .modal-box select,
  .modal-box textarea { font-size: 16px !important; }

  .fm-topstrip { font-size: 12px; }
  .back-to-top { right: 14px; bottom: 76px; width: 46px; height: 46px; }
}

/* iPhone SE 等超窄屏 */
@media (max-width: 375px) {
  .fm-wrap { padding: 0 16px; }
  .fm-hero-grid { padding: 44px 16px 40px; }
  .fm-btn { padding: 13px 18px; font-size: 14px; }
  .fm-nav > a, .fm-nav-item > a { padding: 14px 54px 14px 18px; font-size: 15px; }
  .fm-nav > a { padding-right: 18px; }
  .fm-mega > a { padding: 11px 14px 11px 26px !important; font-size: 13.5px; }
  .fm-flowline-grid { grid-template-columns: 1fr !important; }
  .fm-cta { padding: 30px 20px !important; }
}

/* 横屏手机 */
@media (max-height: 480px) and (orientation: landscape) {
  .fm-nav { max-height: calc(100vh - 90px); }
  .fm-topstrip { display: none; }
}

/* 尊重系统减少动画设置 */
@media (prefers-reduced-motion: reduce) {
  .fm-hero-marquee-track,
  .xcpslider__track,
  .productmain .swiper-wrapper { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}