/* 全局配置 */
:root {
  --color-primary: #2c2c2c;
  --color-secondary: #6b6b6b;
  --color-bg: #f7f7f5;
  --color-accent: #8b7355;
  --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.2s ease;
}

* {
  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;
  background-color: var(--color-bg);
  color: var(--color-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 导航栏玻璃态效果 */
nav {
  backdrop-filter: blur(10px) saturate(180%);
  -webkit-backdrop-filter: blur(10px) saturate(180%);
  background-color: rgba(247, 247, 245, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  transition: var(--transition-smooth);
}

nav a {
  position: relative;
  transition: var(--transition-fast);
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 0;
  height: 1px;
  background-color: var(--color-primary);
  transition: var(--transition-smooth);
  transform: translateX(-50%);
}

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

/* 轮播图容器 */
.carousel-container {
  position: relative;
  height: 100vh;
  width: 100%;
}

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

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

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

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

.carousel-dots {
  position: absolute;
  bottom: 5%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 10;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.carousel-dot:hover {
  background-color: rgba(255, 255, 255, 0.8);
  transform: scale(1.2);
}

.carousel-dot.active {
  background-color: white;
  transform: scale(1.3);
}

/* 图片悬停效果 */
.image-hover-container {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.image-hover-container img {
  transition: var(--transition-smooth);
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-hover-container:hover img {
  transform: scale(1.05);
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent 60%, rgba(0, 0, 0, 0.6));
  opacity: 0;
  transition: var(--transition-smooth);
  display: flex;
  align-items: flex-end;
  padding: 2rem;
}

.image-hover-container:hover .image-overlay {
  opacity: 1;
}

.image-overlay-text {
  color: white;
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 0.05em;
}

/* 懒加载占位 */
.lazy-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;
  }
}

/* 返回顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 48px;
  height: 48px;
  background-color: var(--color-primary);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition-smooth);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  background-color: var(--color-accent);
  transform: translateY(-4px);
}

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

.masonry-item {
  break-inside: avoid;
  margin-bottom: 1.5rem;
}

/* 响应式 */
@media (max-width: 1200px) {
  .masonry-grid {
    column-count: 2;
  }
  
  .carousel-caption {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .masonry-grid {
    column-count: 1;
  }
  
  .carousel-caption {
    font-size: 1.5rem;
    bottom: 15%;
  }
  
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }
}

/* 页面过渡效果 */
.fade-in {
  animation: fadeIn 0.8s ease-in;
}

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

/* 滚动视差效果 */
.parallax {
  transition: transform 0.3s ease-out;
}

/* 页脚样式 */
footer {
  font-size: 0.875rem;
  color: var(--color-secondary);
  letter-spacing: 0.1em;
  margin-top: 4rem;
}