/* Design contract
   Mission: compare four real Spine animations, not decorative recreations.
   Warm neutral surfaces; element hues identify, never recolor the canvases.
   Type: system UI + Chinese sans; 12/14/16/32px, tabular timeline numerals.
   Rhythm: 4/8px; radii 6/12/16px. Focus is warm ivory, errors muted coral.
   Motion: immediate hover/press; brief spring-like entrance with 36ms stagger.
   Do: equal 2x2 stages, early controls, real file-count progress, readable errors.
   Don't: crop the effect, synthesize particles, fake percentages, animate chrome
   continuously, or substitute preview dimensions for atlas coordinate units.
*/
:root {
  color-scheme: dark;
  --page: #161513;
  --surface: #201e1b;
  --surface-raised: #292621;
  --border: #3a3630;
  --text: #f0ece5;
  --muted: #b2aaa0;
  --subtle: #918a80;
  --focus: #efdec3;
  --error: #efaa98;
  --radius: 12px;
  --fire: #f19b79;
  --water: #8abed9;
  --wind: #a8ceab;
  --earth: #d4b17b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--text); }
button, select, input { font: inherit; }
button, select { cursor: pointer; }
button, a, select, input { -webkit-tap-highlight-color: transparent; }
button, a, select { touch-action: manipulation; }
a { color: inherit; text-underline-offset: 4px; }
button:disabled, select:disabled, input:disabled, a[aria-disabled="true"] { cursor: not-allowed; opacity: .42; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip-path: inset(50%); white-space: nowrap; }
.workspace { max-width: 1248px; margin: 0 auto; padding: 32px 32px 40px; }
.identity { display: flex; align-items: center; gap: 12px; color: #c7c0b6; font-size: 12px; letter-spacing: 1px; }
.identity-mark { display: grid; grid-template-columns: repeat(2, 5px); gap: 3px; }
.identity-mark i { width: 5px; height: 5px; border-radius: 1px; background: var(--fire); }
.identity-mark i:nth-child(2) { background: var(--water); }
.identity-mark i:nth-child(3) { background: var(--wind); }
.identity-mark i:nth-child(4) { background: var(--earth); }
.identity-divider { color: #635c52; padding: 0 4px; }
.runtime-label { color: var(--subtle); letter-spacing: 1.5px; font-size: 10px; }
.heading-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin: 28px 0; }
.eyebrow { margin: 0 0 8px; color: var(--subtle); font-size: 10px; letter-spacing: 2px; }
h1 { margin: 0 0 8px; font-size: clamp(28px, 3vw, 36px); font-weight: 600; line-height: 1.4; letter-spacing: 1px; }
.title-dot { color: #b6a48b; }
.intro { margin: 0; color: var(--muted); font-size: 13px; }
.mobile-break { display: none; }
.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 14px; border: 1px solid #4b443a; border-radius: 6px; background: var(--surface-raised); color: var(--text); text-decoration: none; font-size: 12px; font-weight: 500; transition: background-color 120ms ease-out, border-color 120ms ease-out, transform 100ms ease-out; }
.button:not(:disabled):not([aria-disabled="true"]):hover { background: #353027; border-color: #8f7d64; }
.button:not(:disabled):not([aria-disabled="true"]):active { transform: translateY(1px); }
svg { display: block; width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.download-all { flex: 0 0 auto; }
.file-type { color: #bfb19b; font-size: 9px; letter-spacing: 1px; margin-left: 8px; border-left: 1px solid #534b3e; padding-left: 12px; }
.control-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.transport { display: flex; align-items: center; gap: 20px; padding: 16px 20px; }
.transport-buttons { display: flex; gap: 8px; flex: 0 0 auto; }
.play-button { min-width: 88px; background: #d6c4a8; border-color: #d6c4a8; color: #29241d; font-weight: 650; }
.play-button:not(:disabled):hover { background: #e4d3b7; border-color: #ead6b6; }
.play-icon { fill: currentColor; stroke: none; width: 16px; }
.pause-icon { display: none; stroke-width: 3; width: 16px; }
.play-button.is-playing .play-icon { display: none; }
.play-button.is-playing .pause-icon { display: block; }
.icon-button { width: 40px; padding: 8px; background: transparent; }
.icon-button svg { width: 16px; }
.timeline-label { min-width: 120px; flex: 1 1 auto; display: flex; align-items: center; gap: 16px; }
.timeline-label > span { color: var(--muted); white-space: nowrap; font-size: 12px; }
input[type="range"] { width: 100%; min-width: 60px; height: 28px; margin: 0; accent-color: #d6c4a8; cursor: pointer; }
output { font-size: 12px; white-space: nowrap; min-width: 132px; text-align: right; font-variant-numeric: tabular-nums; color: #e5ddd1; }
output span { color: var(--subtle); }
select { min-height: 36px; padding: 6px 8px; border: 1px solid #494238; border-radius: 6px; background: #292621; color: #ddd4c7; font-size: 12px; }
.view-options { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; padding: 12px 20px; border-top: 1px solid #35312b; }
.option-group { display: flex; align-items: center; gap: 12px; min-width: 0; }
.option-label { color: var(--subtle); font-size: 12px; flex: 0 0 auto; }
.segmented { display: flex; flex-wrap: wrap; gap: 4px; }
.segmented button { min-height: 32px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--muted); padding: 5px 10px; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background-color 100ms ease-out, color 100ms ease-out, border-color 100ms ease-out; }
.segmented button:not(:disabled):hover { background: #302c26; color: var(--text); }
.segmented button[aria-pressed="true"] { background: #353027; color: #eadcc7; border-color: #5e5140; }
.segmented button:not(:disabled):active { background: #443a2e; }
.swatch { width: 10px; height: 10px; border-radius: 2px; border: 1px solid #6b655d; flex: 0 0 auto; }
.swatch-dark { background: #0b0b0b; }
.swatch-light { background: #dcd8d0; }
.swatch-checker { background: conic-gradient(#888 25%, #444 0 50%, #888 0 75%, #444 0); }
.sync-caption { margin-left: auto; color: var(--subtle); font-size: 11px; white-space: nowrap; }
.sync-caption > span { margin-right: 6px; color: #b9ac96; font-size: 18px; vertical-align: -1px; }
.status-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 2px; min-height: 48px; color: var(--subtle); font-size: 11px; }
.status-row p { margin: 0; }
#status { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.status-indicator { width: 5px; height: 5px; border-radius: 50%; background: #b4a388; flex: 0 0 auto; align-self: center; }
#status[data-state="ready"] .status-indicator { background: #a8c8a0; }
#status[data-state="error"] { color: var(--error); }
#status[data-state="error"] .status-indicator { background: var(--error); }
#timeline-help { flex-shrink: 0; }
kbd { font: inherit; padding: 1px 4px; border: 1px solid #494238; border-radius: 3px; color: #c9c0b3; }
.error-notice { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 20px; margin: 0 0 16px; background: #30221e; border: 1px solid #765042; border-radius: 8px; color: var(--error); font-size: 12px; }
.error-notice p { margin: 4px 0 0; overflow-wrap: anywhere; color: #d1b3a8; }
.error-notice .button { flex-shrink: 0; }
.comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.variant { min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); --element: var(--fire); animation: arrive 420ms cubic-bezier(.16, 1, .3, 1) both; }
.variant[data-element="water"] { --element: var(--water); animation-delay: 36ms; }
.variant[data-element="wind"] { --element: var(--wind); animation-delay: 72ms; }
.variant[data-element="earth"] { --element: var(--earth); animation-delay: 108ms; }
.variant-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; min-height: 88px; }
.variant-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.element-symbol { display: grid; place-items: center; width: 36px; height: 40px; color: var(--element); font-size: 21px; font-weight: 400; border: 1px solid #4a443b; border-radius: 8px; flex: 0 0 auto; }
h2 { margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 15px; font-weight: 600; line-height: 1.5; }
h2 > span { color: var(--element); font-size: 9px; letter-spacing: 1.8px; font-weight: 500; }
.variant-subtitle { margin: 3px 0 0; color: var(--subtle); font-size: 11px; }
.variant-download { color: var(--muted); display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 4px 0 4px 6px; text-decoration: none; font-size: 11px; flex: 0 0 auto; transition: color 100ms ease-out; }
.variant-download:not([aria-disabled="true"]):hover { color: var(--element); }
.variant-download svg { width: 16px; height: 16px; }
.stage { position: relative; aspect-ratio: 4 / 3; background: #090909; border-top: 1px solid #302d28; border-bottom: 1px solid #302d28; }
canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
.comparison[data-background="checker"] .stage { background-color: #292929; background-image: conic-gradient(#363636 25%, transparent 0 50%, #363636 0 75%, transparent 0); background-size: 24px 24px; }
.comparison[data-background="light"] .stage { background: #dcd8d0; }
.stage-coordinate { position: absolute; bottom: 12px; left: 16px; color: #88837b; font-size: 8px; letter-spacing: 1.8px; pointer-events: none; }
.comparison[data-background="light"] .stage-coordinate { color: #77716a; }
.loading-panel { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 20px; background: #141310e8; color: #c6bfb4; text-align: center; }
.loading-title { font-size: 16px; letter-spacing: 4px; color: var(--element); }
.load-message { font-size: 11px; margin: 0; overflow-wrap: anywhere; }
.load-progress { width: min(180px, 85%); height: 3px; border: 0; border-radius: 4px; accent-color: var(--element); }
.load-progress::-webkit-progress-bar { background: #3d3830; border-radius: 4px; }
.load-progress::-webkit-progress-value { background: var(--element); border-radius: 4px; }
.load-progress::-moz-progress-bar { background: var(--element); border-radius: 4px; }
.loading-panel[data-state="error"] .load-message { color: var(--error); }
.variant-footer { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 20px; font-size: 11px; color: var(--muted); margin-top: auto; }
.variant-footer p { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.variant-state { flex: 0 0 auto; color: var(--subtle); font-size: 10px; }
.variant-state[data-state="ready"] { color: var(--element); }
.variant-state[data-state="error"] { color: var(--error); }
.page-footer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, .8fr); gap: 48px; padding-top: 28px; margin-top: 28px; border-top: 1px solid var(--border); color: var(--subtle); font-size: 11px; line-height: 1.9; }
.page-footer p { margin: 0 0 8px; }
.page-footer .footer-title { color: #c6bcae; font-size: 13px; margin-bottom: 8px; }
details { min-width: 0; }
summary { color: #c2b8a8; cursor: pointer; width: fit-content; margin-bottom: 8px; font-size: 12px; }
.page-footer a { color: #d3c2a7; }
@keyframes arrive { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 1000px) {
  .transport { gap: 12px; }
  .timeline-label { gap: 10px; }
  .timeline-label > span { display: none; }
  .sync-caption { display: none; }
  .variant-header { padding: 16px; }
  .variant-footer { padding: 12px 16px; }
}
@media (max-width: 700px) {
  .workspace { padding: 24px 16px 32px; }
  .heading-row { align-items: flex-start; flex-direction: column; gap: 20px; margin: 24px 0; }
  .transport { flex-wrap: wrap; gap: 12px; padding: 12px; }
  .timeline-label { order: 4; flex-basis: 100%; }
  .timeline-label > span { display: block; }
  output { margin-left: auto; min-width: auto; }
  .view-options { gap: 12px; padding: 12px; }
  .option-group { gap: 8px; }
  .segmented button { padding: 5px 8px; }
  .comparison { gap: 12px; }
  .variant-header { padding: 12px; min-height: 80px; gap: 6px; }
  .element-symbol { display: none; }
  h2 { font-size: 14px; gap: 6px; }
  h2 > span { font-size: 8px; letter-spacing: 1px; }
  .variant-subtitle { font-size: 10px; }
  .variant-download > span { display: none; }
  .variant-download { width: 28px; justify-content: flex-end; }
  .variant-footer { flex-wrap: wrap; gap: 4px 12px; padding: 10px 12px; font-size: 10px; }
  .stage-coordinate { font-size: 7px; left: 10px; bottom: 8px; }
  .status-row { align-items: flex-start; font-size: 10px; }
  .keyboard-hint { display: none; }
  .page-footer { gap: 20px; grid-template-columns: 1fr; padding-top: 20px; margin-top: 24px; }
}
@media (max-width: 500px) {
  .workspace { padding: 20px 16px 28px; }
  .comparison { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .variant-header { padding: 12px 16px; min-height: 76px; }
  .element-symbol { display: grid; width: 32px; height: 36px; font-size: 19px; }
  h2 { gap: 10px; }
  .variant-download { width: auto; }
  .variant-download > span { display: inline; }
  .variant-footer { flex-wrap: nowrap; padding: 12px 16px; }
  .view-options { gap: 12px 20px; }
  .option-group { flex-basis: 100%; }
  .option-label { width: 28px; }
  .segmented button { min-height: 36px; padding: 6px 12px; }
  .mobile-break { display: block; }
  .intro { font-size: 12px; }
  .speed-label { margin-left: auto; }
  output { font-size: 11px; }
  .transport { gap: 8px; }
  .transport-buttons { gap: 6px; }
  .play-button { min-width: 76px; padding: 8px 10px; }
  .icon-button { width: 36px; }
  select { padding: 6px; font-size: 11px; }
  .error-notice { align-items: flex-start; flex-direction: column; gap: 12px; padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .variant { animation: none; }
  .button, .segmented button, .variant-download { transition: none; }
}
