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

/* Tailwind CSS 配置 */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* 自定义 Tailwind 配置 */
@layer base {
  :root {
    --color-cream: #FBF9F6;
    --color-cocoa: #4A3F35;
    --color-sand: #E8DED2;
    --color-accent: #B8926A;
  }

  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  html {
    scroll-behavior: smooth;
    font-size: 16px;
  }

  body {
    font-family: 'Source Han Sans CN', 'Noto Sans SC', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--color-cream);
    color: var(--color-cocoa);
    line-height: 1.6;
    overflow-x: hidden;
  }
}

/* 导航栏样式 */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(251, 249, 246, 0.95);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.navbar.scrolled {
  box-shadow: 0 2px 10px rgba(74, 63, 53, 0.1);
}

/* 图片懒加载占位 */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

img[loading="lazy"].loaded {
  opacity: 1;
}

/* 轮播容器 */
.carousel-container {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.carousel-slide.active {
  opacity: 1;
  z-index: 1;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 网格布局 */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  padding: 2rem;
}

@media (min-width: 768px) {
  .grid-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 悬停效果 */
.hover-zoom {
  overflow: hidden;
  position: relative;
  transition: transform 0.3s ease;
}

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

.hover-zoom:hover img {
  transform: scale(1.08);
}

.hover-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(74, 63, 53, 0.9), transparent);
  color: var(--color-cream);
  padding: 2rem;
  transform: translateY(100%);
  transition: transform 0.4s ease;
}

.hover-zoom:hover .hover-overlay {
  transform: translateY(0);
}

/* 页面过渡动画 */
.page-transition {
  animation: fadeIn 0.8s ease-in-out;
}

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

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

/* 文字样式 */
.title-primary {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 300;
  letter-spacing: 0.05em;
  line-height: 1.2;
}

.title-secondary {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 300;
  letter-spacing: 0.03em;
}

.text-elegant {
  font-size: clamp(0.875rem, 1.5vw, 1.125rem);
  letter-spacing: 0.02em;
  line-height: 1.8;
}

/* 按钮样式 */
.btn-minimal {
  padding: 0.75rem 2rem;
  border: 1px solid var(--color-cocoa);
  background: transparent;
  color: var(--color-cocoa);
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn-minimal:hover {
  background: var(--color-cocoa);
  color: var(--color-cream);
}

/* 材质卡片 */
.material-card {
  background: white;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(74, 63, 53, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.material-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 30px rgba(74, 63, 53, 0.15);
}

/* 分隔线 */
.divider {
  width: 60px;
  height: 1px;
  background: var(--color-accent);
  margin: 2rem auto;
}

/* 页脚样式 */
footer {
  background: var(--color-cocoa);
  color: var(--color-cream);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.875rem;
  opacity: 0.7;
}

/* 响应式图片容器 */
.img-container {
  position: relative;
  width: 100%;
  padding-bottom: 133.33%;
  overflow: hidden;
  background: var(--color-sand);
}

.img-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 场景化展示布局 */
.scene-layout {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

@media (min-width: 1024px) {
  .scene-layout {
    flex-direction: row;
    align-items: flex-start;
  }
  
  .scene-layout > * {
    flex: 1;
  }
}

/* 色彩样本 */
.color-swatch {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: inline-block;
  margin: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.color-swatch:hover {
  transform: scale(1.15);
}

/* 加载动画 */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-sand);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

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

/* 焦点样式 */
a:focus,
button:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

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

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

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

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