/* 全局变量定义 */
:root {
  --color-primary: #1a1a1a;
  --color-secondary: #f5f5f5;
  --color-accent: #e8e8e8;
  --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC', sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基础样式重置 */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

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

/* 图片加载优化 */
img {
  max-width: 100%;
  height: auto;
  display: block;
  transition: var(--transition-smooth);
}

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

a:hover {
  opacity: 0.8;
}

/* 导航栏样式 */
.nav-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-accent);
}

.nav-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 300;
  letter-spacing: 0.1em;
}

.nav-menu {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  position: relative;
  cursor: pointer;
}

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

.nav-link:hover::after {
  width: 100%;
}

/* 全屏页面样式 */
.fullscreen-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hero-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.4) 100%);
  z-index: 0;
}

.hero-content {
  text-align: center;
  color: white;
  z-index: 1;
  padding: 2rem;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 200;
  letter-spacing: 0.15em;
  margin-bottom: 1rem;
  animation: fadeInUp 1s ease;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 300;
  letter-spacing: 0.1em;
  opacity: 0.9;
  animation: fadeInUp 1s ease 0.2s backwards;
}

/* 网格布局 */
.grid-container {
  display: grid;
  gap: 1.5rem;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--color-secondary);
  border-radius: 4px;
}

.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

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

.grid-item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  color: white;
  padding: 1.5rem;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.grid-item:hover .grid-item-overlay {
  transform: translateY(0);
}

/* 不对称拼贴布局 */
.masonry-container {
  columns: 3 280px;
  column-gap: 1.5rem;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

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

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

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

/* 宝丽来相片样式 */
.polaroid-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.polaroid-item {
  background: white;
  padding: 1rem 1rem 3rem 1rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  transform: rotate(-2deg);
  transition: transform 0.3s ease;
}

.polaroid-item:nth-child(even) {
  transform: rotate(1deg);
}

.polaroid-item:hover {
  transform: rotate(0deg) scale(1.05);
}

.polaroid-item img {
  width: 100%;
  height: auto;
  margin-bottom: 1rem;
}

.polaroid-caption {
  font-size: 0.85rem;
  color: #666;
  text-align: center;
  font-style: italic;
}

/* 页脚样式 */
footer {
  background-color: var(--color-primary);
  color: var(--color-secondary);
  text-align: center;
  padding: 2rem;
  margin-top: 4rem;
}

/* 动画 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeInUp 0.8s ease;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .nav-menu {
    gap: 1.5rem;
  }
  
  .nav-link {
    font-size: 0.85rem;
  }
  
  .masonry-container {
    columns: 2 200px;
  }
  
  .grid-container {
    padding: 1rem;
    gap: 1rem;
  }
  
  .polaroid-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .nav-content {
    padding: 1rem;
  }
  
  .masonry-container {
    columns: 1;
  }
  
  .hero-title {
    font-size: 1.8rem;
  }
  
  .hero-subtitle {
    font-size: 0.95rem;
  }
}

/* 横向滚动容器 */
.horizontal-scroll {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 1rem;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.horizontal-scroll-item {
  flex: 0 0 auto;
  width: 400px;
  scroll-snap-align: start;
}

.horizontal-scroll-item img {
  width: 100%;
  height: 600px;
  object-fit: cover;
}

/* 隐藏滚动条但保持功能 */
.horizontal-scroll::-webkit-scrollbar {
  height: 8px;
}

.horizontal-scroll::-webkit-scrollbar-track {
  background: var(--color-accent);
}

.horizontal-scroll::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 4px;
}

/* 页面过渡 */
.page-transition {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.page-transition.active {
  opacity: 1;
  transform: translateY(0);
}