/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500&display=swap');

/* 设计令牌 */
:root {
  --primary-bg: #f8f5f2;
  --secondary-bg: #e8e2dc;
  --text-primary: #333333;
  --text-secondary: #666666;
  --border-color: #d4cfc7;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 全局重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--primary-bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

.logo {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
}

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

.nav-links a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 300;
  transition: var(--transition);
  position: relative;
}

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

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

/* 主内容区 */
.main-content {
  margin-top: 80px;
  min-height: calc(100vh - 160px);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* 轮播图 */
.carousel {
  position: relative;
  width: 100%;
  height: 80vh;
  min-height: 500px;
  overflow: hidden;
}

.carousel-inner {
  display: flex;
  transition: transform 0.5s ease;
  height: 100%;
}

.carousel-item {
  min-width: 100%;
  height: 100%;
  position: relative;
}

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

.carousel-indicators {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 1rem;
}

.indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: var(--transition);
}

.indicator.active {
  background: white;
  transform: scale(1.2);
}

/* 图片网格 */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.grid-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.grid-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

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

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

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

.masonry-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: var(--transition);
}

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

/* 筛选按钮 */
.filter-buttons {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.5rem 1.5rem;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-primary);
  border-radius: 24px;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 300;
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--text-primary);
  color: var(--primary-bg);
}

/* 灵感故事卡片 */
.story-card {
  margin-bottom: 3rem;
}

.story-title {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.story-description {
  font-weight: 300;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.story-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  scroll-behavior: smooth;
}

.story-scroll::-webkit-scrollbar {
  height: 6px;
}

.story-scroll::-webkit-scrollbar-track {
  background: var(--secondary-bg);
  border-radius: 3px;
}

.story-scroll::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.story-image {
  flex: 0 0 300px;
  height: 400px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
}

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

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

/* 模态框 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.show {
  display: flex;
  opacity: 1;
}

.modal-content {
  margin: auto;
  max-width: 90%;
  max-height: 90%;
  position: relative;
}

.modal-content img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

.modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}

/* 页脚 */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-weight: 300;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .nav-container {
    padding: 1rem;
  }

  .nav-links {
    gap: 1rem;
    font-size: 0.9rem;
  }

  .container {
    padding: 1rem;
  }

  .carousel {
    height: 60vh;
    min-height: 400px;
  }

  .image-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
  }

  .masonry {
    column-count: 2;
    column-gap: 1rem;
  }

  .story-scroll {
    gap: 0.5rem;
  }

  .story-image {
    flex: 0 0 250px;
    height: 350px;
  }
}

@media (max-width: 480px) {
  .nav-links {
    font-size: 0.8rem;
    gap: 0.5rem;
  }

  .carousel {
    height: 50vh;
    min-height: 300px;
  }

  .image-grid {
    grid-template-columns: 1fr;
  }

  .masonry {
    column-count: 1;
  }

  .filter-buttons {
    justify-content: center;
  }

  .story-image {
    flex: 0 0 200px;
    height: 300px;
  }
}

/* 页面标题 */
.page-title {
  font-size: 2.5rem;
  font-weight: 300;
  text-align: center;
  margin-bottom: 3rem;
  color: var(--text-primary);
}

/* 加载动画 */
.fade-in {
  animation: fadeIn 0.6s ease-in;
}

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