:root {
  --bg: #f4f5f0;
  --surface: #ffffff;
  --surface-alt: #f8faf6;
  --ink: #132019;
  --muted: #4b5b52;
  --accent: #155e3c;
  --accent-strong: #0f472d;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --border: #d7dfd7;
  --stage-bg: #0f1c16;
  --stage-card: #16281f;
  --stage-ink: #f4f7f5;
  --stage-muted: #b3c5bb;
  --focus: #2563eb;
  --radius: 14px;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.62;
  color: var(--ink);
  background: var(--bg);
  overflow-x: clip;
}

a {
  color: var(--accent-strong);
}

a:focus-visible,
button:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 200;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  background: var(--accent-strong);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.75rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
}

.header-inner {
  width: min(1380px, calc(100% - 1.5rem));
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 0.85rem;
  padding-block: 0.68rem;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.18rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-alt);
}

.lang-switcher a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0.16rem 0.44rem;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 750;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.lang-switcher a:hover,
.lang-switcher a[aria-current="page"] {
  background: var(--accent-strong);
  color: #ffffff;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
  white-space: nowrap;
}

.brand-link img {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: block;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  background: #e5efe8;
  color: var(--accent-strong);
}

.unofficial-ribbon {
  background: #14261d;
  color: #d9e6de;
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  text-align: center;
}

.unofficial-ribbon a {
  color: #fbbf24;
  font-weight: 600;
}

/* Reserved fast-approval ad slots stay hidden until configured & active */
.ad-slot {
  width: min(1380px, calc(100% - 1.5rem));
  max-width: 100%;
  overflow-x: clip;
  margin: 0.75rem auto 0;
  text-align: center;
}

.ad-slot[data-active="false"] {
  display: none;
}

.ad-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

/* 3-Column Veteran Hybrid Stage ("老手合二为一") */
.stage-shell {
  width: min(1380px, calc(100% - 1.5rem));
  margin: 1rem auto 1.75rem;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr) 224px;
  gap: 1rem;
  align-items: start;
}

.side-rail {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

.rail-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem;
}

.rail-title {
  margin: 0 0 0.65rem;
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.game-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.game-card {
  display: block;
  padding: 0.65rem 0.72rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.game-card:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: #ecf5ef;
}

.game-card[aria-current="page"] {
  border-color: var(--accent);
  background: #e1f0e6;
}

.game-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
}

.game-card-title {
  font-weight: 750;
  font-size: 0.9rem;
  line-height: 1.25;
}

.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.42rem;
  border-radius: 999px;
  color: #fff;
  white-space: nowrap;
}

.game-card-desc {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.38;
  color: var(--muted);
}

/* Center Playable Stage */
.center-stage {
  min-width: 0;
  background: var(--stage-bg);
  color: var(--stage-ink);
  border-radius: 16px;
  border: 1px solid #243d30;
  padding: 0.9rem;
  box-shadow: 0 14px 36px rgba(9, 24, 16, 0.14);
}

.stage-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.stage-header h1 {
  margin: 0;
  font-size: clamp(1.2rem, 2.2vw, 1.65rem);
  line-height: 1.2;
  color: #ffffff;
}

.stage-subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.88rem;
  color: var(--stage-muted);
}

.stage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.stage-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 36px;
  padding: 0.35rem 0.72rem;
  border-radius: 8px;
  border: 1px solid #355a47;
  background: var(--stage-card);
  color: #f8fafc;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.stage-btn:hover {
  background: #203b2e;
  border-color: #538a6d;
}

.stage-btn--primary {
  background: #d97706;
  border-color: #f59e0b;
  color: #111827;
}

.stage-btn--primary:hover {
  background: #f59e0b;
}

.hud-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  background: var(--stage-card);
  border: 1px solid #2a4738;
  font-size: 0.82rem;
}

.hud-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.hud-metric strong {
  color: #fbbf24;
  font-variant-numeric: tabular-nums;
}

.trail-switcher {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.trail-select {
  padding: 0.32rem 0.55rem;
  border-radius: 7px;
  border: 1px solid #3c644f;
  background: #0d1a14;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 600;
}

.canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #0a1410;
  border: 1px solid #2b4a3a;
}

.canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: manipulation;
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  text-align: center;
  background: rgba(10, 21, 16, 0.76);
  backdrop-filter: blur(4px);
}

.game-overlay[hidden] {
  display: none;
}

.game-overlay h2 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.15rem, 2.5vw, 1.7rem);
  color: #ffffff;
}

.game-overlay p {
  margin: 0 0 0.85rem;
  max-width: 44ch;
  font-size: 0.9rem;
  color: #dce8e0;
}

.overlay-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
}

/* Mobile & Touch Controls (always clean & zero overflow) */
.touch-controls {
  margin-top: 0.65rem;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.45rem;
}

.touch-btn {
  min-height: 44px;
  padding: 0.4rem 0.25rem;
  border-radius: 9px;
  border: 1px solid #385d4a;
  background: #1a3126;
  color: #f8fafc;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.15;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}

.touch-btn span {
  display: block;
  font-size: 0.66rem;
  font-weight: 500;
  color: #a9c2b4;
  margin-top: 0.1rem;
}

.touch-btn:active,
.touch-btn.is-pressed {
  background: #d97706;
  border-color: #f59e0b;
  color: #111827;
}

.touch-btn:active span,
.touch-btn.is-pressed span {
  color: #1f2937;
}

.garage-drawer {
  margin-top: 0.7rem;
  padding: 0.75rem;
  border-radius: 10px;
  background: var(--stage-card);
  border: 1px solid #2b4a3a;
}

.garage-drawer[hidden] {
  display: none;
}

.garage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.55rem;
  margin-top: 0.5rem;
}

.garage-card {
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid #355a47;
  background: #102018;
  color: #f4f7f5;
  text-align: left;
  cursor: pointer;
}

.garage-card.is-equipped {
  border-color: #f59e0b;
  background: #1e3325;
}

.swatch-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.swatch-btn {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 2px solid #ffffff;
  cursor: pointer;
}

.swatch-btn.is-selected {
  box-shadow: 0 0 0 2px #f59e0b;
}

.challenge-pill {
  margin-top: 0.55rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: #12241b;
  border: 1px dashed #3b6951;
  font-size: 0.8rem;
  color: #e6f2eb;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.gd-frame-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  background: #09130f;
  border: 1px solid #2b4a3a;
}

.gd-frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.gd-consent-cover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  text-align: center;
  background: radial-gradient(circle at top, #1b3829 0%, #0b1611 100%);
}

.gd-consent-cover[hidden] {
  display: none;
}

/* Below-the-Fold SEO & People-First Guide Content */
.article-shell {
  width: min(980px, calc(100% - 1.5rem));
  margin: 1.5rem auto 3rem;
}

.content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: clamp(1.15rem, 2.5vw, 2rem);
  margin-bottom: 1.25rem;
}

.content-card h1,
.content-card h2,
.content-card h3 {
  line-height: 1.25;
  color: var(--ink);
  margin-top: 0;
}

.content-card h2 {
  font-size: 1.32rem;
  margin-top: 1.5rem;
  margin-bottom: 0.65rem;
}

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

.content-card h3 {
  font-size: 1.05rem;
  margin-top: 1.1rem;
  margin-bottom: 0.4rem;
}

.content-card p {
  margin: 0 0 0.85rem;
  color: #213128;
}

.content-card ul,
.content-card ol {
  margin: 0 0 1rem;
  padding-left: 1.3rem;
}

.content-card li {
  margin-bottom: 0.4rem;
}

.notice-box {
  padding: 0.9rem 1rem;
  border-radius: 10px;
  border-left: 4px solid var(--amber);
  background: var(--amber-soft);
  color: #422006;
  margin: 1rem 0;
  font-size: 0.92rem;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 0.85rem 0 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

th,
td {
  padding: 0.68rem 0.82rem;
  border-top: 1px solid var(--border);
}

thead th {
  border-top: 0;
  background: #edf3ee;
  font-weight: 750;
}

.faq-list {
  display: grid;
  gap: 0.6rem;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.72rem 0.95rem;
  background: var(--surface-alt);
}

.faq-item summary {
  font-weight: 750;
  cursor: pointer;
}

.faq-item p {
  margin: 0.55rem 0 0;
  font-size: 0.92rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 1.65rem 0 2.25rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.footer-inner {
  width: min(1380px, calc(100% - 1.5rem));
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

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

.footer-links a:hover {
  text-decoration: underline;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  z-index: 120;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: #111827;
  color: #f9fafb;
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.toast[hidden] {
  display: none;
}

@media (max-width: 1120px) {
  .stage-shell {
    grid-template-columns: 1fr 1fr;
  }

  .center-stage {
    grid-column: 1 / -1;
    order: -1;
  }

  .game-card-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 0.75rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
  }

  .main-nav.is-open {
    display: flex;
  }

  .stage-shell {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .center-stage {
    padding: 0.65rem;
  }

  .canvas-wrap {
    aspect-ratio: 16 / 10;
  }

  .touch-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .game-card {
    transition: none;
  }
}
