/* 自定义CSS变量 */
:root {
  --color-primary: #2c3e50;
  --color-secondary: #95a5a6;
  --color-accent: #8b6f47;
  --color-olive: #556b2f;
  --color-terracotta: #a0522d;
  --color-light: #f5f5f5;
  --color-dark: #1a1a1a;
  --transition-slow: 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--color-primary);
  background-color: #ffffff;
  line-height: 1.6;
  overflow-x: hidden;
}

/* 自定义动画 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes expand {
  from { transform: scale(0.95); }
  to { transform: scale(1); }
}

/* 动画类 */
.animate-fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
}

.animate-fade-in {
  animation: fadeIn 1s ease-out forwards;
}

.animate-slide-left {
  animation: slideInLeft 0.6s ease-out forwards;
}

.animate-slide-right {
  animation: slideInRight 0.6s ease-out forwards;
}

.animate-expand {
  animation: expand 0.5s ease-out forwards;
}

/* 导航栏样式 */
.nav-transparent {
  background-color: rgba(255, 255, 255, 0);
  backdrop-filter: blur(0px);
  transition: all var(--transition-normal);
}

.nav-solid {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* 英雄区块 */
.hero-overlay {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.1) 100%);
}

/* 图片悬停效果 */
.image-hover {
  overflow: hidden;
  position: relative;
}

.image-hover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-normal);
  z-index: 1;
}

.image-hover:hover::before {
  opacity: 1;
}

.image-hover img {
  transition: transform 0.6s ease;
}

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

/* 卡片悬停效果 */
.card-hover {
  transition: all var(--transition-normal);
}

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

/* 按钮样式 */
.btn-primary {
  background-color: var(--color-primary);
  color: white;
  padding: 12px 30px;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: all var(--transition-normal);
  font-weight: 300;
  letter-spacing: 0.5px;
}

.btn-primary:hover {
  background-color: var(--color-secondary);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-primary);
  padding: 12px 30px;
  border: 1px solid var(--color-primary);
  border-radius: 2px;
  cursor: pointer;
  transition: all var(--transition-normal);
  font-weight: 300;
}

.btn-secondary:hover {
  background-color: var(--color-primary);
  color: white;
}

/* 瀑布流布局 */
.masonry-grid {
  column-count: 3;
  column-gap: 24px;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 24px;
}

/* 弹窗样式 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.modal.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background-color: white;
  max-width: 90%;
  max-height: 90%;
  overflow: auto;
  position: relative;
  transform: scale(0.9);
  transition: transform var(--transition-normal);
}

.modal.active .modal-content {
  transform: scale(1);
}

/* 放大镜效果 */
.magnifier {
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
}

.magnifier-lens {
  position: absolute;
  border: 2px solid white;
  border-radius: 50%;
  width: 150px;
  height: 150px;
  display: none;
  pointer-events: none;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

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

@media (max-width: 768px) {
  .masonry-grid {
    column-count: 1;
  }
  
  .modal-content {
    max-width: 95%;
    max-height: 95%;
  }
  
  .btn-primary,
  .btn-secondary {
    padding: 10px 20px;
    font-size: 14px;
  }
}

@media (max-width: 640px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  
  .magnifier-lens {
    width: 100px;
    height: 100px;
  }
}

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

::-webkit-scrollbar-track {
  background: var(--color-light);
}

::-webkit-scrollbar-thumb {
  background: var(--color-secondary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-light);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 延迟动画类 */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }