:root {
  --blue: #4f8dfe;
  --blue-dark: #3a78e8;
  --bg: #eef2f8;
  --card: #ffffff;
  --text: #1c2434;
  --muted: #8b95a8;
  --line: #e3e9f2;
  --radius: 12px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }

/* 顶栏 */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 11px 14px 9px;
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  text-align: center;
}
.brand {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .4px;
  color: #b8791a;
}
.domain {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.domain b {
  display: inline-block;
  margin: 0 4px;
  padding: 1px 9px;
  border: 1px solid #f0c674;
  border-radius: 20px;
  color: #b8791a;
  font-weight: 600;
  background: #fffaf0;
}
.domain .suffix { margin-left: 4px; }

/* 广告位：一行五个，统一比例 */
.ads-wrap {
  max-width: 1180px;
  margin: 10px auto 0;
  padding: 0 10px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}
.ad-card {
  display: block;
  background: none;
  border: 0;
  box-shadow: none;
}
.ad-card .ad-media {
  width: 100%;
  aspect-ratio: 2.22 / 1;
  background: #eef3fb;
  border-radius: 8px;
  overflow: hidden;
}
.ad-card .ad-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ad-name {
  display: block;
  margin-top: 4px;
  padding: 0 2px;
  font-size: 10.5px;
  line-height: 1.3;
  color: #6b7688;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: none;
}

/* 主体 */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 13px 10px 30px;
}
.section-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 4px 0 9px;
}
.section-head h2 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  padding-left: 8px;
  border-left: 3px solid var(--blue);
  line-height: 1.1;
}
.count { font-size: 11.5px; color: var(--muted); }

/* 搜索 */
.search-box {
  position: relative;
  margin-bottom: 11px;
}
.search-box svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: #a9b4c7;
}
.search-box input {
  width: 100%;
  height: 38px;
  padding: 0 13px 0 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.search-box input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(79, 141, 254, .12);
}

/* 游戏网格：一行五个 */
.grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}
.game-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 6px 5px 7px;
  text-align: center;
  box-shadow: 0 1px 6px rgba(30, 50, 90, .06);
  transition: transform .16s ease, box-shadow .16s ease;
  cursor: pointer;
}
.game-card:active {
  transform: scale(.95);
  box-shadow: 0 1px 3px rgba(30, 50, 90, .12);
}
.game-card .thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 9px;
  overflow: hidden;
  background: #f4f7fc;
}
.game-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.game-card .name {
  margin-top: 5px;
  font-size: 10.5px;
  line-height: 1.25;
  color: #2c3546;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty {
  padding: 40px 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* 页脚 */
.site-foot {
  padding: 16px 14px 26px;
  text-align: center;
  color: #9aa5b8;
  font-size: 11px;
  line-height: 1.8;
}
.foot-links a { color: #9aa5b8; text-decoration: underline; }

@media (min-width: 720px) {
  .ads-wrap { gap: 10px; padding: 0 16px; }
  .grid { gap: 10px; }
  .wrap { padding: 16px 16px 34px; }
  .ad-name { font-size: 12px; margin-top: 6px; padding: 0 3px; }
  .game-card { padding: 8px 7px 9px; }
  .game-card .name { font-size: 12.5px; margin-top: 7px; }
  .brand { font-size: 21px; }
  .domain { font-size: 12.5px; }
}

/* 广告折叠 */
.ads-toggle {
  max-width: 1180px;
  margin: 6px auto 0;
  padding: 0 10px;
  text-align: center;
}
.ads-toggle button {
  height: 28px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: #6b7688;
  font-size: 11.5px;
  cursor: pointer;
}
.ads-toggle button:active { background: #f4f7fc; }
@media (min-width: 720px) {
  .ads-toggle { padding: 0 16px; }
  .ads-toggle button { font-size: 12.5px; height: 30px; }
}

/* 折叠区隐藏（grid 覆盖了 hidden 的默认 display:none） */
.ads-wrap[hidden] { display: none !important; }
