.products-main {
    position: relative;
    width: 100%;
    height: auto;
    margin: calc(var(--nav-height)) auto 0;
    transition: margin-top 0.3s ease;
}

.category-nav {
    margin: 30px 0 10px 0;
}

.category-nav-inner {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
}

@media (max-width: 768px) {
    .category-item {
        padding: 8px 12px;
        font-size: 14px;
        color: white;
        background: transparent;
        transform: none;
        box-shadow: none;
        text-align: left;
    }
}

.category-item {
    background: #0077be;
    color: white;
    padding: 4px 13px;
    border-radius: 25px;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.category-item span {
    display: block;
    transform: skew(20deg);
}

.category-item.active {
    background: #0267a1;
    border-radius: 25px;     
}

.category-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 25px;
}

@media (max-width: 768px) {
    .category-nav {
        position: relative;
        z-index: 1;
        margin: 0;
        padding: 0;
        background: #005a8c;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    
    .category-nav-inner {
        display: grid;
        /* grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); */
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 3px;
        padding: 8px 0;
        justify-items: start;
    }

    .category-item {
        padding: 4px 16px;
        color: white !important;
        background: transparent !important;
        transform: none !important;
        box-shadow: none !important;
        text-align: left;
        white-space: normal !important;
        word-break: break-word !important;
    }
}

.products-main {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 130px); /* 假设导航70px + 页脚60px */
}

/* 添加移动端导航文本样式 */
.products-grid {
  display: none;
}

/* 默认的 :root 变量 */
@media (min-width: 769px) {
  :root {
    --nav-height: 70px;
    --section-title-height: 122px;
    --nav-scroll-height: 103px;
    --footer-height: 60px;
  }
}

.products-grid.active {
  opacity: 1;
  transform: translateY(0);
  position: relative;
  width: 100%;
  max-width: 1500px;
  margin: auto;
  min-height: calc(100vh - var(--nav-height) - var(--section-title-height) - var(--nav-scroll-height) - var(--footer-height));
  height: auto !important;
  max-height: none !important;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 230px));
  /* grid-template-columns: repeat(6, minmax(230px, 230px)); */
  /* 替换原有的固定6列 */
  /* grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); */
  justify-content: center;
  align-content: center;
  align-items: start;
  gap: 15px;
  overflow-y: auto;
  padding-top: 40px;
  padding-bottom: 40px;
}

@media (max-width: 767px) {
  :root {
    --nav-height: 70px;
    --nav-scroll-height: 242px;
    --footer-height: 60px;
  }
}

@media (max-width: 768px) {
  .products-grid.active {
    grid-template-columns: repeat(auto-fit, minmax(180px, 180px));
    gap: 5px;
    min-height: calc(100dvh - var(--nav-height) - var(--nav-scroll-height) - var(--footer-height));
    margin: 0 auto;    
  }
}

.product-card {
  margin: 0.5rem;
  padding: 8px;
  background: #fff;
  border-radius: 12px;
  overflow: visible;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  cursor: pointer;
  z-index: 0;
}
 
.product-card::before {
  content: '';
  position: absolute;
  border-radius: 12px;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(0,87,184,0.1), rgba(0,135,207,0.15));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.15);
  z-index: 1;
  will-change: transform;
}

.product-card:hover::before {
  opacity: 1;
}

.product-image {
  position: relative;
  background: #f8f9fa;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.3s ease;
}

.product-info {
  padding: 0.8rem 0;
  background: #ffffff;
}

.product-model {
  font-size: 0.9rem;
  color: #1a2a3a;
  font-weight: 600;
  text-align: center;
  margin: 0 auto;
}

@media (max-width: 768px) {
   .product-model {
    font-size: 0.9rem; 
   }
}


/* 新增悬浮展示容器 */
.hover-preview {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  transition: opacity 0.3s;
  min-height: 300px;
  flex-direction: column;
  box-sizing: border-box;
  overflow: visible;
  opacity: 0;
  align-items: center;
  border-radius: 8px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  padding-bottom: 50px;
  display: flex;
}

@media (max-width: 768px) {
  .hover-preview {
    width: 90vw !important;
    height: auto !important;
    transform: translate(-50%, -50%);
    left: 50% !important;
    margin-left: auto;
    margin-right: auto;
    top: 50% !important;
    padding-bottom: 0 !important;
    flex-direction: column;
    align-items: stretch;
  }
  .hover-preview img {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain;
    flex-grow: 1;
    height: auto;
  }
  .hover-preview span {
    position: static;
    height: auto;
    padding: 10px 0;
    flex-shrink: 0;
    font-size: 1.4rem !important;
  }
}

.hover-preview img {
  width: 100%;
  height: calc(100% - 50px);
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.15));
  position: relative;
  z-index: 1;
}

.hover-preview span {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'SimHei', sans-serif;
  font-weight: 900;
  font-size: 1.8rem;
  color: #056acf;
  background: rgb(255, 255, 255);
  text-shadow: 0 2px 4px rgba(253, 253, 253, 0.5);
  z-index: 2;  
}

.hover-preview img {
  width: 100%;
  height: auto;
  object-fit: cover;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.15));
}



@media (max-width: 768px) {
    .slogan-text {
        font-size: 3.5vw;
        max-width: 90vw;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nav-scroll-container {
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        font-size: 14px;
        letter-spacing: 1px;
    }
    
    .section-title {
        display: none;
    }

    .product-card::before {
        transform: translateZ(0);
        background: linear-gradient(45deg, rgba(0,87,184,0.15), rgba(0,135,207,0.2));
        transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .hover-preview img {
        flex-grow: 1;
        height: auto !important;
        min-height: unset;
        margin-bottom: -1px;
    }
    
    .hover-preview span {
        position: static;
        height: auto;
        padding: 10px 0;
        flex-shrink: 0;
        order: 2;
    }
}


@media (max-width: 768px) {
    .nav-scroll-container {
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
      font-size: 14px;
      letter-spacing: 1px;
    }
}

@media (max-width: 768px) {
    .section-title {
      display: none;
    }
}



@media (max-width: 768px) {
    .product-card::before {
        transform: translateZ(0);
        background: linear-gradient(45deg, rgba(0,87,184,0.15), rgba(0,135,207,0.2));
        transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
}



@media (min-width: 769px) {
  .hover-preview {
    max-width: 90%;
    min-width: 1100px;
    width: auto;
    height: auto;
    
  }
  .hover-preview img {
    width: auto;
    max-width: 90%;
    min-width: 1100px;
    height: auto;
  }
  .hover-preview span {
    height: auto;
    padding: 15px 0;
    margin-top: 20px;
  }
}


@media (max-width: 768px) {
    .nav-scroll-container {
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
      font-size: 14px;
      letter-spacing: 1px;
    }
}

@media (max-width: 768px) {
    .section-title {
      display: none;
    }
}


