/* ============================================================================
 *  彩虹助手 · 样式表
 *  目录：01 变量 / 02 基础 / 03 布局 / 04 侧栏 / 05 顶栏 / 06 首页 Hero
 *        07 筛选条 / 08 游戏卡片 / 09 游戏详情 / 10 工具卡片 / 11 说明与 FAQ
 *        12 页脚 / 13 移动端底栏 / 14 组件 / 15 响应式 / 16 动画
 * ========================================================================== */

/* ---------------------------------------------------------------- 01 变量 */
:root {
  /* 亮色底不再用纯白：整体偏一点冷灰蓝，长时间看不刺眼 */
  --bg: #e9eef6;
  --bg-soft: #e1e8f2;
  --surface: #f9fafc;
  --surface-2: #f1f5fa;
  --surface-3: rgba(249, 250, 252, 0.74);
  --glass: rgba(240, 244, 250, 0.86);
  --border: #dde5f0;
  --border-strong: #ccd8e8;

  --text: #16202e;
  --text-2: #47586d;
  --text-3: #7b8da3;

  --brand: #2563eb;
  --brand-2: #7c3aed;
  --accent: #06b6d4;
  --danger: #ef4444;
  --ok: #10b981;

  --shadow-sm: 0 1px 2px rgba(16, 36, 68, 0.04), 0 1px 3px rgba(16, 36, 68, 0.03);
  --shadow: 0 12px 28px -16px rgba(16, 36, 68, 0.16);
  --shadow-lg: 0 28px 60px -26px rgba(16, 36, 68, 0.26);

  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;

  --sidebar-w: 268px;
  --maxw: 1180px;

  --cta-1: #2563eb;
  --cta-2: #7c3aed;

  --c1: #6366f1;
  --c2: #8b5cf6;
}

[data-theme="dark"] {
  --bg: #070b14;
  --bg-soft: #0a1020;
  --surface: #0d1320;
  --surface-2: #121a2a;
  --surface-3: rgba(18, 26, 42, 0.72);
  --glass: rgba(10, 16, 28, 0.86);
  --border: #1c2740;
  --border-strong: #24324f;

  --text: #e8eefb;
  --text-2: #a3b0c6;
  --text-3: #6b7a94;

  --brand: #60a5fa;
  --brand-2: #a78bfa;
  --cta-1: #2563eb;
  --cta-2: #7c3aed;
  --accent: #22d3ee;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 14px 32px -16px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, 0.9);
}

/* ---------------------------------------------------------------- 02 基础 */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input { font: inherit; }
::selection { background: rgba(99, 102, 241, 0.22); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

/* 背景光晕 */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.aurora::before,
.aurora::after {
  content: "";
  position: absolute;
  width: 70vw;
  height: 70vw;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.42;
}
.aurora::before {
  left: -22vw;
  top: -30vw;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.18), transparent 66%);
}
.aurora::after {
  right: -26vw;
  top: 6vw;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.16), transparent 66%);
}
[data-theme="dark"] .aurora::before { background: radial-gradient(circle, rgba(59, 130, 246, 0.26), transparent 64%); opacity: 0.9; }
[data-theme="dark"] .aurora::after { background: radial-gradient(circle, rgba(168, 85, 247, 0.22), transparent 64%); opacity: 0.9; }

/* ---------------------------------------------------------------- 03 布局 */
.layout {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.main-inner {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px 72px;
}
@media (min-width: 1400px) {
  .main-inner { max-width: 1260px; }
}

/* ---------------------------------------------------------------- 04 侧栏 */
.sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  height: 100vh;
  padding: 26px 18px 20px;
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-right: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px;
}
.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  font-size: 21px;
  border-radius: 13px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  box-shadow: 0 10px 22px -10px rgba(37, 99, 235, 0.85);
  overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
/* 站名「彩虹助手」：彩色渐变文字，颜色缓慢流动。
   首尾同色，循环时不会出现跳变；不支持 background-clip 的浏览器自动回退成主色。 */
.brand-name {
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--brand);
  background-image: linear-gradient(92deg,
    #ff3b30 0%, #ff9500 14%, #ffcc00 28%, #34c759 42%,
    #00c7be 56%, #0a84ff 70%, #5e5ce6 84%, #bf5af2 92%, #ff3b30 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: brandRainbow 9s linear infinite;
}
@keyframes brandRainbow {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .brand-name { animation: none; }
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .brand-name {
    background-image: none;
    color: var(--brand);
    -webkit-text-fill-color: currentColor;
  }
}
.brand-slogan {
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 桌面端侧栏已有站名，这行只在窄屏出现 */
.mobile-brand { display: none; }
@media (max-width: 900px) {
  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 14px 0 4px;
  }
  .mobile-brand .brand-mark {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    font-size: 17px;
    border-radius: 10px;
  }
  .mobile-brand .brand-name { font-size: 21px; letter-spacing: 0.4px; }
}

.side-label {
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-3);
}

.side-nav { display: flex; flex-direction: column; gap: 4px; }

.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.side-link span.ico { font-size: 16px; line-height: 1; }
.side-link:hover {
  background: var(--surface-2);
  color: var(--text);
  transform: translateX(3px);
}
.side-link.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(124, 58, 237, 0.12));
  color: var(--brand);
  font-weight: 700;
}
[data-theme="dark"] .side-link.active {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.16), rgba(167, 139, 250, 0.16));
  color: #c7ddff;
}

.side-games {
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  min-height: 0;
  padding-right: 2px;
}
.side-games::-webkit-scrollbar { width: 4px; }
.side-games::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

.side-game {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-2);
  transition: background-color 0.18s ease, color 0.18s ease;
}
.side-game .dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--c1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}
.side-game .txt { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.side-game:hover { background: var(--surface-2); color: var(--text); }
.side-game.active { color: var(--brand); font-weight: 700; background: var(--surface-2); }

.side-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.side-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--cta-1), var(--cta-2));
  color: #fff;
  box-shadow: 0 12px 24px -14px rgba(37, 99, 235, 0.9);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.side-cta:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -14px rgba(37, 99, 235, 0.9); }
.side-meta {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-3);
  text-align: center;
}

/* ---------------------------------------------------------------- 05 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  background: linear-gradient(var(--bg) 62%, rgba(243, 246, 252, 0));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
[data-theme="dark"] .topbar { background: linear-gradient(var(--bg) 62%, rgba(7, 11, 20, 0)); }

.search {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 14px;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}
.search .ico { font-size: 15px; opacity: 0.65; }
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.search input::placeholder { color: var(--text-3); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search kbd {
  flex: 0 0 auto;
  padding: 2px 7px;
  font-family: inherit;
  font-size: 11px;
  color: var(--text-3);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface-2);
}

.top-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 17px;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}
.icon-btn:hover { transform: translateY(-2px); border-color: var(--border-strong); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 44px;
  padding: 0 15px;
  border-radius: 13px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: color 0.18s ease, transform 0.18s ease;
  flex: 0 0 auto;
}
.back-link:hover { color: var(--brand); transform: translateX(-2px); }

.crumb {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-3);
  overflow: hidden;
}
.crumb b { color: var(--text); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------- 06 Hero */
.hero { padding: 34px 0 8px; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 8px;
  margin-bottom: 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  background: rgba(37, 99, 235, 0.09);
  border: 1px solid rgba(37, 99, 235, 0.16);
}
[data-theme="dark"] .hero-badge {
  color: #a9c8ff;
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.2);
}
.hero-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
  animation: pulse 2.4s ease-in-out infinite;
}

.hero h1 {
  font-size: clamp(27px, 3.6vw, 42px);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.02em;
  max-width: 20em;
  text-wrap: pretty;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(115deg, #2563eb, #7c3aed 55%, #06b6d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
[data-theme="dark"] .hero h1 em {
  background: linear-gradient(115deg, #60a5fa, #a78bfa 55%, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-desc {
  max-width: 40em;
  margin-top: 14px;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--text-2);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.stat {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 10px 15px;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.stat b {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat span { font-size: 12.5px; color: var(--text-3); }

.notice-bar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 24px;
  padding: 13px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-2);
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.22);
}
[data-theme="dark"] .notice-bar {
  color: #e8d3a8;
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.24);
}
.notice-bar .ico { flex: 0 0 auto; font-size: 15px; line-height: 1.5; }

/* ---------------------------------------------------------------- 07 筛选 */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 40px 0 16px;
  flex-wrap: wrap;
}
.section-head h2 {
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.section-head h2 .count {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  background: rgba(37, 99, 235, 0.1);
  padding: 2px 9px;
  border-radius: 999px;
}
[data-theme="dark"] .section-head h2 .count { color: #b9d4ff; background: rgba(96, 165, 250, 0.14); }
.section-head .hint { font-size: 12.5px; color: var(--text-2); opacity: 0.8; }

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.18s ease;
  white-space: nowrap;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); transform: translateY(-1px); }
.chip.active {
  color: #fff;
  background: linear-gradient(135deg, var(--cta-1), var(--cta-2));
  border-color: transparent;
  box-shadow: 0 10px 22px -12px rgba(37, 99, 235, 0.9);
}
.chip .n { font-size: 11px; opacity: 0.75; }

/* ---------------------------------------------------------------- 08 游戏卡片 */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 20px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.35, 1.1),
    box-shadow 0.32s ease, border-color 0.32s ease;
}
.game-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--c1), var(--c2));
  opacity: 0;
  transition: opacity 0.32s ease;
}
.game-card::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -50px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--c1-soft), transparent 72%);
  opacity: 0.5;
  pointer-events: none;
  transition: transform 0.35s ease;
}
.game-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--c1-soft-2);
}
.game-card:hover::before { opacity: 1; }
.game-card:hover::after { transform: scale(1.18); }

.gc-head { display: flex; align-items: center; gap: 13px; position: relative; z-index: 1; }

.game-icon {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  display: grid;
  place-items: center;
  font-size: 26px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--c1-soft), var(--c2-soft));
  border: 1px solid var(--c1-soft-2);
  overflow: hidden;
  line-height: 1;
}
.game-icon img { width: 100%; height: 100%; object-fit: cover; }
.game-icon.xl {
  width: 76px;
  height: 76px;
  flex-basis: 76px;
  font-size: 38px;
  border-radius: 20px;
}

.gc-title { min-width: 0; flex: 1; }
.gc-name {
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.gc-cat { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

.gc-desc {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.gc-tags { display: flex; flex-wrap: wrap; gap: 6px; position: relative; z-index: 1; }
.tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 7px;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.gc-scripts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  position: relative;
  z-index: 1;
}
.gc-script {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--c1);
  background: var(--c1-soft);
  border: 1px solid var(--c1-soft-2);
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
[data-theme="dark"] .gc-script { color: #cdd9ff; }

.gc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  color: var(--text-3);
  position: relative;
  z-index: 1;
}
.gc-go {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--c1);
  transition: gap 0.2s ease;
}
[data-theme="dark"] .gc-go { color: #a9c8ff; }
.game-card:hover .gc-go { gap: 9px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1.6;
  white-space: nowrap;
}
.pill.hot { color: #fff; background: linear-gradient(135deg, #f97316, #ef4444); }
.pill.ok { color: #047857; background: rgba(16, 185, 129, 0.14); border: 1px solid rgba(16, 185, 129, 0.28); }
[data-theme="dark"] .pill.ok { color: #6ee7b7; }
.pill.warn { color: #b45309; background: rgba(245, 158, 11, 0.14); border: 1px solid rgba(245, 158, 11, 0.3); }
[data-theme="dark"] .pill.warn { color: #fcd34d; }
.pill.beta { color: #6d28d9; background: rgba(139, 92, 246, 0.14); border: 1px solid rgba(139, 92, 246, 0.28); }
[data-theme="dark"] .pill.beta { color: #c4b5fd; }
.pill.new {
  color: #fff;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  box-shadow: 0 6px 14px -8px rgba(16, 185, 129, 0.9);
}

/* ---------------------------------------------------------------- 09 游戏详情 */
.game-hero {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding: 24px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.game-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--c1), var(--c2));
}
.game-hero::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -70px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--c1-soft), transparent 74%);
  opacity: 0.6;
  pointer-events: none;
}
.gh-main { display: flex; gap: 18px; flex: 1 1 380px; min-width: 0; position: relative; z-index: 1; }
.gh-text { min-width: 0; }
.gh-name {
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.gh-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.gh-desc { margin-top: 11px; font-size: 13.5px; line-height: 1.7; color: var(--text-2); max-width: 46em; }

.gh-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.gh-stat {
  min-width: 88px;
  padding: 11px 14px;
  border-radius: 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  text-align: center;
}
.gh-stat b { display: block; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.gh-stat span { font-size: 11.5px; color: var(--text-3); }

.gh-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; position: relative; z-index: 1; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  transition: all 0.2s ease;
  cursor: pointer;
}
.btn:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.btn.primary {
  background: linear-gradient(135deg, var(--cta-1), var(--cta-2));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 12px 24px -14px rgba(37, 99, 235, 0.9);
}
.btn.primary:hover { box-shadow: 0 16px 30px -14px rgba(37, 99, 235, 0.95); }

/* ---------------------------------------------------------------- 10 工具卡片 */
.script-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(345px, 1fr));
  gap: 18px;
}

.script-card {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 20px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.35, 1.1),
    box-shadow 0.3s ease, border-color 0.3s ease;
}
.script-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}
.script-card.dim { opacity: 0.72; }

.sc-head { display: flex; align-items: flex-start; gap: 12px; }
.sc-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  font-size: 22px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--c1-soft), var(--c2-soft));
  border: 1px solid var(--c1-soft-2);
  overflow: hidden;
  line-height: 1;
}
.sc-icon img { width: 100%; height: 100%; object-fit: cover; }
.sc-title-wrap { flex: 1; min-width: 0; }
.sc-title {
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sc-ver {
  font-size: 11px;
  font-weight: 700;
  padding: 1.5px 7px;
  border-radius: 6px;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.sc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  margin-top: 4px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-2);
}
.sc-meta .sc-game { margin-right: 0; }

.sc-game {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 7px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--c1);
  background: var(--c1-soft);
  border: 1px solid var(--c1-soft-2);
  vertical-align: 1px;
  transition: filter 0.18s ease;
}
.sc-game:hover { filter: brightness(0.96); }
[data-theme="dark"] .sc-game { color: #cdd9ff; }

.sc-desc { font-size: 13px; line-height: 1.68; color: var(--text-2); }

.sc-features { display: flex; flex-wrap: wrap; gap: 6px; }
.sc-feature {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 7px;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}
.link-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  overflow: hidden;
}
.link-btn:hover {
  transform: translateY(-2px);
  border-color: var(--c1-soft-2);
  background: var(--c1-soft);
  color: var(--c1);
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .link-btn:hover { color: #cdd9ff; }
.link-btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  border-color: transparent;
  box-shadow: 0 12px 22px -14px var(--c1);
}
.link-btn.primary:hover {
  color: #fff;
  box-shadow: 0 18px 30px -16px var(--c1);
  filter: saturate(1.08);
}
.link-btn.disabled {
  pointer-events: none;
  opacity: 0.45;
}
.link-btn .lb-txt {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.link-btn .flag {
  flex: 0 0 auto;
  white-space: nowrap;
  margin-left: 2px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.6;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.26);
  color: inherit;
}
.link-btn:not(.primary) .flag {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}
[data-theme="dark"] .link-btn:not(.primary) .flag { color: #fca5a5; background: rgba(239, 68, 68, 0.18); }

/* 使用说明 */
.guide-card {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.guide-card h3 {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.guide-list { display: flex; flex-direction: column; gap: 7px; }
.guide-list li {
  position: relative;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-2);
}
.guide-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
  opacity: 0.65;
}

/* ---------------------------------------------------------------- 11 FAQ */
.faq { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color 0.2s ease;
}
.faq-item[open] { border-color: var(--border-strong); }
.faq-item summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "＋";
  margin-left: auto;
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-3);
  transition: transform 0.25s ease;
}
.faq-item[open] summary::after { content: "－"; }
.faq-item summary:hover { color: var(--brand); }
.faq-body {
  padding: 0 18px 16px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-2);
}

/* 联系区块 */
.contact-row { display: flex; flex-wrap: wrap; gap: 10px; }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 64px 20px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  text-align: center;
}
.empty .big { font-size: 34px; }
.empty p { font-size: 14px; color: var(--text-2); }
.empty small { font-size: 12px; color: var(--text-3); }

.other-games { margin-top: 34px; }
.other-games .chips { margin-bottom: 0; }

/* ---------------------------------------------------------------- 12 页脚 */
.site-foot {
  margin-top: 52px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  flex-wrap: wrap;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-3);
}
.site-foot .left { max-width: 62em; }
.site-foot b { color: var(--text-2); font-weight: 700; }

/* ---------------------------------------------------------------- 13 移动端底栏 */
.tabbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 26px -18px rgba(15, 27, 45, 0.4);
}
.tabbar-inner {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px 4px;
  border-radius: 11px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-3);
  transition: color 0.18s ease, background-color 0.18s ease;
}
.tab .ico { font-size: 17px; line-height: 1.3; }
.tab.active { color: var(--brand); background: rgba(37, 99, 235, 0.09); }
[data-theme="dark"] .tab.active { color: #a9c8ff; background: rgba(96, 165, 250, 0.14); }

/* ---------------------------------------------------------------- 14 组件 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 400;
  transform: translate(-50%, 14px);
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: rgba(15, 27, 45, 0.94);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.24s ease;
  max-width: calc(100vw - 32px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
[data-theme="dark"] .toast { background: rgba(232, 238, 251, 0.96); color: #0b1220; }

.skeleton {
  height: 168px;
  border-radius: var(--r-lg);
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 220% 100%;
  border: 1px solid var(--border);
  animation: shimmer 1.3s linear infinite;
}

/* ---------------------------------------------------------------- 15 响应式 */
@media (max-width: 1080px) {
  :root { --sidebar-w: 236px; }
  .main-inner { padding: 0 24px 64px; }
}

@media (max-width: 900px) {
  .sidebar { display: none; }
  .tabbar { display: block; }
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .script-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .main-inner { padding: 0 16px 48px; }
  .topbar { padding: 11px 0; gap: 9px; }
  .search { height: 42px; padding: 0 12px; }
  .search kbd { display: none; }
  .icon-btn, .back-link { height: 42px; }
  .icon-btn { width: 42px; }

  .hero { padding: 22px 0 4px; }
  /* keep-all：中文只在标点处断行，避免出现「点 / 开就能用」这种断法 */
  .hero h1 { max-width: 10.4em; word-break: keep-all; overflow-wrap: anywhere; }
  .hero-desc { font-size: 13.5px; }
  .hero-stats { gap: 8px; margin-top: 16px; }
  .stat { padding: 8px 12px; gap: 6px; }
  .stat b { font-size: 17px; }

  .section-head { margin: 30px 0 13px; }
  .section-head h2 { font-size: 18px; }

  .game-grid { grid-template-columns: 1fr; gap: 14px; }
  .game-card { padding: 17px; border-radius: 17px; gap: 11px; }
  .game-icon { width: 48px; height: 48px; flex-basis: 48px; font-size: 23px; border-radius: 14px; }

  .game-hero { padding: 18px; gap: 16px; margin-top: 14px; border-radius: 17px; }
  .gh-main { flex-direction: column; gap: 13px; }
  .gh-stats { width: 100%; }
  .gh-stat { flex: 1; min-width: 0; padding: 9px 10px; }
  .gh-stat b { font-size: 16px; }
  .gh-actions { width: 100%; }
  .gh-actions .btn { flex: 1; }

  .script-card { padding: 17px; border-radius: 17px; }
  .link-btn { font-size: 12.5px; min-height: 40px; }

  .site-foot { font-size: 11.5px; }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------------- 16 动画 */
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.08); }
}
@keyframes shimmer {
  from { background-position: 120% 0; }
  to { background-position: -80% 0; }
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.rise { animation: riseIn 0.42s cubic-bezier(0.2, 0.9, 0.3, 1) both; }


/* ---------------------------------------------------------------- 17 更新日志弹层 */
.link-btn.logs-btn .flag {
  background: var(--c1-soft);
  color: var(--c1);
  font-size: 9px;
  padding: 0 4px;
}
[data-theme="dark"] .link-btn.logs-btn .flag { color: #cdd9ff; background: rgba(255, 255, 255, 0.08); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.show { display: flex; }
.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(8, 15, 30, 0.52);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal-card {
  position: relative;
  width: min(560px, 100%);
  max-height: min(88vh, 780px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn 0.26s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 16px; }
.modal-head p { margin-top: 4px; font-size: 12px; color: var(--text-3); }
.modal-x {
  margin-left: auto;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-size: 13px;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: all 0.18s ease;
}
.modal-x:hover { color: var(--text); border-color: var(--border-strong); }
.modal-body { padding: 4px 20px 20px; overflow-y: auto; }

.log-list { display: flex; flex-direction: column; }
.log-item {
  position: relative;
  margin-left: 6px;
  padding: 15px 0 15px 20px;
  border-left: 1px solid var(--border-strong);
}
.log-item:last-child { border-left-color: transparent; }
.log-dot {
  position: absolute;
  left: -4.5px;
  top: 21px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}
.log-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.log-top b { font-size: 13px; font-weight: 800; }
.log-top span { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.log-text { margin-top: 6px; font-size: 13px; line-height: 1.72; color: var(--text-2); }
.log-empty { padding: 40px 10px; text-align: center; font-size: 13px; color: var(--text-3); }

body.modal-open { overflow: hidden; }

@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* 页脚数据来源提示 */
.foot-note { margin-top: 6px; font-size: 11.5px; }
.foot-note.warn { color: #b45309; }
[data-theme="dark"] .foot-note.warn { color: #fcd34d; }

/* 页脚后台入口 */
.foot-admin {
  font-size: 11.5px;
  color: var(--text-3);
  border-bottom: 1px dashed var(--border-strong);
  transition: color 0.18s ease;
}
.foot-admin:hover { color: var(--brand); }

/* ============================================================================
 *  18 v3 结构：单工具卡片、游戏面板、赞助码页
 * ========================================================================== */

.game-card { cursor: pointer; }
.game-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

.stat-link { text-decoration: none; transition: transform 0.18s ease, border-color 0.18s ease; }
.stat-link:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.stat-link b { font-size: 18px; }

/* ---------------------------------------------------------------- 工具框 */
.script-box {
  position: relative;
  margin-top: 16px;
  padding: 20px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.sb-head { display: flex; align-items: center; gap: 13px; }
.sb-icon {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  display: grid;
  place-items: center;
  font-size: 24px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--c1-soft), var(--c2-soft));
  border: 1px solid var(--c1-soft-2);
  overflow: hidden;
  line-height: 1;
}
.sb-icon img { width: 100%; height: 100%; object-fit: cover; }
.sb-title-wrap { min-width: 0; flex: 1; }
.sb-title {
  font-size: 17px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sb-meta { margin-top: 3px; font-size: 11.5px; color: var(--text-3); }
.sb-desc { margin-top: 12px; font-size: 13px; line-height: 1.7; color: var(--text-2); }

.btn-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}
.btn-grid .link-btn { min-height: 46px; }

.link-btn.qq-btn {
  color: #0284c7;
  background: rgba(14, 165, 233, 0.09);
  border-color: rgba(14, 165, 233, 0.26);
}
.link-btn.qq-btn:hover {
  color: #0369a1;
  background: rgba(14, 165, 233, 0.16);
  border-color: rgba(14, 165, 233, 0.4);
}
[data-theme="dark"] .link-btn.qq-btn { color: #7dd3fc; border-color: rgba(56, 189, 248, 0.3); }

.qq-line {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  color: var(--text-3);
}
.qq-line b { color: var(--text-2); font-variant-numeric: tabular-nums; letter-spacing: 0.3px; }

/* ---------------------------------------------------------------- 游戏面板弹层 */
.panel-card { width: min(640px, 100%); }
.panel-x { position: absolute; top: 14px; right: 14px; z-index: 3; }
.panel-body { flex: 1; min-height: 0; padding: 24px 22px 14px; overflow-y: auto; }
.panel-head { display: flex; gap: 16px; align-items: flex-start; padding-right: 26px; }
.panel-title-wrap { min-width: 0; }
.panel-title {
  font-size: 21px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.panel-desc { margin-top: 10px; font-size: 13px; line-height: 1.7; color: var(--text-2); }
.panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 22px 14px;
  border-top: 1px solid var(--border);
}
#panelPage { font-size: 12.5px; font-weight: 700; color: var(--brand); }
#panelPage:hover { text-decoration: underline; }
.panel-copy { font-size: 12.5px; color: var(--text-3); transition: color 0.18s ease; }
.panel-copy:hover { color: var(--text); }

/* ---------------------------------------------------------------- 赞助码页 */
.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}
.price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 20px 18px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.35, 1.1), box-shadow 0.25s ease, border-color 0.25s ease;
}
.price-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.price-card.hot { border-color: rgba(37, 99, 235, 0.35); box-shadow: 0 20px 40px -26px rgba(37, 99, 235, 0.55); }
[data-theme="dark"] .price-card.hot { border-color: rgba(96, 165, 250, 0.4); }

.price-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #f97316, #ef4444);
  box-shadow: 0 6px 14px -8px rgba(239, 68, 68, 0.9);
}
.price-name { font-size: 13px; font-weight: 700; color: var(--text-2); }
.price-num {
  margin: 6px 0 2px;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.price-num small { font-size: 15px; font-weight: 700; margin-right: 2px; }
.price-desc { font-size: 12.5px; color: var(--text-3); }
.price-btn { margin-top: 14px; width: 100%; height: 42px; }
.price-btn.disabled { pointer-events: none; opacity: 0.5; }

.steps { display: flex; flex-direction: column; gap: 10px; }
.step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
}
.step-n {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--cta-1), var(--cta-2));
}

@media (max-width: 640px) {
  .btn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .script-box { padding: 17px; border-radius: 17px; }
  .panel-body { padding: 20px 16px 4px; }
  .panel-head { gap: 13px; }
  .panel-title { font-size: 18px; }
  .panel-foot { padding: 12px 16px 14px; flex-wrap: wrap; }
  .price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .price-card { padding: 16px 14px; border-radius: 16px; }
  .price-num { font-size: 27px; }
}

/* ============================================================================
   栏目面板 + 条目卡片（v3.2：照参考站结构，栏目切换 + 条目内 2 列按钮）
   ========================================================================== */

.panel { display: none; }
.panel.active { display: block; animation: panelIn 0.26s ease both; }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.page-head { margin: 6px 0 18px; }
.page-head h1 {
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 800;
  margin: 0 0 8px;
  max-width: 22em;
  text-wrap: pretty;
}
.page-head h1 em {
  font-style: normal;
  background: linear-gradient(115deg, #2563eb, #7c3aed 55%, #06b6d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
[data-theme="dark"] .page-head h1 em {
  background: linear-gradient(115deg, #60a5fa, #a78bfa 55%, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.page-head p { margin: 0; color: var(--text-2); font-size: 14px; max-width: 52em; }

/* 侧栏栏目按钮：复用 .side-link 外观，去掉默认按钮样式 */
.side-link {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

/* 条目网格 */
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 16px;
  margin-top: 4px;
}
.item-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 26px -18px rgba(15, 23, 42, 0.28);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.item-card::before {
  content: "";
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent, #2563eb);
  opacity: 0.75;
}
.item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.05), 0 18px 36px -20px rgba(15, 23, 42, 0.34);
}
.item-card:focus-visible { outline: 2px solid var(--accent, #2563eb); outline-offset: 2px; }

.ic-head { display: flex; align-items: flex-start; gap: 11px; padding-left: 4px; }
.ic-title { min-width: 0; flex: 1; }
.ic-title h3 {
  margin: 0 0 4px;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.ic-meta {
  font-size: 12px;
  color: var(--text-3, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ic-desc {
  margin: 0;
  padding-left: 4px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.item-card .gc-tags { padding-left: 4px; margin: 0; }

/* 卡片内按钮：2 列（参考站排布） */
.ib-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 2px;
}
.ib-grid .link-btn { min-height: 40px; font-size: 12.8px; }

.ic-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  color: var(--text-3, #94a3b8);
}
.ic-more { color: var(--accent, #2563eb); font-weight: 700; text-decoration: none; white-space: nowrap; }
.ic-more:hover { text-decoration: underline; }

/* 说明必看：步骤条 */
.guide-steps { display: grid; gap: 12px; }
.guide-step {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.gs-no {
  flex: 0 0 28px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px;
  background: linear-gradient(140deg, #2563eb, #7c3aed);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.gs-body h3 { margin: 2px 0 6px; font-size: 15px; font-weight: 700; }
.gs-body p { margin: 0; font-size: 13.8px; line-height: 1.7; color: var(--text-2); }

.empty.small { padding: 26px 0; }

@media (max-width: 640px) {
  .item-grid { grid-template-columns: 1fr; gap: 13px; }
  .item-card { padding: 14px; border-radius: 14px; }
  .page-head { margin: 2px 0 14px; }
  /* keep-all：只在标点处断行，避免「每个游戏一 / 个工具，点」这种断法 */
  .page-head h1 { font-size: 21px; max-width: none; word-break: keep-all; overflow-wrap: anywhere; }
  .page-head p { font-size: 13px; }
  .guide-step { padding: 14px; gap: 11px; }
}

/* 页脚备案号（有值才渲染） */
.site-foot .foot-beian {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: center;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--text-3);
}
.site-foot .foot-beian a {
  color: var(--text-3);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
}
.site-foot .foot-beian a:hover { color: var(--brand); border-bottom-color: currentColor; }


/* ============================================================================
   购买页：按游戏分组的商品 / 服务卡片
   ========================================================================== */
.market-desc {
  margin: 0 0 14px;
  color: var(--text-2);
  font-size: 13.5px;
  max-width: 60em;
}
#marketSection .notice-bar { margin-bottom: 6px; }
.mk-group { margin-top: 26px; }
.mk-group:first-child { margin-top: 4px; }
.mk-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.mk-icon {
  flex: 0 0 34px;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  font-size: 18px;
  background: var(--c1-soft, rgba(99, 102, 241, 0.12));
  border: 1px solid var(--border);
  overflow: hidden;
}
.mk-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.mk-head h3 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -0.01em; }
.mk-count {
  font-size: 11.5px;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 1px 8px;
  border-radius: 999px;
}
.mk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.mk-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 26px -20px rgba(15, 23, 42, 0.28);
}
.mk-card.hot { border-color: rgba(245, 158, 11, 0.45); }
.mk-img {
  flex: 0 0 84px;
  width: 84px; height: 84px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.mk-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mk-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.mk-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.4;
}
.mk-type {
  font-size: 10.5px;
  font-weight: 700;
  color: #1d4ed8;
  background: #e8f0ff;
  border: 1px solid #c7dbff;
  border-radius: 999px;
  padding: 1px 7px;
}
[data-theme="dark"] .mk-type { color: #b9d4ff; background: rgba(96, 165, 250, 0.16); border-color: rgba(96, 165, 250, 0.3); }
.mk-price { font-size: 19px; font-weight: 800; color: var(--text); line-height: 1.1; }
.mk-price small { font-size: 12px; font-weight: 700; margin-right: 1px; }
.mk-price i { font-style: normal; font-size: 11.5px; color: var(--text-3); margin-left: 3px; font-weight: 600; }
.mk-price > i:only-child { font-size: 14px; font-weight: 700; color: var(--text-2); margin-left: 0; }
.mk-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mk-card .ib-grid { grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; }
.mk-card .ib-grid.one { grid-template-columns: 1fr; }
.mk-card .link-btn { min-height: 36px; font-size: 12.5px; }
@media (max-width: 640px) {
  .mk-grid { grid-template-columns: 1fr; }
  .mk-img { flex-basis: 64px; width: 64px; height: 64px; }
}

/* ============================================================================
   v3.4 三板块：游戏弹层 / 赞助码按游戏分组 / 其他购买
   ========================================================================== */

/* 游戏卡片底部两个入口 */
.ic-cta {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 8px;
  margin-top: 2px;
}
.ic-cta .link-btn { min-height: 40px; font-size: 12.8px; }

/* ---------------- 游戏弹层：四个入口 ---------------- */
.gm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin: 16px 0 4px;
}
.gm-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.gm-btn:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px -14px rgba(16, 36, 68, 0.5);
}
.gm-btn.primary {
  background: linear-gradient(135deg, var(--cta-1), var(--cta-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 22px -14px rgba(37, 99, 235, 0.9);
}
.gm-btn.primary:hover { border-color: transparent; }
.gm-btn.disabled,
.gm-btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.gm-ico {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.gm-btn.primary .gm-ico {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.24);
}
.gm-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.gm-txt b { font-size: 13px; font-weight: 700; }
.gm-txt small {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gm-btn.primary .gm-txt small { color: rgba(255, 255, 255, 0.86); }
.gm-arrow { flex: 0 0 auto; font-size: 12px; opacity: 0.65; }

.gm-logbox {
  margin-top: 14px;
  padding: 13px 14px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.gm-logbox[hidden] { display: none; }
.gm-log-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.gm-log-head h3 { margin: 0; font-size: 13.5px; font-weight: 800; }
.gm-log-head span { font-size: 11px; color: var(--text-3); }
.gm-logbox .log-list { max-height: 220px; overflow-y: auto; padding-right: 2px; }
.gm-log-empty { margin: 0; font-size: 12.5px; color: var(--text-3); }

/* ---------------- 赞助码：按游戏分组 ---------------- */
.sp-group { margin-top: 26px; }
.sp-group:first-child { margin-top: 4px; }
.sp-group + .sp-group { border-top: 1px dashed var(--border); padding-top: 20px; }
.sp-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.sp-group-title { display: flex; flex-direction: column; gap: 2px; }
.sp-group-title h3 { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }
.sp-group-title span { font-size: 11.5px; color: var(--text-3); }

.sp-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 840px;
}
.sp-buy {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.sp-buy:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -18px rgba(16, 36, 68, 0.55);
}
.sp-buy-main { flex: 1; min-width: 0; }
.sp-buy-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
}
.sp-buy-note {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  color: #b45309;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.sp-go {
  flex: 0 0 auto;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--brand);
  background: rgba(37, 99, 235, 0.09);
  padding: 5px 9px;
  border-radius: 9px;
  white-space: nowrap;
}
[data-theme="dark"] .sp-go { background: rgba(96, 165, 250, 0.14); }

.panel-sec { margin-top: 24px; }

/* ---------------- 其他购买：卖家信息 ---------------- */
.mk-seller {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-3);
  padding-top: 2px;
}
.mk-seller b { color: var(--text-2); font-weight: 700; }

@media (max-width: 640px) {
  .gm-actions { grid-template-columns: 1fr; }
  .ic-cta { grid-template-columns: 1fr 1fr; }
}

/* 游戏弹层四个入口：按下 / 展开的视觉反馈（v3.4.2） */
.gm-btn { -webkit-tap-highlight-color: transparent; }
.gm-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.gm-btn:active { transform: scale(0.985); }
.gm-btn.is-pressed {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
  filter: brightness(0.98);
}
.gm-btn.is-pressed:not(.primary) { background: rgba(37, 99, 235, 0.12); }
.gm-btn.primary.is-pressed {
  border-color: rgba(255, 255, 255, 0.55);
  filter: brightness(1.08);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.65), 0 0 0 5px rgba(124, 58, 237, 0.32),
    0 10px 22px -14px rgba(37, 99, 235, 0.9);
}
.gm-arrow { transition: transform 0.2s ease; }
.gm-btn.is-open {
  border-color: rgba(37, 99, 235, 0.42);
  background: rgba(37, 99, 235, 0.07);
}
.gm-btn.is-open .gm-arrow { transform: rotate(180deg); }
[data-theme="dark"] .gm-btn.is-open {
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(96, 165, 250, 0.12);
}

/* ============================================================================
   v3.5 赞助码：游戏板块 + 卖家弹层
   ========================================================================== */
.sp-blocks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.sp-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.sp-block:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: 0 14px 28px -22px rgba(16, 36, 68, 0.55);
}
.sp-block:active { transform: scale(0.99); }
.sp-block-ico {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  font-size: 22px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
}
.sp-block-ico img { width: 100%; height: 100%; object-fit: cover; }
.sp-block-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sp-block-main b { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }
.sp-block-main small { font-size: 11.5px; color: var(--text-3); }
.sp-block-main em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-block-go {
  flex: 0 0 auto;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--brand);
  background: rgba(37, 99, 235, 0.09);
  padding: 6px 10px;
  border-radius: 9px;
  white-space: nowrap;
}
[data-theme="dark"] .sp-block-go { background: rgba(96, 165, 250, 0.14); }
/* 没有卖家的板块：按钮改成灰字，避免「去购买」点进去是空的 */
.sp-block.is-empty .sp-block-go {
  color: var(--text-3);
  background: var(--surface-2);
  font-weight: 700;
}

/* 购买弹层 */
.sp-modal { width: min(600px, 100%); }
.sp-modal-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sp-modal-ico {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 21px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
}
.sp-modal-ico img { width: 100%; height: 100%; object-fit: cover; }
.seller-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.seller-card + .seller-card { margin-top: 10px; }
.seller-head {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 14px;
}
.seller-head b { font-size: 14.5px; font-weight: 800; }
.seller-note { font-size: 11.5px; color: var(--text-3); }
.seller-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.seller-actions .link-btn { min-height: 38px; font-size: 12.5px; }
.seller-contact { margin-top: 8px; font-size: 11.5px; color: var(--text-3); }
.seller-contact span { color: var(--text-2); font-weight: 700; }
.sp-modal-tip { font-size: 11.5px; color: var(--text-3); }

@media (max-width: 640px) {
  .sp-blocks { grid-template-columns: 1fr; }
  .seller-actions { grid-template-columns: 1fr 1fr; }
  .seller-actions .link-btn:last-child { grid-column: 1 / -1; }
}

/* ---------------------------------------------------------------- 购买板块：上下分隔 */
.buy-split {
  height: 0;
  margin: 40px 0 24px;
  border-top: 1px dashed var(--border-strong);
  position: relative;
}


.page-head.is-sub { margin-bottom: 12px; }
.page-head.is-sub h2 {
  font-family: var(--font-display, inherit);
  font-size: 20px;
  line-height: 1.4;
}
.page-head.is-sub p { font-size: 12.5px; }

@media (max-width: 560px) {
  .buy-split { margin: 30px 0 18px; }
  .page-head.is-sub h2 { font-size: 18px; }
}
