:root {
  color-scheme: dark;
  --bg: #14101e;
  --panel: #211933;
  --inset: #191426;
  --border: #413451;
  --ink: #f3edff;
  --muted: #c2b6d4;
  --purple: #c4a6ff;
  --aqua: #86e1d7;
  --head: #ffcc90;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font: 16px/1.55 'Microsoft YaHei UI', 'PingFang SC', system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: radial-gradient(ellipse at 79% 3%, #352454 0, transparent 48%), var(--bg); }
button, input, select, textarea { font: inherit; }
a { color: var(--purple); }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .47; }
:focus-visible { outline: 3px solid var(--head); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.top { height: 64px; padding-inline: max(24px, calc((100% - 1120px)/2)); display: flex; justify-content: space-between; align-items: center; background: #191226a8; border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 750; letter-spacing: .04em; }
.top-link { font-size: .88rem; text-decoration: none; }
.shell { max-width: 1168px; margin: auto; padding: 0 24px; }
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin: 42px 0 26px; }
.eyebrow { margin: 0 0 8px; color: var(--purple); font: 700 .76rem/1.5 var(--mono); letter-spacing: .095em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(2.1rem, 5.25vw, 4rem); line-height: 1.12; letter-spacing: -.065em; }
h2 { margin-bottom: 5px; font-size: clamp(1.2rem, 3.5vw, 1.65rem); line-height: 1.3; overflow-wrap: anywhere; }
.sub { margin-bottom: 0; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 9px; flex: 0 0 auto; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 43px; border: 1px solid transparent; padding: 8px 15px; border-radius: 8px; font-weight: 720; text-decoration: none; white-space: normal; }
.button.primary { color: #241735; background: #c8a9ff; }
.button.primary:hover:not(:disabled) { background: #decaff; }
.button.ghost { color: var(--ink); background: #241a37; border-color: #5d4b77; }
.button.ghost:hover:not(:disabled) { background: #39284f; }
.button.small { font-size: .88rem; min-height: 39px; }
.studio, .editing, .export { border: 1px solid var(--border); border-radius: 15px; background: var(--panel); }
.studio { overflow: hidden; box-shadow: 0 18px 45px #0e0a1666; }
.panel-head, .edit-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 20px; }
.panel-head { border-bottom: 1px solid var(--border); }
.panel-head > div { min-width: 0; }
.panel-head h2, .edit-head h2 { margin-bottom: 0; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--aqua); margin-inline-end: 6px; vertical-align: 1px; }
.chip { border: 1px solid #62517c; color: #ded0ee; background: #2c2140; border-radius: 100px; padding: 3px 11px; font-size: .78rem; white-space: nowrap; }
.monitors { padding: 16px 20px 17px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.monitor { min-width: 0; min-height: 184px; padding: 15px; background: var(--inset); border: 1px solid var(--border); border-radius: 10px; box-shadow: inset 0 3px var(--accent); }
.monitor.prediction { --accent: var(--purple); }
.monitor.actual { --accent: var(--aqua); }
.monitor-label { color: var(--accent); font: 700 .82rem/1.5 var(--mono); }
.track-key { display: inline-block; text-align: center; width: 23px; border: 1px solid currentColor; margin-right: 4px; border-radius: 4px; }
.timecode { color: var(--muted); font: 500 .81rem/1.5 var(--mono); }
.monitor .timecode { margin: 7px 0; }
.frame-text { font-size: 1.05rem; margin-bottom: 0; }
.frame-text, .context { white-space: pre-wrap; overflow-wrap: anywhere; }
.context { margin: 9px 0 0; color: var(--muted); font-size: .85rem; }
.timeline { background: #181321; border-block: 1px solid var(--border); padding: 12px 20px; }
.transport { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; color: var(--muted); font-size: .8rem; }
.transport-controls { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.transport-controls output { margin-left: 6px; }
.icon-button { color: var(--ink); border: 1px solid #5d4b77; background: #261d36; min-width: 38px; min-height: 36px; padding: 1px 7px; border-radius: 5px; font: 1.3rem var(--mono); }
.trackbody { display: grid; grid-template-columns: 53px minmax(0,1fr); }
.track-labels { display: grid; grid-template-rows: 24px 24px; gap: 4px; padding-top: 16px; color: var(--muted); font: .75rem/24px var(--mono); }
.rail { position: relative; margin-inline: 10px; height: 71px; }
.ruler { height: 11px; background: repeating-linear-gradient(90deg, #796495 0 1px, transparent 1px 5%); opacity: .65; }
.lane { position: absolute; left: 0; right: 0; border-radius: 4px; height: 23px; border: 1px solid; }
.expectation { top: 16px; background: repeating-linear-gradient(135deg, #513675 0 7px, #483166 7px 14px); border-color: #7556a2; }
.observation { top: 44px; background: #233539; border-color: #3c6362; }
.rail:has(input:disabled) .lane { opacity: .55; }
.marker { position: absolute; left: var(--position); top: 5px; transform: translateX(-50%); width: 11px; height: 11px; border-radius: 2px; background: var(--aqua); }
.marker.review { border-radius: 50%; background: #b0f8e5; }
.playhead { position: absolute; pointer-events: none; left: var(--position, 0%); top: 3px; bottom: 1px; width: 2px; transform: translateX(-50%); background: var(--head); z-index: 2; }
.playhead::before { content: ''; position: absolute; left: 50%; top: 0; transform: translateX(-50%); width: 14px; height: 11px; background: var(--head); clip-path: polygon(0 0, 100% 0, 100% 45%, 50% 100%, 0 45%); }
.rail > input { appearance: none; position: absolute; inset: 0 auto 0 -10px; width: calc(100% + 20px); height: 100%; margin: 0; background: transparent; cursor: ew-resize; z-index: 3; }
.rail > input:disabled { cursor: default; }
.rail > input::-webkit-slider-thumb { appearance: none; width: 20px; height: 68px; background: transparent; }
.rail > input::-moz-range-thumb { width: 20px; height: 68px; background: transparent; border: 0; }
.axis { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font: .73rem/1.4 var(--mono); margin: 4px 10px 0 63px; }
.studio-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 12px; padding: 10px 20px; color: var(--muted); font-size: .86rem; }
#verdict-label { color: var(--head); }
.editing, .export { margin-top: 25px; }
.editing { padding-bottom: 16px; scroll-margin-top: 12px; }
.storage { color: var(--muted); font-size: .87rem; margin: 0 20px 14px; }
#record { padding: 0 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
fieldset { min-width: 0; margin: 0; border: 1px solid var(--border); border-radius: 9px; padding: 8px 12px 12px; }
legend { padding: 0 5px; font-weight: 720; color: var(--purple); }
label { display: block; margin-bottom: 12px; font-size: .86rem; }
label:last-child { margin-bottom: 0; }
label input, label select, label textarea { display: block; width: 100%; margin-top: 4px; color: var(--ink); background: #171224; border: 1px solid #635076; padding: 8px 9px; border-radius: 5px; }
label textarea { resize: vertical; }
label input::placeholder, label textarea::placeholder { color: #ad9cbd; }
.optional, .rules, .export p, .archive-links, .page-foot { color: var(--muted); font-size: .87rem; }
.changes { margin-top: 14px; }
.rules { margin-bottom: 9px; }
.change-row { display: grid; grid-template-columns: minmax(130px,.7fr) minmax(0,2fr) auto; gap: 8px; align-items: end; margin: 6px 0 12px; }
.change-row label { margin: 0; }
.edit-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 15px; }
.edit-actions p, .export p { margin-bottom: 0; }
.export { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: center; padding: 17px 20px; }
.export-note, .archive-links { grid-column: 1 / -1; }
.archive-links { padding-top: 10px; border-top: 1px solid var(--border); }
.archive-links h3, .archive-links ul { margin: 0; }
.archive-links a { overflow-wrap: anywhere; }
.page-foot { display: flex; justify-content: space-between; margin: 21px 0; }
.checkout { max-width: 660px; margin: 46px auto; }
.checkout .studio { padding: 24px; }
.checkout h1 { font-size: clamp(1.9rem, 5vw, 3rem); }
.checkout .actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.checkout .message { min-height: 1.6em; margin: 14px 0 0; color: var(--head); }
@media(max-width:750px) {
  .hero { flex-direction: column; align-items: flex-start; margin-top: 28px; }
  .export { grid-template-columns: 1fr; }
  .export button { justify-self: start; }
}
@media(max-width:500px) {
  .shell { padding-inline: 12px; }
  .top { height: 54px; padding-inline: 13px; }
  .hero { gap: 13px; margin: 20px 0; }
  .monitors { padding: 11px; gap: 7px; }
  .monitor { padding: 8px; }
  .frame-text { font-size: .93rem; }
  .panel-head, .timeline, .studio-foot, .edit-head, .export { padding-inline: 11px; }
  #record { padding-inline: 11px; }
  .storage { margin-inline: 11px; }
  .form-grid { grid-template-columns: 1fr; }
  .change-row { grid-template-columns: 1fr auto; }
  .change-row label:nth-child(2) { grid-row: 2; grid-column: 1 / -1; }
  .change-row button { grid-row: 1; grid-column: 2; }
  .transport { font-size: .73rem; }
  .trackbody { grid-template-columns: 35px minmax(0,1fr); }
  .axis { margin-left: 45px; }
}
@media(prefers-reduced-motion:reduce) { html { scroll-behavior: auto; } }
