/* ============ 移动端样式 ============ */
/* 本文件仅 ≤1024px 通过 <link media="(max-width:1024px)"> 按需加载。
   桌面端样式在 style.css。三层断点：1024 导航切换/网格降列 · 768 手机纵向 · 480 小屏收窄。 */

@media(max-width:1024px) {
  .nav {
  display: none
  }

  .hamburger {
  display: flex
  }

  .header-actions .btn {
  display: none
  }

  .lang-switch {
  display: none
  }

  .cat-grid {
  grid-template-columns: repeat(2, 1fr)
  }

  .why-grid {
  grid-template-columns: repeat(2, 1fr)
  }

  .proj-grid {
  grid-template-columns: repeat(2, 1fr)
  }

  .factory-grid {
  grid-template-columns: 1fr;
  gap: 32px
  }

  .featured-slide {
  grid-template-columns: 1fr
  }

  .featured-img {
  aspect-ratio: 1/1
  }

  .footer-grid {
  grid-template-columns: 1fr 1fr;
  gap: 32px
  }

  .product-layout {
  grid-template-columns: 1fr
  }

  .sidebar {
  position: static
  }

  .product-grid {
  grid-template-columns: repeat(2, 1fr)
  }

  .detail-layout {
  grid-template-columns: 1fr;
  gap: 32px
  }

  .scenario-grid {
  grid-template-columns: repeat(2, 1fr)
  }

  .about-story-grid {
  grid-template-columns: 1fr
  }

  .about-stats-grid {
  grid-template-columns: repeat(2, 1fr)
  }

  .cert-grid {
  grid-template-columns: repeat(2, 1fr)
  }

  .contact-layout {
  grid-template-columns: 1fr
  }

  .contact-info-side {
  padding: 40px 32px
  }

  .contact-meta {
  grid-template-columns: repeat(2, 1fr)
  }

  .gallery-grid {
  grid-template-columns: repeat(3, 1fr)
  }

  .strip-grid {
  grid-template-columns: repeat(3, 1fr)
  }

  .process-grid {
  grid-template-columns: repeat(2, 1fr)
  }

  .timeline-grid {
  gap: 12px
  }

  .timeline-step p {
  font-size: 12px;
  padding: 0 4px
  }

  .product-list {
  grid-template-columns: 1fr
  }

  .service-grid {
  grid-template-columns: repeat(2, 1fr)
  }

  .detail-gallery-grid {
  grid-template-columns: repeat(2, 1fr)
  }

  .cat-intro-grid,
  .materials-grid,
  .custom-grid {
  grid-template-columns: repeat(2, 1fr)
  }

  .market-grid {
  grid-template-columns: repeat(3, 1fr)
  }

  .flow-grid {
  grid-template-columns: repeat(3, 1fr)
  }

  .flow-line {
  display: none
  }

  .values-grid,
  .qc-grid {
  grid-template-columns: repeat(2, 1fr)
  }

  .inquiry-grid {
  grid-template-columns: 1fr
  }
}

@media(max-width:768px) {
  .to-top {
  right: 16px;
  bottom: 16px;
  width: 42px;
  height: 42px
  }

  .section-pad {
  padding: 64px 0
  }

  .container {
  padding: 0 16px
  }

  .cat-grid {
  grid-template-columns: 1fr
  }

  .cat-card {
  aspect-ratio: 1/1
  }

  .why-grid {
  grid-template-columns: 1fr
  }

  .proj-grid {
  grid-template-columns: 1fr 1fr
  }

  .footer-grid {
  grid-template-columns: 1fr;
  gap: 32px
  }

  .trust-divider {
  display: none
  }

  .trust-inner {
  gap: 24px
  }

  .featured-info {
  padding: 32px 24px
  }

  .featured-arrow {
  width: 40px;
  height: 40px
  }

  .featured-arrow-prev {
  left: 12px
  }

  .featured-arrow-next {
  right: 12px
  }

  .hero {
  min-height: 90vh
  }

  .hero-content {
  padding-top: 60px
  }

  .product-grid {
  grid-template-columns: 1fr
  }

  .form-row {
  grid-template-columns: 1fr
  }

  .contact-form-wrap {
  padding: 40px 24px
  }

  .contact-cards {
  grid-template-columns: 1fr
  }

  .contact-meta {
  grid-template-columns: 1fr;
  gap: 28px
  }

  .about-stats-grid {
  grid-template-columns: 1fr 1fr
  }

  .timeline-grid {
  grid-template-columns: 1fr
  }

  .timeline-line {
  display: none
  }

  .gallery-grid {
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 160px
  }

  .gallery-large {
  grid-column: span 2;
  grid-row: span 1
  }

  .strip-grid {
  grid-template-columns: repeat(2, 1fr)
  }

  .process-grid {
  grid-template-columns: 1fr
  }

  .product-list .product-card {
  flex-direction: column
  }

  .product-list .product-card-img {
  width: 100%;
  min-width: 0;
  aspect-ratio: 1/1
  }

  .product-list .product-card-info {
  padding: 24px
  }

  .product-list .product-card-info h3 {
  font-size: 18px
  }

  .product-list .product-card-desc {
  font-size: 13px
  }

  .category-head {
  font-size: 20px;
  margin: 36px 0 16px
  }

  .detail-desc-points {
  grid-template-columns: 1fr
  }

  .cat-intro-grid,
  .materials-grid,
  .custom-grid {
  grid-template-columns: 1fr
  }

  .market-grid {
  grid-template-columns: repeat(2, 1fr)
  }

  .flow-grid {
  grid-template-columns: repeat(2, 1fr)
  }

  .values-grid,
  .qc-grid {
  grid-template-columns: 1fr
  }

  .inquiry-list {
  grid-template-columns: 1fr
  }
}

@media(max-width:480px) {
  .proj-grid {
  grid-template-columns: 1fr
  }

  .scenario-grid {
  grid-template-columns: 1fr
  }

  .cert-grid {
  grid-template-columns: 1fr
  }

  .trust-item strong {
  font-size: 16px
  }

  .trust-item span {
  font-size: 10px
  }

  .gallery-grid {
  grid-template-columns: 1fr;
  grid-auto-rows: 200px
  }

  .gallery-large {
  grid-column: span 1;
  grid-row: span 1
  }

  .strip-grid {
  grid-template-columns: 1fr
  }

  .service-grid {
  grid-template-columns: 1fr
  }

  .detail-gallery-grid {
  grid-template-columns: 1fr
  }

  .market-grid {
  grid-template-columns: 1fr
  }

  .flow-grid {
  grid-template-columns: 1fr
  }
}

/* ============ 移动端导航增强（Task3）：品牌区 / 语言切换 / 快捷联系入口 ============ */
@media(max-width:1024px) {
  .mobile-menu {
    justify-content: flex-start;
    padding: 96px 24px 48px;
    overflow-y: auto;
    gap: 8px
  }

  .mobile-menu-brand {
    text-align: center;
    margin-bottom: 24px
  }

  .mobile-menu-brand-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 30px;
    letter-spacing: 3px;
    color: var(--white)
  }

  .mobile-menu-brand-logo span {
    color: var(--copper)
  }

  .mobile-menu-brand-sub {
    font-size: 11px;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    margin-top: 4px
  }

  .mobile-menu a {
    font-size: 20px;
    padding: 10px 0
  }

  /* 菜单内 CTA 按钮恢复左右 padding（.mobile-menu a 会覆盖 .btn 的 padding） */
  .mobile-menu .btn {
    padding: 14px 40px
  }

  /* 覆盖 1024 层 .lang-switch{display:none}，让菜单内语言切换按钮可见 */
  .mobile-menu .mobile-menu-lang {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 24px;
    font-size: 14px;
    padding: 10px 28px;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.85)
  }

  .mobile-menu-contacts {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(320px, 78vw);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 24px;
    margin-top: 20px
  }

  .mobile-menu a.mm-contact {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    padding: 12px 18px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    transition: all 0.3s var(--ease)
  }

  .mobile-menu a.mm-contact:hover {
    color: var(--copper);
    border-color: var(--copper)
  }

  .mobile-menu a.mm-contact svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--copper)
  }
}

/* 1024px 下默认隐藏 CTA 栏（仅 ≤768px 显示） */
@media(max-width:1024px) {
  .mobile-cta-bar {
    display: none
  }
}

/* ============ 底部固定 CTA 栏（Task4，≤768px 显示，仅含栏页面） ============ */
@media(max-width:768px) {
  body.has-mobile-cta {
    padding-bottom: 84px
  }

  .mobile-cta-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 940;
    display: flex;
    justify-content: center;
    padding: 10px 20px calc(10px + env(safe-area-inset-bottom));
    background: rgba(28, 28, 30, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid rgba(255, 255, 255, 0.08)
  }

  .mobile-cta-inner {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 520px
  }

  .mobile-cta-inner .mcta-btn {
    flex: 1;
    justify-content: center;
    padding: 14px 12px;
    font-size: 14px;
    margin: 0
  }

  .mobile-cta-inner.mcta-three .mcta-link {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 6px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 11px;
    font-weight: 600
  }

  .mobile-cta-inner.mcta-three .mcta-link svg {
    width: 20px;
    height: 20px;
    color: var(--copper)
  }

  .mobile-cta-inner.mcta-three .mcta-link:active {
    background: rgba(255, 255, 255, 0.08)
  }

  /* 仅含 CTA 栏页面避让，避免无栏页面悬浮 */
  body.has-mobile-cta .to-top {
    bottom: 96px
  }
}

/* ============ 网格与卡片重排（Task5） ============ */

/* 产品列表卡：1:1 方图 + 信息紧凑化 */
@media(max-width:768px) {
  .product-list .product-card-img {
    aspect-ratio: 1/1
  }

  .product-list .product-card {
    border-radius: 10px
  }

  .product-list .product-card-info {
    padding: 18px 16px
  }

  .product-list .product-card-info h3 {
    font-size: 17px
  }

  .product-list .product-card-desc {
    font-size: 13px;
    margin-bottom: 12px
  }

  .product-list .product-card-points li {
    font-size: 12px
  }

  .product-list .product-card-meta {
    gap: 6px 14px
  }

  .product-list .product-card-meta span {
    font-size: 11px
  }
}

/* 产品页分类筛选 → 顶部横向滚动 chips */
@media(max-width:768px) {
  .product-layout {
    padding: 24px 0 8px
  }

  .sidebar {
    margin-bottom: 8px;
    min-width: 0
  }

  .sidebar h3,
  .filter-group h4 {
    display: none
  }

  .sidebar .filter-group {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 0 12px;
    margin-bottom: 0
  }

  .sidebar .filter-group::-webkit-scrollbar {
    display: none
  }

  .filter-option {
    flex-shrink: 0;
    padding: 0
  }

  .filter-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0
  }

  .filter-option label {
    display: inline-flex;
    align-items: center;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.25s var(--ease)
  }

  .filter-option input:checked + label {
    background: var(--copper);
    border-color: var(--copper);
    color: var(--white)
  }

  .product-toolbar {
    margin-bottom: 16px
  }
}

/* 首页分类卡 / 市场卡 横向滑动 */
@media(max-width:768px) {
  .cat-grid {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding-bottom: 4px
  }

  .cat-grid::-webkit-scrollbar {
    display: none
  }

  .cat-grid .cat-card {
    flex: 0 0 72%;
    scroll-snap-align: start;
    aspect-ratio: 4/3
  }

  .cat-grid .cat-content {
    padding: 20px
  }

  .market-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    margin-top: 28px
  }

  .market-grid::-webkit-scrollbar {
    display: none
  }

  .market-grid .market-card {
    flex: 0 0 46%;
    scroll-snap-align: start
  }
}

/* 服务/流程网格间距收紧 */
@media(max-width:768px) {
  .service-grid {
    gap: 12px
  }

  .process-grid {
    gap: 16px
  }

  .flow-grid {
    gap: 12px
  }

  .values-grid,
  .qc-grid {
    gap: 14px
  }
}

/* ============ 规格表卡片化 + 触控排版 + 性能（Task6） ============ */

/* 规格表卡片化堆叠 */
@media(max-width:768px) {
  .spec-table {
    display: block
  }

  .spec-table thead {
    display: none
  }

  .spec-table tbody {
    display: block
  }

  .spec-table tr {
    display: block;
    padding: 10px 16px;
    background: var(--white)
  }

  .spec-table tr:nth-child(odd) {
    background: var(--mist)
  }

  .spec-table tr:hover {
    background: #EEF4FA
  }

  .spec-table td {
    display: block;
    padding: 2px 0;
    border: none
  }

  .spec-table td:first-child {
    width: 100%;
    font-weight: 600;
    color: var(--text-mid);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px
  }

  .spec-table td:last-child {
    font-size: 14px;
    color: var(--text);
    padding-top: 2px
  }
}

/* 字号/间距收敛 + 触控目标 + 表单防缩放 + 光斑静止 */
@media(max-width:768px) {
  .section-head h2 {
    font-size: 26px
  }

  .page-hero {
    padding: 130px 0 56px
  }

  .page-hero h1 {
    font-size: 32px
  }

  .page-hero p {
    font-size: 16px
  }

  .featured-dot {
    width: 36px;
    height: 8px
  }

  .gallery-thumb {
    width: 64px;
    height: 64px
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 16px
  }

  /* 性能：触屏停用光斑漂移动画 */
  .ambient-blob {
    animation: none !important
  }
}

@media(max-width:480px) {
  .hero h1 {
    font-size: 34px
  }

  .hero-sub {
    font-size: 15px
  }

  .section-head h2 {
    font-size: 24px
  }

  .cta-content h2 {
    font-size: 26px
  }
}

/* ============ 覆盖 HTML inline grid 样式（oem why-grid 3列 / detail relatedGrid 4列 移动端溢出） ============ */
@media(max-width:1024px) {
  .why-grid,
  #relatedGrid {
    grid-template-columns: repeat(2, 1fr) !important
  }
}

@media(max-width:768px) {
  .why-grid,
  #relatedGrid {
    grid-template-columns: 1fr !important
  }
}

/* ============ 移动端 reveal 横向位移收敛（全宽元素右移会超出视口被裁剪） ============ */
@media(max-width:1024px) {
  .reveal-left.reveal-animate,
  .reveal-right.reveal-animate {
    transform: translateY(32px)
  }

  .reveal-left.reveal-animate.revealed,
  .reveal-right.reveal-animate.revealed {
    transform: translateY(0)
  }
}

/* ============ 移动端首页 hero 背景图切换（竖屏专用 hero-homepage-m.png） ============ */
@media(max-width:768px) {
  .hero-bg {
    background-image: url('/banners/hero-homepage-m.png') !important
  }
}
