:root { --paper: #fbfbf9; --ink: #1d1d1b; --ink-2: #74736d; --line: #deddd6; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--paper); color: var(--ink); }
body { font-family: -apple-system, "PingFang SC", "Helvetica Neue", sans-serif; -webkit-font-smoothing: antialiased; }

.stitch-page { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: 20px 16px 22px; gap: 12px; }
.stitch-head { text-align: center; }
.stitch-head h1 { margin: 0; font-family: "Songti SC", "STSong", serif; font-size: 22px; font-weight: 600; letter-spacing: 0.14em; }
.stitch-head p { margin: 3px 0 0; font-size: 12.5px; color: var(--ink-2); }

.stitch-stage { position: relative; height: min(calc(100dvh - 238px), 130vw); max-width: 100%; flex: 0 0 auto; cursor: grab; }
.stitch-stage:active { cursor: grabbing; }
.stitch-stage canvas { display: block; }

.stitch-controls { display: flex; flex-direction: column; align-items: center; gap: 9px; width: min(560px, 100%); }
.stitch-time { display: flex; align-items: center; gap: 12px; width: 100%; font-family: "Songti SC", "STSong", serif; font-size: 15px; color: #55544e; }
.stitch-track { position: relative; flex: 1; height: 40px; }
.stitch-ticks { position: absolute; inset: 11px 0; display: flex; justify-content: space-between; }
.stitch-ticks i { display: block; width: 2px; border-radius: 1px; opacity: 0.85; }
.stitch-thumb { position: absolute; top: 1px; width: 30px; height: 38px; margin-left: -15px; border-radius: 15px 15px 5px 5px; pointer-events: none;
  background: linear-gradient(#88c1ec, #e8d8a8); border: 3px solid #f7f2e4; box-shadow: 0 1px 5px rgba(50, 40, 20, 0.3); display: grid; place-items: center; }
.stitch-thumb::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: #fff7d8; box-shadow: 0 0 6px #fff2b0; }
.stitch-thumb[data-mode="moon"] { background: linear-gradient(#141a48, #26305f); }
.stitch-thumb[data-mode="moon"]::after { background: transparent; box-shadow: inset 3.5px -2px 0 0 #f5eecb; }
.stitch-track input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.stitch-track input:focus-visible ~ * { outline: none; }
.stitch-track:has(input:focus-visible) .stitch-thumb { outline: 2px solid #3267c4; outline-offset: 2px; }

.stitch-shots { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.stitch-shots button { font: inherit; font-size: 12.5px; padding: 5px 12px; min-height: 30px; border-radius: 999px; background: transparent; color: #4d4c46; border: 1px solid var(--line); cursor: pointer; }
.stitch-shots button:hover { background: #f1f0ea; }
.stitch-shots button:focus-visible { outline: 2px solid #3267c4; outline-offset: 1px; }
.stitch-hint { margin: 0; font-size: 11.5px; color: #93928a; }
