/* 全局基础设置 */
:root {
  --color-text-main: #1a1a1a;
  --color-text-sub: #4b5563;
  --bg-primary: #ffffff;
}

body {
  font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--color-text-main);
  background-color: var(--bg-primary);
  overflow-x: hidden; /* 防止水平滚动 */
}

/* 页面加载淡入动画 */
.page-fade-in {
  animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: translateY(15px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 导航链接动效 */
.nav-link {
  position: relative;
  display: inline-block;
  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-in-out;
}

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

/* 移动端菜单过渡 */
#mobile-menu {
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform-origin: top;
}

/* 图片交互效果 */
.img-container {
  overflow: hidden;
  position: relative;
}

.img-hover-scale {
  transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.5s ease;
  will-change: transform;
}

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

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

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

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

::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* 辅助工具类 */
.text-balance {
  text-wrap: balance;
}

.glass-effect {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
}