:root {
  color-scheme: light;
  font-family: system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #281b3a;
  --muted: #685875;
  --accent: #6b39ac;
  --accent-deep: #512687;
  --line: #ece4f2;
  --surface: rgba(255, 253, 255, .88);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-width: 280px;
  min-height: 100vh;
  background: #eee0f2;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, #f9e8f2bb, #fcf4eac7 56%, #e5def69e),
    url("../img/background.jpg") center / cover;
}
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { opacity: .42; cursor: default; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, p { margin: 0; }
svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.solid { fill: currentColor; stroke: none; }
.symbols { position: absolute; width: 0; height: 0; }

.site-header, .site-verse, .layout {
  width: min(1180px, calc(100% - 64px));
  margin-inline: auto;
}
.site-header {
  min-height: 94px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 1.15rem; font-weight: 750; white-space: nowrap; }
.brand small { margin-left: 6px; font-size: .875rem; font-weight: 650; color: var(--accent-deep); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 41px;
  height: 41px;
  color: white;
  background: linear-gradient(145deg, #8350bf, #593293);
  border-radius: 13px;
  box-shadow: 0 5px 13px #663a9933;
}
.site-header nav { display: flex; flex-wrap: wrap; gap: 4px; }
.site-header nav a { padding: 8px 11px; font-size: .9rem; color: var(--muted); border-radius: 9px; }
.site-header nav a:hover,
.site-header .nav-current,
.site-header nav [aria-current="page"] { color: var(--accent-deep); background: #fff9; }

.site-verse {
  margin-bottom: 16px;
  padding: 9px 14px;
  border-radius: 12px;
  background: #fff8;
  color: var(--accent-deep);
  text-align: center;
  line-height: 1.65;
}
.site-verse span { display: inline-block; color: var(--muted); font-size: .875rem; }

.layout {
  display: grid;
  grid-template-columns: minmax(240px, 310px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding-bottom: 36px;
}
.workspace { grid-area: 1 / 2; display: grid; gap: 18px; min-width: 0; }
.mobile-back { display: none; }
.player { scroll-margin-top: 12px; }
.panel {
  background: var(--surface);
  border: 1px solid #fff;
  border-radius: 24px;
  box-shadow: 0 12px 32px #49305e10;
}
.info-page {
  width: min(48rem, calc(100% - 24px));
  margin-inline: auto;
  padding-bottom: 36px;
}
.info-card { padding: clamp(20px, 4vw, 40px); line-height: 1.8; }
.info-card h1 { margin-bottom: 16px; font-size: clamp(1.5rem, 3.1vw, 2.4rem); line-height: 1.22; }
.info-card p + p { margin-top: 8px; }
.info-card a { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.info-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.info-section h2 { font-size: 1.25rem; }
.info-section ul { margin: 10px 0 0; padding-inline-start: 1.35em; }
.info-section li + li { margin-top: 8px; }
.info-section li::marker { color: var(--accent); }
.scripture { margin: 0; padding: 15px 18px; border-inline-start: 3px solid var(--accent); background: #f8f3fb; border-radius: 0 11px 11px 0; }
.scripture blockquote { margin: 0; font-size: 1.125rem; }
.scripture figcaption { margin-top: 8px; color: var(--muted); font-size: .875rem; }
.library { grid-area: 1 / 1; display: flex; flex-direction: column; height: calc(100dvh - 183px); min-height: 420px; }
.library-header { padding: 24px 20px 14px; }
.library-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 16px; }
.library h2 { font-size: 1.25rem; }
#song-count { font-size: .875rem; color: var(--muted); }
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #faf6fc;
  color: var(--muted);
}
.search:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.search svg { width: 17px; height: 17px; flex: none; }
.search input { width: 100%; min-height: 42px; padding: 0; border: 0; background: transparent; color: #281b3a; outline: none; }
.search input::placeholder { color: var(--muted); }
.song-list { overflow: auto; list-style: none; margin: 0 9px 12px; padding: 0 4px 4px; scrollbar-width: thin; scrollbar-color: #d0bddf transparent; }
.song-list a {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 9px;
  padding: 10px 10px;
  min-height: 51px;
  border-radius: 11px;
  font-size: .94rem;
}
.song-list a:hover { background: #f4edf8; }
.song-list a[aria-current="true"] { color: var(--accent-deep); background: #eee3f8; font-weight: 700; }
.song-number { color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; text-align: center; }
.song-list svg { opacity: 0; }
.song-list a:is(:hover, :focus-visible, [aria-current]) svg { opacity: 1; }
.empty { padding: 24px; color: var(--muted); text-align: center; }

.player {
  padding: clamp(19px, 3vw, 32px);
  display: grid;
  grid-template-columns: minmax(110px, 34%) minmax(0, 1fr);
  gap: clamp(17px, 3vw, 30px);
  align-items: center;
}
.album-art {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  position: relative;
  border-radius: 19px;
  color: #fff9fc;
  background:
    radial-gradient(ellipse at 12% 7%, #ffbbad 0, transparent 46%),
    radial-gradient(ellipse at 90% 90%, #b884e5 0, transparent 56%),
    linear-gradient(139deg, #ad75be 0%, #7447aa 54%, #4e3b86 100%);
  box-shadow: inset 0 0 0 1px #ffffff59, 0 9px 20px #5d37882e;
}
.album-art::before, .album-art::after { content: ""; position: absolute; border-radius: 50%; }
.album-art::before {
  width: 78%;
  aspect-ratio: 1;
  background: repeating-radial-gradient(circle, #fff0 0 9px, #fff4 10px 11px);
  border: 1px solid #fff8;
}
.album-art::after { width: 33%; aspect-ratio: 1; border: 1px solid #fff9; background: #8056ac; }
.album-art svg { z-index: 1; width: 16%; height: auto; stroke-width: 1.45; }
.player-label { color: var(--accent-deep); font-size: .875rem; font-weight: 650; }
.player h1 { margin: 5px 0 15px; font-size: clamp(1.5rem, 3.1vw, 2.4rem); line-height: 1.22; overflow-wrap: anywhere; }
.variants { display: flex; flex-wrap: wrap; gap: 8px; }
.segment { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #f8f3fb; }
.segment button { border: 0; background: transparent; border-radius: 6px; min-height: 29px; padding: 3px 10px; font-size: .875rem; }
.segment button[aria-pressed="true"] { color: var(--accent-deep); background: white; font-weight: 700; box-shadow: 0 1px 4px #48256818; opacity: 1; }
.segment button:not(:disabled):hover { color: var(--accent-deep); }
.timeline { margin-top: 14px; }
input[type="range"] { display: block; width: 100%; margin: 0; height: 22px; accent-color: var(--accent); cursor: pointer; }
.time { display: flex; justify-content: space-between; font-size: .8125rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.transport { display: flex; align-items: center; gap: clamp(3px, .9vw, 11px); margin-top: 8px; }
.icon-button {
  display: inline-grid;
  place-items: center;
  flex: none;
  position: relative;
  width: 39px;
  height: 39px;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: transparent;
}
.icon-button:hover:enabled, .icon-button[aria-pressed="true"], .icon-button[data-active="true"] { background: #f0e5f8; color: var(--accent-deep); }
.play, .play:hover:enabled { width: 53px; height: 53px; border-radius: 50%; color: white; background: var(--accent); }
.play:hover:enabled { background: var(--accent-deep); }
.play svg { width: 25px; height: 25px; }
#repeat-one { position: absolute; top: 0; right: 1px; background: var(--accent-deep); color: white; font-size: .6875rem; border-radius: 20px; padding: 0 4px; }
.volume { display: flex; align-items: center; gap: 6px; min-width: 40px; width: 95px; margin-left: auto; color: var(--muted); }
.volume svg { flex: 0 0 17px; width: 17px; height: 17px; }
.volume input { min-width: 0; }
.playback-message { margin-top: 10px; font-size: .875rem; color: #8c2855; }

.reading { min-height: 315px; overflow: hidden; }
.reading-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
}
.tabs { display: flex; gap: 13px; }
.tabs button {
  display: flex;
  gap: 7px;
  align-items: center;
  min-height: 58px;
  padding: 0 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
}
.tabs svg { width: 18px; height: 18px; }
.tabs button[aria-selected="true"] { border-color: var(--accent); color: var(--accent-deep); font-weight: 700; }
#score-original { font-size: .875rem; color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; }
.lyrics, .scores {
  overflow: auto;
  max-height: clamp(230px, 44dvh, 620px);
  padding: 21px 23px 27px;
  scrollbar-width: thin;
  scrollbar-color: #d0bddf transparent;
}
.lyrics {
  text-align: center;
  white-space: pre-wrap;
  line-height: 2.1;
  font-size: 1.07rem;
  letter-spacing: .035em;
  font-family: "Songti SC", "Noto Serif CJK SC", "SimSun", serif;
}
.scores a { display: block; max-width: 650px; margin: 0 auto 12px; text-align: center; color: var(--accent-deep); }
.scores img { display: block; width: 100%; height: auto; border-radius: 8px; background: white; }
.score-fallback { display: block; padding: 18px; text-decoration: underline; }

@media (max-width: 900px) {
  .site-header, .site-verse, .layout { width: calc(100% - 36px); }
  .layout { grid-template-columns: minmax(205px, 29%) minmax(0, 1fr); gap: 14px; }
  .player { grid-template-columns: 103px minmax(0, 1fr); }
  .volume { display: none; }
}

@media (max-width: 660px) {
  .site-header, .site-verse, .layout { width: calc(100% - 24px); }
  .site-header { min-height: 73px; gap: 6px; }
  .brand { gap: 7px; font-size: 1rem; }
  .brand-text { line-height: 1.2; }
  .brand small { display: block; margin: 3px 0 0; font-size: .8125rem; }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .site-header nav a { padding: 7px 5px; font-size: .8125rem; }
  .site-verse { margin-bottom: 12px; font-size: .875rem; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .workspace { grid-area: auto; gap: 12px; }
  .panel { border-radius: 19px; }
  .library { grid-area: auto; height: min(65dvh, 480px); min-height: 280px; }
  .player { padding: 16px; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .mobile-back {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    min-height: 44px;
    padding-inline: 12px;
    border-radius: 9px;
    background: #f3e9f8;
    color: var(--accent-deep);
    font-size: .875rem;
    font-weight: 650;
  }
  .mobile-back:hover { background: #eee3f8; }
  .album-art { display: none; }
  .transport { gap: 10px; }
  .reading { min-height: 251px; }
  .lyrics, .scores { max-height: 40dvh; padding: 14px 13px 19px; }
}
