/*
Theme Name: 逆光游戏空间
Description: 小游戏入口与分类更新公告主题。
Version: 1.0.0
Author: niguang
*/

:root {
  --accent: #7c8cff;
  --bg: #10121a;
  --surface: #171a25;
  --surface-2: #1d2130;
  --text: #f0f2ff;
  --muted: #9ca4bd;
  --line: #2a3042;
  --shadow: 0 20px 55px rgba(0, 0, 0, 0.25);
}

:root[data-theme="light"] {
  --bg: #f4f5fa;
  --surface: #fff;
  --surface-2: #f0f2f8;
  --text: #1a1d2b;
  --muted: #676e82;
  --line: #dfe2ec;
  --shadow: 0 18px 45px rgba(34, 40, 70, 0.1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 15% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 34%),
    var(--bg);
  color: var(--text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.7;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  transform: translateY(-150%);
  padding: 8px 12px;
  background: var(--accent);
  color: #fff;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(18px);
}
.header-inner,
.site-main,
.site-footer > div {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}
.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}
.brand-dot {
  width: 18px;
  height: 18px;
  border: 5px solid color-mix(in srgb, var(--accent) 34%, var(--surface));
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 70%, transparent);
}
.brand strong,
.brand small { display: block; }
.brand strong { font-size: 16px; letter-spacing: 0.04em; }
.brand small { color: var(--muted); font-size: 9px; letter-spacing: 0.18em; }
.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.site-nav a,
.site-nav button,
.nav-toggle {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 8px 11px;
}
.site-nav a:hover,
.site-nav button:hover { background: var(--surface); color: var(--text); }
.nav-toggle { display: none; }

.site-main { padding-block: 38px 72px; }
.game-tabs {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  scrollbar-width: thin;
}
.game-tabs a,
.game-tabs-empty {
  flex: 0 0 auto;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}
.game-tabs a:hover {
  color: var(--text);
  background: var(--surface-2);
}
.game-tabs a.active {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-2));
  color: var(--text);
}
.game-tabs-hint {
  margin: 16px 4px 0;
  color: var(--muted);
  font-size: 13px;
}
.game-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 42px;
  margin-top: 18px;
  padding: clamp(28px, 5vw, 52px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 13%, var(--surface)), var(--surface) 58%);
  box-shadow: var(--shadow);
}
.game-stage h1 {
  margin: 10px 0 9px;
  font-size: clamp(34px, 5vw, 56px);
  letter-spacing: -0.04em;
  line-height: 1.08;
}
.game-stage p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
}
.game-stage-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.game-launch {
  position: relative;
  z-index: 1;
}
.game-launch .button {
  min-width: 150px;
  min-height: 46px;
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  align-items: end;
  gap: 46px;
  padding: clamp(30px, 5vw, 62px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 13%, var(--surface)), var(--surface) 55%);
  box-shadow: var(--shadow);
}
.eyebrow {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
}
.hero h1,
.archive-header h1,
.article-header h1,
.not-found h1 {
  margin: 8px 0 12px;
  font-size: clamp(34px, 5.2vw, 62px);
  letter-spacing: -0.04em;
  line-height: 1.08;
}
.hero p,
.archive-header p,
.article-header > p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
}
.search-form {
  display: flex;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.search-form input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 8px 10px;
}
.search-form button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  padding: 9px 15px;
  font-weight: 700;
}
.search-form button,
.button.primary {
  background: var(--accent);
  color: #fff;
}
.button.ghost { border: 1px solid var(--line); background: var(--surface-2); }
.button.disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }

.section-block { margin-top: 42px; }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}
.section-heading h2 { margin: 3px 0 0; font-size: 27px; }
.section-heading > p { margin: 0; color: var(--muted); font-size: 13px; }
.game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.game-card,
.update-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}
.game-card {
  display: flex;
  min-height: 270px;
  flex-direction: column;
  padding: 22px;
}
.game-card-top,
.game-detail-tags,
.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.status,
.version {
  display: inline-flex;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 999px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
}
.version { border-color: var(--line); color: var(--muted); }
.game-card h3 { margin: 22px 0 8px; font-size: 23px; }
.game-card p { margin: 0; color: var(--muted); font-size: 14px; }
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 22px;
}
.update-list { display: grid; gap: 12px; }
.update-card {
  position: relative;
  padding: 20px 22px;
}
.update-card h3 { margin: 5px 0 6px; font-size: 20px; }
.update-card p { margin: 0; color: var(--muted); }
.update-meta {
  display: flex;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}
.read-more {
  display: inline-block;
  margin-top: 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}
.archive-header { padding: 28px 0 8px; }
.archive-header h1 { font-size: clamp(34px, 5vw, 54px); }

.article {
  width: min(820px, 100%);
  margin-inline: auto;
}
.article-header {
  padding: 28px 0 30px;
  border-bottom: 1px solid var(--line);
}
.article-header h1 { font-size: clamp(36px, 6vw, 64px); }
.article-meta { color: var(--muted); font-size: 12px; }
.article-content {
  padding: 34px 0;
  font-size: 16px;
}
.article-content h2,
.article-content h3 { margin-top: 1.8em; line-height: 1.25; }
.article-content a { color: var(--accent); text-decoration: underline; }
.article-content pre {
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.article-content img { max-width: 100%; height: auto; border-radius: 14px; }
.article-footer {
  display: flex;
  justify-content: space-between;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.article-footer a { color: var(--accent); }
.game-detail .article-header > p { margin-top: 16px; }
.empty-state,
.not-found {
  padding: 42px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}
.not-found { margin: 60px auto; }
.pagination { display: flex; gap: 8px; margin-top: 18px; }
.pagination a,
.pagination span {
  display: inline-flex;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.site-footer > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-block: 24px;
}
.site-footer p { margin: 0; }

@media (max-width: 850px) {
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .header-inner,
  .site-main,
  .site-footer > div { width: min(100% - 28px, 1120px); }
  .header-inner { min-height: 64px; }
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 14px;
    left: 14px;
    display: none;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
  }
  .site-nav.open { display: grid; }
  .hero { grid-template-columns: 1fr; gap: 24px; padding: 28px 22px; }
  .hero h1 { font-size: 38px; }
  .game-stage {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 28px 22px;
  }
  .game-launch .button {
    width: 100%;
  }
  .game-grid { grid-template-columns: 1fr; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 4px; }
  .site-footer > div { display: block; }
}
