:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #f1f4f8;
  --text: #151922;
  --muted: #687385;
  --line: #dce3ec;
  --brand: #2563eb;
  --accent: #14b8a6;
  --code-bg: #101826;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  color: var(--text);
  font-family:
    Inter,
    "Noto Sans SC",
    "PingFang SC",
    "Microsoft YaHei",
    Arial,
    sans-serif;
  background: var(--bg);
  letter-spacing: 0;
}

:root[data-theme="dark"] {
  --bg: #090d12;
  --surface: #111821;
  --surface-soft: #17202b;
  --text: #edf2f7;
  --muted: #94a3b8;
  --line: #263241;
  --brand: #60a5fa;
  --accent: #2dd4bf;
  --code-bg: #05080d;
  --shadow-sm: none;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(37, 99, 235, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(37, 99, 235, 0.028) 1px, transparent 1px),
    var(--bg);
  background-size: 56px 56px;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

#content:focus {
  outline: 0;
}

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

button,
input {
  font: inherit;
}

code,
pre {
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

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

.skip-link {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 100;
  padding: 9px 12px;
  border: 1px solid var(--brand);
  border-radius: 6px;
  background: var(--surface);
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transform: translateY(calc(-100% - 32px));
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  width: min(1180px, calc(100% - 32px));
  min-width: 0;
  min-height: 62px;
  margin: 12px auto 0;
  padding: 8px 12px;
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) minmax(220px, 320px) auto;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow-sm);
  transition:
    transform 180ms ease,
    opacity 180ms ease;
  will-change: transform;
}

.site-header.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(-100% - 12px));
}

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

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  line-height: 1;
  font-weight: 900;
}

.brand small {
  max-width: 190px;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-mark {
  flex: 0 0 auto;
  width: 32px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--brand) 40%, var(--line));
  border-radius: 6px;
  background: var(--surface-soft);
}

.brand-mark::before {
  color: var(--brand);
  content: "S";
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: clamp(14px, 3vw, 28px);
  min-width: 0;
}

.nav-links a {
  position: relative;
  padding: 10px 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.nav-links a.active,
.nav-links a:hover {
  color: var(--brand);
}

.nav-links a.active::after {
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 20px;
  height: 2px;
  background: var(--brand);
  content: "";
  transform: translateX(-50%);
}

.site-search {
  min-width: 0;
  height: 36px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.site-search label {
  min-width: 0;
}

.site-search input {
  width: 100%;
  height: 100%;
  padding: 0 12px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

.site-search button {
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0 6px 6px 0;
  background: transparent;
  color: var(--brand);
  cursor: pointer;
}

.theme-toggle {
  position: relative;
  width: 46px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  cursor: pointer;
}

.theme-toggle span,
.theme-toggle span::before {
  position: absolute;
  content: "";
  border-radius: 999px;
}

.theme-toggle span {
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  background: var(--accent);
  transition: transform 160ms ease;
}

.theme-toggle span::before {
  inset: 4px 3px 4px 9px;
  background: var(--surface-soft);
  opacity: 0;
}

:root[data-theme="dark"] .theme-toggle span {
  transform: translateX(20px);
  background: var(--text);
}

:root[data-theme="dark"] .theme-toggle span::before {
  opacity: 1;
}

.hero-section {
  padding: 18px 16px 12px;
}

.hero-inner {
  position: relative;
  overflow: hidden;
  width: min(1180px, 100%);
  min-height: 260px;
  margin: 0 auto;
  padding: clamp(24px, 3.4vw, 40px);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 28px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, var(--surface) 0 48%, color-mix(in srgb, var(--surface) 78%, transparent) 68%, transparent),
    var(--hero-cover, url("/assets/hero-game-tech.png")) right center / cover no-repeat;
}

.hero-inner::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--brand) 10%, transparent) 1px, transparent 1px),
    linear-gradient(color-mix(in srgb, var(--brand) 8%, transparent) 1px, transparent 1px);
  background-size: 40px 40px;
  content: "";
  opacity: 0.55;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-copy {
  width: min(680px, 100%);
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-copy h1 {
  max-width: 760px;
  margin: 0;
  color: var(--text);
  font-size: clamp(34px, 4.1vw, 52px);
  line-height: 1.03;
  font-weight: 800;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(15px, 1.5vw, 17px);
  line-height: 1.75;
  font-weight: 500;
}

.hero-actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button-link,
.ghost-link,
.secondary-button {
  min-height: 38px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
}

.button-link {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
}

.ghost-link,
.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.button-link:hover,
.ghost-link:hover,
.secondary-button:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.button-link:hover {
  color: #fff;
}

.content-shell,
.page-shell,
.article-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 22px auto 0;
}

.content-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
  align-items: start;
}

.content-main,
.blog-sidebar,
.article-aside {
  min-width: 0;
}

.section-block,
.sidebar-card,
.search-page-card,
.article-page,
.page-title,
.tag-matrix-page {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.section-block {
  padding: 22px;
}

.section-block + .section-block {
  margin-top: 22px;
}

.section-head {
  margin-bottom: 16px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.section-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 800;
}

.section-head > a {
  color: var(--brand);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.post-grid,
.article-index-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.recommended-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 16px;
}

.home-post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.home-post-grid .archive-card {
  height: 100%;
}

.article-index-page,
.tags-page {
  max-width: 1180px;
}

.page-context {
  margin: 0 0 16px;
  padding: 0 4px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  align-items: end;
  color: var(--muted);
}

.page-context-kicker {
  grid-column: 1 / -1;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-context-copy {
  min-width: 0;
}

.page-context h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(24px, 2.8vw, 34px);
  line-height: 1.18;
  font-weight: 800;
}

.page-context p {
  max-width: 720px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.page-context b {
  min-height: 22px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.archive-filter-bar {
  margin: 0 0 18px;
  display: flex;
}

.archive-filters {
  padding: 4px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.archive-filters a {
  min-height: 30px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.archive-filters a.active,
.archive-filters a:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.archive-filters b {
  color: var(--brand);
  font-size: 12px;
}

.archive-card,
.post-card {
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition:
    border-color 160ms ease,
    transform 160ms ease;
}

.archive-card:hover,
.post-card:hover {
  border-color: color-mix(in srgb, var(--brand) 55%, var(--line));
  transform: translateY(-1px);
}

.archive-card-thumb,
.thumb,
.search-result-thumb {
  position: relative;
  overflow: hidden;
  display: block;
  background:
    linear-gradient(180deg, transparent 48%, rgba(4, 8, 14, 0.54)),
    var(--cover-image, linear-gradient(135deg, #111821, #263241)) center / cover no-repeat;
}

.archive-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
}

.thumb {
  height: 128px;
}

.archive-card-thumb span,
.thumb span,
.search-result-thumb span {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  min-height: 22px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  background: rgba(4, 8, 14, 0.68);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.thumb span {
  top: 12px;
  bottom: auto;
}

.thumb i {
  display: none;
}

.archive-card-body,
.post-card-body {
  padding: 15px;
  display: flex;
  flex: 1;
  flex-direction: column;
}

.archive-card h2,
.post-card h3 {
  margin: 10px 0 8px;
  color: var(--text);
  font-size: 19px;
  line-height: 1.38;
  font-weight: 700;
}

.post-card h3 {
  font-size: 18px;
}

.archive-card h2 a:hover,
.post-card h3 a:hover,
.archive-item h3 a:hover {
  color: var(--brand);
}

.archive-card p,
.post-card p {
  min-height: 48px;
  margin: 0 0 14px;
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.archive-card .tag-row {
  margin-top: auto;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.view-count {
  white-space: nowrap;
}

.updated-date {
  white-space: nowrap;
}

.tag-row,
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-row a,
.tag-cloud a {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.tag-cloud a {
  display: inline-flex;
  gap: 6px;
}

.tag-cloud a b,
.category-list b {
  color: var(--brand);
}

.blog-sidebar {
  display: grid;
  gap: 14px;
}

.sidebar-card {
  padding: 18px;
}

.sidebar-card h2 {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 800;
}

.sidebar-card p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.7;
}

.category-list {
  display: grid;
  gap: 6px;
}

.category-list a {
  min-height: 34px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.category-list a:hover {
  border-color: var(--brand);
  background: var(--surface-soft);
}

.ranking-list {
  display: grid;
}

.ranking-link {
  padding: 10px 0;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 2px 9px;
  align-items: start;
  border-top: 1px solid var(--line);
}

.ranking-link:first-child {
  border-top: 0;
  padding-top: 0;
}

.ranking-link b {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.ranking-link span {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-link small {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 500;
}

.ranking-link:hover span {
  color: var(--brand);
}

.subscribe-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.text-link {
  color: var(--brand);
  font-weight: 700;
}

.page-shell.narrow {
  max-width: 900px;
}

.page-title {
  padding: 22px;
}

.page-title h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.12;
  font-weight: 800;
}

.page-title p {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.tag-matrix-page {
  padding: 18px;
}

.tag-matrix {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.tag-index-item {
  min-height: 48px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.tag-index-item:hover,
.tag-index-item.active {
  border-color: var(--brand);
  background: var(--surface-soft);
}

.tag-index-item b {
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: var(--surface-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.tag-index-item.size-1 {
  font-size: 14px;
}

.tag-index-item.size-2,
.tag-index-item.size-3 {
  font-size: 15px;
}

.tag-results {
  margin-top: 20px;
}

.tag-results-head {
  margin-bottom: 14px;
}

.tag-results-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 25px;
  line-height: 1.25;
  font-weight: 800;
}

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

.taxonomy-card {
  min-height: 94px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.taxonomy-card span {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
}

.taxonomy-card b {
  color: var(--brand);
  font-size: 13px;
}

.series-page {
  max-width: 1180px;
}

.series-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.series-card,
.series-related,
.series-timeline {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.series-card {
  min-height: 174px;
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.series-card:hover {
  border-color: var(--brand);
}

.series-card span,
.series-panel-head span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.series-card h2 {
  margin: 10px 0 8px;
  color: var(--text);
  font-size: 22px;
  line-height: 1.28;
  font-weight: 800;
}

.series-card p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.series-card small {
  margin-top: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.series-timeline {
  padding: 18px;
}

.series-timeline-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.series-timeline-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.series-timeline-item > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

.series-timeline-item h2 {
  margin: 8px 0;
  color: var(--text);
  font-size: 21px;
  line-height: 1.32;
  font-weight: 800;
}

.series-timeline-item h2 a:hover {
  color: var(--brand);
}

.series-timeline-item p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.series-related {
  margin-top: 18px;
  padding: 18px;
}

.series-related h2 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
}

.archive-list {
  display: grid;
  gap: 22px;
}

.archive-list section {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.archive-list h2 {
  margin: 0 0 14px;
}

.archive-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.archive-item time,
.archive-item span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.archive-item h3 {
  margin: 0;
  font-size: 17px;
}

.pagination {
  margin: 36px auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.pagination a,
.pagination span {
  min-width: 38px;
  min-height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.pagination a:hover,
.pagination span.active {
  border-color: var(--brand);
  color: var(--brand);
}

.pagination span.disabled {
  opacity: 0.46;
}

.article-shell {
  width: min(1440px, calc(100% - 48px));
  display: grid;
  grid-template-columns:
    minmax(170px, 220px)
    minmax(0, 900px)
    minmax(170px, 220px);
  gap: 22px;
  align-items: start;
  justify-content: center;
}

.article-shell.no-toc {
  grid-template-columns: minmax(170px, 220px) minmax(0, 900px);
}

.article-shell.no-related {
  grid-template-columns: minmax(0, 900px) minmax(170px, 220px);
}

.article-shell.no-related.no-toc {
  grid-template-columns: minmax(0, 900px);
}

.article-page {
  overflow: hidden;
}

.article-hero {
  padding: 34px 42px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.article-hero h1 {
  max-width: 840px;
  margin: 14px 0 12px;
  color: var(--text);
  font-size: clamp(34px, 3.6vw, 48px);
  line-height: 1.14;
  font-weight: 800;
}

.article-hero p {
  max-width: 760px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.category-pill {
  display: inline-flex;
  min-height: 26px;
  padding: 0 9px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.article-content {
  max-width: 820px;
  margin: 0 auto;
  padding: 42px 42px 48px;
  color: var(--text);
  font-size: 17px;
  line-height: 1.85;
}

.article-content h2,
.article-content h3,
.article-content h4 {
  color: var(--text);
  line-height: 1.28;
}

.article-content h2 {
  margin: 2.4em 0 0.75em;
  font-size: 26px;
  font-weight: 800;
}

.article-content h3 {
  margin: 2em 0 0.7em;
  font-size: 21px;
  font-weight: 700;
}

.article-content h4 {
  margin: 1.8em 0 0.7em;
  font-size: 18px;
  font-weight: 700;
}

.article-content p,
.article-content ul,
.article-content ol,
.article-content blockquote,
.article-content pre,
.article-content .table-scroll {
  margin: 0 0 1.1em;
}

.article-content a {
  color: var(--brand);
  font-weight: 600;
}

.article-content pre {
  position: relative;
  overflow-x: auto;
  padding: 42px 18px 18px;
  border: 1px solid #1f2b3a;
  border-radius: 6px;
  background: var(--code-bg);
  color: #eaf2ff;
  font-size: 14px;
  line-height: 1.65;
}

.article-content pre code {
  display: block;
  min-width: max-content;
}

.article-content pre::before {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 28px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #1f2b3a;
  color: #94a3b8;
  content: attr(data-language);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.code-copy-button {
  position: absolute;
  top: 4px;
  right: 8px;
  z-index: 1;
  min-height: 20px;
  padding: 0 8px;
  border: 1px solid #26384d;
  border-radius: 4px;
  background: #152235;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.code-copy-button:hover,
.code-copy-button.is-copied {
  border-color: #3b82f6;
  color: #eaf2ff;
}

.article-content pre:not([data-language])::before,
.article-content pre[data-language=""]::before {
  content: "CODE";
}

.article-content :not(pre) > code {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-soft);
  color: var(--brand);
  font-size: 0.9em;
}

.article-content blockquote {
  padding: 14px 16px;
  border-left: 3px solid var(--brand);
  background: var(--surface-soft);
  color: var(--muted);
}

.article-content .table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.article-content table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.article-content th,
.article-content td {
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.article-content th:last-child,
.article-content td:last-child {
  border-right: 0;
}

.article-content tr:last-child td {
  border-bottom: 0;
}

.article-content th {
  background: var(--surface-soft);
  font-weight: 700;
}

.article-content [data-align="center"] {
  text-align: center;
}

.article-content [data-align="right"] {
  text-align: right;
}

.article-footer {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 42px 42px;
}

.series-panel {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.series-panel-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
  justify-content: space-between;
}

.series-panel-head h2 {
  flex: 1 1 auto;
  margin: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.3;
  font-weight: 800;
}

.series-panel-head a {
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.series-panel ol {
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
  list-style: none;
}

.series-panel li a {
  min-height: 36px;
  padding: 0 10px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.series-panel li.active a,
.series-panel li a:hover {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--text);
}

.series-panel li span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.post-navigation {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.post-navigation a,
.post-nav-empty {
  min-height: 104px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.post-navigation a:hover {
  border-color: var(--brand);
}

.post-navigation span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.post-navigation strong {
  margin-top: 8px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  font-weight: 700;
}

.post-navigation small {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.comments-section {
  max-width: 820px;
  margin: 0 auto 42px;
  padding: 26px 42px 0;
  border-top: 1px solid var(--line);
}

.comments-section h2 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 22px;
  line-height: 1.3;
}

.article-aside {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 14px;
}

.related-card {
  max-height: calc(100vh - 110px);
  overflow: auto;
}

.toc {
  display: grid;
  gap: 7px;
}

.toc a,
.related-link {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.toc a {
  padding-left: 9px;
  border-left: 2px solid transparent;
}

.toc a:hover,
.toc a.active,
.related-link:hover span {
  color: var(--brand);
}

.toc a.active {
  border-left-color: var(--brand);
}

.toc h2,
.related-card h2 {
  color: var(--text);
}

.toc .level-3 {
  padding-left: 12px;
}

.related-link {
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-weight: 600;
}

.related-link span,
.related-link small {
  display: block;
}

.related-link span {
  color: var(--text);
}

.related-link small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.reading-pill {
  position: fixed;
  top: 84px;
  right: 18px;
  z-index: 8;
  min-height: 26px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.reading-pill span:first-child {
  color: var(--brand);
}

.search-page-card {
  padding: 20px;
}

.search-page-card input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: 0;
  color: var(--text);
  background: var(--surface);
}

.search-results {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.search-count {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.search-result-card {
  overflow: hidden;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.search-result-thumb {
  min-height: 142px;
}

.search-result-body {
  padding: 15px;
}

.search-result-card h2 {
  margin: 0 0 8px;
  font-size: 19px;
}

.search-result-card p {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.65;
}

.search-result-card mark {
  padding: 0 2px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--text);
}

.simple-page {
  padding-top: 0;
}

.empty-build {
  width: min(760px, calc(100% - 32px));
  margin: 15vh auto 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 34px auto 22px;
  padding: 18px 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.site-footer a {
  color: var(--brand);
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 1180px) {
  .site-header {
    grid-template-columns: 1fr minmax(220px, 320px) auto;
  }

  .nav-links {
    order: 3;
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .site-search {
    width: min(320px, 44vw);
  }

  .content-shell,
  .article-shell {
    grid-template-columns: 1fr;
  }

  .article-shell.no-toc,
  .article-shell.no-related,
  .article-shell.no-related.no-toc {
    grid-template-columns: 1fr;
  }

  .blog-sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article-aside {
    position: static;
  }

  .article-page {
    order: 1;
  }

  .article-toc-aside {
    order: 2;
  }

  .article-related-aside {
    order: 3;
  }

  .related-card {
    max-height: none;
  }

  .post-grid,
  .taxonomy-grid,
  .article-index-grid,
  .tag-matrix {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .site-header {
    width: 100%;
    min-height: 0;
    margin-top: 0;
    padding: 9px 12px 8px;
    border-width: 0 0 1px;
    border-radius: 0;
    grid-template-columns: minmax(0, 1fr) 36px 46px;
    grid-template-areas:
      "brand search theme"
      "nav nav nav";
    gap: 8px 10px;
  }

  .brand {
    grid-area: brand;
  }

  .nav-links {
    grid-area: nav;
    grid-column: auto;
    order: initial;
    justify-content: flex-start;
    gap: 20px;
    padding: 6px 0 0;
    border-top: 1px solid var(--line);
  }

  .site-search {
    grid-area: search;
    width: 36px;
    height: 34px;
    grid-template-columns: 34px;
    justify-self: end;
  }

  .site-search label {
    display: none;
  }

  .site-search button {
    border-left: 0;
    border-radius: 6px;
  }

  .theme-toggle {
    grid-area: theme;
    justify-self: end;
  }

  .hero-section {
    padding: 12px 12px 8px;
  }

  .hero-inner {
    min-height: 300px;
    padding: 22px 24px;
    grid-template-columns: 1fr;
    align-items: end;
    background:
      linear-gradient(180deg, var(--surface) 0 42%, color-mix(in srgb, var(--surface) 78%, transparent) 72%, color-mix(in srgb, var(--surface) 38%, transparent)),
      var(--hero-cover, url("/assets/hero-game-tech.png")) center bottom / cover no-repeat;
  }

  .hero-copy h1 {
    font-size: 32px;
    line-height: 1.08;
  }

  .hero-copy > p:not(.eyebrow) {
    font-size: 15px;
  }

  .content-shell,
  .page-shell,
  .article-shell {
    width: calc(100% - 24px);
    margin-top: 14px;
  }

  .section-block,
  .sidebar-card,
  .page-title,
  .search-page-card,
  .tag-matrix-page {
    padding: 16px;
  }

  .post-grid,
  .taxonomy-grid,
  .article-index-grid,
  .blog-sidebar,
  .tag-matrix,
  .series-grid,
  .recommended-grid,
  .home-post-grid {
    grid-template-columns: 1fr;
  }

  .page-context {
    grid-template-columns: 1fr;
  }

  .page-context b {
    width: max-content;
  }

  .page-context {
    margin-bottom: 10px;
  }

  .archive-filter-bar {
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .archive-filters {
    width: max-content;
    min-width: 100%;
  }

  .article-hero,
  .article-content,
  .article-footer,
  .comments-section {
    padding-left: 22px;
    padding-right: 22px;
  }

  .article-hero h1 {
    font-size: 30px;
  }

  .article-hero p {
    font-size: 15px;
  }

  .article-content {
    font-size: 16px;
  }

  .post-navigation {
    grid-template-columns: 1fr;
  }

  .post-nav-empty {
    display: none;
  }

  .search-result-card {
    grid-template-columns: 1fr;
  }

  .reading-pill {
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    z-index: 30;
    min-height: 0;
    height: 2px;
    padding: 0;
    display: block;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    pointer-events: none;
    opacity: 1;
  }

  .reading-pill::before {
    width: var(--reading-progress, 0%);
    height: 100%;
    display: block;
    background: var(--brand);
    content: "";
  }

  .reading-pill span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
}

@media (max-width: 420px) {
  .hero-actions {
    display: grid;
  }

  .button-link,
  .ghost-link {
    width: 100%;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
