/* =============================================================================
 * 翊翊荟优选 · 首页 / 商品墙专属样式（VIBRANT / STREET-POP · 潮流活力风）
 * 区块：Hero 非对称大色块 / 服务承诺(撞色图标) / 分类矩阵 / 平台优选 / 商品墙(错落网格)
 * 依赖：style.css 设计令牌（全部 var()，暗色主题自动适配）
 * ========================================================================== */

/* ---------------------------------------------------------------------------
 * 1. Hero · 全屏焦点轮播（满幅大图 + 墨黑渐变 + 左侧文案浮层）
 * ------------------------------------------------------------------------ */
.hero {
  position: relative;
  width: 100%;
  height: 560px;
  overflow: hidden;
  background: var(--ink);
}
.hero-viewport { position: relative; width: 100%; height: 100%; overflow: hidden; }
.hero-track { position: relative; width: 100%; height: 100%; }

.hero-slide {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity .9s ease;
  pointer-events: none;
}
.hero-slide.is-active { opacity: 1; pointer-events: auto; z-index: 2; }

/* 满幅背景大图（缓慢推近，营造焦点感） */
.hero-bg {
  position: absolute; inset: 0;
  background-color: var(--ink-2);
  background-size: cover;
  background-position: center;
  transform: scale(1.12);
  transition: transform 9s ease, opacity .9s ease;
  will-change: transform;
}
.hero-slide.is-active .hero-bg { transform: scale(1); }

/* 墨黑渐变蒙版：左重右淡，保证左侧文案始终可读 */
.hero-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(90deg,
    rgba(10,10,14,.94) 0%,
    rgba(10,10,14,.82) 24%,
    rgba(10,10,14,.46) 52%,
    rgba(10,10,14,.12) 78%,
    rgba(10,10,14,0) 100%);
}
.hero-scrim::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(10,10,14,.42) 0%,
    rgba(10,10,14,0) 20%,
    rgba(10,10,14,0) 66%,
    rgba(10,10,14,.5) 100%);
}

/* 左侧雾蓝强调竖条 */
.hero-rail {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 6px; z-index: 5;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 26px var(--glow-accent);
}

/* 文案浮层（左侧，垂直居中） */
.hero-content {
  position: absolute;
  z-index: 6;
  left: 0; top: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 19px;
  width: min(640px, 86vw);
  padding-left: clamp(24px, 7vw, 110px);
  padding-right: 24px;
  color: #fff;
}
.hero-content > * { position: relative; z-index: 1; }

.hero-kicker {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 1.8px;
  color: var(--ink);
  background: var(--grad-accent, var(--accent));
  padding: 7px 16px;
  border-radius: 999px;
  box-shadow: 0 8px 22px var(--glow-accent);
}
.hero-title {
  margin: 0;
  font-size: 46px;
  font-weight: 900;
  line-height: 1.14;
  letter-spacing: -.5px;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0,0,0,.5);
}
.hero-title em { font-style: normal; color: var(--accent-2); }
.hero-sub {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.85;
  color: rgba(255,255,255,.82);
  max-width: 34em;
}
.hero-actions { display: flex; gap: 13px; flex-wrap: wrap; margin-top: 4px; }

/* 低调品牌水印（右下角） */
.hero-wm {
  position: absolute;
  right: clamp(24px, 5vw, 70px);
  bottom: 26px;
  z-index: 6;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 4px;
  color: rgba(255,255,255,.55);
  text-shadow: 0 2px 14px rgba(0,0,0,.55);
  pointer-events: none;
}

/* 轮播箭头 / 指示点 */
.hero-nav {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(20,20,26,.5);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 24px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 7;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
  user-select: none;
}
.hero-nav:hover { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: var(--glow-accent); }
.hero-prev { left: 18px; }
.hero-next { right: 18px; }
.hero-dots { position: absolute; left: 0; right: 0; bottom: 18px; display: flex; justify-content: center; gap: 9px; z-index: 7; }
.hero-dot {
  width: 26px; height: 5px; border: 0; border-radius: 4px; padding: 0;
  background: rgba(255,255,255,.3); cursor: pointer; transition: all .24s ease;
}
.hero-dot.is-active { width: 42px; background: var(--accent); box-shadow: 0 0 14px var(--glow-accent); }

/* ---------------------------------------------------------------------------
 * 2. 服务承诺（撞色图标）
 * ------------------------------------------------------------------------ */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 26px 0 16px; }
.feature {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.feature::after {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--fc, var(--accent)), transparent);
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-hi); }
.feature-icn {
  width: 50px; height: 50px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: #fff;
  background: var(--fc, var(--accent));
  box-shadow: 0 6px 18px color-mix(in srgb, var(--fc, var(--accent)) 40%, transparent);
  transition: transform .26s ease, box-shadow .26s ease;
}
.feature-icn svg { width: 24px; height: 24px; }
.feature:hover .feature-icn { transform: scale(1.08) rotate(-4deg); box-shadow: 0 0 28px color-mix(in srgb, var(--fc, var(--accent)) 55%, transparent); }
.feature h4 { margin: 0 0 3px; font-size: 15px; font-weight: 800; color: var(--text); }
.feature p { margin: 0; color: var(--muted); font-size: 12.5px; }

/* ---------------------------------------------------------------------------
 * 3. 分类矩阵（大色块卡片，取分类色）
 * ------------------------------------------------------------------------ */
.cat-section { margin-top: 30px; }
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.cat-card {
  --cat-color: #3D7BFF;
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  padding: 24px 16px 20px;
  text-align: center; color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.cat-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--cat-color);
  transform: scaleX(0); transform-origin: left;
  transition: transform .28s ease;
  box-shadow: 0 0 18px var(--cat-color);
}
.cat-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--cat-color) 55%, transparent);
  box-shadow: 0 14px 32px rgba(20,20,26,.1), 0 0 26px color-mix(in srgb, var(--cat-color) 30%, transparent);
  text-decoration: none; color: var(--text);
}
.cat-card:hover::before { transform: scaleX(1); }
.cat-icon {
  position: relative;
  width: 62px; height: 62px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 13px;
  color: #fff; background: var(--cat-color);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--cat-color) 42%, transparent);
  transition: transform .26s ease, box-shadow .26s ease;
}
.cat-card:hover .cat-icon { transform: scale(1.08) rotate(-4deg); box-shadow: 0 0 30px color-mix(in srgb, var(--cat-color) 55%, transparent); }
.cat-icon svg { width: 30px; height: 30px; }
.cat-name { font-size: 15px; font-weight: 800; margin-bottom: 5px; }
.cat-count { font-size: 12px; color: var(--muted); }
.cat-arrow {
  position: absolute; right: 13px; top: 13px;
  font-size: 15px; color: var(--cat-color);
  opacity: 0; transform: translateX(-6px);
  transition: opacity .22s ease, transform .22s ease;
}
.cat-card:hover .cat-arrow { opacity: 1; transform: translateX(0); }

/* ---------------------------------------------------------------------------
 * 4. 平台优选（横向卡片带）
 * ------------------------------------------------------------------------ */
.reco-band { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.reco-card {
  position: relative; display: flex; gap: 15px; padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.reco-card:hover { transform: translateY(-3px); border-color: var(--border-hi); box-shadow: var(--shadow); text-decoration: none; }
.reco-card .thumb {
  width: 96px; height: 96px; flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--paper-2) center/cover no-repeat;
  border: 1px solid var(--border);
}
.reco-card .thumb-ph { display: flex; align-items: center; justify-content: center; background: var(--grad-accent); }
.reco-card .thumb-ph::before { content: attr(data-cat); font-size: 12px; font-weight: 800; letter-spacing: 2px; color: #fff; text-align: center; padding: 0 6px; line-height: 1.5; }
.reco-card .info { min-width: 0; flex: 1; }
.reco-card .info h4 { margin: 0 0 6px; font-size: 14px; font-weight: 700; line-height: 1.5; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.reco-card .info .desc { margin: 0 0 8px; font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.reco-card .info .p { color: var(--accent); font-weight: 900; font-size: 17px; font-variant-numeric: tabular-nums; }
.reco-card .info .p small { color: var(--muted); font-weight: 600; font-size: 12px; }

/* ---------------------------------------------------------------------------
 * 5. 商品墙 · 错落大小卡片网格（columns 瀑布流 + 不等封面比例）
 * ------------------------------------------------------------------------ */
.goods-section { padding-top: 6px; }
.goods-search { display: flex; gap: 9px; }
.goods-search select,
.goods-search input[type="text"] {
  height: 40px; padding: 0 13px;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  background: var(--paper-2); color: var(--text); font-size: 13.5px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.goods-search select:focus,
.goods-search input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(61,123,255,.14); }
.goods-search select { width: 138px; }
.goods-search input[type="text"] { width: 220px; }
.goods-search .btn { height: 40px; }

/* 真实瀑布流：列布局 + 卡片内部分隔，封面比例错落 → 年轻跳脱的网格感 */
.goods-grid {
  columns: 4;
  column-gap: 16px;
  margin-top: 4px;
}
.goods-grid .product {
  display: block;
  width: 100%;
  margin: 0 0 16px;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
}
.goods-grid .product .cover { aspect-ratio: 1 / 1; }
/* 周期性改变封面比例，制造大小错落 */
.goods-grid .product:nth-child(5n+1) .cover { aspect-ratio: 4 / 5; }
.goods-grid .product:nth-child(7n+3) .cover { aspect-ratio: 4 / 3; }
.goods-grid .product:nth-child(4n+2) .cover { aspect-ratio: 1 / 1; }
.goods-grid .product:nth-child(6n+4) .cover { aspect-ratio: 3 / 4; }
/* NEW 角标移到右上，避免与 HOT/优选 重叠 */
.goods-grid .product .badge-new { left: auto; right: 12px; }

/* ---------------------------------------------------------------------------
 * 6. 响应式
 * ------------------------------------------------------------------------ */
@media (max-width: 1180px) {
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
  .goods-grid { columns: 3; }
}
@media (max-width: 1024px) {
  .hero { height: 440px; }
  .hero-title { font-size: 34px; }
  .hero-content { width: min(560px, 88vw); padding-left: clamp(22px, 5vw, 60px); }
  .features { grid-template-columns: repeat(2, 1fr); }
  .reco-band { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .hero { height: 400px; }
  .hero-scrim {
    background: linear-gradient(180deg,
      rgba(10,10,14,.28) 0%,
      rgba(10,10,14,.12) 30%,
      rgba(10,10,14,.55) 64%,
      rgba(10,10,14,.92) 100%);
  }
  .hero-rail { width: 4px; }
  .hero-content {
    width: 100%; top: auto; bottom: 0;
    justify-content: flex-end;
    padding: 0 22px 30px; gap: 13px;
  }
  .hero-title { font-size: 26px; }
  .hero-sub { font-size: 13.5px; }
  .hero-wm { display: none; }
  .hero-nav { width: 38px; height: 38px; font-size: 21px; }
  .hero-prev { left: 10px; }
  .hero-next { right: 10px; }
  .hero-dots { bottom: 12px; }
  .goods-grid { columns: 2; }
  .features { grid-template-columns: 1fr 1fr; gap: 12px; }
  .feature { padding: 14px; flex-direction: column; text-align: center; align-items: center; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .cat-card { padding: 18px 10px 16px; }
  .cat-icon { width: 52px; height: 52px; border-radius: 15px; }
  .cat-icon svg { width: 26px; height: 26px; }
  .reco-band { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .goods-search { width: 100%; flex-wrap: wrap; }
  .goods-search select { width: 122px; }
  .goods-search input[type="text"] { flex: 1; width: auto; min-width: 130px; }
}
@media (max-width: 480px) {
  .features { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .goods-grid { columns: 2; }
}
