:root {
  color-scheme: dark;
  --ink: #f4f1ea;
  --muted: #b7b1a6;
  --line: rgba(244, 241, 234, .16);
  --gold: #e4c27a;
  --bg: #12110f;
  --panel: #1c1a17;
  --green: #b7d7a8;
  --red: #e7b1b1;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--ink);
  background: radial-gradient(circle at 12% 0%, rgba(228, 194, 122, .16), transparent 28%), var(--bg);
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.topbar, main { width: min(1080px, calc(100% - 32px)); margin: 0 auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 0; }
.brand b { display: block; font-family: Georgia, "Songti SC", serif; font-size: 22px; font-weight: 500; }
.brand small { color: var(--muted); letter-spacing: .14em; font-size: 11px; }
.panel {
  border: 1px solid var(--line); border-radius: 16px; background: rgba(28, 26, 23, .92); padding: 22px;
}
.login { width: min(440px, 100%); margin: 8vh auto 0; }
h1, h2 { font-family: Georgia, "Songti SC", serif; font-weight: 500; }
h1 { margin: 0 0 8px; font-size: 36px; }
h2 { margin: 0; font-size: 22px; }
p { color: var(--muted); line-height: 1.7; }
form, .stack { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-size: 14px; }
input {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.04); padding: 12px;
}
input:focus { outline: 2px solid var(--gold); border-color: transparent; }
.primary, .ghost {
  border-radius: 999px; padding: 11px 16px; border: 1px solid transparent;
}
.primary { background: var(--gold); color: #241b0d; font-weight: 750; }
.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.primary:disabled { opacity: .6; cursor: wait; }
.status { min-height: 1.4em; color: var(--gold); }
.status[data-bad="true"] { color: var(--red); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 8px 0 18px; }
.stat { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.03); }
.stat b { display: block; font-size: 32px; font-family: Georgia, serif; font-weight: 500; }
.stat span { color: var(--muted); font-size: 13px; }
.toolbar { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 16px; }
.card {
  margin: 0 0 18px; padding: 18px; border-radius: 16px; border: 1px solid rgba(228, 194, 122, .45);
  background: rgba(228, 194, 122, .08);
}
.secret { margin: 4px 0 12px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 20px; letter-spacing: .04em; }
.actions, .filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters { margin: 8px 0 12px; }
.filters button[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
th { color: var(--muted); font-weight: 600; }
.tag { display: inline-block; border-radius: 999px; padding: 3px 8px; border: 1px solid var(--line); font-size: 12px; }
.tag.issued { color: var(--gold); }
.tag.sold { color: var(--red); }
.tag.available { color: var(--green); }
.pass { font-family: ui-monospace, Menlo, Consolas, monospace; }
@media (max-width: 720px) {
  .stats, .toolbar { grid-template-columns: 1fr; display: grid; }
  table { display: block; overflow-x: auto; }
  h1 { font-size: 30px; }
}
