:root {
  --bg: #0f1215;
  --surface: #171b20;
  --surface-2: #20262d;
  --border: #2b323a;
  --text: #e6e9ec;
  --muted: #8a949e;
  --accent: #f0a63a;
  --accent-ink: #1a1206;
  --ok: #5cc98a;
  --warn: #e8c15a;
  --danger: #ef6b5f;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 28px 20px 60px; }
header.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
header.top h1 { margin: 0; font-size: 22px; letter-spacing: .3px; }
header.top h1 span { color: var(--accent); }
.sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 18px; }
.card + .card { margin-top: 16px; }
.card h2 { margin: 0 0 14px; font-size: 15px; font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px; border-radius: 7px; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.btn.small { padding: 4px 10px; font-size: 12px; }

input, select {
  font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 7px; padding: 7px 10px; min-width: 0;
}
input:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 0; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
label.check { display: flex; align-items: center; gap: 8px; font-size: 13px; }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
tr:last-child td { border-bottom: none; }
td.num { font-variant-numeric: tabular-nums; }

/* 大厅房间列表的地图列：4:3 缩略图 + 图名（图来自 public/thumbs/ 或 mods/thumbs/，没有图显示灰框） */
.map-cell { display: flex; align-items: center; gap: 10px; }
.map-thumb { display: block; width: 96px; height: 72px; flex: none; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); }
.map-name { color: var(--muted); font-size: 13px; }
@media (max-width: 600px) {   /* 手机上表格本来就要横向滑动，地图列收窄：小图、图名放到图下面 */
  .map-cell { flex-direction: column; align-items: flex-start; gap: 4px; }
  .map-thumb { width: 64px; height: 48px; }
  .map-name { font-size: 11px; }
}

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--danger); }

/* 玩法标签：颜色区分玩法，悬停显示胜负规则（data-mode 是玩法 id；地图自带模式的玩法 id 就是地图前缀） */
.mode-tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; line-height: 1.5;
  border: 1px solid currentColor; cursor: help; white-space: nowrap;
}
.mode-tag[data-mode="de"] { color: #f0a63a; background: rgb(240 166 58 / .1); }
.mode-tag[data-mode="cs"] { color: #5fb4f0; background: rgb(95 180 240 / .1); }
.mode-tag[data-mode="as"] { color: #c49af0; background: rgb(196 154 240 / .1); }
.mode-tag[data-mode="es"] { color: #5cc98a; background: rgb(92 201 138 / .1); }
.mode-tag[data-mode="fy"] { color: #8fd3e8; background: rgb(143 211 232 / .1); }
.mode-tag[data-mode="aim"] { color: #e8d36a; background: rgb(232 211 106 / .1); }
.mode-tag[data-mode="awp"] { color: #9fd86b; background: rgb(159 216 107 / .1); }
.mode-tag[data-mode="scout"] { color: #e89ad0; background: rgb(232 154 208 / .1); }
.mode-tag[data-mode="other"] { color: var(--muted); }
/* 不限地图的玩法（死斗）和带魔兽插件的玩法 */
.mode-tag[data-mode="war3ft"] { color: #ff7a6b; background: rgb(255 122 107 / .12); }
.mode-tag[data-mode="deathmatch"] { color: #ff5252; background: rgb(255 82 82 / .14); font-weight: 600; }
.mode-tag[data-mode="war3dm"] { color: #e05cff; background: rgb(224 92 255 / .14); font-weight: 600; }
.mode-tag[data-mode="zombie"] { color: #7fe05a; background: rgb(127 224 90 / .14); font-weight: 600; }

.meter { display: inline-block; width: 64px; height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; vertical-align: middle; margin-right: 8px; }
.meter > i { display: block; height: 100%; background: var(--ok); }
.meter.full > i { background: var(--danger); }

.empty { text-align: center; color: var(--muted); padding: 36px 10px; }
.msg { font-size: 13px; min-height: 18px; }
.msg.error { color: var(--danger); } .msg.ok { color: var(--ok); }

.modal-back { position: fixed; inset: 0; background: rgb(0 0 0 / .6); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.modal.wide { width: min(860px, 100%); }
.modal h3 { margin: 0 0 14px; font-size: 16px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
pre.logs { background: #0a0c0e; border: 1px solid var(--border); border-radius: 8px; padding: 12px; max-height: 60vh; overflow: auto; font-size: 12px; line-height: 1.45; white-space: pre-wrap; word-break: break-all; margin: 0; }
