/* ============================================
   惠丰索具 - 首页专属样式
   ============================================ */

/* Hero 轮播 */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  max-height: 860px;
  overflow: hidden;
  margin-top: 72px;
}
.hero-slides { position: relative; width: 100%; height: 100%; }
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}
.hero-slide.active { opacity: 1; }
.hero-slide-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.12) 70%, transparent 100%);
}
.hero-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: white;
  width: 90%;
  max-width: 780px;
  z-index: 5;
}
.hero-content h1 {
  font-size: 52px;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 18px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.hero-content p {
  font-size: 20px;
  opacity: 0.9;
  margin-bottom: 36px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.3);
}
.hero-btns { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* Hero SVG背景占位（无真实图片时） */
.hero-slide-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
  position: relative;
}
.hero-slide-placeholder.slide1 { background: linear-gradient(135deg, #001f4d 0%, #003d7a 50%, #005cbf 100%); }
.hero-slide-placeholder.slide2 { background: linear-gradient(135deg, #002244 0%, #0047a0 50%, #1565c0 100%); }
.hero-slide-placeholder.slide3 { background: linear-gradient(135deg, #001833 0%, #003366 50%, #004d99 100%); }
.hero-slide-placeholder.slide4 { background: linear-gradient(135deg, #002255 0%, #003d7a 50%, #0d47a1 100%); }

/* 轮播指示器 */
.hero-dots {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}
.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
  cursor: pointer;
  transition: all 0.3s;
}
.hero-dot.active {
  background: var(--accent);
  width: 28px;
  border-radius: 5px;
}

/* ---- 核心优势区 ---- */
.advantages {
  padding: 88px 0;
  background: white;
}
.advantages-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  margin-top: 48px;
}
.adv-card {
  text-align: center;
  padding: 40px 28px;
  border-radius: 6px;
  background: white;
  border: 1.5px solid var(--border);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.adv-card::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform var(--transition);
  transform-origin: center;
}
.adv-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: transparent;
}
.adv-card:hover::before { transform: scaleX(1); }
.adv-icon {
  font-size: 44px;
  margin-bottom: 18px;
}
.adv-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}
.adv-card p { font-size: 14px; color: #666; line-height: 1.7; }

/* ---- 产品分类入口区 ---- */
.product-categories {
  padding: 88px 0;
  background: var(--bg-light);
}
.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 48px;
  justify-items: center;
}
.cat-card {
  width: 100%;
  max-width: 260px;
  background: white;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
  display: block;
  color: inherit;
}
.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.cat-card-img {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  overflow: hidden;
  position: relative;
}
.cat-card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.cat-card-body { padding: 14px; }
.cat-card-body h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0;
  line-height: 1.4;
}
.cat-card-en {
  display: block;
  margin-top: 6px;
  padding: 3px 0;
  border-radius: 4px;
  font-size: 13px;
  background: transparent;
  color: var(--primary);
  font-weight: 600;
}

/* ---- 资质与认证 ---- */
.cert-section {
  padding: 88px 0;
  background: var(--bg-light);
}
.cert-desc {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
  color: #666;
  font-size: 15px;
  line-height: 1.8;
}
.cert-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}
.cert-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid var(--border);
}
.cert-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: transparent;
}
.cert-card-img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: #fafafa;
  padding: 20px;
  border-bottom: 1px solid #f0f0f0;
}
.cert-card-body {
  padding: 20px;
  text-align: center;
}
.cert-card-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}
.cert-card-info {
  font-size: 13px;
  color: #888;
  line-height: 1.7;
}

/* ---- 证书图片 Lightbox ---- */
.cert-card-img { cursor: zoom-in; }
.cert-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.cert-lightbox.active { display: flex; }
.cert-lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
}
.cert-lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  font-size: 36px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 2;
  line-height: 1;
  transition: background 0.2s;
}
.cert-lightbox-close:hover { background: rgba(255,255,255,0.3); }
.cert-lightbox-img {
  max-width: 88vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  position: relative;
  z-index: 1;
}
.cert-lightbox-caption {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 16px;
  background: rgba(0,0,0,0.6);
  padding: 8px 24px;
  border-radius: 20px;
  z-index: 1;
}

/* ---- 响应式 ---- */
@media (max-width: 1023px) {
  .advantages-grid { grid-template-columns: repeat(2, 1fr); }
  .categories-grid { grid-template-columns: repeat(3, 1fr); }
  .cert-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  .hero-content h1 { font-size: 32px; }
  .hero-content p { font-size: 16px; margin-bottom: 24px; }
  .advantages-grid { grid-template-columns: 1fr; gap: 16px; }
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-card { max-width: none; }
  .cert-grid { grid-template-columns: repeat(2, 1fr); }
  .advantages, .product-categories, .cert-section { padding: 56px 0; }
}
