/* 移动端响应式样式表 - Overlay Menu & Responsive Layout */

/* 基础重置与相对单位 */
html, body { font-size: 100%; } /* 16px default */
.container { padding-left: 5vw; padding-right: 5vw; width: 100%; max-width: 100%; }

body.no-scroll { overflow: hidden; }

/* 头部导航 - Overlay Menu */
.header-wrap { 
  height: auto; 
  padding: 10px 0; 
  position: relative;
  z-index: 1000;
}

.nav-toggle { 
  display: block; 
  width: 48px; 
  height: 48px; 
  padding: 0; 
  font-size: 24px;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
}
.nav-toggle::after {
  content: '☰';
  font-size: 28px;
  line-height: 1;
  transition: all 0.3s ease;
}
.nav-toggle.active::after {
  content: '×';
  font-size: 36px;
  transform: rotate(90deg);
}

/* 菜单遮罩 */
.nav-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 998;
}
.nav-backdrop.open{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* 覆盖式菜单核心样式 */
.site-nav {
  position: fixed;
  top: 0;
  right: 0;
  left: auto;
  width: 60vw;
  min-width: 300px;
  max-width: 420px;
  height: 100vh;
  background: #fff;
  z-index: 999;
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 70px 0 20px;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  visibility: hidden; /* 防止未开启时遮挡 */
}

.site-nav.open {
  transform: translateX(0);
  visibility: visible;
}

.site-nav ul {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  width: 100%;
}

.site-nav li {
  width: 100%;
  text-align: left;
  opacity: 0;
  transform: translateX(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  border-bottom: 1px solid #e6e6e6;
}
.site-nav li:last-child{ border-bottom: none; }

/* 菜单项动画延迟 */
.site-nav.open li:nth-child(1) { transition-delay: 0.1s; opacity: 1; transform: translateX(0); }
.site-nav.open li:nth-child(2) { transition-delay: 0.2s; opacity: 1; transform: translateX(0); }
.site-nav.open li:nth-child(3) { transition-delay: 0.3s; opacity: 1; transform: translateX(0); }
.site-nav.open li:nth-child(4) { transition-delay: 0.4s; opacity: 1; transform: translateX(0); }
.site-nav.open li:nth-child(5) { transition-delay: 0.5s; opacity: 1; transform: translateX(0); }
.site-nav.open li:nth-child(6) { transition-delay: 0.6s; opacity: 1; transform: translateX(0); }

.site-nav a {
  font-size: 18px;
  font-weight: 400;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #333;
  font-family: "Microsoft YaHei", "SimHei", sans-serif;
}
.site-nav > ul > li > a::after{
  content: '›';
  font-size: 24px;
  line-height: 1;
  color: #999;
  transform: none;
  margin-top: 0;
}

@media (hover: none) {
  .site-nav .has-sub:hover:not(.open) > a::after{
    transform: none;
    margin-top: 0;
  }
}

.site-nav li button.search-btn{
  width: 100%;
  border: none;
  background: none;
  font-size: 18px;
  font-weight: 400;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #333;
  font-family: "Microsoft YaHei", "SimHei", sans-serif;
}
.site-nav li button.search-btn::after{
  content: '›';
  font-size: 24px;
  line-height: 1;
  color: #999;
}

.site-nav .sub {
  position: static;
  box-shadow: none;
  border: none;
  background: #fff;
  border-top: 1px solid #e6e6e6;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  opacity: 1;
  visibility: visible;
  transform: none;
  width: 100%;
}
.site-nav .sub li{ border-bottom: 1px solid #f0f0f0; }
.site-nav .sub li:last-child{ border-bottom: none; }
.site-nav .sub a{
  font-size: 16px;
  padding: 14px 20px 14px 34px;
}
.site-nav .sub a::after{ content: ''; }

.site-nav .has-sub.open .sub {
  max-height: 500px; /* 近似值 */
}

/* 关闭按钮 */
.nav-close {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 32px;
  color: #333;
  background: none;
  border: none;
  padding: 10px;
  cursor: pointer;
  display: block;
}

/* Logo 适配 */
.logo-img { max-height: 80px; }
.logo-text strong { font-size: 20px; }

/* 内容区域适配 */
.hero { height: 30vh; min-height: 200px; }
.hero-carousel { height: 40vh; min-height: 280px; }

/* 栅格系统 */
.grid { grid-template-columns: 1fr; gap: 20px; }

/* 手机端适配 (您的原始样式增强版) */ 
@media (max-width: 768px) { 
  .home-products-grid { 
    grid-template-columns: repeat(2, 1fr); /* 手机端2列 */ 
    gap: 12px; /* 稍大的间隙便于触摸 */ 
    padding: 12px 0; 
    margin: 0 4px; /* 防止边缘贴边 */ 
  } 
  .home-products-grid .product-card {
    padding: 0 15px;
  }
}

.side-layout { grid-template-columns: 1fr; }
.news-item { grid-template-columns: 130px 1fr; gap: 10px; height: auto; }
.news-item img { height: 100%; min-height: 100px; aspect-ratio: 4/3; }
.news-item .meta { padding: 10px; }
.news-item .meta h3 { font-size: 16px; margin: 0 0 5px; line-height: 1.4; max-height: 44px; overflow: hidden; }
.news-item .meta p { margin: 4px 0; font-size: 12px; line-height: 1.5; }
.contact-card { grid-template-columns: 1fr; max-width: 100%; border-radius: 0; }
.contact-info { padding: 30px 20px; }

/* 底部 */
.footer-grid { grid-template-columns: 1fr; text-align: center; }
.footer-nav { text-align: center; justify-content: center; flex-wrap: wrap; }
.footer-icp { flex-direction: column; gap: 10px; }

/* 首页新闻列表优化 (< 991px) */
.news-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.news-grid .news-card {
  width: 350px;
  max-width: 100%;
}
.news-grid .news-card .thumb {
  height: 220px;
  aspect-ratio: auto;
}

/* 小屏幕优化 (< 375px) */
@media (max-width: 375px) {
  .hero { height: 180px; }
  .site-nav a { font-size: 18px; padding: 12px; }
  .logo-img { max-height: 32px; }
}

@media (min-width: 768px) and (max-width: 991px) {
  .home-products-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    padding: 0;
    margin: 0;
  }
  .home-products-grid .product-card {
    padding: 0;
  }
}
