@charset "utf-8";
/* =========================================================
   响应式：基础(>992) → 平板(≤992) → 手机(≤768) → 小屏(≤560)
   ========================================================= */

/* 默认隐藏手机端关闭按钮 */
.nav-close { display: none; }

/* ============ 平板：≤992 ============ */
@media (max-width: 992px) {
  .header-in { height: 66px; }
  .nav a { line-height: 66px; font-size: 15px; padding: 0 10px; }
  .nav a::after { left: 10px; right: 10px; bottom: 14px; }
  .sub-toggle::after { right: 18px; }
  .submenu { top: 66px; }

  .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .about-imgs .big { width: 100%; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 24px 0; }
  .stat b { font-size: 34px; }
  .adv-grid { grid-template-columns: 1fr; gap: 20px; }
  .adv-img img { height: 240px; aspect-ratio: 1.6 / 1; height: auto; } /* 平板端也保持比例 */
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: 1fr; }
  .honor-grid { grid-template-columns: repeat(2, 1fr); }
  /* 新增：平板两列时，保持接近电脑端的宽高比 */
  .honor-item img {
    height: auto;
    aspect-ratio: 3 / 2;
  }
  
  .culture-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; gap: 30px; }
  .section { padding: 56px 0; }
}

/* ============ 手机：≤768 ============ */
@media (max-width: 768px) {
  .topbar-in { font-size: 12px; }
  .topbar-contact { white-space: nowrap; }

  .header-in { height: 58px; }
  .logo img { height: 40px; }

  /* 汉堡按钮 */
  .nav-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 40px; height: 40px; padding: 0; border: 0; background: none; cursor: pointer;
    order: 2;
  }
  .nav-toggle span {
    display: block; width: 24px; height: 2px; margin: 0 auto; background: #17335a;
    border-radius: 2px; transition: .3s;
  }
  .nav-toggle.open span:nth-child(1) { transform: rotate(45deg) translateY(7px); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: rotate(-45deg) translateY(-7px); }

  /* 侧边导航抽屉 */
  .nav {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 200;
    width: 82%; max-width: 320px; display: block; padding: 62px 0 30px;
    background: #fff; box-shadow: -8px 0 24px rgba(14, 32, 56, .18);
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    transform: translateX(100%); transition: transform .32s ease;
  }
  .nav.open { transform: translateX(0); }
  body.nav-lock { overflow: hidden; }

    /* === 右上角关闭按钮 === */
  .nav-close {
    display: flex !important; /* 覆盖 style.css 中的隐藏 */
    align-items: center; justify-content: center;
    position: absolute; top: 10px; right: 10px;
    width: 44px; height: 44px;
    background: none; border: none;
    font-size: 32px; color: #22344f; line-height: 1;
    cursor: pointer; z-index: 201;
  }
  .nav-close:hover { color: #e87a20; }

  /* 导航主链接 */
  .nav > a, .nav > .has-sub > .sub-toggle {
    display: block; padding: 0 22px; line-height: 50px; font-size: 16px;
    color: #22344f; border-bottom: 1px solid #eef2f7;
  }
  .nav a::after, .sub-toggle::after { display: none !important; }
  .nav > a:hover, .nav > a.active, .nav > .has-sub > .sub-toggle:hover { background: #f5f8fc; color: #1c60b8; }
  .nav > a.active { border-left: 3px solid #e87a20; padding-left: 19px; }

  .caret { float: right; margin-top: 22px; }
  .has-sub.open .caret { border-top-color: #e87a20; }

  /* === 修复：彻底重置并改用 display 控制子菜单 === */
  .nav .has-sub .submenu {
    position: static !important; 
    transform: none !important; 
    top: auto !important; left: auto !important; z-index: auto !important;
    width: 100% !important; min-width: 0 !important; box-sizing: border-box !important; 
    padding: 0 !important; margin: 0 !important;
    background: #f7f9fc !important; box-shadow: none !important; border-top: 0 !important;
    opacity: 1 !important; visibility: visible !important;
    display: none !important; /* 默认不占位隐藏 */
  }
  .nav .has-sub.open .submenu { 
    display: block !important; /* 点击展开时直接显示 */
  }
  
  .nav .has-sub .submenu::before { display: none !important; }
  
  .nav .has-sub .submenu-inner {
    background: #f7f9fc !important;
    display: block !important;
  }
  
  .nav .has-sub .submenu a {
    display: block !important; 
    width: 100% !important; box-sizing: border-box !important;
    padding: 12px 24px 12px 38px !important; /* 用 padding 撑开，比 line-height 稳 */
    font-size: 15px !important; line-height: 1.5 !important; height: auto !important;
    color: #22344f !important; background: #f7f9fc !important;
    border-top: 1px solid #e6ecf4 !important; border-left: 3px solid transparent !important;
  }
  
  .nav .has-sub .submenu a:hover, .nav .has-sub .submenu a.active {
    color: #e87a20 !important; background: #eef3fa !important; border-left-color: #e87a20 !important;
  }

  /* 首屏轮播 */
  .banner { height: 380px; }
  .slide-txt h2 { font-size: 26px; letter-spacing: 2px; }
  .slide-txt p { font-size: 14px; }
  .arrow { width: 36px; height: 36px; font-size: 20px; }
  .prev { left: 2%; } .next { right: 2%; }

  /* 关于我们 / 实力产品 */
  .about-imgs .small { width: 42%; }
  /* 修正：维持接近电脑版的宽高比（约 1.6 : 1） */
  .adv-img img { 
    width: 100%;
    height: auto; 
    aspect-ratio: 1.6 / 1; 
    object-fit: cover; 
  }

  /* 推荐产品 */
  .product-grid { grid-template-columns: 1fr; }
  /* 修正：维持接近电脑版的宽高比（约 1.35 : 1） */
  .card .pic img { 
    width: 100%;
    height: auto; 
    aspect-ratio: 1.35 / 1; 
    object-fit: cover; 
  }
  .product-tabs { gap: 8px; }
  .product-tabs button { padding: 6px 16px; font-size: 14px; }

  /* 横向时间轴 */
  .tl-track { overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 6px; }
  .tl-year { flex: 0 0 40%; font-size: 15px; padding: 14px 2px 12px; scroll-snap-align: center; }
  .tl-content { padding: 20px 16px; }
  .tl-content h4 { font-size: 17px; }
  .tl-content p { font-size: 14px; }
  
  /* 荣誉资质图片比例 */
  .honor-item img {
    height: auto;
    aspect-ratio: 3 / 2;
  }

  /* 新闻 */
  .news-item { flex-direction: column; }
  .news-date { flex: none; padding: 10px 0; }
  .news-date b { font-size: 22px; }
  /* 修正：手机端新闻图片改为 16:9 比例，防止被压得很扁 */
  .news-item img { 
    width: 100%; 
    height: auto; 
    aspect-ratio: 16 / 9; 
    object-fit: cover; 
  }
}

/* ============ 小屏：≤560 ============ */
@media (max-width: 560px) {
  .topbar { font-size: 12px; }
  .topbar-contact { display: none; }
  .banner { height: 320px; }
  .sec-head h3 { font-size: 24px; }
  .stats { grid-template-columns: 1fr; }
  .honor-grid, .culture-grid { grid-template-columns: 1fr; }
  /* 新增：单列时防止图片过高 */
  .honor-item img {
    height: auto;
    aspect-ratio: 3 / 2;
  }
  .product-grid { grid-template-columns: 1fr; }
  .section { padding: 44px 0; }
}