/* ============================================
   宠物世界 - 全局样式
   设计风格：宠物现代科技风
   ============================================ */

/* ========== CSS 变量 ========== */
:root {
  /* 主色调 - 科技蓝青 */
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --primary-dark: #1d4ed8;
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;

  /* 强调色 - 活力橙 */
  --accent: #f97316;
  --accent-light: #fb923c;
  --accent-dark: #ea580c;
  --accent-50: #fff7ed;

  /* 成功/警告/错误 */
  --success: #10b981;
  --success-light: #34d399;
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-light: #f87171;

  /* 中性色 */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* 背景 */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --bg-hero: linear-gradient(135deg, #0ea5e9 0%, #6366f1 50%, #8b5cf6 100%);

  /* 文字 */
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  --text-inverse: #ffffff;

  /* 边框 */
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;

  /* 阴影 */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-primary: 0 4px 14px 0 rgba(37, 99, 235, 0.35);
  --shadow-accent: 0 4px 14px 0 rgba(249, 115, 22, 0.35);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.3);

  /* 间距 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* 过渡 */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;

  /* 布局 */
  --header-height: 72px;
  --container-max: 1280px;
  --container-padding: 20px;
}

/* ========== 重置与基础 ========== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-secondary);
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  font-size: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  outline: none;
}

ul, ol {
  list-style: none;
}

/* ========== 容器 ========== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* ========== 顶部导航 ========== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  height: var(--header-height);
  transition: box-shadow var(--transition-base);
}

.header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--bg-hero);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: var(--shadow-primary);
  transition: transform var(--transition-bounce);
}

.logo:hover .logo-icon {
  transform: rotate(-10deg) scale(1.1);
}

.logo-text {
  background: var(--bg-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 汉堡按钮（桌面隐藏） */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--transition-base), opacity var(--transition-fast);
}
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 移动端抽屉菜单（桌面隐藏） */
.mobile-menu {
  position: fixed;
  top: var(--header-height, 64px);
  right: 0;
  width: 75%;
  max-width: 300px;
  height: calc(100vh - var(--header-height, 64px));
  background: var(--surface, #fff);
  box-shadow: -8px 0 30px rgba(0,0,0,0.12);
  padding: 16px;
  z-index: 998;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}
.mobile-menu.open { transform: translateX(0); }
.mobile-nav-link {
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  font-weight: 500;
  color: var(--text-primary);
  font-size: 15px;
  transition: background var(--transition-fast);
}
.mobile-nav-link:active { background: var(--primary-50); }
.mobile-menu-mask {
  position: fixed;
  inset: 0;
  top: var(--header-height, 64px);
  background: rgba(0,0,0,0.4);
  z-index: 997;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base);
}
.mobile-menu-mask.show { opacity: 1; visibility: visible; }

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: var(--primary-50);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cart-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all var(--transition-fast);
}

.cart-btn:hover {
  background: var(--primary-50);
  transform: translateY(-2px);
}

.cart-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

.user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 8px;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  transition: all var(--transition-fast);
}

.user-btn:hover {
  background: var(--primary-50);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-hero);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  font-weight: 600;
}

.user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

/* ========== 按钮 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 15px;
  transition: all var(--transition-base);
  cursor: pointer;
  border: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left var(--transition-slow);
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: white;
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
  color: white;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  color: white;
  box-shadow: var(--shadow-accent);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.4);
  color: white;
}

.btn-outline {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary-200);
}

.btn-outline:hover {
  border-color: var(--primary);
  background: var(--primary-50);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger-light), var(--danger));
  color: white;
}

.btn-success {
  background: linear-gradient(135deg, var(--success-light), var(--success));
  color: white;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 17px;
  border-radius: var(--radius-lg);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ========== 卡片 ========== */
.card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: all var(--transition-base);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.card-body {
  padding: var(--space-lg);
}

/* ========== 商品卡片 ========== */
.product-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: all var(--transition-base);
  cursor: pointer;
  position: relative;
}

.product-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-6px);
}

.product-image {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--gray-100);
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

/* 售罄标识 */
.soldout-mask {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 4px;
  z-index: 2;
}
.product-card.sold-out { cursor: not-allowed; }
.product-card.sold-out img { filter: grayscale(0.6); opacity: 0.7; }
.product-card.sold-out:hover .product-image img { transform: none; }

.product-card:hover .product-image img {
  transform: scale(1.08);
}

.product-tags {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 6px;
  z-index: 2;
}

.product-tag {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  color: white;
  backdrop-filter: blur(10px);
}

.tag-hot {
  background: linear-gradient(135deg, #ef4444, #f97316);
}

.tag-new {
  background: linear-gradient(135deg, #10b981, #06b6d4);
}

.tag-sale {
  background: linear-gradient(135deg, #f59e0b, #f97316);
}

.product-info {
  padding: 16px;
}

.product-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-subtitle {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.product-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
}

.product-price::before {
  content: '¥';
  font-size: 13px;
  font-weight: 600;
}

.product-original-price {
  font-size: 13px;
  color: var(--text-tertiary);
  text-decoration: line-through;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.product-sales {
  font-size: 12px;
  color: var(--text-tertiary);
}

.product-add-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all var(--transition-bounce);
  box-shadow: var(--shadow-primary);
}

.product-add-btn:hover {
  transform: scale(1.15) rotate(90deg);
}

/* ========== 轮播图 ========== */
.carousel {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.carousel-track {
  display: flex;
  transition: transform var(--transition-slow);
}

.carousel-slide {
  min-width: 100%;
  position: relative;
  aspect-ratio: 21/9;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0.5) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px;
  color: white;
}

.carousel-title {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 12px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.carousel-subtitle {
  font-size: 18px;
  opacity: 0.9;
  margin-bottom: 24px;
}

.carousel-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all var(--transition-base);
}

.carousel-dot.active {
  width: 24px;
  border-radius: 4px;
  background: white;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 5;
}

.carousel-arrow:hover {
  background: white;
  transform: translateY(-50%) scale(1.1);
}

.carousel-arrow.prev { left: 16px; }
.carousel-arrow.next { right: 16px; }

/* ========== 公告栏 ========== */
.announcement-bar {
  background: linear-gradient(90deg, var(--primary-50), var(--accent-50));
  border-radius: var(--radius-md);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.announcement-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.announcement-content {
  flex: 1;
  overflow: hidden;
}

.announcement-text {
  color: var(--text-secondary);
  font-size: 14px;
  white-space: nowrap;
  animation: marquee 20s linear infinite;
}

@keyframes marquee {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* ========== 区块标题 ========== */
.section {
  padding: var(--space-2xl) 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
}

.section-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 28px;
  background: var(--bg-hero);
  border-radius: 2px;
}

.section-more {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
}

.section-more:hover {
  color: var(--primary);
  gap: 8px;
}

/* ========== 网格布局 ========== */
.grid {
  display: grid;
  gap: 20px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

/* ========== 服务卡片 ========== */
.service-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: all var(--transition-base);
  cursor: pointer;
}

.service-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
}

.service-image {
  aspect-ratio: 16/10;
  overflow: hidden;
  position: relative;
}

.service-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.service-card:hover .service-image img {
  transform: scale(1.05);
}

.service-info {
  padding: 16px;
}

.service-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.service-desc {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.service-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.service-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
}

.service-price::before {
  content: '¥';
  font-size: 13px;
}

.service-duration {
  font-size: 12px;
  color: var(--text-tertiary);
  background: var(--gray-100);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

/* ========== 分类标签 ========== */
.category-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  flex-shrink: 0;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  background: white;
  border: 1px solid var(--border);
  font-weight: 500;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

.category-tab:hover {
  border-color: var(--primary-300);
  color: var(--primary);
}

.category-tab.active {
  background: var(--bg-hero);
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow-primary);
}

/* ========== 搜索框 ========== */
.search-box {
  display: flex;
  align-items: center;
  background: white;
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px 4px 4px 20px;
  transition: all var(--transition-base);
  overflow: hidden;
}

.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-50);
}

.search-box input {
  flex: 1;
  border: none;
  padding: 10px 0;
  font-size: 15px;
  background: transparent;
}

.search-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-hero);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all var(--transition-fast);
}

.search-btn:hover {
  transform: scale(1.05);
}

/* ========== 表单 ========== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  transition: all var(--transition-fast);
  background: white;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-50);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 6px;
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 6px;
}

/* ========== 弹窗 ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  width: 90%;
  max-width: 480px;
  max-height: 85vh;
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  transition: all var(--transition-bounce);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-tertiary);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(85vh - 140px);
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ========== Toast 提示 ========== */
.toast-container {
  position: fixed;
  top: 100px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  animation: toastIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  border-left: 4px solid var(--primary);
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

.toast-icon {
  font-size: 20px;
}

.toast-message {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

.toast.out {
  animation: toastOut 0.3s forwards;
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(100%); }
}

/* ========== 空状态 ========== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-desc {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: 24px;
}

/* ========== 页脚 ========== */
.footer {
  background: var(--gray-900);
  color: var(--gray-400);
  padding: var(--space-3xl) 0 var(--space-xl);
  margin-top: var(--space-3xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand .logo {
  color: white;
  margin-bottom: 16px;
}

.footer-brand .logo-text {
  -webkit-text-fill-color: white;
}

.footer-desc {
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 16px;
}

.footer-title {
  color: white;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-link {
  font-size: 14px;
  color: var(--gray-400);
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid var(--gray-800);
  padding-top: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--gray-500);
}

/* ========== 页面主内容 ========== */
.main {
  min-height: calc(100vh - var(--header-height));
  padding-bottom: var(--space-3xl);
}

.page-header {
  background: var(--bg-hero);
  color: white;
  padding: 48px 0;
  margin-bottom: var(--space-2xl);
}

.page-title {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 8px;
}

.page-breadcrumb {
  font-size: 14px;
  opacity: 0.8;
}

.page-breadcrumb a {
  color: rgba(255,255,255,0.8);
}

.page-breadcrumb a:hover {
  color: white;
}

/* ========== 数量选择器 ========== */
.quantity-selector {
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.quantity-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  background: var(--gray-50);
}

.quantity-btn:hover {
  background: var(--primary-50);
  color: var(--primary);
}

.quantity-input {
  width: 50px;
  height: 36px;
  border: none;
  text-align: center;
  font-weight: 600;
  font-size: 15px;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

/* ========== 标签页 ========== */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border-light);
  gap: 4px;
  margin-bottom: 24px;
}

.tab {
  padding: 12px 24px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.tab:hover {
  color: var(--primary);
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ========== 徽章 ========== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}

.badge-primary { background: var(--primary-50); color: var(--primary); }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* ========== 价格显示 ========== */
.price {
  color: var(--accent);
  font-weight: 700;
}

.price-large {
  font-size: 28px;
  font-weight: 800;
}

.price-large::before {
  content: '¥';
  font-size: 16px;
}

/* ========== 分割线 ========== */
.divider {
  height: 1px;
  background: var(--border-light);
  margin: 20px 0;
}

/* ========== 加载动画 ========== */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .carousel-title { font-size: 28px; }
}

@media (max-width: 768px) {
  :root {
    --header-height: 60px;
    --container-padding: 16px;
  }

  .nav { display: none; }
  .nav-toggle { display: flex; }
  .grid-3, .grid-4, .grid-5 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }

  .carousel-slide { aspect-ratio: 4/3; }
  .carousel-overlay { padding: 24px; }
  .carousel-title { font-size: 20px; }
  .carousel-subtitle { font-size: 14px; }
  .carousel-arrow { width: 36px; height: 36px; font-size: 16px; }

  .section { padding: var(--space-xl) 0; }
  .section-title { font-size: 20px; }

  .page-header { padding: 32px 0; }
  .page-title { font-size: 24px; }

  .user-name { display: none; }
  .user-btn { padding: 8px; }

  .modal { width: 95%; }
  .toast-container { right: 16px; left: 16px; }
  .toast { min-width: auto; }
}

@media (max-width: 480px) {
  .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .product-price { font-size: 18px; }
  .btn { padding: 10px 18px; font-size: 14px; }
}

/* ========== 滚动条美化 ========== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* ========== 选中文本 ========== */
::selection {
  background: var(--primary-200);
  color: var(--primary-dark);
}

/* ============================================
   高级动画与视觉升级系统
   ============================================ */

/* ========== 渐变氛围背景 ========== */
.ambient-bg {
  position: relative;
  overflow: hidden;
}
.ambient-bg::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  animation: blobFloat 20s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
.ambient-bg::after {
  content: '';
  position: absolute;
  bottom: -20%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  animation: blobFloat 25s ease-in-out infinite reverse;
  pointer-events: none;
  z-index: 0;
}
@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* ========== 滚动揭示动画 ========== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}
.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}
.reveal-scale {
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}
.reveal-rotate {
  opacity: 0;
  transform: rotate(-5deg) translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-rotate.revealed {
  opacity: 1;
  transform: rotate(0) translateY(0);
}
/* 错峰延迟 */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* ========== 3D 卡片倾斜 ========== */
.tilt-card {
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}
.tilt-card .tilt-content {
  transform: translateZ(30px);
}
.tilt-card .tilt-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  border-radius: inherit;
}
.tilt-card:hover .tilt-shine {
  opacity: 1;
}

/* ========== 磁吸按钮 ========== */
.magnetic-btn {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

/* ========== 涟漪效果 ========== */
.ripple-container {
  position: relative;
  overflow: hidden;
}
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: scale(0);
  animation: rippleEffect 0.6s ease-out;
  pointer-events: none;
}
@keyframes rippleEffect {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ========== 数字滚动 ========== */
.counter {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* ========== 高级悬浮效果 ========== */
.hover-lift {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}
.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
}
.hover-glow:hover {
  box-shadow: 0 0 30px rgba(37, 99, 235, 0.3), 0 10px 30px rgba(0, 0, 0, 0.1);
}
.hover-zoom img {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.hover-zoom:hover img {
  transform: scale(1.12);
}

/* ========== 玻璃拟态增强 ========== */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.glass-dark {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.glass-card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

/* ========== 渐变文字 ========== */
.gradient-text {
  background: var(--bg-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gradient-text-accent {
  background: linear-gradient(135deg, #f97316, #ef4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========== 页面入场动画 ========== */
.page-enter {
  animation: pageEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== 浮动动画 ========== */
.float {
  animation: float 6s ease-in-out infinite;
}
.float-delay-1 { animation-delay: 1s; }
.float-delay-2 { animation-delay: 2s; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

/* ========== 脉冲动画 ========== */
.pulse-ring {
  position: relative;
}
.pulse-ring::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 2px solid var(--primary);
  animation: pulseRing 2s ease-out infinite;
}
@keyframes pulseRing {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.3); opacity: 0; }
}

/* ========== 闪烁光标 ========== */
.cursor-blink::after {
  content: '|';
  animation: blink 1s step-end infinite;
  color: var(--primary);
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ========== 骨架屏增强 ========== */
.skeleton-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 16px;
}
.skeleton-img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}
.skeleton-line {
  height: 14px;
  border-radius: 7px;
  margin-bottom: 8px;
}
.skeleton-line.short { width: 60%; }

/* ========== 进度条动画 ========== */
.progress-bar {
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--bg-hero);
  border-radius: 3px;
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
  width: 0;
}

/* ========== 标签页切换动画 ========== */
.tab-content {
  animation: tabFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== 模态框入场增强 ========== */
.modal-overlay.active .modal {
  animation: modalPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalPop {
  0% { opacity: 0; transform: scale(0.9) translateY(20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ========== 导航下划线动画 ========== */
.nav-link-underline {
  position: relative;
}
.nav-link-underline::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateX(-50%);
}
.nav-link-underline:hover::after,
.nav-link-underline.active::after {
  width: 60%;
}

/* ========== 图片加载淡入 ========== */
.img-fade {
  opacity: 0;
  transition: opacity 0.6s ease;
}
.img-fade.loaded {
  opacity: 1;
}

/* ========== 滚动条美化增强 ========== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary-light), var(--primary));
  border-radius: 5px;
  border: 2px solid var(--gray-100);
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
}

/* ========== 减少动画偏好 ========== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .reveal-left, .reveal-right, .reveal-scale, .reveal-rotate {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ========== 打印样式 ========== */
@media print {
  .header, .footer, .no-print { display: none !important; }
  body { background: white; }
}
