/* All 4 Gamers — 跨游戏导航（rail / strip / topbar / bottom cards） */
:root { --a4g-w: 238px; }

/* ---------- 全站统一顶栏 ---------- */
.a4g-topbar {
  position: sticky; top: 0; z-index: 900;
  display: flex; align-items: center; gap: 12px;
  height: 62px; padding: 0 20px;
  background: #151318; color: #fff;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.a4g-topbar * { box-sizing: border-box; }
.a4g-topbar .a4g-mark { background: transparent; }
.a4g-tb-game {
  display: flex; align-items: center; gap: 10px;
  color: #fff; text-decoration: none;
  font-size: 17px; font-weight: 800; letter-spacing: .3px;
}
.a4g-tb-game:hover { color: #fff; }
.a4g-tb-sp { flex: 1; }
.a4g-tb-link {
  padding: 8px 12px; border-radius: 8px;
  font-size: 13px; color: #cfc9ce; text-decoration: none;
}
.a4g-tb-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.a4g-tb-btn {
  display: inline-flex; align-items: center; height: 38px; padding: 0 16px;
  border-radius: 9px; background: var(--a4g-accent, #4a9afd); color: var(--a4g-accent-fg, #fff);
  font-size: 13.5px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.a4g-tb-btn:hover { filter: brightness(.93); }
.a4g-tb-lang {
  display: inline-flex; align-items: center; justify-content: center; height: 38px; padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .18); border-radius: 9px; background: transparent;
  color: #fff; font-size: 13px; font-weight: 600; font-family: inherit; line-height: 1;
  white-space: nowrap; cursor: pointer;
}
.a4g-tb-lang:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .32); }

/* ---------- 左侧常驻游戏栏（单品页桌面端） ---------- */
.a4g-rail {
  display: none;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--a4g-w);
  background: #fff;
  border-right: 1px solid #e7ecf3;
  box-shadow: 1px 0 0 rgba(16, 32, 52, .02), 6px 0 22px rgba(16, 32, 52, .04);
  z-index: 960;
  flex-direction: column;
  padding: 0 12px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.a4g-rail * { box-sizing: border-box; }

@media (min-width: 1080px) {
  .a4g-rail { display: flex; }
  body.a4g-has-rail { padding-left: var(--a4g-w); }
  body.a4g-fixed-header .header { left: var(--a4g-w); }
}

.a4g-brand {
  display: flex; align-items: center; gap: 8px;
  height: 62px; flex-shrink: 0;
  margin: 0 -12px 8px; padding: 0 18px;
  border-bottom: 1px solid #eef2f7;
  font-size: 16px; font-weight: 800; letter-spacing: .2px;
  color: #0f1923; text-decoration: none;
}
.a4g-brand em { font-style: normal; color: #4a9afd; }
.a4g-brand:hover { color: #0f1923; }

.a4g-rail-t {
  display: flex; align-items: baseline; gap: 8px;
  padding: 8px 8px 9px;
  font-size: 12px; font-weight: 700; color: #7c8ea3; letter-spacing: .3px;
}
.a4g-rail-t span { font-size: 9.5px; font-weight: 600; letter-spacing: 1.8px; color: #aab8c7; }

.a4g-games { display: flex; flex-direction: column; gap: 2px; }

.a4g-games a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 10px;
  text-decoration: none; color: #22303f;
  transition: background .14s;
}
.a4g-games a:hover { background: #f4f7fb; color: #22303f; }
.a4g-games a.on { background: #eef4ff; }
.a4g-games a.on:hover { background: #e6eeff; }

.a4g-mark {
  width: 34px; height: 34px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px; background: var(--c, #4a9afd); color: var(--f, #fff);
  font-size: 10.5px; font-weight: 800; letter-spacing: -.2px;
  overflow: hidden;
}
.a4g-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.a4g-games a.on .a4g-mark { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px rgba(74, 154, 253, .45); }

.a4g-tx { display: block; min-width: 0; flex: 1; }

.a4g-nm {
  display: block; min-width: 0;
  font-size: 13.5px; font-weight: 600; line-height: 1.25; color: #22303f;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.a4g-games a.on .a4g-nm { color: #1d4ed8; }
.a4g-ty { display: block; margin-top: 2px; font-size: 11px; color: #8b9aab; }

.a4g-all {
  margin-top: auto; padding: 12px 8px 4px;
  font-size: 12px; font-weight: 600; color: #7c8ea3; text-decoration: none;
  border-top: 1px solid #eef2f7;
}
.a4g-all:hover { color: #1d4ed8; }

/* ---------- 移动端横向游戏条 ---------- */
.a4g-strip {
  display: none;
  gap: 8px; overflow-x: auto;
  padding: 2px 0 12px; margin: 0 0 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.a4g-strip::-webkit-scrollbar { display: none; }
@media (max-width: 1079px) { .a4g-strip { display: flex; } }

.a4g-strip a {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 7px;
  padding: 6px 12px 6px 6px;
  border: 1px solid #e6ebf2; border-radius: 999px; background: #fff;
  font-size: 12.5px; font-weight: 600; color: #31404f;
  text-decoration: none; white-space: nowrap;
  transition: border-color .14s, background .14s;
}
.a4g-strip a:hover { border-color: #c8d6e6; color: #31404f; }
.a4g-strip a.on { background: #111827; border-color: #111827; color: #fff; }
.a4g-strip a.on .a4g-nm { color: #fff; }
.a4g-strip .a4g-mark { width: 24px; height: 24px; border-radius: 7px; font-size: 8.5px; }

/* ---------- 物品 / 账号 分段 tab ---------- */
.a4g-tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 0 0 12px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.a4g-tabs * { box-sizing: border-box; }
.a4g-tabs a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 999px;
  border: 1px solid #e6ebf2; background: #fff;
  font-size: 13px; font-weight: 600; color: #5b6b7c;
  text-decoration: none; white-space: nowrap;
  transition: border-color .14s, background .14s, color .14s;
}
.a4g-tabs a:hover { border-color: #c8d6e6; color: #22303f; }
.a4g-tabs a.on { background: #111827; border-color: #111827; color: #fff; }
/* 账号页的 strip / tabs 直接挂在 body 下，按内容区宽度居中 */
body > .a4g-strip { max-width: 1240px; margin: 0 auto; padding: 10px 26px 12px; }
body > .a4g-tabs { max-width: 1240px; margin: 4px auto 12px; padding: 0 26px; }
/* tabs 与单品页 .page 的 22px 上内边距对齐（桌面端 topbar 下无 strip） */
body.a4g-page-account > .a4g-tabs { margin-top: 22px; }
@media (min-width: 1080px) { body.a4g-page-item > .a4g-tabs { margin-top: 22px; } }
.a4g-tabs a span { font-size: 11px; font-weight: 500; opacity: .7; }

/* ---------- 底部「其他游戏」卡片 ---------- */
.a4g-more {
  max-width: 1240px; margin: 44px auto 8px; padding: 0 26px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.a4g-more * { box-sizing: border-box; }
.a4g-more h2 {
  display: flex; align-items: baseline; gap: 10px; margin: 0;
  font-size: 17px; font-weight: 800; color: #1b2733; letter-spacing: .2px;
}
.a4g-more h2 span { font-size: 10.5px; font-weight: 600; letter-spacing: 2px; color: #9aa9b8; }
.a4g-more .a4g-sub { margin-top: 6px; font-size: 12.5px; color: #8b9aab; }

.a4g-cards {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px; margin-top: 14px;
}
@media (max-width: 1000px) { .a4g-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.a4g-card {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid #e8ecf1; border-radius: 13px; overflow: hidden;
  text-decoration: none; color: inherit;
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.a4g-card:hover { transform: translateY(-3px); border-color: #c8d6e6; box-shadow: 0 12px 26px rgba(16, 32, 52, .1); color: inherit; }
.a4g-cover {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 120% at 50% 15%, #1a2634 0%, #0f1923 70%);
}
.a4g-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.a4g-cover.wm { font-size: 17px; font-weight: 800; letter-spacing: .2px; color: #fff; }
.a4g-cover.wm b { font-weight: 800; }
.a4g-card .a4g-cn { padding: 11px 13px 0; font-size: 14px; font-weight: 700; color: #1b2733; }
.a4g-card .a4g-cn small { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 500; color: #8b9aab; }
.a4g-card .a4g-dn {
  padding: 7px 13px 12px; font-size: 12px; line-height: 1.6; color: #74869a;
}
.a4g-card .a4g-chip {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: #f1f5fa; color: #67788b; font-size: 10.5px; font-weight: 600;
}

/* ---------- 统一外壳：单品页 ---------- */
body.a4g-page-item header.header { display: none; }
body.a4g-page-item .page { padding: 22px 26px 50px; max-width: 1240px; margin: 0 auto; }
.page > .a4g-more { padding: 0; }

/* ---------- 统一外壳：账号页 ---------- */
body.a4g-page-account { background: #fff; }
body.a4g-page-account .header {
  position: static;
  width: calc(100% - 52px); max-width: 1188px; margin: 12px auto 14px;
  padding: 24px 26px; border-radius: 16px; box-shadow: none;
}
/* 没有 tabs 的账号页（SW/BF/GTA）与没有 tabs 的单品页顶距一致 */
body.a4g-page-account:not(:has(> .a4g-tabs)) .header { margin-top: 22px; }
body.a4g-page-account .header h1 { font-size: 23px; font-weight: 800; letter-spacing: .4px; }
body.a4g-page-account .header h1 span { font-size: 12.5px; font-weight: 500; opacity: .7; margin-left: 6px; }
body.a4g-page-account .header .sub { font-size: 13.5px; opacity: .85; margin-top: 8px; }
body.a4g-page-account .header .contact { font-size: 13px; opacity: .85; margin-top: 6px; }

body.a4g-page-account .container { max-width: 1240px; padding: 0 26px; gap: 18px; }
body.a4g-page-account .main { padding: 0 0 60px; }
body.a4g-page-account .sidebar {
  top: 74px; max-height: calc(100vh - 92px);
  background: #fff; border: 1px solid #e7ecf3; border-radius: 14px;
  padding: 14px 16px 18px;
}
body.a4g-page-account .sidebar h3 { font-size: 12.5px; font-weight: 600; color: #5b6b7c; }
body.a4g-page-account .fgroup { border-bottom: 1px solid #eef2f7; }
body.a4g-page-account .chip { border-radius: 9px; font-size: 13px; padding: 6px 13px; border-color: #e7ecf3; }
body.a4g-page-account .chip.on {
  background: var(--a4g-accent); border-color: var(--a4g-accent); color: var(--a4g-accent-fg, #fff);
}
body.a4g-page-account .chip.on .cnt { color: var(--a4g-accent-fg, #fff); opacity: .75; }
body.a4g-page-account .reset {
  background: #fff; border: 1px solid #e7ecf3; color: #5b6b7c;
  border-radius: 9px; font-weight: 500;
}
body.a4g-page-account .reset:hover { background: #f4f7fb; color: #22303f; }
body.a4g-page-account .toolbar select,
body.a4g-page-account .row2 input,
body.a4g-page-account .sidebar > .fgroup > input[type=text] { border-color: #e7ecf3; border-radius: 9px; }
body.a4g-page-account .card { border: 1px solid #e7ecf3; border-radius: 12px; box-shadow: 0 1px 3px rgba(16, 32, 52, .05); }
body.a4g-page-account .grid,
body.a4g-page-account .card-grid { grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: 13px; }
body.a4g-page-account .card:hover {
  border-color: var(--a4g-accent); box-shadow: 0 10px 26px rgba(16, 32, 52, .09); transform: translateY(-2px);
}
body.a4g-page-account .card .price { font-size: 17px; }
body.a4g-page-account .pager button { border-radius: 9px; }
/* adopt-me-store 原生紫色按钮/分页/标签 → 游戏主色 */
body.a4g-page-account .btn-filter {
  background: var(--a4g-accent); color: var(--a4g-accent-fg, #fff);
  border-radius: 9px; padding: 9px; font-size: 13px; font-weight: 600;
}
body.a4g-page-account .btn-filter:hover { background: var(--a4g-accent); filter: brightness(.93); }
body.a4g-page-account .btn-reset {
  background: #fff; border: 1px solid #e7ecf3; color: #5b6b7c;
  border-radius: 9px; padding: 8px; font-size: 13px;
}
body.a4g-page-account .btn-reset:hover { background: #f4f7fb; color: #22303f; }
body.a4g-page-account .tag-group label {
  font-size: 12px; padding: 4px 9px; border-radius: 9px; border-color: #e7ecf3;
}
body.a4g-page-account .tag-group input:checked + span {
  background: var(--a4g-accent); border-color: var(--a4g-accent);
  color: var(--a4g-accent-fg, #fff); border-radius: 9px;
}
body.a4g-page-account .pagination a,
body.a4g-page-account .pagination span {
  border-radius: 9px; border-color: #e7ecf3; font-size: 13px; padding: 6px 11px;
}
body.a4g-page-account .pagination a:hover,
body.a4g-page-account .pagination .active {
  background: var(--a4g-accent); border-color: var(--a4g-accent); color: var(--a4g-accent-fg, #fff);
}
body.a4g-page-account .copy-btn {
  background: #fff6ec; color: #b2660a; border: 1px solid #ffd9bf; border-radius: 4px;
}
body.a4g-page-account .copy-btn:hover { background: #ffecd6; }
body.a4g-page-account .copy-btn.copied { background: #e7f6ec; border-color: #b7dfc4; color: #1c7a34; }

/* adopt-me 单品页卡片：对齐其余单品站的 190px 栅格 / 12px 圆角 / 1px 描边 */
body.a4g-page-item.a4g-game-am .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
body.a4g-page-item.a4g-game-am .card {
  border-width: 1px; border-color: #e7ecf3; border-radius: 12px; box-shadow: none;
}
body.a4g-page-item.a4g-game-am .card .strip { top: -1px; }
body.a4g-page-item.a4g-game-am .card:hover {
  border-color: var(--orange); box-shadow: 0 10px 26px rgba(254, 153, 32, .12); transform: translateY(-2px);
}
body.a4g-page-account .foot {
  margin-top: 40px; border-top: 1px solid #eef2f7; padding: 18px 26px 26px;
  font-size: 12px; color: #8b9aab;
}
body.a4g-page-item footer {
  margin-top: 40px; border-top: 1px solid #eef2f7; padding-top: 18px;
  font-size: 12px; color: #8b9aab;
}
body.a4g-page-account .foot a,
body.a4g-page-item footer a { color: #1d4ed8; text-decoration: none; }
body.a4g-page-account .foot a:hover,
body.a4g-page-item footer a:hover { text-decoration: underline; }
body.a4g-page-account .card .price { color: #e8590c; }

@media (max-width: 1080px) {
  body.a4g-page-account .container { flex-direction: column; padding: 0 12px; gap: 12px; }
  body.a4g-page-account .sidebar { width: 100%; position: static; max-height: none; border-radius: 14px; }
  body.a4g-page-account .main { padding: 0 0 40px; }
  body.a4g-page-account .a4g-more { padding: 0 12px; }
  body.a4g-page-account .header {
    width: auto; max-width: none;
    margin: 12px 12px 14px; padding: 20px 18px; border-radius: 14px;
  }
  body.a4g-page-item .page { padding: 16px 12px 40px; }
}

@media (max-width: 720px) {
  body.a4g-page-item.a4g-game-am .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; }
  .a4g-topbar { height: 56px; padding: 0 12px; gap: 8px; }
  .a4g-tb-game { font-size: 15px; }
  .a4g-tb-game .a4g-mark { width: 28px; height: 28px; border-radius: 8px; }
  .a4g-tb-link { display: none; }
  .a4g-tb-btn { height: 34px; padding: 0 12px; font-size: 12.5px; }
  .a4g-tb-lang { height: 34px; padding: 0 11px; font-size: 12.5px; }
  body > .a4g-strip { padding: 10px 12px 12px; }
  body > .a4g-tabs { padding: 0 12px; }
  .a4g-more { margin-top: 30px; }
  .a4g-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .a4g-card .a4g-dn { display: none; }
}

/* ---------- 导航游戏搜索 ---------- */
.a4g-search { position: sticky; top: 0; z-index: 3; background: #fff; margin: 0 -12px 8px; padding: 6px 12px; flex-shrink: 0; }
.a4g-search input {
  width: 100%; height: 34px; padding: 0 10px 0 30px;
  border: 1px solid #e3e9f1; border-radius: 9px;
  background: #f7f9fc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none'%3E%3Ccircle cx='6' cy='6' r='4.4' stroke='%2393a3b6' stroke-width='1.6'/%3E%3Cpath d='M9.5 9.5 12.4 12.4' stroke='%2393a3b6' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 10px center;
  font: inherit; font-size: 12.5px; color: #22303f; outline: none;
  -webkit-appearance: none; appearance: none;
}
.a4g-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.a4g-search input:focus { background-color: #fff; border-color: #9cc3ff; box-shadow: 0 0 0 3px rgba(74, 154, 253, .12); }
.a4g-nores { padding: 10px 8px; font-size: 12px; color: #93a3b6; }
.a4g-search-m { display: none; }
@media (max-width: 1079px) {
  .a4g-search-m { display: flex; max-width: 1240px; margin: 0 auto; padding: 10px 12px 0; }
  .a4g-search-m .a4g-search { flex: 1; margin: 0; position: relative; top: auto; background: transparent; padding: 0; z-index: auto; }
}

/* ---------- 列表加载骨架 ---------- */
.a4g-skel {
  border-radius: 10px; min-height: 148px;
  background: linear-gradient(90deg, #eef2f7 25%, #f7f9fc 37%, #eef2f7 63%);
  background-size: 400% 100%;
  animation: a4g-shimmer 1.3s ease infinite;
}
@keyframes a4g-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
html.a4g-busy::before {
  content: ""; position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 99999;
  background: linear-gradient(90deg, rgba(74, 154, 253, 0), #4a9afd, rgba(74, 154, 253, 0));
  background-size: 50% 100%;
  animation: a4g-bar .9s linear infinite;
}
@keyframes a4g-bar { 0% { background-position: -50% 0; } 100% { background-position: 150% 0; } }
@media (prefers-reduced-motion: reduce) {
  .a4g-skel { animation: none; }
  html.a4g-busy::before { animation: none; }
}
