@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

@layer base {
  * {
    @apply border-gray-200;
  }

  html {
    scroll-behavior: smooth;
  }

  body {
    @apply font-sans text-gray-900 bg-white;
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 300;
    line-height: 1.6;
  }

  h1, h2, h3, h4, h5, h6 {
    @apply font-medium tracking-tight;
  }

  h1 {
    @apply text-4xl md:text-5xl;
  }

  h2 {
    @apply text-3xl md:text-4xl;
  }

  h3 {
    @apply text-2xl md:text-3xl;
  }
}

@layer components {
  .nav-fixed {
    @apply fixed top-0 left-0 right-0 z-50 transition-all duration-300;
  }

  .nav-transparent {
    @apply bg-transparent;
  }

  .nav-solid {
    @apply bg-white/95 backdrop-blur-md shadow-sm;
  }

  .btn-primary {
    @apply px-6 py-2 bg-gray-900 text-white rounded-sm transition-all duration-200 hover:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-gray-900 focus:ring-offset-2;
  }

  .btn-secondary {
    @apply px-6 py-2 border border-gray-900 text-gray-900 rounded-sm transition-all duration-200 hover:bg-gray-900 hover:text-white focus:outline-none focus:ring-2 focus:ring-gray-900 focus:ring-offset-2;
  }

  .card-hover {
    @apply transition-all duration-300 hover:scale-105 hover:shadow-xl;
  }

  .image-lazy {
    @apply opacity-0 transition-opacity duration-500;
  }

  .image-loaded {
    @apply opacity-100;
  }

  .text-overlay {
    @apply absolute inset-0 flex items-center justify-center bg-black/40 text-white;
  }

  .fade-in {
    animation: fadeIn 0.6s ease-in-out;
  }

  .slide-up {
    animation: slideUp 0.6s ease-out;
  }

  .scroll-indicator {
    @apply absolute bottom-8 left-1/2 transform -translate-x-1/2 text-white animate-bounce;
  }
}

@layer utilities {
  .container-custom {
    @apply max-w-7xl mx-auto px-4 sm:px-6 lg:px-8;
  }

  .aspect-widescreen {
    aspect-ratio: 16 / 9;
  }

  .aspect-portrait {
    aspect-ratio: 4 / 5;
  }

  .text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  .backdrop-blur-custom {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}

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

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

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  @apply bg-gray-100;
}

::-webkit-scrollbar-thumb {
  @apply bg-gray-400 rounded-sm;
}

::-webkit-scrollbar-thumb:hover {
  @apply bg-gray-500;
}

/* 响应式字体 */
@media (max-width: 640px) {
  h1 {
    @apply text-3xl;
  }
  
  h2 {
    @apply text-2xl;
  }
  
  h3 {
    @apply text-xl;
  }
}

/* 无障碍支持 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 焦点样式 */
.focus-visible:focus {
  @apply outline-none ring-2 ring-gray-900 ring-offset-2;
}

/* 选择文本样式 */
::selection {
  @apply bg-gray-900 text-white;
}

::-moz-selection {
  @apply bg-gray-900 text-white;
}