@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #10110f;
  --ink: #f6f1e7;
  --muted: #9c9486;
  --line: rgba(246, 241, 231, 0.14);
  --card: rgba(255, 250, 242, 0.045);
  --brass: #e2b15c;
  --sage: #8eaa98;
  color-scheme: dark;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; min-height: 100%; }

body {
  color: var(--ink);
  background:
    radial-gradient(1000px 520px at 0% -10%, rgba(226, 177, 92, 0.18), transparent 55%),
    radial-gradient(800px 480px at 100% 8%, rgba(90, 122, 104, 0.2), transparent 50%),
    var(--bg);
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.glow {
  position: fixed;
  inset: auto auto 8% -8%;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: rgba(226, 177, 92, 0.08);
  filter: blur(40px);
  pointer-events: none;
}

.page {
  position: relative;
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.top, .foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.top { padding-bottom: 18px; border-bottom: 1px solid var(--line); }

.word {
  font-family: "Instrument Serif", "Palatino Linotype", Palatino, serif;
  font-style: italic;
  font-size: 34px;
  letter-spacing: -0.03em;
  text-decoration: none;
  color: inherit;
}

.top-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.top-line i {
  width: 28px;
  height: 1px;
  background: var(--brass);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-link, .admin-out {
  flex: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}

.admin-link:hover, .admin-out:hover {
  border-color: rgba(226, 177, 92, 0.7);
  color: var(--brass);
}

.login-form {
  display: grid;
  gap: 14px;
  max-width: 420px;
  margin-top: 8px;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.login-form input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.2);
  font: inherit;
}

.stage {
  display: grid;
  grid-template-columns: 1.5fr 0.8fr;
  gap: 18px;
  padding: 42px 0 34px;
}

.kicker, .plate-kicker {
  margin: 0 0 12px;
  color: var(--brass);
  font-family: "Instrument Serif", Palatino, serif;
  font-style: italic;
  font-size: 22px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.meters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-self: end;
  max-width: 460px;
  padding: 12px 8px 18px 0;
}

.meter-label {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.meter-value {
  margin: 12px 0 16px;
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 650;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.meter-bar {
  display: flex;
  gap: 3px;
  height: 14px;
}

.seg {
  flex: 1 1 0;
  border-radius: 2px;
  background: rgba(246, 241, 231, 0.2);
}

.seg.is-on { background: #3cbe73; }

.plate-note, .slot p, .card p, .catalog-head p {
  color: var(--muted);
}

.plate {
  align-self: end;
  min-height: 240px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(160deg, rgba(226, 177, 92, 0.16), transparent 42%),
    var(--card);
}

.plate-num {
  margin: 8px 0;
  font-family: "Instrument Serif", Palatino, serif;
  font-size: 108px;
  line-height: 0.8;
  letter-spacing: -0.05em;
}

.plate-note { margin: 12px 0 0; }

.catalog-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 14px;
}

.catalog-head h2, .group-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sage);
}

.catalog-head p { margin: 0; }

.bento, .grid {
  display: grid;
  gap: 14px;
}

.bento {
  grid-template-columns: 1.15fr 0.9fr 0.9fr;
  grid-template-rows: 168px 168px;
}

.slot-tall { grid-row: 1 / span 2; }
.slot-wide { grid-column: 2 / span 2; }

.slot, .card {
  position: relative;
  overflow: hidden;
  min-height: 168px;
  padding: 18px 18px 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
}

.slot::after, a.card::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -30px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 1px solid rgba(226, 177, 92, 0.28);
}

.slot h3, .card h3 {
  margin: 28px 0 8px;
  font-size: 26px;
  font-weight: 640;
  letter-spacing: -0.03em;
}

.slot p, .card p { margin: 0; max-width: 28em; }

.num {
  color: var(--brass);
  font-family: "Instrument Serif", Palatino, serif;
  font-size: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease;
}

a.card:hover {
  transform: translateY(-4px);
  border-color: rgba(226, 177, 92, 0.7);
}

.card.is-soon { opacity: 0.72; }

.card-meta, .slot {
  /* slot already positioned */
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.label, .pill {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.pill { margin-left: auto; }
.card:not(.is-soon) .pill {
  color: var(--brass);
  border-color: transparent;
  background: rgba(226, 177, 92, 0.14);
}

.group { margin-top: 22px; }
.group-title { margin-bottom: 12px; }
.grid { grid-template-columns: repeat(3, 1fr); }

.foot {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.beian {
  color: var(--muted);
  text-decoration: none;
}

.beian:hover { color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

@media (max-width: 860px) {
  .page { width: min(1120px, calc(100% - 28px)); }
  .stage, .bento, .grid, .editor { grid-template-columns: 1fr; }
  .slot-tall, .slot-wide { grid-row: auto; grid-column: auto; }
  .bento { grid-template-rows: none; }
  .plate-num { font-size: 84px; }
  .meters { gap: 22px; max-width: none; padding-top: 28px; }
  .catalog-head { display: block; }
  .top-actions { flex-wrap: wrap; justify-content: flex-end; margin-top: 10px; }
  .editor-split { grid-template-columns: 1fr; }
}

.top-line a { color: var(--brass); text-decoration: none; }

h1 {
  margin: 0;
  font-size: clamp(48px, 7vw, 84px);
  font-weight: 620;
  line-height: 0.92;
  letter-spacing: -0.045em;
}

.lede {
  max-width: 36em;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.editor-stage { padding-bottom: 12px; }
.editor-stage h1 { font-size: clamp(48px, 6vw, 72px); }

.editor {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 18px;
  align-items: start;
}

.editor-error {
  margin: 0 0 14px;
  color: #e7b4a0;
}

.editor-empty { color: var(--muted); }

.editor-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.editor-row.is-on .editor-pick { color: var(--brass); }

.editor-pick, .editor-ops button, .editor-actions button, .editor-form input, .editor-form textarea, .editor-form select {
  font: inherit;
  color: var(--ink);
  background: transparent;
}

.editor-pick {
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.editor-ops { display: flex; gap: 8px; }
.editor-ops button, .editor-actions button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
}

.editor-form {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
}

.editor-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.editor-form input, .editor-form textarea, .editor-form select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
}

.editor-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.editor-actions { display: flex; gap: 10px; }
.editor-actions button[type="submit"] {
  color: #1a140c;
  background: var(--brass);
  border-color: transparent;
}
