:root {
  --bg-0: #1b1b1d;
  --bg-1: #2a2a2e;
  --bg-2: #323236;
  --text-1: #f5f5f7;
  --text-2: #d1d1d6;
  --text-3: #98989d;
  --text-4: #6e6e73;
  --accent: #0a84ff;
  --accent-2: #30d158;
  --accent-3: #ff9f0a;
  --danger: #ff453a;
  --glass-bg: rgba(44, 44, 46, 0.55);
  --glass-bg-strong: rgba(38, 38, 42, 0.72);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-strong: rgba(255, 255, 255, 0.22);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --radius-card: 18px;
  --radius-btn: 13px;
  --radius-input: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--text-1);
  background: radial-gradient(1200px 600px at 80% -10%, rgba(10, 132, 255, 0.10), transparent 60%),
    radial-gradient(900px 500px at 0% 100%, rgba(48, 209, 88, 0.07), transparent 55%),
    linear-gradient(160deg, #1c1c1e 0%, #262629 45%, #1e1e20 100%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px 96px;
}

/* 毛玻璃卡片 */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}

/* 右侧亚克力导航 */
.sidenav {
  position: fixed;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 50;
  padding: 10px;
  border-radius: 22px;
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}
.sidenav a, .sidenav button {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.22s ease;
  white-space: nowrap;
}
.sidenav a svg, .sidenav button svg { width: 18px; height: 18px; flex: none; }
.sidenav a:hover, .sidenav button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-1);
}
.sidenav a.active {
  background: rgba(10, 132, 255, 0.18);
  border-color: rgba(10, 132, 255, 0.5);
  color: #fff;
}
.sidenav .nav-user {
  border-top: 1px solid var(--glass-border);
  margin-top: 6px;
  padding-top: 12px;
}
.sidenav .nav-user .uname { max-width: 92px; overflow: hidden; text-overflow: ellipsis; }

/* 顶部页眉（移动端） */
.topbar { display: none; }

/* 标题 */
.hero { text-align: center; padding: 56px 16px 28px; }
.hero h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin: 0 0 12px;
  background: linear-gradient(120deg, #fff, #c7c7cc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p { color: var(--text-3); font-size: 16px; max-width: 620px; margin: 0 auto; }

.section-title { font-size: 23px; font-weight: 700; margin: 36px 0 16px; }
.muted { color: var(--text-3); font-size: 13px; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-1);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font);
}
.btn:hover { background: rgba(255, 255, 255, 0.12); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}
.btn-primary:hover { background: #3398ff; }
.btn-accent-2 { background: var(--accent-2); border-color: transparent; color: #04210f; }
.btn-accent-2:hover { filter: brightness(1.08); }
.btn-danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 10px; }

/* 表单 */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 7px; font-weight: 500; }
.req { color: var(--accent-3); margin-left: 3px; }
.input, .textarea, select.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-input);
  border: 1px solid var(--glass-border);
  background: rgba(20, 20, 22, 0.55);
  color: var(--text-1);
  font-size: 15px;
  font-family: var(--font);
  transition: all 0.2s ease;
  outline: none;
}
.input::placeholder, .textarea::placeholder { color: var(--text-4); }
.input:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.22);
}
.textarea { resize: vertical; min-height: 92px; line-height: 1.6; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 验证码行 */
.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.captcha-row .input { flex: 1; }
.captcha-img {
  height: 46px; border-radius: 12px; cursor: pointer; border: 1px solid var(--glass-border);
  background: #1b1b1d; transition: transform 0.3s ease, opacity 0.3s ease; flex: none;
}
.captcha-img.spin { transform: rotate(-8deg); opacity: 0.4; }

/* 卡片网格 */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1199px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 767px) { .grid { grid-template-columns: 1fr; } }

.game-card { overflow: hidden; display: flex; flex-direction: column; cursor: pointer; transition: transform 0.25s ease, box-shadow 0.25s ease; }
.game-card:hover { transform: translateY(-4px); box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55); }
.game-card .cover { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: #2a2a2e; display: block; }
.game-card .body { padding: 14px 15px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.game-card h3 { font-size: 18px; font-weight: 700; margin: 0; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08); color: var(--text-2); border: 1px solid rgba(255, 255, 255, 0.06);
}
.tag b { color: var(--text-1); font-weight: 600; }
.desc { font-size: 13.5px; color: var(--text-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-actions { margin-top: auto; display: flex; gap: 8px; }
.card-actions .btn { flex: 1; }

/* 搜索栏 */
.searchbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; max-width: 560px; margin: 0 auto; }
.searchbar svg { width: 18px; height: 18px; color: var(--text-3); flex: none; }
.searchbar input { flex: 1; border: none; background: transparent; color: var(--text-1); font-size: 15px; outline: none; font-family: var(--font); }
.searchbar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.22); }

/* 表单卡片（登录/注册/投稿） */
.form-wrap { max-width: 600px; margin: 28px auto; padding: 28px 26px; }
.form-wrap h2 { margin: 0 0 6px; font-size: 24px; }
.form-wrap .sub { color: var(--text-3); font-size: 14px; margin-bottom: 22px; }

/* 登录引导（未登录投稿） */
.gate { text-align: center; padding: 40px 20px; }
.gate h2 { font-size: 22px; margin: 0 0 10px; }
.gate p { color: var(--text-3); margin: 0 0 20px; }

/* Toast */
.toast-wrap { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast {
  padding: 12px 20px; border-radius: 14px; font-size: 14px; font-weight: 500;
  background: var(--glass-bg-strong); backdrop-filter: blur(20px); border: 1px solid var(--glass-border-strong);
  box-shadow: var(--shadow); color: var(--text-1); animation: toastIn 0.28s ease;
  max-width: 90vw;
}
.toast.ok { border-color: rgba(48, 209, 88, 0.55); }
.toast.err { border-color: rgba(255, 69, 58, 0.6); }
.toast.info { border-color: rgba(10, 132, 255, 0.5); }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* 骨架屏 */
.skeleton { background: linear-gradient(100deg, #2a2a2e 30%, #34343a 50%, #2a2a2e 70%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius-card); height: 280px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.empty { text-align: center; color: var(--text-3); padding: 60px 20px; }

/* 免责声明 */
.disclaimer { margin-top: 28px; font-size: 12.5px; color: var(--text-4); line-height: 1.8; }
.disclaimer summary { cursor: pointer; color: var(--text-3); }

/* 友链 */
.link-grid { display: grid; gap: 16px; grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1199px) { .link-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 767px) { .link-grid { grid-template-columns: repeat(3, 1fr); } }
.link-card { padding: 16px 12px; text-align: center; transition: transform 0.25s ease, border-color 0.2s ease; cursor: pointer; }
.link-card:hover { transform: translateY(-3px); border-color: var(--glass-border-strong); }
.link-card img { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; background: rgba(255,255,255,0.08); margin-bottom: 8px; }
.link-card .name { font-size: 13px; color: var(--text-2); }

/* 用户中心 */
.profile-head { display: flex; align-items: center; gap: 16px; padding: 22px; margin-bottom: 18px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; color: #fff; }
.kv-list { display: grid; gap: 1px; }
.kv-row { display: flex; justify-content: space-between; padding: 13px 18px; background: rgba(255,255,255,0.03); font-size: 14px; }
.kv-row .k { color: var(--text-3); }

/* 管理后台 */
.admin-shell { display: flex; min-height: 100vh; }
.admin-nav { width: 220px; flex: none; padding: 20px 14px; border-right: 1px solid var(--glass-border); position: sticky; top: 0; height: 100vh; }
.admin-nav h4 { font-size: 13px; color: var(--text-3); margin: 14px 10px 8px; letter-spacing: 0.5px; }
.admin-nav a { display: block; padding: 10px 14px; border-radius: 12px; color: var(--text-2); font-size: 14px; margin-bottom: 4px; transition: all 0.2s ease; }
.admin-nav a:hover { background: rgba(255,255,255,0.07); color: var(--text-1); }
.admin-nav a.active { background: rgba(10,132,255,0.18); color: #fff; }
.admin-main { flex: 1; padding: 28px 32px; min-width: 0; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th, table.tbl td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--glass-border); vertical-align: top; }
table.tbl th { color: var(--text-3); font-weight: 600; }
table.tbl tr:hover td { background: rgba(255,255,255,0.03); }

.status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.status.pending { background: rgba(255,159,10,0.18); color: #ffb340; }
.status.approved { background: rgba(48,209,88,0.18); color: #4cd964; }
.status.rejected { background: rgba(255,69,58,0.18); color: #ff6961; }
.status.active { background: rgba(48,209,88,0.18); color: #4cd964; }
.status.disabled { background: rgba(120,120,128,0.25); color: #aeaeb2; }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 150; padding: 20px; }
.modal { width: 100%; max-width: 560px; padding: 26px; max-height: 88vh; overflow: auto; }
.modal h3 { margin: 0 0 16px; }

.countdown { font-variant-numeric: tabular-nums; }

/* 移动端底部导航 */
@media (max-width: 767px) {
  .sidenav { display: none; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 50; padding: 12px 16px;
    background: var(--glass-bg-strong); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
  }
  .bottomnav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    display: flex; justify-content: space-around; padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
    background: var(--glass-bg-strong); backdrop-filter: blur(24px); border-top: 1px solid var(--glass-border);
  }
  .bottomnav a, .bottomnav button { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--text-3); background: none; border: none; cursor: pointer; }
  .bottomnav a.active { color: var(--accent); }
  .bottomnav svg { width: 20px; height: 20px; }
  .container { padding: 20px 14px 84px; }
  .admin-nav { display: none; }
  .admin-shell { flex-direction: column; }
  .admin-main { padding: 18px 14px 80px; }
  .bottomnav.admin { background: var(--glass-bg-strong); }
}
