/* ========== 全局基础样式 ========== */
html { scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; }

/* ========== 自定义滚动条 ========== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #64748b; }

/* ========== 动画 ========== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(30, 64, 175, 0.4); }
  70% { box-shadow: 0 0 0 12px rgba(30, 64, 175, 0); }
  100% { box-shadow: 0 0 0 0 rgba(30, 64, 175, 0); }
}
.animate-fade-in-up { animation: fadeInUp 0.6s ease-out backwards; }
.animate-shimmer { background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; }

/* ========== 商品卡片 ========== */
.product-card {
  background: white;
  border-radius: 1rem;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #f1f5f9;
}
.product-card:hover {
  box-shadow: 0 12px 32px -8px rgba(15, 31, 77, 0.15);
  transform: translateY(-4px);
  border-color: #c7d2fe;
}
.product-card .product-img {
  aspect-ratio: 1;
  width: 100%;
  position: relative;
  overflow: hidden;
  background: #f8fafc;
}
.product-card .product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s ease;
}
.product-card:hover .product-img img {
  transform: scale(1.05);
}
.product-card .product-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.05));
  pointer-events: none;
}
.product-card .product-tag {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.125rem 0.5rem;
  background: rgba(245, 158, 11, 0.95);
  color: white;
  font-size: 0.7rem;
  border-radius: 9999px;
  font-weight: 500;
}

/* ========== 轮播图样式 ========== */
.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  display: flex;
  align-items: center;
  padding: 3rem;
}
.carousel-slide.active { opacity: 1; }
.carousel-dots button {
  width: 24px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.5);
  transition: all 0.3s;
}
.carousel-dots button.active {
  background: white;
  width: 36px;
}

/* ========== 分类卡片 ========== */
.category-card {
  position: relative;
  overflow: hidden;
}
.category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.1) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.6s;
}
.category-card:hover::before { transform: translateX(100%); }

/* ========== 商品 SKU 多规格 ========== */
.spec-chip {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.7rem;
  border-radius: 9999px;
  margin-right: 0.25rem;
}

/* ========== Modal 动画 ========== */
#login-modal.show #login-modal-content,
#login-modal.show > div:last-child {
  animation: modalIn 0.3s ease-out;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ========== 响应式微调 ========== */
@media (max-width: 640px) {
  .carousel-slide { padding: 1.5rem; }
}

/* ========== Toast ========== */
#toast.show {
  display: block !important;
  animation: fadeInUp 0.3s ease-out;
}