/**
 * 首页视觉与布局高级化（对齐《网站首页视觉与布局高级化重构方案》）
 * 依赖 body.page-home，仅首页加载。
 */
html:has(body.page-home) {
  overflow-x: hidden;
  max-width: 100%;
}

body.page-home {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: linear-gradient(180deg, #fafcf9 0%, #ffffff 28%, #f7faf8 100%);
  background-attachment: fixed;
}

body.page-home *,
body.page-home *::before,
body.page-home *::after {
  box-sizing: border-box;
}

body.page-home img,
body.page-home video,
body.page-home canvas,
body.page-home svg {
  max-width: 100%;
}

/* 顶栏层次（宽度由全站 site-layout.css 与顶栏样式统一） */
body.page-home nav#navbar {
  border-bottom: 1px solid rgba(201, 150, 42, 0.22);
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.18), 0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

/* —— Hero：高度、深绿底 + 金色高光（保留 slide-bg::before 点阵纹理） —— */
body.page-home .carousel {
  height: clamp(560px, min(88vh, 760px), 760px);
  min-height: 560px;
  max-height: 760px;
}

body.page-home .slide-bg {
  background:
    radial-gradient(circle at 80% 18%, rgba(214, 162, 61, 0.2), transparent 32%),
    linear-gradient(135deg, #0f3d24 0%, #14532d 45%, #1f6b45 100%);
}

body.page-home .slide-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse 95% 70% at 50% 88%, rgba(0, 0, 0, 0.38), transparent 52%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.12) 0%, transparent 42%);
}

body.page-home .slide-content {
  position: relative;
  z-index: 1;
}

body.page-home .slide-title {
  text-wrap: balance;
  letter-spacing: 0.02em;
}

body.page-home .slide-subtitle {
  text-wrap: balance;
  max-width: 36rem;
}

body.page-home .slide-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

body.page-home .carousel-arrow:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* 区块节奏 */
body.page-home section {
  scroll-margin-top: 84px;
}

body.page-home .section-header {
  margin-bottom: 40px;
}

body.page-home .section-title {
  text-wrap: balance;
}

body.page-home .section-desc {
  text-wrap: balance;
  color: #66756d;
}

/* 资讯：米白底 + 三列居中网格 */
body.page-home .news-section {
  background: #fbf7ef;
  padding: 88px 0 96px;
  border-top: none;
  box-shadow: none;
}

body.page-home .news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  max-width: 1120px;
  margin: 0 auto;
}

body.page-home .news-card {
  border-radius: 18px;
  border-color: rgba(26, 77, 46, 0.08);
  box-shadow: 0 10px 28px rgba(20, 83, 45, 0.08);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

body.page-home .news-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 40px rgba(20, 83, 45, 0.16);
}

body.page-home .news-card-img {
  height: 220px;
}

body.page-home .news-card-img img {
  transition: transform 0.35s ease;
}

body.page-home .news-card:hover .news-card-img img {
  transform: scale(1.04);
}

body.page-home .news-card-link {
  transition: transform 0.25s ease, color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

body.page-home .news-card:hover .news-card-link {
  transform: translateX(4px);
}

@media (max-width: 768px) {
  body.page-home .news-section {
    padding: 64px 0 72px;
  }

  body.page-home .news-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  body.page-home .news-card-img {
    height: 190px;
  }
}

/* 行业资讯区：浅底与节奏 */
body.page-home .industry-section {
  background: #f8faf9;
  padding: 88px 0 96px;
}

/* 产品中心：浅绿渐变 + 四列网格 */
body.page-home .products-section {
  background: linear-gradient(180deg, #f4fbf6 0%, #eef8f1 100%);
  padding: 92px 0 100px;
}

body.page-home .category-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 12px;
  margin: 0 auto 32px;
  max-width: 1100px;
}

body.page-home .tab-btn {
  height: 38px;
  padding: 0 18px;
  min-height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(31, 107, 69, 0.28);
  background: rgba(255, 255, 255, 0.75);
  color: #14532d;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.2s ease, color 0.2s ease,
    border-color 0.2s ease;
}

body.page-home .tab-btn:hover,
body.page-home .tab-btn.active {
  box-shadow: 0 8px 18px rgba(20, 83, 45, 0.18);
  transform: translateY(-2px);
}

/* 产品分类/场景标签：hover 时必须有深色底 + 白字，避免仅变色导致白底白字 */
body.page-home #products .category-tabs .tab-btn:hover,
body.page-home #products .category-tabs .tab-btn:focus-visible,
body.page-home #products .scene-tabs-wrap .tab-btn:hover,
body.page-home #products .scene-tabs-wrap .tab-btn:focus-visible {
  background: linear-gradient(135deg, #14532d, #1f6b45) !important;
  color: #fff !important;
  border-color: rgba(20, 83, 45, 0.85) !important;
}

body.page-home #products .category-tabs .tab-btn.active,
body.page-home #products .scene-tabs-wrap .tab-btn.active {
  background: linear-gradient(135deg, #14532d, #1f6b45) !important;
  color: #fff !important;
  border-color: rgba(20, 83, 45, 0.85) !important;
}

body.page-home #products .category-tabs .tab-btn:not(:hover):not(.active),
body.page-home #products .scene-tabs-wrap .tab-btn:not(:hover):not(.active) {
  color: #14532d;
  background: rgba(255, 255, 255, 0.94);
}

/* 兜底：不依赖 .category-tabs 包裹层，避免部分 DOM 结构下 hover 规则未命中 */
body.page-home #products .tab-btn:hover,
body.page-home #products .tab-btn:focus-visible {
  background: linear-gradient(135deg, #14532d, #1f6b45) !important;
  color: #fff !important;
  border-color: rgba(20, 83, 45, 0.85) !important;
}

body.page-home #products .tab-btn.active {
  background: linear-gradient(135deg, #14532d, #1f6b45) !important;
  color: #fff !important;
  border-color: rgba(20, 83, 45, 0.85) !important;
}

body.page-home #products .tab-btn:not(:hover):not(:focus-visible):not(.active) {
  color: #14532d !important;
  background: rgba(255, 255, 255, 0.94) !important;
}

body.page-home .scene-tabs-wrap {
  justify-content: center;
  flex-wrap: wrap;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 768px) {
  body.page-home .category-tabs {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 24px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  body.page-home .category-tabs::-webkit-scrollbar {
    display: none;
  }

  body.page-home .tab-btn {
    flex: 0 0 auto;
  }

  body.page-home .scene-tabs-wrap {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
  }

  body.page-home .scene-tabs-wrap::-webkit-scrollbar {
    display: none;
  }
}

body.page-home .products-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 26px;
  max-width: 1240px;
  margin: 0 auto;
}

body.page-home .product-card {
  border-radius: 20px;
  border: 1px solid rgba(31, 107, 69, 0.08);
  box-shadow: 0 8px 24px rgba(20, 83, 45, 0.07);
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

body.page-home .product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 42px rgba(20, 83, 45, 0.16);
  border-color: rgba(31, 107, 69, 0.22);
}

body.page-home .product-img {
  aspect-ratio: auto;
  height: 240px;
  min-height: 200px;
  background: linear-gradient(180deg, #f3faf5, #e8f4ed);
}

body.page-home .product-img img {
  object-fit: contain;
  max-width: 86%;
  max-height: 86%;
  width: auto;
  height: auto;
  transition: transform 0.35s ease;
}

body.page-home .product-card:hover .product-img img {
  transform: scale(1.06);
}

@media (max-width: 1024px) {
  body.page-home .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
}

@media (max-width: 768px) {
  body.page-home .products-section {
    padding: 72px 0 80px;
  }

  body.page-home .products-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  body.page-home .product-img {
    height: 200px;
  }
}

@media (max-width: 480px) {
  body.page-home .products-grid {
    grid-template-columns: 1fr !important;
  }
}

/* 作物专栏：四列居中 */
body.page-home .crops-section {
  background: #ffffff;
  padding: 92px 0 100px;
}

body.page-home .columns-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 26px;
  max-width: 1120px;
  margin: 0 auto;
}

body.page-home .column-card:hover {
  transform: translateY(-8px);
}

@media (max-width: 768px) {
  body.page-home .crops-section {
    padding: 72px 0 80px;
  }

  body.page-home .columns-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (max-width: 420px) {
  body.page-home .columns-grid {
    grid-template-columns: 1fr;
  }
}

/* 工具 / 案例条：深绿 + 金色光斑（!important 覆盖后台 sectionBg 内联浅色，避免白字贴浅底） */
body.page-home .cases-section.section-tools {
  border-top: none;
  background:
    radial-gradient(circle at 20% 22%, rgba(214, 162, 61, 0.18), transparent 34%),
    linear-gradient(135deg, #0f3d24, #14532d) !important;
  padding: 88px 0 96px;
  color: #fff !important;
}

body.page-home .cases-section.section-tools .section-tag {
  color: rgba(232, 184, 75, 0.95) !important;
}

body.page-home .cases-section.section-tools .section-title {
  color: #fff !important;
}

body.page-home .cases-section.section-tools .section-title span {
  color: #e8c96b !important;
}

body.page-home .cases-section.section-tools .section-desc {
  color: rgba(255, 255, 255, 0.9) !important;
}

body.page-home .cases-section.section-tools .divider {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.35), rgba(214, 162, 61, 0.9)) !important;
}

body.page-home .cases-section.section-tools .tools-strip-wrap a.btn-outline {
  border: 1px solid rgba(255, 255, 255, 0.45) !important;
  color: #fff !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

body.page-home .cases-section.section-tools .tools-strip-wrap a.btn-outline:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  border-color: rgba(255, 255, 255, 0.65) !important;
  color: #fff !important;
}

body.page-home .company-section {
  background: #fff;
  padding: 88px 0 96px;
}

body.page-home .intent-section {
  padding: 88px 0 96px;
}

/* 行业资讯卡片 */
body.page-home .industry-card {
  border-radius: 18px;
  border-color: rgba(26, 77, 46, 0.07);
}

/* 页脚 */
body.page-home footer {
  border-top: 1px solid rgba(201, 150, 42, 0.2);
  background: linear-gradient(180deg, #15261c 0%, #111f16 100%);
  padding-top: 36px;
  padding-bottom: 36px;
}

@media (prefers-reduced-motion: reduce) {
  body.page-home *,
  body.page-home *::before,
  body.page-home *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  body.page-home .carousel-track {
    transition: none !important;
  }
}
