@font-face {
  font-family: 'ZCOOL KuaiLe';
  src: url('/assets/rounded-zh.woff2') format('woff2');
  font-display: swap;
}
:root {
  color-scheme: light;
  --ink: #684b62;
  --muted: #765f73;
  --accent: #936482;
  --outline: #e8d6e1;
  --rose: #f1e3ef;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100svh;
  font: 16px/1.55 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  color: var(--ink);
  background: #fcf7f8;
}
.decor { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.decor > * { position: absolute; }
.heart { width: clamp(40px, 10vw, 121px); top: 6%; left: 5%; transform: rotate(-17deg); fill: #e8b8cd42; }
.bubble { width: clamp(98px, 22vw, 264px); aspect-ratio: 1; border: 1px solid #ead7e599; border-radius: 50%; left: -6%; bottom: 0; background: #f0dbe52c; }
.bubble::after { content: ''; position: absolute; width: 18%; aspect-ratio: 1; border-radius: 50%; left: 84%; top: -13%; background: #e9d9ef66; }
.cloud { width: clamp(108px, 20vw, 235px); height: clamp(45px, 8vw, 90px); top: 23%; right: -4%; border-radius: 59% 46% 44% 51%; background: #e9ddef52; rotate: -14deg; }
.cloud::before, .cloud::after { content: ''; position: absolute; border-radius: 50%; background: #eee4f1; }
.cloud::before { width: 35%; aspect-ratio: 1; left: 17%; top: -33%; }
.cloud::after { width: 41%; aspect-ratio: 1; left: 45%; top: -46%; }
.pebble { width: clamp(64px, 13vw, 150px); aspect-ratio: 1.16; background: #f1dce641; border-radius: 60% 41% 54% 37%; right: 2%; bottom: 13%; rotate: 21deg; }
.spark { width: clamp(19px, 3vw, 32px); left: 15%; top: 34%; fill: #dec8e18a; rotate: 12deg; }
.flower { width: clamp(23px, 4.7vw, 48px); right: 10%; bottom: 28%; rotate: 17deg; fill: #dfb1c45c; }
.flower circle { fill: #fcf7f8; }
.paw { width: clamp(27px, 4.5vw, 52px); right: 7%; bottom: 7%; rotate: -20deg; color: #c299b65e; }
main { position: relative; width: min(100%, 760px); margin: auto; padding: clamp(26px, 5vh, 52px) clamp(18px, 4vw, 34px) 28px; }
main[data-screen=home] { width: min(100%, 994px); }
.brand { text-align: center; position: relative; }
h1 { margin: 0; font: 400 clamp(46px, 8.9vw, 78px)/1.03 'ZCOOL KuaiLe', 'PingFang SC', sans-serif; letter-spacing: .035em; color: #795370; }
.underline { width: clamp(91px, 22vw, 178px); height: auto; display: block; margin: 6px auto 0; fill: none; stroke: #dfb9d2; stroke-linecap: round; stroke-width: 4; }
.sound { position: absolute; right: 0; top: 0; display: grid; place-items: center; width: 45px; padding: 0; border-radius: 50%; background: #fffafd; }
.sound svg, .upload-button svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sound[aria-pressed=true] { background: #fffafd; border-color: #f0e3ed; }
.sound[aria-pressed=true] .sound-off, .sound[aria-pressed=false] .sound-on { display: none; }
.intro { margin: clamp(16px, 3vh, 29px) auto clamp(16px, 3vh, 28px); text-align: center; }
.intro h2 { margin: 0; font-weight: 500; font-size: clamp(21px, 3.6vw, 33px); }
.intro p { margin: 6px 0 0; color: var(--muted); font-size: clamp(15px, 2.3vw, 22px); letter-spacing: .035em; }
main:not([data-screen=home]) .intro { display: none; }
main:not([data-screen=home]) { padding-top: 20px; }
main:not([data-screen=home]) h1 { font-size: 37px; }
main:not([data-screen=home]) .underline { width: 90px; }
.steps { display: flex; justify-content: center; gap: 8px; list-style: none; padding: 0; margin: 16px 0; color: var(--muted); font-size: 16px; }
.steps li { padding: 5px 12px; border-radius: 20px; }
.steps [aria-current=step] { background: var(--rose); color: var(--ink); font-weight: 700; }
button, .upload-button {
  min-height: 44px; padding: 0 14px; font: inherit; color: inherit;
  border: 1px solid var(--outline); border-radius: 22px; background: #fffbfd;
  transition: transform 220ms cubic-bezier(.2,.8,.3,1.4), background 150ms;
}
button { cursor: pointer; }
button:focus-visible, .upload-button:focus-within, .stage:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button:enabled:active, .upload-button:active { transform: scale(.97); }
button[aria-pressed=true]:not(.sound) { background: var(--rose); border-color: #dec6d9; }
button:disabled { opacity: .5; cursor: default; }
.secondary { background: transparent; border-color: transparent; }
.primary { background: #f0cdda; color: #633d56; border-color: #e9c4d3; font-weight: 600; }
.actions { text-align: center; margin-top: clamp(15px, 3.5vh, 28px); }
.upload-button { display: inline-flex; justify-content: center; align-items: center; gap: 13px; position: relative; border-radius: 100px; min-height: 56px; width: min(100%, 400px); font-size: clamp(20px, 3.9vw, 30px); }
.upload-button svg { width: 25px; height: 25px; flex: none; }
.upload-button .chevron { width: 19px; height: 19px; }
.upload-button input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
#home-actions { margin-top: 12px; }
#home-actions p { margin: 0; color: var(--muted); font-size: clamp(15px, 2vw, 19px); }
#home-play { font-size: 15px; }
#capture-actions { margin-top: 10px; }
#capture-actions #share { background: #fffafd; border-color: var(--outline); }
#play-actions { margin-top: 5px; }
#play-tools { margin-top: 8px; }
#play-adjust summary { width: fit-content; min-height: 36px; margin: auto; padding: 5px 12px; cursor: pointer; }
#recording-indicator { width: min(100%, 320px); margin: 0 auto 8px; }
.recording-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.recording-dot { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; background: #c0446d; }
#recording-progress { display: block; width: 100%; height: 8px; margin-top: 5px; accent-color: #c0446d; }
main[data-recording=true] :is(#sound, #upload, #home-actions, #play-tools, #play-actions, #share) { display: none; }
#capture-status { margin: 6px 0; color: var(--muted); }
#recording-preview { display: block; width: min(100%, 440px); max-height: 55svh; margin: 10px auto 0; border-radius: 22px; }
.record-save { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 22px; background: var(--rose); color: var(--ink); text-decoration: none; }
.buttons, .step-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; }
.step-actions { margin-top: 14px; }
#play { min-width: 178px; }
.range { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 39px; font-size: 16px; }
.range input { width: clamp(85px, 32vw, 180px); accent-color: var(--accent); }
.range output { min-width: 3em; }
#status { text-align: center; margin: 7px 0 10px; font-size: 16px; }
#status[data-quiet=true] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.stage { display: flex; max-height: 56svh; background: #f5eaf1; overflow: auto; border: 2px solid #fffdfc; border-radius: clamp(24px, 6vw, 48px); }
main[data-screen=home] .stage { width: min(100%, 62svh, 560px); margin-inline: auto; }
.image-view { flex: none; margin: auto; }
canvas { display: block; touch-action: none; user-select: none; -webkit-user-select: none; }
.stage[data-pan=true] canvas { cursor: grab; }
.stage[data-pan=true] canvas:active { cursor: grabbing; }
@media (min-width: 760px) {
  main[data-screen=home] { padding-top: clamp(38px, 5.5vh, 74px); }
  main[data-screen=home] h1 { font-size: clamp(68px, 7.4vw, 88px); }
  main[data-screen=home] .upload-button { min-height: 64px; width: min(100%, 410px); }
  main[data-screen=home] .sound { width: 60px; min-height: 60px; }
}
@media (max-width: 600px) {
  .cloud { top: 13%; right: -14%; opacity: .58; }
  .spark { left: 4%; top: 22%; }
  .flower { right: 11%; bottom: 10%; }
  .paw { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  button, .upload-button { transition: none; }
  button:enabled:active, .upload-button:active { transform: none; }
}
.privacy-link { margin-top: 18px; text-align: center; font-size: 14px; color: var(--muted); }
.privacy-link a { color: inherit; }
