* { box-sizing: border-box; }
:root {
  color-scheme: light;
  --paper: #f3efe5;
  --surface: #fffdf8;
  --ink: #282622;
  --muted: #716c62;
  --line: #d6cebd;
  --red: #963d31;
  --green: #346553;
  --amber: #8a652d;
}
body {
  margin: 0; min-height: 100vh; color: var(--ink); background: var(--paper);
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
}
.admin-header {
  min-height: 76px; padding: 14px clamp(18px, 4vw, 56px); display: flex;
  align-items: center; justify-content: space-between; gap: 24px;
  color: #f8f3e8; background: #242620; border-bottom: 3px solid var(--red);
}
.brand { color: #d9b56f; font: 13px "Kaiti SC", "STKaiti", serif; letter-spacing: .28em; }
h1 { margin: 4px 0 0; font: 22px "Kaiti SC", "STKaiti", serif; letter-spacing: 0; }
nav { display: flex; gap: 8px; }
.button {
  min-height: 36px; padding: 7px 14px; border: 1px solid #d9b56f; border-radius: 4px;
  color: #242620; background: #d9b56f; font: inherit; text-decoration: none; cursor: pointer;
}
.button.secondary { color: #f8f3e8; background: transparent; border-color: #777a6c; }
main { width: min(1460px, calc(100% - 32px)); margin: 24px auto 48px; }
.summary {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface); border: 1px solid var(--line);
}
.summary div { min-height: 84px; padding: 16px 20px; border-right: 1px solid var(--line); }
.summary div:last-child { border-right: 0; }
.summary span { display: block; color: var(--muted); font-size: 12px; }
.summary strong { display: block; margin-top: 5px; font-size: 28px; font-weight: 600; }
.toolbar {
  display: grid; grid-template-columns: minmax(240px, 1fr) 180px 180px auto;
  gap: 12px; align-items: end; margin: 18px 0 12px;
}
.toolbar label span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; }
input, select {
  width: 100%; height: 38px; padding: 7px 10px; border: 1px solid #bcb3a1;
  border-radius: 3px; color: var(--ink); background: var(--surface); font: inherit;
}
input:focus, select:focus { outline: 2px solid rgba(52,101,83,.22); border-color: var(--green); }
.result-count { padding-bottom: 10px; color: var(--muted); white-space: nowrap; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th { padding: 11px 12px; color: #565147; background: #e8e1d3; text-align: left; font-size: 12px; font-weight: 600; }
td { padding: 13px 12px; border-top: 1px solid #e4ddcf; vertical-align: top; line-height: 1.55; overflow-wrap: anywhere; }
tbody tr:hover { background: #faf7ef; }
th:nth-child(1) { width: 22%; }
th:nth-child(2) { width: 18%; }
th:nth-child(3) { width: 24%; }
th:nth-child(4) { width: 15%; }
th:nth-child(5) { width: 10%; }
th:nth-child(6) { width: 11%; }
.primary { font-weight: 600; }
.sub { margin-top: 3px; color: var(--muted); font-size: 12px; }
.progress-line { display: flex; align-items: center; gap: 8px; }
.progress-track { flex: 1; height: 5px; overflow: hidden; background: #ddd6c8; }
.progress-fill { height: 100%; background: var(--green); }
.badge { display: inline-block; padding: 2px 7px; border: 1px solid #aaa18f; border-radius: 999px; font-size: 12px; }
.badge.playing { color: var(--green); border-color: #84a294; }
.badge.ended { color: var(--amber); border-color: #b99b67; }
.badge.banned { color: var(--red); border-color: #bd8c84; }
.badge.empty { color: var(--muted); }
.empty { padding: 64px 20px; color: var(--muted); text-align: center; }
.hidden { display: none !important; }
@media (max-width: 820px) {
  .admin-header { align-items: flex-start; }
  nav { flex-direction: column; }
  .summary { grid-template-columns: repeat(2, 1fr); }
  .summary div:nth-child(2) { border-right: 0; }
  .summary div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .toolbar label:first-child, .result-count { grid-column: 1 / -1; }
  table { min-width: 980px; }
}
@media (max-width: 480px) {
  main { width: min(100% - 20px, 1460px); margin-top: 14px; }
  .admin-header { padding: 12px; }
  h1 { font-size: 18px; }
  .button { padding-inline: 10px; }
  .toolbar { grid-template-columns: 1fr; }
  .toolbar label:first-child, .result-count { grid-column: auto; }
}
