/* ==========================================
   CSS变量系统 - 设计令牌
   ========================================== */
:root {
  /* 颜色系统 */
  --primary-color: #2ecc71;        /* 主色 - 清新绿 */
  --primary-hover: #27ae60;        /* 主色悬停 */
  --secondary-color: #ff6b6b;      /* 辅色 - 水果红 */
  --accent-color: #ffd93d;         /* 强调色 - 香蕉黄 */
  
  --text-primary: #2c3e50;         /* 主文本色 */
  --text-secondary: #7f8c8d;       /* 次要文本色 */
  --text-light: #95a5a6;           /* 浅色文本 */
  --text-white: #ffffff;           /* 白色文本 */
  
  --bg-white: #ffffff;             /* 白色背景 */
  --bg-light: #f8f9fa;             /* 浅色背景 */
  --bg-dark: #34495e;              /* 深色背景 */
  --bg-overlay: rgba(0, 0, 0, 0.5);/* 遮罩层 */
  
  --border-color: #ecf0f1;         /* 边框颜色 */
  --border-light: #e0e0e0;         /* 浅色边框 */
  
  /* 字体系统 */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-size-xs: 12px;            /* 小字号 */
  --font-size-sm: 14px;            /* 默认字号 */
  --font-size-md: 16px;            /* 中等字号 */
  --font-size-lg: 18px;            /* 大字号 */
  --font-size-xl: 24px;            /* 超大字号 */
  --font-size-xxl: 36px;           /* 标题字号 */
  
  /* 间距系统 */
  --spacing-xs: 4px;               /* 最小间距 */
  --spacing-sm: 8px;               /* 小间距 */
  --spacing-md: 16px;              /* 中等间距 */
  --spacing-lg: 24px;              /* 大间距 */
  --spacing-xl: 32px;              /* 超大间距 */
  --spacing-xxl: 48px;             /* 巨大间距 */
  
  /* 圆角系统 */
  --border-radius-sm: 4px;         /* 小圆角 */
  --border-radius-md: 8px;         /* 中等圆角 */
  --border-radius-lg: 12px;        /* 大圆角 */
  --border-radius-circle: 50%;     /* 圆形 */
  
  /* 阴影系统 */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.15);
  
  /* 过渡动画 */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  
  /* 布局 */
  --container-width: 1200px;
  --header-height: 70px;
}

/* ==========================================
   全局样式
   ========================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  line-height: 1.6;
  background-color: var(--bg-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition-fast);
}

ul {
  list-style: none;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

/* ==========================================
   顶部导航栏
   ========================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: var(--bg-white);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--primary-color);
}

.logo i {
  font-size: 28px;
}

.logo-text {
  letter-spacing: 1px;
}

/* 导航菜单 */
.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--spacing-xl);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  padding: var(--spacing-sm) 0;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width var(--transition-normal);
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link i {
  font-size: 10px;
}

/* 汉堡菜单按钮 */
.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-primary);
  border-radius: var(--border-radius-sm);
}

.mobile-menu-btn:hover {
  background-color: var(--bg-light);
  color: var(--primary-color);
}

/* 用户功能区 */
.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-circle);
  color: var(--text-primary);
  position: relative;
}

.icon-btn:hover {
  background-color: var(--bg-light);
  color: var(--primary-color);
}

.cart-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background-color: var(--secondary-color);
  color: var(--text-white);
  font-size: 11px;
  border-radius: var(--border-radius-circle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ==========================================
   Hero轮播区
   ========================================== */
.hero-section {
  margin-top: var(--header-height);
  position: relative;
  height: 550px;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.hero-slider {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
}

.hero-slide.active {
  opacity: 1;
  visibility: visible;
}

.hero-slide.active .hero-text-wrapper {
  animation: slideInUp 0.8s ease-out;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* 渐变遮罩层 */
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 0, 0, 0.4) 100%
  );
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--spacing-xxl);
  color: var(--text-white);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero-text-wrapper {
  max-width: 600px;
}

/* 徽章 */
.badge {
  width: 70px;
  height: 70px;
  border: 3px solid var(--text-white);
  border-radius: var(--border-radius-circle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--spacing-lg);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.badge-text {
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  letter-spacing: 2px;
}

.hero-title {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: 3px;
  margin-bottom: var(--spacing-md);
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 18px;
  margin-bottom: var(--spacing-xl);
  opacity: 0.95;
  font-weight: 400;
  letter-spacing: 1px;
}

.hero-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}

.price-current {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: 1px;
}

.price-original {
  font-size: 24px;
  text-decoration: line-through;
  opacity: 0.8;
  font-weight: 400;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 16px 40px;
  background-color: var(--text-white);
  color: var(--primary-color);
  font-size: 16px;
  font-weight: 700;
  border-radius: 50px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transition: all var(--transition-normal);
  letter-spacing: 1px;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  background-color: rgba(255, 255, 255, 0.95);
}

.btn-primary:active {
  transform: translateY(-1px);
}

.btn-primary i {
  transition: transform var(--transition-fast);
}

.btn-primary:hover i {
  transform: translateX(4px);
}

/* 轮播指示器 */
.hero-indicators {
  position: absolute;
  bottom: var(--spacing-xl);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--spacing-md);
  z-index: 4;
}

.indicator {
  width: 10px;
  height: 10px;
  border-radius: var(--border-radius-circle);
  background-color: rgba(255, 255, 255, 0.4);
  border: 2px solid transparent;
  transition: all var(--transition-normal);
  cursor: pointer;
}

.indicator:hover {
  background-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.2);
}

.indicator.active {
  width: 40px;
  background-color: var(--text-white);
  border-radius: 10px;
}

/* 轮播箭头 */
.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  background-color: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  color: var(--text-white);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--border-radius-circle);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  transition: all var(--transition-normal);
  font-size: 18px;
}

.hero-arrow:hover {
  background-color: rgba(255, 255, 255, 0.95);
  color: var(--primary-color);
  border-color: var(--text-white);
  transform: translateY(-50%) scale(1.1);
}

.hero-arrow:active {
  transform: translateY(-50%) scale(0.95);
}

.hero-arrow-prev {
  left: var(--spacing-xl);
}

.hero-arrow-next {
  right: var(--spacing-xl);
}

/* ==========================================
   新品上市区
   ========================================== */
.new-arrivals {
  padding: var(--spacing-xxl) 0;
  background-color: var(--bg-white);
}

.section-header {
  text-align: center;
  margin-bottom: var(--spacing-xxl);
}

.section-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
  padding: var(--spacing-md);
  background-color: var(--text-primary);
  color: var(--text-white);
  display: inline-block;
  border-radius: var(--border-radius-sm);
}

.section-subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* 产品网格 */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-lg);
}

.product-card {
  background-color: var(--bg-white);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.product-image {
  position: relative;
  width: 100%;
  padding-top: 100%; /* 1:1 比例 */
  overflow: hidden;
  background-color: var(--bg-light);
}

.product-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.product-card:hover .product-image img {
  transform: scale(1.1);
}

/* 产品遮罩层 */
.product-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.product-card:hover .product-overlay {
  opacity: 1;
}

.btn-icon {
  width: 48px;
  height: 48px;
  background-color: var(--bg-white);
  color: var(--text-primary);
  border-radius: var(--border-radius-circle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-lg);
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background-color: var(--primary-color);
  color: var(--text-white);
  transform: scale(1.1);
}

/* 产品信息 */
.product-info {
  padding: var(--spacing-lg);
}

.product-name {
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-price {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: var(--spacing-sm);
}

.product-desc {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================
   页脚
   ========================================== */
.footer {
  background-color: var(--bg-dark);
  color: var(--text-white);
  padding: var(--spacing-xl) 0;
  text-align: center;
}

.footer p {
  font-size: var(--font-size-sm);
  opacity: 0.8;
}

/* ==========================================
   响应式设计
   ========================================== */

/* 平板设备 (768px - 1024px) */
@media (max-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .hero-title {
    font-size: 36px;
  }
}

/* 移动设备 (320px - 767px) */
@media (max-width: 767px) {
  :root {
    --header-height: 60px;
    --spacing-xxl: 32px;
  }
  
  .container {
    padding: 0 var(--spacing-md);
  }
  
  /* 导航栏 */
  .navbar {
    position: relative;
  }
  
  .mobile-menu-btn {
    display: flex;
  }
  
  .nav-menu {
    position: fixed;
    top: var(--header-height);
    left: -100%;
    width: 280px;
    height: calc(100vh - var(--header-height));
    background-color: var(--bg-white);
    box-shadow: var(--shadow-lg);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: var(--spacing-lg);
    transition: left var(--transition-normal);
    z-index: 999;
    overflow-y: auto;
  }
  
  .nav-menu.active {
    left: 0;
  }
  
  .nav-item {
    width: 100%;
    border-bottom: 1px solid var(--border-color);
  }
  
  .nav-link {
    display: flex;
    width: 100%;
    padding: var(--spacing-md) 0;
    font-size: var(--font-size-md);
  }
  
  .nav-link::after {
    display: none;
  }
  
  .logo {
    font-size: var(--font-size-lg);
  }
  
  .logo i {
    font-size: 20px;
  }
  
  .logo-text {
    display: none;
  }
  
  .nav-actions {
    gap: var(--spacing-xs);
  }
  
  .icon-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  
  /* Hero区 */
  .hero-section {
    height: 480px;
  }
  
  .hero-content {
    padding: 0 var(--spacing-lg);
  }
  
  .hero-text-wrapper {
    max-width: 100%;
  }
  
  .badge {
    width: 55px;
    height: 55px;
    margin-bottom: var(--spacing-md);
    border-width: 2px;
  }
  
  .badge-text {
    font-size: 13px;
    letter-spacing: 1px;
  }
  
  .hero-title {
    font-size: 32px;
    letter-spacing: 2px;
    margin-bottom: var(--spacing-sm);
  }
  
  .hero-subtitle {
    font-size: 15px;
    margin-bottom: var(--spacing-lg);
  }
  
  .hero-price {
    margin-bottom: var(--spacing-lg);
  }
  
  .price-current {
    font-size: 36px;
  }
  
  .price-original {
    font-size: 18px;
  }
  
  .btn-primary {
    padding: 13px 28px;
    font-size: 14px;
  }
  
  .hero-arrow {
    width: 44px;
    height: 44px;
    font-size: 16px;
  }
  
  .hero-arrow-prev {
    left: var(--spacing-md);
  }
  
  .hero-arrow-next {
    right: var(--spacing-md);
  }
  
  .hero-indicators {
    bottom: var(--spacing-lg);
    gap: var(--spacing-sm);
  }
  
  .indicator {
    width: 8px;
    height: 8px;
  }
  
  .indicator.active {
    width: 28px;
  }
  
  /* 产品网格 */
  .new-arrivals {
    padding: var(--spacing-xl) 0;
  }
  
  .section-header {
    margin-bottom: var(--spacing-xl);
  }
  
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
  }
  
  .section-title {
    font-size: var(--font-size-md);
    padding: var(--spacing-sm) var(--spacing-md);
  }
  
  .section-subtitle {
    font-size: 11px;
  }
  
  .product-card {
    border-radius: var(--border-radius-md);
  }
  
  .product-info {
    padding: var(--spacing-sm);
  }
  
  .product-name {
    font-size: 13px;
    margin-bottom: 4px;
  }
  
  .product-price {
    font-size: var(--font-size-md);
    margin-bottom: 4px;
  }
  
  .product-desc {
    font-size: 11px;
    line-height: 1.4;
  }
  
  .btn-icon {
    width: 40px;
    height: 40px;
    font-size: var(--font-size-md);
  }
}

/* 超小设备 (< 480px) */
@media (max-width: 480px) {
  .hero-section {
    height: 420px;
  }
  
  .hero-title {
    font-size: 26px;
    letter-spacing: 1px;
  }
  
  .hero-subtitle {
    font-size: 14px;
  }
  
  .badge {
    width: 50px;
    height: 50px;
  }
  
  .badge-text {
    font-size: 12px;
  }
  
  .price-current {
    font-size: 32px;
  }
  
  .price-original {
    font-size: 16px;
  }
  
  .btn-primary {
    padding: 12px 24px;
    font-size: 13px;
  }
  
  .hero-arrow {
    width: 40px;
    height: 40px;
  }
  
  .hero-arrow-prev {
    left: var(--spacing-sm);
  }
  
  .hero-arrow-next {
    right: var(--spacing-sm);
  }
  
  .product-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
  
  .nav-menu {
    width: 100%;
    left: -100%;
  }
}

/* ==========================================
   动画效果
   ========================================== */

/* 淡入动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card {
  animation: fadeIn 0.6s ease forwards;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }

/* 加载动画 */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* 无障碍访问 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 打印样式 */
@media print {
  .header,
  .hero-section,
  .footer {
    display: none;
  }
  
  .product-card {
    break-inside: avoid;
  }
}

