/* ===== 登录用户系统 · 统一样式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #08080f;
  --bg-2: #0e0e1a;
  --card: rgba(255, 255, 255, 0.035);
  --card-strong: rgba(255, 255, 255, 0.06);
  --text: #f1f2f8;
  --text-2: #9799b0;
  --text-3: #6b6d84;
  --accent: #a78bfa;
  --accent-2: #22d3ee;
  --accent-3: #f472b6;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --danger: #f87171;
  --ok: #4ade80;
  --warn: #fbbf24;
  --radius: 16px;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.75);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 600px at 12% -5%, rgba(167, 139, 250, 0.16), transparent 60%),
    radial-gradient(800px 600px at 88% 8%, rgba(34, 211, 238, 0.10), transparent 60%),
    radial-gradient(700px 700px at 50% 110%, rgba(244, 114, 182, 0.09), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

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

::selection { background: rgba(167, 139, 250, 0.35); color: #fff; }

/* ===== 认证页布局 ===== */
.auth-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 38px 34px 32px;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 8px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: linear-gradient(135deg, #a78bfa, #22d3ee);
  box-shadow: 0 0 22px rgba(167, 139, 250, 0.55);
}

.brand-name { font-size: 20px; font-weight: 900; letter-spacing: -0.02em; }

.auth-title { text-align: center; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin: 6px 0 4px; }
.auth-sub { text-align: center; color: var(--text-2); font-size: 14px; margin-bottom: 26px; }

/* ===== 表单 ===== */
.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 7px;
}

.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 14.5px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.input::placeholder { color: var(--text-3); }
.input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.18);
}

.field-hint { font-size: 12px; color: var(--text-3); margin-top: 5px; }

.check-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); margin: 4px 0 18px; cursor: pointer; user-select: none; }
.check-row input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 18px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s, opacity 0.18s;
  text-decoration: none;
  color: #0b0713;
}

.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(100deg, #c4b5fd, #a78bfa 45%, #22d3ee);
  box-shadow: 0 12px 30px -10px rgba(167, 139, 250, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.09); }

.btn-danger {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.4);
  color: var(--danger);
}
.btn-danger:hover:not(:disabled) { background: rgba(248, 113, 113, 0.24); }

.btn-sm { width: auto; padding: 7px 13px; font-size: 13px; border-radius: 9px; }

.auth-foot { text-align: center; margin-top: 22px; font-size: 13.5px; color: var(--text-2); }
.auth-foot a { font-weight: 600; }

.msg { display: none; margin-bottom: 16px; padding: 11px 14px; border-radius: 10px; font-size: 13.5px; }
.msg.error { display: block; background: rgba(248, 113, 113, 0.12); border: 1px solid rgba(248, 113, 113, 0.35); color: #fca5a5; }
.msg.ok { display: block; background: rgba(74, 222, 128, 0.1); border: 1px solid rgba(74, 222, 128, 0.3); color: #86efac; }

/* ===== 应用页（dashboard / admin）===== */
.app {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0 26px;
}

.topbar .brand { margin: 0; justify-content: flex-start; }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 17px;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.35), rgba(34, 211, 238, 0.25));
  flex: 0 0 34px;
}

.avatar.lg { width: 72px; height: 72px; font-size: 36px; flex-basis: 72px; }

.user-chip .uname { font-weight: 700; font-size: 14px; }
.user-chip .urole { font-size: 12px; color: var(--text-3); }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
}

@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } }

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(10px);
}

.panel h2 { font-size: 17px; font-weight: 800; margin-bottom: 18px; letter-spacing: -0.01em; }

.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.profile-meta .nm { font-size: 18px; font-weight: 800; }
.profile-meta .em { font-size: 13.5px; color: var(--text-2); }

/* 头像快捷选择 */
.avatar-picks { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.avatar-picks button {
  width: 40px; height: 40px; border-radius: 11px; font-size: 20px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.avatar-picks button:hover { transform: translateY(-2px); }
.avatar-picks button.sel { border-color: var(--accent); background: rgba(167, 139, 250, 0.18); }

/* ===== 统计卡片 ===== */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
@media (max-width: 760px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}
.stat-card .num { font-size: 26px; font-weight: 900; letter-spacing: -0.02em; background: linear-gradient(120deg, #e9e5ff, #a78bfa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-card .lbl { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }

/* ===== 工具栏 / 表格 ===== */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; }
.toolbar .spacer { flex: 1; }
.toolbar .input { width: auto; min-width: 200px; flex: 1; }
.select {
  padding: 12px 14px; border-radius: 11px; border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04); color: var(--text); font-size: 14px; font-family: inherit;
}
.select:focus { outline: none; border-color: var(--accent); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--text-3); font-size: 12px; font-weight: 600; letter-spacing: 0.03em; }
td { color: var(--text); }
tbody tr { transition: background 0.15s; }
tbody tr:hover { background: rgba(255, 255, 255, 0.03); }

.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-user .avatar { width: 32px; height: 32px; font-size: 15px; flex-basis: 32px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.badge.admin { background: rgba(167, 139, 250, 0.18); color: #c4b5fd; border: 1px solid rgba(167, 139, 250, 0.35); }
.badge.user { background: rgba(34, 211, 238, 0.12); color: #67e8f9; border: 1px solid rgba(34, 211, 238, 0.3); }
.badge.active { background: rgba(74, 222, 128, 0.12); color: #86efac; border: 1px solid rgba(74, 222, 128, 0.3); }
.badge.disabled { background: rgba(248, 113, 113, 0.12); color: #fca5a5; border: 1px solid rgba(248, 113, 113, 0.35); }
.badge.pending { background: rgba(251, 191, 36, 0.14); color: #fcd34d; border: 1px solid rgba(251, 191, 36, 0.35); }
.badge.me { background: rgba(251, 191, 36, 0.12); color: #fcd34d; border: 1px solid rgba(251, 191, 36, 0.3); }

.row-actions { display: flex; gap: 6px; }
.row-actions button { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; border: 1px solid var(--border); background: rgba(255, 255, 255, 0.04); color: var(--text-2); cursor: pointer; transition: 0.15s; }
.row-actions button:hover { color: var(--text); background: rgba(255, 255, 255, 0.09); }
.row-actions button.danger:hover { color: var(--danger); border-color: rgba(248, 113, 113, 0.4); }

.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 16px; font-size: 13.5px; color: var(--text-2); }
.pager button { padding: 7px 13px; border-radius: 9px; border: 1px solid var(--border); background: rgba(255, 255, 255, 0.04); color: var(--text); cursor: pointer; }
.pager button:disabled { opacity: 0.4; cursor: not-allowed; }

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

/* ===== 模态框 ===== */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(5, 5, 12, 0.7); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; z-index: 200; padding: 20px;
}
.modal-backdrop.open { display: flex; }

.modal {
  width: 100%; max-width: 460px; background: #12121f; border: 1px solid var(--border-strong);
  border-radius: 18px; padding: 26px; box-shadow: var(--shadow); max-height: 90vh; overflow-y: auto;
}
.modal h3 { font-size: 18px; font-weight: 800; margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }

.modal-close { position: absolute; } /* 由按钮类替代 */

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 140%);
  padding: 13px 20px; border-radius: 12px; background: rgba(20, 20, 32, 0.96);
  border: 1px solid var(--border-strong); color: var(--text); font-size: 14px;
  z-index: 300; opacity: 0; transition: transform 0.4s cubic-bezier(0.22,1,0.36,1), opacity 0.3s;
  max-width: calc(100vw - 40px);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.err { border-color: rgba(248, 113, 113, 0.5); }

.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.mt { margin-top: 14px; }

/* ===== 游戏管理 ===== */
.game-cover-row { display: flex; align-items: center; gap: 14px; }
.game-cover-preview {
  width: 96px; height: 60px; object-fit: cover; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--bg-2);
}
.game-icon-preview {
  width: 52px; height: 52px; display: grid; place-items: center;
  font-size: 28px; border-radius: 12px; border: 1px dashed var(--border-strong);
  background: var(--bg-2);
}
.game-cover-actions { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.game-cover-actions input[type="file"] { font-size: 12.5px; color: var(--text-2); max-width: 240px; }
.cell-cover {
  width: 72px; height: 46px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--bg-2); display: block;
}
.cell-ico { font-size: 26px; display: inline-block; }
.game-link-cell { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }
