/* ========== 苹果风格设计系统 ========== */
:root {
  --primary: #007AFF;
  --primary-dark: #0056B3;
  --secondary: #34C759;
  --accent: #FF9500;
  --danger: #FF3B30;
  --text: #1C1C1E;
  --text-secondary: #8E8E93;
  --text-tertiary: #C7C7CC;
  --bg: #F2F2F7;
  --bg-card: #FFFFFF;
  --separator: #C6C6C8;
  --shadow: 0 2px 10px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 20px rgba(0,0,0,0.12);
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; outline: none; font-family: inherit; background: none; }
input { font-family: inherit; font-size: inherit; outline: none; border: none; background: none; }

/* ========== 顶部导航 ========== */
.top-bar {
  background: rgba(28, 28, 30, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  color: white;
  padding: 6px 0;
  font-size: 12px;
  position: sticky;
  top: 0;
  z-index: 999;
}

.top-bar-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar-left { display: flex; align-items: center; gap: 16px; }
.top-bar-right { display: flex; align-items: center; gap: 12px; opacity: 0.8; }

/* ========== 主导航 ========== */
.header {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 0.5px solid var(--separator);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.nav { display: flex; gap: 6px; }
.nav-item {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s;
  color: var(--text-secondary);
}
.nav-item:hover { background: rgba(0, 122, 255, 0.08); color: var(--primary); }
.nav-item.active { background: var(--primary); color: white; }

.header-actions { display: flex; align-items: center; gap: 12px; }

.cart-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.cart-btn:hover { transform: scale(1.05); background: var(--primary); color: white; }
.cart-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  background: var(--danger);
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ========== 轮播图 ========== */
.hero {
  max-width: 1200px;
  margin: 16px auto;
  padding: 0 20px;
}

.hero-slider {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  height: 360px;
  box-shadow: var(--shadow);
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-slide.active { opacity: 1; }

.hero-slide-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  filter: brightness(0.85);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: white;
  padding: 40px;
}

.hero-title {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 12px;
}

.hero-subtitle {
  font-size: 16px;
  opacity: 0.95;
  margin-bottom: 24px;
  font-weight: 400;
}

.hero-btn {
  padding: 12px 28px;
  background: white;
  color: var(--text);
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s;
}
.hero-btn:hover { transform: scale(1.02); }

.hero-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all 0.3s;
}
.hero-dot.active { background: white; width: 24px; border-radius: 4px; }

/* ========== 分类导航 ========== */
.categories {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 20px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.category-item {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.category-item:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.category-item.active { background: var(--primary); color: white; }

.category-icon { font-size: 28px; margin-bottom: 6px; }
.category-name { font-size: 13px; font-weight: 500; }

/* ========== 商品列表 ========== */
.products-section {
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 20px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

.section-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.section-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.filter-btn {
  padding: 6px 14px;
  background: var(--bg-card);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.filter-btn:hover, .filter-btn.active { background: var(--primary); color: white; }

.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: all 0.2s;
  cursor: pointer;
}

.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }

.product-image {
  height: 160px;
  background: linear-gradient(135deg, #F5F5F7 0%, #E8E8ED 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 50px;
  position: relative;
}

.product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  background: var(--danger);
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-full);
}

.product-favorite {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.product-favorite:hover { background: var(--danger); color: white; transform: scale(1.1); }

.product-info { padding: 12px; }

.product-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.product-sales { display: flex; align-items: center; gap: 4px; }

.product-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.product-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.product-original-price {
  font-size: 13px;
  color: var(--text-tertiary);
  text-decoration: line-through;
  margin-left: 6px;
}

.add-cart-btn {
  padding: 8px 14px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}
.add-cart-btn:hover { background: var(--primary-dark); }

/* ========== 特性展示 ========== */
.features {
  background: var(--bg-card);
  padding: 50px 20px;
  margin-top: 50px;
  border-top: 0.5px solid var(--separator);
}

.features-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.feature-item {
  text-align: center;
  padding: 20px;
  border-radius: var(--radius-lg);
  transition: all 0.2s;
}

.feature-item:hover { background: var(--bg); }

.feature-icon { font-size: 42px; margin-bottom: 12px; }

.feature-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.feature-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ========== 页脚 ========== */
.footer {
  background: #1C1C1E;
  color: rgba(255,255,255,0.7);
  padding: 50px 20px 20px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand .logo { color: white; margin-bottom: 16px; }

.footer-brand-desc {
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 20px;
  opacity: 0.8;
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  opacity: 0.8;
}

.footer-title {
  font-size: 14px;
  font-weight: 600;
  color: white;
  margin-bottom: 16px;
}

.footer-links { display: flex; flex-direction: column; gap: 10px; }

.footer-link {
  font-size: 13px;
  transition: color 0.2s;
  opacity: 0.8;
}
.footer-link:hover { color: white; opacity: 1; }

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 20px;
  border-top: 0.5px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.footer-icp {
  font-size: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  opacity: 0.6;
}

.footer-icp a { transition: color 0.2s; }
.footer-icp a:hover { color: white; }

.footer-social { 
  display: flex; 
  gap: 12px; 
  flex-wrap: wrap;
}

.social-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.social-icon:hover { 
  background: var(--primary);
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 122, 255, 0.4);
}

/* 各平台专属配色 */
.social-icon.wechat:hover { background: #07C160; }
.social-icon.weibo:hover { background: #E6162D; }
.social-icon.douyin:hover { background: #000000; }
.social-icon { 
  /* 默认图标，在 JS 中会根据内容添加对应类名 */
}
