/* 全局样式变量 */
:root {
  --primary-color: #f5f5f0;
  --secondary-color: #e8e8e3;
  --accent-color: #d4c5b9;
  --text-primary: #333333;
  --text-secondary: #666666;
  --border-color: #e0e0e0;
  --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.12);
  --border-radius: 8px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基础样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--primary-color);
}

/* 通用容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 导航栏样式 */
header {
  background-color: white;
  box-shadow: var(--shadow-light);
  position: sticky;
  top: 0;
  z-index: 100;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
}

.logo {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: 2px;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 3rem;
}

.nav-menu a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  transition: var(--transition);
  position: relative;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--text-primary);
}

.nav-menu a.active::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--text-primary);
}

/* 轮播图样式 */
.hero-carousel {
  position: relative;
  height: 80vh;
  overflow: hidden;
  background-color: var(--secondary-color);
}

.carousel-slide {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
}

.carousel-slide.active {
  opacity: 1;
}

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

.carousel-caption {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.carousel-caption h2 {
  font-size: 3rem;
  font-weight: 300;
  margin-bottom: 1rem;
  animation: fadeInUp 1s ease;
}

.carousel-caption p {
  font-size: 1.2rem;
  font-weight: 300;
  animation: fadeInUp 1s ease 0.2s backwards;
}

/* 精选系列网格 */
.section {
  padding: 5rem 0;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 300;
  margin-bottom: 3rem;
  color: var(--text-primary);
}

.scarf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.scarf-card {
  background-color: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-light);
  transition: var(--transition);
  cursor: pointer;
}

.scarf-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-medium);
}

.scarf-card img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  transition: var(--transition);
}

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

.scarf-card-content {
  padding: 1.5rem;
}

.scarf-card h3 {
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.scarf-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* 按钮样式 */
.btn {
  display: inline-block;
  padding: 12px 32px;
  background-color: var(--text-primary);
  color: white;
  text-decoration: none;
  border-radius: var(--border-radius);
  transition: var(--transition);
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
}

.btn:hover {
  background-color: #555;
  transform: translateY(-2px);
}

.btn-center {
  text-align: center;
  margin-top: 3rem;
}

/* 筛选器样式 */
.filter-container {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-group label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.filter-group select {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background-color: white;
  color: var(--text-primary);
  font-size: 0.95rem;
  cursor: pointer;
}

/* 瀑布流布局 */
.waterfall {
  column-count: 3;
  column-gap: 2rem;
}

.waterfall-item {
  break-inside: avoid;
  margin-bottom: 2rem;
}

.waterfall-item img {
  width: 100%;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  transition: var(--transition);
}

.waterfall-item:hover img {
  transform: scale(1.02);
  box-shadow: var(--shadow-medium);
}

.waterfall-item p {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
}

/* 详情弹窗 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background-color: white;
  border-radius: var(--border-radius);
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  color: var(--text-secondary);
  cursor: pointer;
  z-index: 10;
}

.modal-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  padding: 2rem;
}

.modal-images img {
  width: 100%;
  border-radius: var(--border-radius);
}

.modal-info {
  padding: 0 2rem 2rem;
}

.modal-info h2 {
  font-size: 2rem;
  font-weight: 300;
  margin-bottom: 1rem;
}

.modal-info p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1rem;
}

/* 工艺页面样式 */
.craft-section {
  margin-bottom: 4rem;
}

.craft-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.craft-image img {
  width: 100%;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
}

.craft-text h3 {
  font-size: 1.8rem;
  font-weight: 400;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.craft-text p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1rem;
}

/* 页脚样式 */
footer {
  background-color: #2c2c2c;
  color: white;
  text-align: center;
  padding: 2rem 0;
  font-size: 0.9rem;
}

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

.fade-in {
  animation: fadeInUp 0.6s ease;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .nav-menu {
    gap: 1.5rem;
  }
  
  .nav-menu a {
    font-size: 0.85rem;
  }
  
  .carousel-caption h2 {
    font-size: 2rem;
  }
  
  .carousel-caption p {
    font-size: 1rem;
  }
  
  .section-title {
    font-size: 1.8rem;
  }
  
  .scarf-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
  }
  
  .waterfall {
    column-count: 2;
    column-gap: 1rem;
  }
  
  .craft-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .filter-container {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .waterfall {
    column-count: 1;
  }
  
  .nav-menu {
    flex-direction: column;
    gap: 1rem;
  }
  
  nav {
    flex-direction: column;
    gap: 1rem;
  }
  
  .hero-carousel {
    height: 60vh;
  }
  
  .carousel-caption h2 {
    font-size: 1.5rem;
  }
}