/* =====================================================
 * 首页专属样式：Hero 轮播 / 核心特色 / 分类陈列 / 商品区
 * 公共样式保留在 style.css，仅做追加
 * ===================================================== */

html { scroll-behavior: smooth; }

/* Hero 轮播 */
.hero {
  position: relative;
  width: 100%;
  background: #0b1426;
  margin-top: 0;
}
.hero-viewport {
  position: relative;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  height: 480px;
  overflow: hidden;
  background: #0b1426;
}
.hero-track {
  position: relative;
  width: 100%;
  height: 100%;
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .8s ease;
  pointer-events: none;
}
.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
}
.hero-img {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.04);
  transition: transform 6s ease;
}
.hero-slide.is-active .hero-img {
  transform: scale(1);
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.25) 50%, rgba(0,0,0,0) 90%);
  display: flex;
  align-items: center;
}
.hero-inner {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 40px;
  color: #fff;
}
.hero-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.25);
  padding: 5px 14px;
  border-radius: 999px;
  margin: 0 0 18px;
}
.hero-title {
  font-size: 44px;
  font-weight: 800;
  margin: 0 0 14px;
  letter-spacing: 1px;
  text-shadow: 0 2px 12px rgba(0,0,0,.4);
}
.hero-sub {
  font-size: 16px;
  margin: 0 0 28px;
  color: rgba(255,255,255,.9);
  max-width: 540px;
  text-shadow: 0 1px 6px rgba(0,0,0,.4);
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn-ghost-light {
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-color: rgba(255,255,255,.4);
  color: #fff;
}
.btn-ghost-light:hover { background: rgba(255,255,255,.28); text-decoration: none; }
.btn-lg { padding: 12px 26px; font-size: 15px; border-radius: 10px; }

/* 轮播左右箭头 */
.hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 28px;
  line-height: 48px;
  text-align: center;
  cursor: pointer;
  z-index: 5;
  transition: background .2s;
  user-select: none;
}
.hero-nav:hover { background: rgba(255,255,255,.4); }
.hero-prev { left: 24px; }
.hero-next { right: 24px; }

/* 轮播指示点 */
.hero-dots {
  position: absolute;
  left: 0; right: 0; bottom: 22px;
  display: flex; justify-content: center; gap: 8px;
  z-index: 5;
}
.hero-dot {
  width: 24px; height: 6px;
  border: 0;
  border-radius: 4px;
  background: rgba(255,255,255,.4);
  cursor: pointer;
  padding: 0;
  transition: background .2s, width .2s;
}
.hero-dot.is-active {
  background: #fff;
  width: 36px;
}

/* 核心特色 */
.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 32px;
  margin-bottom: 16px;
}
.feature {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
  transition: transform .2s, box-shadow .2s;
}
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.feature-icn {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #fff;
}
.feature-icn svg { width: 24px; height: 24px; }
.feature-icn.icn-shield   { background: linear-gradient(135deg, #5b8cff, #2f6df0); }
.feature-icn.icn-factory  { background: linear-gradient(135deg, #36b37e, #1aa260); }
.feature-icn.icn-truck    { background: linear-gradient(135deg, #ff9a3c, #ff7a1a); }
.feature-icn.icn-service  { background: linear-gradient(135deg, #9c6bff, #6c4ce0); }
.feature h4 { margin: 0 0 2px; font-size: 15px; font-weight: 700; }
.feature p  { margin: 0; color: var(--muted); font-size: 12px; }

/* 通用 section head */
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin: 30px 0 18px;
  flex-wrap: wrap; gap: 12px;
}
.section-head h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 4px;
  display: flex; align-items: center; gap: 10px;
}
.section-head h2::before {
  content: '';
  display: inline-block;
  width: 4px; height: 20px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: 4px;
}
.section-head p { margin: 0; font-size: 13px; }
.section-more {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.section-more:hover { color: var(--primary); text-decoration: none; }
/* 区块标题可点击锚点（滚动到商品区 #goods） */
.title-anchor { color: inherit; text-decoration: none; cursor: pointer; transition: color .15s; }
.title-anchor:hover { color: var(--primary); }

/* 分类区 */
.cat-section { padding-top: 8px; }
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.cat-card {
  --cat-color: #5b8cff;
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px 18px 20px;
  text-align: center;
  color: var(--text);
  transition: transform .2s, box-shadow .2s, border-color .2s;
  overflow: hidden;
}
.cat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--cat-color);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .25s;
}
.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(20,30,60,.10);
  border-color: var(--cat-color);
  text-decoration: none;
}
.cat-card:hover::before { transform: scaleX(1); }
.cat-icon {
  width: 64px; height: 64px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--cat-color) 12%, #fff);
  color: var(--cat-color);
  margin-bottom: 12px;
  transition: transform .25s;
}
.cat-card:hover .cat-icon { transform: scale(1.08) rotate(-4deg); }
.cat-icon svg { width: 32px; height: 32px; }
.cat-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}
.cat-count {
  font-size: 12px;
  color: var(--muted);
}
.cat-arrow {
  position: absolute;
  right: 14px; top: 14px;
  font-size: 16px;
  color: var(--cat-color);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity .2s, transform .2s;
}
.cat-card:hover .cat-arrow { opacity: 1; transform: translateX(0); }

/* 商品区 */
.goods-section { padding-top: 8px; }
.goods-search {
  display: flex; gap: 8px;
}
.goods-search select,
.goods-search input[type="text"] {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
}
.goods-search select { width: 130px; }
.goods-search input[type="text"] { width: 200px; }
.goods-search .btn { height: 38px; }

/* 商品卡增强 */
.product { position: relative; }
.product .badge-hot {
  position: absolute;
  top: 10px; left: 10px;
  background: linear-gradient(135deg, #ff6b6b, #ff3b3b);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 1px;
  box-shadow: 0 2px 8px rgba(255, 59, 59, .35);
  z-index: 2;
}

/* 响应式 */
@media (max-width: 1024px) {
  .hero-viewport { height: 420px; }
  .hero-title { font-size: 36px; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .hero-viewport { height: 360px; }
  .hero-title { font-size: 28px; }
  .hero-sub { font-size: 14px; }
  .hero-inner { padding: 0 20px; }
  .hero-nav { width: 38px; height: 38px; line-height: 38px; font-size: 22px; }
  .hero-prev { left: 10px; }
  .hero-next { right: 10px; }
  .features { grid-template-columns: 1fr 1fr; }
  .cat-grid { grid-template-columns: 1fr 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .goods-search { width: 100%; }
  .goods-search input[type="text"] { flex: 1; width: auto; }
}
@media (max-width: 480px) {
  .features { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: 1fr 1fr; }
}
