/* ✅ Hero */
.hero {
  position: relative;
  text-align: center;
  padding: 150px 20px;
  overflow: hidden;
  color: white;
}

body.home .hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(
      rgba(0, 0, 0, 0.6), 
      rgba(0, 0, 0, 0.6)
    ),
    url("images/tsw.jpg");
  background-size: cover;
  background-position: center;
  animation: zoomLoop 10s ease-in-out infinite;
  transform-origin: center;
  z-index: 0;
}

.hero h1,
.hero p {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 64px;
}

.hero p {
  font-size: 28px;
  margin-top: 10px;
}

@keyframes zoomLoop {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* ✅ Services Carousel */
.services-carousel {
  overflow: hidden;
  width: 95%;
  margin: 60px auto;
  position: relative;
}

.carousel-track {
  display: flex;
  transition: transform 0.8s ease-in-out;
}

.service-card {
  background: #e0e0e0;
  border-radius: 10px;
  text-align: left;
  flex: 0 0 calc(33.33% - 30px);
  min-height: 500px;
  max-height: 500px;
  display: flex;
  flex-direction: column;
  font-size: 16px;
  box-sizing: border-box;
  margin: 0 15px;
  padding: 15px;
}

.service-card img.service-img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 10px 10px 0 0;
  margin-bottom: 15px;
}

.service-card h2 {
  font-size: 20px;
  margin: 10px 0;
  color: #003366;
}

.service-card h3 {
  font-size: 16px;
  margin-top: 15px;
  color: #333;
}

.service-card ul {
  margin: 8px 0 0 20px;
  padding: 0;
}

.service-card ul li {
  margin-bottom: 6px;
}

.learn-more-btn {
  margin-top: auto;
  align-self: flex-end;
  background: #003366;
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  transition: background 0.3s ease;
}

.learn-more-btn:hover {
  background: #0055aa;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  font-size: 24px;
  cursor: pointer;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex; 
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }

.carousel-btn:hover {
  background: rgba(0,0,0,0.8);
}

/* ✅ 响应式调整 */
@media (max-width: 1024px) {
  .hero {
    padding: 120px 20px;
  }
  .hero h1 {
    font-size: 48px;
  }
  .hero p {
    font-size: 22px;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 80px 15px;
  }
  .hero h1 {
    font-size: 36px;
  }
  .hero p {
    font-size: 18px;
  }

  .service-card {
    flex: 0 0 100%;
    margin: 10px 0;
    min-height: auto;
  }
  .service-card img.service-img {
    height: auto;
  }

  .services-carousel {
    overflow-x: auto;
  }
  .carousel-track {
    display: flex;
    gap: 15px;
  }

  .carousel-btn {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 60px 10px;
  }
  .hero h1 {
    font-size: 28px;
  }
  .hero p {
    font-size: 16px;
  }

  .learn-more-btn {
    font-size: 12px;
    padding: 6px 12px;
  }

  .carousel-btn {
    width: 35px;
    height: 35px;
    font-size: 18px;
  }
}

/* ===================== HOME PAGE 专属 CSS ===================== */

/* ✅ Hero */
.hero {
  position: relative;
  text-align: center;
  padding: 150px 20px;
  overflow: hidden;
  color: white;
}

body.home .hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(
      rgba(0, 0, 0, 0.6), 
      rgba(0, 0, 0, 0.6)
    ),
    url("images/tsw.jpg");
  background-size: cover;
  background-position: center;
  animation: zoomLoop 10s ease-in-out infinite;
  transform-origin: center;
  z-index: 0;
}

.hero h1,
.hero p {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 64px;
}

.hero p {
  font-size: 28px;
  margin-top: 10px;
}

@keyframes zoomLoop {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* ===================== HOME PAGE 专属 CSS ===================== */

/* ✅ Hero */
.hero {
  position: relative;
  text-align: center;
  padding: 120px 20px; /* 缩小 Hero 高度 */
  overflow: hidden;
  color: white;
}

body.home .hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(
      rgba(0, 0, 0, 0.5), 
      rgba(0, 0, 0, 0.5)
    ),
    url("images/tsw.jpg");
  background-size: cover;
  background-position: center;
  animation: zoomLoop 10s ease-in-out infinite;
  transform-origin: center;
  z-index: 0;
}

.hero h1,
.hero p {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 48px;
}

.hero p {
  font-size: 22px;
  margin-top: 10px;
}

@keyframes zoomLoop {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* ===================== Services Carousel ===================== */
.services-carousel {
  overflow: hidden;
  width: 95%;
  margin: 60px auto;
  position: relative;
}

.carousel-track {
  display: flex;
  transition: transform 0.8s ease-in-out;
  gap: 30px; /* 卡片间距 */
}

.service-card {
  background: #e0e0e0;
  border-radius: 10px;
  text-align: left;
  flex: 0 0 calc(33.33% - 20px); /* 桌面端三列 */
  min-height: 500px;
  display: flex;
  flex-direction: column;
  font-size: 16px;
  box-sizing: border-box;
  padding: 15px;
  position: relative;
}

.service-card img.service-img {
  width: 100%;
  height: 220px; /* 统一高度 */
  object-fit: cover;
  border-radius: 10px 10px 0 0;
  margin-bottom: 15px;
}

.service-card h2 {
  font-size: 20px;
  margin: 10px 0;
  color: #003366;
  line-height: 1.2;
  text-align: left;
}

.service-card h3 {
  font-size: 16px;
  margin-top: 8px;
  color: #333;
}

.service-card ul {
  margin: 8px 0 0 20px;
  padding: 0;
}

.service-card ul li {
  margin-bottom: 6px;
  font-size: 14px;
}

.learn-more-btn {
  position: absolute;
  bottom: 15px; /* 固定在卡片底部 */
  left: 50%;
  transform: translateX(-50%);
  background: #003366;
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  transition: background 0.3s ease;
}

.learn-more-btn:hover {
  background: #0055aa;
}

/* Carousel 控制按钮 */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  font-size: 24px;
  cursor: pointer;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex; 
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }

.carousel-btn:hover {
  background: rgba(0,0,0,0.8);
}

/* ===================== 响应式调整 ===================== */
@media (max-width: 1024px) {
  .service-card { flex: 0 0 45%; }
  .carousel-track { gap: 20px; }
}

@media (max-width: 768px) {
  .services-carousel { overflow-x: auto; padding-bottom: 10px; }
  .carousel-track { display: flex; gap: 15px; }
  .service-card {
    flex: 0 0 80%; /* 手机端单列滚动 */
    min-height: auto;
  }
  .service-card img.service-img { height: 180px; }
  .learn-more-btn { bottom: 10px; font-size: 12px; padding: 6px 12px; }
  .carousel-btn { width: 40px; height: 40px; font-size: 20px; }
}

@media (max-width: 480px) {
  .hero { padding: 80px 10px; }
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 16px; }
  .service-card { flex: 0 0 90%; }
  .service-card img.service-img { height: 150px; }
  .learn-more-btn { bottom: 8px; font-size: 12px; padding: 5px 10px; }
  .carousel-btn { width: 35px; height: 35px; font-size: 18px; }
}
