/* ====================================
   响应式样式 - 移动端 (max-width: 768px)
   ==================================== */

@media (max-width: 768px) {
  :root {
    --container-padding: 16px;
    --section-py: 56px;
  }

  body { font-size: 14px; }

  /* Header */
  .nav, .header-cta .btn { display: none; }
  .mobile-menu-btn { display: flex; }
  .header-cta { gap: 0; }
  .header-inner { height: 56px; }
  .logo { font-size: 16px; }
  .logo-icon { height: 30px; width: auto; }

  /* 移动端展开菜单（统一由 .open 类驱动，覆盖 main.css 的 36px 纵向间距）*/
  .nav.open {
    display: flex !important;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 56px; left: 0; right: 0;
    background: #fff;
    padding: 8px 0;
    box-shadow: 0 8px 24px rgba(31, 58, 82, 0.12);
    z-index: 90;
  }
  .nav.open a,
  .nav.open .nav-item > a {
    padding: 13px 20px;
    font-size: 15px;
    color: var(--color-text) !important;
    border-bottom: 1px solid rgba(31, 58, 82, 0.05);
  }
  .nav.open .nav-item:last-child > a,
  .nav.open a:last-child { border-bottom: none; }

  /* 搜索框移动端：折叠为图标 */
  .header-search { display: none; }
  .header-search.mobile-active {
    display: flex;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: #fff;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(31,58,82,0.1);
  }
  .header-search.mobile-active input { width: 100%; }

  /* Hero */
  .hero { padding: 100px 0 60px; }
  .hero h1 { font-size: 30px; line-height: 1.3; }
  .hero p { font-size: 14px; margin-bottom: 32px; }
  .hero-ctas .btn { padding: 10px 20px; font-size: 13px; }
  .hero-stats { gap: 24px; margin-top: 48px; flex-wrap: wrap; }
  .hero-stat-num { font-size: 26px; }
  .hero-stat-label { font-size: 12px; }

  /* Sections */
  .section-header { margin-bottom: 36px; }
  .section-header h2 { font-size: 24px; }
  .section-header p { font-size: 13px; }

  /* Services */
  .services-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .service-card { padding: 20px 12px; }
  .service-icon { width: 48px; height: 48px; font-size: 22px; margin-bottom: 12px; }
  .service-card h3 { font-size: 14px; }
  .service-card p { font-size: 12px; }

  /* Why grid */
  .why-grid { grid-template-columns: 1fr; gap: 12px; }
  .why-card { padding: 20px 16px; }
  .why-card.featured { grid-column: span 1; }
  .why-card h3 { font-size: 15px; }
  .why-card p { font-size: 12px; }

  /* Founder */
  .founder-grid { grid-template-columns: 1fr; gap: 32px; }
  .founder-img { max-width: 240px; margin: 0 auto; }
  .founder-info h2 { font-size: 24px; }
  .founder-info p { font-size: 13px; }

  /* Platform */
  .platform-grid { grid-template-columns: 1fr; gap: 16px; }
  .platform-card { padding: 28px 20px; }
  .platform-card h3 { font-size: 18px; }

  /* Cases */
  .cases-stats { grid-template-columns: 1fr; gap: 12px; margin-bottom: 32px; }
  .case-stat-card { padding: 20px 16px; }
  .case-stat-num { font-size: 32px; }
  .case-tags { gap: 8px; }
  .case-tag { padding: 6px 14px; font-size: 12px; }

  /* Blog */
  .blog-grid { grid-template-columns: 1fr; gap: 16px; }
  .blog-card-body { padding: 16px 18px 20px; }
  .blog-card h3 { font-size: 15px; }
  .blog-card p { font-size: 12px; }

  /* WeChat */
  .wechat-section { padding: 56px 0; }
  .wechat-grid { grid-template-columns: 1fr; gap: 32px; }
  .wechat-card { padding: 28px 20px; }
  .wechat-qr { width: 140px; height: 140px; padding: 8px; }
  .wechat-flow-steps { flex-direction: column; gap: 8px; }
  .wechat-step-arrow { transform: rotate(90deg); }
  .wechat-stats { padding: 16px; gap: 12px; }
  .wechat-stat-num { font-size: 18px; }
  .wechat-stat-label { font-size: 11px; }

  /* CTA */
  .cta-section { padding: 56px 0; }
  .cta-section h2 { font-size: 22px; }
  .cta-section p { font-size: 13px; }

  /* Footer */
  .footer { padding: 40px 0 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; margin-bottom: 28px; }
  .footer-brand { grid-column: span 2; }
  .footer-brand h3 { font-size: 18px; }
  .footer-col h4 { font-size: 13px; margin-bottom: 12px; }
  .footer-col a { font-size: 12px; }
  .footer-bottom { font-size: 11px; padding-top: 20px; }

  /* Modal */
  .modal-card { padding: 32px 24px; max-width: 320px; }
  .modal-card h3 { font-size: 20px; }
  .modal-qr-wrap img, .modal-qr-wrap svg { width: 180px; height: 180px; }

  /* ============================================================
     内页（除首页外）通用移动端适配
     内页 grid/hero 大量用内联 style，这里用 !important 压住
     ============================================================ */

  /* 内页 hero（必须排除首页 .hero--v2，否则 !important 会覆盖 v3 banner 的 44px/88px 移动端样式） */
  .hero:not(.hero--v2) { padding: 80px 0 36px !important; }
  .hero:not(.hero--v2) h1 { font-size: 28px !important; line-height: 1.35; }
  .hero:not(.hero--v2) .hero-inner p { font-size: 14px !important; word-wrap: break-word; overflow-wrap: break-word; max-width: 100%; }

  /* === 关于我们 about.html === */
  .founder-grid { grid-template-columns: 1fr !important; gap: 28px !important; }
  .founder-img { max-width: 300px; margin: 0 auto; }
  .founder-info h2 { font-size: 22px; }
  .founder-info p { font-size: 13px; word-wrap: break-word; overflow-wrap: break-word; }
  .hero-stats { gap: 20px !important; flex-wrap: wrap; justify-content: flex-start !important; }
  .hero-stats > div { flex: 1 1 30%; min-width: 80px; }
  .hero-stat-num { font-size: 22px; }
  .hero-stat-label { font-size: 11px; }
  /* about 里的 services-grid（使命愿景3列 + 时间线4列）→ 2 列 */
  .section-light .services-grid,
  .section-white .services-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 14px !important;
  }
  .service-card { padding: 20px 14px; }
  .service-icon { width: 44px; height: 44px; font-size: 20px; margin-bottom: 10px; }
  .service-card h3 { font-size: 14px; }
  .service-card p { font-size: 12px; }

  /* === 服务介绍 services.html === */
  /* services 的 services-grid 在 .section-white 里，用相同特异性（.section-white .services-grid）
     但写在后面，1fr 覆盖上面 about 段落的 1fr 1fr；about 的 .section-light 不命中，保持 2 列 */
  .section-white .services-grid { grid-template-columns: 1fr !important; gap: 16px !important; }
  .service-detail-card { padding: 22px 16px; }
  .service-detail-card .icon { font-size: 28px; margin-bottom: 12px; }
  .service-detail-card h3 { font-size: 16px; margin-bottom: 10px; }
  .service-detail-card p { font-size: 13px; }

  /* process-flow 5 步：横向 → 3 列换行，避免溢出 */
  .process-flow { flex-wrap: wrap; gap: 16px 12px; justify-content: flex-start; }
  .process-step { flex: 0 0 calc(33.333% - 8px); min-width: 90px; padding: 12px 6px; text-align: center; }
  .process-num { width: 36px; height: 36px; font-size: 16px; margin: 0 auto 8px; }
  .process-arrow { display: none; }
  .process-step h4 { font-size: 13px; margin-bottom: 4px; }
  .process-step p { font-size: 11px; line-height: 1.5; }

  /* === 专业团队 team.html === */
  /* team 用 .blog-grid（responsive 已有 1fr），此处补卡片内部 */
  .team-card { padding: 0; overflow: hidden; }
  .team-avatar { height: 240px; }
  .team-info { padding: 16px; }
  .team-info h3 { font-size: 16px; margin-bottom: 4px; }
  .team-info .title,
  .team-info .role { font-size: 12px; margin-bottom: 8px !important; }
  .team-info p { font-size: 12px; line-height: 1.6; }
  .team-tags { gap: 6px; margin-top: 10px !important; }
  .team-tag { padding: 4px 10px; font-size: 11px; }
  /* team 的创始人区（内联 1fr 1.3fr） */
  #founderArea.founder-grid { grid-template-columns: 1fr !important; gap: 24px !important; }
  #founderArea.founder-img { max-width: 280px; }

  /* team 核心咨询师网格：JS 注入内联 repeat(4,1fr)，必须用 !important 压住，否则手机 4 列挤扁 */
  #teamGrid.blog-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 14px !important; }
  /* 咨询师卡片简介限 3 行，避免 60 字 bio 把卡片撑得过高 */
  .team-info p:not(.title) {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* === 成功案例 cases.html === */
  .case-card { margin-bottom: 16px; }
  .case-img { height: 180px; }
  .case-body { padding: 16px; }
  .case-body h3 { font-size: 16px; margin-bottom: 8px; }
  .case-body p { font-size: 13px; line-height: 1.6; word-wrap: break-word; overflow-wrap: break-word; }
  .case-cat { font-size: 11px; padding: 3px 10px; }
  .testimonial { padding: 20px 16px; margin-bottom: 14px; }
  .testimonial p { font-size: 14px; line-height: 1.7; }
  .testimonial-author { font-size: 12px; margin-top: 12px; }

  /* === 实时资讯 blog.html === */
  .filter-bar { display: flex !important; flex-wrap: wrap !important; overflow-x: visible !important; gap: 8px; padding: 12px; }
  .filter-btn { padding: 6px 12px; font-size: 12px; flex: 0 0 auto; }
  .search-box { flex: 0 0 100% !important; width: 100% !important; max-width: 100% !important; padding: 8px 12px; font-size: 13px; box-sizing: border-box; }
  .blog-card { overflow: hidden; max-width: 100%; }
  .blog-card-cover { max-width: 100%; }
  .pagination { gap: 4px; flex-wrap: wrap; justify-content: center; margin-top: 20px; }
  .pagination button { padding: 6px 10px; font-size: 12px; min-width: 32px; }

  /* === 联系我们 contact.html === */
  .contact-grid { grid-template-columns: 1fr; gap: 14px; }
  .contact-card { padding: 22px 16px; text-align: center; }
  .contact-icon { font-size: 28px; margin-bottom: 10px; }
  .contact-card h3 { font-size: 15px; margin-bottom: 8px; }
  .contact-card p { font-size: 13px; }
  .form-grid { grid-template-columns: 1fr; gap: 20px; }
  .form-card { padding: 22px 16px; }
  .form-group { margin-bottom: 14px; }
  .form-group label { font-size: 13px; margin-bottom: 6px; display: block; }
  .form-group input,
  .form-group textarea,
  .form-group select { padding: 10px 12px; font-size: 14px; width: 100%; box-sizing: border-box; }
  .form-card button { padding: 12px; font-size: 14px; width: 100%; }
  .map-card { min-height: 220px; }
  .map-placeholder { font-size: 13px; padding: 16px; }

  /* ===== 内页安全网：禁止水平溢出 + 强制中文长句换行 ===== */
  body:not(.home-landing) { overflow-x: hidden; }
  .hero-inner { max-width: 100%; }
  .hero-inner p, .founder-info p, .case-body p, .case-body li,
  .service-detail-card p, .service-detail-card li,
  .contact-card p, .filter-bar, .blog-card, .blog-card-cover,
  .wechat-section, .wechat-grid, .wechat-card {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .blog-grid { overflow: hidden; }
  .blog-card-cover { background-size: cover; background-position: center; }
}

@media (max-width: 380px) {
  .hero h1 { font-size: 26px; }
  .hero-stats { gap: 16px; }
  .services-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand { grid-column: span 1; }

  /* 内页小屏加固 */
  .hero h1 { font-size: 24px !important; }
  .section-light .services-grid,
  .section-white .services-grid { grid-template-columns: 1fr !important; }
  .process-step { flex: 0 0 calc(50% - 6px); }
  .team-avatar { height: 200px; }
  .case-img { height: 160px; }
  .contact-card { padding: 18px 14px; }
}
