/* ============ 基础 ============ */
:root {
  --c-blue: #2e6fe4;
  --c-blue-d: #1e56c8;
  --c-blue-l: #5ea6f8;
  --c-red: #e23a2e;
  --c-gold: #f7c14b;
  --txt: #243247;
  --txt2: #7d8aa5;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: #c6d4ec;
  color: var(--txt);
}
button { font-family: inherit; }
img { display: block; }

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  background: linear-gradient(180deg, #dce7fa 0%, #eef3fd 45%, #f7fafe 100%);
  position: relative;
  box-shadow: 0 0 28px rgba(30, 60, 120, .18);
}

/* ============ 顶部下载条 ============ */
.top-banner {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 52px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  z-index: 60;
  box-shadow: 0 2px 10px rgba(40, 70, 140, .08);
}
.banner-close {
  border: none;
  background: none;
  width: 26px;
  height: 26px;
  color: #5d6b85;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.banner-close svg { width: 17px; height: 17px; }
.mini-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4);
}
.banner-text {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 800;
  color: #1d2b45;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 3px;
  overflow: hidden;
}
.banner-text .red { color: var(--c-red); font-size: 19px; }
.banner-text .redpacket { width: 22px; height: 22px; flex: none; }
.btn-download {
  height: 34px;
  padding: 0 16px;
  border: none;
  border-radius: 17px;
  background: linear-gradient(135deg, #4f9bf7, #2f6fe4);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  flex: none;
  box-shadow: 0 2px 8px rgba(47, 111, 228, .38);
}

.app.banner-closed .top-banner { display: none; }

/* ============ Logo 头部 ============ */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 64px 14px 10px;
}
.app.banner-closed .header { padding-top: 14px; }
.logo-img { height: 48px; width: auto; display: block; }
.btn-search {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3c66c4;
  box-shadow: 0 2px 10px rgba(40, 70, 140, .14);
}
.btn-search svg { width: 21px; height: 21px; }

/* ============ 主体 ============ */
.main {
  padding: 0 12px calc(86px + env(safe-area-inset-bottom));
}

/* ---- 轮播 Banner ---- */
.banner-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(47, 90, 180, .14);
}
.banner-track { display: flex; transition: transform .5s ease; }
.banner-track img {
  width: 100%;
  flex: 0 0 100%;
  aspect-ratio: 1080 / 490;
  object-fit: cover;
}
.banner-indicators {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 5px;
}
.banner-indicators i {
  width: 14px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .55);
  transition: all .3s;
}
.banner-indicators i.on { background: #fff; width: 22px; }

/* ---- 备用线路 ---- */
.site-row {
  display: flex;
  justify-content: space-between;
  margin: 14px 2px 0;
}
.site-item { flex: 1; display: flex; justify-content: center; }
.site-item img {
  width: 64px;
  height: auto;
  display: block;
  filter: drop-shadow(0 3px 6px rgba(47, 111, 228, .22));
}

/* ---- 公告栏 ---- */
.notice-bar {
  margin: 12px 2px 0;
  background: #fff;
  border-radius: 24px;
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(47, 90, 180, .08);
}
.notice-bar .vol { width: 20px; height: 20px; flex: none; }
.notice-clip { flex: 1; min-width: 0; overflow: hidden; }
.notice-track {
  display: flex;
  white-space: nowrap;
  animation: marquee 16s linear infinite;
  font-size: 13.5px;
  color: #3598db;
  width: max-content;
}
.notice-track span { padding-right: 70px; }
@keyframes marquee { to { transform: translateX(-50%); } }
.notice-mail { position: relative; flex: none; display: flex; }
.notice-mail svg { width: 24px; height: 24px; }
.notice-mail .badge {
  position: absolute;
  top: -9px;
  right: -9px;
  background: #f43b2e;
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 1.5px solid #fff;
}

/* ---- 用户卡片 ---- */
.user-card {
  margin: 12px 2px 0;
  background: #fff;
  border-radius: 16px;
  padding: 16px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 14px rgba(47, 90, 180, .08);
}
.user-title { font-size: 20px; font-weight: 800; color: #22314c; }
.user-tip { margin-top: 9px; font-size: 13px; color: #8a97b1; }
.user-tip a {
  color: var(--c-blue);
  text-decoration: underline;
  margin: 0 2px;
}
.user-actions { display: flex; gap: 13px; }
.ua {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #44526e;
}
.ua-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #7cc0fb, #2e6fe4 72%);
  box-shadow: 0 4px 10px rgba(47, 111, 228, .32), inset 0 2px 3px rgba(255, 255, 255, .5);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ua-icon svg { width: 22px; height: 22px; }

/* ---- 分类 Tab ---- */
.cat-bar { position: relative; margin: 16px 0 10px; }
.cat-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: none;
}
.cat-row::-webkit-scrollbar { display: none; }
.cat {
  flex: 0 0 74px;
  height: 66px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #eef2fb;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #33415c;
  box-shadow: 0 3px 8px rgba(47, 90, 180, .08);
  transition: all .2s;
}
.cat svg { width: 22px; height: 22px; fill: var(--c-blue); }
.cat.on {
  background: linear-gradient(180deg, #57a7f8, #2e6fe4);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 5px 12px rgba(47, 111, 228, .42);
}
.cat.on svg { fill: #fff; }
.cat-hint {
  position: absolute;
  right: -6px;
  top: 0;
  bottom: 0;
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background: linear-gradient(90deg, rgba(238, 243, 253, 0), #eef3fd 75%);
  pointer-events: none;
}
.cat-hint span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(30, 60, 120, .18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5c78a8;
  font-size: 13px;
  margin-right: 2px;
}

/* ---- 游戏宫格 ---- */
.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.game-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 20 / 23;
  box-shadow: 0 3px 10px rgba(47, 90, 180, .12);
}
.game-art {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.game-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.game-emoji {
  font-size: 44px;
  line-height: 1;
  filter: drop-shadow(0 5px 6px rgba(0, 0, 0, .28));
}
.game-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 46px;
  height: 32px;
  background: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(10, 30, 70, .18);
}
.game-badge img {
  max-width: 38px;
  max-height: 24px;
  object-fit: contain;
}
.game-star {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 23px;
  height: 23px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .85);
  color: #c3cede;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.game-star.on { color: #ffb400; }
.game-name { display: none; }

/* ---- 限时优惠 ---- */
.promo-card {
  margin: 14px 2px 0;
  background: #fff;
  border-radius: 16px;
  padding: 16px 14px 14px;
  box-shadow: 0 4px 14px rgba(47, 90, 180, .08);
}
.promo-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 800;
  color: #22314c;
}
.promo-title i {
  width: 34px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #7db2f5);
}
.promo-title i:last-child { transform: scaleX(-1); }
.promo-img {
  width: 100%;
  border-radius: 10px;
  margin-top: 12px;
  display: block;
}
.promo-links {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.promo-links span {
  flex: 1;
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  padding: 8px 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #5ea6f8, #2e6fe4);
  box-shadow: 0 3px 8px rgba(47, 111, 228, .28);
}

.page-note {
  text-align: center;
  font-size: 11px;
  color: #a7b3c9;
  padding: 16px 0 4px;
}

/* ============ 底部导航 ============ */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -4px 18px rgba(40, 70, 140, .12);
  display: flex;
  padding: 9px 6px calc(9px + env(safe-area-inset-bottom));
  z-index: 60;
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  color: #9fb0cc;
  transition: color .2s;
}
.tab svg { width: 24px; height: 24px; fill: #a9b9d6; transition: fill .2s; }
.tab.on { color: var(--c-blue); font-weight: 700; }
.tab.on svg { fill: var(--c-blue); }

/* ============ Toast ============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 116px;
  transform: translateX(-50%) translateY(8px);
  background: rgba(20, 32, 58, .86);
  color: #fff;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 20px;
  opacity: 0;
  pointer-events: none;
  transition: all .25s;
  z-index: 80;
  max-width: 78%;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
