/* 衬衫展示网站全局样式文件 */
/* 自定义颜色定义 */
:root {
  --ivory-50: #fafafa;
  --ivory-100: #f5f5f5;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --beige-100: #f5f5f0;
  --beige-200: #e8e8e0;
}

/* 字体定义 */
@import url('https://fonts.loli.net/css2?family=Noto+Serif+SC:wght@400;600;700&family=Alibaba+PuHuiTi:wght@300;400;500;600&display=swap');

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

body {
  font-family: 'Noto Serif SC', 'Alibaba PuHuiTi', serif;
  line-height: 1.6;
  color: #333;
  background-color: var(--ivory-50);
  overflow-x: hidden;
}

/* 导航栏样式 */
.navbar {
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.navbar-transparent {
  background-color: rgba(255, 255, 255, 0.9);
}

.nav-link {
  position: relative;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -5px;
  left: 50%;
  background-color: var(--gray-600);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

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

/* 图片悬停效果 */
.image-hover {
  transition: all 0.5s ease;
  filter: grayscale(20%);
}

.image-hover:hover {
  filter: grayscale(0%);
  transform: scale(1.02);
}

/* 按钮丝绸质感效果 */
.btn-silk {
  background: linear-gradient(145deg, #f0f0f0, #e0e0e0);
  border: none;
  padding: 12px 24px;
  border-radius: 4px;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.btn-silk::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.5s ease;
}

.btn-silk:hover::before {
  left: 100%;
}

.btn-silk:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* 加载动画 - 纽扣旋转 */
.loading-button {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid #ccc;
  border-radius: 50%;
  border-top-color: #333;
  animation: spin 1s ease-in-out infinite;
}

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

/* 页面切换动画 */
.page-transition {
  animation: slideIn 0.6s ease-out;
}

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

/* 裁剪线稿背景 */
.cutting-pattern-bg {
  background-image: 
    linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
  background-size: 20px 20px;
}

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

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

.fabric-zoom::after {
  content: attr(data-density);
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 5px 10px;
  border-radius: 3px;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fabric-zoom:hover::after {
  opacity: 1;
}

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

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

/* 色卡悬停效果 */
.color-palette {
  position: absolute;
  bottom: -60px;
  left: 0;
  background: white;
  padding: 10px;
  border-radius: 5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 10;
}

.color-swatch:hover .color-palette {
  opacity: 1;
  transform: translateY(0);
}

.color-chip {
  width: 20px;
  height: 20px;
  border-radius: 3px;
  margin-right: 5px;
  display: inline-block;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .masonry-grid {
    column-count: 2;
  }
  
  .btn-silk {
    padding: 10px 20px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .masonry-grid {
    column-count: 1;
  }
  
  .nav-link::after {
    display: none;
  }
}

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

/* 焦点样式 */
button:focus,
a:focus {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

/* 打印样式 */
@media print {
  .navbar,
  .btn-silk,
  .color-palette {
    display: none;
  }
}