/* ===========================
   首页 - 深蓝黑背景 + 氛围光
=========================== */
#pageHome { position: relative; overflow-x: hidden; }

/* 顶部氛围光 */
#pageHome::before {
  content: ''; position: absolute; top:0; left: -30%; right: -30%;
  height: 450px; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 0%,
    rgba(0,230,138,0.08) 0%,
    rgba(0,180,110,0.04) 35%,
    transparent 65%
  );
}

/* 底部氛围光 */
#pageHome::after {
  content: ''; position: absolute; bottom:0; left: -20%; right: -20%;
  height: 300px; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 100%,
    rgba(0,150,100,0.04) 0%,
    transparent 60%
  );
}

/* 漂浮足球装饰 — JS物理驱动，碰墙弹跳 */
.home-deco-ball {
  position: absolute; z-index: var(--z-deco); pointer-events: none;
  will-change: transform;
  transition: none;
  max-width: 40vw;
  max-height: 40vh;
}
.home-deco-ball-1 { opacity: 0.18; }
.home-deco-ball-2 { opacity: 0.14; }
.home-deco-ball-3 { opacity: 0.10; }
.home-deco-ball.squash-x { transform-origin: center center; transform: scaleX(1.05) scaleY(0.95); }
.home-deco-ball.squash-y { transform-origin: center center; transform: scaleX(0.95) scaleY(1.05); }

@media (max-width: 380px) {
  .home-deco-ball { max-width: 30vw; max-height: 30vh; opacity: 0.06 !important; }
  .home-deco-ball-1 { display: none; }
}

#pageHome > *:not(.home-deco-ball):not(.home-grass-stripe) {
  position: relative; z-index: var(--z-content);
}

/* ===========================
   首页 - 轮播图
=========================== */
.carousel-wrapper { padding: 16px 18px 0; }
.main-carousel { border-radius: var(--radius-xl); overflow: hidden; box-shadow: 0 8px 32px rgba(0,0,0,0.4); }
.main-carousel .carousel-item {
  height: clamp(160px, 58vw, 210px); position: relative; overflow: hidden;
}
.carousel-item img.banner-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.carousel-item::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 60px;
  background: linear-gradient(to top, rgba(11,20,38,0.7) 0%, transparent 100%);
  pointer-events: none; z-index: 1;
}

.main-carousel .carousel-indicators { bottom: 12px; z-index: 2; }
.main-carousel .carousel-indicators [data-bs-target] {
  width: 6px; height: 6px; border-radius: 50%; border: none; opacity: 0.35; transition: all 0.35s cubic-bezier(.4,0,.2,1);
  background: rgba(255,255,255,0.55);
}
.main-carousel .carousel-indicators [data-bs-target]:hover { opacity: 0.65; }
.main-carousel .carousel-indicators .active {
  opacity: 1; width: 22px; border-radius: 3px;
  background: var(--primary);
  box-shadow: 0 0 8px rgba(0,230,138,0.35);
}

/* ===========================
   首页 - 滚动公告条
=========================== */
.marquee-bar {
  display: flex; align-items: center; gap: 8px;
  margin: 12px 18px 0;
  background: rgba(255,255,255,0.07);
  border-left: 3px solid var(--primary);
  border-top: 1px solid rgba(255,255,255,0.06);
  border-right: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  padding: 8px 14px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.marquee-icon {
  color: var(--primary); font-size: var(--fs-md); flex-shrink: 0;
  opacity: 0.85;
}
.marquee-track {
  flex: 1; overflow: hidden; position: relative;
  height: 20px; line-height: 20px;
}
.marquee-content {
  display: inline-flex; align-items: center; gap: 12px;
  white-space: nowrap;
  animation: marqueeScroll 28s linear infinite;
}
.marquee-item {
  font-size: var(--fs-sm); color: var(--text-sub); font-weight: 600;
  flex-shrink: 0;
}
.marquee-item-sep {
  font-size: 8px; color: var(--text-light); opacity: 0.5;
  flex-shrink: 0;
}
@keyframes marqueeScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ===========================
   首页 - 快捷入口 — 玻璃态气泡
=========================== */
.quick-entry {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  margin: 18px 18px 0;
  background: var(--bubble-bg-solid); border-radius: var(--radius-xl);
  padding: 20px 10px 18px;
  backdrop-filter: var(--bubble-blur); -webkit-backdrop-filter: var(--bubble-blur);
  border: var(--bubble-border); box-shadow: var(--bubble-shadow);
}
.quick-item {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s;
}
.quick-item:active { transform: scale(0.92); }
.quick-item:active .quick-icon { box-shadow: 0 2px 8px rgba(0,0,0,0.25); }
.quick-icon {
  width: clamp(44px, 14vw, 52px); height: clamp(44px, 14vw, 52px); border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--icon-2xl); color: #0D0D1A;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  transition: box-shadow 0.2s, transform 0.2s;
}
.quick-icon.primary-fill   { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); }
.quick-icon.info-fill      { background: linear-gradient(135deg, #93C5FD 0%, var(--accent-info) 100%); }
.quick-icon.gold-fill      { background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%); }
.quick-icon.warm-fill      { background: linear-gradient(135deg, #FCA5A5 0%, var(--accent-red) 100%); }
.quick-label { font-size: var(--fs-sm); color: var(--text-muted); font-weight: 600; }

/* ===========================
   首页 - 热门比赛标题
=========================== */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 18px 12px;
}
.section-title {
  font-size: var(--fs-xl); font-weight: 800; color: var(--text-main);
  display: flex; align-items: center; gap: 8px;
  letter-spacing: -0.3px;
}
.section-title .fire-icon { color: #FF6B6B; font-size: var(--icon-xl); }
.section-more { font-size: var(--fs-sm); color: var(--text-muted); cursor: pointer; display: flex; align-items: center; gap: 2px; }

/* ===========================
   首页 - 比赛卡片 — 玻璃态 Premium
=========================== */
.match-list { padding: 0 18px; }
.match-card {
  background: var(--bubble-bg-solid); border-radius: var(--radius-xl); margin-bottom: 16px;
  overflow: hidden; position: relative;
  backdrop-filter: var(--bubble-blur); -webkit-backdrop-filter: var(--bubble-blur);
  border: var(--bubble-border); box-shadow: var(--bubble-shadow);
  transition: transform 0.25s cubic-bezier(.4,0,.2,1), box-shadow 0.25s;
}
/* 彩色顶栏 — 静态绿色 */
.match-card::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--primary);
  z-index: var(--z-content);
  transition: height 0.3s cubic-bezier(.4,0,.2,1),
              box-shadow 0.3s cubic-bezier(.4,0,.2,1);
}
.match-card:active::after,
.match-card:hover::after {
  height: 3px;
  box-shadow: 0 1px 6px rgba(0,230,138,0.25);
}
.match-card:active { transform: scale(0.985); box-shadow: var(--card-shadow-hover); }

/* ---- 卡片头部：联赛标签 + 时间 + 状态 ---- */
.match-header {
  background: linear-gradient(90deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
  padding: 12px 18px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  gap: 8px;
}
.match-header-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.match-league-icon {
  width: clamp(18px, 6vw, 22px); height: clamp(18px, 6vw, 22px); border-radius: 6px;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04));
  border: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-xs); color: var(--primary); flex-shrink: 0;
}
.match-tag {
  background: rgba(255,255,255,0.08);
  color: var(--text-main); font-size: var(--fs-xs); font-weight: 700;
  border: 1px solid rgba(255,255,255,0.10);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.match-header-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
/* 比赛状态徽章 */
.match-status-badge {
  font-size: var(--fs-2xs); font-weight: 800; padding: 2px 8px; border-radius: 8px;
  text-transform: uppercase; letter-spacing: 0.5px;
  flex-shrink: 0;
}
.match-status-badge.status-upcoming {
  background: rgba(59,130,246,0.15);
  color: #60A5FA;
  border: 1px solid rgba(59,130,246,0.25);
}
.match-status-badge.status-live {
  background: rgba(239,68,68,0.15);
  color: #F87171;
  border: 1px solid rgba(239,68,68,0.3);
  animation: statusPulse 2s ease-in-out infinite;
}
.match-status-badge.status-finished {
  background: rgba(156,163,175,0.15);
  color: #9CA3AF;
  border: 1px solid rgba(156,163,175,0.2);
}
@keyframes statusPulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.6; }
}
.match-time { font-size: var(--fs-xs); color: var(--text-muted); display: flex; align-items: center; gap: 4px; font-weight: 500; }

/* ---- 球队区域增强 ---- */
.teams-row {
  padding: 20px 18px 16px;
  display: flex; align-items: center; justify-content: space-between;
  position: relative;
}
.team { display: flex; flex-direction: column; align-items: center; flex: 1; gap: 10px; }
.team-flag {
  width: clamp(50px, 17vw, 62px); height: clamp(50px, 17vw, 62px); border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.08);
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
}
.team:first-child .team-flag:hover,
.team:last-child .team-flag:hover {
  transform: scale(1.08) translateY(-2px);
}
.team-name {
  font-size: var(--fs-lg); font-weight: 800; color: var(--text-main); text-align: center;
  letter-spacing: -0.2px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* VS 区域升级 — 计分板风格 */
.vs-badge {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  flex-shrink: 0; margin: 0 10px;
}
.vs-badge .vs-text {
  font-family: var(--font-display);
  font-size: var(--fs-xs); font-weight: 800; color: var(--primary);
  letter-spacing: 2px; opacity: 0.85;
}
.vs-badge .vs-score {
  font-size: var(--fs-2xl); font-weight: 900; color: var(--text-main);
  line-height: 1;
  letter-spacing: 2px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.vs-badge .vs-divider {
  width: 28px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
}

/* 投注选项按钮 — 玻璃态增强版 */
.bet-options { padding: 0 18px 12px; display: flex; gap: 8px; }
.bet-btn {
  flex: 1;
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
  border: 1.5px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-md);
  padding: 14px 8px 10px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
}
.bet-btn::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent);
  pointer-events: none;
}
.bet-btn:active { transform: scale(0.96); }
.bet-btn .bet-label { font-size: var(--fs-xs); color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.bet-btn .bet-odds { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 900; color: var(--text-main); letter-spacing: -0.8px; line-height: 1.2; transition: all 0.2s; }
.bet-btn .flag-icon { display: flex; align-items: center; justify-content: center; height: 18px; margin-bottom: 2px; }
.bet-btn .flag-icon img { width: clamp(20px, 7vw, 24px); height: clamp(13px, 4.5vw, 16px); border-radius: 2px; object-fit: cover; box-shadow: 0 1px 4px rgba(0,0,0,0.25); }

/* 选中态 — 金色高亮 */
.bet-btn.selected {
  background: linear-gradient(180deg, rgba(255,209,102,0.15) 0%, rgba(255,160,0,0.08) 100%);
  border-color: rgba(255,209,102,0.4);
  color: var(--text-main);
  box-shadow: 0 0 0 1px rgba(255,209,102,0.15),
              0 4px 20px rgba(255,180,50,0.15),
              inset 0 1px 0 rgba(255,255,255,0.08);
  transform: scale(1.02);
}
.bet-btn.selected::before {
  background: linear-gradient(180deg, rgba(255,209,102,0.08), transparent);
}
.bet-btn.selected .bet-label { color: #FFD166; font-weight: 700; }
.bet-btn.selected .bet-odds { color: #fff; text-shadow: 0 0 16px rgba(255,209,102,0.4); }

/* 赔率变化提示 — 上升/下降箭头动画 */
.odds-change-up .bet-odds { color: #4ADE80 !important; }
.odds-change-down .bet-odds { color: #F87171 !important; }

.btn-add-bet {
  display: block; width: calc(100% - 36px); margin: 6px 18px 18px;
  background: linear-gradient(135deg, rgba(255,209,102,0.12) 0%, rgba(240,165,0,0.08) 100%);
  border: 1.5px solid rgba(255,209,102,0.25);
  color: #FFD166; border-radius: var(--radius-md); padding: 14px; font-size: var(--fs-md);
  font-weight: 800; cursor: pointer; transition: all 0.25s cubic-bezier(.4,0,.2,1);
  letter-spacing: 0.5px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  position: relative;
  overflow: hidden;
}
.btn-add-bet::after {
  content: '';
  position: absolute; top: 0; left: -100%; width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  transition: left 0.5s ease;
}
.btn-add-bet:not(:disabled):active { transform: scale(0.98); opacity: 0.9; }
.btn-add-bet:not(:disabled):hover::after { left: 120%; }
.btn-add-bet:disabled {
  background: rgba(255,255,255,0.03);
  color: var(--text-light);
  cursor: not-allowed;
  box-shadow: none;
  border-color: rgba(255,255,255,0.06);
}
.btn-add-bet:disabled::after { display: none; }

/* 更多玩法按钮 */
.more-play-btn-wrap {
  padding: 4px 18px 16px;
}
.btn-more-play {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 11px;
  background: rgba(255,255,255,0.03);
  border: 1.5px dashed rgba(255,255,255,0.15);
  border-radius: var(--radius-md);
  color: var(--text-muted); font-size: var(--fs-sm); font-weight: 700;
  cursor: pointer; transition: all 0.25s cubic-bezier(.4,0,.2,1);
  -webkit-tap-highlight-color: transparent;
}
.btn-more-play:active { transform: scale(0.98); background: rgba(255,255,255,0.06); }
.btn-more-play i { font-size: var(--fs-lg); opacity: 0.7; }
@media (hover: hover) {
  .btn-more-play:hover {
    border-color: rgba(255,209,102,0.3);
    color: #FFD166;
    background: rgba(255,209,102,0.06);
  }
  .btn-more-play:hover i { opacity: 1; }
}

/* 玩法分区标题 — 更精致的样式 */
.bet-section-title {
  padding: 14px 18px 6px;
  font-size: var(--fs-xs);
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.8;
}
.bet-section-title::before {
  content: '';
  width: 3px; height: 12px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), #3B82F6);
  opacity: 0.6;
  flex-shrink: 0;
}
.bet-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,0.08), transparent);
}

/* 玩法区间分隔线 */
.bet-section-divider {
  height: 1px;
  margin: 0 18px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
}

/* 投注按钮 hover 赔率放大 */
@media (hover: hover) {
  .match-card:hover { box-shadow: var(--card-shadow-hover); }
  .bet-btn:hover:not(.selected) {
    border-color: rgba(255,255,255,0.16);
    background: linear-gradient(180deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.03) 100%);
    transform: translateY(-1px);
  }
  .bet-btn:hover:not(.selected) .bet-odds {
    transform: scale(1.05);
    display: inline-block;
  }
  .quick-item:hover .quick-icon { transform: translateY(-2px); transition: transform 0.2s; }
}

/* ===========================
   首页 - 信息展示 (帮助中心 + 官方客服)
=========================== */
.info-section {
  padding: 0 18px 16px;
}
.info-grid {
  display: flex;
  background: var(--bubble-bg-solid);
  border-radius: var(--radius-xl);
  padding: 20px 16px;
  backdrop-filter: var(--bubble-blur); -webkit-backdrop-filter: var(--bubble-blur);
  border: var(--bubble-border);
  box-shadow: var(--bubble-shadow);
}
.info-col {
  flex: 1;
  display: flex; flex-direction: column; gap: 12px;
  min-width: 0;
}
.info-col-title {
  font-size: var(--fs-lg); font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}
.info-link {
  font-size: var(--fs-sm); color: var(--text-sub); font-weight: 500;
  cursor: default; -webkit-tap-highlight-color: transparent;
  transition: color 0.2s;
  text-decoration: none;
}
a.info-link:active { opacity: 0.6; }
@media (hover: hover) {
  a.info-link:hover { color: var(--primary); }
}
.info-divider {
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.12), transparent);
  margin: 0 14px;
  flex-shrink: 0;
}

/* ===========================
   首页 - 联名球队 (图片网格)
=========================== */
.co-brand-section {
  padding: 0 18px 8px;
}
.co-brand-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 14px;
  padding: 4px 0 12px;
}
.team-badge {
  width: calc((100% - 14px * 6) / 7);
  max-width: 56px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform 0.25s cubic-bezier(.4,0,.2,1);
}
.team-badge:active { transform: scale(0.92); }
@media (hover: hover) {
  .team-badge:hover { transform: scale(1.06); }
}
.team-logo-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.partners-icon {
  color: var(--primary); font-size: var(--icon-xl);
}

/* 联名球队标题居中 */
.co-brand-header { justify-content: center; }
.co-brand-title { justify-content: center; }

/* 首页底部留白 — 确保最后的内容不被底部导航遮挡 */
.home-bottom-spacer {
  height: calc(70px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}

/* 回到顶部按钮 */
.back-to-top {
  position: fixed;
  right: max(12px, calc((100vw - 480px) / 2 + 30px));
  bottom: calc(95px + env(safe-area-inset-bottom, 0px));
  width: 40px; height: 40px;
  border-radius: 20px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.7);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  cursor: pointer;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: transform 0.3s cubic-bezier(.4,0,.2,1), opacity 0.3s, visibility 0.3s, background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
@media (hover: hover) {
  .back-to-top:hover {
    background: rgba(255,255,255,0.14);
    color: #fff;
  }
}
.back-to-top:active {
  transform: scale(0.9);
  background: rgba(255,255,255,0.16);
}

/* 响应式微调 — 小屏适配 */
@media (max-width: 380px) {
  .team-flag { width: 54px; height: 36px; }
  .bet-btn { padding: 11px 4px 8px; }
  .co-brand-grid { gap: 6px 8px; }
  .team-badge { max-width: 40px; }
}
