:root {
  --bg: #0e1016;
  --panel: #151925;
  --panel2: #1b2130;
  --border: #242c40;
  --text: #cdd3e0;
  --dim: #8b93a8;
  --accent: #7aa2f7;
  --accent-dim: #3d5a99;
  --playing: #7aa2f7;
  --played: #565f89;
  --danger: #e26d7a;
  --ok: #6fbf8f;
  --radius: 10px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 15px;
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* 顶部导航 */
.nav {
  border-bottom: 1px solid var(--border);
  background: rgba(14, 16, 22, 0.92);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(6px);
}
.nav .wrap { display: flex; align-items: center; gap: 26px; height: 54px; }
.nav .brand { font-weight: 600; font-size: 16px; color: var(--text); letter-spacing: 1px; display: flex; align-items: center; gap: 9px; }
.brand-logo { height: 34px; width: auto; flex-shrink: 0; }
.hero-visual { width: 100%; height: 300px; object-fit: cover; border-radius: 14px; border: 1px solid var(--border); display: block; }
#hero h1 { margin-top: 18px; }
.nav .brand:hover { text-decoration: none; }
.nav a { color: var(--dim); font-size: 14px; }
.nav a.on { color: var(--accent); }

/* 通用 */
h1 { font-size: 26px; font-weight: 600; letter-spacing: 1px; }
h2 { font-size: 19px; font-weight: 600; margin: 28px 0 14px; }
h3 { font-size: 16px; font-weight: 600; }
.muted { color: var(--dim); font-size: 13px; }
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.btn {
  display: inline-block; padding: 8px 18px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--panel2);
  color: var(--text); cursor: pointer; font-size: 14px;
  transition: all .15s;
}
.btn:hover { border-color: var(--accent-dim); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #0e1016; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger { color: var(--danger); border-color: #5a2f3a; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
input[type="text"], input[type="password"], textarea, select {
  background: var(--panel2); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 8px 12px;
  font-size: 14px; font-family: inherit; outline: none; width: 100%;
}
input:focus, textarea:focus { border-color: var(--accent-dim); }
label { font-size: 13px; color: var(--dim); }
.field { margin-bottom: 14px; }
.field > label { display: block; margin-bottom: 5px; }

/* 徽章 */
.badge {
  display: inline-block; padding: 1px 10px; border-radius: 20px;
  font-size: 12px; border: 1px solid var(--border); color: var(--dim);
}
.badge.playing { background: rgba(122, 162, 247, .14); border-color: var(--accent-dim); color: var(--playing); }
.badge.played { background: rgba(86, 95, 137, .18); border-color: #3d4665; color: #9aa5c4; }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--dim); font-weight: 500; font-size: 13px; }

/* 统计卡 */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0; }
.stat { text-align: center; padding: 16px 8px; }
.stat .num { font-size: 28px; font-weight: 700; color: var(--accent); }
.stat .lbl { font-size: 13px; color: var(--dim); margin-top: 2px; }

/* 状态切换按钮组 */
.tgl { display: inline-flex; gap: 6px; }
.tgl button {
  padding: 3px 12px; border-radius: 6px; font-size: 12.5px; cursor: pointer;
  border: 1px solid var(--border); background: transparent; color: var(--dim);
  transition: all .12s;
}
.tgl button.sel-playing {
  background: var(--playing); border-color: var(--playing); color: #0e1016; font-weight: 600;
}
.tgl button.sel-played {
  background: var(--played); border-color: var(--played); color: #e8ecf5; font-weight: 600;
}

/* 游戏行（答卷） */
.game-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 10px; border-radius: 8px;
}
.game-row:nth-child(odd) { background: rgba(255, 255, 255, .02); }
.game-row .gname { flex: 1; }

/* 提示框 */
.toast {
  position: fixed; top: 64px; right: 24px; z-index: 100;
  padding: 10px 18px; border-radius: 8px; font-size: 14px;
  background: var(--panel2); border: 1px solid var(--border);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .4);
  animation: fadein .2s;
}
.toast.err { border-color: #5a2f3a; color: #e8a1ab; }
.toast.ok { border-color: #2f5a45; color: #9fdcb9; }
@keyframes fadein { from { opacity: 0; transform: translateY(-6px); } }

/* 匹配条 */
.sim-bar { height: 7px; background: var(--panel2); border-radius: 4px; overflow: hidden; }
.sim-bar > div { height: 100%; background: var(--accent); border-radius: 4px; }

.footer {
  margin-top: 48px; padding: 26px 0 40px; border-top: 1px solid var(--border);
  color: var(--dim); font-size: 13px; text-align: center;
}
.notice {
  border-left: 3px solid var(--accent-dim); background: rgba(122, 162, 247, .06);
  padding: 10px 14px; border-radius: 0 8px 8px 0; font-size: 13.5px; color: var(--text);
  margin: 14px 0;
}
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tabs button {
  padding: 8px 18px; background: none; border: none; color: var(--dim);
  cursor: pointer; font-size: 14px; border-bottom: 2px solid transparent; font-family: inherit;
}
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.modal-back {
  position: fixed; inset: 0; background: rgba(5, 7, 12, .75); z-index: 90;
  display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 40px 16px;
}
.modal {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  width: 100%; max-width: 640px; padding: 22px;
}
.modal h3 { margin-bottom: 14px; }
.modal .acts { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.hidden { display: none !important; }
.progress-stick {
  position: sticky; top: 54px; z-index: 40; background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 16px; margin: 14px 0; display: flex; gap: 16px; align-items: center;
  flex-wrap: wrap;
}
.progress-stick .bar { flex: 1; min-width: 140px; height: 8px; background: var(--panel2); border-radius: 4px; overflow: hidden; }
.progress-stick .bar > div { height: 100%; background: var(--accent); transition: width .2s; }
.cat-chip { font-size: 12.5px; color: var(--dim); cursor: pointer; padding: 2px 10px; border: 1px solid var(--border); border-radius: 16px; background: none; }
.cat-chip:hover { color: var(--accent); border-color: var(--accent-dim); }
.cat-chip.on { color: var(--accent); border-color: var(--accent-dim); background: rgba(122, 162, 247, .08); }
.cat-block { margin-bottom: 22px; }
.cat-block h3 { margin-bottom: 6px; display: flex; align-items: baseline; gap: 10px; }
.cat-block h3 .cnt { font-size: 12px; color: var(--dim); font-weight: 400; }
#chart { width: 100%; height: 380px; }
