/* ===== H5 游戏平台 通用样式（白色主题） ===== */
:root {
  --bg: #f4f6fb;
  --bg-soft: #ffffff;
  --card: #ffffff;
  --card-hover: #f6f8fd;
  --line: #e4e8f1;
  --line-strong: #cfd8ea;
  --text: #1f2a44;
  --text-dim: #6b7691;
  --accent: #2f6bff;
  --accent-2: #0891b2;
  --danger: #e11d48;
  --warn: #d97706;
  --ok: #15803d;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(31, 42, 68, .06);
  --shadow-md: 0 6px 18px rgba(31, 42, 68, .10);
  --shadow-lg: 0 12px 32px rgba(31, 42, 68, .14);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  background-image: radial-gradient(900px 420px at 15% -10%, rgba(47, 107, 255, .07), transparent 60%),
                    radial-gradient(780px 380px at 92% -6%, rgba(8, 145, 178, .06), transparent 58%);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: min(1200px, 92vw); margin: 0 auto; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.topbar-inner { display: flex; align-items: center; gap: 16px; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; font-size: 15px; color: #fff; font-weight: 900;
}
.spacer { flex: 1; }
.user-chip { display: flex; align-items: center; gap: 8px; color: var(--text-dim); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #4f7cff, #a855f7);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--text); cursor: pointer;
  font-size: 14px; font-family: inherit; transition: .15s; white-space: nowrap;
}
.btn:hover { background: var(--card-hover); border-color: var(--line-strong); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--accent), #6d5cff); border-color: transparent; color: #fff; font-weight: 600; box-shadow: 0 2px 8px rgba(47, 107, 255, .25); }
.btn-primary:hover { filter: brightness(1.06); background: linear-gradient(135deg, var(--accent), #6d5cff); }
.btn-ghost { background: transparent; }
.btn-danger { background: #fff; border-color: #f6c9d3; color: var(--danger); }
.btn-danger:hover { background: #fff5f7; border-color: #f0a9ba; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm);
}
.card-title { font-size: 16px; font-weight: 700; margin: 0 0 4px; }
.muted { color: var(--text-dim); }
.small { font-size: 12px; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; color: var(--text-dim); font-size: 13px; }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--text);
  font-family: inherit; font-size: 14px; outline: none; transition: .15s;
}
.input::placeholder { color: #a8b0c4; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 107, 255, .14); }
textarea.input { min-height: 72px; resize: vertical; }
.form-row { display: flex; gap: 12px; }
.form-row > * { flex: 1; }

/* ---------- 提示 ---------- */
.alert { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 13px; display: none; }
.alert.show { display: block; }
.alert-error { background: #fff1f4; border: 1px solid #f7c9d4; color: #a3123a; }
.alert-ok { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }

/* ---------- 登录/注册 ---------- */
.auth-wrap { min-height: calc(100vh - 60px); display: grid; place-items: center; padding: 40px 0; }
.auth-card { width: min(420px, 92vw); }
.auth-card h1 { font-size: 22px; margin: 0 0 6px; }
.auth-foot { margin-top: 16px; text-align: center; color: var(--text-dim); font-size: 13px; }

/* ---------- 首页英雄区 ---------- */
.hero { padding: 70px 0 40px; text-align: center; }
.hero h1 { font-size: clamp(28px, 4.6vw, 46px); margin: 0 0 14px; line-height: 1.25; }
.hero h1 span { background: linear-gradient(120deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--text-dim); font-size: 16px; max-width: 680px; margin: 0 auto 26px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 44px 0 60px; }
.feature h3 { margin: 0 0 6px; font-size: 15px; }
.feature p { margin: 0; color: var(--text-dim); font-size: 13px; }

/* ---------- 游戏大厅 ---------- */
.section-head { display: flex; align-items: baseline; gap: 12px; margin: 28px 0 16px; }
.section-head h2 { font-size: 19px; margin: 0; }
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; padding-bottom: 60px; }
.game-card {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: .18s;
  box-shadow: var(--shadow-sm);
}
.game-card:hover { transform: translateY(-3px); border-color: #c7d5f5; box-shadow: var(--shadow-md); }
.game-card.disabled { cursor: not-allowed; opacity: .65; }
.game-card.disabled:hover { transform: none; box-shadow: var(--shadow-sm); }
.game-thumb {
  height: 130px; display: grid; place-items: center; font-size: 30px; font-weight: 800; color: var(--accent);
  background: linear-gradient(135deg, #eaf0ff, #dfe8fb); overflow: hidden;
}
.game-thumb img { width: 100%; height: 100%; object-fit: cover; }
.game-body { padding: 10px 12px 12px; }
.game-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-meta { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.badge { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: #eef2fb; color: #4b5b86; }
.badge-new { background: rgba(47, 107, 255, .12); color: #2f6bff; }
.badge-hot { background: rgba(225, 29, 72, .10); color: #e11d48; }
.badge-maint { background: rgba(217, 119, 6, .13); color: #b45309; }

/* ---------- iframe 播放层（页内打开，不跳转 URL） ---------- */
.player {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: #eef1f7;
}
.player.open { display: flex; flex-direction: column; }
.player-bar {
  height: 48px; display: flex; align-items: center; gap: 12px; padding: 0 14px;
  background: #fff; border-bottom: 1px solid var(--line); flex: 0 0 auto;
  box-shadow: var(--shadow-sm);
}
.player-title { font-weight: 700; }
.player-frame-wrap { flex: 1; position: relative; background: #fff; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-loading {
  position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-dim);
  background: #fff; font-size: 14px; text-align: center; padding: 24px;
}

/* ---------- 登录门禁（个人中心等需要登录的页面） ----------
   默认 body.gated 只显示校验提示，确认登录后才渲染内容；
   未登录由 JS 跳登录页，所以绝不会出现"未登录看到个人中心"。 */
.auth-gate {
  position: fixed; inset: 0; z-index: 120; display: none; place-items: center; text-align: center;
  background: #f2f5fa; color: var(--text-dim); font-size: 14px;
}
body.gated .auth-gate { display: grid; }
body.gated > header, body.gated > main, body.gated > .mobile-nav { visibility: hidden; }
.auth-gate-box { padding: 24px; }
.auth-gate-box p { margin: 8px 0 0; }
.auth-gate-spin {
  width: 28px; height: 28px; margin: 0 auto; border-radius: 50%;
  border: 2px solid #d9e3f5; border-top-color: var(--accent); animation: gate-spin .8s linear infinite;
}
@keyframes gate-spin { to { transform: rotate(360deg); } }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #f7f9fd; color: var(--text-dim); font-weight: 600; white-space: nowrap; }
tbody tr:hover { background: #f8fafd; }
tbody tr:last-child td { border-bottom: 0; }
.empty { padding: 30px; text-align: center; color: var(--text-dim); }

/* ---------- Toast ---------- */
#toast-host { position: fixed; top: 74px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast {
  padding: 11px 16px; border-radius: 10px; background: #fff; border: 1px solid var(--line);
  color: var(--text); font-size: 13px; box-shadow: var(--shadow-md);
  animation: toast-in .22s ease; max-width: 340px;
}
.toast.error { border-color: #f7c9d4; background: #fff5f7; color: #a3123a; }
.toast.ok { border-color: #bbf7d0; background: #f2fdf5; color: #166534; }
@keyframes toast-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* ---------- 后台布局 ---------- */
.admin-layout { display: grid; grid-template-columns: 210px 1fr; min-height: 100vh; }
.sidebar { background: #fff; border-right: 1px solid var(--line); padding: 16px 10px; }
.sidebar .logo { padding: 0 8px 16px; }
.nav-item {
  display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 9px;
  color: var(--text-dim); cursor: pointer; border: 0; background: transparent;
  font-family: inherit; font-size: 14px; margin-bottom: 2px;
}
.nav-item:hover { background: #f3f6fd; color: var(--text); }
.nav-item.active { background: rgba(47, 107, 255, .10); color: var(--accent); font-weight: 600; }
.admin-main { padding: 22px 26px 60px; overflow-x: hidden; }
.admin-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.admin-head h2 { margin: 0; font-size: 20px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .input { width: auto; min-width: 180px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.stat .num { font-size: 24px; font-weight: 800; color: var(--text); }
.stat .lbl { color: var(--text-dim); font-size: 12px; }

/* ---------- 弹窗（屏幕居中 + 自适应，内容超高时内部滚动） ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(23, 31, 54, .38); z-index: 200;
  display: none; overflow-y: auto; padding: 20px 16px;
}
.modal-mask.open { display: flex; align-items: center; justify-content: center; }
.modal {
  width: min(660px, 96vw); margin: auto; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-lg);
  max-height: calc(100vh - 40px); display: flex; flex-direction: column;
}
.modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 18px; overflow-y: auto; flex: 1 1 auto; }
.modal-foot { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; flex: 0 0 auto; }

/* 登录 / 注册 双 Tab 弹窗 */
.pt-auth { width: min(400px, 94vw); }
.pt-auth-tabs { display: flex; gap: 6px; }
.pt-auth-tabs button {
  border: 0; background: none; font: inherit; font-size: 15px; font-weight: 700; color: var(--text-dim);
  padding: 4px 2px; cursor: pointer; border-bottom: 2px solid transparent; font-family: inherit;
}
.pt-auth-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.pt-auth-tabs button:hover { color: var(--text); }
.pt-auth-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.pt-auth-body .field:last-of-type { margin-bottom: 0; }
.pt-auth-tip { font-size: 12px; color: var(--text-dim); }
@media (max-width: 860px) {
  .modal-mask { padding: 12px; }
  .modal { max-height: calc(100vh - 24px); }
  .modal-body { padding: 14px; }
  .pt-auth { width: 100%; }
}
@media (max-height: 520px) {
  /* 横屏/小高度：不强行居中，改为贴顶滚动，避免内容被裁 */
  .modal-mask.open { align-items: flex-start; }
}

pre.code {
  background: #f7f9fd; border: 1px solid var(--line); border-radius: 10px; padding: 12px;
  overflow-x: auto; font-size: 12px; color: #0f4c81; margin: 0;
}

/* ---------- 顶栏导航 ---------- */
.topnav { display: flex; gap: 4px; }
.topnav a { padding: 6px 12px; border-radius: 8px; color: var(--text-dim); font-size: 14px; }
.topnav a:hover { background: var(--card-hover); color: var(--text); text-decoration: none; }
.topnav a.active { background: rgba(47, 107, 255, .10); color: var(--accent); font-weight: 600; }
.user-chip[role="button"] { cursor: pointer; padding: 4px 10px 4px 4px; border-radius: 999px; }
.user-chip[role="button"]:hover { background: var(--card-hover); }

/* ---------- 大厅工具栏：搜索 + 分类 ---------- */
.hall-toolbar { display: flex; flex-direction: column; gap: 12px; margin: 24px 0 4px; }
.search-box { display: flex; gap: 10px; max-width: 620px; }
.search-box .input { flex: 1; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--text-dim); cursor: pointer; font-family: inherit; font-size: 13px;
}
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip.active { background: rgba(47, 107, 255, .10); border-color: rgba(47, 107, 255, .35); color: var(--accent); font-weight: 600; }

/* ---------- 横向轨道（最近在玩） ---------- */
.rail { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 12px; }
.rail-card {
  flex: 0 0 168px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: .18s; box-shadow: var(--shadow-sm); padding-bottom: 10px;
}
.rail-card:hover { transform: translateY(-3px); border-color: #c7d5f5; box-shadow: var(--shadow-md); }
.rail-card.disabled { opacity: .65; cursor: not-allowed; }
.rail-thumb {
  height: 96px; display: grid; place-items: center; font-size: 24px; font-weight: 800; color: var(--accent);
  background: linear-gradient(135deg, #eaf0ff, #dfe8fb); overflow: hidden;
}
.rail-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rail-name { font-weight: 600; font-size: 13px; padding: 8px 10px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-card .small { padding: 0 10px; }

/* ---------- 收藏星标 ---------- */
.fav-btn {
  position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .92); color: var(--text-dim);
  font-size: 15px; line-height: 1; cursor: pointer; display: grid; place-items: center; box-shadow: var(--shadow-sm);
}
.fav-btn:hover { color: var(--accent); border-color: #c7d5f5; }
.fav-btn.on { color: #f59e0b; border-color: #fcd9a0; background: #fffaf0; }

/* ---------- Tab ---------- */
.tabs { display: flex; gap: 6px; margin: 24px 0 18px; border-bottom: 1px solid var(--line); }
.tab {
  padding: 10px 16px; border: 0; background: transparent; color: var(--text-dim);
  font-family: inherit; font-size: 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); font-weight: 600; border-bottom-color: var(--accent); }

/* ---------- 两栏布局与资料列表 ---------- */
.two-col { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.kv-list { display: grid; grid-template-columns: 110px 1fr; gap: 10px 14px; font-size: 13px; }
.kv-k { color: var(--text-dim); }
.kv-v { color: var(--text); word-break: break-all; }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; gap: 12px; justify-content: center; padding: 14px 0 60px; }

/* ================= 门户主页 ================= */
.logo-text { font-weight: 700; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.home-search { display: flex; gap: 6px; }
.home-search .input { width: 190px; padding: 7px 12px; }

/* 轮播 */
.banner-wrap { position: relative; margin: 20px 0 8px; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-md); background: #eef2fb; }
.banner-wrap.plain { box-shadow: var(--shadow-sm); }
.banner-track { position: relative; height: 300px; }
.banner-slide {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  display: flex; align-items: flex-end; opacity: 0; transition: opacity .5s; cursor: pointer;
}
.banner-slide.active { opacity: 1; }
.banner-slide.plain { background: linear-gradient(120deg, #eaf1ff, #f6f9ff 60%, #eef7ff); cursor: default; }
.banner-mask { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(12, 20, 40, .62) 0%, rgba(12, 20, 40, .28) 45%, rgba(12, 20, 40, 0) 75%); }
.banner-text { position: relative; padding: 0 34px 30px; color: #fff; max-width: 620px; }
.banner-slide.plain .banner-text { color: var(--text); padding-bottom: 40px; }
.banner-text h1 { margin: 0 0 6px; font-size: clamp(22px, 3vw, 32px); }
.banner-text p { margin: 0 0 14px; opacity: .9; font-size: 14px; }
.banner-slide.plain .banner-text p { color: var(--text-dim); }
.banner-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .82); color: #2a3550; font-size: 20px; line-height: 1;
}
.banner-arrow:hover { background: #fff; }
.banner-arrow.prev { left: 12px; }
.banner-arrow.next { right: 12px; }
.banner-dots { position: absolute; right: 18px; bottom: 14px; display: flex; gap: 6px; z-index: 2; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .55); cursor: pointer; }
.dot.active { background: #fff; width: 18px; border-radius: 999px; }

/* 快捷入口 */
.quick-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0 6px; }
.quick-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; color: var(--text);
  box-shadow: var(--shadow-sm); transition: .15s;
}
.quick-card:hover { transform: translateY(-2px); border-color: #c7d5f5; text-decoration: none; box-shadow: var(--shadow-md); }
.quick-card b { font-size: 22px; color: var(--accent); }
.quick-card span { color: var(--text-dim); font-size: 12px; }

/* 推荐小卡 */
.mini-row { display: flex; gap: 12px; flex-wrap: wrap; }
.mini-card {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  color: var(--text); box-shadow: var(--shadow-sm); transition: .15s; max-width: 220px;
}
.mini-card:hover { border-color: #c7d5f5; text-decoration: none; transform: translateY(-2px); }
.mini-thumb { width: 34px; height: 34px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, #eaf0ff, #dfe8fb); color: var(--accent); font-weight: 800; font-size: 13px; flex: 0 0 auto; }
.mini-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mini-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 热门推荐大卡 */
.hot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.hot-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: .18s; cursor: pointer;
}
.hot-card:hover { transform: translateY(-3px); border-color: #c7d5f5; box-shadow: var(--shadow-md); }
.hot-cover { height: 132px; background: linear-gradient(135deg, #eaf0ff, #dfe8fb); display: grid; place-items: center; overflow: hidden; }
.hot-cover img { width: 100%; height: 100%; object-fit: cover; }
.hot-cover-text { font-size: 26px; font-weight: 800; color: var(--accent); }
.hot-body { padding: 12px 14px 14px; }
.hot-name { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-meta { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 12px; min-height: 20px; }
.hot-actions { display: flex; gap: 8px; align-items: center; }
.fav-btn.inline { position: static; width: 32px; height: 32px; flex: 0 0 auto; }

/* 人气榜 */
.portal-cols { margin-top: 8px; }
.rank-list { display: flex; flex-direction: column; gap: 8px; }
.rank-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); cursor: pointer; transition: .15s;
}
.rank-item:hover { border-color: #c7d5f5; transform: translateX(2px); }
.rank-no { width: 22px; text-align: center; font-weight: 800; color: var(--text-dim); font-size: 13px; }
.rank-no-1 { color: #e11d48; }
.rank-no-2 { color: #ea8a00; }
.rank-no-3 { color: #2f6bff; }
.rank-thumb { width: 38px; height: 38px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, #eaf0ff, #dfe8fb); color: var(--accent); font-weight: 800; font-size: 12px; flex: 0 0 auto; }
.rank-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rank-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.rank-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ================= 游戏专区 ================= */
.zone-hero {
  position: relative; margin: 20px 0 8px; border-radius: 16px; overflow: hidden;
  background-color: #e9eefb; background-size: cover; background-position: center; box-shadow: var(--shadow-md);
}
.zone-hero-mask { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(12, 20, 40, .74), rgba(12, 20, 40, .35) 55%, rgba(12, 20, 40, .12)); }
.zone-hero-inner { position: relative; display: flex; gap: 20px; align-items: center; padding: 34px 30px; color: #fff; }
.zone-icon {
  width: 96px; height: 96px; border-radius: 18px; overflow: hidden; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 34px; font-weight: 800;
  background: rgba(255, 255, 255, .16); border: 2px solid rgba(255, 255, 255, .35);
}
.zone-icon img { width: 100%; height: 100%; object-fit: cover; }
.zone-info h1 { margin: 0 0 8px; font-size: clamp(20px, 2.6vw, 30px); }
.zone-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.zone-meta .badge { background: rgba(255, 255, 255, .2); color: #fff; }
.zone-meta .muted { color: rgba(255, 255, 255, .78) !important; }
.zone-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.zone-actions .btn { background: rgba(255, 255, 255, .92); }
.zone-actions .btn-primary { background: linear-gradient(135deg, var(--accent), #6d5cff); color: #fff; }
.zone-intro p { margin: 0 0 12px; line-height: 1.9; color: #33405c; }
.zone-intro p:last-child { margin-bottom: 0; }
.shot-card { flex: 0 0 240px; height: 150px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow-sm); }
.shot-card img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ================= 页脚与移动端导航 ================= */
.footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 24px 0 40px; background: rgba(255, 255, 255, .7); }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; font-size: 13px; }
.footer p { margin: 4px 0; }
.mobile-nav { display: none; }

@media (max-width: 860px) {
  .banner-track { height: 210px; }
  .banner-text { padding: 0 18px 20px; }
  .banner-arrow { display: none; }
  .quick-row { grid-template-columns: repeat(2, 1fr); }
  .home-search { display: none; }
  .zone-hero-inner { flex-direction: column; align-items: flex-start; padding: 22px 18px; }
  .zone-icon { width: 72px; height: 72px; font-size: 26px; }
  .portal-cols { grid-template-columns: 1fr; }
  body.portal { padding-bottom: 62px; }
  .mobile-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line);
    backdrop-filter: blur(8px); box-shadow: 0 -2px 12px rgba(31, 42, 68, .06);
  }
  .mobile-nav a {
    flex: 1; text-align: center; padding: 11px 0; color: var(--text-dim); font-size: 12px;
  }
  .mobile-nav a:hover { text-decoration: none; }
  .mobile-nav a.active { color: var(--accent); font-weight: 700; }
  .mobile-nav { padding-bottom: env(safe-area-inset-bottom); }
  .topnav { display: none; }

  /* 表单控件 ≥16px，避免 iOS 聚焦时自动放大页面 */
  input.input, select.input, textarea.input, .field input { font-size: 16px; }
  .btn { padding: 9px 14px; }

  /* 个人中心：键值表窄标签列，Tab 横向滚动，表格可横滑，卡片网格 3 列 */
  .kv-list { grid-template-columns: 92px minmax(0, 1fr); gap: 8px 10px; }
  .kv-v { word-break: break-all; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; margin: 14px 0 12px; -webkit-overflow-scrolling: touch; }
  .tab { flex: 0 0 auto; }
  .game-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; padding-bottom: 20px; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 520px; }   /* 宁可横滑，也别把字挤成一列 */
  .pager { padding: 12px 0 24px; }
  .auth-wrap { padding: 22px 14px 40px; }
  .auth-card { padding: 18px 16px; }
  .section-head { flex-wrap: wrap; row-gap: 6px; }

  /* 页内播放层：播放条收窄，标题省略，按钮紧凑 */
  .player-bar { height: 44px; gap: 6px; padding: 0 10px; }
  .player-bar .btn { padding: 6px 10px; font-size: 12px; }
  .player-title { font-size: 13px; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .player-loading { font-size: 13px; padding: 18px; }
}
