/* =========================================
   全局基础样式 (Global Reset & Typography)
   ========================================= */
:root {
  --color-bg: #FAF9F6;           /* 浅米白背景 */
  --color-bg-secondary: #F5F5F5; /* 浅灰辅助背景 */
  --color-text: #2C2C2C;         /* 深炭灰文字 */
  --color-text-light: #888888;   /* 浅灰说明文字 */
  --color-border: #EEEEEE;
  
  --font-primary: "Source Han Sans CN", "Source Han Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  
  --spacing-container: 20px;
  --max-width: 1400px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =========================================
   通用布局容器 (Layout Containers)
   ========================================= */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-container);
  width: 100%;
}

main {
  min-height: 80vh;
}

/* =========================================
   导航栏 (Navigation)
   ========================================= */
header {
  padding: 30px 0;
  position: relative;
  z-index: 100;
  background-color: var(--color-bg);
}

nav {
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav-links {
  display: flex;
  gap: 50px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--color-text);
  font-size: 16px;
  letter-spacing: 1px;
  position: relative;
  padding-bottom: 5px;
  transition: opacity 0.3s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--color-text);
  transition: width 0.3s ease;
}

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

/* 汉堡菜单按钮 (默认隐藏) */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  z-index: 102;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-text);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* =========================================
   图片与交互 (Images & Interactions)
   ========================================= */
.image-wrapper {
  overflow: hidden;
  width: 100%;
  background-color: #E5E5E5; /* 占位色 */
  /* 默认保持垂直比例，具体比例可由内容撑开或指定 */
}

img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease;
}

/* 图片悬停放大效果 */
.image-wrapper:hover img {
  transform: scale(1.02);
}

/* 图片懒加载过渡 */
img[data-src] {
  opacity: 0;
}
img.loaded {
  opacity: 1;
}

/* =========================================
   页面内容模块 (Page Sections)
   ========================================= */

/* 1. 英雄区域 (Hero Section) */
.hero {
  margin-bottom: 80px;
  text-align: center;
}

.hero-image-container {
  margin-bottom: 40px;
}

.hero-text {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

.hero-text h1 {
  font-size: clamp(2rem, 5vw, 3rem); /* 响应式字体 */
  font-weight: 300;
  letter-spacing: 2px;
  margin-bottom: 20px;
}

.hero-text p {
  font-size: 1.1rem;
  color: #555;
  font-weight: 300;
}

/* 2. 网格布局 (Grid Layouts) */
.grid-section {
  margin: 80px 0;
}

.preview-grid, 
.detail-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  width: 100%;
}

.grid-item h3,
.detail-item h3 {
  margin-top: 15px;
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: 0.5px;
}

.detail-item p {
  font-size: 0.95rem;
  color: #666;
  margin-top: 5px;
  font-weight: 300;
}

/* 3. 风格辑录 (Collections) - 交替布局 */
.collection-intro,
.detail-intro,
.philosophy {
  text-align: center;
  max-width: 680px;
  margin: 60px auto;
  padding: 0 20px;
}

.collection-intro h2,
.detail-intro h2,
.philosophy h2 {
  font-size: 2rem;
  margin-bottom: 15px;
  font-weight: 300;
  letter-spacing: 1px;
}

.collection-intro p,
.detail-intro p,
.philosophy p {
  color: #555;
  font-weight: 300;
}

.collections {
  display: flex;
  flex-direction: column;
  gap: 100px;
  margin: 80px 0;
}

.collection-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.collection-text {
  padding: 20px;
}

.collection-text h3 {
  font-size: 1.8rem;
  margin-bottom: 15px;
  font-weight: 300;
}

/* 实现左右交替布局 */
.collection-item.reverse-layout .collection-image {
  order: 2;
}
.collection-item.reverse-layout .collection-text {
  order: 1;
}

/* =========================================
   页脚 (Footer)
   ========================================= */
footer {
  text-align: center;
  padding: 60px 0 30px;
  color: var(--color-text-light);
  font-size: 14px;
  border-top: 1px solid var(--color-border);
  margin-top: 100px;
}

/* =========================================
   响应式设计 (Responsive Design)
   ========================================= */
@media (max-width: 1024px) {
  .preview-grid, 
  .detail-gallery {
    grid-template-columns: repeat(2, 1fr); /* 平板端双列 */
  }
}

@media (max-width: 768px) {
  /* 导航栏变为汉堡菜单 */
  .hamburger {
    display: flex;
    position: absolute;
    right: 20px;
    top: 25px;
  }

  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--color-bg);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 40px;
    transform: translateY(-100%);
    transition: transform 0.4s ease-in-out;
    z-index: 101;
  }

  .nav-links.active {
    transform: translateY(0);
  }

  .nav-links a {
    font-size: 1.5rem;
  }

  /* 汉堡菜单动画 X */
  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
  }
  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }
  .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
  }

  /* 布局调整为单列 */
  .preview-grid, 
  .detail-gallery {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .collection-item {
    grid-template-columns: 1fr;
    gap: 30px;
    text-align: center;
  }

  .collection-item.reverse-layout .collection-image {
    order: 0; /* 恢复图片在上 */
  }
  .collection-item.reverse-layout .collection-text {
    order: 1;
  }

  .collection-text h3 {
    font-size: 1.5rem;
  }
  
  .hero-text h1 {
    font-size: 2rem;
  }
}