/* 全局重置与基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: #FFFFFF;
  color: #333333;
  line-height: 1.6;
  overflow-x: hidden;
}

/* 导航栏样式 */
.nav-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-link {
  position: relative;
  transition: all 0.3s ease;
}

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

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

/* 图片容器样式 */
.image-container {
  position: relative;
  overflow: hidden;
  background-color: #F8F8F8;
}

.image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-container:hover img {
  transform: scale(1.03);
}

/* 卡片悬停效果 */
.hover-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* 文字渐入动画 */
.fade-in {
  opacity: 0;
  animation: fadeIn 1s ease-in forwards;
}

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

/* 网格布局 */
.masonry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

/* 响应式断点 */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }

  .masonry-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .nav-container {
    padding: 1rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .masonry-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1025px) {
  .masonry-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 加载动画 */
.loading-line {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #333333, #999999);
  animation: loading 2s ease-in-out infinite;
  z-index: 9999;
}

@keyframes loading {
  0% {
    width: 0;
    left: 0;
  }
  50% {
    width: 100%;
    left: 0;
  }
  100% {
    width: 0;
    left: 100%;
  }
}

/* 页脚样式 */
footer {
  border-top: 1px solid #F8F8F8;
  color: #999999;
  font-size: 0.875rem;
}

/* 懒加载占位 */
img[data-src] {
  filter: blur(10px);
  transition: filter 0.3s;
}

img[data-src].loaded {
  filter: blur(0);
}

/* 焦点可访问性 */
*:focus-visible {
  outline: 2px solid #333333;
  outline-offset: 4px;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #F8F8F8;
}

::-webkit-scrollbar-thumb {
  background: #CCCCCC;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #999999;
}

/* 自定义类 */
.section-spacing {
  padding: 6rem 1rem;
}

.content-max-width {
  max-width: 1400px;
  margin: 0 auto;
}

.text-balance {
  text-wrap: balance;
}