:root {
  --bg: #050510;
  --bg-2: #0a0a22;
  --card: rgba(255, 255, 255, 0.06);
  --card-2: rgba(255, 255, 255, 0.09);
  --text: #eef2ff;
  --muted: #a8b0d8;
  --cyan: #00e5ff;
  --magenta: #ff2d78;
  --purple: #a855f7;
  --line: rgba(0, 229, 255, 0.28);
  --shadow: 0 0 24px rgba(0, 229, 255, 0.18), 0 0 64px rgba(255, 45, 120, 0.12);
  --radius: 20px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 20% -10%, rgba(168, 85, 247, 0.22), transparent 60%),
    radial-gradient(1000px 500px at 90% 10%, rgba(0, 229, 255, 0.16), transparent 60%),
    linear-gradient(180deg, #050510, #0a0a22 60%, #050510);
  color: var(--text);
  font-family: "Rajdhani", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--cyan); }
h1, h2, h3, .brand-text strong { font-family: "Orbitron", "Rajdhani", "Noto Sans SC", sans-serif; letter-spacing: 0.04em; }
h1 { font-size: clamp(34px, 7vw, 64px); line-height: 1.08; margin: 0; text-shadow: 4px 4px 0 #000; }
h1 span { display: block; background: linear-gradient(90deg, var(--cyan), var(--purple), var(--magenta)); -webkit-background-clip: text; background-clip: text; color: transparent; }
h1 em { display: block; font-style: normal; font-size: clamp(18px, 3.4vw, 28px); color: var(--muted); margin-top: 12px; text-shadow: none; letter-spacing: 0.08em; }
h2 { font-size: 26px; margin: 0; }
.glow-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.5; }
.orb-a { width: 420px; height: 420px; background: #a855f7; top: -120px; left: -80px; }
.orb-b { width: 360px; height: 360px; background: #00e5ff; top: 20%; right: -120px; opacity: 0.32; }
.orb-c { width: 300px; height: 300px; background: #ff2d78; bottom: -100px; left: 30%; opacity: 0.28; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 12px 20px; background: rgba(5, 5, 16, 0.82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); min-width: 0; }
.brand-mark { color: var(--cyan); font-size: 22px; text-shadow: 0 0 12px var(--cyan); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: var(--muted); font-size: 11px; letter-spacing: 0.18em; }
.topnav { display: flex; gap: 18px; margin-left: auto; }
.topnav a { color: var(--muted); text-decoration: none; font-weight: 600; }
.topnav a:hover { color: var(--cyan); }
main { max-width: 1080px; margin: 0 auto; padding: 0 20px 40px; }
.hero { padding: 56px 0 28px; text-align: left; }
.hero-eyebrow { color: var(--cyan); letter-spacing: 0.22em; font-weight: 700; font-size: 13px; margin: 0 0 16px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--magenta); box-shadow: 0 0 12px var(--magenta); margin-right: 8px; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.hero-sub { color: var(--muted); font-size: 18px; max-width: 640px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0 28px; }
.btn { min-height: 48px; padding: 12px 20px; border-radius: 999px; border: 1px solid transparent; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary { background: linear-gradient(90deg, var(--cyan), var(--purple)); color: #04121a; box-shadow: 0 0 22px rgba(0, 229, 255, 0.45); }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { background: rgba(255, 255, 255, 0.06); color: var(--text); border-color: rgba(255, 255, 255, 0.22); }
.btn-danger { background: rgba(255, 45, 120, 0.14); color: #ff7aa8; border-color: rgba(255, 45, 120, 0.4); }
.btn-wide { width: 100%; }
.hud { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.hud-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: center; box-shadow: var(--shadow); }
.hud-num { display: block; font-family: "Orbitron", sans-serif; font-size: 28px; font-weight: 900; color: var(--cyan); text-shadow: 0 0 16px rgba(0, 229, 255, 0.6); }
.hud-label { color: var(--muted); font-size: 13px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin: 44px 0 16px; }
.section-tag { color: var(--magenta); font-size: 12px; letter-spacing: 0.24em; font-weight: 700; }
.featured-card, .glass-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.featured-cover { height: 180px; border-radius: 14px; display: flex; align-items: flex-end; padding: 16px; font-family: "Orbitron", sans-serif; font-size: 22px; font-weight: 900; color: #04121a; margin-bottom: 14px; overflow-wrap: anywhere; }
.toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.toolbar input[type="search"] { min-height: 52px; }
input, select, textarea { width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(5, 5, 16, 0.7); color: var(--text); font: inherit; font-size: 16px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--cyan); outline-offset: 1px; border-color: var(--cyan); }
input[type="color"] { padding: 4px; height: 52px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 44px; padding: 10px 16px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.22); background: transparent; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.chip.active { background: linear-gradient(90deg, var(--cyan), var(--purple)); color: #04121a; border-color: transparent; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.game-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; box-shadow: var(--shadow); transition: transform 0.15s ease, border-color 0.15s ease; }
.game-card:hover { transform: translateY(-3px); border-color: var(--cyan); }
.game-cover { height: 150px; display: flex; align-items: flex-end; padding: 14px; font-family: "Orbitron", sans-serif; font-weight: 900; font-size: 20px; color: #04121a; overflow-wrap: anywhere; }
.game-body { padding: 16px; }
.game-body h3 { margin: 0 0 6px; font-size: 20px; overflow-wrap: anywhere; }
.game-meta { color: var(--muted); font-size: 14px; margin: 0 0 8px; overflow-wrap: anywhere; }
.game-desc { margin: 0; color: var(--text); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgba(0, 229, 255, 0.16); color: var(--cyan); border: 1px solid rgba(0, 229, 255, 0.4); }
.badge.featured { background: rgba(255, 45, 120, 0.16); color: #ff7aa8; border-color: rgba(255, 45, 120, 0.45); }
.empty { text-align: center; padding: 36px 16px; border: 1px dashed rgba(255, 255, 255, 0.25); border-radius: var(--radius); color: var(--muted); }
.empty-title { font-size: 20px; color: var(--text); font-weight: 700; margin: 0 0 6px; }
.about-bio { font-size: 18px; }
.about-list { display: grid; gap: 12px; margin: 16px 0; }
.about-list div { display: grid; grid-template-columns: 90px 1fr; gap: 12px; }
.about-list dt { color: var(--muted); }
.about-list dd { margin: 0; overflow-wrap: anywhere; }
.log-list { display: grid; gap: 12px; margin-top: 14px; }
.log-item { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.log-item h3 { margin: 0 0 4px; font-size: 18px; overflow-wrap: anywhere; }
.log-item p { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.log-date { color: var(--cyan); font-weight: 700; white-space: nowrap; }
.count-pill { font-size: 14px; color: var(--cyan); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.footer { max-width: 1080px; margin: 0 auto; padding: 28px 20px 60px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--muted); }
.fab { position: fixed; right: 18px; bottom: 18px; width: 60px; height: 60px; border-radius: 50%; border: none; font-size: 30px; line-height: 1; color: #04121a; background: linear-gradient(135deg, var(--cyan), var(--magenta)); box-shadow: 0 0 28px rgba(0, 229, 255, 0.55); cursor: pointer; z-index: 30; }
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(2, 2, 10, 0.72); backdrop-filter: blur(4px); }
.sheet-panel { position: relative; width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; background: #0d0d26; border: 1px solid var(--line); border-bottom: none; border-radius: 24px 24px 0 0; padding: 20px 20px 0; box-shadow: 0 -10px 60px rgba(0, 229, 255, 0.25); }
.sheet-head { position: sticky; top: 0; background: #0d0d26; display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; z-index: 2; }
.sheet-head h3 { margin: 0; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.22); background: transparent; color: var(--text); font-size: 18px; cursor: pointer; }
.form { display: grid; gap: 14px; padding-bottom: 16px; }
.form label { display: grid; gap: 6px; font-weight: 600; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex !important; flex-direction: row; align-items: center; gap: 10px; }
.check input { width: 22px; height: 22px; min-height: 0; }
.form-error { color: #ff7aa8; margin: 0; }
.sheet-foot { position: sticky; bottom: 0; background: #0d0d26; display: flex; gap: 10px; padding: 14px 0 calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255, 255, 255, 0.12); }
.sheet-foot .btn { flex: 1; min-height: 52px; }
.detail-body { display: grid; gap: 12px; padding-bottom: 16px; overflow-wrap: anywhere; }
.detail-body h4 { margin: 12px 0 4px; color: var(--cyan); }
.detail-body p { margin: 0; }
.detail-links { display: flex; gap: 10px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #0d0d26; border: 1px solid var(--cyan); color: var(--text); padding: 12px 18px; border-radius: 999px; z-index: 80; box-shadow: var(--shadow); }
@media (max-width: 640px) {
  .topnav { display: none; }
  .topbar { padding: 10px 14px; }
  main { padding: 0 14px 32px; }
  .hero { padding-top: 36px; }
  .hud { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .toolbar .btn-wide { width: 100%; }
  .about-list div { grid-template-columns: 1fr; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ===== 管理员鉴权相关 =====
   未登录时隐藏所有编辑入口。默认 HTML 根节点不带 .is-admin，
   因此首屏即为访客状态，只有通过 /api/auth/status 确认登录后才显示。
   注意：这只是界面层的收敛，真正的安全边界在 Pages Functions 的 requireAdmin 守卫。 */
html:not(.is-admin) .admin-only { display: none !important; }

.footer-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* 页脚的管理入口：刻意做得低调，不吸引访客点击，安全性依靠口令而非隐蔽 */
.link-btn {
  background: none;
  border: 0;
  padding: 8px 6px;
  color: rgba(168, 176, 216, 0.42);
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.08em;
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.2s ease;
}
.link-btn:hover { color: var(--cyan); }
.link-btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
html.is-admin .link-btn { color: rgba(255, 45, 120, 0.72); }
