/* Path 283 — editorial game hub (static) */
:root {
  --ink: #161018;
  --muted: #5c5560;
  --paper: #f7f4ef;
  --panel: #ffffff;
  --line: rgba(22, 16, 24, 0.12);
  --accent: #ff5a33;
  --accent-ink: #3b0d00;
  --plum: #3a2a45;
  --sand: #ebe4d8;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(22, 16, 24, 0.12);
  --font: ui-sans-serif, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-serif, Georgia, "Times New Roman", serif;
  --max: 1120px;
  --tap: 44px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(255, 90, 51, 0.14), transparent 55%),
    radial-gradient(700px 380px at 92% 0%, rgba(58, 42, 69, 0.12), transparent 50%),
    var(--paper);
  -webkit-text-size-adjust: 100%;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--plum);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-ink);
}

:focus-visible {
  outline: 3px solid rgba(255, 90, 51, 0.55);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  padding: 10px 14px;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  z-index: 1000;
}

.skip-link:focus {
  left: 12px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #ffb36b);
  box-shadow: 0 10px 22px rgba(255, 90, 51, 0.28);
}

.brand-text {
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.1;
}

.brand-text small {
  display: block;
  font-family: var(--font);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.header-search {
  justify-self: center;
  width: min(420px, 100%);
}

.header-search form {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.header-search input[type="search"] {
  flex: 1;
  min-height: var(--tap);
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  font: inherit;
}

.header-search button {
  min-height: var(--tap);
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

.nav-toggle {
  display: none;
  min-width: var(--tap);
  min-height: var(--tap);
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  font-weight: 800;
}

.desktop-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.desktop-nav a {
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 650;
  font-size: 0.92rem;
}

.desktop-nav a[aria-current="page"] {
  background: var(--sand);
  border: 1px solid var(--line);
}

.mobile-panel {
  display: none;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.mobile-panel-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 16px 18px;
  display: grid;
  gap: 8px;
}

.mobile-panel a {
  display: block;
  padding: 12px 12px;
  border-radius: var(--radius-sm);
  background: var(--sand);
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
}

main {
  flex: 1;
}

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px 16px 28px;
}

.section-tight {
  padding-top: 14px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.h1 {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3.6vw, 2.15rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0;
}

.h1.section-kicker {
  font-size: 1.25rem;
}

.lede {
  margin: 0;
  max-width: 70ch;
  color: var(--muted);
  font-size: 1.02rem;
}

.lede + .game-grid {
  margin-top: 14px;
}

.search-results-line {
  margin: 0;
  font-size: 1rem;
  color: var(--muted);
  font-weight: 650;
}

.search-results-line strong {
  color: var(--ink);
}

.link-more {
  font-weight: 800;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 2px solid rgba(255, 90, 51, 0.55);
  padding-bottom: 2px;
}

/* Ad slots — $url_model: index_js_one / index_js_two / detail_js_one（首页|分类|详情主栏） / detail_js_two（详情侧栏） */
.ad-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
  padding: 0 16px;
  box-sizing: border-box;
  text-align: center;
}

.ad-slot-hint {
  margin: 0 0 10px;
  padding: 0 8px 8px;
  width: 100%;
  max-width: 720px;
  box-sizing: border-box;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  line-height: 1.35;
}

.ad-slot-hint__zh {
  display: inline-block;
  margin-left: 0.35em;
  font-size: 0.92em;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: none;
  opacity: 0.88;
}

.ad-slot-inner {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ad-slot-inner > * {
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
}

.ad-slot iframe,
.ad-slot ins,
.ad-slot-inner iframe,
.ad-slot-inner ins {
  max-width: 100%;
}

.ad-slot--leader {
  margin-top: 12px;
  margin-bottom: 14px;
}

.ad-slot--mid {
  margin: 18px auto 20px;
}

.ad-slot--detail-below-game {
  margin: 16px 0 20px;
  width: 100%;
}

.ad-slot--detail-sidebar {
  margin: 0 0 16px;
  width: 100%;
}

.ad-slot--detail-sidebar .ad-slot-inner {
  align-items: center;
}

.ad-slot--tags-top {
  margin: 0 auto 16px;
}

/* Banner rail — featured games */
.banner-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 16px 6px;
}

.banner-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.banner-title {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--muted);
}

.banner-controls {
  display: flex;
  gap: 8px;
}

.banner-controls button {
  width: var(--tap);
  height: var(--tap);
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  font-size: 1.1rem;
}

.banner-rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.banner-rail::-webkit-scrollbar {
  height: 8px;
}

.banner-rail::-webkit-scrollbar-thumb {
  background: rgba(22, 16, 24, 0.18);
  border-radius: 999px;
}

.banner-card {
  flex: 0 0 min(280px, 78vw);
  scroll-snap-align: start;
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  display: grid;
  grid-template-rows: auto 1fr;
}

.banner-card figure {
  margin: 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--sand);
}

.banner-card figcaption {
  padding: 12px 12px 14px;
}

.banner-card h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.banner-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Categories */
.cat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 18px;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  font-size: 0.92rem;
}

.cat-pill span {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.82rem;
}

/* Game grid */
.game-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

.game-card {
  grid-column: span 4;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 10px 26px rgba(22, 16, 24, 0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Only the cover link inherits text color; .game-actions links keep .btn colors */
.game-card > a {
  text-decoration: none;
  color: inherit;
}

.game-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--sand);
  overflow: hidden;
}

.game-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

.game-body {
  padding: 12px 12px 14px;
  display: grid;
  gap: 8px;
}

.game-title {
  margin: 0;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.game-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent-ink);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.game-actions {
  padding: 0 12px 12px;
  margin-top: auto;
}

.game-actions .btn-primary {
  width: 100%;
  color: #fff;
  background: linear-gradient(145deg, #2a2435, var(--ink));
  box-shadow: 0 6px 18px rgba(22, 16, 24, 0.12);
}

.game-actions .btn-primary:hover {
  filter: brightness(1.06);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: var(--ink);
  color: #fff;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--sand) 55%, var(--paper));
  padding: 22px 16px 96px;
}

@media (min-width: 900px) {
  .site-footer {
    padding-bottom: 28px;
  }
}

.footer-grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
}

.footer-note {
  margin: 0;
  color: var(--muted);
  max-width: 52ch;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  justify-items: start;
}

.footer-links a {
  font-weight: 750;
  text-decoration: none;
  color: var(--ink);
}

.footer-copy {
  max-width: var(--max);
  margin: 16px auto 0;
  padding: 0 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Bottom bar (mobile) */
.bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: none;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: blur(10px);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
}

.bottom-bar nav {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.bottom-bar a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 850;
  font-size: 0.78rem;
  text-align: center;
  padding: 8px 6px;
  border-radius: 12px;
}

.bottom-bar a[aria-current="page"] {
  background: var(--sand);
}

/* Legal pages */
.legal {
  max-width: 760px;
}

.legal h2 {
  font-family: var(--font-display);
  margin-top: 1.4rem;
}

.legal h2:first-child {
  margin-top: 0;
}

/* Detail */
.detail-hero {
  display: grid;
  gap: 14px;
}

@media (min-width: 900px) {
  .detail-hero {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: start;
  }
}

.play-panel {
  display: flex;
  flex-direction: column;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* —— Game detail page (detail.html) —— */
.game-detail {
  max-width: 1080px;
}

.game-detail-crumb {
  margin-bottom: 16px;
}

.game-detail-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 20px;
  margin-bottom: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.game-detail-title-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: min(100%, 280px);
}

.game-detail-h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 4.2vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.game-detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.game-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--sand);
  border: 1px solid var(--line);
  color: var(--muted);
}

.game-badge--muted {
  background: var(--panel);
}

.game-badge--accent {
  background: color-mix(in srgb, var(--accent) 18%, var(--panel));
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  color: var(--accent-ink);
}

.game-detail-back {
  flex-shrink: 0;
}

.game-detail .game-ai-lead {
  margin: 0 0 22px;
  padding: 16px 18px;
  max-width: none;
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
  background: color-mix(in srgb, var(--panel) 88%, var(--sand));
  box-shadow: 0 1px 0 var(--line);
  font-size: 1.04rem;
  line-height: 1.62;
  color: var(--ink);
}

.game-detail-layout {
  display: grid;
  gap: 20px;
  align-items: start;
  isolation: isolate;
}

@media (min-width: 960px) {
  .game-detail-layout {
    grid-template-columns: 1fr min(300px, 32%);
    gap: 24px;
    align-items: stretch;
  }
}

.game-detail-primary {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.game-stage {
  border-radius: calc(var(--radius) + 6px);
  border: 1px solid var(--line);
  background: linear-gradient(165deg, #1e1a24 0%, #121016 48%, #0c0a0e 100%);
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  overflow: hidden;
}

.game-stage-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.game-stage-traffic {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.game-stage-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.game-stage-dot--close {
  background: #ff5f57;
}

.game-stage-dot--min {
  background: #febc2e;
}

.game-stage-dot--max {
  background: #28c840;
}

.game-stage-label {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
}

.game-stage-viewport {
  position: relative;
  background: #000;
  aspect-ratio: 16 / 10;
  max-height: min(600px, 68vh);
  min-height: 200px;
  overflow: hidden;
}

.game-play-poster {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0;
  padding: 0;
  text-align: center;
  background: #0a0810;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

/* Stack: cover image (0) → gradient overlay (1). Override global img rules. */
.game-stage-viewport .game-poster-cover {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center;
  -webkit-object-fit: cover;
}

.game-play-poster-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  box-sizing: border-box;
  padding: 16px 16px 24px;
  background: linear-gradient(
    180deg,
    rgba(10, 8, 16, 0.12) 0%,
    rgba(10, 8, 16, 0.45) 50%,
    rgba(10, 8, 16, 0.88) 100%
  );
  pointer-events: none;
}

.game-play-poster[hidden] {
  display: none !important;
}

.game-play-poster-text {
  margin: 0;
  max-width: 32ch;
  font-size: 0.92rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.78);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.65);
}

.game-play-poster-text strong {
  color: #fff;
  font-weight: 800;
}

/* Do not set touch-action: none — it blocks taps inside the game iframe on mobile */
body.game-detail-no-scroll {
  overflow: hidden;
}

body.game-detail-no-scroll .bottom-bar {
  visibility: hidden;
  pointer-events: none;
}

/*
 * Back control lives in .game-stage-bar (above the iframe). Mobile WebKit often paints
 * cross-origin iframes over sibling DOM inside the same box, so the bar must stay outside .game-stage-viewport.
 * requestFullscreen(stage) keeps this bar visible in native fullscreen.
 */
.game-stage-bar .game-mobile-exit {
  flex-shrink: 0;
  margin-right: 4px;
  min-height: var(--tap);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.game-stage-bar .game-mobile-exit[hidden] {
  display: none !important;
}

/* 触控设备（不根据视口宽高断设备）；与 detail 页 isTouchUiDevice / any-pointer: coarse 一致 */
@media (any-pointer: coarse) {
  /* Poster fills the frame; Start / Back sit on a bottom strip over the cover */
  .game-detail .game-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 78vh;
    min-height: 78dvh;
  }

  .game-detail .game-stage-viewport {
    flex: 1 1 auto;
    min-height: min(44vh, 420px);
    aspect-ratio: unset;
    max-height: none;
  }

  .game-detail .game-stage-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 5;
    justify-content: center;
    gap: 10px;
    margin: 0;
    padding: 18px 14px calc(14px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(
      180deg,
      transparent 0%,
      rgba(6, 4, 10, 0.5) 35%,
      rgba(6, 4, 10, 0.94) 100%
    );
    border-top: none;
    box-shadow: none;
  }

  .game-detail .game-play-poster-overlay {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }

  .game-stage.is-mobile-theater {
    position: fixed;
    inset: 0;
    z-index: 9998;
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    margin: 0;
    border-radius: 0;
    border-width: 0;
    display: flex;
    flex-direction: column;
  }

  .game-stage.is-mobile-theater .game-stage-bar {
    flex-shrink: 0;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    padding-left: calc(12px + env(safe-area-inset-left, 0px));
    padding-right: calc(12px + env(safe-area-inset-right, 0px));
    padding-bottom: 10px;
  }

  .game-stage.is-mobile-theater .game-stage-viewport {
    flex: 1;
    min-height: 0;
    max-height: none;
    aspect-ratio: unset;
  }

  .game-stage.is-mobile-theater .game-stage-footer {
    display: none;
  }
}

.game-detail .game-main-embed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  z-index: 1;
}

.game-detail .game-main-embed:not([hidden]) {
  z-index: 3;
}

.game-stage-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.game-stage-footer .btn-primary {
  background: linear-gradient(145deg, #ff6b4a, #e85d33);
  color: #fff;
  box-shadow: 0 4px 18px rgba(232, 93, 51, 0.35);
}

.game-stage-footer .btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.5);
}

.game-stage-footer .btn-ghost {
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.06);
}

.game-stage-footer .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.game-panel {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 18px 18px 20px;
  box-shadow: 0 8px 28px rgba(22, 16, 24, 0.05);
}

.game-panel-head {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.game-panel-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.game-feature-grid {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 520px) {
  .game-feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.game-feature-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--sand) 45%, var(--panel));
  border: 1px solid var(--line);
  font-weight: 650;
  font-size: 0.94rem;
  line-height: 1.35;
}

.game-feature-icon {
  flex-shrink: 0;
  width: 11px;
  height: 11px;
  margin-top: 4px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--accent), #ffb36b);
  box-shadow: 0 2px 10px rgba(255, 90, 51, 0.35);
}

.game-faq-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.game-faq-card {
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 40%, var(--panel));
}

.game-faq-q {
  margin: 0 0 8px;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--ink);
}

.game-faq-a {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--muted);
}

.game-detail-meta-strip {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px dashed color-mix(in srgb, var(--plum) 22%, var(--line));
  background: color-mix(in srgb, var(--sand) 35%, transparent);
}

@media (min-width: 560px) {
  .game-detail-meta-strip {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
  }
}

.game-detail-meta-strip .game-meta-line {
  margin: 0;
}

.game-detail-meta-strip .game-see-also {
  margin: 0;
}

.game-see-label {
  display: inline-block;
  margin-right: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.game-see-sep {
  margin: 0 8px;
  color: var(--line);
}

.game-detail-sidebar {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  z-index: 0;
}

/* 侧栏随页面滚动，避免 sticky + 内部滚动与主栏叠层、穿透 */
.game-detail-sidebar > * {
  flex-shrink: 0;
}

.game-facts-card {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 18px 16px 16px;
  box-shadow: 0 10px 32px rgba(22, 16, 24, 0.07);
}

.game-facts-title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.game-facts-list {
  margin: 0;
  padding: 0;
}

.game-facts-row {
  display: grid;
  grid-template-columns: 5.2rem 1fr;
  gap: 8px 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.game-facts-row:first-child {
  padding-top: 0;
}

.game-facts-row:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.game-facts-row dt {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.game-facts-row dd {
  margin: 0;
  font-weight: 700;
  color: var(--ink);
}

.game-facts-note {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.game-facts-note p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--muted);
}

.game-facts-note code {
  font-size: 0.88em;
  font-weight: 650;
  color: var(--plum);
}

.game-play-card {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 18px 16px 16px;
  box-shadow: 0 10px 32px rgba(22, 16, 24, 0.07);
}

.game-play-card .game-facts-title {
  margin-bottom: 12px;
}

.game-play-steps {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--muted);
}

.game-play-steps li {
  margin: 0.5em 0;
  padding-left: 2px;
}

.game-play-steps li:first-child {
  margin-top: 0;
}

.game-play-steps li:last-child {
  margin-bottom: 0;
}

.game-play-steps strong {
  color: var(--ink);
  font-weight: 750;
}

.game-play-rich {
  font-size: 0.9rem;
  line-height: 1.58;
  color: var(--muted);
}

.game-play-rich > :first-child {
  margin-top: 0;
}

.game-play-rich > :last-child {
  margin-bottom: 0;
}

.game-play-rich p {
  margin: 0.65em 0;
}

.game-play-rich ul,
.game-play-rich ol {
  margin: 0.5em 0;
  padding-left: 1.2rem;
}

.game-comments-panel {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.game-comments-panel .game-panel-title {
  margin-bottom: 6px;
}

.game-comments-panel .lede.compact-top {
  margin-bottom: 14px;
}

.game-comments-in-sidebar.game-comments-panel {
  margin-top: 0;
  padding-top: 0;
  padding: 18px 16px 16px;
  border-top: none;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 10px 32px rgba(22, 16, 24, 0.07);
}

.game-comments-in-sidebar .game-panel-title {
  font-size: 1.12rem;
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.game-comments-in-sidebar .lede.compact-top {
  font-size: 0.88rem;
  margin-bottom: 12px;
}

.game-comments-in-sidebar .comment-list {
  max-height: 330px;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}

.game-comments-in-sidebar .comment-form textarea {
  min-height: 72px;
}

.game-comments-in-sidebar .comment-form label {
  font-size: 0.88rem;
}

.play-frame {
  aspect-ratio: 16 / 10;
  background: #0f0d12;
  display: grid;
  place-items: center;
  padding: 18px;
  text-align: center;
  color: rgba(255, 255, 255, 0.78);
}

.play-frame code {
  color: rgba(255, 255, 255, 0.92);
}

.play-iframe {
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 0;
  display: block;
  background: #000;
}

.breadcrumb {
  margin-bottom: 12px;
  font-size: 0.92rem;
  color: var(--muted);
}

.breadcrumb a {
  font-weight: 750;
  text-decoration: none;
  color: var(--plum);
}

.detail-subh {
  font-size: 1.2rem;
  margin: 0;
}

.detail-subh.spaced {
  margin-top: 16px;
}

.lede.compact-top {
  margin-top: 8px;
}

.lede code {
  font-size: 0.95em;
  font-weight: 650;
  color: var(--plum);
}

.play-actions {
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.game-meta-line {
  font-size: 0.92rem;
  color: var(--muted);
}

.game-meta-line time {
  font-weight: 650;
  color: var(--ink);
}

.game-see-also {
  font-size: 0.95rem;
}

.game-see-also a {
  font-weight: 750;
  text-decoration: none;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.fact-grid li {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--panel);
}

.fact-grid dt {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
}

.fact-grid dd {
  margin: 6px 0 0;
  font-weight: 800;
}

.comments {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.comment-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.comment-form label {
  display: grid;
  gap: 6px;
  font-weight: 750;
  font-size: 0.92rem;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font: inherit;
}

.comment-form textarea {
  min-height: 120px;
  resize: vertical;
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  gap: 12px;
}

.comment-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: color-mix(in srgb, var(--panel) 70%, var(--paper));
}

.comment-meta {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.comment-body {
  margin: 0;
}

/* Search empty */
.empty-block {
  border: 1px dashed rgba(22, 16, 24, 0.22);
  border-radius: var(--radius);
  padding: 18px;
  background: color-mix(in srgb, var(--sand) 55%, transparent);
}

.empty-block h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
}

.empty-block p {
  margin: 0;
  color: var(--muted);
}

/* Tags */
.tag-toolbar {
  position: sticky;
  top: 64px;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  margin: 0 0 14px;
}

.tag-toolbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-toolbar a {
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-weight: 850;
  font-size: 0.9rem;
}

.tag-toolbar a.is-active {
  border-color: rgba(255, 90, 51, 0.45);
  box-shadow: 0 10px 22px rgba(255, 90, 51, 0.12);
}

.tag-category-desc {
  margin: -6px 0 20px;
  max-width: 62ch;
  color: var(--muted);
}

.tag-intro {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 14px;
  background: var(--panel);
  margin: 0 0 14px;
}

.tag-intro h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
}

.tag-intro p {
  margin: 0;
  color: var(--muted);
}

/* Responsive：触控设备用紧凑导航与单列卡片（不按视口宽高断「手机」） */
@media (any-pointer: coarse) {
  .header-inner {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand actions"
      "search search";
  }

  .brand {
    grid-area: brand;
  }

  .header-actions {
    grid-area: actions;
  }

  .header-search {
    grid-area: search;
    width: 100%;
    justify-self: stretch;
  }

  .desktop-nav {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-panel {
    display: block;
  }

  .mobile-panel[hidden] {
    display: none;
  }

  .game-card {
    grid-column: span 12;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .bottom-bar {
    display: block;
  }
}

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

  .banner-rail {
    scroll-behavior: auto;
  }
}
