:root {
  --bg: #16171a;
  --panel: #1e2025;
  --line: #2e3138;
  --text: #e7e8ea;
  --dim: #9aa0a8;
  --accent: #f28c28;
  --green: #46a05a;
  --red: #ff3c3c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 28px 22px 60px;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

header, .notice, main, footer { max-width: 1180px; margin: 0 auto; }

h1 { font-size: 24px; margin: 0 0 10px; font-weight: 650; }
h2 { font-size: 14px; margin: 0 0 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); }
.dim { color: var(--dim); }
.small { font-size: 12.5px; }
.lead { margin: 0 0 4px; color: #cfd2d6; max-width: 78ch; }

a { color: #7db8f0; text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: .92em;
  background: #26282e;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
}

.notice {
  margin: 16px auto 22px;
  padding: 12px 16px;
  background: #202428;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  font-size: 13.5px;
  color: #cfd2d6;
}

main {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr);
  gap: 22px;
  align-items: start;
}

@media (max-width: 900px) {
  main { grid-template-columns: minmax(0, 1fr); }
}

.frames { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }

.frames button {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px 5px 5px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--dim);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.frames button img { width: 46px; height: 26px; object-fit: cover; border-radius: 4px; }
.frames button.on { border-color: var(--accent); color: var(--text); background: #262a2f; }

.stage { position: relative; line-height: 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.stage img { width: 100%; display: block; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.controls { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }

button {
  padding: 7px 13px;
  background: #262a2f;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}

button:hover { background: #2e333a; }
button.primary { background: var(--accent); border-color: var(--accent); color: #1a1206; font-weight: 600; }
button.primary:hover { filter: brightness(1.08); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px 16px;
  margin-bottom: 16px;
}

.summary { font-size: 13.5px; margin-bottom: 12px; }
.summary .big { font-size: 17px; font-weight: 600; }
.summary .row { color: var(--dim); margin-top: 2px; }

.timeline { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }

.timeline .step {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 6px 8px;
  min-height: 92px;
  background: #1a1c20;
  transition: background .12s, border-color .12s;
}

.timeline .step.on { background: #31353c; border-color: var(--accent); }
.timeline .when { font-size: 10.5px; color: var(--dim); margin-bottom: 6px; white-space: nowrap; }
.timeline .keys { display: flex; flex-wrap: wrap; gap: 4px; }
.timeline .none { font-size: 11.5px; color: #6d737b; }

.chip {
  font: 600 11.5px/1 ui-monospace, Consolas, monospace;
  padding: 4px 6px;
  border-radius: 5px;
  background: var(--green);
  color: #fff;
}

.chip.mouse { background: var(--accent); color: #1a1206; }

textarea {
  width: 100%;
  resize: vertical;
  padding: 9px 10px;
  background: #15171a;
  color: #dfe3e8;
  border: 1px solid var(--line);
  border-radius: 7px;
  font: 12.5px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace;
}

#status { margin: 8px 0 0; color: var(--dim); }
#status.err { color: #ff9a9a; }
#status.ok { color: #8fd6a1; }

footer { margin-top: 34px; border-top: 1px solid var(--line); padding-top: 16px; color: #b9bec5; font-size: 13px; }
footer p { max-width: 82ch; }
