:root {
  color-scheme: light;
  --ink: #173d3a;
  --muted: #6c817d;
  --line: #d8e4df;
  --surface: #fffdf8;
  --surface-soft: #f1f8f4;
  --green: #145c52;
  --green-dark: #0d463f;
  --gold: #f2b34b;
  --coral: #ef8166;
  --shadow: 0 18px 48px rgba(19, 72, 61, 0.09);
  font-family: "Avenir Next", "Noto Sans TC", "PingFang TC", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: radial-gradient(circle at 80% -10%, #d9f0e7 0, transparent 38%), #f7fbf8;
}
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 36px 0 26px; }
.hero { display: flex; justify-content: space-between; gap: 24px; align-items: end; padding: 18px 14px 34px; }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: 0.74rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 750; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 650px; margin-bottom: 10px; font-size: clamp(2rem, 5vw, 4.4rem); line-height: .98; letter-spacing: -.055em; }
h2 { margin-bottom: 0; font-size: 1.3rem; letter-spacing: -.025em; }
.hero-copy { margin: 0; color: var(--muted); font-size: 1rem; }
.hero-mark { display: grid; place-items: center; width: 74px; height: 74px; border-radius: 24px; background: var(--gold); color: #fff; font-size: 2.3rem; transform: rotate(8deg); box-shadow: 0 10px 24px rgba(242, 179, 75, .25); }
.workspace { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(250px, .78fr); gap: 18px; margin-top: 18px; }
.panel { background: rgba(255, 253, 248, .92); border: 1px solid rgba(216, 228, 223, .9); border-radius: 26px; box-shadow: var(--shadow); }
.playlist-panel, .player-panel, .lyrics-panel { padding: 24px; }
.section-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.count-badge, .status-chip { padding: 7px 10px; border-radius: 999px; background: var(--surface-soft); color: var(--green); white-space: nowrap; font-size: .75rem; font-weight: 750; }
.status-chip.pending { background: #fff2d9; color: #8d6218; }
.song-list { display: grid; gap: 10px; }
.song-item { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 14px 12px; border: 1px solid transparent; border-radius: 17px; background: #f6faf7; color: var(--ink); text-align: left; transition: .2s ease; }
.song-item:hover { border-color: #b5d9cd; transform: translateY(-1px); }
.song-item.is-active { background: var(--green); color: #fff; box-shadow: 0 10px 20px rgba(20, 92, 82, .18); }
.song-number { color: var(--coral); font-size: .78rem; font-weight: 800; }
.is-active .song-number { color: #ffd47e; }
.song-copy { display: grid; gap: 3px; min-width: 0; }
.song-copy strong { font-size: .98rem; }
.song-copy small, .song-duration, .source-note, .setting-help { color: var(--muted); font-size: .76rem; }
.song-copy em { width: fit-content; padding: 2px 7px; border-radius: 999px; background: #e7f4ee; color: var(--green); font-size: .66rem; font-style: normal; font-weight: 800; }
.is-active .song-copy small, .is-active .song-duration { color: #cce9df; }
.is-active .song-copy em { background: rgba(255, 255, 255, .16); color: #fff3c8; }
.source-note { margin: 22px 2px 0; line-height: 1.55; }
.now-playing { display: flex; align-items: center; gap: 16px; }
.album-art { display: grid; place-items: center; flex: 0 0 76px; height: 76px; border-radius: 23px; background: linear-gradient(140deg, var(--coral), #f5c25e); color: #fff; font-size: 2rem; box-shadow: 0 10px 22px rgba(239, 129, 102, .2); }
#track-subtitle { margin: 8px 0 0; color: var(--muted); font-size: .86rem; }
.progress-area { margin: 30px 0 12px; }
input[type="range"] { width: 100%; accent-color: var(--green); }
.time-row, .range-hint { display: flex; justify-content: space-between; color: var(--muted); font-size: .74rem; }
.transport-controls { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 3vw, 24px); margin: 12px 0 26px; }
.icon-button   { position: relative; }
.seek-button small { position: absolute; right: -3px; bottom: 0; font-size: .52rem; font-weight: 800; }
.play-button   { display: grid; place-items: center; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.setting-card { display: grid; gap: 8px; padding: 14px; border-radius: 18px; background: #f5faf7; }
.setting-label { font-size: .76rem; color: var(--muted); font-weight: 700; }
.setting-card output { font-size: 1.35rem; font-weight: 800; }
.range-hint { margin-top: -2px; }
.loop-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.loop-option   { line-height: 1.2; }
.audio-status { min-height: 1.2em; margin: 17px 0 0; color: var(--muted); font-size: .78rem; text-align: center; }
.lyrics-panel { margin-top: 18px; }
.lyrics-heading { align-items: center; }
.lyrics-status-group { display: grid; justify-items: end; gap: 6px; }
.lyric-live-status { color: var(--green); font-size: .72rem; font-weight: 700; }
.lyrics-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.lyrics-size-options { display: flex; gap: 6px; }
.lyrics-preview { --lyric-font-size: 1.28rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-height: min(70vh, 720px); overflow-y: auto; overscroll-behavior: contain; padding: 2px 6px 2px 2px; scroll-behavior: smooth; scrollbar-gutter: stable; }
.lyrics-preview[data-text-size="small"] { --lyric-font-size: 1.05rem; }
.lyrics-preview[data-text-size="large"] { --lyric-font-size: 1.8rem; }
.lyric-line { display: flex; gap: 12px; align-items: start; padding: 18px; border: 1px solid var(--line); border-radius: 19px; background: #fff; }
.lyric-line.is-active { border-color: #72b9a6; background: #f4fbf7; box-shadow: 0 8px 20px rgba(20, 92, 82, .1); transform: translateY(-1px); }
.lyric-line.is-active .line-label { color: var(--green); }
.line-label { flex: 0 0 58px; color: var(--coral); font-size: .69rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.lyric-words { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .2em; min-width: 0; font-size: var(--lyric-font-size); }
.lyric-word { display: inline-flex; min-width: 1.3em; max-width: 100%; min-height: 2.2em; justify-content: center; align-items: center; gap: .15em; }
.lyric-word .zhuyin { order: 1; flex-shrink: 0; color: var(--coral); font-size: .51em; line-height: 1; white-space: nowrap; writing-mode: vertical-rl; text-orientation: upright; }
.lyric-word .zhuyin:empty { display: none; }
.lyric-word .hanzi { min-width: 0; overflow-wrap: anywhere; padding: .15em .1em; border-radius: 7px; font-size: 1em; line-height: 1.2; transition: color .12s ease, background-color .12s ease, box-shadow .12s ease; }
.lyric-word.is-word-active .hanzi { background: var(--coral); color: #fff; box-shadow: 0 4px 10px rgba(239, 129, 102, .24); }
.lyric-word.is-word-active .zhuyin { color: var(--green); font-weight: 800; }
@font-face {
  font-family: 'ltes Bpmf';
  src: url('./fonts/bpmf/BpmfGenSenRounded-R.ttf') format('truetype');
  font-weight: 400;
  font-display: block;
}
.has-bpmf-font .hanzi { font-family:'ltes Bpmf', sans-serif; font-weight:400; font-synthesis:none; }
.has-bpmf-font .zhuyin { display:none; }
.lyrics-preview[data-motion="line"] .is-active .hanzi { background:var(--coral); color:#fff; border-radius:7px; }
.lyrics-preview[data-motion="line"] .is-active .zhuyin { color:var(--green); }
.lyrics-panel > .lyrics-size-options { flex-wrap:wrap; margin-bottom:10px; }
.lyrics-notice { display: flex; gap: 10px; align-items: center; margin-top: 15px; padding: 13px 15px; border-radius: 14px; background: #fff8e9; color: #76572a; }
.lyrics-notice span { font-size: 1.1rem; }
.lyrics-notice p { flex: 1; margin: 0; font-size: .77rem; line-height: 1.6; }
.timing-review-link { flex: 0 0 auto; padding: 8px 11px; border-radius: 10px; background: #fff; color: var(--green); font-size: .74rem; font-weight: 800; text-decoration: none; box-shadow: inset 0 0 0 1px #d7c79e; }
.timing-review-link:hover { background: #fffdf8; box-shadow: inset 0 0 0 2px var(--green); }
.app-footer { display: flex; justify-content: space-between; gap: 16px; padding: 18px 10px 0; color: var(--muted); font-size: .74rem; }
@media (max-width: 780px) {
  .app-shell { width: min(100% - 22px, 640px); padding-top: 20px; }
  .hero { padding: 12px 5px 24px; }
  .hero-mark { width: 58px; height: 58px; border-radius: 19px; font-size: 1.8rem; }
  .workspace, .lyrics-preview { grid-template-columns: 1fr; }
  .playlist-panel { order: 2; }
  .player-panel { order: 1; }
  .lyrics-panel { order: 3; }
  .app-footer { flex-direction: column; gap: 5px; }
}
@media (max-width: 430px) {
  .panel { border-radius: 21px; }
  .playlist-panel, .player-panel, .lyrics-panel { padding: 18px; }
  .settings-grid { grid-template-columns: 1fr; }
  .loop-options { grid-template-columns: 1fr; }
  .lyric-line { padding: 14px 11px; gap: 7px; }
  .line-label { flex-basis: 47px; }
  .lyrics-heading { flex-direction: column; align-items: start; }
  .lyrics-status-group { justify-items: start; }
  .lyrics-notice { align-items: stretch; flex-wrap: wrap; }
  .timing-review-link { margin-left: 1.7rem; text-align: center; }
}
