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

:root {
  --color-pearl: #f8f8f8;
  --color-gray-light: #e5e5e5;
  --color-gray: #999;
  --color-beige: #f5f1e8;
  --color-text: #333;
  --color-text-light: #666;
  --transition-base: 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background-color: var(--color-pearl);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* 图片通用样式 */
img {
  max-width: 100%;
  height: auto;
  display: block;
  transition: transform var(--transition-base), opacity var(--transition-base);
}

img[data-lazy] {
  opacity: 0;
}

img.loaded {
  opacity: 1;
}

/* 导航栏样式 */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: rgba(248, 248, 248, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  border-bottom: 1px solid var(--color-gray-light);
}

/* 链接样式 */
a {
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--color-text-light);
}

/* 页面容器 */
.page-container {
  padding-top: 80px;
  min-height: 100vh;
}

/* 轮播图样式 */
.carousel-container {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  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;
}

.carousel-caption {
  position: absolute;
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  font-size: 1.5rem;
  letter-spacing: 0.1em;
}

/* 网格布局 */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  padding: 4rem 2rem;
}

.grid-item {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  cursor: pointer;
}

.grid-item img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
}

.grid-item:hover img {
  transform: scale(1.05);
}

.grid-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  padding: 1.5rem;
  color: white;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.grid-item:hover .grid-overlay {
  opacity: 1;
}

/* 瀑布流布局 */
.masonry-container {
  column-count: 3;
  column-gap: 1.5rem;
  padding: 2rem;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}

.masonry-item img {
  width: 100%;
  display: block;
}

/* 章节样式 */
.section-title {
  font-size: 2.5rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  text-align: center;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--color-text-light);
  text-align: center;
  margin-bottom: 3rem;
  letter-spacing: 0.05em;
}

/* 内容区域 */
.content-section {
  max-width: 1200px;
  margin: 4rem auto;
  padding: 0 2rem;
}

.content-block {
  margin-bottom: 4rem;
}

.content-block h3 {
  font-size: 1.8rem;
  font-weight: 300;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

.content-block p {
  color: var(--color-text-light);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

/* 引用样式 */
.quote-block {
  text-align: center;
  padding: 3rem 2rem;
  font-size: 1.3rem;
  font-weight: 300;
  font-style: italic;
  color: var(--color-text-light);
  letter-spacing: 0.05em;
}

/* 页脚样式 */
footer {
  text-align: center;
  padding: 2rem;
  font-size: 0.875rem;
  color: var(--color-gray);
  border-top: 1px solid var(--color-gray-light);
  margin-top: 4rem;
}

/* 响应式设计 */
@media (max-width: 1199px) {
  .masonry-container {
    column-count: 2;
  }
  
  .grid-container {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
  }
}

@media (max-width: 767px) {
  .masonry-container {
    column-count: 1;
  }
  
  .grid-container {
    grid-template-columns: 1fr;
    padding: 2rem 1rem;
  }
  
  .carousel-caption {
    font-size: 1rem;
  }
  
  .section-title {
    font-size: 1.8rem;
  }
  
  .content-section {
    padding: 0 1rem;
  }
}

/* 淡入动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* 加载占位符 */
.loading-placeholder {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}