/* ============================================
   Mobile Fix Patch — 2026-08-19
   修复手机端布局溢出/乱版问题
   ============================================ */

/* 1. 全局防水平溢出 */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

/* 2. 弹性元素不撑破容器 */
img, video, canvas, svg, iframe {
  max-width: 100%;
}

/* 3. 长文字/链接强制换行 */
p, h1, h2, h3, h4, h5, h6, li, td, th, a, span, div {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* ============================================
   1024px 及以下
   ============================================ */
@media (max-width: 1024px) {
  .container {
    padding: 0 20px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .section {
    padding: 60px 0;
  }

  .contact-form {
    padding: 28px;
  }

  /* 所有未覆盖的多列网格降到2列 */
  .warehouse-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .comparison-card {
    padding: 24px 20px;
  }
}

/* ============================================
   768px 及以下（手机/小平板）
   ============================================ */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  /* 导航 */
  .navbar {
    height: 56px;
  }

  .nav-container {
    padding: 0 16px;
  }

  .nav-logo img {
    height: 28px;
  }

  .nav-links {
    top: 56px;
    padding: 16px;
    gap: 12px;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
  }

  .nav-links a {
    font-size: 0.95rem;
    padding: 12px 0;
  }

  /* Hero */
  .hero {
    padding: 100px 0 60px;
  }

  .hero h1 {
    font-size: 1.5rem;
    line-height: 1.3;
    margin-bottom: 16px;
  }

  .hero p {
    font-size: 0.95rem;
    margin-bottom: 28px;
    line-height: 1.6;
  }

  .hero-buttons {
    gap: 10px;
  }

  .hero-buttons .btn {
    width: 100%;
    max-width: 300px;
    justify-content: center;
  }

  /* Stats */
  .stats-bar {
    padding: 0;
  }

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

  .stat-item {
    padding: 20px 12px;
    border-right: none;
  }

  .stat-number {
    font-size: 1.6rem !important;
  }

  .stat-label {
    font-size: 0.75rem;
  }

  /* Section */
  .section {
    padding: 48px 0;
  }

  .section-title {
    margin-bottom: 32px;
  }

  .section-title h2 {
    font-size: 1.3rem;
  }

  .section-title p {
    font-size: 0.9rem;
  }

  /* 产品/特性卡片全部单列 */
  .products-grid,
  .features-grid,
  .process-steps,
  .process-steps-6,
  .warehouse-grid,
  .comparison-grid,
  .contact-cards,
  .about-brief-stats {
    grid-template-columns: 1fr !important;
  }

  /* 产品卡片 */
  .product-card .card-image {
    height: 180px;
  }

  .product-card .card-body {
    padding: 20px;
  }

  .product-card .card-body h3 {
    font-size: 1.1rem;
  }

  .product-card .card-body p {
    font-size: 0.88rem;
  }

  /* About */
  .about-brief-content {
    gap: 32px;
  }

  .about-brief-text h2 {
    font-size: 1.3rem;
  }

  .about-brief-text p {
    font-size: 0.92rem;
  }

  .stat-box {
    padding: 16px;
  }

  .stat-box .stat-number {
    font-size: 1.5rem;
  }

  /* Content blocks (产品详情页) */
  .content-block {
    gap: 28px;
  }

  .content-block h2 {
    font-size: 1.25rem;
  }

  .content-block p,
  .content-block li {
    font-size: 0.9rem;
  }

  /* 步骤卡片 */
  .step-card {
    padding: 20px 16px;
  }

  /* 对比卡片 */
  .comparison-card {
    padding: 20px;
  }

  /* 表格横向滚动，不撑破屏幕 */
  .specs-table {
    font-size: 0.8rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  .specs-table th,
  .specs-table td {
    padding: 10px 14px;
  }

  /* CTA 区域 — 修复装饰圆形溢出 */
  .cta-section {
    padding: 56px 0;
  }

  .cta-section::before {
    width: 250px;
    height: 250px;
    right: -60px;
    top: -30%;
  }

  .cta-section h2 {
    font-size: 1.3rem;
  }

  .cta-section p {
    font-size: 0.9rem;
  }

  /* 联系页 */
  .contact-grid {
    gap: 32px;
  }

  .contact-card {
    padding: 20px 16px;
  }

  .contact-form {
    padding: 24px 20px;
  }

  .contact-form h3 {
    font-size: 1.15rem;
  }

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

  .form-group input,
  .form-group textarea,
  .form-group select {
    font-size: 16px; /* 防止 iOS 自动缩放 */
  }

  /* 页面头 */
  .page-header {
    padding: 100px 0 40px;
  }

  .page-header h1 {
    font-size: 1.4rem;
  }

  .page-header p {
    font-size: 0.9rem;
  }

  /* Footer */
  .footer {
    padding: 48px 0 24px;
  }

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

  .footer-col h3 {
    font-size: 1rem;
    margin-bottom: 12px;
  }

  .footer-col p,
  .footer-col a {
    font-size: 0.88rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 8px;
    padding-top: 24px;
  }

  .footer-social {
    justify-content: center;
  }

  /* 方案盒子 */
  .solution-box {
    padding: 24px 18px;
  }

  /* 标签 */
  .app-tag {
    padding: 6px 14px;
    font-size: 0.78rem;
  }

  /* 仓库卡片 */
  .warehouse-card {
    padding: 20px 16px;
  }

  /* WhatsApp 按钮 */
  .whatsapp-float {
    width: 48px;
    height: 48px;
    bottom: 16px;
    right: 16px;
    font-size: 22px;
  }
}

/* ============================================
   480px 及以下（小屏手机）
   ============================================ */
@media (max-width: 480px) {
  .container {
    padding: 0 14px;
  }

  .hero {
    padding: 90px 0 48px;
  }

  .hero h1 {
    font-size: 1.3rem;
  }

  .hero p {
    font-size: 0.88rem;
  }

  .stats-bar-grid {
    grid-template-columns: 1fr;
  }

  .stat-item {
    padding: 16px;
  }

  .section {
    padding: 40px 0;
  }

  .section-title h2 {
    font-size: 1.15rem;
  }

  .cta-section {
    padding: 40px 0;
  }

  .cta-section::before {
    width: 200px;
    height: 200px;
  }

  .cta-section h2 {
    font-size: 1.15rem;
  }

  .btn {
    padding: 10px 20px;
    font-size: 0.88rem;
  }

  .contact-form {
    padding: 20px 16px;
  }

  .product-card .card-image {
    height: 160px;
  }

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

  .specs-table {
    font-size: 0.75rem;
  }
}

/* ============================================
   375px 及以下（iPhone SE 等超小屏）
   ============================================ */
@media (max-width: 375px) {
  .hero h1 {
    font-size: 1.15rem;
  }

  .nav-logo img {
    height: 24px;
  }

  .stat-number {
    font-size: 1.3rem !important;
  }
}
