/* =============================================================================
 * 日宜百货 · 首页 / 商品墙专属样式（VIBRANT / STREET-POP · 潮流活力风）
 * 区块：Hero 非对称大色块 / 服务承诺(撞色图标) / 分类矩阵 / 平台优选 / 商品墙(错落网格)
 * 依赖：style.css 设计令牌（全部 var()，暗色主题自动适配）
 * ========================================================================== */

/* ---------------------------------------------------------------------------
 * 1. Hero · 非对称大色块（左墨黑文案块 + 右大图）
 * ------------------------------------------------------------------------ */
.hero {
  position: relative;
  width: 100%;
  margin-top: 14px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--ink);
  box-shadow: var(--shadow);
}
.hero-viewport { position: relative; width: 100%; max-width: 1680px; margin: 0 auto; height: 468px; overflow: hidden; }
.hero-track { position: relative; width: 100%; height: 100%; }

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .7s ease;
  pointer-events: none;
}
.hero-slide.is-active { opacity: 1; pointer-events: auto; z-index: 2; }

/* 每屏：左文案 / 右大图 两栏 */
.hero-grid { display: grid; grid-template-columns: 1.04fr .96fr; height: 100%; }

.hero-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: 0 48px;
  color: #fff;
  background: var(--ink);
  overflow: hidden;
}
/* 左侧撞色竖条（取每屏 --hc） */
.hero-panel::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 10px;
  background: var(--hc, var(--accent));
  box-shadow: 0 0 34px var(--hc, var(--accent));
}
/* 角落大号水印字，强化年轻跳脱 */
.hero-panel::after {
  content: "RIYI";
  position: absolute;
  right: 18px; bottom: -14px;
  font-size: 120px;
  font-weight: 900;
  letter-spacing: -.04em;
  color: rgba(255,255,255,.05);
  pointer-events: none;
}
.hero-panel > * { position: relative; z-index: 1; }

.hero-kicker {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.6px;
  color: var(--ink);
  background: var(--hc, var(--accent));
  padding: 6px 15px;
  border-radius: 999px;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--hc, var(--accent)) 45%, transparent);
}
.hero-title {
  margin: 0;
  font-size: 42px;
  font-weight: 900;
  line-height: 1.16;
  letter-spacing: -.5px;
  color: #fff;
  max-width: 14em;
}
.hero-title em { font-style: normal; color: var(--hc, var(--accent)); }
.hero-sub {
  margin: 0;
  font-size: 15px;
  line-height: 1.85;
  color: rgba(255,255,255,.72);
  max-width: 30em;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* 右侧大图 */
.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px;
  background: var(--ink);
}
.hero-visual::before {
  content: "";
  position: absolute;
  inset: 26px;
  border-radius: var(--radius-lg);
  background: var(--hc, var(--accent));
  opacity: .14;
}
.hero-img {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255,255,255,.08);
  transform: scale(1.04);
  transition: transform 7s ease;
  box-shadow: 0 26px 56px rgba(0,0,0,.5);
  filter: saturate(1.05);
}
.hero-slide.is-active .hero-img { transform: scale(1); }

/* 轮播箭头 / 指示点 */
.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: 5;
  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: 5; }
.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: #FF2D6F;
  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(255,45,111,.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-viewport { height: 408px; }
  .hero-title { font-size: 32px; }
  .hero-panel { padding: 0 30px; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .reco-band { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .hero-viewport { height: auto; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-panel { padding: 34px 22px 30px; min-height: 280px; }
  .hero-panel::after { font-size: 84px; bottom: -8px; }
  .hero-visual { padding: 16px; min-height: 240px; }
  .hero-visual::before { inset: 16px; }
  .hero-title { font-size: 26px; }
  .hero-sub { font-size: 13.5px; }
  .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; }
}
