/* 全局字体设置：优先使用 HarmonyOS Sans SC 和 思源黑体 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@100;300;400;500;700&display=swap');

:root {
  --font-primary: "HarmonyOS Sans SC", "Noto Sans SC", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --transition-smooth: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: var(--font-primary);
  background-color: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased; /* macOS 字体平滑 */
  -moz-osx-font-smoothing: grayscale; /* Firefox 字体平滑 */
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

/* 极简滚动条 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #e5e5e5;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #d4d4d4;
}

/* 文本选区样式：极简黑白 */
::selection {
  background-color: rgba(0, 0, 0, 0.1);
  color: #000;
}

/* ----------------------------------------------------
   自定义动画 Keyframes
   ---------------------------------------------------- */

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

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

@keyframes subtleZoom {
  0% { transform: scale(1); }
  100% { transform: scale(1.03); }
}

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

/* ----------------------------------------------------
   实用动画类 (配合 Tailwind 使用)
   ---------------------------------------------------- */

.animate-fade-in {
  animation: fadeIn 1.5s var(--transition-smooth) forwards;
}

.animate-fade-up {
  animation: fadeInUp 1.2s var(--transition-smooth) forwards;
  opacity: 0;
}

.animate-subtle-zoom {
  animation: subtleZoom 10s ease-out forwards;
}

/* 动画延迟工具类 */
.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; }
.delay-1000 { animation-delay: 1s; }

/* ----------------------------------------------------
   交互细节
   ---------------------------------------------------- */

/* 导航链接下划线动效 */
.nav-link {
  position: relative;
  display: inline-block;
}
.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: -4px;
  left: 0;
  background-color: currentColor;
  transition: width 0.4s var(--transition-smooth);
}
.nav-link:hover::after {
  width: 100%;
}

/* 图片悬停容器 */
.img-hover-container {
  overflow: hidden;
  position: relative;
}
.img-hover-scale {
  transition: transform 0.8s var(--transition-smooth);
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.img-hover-container:hover .img-hover-scale {
  transform: scale(1.05);
}

/* 蒙层文字动效 */
.hover-reveal-text {
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.5s var(--transition-smooth);
}
.img-hover-container:hover .hover-reveal-text {
  opacity: 1;
  transform: translateY(0);
}

/* ----------------------------------------------------
   结构化组件辅助
   ---------------------------------------------------- */

/* 动态槽位预留样式 */
.slot-container {
  min-height: 100px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 视差效果辅助层 */
.parallax-bg {
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* 针对移动端的优化 */
@media (max-width: 768px) {
  .parallax-bg {
    background-attachment: scroll; /* 移动端性能优化，禁用 fixed */
  }
}