:root {
  --brand-icon-url: url("./assets/Home_Toy/M_0.png");
  --brand-icon-size: 22px;
  --brand-text-size: 1.08rem;
  --brand-gap: 8px;
  --nav-glass-base: rgba(255, 255, 255, 0.1);
  --nav-glass-tint: rgba(255, 255, 255, 0.08);
  --nav-glass-glow: rgba(255, 255, 255, 0.22);
  --nav-glass-border: rgba(255, 255, 255, 0.18);
  --nav-ink: #ffffff;
  --nav-muted-ink: rgba(255, 255, 255, 0.9);
  --nav-pill-bg: rgba(255, 255, 255, 0.14);
  --nav-pill-active-bg: #ffffff;
  --nav-pill-active-ink: #ffffff;
  --nav-blur: 16px;
  --nav-saturate: 100%;
  --light-bg: #f2f2f2;
  --light-surface: #ffffff;
  --light-surface-alt: #e5e5e5;
  --light-surface-alt-ink: #111111;
  --light-text: #111111;
  --light-muted: #595959;
  --light-accent: #000000;
  --light-accent-ink: #ffffff;
  --light-selection-bg: rgba(68, 127, 255, 0.28);
  --light-selection-text: #0f172a;
  --light-home-strip-title: #111111;
  --light-home-strip-desc: #111111;
  --light-home-strip-index: #111111;

  --dark-bg: #0d0d0d;
  --dark-surface: #1c1c1c;
  --dark-surface-alt: #2a2a2a;
  --dark-surface-alt-ink: #f5f5f5;
  --dark-text: #f5f5f5;
  --dark-muted: #b3b3b3;
  --dark-accent: #ffffff;
  --dark-accent-ink: #111111;
  --dark-selection-bg: rgba(110, 167, 255, 0.38);
  --dark-selection-text: #f8fbff;
  --dark-home-strip-title: #f5f5f5;
  --dark-home-strip-desc: #f5f5f5;
  --dark-home-strip-index: #f5f5f5;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body[data-theme="light"] {
  --bg: var(--light-bg);
  --surface: var(--light-surface);
  --surface-alt: var(--light-surface-alt);
  --surface-alt-ink: var(--light-surface-alt-ink);
  --text: var(--light-text);
  --muted: var(--light-muted);
  --accent: var(--light-accent);
  --accent-ink: var(--light-accent-ink);
  --emphasis-bg: rgba(0, 0, 0, 0.08);
  --emphasis-bg-strong: rgba(0, 0, 0, 0.12);
  --code-block-bg: #f7f2ea;
  --code-block-border: #e6ddd0;
  --code-block-fg: #1a1a1a;
  --code-block-label: #9a907e;
  --code-tok-comment: #928a7e;
  --code-tok-kw: #b5121c;
  --code-tok-str: #156b3c;
  --code-tok-num: #0550ae;
  --code-tok-tag: #b5121c;
  --code-tok-attr: #6f42c1;
  --quote-bg: rgba(48, 70, 106, 0.09);
  --quote-mark: rgba(35, 55, 90, 0.12);
  --nav-ink: #111111;
  --nav-muted-ink: rgba(0, 0, 0, 0.86);
  --nav-pill-active-ink: #1900ff;
  --selection-bg: var(--light-selection-bg);
  --selection-text: var(--light-selection-text);
  --home-strip-title: var(--light-home-strip-title);
  --home-strip-desc: var(--light-home-strip-desc);
  --home-strip-index: var(--light-home-strip-index);
}

body[data-theme="dark"] {
  --bg: var(--dark-bg);
  --surface: var(--dark-surface);
  --surface-alt: var(--dark-surface-alt);
  --surface-alt-ink: var(--dark-surface-alt-ink);
  --text: var(--dark-text);
  --muted: var(--dark-muted);
  --accent: var(--dark-accent);
  --accent-ink: var(--dark-accent-ink);
  --emphasis-bg: rgba(255, 255, 255, 0.15);
  --emphasis-bg-strong: rgba(255, 255, 255, 0.28);
  --code-block-bg: #212121;
  --code-block-border: #333333;
  --code-block-fg: #e8edf5;
  --code-block-label: #9aa8c2;
  --code-tok-comment: #8a9bb5;
  --code-tok-kw: #6fc2ff;
  --code-tok-str: #ffc97a;
  --code-tok-num: #7cf2a8;
  --code-tok-tag: #6fc2ff;
  --code-tok-attr: #d4e1ff;
  --quote-bg: rgba(210, 228, 255, 0.08);
  --quote-mark: rgba(235, 243, 255, 0.13);
  --nav-pill-active-ink: #1900ff;
  --selection-bg: var(--dark-selection-bg);
  --selection-text: var(--dark-selection-text);
  --home-strip-title: var(--dark-home-strip-title);
  --home-strip-desc: var(--dark-home-strip-desc);
  --home-strip-index: var(--dark-home-strip-index);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

::selection {
  background: var(--selection-bg);
  color: var(--selection-text);
}

::-moz-selection {
  background: var(--selection-bg);
  color: var(--selection-text);
}

a {
  color: inherit;
}

.shell {
  width: min(1160px, calc(100% - 24px));
  margin: 0 auto;
}

.top-nav {
  margin-top: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 40;
  isolation: isolate;
  padding: 10px 12px;
  transition: transform 220ms ease, opacity 220ms ease;
  will-change: transform;
}

.top-nav.is-auto-hidden {
  transform: translateY(calc(-100% - 8px));
  opacity: 0.01;
  pointer-events: none;
}

.top-nav::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background:
    linear-gradient(120deg, var(--nav-glass-tint) 0%, rgba(255, 255, 255, 0) 44%),
    linear-gradient(165deg, var(--nav-glass-base) 0%, var(--nav-glass-glow) 100%);
  border: 1px solid var(--nav-glass-border);
  border-radius: 0;
  box-shadow: 0 10px 24px rgba(80, 0, 120, 0.3);
  backdrop-filter: blur(var(--nav-blur)) saturate(var(--nav-saturate));
  -webkit-backdrop-filter: blur(var(--nav-blur)) saturate(var(--nav-saturate));
  pointer-events: none;
  z-index: -1;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--brand-gap);
  text-decoration: none;
  font-family: "Syne", sans-serif;
  font-size: var(--brand-text-size);
  font-weight: 700;
  color: var(--nav-ink);
}

.brand::before {
  content: "";
  width: var(--brand-icon-size);
  height: var(--brand-icon-size);
  background-image: var(--brand-icon-url);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex: 0 0 var(--brand-icon-size);
}

.top-nav nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(30px, 4.2vw, 64px);
}

.top-nav nav a {
  text-decoration: none;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--nav-muted-ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0;
  padding: 6px 10px;
}

.top-nav nav a.active {
  background: var(--nav-pill-active-bg);
  color: var(--nav-pill-active-ink);
  border-color: transparent;
}

.top-nav nav a:hover {
  color: var(--nav-ink);
  border-color: transparent;
}

.top-nav .theme-toggle {
  background: rgba(255, 255, 255, 0.16);
  color: var(--nav-ink);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 0;
}

.top-nav .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
}

.btn {
  border: 0;
  outline: none;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 12px;
  text-decoration: none;
  cursor: pointer;
}

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

.theme-toggle {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  width: 40px;
  height: 36px;
  padding: 8px 10px;
  line-height: 1;
  font-size: 1rem;
}

.theme-toggle::before {
  content: "";
  width: 16px;
  height: 16px;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M21.64 13a1 1 0 0 0-1.06-.33A8 8 0 0 1 11.36 3.4a1 1 0 0 0-1.39-1A10 10 0 1 0 22.6 15a1 1 0 0 0-.96-2z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M21.64 13a1 1 0 0 0-1.06-.33A8 8 0 0 1 11.36 3.4a1 1 0 0 0-1.39-1A10 10 0 1 0 22.6 15a1 1 0 0 0-.96-2z'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.page-main {
  margin-top: 12px;
  margin-bottom: 24px;
  display: grid;
  gap: 12px;
}

.home-intro h1 {
  margin: 0;
  font-family: "Noto Sans SC", "Syne", "Microsoft YaHei", sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 6vw, 4.6rem);
  line-height: 2;
  letter-spacing: 0.01em;
}

.home-intro p {
  margin: 0;
  text-align: center;
}

.home-intro,
.home-intro.block {
  background: transparent;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
}

.home-title-line {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  justify-content: center;
  gap: var(--home-title-gap, clamp(6px, 1.4vw, 14px));
  margin-bottom: var(--home-title-safe-gap, 0px);
  order: 1;
}

.home-intro [data-site="eyebrow"] {
  order: 2;
  margin-top: clamp(2px, 0.7vw, 8px);
}

.home-intro [data-site="subtitle"] {
  order: 3;
  margin-top: clamp(2px, 0.7vw, 10px);
  text-align: center;
}

.home-intro [data-site="title"],
.home-intro [data-site="eyebrow"],
.home-intro [data-site="subtitle"] {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.home-title-role {
  --home-role-scale: 1;
  --home-role-offset-x: 0%;
  --home-role-offset-y: 0%;
  width: calc(clamp(52px, 8vw, 92px) * var(--home-role-scale));
  height: auto;
  object-fit: contain;
  object-position: center bottom;
  flex: 0 0 auto;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  pointer-events: none;
  touch-action: none;
  transform: translate3d(var(--home-role-offset-x), var(--home-role-offset-y), 0);
}

.home-title-role-hit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  line-height: 0;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}

.home-title-role-hit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.home-title-role.raised {
  animation: toy-role-shake var(--toy-shake-ms, 220ms) linear infinite;
}

@keyframes toy-role-shake {
  0% {
    transform: translate3d(
        calc(var(--home-role-offset-x) - 1px),
        calc(var(--home-role-offset-y) + 0px),
        0
      )
      rotate(-1deg);
  }
  50% {
    transform: translate3d(
        calc(var(--home-role-offset-x) + 1px),
        calc(var(--home-role-offset-y) - 1px),
        0
      )
      rotate(1deg);
  }
  100% {
    transform: translate3d(
        calc(var(--home-role-offset-x) - 1px),
        calc(var(--home-role-offset-y) + 0.5px),
        0
      )
      rotate(-1deg);
  }
}

.home-strip-list {
  display: grid;
  gap: 0;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.home-strip {
  position: relative;
  --strip-pad: clamp(12px, 2.2vw, 22px);
  --strip-slant: 22%;
  min-height: clamp(260px, 34vw, 460px);
  overflow: hidden;
  display: grid;
  align-items: end;
  text-decoration: none;
  background: var(--surface);
  clip-path: polygon(0 var(--strip-slant), 100% 0, 100% calc(100% - var(--strip-slant)), 0 100%);
  transition: transform 180ms ease;
  transform-origin: center;
}

.home-strip,
.home-strip * {
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.home-strip + .home-strip {
  margin-top: clamp(-62px, -4.6vw, -30px);
}

.home-strip:hover,
.home-strip:focus-visible {
  transform: scale(1.08);
  z-index: 3;
}

.home-strip-bg {
  position: absolute;
  inset: -14% -3%;
  transform: translate3d(0, 0, 0) scale(1.2);
  will-change: transform;
  overflow: hidden;
}

.home-strip-media {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.home-strip-media-base {
  opacity: 1;
}

.home-strip-media-hover {
  opacity: 0;
}

.home-strip.has-hover-media:hover .home-strip-media-base,
.home-strip.has-hover-media:focus-visible .home-strip-media-base {
  opacity: 0;
}

.home-strip.has-hover-media:hover .home-strip-media-hover,
.home-strip.has-hover-media:focus-visible .home-strip-media-hover {
  opacity: 1;
}

.home-strip-media-video,
.home-strip-bg-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: var(--strip-fit, cover);
  object-position: var(--strip-position, center);
  pointer-events: none;
}

.home-strip-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.22) 0%, rgba(0, 0, 0, 0.58) 100%);
}

.home-strip-content {
  position: relative;
  z-index: 2;
  margin: var(--strip-pad);
  padding: 10px 0;
  background: transparent;
  width: auto;
  max-width: min(92%, 920px);
}

.home-strip-no {
  display: inline-block;
  margin-bottom: 2px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--home-strip-index);
}

.home-strip h2 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: clamp(1.6rem, 4.6vw, 3rem);
  color: var(--home-strip-title);
}

.home-strip p {
  margin: 8px 0 0;
  color: var(--home-strip-desc);
}

.page-hero {
  display: grid;
  gap: 8px;
}

.hero-image {
  width: 100%;
  height: auto;
  aspect-ratio: var(--hero-ratio, 21 / 8);
  object-fit: var(--hero-fit, cover);
  object-position: var(--hero-position, center);
  display: block;
  background: var(--surface-alt);
}

.block {
  background: var(--surface);
  padding: 14px;
}

.hero-copy h1 {
  margin: 6px 0 0;
  font-family: "Noto Serif SC", "Syne", serif;
  font-size: clamp(1.8rem, 5vw, 3.6rem);
  line-height: 0.95;
}

.hero-copy p {
  margin: 10px 0 0;
  color: var(--muted);
}

.eyebrow {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.portal {
  text-decoration: none;
  display: grid;
  gap: 8px;
}

.portal span {
  font-family: "Space Grotesk", sans-serif;
  color: var(--muted);
  font-size: 0.78rem;
}

.portal h2 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: 1.48rem;
}

.portal p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.item-card {
  background: var(--surface);
  display: grid;
  grid-template-rows: auto 1fr;
  transition: transform 180ms ease;
  transform-origin: center;
}

.item-card,
.item-card *,
.game-card,
.game-card * {
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.item-card:hover,
.item-card:focus-within {
  transform: scale(1.08);
  z-index: 2;
}

.item-card-link {
  color: inherit;
  text-decoration: none;
}

.item-card-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--emphasis-bg-strong);
}

.item-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: var(--surface-alt);
}

.item-cover-wrap {
  position: relative;
}

.item-card-comic .item-cover-wrap {
  overflow: hidden;
}

#art-grid {
  display: block;
  column-width: clamp(220px, 24vw, 340px);
  column-gap: 0;
}

#art-grid .item-card {
  display: block;
  width: 100%;
  margin: 0;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
}

#art-grid .item-cover {
  aspect-ratio: auto;
  height: auto;
  object-fit: contain;
}

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

.item-meta {
  margin: 0;
  color: var(--muted);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.8rem;
}

.item-title {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.35;
}

.item-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.58;
}

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

.item-tags span {
  background: var(--emphasis-bg);
  color: var(--text);
  font-size: 0.72rem;
  padding: 3px 7px;
}

.art-type-flag {
  font-size: 0.7rem;
  padding: 1px 6px;
  background: var(--emphasis-bg);
  color: var(--text);
}

.comic-panel {
  margin-top: 2px;
  border-top: 1px solid var(--surface-alt);
  padding-top: 8px;
}

.comic-panel-summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.84rem;
  user-select: none;
  -webkit-user-select: none;
}

.item-card-comic {
  position: relative;
  overflow: visible;
}

.item-card-comic .comic-panel {
  position: absolute;
  inset: 0;
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
  z-index: 3;
}

.item-card-comic .comic-panel-summary {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(-13deg);
  width: 118%;
  height: 50%;
  min-height: 86px;
  max-height: 240px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 3;
  padding: 0 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 0;
  box-shadow: none;
  color: #f5f8ff;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
}

.item-card-comic .comic-panel-summary::-webkit-details-marker {
  display: none;
}

.item-card-comic .comic-panel-summary {
  list-style: none;
}

.item-card-comic .comic-panel[open] .comic-pages {
  transform: translateY(-12px);
  opacity: 1;
  pointer-events: auto;
}

.comic-pages {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  column-gap: 4px;
  row-gap: 0;
  align-content: start;
  align-items: start;
}

.item-card-comic .comic-pages {
  position: absolute;
  left: 22px;
  right: 22px;
  top: 22px;
  bottom: 22px;
  z-index: 4;
  margin-top: 0;
  padding: 26px 4px 0;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(8, 12, 20, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow: auto;
  transform: translateY(24px);
  opacity: 0;
  pointer-events: none;
  transition: transform 220ms ease, opacity 220ms ease;
}

.comic-pages-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border: 0;
  background: rgba(0, 0, 0, 0.72);
  color: #f5f8ff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.comic-page-thumb {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  background: var(--surface-alt);
  cursor: zoom-in;
}

.item-card-comic .comic-page-thumb {
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.comic-viewer {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 28px);
  background: rgba(8, 12, 20, 0.92);
}

.comic-viewer.open {
  display: flex;
}

.comic-viewer-img {
  max-width: min(94vw, 1200px);
  max-height: 86vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.comic-viewer-caption {
  position: absolute;
  left: 50%;
  bottom: clamp(12px, 2.2vw, 22px);
  transform: translateX(-50%);
  margin: 0;
  padding: 6px 10px;
  color: #f5f8ff;
  background: rgba(8, 12, 20, 0.62);
  font-size: 0.86rem;
}

.comic-viewer-close,
.comic-viewer-nav {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(8, 12, 20, 0.55);
  color: #f5f8ff;
  cursor: pointer;
}

.comic-viewer-close {
  top: clamp(12px, 2.2vw, 20px);
  right: clamp(12px, 2.2vw, 20px);
  width: 42px;
  height: 42px;
  font-size: 1.55rem;
  line-height: 1;
}

.comic-viewer-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 52px;
  font-size: 2rem;
  line-height: 1;
}

.comic-viewer-nav.prev {
  left: clamp(8px, 2.2vw, 20px);
}

.comic-viewer-nav.next {
  right: clamp(8px, 2.2vw, 20px);
}

.comic-viewer-nav:disabled {
  opacity: 0.45;
  cursor: default;
}

.item-tags .blog-tag-chip {
  border: 0;
  outline: none;
  cursor: pointer;
  user-select: none;
}

.item-tags .blog-tag-chip:focus-visible {
  box-shadow: 0 0 0 2px var(--accent);
}

.item-tags .blog-tag-chip.blog-tag-lock {
  cursor: default;
  opacity: 0.9;
  background: color-mix(in srgb, var(--emphasis-bg), #7cb0ff 35%);
}

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

.back-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.post-content {
  width: min(920px, 100%);
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding: 16px clamp(14px, 2.8vw, 28px);
  box-sizing: border-box;
  min-width: 0;
}

.markdown-content {
  max-width: 100%;
  min-width: 0;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4 {
  font-family: "Noto Serif SC", "Syne", serif;
  margin: 1.2em 0 0.5em;
  overflow-wrap: anywhere;
  word-break: break-word;
  scroll-margin-top: calc(96px + env(safe-area-inset-top, 0px));
}

.markdown-content p,
.markdown-content li,
.markdown-content blockquote {
  font-family: "Noto Serif SC", "STSong", "SimSun", "Songti SC", serif;
  color: var(--muted);
  line-height: 1.8;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.markdown-content a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.markdown-content ul,
.markdown-content ol {
  padding-left: 1.25rem;
}

.markdown-content hr {
  border: 0;
  border-top: 1px solid var(--surface-alt);
  margin: 1.1rem 0;
}

.markdown-content code {
  background: var(--emphasis-bg);
  color: var(--text);
  padding: 0.1em 0.36em;
  font-family: "Noto Serif SC", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.markdown-content pre {
  overflow: auto;
  max-width: 100%;
  padding: 12px;
  background: var(--code-block-bg);
  border: 1px solid var(--code-block-border);
  overflow-wrap: normal;
  word-break: normal;
}

.markdown-content pre::-webkit-scrollbar {
  height: 32px;
  background: var(--code-block-bg);
  border-top: 1px solid var(--code-block-border);
}

.markdown-content pre::-webkit-scrollbar-track {
  background: color-mix(in srgb, var(--code-block-border), transparent 75%);
}

.markdown-content pre::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--code-block-border), var(--code-block-fg) 20%);
  border-radius: 0;
}

.markdown-content pre::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--code-block-border), var(--code-block-fg) 35%);
}

.markdown-content pre::-webkit-scrollbar-thumb:active {
  background: color-mix(in srgb, var(--code-block-border), var(--code-block-fg) 50%);
}

.markdown-content pre.code-block {
  position: relative;
  padding-top: 34px;
}

.markdown-content pre.code-block::before {
  content: attr(data-lang);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 7px 12px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--code-block-label);
  border-bottom: 1px solid var(--code-block-border);
}

.markdown-content .code-copy-btn {
  position: absolute;
  top: 5px;
  left: 8px;
  z-index: 1;
  border: 1px solid var(--code-block-border);
  background: color-mix(in srgb, var(--code-block-bg), #ffffff 8%);
  color: var(--code-block-fg);
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
  padding: 4px 9px;
  cursor: pointer;
}

.markdown-content .code-copy-btn:hover {
  background: color-mix(in srgb, var(--code-block-bg), #ffffff 18%);
}

.markdown-content pre code {
  counter-reset: code-line;
}

.code-line {
  display: block;
  counter-increment: code-line;
  padding-left: 4em;
  position: relative;
  min-height: 1.5em;
}

.code-line::before {
  content: counter(code-line);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.8em;
  height: 100%;
  text-align: right;
  padding: 0 0.5em 0 0;
  color: var(--code-block-fg);
  opacity: 0.22;
  font-size: 0.82em;
  line-height: inherit;
  background: color-mix(in srgb, var(--code-block-bg), var(--code-block-fg) 3.5%);
  border-right: 1px solid color-mix(in srgb, var(--code-block-border), transparent 72%);
  user-select: none;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.markdown-content pre code {
  background: transparent;
  padding: 0;
  color: var(--code-block-fg);
  font-family: "Noto Serif SC", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.markdown-content pre code .tok-comment {
  color: var(--code-tok-comment);
}

.markdown-content pre code .tok-kw {
  color: var(--code-tok-kw);
}

.markdown-content pre code .tok-str {
  color: var(--code-tok-str);
}

.markdown-content pre code .tok-num {
  color: var(--code-tok-num);
}

.markdown-content pre code .tok-tag {
  color: var(--code-tok-tag);
}

.markdown-content pre code .tok-attr {
  color: var(--code-tok-attr);
}

.markdown-content .math-inline {
  display: inline-block;
  max-width: 100%;
  vertical-align: middle;
}

.markdown-content .math-block {
  display: block;
  margin: 0.7em 0;
  overflow-x: auto;
  padding: 0.1em 0;
}

.markdown-content .math-block .katex-display {
  margin: 0.2em 0;
}

.markdown-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0.8rem 0;
}

.markdown-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
  font-size: 0.9rem;
  overflow-x: auto;
  display: block;
}

.markdown-content th,
.markdown-content td {
  border: 1px solid var(--surface-alt);
  padding: 8px 12px;
  text-align: inherit;
}

.markdown-content th {
  background: var(--emphasis-bg-strong);
  font-weight: 700;
}

.markdown-content td {
  background: var(--surface);
}

.markdown-content tr:nth-child(even) td {
  background: var(--emphasis-bg);
}

.markdown-content blockquote {
  margin: 1em 0;
  padding: 12px 16px;
  background: var(--quote-bg);
  position: relative;
  overflow: hidden;
}

.markdown-content blockquote::before,
.markdown-content blockquote::after {
  position: absolute;
  line-height: 1;
  font-family: "Syne", "Noto Sans SC", sans-serif;
  font-size: clamp(2.2rem, 4.8vw, 3.6rem);
  color: var(--quote-mark);
  pointer-events: none;
}

.markdown-content blockquote::before {
  content: "\201C";
  top: -2px;
  left: 6px;
}

.markdown-content blockquote::after {
  content: "\201D";
  right: 6px;
  bottom: -10px;
}

.post-toc {
  width: min(920px, 100%);
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding: 12px clamp(14px, 2.8vw, 28px);
  box-sizing: border-box;
}

.post-toc-title {
  margin: 0 0 8px;
  font-family: "Syne", sans-serif;
  font-size: 0.92rem;
  opacity: 0.9;
}

.post-toc-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}

.post-toc-link {
  display: block;
  text-decoration: none;
  color: var(--muted);
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 0.82rem;
  line-height: 1.35;
  padding: 1px 0;
}

.post-toc-link:hover {
  color: var(--text);
}

.post-toc-link.level-2 {
  padding-left: 8px;
  font-weight: 700;
}

.post-toc-link.level-3 {
  padding-left: 16px;
  font-weight: 500;
}

.post-toc-link.level-4 {
  padding-left: 24px;
  font-weight: 400;
}

.post-toc-link.level-1 {
  font-weight: 800;
}

.page-main.post-has-toc {
  grid-template-columns: minmax(0, 920px) minmax(160px, 220px);
  column-gap: 16px;
  align-items: start;
  justify-content: center;
}

.page-main.post-has-toc .page-hero {
  grid-column: 1 / -1;
}

.page-main.post-has-toc .post-content {
  grid-column: 1;
  width: 100%;
  margin: 0;
}

.page-main.post-has-toc .post-toc {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  margin: 0;
  padding: 8px 0 8px 10px;
  background: transparent;
  border-left: 1px solid var(--surface-alt);
  position: sticky;
  top: calc(92px + env(safe-area-inset-top, 0px));
  max-height: calc(100vh - 110px);
  overflow: auto;
  overscroll-behavior: contain;
}

.page-main.post-has-toc .post-toc::-webkit-scrollbar {
  width: 6px;
}

.page-main.post-has-toc .post-toc::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--muted), transparent 52%);
}

@media (max-width: 1160px) {
  .page-main.post-has-toc {
    grid-template-columns: 1fr;
  }

  .page-main.post-has-toc .post-content {
    grid-column: 1;
  }

  .page-main.post-has-toc .post-toc {
    grid-column: 1;
    grid-row: auto;
    position: static;
    max-height: none;
    border-left: 0;
    padding: 10px clamp(14px, 2.8vw, 28px);
    margin-left: auto;
    margin-right: auto;
    width: min(920px, 100%);
    background: var(--surface);
  }
}

.toolbar-block {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

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

.blog-toolbar {
  width: min(960px, 100%);
  margin: 0 auto;
  align-items: flex-start;
}

.blog-search-row {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.blog-search-input {
  width: 100%;
  border: 1px solid var(--surface-alt);
  background: var(--surface);
  color: var(--text);
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 0.92rem;
  padding: 9px 10px;
}

.blog-search-input:focus {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}

.blog-filter-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-btn {
  border: 0;
  background: var(--emphasis-bg);
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 7px 10px;
  cursor: pointer;
}

.filter-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.filter-btn.active {
  background: var(--accent);
  color: var(--accent-ink);
}

.post-tag-link {
  text-decoration: none;
  color: color-mix(in srgb, var(--text), #3f7dff 32%);
}

.post-tag-link:hover {
  text-decoration: underline;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  position: relative;
  z-index: 1;
}

.game-card {
  background: var(--surface);
  display: grid;
  grid-template-rows: auto 1fr;
  transform: scale(0.92);
  transition: transform 220ms ease;
}

.game-card:hover,
.game-card:focus-within {
  transform: scale(1.02);
  z-index: 2;
}

.game-media {
  position: relative;
  border: 0;
  padding: 0;
  margin: 0;
  background: var(--emphasis-bg);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  cursor: pointer;
}

.game-media:disabled {
  cursor: not-allowed;
}

.game-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 220ms ease, transform 260ms ease;
}

.game-cover-hover {
  opacity: 0;
}

.game-card:hover .game-cover-primary,
.game-card:focus-within .game-cover-primary {
  opacity: 0;
  transform: scale(1.05);
}

.game-card:hover .game-cover-hover,
.game-card:focus-within .game-cover-hover {
  opacity: 1;
  transform: scale(1.05);
}

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

.game-meta {
  margin: 0;
  color: var(--muted);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.78rem;
}

.game-title {
  margin: 0;
  font-size: 1.08rem;
}

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

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

.game-tags span {
  background: var(--emphasis-bg);
  color: var(--text);
  padding: 2px 7px;
  font-size: 0.72rem;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
}

.mi-unlock-mask {
  position: fixed;
  inset: 0;
  z-index: 140;
  background: rgba(0, 0, 0, 0.58);
  display: grid;
  place-items: center;
  padding: 12px;
}

.mi-unlock-panel {
  width: min(520px, 100%);
  background: var(--surface);
  border: 1px solid var(--surface-alt);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.mi-unlock-panel h2 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: 1.2rem;
}

.mi-unlock-question {
  margin: 0;
  color: var(--muted);
}

.mi-unlock-form {
  display: grid;
  gap: 10px;
}

.mi-unlock-input {
  width: 100%;
  border: 1px solid var(--surface-alt);
  background: var(--surface);
  color: var(--text);
  padding: 9px 10px;
  font-size: 0.94rem;
}

.mi-unlock-input:focus {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}

.mi-unlock-error {
  margin: 0;
  color: #ff7b8c;
  font-size: 0.86rem;
}

.mi-unlock-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
}

.modal-panel {
  position: relative;
  width: min(1180px, calc(100% - 24px));
  margin: 16px auto;
  background: var(--surface);
  display: grid;
  grid-template-rows: auto 1fr;
}

.modal-panel header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--emphasis-bg-strong);
}

.modal-panel h2 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: 1.05rem;
}

.close-btn {
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  width: 32px;
  height: 32px;
  font-size: 1.2rem;
  cursor: pointer;
}

.modal-body {
  min-height: 74vh;
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 10px;
  background: var(--surface);
}

#game-frame {
  width: 100%;
  height: calc(74vh - 20px);
  border: 0;
  background: #000;
}

.embed-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.embed-open-link {
  width: fit-content;
}

.game-player {
  margin-top: 12px;
  border: 1px solid var(--surface-alt);
  background: var(--surface);
  position: sticky;
  top: calc(var(--back-to-top-top, 72px) + 6px);
  z-index: 32;
  isolation: isolate;
}

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

.game-player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--emphasis-bg-strong);
}

.game-player-header h2 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: 1.05rem;
}

.game-player-body {
  min-height: 74vh;
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 10px;
  background: var(--surface);
}

@media (min-width: 901px) {
  body[data-page="game"].game-player-open .page-main {
    height: auto;
    overflow: visible;
    gap: 12px;
  }

  body[data-page="game"].game-player-open .game-player {
    position: static;
    top: auto;
    margin-top: 0;
  }

  body[data-page="game"].game-player-open #game-frame {
    height: clamp(320px, 56vh, 760px);
  }

  body[data-page="game"].game-player-open .game-grid {
    height: auto;
    overflow: visible;
    padding-right: 0;
    padding-bottom: 0;
  }
}

.lab-stage {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 14px;
  overflow: visible;
}

.paint-widget {
  width: min(var(--lab-window-width, 1170px), calc(100vw - 56px));
  max-width: var(--lab-window-width, 1170px);
  position: relative;
  transform: translate(0, 0);
  touch-action: pinch-zoom;
}

.paint-window {
  position: relative;
  width: 100%;
  aspect-ratio: 1170 / 1394;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.paint-window.edge-draggable {
  cursor: move;
}

.paint-window-base {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.paint-draw-layer,
.paint-tools,
.paint-color {
  position: absolute;
}

.paint-draw-layer {
  overflow: hidden;
}

.paint-draw-base,
.paint-canvas,
.paint-draw-top {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.paint-draw-base,
.paint-draw-top {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.paint-canvas {
  touch-action: pinch-zoom;
  cursor: crosshair;
}

.paint-tools {
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: var(--tool-gap, 16px);
}

.paint-tool-btn {
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.paint-tool-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.paint-tool-btn.active img {
  filter: brightness(0.6) saturate(0.9);
}

.paint-color {
  overflow: hidden;
}

.paint-color-base,
.paint-color-top,
.paint-color-swatch,
.paint-color-hit {
  position: absolute;
  inset: 0;
}

.paint-color-base,
.paint-color-top {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.paint-color-swatch {
  left: 16%;
  right: 16%;
  top: 16%;
  bottom: 16%;
  border-radius: 2px;
  pointer-events: none;
}

.paint-color-hit {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.paint-color-native-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.paint-export-btn {
  display: block;
  margin: 14px auto 0;
}

.zoomable-image {
  cursor: zoom-in;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 28px);
  background: rgba(8, 12, 20, 0.88);
}

.image-lightbox.open {
  display: flex;
}

.image-lightbox-img {
  max-width: min(96vw, 1600px);
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

.image-lightbox-caption {
  position: absolute;
  left: 50%;
  bottom: clamp(10px, 2.2vw, 20px);
  transform: translateX(-50%);
  margin: 0;
  max-width: min(88vw, 720px);
  padding: 6px 10px;
  color: #f5f8ff;
  background: rgba(10, 14, 22, 0.62);
  text-align: center;
  font-size: 0.86rem;
}

.image-lightbox-close {
  position: absolute;
  right: clamp(10px, 2.2vw, 20px);
  top: clamp(10px, 2.2vw, 20px);
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(8, 12, 20, 0.55);
  color: #f5f8ff;
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
}

body.lightbox-open {
  overflow: hidden;
}

.empty-tip {
  background: var(--surface);
  color: var(--muted);
  padding: 14px;
}

.blog-list {
  width: min(840px, 100%);
  margin: 0 auto;
  grid-template-columns: 1fr;
}

.blog-list .item-cover {
  width: 100%;
  aspect-ratio: 8 / 3;
  object-fit: cover;
  object-position: center;
}

.blog-pagination {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 10px 12px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.blog-page-info {
  margin: 0;
  color: var(--muted);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
}

.art-pagination {
  width: min(960px, 100%);
  margin: 10px auto 0;
  padding: 10px 12px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.art-page-info {
  margin: 0;
  color: var(--muted);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
}

.site-footer {
  margin-top: 30px;
  margin-bottom: 30px;
  padding: 18px 0 12px;
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
  font-size: 0.84rem;
}

.back-to-top {
  position: fixed;
  right: 16px;
  top: var(--back-to-top-top, calc(96px + env(safe-area-inset-top, 0px)));
  z-index: 30;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--nav-glass-border);
  color: var(--nav-ink);
  background:
    linear-gradient(120deg, var(--nav-glass-tint) 0%, rgba(255, 255, 255, 0) 44%),
    linear-gradient(165deg, var(--nav-glass-base) 0%, var(--nav-glass-glow) 100%);
  backdrop-filter: blur(var(--nav-blur)) saturate(var(--nav-saturate));
  -webkit-backdrop-filter: blur(var(--nav-blur)) saturate(var(--nav-saturate));
  box-shadow: 0 10px 24px rgba(80, 0, 120, 0.3);
  border-radius: 0;
  width: 66px;
  height: 62px;
  padding: 0;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.back-to-top::before {
  content: "";
  width: 28px;
  height: 28px;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 5l7 7-1.41 1.41L13 8.83V20h-2V8.83L6.41 13.41 5 12z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 5l7 7-1.41 1.41L13 8.83V20h-2V8.83L6.41 13.41 5 12z'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  border-color: rgba(255, 255, 255, 0.62);
}

@media (max-width: 900px) {
  .top-nav {
    grid-template-columns: 1fr;
    justify-items: stretch;
    row-gap: 8px;
    padding-inline: 12px;
  }

  .top-nav .brand {
    justify-self: center;
  }

  .top-nav nav {
    grid-row: 2;
    width: 100%;
    max-width: calc(100% - 84px);
    margin: 0 auto;
    justify-content: center;
    gap: 8px;
  }

  .top-nav .theme-toggle {
    position: absolute;
    right: 12px;
    top: 10px;
    justify-self: auto;
  }

  .blog-search-row {
    grid-template-columns: 1fr;
  }

  .back-to-top {
    right: 12px;
    width: 60px;
    height: 56px;
  }

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

  .art-pagination {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .art-page-info {
    grid-column: 1 / -1;
    text-align: center;
  }

  .lab-stage {
    padding: 10px;
  }

  .paint-widget {
    width: min(var(--lab-window-width, 1170px), calc(100vw - 28px));
  }

  #art-grid {
    column-count: 2;
    column-width: auto;
    column-gap: 0;
  }

  #game-frame {
    height: calc(62vh - 20px);
  }

  body[data-page="game"].game-player-open .page-main {
    height: auto;
    overflow: visible;
    gap: 10px;
  }

  body[data-page="game"].game-player-open .game-player {
    position: static;
    top: auto;
    margin-top: 0;
  }

  body[data-page="game"].game-player-open .game-player-body {
    min-height: 0;
  }

  body[data-page="game"].game-player-open #game-frame {
    height: clamp(220px, 44svh, 460px);
  }

  body[data-page="game"].game-player-open .game-grid {
    height: auto;
    overflow: visible;
    padding-right: 0;
    padding-bottom: 0;
  }

  .home-strip-content {
    margin: var(--strip-pad);
    width: auto;
  }

  .home-strip-list {
    width: 100%;
  }

  .home-strip {
    --strip-pad: 9px;
    --strip-slant: 16%;
  }

  .home-strip + .home-strip {
    margin-top: -24px;
  }

  .item-card-comic .comic-panel-summary {
    top: 50%;
    width: 122%;
    min-height: 72px;
    max-height: 180px;
    padding: 0 8px;
    font-size: 1.5rem;
  }

  .item-card-comic .comic-pages {
    left: 18px;
    right: 18px;
    top: 18px;
    bottom: 18px;
    padding: 24px 3px 0;
  }

  .comic-pages {
    grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
    column-gap: 3px;
    row-gap: 0;
  }

  .comic-pages-close {
    width: 24px;
    height: 24px;
    font-size: 0.95rem;
  }

  .comic-viewer {
    padding: 10px;
  }

  .comic-viewer-img {
    max-width: 96vw;
    max-height: 82vh;
  }

  .comic-viewer-nav {
    width: 40px;
    height: 46px;
    font-size: 1.8rem;
  }

  .comic-viewer-close {
    width: 38px;
    height: 38px;
    font-size: 1.4rem;
  }

  .page-main.post-has-toc .post-toc {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 8px 12px;
    border-left: 0;
    border-top: 1px solid var(--surface-alt);
    border-bottom: 1px solid var(--surface-alt);
    background: transparent;
  }

  .page-main.post-has-toc .post-toc-title {
    margin-bottom: 6px;
    font-size: 0.84rem;
  }

  .page-main.post-has-toc .post-toc-link {
    font-size: 0.8rem;
  }

  .page-main.post-has-toc .post-toc-link.level-1,
  .page-main.post-has-toc .post-toc-link.level-2,
  .page-main.post-has-toc .post-toc-link.level-3,
  .page-main.post-has-toc .post-toc-link.level-4 {
    padding-left: 0;
    font-weight: 700;
  }
}
