/* Features Section */
.features {
  padding: 100px 0;
  background: var(--bg-light);
  text-align: center;
  position: relative;
  overflow: hidden;
  /* 过渡设置 - 与全局animate类兼容 */
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.features::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 0;
  width: 100%;
  height: 200px;
  background: var(--bg-white);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.features h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.section-desc {
  max-width: 800px;
  margin: 0 auto 3rem;
  color: var(--text-light);
  text-align: center;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin: 3rem 0;
}

.gallery-item {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px var(--shadow);
  transition: all 0.4s ease;
  position: relative;
  /* 移除冲突的透明度和变换设置，让animate类控制动画效果 */
}

.gallery-item:hover {
  transform: translateY(-15px) scale(1.03);
  box-shadow: 0 15px 40px rgba(131, 100, 232, 0.3);
}

.gallery-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(131, 100, 232, 0.05), rgba(255, 107, 156, 0.1));
  pointer-events: none;
}

/* Feature Cards Section */
.feature-cards,
.feature-alternate {
  padding: 50px 0;
  position: relative;
  overflow: hidden;
}

.feature-alternate {
  background: var(--bg-light);
}

.feature-cards h2,
.feature-alternate h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
  text-align: center;
  width: 100%;
}

.feature-list {
  display: flex;
  align-items: center;
  gap: 3rem;
  margin-top: 3rem;
}

.feature-card {
  flex: 1;
  padding: 2rem;
  background: var(--card-gradient);
  border-radius: 24px;
  box-shadow: 0 10px 30px var(--shadow);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.7);
  position: relative;
  overflow: hidden;
  /* 移除冲突的透明度和变换设置，让animate类控制动画效果 */
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: var(--gradient);
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(131, 100, 232, 0.2);
}

/* 让图标和标题在同一行显示 */
.feature-card .card-icon-title {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.feature-card .card-icon-title .card-icon {
  margin-bottom: 0;
  flex-shrink: 0;
}

.feature-card .card-icon-title h3 {
  margin: 0;
  margin-bottom: 0;
}

.feature-card h3 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--primary);
}

.feature-card p {
  margin-bottom: 1.5rem;
  color: var(--text-light);
}

.feature-image {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 0.75rem;
  width: 100%;
  max-width: 700px; /* 适当减小容器宽度 */
  margin: 0 auto;
  min-height: 480px; /* 减小容器高度 */
}

.feature-image img,
.feature-image video {
  border-radius: 24px;
  box-shadow: 0 15px 40px var(--shadow);
  transition: all 0.3s ease;
  width: 100%; 
  max-width: 500px; /* 减小最大宽度 */
  height: auto;
  object-fit: contain; /* 使用contain确保按比例显示完整图片 */
  max-height: 440px; /* 减小最大高度 */
}

.feature-image:hover img,
.feature-image:hover video {
  transform: scale(1.05);
}

/* Styles Section */
.styles {
  padding: 100px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.styles h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
}

.tab {
  padding: 0.75rem 2rem;
  border-radius: 50px;
  border: none;
  background: var(--bg-light);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.tab:hover {
  background: rgba(131, 100, 232, 0.1);
}

.tab.active {
  background: var(--gradient);
  color: white;
  box-shadow: var(--button-shadow);
}

.style-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.style-card {
  background: var(--card-gradient);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px var(--shadow);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.7);
  position: relative;
  /* 进一步增加卡片高度 */
  height: 380px;
  display: flex;
  flex-direction: column;
}

.style-card:hover {
  transform: translateY(-10px) scale(1.03);
  box-shadow: 0 15px 40px rgba(131, 100, 232, 0.2);
}

.style-card img {
  width: 100%;
  height: 320px; /* 进一步增加图片高度 */
  object-fit: cover;
  transition: all 0.5s ease;
}

.style-card:hover img {
  transform: scale(1.1);
}

.style-card figcaption,
.style-card span {
  display: block;
  padding: 1rem;
  font-weight: 600;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.9);
  position: relative;
  z-index: 1;
  text-align: center;
  margin-top: auto; /* 将标题推到卡片底部 */
}

/* 特性卡片的装饰元素 */
.card-icon {
  margin-bottom: 20px;
  font-size: 1.8rem;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(131, 100, 232, 0.3);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease-in-out, transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 添加图标装饰效果 */
.card-icon::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, transparent 25%, rgba(255, 255, 255, 0.2) 25%, 
                                rgba(255, 255, 255, 0.2) 50%, transparent 50%, 
                                transparent 75%, rgba(255, 255, 255, 0.2) 75%);
  background-size: 20px 20px;
  opacity: 0.2;
  z-index: 1;
}

.card-icon::after {
  content: '';
  position: absolute;
  width: 150%;
  height: 50%;
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(-25deg) translateY(-100%);
  top: 0;
  left: -25%;
  transition: transform 0.6s ease;
}

/* 图标悬停效果 */
.feature-card:hover .card-icon {
  transform: translateY(-8px) scale(1.05);
  box-shadow: 0 15px 30px rgba(131, 100, 232, 0.4);
}

.feature-card:hover .card-icon::after {
  transform: rotate(-25deg) translateY(200%);
}

/* 图标内的i元素增加相对定位 */
.card-icon i {
  position: relative;
  z-index: 2;
  transition: transform 0.3s ease;
}

.feature-card:hover .card-icon i {
  transform: scale(1.15);
}

/* 特性徽章 */
.feature-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--gradient);
  color: white;
  padding: 5px 15px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 10; /* 提高z-index确保徽章始终可见 */
}

/* 卡片丝带 */
.card-ribbon {
  position: absolute;
  top: 15px;
  right: -5px;
  background: var(--secondary);
  color: white;
  padding: 5px 15px;
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 2;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.card-ribbon::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: -5px;
  width: 5px;
  height: 5px;
  background: #d64778;
  border-radius: 0 0 0 5px;
}

/* 保留风格类型的大尺寸 */
#style-types-tab .style-card {
  height: 380px;
}

#style-types-tab .style-card img {
  height: 320px;
}

/* JavaScript动态创建卡片时样式一致性 */
#style-types-tab .style-card span {
  margin-top: auto; /* 确保在底部 */
  font-size: 1rem; /* 与figcaption一致的字体大小 */
  font-family: 'Poppins', sans-serif; /* 保持字体一致 */
}

/* 角度视图使用更小尺寸 */
#angle-views-tab .style-card {
  height: 380px;
}

#angle-views-tab .style-card img {
  height: 320px;
  object-fit: contain;
  padding: 5px;
  background-color: white;
}

/* 响应式布局 */
@media (max-width: 1024px) {
  .feature-list {
    flex-direction: column;
  }
  
  .feature-alternate .feature-list {
    flex-direction: column-reverse;
  }
  
  .style-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .feature-card, 
  .feature-image {
    width: 100%;
    max-width: 600px; /* 适中的容器宽度 */
    margin: 0 auto;
  }
  
  .feature-image {
    min-height: 460px; /* 调整响应式下的高度 */
    max-width: 650px; /* 调整响应式下的宽度 */
  }
  
  .feature-image img,
  .feature-image video {
    max-width: 90%;
    max-height: 420px; /* 调整响应式下的最大高度 */
  }
  
  #style-types-tab .style-card {
    height: 360px;
  }
  
  #style-types-tab .style-card img {
    height: 300px;
  }
  
  #angle-views-tab .style-card {
    height: 360px;
  }
  
  #angle-views-tab .style-card img {
    height: 300px;
  }
}

@media (max-width: 768px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .style-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .feature-badge {
    font-size: 0.8rem;
    padding: 3px 10px;
  }
  
  #style-types-tab .style-card {
    height: 340px;
  }
  
  #style-types-tab .style-card img {
    height: 280px;
  }
  
  #angle-views-tab .style-card {
    height: 340px;
  }
  
  #angle-views-tab .style-card img {
    height: 280px;
  }
  
  .gallery-item img {
    height: 250px; /* 略微减小图片高度 */
  }
  
  .feature-image {
    min-height: 420px; /* 在更小屏幕上继续减小高度 */
  }
  
  .feature-image img,
  .feature-image video {
    max-width: 90%;
    max-height: 380px; /* 调整响应式下的最大高度 */
  }
  
  .feature-card .card-icon-title {
    gap: 1rem;
  }
}

@media (max-width: 576px) {
  .gallery,
  .style-grid {
    grid-template-columns: 1fr;
  }
  
  .feature-card {
    padding: 1.5rem;
  }
  
  h2, .features h2, .styles h2 {
    font-size: 2rem;
  }
  
  #style-types-tab .style-card {
    height: 320px;
  }
  
  #style-types-tab .style-card img {
    height: 260px;
  }
  
  #angle-views-tab .style-card {
    height: 320px;
  }
  
  #angle-views-tab .style-card img {
    height: 260px;
  }
  
  .feature-image {
    min-height: 380px; /* 小屏幕下调整容器高度 */
  }
  
  .feature-image img,
  .feature-image video {
    max-height: 340px; /* 小屏幕下调整最大高度 */
  }
} 