/*=============== PRODUCT ENHANCEMENTS - 酷炫产品展示效果 ===============*/

/*=============== 1. 产品卡片3D翻转效果 ===============*/
.popular__card {
  position: relative;
  perspective: 1000px;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: visible;
}

.popular__card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, 
    var(--first-color), 
    var(--second-color), 
    var(--first-color));
  border-radius: 1rem;
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s ease;
  animation: border-glow 3s ease-in-out infinite;
}

.popular__card:hover::before {
  opacity: 0.6;
}

.popular__card:hover {
  transform: translateY(-15px) rotateX(5deg) rotateY(5deg) scale(1.05);
  box-shadow: 0 20px 40px hsla(228, 66%, 45%, .25),
              0 0 30px rgba(255, 193, 7, 0.3);
}

.popular__card .popular__img {
  position: relative;
  overflow: hidden;
  transition: transform 0.6s ease;
  border-radius: 1rem;
  margin-bottom: 1rem;
  width: 100%;
}

.popular__card .popular__img img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1),
              filter 0.6s ease;
  border-radius: 1rem;
}

.popular__card:hover .popular__img {
  transform: scale(1.05);
}

.popular__card:hover .popular__img img {
  transform: scale(1.1) rotate(2deg);
  filter: brightness(1.1) saturate(1.2);
}

.popular__img::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.3), 
    transparent);
  transition: left 0.5s ease;
}

.popular__card:hover .popular__img::after {
  left: 100%;
}

/*=============== 2. 产品徽章/标签 ===============*/
.popular__badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: linear-gradient(135deg, var(--first-color), var(--second-color));
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: var(--smaller-font-size);
  font-weight: var(--font-semi-bold);
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.popular__badge--new {
  background: linear-gradient(135deg, #00C851, #00E676);
}

.popular__badge--ai {
  background: linear-gradient(135deg, #667eea, #764ba2);
}

/*=============== 3. 产品特性标签云 ===============*/
.popular__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.popular__card:hover .popular__tags {
  opacity: 1;
  transform: translateY(0);
}

.popular__tag {
  background: var(--first-color-lighten);
  color: var(--first-color);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: var(--smaller-font-size);
  font-weight: var(--font-medium);
  border: 1px solid var(--first-color);
  transition: all 0.3s ease;
}

.popular__tag:hover {
  background: var(--first-color);
  color: white;
  transform: scale(1.1);
}

/*=============== 4. 粒子背景效果 ===============*/
#popular {
  position: relative;
}

.particles-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--first-color);
  border-radius: 50%;
  opacity: 0.6;
  animation: float-particle 15s infinite ease-in-out;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { left: 20%; animation-delay: 2s; }
.particle:nth-child(3) { left: 30%; animation-delay: 4s; }
.particle:nth-child(4) { left: 40%; animation-delay: 6s; }
.particle:nth-child(5) { left: 50%; animation-delay: 8s; }
.particle:nth-child(6) { left: 60%; animation-delay: 10s; }
.particle:nth-child(7) { left: 70%; animation-delay: 12s; }
.particle:nth-child(8) { left: 80%; animation-delay: 14s; }

@keyframes float-particle {
  0%, 100% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 0.6;
  }
  90% {
    opacity: 0.6;
  }
  50% {
    transform: translateY(-100px) translateX(20px);
    opacity: 1;
  }
}

/*=============== 5. 鼠标跟随光效 ===============*/
.popular__container {
  position: relative;
  padding: 2rem 0;
}

.mouse-light {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, 
    rgba(255, 193, 7, 0.2) 0%, 
    rgba(255, 193, 7, 0.1) 40%, 
    transparent 70%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
  z-index: 1;
  display: none;
}

.popular__container:hover .mouse-light {
  display: block;
}

/*=============== 6. 产品数据可视化 ===============*/
.popular__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s ease;
}

.popular__card:hover .popular__stats {
  opacity: 1;
  transform: translateY(0);
}

.popular__stat {
  text-align: center;
}

.popular__stat-number {
  font-size: var(--h3-font-size);
  font-weight: var(--font-semi-bold);
  color: var(--first-color);
  display: block;
}

.popular__stat-label {
  font-size: var(--smaller-font-size);
  color: var(--text-color);
  margin-top: 0.25rem;
}

/*=============== 7. 产品对比功能 ===============*/
.product-comparison {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--container-color);
  padding: 2rem;
  border-radius: 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  max-width: 800px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.product-comparison.active {
  display: block;
  animation: modal-fade-in 0.3s ease;
}

@keyframes modal-fade-in {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.comparison-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  backdrop-filter: blur(5px);
}

.comparison-overlay.active {
  display: block;
}

/*=============== 8. 产品预览视频悬浮效果 ===============*/
.popular__video-preview {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 1rem;
  overflow: hidden;
}

.popular__card:hover .popular__video-preview {
  opacity: 1;
}

.popular__video-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/*=============== 9. 渐变背景动画 ===============*/
.popular__card {
  background: linear-gradient(135deg, 
    var(--container-color) 0%, 
    var(--body-color) 100%);
  position: relative;
  overflow: hidden;
}

.popular__card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, 
    rgba(255, 193, 7, 0.1) 0%, 
    transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.popular__card:hover::after {
  opacity: 1;
  animation: gradient-rotate 3s linear infinite;
}

@keyframes gradient-rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/*=============== 10. 产品卡片加载动画 ===============*/
@keyframes card-slide-in {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.popular__card {
  animation: card-slide-in 0.6s ease-out;
}

.popular__card:nth-child(1) {
  animation-delay: 0.1s;
}

.popular__card:nth-child(2) {
  animation-delay: 0.2s;
}

.popular__card:nth-child(3) {
  animation-delay: 0.3s;
}

/*=============== 11. 产品特性进度条 - 已移除，简化设计 ===============*/

/*=============== 12. 产品卡片交互按钮 ===============*/
.popular__actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  opacity: 1;
  transform: translateY(0);
  transition: all 0.3s ease;
}

.popular__action-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--first-color-lighten);
  color: var(--first-color);
  border: 1px solid var(--first-color);
  border-radius: 0.5rem;
  font-size: var(--small-font-size);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  font-weight: var(--font-medium);
}

.popular__action-btn:hover {
  background: var(--first-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.popular__action-btn i {
  font-size: 1.1rem;
}

/*=============== 13. 两个产品并排显示布局 ===============*/
.popular__wrapper {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 0;
  align-items: stretch;
}

.popular__card {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.popular__data {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.popular__description {
  flex: 1;
  margin-bottom: 1rem;
}

/*=============== 14. 首页CTA按钮样式 ===============*/
.home__cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.button--outline {
  background: transparent;
  border: 2px solid var(--first-color);
  color: var(--first-color);
}

.button--outline:hover {
  background: var(--first-color);
  color: white;
}

.home__cta .button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/*=============== 15. 响应式设计 ===============*/
@media screen and (max-width: 1024px) {
  .popular__wrapper {
    grid-template-columns: 1fr;
    gap: 3rem;
    max-width: 600px;
  }
  
  .popular__card {
    max-width: 100%;
  }
}

@media screen and (max-width: 768px) {
  .popular__card:hover {
    transform: translateY(-10px) scale(1.02);
  }
  
  .popular__stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .popular__actions {
    flex-direction: column;
  }
  
  .home__cta {
    flex-direction: column;
  }
  
  .home__cta .button {
    width: 100%;
    justify-content: center;
  }
}

/*=============== 14. 暗色主题适配 ===============*/
.dark-theme .popular__card::before {
  background: linear-gradient(45deg, 
    var(--first-color), 
    var(--second-color), 
    var(--first-color));
}

.dark-theme .popular__tag {
  background: var(--container-color);
  border-color: var(--first-color);
}

.dark-theme .popular__feature-progress {
  background: var(--border-color);
}

/*=============== 15. 边框发光动画 ===============*/
@keyframes border-glow {
  0%, 100% {
    opacity: 0;
    filter: blur(0px);
  }
  50% {
    opacity: 0.8;
    filter: blur(5px);
  }
}

/*=============== 16. 产品卡片磁吸效果 ===============*/
.popular__card {
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

/*=============== 17. 产品图片缩放和模糊效果 - 已合并到上方 ===============*/

/*=============== 18. 产品标题动画 ===============*/
.popular__title {
  position: relative;
  display: inline-block;
}

.popular__title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--first-color), var(--second-color));
  transition: width 0.4s ease;
}

.popular__card:hover .popular__title::after {
  width: 100%;
}

/*=============== 19. 产品描述淡入效果 ===============*/
.popular__description {
  transition: opacity 0.3s ease, transform 0.3s ease;
  line-height: 1.6;
  min-height: 3.5em;
}

.popular__card:hover .popular__description {
  opacity: 0.9;
  transform: translateX(5px);
}

/* 隐藏空的价格部分 */
.popular__price:empty {
  display: none;
}

/*=============== 20. 产品卡片点击波纹效果 ===============*/
.popular__card {
  position: relative;
  overflow: hidden;
}

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transform: scale(0);
  animation: ripple-animation 0.6s ease-out;
  pointer-events: none;
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}
