:root {
  --bg: #0a0a0c;
  --bg-2: #0e0e12;
  --bg-3: #131318;
  --panel: rgba(255, 255, 255, 0.03);
  --line: rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.06);
  --txt: #ececea;
  --txt-2: #b8b8b2;
  --muted: #8b8b86;
  --accent: #c8f04b;
  --accent-soft: rgba(200, 240, 75, 0.14);
  --accent-line: rgba(200, 240, 75, 0.35);
  --danger: #ff7b7b;
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 16px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body { font-family: var(--font); background: var(--bg); color: var(--txt); line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--accent); color: #0a0a0c; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font); font-size: 14px; font-weight: 600;
  border-radius: 999px; padding: 12px 20px; border: 1px solid transparent;
  transition: transform 0.2s, background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #0a0a0c; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 26px rgba(200,240,75,0.3); }
.btn-ghost { background: rgba(255,255,255,0.04); color: var(--txt); border-color: var(--line); }
.btn-ghost:hover { background: rgba(255,255,255,0.08); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-danger { background: rgba(255,123,123,0.1); color: var(--danger); border-color: rgba(255,123,123,0.25); }
.btn-danger:hover { background: rgba(255,123,123,0.18); }
.btn-mini { padding: 7px 12px; font-size: 12.5px; border-radius: 9px; }

/* gate */
.gate { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(60% 60% at 50% 0%, rgba(200,240,75,0.05), transparent 60%), var(--bg); }
.gate[hidden] { display: none; }
.gate-panel { width: min(400px, 92vw); background: var(--bg-2); border: 1px solid var(--line); border-radius: 20px; padding: 40px; box-shadow: 0 40px 100px rgba(0,0,0,0.5); }
.gate-logo { width: 54px; height: 54px; border-radius: 15px; background: var(--accent); display: grid; place-items: center; margin-bottom: 20px; }
.gate-logo img { width: 32px; height: 32px; }
.gate-title { font-size: 26px; font-weight: 700; }
.gate-sub { color: var(--muted); font-size: 14px; margin: 4px 0 26px; font-family: var(--font-mono); }
.gate-form { display: flex; flex-direction: column; gap: 16px; }
.gate-back { display: block; margin-top: 20px; text-align: center; color: var(--muted); font-size: 13px; }
.gate-back:hover { color: var(--accent); }

.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 12px; letter-spacing: 0.06em; color: var(--muted); }
.field input, .field textarea {
  background: rgba(255,255,255,0.04); border: 1px solid var(--line);
  border-radius: 12px; padding: 13px 15px; color: var(--txt); font-size: 14px; font-family: var(--font);
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
  resize: vertical;
}
.field input:focus, .field textarea:focus { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
.form-error { color: var(--danger); font-size: 13px; }

/* dashboard */
.topbar { position: sticky; top: 0; z-index: 50; height: 68px; background: rgba(10,10,12,0.8); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line-soft); }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(16px, 3vw, 32px); }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-logo { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; }
.topbar-logo img { width: 20px; height: 20px; }
.topbar-title { font-weight: 700; font-size: 16px; }
.topbar-right { display: flex; gap: 10px; }
.content { max-width: 1240px; margin: 0 auto; padding: 40px clamp(16px, 4vw, 40px) 80px; }
.content-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.kicker { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.page-title { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 26px; }
.stat { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 16px; padding: 22px; }
.stat b { display: block; font-family: var(--font-mono); font-size: 32px; font-weight: 700; color: var(--accent); }
.stat span { font-size: 13px; color: var(--muted); }

.card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 18px; overflow: hidden; margin-bottom: 26px; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line-soft); }
.card-head h2 { font-size: 18px; font-weight: 700; }
.card-count { font-family: var(--font-mono); color: var(--muted); font-size: 13px; }
.security-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 16px; align-items: end; padding: 20px 24px 24px; }
.security-form .form-error { grid-column: 1 / -1; margin: -6px 0; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 14px 20px; text-align: left; font-size: 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table th { font-size: 12px; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; font-weight: 500; }
.table tbody tr { transition: background 0.15s; }
.table tbody tr:hover { background: rgba(255,255,255,0.02); }
.table tbody tr:last-child td { border-bottom: none; }
.table-sm td, .table-sm th { padding: 12px 20px; }
.ta-r { text-align: right !important; }

.cover-thumb { width: 70px; height: 44px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); }
.game-row-title { display: flex; flex-direction: column; }
.game-row-title b { font-size: 14px; }
.game-row-title span { font-size: 12px; color: var(--muted); max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.desc-cell { max-width: 260px; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; max-width: 200px; }
.tag-list span { font-size: 11px; font-family: var(--font-mono); color: var(--txt-2); background: rgba(255,255,255,0.05); border: 1px solid var(--line-soft); padding: 2px 7px; border-radius: 6px; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid; }
.pill.on { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.pill.off { color: var(--muted); border-color: var(--line); }
.pill.warn { color: var(--warm); border-color: rgba(240,163,90,0.4); background: rgba(240,163,90,0.14); }
.pill.dev { color: var(--accent); border-color: var(--accent-line); background: rgba(200,240,75,0.12); }
.switcher { display: flex; gap: 8px; }
.switcher button {
  flex: 1; height: 44px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04); border: 1px solid var(--line);
  color: var(--txt-2); font-family: var(--font); font-size: 14px; cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.switcher button.is-active { background: var(--accent); color: #0a0a0c; border-color: var(--accent); }
.captcha-row { display: flex; align-items: center; gap: 10px; }
.captcha-row input { flex: 1; }
.captcha-img { width: 120px; height: 44px; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; background: #131318; flex: 0 0 120px; }
.mm-anim { background: rgba(255,255,255,0.05); border: 1px solid var(--line); color: var(--txt-2); border-radius: 8px; padding: 5px 10px; font-size: 12px; cursor: pointer; }
.mm-anim:hover, .mm-anim.is-on { border-color: var(--accent-line); color: var(--accent); }
.shot-list { display: flex; flex-wrap: wrap; gap: 8px; }
.shot { position: relative; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-3); display: inline-block; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot button { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; background: rgba(10,10,12,0.7); color: #fff; border: none; cursor: pointer; font-size: 12px; line-height: 1; }
.shot button:hover { background: var(--warm); }
.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 18px; }
#settingsForm { display: block; padding: 20px 24px 24px; }
#settingsForm .settings-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.link-cell { color: var(--accent); font-size: 13px; font-family: var(--font-mono); max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-actions { display: inline-flex; gap: 8px; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* editor modal */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(6,6,8,0.7); backdrop-filter: blur(8px); }
.modal-panel { position: relative; width: min(560px, 96vw); max-height: 92vh; overflow-y: auto; background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px; padding: 32px; box-shadow: 0 40px 100px rgba(0,0,0,0.6); animation: pop 0.3s cubic-bezier(0.2,0.8,0.2,1); }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: none; } }
.modal-close { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.05); border: 1px solid var(--line); color: var(--txt); font-size: 18px; }
.modal-close:hover { background: rgba(255,255,255,0.12); }
.modal-title { font-size: 24px; font-weight: 700; margin-bottom: 22px; }
.editor-form { display: flex; flex-direction: column; gap: 18px; }
.cover-block { display: flex; flex-direction: column; gap: 8px; }
.cover-row { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.cover-preview { width: 150px; height: 94px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-3); flex: 0 0 auto; }
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.cover-controls { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.upload-btn { display: inline-flex; padding: 10px 16px; border-radius: 10px; background: rgba(255,255,255,0.05); border: 1px solid var(--line); font-size: 13px; font-weight: 600; cursor: pointer; width: fit-content; transition: background 0.2s; }
.upload-btn:hover { background: rgba(255,255,255,0.1); }
.cover-hint { font-size: 12px; color: var(--muted); }
.cover-controls input[type=text] { background: rgba(255,255,255,0.04); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; color: var(--txt); font-family: var(--font); font-size: 13px; outline: none; width: 100%; max-width: 100%; }
.cover-controls input[type=text]:focus { border-color: var(--accent-line); }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--txt-2); }
.check input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.editor-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 8px; }
.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 300; background: #15151a; border: 1px solid var(--line); color: var(--txt); padding: 14px 22px; border-radius: 999px; font-size: 14px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }

@media (max-width: 720px) {
  .stat-row { grid-template-columns: 1fr; }
  .cover-row { flex-direction: column; }
  .security-form { grid-template-columns: 1fr; }
}

/* 数据统计 */
.stats-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; }
.stats-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; }
.kpi { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 14px; padding: 16px 18px; }
.kpi span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.kpi b { font-family: var(--font-mono); font-size: 24px; font-weight: 700; }
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart-box { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 14px; padding: 16px; }
.chart-box h3 { margin: 0 0 12px; font-size: 14px; font-weight: 500; color: var(--txt-2); }
.chart-box svg { width: 100%; height: auto; display: block; }
@media (max-width: 900px) { .stats-grid { grid-template-columns: 1fr; } .charts { grid-template-columns: 1fr; } }
