/* 顶部安全距离：手机浏览器里封顶，装到桌面的应用（standalone）照实留 */
:root { --hub-safe-top: env(safe-area-inset-top, 0px); }
@media (max-width: 640px) and (display-mode: browser) {
  :root { --hub-safe-top: min(env(safe-area-inset-top, 0px), 24px); }
}

/* =========================================================
 * 小王桌游站 · 首页 v2（2026-10-21 重绘）
 * 叠在 style.css / skins.css 之后：只换外观，不动功能。
 * 主页元素一律用 #app / #topbar 前缀拿特异性，压过旧样式。
 * 回滚：删掉 index.html 里引用本文件的那一行（或运行备份目录里的 还原.py）。
 * ========================================================= */

:root {
  --bg: #f5f3ef;
  --bg-a: #f7f5f1;
  --bg-b: #efebe4;
  --panel: #ffffff;
  --panel-soft: #fbfaf7;
  --ink: #1d1b29;
  --ink-2: #3d3a4c;
  --muted: #7a7684;
  --brand: #4c3fd3;
  --brand-dark: #3a2fb0;
  --brand-soft: #efedfc;
  --brand-soft-hover: #e5e1fb;
  --brand-soft2: #f8f7fe;
  --brand-line: #d3cdf5;
  --gold: #b07a26;
  --gold-soft: #fbf2e1;
  --green: #1f9d63;
  --green-soft: #e2f5ec;
  --red: #c4432f;
  --line: #e8e4dc;
  --line-soft: #f0ece6;
  --shadow-tint: rgba(36, 28, 80, .06);
  --shadow-hero: rgba(36, 28, 80, .14);
  --shadow-focus: rgba(76, 63, 211, .16);
  --modal-scrim: rgba(22, 19, 40, .5);
  --toast-bg: #1d1b29;
  --v2-radius: 16px;
  --v2-ease: cubic-bezier(.2, .75, .25, 1);
  --v2-card-shadow: 0 1px 2px rgba(36, 28, 80, .04), 0 2px 10px -4px rgba(36, 28, 80, .08);
  --v2-card-shadow-hover: 0 2px 4px rgba(36, 28, 80, .04), 0 16px 34px -14px rgba(52, 40, 150, .32);
  --v2-topbar-h: 62px;
  --v2-gutter: clamp(16px, 3vw, 32px);
}

html { scroll-padding-top: calc(var(--v2-topbar-h) + 64px); -webkit-text-size-adjust: 100%; }

body {
  font-family: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(1200px 520px at 12% -8%, rgba(108, 92, 231, .10), transparent 60%),
    radial-gradient(900px 480px at 100% 0%, rgba(214, 160, 76, .10), transparent 62%),
    linear-gradient(180deg, var(--ap-page-bg, #f6f4f0) 0%, color-mix(in srgb, var(--ap-page-bg, #f6f4f0) 93%, #6b5a3a) 100%);
  background-attachment: fixed;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

/* 旧的城堡月亮场景不再用；站长选的动态壁纸保留，但罩一层纸色让内容更安静 */
#bg-scene { display: none !important; }
html.hub-bg-on #hub-bg-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ap-veil-bg, rgba(245, 243, 239, .5));
}

#app {
  max-width: 1280px;
  padding: 18px var(--v2-gutter) 10px;
}

/* ---------- 通用按钮 ---------- */
#app .btn, #topbar .btn {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-2);
  font-family: inherit;
  font-weight: 600;
  transition: background .18s var(--v2-ease), border-color .18s var(--v2-ease), box-shadow .18s var(--v2-ease), transform .18s var(--v2-ease), color .18s;
  -webkit-tap-highlight-color: transparent;
}
#app .btn:hover:not(:disabled), #topbar .btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--brand-line);
  box-shadow: 0 6px 16px -8px rgba(52, 40, 150, .35);
}
#app .btn:active:not(:disabled), #topbar .btn:active:not(:disabled) { transform: translateY(0) scale(.97); }
#app .btn.primary {
  background: linear-gradient(135deg, #5a4be0, #4234c4);
  border-color: transparent;
  color: #fff;
}
#app .btn.primary:hover:not(:disabled) { background: linear-gradient(135deg, #6656ea, #4a3bd0); }
#app .btn:focus-visible, #topbar .btn:focus-visible, #app a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ---------- 顶栏 ---------- */
#topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--v2-topbar-h);
  background: var(--ap-nav-bg, rgba(247, 245, 241, .55));
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
#topbar.scrolled {
  background: var(--ap-nav-bg, rgba(247, 245, 241, .7));
  border-bottom-color: var(--line);
  box-shadow: 0 6px 20px -16px rgba(36, 28, 80, .4);
}
#topbar .topbar-in {
  max-width: 1280px;
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--v2-gutter);
  display: flex;
  align-items: center;
  gap: 18px;
}
#topbar .tb-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  text-decoration: none;
  color: var(--ink);
}
#topbar .tb-brand img { width: 34px; height: 34px; object-fit: contain; display: block; }
#topbar .tb-name { font-weight: 800; font-size: 16px; letter-spacing: .5px; white-space: nowrap; }
#topbar .tb-search {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 40px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 2px rgba(36, 28, 80, .04);
  transition: border-color .18s, box-shadow .18s, background .18s;
  cursor: text;
}
#topbar .tb-search:focus-within {
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--shadow-focus);
}
#topbar .tb-search svg {
  width: 18px;
  height: 18px;
  margin: 0 8px 0 14px;
  flex: none;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
}
#topbar #quick-search {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent !important;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  padding-right: 8px;
}
#topbar #quick-search::placeholder { color: #a5a1ad; }
#topbar #quick-search::-webkit-search-cancel-button { cursor: pointer; }
#topbar .tb-kbd {
  flex: none;
  margin-right: 10px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--muted);
  font: 600 12px/20px ui-monospace, Consolas, monospace;
  text-align: center;
}
#topbar .tb-search:focus-within .tb-kbd { display: none; }
#topbar .tb-actions { flex: 0 0 auto; display: flex; gap: 8px; }
#topbar .tb-profile {
  height: 38px;
  padding: 0 16px;
  font-size: 14px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Hero ---------- */
#app .hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  text-align: left;
  color: #fff;
  border: 0;
  border-radius: 24px;
  padding: 34px 40px 30px;
  margin: 6px 0 22px;
  background-color: var(--ap-hero-fill-a, var(--ap-hero-a, #2a2370));
  background-image:
    radial-gradient(560px 300px at 88% 18%, var(--ap-hero-glow-a, rgba(255, 196, 110, .30)), transparent 60%),
    radial-gradient(520px 340px at 0% 110%, var(--ap-hero-glow-b, rgba(134, 112, 255, .55)), transparent 62%),
    linear-gradient(128deg, var(--ap-hero-fill-a, var(--ap-hero-a, #1f1a52)) 0%, var(--ap-hero-fill-mid, color-mix(in srgb, var(--ap-hero-a, #1f1a52) 50%, var(--ap-hero-b, #4a39c9))) 46%, var(--ap-hero-fill-b, var(--ap-hero-b, #4a39c9)) 100%);
  -webkit-backdrop-filter: blur(var(--ap-hero-blur, 0px));
  backdrop-filter: blur(var(--ap-hero-blur, 0px));
  box-shadow: 0 28px 60px -32px rgba(40, 30, 130, .65), inset 0 1px 0 rgba(255, 255, 255, .12);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "brand tools" "meta tools";
  column-gap: 24px;
  row-gap: 18px;
  align-items: end;
}
/* 背景纹理：骰点 + 棋格，极淡 */
#app .hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: var(--ap-hero-pattern-alpha, .55);
  background-image:
    radial-gradient(rgba(255, 255, 255, .16) 1.2px, transparent 1.4px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(105deg, transparent 30%, #000 75%);
  mask-image: linear-gradient(105deg, transparent 30%, #000 75%);
}
#app .hero::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -80px;
  width: 340px;
  height: 340px;
  z-index: -1;
  opacity: var(--ap-hero-decor-alpha, 1);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .10);
  box-shadow: 0 0 0 46px rgba(255, 255, 255, .03), 0 0 0 92px rgba(255, 255, 255, .025);
}
#app .hero-brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 0;
}
#app .hero-brand-mark {
  grid-column: auto;
  justify-self: auto;
  width: 84px;
  height: 84px;
  flex: 0 0 auto;
  transform: none;
  border-radius: 22px;
  padding: 10px;
  background: var(--ap-logo-tile-bg, rgba(255, 255, 255, .96)) !important;
  -webkit-backdrop-filter: blur(var(--ap-logo-tile-blur, 0px)) !important;
  backdrop-filter: blur(var(--ap-logo-tile-blur, 0px)) !important;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .45), inset 0 -2px 0 rgba(36, 28, 80, .08) !important;
  transition: transform .3s var(--v2-ease);
}
#app .hero-brand-mark:hover { transform: rotate(-4deg) scale(1.04); }
#app .hero-brand-mark img { object-fit: contain; }
#app .hero-brand-copy { text-align: left; min-width: 0; }
#app .hero-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #f2c47a;
  margin-bottom: 6px;
}
#app .hero-title {
  font-size: clamp(24px, 3.2vw, 34px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .25);
}
#app .hero-sub { color: rgba(236, 233, 255, .78); margin: 8px 0 0; }
#app .hero-sub span { font-size: 13px !important; letter-spacing: .5px; }
#app .hero-meta {
  grid-area: meta;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  font-size: 12.5px;
}
#app .hero-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .14);
  color: rgba(240, 238, 255, .86);
  white-space: nowrap;
}
#app .hero-meta > span:empty { display: none; }
#app .hero .conn-status.ok { color: #9ff0c6; font-weight: 700; }
#app .hero .conn-status.err { color: #ffb4a6; font-weight: 700; }
#app .hero .last-updated { color: rgba(240, 238, 255, .7); }
#app .hero .hero-stat { color: #fff; font-weight: 700; }
#app .hero .toolbar {
  grid-area: tools;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  gap: 10px;
}
#app .hero .hero-btn {
  height: 44px;
  padding: 0 20px;
  font-size: 14px;
  white-space: nowrap;
}
#app .hero #btn-random {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .22);
  color: #fff;
}
#app .hero #btn-random:hover:not(:disabled) { background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .4); }
#app .hero #btn-copy-page {
  background: linear-gradient(135deg, #ffd58f, #f2b04f);
  color: #2a1d05;
  border-color: transparent;
  box-shadow: 0 10px 24px -12px rgba(242, 176, 79, .9);
}
#app .hero #btn-copy-page:hover:not(:disabled) { background: linear-gradient(135deg, #ffe0a6, #f6bb63); }

/* ---------- 继续上一局 / 正在进行的游戏桌 / 快捷游戏 ---------- */
#app .resume-bar {
  border-radius: var(--v2-radius);
  border: 1px solid #ecd6a8;
  background: linear-gradient(110deg, #fffaf0, #fdf1d9);
  box-shadow: 0 10px 26px -18px rgba(176, 122, 38, .6);
  padding: 12px 16px;
  margin-bottom: 16px;
}
#app .active-tables,
#app .fav-section,
#app .report-panel,
#app .tips.panel,
#app .stats-table-wrap,
#app .search-panel {
  background: rgba(255, 255, 255, .82);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--v2-card-shadow);
}
#app .active-tables { padding: 16px 18px; margin-bottom: 16px; }
#app .at-title, #app .fav-section .group-title { font-size: 15px; font-weight: 800; color: var(--ink); padding-left: 0; }
#app .at-row {
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: var(--panel-soft);
}
#app .fav-section { padding: 14px 18px 16px; margin-bottom: 18px; }
#app .fav-cards { gap: 8px; }
#app .fav-card {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: none;
  transition: transform .18s var(--v2-ease), border-color .18s, box-shadow .18s;
}
#app .fav-card:not(.edit):hover { transform: translateY(-2px); border-color: var(--brand-line); box-shadow: 0 8px 18px -10px rgba(52, 40, 150, .45); }
#app .fav-card.edit { height: auto; border-radius: 14px; padding: 6px 8px; }
#app .fav-head-btns .btn { height: 30px; padding: 0 12px; font-size: 12px; }

/* ---------- 分类导航 ---------- */
#app .cat-nav {
  position: sticky;
  top: var(--v2-topbar-h);
  z-index: 30;
  margin: 4px calc(-1 * var(--v2-gutter)) 6px;
  padding: 10px var(--v2-gutter);
  /* 半透明 + 毛玻璃：跟着背后的壁纸 / 底色走，不再是一条白底 */
  background: var(--ap-nav-bg, rgba(246, 244, 240, .55));
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
}
#app .cat-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 2px 4px;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  scroll-snap-type: x proximity;
}
#app .cat-chips::-webkit-scrollbar { display: none; }
#app .cat-chip {
  --cat-h: 250;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font: 600 13.5px/1 inherit;
  font-family: inherit;
  cursor: pointer;
  scroll-snap-align: start;
  transition: background .18s var(--v2-ease), color .18s, border-color .18s, transform .18s var(--v2-ease), box-shadow .18s;
  -webkit-tap-highlight-color: transparent;
}
#app .cat-chip:hover { border-color: hsl(var(--cat-h) 60% 78%); transform: translateY(-1px); }
#app .cat-chip .cc-icon { font-size: 15px; line-height: 1; }
#app .cat-chip .cc-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--line-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
#app .cat-chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(29, 27, 41, .7);
}
#app .cat-chip.active .cc-count { background: rgba(255, 255, 255, .16); color: #fff; }
#app .cat-nav.searching .cat-chip { opacity: .55; }

#app .filter-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 2px 14px;
  font-size: 14px;
  color: var(--ink-2);
}
#app .filter-note .fn-clear { height: 30px; padding: 0 12px; font-size: 12px; }

#app .groups-empty {
  text-align: center;
  padding: 56px 16px 64px;
  color: var(--muted);
}
#app .groups-empty .ge-icon { font-size: 40px; margin-bottom: 10px; }
#app .groups-empty .ge-title { font-size: 17px; font-weight: 800; color: var(--ink); margin-bottom: 6px; }
#app .groups-empty .ge-sub { font-size: 13px; }

/* ---------- 分组 ---------- */
#app .groups { gap: 34px; margin-bottom: 30px; }
#app .group { --cat-h: 250; scroll-margin-top: calc(var(--v2-topbar-h) + 64px); }
#app .group-new { margin-bottom: 30px; }
#app .group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}
#app .group-title .gt-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: inline-grid;
  place-items: center;
  font-size: 18px;
  background: hsl(var(--cat-h) 80% 94%);
  box-shadow: inset 0 0 0 1px hsl(var(--cat-h) 60% 86%);
}
#app .group-title .gt-name { letter-spacing: .5px; }
#app .group-title .gt-count {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
#app .group-title::after {
  content: "";
  flex: 1;
  height: 1px;
  margin-left: 6px;
  background: linear-gradient(90deg, var(--line), transparent);
}

/* ---------- 游戏卡片 ---------- */
#app .cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--ap-card-min, 250px)), 1fr));
  gap: var(--ap-gap, 14px);
}
#app .game-card {
  --cat-h: 250;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 16px 16px 12px;
  border-radius: var(--ap-radius, 16px);
  background: var(--ap-card-bg, #fff);
  border: 1px solid var(--line);
  box-shadow: var(--v2-card-shadow);
  cursor: pointer;
  transition: transform .28s var(--v2-ease), box-shadow .28s var(--v2-ease), border-color .2s;
  contain: layout;
}
#app .game-card::before {
  /* 悬停时顶部一道分类色光 */
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: -1px;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: linear-gradient(90deg, transparent, hsl(var(--cat-h) 75% 60%), transparent);
  opacity: 0;
  transition: opacity .25s;
}
@media (hover: hover) and (pointer: fine) {
  #app .game-card:not(.is-off):hover {
    transform: translateY(-4px);
    border-color: hsl(var(--cat-h) 55% 84%);
    box-shadow: var(--v2-card-shadow-hover);
  }
  #app .game-card:not(.is-off):hover::before { opacity: 1; }
  #app .game-card:not(.is-off):hover .gc-icon { transform: scale(1.06) rotate(-4deg); }
}
#app .game-card:not(.is-off):active { transform: translateY(-1px) scale(.99); }
#app .game-card:focus-within { border-color: var(--brand-line); }
#app .game-card.is-filtered,
#app .game-card.is-folded { display: none; }
#app .game-card.is-off { cursor: default; background: #fbfaf8; }
#app .game-card.is-off .gc-icon { filter: grayscale(.7); opacity: .7; }
#app .game-card.is-off .gc-name { color: var(--muted); }
#app .game-card.just-updated { animation: v2-flash 1.4s var(--v2-ease); }
#app .game-card.gc-spot { animation: v2-spot 2.4s var(--v2-ease); }
@keyframes v2-flash {
  0% { box-shadow: 0 0 0 0 rgba(76, 63, 211, .45), var(--v2-card-shadow); }
  100% { box-shadow: 0 0 0 14px rgba(76, 63, 211, 0), var(--v2-card-shadow); }
}
@keyframes v2-spot {
  0%, 40%, 80% { box-shadow: 0 0 0 3px hsl(var(--cat-h) 75% 60%), 0 18px 40px -16px hsl(var(--cat-h) 70% 45% / .6); transform: translateY(-4px); }
  20%, 60% { box-shadow: 0 0 0 7px hsl(var(--cat-h) 75% 60% / .25), var(--v2-card-shadow); transform: translateY(-2px); }
  100% { box-shadow: var(--v2-card-shadow); transform: none; }
}

#app .gc-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  min-width: 0;
}
#app .gc-icon {
  flex: 0 0 auto;
  width: var(--ap-icon, 48px);
  height: var(--ap-icon, 48px);
  border-radius: calc(var(--ap-icon, 48px) * .29);
  display: grid;
  place-items: center;
  font-size: calc(var(--ap-icon, 48px) * var(--ap-glyph, .52));
  line-height: 1;
  background: linear-gradient(145deg, hsl(var(--cat-h) 90% 97%), hsl(var(--cat-h) 70% 91%));
  box-shadow: inset 0 0 0 1px hsl(var(--cat-h) 55% 87%), inset 0 -2px 0 hsl(var(--cat-h) 50% 85%);
  transition: transform .3s var(--v2-ease);
}
#app .gc-titles { flex: 1; min-width: 0; padding-top: 2px; }
#app .gc-name {
  font-size: var(--ap-name, 15.5px);
  font-weight: 800;
  line-height: 1.3;
  color: var(--ap-name-color, var(--ink));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#app .gc-name { display: flex; align-items: center; gap: 6px; }
#app .gc-name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#app .gc-tag {
  flex: none;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  background: var(--line-soft);
  box-shadow: inset 0 0 0 1px var(--line);
}
#app .hero .lbl-short { display: none; }
#app .gc-sub {
  margin-top: 4px;
  font-size: var(--ap-sub, 12.5px);
  line-height: 1.55;
  color: var(--ap-sub-color, var(--muted));
  display: -webkit-box;
  -webkit-line-clamp: var(--ap-sub-lines, 2);
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.55em * var(--ap-sub-lines, 2));
}
#app .gc-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #8a5a10;
  background: linear-gradient(135deg, #ffe7b8, #f7cf83);
  box-shadow: 0 2px 6px -2px rgba(176, 122, 38, .6);
  pointer-events: none;
}
#app .gc-date {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
}
#app #new-group .gc-badge { display: none; }
#app .gc-ctrl {
  position: relative;
  z-index: 2;
  flex: none;
  width: 28px;
  height: 28px;
  margin-left: -4px;
  border-radius: 50%;
  padding: 0;
}
#app .gc-ctrl svg { width: 16px; height: 16px; }

#app .gc-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  min-width: 0;
}
#app .gc-status {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
#app .status-dot { width: 7px; height: 7px; border: 0; }
#app .status-dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(31, 157, 99, .16); animation: v2-pulse 2.6s ease-in-out infinite; }
#app .status-dot.off { background: #c9c4bd; box-shadow: none; }
@keyframes v2-pulse { 50% { box-shadow: 0 0 0 5px rgba(31, 157, 99, .05); } }
#app .game-card:not(.is-off) .gc-status-text { color: var(--green); }
#app .gc-port { font-weight: 500; color: var(--muted); }
#app .gc-link-wrap {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
}
#app .gc-link {
  display: block;
  font-size: 11.5px;
  color: #a39fab;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: normal;
  line-height: 1.4;
}
#app .gc-link:hover { text-decoration: none; }
/* 整张卡就是进入游戏的链接 */
#app .game-card:not(.is-off) .gc-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}
#app .gc-empty { font-size: 11.5px; color: #a39fab; }
#app .gc-online-time, #app .gc-updated { display: none !important; }
#app .gc-btns {
  position: relative;
  z-index: 2;
  flex: none;
  display: inline-flex;
  gap: 2px;
}
#app .gc-btns .btn {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent !important;
  color: #a39fab;
  font-size: 15px;
  line-height: 1;
  box-shadow: none !important;
  transform: none !important;
}
#app .gc-btns .btn:hover { background: var(--line-soft) !important; color: var(--ink-2); }
#app .gc-btns .gc-info { font: italic 700 14px/1 Georgia, "Times New Roman", serif; }
#app .gc-btns .gc-fav.on { color: var(--gold); }
#app .gc-btns .gc-copy svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@media (hover: hover) and (pointer: fine) {
  #app .gc-btns .gc-info,
  #app .gc-btns .gc-copy { opacity: 0; transition: opacity .18s; }
  #app .game-card:hover .gc-btns .btn,
  #app .game-card:focus-within .gc-btns .btn { opacity: 1; }
}
html.ui-hide-fav #app .gc-fav { display: none !important; }

/* ---------- 反馈 / 站长工具 / 页脚 ---------- */
#app .report-panel { padding: 20px 22px; margin-top: 10px; }
#app .report-panel .panel-title { font-size: 16px; font-weight: 800; color: var(--ink); }
#app .report-grid { gap: 14px; }
#app .report-form-box {
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: var(--panel-soft);
  padding: 14px;
  gap: 8px;
}
#app .rf-title { font-size: 13px; font-weight: 700; color: var(--ink-2); letter-spacing: 0; }
#app .rf-input, #app .rf-textarea, .modal .rf-input {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: inherit;
  transition: border-color .18s, box-shadow .18s;
}
#app .rf-input:focus, #app .rf-textarea:focus, .modal .rf-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--shadow-focus);
}
#app .rf-textarea { min-height: 64px; }
#app .report-form-box .btn { height: 34px; padding: 0 16px; font-size: 13px; }
#app .tips.panel { padding: 12px 18px; margin-top: 14px; }
#app .tips summary { color: var(--muted); font-weight: 600; font-size: 13px; }
#app .tips-stats .btn { border-radius: 999px; background: #fff; border-color: var(--line); color: var(--ink-2); }
#app .made-by {
  padding: 26px 0 14px;
  font-size: 12px;
  letter-spacing: 1px;
  color: #9a96a3;
}

/* ---------- 弹窗 / 提示 ---------- */
.modal { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal .modal-card {
  border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: 0 40px 80px -30px rgba(22, 19, 40, .55);
  animation: v2-pop .28s var(--v2-ease);
}
@keyframes v2-pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal .modal-title { font-weight: 800; color: var(--ink); }
.modal .modal-close { border-radius: 50%; }
.game-intro-card .game-intro-text { line-height: 1.75; font-size: 14.5px; color: var(--ink-2); }
.toast {
  border-radius: 999px !important;
  padding: 10px 20px !important;
  font-weight: 600;
  box-shadow: 0 16px 34px -12px rgba(22, 19, 40, .55) !important;
  animation: v2-toast .3s var(--v2-ease);
}
@keyframes v2-toast { from { transform: translate(-50%, 8px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  #app .game-card, #app .gc-icon, #app .cat-chip, .modal .modal-card, .toast { transition: none !important; animation: none !important; }
  #app .status-dot.on { animation: none; }
}

/* ---------- 平板 ---------- */
@media (max-width: 900px) {
  #app .hero { grid-template-columns: 1fr; grid-template-areas: "brand" "meta" "tools"; padding: 28px 26px 24px; }
  #app .hero .toolbar { flex-direction: row; }
  #app .hero .hero-btn { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
}

/* ---------- 手机 ---------- */
@media (max-width: 640px) {
  :root { --v2-topbar-h: 56px; --v2-gutter: 16px; }
  #topbar .topbar-in { gap: 10px; }
  #topbar .tb-name { display: none; }
  #topbar .tb-brand img { width: 30px; height: 30px; }
  #topbar .tb-search { height: 38px; }
  #topbar .tb-search svg { margin-left: 12px; }
  #topbar .tb-kbd { display: none; }
  #topbar #quick-search { font-size: 16px; } /* iOS 不放大 */
  #topbar .tb-profile { height: 36px; padding: 0 12px; font-size: 13px; max-width: 108px; }

  #app { padding-top: 12px; }
  #app .hero {
    border-radius: 20px;
    padding: 20px 18px 18px;
    margin-bottom: 16px;
    row-gap: 14px;
  }
  #app .hero-brand { display: block; min-height: 0; }
  #app .hero-brand-mark { display: none; }
  #app .hero .lbl-long { display: none; }
  #app .hero .lbl-short { display: inline; }
  #app .hero-brand-mark:hover { transform: none; }
  #app .hero-eyebrow { font-size: 9.5px; letter-spacing: 2px; margin-bottom: 4px; }
  #app .hero-title { font-size: 21px; line-height: 1.2; letter-spacing: .5px; cursor: pointer; }
  #app .hero-sub { white-space: normal; margin-top: 5px; }
  #app .hero-sub span { font-size: 11.5px !important; letter-spacing: 0; }
  #app .hero-meta { gap: 6px; }
  #app .hero .last-updated { display: none; }
  #app .hero-eyebrow { display: none; }
  #app .hero-meta > span { height: 24px; padding: 0 9px; font-size: 11px; }
  #app .hero .toolbar { gap: 8px; }
  #app .hero .hero-btn { height: 40px; padding: 0 12px; font-size: 13px; }

  #app .cat-nav { padding: 8px var(--v2-gutter); }
  #app .cat-chip { height: 34px; padding: 0 12px 0 10px; font-size: 13px; }

  #app .groups { gap: 26px; }
  #app .group-title { font-size: 16px; margin-bottom: 10px; }
  #app .group-title .gt-icon { width: 30px; height: 30px; border-radius: 10px; font-size: 16px; }
  #app .gc-ctrl { position: absolute; top: 10px; right: 10px; margin: 0; width: 26px; height: 26px; }
  #app .gc-badge { top: 12px; right: 10px; }
  html:not(.ui-hide-ctrl) #app .gc-badge { right: 42px; }
  #app .gc-foot { padding-top: 6px; gap: 4px; }
  /* 不能 display:none：整卡点击层是 .gc-link::after，隐藏会让手机点卡片进不了游戏 */
  #app .gc-link-wrap { flex: 0 0 0; width: 0; }
  #app .gc-link { width: 0; color: transparent; }
  #app .gc-status { flex: 1; min-width: 0; font-size: 11px; }
  #app .gc-btns .btn { width: 28px; height: 28px; font-size: 14px; }

  #app .resume-bar, #app .active-tables, #app .fav-section { border-radius: 16px; }
  #app .fav-section { padding: 12px 14px 14px; }
  #app .fav-card { height: 34px; padding: 0 12px; font-size: 13px; }
  #app .report-panel { padding: 16px; }
  #app .filter-note { font-size: 13px; }
}

@media (max-width: 360px) {
  #app .cards { grid-template-columns: 1fr; }
}

/* ---------- 分组折叠 / 查看全部 ---------- */
#app .group-more {
  grid-column: 1 / -1;
  justify-self: center;
  height: 38px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px dashed hsl(var(--cat-h) 45% 78%);
  background: hsl(var(--cat-h) 80% 97%);
  color: hsl(var(--cat-h) 45% 32%);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s, border-color .18s, transform .18s var(--v2-ease);
}
#app .group-more:hover { background: hsl(var(--cat-h) 80% 94%); border-style: solid; transform: translateY(-1px); }

/* ---------- 回到顶部 ---------- */
.to-top {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 45;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .94);
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 12px 26px -12px rgba(36, 28, 80, .5);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .25s, transform .25s var(--v2-ease);
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- 简介弹窗操作区 ---------- */
.game-intro-actions { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.game-intro-actions .gia-row { display: flex; gap: 10px; }
.game-intro-actions .btn { height: 40px; padding: 0 18px; border-radius: 999px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.game-intro-actions .gia-go { flex: 1; background: linear-gradient(135deg, #5a4be0, #4234c4); border-color: transparent; color: #fff; }
.game-intro-actions .gia-admin {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  color: var(--muted);
}
.game-intro-actions .gia-unlock, .game-intro-actions .gia-hide {
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  padding: 4px 0;
}
.game-intro-actions .gia-unlock:hover, .game-intro-actions .gia-hide:hover { color: var(--brand); }
.game-intro-actions .gia-hide { margin-left: auto; }
.game-intro-actions .gia-select {
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
}
.game-intro-card .game-intro-cat { display: inline-block; margin: 2px 0 10px; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: 12px; font-weight: 600; }
.game-intro-card .game-intro-date { color: var(--muted); font-size: 12px; margin-top: 8px; }

@media (max-width: 640px) {
  #app .group-more { width: 100%; height: 40px; }
  .to-top { width: 42px; height: 42px; bottom: calc(16px + env(safe-area-inset-bottom)); }
  /* 弹窗在手机上贴底弹出，单手好点 */
  .modal { padding: 8vh 0 0 !important; }
  .modal .modal-card { width: 100% !important; max-width: none !important; border-radius: 22px 22px 0 0 !important; margin: auto 0 0 !important; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  @keyframes v2-pop { from { transform: translateY(40px); opacity: .4; } }
}


/* =========================================================
 * 2026-10-21 第二批：外观变量、手机横排卡片、极简模式、区块折叠、公告条
 * ========================================================= */

/* ---------- 手机：普通卡片＝左图标右名字，简介在下方通栏 ---------- */
@media (max-width: 640px) {
  #app .cards { grid-template-columns: repeat(var(--ap-cols, 2), minmax(0, 1fr)); }
  #app .game-card { padding: 10px 10px 4px; gap: 6px; }
  #app .gc-head {
    display: grid;
    grid-template-columns: var(--ap-icon, 36px) minmax(0, 1fr);
    align-items: center;
    column-gap: 8px;
    row-gap: 6px;
  }
  #app .gc-titles { display: contents; }
  #app .gc-name { grid-column: 2; padding-right: 2px; }
  #app .gc-sub { grid-column: 1 / -1; margin-top: 0; }
  #app .gc-badge { top: -6px; right: 8px; padding: 1px 6px; font-size: 9px; }
  html:not(.ui-hide-ctrl) #app .gc-badge { right: 8px; }
  #app .gc-ctrl { position: absolute; top: 8px; right: 8px; }
  #app .gc-foot { padding-top: 4px; }
  #app .gc-btns .btn { width: 26px; height: 26px; font-size: 13px; }
}
@media (max-width: 360px) {
  #app .cards { grid-template-columns: repeat(min(var(--ap-cols, 2), 2), minmax(0, 1fr)); }
}

/* ---------- 极简模式：只留图标 + 名字（电脑 / 手机各自选择） ---------- */
@media (min-width: 641px) {
  html[data-cm-d="compact"] #app .cards { grid-template-columns: repeat(auto-fill, minmax(var(--ap-compact-min, 112px), 1fr)); }
}
@media (max-width: 640px) {
  html[data-cm-m="compact"] #app .cards { grid-template-columns: repeat(var(--ap-compact-cols, 4), minmax(0, 1fr)); gap: 8px; }
}
html[data-cm-d="compact"] .cm-scope, html[data-cm-m="compact"] .cm-scope { display: none; }
@media (min-width: 641px) { html[data-cm-d="compact"] #app { --cm: 1; } }
@media (max-width: 640px) { html[data-cm-m="compact"] #app { --cm: 1; } }
@media (min-width: 641px) {
  html[data-cm-d="compact"] #app .game-card { padding: 14px 8px 10px; gap: 8px; align-items: center; text-align: center; }
  html[data-cm-d="compact"] #app .gc-head { flex-direction: column; align-items: center; gap: 8px; width: 100%; }
  html[data-cm-d="compact"] #app .gc-titles { width: 100%; padding: 0; }
  html[data-cm-d="compact"] #app .gc-name { justify-content: center; font-size: calc(var(--ap-name, 15px) - 2px); }
  html[data-cm-d="compact"] #app .gc-sub,
  html[data-cm-d="compact"] #app .gc-foot,
  html[data-cm-d="compact"] #app .gc-tag,
  html[data-cm-d="compact"] #app .gc-date { display: none; }
  html[data-cm-d="compact"] #app .gc-badge { top: 6px; right: 6px; font-size: 8.5px; padding: 1px 5px; }
  html[data-cm-d="compact"] #app .game-card::after {
    content: ""; position: absolute; top: 9px; left: 9px; width: 7px; height: 7px; border-radius: 50%;
    background: var(--green); box-shadow: 0 0 0 3px rgba(31, 157, 99, .14);
  }
  html[data-cm-d="compact"] #app .game-card.is-off::after { background: #c9c4bd; box-shadow: none; }
  html[data-cm-d="compact"] #app .game-card:not(.is-off)::before { display: none; }
}
@media (max-width: 640px) {
  html[data-cm-m="compact"] #app .game-card { padding: 10px 4px 8px; gap: 6px; align-items: center; text-align: center; border-radius: 12px; }
  html[data-cm-m="compact"] #app .gc-head { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; }
  html[data-cm-m="compact"] #app .gc-titles { display: block; width: 100%; }
  html[data-cm-m="compact"] #app .gc-name { justify-content: center; font-size: calc(var(--ap-name, 14px) - 2px); padding: 0; }
  html[data-cm-m="compact"] #app .gc-name-text { white-space: nowrap; }
  html[data-cm-m="compact"] #app .gc-sub,
  html[data-cm-m="compact"] #app .gc-foot,
  html[data-cm-m="compact"] #app .gc-tag,
  html[data-cm-m="compact"] #app .gc-date,
  html[data-cm-m="compact"] #app .gc-ctrl { display: none; }
  html[data-cm-m="compact"] #app .gc-badge { top: -5px; right: 2px; font-size: 8px; padding: 0 4px; }
  html[data-cm-m="compact"] #app .game-card.is-off .gc-icon { opacity: .45; }
}

/* ---------- 分类栏右侧：卡片模式切换（访客本机） ---------- */
#app .cat-nav { display: flex; align-items: center; gap: 8px; }
#app .cat-nav .cat-chips { flex: 1; min-width: 0; }
#app .view-toggle {
  flex: none;
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
}
#app .view-toggle button {
  width: 32px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: background .18s, color .18s;
}
#app .view-toggle button svg { width: 16px; height: 16px; fill: currentColor; }
#app .view-toggle button.on { background: var(--ink); color: #fff; }

/* ---------- 快捷游戏 / 正在进行的游戏桌：折叠 ---------- */
#app .sec-fold {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 10px 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
#app .sec-fold:hover { color: var(--ink); border-color: var(--brand-line); }
#app .sec-fold .sf-arrow { display: inline-block; transition: transform .2s var(--v2-ease); }
#app .is-collapsed .sec-fold .sf-arrow { transform: rotate(-90deg); }
#app .sec-count { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 6px; }
#app .fav-section.is-collapsed #fav-cards,
#app .fav-section.is-collapsed #fav-edit-hint,
#app .fav-section.is-collapsed #btn-fav-sort,
#app .fav-section.is-collapsed #btn-fav-edit,
#app .active-tables.is-collapsed #active-tables-list,
#app .active-tables.is-collapsed #btn-destroy-my-tables { display: none !important; }
#app .fav-section.is-collapsed,
#app .active-tables.is-collapsed { padding-bottom: 14px; }
#app .fav-section.is-collapsed .fav-head,
#app .active-tables.is-collapsed .at-head { margin-bottom: 0; }
#app .at-head { display: flex; align-items: center; gap: 8px; }
#app .at-head .at-title { flex: 1; margin: 0; }
#app .fav-head .group-title { flex: 1; }

/* ---------- 公告条 ---------- */
#app .site-announce {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid;
}
#app .site-announce .sa-icon { flex: none; font-size: 16px; line-height: 1.5; }
#app .site-announce .sa-text { flex: 1; min-width: 0; white-space: pre-wrap; word-break: break-word; }
#app .site-announce .sa-close { flex: none; border: 0; background: none; color: inherit; opacity: .55; cursor: pointer; font-size: 16px; line-height: 1.4; }
#app .site-announce.tone-info { background: #eef0fd; border-color: #d6d9f6; color: #2d2a7a; }
#app .site-announce.tone-gold { background: #fdf4e2; border-color: #efd7a6; color: #6d4a10; }
#app .site-announce.tone-green { background: #e5f5ec; border-color: #bfe3cf; color: #165a37; }
#app .site-announce.tone-red { background: #fdebe8; border-color: #f2c4bb; color: #84261a; }

/* ---------- 站长控制台入口 ---------- */
#app .admin-entry {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}
#app .admin-entry .btn { height: 34px; padding: 0 16px; font-size: 12.5px; color: var(--muted); }

/* ---------- 分类栏两端箭头（电脑端，内容溢出时出现） ---------- */
#app .cat-arrow {
  display: none;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .9);
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px -6px rgba(36, 28, 80, .4);
}
#app .cat-arrow:hover { border-color: var(--brand-line); color: var(--brand); }
@media (hover: hover) and (pointer: fine) {
  #app .cat-arrow.show { display: inline-grid; place-items: center; }
}
#app .cat-chips.dragging { cursor: grabbing; scroll-snap-type: none; }
#app .cat-chips.dragging .cat-chip { pointer-events: none; }
#app .cat-chips.at-end { -webkit-mask-image: none; mask-image: none; }


/* ---------- 极简模式：图标方块单独的尺寸 ---------- */
@media (min-width: 641px) {
  html[data-cm-d="compact"] #app .gc-icon {
    width: var(--ap-cbox, 40px);
    height: var(--ap-cbox, 40px);
    border-radius: calc(var(--ap-cbox, 40px) * .29);
    font-size: calc(var(--ap-cbox, 40px) * var(--ap-cglyph, .56));
  }
}
@media (max-width: 640px) {
  html[data-cm-m="compact"] #app .gc-icon {
    width: var(--ap-cbox, 32px);
    height: var(--ap-cbox, 32px);
    border-radius: calc(var(--ap-cbox, 32px) * .29);
    font-size: calc(var(--ap-cbox, 32px) * var(--ap-cglyph, .56));
  }
}

/* ---------- 排序按钮 / 菜单 ---------- */
#app .sort-wrap { position: relative; flex: none; }
#app .sort-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
#app .sort-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#app .sort-btn.on { border-color: var(--brand); color: var(--brand); }
#app .sort-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 35;
  min-width: 190px;
  padding: 6px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px -16px rgba(36, 28, 80, .45);
  display: flex;
  flex-direction: column;
}
#app .sort-menu.hidden { display: none !important; }
#app .sort-menu button {
  text-align: left;
  border: 0;
  background: none;
  padding: 9px 12px;
  border-radius: 9px;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
}
#app .sort-menu button:hover { background: var(--line-soft); }
#app .sort-menu button.on { color: var(--brand); font-weight: 700; background: var(--brand-soft); }
#app .group-empty { padding: 26px 10px; text-align: center; color: var(--muted); font-size: 13.5px; }
#app .group[data-cat="__cn"] .group-title::after { display: none; }
#app .cn-search-toggle {
  width: 38px; height: 38px; flex: 0 0 38px; margin-left: auto; padding: 0;
  display: inline-grid; place-items: center; border: 0; border-radius: 0;
  background: transparent; color: var(--ink-2); cursor: pointer; box-shadow: none;
}
#app .cn-search-toggle:hover, #app .cn-search-toggle[aria-expanded="true"] { color: var(--brand); }
#app .cn-search-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
#app .cn-search { display: none; margin: 0 0 14px; padding: 12px; border-radius: var(--ap-radius, 16px); background: var(--ap-card-bg, rgba(255,255,255,.7)); border: 1px solid var(--line); box-shadow: var(--v2-card-shadow); -webkit-backdrop-filter: blur(var(--ap-card-blur, 0px)); backdrop-filter: blur(var(--ap-card-blur, 0px)); }
#app .cn-search.is-open { display: block; }
#app .cn-search-input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--ap-card-bg, rgba(255,255,255,.7)); color: var(--ink);
  font: inherit; font-size: 14px; outline: none;
}
#app .cn-search-input:focus { border-color: var(--brand-line); box-shadow: 0 0 0 3px var(--shadow-focus); }
#app .cn-search-count { min-height: 16px; margin: 5px 2px 0; color: var(--muted); font-size: 12px; }
@media (max-width: 640px) {
  #app .sort-btn { width: 36px; padding: 0; justify-content: center; }
  #app .sort-btn .sort-label { display: none; }
  #app .sort-btn.on::after { content: ""; position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
  #app .view-toggle button { width: 30px; }
}


/* ---------- 搜索框弹层：最近搜索 / 搜索后进入过 ---------- */
#topbar .qs-pop {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 60;
  max-height: min(70vh, 460px);
  overflow: auto;
  padding: 12px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 24px 50px -20px rgba(36, 28, 80, .45);
  -webkit-backdrop-filter: blur(var(--ap-card-blur, 0px));
  backdrop-filter: blur(var(--ap-card-blur, 0px));
  cursor: default;
}
#topbar .qs-pop.hidden { display: none; }
#topbar .qs-title { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 4px 2px 8px; }
#topbar .qs-title + * { margin-bottom: 10px; }
#topbar .qs-clear { border: 0; background: none; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
#topbar .qs-clear:hover { color: var(--brand); }
#topbar .qs-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
#topbar .qs-game {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 9px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
#topbar .qs-game:hover { border-color: var(--brand-line); background: var(--brand-soft2); }
#topbar .qs-game-icon { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-soft); font-size: 15px; }
#topbar .qs-game-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#topbar .qs-game-item { position: relative; min-width: 0; }
#topbar .qs-game-item.editing .qs-game { padding-right: 28px; }
#topbar .qs-game-remove { display: none; }
#topbar .qs-game-item.editing .qs-game-remove {
  position: absolute; top: -6px; right: -5px; z-index: 1;
  display: grid; place-items: center; width: 22px; height: 22px; padding: 0;
  border: 1px solid #fff; border-radius: 50%; background: var(--red); color: #fff;
  font: 700 16px/1 inherit; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); cursor: pointer;
}
#topbar .qs-hist { display: flex; flex-wrap: wrap; gap: 6px; }
#topbar .qs-chip { display: inline-flex; align-items: center; border-radius: 999px; background: var(--line-soft); }
#topbar .qs-q { border: 0; background: none; padding: 6px 4px 6px 12px; font: inherit; font-size: 13px; color: var(--ink-2); cursor: pointer; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#topbar .qs-x { border: 0; background: none; padding: 6px 10px 6px 4px; font-size: 11px; color: var(--muted); cursor: pointer; }
#topbar .qs-chip:hover { background: var(--brand-soft); }
#topbar .qs-empty { padding: 10px 4px; font-size: 13px; color: var(--muted); }
@media (max-width: 640px) {
  #topbar .qs-pop { position: fixed; left: 12px; right: 12px; top: calc(var(--v2-topbar-h) + 4px); }
  #topbar .qs-games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* 「我的快捷游戏」由分类栏里的「⭐ 我的收藏」标签代替（2026-10-21） */
#app #fav-section { display: none !important; }

/* ---------- 热门推荐：站长直接在标签里搜索添加 / 移出 ---------- */
#app .hot-admin {
  margin: -4px 0 16px;
  padding: 12px;
  border-radius: 14px;
  border: 1px dashed #efc78a;
  background: rgba(255, 248, 236, .92);
}
#app .hot-admin-input {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid #efd7a6;
  background: #fff;
  font: inherit;
  font-size: 14px;
  outline: none;
}
#app .hot-admin-input:focus { border-color: #d9952e; box-shadow: 0 0 0 3px rgba(217, 149, 46, .18); }
#app .hot-admin-hits { display: flex; flex-wrap: wrap; gap: 6px; }
#app .hot-admin-hits:not(:empty) { margin-top: 10px; }
#app .hot-admin-hit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px 0 6px;
  border-radius: 999px;
  border: 1px solid #ecd6a8;
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
}
#app .hot-admin-hit:hover { border-color: #d9952e; background: #fff4df; }
#app .hot-admin-hit:disabled { opacity: .5; }
#app .hot-admin-icon { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #fdecc8; font-size: 13px; }
#app .hot-admin-plus { color: #b06a10; font-weight: 800; }
#app .hot-admin-empty { font-size: 13px; color: var(--muted); }
#app .hot-remove {
  position: absolute;
  top: -8px;
  left: -8px;
  z-index: 3;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid #f0c3b9;
  background: #fff;
  color: #c4432f;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 10px -4px rgba(0, 0, 0, .3);
}
#app .hot-remove:hover { background: #fbe9e5; }

/* 热门推荐：站长编辑时拖动排序 */
#app .cards.hot-sorting .game-card {
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
#app .cards.hot-sorting .game-card * { cursor: grab; }
#app .cards.hot-sorting .hot-remove { cursor: pointer; }
#app .cards.hot-sorting .game-card.hot-drag-src { opacity: .28; outline: 2px dashed #d9952e; outline-offset: -2px; }
#app .game-card.hot-drag-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9999;
  margin: 0;
  pointer-events: none;
  cursor: grabbing;
  transition: none;
  box-shadow: 0 18px 36px -12px rgba(0, 0, 0, .45);
}
#app .hot-admin-hint { margin-top: 8px; font-size: 12px; color: var(--muted); }


/* =========================================================
 * 2026-10-21 第十批：游戏桌并卡 / 反馈弹窗 / 标签简称 / 极简横排 / 查看全部占卡位 / 公告 / 弹窗滚动
 * ========================================================= */

/* ---------- 弹窗打开时锁住背后的页面（手机上滑动只滚弹窗） ---------- */
html.modal-lock, html.modal-lock body { overflow: hidden !important; overscroll-behavior: none; }
.modal { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

/* ---------- 继续上一局并进游戏桌；游戏桌卡片和游戏卡片同一套样式 ---------- */
#app #resume-bar { display: none !important; }
#app .active-tables {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  padding: 0 !important;
  margin: 0 0 24px;
}
#app .at-head { display: flex; flex-direction: row !important; align-items: center; justify-content: flex-start !important; gap: 10px; margin: 0 0 12px; flex-wrap: nowrap; }
#app .at-head .at-title { flex: 0 1 auto !important; font-size: 18px; font-weight: 800; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#app .at-head .sec-fold { order: 2; }
#app .at-head #btn-destroy-my-tables { order: 3; margin-left: auto; align-self: center; height: 30px; padding: 0 12px; font-size: 12px; }
#app .active-tables.is-collapsed { margin-bottom: 14px; }
#app .at-list { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--ap-gap, 14px); }
#app .at-row {
  position: relative;
  display: flex;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 8px !important;
  padding: 14px 16px 12px !important;
  border-radius: var(--ap-radius, 16px) !important;
  background: var(--ap-card-bg, #fff) !important;
  border: 1px solid var(--line) !important;
  box-shadow: var(--v2-card-shadow);
}
#app .at-row.off { opacity: .7; }
#app .at-headline { display: flex; align-items: center; gap: 10px; }
#app .at-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: var(--brand-soft);
  flex: none;
}
#app .at-name { font-weight: 800; font-size: 15px; color: var(--ap-name-color, var(--ink)); }
#app .at-room { font-size: 12.5px; color: var(--ap-sub-color, var(--muted)); }
#app .at-btns { display: flex; justify-content: flex-end; gap: 6px; border-top: 1px dashed var(--line); padding-top: 8px !important; margin-top: auto; width: 100%; }
#app .at-btns .btn { height: 30px; padding: 0 14px; font-size: 12.5px; }
#app .at-btns .at-enter { display: inline-flex; align-items: center; justify-content: center; text-align: center; background: linear-gradient(135deg, #5a4be0, #4234c4); color: #fff; border-color: transparent; }
@media (max-width: 640px) {
  #app .at-head .at-title { font-size: 16px; }
  #app .at-head #btn-destroy-my-tables { height: 28px; padding: 0 10px; font-size: 11.5px; }
  #app .at-list { grid-template-columns: 1fr; gap: 8px; }
  #app .at-row { padding: 12px !important; }
}

/* ---------- 顶部卡片：随机 / 邀请 / 反馈 三个按钮同一层 ---------- */
#app .hero #btn-feedback {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .22);
  color: #fff;
}
#app .hero #btn-feedback:hover:not(:disabled) { background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .4); }
#app .hero .toolbar { gap: 8px; }
#app .hero .hero-btn { height: 40px; }
@media (max-width: 900px) {
  #app .hero .toolbar { display: grid; grid-template-columns: 1fr 1.25fr .8fr; }
}
/* 2026-11-17：电脑端按钮列保持改版前的宽度（按钮文字改短后列宽跟着缩到 209px，看着窄） */
@media (min-width: 901px) {
  #app .hero .toolbar { min-width: 275px; }
}
@media (max-width: 640px) {
  #app .hero .hero-btn { height: 38px; padding: 0 8px; font-size: 12.5px; }
  /* 2026-11-17：随机和反馈一样宽，中间按钮多拿空间 */
  #app .hero .toolbar { grid-template-columns: .8fr 1.7fr .8fr; }
}
#modal-feedback .feedback-card { max-width: 760px; }
#modal-feedback .report-panel { margin: 0 !important; padding: 4px 0 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; }
#modal-feedback .report-panel .panel-title { display: none; }

/* ---------- 分类栏：平时看不到底框；吸顶时是半透明圆角胶囊 ---------- */
#app .cat-nav {
  background: transparent !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  margin: 4px 0 6px !important;
  padding: 8px 0 !important;
  border-radius: 20px;
  transition: background .2s, padding .2s, box-shadow .2s;
}
#app .cat-nav.stuck {
  background: var(--ap-nav-bg, rgba(246, 244, 240, .55)) !important;
  -webkit-backdrop-filter: saturate(1.4) blur(14px) !important;
  backdrop-filter: saturate(1.4) blur(14px) !important;
  padding: 8px 10px !important;
  box-shadow: 0 10px 24px -18px rgba(36, 28, 80, .5);
}
#app .cat-chip { padding: 0 12px 0 10px; }
#app .cat-chip .cc-count { min-width: 18px; height: 18px; line-height: 18px; font-size: 10.5px; padding: 0 5px; }
#app .sort-menu-head { padding: 8px 12px 4px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
#app .sort-menu .mobile-only { display: none; }
@media (max-width: 640px) {
  #app .cat-chip { height: 32px; padding: 0 10px 0 8px; gap: 4px; font-size: 13px; }
  #app .cat-chip .cc-count { display: none; }
  #app .view-toggle { display: none; }
  #app .sort-btn { width: 32px; height: 32px; }
  #app .sort-menu .mobile-only { display: block; }
  #app .sort-menu { min-width: 200px; }
}

/* ---------- 极简模式：左图标、右名字，下面一行是复制链接 + 信息 ---------- */
@media (min-width: 641px) {
  html[data-cm-d="compact"] #app .game-card { padding: 10px 10px 6px; gap: 6px; align-items: stretch; text-align: left; }
  html[data-cm-d="compact"] #app .gc-head { flex-direction: row; align-items: center; gap: 8px; }
  html[data-cm-d="compact"] #app .gc-titles { flex: 1; min-width: 0; }
  html[data-cm-d="compact"] #app .gc-name { justify-content: flex-start; }
  html[data-cm-d="compact"] #app .game-card::after { top: 6px; left: auto; right: 6px; width: 6px; height: 6px; }
  html[data-cm-d="compact"] #app .gc-foot { display: flex; padding-top: 4px; border-top: 1px dashed var(--line); }
  html[data-cm-d="compact"] #app .gc-status,
  html[data-cm-d="compact"] #app .gc-fav { display: none !important; }
  html[data-cm-d="compact"] #app .gc-link { font-size: 0; }
  html[data-cm-d="compact"] #app .gc-btns { margin-left: auto; }
  html[data-cm-d="compact"] #app .gc-btns .btn { opacity: 1; width: 26px; height: 26px; font-size: 13px; }
  html[data-cm-d="compact"] #app .gc-badge { top: -6px; right: 8px; }
}
@media (max-width: 640px) {
  html[data-cm-m="compact"] #app .game-card { padding: 8px 8px 4px; gap: 4px; align-items: stretch; text-align: left; }
  html[data-cm-m="compact"] #app .gc-head { display: flex; flex-direction: row; align-items: center; gap: 6px; }
  html[data-cm-m="compact"] #app .gc-titles { display: block; flex: 1; min-width: 0; }
  html[data-cm-m="compact"] #app .gc-name { justify-content: flex-start; font-size: calc(var(--ap-name, 14px) - 1.5px); }
  html[data-cm-m="compact"] #app .gc-foot { display: flex; padding-top: 2px; border-top: 1px dashed var(--line); gap: 0; }
  html[data-cm-m="compact"] #app .gc-status,
  html[data-cm-m="compact"] #app .gc-fav { display: none !important; }
  html[data-cm-m="compact"] #app .gc-link-wrap { display: block; flex: 1; }
  html[data-cm-m="compact"] #app .gc-link { font-size: 0; }
  html[data-cm-m="compact"] #app .gc-btns { margin-left: auto; }
  html[data-cm-m="compact"] #app .gc-btns .btn { width: 24px; height: 24px; font-size: 12px; }
  html[data-cm-m="compact"] #app .gc-btns .gc-info { display: inline-grid; }
}

/* ---------- 「查看全部」占最后一个卡位 ---------- */
#app .group-more {
  grid-column: auto !important;
  justify-self: stretch !important;
  height: auto !important;
  min-height: 100%;
  width: auto !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 10px !important;
  border-radius: var(--ap-radius, 16px) !important;
  border: 1.5px dashed hsl(var(--cat-h) 45% 78%) !important;
  background: hsl(var(--cat-h) 80% 97% / .85) !important;
  text-align: center;
}
#app .group-more .gm-icon { font-size: 22px; line-height: 1; }
#app .group-more .gm-text { font-size: 15px; font-weight: 800; color: hsl(var(--cat-h) 45% 30%); }
#app .group-more .gm-sub { font-size: 12px; font-weight: 600; color: hsl(var(--cat-h) 25% 45%); }
html[data-cm-d="compact"] #app .group-more .gm-icon,
html[data-cm-m="compact"] #app .group-more .gm-icon { display: none; }
@media (max-width: 640px) {
  #app .group-more .gm-text { font-size: 14px; }
  #app .group-more .gm-sub { font-size: 11px; }
  html[data-cm-m="compact"] #app .group-more .gm-text { font-size: 12.5px; }
  html[data-cm-m="compact"] #app .group-more .gm-sub { display: none; }
}

/* ---------- 公告：富文本、可调透明度 / 模糊 ---------- */
#app .site-announce {
  background: rgba(var(--ann-rgb), var(--ap-ann-alpha, 1)) !important;
  -webkit-backdrop-filter: blur(var(--ap-ann-blur, 0px));
  backdrop-filter: blur(var(--ap-ann-blur, 0px));
}
#app .site-announce.tone-info { --ann-rgb: 238, 240, 253; }
#app .site-announce.tone-gold { --ann-rgb: 253, 244, 226; }
#app .site-announce.tone-green { --ann-rgb: 229, 245, 236; }
#app .site-announce.tone-red { --ann-rgb: 253, 235, 232; }
#app .site-announce .sa-text { white-space: normal; }
#app .site-announce .sa-text p, #app .site-announce .sa-text div { margin: 0; }
#app .site-announce .sa-text a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 页脚署名（也是站长控制台的隐藏入口） ---------- */
#app .made-by { cursor: default; user-select: none; -webkit-tap-highlight-color: transparent; }
#app .admin-entry { display: none !important; }


/* 手机开了「减弱动态效果」时旧样式会把壁纸整个藏掉，导致壁纸 / 蒙版设置在手机上看不出变化；
   改为照常显示（壁纸自己在这种模式下是静止的） */
@media (prefers-reduced-motion: reduce) {
  html:not([data-skin="legacy"]) #hub-bg-layer iframe { display: block !important; }
}

/* 反馈表单首帧就藏起来（脚本会把它挪进「反馈」弹窗），避免加载时闪一下 */
#app .report-panel { display: none !important; }

/* 「查看全部」卡位：和游戏卡片同一个底色 / 边框 / 模糊，不用分类主题色 */
#app .group-more {
  border: 1px solid var(--line) !important;
  background: var(--ap-card-bg, #fff) !important;
  box-shadow: var(--v2-card-shadow);
  -webkit-backdrop-filter: blur(var(--ap-card-blur, 0px));
  backdrop-filter: blur(var(--ap-card-blur, 0px));
  transition: transform .28s var(--v2-ease), box-shadow .28s var(--v2-ease), border-color .2s;
}
#app .group-more:hover { transform: translateY(-3px) !important; border-color: var(--brand-line) !important; box-shadow: var(--v2-card-shadow-hover); }
#app .group-more .gm-text { color: var(--ap-name-color, var(--ink)) !important; }
#app .group-more .gm-sub { color: var(--ap-sub-color, var(--muted)) !important; }

/* 热门推荐：站长的「编辑」按钮 */
#app .hot-edit-btn {
  margin-left: 4px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #ecd6a8;
  background: #fff8ec;
  color: #8a5a10;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
#app .hot-edit-btn:hover { border-color: #d9952e; }
#app .hot-edit-btn.on { background: #d9952e; border-color: #d9952e; color: #fff; }

/* 极简卡片：左下角放在线状态（绿点 + 在线 / 灰点 + 维护），和右下角的两个按钮对称 */
html[data-cm-d="compact"] #app .game-card::after,
html[data-cm-m="compact"] #app .game-card::after { display: none !important; }
@media (min-width: 641px) {
  html[data-cm-d="compact"] #app .gc-status { display: inline-flex !important; font-size: 11px; gap: 5px; }
}
@media (max-width: 640px) {
  html[data-cm-m="compact"] #app .gc-status {
    display: inline-flex !important;
    flex: 0 1 auto;
    align-items: center;
    gap: 4px;
    min-width: 0;
    font-size: 10.5px;
    font-weight: 700;
    white-space: nowrap;
  }
  html[data-cm-m="compact"] #app .gc-status .status-dot { width: 6px; height: 6px; }
  html[data-cm-m="compact"] #app .gc-link-wrap { flex: 1 1 0; min-width: 0; }
}
html[data-cm-d="compact"] #app .gc-port,
html[data-cm-m="compact"] #app .gc-port { display: none !important; }

html[data-cm-d="compact"] #app .gc-status-text,
html[data-cm-m="compact"] #app .gc-status-text { display: inline !important; }

/* 搜索框提示字小一点 */
#topbar #quick-search::placeholder { font-size: 13px; }
@media (max-width: 640px) { #topbar #quick-search::placeholder { font-size: 13px; } }


/* ---------- 沉浸式：页面铺到状态栏 / 手势条后面，内容留出安全距离 ---------- */
html { background: var(--ap-page-bg, #f5f3ef); }
#topbar {
  height: calc(var(--v2-topbar-h) + var(--hub-safe-top));
  padding-top: var(--hub-safe-top);
}
#topbar .topbar-in {
  padding-left: max(var(--v2-gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--v2-gutter), env(safe-area-inset-right, 0px));
}
#app {
  padding-left: max(var(--v2-gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--v2-gutter), env(safe-area-inset-right, 0px));
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}
#app .cat-nav { top: calc(var(--v2-topbar-h) + var(--hub-safe-top)); }
html { scroll-padding-top: calc(var(--v2-topbar-h) + var(--hub-safe-top) + 64px); }
.modal .modal-card { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 640px) {
  #topbar .qs-pop { top: calc(var(--v2-topbar-h) + var(--hub-safe-top) + 4px); }
}


/* ---------- 状态栏区域：顶部安全区放一条实色，取页面顶部颜色的浏览器也能对上 ---------- */
#topbar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: var(--hub-safe-top);
  background: var(--ap-page-bg, #f5f3ef);
  pointer-events: none;
}
/* 有动态壁纸时，让壁纸透到状态栏安全区；无壁纸仍用页面底色托底。 */
html.hub-bg-on #topbar::before {
  background: transparent;
}
/* 有壁纸时页面底色也换成壁纸顶部色（--hub-bg-tc 由 bgs.js / 首帧脚本写入）：
   Via 等按页面底色给状态栏、导航栏取色的浏览器，就不会只认到米白底色。壁纸层盖在上面，看不到这层。 */
html.hub-bg-on { background: var(--hub-bg-tc, var(--ap-page-bg, #f5f3ef)); }
html.hub-bg-on body { background: var(--hub-bg-tc, transparent); }

/* 手机上滚动时暂时移除大面积背景模糊，减少固定与卡片层的重绘。 */
@media (pointer: coarse) {
  html.hub-scrolling #topbar,
  html.hub-scrolling #app .cat-nav,
  html.hub-scrolling #app .game-card,
  html.hub-scrolling #app .fav-card {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
}

/* =========================================================
 * 2026-10-31：极简模式 3.0「启动台」——不再是一张张小卡片，
 * 每个分组是一块半透明托盘，里面像手机桌面一样排图标：彩色圆角方块 + 下方一行名字，
 * 在线是方块右下角的小绿点，维护中的游戏图标变灰。整卡点击层 .gc-link::after 保留。
 * ========================================================= */
@media (min-width: 641px) {
  html[data-cm-d="compact"] #app { --lp-box: max(var(--ap-cbox, 56px), 48px); --lp-name: 12.5px; --lp-col: max(var(--ap-compact-min, 104px), 92px); }
  html[data-cm-d="compact"] #app .cards { grid-template-columns: repeat(auto-fill, minmax(min(var(--lp-col), 100%), 1fr)) !important; }
}
@media (max-width: 640px) {
  html[data-cm-m="compact"] #app { --lp-box: max(var(--ap-cbox, 50px), 42px); --lp-name: 11.5px; }
  html[data-cm-m="compact"] #app .cards { grid-template-columns: repeat(max(var(--ap-compact-cols, 4), 3), minmax(0, 1fr)) !important; }
}

/* 托盘 */
@media (min-width: 641px) {
  html[data-cm-d="compact"] #app .group .cards { row-gap: 14px !important; column-gap: 4px !important; padding: 16px 14px 10px; border-radius: 22px; background: var(--ap-card-bg, rgba(255, 255, 255, .7)); border: 1px solid rgba(255, 255, 255, .6); box-shadow: 0 1px 2px rgba(36, 28, 80, .04), 0 12px 30px -22px rgba(36, 28, 80, .35); -webkit-backdrop-filter: blur(var(--ap-card-blur, 0px)); backdrop-filter: blur(var(--ap-card-blur, 0px)); }
}
@media (max-width: 640px) {
  html[data-cm-m="compact"] #app .group .cards { row-gap: 12px !important; column-gap: 2px !important; padding: 12px 6px 8px; border-radius: 20px; background: var(--ap-card-bg, rgba(255, 255, 255, .7)); border: 1px solid rgba(255, 255, 255, .6); box-shadow: 0 10px 26px -20px rgba(36, 28, 80, .35); }
}

/* 图标格子：去掉卡片外观 */
@media (min-width: 641px) {
  html[data-cm-d="compact"] #app .cards > .game-card { padding: 4px 2px 2px !important; gap: 7px !important; align-items: center !important; text-align: center !important; background: transparent !important; border: 0 !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; border-radius: 16px !important; transform: none !important; }
  html[data-cm-d="compact"] #app .cards > .game-card:hover { background: rgba(255, 255, 255, .5) !important; }
}
@media (max-width: 640px) {
  html[data-cm-m="compact"] #app .cards > .game-card { padding: 2px 0 0 !important; gap: 6px !important; align-items: center !important; text-align: center !important; background: transparent !important; border: 0 !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; border-radius: 14px !important; }
}
html[data-cm-d="compact"] #app .cards > .game-card::before,
html[data-cm-m="compact"] #app .cards > .game-card::before { display: none !important; }
@media (min-width: 641px) {
  html[data-cm-d="compact"] #app .cards > .game-card .gc-head { display: flex !important; flex-direction: column !important; align-items: center !important; gap: 7px !important; width: 100%; }
  html[data-cm-d="compact"] #app .cards > .game-card .gc-titles { display: block !important; width: 100%; padding: 0 !important; min-width: 0; }
  html[data-cm-d="compact"] #app .cards > .game-card .gc-name { display: block !important; font-size: var(--lp-name) !important; font-weight: 600; line-height: 1.3; color: var(--ap-name-color, var(--ink)); padding: 0 !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html[data-cm-d="compact"] #app .cards > .game-card .gc-name-text { white-space: nowrap; }
  html[data-cm-d="compact"] #app .cards > .game-card :is(.gc-sub, .gc-tag, .gc-date, .gc-ctrl, .gc-btns, .gc-status, .gc-online-time) { display: none !important; }
  html[data-cm-d="compact"] #app .cards > .game-card .gc-foot { display: block !important; position: static !important; height: 0; padding: 0 !important; margin: 0 !important; border: 0 !important; overflow: visible; }
  html[data-cm-d="compact"] #app .cards > .game-card .gc-link-wrap { display: block !important; width: 0; height: 0; overflow: visible; }
  html[data-cm-d="compact"] #app .cards > .game-card .gc-link { font-size: 0 !important; width: 0; color: transparent; }
}
@media (max-width: 640px) {
  html[data-cm-m="compact"] #app .cards > .game-card .gc-head { display: flex !important; flex-direction: column !important; align-items: center !important; gap: 6px !important; width: 100%; }
  html[data-cm-m="compact"] #app .cards > .game-card .gc-titles { display: block !important; width: 100%; padding: 0 !important; min-width: 0; }
  html[data-cm-m="compact"] #app .cards > .game-card .gc-name { display: block !important; font-size: var(--lp-name) !important; font-weight: 600; line-height: 1.3; color: var(--ap-name-color, var(--ink)); padding: 0 2px !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html[data-cm-m="compact"] #app .cards > .game-card .gc-name-text { white-space: nowrap; }
  html[data-cm-m="compact"] #app .cards > .game-card :is(.gc-sub, .gc-tag, .gc-date, .gc-ctrl, .gc-btns, .gc-status, .gc-online-time) { display: none !important; }
  html[data-cm-m="compact"] #app .cards > .game-card .gc-foot { display: block !important; position: static !important; height: 0; padding: 0 !important; margin: 0 !important; border: 0 !important; overflow: visible; }
  html[data-cm-m="compact"] #app .cards > .game-card .gc-link-wrap { display: block !important; flex: none !important; width: 0; height: 0; overflow: visible; }
  html[data-cm-m="compact"] #app .cards > .game-card .gc-link { font-size: 0 !important; width: 0; color: transparent; }
}

/* 图标：分类色的圆角方块，带一点高光和投影 */
@media (min-width: 641px) {
  html[data-cm-d="compact"] #app .cards > .game-card .gc-icon { position: relative; width: var(--lp-box) !important; height: var(--lp-box) !important; border-radius: calc(var(--lp-box) * .3) !important; font-size: calc(var(--lp-box) * var(--ap-cglyph, .56)) !important; background: linear-gradient(155deg, hsl(var(--cat-h) 95% 97%), hsl(var(--cat-h) 72% 87%)) !important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 0 0 1px hsl(var(--cat-h) 50% 80% / .55), 0 8px 16px -10px hsl(var(--cat-h) 45% 35% / .55) !important; transition: transform .22s var(--v2-ease), box-shadow .22s; }
  html[data-cm-d="compact"] #app .cards > .game-card:hover .gc-icon { transform: translateY(-3px) scale(1.04); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 0 0 1px hsl(var(--cat-h) 50% 76% / .6), 0 14px 22px -12px hsl(var(--cat-h) 45% 32% / .6) !important; }
}
@media (max-width: 640px) {
  html[data-cm-m="compact"] #app .cards > .game-card .gc-icon { position: relative; width: var(--lp-box) !important; height: var(--lp-box) !important; border-radius: calc(var(--lp-box) * .3) !important; font-size: calc(var(--lp-box) * var(--ap-cglyph, .56)) !important; background: linear-gradient(155deg, hsl(var(--cat-h) 95% 97%), hsl(var(--cat-h) 72% 87%)) !important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 0 0 1px hsl(var(--cat-h) 50% 80% / .55), 0 6px 12px -8px hsl(var(--cat-h) 45% 35% / .55) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; transition: transform .12s; }
  html[data-cm-m="compact"] #app .cards > .game-card:active .gc-icon { transform: scale(.94); }
}
/* 在线小绿点 / 维护变灰 */
@media (min-width: 641px) {
  html[data-cm-d="compact"] #app .cards > .game-card .gc-icon::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%; background: var(--green, #1f9d63); box-shadow: 0 0 0 2.5px #fff; }
  html[data-cm-d="compact"] #app .cards > .game-card.is-off .gc-icon { filter: grayscale(1); opacity: .5; }
  html[data-cm-d="compact"] #app .cards > .game-card.is-off .gc-icon::after { display: none; }
  html[data-cm-d="compact"] #app .cards > .game-card.is-off .gc-name { opacity: .55; }
  html[data-cm-d="compact"] #app .cards > .game-card .gc-badge { top: -2px !important; right: calc(50% - var(--lp-box) / 2 - 12px) !important; left: auto !important; font-size: 8.5px !important; padding: 1px 5px !important; letter-spacing: .5px; z-index: 2; }
}
@media (max-width: 640px) {
  html[data-cm-m="compact"] #app .cards > .game-card .gc-icon::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 50%; background: var(--green, #1f9d63); box-shadow: 0 0 0 2px #fff; }
  html[data-cm-m="compact"] #app .cards > .game-card.is-off .gc-icon { filter: grayscale(1); opacity: .5; }
  html[data-cm-m="compact"] #app .cards > .game-card.is-off .gc-icon::after { display: none; }
  html[data-cm-m="compact"] #app .cards > .game-card.is-off .gc-name { opacity: .55; }
  html[data-cm-m="compact"] #app .cards > .game-card .gc-badge { top: -4px !important; right: calc(50% - var(--lp-box) / 2 - 10px) !important; left: auto !important; font-size: 7.5px !important; padding: 0 4px !important; z-index: 2; }
}

/* 「查看全部」也做成一个图标格子 */
@media (min-width: 641px) {
  html[data-cm-d="compact"] #app .cards > .group-more { background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 4px 2px 2px !important; gap: 7px !important; justify-content: flex-start !important; color: var(--ink-2) !important; }
  html[data-cm-d="compact"] #app .cards > .group-more::before { content: "⋯"; display: grid; place-items: center; width: var(--lp-box); height: var(--lp-box); border-radius: calc(var(--lp-box) * .3); font-size: calc(var(--lp-box) * .42); font-weight: 800; color: hsl(var(--cat-h) 40% 40%); background: rgba(255, 255, 255, .55); box-shadow: inset 0 0 0 1.5px hsl(var(--cat-h) 40% 75% / .7); }
  html[data-cm-d="compact"] #app .cards > .group-more .gm-text { font-size: var(--lp-name) !important; }
  html[data-cm-d="compact"] #app .cards > .group-more .gm-sub { display: none !important; }
}
@media (max-width: 640px) {
  html[data-cm-m="compact"] #app .cards > .group-more { background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 2px 0 0 !important; gap: 6px !important; justify-content: flex-start !important; color: var(--ink-2) !important; min-height: 0 !important; }
  html[data-cm-m="compact"] #app .cards > .group-more::before { content: "⋯"; display: grid; place-items: center; width: var(--lp-box); height: var(--lp-box); border-radius: calc(var(--lp-box) * .3); font-size: calc(var(--lp-box) * .42); font-weight: 800; color: hsl(var(--cat-h) 40% 40%); background: rgba(255, 255, 255, .55); box-shadow: inset 0 0 0 1.5px hsl(var(--cat-h) 40% 75% / .7); }
  html[data-cm-m="compact"] #app .cards > .group-more .gm-text { font-size: var(--lp-name) !important; }
  html[data-cm-m="compact"] #app .cards > .group-more .gm-sub { display: none !important; }
}

/* ---------- 2026-10-31：「最新」标题一行放下 + 黑白分段切换；日期放卡片底栏 ---------- */
#app .group-new .group-title { flex-wrap: nowrap; }
#app .group-new .group-title .gt-name { white-space: nowrap; }
#app .group-new .group-title::after { order: 2; }
#app .new-mode-switch { order: 3; flex: none; display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: rgba(29, 27, 41, .07); box-shadow: inset 0 0 0 1px rgba(29, 27, 41, .08); }
#app .new-mode-switch .nms-btn { height: 28px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .18s, color .18s; }
#app .new-mode-switch .nms-btn:hover { color: var(--ink); }
#app .new-mode-switch .nms-btn.on { background: var(--ink, #1d1b29); color: #fff; box-shadow: 0 4px 10px -6px rgba(29, 27, 41, .7); }
@media (max-width: 640px) {
  #app .new-mode-switch .nms-btn { height: 26px; padding: 0 12px; font-size: 12.5px; }
}
#app #new-group .gc-date { position: static; flex: none; margin-left: 2px; font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap; }

/* 多条公告挨得近一点 */
#app .site-announce + .site-announce { margin-top: -8px; }

/* 顶栏搜索、个人中心、排序和卡片模式控件沿用分类标签的白底与毛玻璃 */
#topbar .tb-search,
#topbar .tb-profile,
#app .sort-btn,
#app .view-toggle {
  /* 标签按钮本身是白底；控件也用同一底色，避免壁纸从半透明白底透出造成色差。 */
  background: rgba(255, 255, 255, .55);
  border-color: var(--line);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
}
#topbar .tb-search:focus-within {
  background: rgba(255, 255, 255, .55);
}

/* ---------- 2026-10-31：游戏图标图片（扁平 / 拟物 / 官方），普通卡片和极简各自显示自己那张 ---------- */
#app .gc-icon { position: relative; }
#app .gc-icon .gi-img { display: none; position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
#app .gc-icon .gi-img.bare { object-fit: contain; }
#app .gc-icon .gi-img.k-skeu.full { filter: drop-shadow(0 2px 3px rgba(40, 24, 10, .28)); }
#app .gc-icon .gi-img.k-official.full { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
@media (min-width: 641px) {
  html:not([data-cm-d="compact"]) #app .gc-icon.has-n .gi-n { display: block; }
  html:not([data-cm-d="compact"]) #app .gc-icon.has-n .gi-e { visibility: hidden; }
  html:not([data-cm-d="compact"]) #app .gc-icon.n-full { background: none !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  html[data-cm-d="compact"] #app .gc-icon.has-c .gi-c { display: block; }
  html[data-cm-d="compact"] #app .gc-icon.has-c .gi-e { visibility: hidden; }
}
@media (max-width: 640px) {
  html:not([data-cm-m="compact"]) #app .gc-icon.has-n .gi-n { display: block; }
  html:not([data-cm-m="compact"]) #app .gc-icon.has-n .gi-e { visibility: hidden; }
  html:not([data-cm-m="compact"]) #app .gc-icon.n-full { background: none !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  html[data-cm-m="compact"] #app .gc-icon.has-c .gi-c { display: block; }
  html[data-cm-m="compact"] #app .gc-icon.has-c .gi-e { visibility: hidden; }
}

/* 手机 / 平板搜索：历史弹层占满手机屏宽，输入后结果紧跟搜索栏 */
@media (max-width: 640px) {
  #topbar .qs-pop {
    left: 5%;
    right: 5%;
    border-radius: 16px;
    background: #fff;
    max-height: calc(100dvh - var(--v2-topbar-h) - var(--hub-safe-top) - 8px);
  }
  #topbar .qs-games { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #topbar .qs-game-item { position: relative; min-width: 0; }
  #topbar .qs-game { width: 100%; min-height: 42px; align-items: flex-start; padding: 7px 8px; }
  #topbar .qs-game-name { white-space: normal; line-height: 1.35; overflow-wrap: anywhere; }
  #topbar .qs-game-name {
    overflow: visible;
    text-overflow: clip;
  }
  #topbar .qs-game-item.editing .qs-game { padding-right: 25px; }
  #topbar .qs-game-remove { display: none; }
  #topbar .qs-game-item.editing .qs-game-remove {
    position: absolute;
    top: -6px;
    right: -5px;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid #fff;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    font: 700 16px/1 inherit;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
    cursor: pointer;
  }
}

/* 输入搜索时，让手机和平板的结果列表贴近固定搜索栏。 */
html.quick-search-active #app > .hero,
html.quick-search-active #app .site-announce,
html.quick-search-active #app #resume-bar,
html.quick-search-active #app #active-tables,
html.quick-search-active #app #fav-section,
html.quick-search-active #app #cat-nav { display: none !important; }
html.quick-search-active #app { padding-top: 0 !important; }

/* 2026-11-17 搜索联想：「你是不是要找」 */
#app .filter-note .fn-fuzzy { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
#app .filter-note .fn-guess { height: 28px; padding: 0 10px; border: 1.5px solid var(--ink); border-radius: 14px; background: var(--paper, #fff); color: var(--ink); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
#app .filter-note .fn-guess:hover { background: var(--ink); color: #fff; }
