/* 全局样式 */
:root {
  /* 颜色令牌 */
  --color-primary: #faf9f6;
  --color-secondary: #e8e6e1;
  --color-accent: #a8c4bc;
  --color-accent-secondary: #b2aeb5;
  --color-accent-tertiary: #d8b9ba;
  --color-text: #333333;
  --color-text-light: #666666;
  --color-text-lighter: #999999;
  
  /* 间距令牌 */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 3rem;
  --spacing-xl: 4rem;
  
  /* 字体令牌 */
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  
  /* 阴影令牌 */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  
  /* 圆角令牌 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-primary);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* 图片默认样式 */
img {
  max-width: 100%;
  height: auto;
  display: block;
  opacity: 0;
  transition: opacity 0.6s ease;
}

img.loaded {
  opacity: 1;
}

/* 导航栏样式 */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(250, 249, 246, 0.85);
  backdrop-filter: blur(10px);
  z-index: 1000;
  padding: var(--spacing-md);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav-links {
  display: flex;
  gap: var(--spacing-lg);
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--color-text);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  transition: color 0.3s ease;
  position: relative;
}

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

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

.nav-links a:hover {
  color: var(--color-accent);
}

/* 主容器 */
.main-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: calc(var(--spacing-xl) + var(--spacing-md)) var(--spacing-md) var(--spacing-md);
}

/* 页脚 */
footer {
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-md);
  color: var(--color-text-lighter);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
}

/* 标题样式 */
.page-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  margin-bottom: var(--spacing-lg);
  color: var(--color-text);
}

/* 按钮基础样式 */
.btn {
  display: inline-block;
  padding: var(--spacing-xs) var(--spacing-sm);
  background: none;
  border: 1px solid var(--color-text);
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn:hover {
  background-color: var(--color-text);
  color: var(--color-primary);
}

/* 响应式断点 */
@media (max-width: 768px) {
  :root {
    font-size: 14px;
  }
  
  .nav-links {
    gap: var(--spacing-md);
  }
  
  .nav-links a {
    font-size: 0.85rem;
  }
  
  .main-container {
    padding: calc(var(--spacing-lg) + var(--spacing-md)) var(--spacing-sm) var(--spacing-sm);
  }
  
  .page-title {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .nav-links {
    gap: var(--spacing-sm);
  }
  
  .main-container {
    padding: calc(var(--spacing-md) + var(--spacing-sm)) var(--spacing-xs) var(--spacing-xs);
  }
  
  .page-title {
    font-size: 1.75rem;
  }
}

/* 动画类 */
.fade-in {
  animation: fadeIn 0.8s ease forwards;
}

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

/* 瀑布流布局 */
.masonry-grid {
  column-count: 3;
  column-gap: var(--spacing-sm);
}

@media (max-width: 1024px) {
  .masonry-grid {
    column-count: 2;
  }
}

@media (max-width: 768px) {
  .masonry-grid {
    column-count: 1;
  }
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: var(--spacing-sm);
  overflow: hidden;
  border-radius: var(--radius-md);
}

.masonry-item img {
  width: 100%;
  transition: transform 0.4s ease;
}

.masonry-item:hover img {
  transform: scale(1.03);
}

/* 网格布局 */
.grid-layout {
  display: grid;
  gap: var(--spacing-sm);
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* 灯箱样式 */
.lightbox {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
}

.lightbox.active {
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  background: none;
  border: none;
}

/* 筛选标签 */
.filter-tags {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  flex-wrap: wrap;
}

.filter-tag {
  padding: var(--spacing-xs) var(--spacing-sm);
  background: transparent;
  border: 1px solid var(--color-secondary);
  color: var(--color-text-light);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

.filter-tag:hover,
.filter-tag.active {
  background-color: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

/* 轮播图容器 */
.carousel-container {
  position: relative;
  width: 100%;
  height: 70vh;
  min-height: 400px;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

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

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

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

/* 引言区域 */
.intro-section {
  text-align: center;
  padding: var(--spacing-xl) 0;
  max-width: 800px;
  margin: 0 auto;
}

.intro-text {
  font-size: 1.25rem;
  line-height: 1.8;
  color: var(--color-text-light);
  letter-spacing: 0.05em;
  font-weight: 300;
}

/* 精选展示区 */
.featured-section {
  margin-top: var(--spacing-xl);
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-md);
}

.featured-item {
  text-align: center;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.featured-item:hover {
  transform: translateY(-5px);
}

.featured-item img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-xs);
}

.featured-item p {
  font-size: 0.9rem;
  color: var(--color-text-light);
  letter-spacing: 0.05em;
}

/* 故事页面样式 */
.story-container {
  position: relative;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.story-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.story-background img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.8);
}

.story-content {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  padding: var(--spacing-lg);
  max-width: 700px;
  margin: var(--spacing-md);
  border-radius: var(--radius-lg);
}

.story-text {
  font-size: 1.1rem;
  line-height: 2;
  color: var(--color-text);
  letter-spacing: 0.02em;
  text-align: justify;
}