/* ============================================================
   游戏资源站 · 前台样式（移动端优先，绿色主题）
   ============================================================ */
:root {
  --bg: #0a0f0c;
  --bg2: #0f1511;
  --surface: #141c17;
  --surface2: #1b241e;
  --line: rgba(255, 255, 255, .08);
  --text: #eef2ef;
  --muted: #9aa89f;
  --brand: #22c55e;
  --brand2: #0ea5e9;
  --grad: linear-gradient(120deg, #16a34a 0%, #0ea5e9 100%);
  --radius: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  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.6;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
img { display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: #0e1511;
  border-bottom: 1px solid var(--line);
}
.topbar-inner { height: 54px; display: flex; align-items: center; gap: 10px; padding: 0 12px; }
.logo { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.logo-ico {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--grad);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; box-shadow: 0 4px 12px rgba(34, 197, 94, .35);
}
.logo-txt {
  font-size: 17px; font-weight: 800; letter-spacing: .3px;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.nav { display: none; }
.top-right { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: 1; min-width: 0; }
.search { position: relative; flex: 1; min-width: 0; }
.search input {
  width: 100%; height: 36px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text); padding: 0 36px 0 14px; font-size: 13px;
  outline: none; transition: border-color .2s;
}
.search input:focus { border-color: var(--brand); }
.search input::placeholder { color: #67736b; }
.search button {
  position: absolute; right: 3px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 50%; font-size: 14px;
}
.admin-link {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 15px;
}

/* ---------- 公告条 ---------- */
.announce { background: rgba(34, 197, 94, .07); border-bottom: 1px solid var(--line); }
.ann-inner {
  height: 30px; display: flex; align-items: center; gap: 6px; padding: 0 12px;
  font-size: 12.5px; color: #b6c9bc; overflow: hidden; white-space: nowrap;
}
.ann-ico { font-size: 12px; flex-shrink: 0; }
.ann-text { overflow: hidden; text-overflow: ellipsis; }
.ann-close {
  margin-left: auto; flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
  color: #7d8a81; font-size: 12px; display: flex; align-items: center; justify-content: center;
}

/* ---------- 主内容 ---------- */
.main { padding: 8px 12px 100px; min-height: 70vh; }
.page-head { margin: 14px 2px 10px; }
.page-title { font-size: 20px; font-weight: 800; }
.page-sub { color: #a8b4ab; margin-top: 3px; font-size: 12px; }

/* ---------- 筛选胶囊 ---------- */
.filter-pills {
  position: relative;
  display: flex; gap: 8px; margin: 4px 0 14px;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  padding: 2px 40px 4px 2px;
}
.filter-pills::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 40px;
  background: linear-gradient(90deg, rgba(10, 15, 12, 0), var(--bg) 88%);
  pointer-events: none;
}
.filter-pills::-webkit-scrollbar { display: none; }
.pill {
  flex-shrink: 0; padding: 7px 16px; border-radius: 999px; font-size: 13px;
  background: var(--surface2); border: 1px solid rgba(255, 255, 255, .14);
  color: #b8c3bb; transition: all .2s;
}
.pill.on {
  background: var(--grad); color: #fff; font-weight: 600;
  border-color: transparent; box-shadow: 0 4px 14px rgba(34, 197, 94, .4);
}

/* ---------- 游戏卡片（2列） ---------- */
.ggrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 10px; }
.gcard {
  display: flex; gap: 10px; background: var(--surface);
  border: 1px solid rgba(255, 255, 255, .11); border-radius: 12px; padding: 10px;
  transition: transform .12s, border-color .12s;
}
.gcard:active { transform: scale(.98); border-color: var(--brand); }
.gicon {
  position: relative; width: 66px; height: 66px; flex-shrink: 0;
  border-radius: 12px; overflow: hidden; background: var(--surface2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .4);
}
.gicon img { width: 100%; height: 100%; object-fit: cover; }
.badge-hot {
  position: absolute; top: 3px; right: 3px; z-index: 2;
  font-size: 9.5px; font-weight: 600; padding: 1px 6px; border-radius: 999px;
  background: linear-gradient(120deg, #ff6a3d, #ff2d78); color: #fff;
}
.gcard-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.gcard-title {
  font-size: 13.5px; font-weight: 700; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.gcard-tags {
  font-size: 11px; color: #7ee2a8; margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gcard-meta { font-size: 11.5px; color: #b3beb6; margin-top: 3px; }

/* ---------- 分页 ---------- */
.pager { display: flex; justify-content: center; gap: 7px; margin-top: 26px; }
.pager a, .pager span {
  min-width: 34px; height: 34px; padding: 0 9px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; background: var(--surface); border: 1px solid var(--line);
  color: var(--muted); font-size: 13px;
}
.pager .cur { background: var(--grad); color: #fff; border: none; font-weight: 600; }

/* ---------- 游戏详情 ---------- */
.gdetail-head { display: flex; gap: 14px; margin-top: 12px; align-items: flex-start; }
.gdetail-icon {
  width: 96px; height: 96px; flex-shrink: 0; border-radius: 18px; overflow: hidden;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .55); background: var(--surface2);
}
.gdetail-icon img { width: 100%; height: 100%; object-fit: cover; }
.gdetail-info { flex: 1; min-width: 0; }
.gdetail-title { font-size: 18px; font-weight: 800; line-height: 1.4; }
.gdetail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 9px 0; }
.chip {
  font-size: 11.5px; padding: 3px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, .08); color: #c9d5cc; border: 1px solid rgba(255, 255, 255, .16);
}
.chip.cat { background: rgba(14, 165, 233, .13); color: #7dd3fc; border-color: rgba(14, 165, 233, .3); }
.gdetail-meta { display: flex; flex-wrap: wrap; gap: 18px; color: #b3beb6; font-size: 13px; }
.gdetail-desc {
  color: #c4ccc6; font-size: 13.5px; line-height: 2.05; margin-top: 12px;
  background: #18201b; border: 1px solid rgba(255, 255, 255, .1);
  padding: 14px 16px; border-radius: 12px;
}
.gdetail-actions { margin-top: 16px; display: flex; gap: 10px; }
.gdetail-actions .btn { flex: 1; padding: 13px 10px; font-size: 16px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 999px; padding: 10px 22px; font-size: 14px; font-weight: 600;
  transition: all .2s; white-space: nowrap;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 26px rgba(34, 197, 94, .45); }
.btn-primary:active { transform: scale(.97); }
.btn-ghost {
  background: rgba(255, 255, 255, .1); color: #fff;
  border: 1px solid rgba(255, 255, 255, .3);
}
.btn-lg { padding: 12px 26px; font-size: 15px; }

/* ---------- 区块 ---------- */
.sec { margin-top: 26px; }
.sec-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.sec-title { font-size: 16px; font-weight: 700; }
.sec-ico { font-size: 15px; }

/* ---------- 空状态 ---------- */
.empty-state { text-align: center; padding: 60px 16px; color: var(--muted); }
.empty-state .big { font-size: 44px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ---------- 页脚 ---------- */
.footer { border-top: 1px solid var(--line); background: var(--bg2); margin-top: 24px; }
.footer-inner { padding: 26px 16px 30px; text-align: center; }
.footer-logo { font-size: 16px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 8px; }
.footer-sub { color: var(--muted); font-size: 12px; margin-top: 6px; }
.footer-text { color: #59665e; font-size: 11px; margin-top: 8px; line-height: 1.9; }
.footer-copy { color: #48544c; font-size: 11px; margin-top: 10px; }

/* ---------- 底部导航 ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 400;
  background: #0e1511;
  border-top: 1px solid var(--line);
  display: flex; padding-bottom: var(--safe-b);
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 6px; color: var(--muted); font-size: 10.5px;
  transition: color .2s;
}
.bottom-nav .bn-ico { font-size: 20px; line-height: 1.2; }
.bottom-nav a.on { color: #fff; font-weight: 600; }
.bottom-nav a.on .bn-ico {
  background: var(--grad); border-radius: 12px; padding: 1px 10px;
  box-shadow: 0 3px 10px rgba(34, 197, 94, .45);
}

/* ================= 桌面端（≥768px） ================= */
@media (min-width: 768px) {
  .topbar-inner { max-width: 1240px; margin: 0 auto; height: 62px; gap: 34px; padding: 0 20px; }
  .logo-ico { width: 34px; height: 34px; border-radius: 10px; font-size: 17px; }
  .logo-txt { font-size: 20px; letter-spacing: .5px; }
  .nav { display: flex; align-items: center; gap: 26px; font-size: 15px; flex: 1; }
  .nav a { color: var(--muted); transition: color .2s; position: relative; padding: 4px 0; }
  .nav a:hover { color: #fff; }
  .nav a.on { color: #fff; font-weight: 600; }
  .nav a.on::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 3px;
    border-radius: 2px; background: var(--grad);
  }
  .top-right { gap: 14px; }
  .search { flex: none; }
  .search input { width: 230px; padding: 0 40px 0 18px; font-size: 13.5px; transition: width .25s, border-color .2s; }
  .search input:focus { width: 290px; }
  .ann-inner { max-width: 1240px; margin: 0 auto; padding: 0 20px; font-size: 13px; }
  .main { max-width: 1240px; margin: 0 auto; padding: 8px 20px 60px; }
  .page-head { margin: 26px 0 20px; }
  .page-title { font-size: 26px; }
  .page-sub { font-size: 13.5px; }
  .filter-pills { flex-wrap: wrap; overflow: visible; margin: 4px 0 24px; }
  .pill { padding: 8px 20px; font-size: 14px; }
  .ggrid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
  .gcard:hover { transform: translateY(-3px); border-color: rgba(34, 197, 94, .5); }
  .gcard-title { font-size: 15px; }
  .gicon { width: 76px; height: 76px; }
  .gdetail-icon { width: 140px; height: 140px; }
  .gdetail-title { font-size: 26px; }
  .gdetail-desc { max-width: 720px; }
  .footer-inner { max-width: 1240px; margin: 0 auto; padding: 40px 20px 34px; }
  .footer-logo { font-size: 18px; }
  .bottom-nav { display: none; }
}
