/* 全局样式设置 */
:root {
  --color-primary: #1a1a1a;
  --color-secondary: #4a4a4a;
  --bg-color: #ffffff;
}

body {
  font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  color: var(--color-primary);
  background-color: var(--bg-color);
  overflow-x: hidden;
}

/* 隐藏横向滚动条 */
body::-webkit-scrollbar {
  width: 6px;
}
body::-webkit-scrollbar-track {
  background: transparent;
}
body::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}

/* 自定义选中文本颜色 */
::selection {
  background: #f3f4f6;
  color: #111827;
}

/* 关键帧动画 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

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

/* 动画工具类 */
.animate-fade-in {
  animation: fadeIn 1.2s ease-out forwards;
}

.animate-slide-up {
  opacity: 0; /* 初始隐藏 */
  animation: slideUp 1s ease-out forwards;
}

.animate-slide-down {
  animation: slideDown 0.8s ease-out forwards;
}

.animate-scale {
  animation: gentleScale 20s ease-in-out infinite alternate;
}

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

/* 交互效果 */
.hover-reveal-container {
  overflow: hidden;
  position: relative;
}

.hover-reveal-img {
  transition: transform 0.8s cubic-bezier(0.2, 1, 0.3, 1), opacity 0.5s ease;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

/* 导航链接动效 */
.nav-link {
  position: relative;
  padding-bottom: 2px;
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: 0;
  left: 0;
  background-color: currentColor;
  transition: width 0.3s ease-out;
}

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

/* 文本排版优化 */
.tracking-widest-plus {
  letter-spacing: 0.2em;
}

/* 图片遮罩层 */
.image-overlay {
  background: linear-gradient(to top, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0) 40%);
}

/* 加载占位符 */
.image-placeholder {
  background-color: #f3f4f6;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .7; }
}