* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html, body {
  width: 100%;
  height: 100%;
  font-family: system-ui, sans-serif;
  transition: background 0.4s ease-out, color 0.4s ease-out; /* 优化过渡曲线 */
  -webkit-font-smoothing: antialiased; /* 文字抗锯齿 */
  -webkit-overflow-scrolling: touch; /* 移动端弹性滚动 */
}

html.dark {
  background: #101010;
  color: #fff;
}
html.light {
  background: #ffffff;
  color: #111;
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease-out, background 0.3s ease-out; /* 拆分过渡属性 */
  will-change: opacity, background; /* 告诉浏览器预渲染优化 */
}
html.light .navbar {
  background: rgba(255,255,255,0.85);
}
.navbar.show {
  opacity: 1;
}

.logo-img {
  height: 36px;
  width: auto;
  transition: opacity 0.2s ease; /* LOGO切换添加过渡 */
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 24px;
}
.nav-menu a {
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  position: relative;
}
html.light .nav-menu a {
  color: #111;
}
/* 导航链接添加hover动画（优化交互流畅度） */
.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width 0.2s ease;
}
.nav-menu a:hover::after {
  width: 100%;
}

#themeToggle {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: inherit;
  padding: 8px; /* 扩大点击区域（适配移动端） */
  border-radius: 50%; /* 圆形点击区域 */
  transition: background 0.2s ease;
  touch-action: manipulation; /* 禁用移动端双击缩放 */
}
#themeToggle:hover {
  background: rgba(255,255,255,0.1);
}
html.light #themeToggle:hover {
  background: rgba(0,0,0,0.05);
}

.scroll-container {
  width: 100vw;
  height: 100vh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth; /* 全局平滑滚动（替代JS的behavior） */
  -webkit-scroll-snap-type: y mandatory; /* 兼容iOS */
}
.page {
  width: 100%;
  height: 100vh;
  scroll-snap-align: start;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  will-change: transform; /* 预渲染优化 */
}

.video-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}
video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none; /* 避免视频拦截点击事件 */
}

.hero-img {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.75);
  object-fit: contain;
  pointer-events: none;
  will-change: transform; /* 优化缩放动画 */
}

.hero-text {
  position: relative;
  z-index: 2;
}

#page2, #page3, #page4 {
  background: transparent !important;
}

.tool-list {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  margin-top: 40px;
  padding: 0 20px; /* 移动端左右内边距 */
}
.tool-item {
  position: relative;
  width: 270px;
  height: 370px;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  transition: all 0.25s ease-out; /* 优化过渡曲线 */
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: translateZ(0); /* 硬件加速 */
  will-change: transform, box-shadow; /* 预渲染 */
}
.tool-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s ease;
}
.tool-item:hover img {
  opacity: 0.95;
}
.tool-title {
  position: absolute;
  top: 12px;
  left: 14px;
  font-size: 16px;
  color: #fff;
  z-index: 2;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
.tool-item:hover {
  transform: translateY(-6px) translateZ(0); /* 硬件加速 */
  box-shadow: 0 12px 28px rgba(0,0,0,0.25);
}

/* 社交头像样式 */
.social-avatar {
  margin: 20px 0;
  text-align: center;
}
.avatar-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: transform 0.2s ease, opacity 0.2s ease;
  opacity: 1;
}
.avatar-img:hover {
  transform: scale(1.05);
}
html.light .avatar-img {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* 社交图片按钮样式 */
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 30px; /* 增大间距 */
  justify-content: center;
  margin-top: 30px;
  padding: 0 20px;
}
.social-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease-out;
  transform: translateZ(0); /* 硬件加速 */
}
.social-img {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  transition: box-shadow 0.2s ease, opacity 0.2s ease;
  opacity: 1;
}
.social-name {
  font-size: 14px;
  margin-top: 4px;
}
/* hover 效果 */
.social-item:hover {
  transform: translateY(-6px) translateZ(0);
}
.social-item:hover .social-img {
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}
/* 浅色模式适配 */
html.light .social-img {
  box-shadow: 0 3px 10px rgba(0,0,0,0.06);
}
html.light .social-item:hover .social-img {
  box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

.vision-text {
  font-size: 20px;
  line-height: 1.8;
  margin-top: 20px;
  padding: 0 20px;
  max-width: 800px;
}

.footer-icp {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.5);
  font-size: 13px;
  scroll-snap-align: start;
  text-decoration: none;
  transition: color 0.2s ease;
}
html.light .footer-icp {
  color: rgba(0,0,0,0.5);
}

/* 移动端样式：保持工具项原有高度 */
@media (max-width:768px) {
  .navbar {
    opacity: 1 !important;
  }
  .tool-item {
    height: 180px; 
    transition: height 0.2s ease-out, all 0.25s ease-out; /* 添加高度过渡 */
  }
  /* 移动端优化点击区域 */
  .nav-menu {
    gap: 16px;
  }
  .nav-menu a {
    font-size: 14px;
    padding: 4px 0;
  }
  #themeToggle {
    font-size: 18px;
  }
  /* 社交区域移动端适配 */
  .avatar-img {
    width: 100px;
    height: 100px;
  }
  .social-img {
    width: 70px;
    height: 70px;
  }
  .social-links {
    gap: 20px;
  }
}

/* 修复iOS滚动卡顿 */
@supports (-webkit-touch-callout: none) {
  .scroll-container {
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
  }
}