/* 布局工具类 */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* 高度工具类 */
.min-h-screen {
  min-height: 100vh;
}

.h-screen {
  height: 100vh;
}

.h-full {
  height: 100%;
}

.w-full {
  width: 100%;
}

/* 定位工具类 */
.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.fixed {
  position: fixed;
}

.inset-0 {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

/* z-index工具类 */
.z-50 {
  z-index: 50;
}

.z-20 {
  z-index: 20;
}

.z-10 {
  z-index: 10;
}

.z-0 {
  z-index: 0;
}

/* Flexbox工具类 */
.flex {
  display: flex;
}

.grid {
  display: grid;
}

.hidden {
  display: none;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.flex-col {
  flex-direction: column;
}

/* 间距工具类 */
.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 0.75rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-6 {
  gap: 1.5rem;
}

/* 内边距工具类 */
.p-2 {
  padding: 0.5rem;
}

.p-3 {
  padding: 0.75rem;
}

.p-4 {
  padding: 1rem;
}

.p-12 {
  padding: 3rem;
}

.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.px-8 {
  padding-left: 2rem;
  padding-right: 2rem;
}

.py-3 {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.py-4 {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.py-16 {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.pt-24 {
  padding-top: 6rem;
}

.pb-16 {
  padding-bottom: 4rem;
}

/* 外边距工具类 */
.mb-1 {
  margin-bottom: 0.25rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-3 {
  margin-bottom: 0.75rem;
}

.mb-4 {
  margin-bottom: 1rem;
}


.mb-8 {
  margin-bottom: 2rem;
}

.mb-10 {
  margin-bottom: 2.5rem;
}

.mb-12 {
  margin-bottom: 3rem;
}

.mt-6 {
  margin-top: 1.5rem;
}

.mt-8 {
  margin-top: 2rem;
}

.mr-2 {
  margin-right: 0.5rem;
}

.ml-4 {
  margin-left: 1rem;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

/* 文本对齐工具类 */
.text-center {
  text-align: center;
}

/* 颜色工具类 */
.text-white {
  color: #ffffff;
}

.text-transparent {
  color: transparent;
}

.bg-black {
  background-color: #000000;
}

.bg-gray-600 {
  background-color: #4b5563;
}

.bg-gray-500 {
  background-color: #6b7280;
}

.bg-gray-800 {
  background-color: #3B3B3B;
}

.hover\:bg-gray-700:hover {
  background-color: #4A4A4A;
}

.hover\:bg-gray-500:hover {
  background-color: #6b7280;
}

/* 渐变工具类 */
.bg-gradient-to-r {
  background-image: linear-gradient(to right, var(--tw-gradient-stops));
}

.bg-gradient-to-t {
  background-image: linear-gradient(to top, var(--tw-gradient-stops));
}

.from-primary {
  --tw-gradient-from: var(--color-primary);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(212, 175, 55, 0));
}

.to-primary-light {
  --tw-gradient-to: var(--color-primary-light);
}

.from-black-80 {
  --tw-gradient-from: rgba(0, 0, 0, 0.8);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(0, 0, 0, 0));
}

.via-black-30 {
  --tw-gradient-via: rgba(0, 0, 0, 0.3);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-via), var(--tw-gradient-to, rgba(0, 0, 0, 0));
}

.to-transparent {
  --tw-gradient-to: transparent;
}

.bg-clip-text {
  -webkit-background-clip: text;
  background-clip: text;
}

/* Grid工具类 */
.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* 纵横比工具类 */
.aspect-square {
  aspect-ratio: 1 / 1;
}

.aspect-video {
  aspect-ratio: 16 / 9;
}

/* 溢出工具类 */
.overflow-hidden {
  overflow: hidden;
}

/* 圆角工具类 */
.rounded-lg {
  border-radius: 0.5rem;
}

.rounded-xl {
  border-radius: 0.75rem;
}

.rounded-full {
  border-radius: 9999px;
}

/* 透明度工具类 */
.opacity-80 {
  opacity: 0.8;
}

.opacity-30 {
  opacity: 0.3;
}

.opacity-0 {
  opacity: 0;
}

.opacity-100 {
  opacity: 1;
}

/* 过渡效果工具类 */
.transition-all {
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 300ms;
}

.transition-opacity {
  transition-property: opacity;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 300ms;
}

.transition-transform {
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 300ms;
}

.duration-300 {
  transition-duration: 300ms;
}

.duration-500 {
  transition-duration: 500ms;
}

.duration-700 {
  transition-duration: 700ms;
}

.duration-1000 {
  transition-duration: 1000ms;
}

/* 变换工具类 */
.transform {
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}

.scale-90 {
  --tw-scale-x: 0.9;
  --tw-scale-y: 0.9;
}

.scale-100 {
  --tw-scale-x: 1;
  --tw-scale-y: 1;
}

.scale-110 {
  --tw-scale-x: 1.1;
  --tw-scale-y: 1.1;
}

.hover\:scale-105:hover {
  --tw-scale-x: 1.05;
  --tw-scale-y: 1.05;
}

.hover\:scale-110:hover {
  --tw-scale-x: 1.1;
  --tw-scale-y: 1.1;
}

.group:hover .group-hover\:scale-100 {
  --tw-scale-x: 1;
  --tw-scale-y: 1;
}

.group:hover .group-hover\:scale-110 {
  --tw-scale-x: 1.1;
  --tw-scale-y: 1.1;
}

/* 对象适配工具类 */
.object-cover {
  object-fit: cover;
}

/* 尺寸工具类 */
.w-4 {
  width: 1rem;
}

.h-4 {
  height: 1rem;
}

.w-5 {
  width: 1.25rem;
}

.h-5 {
  height: 1.25rem;
}

.w-8 {
  width: 2rem;
}

.h-8 {
  height: 2rem;
}

.w-10 {
  width: 2.5rem;
}

.h-10 {
  height: 2.5rem;
}

.w-12 {
  width: 3rem;
}

.h-12 {
  height: 3rem;
}

.w-16 {
  width: 4rem;
}

.h-16 {
  height: 4rem;
}

.w-20 {
  width: 5rem;
}

.h-20 {
  height: 5rem;
}

.h-40 {
  height: 10rem;
}

.h-0 {
  height: 0;
}

.h-0\.5 {
  height: 0.125rem;
}

/* 交互工具类 */
.cursor-pointer {
  cursor: pointer;
}

.cursor-move {
  cursor: move;
}

.hover\:opacity-50:hover {
  opacity: 0.5;
}

/* 字体大小工具类 */
.text-xs {
  font-size: 0.75rem;
}

.text-sm {
  font-size: 0.875rem;
}

.text-base {
  font-size: 1rem;
}

.text-lg {
  font-size: 1.125rem;
}

.text-xl {
  font-size: 1.25rem;
}

.text-2xl {
  font-size: 1.5rem;
}

.text-3xl {
  font-size: 1.875rem;
}

.text-4xl {
  font-size: 2.25rem;
}

.text-5xl {
  font-size: 3rem;
}


.font-medium {
  font-weight: 500;
}

.font-bold {
  font-weight: 700;
}

/* 定位工具类 */
.top-0 {
  top: 0;
}

.top-4 {
  top: 1rem;
}

.right-3 {
  right: 0.75rem;
}

.right-4 {
  right: 1rem;
}

.bottom-3 {
  bottom: 0.75rem;
}

.bottom-8 {
  bottom: 2rem;
}

.left-0 {
  left: 0;
}

.left-1\/2 {
  left: 50%;
}

/* 变换工具类 */
.-translate-x-1\/2 {
  --tw-translate-x: -50%;
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}

.translate-y-1 {
  --tw-translate-y: 0.25rem;
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}

.group:hover .group-hover\:translate-y-0 {
  --tw-translate-y: 0;
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}

/* 阴影工具类 */
.shadow-xl {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 响应式工具类 */
@media (min-width: 768px) {
  .md\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  
  .md\:gap-6 {
    gap: 1.5rem;
  }
  
  .md\:text-3xl {
    font-size: 1.875rem;
  }
}

/* 最大宽度工具类 */
.max-w-2xl {
  max-width: 42rem;
}

.max-w-3xl {
  max-width: 48rem;
}

.max-w-4xl {
  max-width: 56rem;
}

.max-w-5xl {
  max-width: 64rem;
}

.max-w-6xl {
  max-width: 72rem;
}

/* 更多透明度工具类 */
.opacity-30 {
  opacity: 0.3;
}

.opacity-0 {
  opacity: 0;
}

.opacity-100 {
  opacity: 1;
}

/* 边框工具类 */
.border {
  border-width: 1px;
}

.border-2 {
  border-width: 2px;
}

.border-dashed {
  border-style: dashed;
}

/* 过渡效果工具类 */
.transition-colors {
  transition-property: color, background-color, border-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 300ms;
}

.duration-300 {
  transition-duration: 300ms;
}

/* 禁用状态工具类 */
.disabled\:cursor-not-allowed:disabled {
  cursor: not-allowed;
}

/* Grid 工具类 */
.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

/* 间距组合工具类 */
.space-y-3 > *:not(:first-child) {
  margin-top: 0.75rem;
}

.space-y-4 > *:not(:first-child) {
  margin-top: 1rem;
}

.space-y-8 > *:not(:first-child) {
  margin-top: 2rem;
}

.space-x-8 > *:not(:first-child) {
  margin-left: 2rem;
}

@media (min-width: 768px) {
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  .md\:flex {
    display: flex;
  }
  
  .md\:hidden {
    display: none;
  }
  
  .md\:px-8 {
    padding-left: 2rem;
    padding-right: 2rem;
  }
  
  .md\:text-5xl {
    font-size: 3rem;
  }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  
  .lg\:grid-cols-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

/* ===========================================
   性能优化样式 - Performance Optimization
   =========================================== */

/* 懒加载图片样式 */
.lazy-image {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  background-color: #f3f4f6;
  background-image: 
    linear-gradient(45deg, #f9fafb 25%, transparent 25%), 
    linear-gradient(-45deg, #f9fafb 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #f9fafb 75%), 
    linear-gradient(-45deg, transparent 75%, #f9fafb 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

.lazy-image.lazy-loading {
  opacity: 0.7;
  background-color: #e5e7eb;
  position: relative;
}

.lazy-image.lazy-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border: 2px solid #d1d5db;
  border-top: 2px solid #d4af37;
  border-radius: 50%;
  animation: lazySpinner 1s linear infinite;
}

.lazy-image.lazy-loaded {
  opacity: 1;
  background: none;
}

.lazy-image.lazy-error {
  opacity: 1;
  background-color: #fee2e2;
  background-image: none;
  position: relative;
}

.lazy-image.lazy-error::after {
  content: '❌';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  color: #dc2626;
}

@keyframes lazySpinner {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 骨架屏样式 */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeletonLoading 1.5s infinite;
}

.skeleton-text {
  height: 1em;
  border-radius: 4px;
  margin-bottom: 0.5em;
}

.skeleton-text:last-child {
  margin-bottom: 0;
  width: 60%;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.skeleton-card {
  padding: 1rem;
  border-radius: 8px;
}

.skeleton-image {
  width: 100%;
  height: 200px;
  border-radius: 8px;
}

@keyframes skeletonLoading {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* 加载状态指示器 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #f3f4f6;
  border-top: 4px solid #d4af37;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  margin-top: 1rem;
  color: #4b5563;
  font-size: 0.875rem;
  text-align: center;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 渐进式增强样式 */
.progressive-image {
  position: relative;
  overflow: hidden;
}

.progressive-image__placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(5px);
  transform: scale(1.1);
  transition: opacity 0.3s ease;
}

.progressive-image__img {
  position: relative;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.progressive-image__img.loaded {
  opacity: 1;
}

.progressive-image__img.loaded + .progressive-image__placeholder {
  opacity: 0;
}

/* 性能优化类 */
.optimized-scroll {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

.gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000;
}

/* 响应式图片容器 */
.responsive-image-container {
  position: relative;
  width: 100%;
  height: 0;
  overflow: hidden;
}

.responsive-image-container.aspect-16-9 {
  padding-bottom: 56.25%; /* 16:9 */
}

.responsive-image-container.aspect-4-3 {
  padding-bottom: 75%; /* 4:3 */
}

.responsive-image-container.aspect-1-1 {
  padding-bottom: 100%; /* 1:1 */
}

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

/* 预加载提示 */
.preloading-hint {
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.preloading-hint.loaded {
  opacity: 1;
}

/* 错误边界样式 */
.error-boundary {
  padding: 2rem;
  text-align: center;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #dc2626;
}

.error-boundary h3 {
  margin-bottom: 0.5rem;
  color: #991b1b;
}

.error-boundary p {
  margin-bottom: 1rem;
  color: #7f1d1d;
}

.error-boundary button {
  background-color: #dc2626;
  color: white;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.error-boundary button:hover {
  background-color: #b91c1c;
}

/* 内存优化 */
@media (max-width: 768px) {
  /* 移动端减少动画以节省性能 */
  .skeleton,
  .lazy-image,
  .progressive-image__img,
  .progressive-image__placeholder {
    animation-duration: 0.5s;
    transition-duration: 0.2s;
  }
  
  /* 减少模糊效果 */
  .progressive-image__placeholder {
    filter: blur(2px);
  }
  
  /* 移动端优化的加载指示器 */
  .loading-spinner {
    width: 32px;
    height: 32px;
    border-width: 3px;
  }
}

/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
  .lazy-image {
    background-color: #374151;
  }
  
  .skeleton {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
  }
  
  .loading-overlay {
    background-color: rgba(17, 24, 39, 0.9);
  }
  
  .error-boundary {
    background-color: #450a0a;
    border-color: #7f1d1d;
    color: #fca5a5;
  }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
  .lazy-image.lazy-loading::after {
    border-color: #000;
    border-top-color: #d4af37;
  }
  
  .loading-spinner {
    border-color: #000;
    border-top-color: #d4af37;
  }
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
  .lazy-image,
  .skeleton,
  .progressive-image__img,
  .progressive-image__placeholder,
  .loading-spinner,
  .lazy-image.lazy-loading::after {
    animation: none;
    transition: none;
  }
  
  .lazy-image.lazy-loaded {
    opacity: 1;
  }
}

/* 性能监控样式 */
.performance-indicator {
  position: fixed;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-family: monospace;
  z-index: 10000;
  pointer-events: none;
}

.performance-indicator.good {
  background: rgba(34, 197, 94, 0.8);
}

.performance-indicator.medium {
  background: rgba(234, 179, 8, 0.8);
}

.performance-indicator.poor {
  background: rgba(239, 68, 68, 0.8);
} 