/* 动画样式文件 - 风格雅集 */
/* 定义悬停效果、页面过渡和滚动动画 */

/* ========== 页面过渡动画 ========== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ========== 呼吸动画 ========== */
@keyframes breathe {
  0%, 100% {
    opacity: 0.4;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-10px);
  }
}

/* ========== 脉动动画 ========== */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

/* ========== 闪烁动画 ========== */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* ========== 旋转动画 ========== */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ========== 页面加载动画 ========== */
body {
  animation: fadeIn 0.5s ease-in-out;
}

/* ========== 导航栏动画 ========== */
nav {
  animation: fadeInDown 0.6s ease-out;
}

.nav-links a {
  position: relative;
  transition: color 0.3s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width 0.3s ease, left 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
  left: 0;
}

/* ========== 滚动指示器动画 ========== */
.scroll-indicator {
  animation: breathe 2s ease-in-out infinite;
}

/* ========== 轮播图过渡 ========== */
.hero-slide {
  transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out;
}

.hero-slide.active {
  animation: fadeIn 0.8s ease-in-out;
}

/* 轮播指示器动画 */
.carousel-indicator {
  transition: all 0.3s ease;
}

.carousel-indicator:hover {
  transform: scale(1.2);
}

.carousel-indicator.active {
  animation: pulse 1.5s ease-in-out infinite;
}

/* ========== 卡片悬停效果 ========== */
.featured-item,
.collection-item,
.detail-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.featured-item:hover,
.collection-item:hover,
.detail-card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.featured-item img,
.collection-item img,
.detail-card img {
  transition: transform 0.4s ease;
}

.featured-item:hover img,
.collection-item:hover img,
.detail-card:hover img {
  transform: scale(1.05);
}

/* 卡片遮罩层动画 */
.overlay {
  transition: opacity 0.3s ease;
}

.featured-item:hover .overlay,
.collection-item:hover .overlay {
  opacity: 1;
}

.item-label,
.item-description {
  transition: opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
}

.featured-item:hover .item-description,
.collection-item:hover .item-label {
  opacity: 1;
  transform: translateY(0);
}

/* ========== 按钮动画 ========== */
.btn-explore,
.filter-tag,
.back-link {
  position: relative;
  transition: all 0.3s ease;
}

.btn-explore:hover,
.filter-tag:hover,
.back-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.btn-explore:active,
.filter-tag:active,
.back-link:active {
  transform: translateY(0);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 按钮背景动画 */
.btn-explore::before {
  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;
}

.btn-explore:hover::before {
  left: 100%;
}

/* ========== 筛选标签动画 ========== */
.filter-tag {
  transition: all 0.3s ease;
}

.filter-tag.active {
  transform: scale(1.05);
  animation: pulse 0.5s ease;
}

/* ========== 滚动触发动画 ========== */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

/* 不同方向的滚动动画 */
.animate-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-left.animated {
  opacity: 1;
  transform: translateX(0);
}

.animate-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-right.animated {
  opacity: 1;
  transform: translateX(0);
}

/* ========== 图片懒加载动画 ========== */
.lazy-image {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.lazy-image.loaded {
  opacity: 1;
  animation: fadeIn 0.5s ease;
}

/* 图片占位符闪烁效果 */
.image-placeholder {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* ========== 时间轴动画 ========== */
.timeline-item {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.timeline-item.animated {
  opacity: 1;
  transform: translateY(0);
}

.timeline-item:nth-child(1) { transition-delay: 0.1s; }
.timeline-item:nth-child(2) { transition-delay: 0.2s; }
.timeline-item:nth-child(3) { transition-delay: 0.3s; }
.timeline-item:nth-child(4) { transition-delay: 0.4s; }
.timeline-item:nth-child(5) { transition-delay: 0.5s; }

.timeline-icon {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-item:hover .timeline-icon {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* ========== 细节滑块动画 ========== */
.detail-slider {
  scroll-behavior: smooth;
}

.detail-card {
  opacity: 0;
  transform: scale(0.95);
  animation: fadeIn 0.5s ease forwards;
}

.detail-card:nth-child(1) { animation-delay: 0.1s; }
.detail-card:nth-child(2) { animation-delay: 0.2s; }
.detail-card:nth-child(3) { animation-delay: 0.3s; }

/* ========== 页面标题动画 ========== */
.page-title {
  animation: fadeInUp 0.8s ease-out;
}

.section-title {
  animation: fadeInUp 0.8s ease-out;
}

/* ========== 工艺展示动画 ========== */
.craft-visual,
.craft-text {
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.craft-visual.animated {
  opacity: 1;
  animation: slideInLeft 0.8s ease forwards;
}

.craft-text.animated {
  opacity: 1;
  animation: slideInRight 0.8s ease forwards;
}

/* ========== 引文动画 ========== */
.statement-quote {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.statement-quote.animated {
  opacity: 1;
  transform: scale(1);
}

/* ========== 工艺要点动画 ========== */
.craft-point {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.craft-point.animated {
  opacity: 1;
  transform: translateY(0);
}

.craft-point:nth-child(1) { transition-delay: 0.1s; }
.craft-point:nth-child(2) { transition-delay: 0.2s; }
.craft-point:nth-child(3) { transition-delay: 0.3s; }

/* ========== 页脚动画 ========== */
footer {
  animation: fadeIn 1s ease-out;
}

/* ========== 平滑滚动 ========== */
html {
  scroll-behavior: smooth;
}

/* ========== 加载状态动画 ========== */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: shimmer 1.5s infinite;
}

/* ========== 无障碍动画控制 ========== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}