/* Tailwind CSS 配置 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #333;
  line-height: 1.6;
  overflow-x: hidden;
}

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
}

/* 导航栏样式 */
.nav-transparent {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* 图片悬停效果 */
.hover-scale {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-scale:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* 图片叠加层 */
.image-overlay {
  position: relative;
  overflow: hidden;
}

.image-overlay::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
  pointer-events: none;
}

.image-overlay:hover::after {
  background: rgba(0, 0, 0, 0.2);
}

/* 页面过渡动画 */
.fade-in {
  animation: fadeIn 0.6s ease-in;
}

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

/* 向下滚动指示箭头 */
.scroll-indicator {
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* 导航链接悬停效果 */
.nav-link {
  position: relative;
  transition: color 0.3s ease;
}

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

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

/* 固定侧边栏导航 */
.sidebar-nav {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 2px;
}

/* 侧边栏链接样式 */
.sidebar-link {
  transition: all 0.3s ease;
  border-left: 2px solid transparent;
}

.sidebar-link:hover,
.sidebar-link.active {
  color: #333;
  border-left-color: #333;
  padding-left: 1rem;
}

/* 图片网格布局 */
.grid-masonry {
  column-count: 3;
  column-gap: 1.5rem;
}

.grid-masonry > div {
  break-inside: avoid;
  margin-bottom: 1.5rem;
}

/* 响应式布局 */
@media (max-width: 1024px) {
  .grid-masonry {
    column-count: 2;
  }
}

@media (max-width: 640px) {
  .grid-masonry {
    column-count: 1;
  }
  
  .sidebar-nav {
    position: relative;
    top: 0;
    max-height: none;
  }
}

/* 图片加载优化 */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 懒加载占位 */
img[loading="lazy"] {
  background: #f5f5f5;
  min-height: 400px;
}

/* 页脚样式 */
footer {
  font-size: 0.875rem;
  color: #999;
  letter-spacing: 0.05em;
}

/* 标题样式 */
h1, h2, h3 {
  font-weight: 300;
  letter-spacing: 0.02em;
}

/* 段落样式 */
p {
  max-width: 65ch;
  line-height: 1.8;
}

/* 全屏区域 */
.full-height {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* 内容容器 */
.content-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* 图片弹窗 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #333;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 色彩渐变背景 */
.gradient-bg {
  background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 50%, #f5f5f5 100%);
}

/* 文字阴影 */
.text-shadow {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 卡片样式 */
.card {
  background: white;
  border-radius: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* 分隔线 */
.divider {
  width: 60px;
  height: 1px;
  background: #333;
  margin: 2rem auto;
}

/* 无障碍优化 */
:focus-visible {
  outline: 2px solid #333;
  outline-offset: 4px;
}

/* 打印样式 */
@media print {
  .nav-transparent,
  footer {
    display: none;
  }
}