/* 全局样式 - 时尚女装展示网站 */

/* 自定义CSS变量 */
:root {
  --color-primary: #1a1a1a;
  --color-secondary: #f5f5f5;
  --color-accent: #e8dfd4;
  --color-text: #333333;
  --color-text-light: #666666;
  --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --font-elegant: 'Noto Sans SC', system-ui, -apple-system, sans-serif;
}

/* 基础重置与字体 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-elegant);
  color: var(--color-text);
  background-color: #ffffff;
  line-height: 1.6;
  overflow-x: hidden;
}

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

/* 导航栏动画 */
.nav-link {
  position: relative;
  transition: var(--transition-smooth);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 1px;
  background-color: var(--color-primary);
  transition: var(--transition-smooth);
  transform: translateX(-50%);
}

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

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

.image-hover img {
  transition: var(--transition-smooth);
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.image-hover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition-smooth);
}

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

/* 按钮动画 */
.btn-elegant {
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.btn-elegant::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-elegant:hover::before {
  width: 300px;
  height: 300px;
}

/* 轮播图动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(1.1);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.carousel-item {
  animation: fadeIn 1s ease-in-out;
}

/* 滚动渐现动画 */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-on-scroll {
  opacity: 0;
  animation: slideUp 0.8s ease-out forwards;
}

/* 网格布局动画 */
.grid-item {
  transition: var(--transition-smooth);
}

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

/* 标题装饰线 */
.title-decorated {
  position: relative;
  display: inline-block;
}

.title-decorated::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(to right, var(--color-primary), transparent);
}

/* 加载动画 */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* 响应式断点 */
@media (max-width: 768px) {
  .nav-link::after {
    display: none;
  }
  
  .grid-item:hover {
    transform: none;
  }
}

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

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

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

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

/* 图片懒加载占位 */
img[loading="lazy"] {
  min-height: 200px;
  background: var(--color-secondary);
}

/* 页脚样式 */
footer {
  background: var(--color-primary);
  color: white;
  text-align: center;
  padding: 2rem 0;
  margin-top: 4rem;
}

/* 视差滚动效果 */
.parallax {
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* 文字渐变效果 */
.text-gradient {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-text-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 卡片阴影层次 */
.card-shadow-sm {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.card-shadow-md {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.card-shadow-lg {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
}

/* 过渡动画类 */
.fade-enter {
  opacity: 0;
}

.fade-enter-active {
  opacity: 1;
  transition: opacity 0.5s ease-in;
}

.fade-exit {
  opacity: 1;
}

.fade-exit-active {
  opacity: 0;
  transition: opacity 0.5s ease-out;
}