:root {
  --space-dark: #061220;
  --space-blue: #0f2847;
  --star-white: #e8f4fc;
  --nebula-pink: #f97316;
  --comet-cyan: #34d399;
  --sun-gold: #fbbf24;
  --planet-purple: #38bdf8;
  --ink-muted: rgba(232, 244, 252, 0.65);
  --line-soft: rgba(56, 189, 248, 0.22);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 32px rgba(52, 211, 153, 0.15);
  --g16-radius: 12px;
  --g16-radius-lg: 20px;
  --g16-header-h: 72px;
  --transition-fast: 0.2s ease;
  --g16-star-full: #fbbf24;
  --g16-star-glow: rgba(251, 191, 36, 0.55);
  --g16-star-empty: rgba(56, 189, 248, 0.32);
  --g16-star-track: rgba(6, 18, 32, 0.72);
  --g16-star-border: rgba(52, 211, 153, 0.28);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  width: 100%;
  overflow-x: hidden;
}

body {
  background: var(--space-dark);
  color: var(--star-white);
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  margin: 0;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.55;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  font-weight: 700;
  margin-top: 0;
  color: var(--star-white);
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; padding: 0; margin: 0; }

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

.brief-comment-game {
  margin: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 0.88rem;
  color: var(--ink-muted);
}

.module-description {
  margin: 0 0 1.25rem;
  line-height: 1.6;
  color: var(--ink-muted);
  max-width: 62ch;
}

/* Ads */
.g16-ad-slot {
  padding-top: 16px;
  padding-bottom: 16px;
  overflow: hidden;
}

/* 仅首屏顶栏广告需避开固定导航 */
.g16-ad-slot--hero,
.g16-ad-slot--tags-top {
  padding-top: calc(var(--g16-header-h) + 12px);
}

.g16-ad-slot iframe,
.g16-ad-slot ins,
.g16-ad-slot > div {
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.g16-legal-ad {
  padding-top: calc(var(--g16-header-h) + 20px);
}

.container > * + .legal-container {
  margin-top: 24px;
}

.container > .legal-container:first-child {
  margin-top: calc(var(--g16-header-h) + 20px);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.legal-container {
  padding: 32px 28px;
  margin-bottom: 48px;
  background: var(--space-blue);
  border: 1px solid var(--line-soft);
  border-radius: var(--g16-radius-lg);
  line-height: 1.7;
}

.legal-container h1,
.legal-container h2 {
  color: var(--comet-cyan);
}

/* Header */
.g16-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--g16-header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 32px);
  background: rgba(6, 18, 32, 0.88);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(14px);
}

.g16-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.logo-text {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, var(--comet-cyan), var(--planet-purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo-img {
  height: 40px;
  width: auto;
  display: block;
}

.g16-nav-dock {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  background: rgba(15, 40, 71, 0.85);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  max-width: min(62vw, 520px);
  overflow: visible;
  position: relative;
  z-index: 1;
}

/* 溢出「More」下拉：勿在 dock 上使用 overflow:hidden，否则菜单被裁切、点击像无反应 */
.g16-nav-dock .nav-more {
  position: relative;
  flex: 0 0 auto;
}

.g16-nav-dock .nav-more-toggle {
  cursor: pointer;
  border: none;
  font: inherit;
  background: transparent;
  color: inherit;
  box-shadow: none;
}

.g16-nav-dock .nav-more-menu {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 180px;
  padding: 10px;
  border-radius: 8px;
  background: var(--space-blue);
  border: 1px solid rgba(52, 211, 153, 0.35);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  z-index: 1002;
}

.g16-nav-dock .nav-more.active .nav-more-menu {
  display: block;
}

.g16-nav-dock .nav-more.active .nav-more-toggle {
  color: var(--space-dark);
  background: var(--comet-cyan);
}

.g16-nav-dock .nav-more-menu .nav-link {
  display: block;
  margin-bottom: 8px;
  white-space: nowrap;
}

.g16-nav-dock .nav-more-menu .nav-link:last-child {
  margin-bottom: 0;
}

.g16-nav-dock .nav-item--primary.is-overflow-hidden {
  display: none;
}

.g16-nav-dock .nav-link {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ink-muted);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.g16-nav-dock .nav-link:hover,
.g16-nav-dock .nav-link.active {
  color: var(--space-dark);
  background: var(--comet-cyan);
}

/* Mobile nav */
.g16-mobile-dock {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 58px;
  background: rgba(6, 18, 32, 0.96);
  border-top: 1px solid var(--line-soft);
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.g16-mobile-dock .mobile-nav-item {
  font-size: 1.35rem;
  padding: 8px 24px;
  color: var(--ink-muted);
  border-radius: 12px;
}

.g16-mobile-dock .mobile-nav-item.active {
  color: var(--comet-cyan);
  background: rgba(52, 211, 153, 0.12);
}

/* Hero */
.g16-hero-terminal {
  position: relative;
  margin-top: var(--g16-header-h);
  padding: 56px 0 48px;
  overflow: hidden;
}

.g16-hero-mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 40%, rgba(52, 211, 153, 0.18), transparent),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(56, 189, 248, 0.15), transparent),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(249, 115, 22, 0.1), transparent);
  pointer-events: none;
}

.g16-hero-inner {
  position: relative;
  text-align: center;
}

.g16-hero-prompt {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.75rem;
  color: var(--comet-cyan);
  margin: 0 0 12px;
  letter-spacing: 0.04em;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
  margin-bottom: 12px;
}

.hero-subtitle {
  color: var(--ink-muted);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto 28px;
  line-height: 1.6;
}

.hero-subtitle p {
  margin: 0;
}

.g16-hero-search {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 520px;
  margin: 0 auto 24px;
  justify-content: center;
}

.g16-search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.form-input {
  flex: 1 1 200px;
  min-width: 0;
  padding: 12px 16px;
  border-radius: var(--g16-radius);
  border: 1px solid var(--line-soft);
  background: rgba(15, 40, 71, 0.8);
  color: var(--star-white);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
}

.form-input:focus {
  border-color: var(--comet-cyan);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border: none;
  border-radius: var(--g16-radius);
  background: linear-gradient(135deg, var(--nebula-pink), #ea580c);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.35);
}

.g16-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.g16-stat {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 14px;
  border: 1px dashed var(--line-soft);
  border-radius: 6px;
  color: var(--ink-muted);
}

.g16-stat strong {
  color: var(--comet-cyan);
  font-weight: 600;
}

/* Featured top 3: equal overlay tiles (image-first, title on gradient) */
.g16-portholes-wrap {
  padding: 4px 0 32px;
}

.g16-portholes-desc {
  margin-bottom: 14px;
}

.g16-porthole-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
}

.g16-porthole-tile {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  overflow: hidden;
  background: #0c1828;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.g16-porthole-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(52, 211, 153, 0.35);
}

.g16-porthole-tile > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.g16-porthole-tile:hover > img {
  transform: scale(1.06);
}

.g16-porthole-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    transparent 45%,
    rgba(6, 18, 32, 0.55) 72%,
    rgba(6, 18, 32, 0.92) 100%
  );
  pointer-events: none;
  z-index: 1;
}

.g16-porthole-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
}

.g16-porthole-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

/* 游戏卡片标题：统一单行省略 */
.g16-porthole-title,
.g16-hcard h3,
.g16-game-tile .card-title,
.special-card-content > h3,
.carousel-card-content .game-title,
.carousel-card-content > h3,
.g16-detail-related .special-card-content > h3 {
  margin: 0 0 6px;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.g16-hcard h3 {
  font-size: 1rem;
}

/* star_html — G16 arcade terminal style */
.game-star,
.game-star .star-rating,
.star-rating {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 3px;
  padding: 4px 10px 4px 8px;
  font-size: 0.82rem;
  line-height: 1;
  min-height: 1.35em;
  font-family: 'Source Code Pro', monospace;
  letter-spacing: 0.02em;
  background: var(--g16-star-track);
  border: 1px solid var(--g16-star-border);
  border-radius: 6px;
  box-shadow:
    inset 0 1px 0 rgba(56, 189, 248, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.2);
}

.game-star .star-icon,
.game-star .star-full,
.game-star .star-empty,
.game-star .star-half,
.game-star .fa,
.game-star .fas,
.game-star .far,
.game-star i,
.star-rating .star-icon,
.star-rating .star-full,
.star-rating .star-empty,
.star-rating .star-half,
.star-rating i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05em;
  height: 1.05em;
  font-style: normal;
  font-size: 0.95em;
  line-height: 1;
  flex-shrink: 0;
}

.game-star .star-icon::before,
.game-star .star-full::before,
.game-star .fa-star::before,
.game-star .star-rating .star-icon::before,
.game-star .star-rating .star-full::before,
.game-star .star-rating .fa-star::before,
.star-rating .star-icon::before,
.star-rating .star-full::before {
  content: "★";
  color: var(--g16-star-full);
  text-shadow: 0 0 8px var(--g16-star-glow);
}

.game-star .star-half::before,
.game-star .star-rating .star-half::before,
.star-rating .star-half::before {
  content: "★";
  color: var(--g16-star-full);
  opacity: 0.55;
  text-shadow: 0 0 6px var(--g16-star-glow);
}

.game-star .star-empty::before,
.game-star .fa-star-o::before,
.game-star .far.fa-star::before,
.game-star .star-rating .star-empty::before,
.game-star .star-rating .fa-star-o::before,
.star-rating .star-empty::before {
  content: "☆";
  color: var(--g16-star-empty);
  text-shadow: none;
}

/* 列表 / 卡片：评分条左对齐，不拉满整行 */
.g16-porthole-meta .game-star,
.special-card-content .game-star,
.g16-hcard .game-star,
.carousel-card-content .game-star,
.g16-snap-card .carousel-card-content .game-star,
.g16-game-tile .card-meta > .game-star,
.g16-detail-related .special-card-content .game-star {
  display: inline-flex;
  width: auto;
  max-width: 100%;
  flex: 0 0 auto;
  margin: 0 0 6px;
  align-self: flex-start;
}

/* 首页精选：叠在暗色渐变上，略透明 + 毛玻璃 */
.g16-porthole-meta .game-star {
  margin: 0;
  padding: 3px 8px;
  font-size: 0.75rem;
  gap: 2px;
  background: rgba(6, 18, 32, 0.82);
  border-color: rgba(52, 211, 153, 0.38);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.g16-porthole-meta .game-star .star-icon,
.g16-porthole-meta .game-star .star-full,
.g16-porthole-meta .game-star .star-empty,
.g16-porthole-meta .game-star .star-half,
.g16-porthole-meta .game-star i {
  width: 1em;
  height: 1em;
  font-size: 0.9em;
}

/* 详情页：内联星级，避免与 .star-rating 双层边框 */
.game-star.game-star--detail-hero {
  display: inline-flex;
  align-items: center;
  margin: 0 0 14px;
  padding: 0;
  gap: 0;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  min-height: 0;
}

.game-star.game-star--detail-hero .detail-rating-visual,
.game-star.game-star--detail-hero .star-rating {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 0;
  margin: 0;
  font-size: 1.2rem;
  line-height: 1;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  min-height: 0;
}

.game-star.game-star--detail-hero .star-icon,
.game-star.game-star--detail-hero .star-full,
.game-star.game-star--detail-hero .star-empty,
.game-star.game-star--detail-hero .star-half,
.game-star.game-star--detail-hero i {
  width: 1.15em;
  height: 1.15em;
  font-size: 1.05em;
}

.game-star.game-star--detail-hero .star-icon::before,
.game-star.game-star--detail-hero .star-full::before,
.game-star.game-star--detail-hero .fa-star::before {
  text-shadow: 0 0 10px var(--g16-star-glow);
}

.game-star.game-star--detail-hero .star-empty::before,
.game-star.game-star--detail-hero .fa-star-o::before,
.game-star.game-star--detail-hero .far.fa-star::before {
  color: rgba(148, 163, 184, 0.45);
}

/* 横向卡片内容区 */
.g16-hcard .special-card-content .game-star,
.g16-snap-card .carousel-card-content .game-star {
  margin-bottom: 4px;
}

.card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  gap: 4px;
}

.card-meta > .brief-comment-game {
  width: 100%;
}

/* 图片懒加载占位 / 加载失败兜底（列表区静态占位，仅首屏 LCP 图轻量 shimmer） */
@keyframes g16-img-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.g16-img-ph {
  background-color: var(--space-blue);
  object-fit: cover;
}

.g16-img-ph.is-loading {
  background-image: linear-gradient(
    110deg,
    rgba(15, 40, 71, 0.98) 0%,
    rgba(52, 211, 153, 0.1) 50%,
    rgba(15, 40, 71, 0.98) 100%
  );
}

.g16-img-ph.is-loaded {
  background-image: none;
  background-color: transparent;
}

.g16-img-ph.is-error {
  background-image: none;
  background-color: var(--space-blue);
  opacity: 0;
}

.g16-porthole-tile,
.card-media,
.g16-cover-frame {
  position: relative;
}

.g16-porthole-tile::before,
.card-media::before,
.g16-cover-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  background-color: var(--space-blue);
}

/* 卡片区：静态占位，不跑 background-position 动画 */
.card-media:has(> img.g16-img-ph.is-loading)::before {
  opacity: 1;
}

/* 首屏 LCP：porthole 首张 + 详情封面，最多 2 次 shimmer */
.g16-porthole-tile:first-child:has(> img.g16-img-ph.is-loading)::before,
.g16-cover-frame:has(> img.g16-img-ph.is-loading)::before {
  opacity: 1;
  background-image: linear-gradient(
    110deg,
    rgba(15, 40, 71, 0.98) 0%,
    rgba(52, 211, 153, 0.14) 45%,
    rgba(56, 189, 248, 0.2) 55%,
    rgba(15, 40, 71, 0.98) 100%
  );
  background-size: 220% 100%;
  animation: g16-img-shimmer 1.6s ease-in-out 2;
}

@media (prefers-reduced-motion: reduce) {
  .g16-porthole-tile:first-child:has(> img.g16-img-ph.is-loading)::before,
  .g16-cover-frame:has(> img.g16-img-ph.is-loading)::before {
    animation: none;
  }
}

.g16-porthole-tile:has(> img.g16-img-ph.is-error)::before,
.card-media:has(> img.g16-img-ph.is-error)::before,
.g16-cover-frame:has(> img.g16-img-ph.is-error)::before {
  opacity: 1;
  animation: none;
  background-image: none;
}

.g16-porthole-tile:has(> img.g16-img-ph.is-error)::after,
.card-media:has(> img.g16-img-ph.is-error)::after,
.g16-cover-frame:has(> img.g16-img-ph.is-error)::after {
  content: '🎮';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  font-size: clamp(1.5rem, 6vw, 2.25rem);
  opacity: 0.45;
  pointer-events: none;
  line-height: 1;
}

.g16-hcard .card-media {
  width: 100%;
  height: 100%;
  min-height: 112px;
}

.g16-snap-card .card-media {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.g16-porthole-tile > img.g16-img-ph,
.card-media > img.g16-img-ph,
.g16-cover-frame > img.g16-img-ph {
  position: relative;
  z-index: 1;
}

.g16-porthole-veil,
.g16-porthole-meta {
  z-index: 2;
}

/* Sections */
.daily-special {
  padding: 28px 0;
}

/* 首屏以下模块延迟布局/绘制，减轻主线程与 Speed Index 压力 */
.g16-portholes-wrap ~ .daily-special,
.g16-portholes-wrap ~ .g16-ad-slot,
.orbit-categories.g16-genre-deck,
.g16-detail-related,
.g16-detail-body {
  content-visibility: auto;
  contain-intrinsic-size: auto 420px;
}

.section-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.section-header h2 {
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.g16-module-tag {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  background: rgba(249, 115, 22, 0.2);
  color: var(--nebula-pink);
  border-radius: 4px;
}

.module-link-more {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.8rem;
  color: var(--comet-cyan);
  font-weight: 600;
}

.module-link-more:hover {
  color: var(--planet-purple);
}

/* Horizontal row cards */
.g16-row-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.g16-hcard.special-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0;
  align-items: stretch;
  background: var(--space-blue);
  border: 1px solid var(--line-soft);
  border-radius: var(--g16-radius);
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.g16-hcard:hover {
  border-color: var(--comet-cyan);
  box-shadow: var(--shadow-card);
}

.g16-hcard .special-card-img {
  width: 100%;
  height: 100%;
  min-height: 112px;
  object-fit: cover;
  display: block;
}

.g16-hcard .special-card-content,
.g16-snap-card .carousel-card-content {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.g16-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.g16-tag-lbl {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.68rem;
  padding: 2px 8px;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 4px;
  color: var(--planet-purple);
}

/* Carousel */
.g16-snap-rail {
  position: relative;
  margin: 0 -20px;
  padding: 0 48px;
}

.g16-snap-rail .carousel-container {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 8px 4px 16px;
  scrollbar-width: none;
}

.g16-snap-rail .carousel-container::-webkit-scrollbar {
  display: none;
}

.g16-snap-card {
  flex: 0 0 min(280px, 78vw);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  background: var(--space-blue);
  border: 1px solid var(--line-soft);
  border-radius: var(--g16-radius);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.g16-snap-card:hover {
  border-color: var(--nebula-pink);
}

.g16-snap-card .carousel-card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line-soft);
  background: rgba(6, 18, 32, 0.9);
  color: var(--star-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-btn.prev { left: 4px; }
.carousel-btn.next { right: 4px; }

/* Genre deck */
.g16-genre-deck {
  padding: 40px 0 56px;
  background: linear-gradient(180deg, transparent, rgba(15, 40, 71, 0.5));
}

.g16-genre-heading {
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: var(--ink-muted);
  font-weight: 600;
}

.g16-genre-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.g16-genre-tile {
  display: flex;
  align-items: flex-end;
  min-height: 88px;
  padding: 14px 16px;
  border-radius: var(--g16-radius);
  border: 1px solid var(--line-soft);
  background: linear-gradient(145deg, var(--space-blue), rgba(15, 40, 71, 0.4));
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.g16-genre-tile:hover {
  transform: scale(1.02);
  border-color: var(--comet-cyan);
}

.g16-genre-tile[data-planet-index="0"] { border-left: 3px solid var(--comet-cyan); }
.g16-genre-tile[data-planet-index="1"] { border-left: 3px solid var(--planet-purple); }
.g16-genre-tile[data-planet-index="2"] { border-left: 3px solid var(--nebula-pink); }
.g16-genre-tile[data-planet-index="3"] { border-left: 3px solid var(--sun-gold); }
.g16-genre-tile[data-planet-index="4"] { border-left: 3px solid #a78bfa; }
.g16-genre-tile[data-planet-index="5"] { border-left: 3px solid #fb7185; }

.g16-genre-tile-label {
  font-weight: 700;
  font-size: 0.95rem;
}

/* Tags page */
.g16-tags-shell {
  padding-top: 0;
}

.tags-box > .g16-tags-head:first-child {
  margin-top: calc(var(--g16-header-h) + 12px);
}

.tags-box > * + .g16-tags-head {
  margin-top: 16px;
}

.tags-box > * + .g16-tags-main {
  margin-top: 8px;
}

.g16-tags-shell:not(:last-child) {
  padding-bottom: 24px;
}

.g16-tags-head {
  padding: 28px 20px 12px;
}

.g16-tags-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin-bottom: 8px;
}

.g16-tags-sub {
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink-muted);
  margin: 0;
}

.g16-cat-rail-wrap .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
}

.g16-cat-rail {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  flex: 1 1 auto;
  min-width: 0;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.g16-cat-chip {
  flex: 0 0 auto;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: var(--space-blue);
  color: var(--ink-muted);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.g16-cat-chip:hover,
.g16-cat-chip.active {
  background: var(--comet-cyan);
  color: var(--space-dark);
  border-color: var(--comet-cyan);
}

.g16-view-toolbar {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.g16-view-btn {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 8px 12px;
  border: 1px solid var(--line-soft);
  background: transparent;
  color: var(--ink-muted);
  border-radius: 6px;
  cursor: pointer;
}

.g16-view-btn.is-active {
  background: var(--planet-purple);
  color: var(--space-dark);
  border-color: var(--planet-purple);
}

.g16-tags-main {
  padding-bottom: 32px;
}

.tags-box > * + .g16-tags-main,
.tags-box > .g16-ad-slot--tags-top + .g16-tags-head {
  margin-top: 0;
}

.g16-games-mosaic {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.g16-game-tile {
  display: flex;
  flex-direction: column;
  background: var(--space-blue);
  border: 1px solid var(--line-soft);
  border-radius: var(--g16-radius);
  overflow: hidden;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.g16-game-tile:hover {
  transform: translateY(-4px);
  border-color: var(--comet-cyan);
}

.g16-game-tile .card-media {
  display: block;
  line-height: 0;
}

.g16-game-tile .card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.g16-game-tile .card-content {
  padding: 12px 14px;
}

.g16-game-tile .card-title {
  font-size: 0.95rem;
}

/* List view */
.games-grid.list-view {
  grid-template-columns: 1fr !important;
  gap: 12px;
}

.games-grid.list-view .g16-game-tile {
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

.games-grid.list-view .card-media {
  flex: 0 0 auto;
  width: 38%;
  max-width: 220px;
  min-width: 140px;
  position: relative;
  overflow: hidden;
  align-self: stretch;
}

.games-grid.list-view .card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: unset;
  object-fit: cover;
  object-position: center;
  display: block;
}

.games-grid.list-view .card-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (max-width: 768px) {
  /* 移动端游戏列表：双列网格（分类 / 首页模块 / 推荐） */
  .g16-games-mosaic:not(.list-view),
  .g16-row-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .g16-row-cards .g16-hcard.special-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .g16-games-mosaic:not(.list-view) .g16-game-tile .card-media,
  .g16-row-cards .g16-hcard .card-media {
    aspect-ratio: 16 / 10;
    overflow: hidden;
  }

  .g16-games-mosaic:not(.list-view) .g16-game-tile .card-img,
  .g16-row-cards .g16-hcard .special-card-img {
    aspect-ratio: 16 / 10;
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
  }

  .g16-games-mosaic:not(.list-view) .card-content,
  .g16-row-cards .g16-hcard .special-card-content {
    padding: 6px 8px 7px;
    gap: 2px;
  }

  .g16-games-mosaic:not(.list-view) .card-title,
  .g16-row-cards .g16-hcard .game-title,
  .g16-row-cards .g16-hcard h3 {
    font-size: 0.76rem;
    line-height: 1.25;
    margin-bottom: 2px;
  }

  .g16-games-mosaic:not(.list-view) .card-meta,
  .g16-row-cards .g16-hcard .special-card-content {
    gap: 2px;
  }

  .g16-games-mosaic:not(.list-view) .card-meta > .game-star,
  .g16-row-cards .g16-hcard .special-card-content > .game-star {
    margin-bottom: 0;
    padding: 2px 6px;
    font-size: 0.65rem;
    gap: 1px;
    min-height: 0;
  }

  .g16-games-mosaic:not(.list-view) .g16-card-tags,
  .g16-row-cards .g16-hcard .g16-card-tags {
    flex-wrap: nowrap;
    overflow: hidden;
    gap: 4px;
    max-height: 1.25rem;
  }

  .g16-games-mosaic:not(.list-view) .g16-tag-lbl,
  .g16-row-cards .g16-hcard .g16-tag-lbl {
    font-size: 0.58rem;
    padding: 1px 5px;
    flex-shrink: 0;
    white-space: nowrap;
  }

  .g16-games-mosaic:not(.list-view) .card-meta .brief-comment-game,
  .g16-row-cards .g16-hcard .brief-comment-game {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    font-size: 0.68rem;
    line-height: 1.3;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }

  .games-grid.list-view .g16-game-tile {
    min-height: 88px;
  }

  .games-grid.list-view .card-media {
    width: 112px;
    min-width: 112px;
    max-width: 112px;
  }

  .games-grid.list-view .card-content {
    padding: 10px 12px;
  }

  .games-grid.list-view .card-title {
    font-size: 0.85rem;
  }
}

.tags-layout:not(:last-child) {
  padding-bottom: 24px;
}

/* Detail */
.g16-detail-wrap {
  padding-top: calc(var(--g16-header-h) + 16px);
  padding-bottom: 32px;
}

.breadcrumb-nav { margin: 0 0 20px; }

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.breadcrumb-item a,
.breadcrumb-item span[aria-current="page"] {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.72rem;
  color: var(--comet-cyan);
}

.breadcrumb-separator {
  color: var(--ink-muted);
  font-size: 0.8rem;
}

.g16-detail-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 28px;
}

.g16-cover-frame {
  border-radius: var(--g16-radius-lg);
  overflow: hidden;
  border: 2px solid var(--line-soft);
  box-shadow: var(--shadow-card);
}

.g16-cover-frame .game-cover {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.g16-detail-panel h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 10px;
}

.g16-tag-pill {
  display: inline-block;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.72rem;
  padding: 4px 10px;
  margin: 0 6px 6px 0;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  color: var(--planet-purple);
}

.g16-btn-play {
  width: 100%;
  max-width: 280px;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--g16-radius);
  background: linear-gradient(135deg, var(--comet-cyan), #059669);
  color: var(--space-dark);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.g16-btn-play:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-glow);
}

.g16-detail-body {
  background: var(--space-blue);
  border: 1px solid var(--line-soft);
  border-radius: var(--g16-radius-lg);
  padding: 20px 24px;
}

.g16-detail-tabs .tab-btn {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.8rem;
  padding: 8px 16px;
  border: 1px solid var(--comet-cyan);
  background: rgba(52, 211, 153, 0.15);
  color: var(--comet-cyan);
  border-radius: 6px;
  cursor: pointer;
}

.detail-split-block {
  padding: 16px 0;
  border-top: 1px solid var(--line-soft);
}

.detail-split-block:first-of-type {
  border-top: none;
  padding-top: 8px;
}

.detail-split-block h2 {
  font-size: 1.1rem;
  color: var(--nebula-pink);
  margin-bottom: 10px;
}

.rich-content {
  line-height: 1.7;
  color: var(--ink-muted);
}

.rich-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--g16-radius);
}

.g16-detail-related {
  padding-bottom: 40px;
}

.g16-related-title {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

/* Modal */
.g16-game-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(6, 18, 32, 0.92);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.g16-game-modal.is-open {
  display: flex;
}

.g16-modal-shell {
  position: relative;
  width: min(960px, 100%);
  aspect-ratio: 16 / 9;
  background: #000;
  border: 2px solid var(--comet-cyan);
  border-radius: var(--g16-radius);
  overflow: hidden;
}

.g16-modal-shell iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.g16-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.75rem;
  padding: 6px 12px;
  background: rgba(6, 18, 32, 0.85);
  border: 1px solid var(--line-soft);
  color: var(--star-white);
  border-radius: 6px;
  cursor: pointer;
}

/* Empty state */
.g16-empty {
  text-align: center;
  padding: 48px 20px;
}

.g16-empty-ring {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border: 3px dashed var(--comet-cyan);
  border-radius: 50%;
  animation: g16-spin 12s linear infinite;
}

@keyframes g16-spin {
  to { transform: rotate(360deg); }
}

.game-empty-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 8px;
}

/* Footer */
.g16-footer {
  margin-top: auto;
  background: #041018;
  position: relative;
}

.g16-footer-wave {
  display: block;
  width: 100%;
  height: 32px;
}

.g16-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  padding: 32px 20px 24px;
}

.g16-footer-kicker {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--comet-cyan);
  margin-bottom: 10px;
}

.g16-footer-brand p {
  color: var(--ink-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0 0 16px;
}

.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-social-link {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  color: var(--star-white);
  transition: background var(--transition-fast);
}

.footer-social-link:hover {
  background: var(--comet-cyan);
  color: var(--space-dark);
}

.footer-col ul li {
  margin-bottom: 8px;
}

.footer-col ul a {
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.footer-col ul a:hover {
  color: var(--comet-cyan);
}

.g16-footer-bottom {
  border-top: 1px solid var(--line-soft);
  padding: 16px 20px;
  text-align: center;
}

.g16-footer-bottom p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.g16-back-top {
  position: fixed;
  bottom: 72px;
  right: 20px;
  z-index: 999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--comet-cyan);
  background: var(--space-blue);
  color: var(--comet-cyan);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

.g16-back-top.show {
  opacity: 1;
  visibility: visible;
}

.pagination-container {
  margin-top: 28px;
  padding-bottom: 16px;
}

/* Responsive */
@media (max-width: 900px) {
  .g16-porthole-row {
    gap: 12px;
  }

  .g16-detail-hero {
    grid-template-columns: 1fr;
  }

  .g16-genre-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .g16-games-mosaic {
    grid-template-columns: repeat(2, 1fr);
  }

  .g16-hcard.special-card {
    grid-template-columns: 140px 1fr;
  }
}

@media (max-width: 768px) {
  .g16-nav-dock {
    display: none;
  }

  .g16-mobile-dock {
    display: flex;
  }

  body {
    padding-bottom: 58px;
  }

  .g16-back-top {
    bottom: 78px;
  }

  .g16-footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .g16-snap-rail {
    padding: 0 36px;
  }

  .g16-porthole-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .g16-porthole-tile {
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 480px) {
  .g16-genre-grid {
    grid-template-columns: 1fr;
  }
}
