/* ============================================
   迎鑫童鞋 — 全局样式
   移动优先，适配微信内置浏览器
   ============================================ */

/* --- 基础重置 --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #FF6B6B;
  --primary-dark: #E55A5A;
  --primary-light: #FFF0F0;
  --accent: #FFB347;
  --bg: #FFFBF7;
  --card: #FFFFFF;
  --text: #333333;
  --text-light: #999999;
  --text-mid: #666666;
  --border: #F0E8E4;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.04);
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --nav-height: 56px;
  --header-height: 50px;

  /* 分类主题色 */
  --boy-color: #4DA6FF;
  --boy-light: #EDF5FF;
  --girl-color: #FF7EB3;
  --girl-light: #FFF0F5;
  --baby-color: #FFB347;
  --baby-light: #FFF8ED;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-height) + 32px);
  -webkit-tap-highlight-color: transparent;
  /* 页面入场 */
  animation: pageIn 0.25s ease;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- 顶部导航栏 --- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 12px rgba(255,107,107,0.25);
}

.header .back-btn {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  text-decoration: none;
  font-size: 1.3rem;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  line-height: 1;
}

/* --- 底部导航栏 --- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--nav-height);
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.05);
}

.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-light);
  font-size: 0.68rem;
  gap: 3px;
  transition: color 0.2s;
  position: relative;
}

.bottom-nav a.active {
  color: var(--primary);
  font-weight: 600;
}

.bottom-nav a.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2.5px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
}

.bottom-nav a .icon {
  font-size: 1.25rem;
}

/* --- 首页 Hero --- */
.hero {
  background: linear-gradient(160deg, #FF6B6B 0%, #FF8E53 50%, #FFB347 100%);
  color: #fff;
  text-align: center;
  padding: 44px 28px 40px;
  position: relative;
  overflow: hidden;
}

/* 装饰圆点 */
.hero::before {
  content: '';
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  top: -30px;
  right: -30px;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -18px;
  left: 0;
  right: 0;
  height: 36px;
  background: var(--bg);
  border-radius: 60% 60% 0 0;
}

.hero h1 {
  font-size: 1.85rem;
  font-weight: 700;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.hero .slogan {
  font-size: 0.95rem;
  opacity: 0.92;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

.hero .desc {
  font-size: 0.78rem;
  opacity: 0.72;
  margin-top: 10px;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

/* --- 首页分类入口 --- */
.category-entry {
  display: flex;
  gap: 10px;
  padding: 16px 14px;
}

.category-entry a {
  flex: 1;
  text-decoration: none;
  background: #fff;
  border-radius: var(--radius);
  padding: 18px 8px 14px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

/* 分类顶部色条 */
.category-entry a:nth-child(1) { border-top: 3px solid var(--boy-color); }
.category-entry a:nth-child(2) { border-top: 3px solid var(--girl-color); }
.category-entry a:nth-child(3) { border-top: 3px solid var(--baby-color); }

.category-entry a:active {
  transform: scale(0.96);
  box-shadow: var(--shadow-sm);
}

.category-entry .cat-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 6px;
}

.category-entry .cat-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.category-entry .cat-count {
  font-size: 0.7rem;
  color: var(--text-light);
  margin-top: 2px;
}

/* --- 区块标题 --- */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 10px;
  font-size: 1rem;
  font-weight: 700;
}

.section-title .more {
  font-size: 0.78rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 2px;
}

/* --- 商品卡片 --- */
.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  padding: 0 14px 24px;
}

.product-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s, box-shadow 0.2s;
  display: block;
}

.product-card:active {
  transform: scale(0.97);
  box-shadow: var(--shadow-sm);
}

.product-card .img-box {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  position: relative;
  overflow: hidden;
}

.product-card .img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

.product-card .img-box .placeholder-emoji {
  position: relative;
  z-index: 1;
}

.product-card .info {
  padding: 10px 12px 12px;
}

.product-card .name {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #222;
}

.product-card .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.product-card .price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

.product-card .price-unit {
  font-size: 0.7rem;
  font-weight: 500;
}

.product-card .tag {
  font-size: 0.68rem;
  background: #F5F5F5;
  color: var(--text-mid);
  padding: 3px 10px;
  border-radius: 20px;
}

/* 已售罄 */
.product-card.sold-out {
  opacity: 0.6;
}

.product-card.sold-out .img-box::after {
  content: '已售罄';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 5px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  z-index: 5;
  letter-spacing: 1px;
}

/* --- 分类标签 --- */
.category-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  position: sticky;
  top: var(--header-height);
  z-index: 50;
  background: var(--bg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar { display: none; }

.category-tabs .tab {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: 22px;
  font-size: 0.85rem;
  background: #fff;
  border: 1.5px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  user-select: none;
  font-weight: 500;
}

.category-tabs .tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(255,107,107,0.25);
}

/* --- 商品详情 --- */
.detail-images {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  overflow: hidden;
}

.detail-images img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

.detail-info {
  padding: 18px 16px 12px;
  background: #fff;
}

.detail-info .name {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.4;
}

.detail-info .price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.detail-info .price {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
}

.detail-info .price .unit {
  font-size: 0.85rem;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-meta .meta-item {
  background: #F8F8F8;
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 0.78rem;
  color: var(--text-mid);
}

.detail-section {
  padding: 0 16px 16px;
}

.detail-section h3 {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 10px;
  padding-top: 10px;
  color: #444;
}

/* --- 尺码标签 --- */
.size-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.size-tag {
  min-width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fff;
  border: 1.5px solid #E8E3DF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  padding: 0 6px;
}

/* --- 颜色标签 --- */
.color-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-tag {
  padding: 6px 16px;
  border-radius: 16px;
  background: #fff;
  border: 1.5px solid #E8E3DF;
  font-size: 0.82rem;
  color: var(--text-mid);
}

/* --- 商品描述 --- */
.product-desc {
  font-size: 0.88rem;
  line-height: 1.85;
  color: #666;
  padding: 12px 16px;
  background: #fff;
  margin: 0 16px;
  border-radius: var(--radius-sm);
}

/* --- 按钮 --- */
.btn-contact {
  display: block;
  width: calc(100% - 32px);
  margin: 16px 16px 24px;
  padding: 15px 0;
  text-align: center;
  background: linear-gradient(135deg, var(--primary), #FF8E53);
  color: #fff;
  border: none;
  border-radius: 28px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  letter-spacing: 1px;
  box-shadow: 0 4px 16px rgba(255,107,107,0.28);
  transition: opacity 0.15s, transform 0.15s;
}

.btn-contact:active {
  opacity: 0.85;
  transform: scale(0.98);
}

.btn-outline {
  display: block;
  width: calc(100% - 32px);
  margin: 8px 16px;
  padding: 13px 0;
  text-align: center;
  background: #fff;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: 28px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

/* --- 联系页卡片 --- */
.contact-card {
  margin: 16px 14px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.contact-card .card-header {
  background: linear-gradient(135deg, #FF6B6B, #FF8E53);
  color: #fff;
  padding: 28px 16px;
  text-align: center;
}

.contact-card .card-header .shop-name {
  font-size: 1.35rem;
  font-weight: 700;
}

.contact-card .card-body {
  padding: 4px 0;
}

.contact-item {
  display: flex;
  align-items: center;
  padding: 15px 16px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid #F5F0EC;
  gap: 14px;
  cursor: pointer;
  transition: background 0.15s;
}

.contact-item:active {
  background: #FAFAFA;
}

.contact-item:last-child {
  border-bottom: none;
}

.contact-item .ci-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.contact-item .ci-icon.phone   { background: #FFF0F0; }
.contact-item .ci-icon.wechat  { background: #E8F8E8; }
.contact-item .ci-icon.address { background: #FFF4E8; }
.contact-item .ci-icon.time    { background: #EDF4FF; }

.contact-item .ci-text {
  flex: 1;
  line-height: 1.5;
}

.contact-item .ci-text .ci-label {
  font-size: 0.73rem;
  color: var(--text-light);
}

.contact-item .ci-text .ci-value {
  font-size: 0.95rem;
  font-weight: 500;
}

.contact-item .ci-arrow {
  color: #D0D0D0;
  font-size: 1rem;
  flex-shrink: 0;
}

/* --- 服务说明 --- */
.services {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 14px 20px;
}

.service-item {
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 18px 10px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.service-item .si-icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 6px;
}

.service-item .si-text {
  font-size: 0.78rem;
  color: var(--text-mid);
  line-height: 1.5;
}

/* --- Toast --- */
.toast {
  position: fixed;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.78);
  color: #fff;
  padding: 14px 24px;
  border-radius: 24px;
  font-size: 0.9rem;
  z-index: 9999;
  pointer-events: none;
  animation: toastIn 0.3s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* --- 空状态 --- */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-light);
}

.empty-state .empty-icon {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 16px;
}

/* --- 商品排号标签 --- */
.badge-soldout {
  display: inline-block;
  background: #B0B0B0;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: 10px;
  margin-left: 8px;
  vertical-align: middle;
}

/* --- 详情页图片下方的滑动提示 --- */
.image-hint {
  text-align: center;
  font-size: 0.72rem;
  color: #bbb;
  padding: 6px;
  background: #fff;
}
