/* 首页 PC：Hero、字母条、厂商带、列表区 */

.page-index-main {
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* 轮播上方：快捷入口（与游戏库厂商筛选同链：/games?vendorId=） */
.home-quick-wrap {
  margin: -4px 0 4px;
}

.home-quick-links {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  font-size: 15px;
  line-height: 1.5;
  color: #b8c8d6;
}

.home-quick-label {
  color: #c5d4e0;
  font-weight: 800;
  flex-shrink: 0;
  font-size: 16px;
}

.home-quick-link {
  color: var(--store-accent, #66c0f4);
  text-decoration: none;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 700;
}

.home-quick-link:hover {
  text-decoration: underline;
}

.home-quick-miss {
  color: #5c6570;
  cursor: default;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 600;
}

/* 快捷入口与轮播之间：标题 + 历史游玩条带 */
.home-recent-suite {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.home-recent-page-title {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.07em;
  color: #c5d0db;
  line-height: 1.3;
}

/* 历史游玩条带（位于快捷入口与轮播之间；高度由 JS 参考轮播） */
.home-recent-strip {
  position: relative;
  border-radius: 10px;
  border: 1px solid rgba(102, 192, 244, 0.2);
  background: rgba(15, 22, 32, 0.75);
  overflow: hidden;
  min-height: 96px;
  box-sizing: border-box;
}

.home-recent-strip-inner {
  position: relative;
  height: 100%;
  padding: 6px 10px 24px;
  box-sizing: border-box;
}

/* 未登录或加载中隐藏「更多」时，减小底部留白，便于垂直居中观感 */
.home-recent-strip-inner:has(.home-recent-more[hidden]) {
  padding-bottom: 10px;
}

.home-recent-body {
  height: 100%;
  overflow: hidden;
}

/* 已登录网格：允许纵向滚动，避免条带略矮时名称被父级裁切 */
.home-recent-body:has(.home-recent-grid) {
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* 未登录 / 加载中：整块内容在条带内水平 + 垂直居中 */
.home-recent-body:has(.home-recent-guest-inner),
.home-recent-body:has(.home-recent-loading) {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
}

.home-recent-body:has(.home-recent-empty) {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
}

.home-recent-more {
  position: absolute;
  right: 8px;
  bottom: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--store-accent, #66c0f4);
  text-decoration: none;
  z-index: 2;
}

.home-recent-more:hover {
  text-decoration: underline;
}

.fj2me-last-play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 12px;
  text-decoration: none;
  color: #fff !important;
  background: linear-gradient(180deg, #4a8fc7 0%, #3578ad 100%);
  border: 1px solid #2f6a9a;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.22);
  flex-shrink: 0;
}

.fj2me-last-play-btn:hover {
  filter: brightness(1.06);
}

.home-recent-guest-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 0 8px;
}

.home-recent-tip {
  margin: 0;
  flex: none;
  max-width: 100%;
  font-size: 12px;
  line-height: 1.45;
  color: #b8c8d6;
}

.home-recent-loading,
.home-recent-empty {
  font-size: 12px;
  color: #8b98a8;
  padding: 6px 10px;
  text-align: center;
  max-width: 100%;
  box-sizing: border-box;
}

.home-recent-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(92px, auto);
  gap: 6px 7px;
  align-content: start;
  justify-items: stretch;
  min-height: 0;
  padding: 0 0 2px;
  box-sizing: border-box;
}

/* 迷你游戏库卡片（再收口）：上层图标区，下层单行名称 */
.home-recent-tile {
  border: 1px solid rgba(102, 192, 244, 0.18);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(32, 48, 66, 0.5), rgba(18, 26, 38, 0.88));
  padding: 5px 4px 4px;
  cursor: pointer;
  color: #e8eef5;
  display: grid;
  grid-template-rows: 1fr minmax(1.25em, auto);
  gap: 4px;
  min-height: 92px;
  min-width: 0;
  font: inherit;
  text-align: center;
  box-sizing: border-box;
  outline: none;
}

.home-recent-tile:hover {
  border-color: rgba(102, 192, 244, 0.5);
  background: linear-gradient(180deg, rgba(40, 58, 78, 0.65), rgba(22, 32, 46, 0.95));
}

.home-recent-tile:focus-visible {
  box-shadow: 0 0 0 2px rgba(102, 192, 244, 0.45);
}

/* 上层：正方形图标区，不撑满整格高度，约占卡片上部 */
.home-recent-icon-wrap {
  grid-row: 1;
  min-height: 0;
  width: min(100%, 44px);
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1;
  margin: 0 auto;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: rgba(10, 14, 22, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-sizing: border-box;
  overflow: hidden;
}

.home-recent-icon-wrap .home-recent-icon {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  object-fit: contain;
  object-position: center;
  border: none;
  flex-shrink: 0;
  box-sizing: border-box;
  padding: 1px;
}

.home-recent-icon-wrap .home-recent-icon--fb {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: clamp(11px, 0.82rem + 0.15vw, 15px);
  font-weight: 800;
  color: var(--store-accent, #66c0f4);
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(102, 192, 244, 0.22);
  flex-shrink: 0;
  box-sizing: border-box;
}

.home-recent-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.home-recent-icon--fb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
  color: var(--store-accent, #66c0f4);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(102, 192, 244, 0.25);
  flex-shrink: 0;
}

/* 下层：单行省略，不撑破卡片与网格 */
.home-recent-name {
  grid-row: 2;
  align-self: stretch;
  display: block;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0 1px;
  font-size: 10px;
  line-height: 1.3;
  font-weight: 700;
  color: #e6eef6;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}

/* —— Hero 轮播 —— */
.hero-carousel {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--store-border, rgba(102, 192, 244, 0.22));
  background: linear-gradient(135deg, rgba(15, 22, 32, 0.95), rgba(27, 40, 56, 0.88));
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  min-height: 300px;
}

.hero-carousel-inner {
  position: relative;
  width: 100%;
  min-height: 300px;
}

.hero-slides-viewport {
  overflow: hidden;
  width: 100%;
  min-height: 300px;
}

.hero-slides-track {
  display: flex;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  box-sizing: border-box;
}

.hero-slide {
  flex-shrink: 0;
  min-height: 300px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(260px, 38%) 1fr;
  gap: 0;
  align-items: stretch;
  opacity: 0.96;
}

.hero-slide-visual {
  position: relative;
  min-height: 300px;
  background: radial-gradient(ellipse at 30% 40%, rgba(102, 192, 244, 0.18), transparent 55%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.hero-slide-icon {
  width: min(168px, 58%);
  aspect-ratio: 1;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid rgba(102, 192, 244, 0.35);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-slide-icon-fallback {
  width: min(168px, 58%);
  aspect-ratio: 1;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 3rem;
  font-weight: 800;
  color: var(--store-accent, #66c0f4);
  background: rgba(0, 0, 0, 0.35);
  border: 2px solid var(--store-border);
}

.hero-slide:hover .hero-slide-icon {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
}

.hero-slide-info {
  padding: 36px 40px 36px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.28));
}

.hero-slide-title {
  margin: 0;
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
}

.hero-slide-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: rgba(103, 193, 245, 0.18);
  color: #a8d8f2;
  border: 1px solid rgba(103, 193, 245, 0.35);
}

.hero-slide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 24px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.12s ease;
}

.hero-btn-primary {
  background: linear-gradient(180deg, #799905, #536904);
  color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.hero-btn-secondary {
  background: rgba(102, 192, 244, 0.12);
  color: var(--store-accent, #66c0f4);
  border: 1px solid var(--store-border);
}

.hero-btn:hover {
  filter: brightness(1.1);
}

.hero-btn:active {
  transform: scale(0.98);
}

.hero-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 76px;
  border: 1px solid rgba(102, 192, 244, 0.25);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  z-index: 3;
  transition: background 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  opacity: 0.92;
  line-height: 1;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}

.hero-nav-btn:hover {
  background: rgba(102, 192, 244, 0.32);
  border-color: rgba(102, 192, 244, 0.5);
  opacity: 1;
}

.hero-nav-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(102, 192, 244, 0.45);
}

.hero-nav-prev {
  left: 10px;
}

.hero-nav-next {
  right: 10px;
}

.hero-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 3;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}

.hero-dot.active {
  background: var(--store-accent, #66c0f4);
  transform: scale(1.15);
}

/* 字母筛选 */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fff;
  text-transform: uppercase;
}

.section-head span {
  font-size: 12px;
  color: #8b9298;
}

.home-az-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 18px;
  background: var(--store-card);
  border: 1px solid var(--store-border);
  border-radius: 8px;
}

.home-az-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 36px;
  padding: 0 12px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
  color: #c2ccd4;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
}

.home-az-chip:hover {
  border-color: var(--store-accent);
  color: #fff;
  background: rgba(102, 192, 244, 0.12);
  transform: translateY(-2px);
}

/* 热门厂商 */
.home-vendor-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 18px;
  background: var(--store-card);
  border: 1px solid var(--store-border);
  border-radius: 8px;
}

.home-vendor-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(102, 192, 244, 0.28);
  background: linear-gradient(180deg, rgba(42, 62, 84, 0.65), rgba(27, 40, 56, 0.5));
  color: #dbe4ef;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.home-vendor-pill:hover {
  border-color: var(--store-accent);
  box-shadow: 0 4px 14px rgba(102, 192, 244, 0.18);
  transform: translateY(-2px);
}

/* 列表工具条 */
.list-deck {
  background: var(--store-card);
  border: 1px solid var(--store-border);
  border-radius: 8px;
  padding: 16px 18px;
}

.list-deck-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

body.steam-store .list-deck select {
  height: 40px;
  min-width: 140px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.steam-store .list-deck button {
  height: 40px;
  border-radius: 4px;
  font-weight: 600;
}

body.steam-store #resetBtn {
  background: rgba(139, 146, 152, 0.25);
}

body.steam-store #randomPlayBtn {
  background: linear-gradient(180deg, #4a90c5, #2e5f8c);
}

.list-meta-row {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: #8b9298;
}

/* 游戏网格 */
#grid.game-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

#grid.game-card-grid .card.game-card {
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  padding: 0;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(36, 52, 71, 0.9), rgba(22, 32, 45, 0.85));
  min-height: 0;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

#grid.game-card-grid .card.game-card:hover {
  transform: translateY(-6px);
  border-color: rgba(102, 192, 244, 0.45);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(102, 192, 244, 0.15);
}

#grid.game-card-grid .game-card-thumb {
  position: relative;
  height: var(--fj2me-game-thumb-px, 96px);
  background: #0d131c;
  display: flex;
  align-items: center;
  justify-content: center;
}

#grid.game-card-grid .game-card-thumb img.icon {
  width: var(--fj2me-game-thumb-px, 96px);
  height: var(--fj2me-game-thumb-px, 96px);
  object-fit: cover;
  border-radius: 0;
  border: none;
  flex-shrink: 0;
}

#grid.game-card-grid .game-card-thumb .icon-fallback {
  width: var(--fj2me-game-thumb-px, 96px);
  height: var(--fj2me-game-thumb-px, 96px);
  border-radius: 0;
  font-size: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.35);
}

#grid.game-card-grid a.game-card,
#grid.game-card-grid a.game-card .name,
#grid.game-card-grid a.game-card .heat {
  text-decoration: none;
}

#grid.game-card-grid .game-card-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

#grid.game-card-grid .name {
  font-size: 14px;
  font-weight: 700;
  color: #ecf4fc;
  max-height: none;
  line-height: 1.35;
}

#grid.game-card-grid .heat {
  margin-top: 0;
  font-size: 12px;
  color: #8f98a0;
}

/* 分页器 */
.pager.store-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 18px 0 8px;
}

body.steam-store .pager.store-pager button {
  min-width: 88px;
  height: 40px;
  border-radius: 4px;
  font-weight: 600;
}

body.steam-store .pager.store-pager #jumpInput {
  height: 40px;
}

#homeRankEntryList {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 1024px) {
  #grid.game-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .hero-slide {
    grid-template-columns: minmax(200px, 42%) 1fr;
  }
}

@media (max-width: 900px) {
  .hero-slide {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .hero-slide-visual {
    min-height: 200px;
    padding: 20px;
  }
  .hero-slide-info {
    padding: 20px 24px 28px;
  }
  .hero-nav-btn {
    height: 56px;
    width: 38px;
  }
}
