/* ============ 基础 ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --dark: #111111;
  --text: #1a1a1a;
  --muted: #9a9a9a;
  --border: #ececec;
  --border-strong: #d8d8d8;
  --bg-soft: #fafafa;
  --radius: 10px;
  --radius-sm: 8px;

  /* 弹窗统一设计变量 */
  --modal-z: 1000;
  --modal-width: 560px;
  --modal-width-sm: 420px;
  --modal-radius: 14px;
  --modal-pad-x: 24px;
  --modal-pad-y: 20px;
  --modal-overlay-bg: rgba(0, 0, 0, .45);
  --modal-shadow: 0 20px 60px rgba(0, 0, 0, .22);
  --modal-duration: .22s;
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: #fff;
  font-size: 15px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 22px;
  font-size: 15px;
  line-height: 1.2;
  white-space: nowrap;
  transition: opacity .15s, background .15s, border-color .15s;
}
.btn:hover { opacity: .88; }
.btn:active { opacity: .75; }

.btn-dark { background: var(--dark); color: #fff; }
.btn-outline { background: #fff; border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { border-color: #999; opacity: 1; }
.btn-danger { background: #fff; border-color: #e2b8b8; color: #c0392b; }
.btn-danger:hover { background: #fff5f4; opacity: 1; }

.btn-sm { padding: 7px 14px; font-size: 13.5px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ============ 顶部导航 ============ */
.site-header {
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.header-inner {
  display: flex; align-items: center; gap: 34px;
  height: 66px;
}
.logo {
  display: flex; align-items: center; gap: 9px;
  font-size: 21px; font-weight: 700; letter-spacing: .5px;
  flex-shrink: 0;
}
.main-nav { display: flex; gap: 28px; }
.nav-link {
  font-size: 15.5px; color: #444; padding: 4px 0;
}
.nav-link:hover { color: #000; }
.nav-link.nav-active { font-weight: 700; color: #000; }

/* 前端分类页：分类筛选栏 */
.cat-bar {
  display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 22px;
}
.cat-chip {
  display: inline-flex; align-items: center;
  font-size: 13.5px; padding: 5px 14px; border-radius: 20px;
  border: 1px solid var(--border-strong); background: #fff; color: #444;
  text-decoration: none; white-space: nowrap;
}
.cat-chip:hover { border-color: #999; color: #000; }
.cat-chip-active { background: var(--dark); color: #fff; border-color: var(--dark); }
.cat-chip-active:hover { background: #222; color: #fff; border-color: #222; }

.header-user { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.user-badge {
  font-size: 12.5px; padding: 3px 11px; border-radius: 20px;
  border: 1px solid var(--border-strong); color: #777; background: #fff;
}
.badge-member { background: var(--dark); color: #fff; border-color: var(--dark); }
.user-account { color: #777; font-size: 14px; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border, #e8e8ec); flex-shrink: 0; }

.site-main { padding-top: 26px; padding-bottom: 50px; min-height: calc(100vh - 150px); }

/* ============ 公告 ============ */
.announce-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  margin-bottom: 26px;
  overflow: hidden;
}
.announce-item {
  padding: 18px 22px;
  border-left: 3px solid var(--dark);
}
.announce-more { border-top: 1px solid var(--border); }
.announce-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.announce-tag {
  background: var(--dark); color: #fff;
  font-size: 12.5px; font-weight: 600;
  padding: 2px 11px; border-radius: 5px;
}
.announce-date { color: var(--muted); font-size: 13.5px; }
.announce-content { color: #555; font-size: 14.5px; }

/* ============ 搜索 ============ */
.search-bar {
  display: flex; gap: 12px;
  margin-bottom: 32px;
}
.search-input {
  flex: 1;
  height: 48px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0 18px;
  font-size: 15px;
  outline: none;
  transition: border-color .15s;
}
.search-input:focus { border-color: #777; }
.search-bar .btn { height: 48px; padding: 0 28px; }

/* ============ 区块标题 ============ */
.section-title {
  font-size: 21px; font-weight: 700;
  margin: 34px 0 18px;
}
.section-title:first-of-type { margin-top: 4px; }

/* ============ 游戏卡片 ============ */
.game-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
.game-card {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 460 / 262;
  background: linear-gradient(180deg, #f2f2f2, #d9d9d9);
}
.game-card img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .3s;
}
.game-card:hover img { transform: scale(1.05); }
.game-card-title {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 10px 8px;
  color: #fff; font-size: 13px; line-height: 1.35;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.72));
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============ 分页 ============ */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  margin-top: 34px;
}
.page-info { color: #888; font-size: 14.5px; }
.page-link {
  padding: 7px 20px; border: 1px solid var(--border-strong); border-radius: 7px;
  font-size: 14px; color: #333;
}
.page-link:hover { border-color: #999; }

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

/* ============ 游戏详情页 ============ */
.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
}
.game-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.game-title { font-size: 27px; font-weight: 700; line-height: 1.3; }

.tag {
  display: inline-block; font-size: 13px; padding: 4px 13px; border-radius: 20px;
}
.tag-outline { border: 1px solid var(--border-strong); color: #666; background: #fff; }
.tag-dark { background: var(--dark); color: #fff; }

.game-cover {
  width: 100%; border-radius: var(--radius);
  margin-bottom: 20px;
}
.game-desc { color: #444; font-size: 15.5px; }

/* 侧栏卡片 */
.side-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}
.side-card-title {
  display: flex; align-items: center; gap: 9px;
  font-size: 16.5px; font-weight: 700;
  margin-bottom: 14px;
}
.side-hint { color: #8a8a8a; font-size: 14px; margin-bottom: 14px; }
.side-hint b { color: var(--dark); font-size: 16px; }

/* 领取结果 */
.claimed-list { margin-top: 16px; }
.claimed-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 10px;
  background: var(--bg-soft);
}
.claimed-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; padding: 3px 0;
}
.claimed-label { color: var(--muted); width: 34px; flex-shrink: 0; }
.claimed-value {
  font-family: Consolas, Menlo, monospace;
  word-break: break-all; flex: 1;
}
.copy-btn {
  border: 1px solid var(--border-strong); background: #fff;
  border-radius: 6px; font-size: 12px; padding: 3px 10px; color: #555;
}
.copy-btn:hover { border-color: #999; color: #000; }
.claimed-note { color: var(--muted); font-size: 12px; margin-top: 3px; }

/* 教程列表 */
.tutorial-list { list-style: none; }
.tutorial-list li a {
  display: flex; align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  margin-bottom: 9px;
  font-size: 14px; color: #444;
  position: relative;
}
.tutorial-list li a::before {
  content: ""; flex-shrink: 0;
  width: 14px; height: 14px; margin-right: 10px;
  border: 1.6px solid #999; border-radius: 3px;
}
.tutorial-list li a[target="_blank"]::after {
  content: "↗"; margin-left: auto; color: #aaa; font-size: 13px;
}
.tutorial-list li a:hover { border-color: #aaa; color: #000; }

/* ============ 登录卡片 ============ */
.auth-wrap {
  display: flex; justify-content: center;
  padding: 30px 0;
}
.auth-card {
  width: 420px; max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 30px;
}
.auth-title { font-size: 23px; font-weight: 700; margin-bottom: 22px; }

.form-label {
  display: block; font-size: 14px; color: #333;
  margin: 16px 0 7px;
}
.form-input {
  width: 100%; height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0 14px; font-size: 15px;
  outline: none; transition: border-color .15s;
}
.form-input:focus { border-color: #777; }
.form-hint { color: var(--muted); font-size: 13px; margin: 8px 0 14px; }
.form-hint code { background: #f3f3f5; padding: 2px 6px; border-radius: 4px; font-size: 12px; word-break: break-all; }
.settings-divider { border: none; border-top: 1px solid var(--border, #e8e8ec); margin: 24px 0 18px; }
.remember-line { display: flex; align-items: center; gap: 7px; font-size: 14px; color: #555; margin-bottom: 18px; }
.auth-foot { color: var(--muted); font-size: 13px; margin-top: 18px; text-align: center; }

/* 面板内文字链接（忘记密码 / 返回登录） */
.auth-link-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  color: #555; font-size: 13px; text-decoration: none;
}
.auth-link-btn:hover { color: #111; text-decoration: underline; }

/* 找回密码步骤说明 */
.forgot-lead {
  background: #f7f7f8; border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 13px; line-height: 1.7; color: #555;
  margin: 10px 0 16px;
}
.forgot-lead b { color: #111; }

/* 微信登录 */
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 16px; color: var(--muted); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border, #e8e8ec); }
.btn-wx { display: flex; align-items: center; justify-content: center; gap: 8px; background: #07c160; color: #fff; border-color: #07c160; font-weight: 500; }
.btn-wx:hover { background: #06ad56; border-color: #06ad56; }
.btn-wx .wx-icon { flex-shrink: 0; }

/* 登录 / 注册 选项卡与分步面板 */
.auth-tabs { display: flex; gap: 10px; margin-bottom: 6px; }
.auth-tab {
  flex: 1; padding: 10px 0; font-size: 15px; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #f7f7f8; color: #666; transition: all .15s;
}
.auth-tab:hover { border-color: #999; }
.auth-tab.active { background: #111; border-color: #111; color: #fff; }
.auth-pane { display: none; }
.auth-pane.active { display: block; }
.auth-pane .form-label:first-child { margin-top: 10px; }
.wx-verify-icon {
  width: 84px; height: 84px; margin: 10px auto 14px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: #e8f9f0; color: #07c160;
}

/* ============ 提示条 ============ */
.alert {
  border-radius: var(--radius-sm);
  padding: 11px 15px; font-size: 14px;
  margin-bottom: 16px;
}
.alert-error { background: #fdf1f0; border: 1px solid #f2d4d0; color: #b5453a; }
.alert-success { background: #f1f7f1; border: 1px solid #d4e7d4; color: #2f7a3a; }

/* ============ 会员中心 ============ */
.page-h1 { font-size: 26px; font-weight: 700; }
.member-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 24px;
}
.member-account { color: var(--muted); font-size: 15px; font-weight: 400; margin-left: 8px; }
.btn-row { display: flex; gap: 10px; }

.stat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin-bottom: 14px;
}
.stat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  min-height: 108px;
}
.stat-main { margin-bottom: 8px; }
.stat-big { font-size: 25px; font-weight: 700; }
.stat-date { font-size: 19px; }
.stat-valid { color: #1a7a35; }
.stat-label { color: var(--muted); font-size: 13.5px; }
.stat-sub { color: #aaa; font-size: 12.5px; margin-top: 3px; }
.page-hint { color: var(--muted); font-size: 13.5px; margin: 6px 2px 0; }

/* ============ 表格 ============ */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  overflow-x: auto;
}
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  text-align: left; font-weight: 600; color: #666; font-size: 13.5px;
  padding: 12px 16px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #fcfcfc; }
.td-time { color: #777; font-size: 13px; white-space: nowrap; font-family: Consolas, Menlo, monospace; }
.td-region { max-width: 240px; font-size: 13px; color: #555; line-height: 1.4; word-break: break-all; }
.td-code { font-family: Consolas, Menlo, monospace; letter-spacing: 1px; font-weight: 600; }

/* ============ 表单卡片 ============ */
.page-head { margin-bottom: 20px; }
.form-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 20px;
}
.form-card-narrow { max-width: 520px; }
.validity-row { display: flex; gap: 10px; }
.validity-row input { flex: 1; }
.validity-row select { width: 110px; flex: none; cursor: pointer; }
.players-row { display: flex; gap: 10px; }
.players-row input { flex: 1; }
.players-row .btn { width: 90px; flex: none; }
.form-card-title { font-size: 17px; font-weight: 700; margin-bottom: 10px; }
.form-card-desc { color: #777; font-size: 14px; margin-bottom: 16px; }
.form-card .btn { margin-top: 6px; }

.form-textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 11px 14px; font-size: 14.5px;
  font-family: inherit; resize: vertical; outline: none;
}
.form-textarea:focus { border-color: #777; }
.form-file { margin: 10px 0; font-size: 13.5px; }
.form-check-row { display: flex; gap: 26px; margin: 18px 0 6px; font-size: 14px; }
.form-check-row label { display: flex; align-items: center; gap: 7px; }
.form-input-sm { max-width: 150px; }
.form-actions { display: flex; gap: 12px; margin-top: 20px; }

/* 分类管理：标签多选网格 */
.tag-check-grid {
  display: flex; flex-wrap: wrap; gap: 8px; max-height: 220px; overflow-y: auto;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 10px;
}
.tag-check-grid label {
  display: inline-flex; align-items: center; gap: 5px; font-size: 13px;
  border: 1px solid var(--border-strong); border-radius: 20px; padding: 4px 12px;
  cursor: pointer; background: #fff; user-select: none;
}
.tag-check-grid label:has(input:checked) { background: var(--dark); color: #fff; border-color: var(--dark); }

/* 教程页 */
.tutorial-page { max-width: 820px; }
.tut-section { margin-bottom: 30px; }
.tut-section h2 { font-size: 18px; margin-bottom: 10px; }
.tut-section ol, .tut-section ul { padding-left: 22px; color: #444; }
.tut-section li { margin-bottom: 7px; }
.tut-section p { color: #444; }

/* ---------- 帮助中心（左导航 + 右内容） ---------- */
.help-layout {
  display: grid; grid-template-columns: 220px 1fr; gap: 22px;
  align-items: start; margin-top: 4px;
}
.help-sidebar {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 10px; position: sticky; top: 80px;
}
.help-nav-item {
  display: block; padding: 10px 13px; border-radius: 8px;
  font-size: 14px; color: #444; margin-bottom: 2px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.help-nav-item:hover { background: #f5f6f8; color: #000; }
.help-nav-item.active { background: var(--dark); color: #fff; }
.help-empty { padding: 14px 10px; color: var(--muted); font-size: 13px; }
.help-content {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 26px 30px; min-height: 300px;
}
.help-title { font-size: 20px; font-weight: 700; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.help-body p { color: #333; line-height: 1.9; margin-bottom: 14px; font-size: 14.5px; word-break: break-word; }
.help-updated { margin-top: 22px; padding-top: 12px; border-top: 1px dashed var(--border); color: var(--muted); font-size: 12.5px; }
.help-empty-box { padding: 60px 0; text-align: center; color: var(--muted); }
.article-excerpt { color: #666; font-size: 13px; max-width: 320px; }
@media (max-width: 720px) {
  .help-layout { grid-template-columns: 1fr; }
  .help-sidebar { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .help-nav-item { margin-bottom: 0; }
  .help-content { padding: 20px 18px; }
}

/* 404 */
.not-found { text-align: center; padding: 90px 0; }
.not-found h1 { font-size: 70px; font-weight: 800; }
.not-found p { color: #888; margin-bottom: 24px; }

/* ============ 页脚 ============ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0; text-align: center;
  color: var(--muted); font-size: 13.5px;
}

/* ============ 管理后台 ============ */
.admin-body { background: #f6f6f7; }
.admin-layout { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 208px; flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh;
}
.admin-logo {
  height: 62px; display: flex; align-items: center; padding: 0 22px;
  border-bottom: 1px solid var(--border);
  font-size: 17px; font-weight: 700;
}
.admin-nav { padding: 14px 12px; }
.admin-nav-item {
  display: block;
  padding: 10px 15px; border-radius: 8px;
  font-size: 14.5px; color: #555;
  margin-bottom: 3px;
}
.admin-nav-item:hover { background: #f3f3f4; color: #000; }
.admin-nav-item.active { background: var(--dark); color: #fff; }
/* 侧边栏分组（外观管理等带子菜单的组） */
.admin-nav-group-label {
  display: block; padding: 10px 15px 4px;
  font-size: 12px; color: #9aa0aa; letter-spacing: 1px;
}
.admin-nav-sub { padding-left: 8px; }
.admin-nav-sub .admin-nav-item { font-size: 13.5px; padding: 8px 15px 8px 20px; }
/* 导航管理：拖拽排序 */
.drag-cell { width: 44px; text-align: center; }
.drag-handle { cursor: grab; color: #b6bac2; font-size: 15px; user-select: none; }
tr.row-dragging { opacity: .45; }
tr.row-drag-over td { border-top: 2px solid var(--dark); }
.nav-url { color: #555; font-size: 13px; word-break: break-all; }
/* 弹窗底部按钮行 */
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
/* 页头操作条（提示文字 + 右侧按钮） */
.admin-block-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 4px 0 16px; flex-wrap: wrap; }

.admin-content-wrap { flex: 1; min-width: 0; }
.admin-topbar {
  height: 62px; background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px;
  position: sticky; top: 0; z-index: 10;
}
.admin-topbar-title { font-size: 16.5px; font-weight: 600; }
.admin-topbar-user { display: flex; align-items: center; gap: 14px; }
.admin-top-link { color: #888; font-size: 13.5px; }
.admin-top-link:hover { color: #000; }
.admin-username { font-size: 14px; color: #555; }

.admin-content { padding: 24px 26px 40px; }

.admin-stat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 14px;
  margin-bottom: 26px;
}
.admin-stat-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.a-stat-num { font-size: 27px; font-weight: 700; }
.a-num-ok { color: #1a7a35; }
.a-stat-label { color: var(--muted); font-size: 13px; margin-top: 3px; }
.a-stat-sub { display: inline-block; margin-left: 4px; font-size: 12px; color: #999; }
.a-sub-ok { color: #1a7a35; }

/* ============ 仪表盘图表 ============ */
.chart-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-bottom: 10px;
}
.chart-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px 18px;
  min-width: 0;
}
.chart-card-wide { grid-column: 1 / -1; }
.chart-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 10px; flex-wrap: wrap;
}
.chart-head h3 { font-size: 15px; font-weight: 600; margin: 0; }
.chart-legend { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin: 0 4px 0 10px; }
.legend-dot:first-child { margin-left: 0; }
.chart-body { position: relative; width: 100%; }
.chart-body canvas { display: block; width: 100%; height: 100%; }
#trendChart { height: 260px; }
#topGamesChart { height: 280px; }
#visitHourChart { height: 240px; }
/* 流量来源榜单 */
.source-list { padding: 4px 2px 2px; }
.source-row {
  display: grid; grid-template-columns: 132px 1fr 92px;
  align-items: center; gap: 10px; padding: 7px 0;
  font-size: 13px;
}
.source-name {
  color: #444; overflow: hidden; white-space: nowrap;
  text-overflow: ellipsis;
}
.source-bar { height: 8px; background: #f0f1f3; border-radius: 999px; overflow: hidden; }
.source-bar i { display: block; height: 100%; background: #2f7cf6; border-radius: 999px; }
.source-num { text-align: right; color: #999; white-space: nowrap; }
.source-num b { color: #111; font-weight: 600; margin-right: 6px; }
@media (max-width: 720px) {
  .source-row { grid-template-columns: 92px 1fr 78px; }
}
.chart-body-center { min-height: 220px; display: flex; align-items: center; justify-content: center; gap: 22px; flex-wrap: wrap; }
.chart-body-center canvas { width: 180px; height: 180px; flex: 0 0 auto; }
.mix-legend { display: flex; flex-direction: column; gap: 10px; font-size: 13px; color: #555; }
.mix-legend .legend-row { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.mix-legend .legend-dot { margin: 0; border-radius: 50%; }
.mix-legend b { color: #111; font-weight: 600; margin-left: 2px; }
.mix-legend .legend-pct { color: #999; margin-left: 4px; }
.chart-empty {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center;
  color: #aaa; font-size: 13px;
}

.admin-block-title { font-size: 17px; font-weight: 700; margin: 26px 0 14px; }

/* 批量操作栏 */
.batch-bar {
  display: flex; align-items: center; gap: 10px;
  margin: -4px 0 14px; padding: 10px 14px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.batch-info { font-size: 13px; color: var(--muted); }
.batch-info b { color: var(--text); }
.batch-msg { font-size: 12px; }
.batch-msg-ok { color: #1a8f4a; }
.batch-msg-err { color: #d33030; }
.th-check, .td-check { width: 42px; text-align: center; }
.th-check input, .td-check input { cursor: pointer; }

.admin-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 18px;
}
.admin-search { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.admin-search .form-input { width: 260px; height: 40px; }
.admin-select-form { display: flex; align-items: center; gap: 10px; font-size: 14px; }

/* 日志管理 Tab */
.log-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.log-tab {
  display: inline-block; padding: 7px 16px; font-size: 13.5px;
  border: 1px solid var(--border-strong); border-radius: 999px;
  color: #555; background: #fff; text-decoration: none;
}
.log-tab:hover { border-color: #999; color: #111; }
.log-tab.active { background: #111; border-color: #111; color: #fff; }

.form-select {
  height: 40px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 0 10px; font-size: 14px; background: #fff; outline: none;
}
.form-select-xs { height: 32px; font-size: 12.5px; padding: 0 6px; }

.td-cover { width: 90px; height: 52px; object-fit: cover; border-radius: 6px; }
.td-actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.inline-form { display: inline; }
.grant-form { display: inline-flex; gap: 6px; align-items: center; }

/* 状态徽章 */
.status-pill {
  display: inline-block; font-size: 12.5px; padding: 3px 11px; border-radius: 20px;
}
.status-unused { background: #eef5ff; color: #2a64b5; }
.status-used { background: #f0f0f0; color: #666; }
.status-disabled { background: #faf0ef; color: #b5453a; }
.status-valid { background: #eef8f0; color: #2f7a3a; }

/* ============ 弹窗（全局统一） ============ */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: var(--modal-overlay-bg);
  z-index: var(--modal-z);
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.show {
  display: flex;
  animation: modal-fade var(--modal-duration) ease;
}
.modal-box {
  background: #fff;
  border-radius: var(--modal-radius);
  width: 100%;
  max-width: var(--modal-width);
  max-height: 88vh; overflow-y: auto;
  box-shadow: var(--modal-shadow);
  animation: modal-pop var(--modal-duration) cubic-bezier(.16, 1, .3, 1);
}
.modal-sm { max-width: var(--modal-width-sm); }
/* 文章编辑器弹窗加宽 */
.modal-box-editor { max-width: min(880px, 94vw); }
.modal-box-editor .vditor { border: 1px solid var(--border); border-radius: 8px; }
.modal-box-editor .vditor-toolbar { border-bottom: 1px solid var(--border); }

/* 前台文章 HTML 内容排版（编辑器产出） */
.article-html { font-size: 14.5px; color: #333; line-height: 1.9; word-break: break-word; }
.article-html h1, .article-html h2, .article-html h3, .article-html h4 { margin: 18px 0 10px; font-weight: 700; }
.article-html p { margin-bottom: 12px; }
.article-html img { max-width: 100%; border-radius: 8px; }
.article-html ul, .article-html ol { padding-left: 22px; margin-bottom: 12px; }
.article-html li { margin-bottom: 5px; }
.article-html blockquote { border-left: 3px solid var(--dark); background: #f7f8fa; padding: 10px 14px; margin: 0 0 12px; color: #555; }
.article-html pre { background: #f6f8fa; border: 1px solid var(--border); border-radius: 8px; padding: 13px 15px; overflow: auto; margin-bottom: 12px; }
.article-html pre code { font-family: Consolas, "Courier New", monospace; font-size: 13px; background: none; padding: 0; }
.article-html code { background: #f0f1f3; border-radius: 4px; padding: 2px 6px; font-size: 13px; font-family: Consolas, "Courier New", monospace; }
.article-html table { border-collapse: collapse; width: 100%; margin-bottom: 12px; }
.article-html th, .article-html td { border: 1px solid var(--border); padding: 8px 10px; font-size: 13.5px; }
.article-html th { background: #f7f8fa; }
.article-html a { color: #2f7cf6; }
/* 自定义页面（页面管理） */
.custom-page-wrap { max-width: 900px; }

/* 许愿游戏页 */
.wish-wrap { max-width: 660px; }
.wish-tip { margin: 6px 0 16px; }
.wish-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 24px 26px; }
.wish-submit { margin-top: 16px; min-width: 140px; }
.req-star { color: #e02d2d; }

/* 详情页：账号问题提交按钮与切换按钮并排 */
.copy-btn-plain { margin-left: 8px; }

/* 后台工单 */
.muted-text { color: var(--muted); }
.row-done { opacity: .55; }
.ticket-detail { max-width: 380px; min-width: 180px; white-space: pre-wrap; word-break: break-word; color: #555; font-size: 13px; line-height: 1.6; }
.modal-wide { max-width: 820px; }

/* 注册微信扫码弹窗：原生二维码状态区 */
.wx-qr-stage { min-height: 320px; display: flex; align-items: center; justify-content: center; }
.wx-qr-state { width: 100%; text-align: center; padding: 8px 0; }
.wx-qr-state p { margin: 12px 0 0; color: #666; font-size: 14px; }
.wx-qr-img {
  width: 224px; height: 224px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
}
.wx-qr-img canvas, .wx-qr-img img { display: block; }
.wx-qr-scan-tip { font-size: 15px !important; color: #333 !important; }
.wx-qr-brand { color: #07c160; }
.wx-qr-waiting { font-size: 12px !important; color: #999 !important; }
.wx-qr-expired { margin-top: 14px; }
.wx-qr-expired-text { color: #e64340 !important; margin-bottom: 10px !important; }
.wx-qr-result-icon {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px; font-size: 36px; color: #fff;
}
.wx-qr-result-icon.ok { background: #07c160; }
.wx-qr-result-icon.err { background: #e64340; }

/* ============ 全局提示弹窗（账号暂未上架等） ============ */
.notice-body { text-align: center; padding-top: 4px; }
.notice-icon {
  width: 72px; height: 72px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 6px auto 16px;
}
.notice-icon-warn { background: #fdf3e3; color: #e8a33d; }
.notice-text {
  font-size: 16px; line-height: 1.8; color: #222;
  margin: 0 0 12px; font-weight: 500;
}
.notice-kefu {
  font-size: 13px; line-height: 1.8; color: var(--muted);
  margin: 0 0 20px;
}
.notice-kefu b { color: #111; font-weight: 600; word-break: break-all; }
.wx-qr-error-text { color: #e64340 !important; line-height: 1.7 !important; margin-bottom: 14px !important; }
.wx-qr-state .btn-block { max-width: 240px; margin-left: auto; margin-right: auto; }
.wx-qr-spinner {
  display: inline-block; width: 34px; height: 34px;
  border: 3px solid #e5e5e5; border-top-color: #07c160;
  border-radius: 50%; animation: wx-qr-spin .8s linear infinite;
}
@keyframes wx-qr-spin { to { transform: rotate(360deg); } }
.pool-meta { color: var(--text-light, #888); font-size: 13px; margin-bottom: 10px; }
.pool-toolbar { margin-bottom: 12px; }
.pool-empty { text-align: center; color: var(--text-light, #888); padding: 28px 0; }

/* 用户管理：WXID 列与赠送时长弹窗 */
.td-wxid {
  max-width: 150px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.grant-row { display: flex; gap: 10px; }
.grant-row .form-input { flex: 1; }
.grant-row .form-select { width: 110px; flex: none; }

.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: var(--modal-pad-y) var(--modal-pad-x);
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 18px; font-weight: 700; margin: 0; }
.modal-close {
  flex-shrink: 0;
  border: none; background: none;
  font-size: 26px; line-height: 1; color: #999;
  cursor: pointer; padding: 0 4px;
  transition: color .15s ease;
}
.modal-close:hover { color: #333; }
.modal-body { padding: var(--modal-pad-y) var(--modal-pad-x) calc(var(--modal-pad-y) + 4px); }
.modal-body .form-label { margin-top: 14px; margin-bottom: 6px; }
.modal-body .form-label:first-child { margin-top: 0; }

/* 弹窗打开时锁定页面滚动 */
body:has(.modal-overlay.show) { overflow: hidden; }

@keyframes modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modal-pop {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .modal-overlay.show, .modal-box { animation: none; }
}

/* 游戏选择器：弹窗内默认满宽；工具栏内统一行内尺寸 */
.game-picker { width: 100%; }
.game-picker-inline,
.admin-search .game-picker { width: 260px; max-width: 100%; flex-shrink: 0; }
.admin-search .game-picker .form-input { width: 100%; }
.game-picker-input { padding-right: 30px; }

/* 输入框尾部清除叉号 */
.game-picker-clear {
  display: none;
  position: absolute; top: 50%; right: 9px;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  border: none; border-radius: 50%;
  background: #c4c4c4; color: #fff;
  font-size: 13px; line-height: 18px;
  text-align: center; padding: 0;
  cursor: pointer;
}
.game-picker-clear:hover { background: #9a9a9a; }
.game-picker-clear.show { display: block; }

/* Steam Guard 验证码弹窗 */
.guard-state { text-align: center; }
.guard-loading { color: var(--muted); padding: 14px 0; }
.guard-code {
  font-size: 42px; font-weight: 700; letter-spacing: 10px;
  text-indent: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--dark);
  padding: 8px 0 14px;
  user-select: all;
}
.guard-result .btn { margin-bottom: 4px; }
.guard-error { margin-bottom: 10px; }
.guard-hint { text-align: center; margin-top: 14px; margin-bottom: 12px; }

/* 游戏搜索下拉（弹窗内 / 工具栏通用） */
.game-search-wrap { margin-bottom: 18px; }
.search-select { position: relative; }
.search-dropdown {
  position: absolute; top: 100%; left: 0; right: 0;
  max-height: 220px; overflow-y: auto;
  background: #fff; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  margin-top: 4px;
  list-style: none; padding: 4px 0;
  display: none; z-index: 10;
  box-shadow: 0 6px 20px rgba(0,0,0,.1);
}
.search-dropdown.show { display: block; }
.search-dropdown li {
  padding: 9px 14px; cursor: pointer; font-size: 14px;
}
.search-dropdown li:hover { background: var(--bg-soft); }
.search-dropdown .search-no-result {
  color: var(--muted); cursor: default;
}
.search-dropdown .search-no-result:hover { background: none; }
.selected-game { margin-top: 8px; min-height: 20px; }
.selected-game-hint { color: var(--muted); font-size: 13px; }
.selected-game-tag {
  display: inline-block; font-size: 13.5px;
  padding: 4px 12px; border-radius: 20px;
  background: var(--dark); color: #fff;
}

/* 选项卡 */
.tab-bar {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.tab-btn {
  border: none; background: none;
  padding: 10px 18px; font-size: 15px;
  color: #777; cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab-btn:hover { color: #333; }
.tab-btn.active { color: var(--dark); border-bottom-color: var(--dark); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tab-panel .form-label:first-child { margin-top: 0; }

/* 双栏（账号池）已移除，保留占位防止冲突 */

/* ============ 分页 ============ */
.pagination-bar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  margin-top: 18px; padding: 12px 0;
}
.page-info { font-size: 13.5px; color: var(--muted); }
.page-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.page-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff; color: #333;
  font-size: 13.5px; text-decoration: none; cursor: pointer;
}
.page-btn:hover { background: var(--bg-soft); }
.page-btn.active { background: var(--dark); color: #fff; border-color: var(--dark); }
.page-ellipsis {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 34px; color: var(--muted);
}


/* 生成兑换码 */
.code-gen-form { margin-top: 8px; }
.code-gen-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.code-gen-row .form-input-sm { width: 110px; }
.code-result {
  font-family: Consolas, Menlo, monospace; font-size: 14px;
  background: var(--bg-soft);
}

/* 双栏（账号池） */
.admin-two-col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}

.cover-preview { max-width: 240px; border-radius: 8px; margin-top: 8px; }

/* ============ 响应式 ============ */
@media (max-width: 1080px) {
  .game-grid { grid-template-columns: repeat(4, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-stat-grid { grid-template-columns: repeat(3, 1fr); }
  .chart-grid { grid-template-columns: 1fr; }
  .game-layout { grid-template-columns: 1fr; }
  .game-side { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
}
@media (max-width: 720px) {
  .header-inner { gap: 16px; height: auto; padding: 14px 20px; flex-wrap: wrap; }
  .main-nav { gap: 16px; }
  .user-account { display: none; }
  .game-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-two-col { grid-template-columns: 1fr; }
  .admin-sidebar { width: 150px; }
  .game-side { grid-template-columns: 1fr; }
  .admin-stat-grid { grid-template-columns: repeat(2, 1fr); }

  /* iOS Safari: 输入框字号 <16px 聚焦时会自动放大页面，移动端统一 16px 防止缩放 */
  input, textarea, select,
  .form-input, .form-textarea, .form-select, .form-select-xs, .search-input {
    font-size: 16px;
  }
  .invite-link-row { flex-direction: column; align-items: stretch; }
  .invite-copy-btn { width: 100%; }
}

/* ============ 营销：注册赠送提醒 / 邀请卡片 ============ */
.reg-gift-banner {
  background: #eafaf1;
  border: 1px solid #b7e4c7;
  color: #1b6e3f;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13.5px;
  line-height: 1.5;
  text-align: center;
  margin-bottom: 14px;
}
.reg-gift-banner b { color: #0f7a3d; font-size: 15px; }

.invite-card {
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 28px;
}
.invite-badge {
  display: inline-block;
  background: #eafaf1;
  border: 1px solid #b7e4c7;
  color: #1b6e3f;
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 13.5px;
}
.invite-badge b { color: #0f7a3d; font-size: 15px; }
.invite-link-row { display: flex; gap: 10px; align-items: center; }
.invite-link-input { flex: 1; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13.5px; }
.invite-copy-btn { flex: none; white-space: nowrap; }
.invite-stats { margin-top: 12px; font-size: 13.5px; color: var(--muted); }
.invite-stats b { color: #333; }

/* 免费领会员（权益领取页） */
.benefit-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 18px;
}
.benefit-status-info { display: flex; align-items: center; gap: 12px; }
.benefit-status-label { font-size: 14px; color: var(--muted); }
.benefit-status-expire { font-size: 14px; color: var(--muted); white-space: nowrap; }
.benefit-status-expire b { color: #333; font-weight: 600; }
.benefit-task-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.benefit-task-main { flex: 1; min-width: 0; }
.benefit-task-action { flex: none; }
@media (max-width: 720px) {
  .benefit-status-card { flex-direction: column; align-items: flex-start; gap: 8px; }
  .benefit-task-head { flex-direction: column; align-items: stretch; }
  .benefit-task-action .btn { width: 100%; }
}
