/* Google Fonts - 引入思源黑体(标题)与思源宋体(正文) */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&family=Noto+Serif+SC:wght@200;300;400;600&display=swap');

/* 全局基础设置 */
:root {
  --font-serif: 'Noto Serif SC', 'Songti SC', serif;
  --font-sans: 'Noto Sans SC', 'PingFang SC', sans-serif;
  --color-text-main: #1a1a1a;
  --color-bg-body: #ffffff;
  --transition-smooth: 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-serif);
  background-color: var(--color-bg-body);
  color: var(--color-text-main);
  overflow-x: hidden; /* 防止横向溢出 */
  line-height: 1.75; /* 增加行高提升阅读体验 */
}

/* 标题字体系统 */
h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: var(--font-sans);
  letter-spacing: -0.02em;
}

/* 实用工具类：隐藏滚动条但保留滚动功能 (用于水平导航) */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* 文本排版优化 */
.text-justify-custom {
  text-align: justify;
  text-justify: inter-ideograph;
}

/* Webkit 滚动条美化 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #d4d4d4;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #a3a3a3;
}

/* 动画：向上渐显 */
.fade-in-up {
  opacity: 0;
  transform: translateY(40px);
  animation: fadeInUp 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 动画：微弱缩放 (用于背景图) */
@keyframes subtleZoom {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}
.animate-subtle-zoom {
  animation: subtleZoom 20s ease-in-out infinite alternate;
}

/* 动画延迟工具类 */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-500 { animation-delay: 0.5s; }
.delay-700 { animation-delay: 0.7s; }

/* 交互：图片悬停微放大效果 */
.hover-zoom-container {
  overflow: hidden;
  position: relative;
  display: block;
}

.hover-zoom-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1);
  will-change: transform;
}

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

/* 交互：图片遮罩文字 */
.hover-overlay-text {
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.5s ease;
}
.hover-zoom-container:hover .hover-overlay-text {
  opacity: 1;
}

/* 交互：导航下划线动效 */
.nav-link-hover {
  position: relative;
  text-decoration: none;
}
.nav-link-hover::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: -4px;
  left: 50%;
  background-color: currentColor;
  transition: width 0.3s ease, left 0.3s ease;
}
.nav-link-hover:hover::after {
  width: 100%;
  left: 0;
}

/* 选中状态 */
.nav-link-active {
  position: relative;
}
.nav-link-active::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 1px;
  bottom: -4px;
  left: 0;
  background-color: currentColor;
}

/* 文本选中样式 */
::selection {
  background: #f3f3f3;
  color: #000;
  text-shadow: none;
}

/* 视觉：大留白辅助 */
.section-padding {
  padding-top: 8rem;
  padding-bottom: 8rem;
}

@media (max-width: 768px) {
  .section-padding {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
}