/* ============================================
   首页样式 home.css
   ============================================ */

/* ---------- Hero 轮播（Swiper） ---------- */
.hero {
  position: relative;
  height: 600px;
  overflow: hidden;
  background: var(--color-bg-dark);
}

.hero-swiper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.swiper-slide {
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
}

.swiper-pagination {
  position: absolute;
  bottom: 30px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  z-index: 10;
  width: 100%;
  text-align: center;
}

.swiper-pagination-bullet {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all var(--transition-base);
  margin: 0 5px !important;
  opacity: 1 !important;
}

.swiper-pagination-bullet-active {
  background: var(--color-secondary);
  width: 36px;
  border-radius: 6px;
}

.swiper-button-prev,
.swiper-button-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all var(--transition-base);
  backdrop-filter: blur(4px);
  margin-top: 0;
}

.swiper-button-prev {
  left: 30px;
}

.swiper-button-next {
  right: 30px;
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
  background: var(--color-secondary);
}

.swiper-button-prev::after,
.swiper-button-next::after {
  display: none;
}

.hero-content {
  color: #fff;
  max-width: 720px;
  overflow-wrap: break-word;
  word-break: break-word;
  padding-right: 20px;
}

.hero-content h1,
.hero-content h2 {
  font-size: var(--font-size-4xl);
  color: #fff;
  font-weight: 800;
  margin-bottom: var(--space-4);
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hero-content p {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-6);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .hero {
    height: auto;
    aspect-ratio: 16 / 9;
    min-height: 280px;
    position: relative;
    width: 100%;
    max-width: 100vw;
  }
  .hero-swiper {
    width: 100%;
    max-width: 100vw;
  }

  .swiper-pagination {
    bottom: 12px;
    gap: 6px;
  }

  .swiper-pagination-bullet {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    margin: 0 !important;
    opacity: 1 !important;
    position: relative;
  }

  .swiper-pagination-bullet::before {
    content: "";
    position: absolute;
    inset: -19px;
  }

  .swiper-pagination-bullet-active {
    width: 20px;
    height: 6px;
    border-radius: 3px;
    background: var(--color-secondary);
  }

  .swiper-button-prev,
  .swiper-button-next {
    width: 44px;
    height: 44px;
    font-size: 24px;
    margin-top: 0;
  }

  .swiper-button-prev {
    left: 12px;
  }

  .swiper-button-next {
    right: 12px;
  }

  .hero-content {
    padding: 0 16px;
    width: 100%;
    box-sizing: border-box;
  }
  .hero-content h1,
  .hero-content h2 {
    font-size: 26px;
    line-height: 1.3;
  }

  .hero-content p {
    font-size: 14px;
    line-height: 1.6;
  }

  .hero-actions .btn {
    flex: 1;
    min-width: 120px;
    padding: 10px 16px;
    font-size: var(--font-size-sm);
  }
}

@media (max-width: 480px) {

  .hero-content {
    padding: 0 12px;
  }

  .hero-content h1,
  .hero-content h2 {
    font-size: 22px;
    line-height: 1.3;
  }

  .hero-content p {
    font-size: 13px;
    line-height: 1.6;
  }

  .hero-actions .btn {
    min-width: 100px;
    padding: 8px 12px;
    font-size: 12px;
  }
}

/* ---------- 数据统计 ---------- */
.stats {
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-8) 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
  text-align: center;
}

.stat-num {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  color: var(--color-secondary);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.stat-num::after {
  content: "+";
}

.stat-label {
  font-size: var(--font-size-base);
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
  }
  .stat-num {
    font-size: var(--font-size-2xl);
  }
  .stat-label {
    font-size: var(--font-size-sm);
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }
  .stat-num {
    font-size: 28px;
  }
}

/* ---------- 主营业务卡片 ---------- */
.business-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.business-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--color-primary);
  transform: scaleX(0);
  transition: transform var(--transition-base);
}

.business-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
}

.business-card:hover::before {
  transform: scaleX(1);
}

.business-icon {
  margin-bottom: var(--space-4);
  line-height: 1;
}

.business-card h3 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-3);
  color: var(--color-primary-dark);
}

.business-card p {
  color: var(--color-text-light);
  margin-bottom: var(--space-4);
  font-size: var(--font-size-sm);
  line-height: 1.7;
}

.business-link {
  color: var(--color-primary);
  font-weight: 500;
  font-size: var(--font-size-sm);
}

.business-link:hover {
  color: var(--color-secondary);
}

/* 智能装备事业部卡片：两个链接并排 */
.business-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

/* ---------- 主营业务网格响应式：PC 4 列 / 移动 2 列 ---------- */
.business-grid {
  /* 桌面端继承 grid-4：4 列 */
}

@media (max-width: 1024px) {
  .business-grid {
    grid-template-columns: repeat(2, 1fr);  /* 平板：2 列 */
  }
}

@media (max-width: 600px) {
  .business-grid {
    grid-template-columns: repeat(2, 1fr);  /* 移动端：2 列（覆盖全局 1 列） */
  }

  .business-card {
    padding: var(--space-5) var(--space-3);  /* 移动端减少左右内边距 */
  }

  .business-icon {
    margin-bottom: var(--space-3);
  }

  .business-card h3 {
    font-size: var(--font-size-base);
    margin-bottom: var(--space-2);
  }

  .business-card p {
    font-size: var(--font-size-xs);
    line-height: 1.6;
    margin-bottom: var(--space-3);
  }
}

/* ---------- 产品精选 ---------- */
.featured-grid .card {
  display: flex;
  flex-direction: column;
}

.featured-grid .card-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.featured-grid .card-link:hover {
  border-color: var(--color-primary);
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.featured-grid .card-link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.featured-grid .card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.featured-grid .card-text {
  flex: 1;
}

/* ---------- 解决方案预览 ---------- */
.solution-card {
  display: block;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.solution-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.solution-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.solution-card:hover img {
  transform: scale(1.05);
}

.solution-card-body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-5);
  background: linear-gradient(to top, rgba(0, 77, 58, 0.9), transparent);
  color: #fff;
}

.solution-card-body h3 {
  color: #fff;
  margin-bottom: var(--space-1);
  font-size: var(--font-size-lg);
}

.solution-card-body p {
  font-size: var(--font-size-sm);
  margin: 0;
}

/* ---------- 关于我们简版 ---------- */
.about-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  align-items: center;
}

.about-preview-img img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
}

.about-preview-text .tag {
  background: rgba(0, 128, 96, 0.1);
  color: var(--color-primary);
  margin-bottom: var(--space-3);
  padding: 6px 14px;
}

.about-preview-text h2 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-4);
  color: var(--color-primary-dark);
}

.about-preview-text p {
  color: var(--color-text-light);
  margin-bottom: var(--space-4);
  line-height: 1.8;
}

.about-list {
  margin-bottom: var(--space-6);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.about-list li {
  color: var(--color-text);
  font-size: var(--font-size-sm);
  font-weight: 500;
}

@media (max-width: 768px) {
  .about-preview-grid {
    grid-template-columns: 1fr;
  }

  .about-list {
    grid-template-columns: 1fr;
  }
}

/* ---------- 新闻卡片 ---------- */
.news-grid .card {
  display: flex;
  flex-direction: column;
}

.news-grid .card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.news-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}

.news-date {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
}

.news-card .card-text {
  flex: 1;
  margin-bottom: var(--space-4);
}

.news-link {
  color: var(--color-primary);
  font-weight: 500;
  font-size: var(--font-size-sm);
}

/* ---------- 服务承诺 ---------- */
.promise-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.promise-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-5);
  text-align: center;
  border: 1px solid var(--color-border);
  transition: all var(--transition-base);
}

.promise-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-secondary);
}

.promise-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-4);
  background: rgba(0, 128, 96, 0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  transition: all var(--transition-base);
}

.promise-card:hover .promise-icon {
  background: var(--color-primary);
  color: #fff;
}

.promise-card h3 {
  font-size: var(--font-size-lg);
  color: var(--color-primary-dark);
  margin-bottom: var(--space-2);
}

.promise-card p {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  line-height: 1.6;
}

@media (max-width: 1024px) {
  .promise-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .promise-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- 品牌视频 ---------- */
.brand-video-section {
  position: relative;
  overflow: hidden;
}

.brand-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 560px;
  overflow: hidden;
}

.brand-video-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: kenBurns 20s ease-in-out infinite alternate;
}

@keyframes kenBurns {
  0% {
    transform: scale(1) translate(0, 0);
  }

  100% {
    transform: scale(1.1) translate(-1%, -1%);
  }
}

.brand-video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 77, 58, 0.7), rgba(0, 128, 96, 0.5));
}

.brand-video-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  padding: var(--space-8) var(--container-padding);
}

.brand-play-btn {
  width: 80px;
  height: 80px;
  color: #fff;
  cursor: pointer;
  transition: all var(--transition-base);
  margin-bottom: var(--space-5);
  background: none;
  border: none;
}

.brand-play-btn svg {
  width: 100%;
  height: 100%;
}

.brand-play-btn:hover,
.brand-play-btn:focus-visible {
  transform: scale(1.15);
  color: var(--color-secondary);
  outline: none;
}

.brand-video-content h2 {
  color: #fff;
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-3);
}

.brand-video-content p {
  font-size: var(--font-size-lg);
  max-width: 600px;
}

@media (max-width: 768px) {
  .brand-video-wrap {
    aspect-ratio: 4 / 3;
    max-height: 400px;
  }

  .brand-video-bg {
    animation: none;
  }

  .brand-play-btn {
    width: 60px;
    height: 60px;
  }

  .brand-video-content h2 {
    font-size: var(--font-size-2xl);
  }

  .brand-video-content p {
    font-size: var(--font-size-base);
  }
}

/* ============================================
   移动端（≤600px）四大模块：产品精选 / 行业解决方案 / 服务承诺 / 新闻动态
   全部统一为一行两列布局
   - 产品精选（8 张）→ 2 列 × 4 行
   - 行业解决方案（6 张）→ 2 列 × 3 行
   - 服务承诺（6 张）→ 2 列 × 3 行
   - 新闻动态（3 张）→ 2 列 × 2 行（末行单张）
   ============================================ */
@media (max-width: 600px) {

  /* ---------- 产品精选 ---------- */
  .featured-grid,
  .solutions-preview-grid,
  .news-grid {
    /* 覆盖 common.css 的 .grid-* 在 ≤600px 退化为 1 列的默认行为 */
    grid-template-columns: repeat(2, 1fr) !important;
    gap: var(--space-3) !important;
  }

  .featured-grid .card-body {
    padding: var(--space-3);
  }

  .featured-grid .card-title {
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-1);
    /* 标题 2 行截断 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .featured-grid .card-text {
    font-size: 12px;
    line-height: 1.5;
    /* 描述 2 行截断 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .featured-grid .badge {
    font-size: 10px;
    padding: 1px 6px;
  }

  /* ---------- 行业解决方案 ---------- */
  .solution-card-body {
    padding: var(--space-3);
  }

  .solution-card-body h3 {
    font-size: var(--font-size-base);
    margin-bottom: 2px;
  }

  .solution-card-body p {
    font-size: 12px;
    line-height: 1.4;
    /* 描述 2 行截断，避免长文字撑高卡片破坏两列等高 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* ---------- 服务承诺 ---------- */
  .promise-grid {
    /* 覆盖 .promise-grid 在 ≤600px 退化为 1fr 单列的本地规则 */
    grid-template-columns: repeat(2, 1fr) !important;
    gap: var(--space-3) !important;
  }

  .promise-card {
    padding: var(--space-4) var(--space-3);
  }

  .promise-icon {
    width: 44px;
    height: 44px;
    margin-bottom: var(--space-2);
  }

  .promise-card h3 {
    font-size: var(--font-size-base);
    margin-bottom: var(--space-1);
  }

  .promise-card p {
    font-size: 12px;
    line-height: 1.5;
    /* 描述 2 行截断 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* ---------- 新闻动态 ---------- */
  .news-grid .card-body {
    padding: var(--space-3);
  }

  .news-grid .card-title {
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-1);
    /* 标题 2 行截断 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .news-grid .card-text {
    font-size: 12px;
    line-height: 1.5;
    /* 描述 2 行截断 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .news-meta {
    margin-bottom: var(--space-2);
  }

  .news-meta .tag {
    font-size: 10px;
    padding: 2px 6px;
  }

  .news-date {
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-video-bg {
    animation: none;
  }
}