/* CSS变量定义 */
:root {
  --primary-bg: #f5f2ed;
  --secondary-bg: #e8e5e0;
  --accent-dark: #4a5f4a;
  --accent-brown: #8b6f47;
  --text-primary: #333;
  --text-secondary: #666;
  --border-light: rgba(0, 0, 0, 0.1);
}

/* 字体设置 */
@font-face {
  font-family: 'Source Han Serif';
  src: url('https://fonts.loli.net/css2?family=Noto+Serif+SC:wght@400;600&display=swap');
}

@font-face {
  font-family: 'Alibaba PuHuiTi';
  src: url('https://fonts.loli.net/css2?family=Noto+Sans+SC:wght@300;400;500&display=swap');
}

body {
  font-family: 'Alibaba PuHuiTi', 'Noto Sans SC', sans-serif;
  background-color: var(--primary-bg);
  color: var(--text-primary);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* 标题字体 */
h1, h2, h3, h4 {
  font-family: 'Source Han Serif', 'Noto Serif SC', serif;
  font-weight: 600;
}

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

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

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 400;
  transition: color 0.3s ease;
}

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

/* 主容器 */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 6rem 2rem 2rem;
  min-height: 100vh;
}

/* 轮播图容器 */
.carousel {
  position: relative;
  width: 100%;
  height: 70vh;
  margin-bottom: 4rem;
  overflow: hidden;
}

.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;
  filter: contrast(0.95) brightness(0.98);
}

.carousel-caption {
  position: absolute;
  bottom: 3rem;
  left: 3rem;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  max-width: 50%;
}

.carousel-caption h2 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

/* 卡片区 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.card:hover {
  transform: scale(1.02);
}

.card img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  filter: contrast(0.95) brightness(0.98);
}

.card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  color: white;
  padding: 2rem;
}

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

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

.waterfall-item img {
  width: 100%;
  height: auto;
  filter: contrast(0.95) brightness(0.98);
  transition: transform 0.3s ease;
}

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

.waterfall-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  color: white;
  padding: 1rem;
}

/* 时间轴 */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent-brown);
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  margin-bottom: 4rem;
  display: flex;
  align-items: center;
}

.timeline-item:nth-child(odd) {
  flex-direction: row-reverse;
}

.timeline-content {
  flex: 1;
  padding: 2rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin: 0 2rem;
}

.timeline-dot {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  background: var(--accent-brown);
  border-radius: 50%;
  border: 4px solid var(--primary-bg);
}

.timeline img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  filter: contrast(0.95) brightness(0.98);
  border-radius: 8px;
  margin-bottom: 1rem;
}

/* 筛选标签 */
.filter-tags {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.tag {
  padding: 0.5rem 1.5rem;
  background: var(--secondary-bg);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
}

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

/* 图文交错布局 */
.content-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  margin-bottom: 4rem;
}

.content-block:nth-child(even) {
  direction: rtl;
}

.content-block img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  filter: contrast(0.95) brightness(0.98);
  border-radius: 8px;
}

.content-text {
  padding: 2rem;
  direction: ltr;
}

/* 返回顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--accent-dark);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--accent-brown);
}

/* 页脚 */
footer {
  margin-top: 6rem;
  padding: 3rem 2rem;
  text-align: center;
  border-top: 0.5px solid rgba(0, 0, 0, 0.1);
}

footer p {
  margin: 0.5rem 0;
  color: var(--text-secondary);
}

/* 水印 */
.watermark::after {
  content: '風';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
  font-size: 8rem;
  color: rgba(0, 0, 0, 0.03);
  pointer-events: none;
  z-index: 1;
}

/* 页面切换动画 */
.page-transition {
  animation: fadeIn 0.8s ease-in-out;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
  .nav-links {
    flex-direction: column;
    gap: 1rem;
  }
  
  .carousel-caption h2 {
    font-size: 1.8rem;
  }
  
  .carousel-caption {
    left: 1rem;
    bottom: 1rem;
    max-width: 80%;
  }
  
  .waterfall {
    columns: 2;
  }
  
  .timeline::before {
    left: 30px;
  }
  
  .timeline-item,
  .timeline-item:nth-child(odd) {
    flex-direction: row;
  }
  
  .timeline-content {
    margin-left: 60px;
  }
  
  .timeline-dot {
    left: 30px;
  }
  
  .content-block {
    grid-template-columns: 1fr;
  }
  
  .content-block:nth-child(even) {
    direction: ltr;
  }
}

@media (max-width: 480px) {
  .waterfall {
    columns: 1;
  }
  
  .card-grid {
    grid-template-columns: 1fr;
  }
  
  .filter-tags {
    justify-content: center;
  }
}

/* 禁止右键菜单 */
img {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  pointer-events: none;
}

/* 图片颗粒效果 */
.grain-effect {
  position: relative;
}

.grain-effect::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 2px,
      rgba(255, 255, 255, 0.03) 2px,
      rgba(255, 255, 255, 0.03) 4px
    );
  pointer-events: none;
  z-index: 1;
}