:root {
  color-scheme: light;
  font-family: Roboto, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #514841;
  background: #e9e5e0;
  --paper: #fffaf4;
  --ink: #514841;
  --primary: #a6412b;
  --accent: #b86642;
  --container: #f0e8dc;
  --controls-height: calc(86px + env(safe-area-inset-bottom, 0px));
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body { overscroll-behavior: none; }
button, input { font: inherit; }
button { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; cursor: pointer; }
button { color: inherit; border: 0; }
button:disabled { cursor: default; opacity: .45; }
button:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
button:active:not(:disabled) { filter: brightness(.94); }
button img { pointer-events: none; }
[hidden] { display: none !important; }
#app { position: relative; max-width: 600px; width: 100%; height: 100%; height: 100dvh; margin: auto; background: var(--paper); overflow: hidden; isolation: isolate; }
.view { position: absolute; inset: 0; background: var(--paper); }
#page-stage { position: absolute; inset: 0; overflow: hidden; }
.lyric-scroll { position: absolute; inset: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: none; touch-action: pan-y; padding: calc(20px + env(safe-area-inset-top, 0px)) 16px max(55dvh, 260px); }
.lyric-scroll::-webkit-scrollbar { display: none; }
.song-title { color: #402c22; font-size: 1.5rem; line-height: 1.5; font-weight: 700; margin: 0 12px 18px; min-height: 48px; display: flex; align-items: center; }
.lyric-row { display: block; width: 100%; padding: 11px 12px; margin: 0 0 8px; min-height: 48px; border-radius: 12px; background: transparent; font-size: 1.375rem; font-weight: 500; line-height: 1.8; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; transform-origin: left center; transition: transform 320ms ease, background-color 250ms ease; }
.lyric-row.active { transform: scale(1.035); background: #f4ede3; }
.syllable { background: linear-gradient(to right, var(--accent) var(--sung, 0%), var(--ink) var(--sung, 0%)); background-clip: text; -webkit-background-clip: text; color: transparent; }
.player { position: absolute; z-index: 1; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: calc(100% - 24px); max-width: 360px; padding: 0 8px; border-radius: 24px; background: rgba(219, 198, 177, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 0; box-shadow: 0 6px 24px rgba(81,72,65,.16); }
.playback-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; height: 72px; }
.transport-controls { display: flex; align-items: center; gap: 4px; }
.track-button { display: grid; place-items: center; flex: none; padding: 0; width: 52px; height: 48px; border: 1px solid #bca99a; border-radius: 14px; background: #fffaf4; color: #663d2c; font-size: .875rem; font-weight: 600; white-space: nowrap; box-shadow: 0 1px 2px #51484114; transition: transform 150ms ease, background-color 150ms ease; }
.track-button:active:not(:disabled) { transform: scale(.95); background: #e9d8c8; }
.track-button:disabled { opacity: 1; color: #968c83; border-color: #d8cec3; background: #eee8e0; box-shadow: none; }
.track-button:disabled img { opacity: .4; }
.side-control { display: flex; align-items: center; justify-content: flex-start; }
.side-control.right { justify-content: flex-end; }
.play-button, .icon-button { display: grid; place-items: center; padding: 0; border-radius: 50%; transition: transform 150ms ease, box-shadow 150ms ease; }
.play-button { width: 56px; height: 56px; justify-self: center; background: var(--primary); box-shadow: 0 2px 4px #6d2b1c1a; }
.play-button:active, .icon-button:active { transform: scale(.94); }
.icon-button { width: 48px; height: 48px; background: var(--container); }
.player .icon-button { background: var(--paper); color: #663d2c; box-shadow: 0 1px 3px #51484124; }
.entry-label { font-size: .875rem; font-weight: 600; line-height: 1; white-space: nowrap; pointer-events: none; }
.version-button, .text-button { background: var(--container); min-height: 48px; padding: 0 20px; border-radius: 24px; font-size: 1rem; font-weight: 500; }
.version-button { font-size: .875rem; padding: 0 4px; max-width: 100%; }
.version-button.floating-version { position: absolute; z-index: 2; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; min-width: 72px; padding: 0 12px; box-shadow: 0 4px 16px #5148411a; }
.has-versions .song-title { padding-right: 72px; }
.score-view { display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); padding-bottom: var(--controls-height); }
.has-versions .score-view { padding-top: calc(72px + env(safe-area-inset-top, 0px)); }
.score-area { flex: 1; min-height: 0; position: relative; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: none; touch-action: pan-y; }
.score-area::-webkit-scrollbar { display: none; }
#score-canvas { width: 100%; height: 100%; display: block; touch-action: pan-y; }
.list-view { padding-top: env(safe-area-inset-top, 0px); }
.song-list { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 8px 16px calc(20px + env(safe-area-inset-bottom, 0px)); touch-action: pan-y; }
.song-item { position: relative; min-height: 64px; margin-bottom: 4px; border-radius: 12px; }
.song-item > button { display: block; width: 100%; min-height: 64px; padding: 16px 12px; border-radius: 12px; font-size: 1.25rem; text-align: left; background: transparent; line-height: 1.6; }
.song-item.current { background: var(--container); }
.song-item.dragging { opacity: .28; }
.drag-ghost { position: absolute; z-index: 10; left: 16px; right: 16px; padding: 16px 12px; border-radius: 12px; background: #f0e8dc; box-shadow: 0 6px 24px #5148412b; font-size: 1.25rem; pointer-events: none; line-height: 1.6; }
.loading, .fatal { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; background: var(--paper); text-align: center; padding: 24px; }
.loading img { border-radius: 18px; }
.loading p, .fatal p { font-weight: 600; font-size: 1.5rem; margin: 8px 0; }
.loading span, .fatal span { font-size: 1rem; color: #796e65; }
.fatal button { margin-top: 12px; }
.toast { position: absolute; left: 24px; right: 24px; bottom: calc(var(--controls-height) + 16px); z-index: 30; width: fit-content; max-width: calc(100% - 48px); margin: auto; padding: 14px 20px; color: #fffaf4; background: #453b34; border-radius: 14px; font-size: .9375rem; line-height: 1.5; box-shadow: 0 4px 16px #0002; pointer-events: none; }
.ripple { position: relative; overflow: hidden; }
.ripple-ink { position: absolute; border-radius: 50%; background: currentColor; opacity: .12; pointer-events: none; transform: scale(0); animation: ripple 480ms ease-out forwards; }
@keyframes ripple { to { transform: scale(2); opacity: 0; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.sr-focusable:focus { z-index: 50; clip-path: none; width: auto; height: 48px; margin: 0; padding: 12px; top: 8px; left: 8px; background: var(--container); border-radius: 16px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (max-height: 500px) {
  .lyric-scroll { padding-top: 12px; }
  .song-title { margin-bottom: 8px; }
  .lyric-row { padding-block: 8px; }
}
