/* ==========================================================================
   单机小站 · 全局样式
   设计语言：浅色底 + 白色卡片 + 横向信息卡 + 纯文字卡片
   零外部字体、零 UI 框架，全部手写，保证首屏最快
   ========================================================================== */

/* ---------- 1. 设计变量 ---------- */
:root {
  color-scheme: light;

  --bg: #f3f4f7;
  --bg-elev: #ffffff;
  --bg-soft: #f8f9fb;
  --bg-sunken: #eceef2;

  --text: #14171c;
  --text-2: #545d6c;
  --text-3: #8a93a2;

  --border: #e5e8ee;
  --border-strong: #d3d8e1;

  --brand: #2b6cff;
  --brand-hover: #1a5aeb;
  --brand-soft: #ecf2ff;
  --brand-text: #1b4fd8;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 3px 10px rgba(16, 24, 40, 0.07);
  --shadow-lg: 0 14px 34px rgba(16, 24, 40, 0.12);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;

  /* 版心：宽屏下 1240 会让 3 列卡片各自过宽、内部大片留白，收到 1120 更聚拢 */
  --maxw: 1120px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Helvetica Neue',
    Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

:root[data-theme='dark'] {
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;

    --bg: #0e1014;
    --bg-elev: #171a20;
    --bg-soft: #1c2027;
    --bg-sunken: #12151a;

    --text: #eef1f6;
    --text-2: #a4adbc;
    --text-3: #79828f;

    --border: #262b34;
    --border-strong: #333a45;

    --brand: #5b8cff;
    --brand-hover: #7ba3ff;
    --brand-soft: #16203a;
    --brand-text: #9dbaff;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 3px 12px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 38px rgba(0, 0, 0, 0.55);
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0e1014;
  --bg-elev: #171a20;
  --bg-soft: #1c2027;
  --bg-sunken: #12151a;
  --text: #eef1f6;
  --text-2: #a4adbc;
  --text-3: #79828f;
  --border: #262b34;
  --border-strong: #333a45;
  --brand: #5b8cff;
  --brand-hover: #7ba3ff;
  --brand-soft: #16203a;
  --brand-text: #9dbaff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 3px 12px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 38px rgba(0, 0, 0, 0.55);
}

/* ---------- 2. 基础重置 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  /* 兜底：任何意外的内容溢出都不产生横向滚动条 */
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;

  /* 内容比视口短时把页脚压到底，不留一截空白背景（.main 负责撑开） */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

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

img {
  height: auto;
}

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

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1em;
}

hr {
  height: 1px;
  border: 0;
  margin: 28px 0;
  background: var(--border);
}

::selection {
  background: var(--brand);
  color: #fff;
}

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

/* 滚动条 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 10px;
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-3);
}

/* 跳转到主内容（无障碍） */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--brand);
  color: #fff;
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  left: 0;
}

/* ---------- 3. 布局 ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 18px;
}

.main {
  /* flex: 1 让它在内容不足一屏时把页脚顶到底部 */
  flex: 1 0 auto;
  padding-bottom: 64px;
  /* 详情页要在这里面把内容撑满（见下面的 .container.detail）；
     列表页不受影响：容器是唯一的 flex 子项，高度仍按内容走 */
  display: flex;
  flex-direction: column;
}

.icon {
  width: 1em;
  height: 1em;
  flex: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.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;
}

/* ---------- 4. 搜索框 ---------- */
.search {
  position: relative;
  display: flex;
  align-items: center;
}
.search .icon {
  position: absolute;
  left: 10px;
  width: 15px;
  height: 15px;
  color: var(--text-3);
  pointer-events: none;
}
.search input {
  /* 宽度固定：不随聚焦变形，免得旁边的主题按钮跟着左右跳 */
  width: 240px;
  height: 34px;
  padding: 0 12px 0 32px;
  font-size: 13.5px;
  color: var(--text);
  background: var(--bg-sunken);
  border: 1px solid transparent;
  border-radius: 9px;
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.search input::placeholder {
  color: var(--text-3);
}
.search input:focus {
  background: var(--bg-elev);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

/* 筛选框 + 主题切换按钮同一行 */
.page-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--text-2);
  transition: background 0.15s, color 0.15s;
  flex: none;
}
.icon-btn:hover {
  background: var(--bg-sunken);
  color: var(--text);
}
.icon-btn svg {
  width: 17px;
  height: 17px;
}
.theme-toggle .moon {
  display: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme-toggle .sun {
    display: none;
  }
  :root:not([data-theme='light']) .theme-toggle .moon {
    display: block;
  }
}
:root[data-theme='dark'] .theme-toggle .sun {
  display: none;
}
:root[data-theme='dark'] .theme-toggle .moon {
  display: block;
}

/* ---------- 5. 页面标题区 ---------- */
.page-head {
  display: flex;
  /* flex-start（而不是 flex-end）：搜索框跟 h1 对齐，别掉到副标题那一行去 */
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  /* 没有顶栏了，页面顶端留白自己撑起来 */
  padding: 38px 0 18px;
}

.page-head h1 {
  font-size: 23px;
  font-weight: 700;
}

.page-head .sub {
  margin: 5px 0 0;
  font-size: 13.5px;
  color: var(--text-3);
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-3);
  padding-top: 26px;
  flex-wrap: wrap;
}
.crumbs a:hover {
  color: var(--brand-text);
}
.crumbs .sep {
  opacity: 0.5;
}

/* ---------- 6. 卡片网格 ---------- */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(298px, 1fr));
  gap: 14px;
}

/* ---------- 7. 游戏卡片 ---------- */
.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
    border-color 0.2s var(--ease);
  contain: content;
}

.game-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.game-card:active {
  transform: translateY(-1px);
}

/* 卡片上半：只有标题，不放图。
   高度写死是故意的 —— 同一行的卡片才能齐平，别改成 padding 自适应 */
.card-top {
  display: flex;
  align-items: center;
  height: 54px;
  padding: 0 15px;
}

.card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-width: 0;
}

.card-title {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  /* 两行标题尽量对半分，免得「…BEFORE / 4」这种尾字被孤零零甩到第二行 */
  text-wrap: balance;
}

.card-title .slash {
  color: var(--text-3);
  font-weight: 400;
  margin: 0 1px;
}

.card-title .orig {
  font-weight: 500;
  color: var(--text-2);
}

/* ---------- 8. 卡片底部信息条 ---------- */
.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 0 13px 10px;
  font-size: 12px;
  color: var(--text-3);
  min-width: 0;
}

.meta-author {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.avatar {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  flex: none;
  object-fit: cover;
  background: linear-gradient(140deg, var(--brand), #8b5cf6);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: grid;
  place-items: center;
  line-height: 1;
  user-select: none;
}

.meta-author .who {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-2);
}

/* ---------- 11. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  transition: background 0.15s, border-color 0.15s, transform 0.1s, color 0.15s;
}
.btn:hover {
  border-color: var(--border-strong);
  background: var(--bg-soft);
}
.btn:active {
  transform: scale(0.985);
}
.btn .icon {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 2px 10px rgba(43, 108, 255, 0.28);
}
.btn-primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.btn-sm {
  height: 30px;
  padding: 0 11px;
  font-size: 12.5px;
  border-radius: 7px;
  gap: 5px;
}
.btn-sm .icon {
  width: 13px;
  height: 13px;
}

/* ---------- 12. 详情页 ---------- */
/* 详情页内容少，让它铺满一屏：.container 撑满 .main 的高度，
   下载面板用 margin-top: auto 贴到页脚上方 —— 多出来的空白落在两块面板之间，
   而不是整块堆在页脚上面。内容超过一屏时 auto margin 归零，等同于普通从上往下排。 */
.container.detail {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}
/* 两块面板一起吸收多余高度（1 : 1）—— 试过把下载卡也拉高（grid-auto-rows: 1fr），
   卡片会被撑到 250px 高、「名称在上按钮在下」中间一大片空，反而更难看。 */
.container.detail > .panel {
  flex: 1 0 auto;
}

.game-hero {
  padding: 22px 0 24px;
  max-width: 68ch;
}

.game-hero h1 {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.hero-orig {
  margin: 7px 0 0;
  font-size: 14.5px;
  color: var(--text-2);
  font-weight: 500;
}

/* 详情页单列铺满：正文与下载区上下排列，各自横向占满版心，没有侧栏。 */

.panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  font-size: 15px;
  font-weight: 650;
}
.panel-head .icon {
  width: 17px;
  height: 17px;
  color: var(--brand);
}
.panel-head .count {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  background: var(--bg-sunken);
  padding: 1px 7px;
  border-radius: 20px;
}

/* 下载列表：横向铺开的卡片格。
   版心内容宽约 1072px，min 240 + gap 12 刚好能放下 4 列（240 是实测算出来的，
   写到 258 就会掉成 3 列、第 4 个网盘被挤到第二行）。 */
.dl-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.dl-item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 16px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.dl-item:hover {
  border-color: var(--border-strong);
  background: var(--bg-elev);
  box-shadow: var(--shadow-sm);
}

/* 卡片上半：色点 + 网盘名 + 说明 */
.dl-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dl-main {
  min-width: 0;
}

.dl-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  background: hsl(var(--h) 72% 55%);
  box-shadow: 0 0 0 3px hsl(var(--h) 80% 55% / 0.16);
}

.dl-name {
  font-size: 14.5px;
  font-weight: 650;
  min-width: 0;
}

.dl-note {
  font-size: 12px;
  color: var(--text-3);
  overflow-wrap: anywhere;
}

/* 卡片下半：只有一个「前往下载」按钮（自动拉伸占满整行宽）。
   提取码不在这里显示，frontmatter 里的 `downloads[].code` 只作留档。 */
.dl-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dl-actions .btn {
  flex: 1 1 auto;
  justify-content: center;
}

.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: var(--radius);
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
  font-size: 13.5px;
  color: var(--text-2);
  margin-bottom: 12px;
}
.notice .icon {
  width: 16px;
  height: 16px;
  color: var(--brand);
  flex: none;
  stroke-width: 2.2;
}
/* 单栏后这条会横跨整个版心，把按钮推到最右端，两端撑开不显空 */
.notice .btn {
  margin-left: auto;
  flex: none;
}
.notice strong {
  color: var(--text);
  font-weight: 650;
}

/* ---------- 13. Markdown 正文排版 ---------- */
.prose {
  font-size: 15px;
  line-height: 1.78;
  color: var(--text-2);
}

.prose > *:first-child {
  margin-top: 0;
}
.prose > *:last-child {
  margin-bottom: 0;
}

.prose h2 {
  margin: 30px 0 12px;
  font-size: 18px;
  color: var(--text);
  padding-left: 11px;
  border-left: 3px solid var(--brand);
  line-height: 1.4;
}

.prose h3 {
  margin: 24px 0 10px;
  font-size: 15.5px;
  color: var(--text);
}

.prose h4 {
  margin: 20px 0 8px;
  font-size: 14.5px;
  color: var(--text);
}

.prose strong {
  color: var(--text);
  font-weight: 650;
}

.prose a {
  color: var(--brand-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--brand) 35%, transparent);
}
.prose a:hover {
  text-decoration-color: var(--brand);
}

.prose ul,
.prose ol {
  padding-left: 1.35em;
  margin: 0 0 1em;
}
.prose li {
  margin-bottom: 0.4em;
}
.prose li::marker {
  color: var(--text-3);
}

.prose blockquote {
  margin: 16px 0;
  padding: 2px 0 2px 15px;
  border-left: 3px solid var(--border-strong);
  color: var(--text-3);
}

.prose code {
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg-sunken);
  color: var(--text);
}

.prose pre {
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
}
.prose pre code {
  padding: 0;
  background: none;
  font-size: inherit;
}

.prose img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 16px 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
  display: block;
  overflow-x: auto;
}
.prose th,
.prose td {
  padding: 9px 12px;
  border: 1px solid var(--border);
  text-align: left;
}
.prose th {
  background: var(--bg-soft);
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}
.prose tr:nth-child(even) td {
  background: var(--bg-soft);
}

/* 截图 */
.shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}
.shots img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: zoom-in;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.shots img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

/* ---------- 14. 空状态 ---------- */
.empty {
  text-align: center;
  padding: 70px 20px;
  color: var(--text-3);
}
.empty .icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 14px;
  opacity: 0.45;
  stroke-width: 1.5;
}
.empty h3 {
  font-size: 15px;
  color: var(--text-2);
  margin-bottom: 5px;
}
.empty p {
  font-size: 13.5px;
  margin: 0;
}

/* ---------- 15. 分页（纯前端：翻页不发请求，也不生成额外页面） ---------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 28px 0 4px;
}

/* 必须写死这一条：.pager 是 flex，会盖掉 [hidden] 自带的 display:none */
.pager[hidden] {
  display: none;
}

.pager-btn,
.pager-num {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 9px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.pager-btn:hover,
.pager-num:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.pager-num.is-active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
  cursor: default;
}

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

.pager-gap {
  min-width: 18px;
  text-align: center;
  color: var(--text-3);
}

@media (max-width: 640px) {
  .pager {
    gap: 5px;
    margin-top: 22px;
  }
  .pager-btn,
  .pager-num {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    font-size: 13px;
  }
}

/* ---------- 17. 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  padding: 30px 0;
  /* 不再 margin-top：body 是 flex 列，间距由 .main 的 padding-bottom 统一给 */
  font-size: 13px;
  color: var(--text-3);
}

/* ---------- 18. 返回顶部 ---------- */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  color: var(--text-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.25s var(--ease);
}
.to-top.show {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.to-top:hover {
  color: var(--brand);
  border-color: var(--brand);
}
.to-top svg {
  width: 17px;
  height: 17px;
}

/* 复制提示 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 14px);
  z-index: 90;
  padding: 9px 17px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: #fff;
  background: rgba(20, 23, 28, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s var(--ease);
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* 图片灯箱 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 30px;
  background: rgba(10, 12, 16, 0.86);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s;
  cursor: zoom-out;
}
.lightbox.show {
  opacity: 1;
  visibility: visible;
}
.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

/* ---------- 19. 入场动画 ---------- */
@media (prefers-reduced-motion: no-preference) {
  .game-card {
    animation: card-in 0.4s var(--ease) both;
  }
  @keyframes card-in {
    from {
      opacity: 0;
      transform: translateY(9px);
    }
  }
}

/* 搜索过滤时隐藏 */
.game-card[hidden] {
  display: none !important;
}

/* ---------- 20. 响应式 ---------- */
@media (max-width: 860px) {
  .search input {
    width: 170px;
  }
  .game-hero h1 {
    font-size: 21px;
  }
}

@media (max-width: 740px) {
  .page-head {
    padding-top: 22px;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14.5px;
  }
  .container {
    padding-inline: 14px;
  }
  .game-grid {
    /* 必须用 minmax(0,1fr)：单纯的 1fr 最小宽度是 auto，会被卡片内容撑宽导致横向溢出 */
    grid-template-columns: minmax(0, 1fr);
    gap: 11px;
  }
  /* 窄屏：筛选框铺满一行，主题按钮仍贴在它右侧 */
  .page-tools {
    width: 100%;
  }
  .page-tools .search {
    flex: 1;
    min-width: 0;
  }
  .page-tools .search input {
    width: 100%;
  }
  .panel {
    padding: 16px;
    border-radius: var(--radius);
  }
  .to-top {
    right: 14px;
    bottom: 14px;
  }
}

/* ---------- 21. 打印 ---------- */
@media print {
  .site-footer,
  .to-top,
  .dl-actions {
    display: none;
  }
  body {
    background: #fff;
  }
}
