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

/* Tailwind配置 */
@layer base {
  :root {
    --color-moon-white: #F8F9FA;
    --color-gravel-gray: #E9ECEF;
    --color-terracotta-pink: #E0B0A0;
    --color-oat: #D8C3A5;
    --color-graphite-black: #212529;
    --color-haze-blue: #6C757D;
    --color-deep-gray: #343A40;
    --spacing-base: 60px;
    --spacing-section: 100px;
  }
}

/* 全局字体与颜色 */
body {
  font-family: 'Inter', 'Helvetica Neue', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--color-moon-white);
  color: var(--color-deep-gray);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 标题层级 */
h1 { font-size: 40px; font-weight: 600; letter-spacing: -0.02em; }
h2 { font-size: 32px; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 24px; font-weight: 500; }
p { font-size: 16px; line-height: 1.8; }
small { font-size: 14px; color: var(--color-haze-blue); }

/* 链接样式 */
a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--color-haze-blue);
}

/* 图片优化 */
img {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* 导航栏 */
.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 60px;
  background-color: var(--color-moon-white);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background-color: rgba(248, 249, 250, 0.95);
}

.nav-logo {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

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

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

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

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

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

.carousel-caption {
  position: absolute;
  bottom: 80px;
  right: 80px;
  color: white;
  font-size: 32px;
  font-weight: 500;
  text-shadow: 0 2px 12px rgba(0,0,0,0.3);
  text-align: right;
}

.carousel-indicators {
  position: absolute;
  bottom: 40px;
  right: 80px;
  display: flex;
  gap: 12px;
}

.carousel-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-indicator.active {
  background-color: white;
  width: 24px;
  border-radius: 4px;
}

/* 卡片悬停效果 */
.hover-scale {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

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

/* 区块间距 */
.section-spacing {
  padding: var(--spacing-section) var(--spacing-base);
}

.element-spacing {
  margin-bottom: var(--spacing-base);
}

/* 网格布局 */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
}

/* 过滤标签 */
.filter-tabs {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 60px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 12px 32px;
  background-color: transparent;
  border: 1px solid var(--color-gravel-gray);
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
  color: var(--color-deep-gray);
}

.filter-tab:hover,
.filter-tab.active {
  background-color: var(--color-deep-gray);
  color: white;
  border-color: var(--color-deep-gray);
}

/* 页脚 */
.footer-container {
  text-align: center;
  padding: 48px 0;
  border-top: 1px solid var(--color-gravel-gray);
  margin-top: var(--spacing-section);
  color: var(--color-haze-blue);
}

/* 响应式设计 - 平板 */
@media (max-width: 1024px) {
  .nav-container {
    padding: 20px 40px;
  }
  
  .carousel-caption {
    bottom: 60px;
    right: 40px;
    font-size: 28px;
  }
  
  .section-spacing {
    padding: 80px 40px;
  }
  
  .nav-links {
    gap: 32px;
  }
}

/* 响应式设计 - 手机 */
@media (max-width: 768px) {
  h1 { font-size: 32px; }
  h2 { font-size: 28px; }
  h3 { font-size: 20px; }
  
  .nav-container {
    padding: 16px 24px;
    flex-direction: column;
    gap: 16px;
  }
  
  .nav-links {
    gap: 24px;
    font-size: 14px;
  }
  
  .carousel-caption {
    bottom: 40px;
    right: 24px;
    left: 24px;
    font-size: 24px;
  }
  
  .carousel-indicators {
    right: 24px;
  }
  
  .section-spacing {
    padding: 60px 24px;
  }
  
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  
  .filter-tabs {
    gap: 16px;
  }
  
  .filter-tab {
    padding: 10px 24px;
    font-size: 14px;
  }
}

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

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

/* 图片懒加载占位 */
.image-placeholder {
  background: linear-gradient(90deg, var(--color-gravel-gray) 0%, var(--color-moon-white) 50%, var(--color-gravel-gray) 100%);
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
}

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

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-moon-white);
}

::-webkit-scrollbar-thumb {
  background: var(--color-gravel-gray);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-haze-blue);
}