/* ===== 京好价 · 京东红高级版 ===== */
:root {
  --jd: #e1251b;
  --jd-500: #ff4a30;
  --jd-600: #c81b11;
  --jd-700: #9d0f08;
  --jd-tint: #fff3f1;
  --jd-tint-2: #ffe8e3;
  --jd-line: #ffe2dc;

  --bg: #f6f1f0;
  --card: #ffffff;
  --ink: #2c2321;
  --ink-2: #5d4f4c;
  --sub: #a2948f;
  --line: #f1e7e4;

  --shadow-sm: 0 2px 8px rgba(138, 48, 36, .06);
  --shadow-md: 0 10px 26px rgba(138, 48, 36, .10);
  --shadow-lg: 0 16px 38px rgba(138, 48, 36, .14);
  --shadow-red: 0 10px 22px rgba(214, 35, 24, .30);

  --r-lg: 20px;
  --r-md: 16px;
  --r-sm: 13px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(900px 380px at 50% -120px, #ffe6e1 0%, rgba(255, 230, 225, 0) 62%),
    linear-gradient(180deg, #fbf7f6 0%, var(--bg) 100%);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 手机容器：移动端铺满；桌面端呈手机外壳 */
.phone {
  max-width: 430px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  position: relative;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;  /* 阻止滚动链/橡皮筋，手感更跟手 */
  scrollbar-width: none;        /* Firefox 隐藏滚动条 */
}
.phone::-webkit-scrollbar { display: none; }  /* Chrome/Safari 隐藏滚动条 */
@media (min-width: 460px) {
  .phone {
    height: calc(100vh - 48px);
    height: calc(100dvh - 48px);
    margin: 24px auto;
    border-radius: 40px;
    border: 9px solid #17181c;
    box-shadow:
      0 40px 90px rgba(60, 12, 8, .22),
      0 2px 0 rgba(255, 255, 255, .5) inset;
  }
}

/* ===== 顶部横幅 ===== */
.banner {
  position: relative;
  min-height: 186px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 26px 22px 30px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(120% 90% at 12% 0%, rgba(255, 255, 255, .26) 0%, rgba(255, 255, 255, 0) 55%),
    radial-gradient(90% 70% at 100% 100%, rgba(255, 134, 96, .38) 0%, rgba(255, 134, 96, 0) 60%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .05) 0 1px, rgba(255, 255, 255, 0) 1px 9px),
    linear-gradient(158deg, #ec2d1f 0%, var(--jd) 38%, #b8150d 78%, #9d0f08 100%);
  background-size: cover;
  background-position: center;
  border-radius: 0 0 28px 28px;
  box-shadow: 0 14px 28px rgba(186, 28, 18, .18);
}
/* 有自定义背景图时叠一层暗化，保证文字可读 */
.banner.has-img::before {
  content: '';
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(180deg, rgba(40, 6, 2, .30) 0%, rgba(40, 6, 2, .58) 100%);
}
.banner.has-img { background-blend-mode: normal; }

/* 装饰光斑 */
.banner-blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(0.5px);
}
.banner-blob.b1 {
  width: 200px; height: 200px;
  top: -104px; right: -56px;
  background: radial-gradient(circle at 35% 65%, rgba(255, 255, 255, .26), rgba(255, 255, 255, 0) 68%);
}
.banner-blob.b2 {
  width: 150px; height: 150px;
  bottom: -86px; left: -44px;
  background: radial-gradient(circle at 60% 30%, rgba(255, 186, 158, .30), rgba(255, 186, 158, 0) 70%);
}
/* 斜向扫光 */
.banner-shine {
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, .16) 48%, rgba(255, 255, 255, 0) 58%);
  transform: translateX(-120%);
  animation: bannerShine 7s ease-in-out 1.2s infinite;
  pointer-events: none;
}
@keyframes bannerShine {
  0%   { transform: translateX(-120%); }
  55%  { transform: translateX(120%); }
  100% { transform: translateX(120%); }
}

.banner-badge {
  position: absolute;
  top: 14px; right: 16px;
  z-index: 2;
  font-size: 10.5px;
  letter-spacing: .5px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, .20);
  border: 1px solid rgba(255, 255, 255, .38);
  display: inline-flex; align-items: center; gap: 4px;
}
.banner-badge::before {
  content: '';
  width: 5px; height: 5px; border-radius: 50%;
  background: #ffe08a;
  box-shadow: 0 0 6px rgba(255, 224, 138, .9);
}

.banner-inner {
  position: relative;
  z-index: 1;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 品牌头像 */
.brand-avatar {
  width: 62px; height: 62px;
  border-radius: 20px;
  padding: 0;
  overflow: hidden;
  position: relative;
  background: #fff;
  box-shadow:
    0 0 0 2.5px rgba(255, 255, 255, .92),
    0 0 0 6px rgba(255, 255, 255, .16),
    0 12px 26px rgba(96, 8, 4, .38);
  margin-bottom: 12px;
  animation: avatarIn .5s cubic-bezier(.22, .9, .3, 1) both;
}
.brand-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 17px;
}
@keyframes avatarIn {
  from { opacity: 0; transform: scale(.82) translateY(6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.banner-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1.2px;
  line-height: 1.28;
  color: #fff;
  text-shadow: 0 2px 10px rgba(90, 6, 2, .38);
}
.banner-sub {
  font-size: 12.5px;
  margin-top: 7px;
  letter-spacing: .8px;
  line-height: 1.5;
  opacity: .9;
  text-shadow: 0 1px 6px rgba(90, 6, 2, .35);
}

/* ===== 滚动公告 ===== */
.notice-card {
  position: relative;
  z-index: 3;
  margin: -18px 14px 0;
  background: var(--card);
  border-radius: var(--r-md);
  box-shadow: 0 12px 26px rgba(160, 40, 26, .16);
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px 9px 9px;
  flex-shrink: 0;
}
.notice-tag {
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .6px;
  color: #fff;
  padding: 4px 8px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--jd-500) 0%, var(--jd-600) 100%);
  box-shadow: 0 4px 10px rgba(214, 35, 24, .28);
}
.marquee-viewport {
  flex: 1; min-width: 0; overflow: hidden; white-space: nowrap;
  -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0, #000 6%, #000 94%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0, #000 6%, #000 94%, rgba(0,0,0,0) 100%);
}
.marquee-track {
  display: inline-block;
  padding-left: 100%;
  color: #c8352a;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .2px;
  animation: marquee-scroll 18s linear infinite;
  animation-delay: -7s;
  will-change: transform;
}
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

/* ===== 分类区 ===== */
.main-area {
  display: flex;
  padding-top: 12px;
}

/* 左侧小气泡导航（粘性固定，随整页滚动保持在顶部） */
.side-nav {
  width: 92px; flex-shrink: 0;
  position: sticky; top: 0;
  align-self: flex-start;
  max-height: calc(100dvh - 12px);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 2px 8px 20px;
  scrollbar-width: none;
  background: var(--bg);
  z-index: 2;
}
.side-nav::-webkit-scrollbar { display: none; }

.pill {
  background: var(--card);
  border: 1.5px solid transparent;
  border-radius: 15px;
  padding: 10px 6px 9px;
  margin-bottom: 9px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background .2s, box-shadow .22s, transform .14s, border-color .2s;
  position: relative;
  overflow: hidden;
}
.pill:active { transform: scale(.955); }
.pill .p-top { display: flex; align-items: center; gap: 4px; color: #d3b6b0; transition: color .2s; }
.pill .p-ico { width: 17px; height: 17px; display: block; }
.pill .p-count { font-size: 11px; font-weight: 700; color: var(--sub); transition: color .2s; }
.pill .p-name {
  font-size: 11.5px; font-weight: 600; color: var(--ink-2); line-height: 1.2; text-align: center;
  max-width: 100%; word-break: break-all;
  transition: color .2s;
}
.pill.active {
  background: linear-gradient(150deg, #f5361f 0%, var(--jd) 45%, var(--jd-600) 100%);
  box-shadow: var(--shadow-red);
  border-color: rgba(255, 255, 255, .5);
}
.pill.active .p-top { color: rgba(255, 255, 255, .88); }
.pill.active .p-count { color: rgba(255, 255, 255, .92); }
.pill.active .p-name { color: #fff; font-weight: 800; }
.pill.active::after {
  content: '';
  position: absolute; left: 0; top: 0; right: 0; height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0));
  pointer-events: none;
}

/* 右侧大气泡区（随整页一起滚动，不再内部独立滚动） */
.section-area {
  flex: 1; min-width: 0;
  padding: 0 12px 26px 0;
}

.big-bubble {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 15px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, .9);
  animation: cardIn .45s cubic-bezier(.22, .9, .3, 1) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.bb-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; padding: 0 2px;
  gap: 8px;
}
.bb-title {
  font-size: 17px; font-weight: 800; color: var(--ink);
  letter-spacing: .3px;
  display: inline-flex; align-items: center; gap: 7px;
  min-width: 0;
}
.bb-title::before {
  content: '';
  width: 4px; height: 15px; border-radius: 3px; flex-shrink: 0;
  background: linear-gradient(180deg, var(--jd-500), var(--jd-600));
  box-shadow: 0 2px 6px rgba(214, 35, 24, .3);
}
.bb-count {
  flex-shrink: 0;
  font-size: 11px; font-weight: 700; color: #c04a3c;
  background: var(--jd-tint);
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--jd-line);
}

.bb-body {
  background: linear-gradient(180deg, #fff7f5 0%, #fff1ee 100%);
  border-radius: var(--r-md);
  padding: 10px;
  display: flex; gap: 10px; align-items: stretch;
  border: 1px solid var(--jd-line);
}
.bb-label {
  flex: 0 0 60px;
  background: var(--card);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--jd-600);
  font-weight: 800; font-size: 13px;
  text-align: center; padding: 10px 6px; line-height: 1.35;
  word-break: break-all;
  box-shadow: 0 4px 12px rgba(160, 40, 26, .10);
}
.bb-list { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }

.brand-row {
  background: var(--card);
  border-radius: var(--r-sm);
  padding: 9px 10px 9px 9px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  box-shadow: 0 2px 8px rgba(160, 40, 26, .06);
  transition: transform .14s, box-shadow .18s;
}
.brand-row:active { transform: scale(.988); box-shadow: 0 1px 4px rgba(160, 40, 26, .10); }

.br-left { display: flex; align-items: center; min-width: 0; flex: 1; }
.br-name {
  font-size: 14.5px; font-weight: 700; color: #362b28;
  min-width: 0;
  overflow: visible; text-overflow: clip;
  white-space: normal; word-break: break-all; line-height: 1.35;
  letter-spacing: .2px;
}

.join-pill {
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #ff5236 0%, var(--jd) 48%, var(--jd-600) 100%);
  color: #fff; font-size: 12.5px; font-weight: 800;
  padding: 7px 11px 7px 13px;
  border-radius: 999px;
  display: inline-flex; align-items: center; gap: 2px;
  text-decoration: none;
  letter-spacing: .4px;
  box-shadow: 0 7px 16px rgba(214, 35, 24, .30);
  transition: transform .14s, opacity .2s;
}
.join-pill::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0) 36%, rgba(255, 255, 255, .42) 50%, rgba(255, 255, 255, 0) 64%);
  transform: translateX(-140%);
  transition: transform .55s ease;
}
.brand-row:hover .join-pill::after,
.join-pill:active::after { transform: translateX(140%); }
.join-pill .arr { font-size: 14px; font-weight: 800; line-height: 1; margin-left: 1px; }
.join-pill:active { transform: scale(.94); opacity: .92; }

.empty-row { color: var(--sub); font-size: 13px; padding: 18px 6px; text-align: center; }
.empty-tip { color: var(--sub); font-size: 13px; text-align: center; padding: 60px 0; }

/* 卡片进场错峰 */
.big-bubble:nth-child(1) { animation-delay: .02s; }
.big-bubble:nth-child(2) { animation-delay: .07s; }
.big-bubble:nth-child(3) { animation-delay: .12s; }
.big-bubble:nth-child(4) { animation-delay: .17s; }
.big-bubble:nth-child(5) { animation-delay: .22s; }
.big-bubble:nth-child(n+6) { animation-delay: .26s; }

@media (prefers-reduced-motion: reduce) {
  .brand-avatar, .big-bubble, .banner-shine { animation: none !important; }
  .marquee-track { animation-duration: 30s; }
}

/* 顶部横幅 + 公告作为正常流内容，随整页一起滚动：
   上滑时整体移出视野（不再显示），滑回最顶部时重新显示（不做折叠动画） */

/* 滚动进行时（JS 给 .phone 加 .scrolling）：暂停装饰动画（横幅扫光 / 跑马灯），
   把 GPU/主线程让给滚动本身，解决移动端滑动卡顿；停止滚动 200ms 后自动恢复。 */
.phone.scrolling .banner-shine,
.phone.scrolling .marquee-track {
  animation-play-state: paused !important;
}
