/* 
 * 全局样式文件 - 视觉系统与动画 
 * 遵循现代、简约、高雅的设计原则
 */

/* 引入字体资源：Playfair Display (标题), Lato (正文), Noto Serif SC (中文衬线) */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&family=Noto+Serif+SC:wght@300;400;600&family=Playfair+Display:ital,wght@0,400;0,600;1,400&display=swap');

/* 自定义 CSS 变量系统 */
:root {
  --color-bg: #FAFAFA;       /* 极简白/米白 */
  --color-text: #1A1A1A;     /* 深灰黑 */
  --color-accent: #D4A373;   /* 陶土色辅助 */
  --color-muted: #8E8E8E;    /* 柔和灰 */
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Lato', sans-serif;
  --font-cn: 'Noto Serif SC', serif;
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
}

/* 基础设置 */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  overflow-x: hidden; /* 防止水平滚动 */
}

/* 字体工具类 */
.font-heading {
  font-family: var(--font-heading);
}

.font-body {
  font-family: var(--font-body);
}

.font-cn {
  font-family: var(--font-cn);
}

/* 极简滚动条 */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #E5E5E5;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #D1D1D1;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes imageScale {
  from { transform: scale(1.1); }
  to { transform: scale(1); }
}

/* 动画工具类 */
.animate-fade-in-up {
  animation: fadeInUp 1.2s var(--ease-out-expo) forwards;
}

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

/* 延迟类 */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-500 { animation-delay: 500ms; }

/* 导航链接动效 */
.nav-link {
  position: relative;
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: -4px;
  left: 50%;
  background-color: currentColor;
  transition: all 0.4s var(--ease-out-expo);
  transform: translateX(-50%);
}

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

/* 图片容器与悬停效果 */
.img-container {
  overflow: hidden;
  position: relative;
}

.img-hover-scale {
  transition: transform 1.2s var(--ease-out-expo);
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

/* 蒙层与文字揭示 */
.hover-overlay {
  background: rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: opacity 0.5s ease;
}

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

/* 瀑布流布局 (Masonry) */
.masonry-grid {
  column-count: 1;
  column-gap: 2rem;
}

@media (min-width: 640px) {
  .masonry-grid {
    column-count: 2;
  }
}

@media (min-width: 1024px) {
  .masonry-grid {
    column-count: 3;
  }
}

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

/* 故事页杂志排版 */
.drop-cap::first-letter {
  font-family: var(--font-heading);
  float: left;
  font-size: 4rem;
  line-height: 0.8;
  padding-right: 1rem;
  padding-top: 0.5rem;
  color: var(--color-text);
}

/* 轮播图渐变过渡 */
.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
  z-index: 1;
}

.hero-slide.active {
  opacity: 1;
  z-index: 2;
}

.hero-slide.active img {
  animation: imageScale 8s ease-out forwards;
}

/* 文本选择颜色，增强艺术感 */
::selection {
  background: #EBEBEB; /* 极淡灰 */
  color: #000;
}

/* 隐藏元素的辅助类 */
.opacity-0-forced {
  opacity: 0 !important;
}