/* ============================================
   首页样式 - 有赞风格品质版
   ============================================ */

/* 顶部导航 - 首页专用 */
.home-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 14px 16px;
  padding-top: calc(14px + var(--safe-top));
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(238,103,34,0.3);
  transition: backdrop-filter 0.3s, -webkit-backdrop-filter 0.3s, box-shadow 0.3s, background 0.3s;
}
/* 下拉时导航栏背景模糊效果增强 */
.home-header.scrolled {
  background: linear-gradient(135deg, rgba(238,103,34,0.92) 0%, rgba(212,85,16,0.92) 100%);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  box-shadow: 0 4px 20px rgba(238,103,34,0.35);
}

.home-header .top-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.home-header .logo-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.home-header .logo-icon {
  width: 30px;
  height: 30px;
  background: rgba(255,255,255,0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.home-header .logo-text {
  font-size: 19px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}

.home-header .search-bar {
  flex: 1;
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius-xl);
  padding: 9px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background 0.2s;
  border: 1px solid rgba(255,255,255,0.1);
}

.home-header .search-bar:active {
  background: rgba(255,255,255,0.3);
}

.home-header .search-bar .search-icon {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
}

.home-header .search-bar .search-placeholder {
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  flex: 1;
}

/* 消息入口 */
.home-header .header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.home-header .header-actions .action-icon {
  color: rgba(255,255,255,0.85);
  font-size: 18px;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s;
}

.home-header .header-actions .action-icon:active {
  transform: scale(0.9);
}

.home-header .header-actions .action-dot {
  position: absolute;
  top: -2px;
  right: -3px;
  width: 7px;
  height: 7px;
  background: #FFD700;
  border-radius: 50%;
}

/* 分类导航 */
.category-nav {
  background: #fff;
  padding: 12px 0 14px;
  margin: 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 99;
  top: -10px;
  margin-bottom: -10px;
}

.category-nav .scroll-wrap {
  display: flex;
  overflow-x: auto;
  gap: 0;
  padding: 0 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-nav .scroll-wrap::-webkit-scrollbar {
  display: none;
}

.category-nav .cat-item {
  flex-shrink: 0;
  width: 66px;
  text-align: center;
  padding: 4px 0;
  cursor: pointer;
  transition: transform 0.15s;
}

.category-nav .cat-item:active {
  transform: scale(0.92);
}

.category-nav .cat-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 5px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: var(--bg);
  transition: background 0.2s;
}

.category-nav .cat-item:nth-child(1) .cat-icon { background: #FFF0E8; }
.category-nav .cat-item:nth-child(2) .cat-icon { background: #FFEBEE; }
.category-nav .cat-item:nth-child(3) .cat-icon { background: #E8F8F0; }
.category-nav .cat-item:nth-child(4) .cat-icon { background: #FFF8E8; }
.category-nav .cat-item:nth-child(5) .cat-icon { background: #FFF0E8; }
.category-nav .cat-item:nth-child(6) .cat-icon { background: #E8F0FE; }
.category-nav .cat-item:nth-child(7) .cat-icon { background: #F3E8FF; }
.category-nav .cat-item:nth-child(8) .cat-icon { background: #E8F8F0; }

.category-nav .cat-label {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.2;
  font-weight: 500;
}

/* Banner轮播 */
.banner-section {
  margin: 0;
  padding: 0 12px;
  position: relative;
  z-index: 98;
}

.banner-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.banner-slider {
  display: flex;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.banner-slider .banner-item {
  width: 100%;
  flex-shrink: 0;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  position: relative;
  background: var(--bg);
}

.banner-slider .banner-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.banner-slider .banner-item:hover img {
  transform: scale(1.05);
}

.banner-slider .banner-item .banner-tag {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 12px;
  padding: 4px 14px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.banner-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
}

.banner-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.45);
  transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.banner-dots .dot.active {
  width: 20px;
  background: #fff;
}

/* 功能入口区 - 8宫格（有赞金刚区风格） */
.quick-entry {
  background: #fff;
  margin: 12px 12px 0;
  border-radius: var(--radius-lg);
  padding: 18px 8px 14px;
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px 0;
}

.quick-entry .entry-item {
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s;
}

.quick-entry .entry-item:active {
  transform: scale(0.92);
}

.quick-entry .entry-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 7px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: linear-gradient(135deg, #F5F6F8, #EBEDF0);
  transition: transform 0.2s, box-shadow 0.2s;
}
/* 金刚区图标微动效 */
.quick-entry .entry-item:hover .entry-icon {
  animation: entryGentleBounce 0.6s ease;
}
.quick-entry .entry-item:active .entry-icon {
  transform: scale(0.88);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
@keyframes entryGentleBounce {
  0%,100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
  60% { transform: translateY(-2px); }
}

.quick-entry .entry-item:nth-child(1) .entry-icon { background: linear-gradient(135deg, #FFE8D6, #FFD6B8); }
.quick-entry .entry-item:nth-child(2) .entry-icon { background: linear-gradient(135deg, #FFE0E0, #FFCCCC); }
.quick-entry .entry-item:nth-child(3) .entry-icon { background: linear-gradient(135deg, #D4F0E8, #B8E6D6); }
.quick-entry .entry-item:nth-child(4) .entry-icon { background: linear-gradient(135deg, #FFE8D6, #FFE0B8); }
.quick-entry .entry-item:nth-child(5) .entry-icon { background: linear-gradient(135deg, #E8ECF8, #D6DCF0); }
.quick-entry .entry-item:nth-child(6) .entry-icon { background: linear-gradient(135deg, #FFF8E0, #FFF0B8); }
.quick-entry .entry-item:nth-child(7) .entry-icon { background: linear-gradient(135deg, #F0E8FF, #E0D6F0); }
.quick-entry .entry-item:nth-child(8) .entry-icon { background: linear-gradient(135deg, #D4F0E8, #B8E6D6); }

.quick-entry .entry-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* 区块标题 */
.section-block {
  margin: 12px 12px 0;
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.section-header {
  display: flex;
  align-items: center;
  padding: 16px 16px 12px;
  gap: 8px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  flex: 1;
  color: var(--text);
  letter-spacing: 0.3px;
}

.section-title .highlight {
  color: var(--accent);
}

.section-more {
  font-size: 12px;
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.section-more:active {
  background: var(--bg);
  color: var(--primary);
}

/* 秒杀区 */
.flash-section-inner {
  padding: 0 16px 16px;
}

.flash-timer-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.flash-timer-bar .timer-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.flash-timer-bar .timer-box {
  display: flex;
  gap: 4px;
}

.flash-timer-bar .timer-unit {
  background: var(--text);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  min-width: 26px;
  text-align: center;
  font-family: 'Courier New', 'SF Mono', monospace;
  position: relative;
  overflow: hidden;
}
/* 秒杀倒计时脉冲动画 */
.timer-unit.flash-pulse {
  animation: countdownPulse 1s ease-in-out infinite;
}
.timer-unit.flash-pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transform: translateX(-100%);
  animation: pulseShine 1.5s ease infinite;
}
@keyframes countdownPulse {
  0%,100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(231,76,60,0.4); }
  50% { transform: scale(1.05); box-shadow: 0 0 12px 4px rgba(231,76,60,0.2); }
}
@keyframes pulseShine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.flash-timer-bar .timer-sep {
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
}

.flash-list-h {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.flash-list-h::-webkit-scrollbar {
  display: none;
}

.flash-product-card {
  width: 110px;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.15s;
}

.flash-product-card:active {
  transform: scale(0.96);
}

.flash-product-card .fp-img {
  width: 110px;
  height: 110px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg);
}

.flash-product-card .fp-price {
  color: var(--accent);
  font-size: 16px;
  font-weight: 700;
  margin-top: 8px;
}

.flash-product-card .fp-price .fp-original {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 4px;
}

.flash-product-card .fp-progress {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}

.flash-product-card .fp-progress-bar {
  flex: 1;
  height: 4px;
  background: #FFE0E0;
  border-radius: 2px;
  overflow: hidden;
}

.flash-product-card .fp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 2px;
  transition: width 0.5s ease;
}

.flash-product-card .fp-progress-text {
  font-size: 10px;
  color: var(--accent);
  font-weight: 600;
}

/* 拼团区 */
.group-list-h {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 0 16px 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.group-list-h::-webkit-scrollbar {
  display: none;
}

/* 热卖推荐 - 瀑布流 */
.recommend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 16px 16px;
}

.product-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border-light);
  transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  animation: cardFadeIn 0.4s ease both;
}

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

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

.product-card .pc-img-wrap {
  position: relative;
  background: var(--bg);
  overflow: hidden;
}

.product-card .pc-img-wrap::before {
  content: '';
  display: block;
  padding-bottom: 100%;
}

.product-card .pc-img-wrap img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.product-card:active .pc-img-wrap img {
  transform: scale(1.05);
}

/* — 收藏按钮（心形） — */
.pc-fav-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 28px;
  height: 28px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.25,0.46,0.45,0.94);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  line-height: 1;
}
.pc-fav-btn:active {
  transform: scale(0.85);
}
.pc-fav-btn.faved {
  background: linear-gradient(135deg, var(--accent), #FF6B6B);
  color: #fff;
  box-shadow: 0 2px 10px rgba(231,76,60,0.35);
}
.pc-fav-btn .fav-heart {
  transition: transform 0.2s;
  display: inline-block;
}
.pc-fav-btn.faved .fav-heart {
  animation: heartBeat 0.4s ease;
}
@keyframes heartBeat {
  0%,100% { transform: scale(1); }
  25% { transform: scale(1.3); }
  50% { transform: scale(0.9); }
  75% { transform: scale(1.15); }
}

/* — 销量标签（左下角） — */
.pc-sales-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  z-index: 3;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  line-height: 1.3;
}

.product-card .pc-tag {
  position: absolute;
  top: 8px;
  left: 0;
  background: linear-gradient(135deg, var(--accent), #FF6B6B);
  color: #fff;
  font-size: 10px;
  padding: 2px 10px 2px 8px;
  border-radius: 0 4px 4px 0;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(231,76,60,0.3);
  z-index: 2;
}

.product-card .pc-tag.gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  box-shadow: 0 2px 6px rgba(212,168,67,0.3);
}

.product-card .pc-tag.green {
  background: linear-gradient(135deg, var(--success), #00D2A0);
  box-shadow: 0 2px 6px rgba(0,184,148,0.3);
}

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

.product-card .pc-name {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
  color: var(--text);
}

.product-card .pc-desc {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-card .pc-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.product-card .pc-price {
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.product-card .pc-price .pc-symbol {
  font-size: 12px;
  font-weight: 500;
}

.product-card .pc-original {
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: line-through;
}

.product-card .pc-sales {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 4px;
}

/* 会员专享 */
.member-only-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
}

/* 新人专享区 */
.newuser-inner {
  padding: 0 16px 16px;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.newuser-inner::-webkit-scrollbar {
  display: none;
}

.newuser-card {
  width: 160px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #FFF8E8 0%, #FFE8B8 100%);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: transform 0.15s;
}

.newuser-card:active {
  transform: scale(0.96);
}

.newuser-card .nu-price {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.newuser-card .nu-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
  font-weight: 500;
}

/* 品牌直供 */
.brand-strip {
  display: flex;
  gap: 8px;
  padding: 0 16px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.brand-strip::-webkit-scrollbar {
  display: none;
}

.brand-strip .brand-item {
  flex-shrink: 0;
  width: 80px;
  height: 40px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  border: 1px solid var(--border-light);
  transition: border-color 0.2s;
}

.brand-strip .brand-item:active {
  border-color: var(--primary);
}

/* ============================================
   懒加载图片 样式
   ============================================ */
.product-card img[data-src],
.product-card img.lazyload {
  opacity: 0;
  transition: opacity 0.4s ease, filter 0.4s ease;
  filter: blur(8px);
}
.product-card img.lazyloaded {
  opacity: 1;
  filter: blur(0);
}
.product-card img.lazyloaded + .lazy-placeholder {
  opacity: 0;
  pointer-events: none;
}
.lazy-placeholder {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--border-light) 0%, var(--bg) 50%, var(--border-light) 100%);
  background-size: 200% 200%;
  animation: lazyShimmer 1.8s ease infinite;
  z-index: 1;
  transition: opacity 0.4s ease;
}
@keyframes lazyShimmer {
  0% { background-position: 200% 50%; }
  100% { background-position: -200% 50%; }
}

/* ============================================
   下拉刷新指示器
   ============================================ */
.ptr-indicator {
  position: fixed;
  top: -50px;
  left: 0;
  right: 0;
  z-index: 200;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-light);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: top 0.3s cubic-bezier(0.25,0.46,0.45,0.94);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.ptr-indicator.show {
  top: 0;
}
.ptr-indicator .ptr-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.ptr-indicator .ptr-arrow {
  font-size: 16px;
  transition: transform 0.2s;
  display: inline-block;
}
.ptr-indicator.pulling .ptr-arrow {
  transform: rotate(180deg);
}
.ptr-indicator .ptr-text {
  font-weight: 500;
}
