:root {
  color-scheme: dark;
  --night: #160607;
  --lacquer: #250a0c;
  --red: #d52c2c;
  --red-dark: #8e171c;
  --gold: #e6b455;
  --paper: #f2e6cc;
  --paper-2: #e5d3af;
  --ink: #251817;
  --smoke: #b8a49a;
  --rule: #0f0707;
  --hard-shadow: 6px 6px 0 #080303;
  font-family: "Avenir Next", Avenir, "PingFang SC", "Noto Sans CJK SC", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--night); scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  color: #fff5e6;
  background:
    linear-gradient(rgba(230,180,85,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(230,180,85,.035) 1px, transparent 1px),
    radial-gradient(circle at 78% -5%, rgba(213,44,44,.24), transparent 34%),
    var(--night);
  background-size: 24px 24px, 24px 24px, auto, auto;
}
button, input { font: inherit; }
button { touch-action: manipulation; }
a { color: inherit; }
.playground-chrome { position: sticky; top: 0; z-index: 50; }
.chrome-mark { margin-left: auto; color: #7c271f; font-weight: 900; letter-spacing: .12em; }
.app-shell { width: min(1240px, calc(100% - 20px)); margin: 0 auto; padding: 14px 0 64px; }
.library, .song-stage { border: 2px solid var(--rule); box-shadow: var(--hard-shadow); }
.library { overflow: hidden; background: var(--lacquer); }
.library-bar, .utility-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 34px; padding: 7px 10px; border-bottom: 2px solid var(--rule);
  background: var(--red); color: #fff8e8;
  font: 900 .7rem/1 var(--pg-font-mono, ui-monospace, monospace); letter-spacing: .1em;
}
.library-head { position: relative; overflow: hidden; padding: 24px 18px 20px; border-bottom: 1px solid rgba(230,180,85,.3); }
.library-head::after { content: "歌"; position: absolute; right: -13px; bottom: -38px; color: rgba(230,180,85,.08); font: 900 10rem/1 "Songti SC", STSong, serif; }
.stamp { margin: 0 0 12px; color: var(--gold); font: 850 .67rem/1.2 var(--pg-font-mono, ui-monospace, monospace); letter-spacing: .1em; }
.library h1 { position: relative; z-index: 1; margin: 0; color: #fff0d5; font: 900 clamp(3rem, 15vw, 5.5rem)/.85 "Songti SC", STSong, serif; letter-spacing: -.07em; }
.library-head > p:last-child { position: relative; z-index: 1; max-width: 28rem; margin: 14px 0 0; color: var(--smoke); font-size: .88rem; line-height: 1.45; }
.search-label { display: grid; gap: 7px; padding: 14px 14px 10px; color: var(--gold); font: 800 .66rem/1 var(--pg-font-mono, ui-monospace, monospace); letter-spacing: .08em; }
.search-label input { width: 100%; min-height: 43px; border: 1px solid #6e3431; border-radius: 0; padding: 9px 11px; outline: 0; color: #fff5e6; background: #110606; }
.search-label input:focus { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.song-list { padding: 4px 12px 12px; }
.song-choice { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; width: 100%; border: 1px solid transparent; border-radius: 0; padding: 12px 8px; color: #f5e7d3; background: transparent; text-align: left; cursor: pointer; }
.song-choice:hover, .song-choice:focus-visible { border-color: #74403b; background: rgba(255,255,255,.035); }
.song-choice.is-active { border-color: var(--gold); background: #381013; }
.song-choice .track { color: var(--gold); font: 800 .68rem/1 var(--pg-font-mono, ui-monospace, monospace); }
.song-choice strong { display: block; font: 800 1rem/1.2 "PingFang SC", sans-serif; }
.song-choice small { display: block; margin-top: 5px; color: var(--smoke); font-size: .72rem; }
.song-choice .arrow { color: var(--gold); }
.empty { margin: 10px; color: var(--smoke); font-size: .85rem; }
.library-foot { margin: 0; padding: 12px 14px 16px; border-top: 1px solid rgba(230,180,85,.2); color: #8f7c75; font-size: .72rem; }
.library-foot code { color: var(--gold); }
.song-stage { margin-top: 14px; overflow: hidden; color: var(--ink); background: var(--paper); }
.song-header { position: relative; min-height: 320px; overflow: hidden; padding: 24px 20px 28px; color: #fff4df; background: radial-gradient(circle at 72% 30%, #7e1d24 0, #420d12 34%, #190708 72%); }
.song-header::before { content: ""; position: absolute; inset: 12px; border: 1px solid rgba(230,180,85,.34); pointer-events: none; }
.song-header::after { content: attr(data-watermark); position: absolute; right: -2vw; bottom: -8vw; color: rgba(230,180,85,.09); font: 900 clamp(11rem, 40vw, 25rem)/.7 "Songti SC", STSong, serif; pointer-events: none; }
.song-index { position: relative; z-index: 1; margin: 0 0 38px; color: var(--gold); font: 900 .72rem/1 var(--pg-font-mono, ui-monospace, monospace); letter-spacing: .16em; }
.song-title { position: relative; z-index: 1; max-width: 9ch; margin: 0; font: 900 clamp(2.9rem, 14vw, 7.2rem)/.9 "Songti SC", STSong, serif; letter-spacing: -.06em; text-wrap: balance; }
.song-romanization { position: relative; z-index: 1; max-width: 38rem; margin: 15px 0 0; color: #dfbf8a; font: italic 600 clamp(.88rem, 3vw, 1.08rem)/1.4 Georgia, serif; }
.song-meta { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 26px 0 0; color: #cbb5a4; font-size: .78rem; }
.song-meta strong { color: #fff0d5; }
.source-link { border-bottom: 1px solid var(--gold); color: var(--gold); text-decoration: none; }
.source-link:hover { color: #fff; }
.utility-bar { position: sticky; top: 29px; z-index: 20; color: #fff; background: #110606; }
.now-label { display: inline-flex; align-items: center; gap: 7px; }
.now-label i { width: 7px; height: 7px; border: 1px solid #fff; border-radius: 50%; background: var(--red); animation: pulse 1.2s ease-in-out infinite alternate; }
.display-controls { display: flex; gap: 4px; }
.display-toggle { min-height: 26px; border: 1px solid #765651; border-radius: 0; padding: 4px 8px; color: #a9978e; background: transparent; cursor: pointer; font: 800 .65rem/1 var(--pg-font-mono, ui-monospace, monospace); }
.display-toggle.is-on { border-color: var(--gold); color: #180809; background: var(--gold); }
.display-toggle:focus-visible, .song-choice:focus-visible, .lyric-line:focus-visible, a:focus-visible { outline: 3px solid #f0c66d; outline-offset: 2px; }
.lyrics { margin: 0; padding: 8px 0 20px; list-style: none; counter-reset: line; }
.lyric-line { counter-increment: line; position: relative; display: grid; gap: 6px; width: 100%; border: 0; border-bottom: 1px solid #cbb891; border-radius: 0; padding: 18px 18px 18px 49px; color: var(--ink); background: transparent; text-align: left; cursor: pointer; transition: color .18s ease, background .18s ease, padding .18s ease; }
.lyric-line::before { content: counter(line, decimal-leading-zero); position: absolute; left: 14px; top: 22px; color: #8a755a; font: 750 .64rem/1 var(--pg-font-mono, ui-monospace, monospace); }
.lyric-line::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 0; background: var(--red); transition: width .18s ease; }
.lyric-line:hover { background: rgba(255,255,255,.34); }
.lyric-line.is-active { padding-left: 55px; color: #fff6e2; background: var(--red-dark); }
.lyric-line.is-active::before { color: var(--gold); }
.lyric-line.is-active::after { width: 7px; }
.hanzi { font: 850 clamp(1.28rem, 5.3vw, 1.75rem)/1.25 "PingFang SC", "Noto Sans CJK SC", sans-serif; letter-spacing: .01em; }
.pinyin { color: #806c52; font: italic 600 .85rem/1.4 Georgia, serif; }
.english { color: #675851; font-size: .9rem; line-height: 1.4; }
.is-active .pinyin { color: #f0c97b; }
.is-active .english { color: #f0deda; }
body.hide-pinyin .pinyin, body.hide-english .english { display: none; }
.song-note { margin: 0; padding: 18px 20px 22px; border-top: 2px solid var(--rule); color: #675851; background: var(--paper-2); font-size: .78rem; line-height: 1.5; }
.song-note:empty { display: none; }
@keyframes pulse { to { opacity: .35; } }
@media (min-width: 820px) {
  .app-shell { display: grid; grid-template-columns: minmax(250px, 330px) minmax(0, 1fr); align-items: start; gap: 18px; padding-top: 24px; }
  .library { position: sticky; top: 52px; }
  .song-stage { margin-top: 0; }
  .song-header { min-height: 430px; padding: 38px 42px 44px; }
  .song-index { margin-bottom: 62px; }
  .lyric-line { grid-template-columns: minmax(220px, .95fr) minmax(160px, .8fr) minmax(240px, 1.2fr); align-items: baseline; gap: 22px; padding: 20px 24px 20px 58px; }
  .lyric-line::before { left: 18px; top: 26px; }
  .lyric-line.is-active { padding-left: 65px; }
  .hanzi { font-size: clamp(1.15rem, 2vw, 1.55rem); }
  .pinyin, .english { font-size: .84rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
