/* ============================================
   嘉品仪器 s.jp17.com - 移动端专属样式表 v1.0
   断点：≤768px（覆盖手机与小平板）
   原则：PC 样式不动，移动端覆盖/重置
   ============================================ */

@media (max-width: 768px) {
  :root {
    --header-h: 56px;
    --m-space: 16px;
    --m-radius: 10px;
    --m-card-pad: 14px;
  }

  html { font-size: 15px; }
  body { font-size: 15px; line-height: 1.6; }
  .container { padding: 0 14px; }
  .section { padding: 28px 0; }
  .page-header { padding: 24px 0; }
  .page-header h1 { font-size: 22px; }
  .page-header p { font-size: 13px; padding: 0 10px; }

  /* ===== 顶部条 ===== */
  .top-bar { display: none; }
  .top-bar.m-top-bar {
    display: block;
    background: var(--primary-dark);
    color: #fff;
    font-size: 12px;
    padding: 6px 0;
  }
  .top-bar.m-top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  /* ===== Header ===== */
  .site-header { position: sticky; top: 0; z-index: 1000; }
  .header-main {
    height: var(--header-h);
    gap: 8px;
    padding: 0 14px;
  }
  .logo { gap: 6px; }
  .logo-img { width: auto; height: 30px; }
  .logo strong { font-size: 16px; }
  .logo small { display: none; }

  .header-actions { gap: 6px; }
  .header-actions .btn {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
  }
  .header-actions .btn-outline { display: none; }
  .header-actions .btn-header-search {
    padding: 6px 10px;
    font-size: 12px;
  }

  /* 汉堡按钮 */
  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-light);
    border-radius: 8px;
    font-size: 20px;
    color: var(--primary);
    cursor: pointer;
    margin-left: 4px;
  }

  /* ===== 移动端抽屉菜单 ===== */
  .main-nav {
    position: static;
    flex: 0;
    justify-content: flex-end;
  }
  .nav-list {
    display: none;
    position: fixed;
    top: var(--header-h);
    right: 0;
    left: auto;
    width: min(320px, 85vw);
    height: calc(100vh - var(--header-h));
    background: var(--bg-white);
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0,0,0,.15);
    padding: 8px 0 24px;
    max-height: none;
    overflow-y: auto;
    z-index: 1001;
    transform: translateX(100%);
    transition: transform .25s ease;
  }
  .nav-list.active {
    display: flex;
    transform: translateX(0);
  }
  .nav-list > li { width: 100%; border-bottom: 1px solid var(--border-light); }
  .nav-list > li > a {
    padding: 14px 18px;
    font-size: 15px;
    border-radius: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .nav-list > li > a.active { background: #f0f7ff; color: var(--primary-light); }
  .dropdown-arrow { font-size: 12px; transition: transform .2s; }
  .nav-dropdown.open > a .dropdown-arrow { transform: rotate(180deg); }

  /* 抽屉内 mega menu */
  .nav-dropdown .dropdown-mega {
    position: static;
    display: none;
    transform: none;
    box-shadow: none;
    border: none;
    border-top: 1px solid var(--border-light);
    border-radius: 0;
    padding: 0;
    background: #f8fafc;
    min-width: auto !important;
    width: 100%;
    animation: none;
  }
  .nav-dropdown.open .dropdown-mega { display: block; }
  .dropdown-grid {
    grid-template-columns: 1fr !important;
    gap: 0;
    padding: 8px 0;
  }
  .dropdown-col { padding: 0; }
  .dropdown-col h4 {
    font-size: 13px;
    padding: 10px 18px;
    margin: 0;
    color: var(--text-light);
    background: transparent;
  }
  .dropdown-col a {
    display: block;
    padding: 10px 18px 10px 28px;
    font-size: 14px;
    border-bottom: 1px solid #eef2f7;
  }
  .dropdown-col a:last-child { border-bottom: none; }

  /* 抽屉底部快捷操作 */
  .m-drawer-actions {
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .m-drawer-actions .btn { width: 100%; justify-content: center; }
  .m-drawer-phone {
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
  }
  .m-drawer-phone a { color: var(--primary-light); font-weight: 600; }

  /* 遮罩 */
  .nav-overlay {
    display: none;
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: rgba(0,0,0,.45);
    z-index: 998;
  }
  .nav-overlay.active { display: block; }
  .nav-list.active { z-index: 1002; }

  /* ===== Footer 移动端手风琴 ===== */
  .site-footer { padding: 32px 0 16px; }
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 0;
  }
  .footer-col {
    border-bottom: 1px solid rgba(255,255,255,.1);
    padding: 0;
  }
  .footer-col h3 {
    margin: 0;
    padding: 14px 0;
    font-size: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
  }
  .footer-col h3::after {
    content: '+';
    font-size: 18px;
    font-weight: 400;
    opacity: .7;
  }
  .footer-col.open h3::after { content: '−'; }
  .footer-col ul,
  .footer-col .footer-about-text,
  .footer-col .footer-stats,
  .footer-col .contact-company,
  .footer-col .footer-logo,
  .footer-col .footer-slogan {
    display: none;
    padding-bottom: 14px;
  }
  .footer-col.open ul,
  .footer-col.open .footer-about-text,
  .footer-col.open .footer-stats,
  .footer-col.open .contact-company,
  .footer-col.open .footer-logo,
  .footer-col.open .footer-slogan {
    display: block;
  }
  .footer-col:first-child { border-top: 1px solid rgba(255,255,255,.1); }
  /* 品牌简介默认展开 */
  .footer-col.footer-brand { display: block; }
  .footer-col.footer-brand h3::after { content: '−'; }
  .footer-col.footer-brand ul,
  .footer-col.footer-brand .footer-about-text,
  .footer-col.footer-brand .footer-stats,
  .footer-col.footer-brand .footer-logo,
  .footer-col.footer-brand .footer-slogan { display: block; }

  .footer-logo img { width: 150px; height: auto; margin-bottom: 8px; }
  .footer-slogan { font-size: 13px; margin-bottom: 10px; }
  .footer-about-text { font-size: 13px; line-height: 1.7; margin-bottom: 12px; }
  .footer-stats { display: flex !important; flex-wrap: wrap; gap: 12px; }
  .footer-stat-item { min-width: 68px; }
  .footer-stat-item strong { font-size: 18px; }
  .footer-stat-item small { font-size: 11px; }

  .footer-col li { margin-bottom: 8px; }
  .footer-col li a { font-size: 14px; }
  .footer-contact .contact-company { margin-bottom: 14px; }
  .footer-contact .contact-company p { font-size: 13px; margin: 3px 0; }

  /* 品牌通栏 */
  .footer-brands-bar { padding: 12px 0; }
  .footer-brands-inner {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }
  .footer-brands-label { font-size: 13px; white-space: nowrap; flex-shrink: 0; }
  .footer-brand-link, .footer-brand-text { font-size: 13px; white-space: nowrap; }
  .footer-brand-sep { font-size: 13px; }

  /* 二维码 */
  .footer-qr-row { padding: 16px 0; }
  .footer-qr-main img { max-width: 160px; margin: 0 auto; }

  /* 友情链接 */
  .footer-friend-links { padding: 12px 0; }
  .friend-links-list {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 14px;
  }
  .friend-links-list a { font-size: 12px; }

  /* 版权 */
  .footer-bottom { padding: 14px 0; }
  .footer-bottom-inner { text-align: center; }
  .copyright { font-size: 12px; line-height: 1.7; }
  .footer-tagline { font-size: 11px; margin-top: 6px; }

  /* ===== 通用按钮/表单 ===== */
  .btn { padding: 10px 16px; font-size: 14px; }
  .btn-lg { padding: 12px 20px; font-size: 15px; }
  .btn-sm { padding: 7px 12px; font-size: 13px; }
  input, select, textarea { font-size: 16px; } /* 防止 iOS 缩放 */

  /* ===== Hero 首页 ===== */
  .hero { padding: 32px 0 28px; }
  .hero h1 { font-size: 24px; line-height: 1.35; }
  .hero p { font-size: 14px; }
  .hero-cta { flex-direction: column; gap: 10px; }
  .hero-cta .btn { width: 100%; text-align: center; }
  .hero-stats { flex-wrap: wrap; gap: 14px; justify-content: center; }
  .hero-stats .stat strong { font-size: 22px; }
  .hero-stats .stat span { font-size: 12px; }

  /* 首页各卡片网格 */
  .cards-grid { grid-template-columns: 1fr; gap: 14px; }
  .industry-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .industry-card { padding: 16px 12px; }
  .industry-card h3 { font-size: 14px; }
  .solutions-grid { grid-template-columns: 1fr; gap: 14px; }

  /* 首页产品分类卡片 */
  .hm-prodcat-card { width: calc(50% - 8px); min-width: auto; padding: 18px 10px 14px; }
  .hm-prodcat-icon { font-size: 28px; }
  .hm-prodcat-name { font-size: 14px; }
  .hm-prodcat-count { font-size: 12px; }

  /* 首页流程/品牌/新闻 */
  .hm-process-step { min-width: 120px; max-width: 100%; }
  .hm-brand-logo img { max-height: 36px; }
  .hm-news-grid { grid-template-columns: 1fr; }

  /* ===== 产品列表页 ===== */
  .products-layout { flex-direction: column; gap: 16px; }
  .products-sidebar {
    width: 100%;
    position: static;
    order: -1;
    box-shadow: none;
    border: 1px solid var(--border);
  }
  .products-sidebar.collapsed .products-sidebar-toggle-body { display: none; }
  .products-sidebar-toggle,
  .industry-sidebar-toggle,
  .solutions-filter-toggle,
  .knowledge-filter-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: var(--bg-light);
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
  }
  .products-sidebar-toggle::after,
  .industry-sidebar-toggle::after,
  .solutions-filter-toggle::after,
  .knowledge-filter-toggle::after { content: '▼'; font-size: 12px; }
  .products-sidebar.collapsed .products-sidebar-toggle::after,
  .industry-sidebar.collapsed .industry-sidebar-toggle::after,
  .solutions-sidebar.collapsed .solutions-filter-toggle::after,
  .knowledge-sidebar.collapsed .knowledge-filter-toggle::after { content: '▶'; }
  .cat-tree-title { font-size: 11px; }
  .cat-tree-item { padding: 10px 14px; font-size: 14px; }

  .products-main { width: 100%; }
  .products-header { flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 14px; }
  .products-header h1 { font-size: 20px; }
  .products-count { font-size: 13px; }

  .product-grid,
  .product-grid-main { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .product-card { border-radius: var(--m-radius); }
  .product-card-img { height: 120px; }
  .product-card-body { padding: 10px; }
  .product-card-title { font-size: 13px; line-height: 1.45; height: auto; min-height: 38px; }
  .product-card-meta { font-size: 11px; }
  .product-card-price { font-size: 13px; }
  .product-card-actions { display: none; } /* 移动端卡片不显示按钮，点击卡片进详情 */

  /* ===== 产品详情页 ===== */
  .product-detail-header { grid-template-columns: 1fr; gap: 18px; }
  .product-detail-img { height: 240px; }
  .product-detail-info h1 { font-size: 20px; }
  .product-detail-meta { flex-wrap: wrap; gap: 8px; }
  .product-action-bar { flex-wrap: wrap; gap: 8px; }
  .product-action-bar .btn { flex: 1; min-width: 120px; }
  .product-detail-tabs { overflow-x: auto; }
  .product-detail-tabs a { white-space: nowrap; padding: 10px 14px; font-size: 14px; }
  .specs-table th, .specs-table td { padding: 8px 10px; font-size: 13px; }
  .specs-table { display: block; overflow-x: auto; }

  /* ===== 行业配套页 ===== */
  .industry-layout { flex-direction: column; gap: 16px; }
  .industry-main { width: 100%; order: 2; }
  .industry-sidebar {
    width: 100%;
    position: static;
    order: 1;
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--m-radius);
    background: var(--bg-white);
    overflow: hidden;
  }
  .industry-sidebar.collapsed .industry-sidebar-toggle-body { display: none; }
  .right-nav-tree { padding: 8px 0; }
  .right-nav-group-toggle { padding: 10px 14px; font-size: 14px; }
  .right-nav-subs li a { padding: 8px 14px 8px 26px; font-size: 13px; }

  .stage-sticky-nav { top: var(--header-h); padding: 8px 0; }
  .stage-sticky-nav .container { gap: 6px; }
  .stage-nav-item { padding: 5px 8px; font-size: 12px; }
  .stage-nav-label { display: none; }

  .stage-card { padding: 18px 14px; margin-bottom: 18px; }
  .stage-card h2 { font-size: 17px; margin-bottom: 12px; }
  .stage-card p { font-size: 14px; }

  .report-banner { flex-direction: column; gap: 12px; padding: 16px; }
  .report-banner-btn { width: 100%; text-align: center; }
  .report-fields { grid-template-columns: 1fr; }
  .report-actions { flex-direction: column; }
  .report-actions .btn { width: 100%; }

  .eq-row { flex-direction: column; gap: 10px; align-items: stretch; }
  .eq-opts { flex-wrap: wrap; gap: 6px; }
  .eq-opt { font-size: 12px; padding: 5px 10px; }

  /* 阶段时间轴 */
  .stage-timeline { padding: 18px 14px; overflow-x: auto; }
  .timeline-track { min-width: 600px; }
  .timeline-node { width: 28px; height: 28px; font-size: 12px; }
  .timeline-label strong { font-size: 11px; }
  .timeline-label small { display: none; }

  /* ===== 解决方案页 ===== */
  .solutions-layout { flex-direction: column; gap: 16px; }
  .solutions-sidebar {
    width: 100%;
    position: static;
    order: -1;
    border: 1px solid var(--border);
    border-radius: var(--m-radius);
  }
  .solutions-sidebar.collapsed .solutions-filter-toggle-body { display: none; }
  .solutions-main { width: 100%; }
  .solution-card { flex-direction: column; }
  .solution-card-img { width: 100%; height: 160px; }
  .solution-card-body { padding: 14px; }
  .solution-card-title { font-size: 15px; }
  .solution-card-desc { font-size: 13px; }

  /* ===== 技术干货/文章列表 ===== */
  .knowledge-layout { flex-direction: column; gap: 16px; }
  .knowledge-sidebar {
    width: 100%;
    position: static;
    order: -1;
    border: 1px solid var(--border);
    border-radius: var(--m-radius);
  }
  .knowledge-sidebar.collapsed .knowledge-filter-toggle-body { display: none; }
  .knowledge-main { width: 100%; }
  .knowledge-grid { grid-template-columns: 1fr; gap: 14px; }
  .article-card { flex-direction: column; }
  .article-card-img { width: 100%; height: 160px; }
  .article-card-body { padding: 14px; }
  .article-card-title { font-size: 15px; }
  .article-card-desc { font-size: 13px; }

  /* 文章详情 */
  .article-content { padding: 20px 0; }
  .article-content h1 { font-size: 21px; }
  .article-content h2 { font-size: 18px; }
  .article-content h3 { font-size: 16px; }
  .article-content p { font-size: 15px; }
  .article-content img { border-radius: 6px; }
  .article-content table { display: block; overflow-x: auto; }
  .article-meta { flex-wrap: wrap; gap: 8px; font-size: 12px; }

  /* 详情页互动条 */
  .detail-action-bar,
  .engagement-bar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .detail-action-bar .btn,
  .engagement-bar .btn {
    flex: 1;
    min-width: 100px;
    justify-content: center;
  }

  /* ===== 品牌专区 ===== */
  .brand-stats { gap: 16px; }
  .stat-item strong { font-size: 22px; }
  .letter-filter { gap: 6px; }
  .letter-link { width: 28px; height: 28px; font-size: 12px; }
  .brand-grid { grid-template-columns: 1fr; gap: 10px; }
  .brand-card { padding: 12px; }
  .brand-card-logo { width: 44px; height: 44px; }
  .brand-card-name { font-size: 14px; }

  .brand-detail-top { flex-direction: column; text-align: center; gap: 12px; }
  .brand-detail-info h1 { font-size: 22px; }
  .brand-detail-meta { flex-wrap: wrap; justify-content: center; }
  .brand-detail-grid { grid-template-columns: 1fr; gap: 16px; }
  .ebook-item { padding: 10px 12px; }

  /* ===== 联系我们 ===== */
  .contact-grid { grid-template-columns: 1fr; gap: 16px; }
  .contact-card { padding: 14px; }
  .contact-form { padding: 18px 14px; }
  .contact-form-row { flex-direction: column; gap: 0; }
  .contact-form .btn { width: 100%; }
  .service-promise { padding: 12px 14px; }

  /* ===== 会员中心/登录注册 ===== */
  .auth-layout { flex-direction: column; }
  .auth-left { display: none; }
  .auth-right { padding: 24px 16px; }
  .auth-form-wrap { max-width: 100%; }
  .member-layout { flex-direction: column; }
  .member-sidebar { width: 100%; }
  .member-main { padding: 16px 0; }
  .member-list-item { flex-direction: column; align-items: flex-start; gap: 6px; }

  /* ===== 分享中心 ===== */
  .invite-code-card { flex-direction: column; gap: 16px; padding: 18px; }
  .invite-code-left { flex: auto; }
  .invite-code-value { font-size: 28px; }
  .share-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .share-stat-card { padding: 14px 8px; }
  .share-stat-card .stat-num { font-size: 22px; }

  /* ===== 通用分页 ===== */
  .pagination { flex-wrap: wrap; gap: 6px; justify-content: center; }
  .pagination a, .pagination span { padding: 6px 10px; font-size: 13px; }

  /* ===== 面包屑 ===== */
  .breadcrumb { font-size: 12px; flex-wrap: wrap; }

  /* ===== 搜索页 ===== */
  .search-form { flex-direction: column; gap: 8px; }
  .search-form input, .search-form button { width: 100%; border-radius: 8px; }
  .search-form button { border-left: 1px solid var(--primary); }

  /* ===== 返回顶部 ===== */
  .back-to-top {
    width: 40px !important;
    height: 40px !important;
    bottom: 80px !important;
    right: 14px !important;
    font-size: 18px !important;
  }
}

/* ===== 更小屏 480px ===== */
@media (max-width: 480px) {
  .container { padding: 0 12px; }
  .hero h1 { font-size: 20px; }
  .page-header h1 { font-size: 19px; }
  .product-grid,
  .product-grid-main { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .product-card-img { height: 100px; }
  .product-card-title { font-size: 12px; min-height: 34px; }
  .industry-grid { grid-template-columns: 1fr; }
  .hm-prodcat-card { width: 100%; }
  .stage-nav-item { padding: 4px 6px; font-size: 11px; }
}

/* ===== 微信小程序入口悬浮球 ===== */
.weapp-float-btn {
  position: fixed;
  right: 14px;
  bottom: 132px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #07c160, #05a350);
  color: #fff;
  box-shadow: 0 4px 14px rgba(7,193,96,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  cursor: pointer;
  z-index: 998;
  border: none;
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  transition: transform .2s;
}
.weapp-float-btn:hover { transform: scale(1.05); }
.weapp-float-btn .weapp-icon { font-size: 20px; margin-bottom: 1px; }

.weapp-float-btn.hidden { display: none; }

@media (max-width: 768px) {
  .weapp-float-btn {
    right: 12px;
    bottom: 110px;
    width: 48px;
    height: 48px;
    font-size: 10px;
  }
  .weapp-float-btn .weapp-icon { font-size: 18px; }
}

/* 小程序引导弹窗 */
.weapp-guide-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.weapp-guide-modal.open { display: flex; }
.weapp-guide-content {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 340px;
  text-align: center;
}
.weapp-guide-content h3 { margin: 0 0 8px; font-size: 18px; color: #1a3a5c; }
.weapp-guide-content p { margin: 0 0 18px; font-size: 14px; color: #64748b; line-height: 1.6; }
.weapp-guide-content .weapp-icon-big {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #07c160, #05a350);
  color: #fff;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  margin-bottom: 14px;
}
.weapp-guide-actions { display: flex; flex-direction: column; gap: 10px; }
.weapp-guide-actions .btn { width: 100%; }
.weapp-guide-close {
  margin-top: 12px;
  color: #94a3b8;
  font-size: 13px;
  cursor: pointer;
  background: none;
  border: none;
}
