/* ========================================
   好物购 — 样式
   简约大气 · 移动优先
   ======================================== */

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue",
               Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #2d2d2d;
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================
   Header — 好物购 + 分类 + 搜索 全在一条
   ============================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  height: 62px;
}

/* ---- Logo（最左） ---- */
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
  color: #2d2d2d;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.logo-dot {
  width: 8px;
  height: 8px;
  background: #ff4757;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* ---- 分类标签（中间，填满） ---- */
.category-nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  white-space: nowrap;
  padding: 0 12px;
}

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

.cat-tab {
  flex-shrink: 0;
  padding: 6px 0;
  font-size: 17px;
  font-family: inherit;
  font-weight: 500;
  color: #999;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.cat-tab:hover {
  color: #555;
}

.cat-tab.active {
  color: #ff4757;
  border-bottom-color: #ff4757;
  font-weight: 600;
}

/* ---- 搜索框（最右） ---- */
.search-box {
  position: relative;
  width: 180px;
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  font-size: 14px;
  font-family: inherit;
  color: #2d2d2d;
  background: #f5f5f5;
  border: 1px solid transparent;
  border-radius: 8px;
  outline: none;
  transition: all 0.2s ease;
}

.search-input::placeholder {
  color: #bbb;
}

.search-input:focus {
  background: #ffffff;
  border-color: #ddd;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
}

/* 放大镜图标 */
.search-box::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  border: 2px solid #bbb;
  border-radius: 50%;
  pointer-events: none;
}

.search-box::after {
  content: '';
  position: absolute;
  left: 20px;
  top: 58%;
  transform: translateY(-50%) rotate(45deg);
  width: 5px;
  height: 2px;
  background: #bbb;
  border-radius: 1px;
  pointer-events: none;
}

/* ============================================
   Tagline — 精简宣传语
   ============================================ */
.tagline-bar {
  padding: 22px 0;
  text-align: center;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
}

.tagline-text {
  font-size: 18px;
  font-weight: 600;
  color: #555;
  margin: 0;
  letter-spacing: 0.5px;
}

/* ============================================
   Products Section
   ============================================ */
.products {
  padding: 32px 0 60px;
}

.section-header {
  text-align: center;
  margin-bottom: 28px;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 6px;
}

.section-desc {
  font-size: 14px;
  color: #aaa;
}

/* ---------- Products Grid ---------- */
.products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 640px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (min-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Goods Card ---------- */
.goods-card {
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #f0f0f0;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.goods-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.goods-link {
  display: block;
  color: inherit;
}

/* Image */
.goods-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f8f9fa;
  overflow: hidden;
}

.goods-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.goods-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
}

.placeholder-icon {
  font-size: 40px;
  opacity: 0.6;
}

.placeholder-text {
  font-size: 13px;
  color: #bbb;
}

/* Platform Badge */
.platform-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  color: #fff;
  letter-spacing: 0.5px;
}

.tag-taobao { background: #ff5000; }
.tag-jd     { background: #c91623; }
.tag-pdd    { background: #e02e24; }
.tag-douyin { background: #111111; }
.tag-other  { background: #888888; }

/* Info */
.goods-info {
  padding: 16px 18px 20px;
}

.goods-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: #1a1a1a;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.goods-desc {
  font-size: 13px;
  color: #999;
  line-height: 1.5;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Price */
.goods-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
}

.price-current {
  font-size: 20px;
  font-weight: 700;
  color: #ff4757;
}

.price-original {
  font-size: 13px;
  color: #bbb;
  text-decoration: line-through;
}

/* Button */
.goods-btn {
  display: block;
  width: 100%;
  padding: 12px 0;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  background: #ff4757;
  border-radius: 10px;
  transition: background 0.2s ease, transform 0.15s ease;
  cursor: pointer;
}

.goods-btn:hover { background: #e83a4a; }
.goods-btn:active { transform: scale(0.98); }

/* 占位商品 */
.goods-card-placeholder {
  opacity: 0.5;
  pointer-events: none;
}

.goods-coming {
  display: block;
  text-align: center;
  padding: 12px 0;
  font-size: 14px;
  font-weight: 500;
  color: #ccc;
}

/* ============================================
   Footer — 卖点 + 信息
   ============================================ */
.footer {
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid #f0f0f0;
  background: #fafafa;
}

/* 卖点三列 */
.footer-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.fstat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.fstat-num {
  font-size: 16px;
  font-weight: 700;
  color: #2d2d2d;
}

.fstat-label {
  font-size: 12px;
  color: #aaa;
}

.fstat-divider {
  color: #ddd;
  font-size: 18px;
  font-weight: 300;
}

.footer-text {
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
}

.footer-note {
  font-size: 12px;
  color: #bbb;
  margin-bottom: 8px;
}

.footer-copy {
  font-size: 12px;
  color: #ccc;
}

.footer-icp {
  margin-top: 10px;
  font-size: 12px;
}
.footer-icp a {
  color: #bbb;
  text-decoration: none;
}
.footer-icp a:hover {
  color: #999;
}

/* ============================================
   No Result
   ============================================ */
.no-result {
  text-align: center;
  padding: 60px 20px;
  color: #bbb;
}

.no-result-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
}

.no-result p {
  font-size: 15px;
}

/* ============================================
   响应式 — 手机端
   ============================================ */
@media (max-width: 768px) {
  .header-inner {
    height: 54px;
  }

  .logo {
    font-size: 17px;
    gap: 6px;
  }

  .logo-dot {
    width: 7px;
    height: 7px;
  }

  /* 手机上分类缩小，可左右滑动，间距缩小 */
  .category-nav {
    gap: 16px;
    justify-content: flex-start;
  }

  .cat-tab {
    padding: 5px 0;
    font-size: 14px;
  }

  /* 手机上搜索框缩小 */
  .search-box {
    width: 120px;
  }

  .search-input {
    padding: 7px 8px 7px 28px;
    font-size: 13px;
  }

  .search-box::before {
    left: 8px;
    width: 11px;
    height: 11px;
  }

  .search-box::after {
    left: 16px;
    width: 4px;
  }

  .tagline-bar {
    padding: 14px 0;
  }

  .tagline-text {
    font-size: 15px;
  }

  .products {
    padding: 20px 0 40px;
  }

  .section-title {
    font-size: 18px;
  }

  .products-grid {
    gap: 14px;
  }

  .goods-info {
    padding: 12px 12px 14px;
  }

  .goods-title {
    font-size: 14px;
  }

  .price-current {
    font-size: 17px;
  }

  .goods-btn {
    padding: 10px 0;
    font-size: 14px;
  }

  .footer-stats {
    gap: 12px;
  }

  .fstat-num {
    font-size: 14px;
  }
}

/* 小屏手机 */
@media (max-width: 380px) {
  .header-inner {
    gap: 8px;
  }

  .logo {
    font-size: 15px;
  }

  .cat-tab {
    padding: 5px 10px;
    font-size: 12px;
  }

  .search-box {
    width: 110px;
  }

  .search-input {
    font-size: 12px;
    padding: 6px 6px 6px 26px;
  }
}
