/* 自定义样式 - 现代化设计 */

/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans SC', sans-serif;
  overflow-x: hidden;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
  background: #D4AF37;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #f5c518;
}

/* 动画定义 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 1s ease-out;
}

.animate-fade-in {
  animation: fadeIn 0.8s ease-out;
}

/* 导航栏样式 */
#navbar {
  box-shadow: none;
}

/* 导航栏初始状态 - 在Hero区域（深色背景） */
.nav-text-color {
  color: white;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* 导航栏滚动后状态 - 在内容区域（白色背景） */
#navbar.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

#navbar.scrolled .nav-bg {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

#navbar.scrolled .nav-text-color {
  color: #2F1810;
  text-shadow: none;
}

#navbar.scrolled .nav-link:hover {
  color: #D4AF37;
}

/* 导航栏背景层 */
.nav-bg {
  transition: background 0.3s ease;
}

/* 导航链接下划线动画 */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #D4AF37;
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* 产品卡片样式 */
.product-card {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: white;
  transition: all 0.3s ease;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(139, 69, 19, 0.2);
}

.product-card img {
  width: 100%;
  height: 280px;
  object-fit: contain;
  background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
  transition: transform 0.5s ease;
}

.product-card:hover img {
  transform: scale(1.1);
}

.product-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(47, 24, 16, 0.9) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-end;
  padding: 1.5rem;
}

.product-card:hover .product-card-overlay {
  opacity: 1;
}

.product-card-title {
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.product-card:hover .product-card-title {
  transform: translateY(0);
}

/* 按钮激活状态 */
.filter-btn.active {
  background-color: #8B4513;
  color: white;
}

/* 图片懒加载占位 */
.lazy-image {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* 表单焦点效果 */
input:focus,
textarea:focus {
  border-color: #D4AF37 !important;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

/* 响应式调整 */
@media (max-width: 768px) {
  .product-card img {
    height: 200px;
  }
  
  section {
    padding: 3rem 0;
  }
}

/* 淡入动画类 */
.fade-in-section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 图片查看器 */
#lightbox {
  cursor: pointer;
  animation: fadeIn 0.3s ease;
}

#lightbox img {
  transition: transform 0.3s ease, opacity 0.3s ease;
  cursor: default;
}

/* 图片查看器导航按钮 */
#prev-img, #next-img {
  transition: all 0.3s ease;
}

#prev-img:hover, #next-img:hover {
  transform: translateY(-50%) scale(1.15);
  box-shadow: 0 8px 20px rgba(212, 175, 55, 0.4);
}

/* 关闭按钮悬停效果 */
#close-lightbox:hover {
  background-color: #f5c518;
  box-shadow: 0 8px 20px rgba(212, 175, 55, 0.4);
}

/* 移动端导航按钮 */
@media (max-width: 768px) {
  #prev-img, #next-img {
    width: 40px;
    height: 40px;
  }
  
  #prev-img:hover, #next-img:hover {
    transform: translateY(-50%) scale(1.1);
  }
}

/* 联系表单提交动画 */
.form-success {
  animation: successPulse 0.5s ease;
}

@keyframes successPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Hero区域背景动画 */
#home::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

/* 产品筛选过渡 */
.product-item {
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.product-item.hidden {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
  position: absolute;
}

/* 社交图标悬停效果 */
.social-icon {
  transition: all 0.3s ease;
}

.social-icon:hover {
  transform: translateY(-3px) rotate(5deg);
}

/* 加载动画 */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(212, 175, 55, 0.3);
  border-top-color: #D4AF37;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 滚动提示动画 */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0) translateX(-50%);
  }
  40% {
    transform: translateY(-10px) translateX(-50%);
  }
  60% {
    transform: translateY(-5px) translateX(-50%);
  }
}

/* 文字选择样式 */
::selection {
  background: #D4AF37;
  color: #2F1810;
}

::-moz-selection {
  background: #D4AF37;
  color: #2F1810;
}
