/* ============ 主题变量 ============ */
:root {
  /* 主色：品牌绿（填充按钮上用深色文字保证对比度） */
  --primary: #1db954;
  --primary-dark: #169c46;
  --primary-soft: rgba(29, 185, 84, 0.1);
  --on-primary: #08130c;
  --bg: #f6f7f5;
  --card: #fcfdfc;
  --text: #111827;
  --text-2: #586779;
  --border: #e3e8e4;
  --header-bg: rgba(252, 253, 252, 0.92);
  --chip-bg: #eff3f0;
  --shadow: 0 18px 34px -28px rgba(22, 32, 26, 0.16);
  --shadow-hover: 0 26px 54px -38px rgba(22, 32, 26, 0.24);
  --radius: 12px;
  --motion-fast: 180ms;
  --motion-med: 280ms;
  --motion-ripple: 360ms;
  --motion-wave: 420ms;
  --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}
[data-theme="dark"] {
  --primary: #29cca1;
  --primary-dark: #08bd85;
  --primary-soft: rgba(41, 204, 161, 0.14);
  --on-primary: #06130f;
  --bg: #0a1117;
  --card: #111e27;
  --text: #edf2fa;
  --text-2: #9ba8ba;
  --border: #23313b;
  --header-bg: rgba(14, 24, 32, 0.94);
  --chip-bg: #15232b;
  --shadow: 0 18px 34px -28px rgba(0, 0, 0, 0.66);
  --shadow-hover: 0 26px 52px -34px rgba(0, 0, 0, 0.82);
}

/* ============ 基础 ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  transition: background-color var(--motion-fast), color var(--motion-fast);
}
a { color: inherit; text-decoration: 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;
}
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.empty { color: var(--text-2); text-align: center; padding: 48px 0; }

/* ============ 公告条 ============ */
.announce {
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 13px;
  line-height: 1.6;
  padding: 8px 0;
}
.announce .container { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ============ 头部 ============ */
.site-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner { display: flex; align-items: center; gap: 20px; padding: 14px 16px 10px; }
.logo { display: flex; align-items: center; gap: 10px; line-height: 1.2; flex-shrink: 0; }
.logo-text { display: flex; flex-direction: column; }
.logo-name { font-size: 22px; font-weight: 800; color: var(--primary); letter-spacing: 1px; }
/* 站名 Logo：固定高度 + 最大宽度，超出等比缩放，避免撑乱头部 */
.logo-title-img {
  display: block;
  height: 44px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
}
.logo-slogan { font-size: 12px; color: var(--text-2); }
.search { display: flex; flex: 1; max-width: 460px; margin-left: auto; }
.search input { flex: 1; border-radius: 20px 0 0 20px; border-right: none; padding-left: 16px; }
.search button {
  background: var(--primary);
  color: var(--on-primary);
  border: none;
  border-radius: 0 20px 20px 0;
  padding: 0 18px;
  display: flex;
  align-items: center;
}
.search button:hover { background: var(--primary-dark); }
.nav-toggle { display: none; background: none; border: none; color: var(--text); }
.site-nav { border-top: 1px solid var(--border); }
.nav-inner { display: flex; flex-wrap: wrap; gap: 4px; padding-top: 4px; padding-bottom: 4px; }
.nav-inner a {
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: var(--font-nav, inherit);
  font-weight: 700;
  color: var(--text-2);
  transition: border-color var(--motion-fast) var(--ease-standard),
    background-color var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-med) var(--ease-standard);
}
/* 分类栏按钮悬停时的主题色发光 */
@keyframes navGlow {
  0%, 100% {
    box-shadow: 0 0 10px color-mix(in srgb, var(--primary) 22%, transparent);
  }
  50% {
    box-shadow: 0 0 20px color-mix(in srgb, var(--primary) 48%, transparent);
  }
}
.nav-inner a:hover {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary-soft);
  animation: navGlow 1.8s ease-in-out infinite;
}
.nav-inner a:focus-visible {
  border-color: color-mix(in srgb, var(--primary) 45%, transparent);
  box-shadow: 0 0 16px color-mix(in srgb, var(--primary) 40%, transparent);
}
.nav-inner a.active { color: var(--primary); font-weight: 700; }
.sec-title-link { display: inline-block; }
.nav-inner a { transform: translateY(0); }
.text-wave-char {
  display: inline-block;
  white-space: pre;
  transform: translateY(0);
}
@keyframes text-wave-ripple {
  0%, 100% { transform: translateY(0); }
  45% { transform: translateY(-4px); }
}
@media (hover: hover) and (pointer: fine) {
  .nav-inner a:hover { transform: translateY(-4px); }
  .nav-inner a:hover .text-wave-char,
  .sec-title-link:hover .text-wave-char {
    animation: text-wave-ripple var(--motion-wave) var(--ease-bounce);
    animation-delay: calc(var(--wave-index) * 28ms);
  }
  .game-card:hover .card-body h3 { color: var(--primary); }
}
.game-card:focus-visible .card-body h3 { color: var(--primary); }
.nav-inner a:focus-visible { transform: translateY(-4px); }
.nav-inner a:focus-visible .text-wave-char,
.sec-title-link:focus-visible .text-wave-char {
  animation: text-wave-ripple var(--motion-wave) var(--ease-bounce);
  animation-delay: calc(var(--wave-index) * 28ms);
}

/* ============ 主体布局 ============ */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  padding-top: 20px;
  padding-bottom: 32px;
  align-items: start;
}
.main-col { min-width: 0; }

.sec { margin-bottom: 28px; }
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  border-left: 4px solid var(--primary);
  padding-left: 10px;
}
.sec-title { font-size: 19px; font-weight: 700; color: var(--primary); }
.more { font-size: 13px; color: var(--text-2); }
.more:hover { color: var(--primary); }

/* ============ 游戏卡片 ============ */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 16px;
}
.game-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.18s, box-shadow 0.18s;
  display: flex;
  flex-direction: column;
}
.game-card .cover { position: relative; aspect-ratio: 460 / 215; background: var(--chip-bg); overflow: hidden; }
/* 图片比容器大 2px 并负边距居中，消除缩放时边缘露出的浅色细缝 */
.game-card .cover img {
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  margin: -1px;
  object-fit: cover;
  object-position: center;
  display: block;
}
.badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  padding: 2px 8px;
  border-radius: 6px;
}
.badge-new { background: var(--primary); color: var(--on-primary); }
.badge-upd { background: #f59e0b; left: auto; right: 8px; }
.badge-rec {
  top: auto;
  left: auto;
  bottom: 8px;
  right: 8px;
  background: rgba(76, 175, 80, 0.6);
  color: #fff;
  font-weight: 700;
  border-radius: 4px;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-body h3 {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--motion-fast) var(--ease-standard);
}
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--chip-bg);
  color: var(--text-2);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
}
.chip-cat { background: var(--primary-soft); color: var(--primary); }
.chip i { font-style: normal; opacity: 0.7; }
.chip-link:hover { background: var(--primary); color: var(--on-primary); }
.chip-link.on { background: var(--primary); color: var(--on-primary); }
.meta {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: var(--text-2);
  margin-top: auto;
}

/* ============ 列表头 / 筛选 / 排序 ============ */
.list-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; }
.list-title { font-size: 20px; font-weight: 700; }
.list-title small { font-size: 13px; color: var(--text-2); font-weight: 400; margin-left: 6px; }
.sort-bar { display: flex; align-items: center; gap: 6px; margin-left: auto; font-size: 13px; color: var(--text-2); }
.sort-bar a { padding: 3px 10px; border-radius: 6px; }
.sort-bar a:hover { color: var(--primary); }
.sort-bar a.on { background: var(--primary); color: var(--on-primary); }
.tag-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }

/* ============ 分页 ============ */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 24px 0 8px; }
.page-btn {
  min-width: 36px;
  text-align: center;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 14px;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.current { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 700; }
.page-dots { padding: 6px 4px; color: var(--text-2); }

/* ============ 侧栏 ============ */
.sidebar { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 130px; }
.side-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.side-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; border-left: 4px solid var(--primary); padding-left: 8px; }
.hot-list { list-style: none; }
.hot-list li + li { margin-top: 8px; }
.hot-list a { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.hot-list a:hover .hot-title { color: var(--primary); }
.rank {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  font-size: 12px;
  border-radius: 6px;
  background: var(--chip-bg);
  color: var(--text-2);
}
.rank-1, .rank-2, .rank-3 { background: var(--primary); color: var(--on-primary); }
.rank-2 { opacity: 0.85; }
.rank-3 { opacity: 0.7; }
.hot-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hot-views { font-size: 12px; color: var(--text-2); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }

/* ============ 详情页 ============ */
.breadcrumb { font-size: 13px; color: var(--text-2); margin-bottom: 14px; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--text); font-weight: 600; }

/* 详情页悬浮返回按钮：初始隐藏，路径行滚出视口后从顶部滑入 */
.back-bar {
  position: fixed;
  left: max(16px, calc(50% - 584px));
  top: calc(var(--header-h, 112px) + 10px);
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  padding: 10px 22px;
  border: none;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-14px) scale(0.96);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 40%, transparent),
    0 0 16px color-mix(in srgb, var(--primary) 55%, transparent),
    0 14px 30px -18px color-mix(in srgb, var(--primary) 70%, transparent);
  transition: opacity var(--motion-med) var(--ease-standard),
    transform var(--motion-med) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard);
}
.back-bar svg { width: 18px; height: 18px; flex: 0 0 18px; display: block; }
.back-bar-text { flex: 0 0 auto; white-space: nowrap; }
.back-bar.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  animation: backBarGlow 2.6s ease-in-out 0.3s infinite;
}
.back-bar.is-visible:hover {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 55%, transparent),
    0 0 26px color-mix(in srgb, var(--primary) 80%, transparent),
    0 18px 34px -16px color-mix(in srgb, var(--primary) 85%, transparent);
}
.back-bar.is-visible:active { transform: translateY(0) scale(0.97); }
/* 主题色辉光呼吸 */
@keyframes backBarGlow {
  0%, 100% {
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 40%, transparent),
      0 0 14px color-mix(in srgb, var(--primary) 50%, transparent),
      0 14px 30px -18px color-mix(in srgb, var(--primary) 70%, transparent);
  }
  50% {
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 60%, transparent),
      0 0 26px color-mix(in srgb, var(--primary) 82%, transparent),
      0 14px 30px -18px color-mix(in srgb, var(--primary) 70%, transparent);
  }
}
@media (max-width: 640px) {
  .back-bar { font-size: 13px; padding: 9px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-inner a { animation: none; }
  .back-bar { transition: opacity var(--motion-fast) linear; transform: translateY(0) scale(1); }
  .back-bar.is-visible { animation: none; }
}
.detail-card {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.detail-cover { position: relative; aspect-ratio: 460 / 215; border-radius: 8px; overflow: hidden; background: var(--chip-bg); }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-info h1 { font-size: 22px; line-height: 1.4; margin-bottom: 10px; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.info-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.info-table th, .info-table td { text-align: left; padding: 7px 10px; border-bottom: 1px dashed var(--border); }
.info-table th { color: var(--text-2); font-weight: 400; width: 90px; white-space: nowrap; }

.dl-box, .content-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.box-title { font-size: 17px; font-weight: 700; margin-bottom: 12px; border-left: 4px solid var(--primary); padding-left: 8px; }
.dl-tip { font-size: 13px; color: var(--text-2); margin-bottom: 12px; }
.dl-row {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.dl-row + .dl-row { margin-top: 10px; }
.dl-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.dl-url {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.dl-url-label {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-2);
}
.dl-url-input {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--text-2);
  background: var(--chip-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: text;
}
.video-tip { margin-top: 10px; font-size: 12px; color: var(--text-2); }
.video-tip a { color: var(--primary); }
.pan-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
}
.pan-ico { width: 14px; height: 14px; flex: 0 0 14px; display: block; }
/* 各网盘品牌色 */
.pan-badge[data-pan="夸克网盘"] { background: linear-gradient(135deg, #2ee6a8, #12b7d8); }
.pan-badge[data-pan="百度网盘"] { background: linear-gradient(135deg, #4b6bff, #2932e1); }
.pan-badge[data-pan="迅雷网盘"] { background: linear-gradient(135deg, #4aa8ff, #1667d9); }
.pan-badge[data-pan="移动云盘"] { background: linear-gradient(135deg, #46c2ff, #1890d7); }
.pan-badge[data-pan="在线试玩"] { background: #1677ff; }
.pan-badge[data-pan="其它"] { background: #6b7280; }
.dl-link {
  background: var(--primary);
  color: #fff;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
}
.dl-link:hover { background: var(--primary-dark); }
.dl-link.dl-trial { background: #1677ff; }
.dl-link.dl-trial:hover { background: #0958d9; }
.dl-code { font-size: 13px; color: var(--text-2); }
.dl-code b { color: var(--text); margin-right: 6px; }
.copy-btn {
  background: var(--chip-bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 6px;
}
.copy-btn:hover { color: var(--primary); border-color: var(--primary); }
.dl-note { font-size: 12px; color: var(--text-2); margin-left: auto; }
.content-box p { margin-bottom: 10px; }
.req {
  font: 13px/1.8 ui-monospace, SFMono-Regular, Consolas, "Microsoft YaHei", monospace;
  white-space: pre-wrap;
  background: var(--chip-bg);
  border-radius: 8px;
  padding: 14px;
}
.shot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.shot { aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--chip-bg); cursor: zoom-in; }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s; }
.video-box {
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
  max-height: 520px;
}
.video-box video { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ============ 页脚 / 悬浮按钮 / 提示 ============ */
.site-footer { border-top: 1px solid var(--border); background: var(--header-bg); padding: 26px 0; margin-top: 10px; }
.friend-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-bottom: 12px; font-size: 13px; }
.friend-links-label { font-weight: 700; color: var(--text); }
.friend-links a { color: var(--text-2); }
.friend-links a:hover { color: var(--primary); }
.footer-text { font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.copyright { font-size: 13px; color: var(--text-2); text-align: center; }
.copyright a:hover { color: var(--primary); }
.float-btns { position: fixed; right: 16px; bottom: 80px; display: flex; flex-direction: column; gap: 10px; z-index: 60; }
.float-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
}
.float-btn:hover { color: var(--primary); border-color: var(--primary); }
#backTop { opacity: 0; pointer-events: none; transition: opacity 0.25s; }
#backTop.show { opacity: 1; pointer-events: auto; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20, 20, 22, 0.88);
  color: #fff;
  font-size: 14px;
  padding: 9px 20px;
  border-radius: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.not-found { text-align: center; padding: 90px 0; }
.not-found h1 { font-size: 64px; color: var(--primary); }
.not-found p { color: var(--text-2); margin: 10px 0 24px; }
.btn-primary {
  display: inline-block;
  background: var(--primary);
  color: var(--on-primary);
  border: none;
  padding: 9px 22px;
  border-radius: 8px;
  font-weight: 600;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-block { width: 100%; }

/* ============ 后台 ============ */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.theme-card {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.theme-card input { width: 16px; height: 16px; accent-color: var(--primary); }
.theme-swatch { width: 20px; height: 20px; border-radius: 50%; background: var(--swatch); flex-shrink: 0; }
.theme-name { color: var(--text); font-size: 14px; }
.theme-card:hover { border-color: var(--primary); }
.theme-card:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }

.admin-body { background: var(--bg); }
.admin-top { background: #0e1820; color: #dce5ee; border-bottom: 1px solid rgba(184, 216, 223, 0.08); }
.admin-top-inner { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.admin-brand { font-weight: 800; font-size: 17px; color: #fff; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 2px; }
.admin-nav a { padding: 6px 12px; border-radius: 8px; font-size: 14px; color: #b9bfc9; }
.admin-nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.admin-nav a.active { color: var(--on-primary); background: var(--primary); }
.admin-user { margin-left: auto; display: flex; gap: 12px; font-size: 13px; }
.admin-user a { color: #b9bfc9; }
.admin-user a:hover { color: #fff; }
.admin-main { padding-top: 22px; padding-bottom: 40px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.admin-head h1 { font-size: 21px; }
.admin-head small { font-size: 13px; color: var(--text-2); font-weight: 400; }
.admin-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-card b { display: block; font-size: 26px; color: var(--primary); }
.stat-card span { font-size: 13px; color: var(--text-2); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.admin-table th { color: var(--text-2); font-weight: 500; white-space: nowrap; }
.admin-table a:hover { color: var(--primary); }
.admin-table input { padding: 5px 8px; width: 100%; max-width: 220px; }
/* 访问统计 */
.admin-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.admin-row .admin-box { margin-bottom: 16px; }
.path-cell { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.empty { color: var(--text-2); text-align: center; padding: 18px 0; }
.chart { display: flex; align-items: flex-end; gap: 8px; height: 190px; padding-top: 10px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; }
.chart-val { font-size: 11px; color: var(--text-2); margin-bottom: 4px; }
.chart-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.chart-bar { width: 46%; max-width: 18px; background: var(--primary); border-radius: 3px 3px 0 0; min-height: 2px; opacity: 0.9; }
.chart-bar.uv { background: #f59e0b; opacity: 0.75; }
.chart-label { font-size: 11px; color: var(--text-2); margin-top: 6px; }
.chart-legend { font-size: 12px; color: var(--text-2); margin-top: 12px; display: flex; align-items: center; gap: 6px; }
.chart-legend .dot { width: 9px; height: 9px; border-radius: 2px; background: var(--primary); display: inline-block; }
.chart-legend .dot.uv { background: #f59e0b; margin-left: 10px; }
@media (max-width: 820px) { .admin-row { grid-template-columns: 1fr; } }
.thumb { width: 42px; height: 56px; object-fit: cover; border-radius: 6px; background: var(--chip-bg); }
.status { display: inline-block; white-space: nowrap; font-size: 12px; padding: 2px 10px; border-radius: 10px; }
.status.published { background: rgba(34, 197, 94, 0.14); color: #16a34a; }
.status.draft { background: var(--chip-bg); color: var(--text-2); }
.mini-badge { font-size: 11px; background: var(--primary); color: var(--on-primary); border-radius: 4px; padding: 0 5px; margin-left: 4px; }
.mini-badge.upd { background: #f59e0b; }
.btn-sm {
  display: inline-block;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 6px;
}
.btn-sm:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger:hover { border-color: #dc2626; color: #dc2626; }
.inline-form { display: inline; }
.ops-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.ops-row .inline-form { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.ops-row input[type="text"] { margin: 0; }
.ops { white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.admin-table .col-cat { white-space: nowrap; }
.admin-table .col-rec { text-align: center; }
.switch { position: relative; display: inline-block; width: 38px; height: 20px; vertical-align: middle; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-slider { position: absolute; inset: 0; background: #cbd5e1; border-radius: 999px; transition: background .2s ease; }
.switch-slider::before { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s ease; }
.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }
.switch input:focus-visible + .switch-slider { outline: 2px solid var(--primary); outline-offset: 2px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.filter-bar input { min-width: 220px; }
.admin-form label { display: flex; flex-direction: column; gap: 5px; font-size: 14px; color: var(--text-2); margin-bottom: 14px; }
.admin-form .label-text { font-size: 14px; color: var(--text-2); margin-bottom: 5px; display: block; }
.admin-form label i { color: var(--primary); font-style: normal; }
.form-row { display: flex; flex-wrap: wrap; gap: 14px; }
.form-row > label { flex: 1; min-width: 160px; }
.form-row .grow { flex: 2; }
.form-row.checks { align-items: center; gap: 22px; margin-bottom: 14px; }
.form-row.checks label { flex-direction: row; align-items: center; gap: 6px; margin-bottom: 0; }
.tag-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.tag-checks label { flex-direction: row !important; align-items: center; gap: 5px; margin-bottom: 0 !important; }
.cover-preview { width: 150px; border-radius: 8px; overflow: hidden; margin-bottom: 12px; border: 1px solid var(--border); }
.dl-edit-row, .shot-edit-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.dl-edit-row select { width: 110px; flex-shrink: 0; }
.dl-edit-row input[type="url"] { flex: 1; min-width: 0; }
.dl-edit-row .w-code { width: 100px; flex-shrink: 0; }
.dl-edit-row .w-note { width: 150px; flex-shrink: 0; }
.shot-edit-row input { flex: 1; }
.row-del {
  background: var(--chip-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 34px;
  height: 34px;
  font-size: 16px;
  color: var(--text-2);
  flex-shrink: 0;
}
.row-del:hover { color: #dc2626; border-color: #dc2626; }
.shot-edit-list { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.shot-edit-item { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
.shot-edit-item img { width: 160px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }

/* 游戏介绍 / 配置要求大编辑框（宽 1100px、高 350px，窄屏自动收缩） */
.admin-form .big-editor { width: 1100px; max-width: 100%; height: 350px; resize: vertical; }

/* 友情链接管理 */
.fl-list { display: flex; flex-direction: column; gap: 8px; }
.fl-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--chip-bg); }
.fl-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1; min-width: 260px; }
.fl-form input[type="text"] { flex: 1; min-width: 120px; max-width: 220px; }
.fl-form input[type="url"] { flex: 2; min-width: 180px; }
.fl-form .w-sort { width: 90px; }
.backup-actions { display: flex; flex-wrap: wrap; gap: 10px; }
/* 登录验证码 */
.captcha-row { display: flex; gap: 8px; align-items: center; }
.captcha-row input { flex: 1; min-width: 0; }
.captcha-img { width: 120px; height: 44px; border-radius: 6px; border: 1px solid var(--border); cursor: pointer; flex-shrink: 0; }
.admin-who { font-size: 12px; color: var(--text-2); margin-right: 4px; }
.shot-edit-item span { display: flex; align-items: center; gap: 5px; }
.form-actions { display: flex; gap: 12px; align-items: center; }
.form-error {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.4);
  color: #dc2626;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 14px;
}
.form-ok {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #16a34a;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 14px;
}
.inline-create { display: flex; flex-wrap: wrap; gap: 10px; }
.inline-create input { min-width: 180px; }
.code-block {
  background: var(--chip-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  overflow-x: auto;
  white-space: pre;
  user-select: all;
}

/* 采集导入 */
.hint { font-size: 13px; color: var(--text-2); line-height: 1.7; margin-bottom: 12px; }
.hint b { color: var(--text); font-weight: 600; }
.logo-preview {
  background: var(--chip-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 14px;
  display: inline-block;
}
.logo-preview img { max-height: 72px; width: auto; max-width: 240px; object-fit: contain; }
.import-form { margin-top: 6px; }
.import-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.import-head .box-title { margin-bottom: 0; }
.import-head small { font-size: 13px; color: var(--text-2); font-weight: 400; margin-left: 6px; }
.import-tools { display: flex; gap: 8px; margin-bottom: 12px; }
.import-table .thumb.wide { width: 72px; height: 48px; }
.import-table tr.is-imported td { opacity: 0.55; }
.import-table input[type="checkbox"] { width: 16px; height: 16px; padding: 0; }

/* 图片本地化 */
.localize-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 13px;
  color: var(--text-2);
  margin: 4px 0 14px;
}
.localize-stats b { color: var(--primary); font-size: 15px; margin: 0 2px; }
.localize-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.localize-actions button:disabled { opacity: 0.5; cursor: not-allowed; }
.localize-progress { margin-top: 14px; }
.progress {
  height: 8px;
  border-radius: 4px;
  background: var(--chip-bg);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0;
  background: var(--primary);
  transition: width 0.3s;
}
.progress-text { font-size: 12px; color: var(--text-2); margin-top: 6px; }

/* 登录页 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 28px;
  box-shadow: var(--shadow-hover);
}
.login-title { text-align: center; color: var(--primary); font-size: 24px; }
.login-sub { text-align: center; color: var(--text-2); font-size: 14px; margin: 6px 0 22px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text-2); margin-bottom: 16px; }
.login-back { text-align: center; margin-top: 16px; font-size: 13px; }
.login-back a { color: var(--text-2); }
.login-back a:hover { color: var(--primary); }

/* ============ 响应式 ============ */
@media (max-width: 960px) {
  /* minmax(0,1fr)：避免内容最小宽度把轨道撑开，导致整页横向溢出 */
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; min-width: 0; }
}
@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; gap: 10px; }
  .search { order: 3; max-width: none; flex-basis: 100%; }
  .nav-toggle { display: block; margin-left: auto; }
  .site-nav {
    display: block;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: max-height var(--motion-med) var(--ease-standard),
      opacity var(--motion-fast) var(--ease-standard),
      visibility 0s linear var(--motion-med);
  }
  .site-nav.open {
    max-height: 70vh;
    overflow-y: auto;
    opacity: 1;
    visibility: visible;
    transition: max-height var(--motion-med) var(--ease-standard),
      opacity var(--motion-fast) var(--ease-standard), visibility 0s;
  }
  .nav-inner { flex-direction: column; align-items: stretch; padding-bottom: 10px; }
  /* 手机端改为一列：minmax(0,1fr) 避免封面图固有宽度撑破轨道导致横向溢出 */
  .game-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .detail-card { grid-template-columns: 1fr; }
  .detail-cover { max-width: 260px; }
  .list-head { flex-direction: column; align-items: flex-start; }
  .sort-bar { margin-left: 0; }
  .dl-note { margin-left: 0; flex-basis: 100%; }
  .dl-edit-row { flex-wrap: wrap; }
  .dl-edit-row input[type="url"] { flex-basis: 100%; }
  .float-btns { bottom: 30px; }
  .logo-title-img { height: 36px; max-width: 190px; }
}

/* ============ 参考站配色补充（毛玻璃头部 / 柔和描边） ============ */
.site-header {
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
}
.game-card,
.detail-card,
.dl-box,
.content-box,
.side-box,
.admin-box {
  border-color: var(--border);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
[data-theme="light"] .game-card,
[data-theme="light"] .detail-card,
[data-theme="light"] .dl-box,
[data-theme="light"] .content-box,
[data-theme="light"] .side-box,
[data-theme="light"] .admin-box {
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.sec-head,
.box-title,
.side-title { border-left-color: var(--primary); }
.footer-text,
.copyright { color: var(--text-2); }

/* ============ 后台：站名 Logo 预览 ============ */
.logo-preview-title img {
  max-height: 44px;
  max-width: 240px;
  width: auto;
  object-fit: contain;
}

/* ============ 前台：访客留言 ============ */
.float-btn.msg-toggle.on { color: var(--primary); border-color: var(--primary); }
.msg-panel {
  position: fixed;
  right: 16px;
  bottom: 140px;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  padding: 14px;
  z-index: 70;
}
.msg-panel[hidden] { display: none; }
.msg-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
}
.msg-close {
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 20px;
  line-height: 1;
  padding: 0 4px;
}
.msg-close:hover { color: var(--primary); }
.msg-panel textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  font-size: 14px;
}
.msg-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}
.msg-count { font-size: 12px; color: var(--text-2); }
.msg-submit { padding: 7px 18px; border-radius: 8px; border: none; }

/* ============ 后台：页头操作区 ============ */
.head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}
.head-actions .hint { margin: 0; }
.msg-content { white-space: pre-wrap; word-break: break-word; }
.kw-cloud {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.kw-label { font-size: 13px; color: var(--text-2); }
.kw-cloud .chip i { font-style: normal; opacity: 0.7; }

/* ============ 后台：版本信息与更新记录 ============ */
.version-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 16, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
}
.modal-mask[hidden] { display: none; }
.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  width: 560px;
  max-width: 100%;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}
.modal-close {
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 22px;
  line-height: 1;
  padding: 0 4px;
}
.modal-close:hover { color: var(--primary); }
.modal-body {
  padding: 16px 18px 20px;
  overflow-y: auto;
}
.ver-item + .ver-item {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}
.ver-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 14px;
  margin-bottom: 6px;
}
.ver-head span { font-size: 12px; color: var(--text-2); }
.ver-item ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.8;
}

/* ============ 前台：轻量动效 ============ */
.nav-inner a,
.more,
.sort-bar a,
.chip-link,
.page-btn,
.hot-title,
.friend-links a,
.breadcrumb a,
.video-tip a,
.dl-link,
.copy-btn,
.search button,
.btn-primary,
.float-btn,
.msg-close {
  transition: color var(--motion-fast) var(--ease-standard),
    background-color var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard),
    opacity var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

/* 卡片与截图：仅桌面精确指针启用悬停位移 */
.game-card {
  transition: transform var(--motion-med) var(--ease-standard),
    box-shadow var(--motion-med) var(--ease-standard);
}
.game-card .cover img,
.shot img { transition: transform var(--motion-med) var(--ease-standard); }
.game-card:focus-visible,
.shot:focus-visible {
  outline: 3px solid var(--primary-soft);
  outline-offset: 3px;
}
.game-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}
.game-card:focus-visible .cover img,
.shot:focus-visible img { transform: scale(1.05); }
@media (hover: hover) and (pointer: fine) {
  .game-card:hover {
    position: relative;
    z-index: 2;
    transform: translateY(-4px) scale(1.05);
    animation: cardGlow 2.4s ease-in-out infinite;
  }
  .game-card:hover .cover img { transform: scale(1.1); }
  .shot:hover img { transform: scale(1.05); }
}
/* 卡片悬停时的主题色呼吸发光 */
@keyframes cardGlow {
  0%, 100% {
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.16), 0 4px 10px rgba(0, 0, 0, 0.1),
      0 0 18px color-mix(in srgb, var(--primary) 32%, transparent),
      0 0 36px color-mix(in srgb, var(--primary) 18%, transparent);
  }
  50% {
    box-shadow: 0 20px 36px rgba(0, 0, 0, 0.2), 0 6px 14px rgba(0, 0, 0, 0.12),
      0 0 46px color-mix(in srgb, var(--primary) 78%, transparent),
      0 0 84px color-mix(in srgb, var(--primary) 42%, transparent);
  }
}
@media (prefers-reduced-motion: reduce) {
  .game-card:hover { animation: none; }
}

/* 吸顶头部滚动层次 */
.site-header {
  transition: box-shadow var(--motion-med) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    background-color var(--motion-fast) var(--ease-standard);
}
.site-header.is-scrolled { box-shadow: 0 12px 30px -22px rgba(22, 32, 26, 0.48); }
[data-theme="dark"] .site-header.is-scrolled {
  box-shadow: 0 14px 32px -22px rgba(0, 0, 0, 0.86);
}

/* 移动端汉堡菜单变形 */
.nav-toggle {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
}
.nav-toggle-line {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 2px;
  margin: -1px 0 0 -11px;
  border-radius: 2px;
  background: currentColor;
  transition: transform var(--motion-med) var(--ease-standard),
    opacity var(--motion-fast) var(--ease-standard);
}
.nav-toggle-line:nth-child(1) { transform: translateY(-6px); }
.nav-toggle-line:nth-child(3) { transform: translateY(6px); }
.nav-toggle[aria-expanded="true"] { color: var(--primary); }
.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(1) { transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0.4);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(3) { transform: rotate(-45deg); }

/* 深浅主题图标交叉淡化 */
.theme-toggle { position: relative; }
.theme-toggle .icon-moon,
.theme-toggle .icon-sun {
  display: block;
  position: absolute;
  inset: 0;
  margin: auto;
  transition: opacity var(--motion-fast) var(--ease-standard),
    transform var(--motion-med) var(--ease-standard);
}
.theme-toggle .icon-moon { opacity: 1; transform: rotate(0) scale(1); }
.theme-toggle .icon-sun { opacity: 0; transform: rotate(-45deg) scale(0.65); }
[data-theme="dark"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(45deg) scale(0.65); }
[data-theme="dark"] .theme-toggle .icon-sun { opacity: 1; transform: rotate(0) scale(1); }

/* 主操作点击波纹与复制成功反馈 */
.has-ripple { position: relative; overflow: hidden; }
.dl-link.has-ripple,
.copy-btn.has-ripple { display: inline-flex; align-items: center; justify-content: center; }
.ripple-ink {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.2;
  pointer-events: none;
  transform: scale(0);
  animation: ripple-out var(--motion-ripple) var(--ease-standard) forwards;
}
.copy-btn.is-copied {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-soft);
}
@keyframes ripple-out {
  to { opacity: 0; transform: scale(1); }
}

/* 游戏截图 Lightbox：默认居中窗口，最大化由用户主动选择 */
body.shot-lightbox-active { overflow: hidden; }
.shot-lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--motion-med) var(--ease-standard);
}
.shot-lightbox[hidden] { display: none; }
.shot-lightbox.is-open { opacity: 1; }
.shot-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 8, 12, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background-color var(--motion-med) var(--ease-standard);
}
.shot-lightbox-window {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1150px, calc(100vw - 64px));
  max-height: calc(100vh - 64px);
  max-height: calc(100dvh - 64px);
  overflow: hidden;
  background: #0a1117;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.46);
  transform: translateY(10px) scale(0.985);
  transition: transform var(--motion-med) var(--ease-standard);
}
.shot-lightbox.is-open .shot-lightbox-window { transform: translateY(0) scale(1); }
.shot-lightbox-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 60px;
  padding: 6px 10px 6px 16px;
  color: #f5f7f8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}
.shot-lightbox-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
}
.shot-lightbox-count {
  flex: 0 0 auto;
  color: rgba(245, 247, 248, 0.68);
  font: 13px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}
.shot-lightbox-close,
.shot-lightbox-maximize,
.shot-lightbox-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  color: #f5f7f8;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  transition: color var(--motion-fast) var(--ease-standard),
    background-color var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}
.shot-lightbox-close:hover,
.shot-lightbox-maximize:hover,
.shot-lightbox-nav:hover {
  color: var(--on-primary);
  background: var(--primary);
  border-color: var(--primary);
}
.shot-lightbox-close:active,
.shot-lightbox-maximize:active { transform: scale(0.94); }
.shot-lightbox-close:focus-visible,
.shot-lightbox-maximize:focus-visible,
.shot-lightbox-nav:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}
.shot-lightbox-close[hidden],
.shot-lightbox-maximize[hidden],
.shot-lightbox-nav[hidden] { display: none; }
.shot-lightbox-restore-icon { display: none; }
.shot-lightbox.is-maximized .shot-lightbox-maximize-icon { display: none; }
.shot-lightbox.is-maximized .shot-lightbox-restore-icon { display: block; }
.shot-lightbox-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 48px;
  height: 48px;
  transform: translateY(-50%);
}
.shot-lightbox-nav:active { transform: translateY(-50%) scale(0.94); }
.shot-lightbox-prev { left: 14px; }
.shot-lightbox-next { right: 14px; }
.shot-lightbox-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  width: 100%;
  height: min(72vh, 800px);
  height: min(72dvh, 800px);
  min-height: 220px;
  padding: 18px 72px;
  user-select: none;
  touch-action: pan-y;
}
.shot-lightbox-image {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.36);
  opacity: 1;
  transform: scale(1);
  transition: opacity var(--motion-med) var(--ease-standard),
    transform var(--motion-med) var(--ease-standard);
}
.shot-lightbox:not(.is-open) .shot-lightbox-image { opacity: 0.6; transform: scale(0.97); }
.shot-lightbox-thumbs {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  width: 100%;
  padding: 10px 72px 12px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 247, 248, 0.28) transparent;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.shot-lightbox-thumbs[hidden] { display: none; }
.shot-lightbox-thumbs::-webkit-scrollbar { height: 4px; }
.shot-lightbox-thumbs::-webkit-scrollbar-track { background: transparent; }
.shot-lightbox-thumbs::-webkit-scrollbar-thumb {
  background: rgba(245, 247, 248, 0.28);
  border-radius: 4px;
}
.shot-lightbox-thumb {
  position: relative;
  flex: 0 0 calc((100% - 48px) / 7);
  aspect-ratio: 16 / 9;
  padding: 0;
  overflow: hidden;
  background: #111e27;
  border: 2px solid transparent;
  border-radius: 6px;
  opacity: 0.58;
  transition: opacity var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard);
}
.shot-lightbox-thumb:hover { opacity: 0.9; }
.shot-lightbox-thumb.is-active {
  border-color: var(--primary);
  opacity: 1;
  box-shadow: 0 0 0 1px var(--primary);
}
.shot-lightbox-thumb:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  opacity: 1;
}
.shot-lightbox-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.shot-lightbox-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  color: rgba(245, 247, 248, 0.52);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
}
.shot-lightbox.is-maximized .shot-lightbox-window {
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  border-width: 0;
  border-radius: 0;
}
.shot-lightbox.is-maximized .shot-lightbox-stage {
  height: auto;
  min-height: 0;
  padding: 16px 80px 20px;
}
@media (max-width: 640px) {
  .shot-lightbox-window {
    width: calc(100vw - 28px);
    max-height: calc(100dvh - 28px);
    border-radius: 10px;
  }
  .shot-lightbox-head { gap: 8px; flex-basis: 56px; padding: 6px 8px 6px 12px; }
  .shot-lightbox-title { font-size: 12px; }
  .shot-lightbox-count { font-size: 12px; }
  .shot-lightbox-stage { height: 62dvh; min-height: 180px; padding: 12px 44px; }
  .shot-lightbox-thumbs { gap: 6px; padding: 8px 12px 10px; }
  .shot-lightbox-thumb {
    flex-basis: calc((100% - 24px) / 5);
    height: 44px;
    aspect-ratio: auto;
    border-radius: 5px;
  }
  .shot-lightbox-prev { left: 8px; }
  .shot-lightbox-next { right: 8px; }
  .shot-lightbox-nav { background: rgba(10, 17, 23, 0.68); }
  .shot-lightbox-hint { display: none; }
  .shot-lightbox.is-maximized .shot-lightbox-stage { padding: 12px 48px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
  .game-card:hover,
  .game-card:focus-visible,
  .game-card:hover .cover img,
  .game-card:focus-visible .cover img,
  .shot:hover img,
  .shot:focus-visible img { transform: none; }
  .nav-inner a:hover,
  .nav-inner a:focus-visible { transform: none; }
  .nav-inner a:hover .text-wave-char,
  .nav-inner a:focus-visible .text-wave-char,
  .sec-title-link:hover .text-wave-char,
  .sec-title-link:focus-visible .text-wave-char {
    animation: none;
    transform: none;
  }
  .ripple-ink { display: none; }
}


/* ============ 前台：主题配色选择 ============ */
.float-btn.color-toggle.on { color: var(--primary); border-color: var(--primary); }
.color-panel { width: 248px; bottom: 250px; }
.color-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.color-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-2, rgba(0, 0, 0, 0.03));
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  text-align: left;
  transition: border-color 0.2s, background-color 0.2s;
}
.color-opt:hover { border-color: var(--primary); }
.color-opt.on {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 600;
}
.color-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 25%, transparent);
  flex: none;
}
.color-reset {
  width: 100%;
  margin-top: 10px;
  padding: 7px 10px;
  background: none;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-2);
  font-size: 12px;
}
.color-reset:hover { color: var(--primary); border-color: var(--primary); }

/* ============ 后台：音效管理 ============ */
.sfx-row { align-items: flex-start; }
.sfx-field { display: flex; gap: 8px; align-items: center; }
.sfx-field select { flex: 1; min-width: 0; }
.sfx-field .btn-sm { flex: none; white-space: nowrap; }

/* ============ 后台：内容待完善筛选 ============ */
.filter-bar .todo-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-2);
  white-space: nowrap;
}
.filter-bar .todo-check input { min-width: 0; }
a.stat-card { display: block; transition: border-color var(--motion-fast); }
a.stat-card:hover { border-color: var(--primary); }

@media (max-width: 720px) {
  .color-panel { bottom: 210px; }
}

/* ============ 前台右下角悬浮按钮：彩色渐变 ============ */
.float-btn.start-link {
  background: linear-gradient(140deg, #22d3ee, #2563eb);
  box-shadow: 0 10px 24px -10px rgba(37, 99, 235, .75);
}
.float-btn.color-toggle {
  background: linear-gradient(140deg, #f472b6, #8b5cf6 55%, #38bdf8);
  box-shadow: 0 10px 24px -10px rgba(139, 92, 246, .75);
}
.float-btn.msg-toggle {
  background: linear-gradient(140deg, #fbbf24, #f97316);
  box-shadow: 0 10px 24px -10px rgba(249, 115, 22, .75);
}
.float-btn.theme-toggle {
  background: linear-gradient(140deg, #818cf8, #4f46e5);
  box-shadow: 0 10px 24px -10px rgba(79, 70, 229, .75);
}
#backTop {
  background: linear-gradient(140deg, #34d399, #0d9488);
  box-shadow: 0 10px 24px -10px rgba(13, 148, 136, .7);
}
.float-btn.start-link,
.float-btn.color-toggle,
.float-btn.msg-toggle,
.float-btn.theme-toggle,
#backTop {
  border: 0;
  color: #fff;
}
.float-btn.start-link:hover,
.float-btn.color-toggle:hover,
.float-btn.msg-toggle:hover,
.float-btn.theme-toggle:hover,
#backTop:hover {
  color: #fff;
  transform: translateY(-2px) scale(1.05);
  filter: brightness(1.07);
}
.float-btn.msg-toggle.on,
.float-btn.color-toggle.on {
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .5), 0 12px 26px -10px rgba(0, 0, 0, .4);
}
