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

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

:root {
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-muted: #666666;
  --color-accent: #8b1538;
  --color-border: #e5e5e5;
  --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-subtle: 0 2px 8px rgba(0, 0, 0, 0.08);
}

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

/* 导航栏 */
.nav-fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  transition: var(--transition-smooth);
}

.nav-link {
  position: relative;
  transition: var(--transition-smooth);
}

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

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

/* 轮播图样式 */
.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;
}

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

.carousel-caption {
  position: absolute;
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: #ffffff;
  font-size: 2.5rem;
  font-weight: 300;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  letter-spacing: 2px;
}

.carousel-dots {
  position: absolute;
  bottom: 5%;
  right: 5%;
  display: flex;
  gap: 12px;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.carousel-dot.active {
  background: #ffffff;
  transform: scale(1.2);
}

/* 图片悬停效果 */
.hover-scale {
  transition: var(--transition-smooth);
  overflow: hidden;
}

.hover-scale img {
  transition: var(--transition-smooth);
}

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

/* 视觉卡片 */
.visual-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.visual-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition-smooth);
}

.visual-card:hover .visual-overlay {
  opacity: 1;
}

/* 懒加载占位 */
img[data-src] {
  background: #f5f5f5;
  min-height: 300px;
}

img.loaded {
  animation: fadeIn 0.6s ease-in;
}

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

/* 系列卡片 */
.collection-card {
  transition: var(--transition-smooth);
}

.collection-card:hover {
  box-shadow: var(--shadow-subtle);
  transform: translateY(-4px);
}

/* 单品详情 */
.piece-detail-image {
  position: sticky;
  top: 80px;
  cursor: zoom-in;
}

.detail-tag {
  display: inline-block;
  padding: 6px 16px;
  background: #f5f5f5;
  border-radius: 20px;
  font-size: 0.875rem;
  color: var(--color-muted);
  margin: 4px;
  transition: var(--transition-smooth);
}

.detail-tag:hover {
  background: var(--color-accent);
  color: #ffffff;
}

/* 横向滚动容器 */
.horizontal-scroll {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding-bottom: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.horizontal-scroll::-webkit-scrollbar {
  height: 6px;
}

.horizontal-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.horizontal-scroll::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

/* 全屏图片查看器 */
.fullscreen-viewer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.fullscreen-viewer.active {
  display: flex;
}

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

/* 加载动画 */
.loading-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  animation: pulse 1.4s infinite ease-in-out;
}

.loading-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes pulse {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .carousel-caption {
    font-size: 1.5rem;
    bottom: 15%;
  }
  
  .nav-fixed {
    padding: 12px 16px;
  }
  
  .piece-detail-image {
    position: static;
  }
  
  .horizontal-scroll {
    gap: 16px;
  }
}

@media (max-width: 640px) {
  .carousel-caption {
    font-size: 1.2rem;
    letter-spacing: 1px;
  }
  
  .carousel-dots {
    bottom: 3%;
    right: 3%;
  }
}

/* 辅助类 */
.text-shadow {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.section-padding {
  padding: 80px 24px;
}

@media (max-width: 768px) {
  .section-padding {
    padding: 48px 16px;
  }
}