:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --border: #eceef1;
  --text: #171c24;
  --text-2: #59636f;
  --text-3: #9aa3af;
  --accent: #ff5a1f;
  --accent-2: #ff7a29;
  --red: #e1251b;
  --shadow: 0 1px 2px rgba(20, 30, 50, 0.04), 0 6px 20px rgba(20, 30, 50, 0.05);
  --shadow-hover: 0 4px 10px rgba(20, 30, 50, 0.06), 0 14px 34px rgba(20, 30, 50, 0.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

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

.wrap { max-width: 1020px; margin: 0 auto; padding: 0 16px 60px; }

/* ---------- Header（logo + 搜索 + 分类，整体常驻） ---------- */
.header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.header-inner {
  max-width: 1020px; margin: 0 auto; padding: 13px 16px 11px;
  display: flex; align-items: baseline; gap: 10px;
}
.logo {
  font-size: 21px; font-weight: 900; letter-spacing: -0.3px;
  color: var(--text);
}
.slogan { font-size: 12px; color: var(--text-3); }

/* 搜索 + 分类 Tab（sticky 在 header 内，滚动时随时可筛） */
.controls {
  max-width: 1020px; margin: 0 auto; padding: 0 16px 11px;
}

/* ---------- Search ---------- */
.search {
  width: 100%; padding: 11px 14px 11px 38px; border-radius: 13px;
  border: 1px solid transparent; background: #f0f1f4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa3af' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 13px center; background-size: 15px;
  font-size: 14px; color: var(--text); outline: none;
  transition: background .15s, box-shadow .15s, border-color .15s;
}
.search:focus {
  background-color: #fff; border-color: var(--border);
  box-shadow: 0 0 0 4px rgba(23, 28, 36, 0.05);
}
.search::placeholder { color: var(--text-3); }

/* ---------- Tabs（选中黑底白字，克制高级） ---------- */
.tabs {
  display: flex; gap: 8px; overflow-x: auto; padding: 11px 0 2px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; padding: 8px 16px; border-radius: 999px;
  background: #fff; border: 1px solid var(--border);
  font-size: 13.5px; color: var(--text-2); cursor: pointer; white-space: nowrap;
  transition: all .16s;
}
.tab:hover { border-color: #d8dce2; color: var(--text); }
/* 分组竖线：会员 / 数码 / 生活 三组之间的视觉分隔 */
.tab-sep {
  flex: 0 0 auto; align-self: center;
  width: 1px; height: 20px; margin: 0 2px;
  background: linear-gradient(to bottom, transparent, var(--border) 20%, var(--border) 80%, transparent);
}
.tab.active {
  background: var(--text); color: #fff; border-color: transparent; font-weight: 600;
  box-shadow: 0 3px 10px rgba(23, 28, 36, 0.22);
}
.tab--wps {
  border-color: #ffd9d2; color: #e0301e; background: #fff6f4; font-weight: 700;
}
.tab--wps.active {
  background: #e0301e; border-color: transparent; color: #fff;
  box-shadow: 0 3px 10px rgba(224, 48, 30, 0.28);
}
/* 双十一钜惠：橙红节日色 */
.tab--double11 {
  border-color: #ffd0b0; color: #e8470b; background: #fff5ef; font-weight: 700;
}
.tab--double11.active {
  background: linear-gradient(135deg, #ff6a00, #e1251b);
  border-color: transparent; color: #fff;
  box-shadow: 0 3px 12px rgba(225, 37, 27, 0.32);
}
/* 合作推荐：灰调（第三方，与官方好价区分） */
.tab--partners {
  border-color: #e2e5ea; color: #6b7280; background: #f7f8fa; font-weight: 700;
}
.tab--partners.active {
  background: #3d4350; border-color: transparent; color: #fff;
  box-shadow: 0 3px 10px rgba(61, 67, 80, 0.25);
}

/* ---------- Hero 主推大横幅 ---------- */
.hero {
  position: relative; overflow: hidden;
  margin: 16px 0 6px; border-radius: 20px;
  padding: 26px 28px 24px;
  color: #fff;
  box-shadow: 0 10px 30px rgba(20, 30, 50, 0.16);
}
/* ---------- Hero 卡组（可左右滑动） ---------- */
.hero-strip {
  display: flex; gap: 12px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  margin: 16px 0 6px; padding: 4px 2px 10px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.hero-strip::-webkit-scrollbar { display: none; }
.hero-strip .hero {
  flex: 0 0 clamp(272px, 86vw, 330px);
  scroll-snap-align: start; margin: 0;
  padding: 20px 20px 18px;
}
.hero-strip .hero-title { font-size: 19px; padding-right: 100px; }
.hero-strip .hero-sub { font-size: 12px; }
.hero-strip .hero-price { font-size: 30px; }
.hero-strip .hero-price .cny { font-size: 15px; }
.hero-strip .hero-price-row { gap: 10px; margin-top: 9px; }
.hero-strip .hero-buy { margin-top: 12px; padding: 8px 20px; font-size: 13px; }
.hero-strip .hero-media { right: 16px; }
.hero-strip .hero-icon { width: 80px; height: 80px; border-radius: 18px; padding: 7px; }
.hero-strip .hero-photo { width: 80px; height: 80px; }
.hero-strip .hero-duo .hero-icon { width: 62px; height: 62px; border-radius: 14px; padding: 5px; }
.hero-strip .hero-duo .hero-icon:last-child { margin-left: -10px; }
.hero-strip .hero-tag { font-size: 11px; padding: 3px 10px; }
.hero-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .2px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 4px 12px; border-radius: 999px;
}
.hero-title {
  margin-top: 13px; font-size: 27px; font-weight: 900; letter-spacing: -0.3px;
  line-height: 1.25; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.12);
  padding-right: 170px; /* 给右侧悬浮图标让位 */
}
.hero-sub { margin-top: 5px; font-size: 13.5px; opacity: .88; }
.hero-price-row { margin-top: 12px; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.hero-price { font-size: 46px; font-weight: 900; line-height: 1; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.hero-price .cny { font-size: 21px; font-weight: 800; margin-right: 2px; }
.hero-src { font-size: 12.5px; opacity: .9; display: inline-flex; align-items: center; gap: 4px; }
.hero-buy {
  display: inline-block; margin-top: 16px; padding: 10px 26px;
  border-radius: 999px; background: #fff; color: var(--text);
  font-size: 14.5px; font-weight: 800; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  transition: transform .12s, box-shadow .12s;
}
.hero-buy:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24); }
.hero-buy:active { transform: scale(.98); }
.hero-media {
  position: absolute; right: 34px; top: 50%;
  transform: translateY(-50%) rotate(-6deg);
  pointer-events: none;
}
.hero-icon {
  width: 118px; height: 118px; border-radius: 26px; object-fit: cover;
  background: #fff; padding: 10px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.26);
}
.hero-duo { display: flex; gap: 6px; }
/* 主推为实物商品时用产品图（白底、等比缩放） */
.hero-photo {
  width: 132px; height: 132px; object-fit: contain; display: block;
  background: #fff; border-radius: 24px; padding: 8px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.26);
}
.hero-duo .hero-icon { width: 96px; height: 96px; border-radius: 22px; }
.hero-duo .hero-icon:last-child { margin-left: -18px; transform: rotate(4deg); }
/* 深色渐变上的装饰光斑 */
.hero::before {
  content: ""; position: absolute; right: -60px; top: -80px;
  width: 260px; height: 260px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.10); pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; right: 150px; bottom: -90px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.07); pointer-events: none;
}

/* ---------- Section title ---------- */
.section-title {
  margin: 26px 2px 12px; font-size: 16.5px; font-weight: 800;
  display: flex; align-items: center; gap: 8px; letter-spacing: -0.2px;
}
.section-title .ic { font-size: 17px; }
.section-title--wps { color: #e0301e; }
.section-title--double11 { color: #e8470b; }
.section-count { font-size: 12px; color: var(--text-3); font-weight: 500; margin-top: 2px; }
.section-note { font-size: 11.5px; color: var(--text-3); font-weight: 400; margin-left: auto; }

/* ---------- More（展开/收起） ---------- */
.more-btn {
  display: block; margin: 14px auto 4px; padding: 8px 26px;
  border: 1px solid var(--border); border-radius: 999px;
  background: #fff; color: var(--text-2);
  font-size: 13px; cursor: pointer;
  transition: all .15s;
}
.more-btn:hover {
  border-color: var(--text); color: var(--text);
}
.more-btn.open {
  border-color: var(--text); color: var(--text); background: #f0f1f4;
}

/* ---------- Grid ---------- */
.grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px;
}
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 880px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Card ---------- */
.card {
  background: var(--card); border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 18px; padding: 16px 15px 14px; display: flex; flex-direction: column;
  position: relative;
  box-shadow: var(--shadow); transition: transform .14s, box-shadow .14s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.card-top { display: flex; align-items: center; gap: 11px; }
.icon {
  width: 56px; height: 56px; border-radius: 14px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800; color: #b6bcc6; background: #f2f3f5;
  position: relative; overflow: visible;
}
/* 官方 App 图标：铺满图标位，自带圆角 */
.brand-logo {
  width: 56px; height: 56px; display: block;
  border-radius: 14px; object-fit: cover;
  box-shadow: 0 2px 8px rgba(20, 30, 50, 0.14);
}
/* 联合会员双图标：并排完整显示，仅微叠压，互不打断 */
.icon-duo {
  width: 94px; height: 56px;
  display: flex; align-items: center; gap: 3px;
}
.icon-duo .brand-logo {
  width: 46px; height: 46px; border-radius: 11px;
  box-shadow: 0 2px 8px rgba(20, 30, 50, 0.14);
}
.icon-duo .logo-b {
  margin-left: -7px; /* 轻微叠压，仍完整可见 */
  box-shadow: 0 0 0 2px #fff, 0 2px 8px rgba(20, 30, 50, 0.16);
}
.card-name {
  font-size: 15px; font-weight: 800; line-height: 1.28; letter-spacing: -0.2px;
  min-height: 2.56em; /* 两行高度：单行名也与两行名的卡片价格对齐 */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word;
}
.card-dur { font-size: 12px; color: var(--text-2); margin-top: 7px; }

/* ---------- 实拍图卡片（img 字段）：大图铺顶，名称独占整行 ---------- */
.card--photo { border: 1px solid var(--line, #e8ebf0); }
.card-photo {
  width: 100%; height: 170px; object-fit: contain;
  background: #fff; border-radius: 12px; display: block;
}
.card--photo .card-name {
  margin-top: 11px;
  -webkit-line-clamp: 3; /* 图片卡名称放宽到 3 行，完整看到在卖啥 */
  min-height: 0;
}
.card--photo.has-ribbon .card-name { padding-right: 0; }
.card--photo .card-dur { margin-top: 5px; }

.price-row { margin-top: 9px; display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.price { font-size: 26px; font-weight: 900; color: var(--red); font-variant-numeric: tabular-nums; letter-spacing: -0.6px; }
.price .cny { font-size: 14px; font-weight: 800; margin-right: 1px; }
.permonth { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.badge {
  font-size: 11px; padding: 3px 8px; border-radius: 7px; font-weight: 700;
}
.badge.discount { background: rgba(225, 37, 27, 0.08); color: var(--red); }
.badge.source { background: rgba(10, 155, 110, 0.09); color: #0a9b6e; }
.badge.low { background: rgba(10, 155, 110, 0.09); color: #0a9b6e; }

.buy {
  margin-top: 12px; display: block; text-align: center;
  padding: 10px 0; border-radius: 12px; font-size: 13.5px; font-weight: 800;
  color: var(--red); background: rgba(225, 37, 27, 0.07);
  cursor: pointer; transition: background .15s, color .15s, transform .1s;
}
.buy:hover { background: var(--red); color: #fff; }
.buy:active { transform: scale(.98); }

/* 活动角标（卡片右上角小飘带） */
.ribbon {
  position: absolute; top: 11px; right: 12px; z-index: 2;
  font-size: 10.5px; font-weight: 800; letter-spacing: .3px;
  padding: 3px 9px; border-radius: 999px;
  background: linear-gradient(135deg, #ff5a1f, #ff7a29); color: #fff;
  box-shadow: 0 3px 9px rgba(255, 90, 31, 0.32);
  pointer-events: none;
}
.card.has-ribbon .card-name { padding-right: 60px; }

/* 划线原价 + 省 ¥X */
.orig {
  font-size: 13px; color: var(--text-3); text-decoration: line-through;
  font-weight: 600; margin-left: 5px; font-variant-numeric: tabular-nums;
}
.save {
  font-size: 11.5px; font-weight: 800; color: var(--accent);
  background: rgba(255, 122, 41, 0.12); padding: 2px 7px; border-radius: 7px;
  margin-left: 5px; white-space: nowrap;
}

/* 活动说明（小灰条） */
.note {
  font-size: 11.5px; color: var(--text-2); margin-top: 9px; line-height: 1.5;
  background: rgba(23, 28, 36, 0.035); padding: 7px 9px; border-radius: 9px;
  border-left: 2px solid var(--accent);
}

/* 领券 + 购买 双按钮 */
.card-actions { display: flex; gap: 8px; margin-top: 12px; }
.card-actions .buy { margin-top: 0; flex: 1; }
.buy-coupon { color: var(--accent); background: rgba(255, 122, 41, 0.10); }
.buy-coupon:hover { background: var(--accent); color: #fff; }

/* Hero 省 ¥X */
.hero-save {
  font-size: 13px; font-weight: 800; color: #fff;
  background: rgba(255, 255, 255, 0.18); border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 3px 10px; border-radius: 999px;
}

/* ---------- Price trend（极简：两条小线，不抢戏） ---------- */
.trend { margin-top: 11px; padding-top: 10px; border-top: 1px solid rgba(0, 0, 0, 0.05); }
.trend-row { display: flex; gap: 12px; }
.trend-cell { flex: 1; min-width: 0; }
.trend-label { font-size: 10px; color: var(--text-3); margin-bottom: 3px; font-weight: 600; }
.spark { width: 100%; height: 24px; display: block; max-width: 100%; }
.trend-stat { font-size: 10px; color: var(--text-3); margin-top: 3px; font-variant-numeric: tabular-nums; }
.trend-empty { font-size: 10.5px; color: var(--text-3); margin-top: 6px; }

/* ---------- 合作推荐（第三方，与好价区分离） ---------- */
.partners { margin-top: 2px; }
.section-title--partners { color: #6b7280; }
.partners-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.partner {
  position: relative; display: block; padding: 14px 14px 12px; border-radius: 14px;
  background: var(--card, #fff); border: 1px solid rgba(0, 0, 0, 0.06);
  text-decoration: none; color: inherit; transition: transform .14s, box-shadow .14s;
}
.partner:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(23, 28, 36, 0.08); }
.partner-tag {
  position: absolute; top: 10px; right: 10px; font-size: 10px; font-weight: 700;
  color: #8a6d3b; background: #fdf3e2; border: 1px solid #f3e0bd;
  padding: 1px 6px; border-radius: 6px;
}
.partner-name { font-size: 14px; font-weight: 800; color: var(--text); padding-right: 44px; }
.partner-logo {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  border-radius: 10px; margin-bottom: 9px;
  box-shadow: 0 2px 6px rgba(23, 28, 36, 0.16);
}
.partner-logo img { width: 21px; height: 21px; display: block; }
.partner-logo i { font-style: normal; font-weight: 800; font-size: 16px; color: #fff; }
.partner-desc { font-size: 11.5px; color: var(--text-3); line-height: 1.5; margin-top: 5px; min-height: 2.6em; }
.partner-go { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--accent, #ff7a29); }
.partner-promo {
  margin-top: 7px; font-size: 11.5px; color: #b4231b;
  background: #fff3f1; border: 1px dashed #ffcfc7; border-radius: 7px;
  padding: 3px 8px; display: inline-block;
}
.partners-disc { margin-top: 12px; font-size: 11px; color: var(--text-3); line-height: 1.6; }
@media (max-width: 640px) {
  .partners-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .partner { padding: 12px 11px 10px; }
  .partner-name { font-size: 13px; padding-right: 40px; }
  .partner-desc { font-size: 11px; min-height: 0; }
  .partner-tag { font-size: 9px; padding: 0 5px; }
  .partner-logo { width: 30px; height: 30px; border-radius: 9px; margin-bottom: 7px; }
  .partner-logo img { width: 18px; height: 18px; }
}

/* ---------- Footer ---------- */
.footer-link { color: #2e7fd6; text-decoration: none; font-weight: 600; }
.footer-link:hover { text-decoration: underline; }
.footer {
  margin-top: 38px; padding: 20px 14px; border-top: 1px solid var(--border);
  font-size: 11.5px; color: var(--text-3); line-height: 1.7; text-align: center;
}
.empty { text-align: center; color: var(--text-3); padding: 40px 0; font-size: 14px; }

/* ---------- 小屏适配 ---------- */
@media (max-width: 640px) {
  .header-inner { padding: 10px 14px 9px; }
  .controls { padding-bottom: 9px; }
  .hero { margin: 12px 0 4px; padding: 20px 18px 18px; border-radius: 18px; }
  .hero-title { font-size: 21px; padding-right: 88px; }
  .hero-price { font-size: 36px; }
  .hero-icon, .hero-duo .hero-icon { width: 74px; height: 74px; border-radius: 17px; padding: 7px; }
  .hero-photo { width: 86px; height: 86px; border-radius: 16px; padding: 5px; }
  .hero-media { right: 16px; }
  .hero-buy { padding: 9px 22px; font-size: 13.5px; margin-top: 13px; }
  .grid { gap: 11px; }
  .card { padding: 13px 12px 12px; border-radius: 16px; }
  .icon, .brand-logo { width: 42px; height: 42px; border-radius: 11px; }
  .icon-duo { width: 74px; height: 42px; }
  .icon-duo .brand-logo { width: 36px; height: 36px; border-radius: 9px; }
  .price { font-size: 22px; }
  .buy { padding: 9px 0; }
  /* ---- 移动端可读性优化 ---- */
  .section-note { display: none; }           /* 分区右侧备注挤占标题，隐藏 */
  .card-name { font-size: 14px; -webkit-line-clamp: 3; }  /* 名称放宽到 3 行，完整可见 */
  .card.has-ribbon .card-name { padding-right: 38px; }    /* 角标缩小后少占名称宽度 */
  .ribbon { font-size: 10px; padding: 3px 8px; }
  .card-photo { height: 140px; }             /* 实拍图降高，减少滑动距离 */
  .card-dur { font-size: 11px; }
  .trend-label { font-size: 9.5px; }
  .trend-row { gap: 6px; }
  .trend-stat { font-size: 8.8px; letter-spacing: -0.2px; font-variant-numeric: normal; white-space: nowrap; }  /* 「低X·现Y」不再折成两行 */
}
