/* 游戏专区：日间浅色主题（仅 /games 页面加载） */
html.games-theme {
  color-scheme: light;
  --bg: #f5f8f6;
  --surface: #ffffff;
  --surface-2: #f0f4f2;
  --border: #e3ebe6;
  --ink: #17251f;
  --muted: #74847a;
  --accent: #2f6df6;
  --accent-ink: #ffffff;
  background: linear-gradient(180deg, #f1f7ff 0, #f6f8f7 300px);
  color: var(--ink);
  scroll-behavior: smooth;
}
html.games-theme body { background: transparent; }

html.games-theme .topbar {
  border-bottom-color: rgba(227, 235, 230, 0.72);
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
}
html.games-theme .topbar-brand { color: var(--ink); }
html.games-theme .topbar-icon { color: #2f6df6; }

html.games-theme .bottom-nav {
  background: rgba(255, 255, 255, 0.72);
  border-top-color: rgba(227, 235, 230, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
  box-shadow: 0 -10px 30px rgba(23, 37, 31, 0.06);
}
html.games-theme .bottom-nav a { color: #8b9990; }
html.games-theme .bottom-nav a.active { color: #2f6df6; }

/* 搜索浮层 */
html.games-theme .search-dialog { background: var(--bg); color: var(--ink); }
html.games-theme .search-input {
  border-color: var(--border);
  background: #fff;
  color: var(--ink);
}
html.games-theme .search-input::placeholder { color: #9aa8a0; }
html.games-theme .search-input:focus {
  border-color: #9ebcfb;
  box-shadow: 0 0 0 3px rgba(47, 109, 246, 0.1);
}
html.games-theme .search-close {
  border-color: var(--border);
  background: #fff;
  color: var(--muted);
}
html.games-theme .search-result {
  border-color: var(--border);
  background: #fff;
}
html.games-theme .search-result:hover { border-color: #b9d0ff; }
html.games-theme .search-result img { background: #f1f5f3; }
html.games-theme .search-result-body strong { color: var(--ink); }

.games-main { padding: 14px 16px 0; }

/* ---------- Banner ---------- */
.games-main .home-banner {
  margin-bottom: 18px;
  border-color: #e2eae6;
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(30, 60, 44, 0.08);
}

.banner-app-card {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 52px 16px 12px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.18) 38%,
    rgba(0, 0, 0, 0.62) 72%,
    rgba(0, 0, 0, 0.85) 100%
  );
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: #fff;
  pointer-events: none;
}
.banner-app-main,
.banner-app-install { pointer-events: auto; }
.banner-app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}
.banner-slide .banner-app-logo {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 11px;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}
.banner-app-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}
.banner-app-info strong {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.banner-app-rating {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  line-height: 1.2;
  color: #fff;
  white-space: nowrap;
}
.banner-app-stars {
  display: inline-flex;
  gap: 1px;
  font-size: 11px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.3);
}
.banner-app-stars .on { color: #f5a623; }
.banner-app-score {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.banner-app-meta {
  display: block;
  font-size: 10.5px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.74);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.banner-app-install {
  flex-shrink: 0;
  height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  background: #2f6df6;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.banner-app-install:hover { background: #245bda; }
.banner-app-install.disabled {
  background: rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.82);
  font-weight: 600;
}

.home-banner.has-app .banner-slide.has-app .banner-caption {
  inset-inline: 0;
  top: 0;
  bottom: auto;
  padding: 14px 18px 32px;
  background: linear-gradient(180deg, rgba(4, 16, 10, 0.48), transparent);
}
.home-banner.has-app .banner-dots {
  top: 11px;
  right: 12px;
  bottom: auto;
  left: auto;
  transform: none;
}

/* ---------- 功能导航 ---------- */
.game-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  margin: 18px 0 22px;
}
.game-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 2px 0;
  border-radius: 12px;
}
.game-nav-icon {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
}
.game-nav-icon svg { width: 23px; height: 23px; }
.game-nav-item:active .game-nav-icon { transform: scale(0.93); }
.game-nav-label {
  font-size: 11px;
  line-height: 1.2;
  color: #4c5c53;
  white-space: nowrap;
}
.tone-orange { background: #fff2e4; color: #f08a24; }
.tone-blue { background: #e9f1ff; color: #2f6df6; }
.tone-green { background: #e7f7ee; color: #14a06b; }
.tone-purple { background: #f1ecff; color: #7c5cf0; }
.tone-pink { background: #fff0f1; color: #ef5a6f; }

/* ---------- 板块标题 ---------- */
.game-section { margin-bottom: 22px; scroll-margin-top: calc(70px + env(safe-area-inset-top)); }
.game-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.game-section-head h2 {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.3px;
  color: var(--ink);
}
.game-more {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font-size: 12px;
  color: #72837a;
}
.game-more svg { width: 14px; height: 14px; }
.game-more:hover { color: #2f6df6; }
.game-section-note { font-size: 11px; color: #8b9a92; }

/* ---------- 本周热门 ---------- */
.hot-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}
.hot-scroll::-webkit-scrollbar { display: none; }
.hot-scroll.dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}
.hot-pages { display: flex; width: 100%; }
.hot-page {
  flex: 0 0 100%;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 2px 10px rgba(25, 55, 38, 0.035);
  overflow: hidden;
}
.hot-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
}
.hot-num {
  width: 18px;
  flex-shrink: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: #a1aea6;
  font-variant-numeric: tabular-nums;
}
.hot-num.top { color: #f08a24; }
.hot-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hot-logo {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 13px;
  object-fit: cover;
  background: #f1f5f3;
  border: 1px solid #eef3f0;
}
.hot-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hot-name {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.3;
  color: #1a2a22;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hot-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  color: #7f8e85;
  line-height: 1.3;
}
.hot-stars {
  display: inline-flex;
  gap: 1px;
  font-size: 10px;
  line-height: 1;
  color: #e4e9e6;
}
.hot-stars .on { color: #f5a623; }
.hot-downloads { white-space: nowrap; }
.hot-tag {
  align-self: flex-start;
  margin-top: 1px;
  padding: 1px 6px;
  border-radius: 5px;
  background: #eef3f1;
  color: #607268;
  font-size: 9.5px;
  line-height: 1.5;
}
.game-install {
  flex-shrink: 0;
  min-width: 54px;
  height: 31px;
  padding: 0 12px;
  border-radius: 999px;
  background: #2f6df6;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.game-install:hover { background: #245bda; }
.game-install.disabled {
  background: #eef2f1;
  color: #9daaa2;
  font-weight: 600;
}
.hot-dots {
  display: flex;
  justify-content: center;
  gap: 5px;
  padding-top: 10px;
}
.hot-dots button {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #d5dfd9;
  transition: width 0.25s, background 0.25s;
}
.hot-dots button.active { width: 16px; background: #2f6df6; }

/* ---------- 游戏排行 ---------- */
.game-ranking .app-card {
  padding: 12px 14px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.game-ranking .app-card:hover {
  border-color: transparent;
  background: transparent;
}
.game-ranking .app-card-logo { background: #f1f5f3; }
.app-card-rank {
  width: 18px;
  flex-shrink: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: #a1aea6;
  font-variant-numeric: tabular-nums;
}
.app-card-rank.top { color: #f08a24; }
html.games-theme .app-card-cat {
  background: #eef3f1;
  color: #5f7269;
  border-color: #e2eae5;
}
html.games-theme .app-card-rating { color: #f2a01f; }
html.games-theme .install-btn {
  min-width: 56px;
  padding: 7px 14px;
  border-radius: 999px;
  background: #2f6df6;
  color: #fff;
}
html.games-theme .install-btn:hover { background: #245bda; }
html.games-theme .install-btn.disabled {
  background: #eef2f1;
  color: #9daaa2;
}
html.games-theme .list-empty {
  border-color: #dfe8e3;
  background: rgba(255, 255, 255, 0.6);
  color: #8b9a92;
}

@media (max-width: 400px) {
  .games-main { padding-inline: 13px; }
  .game-nav { gap: 2px; }
  .game-nav-icon { width: 43px; height: 43px; border-radius: 14px; }
  .game-nav-icon svg { width: 21px; height: 21px; }
  .game-nav-label { font-size: 10.5px; }
  .hot-item { padding: 9px 10px; gap: 8px; }
  .hot-logo { width: 42px; height: 42px; border-radius: 12px; }
  .hot-name { font-size: 13px; }
  .game-install { min-width: 49px; padding: 0 10px; }
  .banner-app-card { padding: 36px 12px 9px; gap: 8px; }
  .banner-slide .banner-app-logo { width: 32px; height: 32px; border-radius: 9px; }
  .banner-app-info { gap: 1px; }
  .banner-app-info strong { font-size: 13.5px; }
  .banner-app-rating { font-size: 11px; gap: 4px; }
  .banner-app-stars { font-size: 10px; }
  .banner-app-score { font-size: 11px; }
  .banner-app-meta { font-size: 10px; }
  .banner-app-install { height: 27px; padding: 0 10px; font-size: 11px; }
  .home-banner.has-app .banner-slide.has-app .banner-caption { padding: 12px 14px 18px; }
  .game-ranking .app-card { padding: 10px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html.games-theme { scroll-behavior: auto; }
  .hot-scroll { scroll-behavior: auto; }
}
