/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Microsoft YaHei', Arial, sans-serif;
  color: #333;
  line-height: 1.6;
  background-color: #f8f9fa;
  font-size: 16px;
  scroll-behavior: smooth;
}

/* 懒加载图片样式 */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

img[loading="lazy"].loaded {
  opacity: 1;
}

/* 预加载占位符 */
.img-placeholder {
  background-color: #e9ecef;
  background-image: linear-gradient(45deg, #f3f4f6 25%, transparent 25%, transparent 75%, #f3f4f6 75%, #f3f4f6),
                    linear-gradient(45deg, #f3f4f6 25%, transparent 25%, transparent 75%, #f3f4f6 75%, #f3f4f6);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  animation: placeholder-loading 1s linear infinite;
}

@keyframes placeholder-loading {
  0% {
    background-position: 0 0, 10px 10px;
  }
  100% {
    background-position: 40px 0, 50px 10px;
  }
}

/* 导航栏样式 */
.navbar {
  transition: all 0.3s ease;
  background-color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar.scrolled {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.navbar-brand h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
  color: #0d6efd;
}

.nav-link {
  color: #333 !important;
  margin: 0 10px;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  padding: 0.5rem 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: #0d6efd;
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link:hover, .nav-link.active {
  color: #0d6efd !important;
}

/* 轮播图样式 */
.carousel {
  position: relative;
  height: 70vh;
  min-height: 500px;
  overflow: hidden;
}

.carousel-item img {
  height: 100%;
  width: 100%;
  object-fit: cover;
}

.carousel-caption {
  bottom: 30%;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 20px;
  border-radius: 8px;
}

.text-shadow {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* 卡片样式 */
.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: none;
  border-radius: 8px;
  height: 100%;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

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

.card-img-top {
  height: 200px;
  width: 100%;
  object-fit: cover;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  transition: transform 0.3s ease;
}

.card-title {
  font-weight: 600;
  color: #2c3e50;
}

/* 按钮样式 */
.btn-primary {
  background-color: #0d6efd;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, #0d6efd, #0a58ca);
  z-index: -1;
  transition: opacity 0.3s ease;
  opacity: 1;
}

.btn-primary:hover::before {
  opacity: 0;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(45deg, #0a58ca, #0d6efd);
  z-index: -1;
  transition: width 0.3s ease;
}

.btn-primary:hover::after {
  width: 100%;
}

.btn-primary:hover {
  background-color: #0b5ed7;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

/* 响应式调整 */
@media (max-width: 992px) {
  .navbar-nav .nav-link {
    margin-left: 0;
    margin-bottom: 0.5rem;
  }
  
  .page-title {
    font-size: 2rem;
  }
  
  .carousel-caption h2 {
    font-size: 2.2rem;
  }
}

@media (max-width: 768px) {
  .carousel {
    height: 60vh;
    min-height: 400px;
  }
  
  .carousel-caption {
    bottom: 20%;
    padding: 15px;
  }
  
  .carousel-item img {
    height: 100%;
  }
  
  .carousel-caption h2 {
    font-size: 1.8rem;
  }
  
  .carousel-caption p {
    font-size: 1rem;
  }
  
  .card-img-top {
    height: 150px;
  }
  
  .col-md-6.pl-8 {
    padding-left: 0 !important;
    margin-top: 20px;
  }
  
  .page-title {
    font-size: 1.8rem;
  }
}

@media (max-width: 576px) {
  .carousel {
    height: 50vh;
    min-height: 300px;
  }
  
  .carousel-caption {
    bottom: 10%;
    padding: 10px;
  }
  
  .carousel-caption h2 {
    font-size: 1.5rem;
  }
  
  .page-title {
    font-size: 1.5rem;
  }
  
  .btn-primary {
    padding: 8px 16px;
    font-size: 0.9rem;
  }
}

/* 页脚样式 */
footer a {
  color: #fff;
  text-decoration: none;
  transition: color 0.3s ease;
}

footer a:hover {
  color: #0d6efd;
}

/* 页面标题样式 */
.page-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: #0d6efd;
  margin: 40px 0;
  padding-bottom: 20px;
  border-bottom: 2px solid #0d6efd;
  position: relative;
}

.page-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  background-color: #0d6efd;
}

/* 产品列表样式 */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
}

/* 案例展示样式 */
.case-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.case-item img {
  transition: transform 0.5s ease;
}

.case-item:hover img {
  transform: scale(1.05);
}

.case-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  color: white;
  padding: 20px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.case-item:hover .case-overlay {
  transform: translateY(0);
}