:root {
  color-scheme: dark;
  --bg: #080b16;
  --panel: rgba(18, 24, 43, 0.86);
  --panel-strong: #12182b;
  --line: rgba(178, 192, 231, 0.14);
  --muted: #8f9ab8;
  --text: #f1f4ff;
  --accent: #a895ff;
  --accent-strong: #7364f4;
  --danger: #ff8b9e;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(112, 92, 255, 0.24), transparent 34rem),
    radial-gradient(circle at 88% 20%, rgba(41, 180, 190, 0.13), transparent 30rem),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang TC", "Noto Sans CJK TC", sans-serif;
}

button, input { font: inherit; }

.shell {
  width: min(960px, calc(100% - 36px));
  margin: 0 auto;
  padding: 52px 0 28px;
}

.masthead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
}

.masthead-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(32px, 5vw, 52px); line-height: 1.05; letter-spacing: -.04em; }
h2 { margin-bottom: 8px; font-size: 20px; letter-spacing: -.02em; }

.privacy-pill, .source-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .045);
}

.privacy-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  color: #c9d1e9;
  font-size: 12px;
  white-space: nowrap;
}

.privacy-pill span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5de3b2;
  box-shadow: 0 0 14px #5de3b2;
}

.drop-zone {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 180px;
  padding: 32px;
  border: 1px dashed rgba(168, 149, 255, .55);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(35, 30, 77, .7), rgba(17, 31, 54, .68));
  cursor: pointer;
  transition: border-color .2s, transform .2s, background .2s;
}

.drop-zone:hover, .drop-zone:focus-visible, .drop-zone.dragging {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(50, 42, 112, .8), rgba(19, 49, 68, .75));
  outline: none;
  transform: translateY(-2px);
}

.drop-icon {
  display: grid;
  flex: 0 0 64px;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-strong), #2dbbc6);
  font-size: 31px;
  box-shadow: 0 14px 34px rgba(91, 72, 235, .35);
}

.drop-zone p { margin-bottom: 0; color: var(--muted); font-size: 14px; }
.drop-zone .button { margin-left: auto; }

.button {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  transition: filter .2s, transform .2s;
}
.button:hover { filter: brightness(1.13); transform: translateY(-1px); }
.button.primary { background: linear-gradient(135deg, #8877ff, #4cbed0); }
.button.secondary { background: rgba(255,255,255,.09); border: 1px solid var(--line); }

.player-card {
  margin-top: 24px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .25);
  backdrop-filter: blur(20px);
}

.track-head { display: flex; align-items: center; gap: 16px; }
.cover {
  display: grid;
  flex: 0 0 70px;
  place-items: center;
  width: 70px;
  height: 70px;
  overflow: hidden;
  border-radius: 17px;
  color: #fff;
  background: linear-gradient(140deg, #30246e, #1ca6ad);
  font-size: 30px;
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.track-meta { min-width: 0; flex: 1; }
.source-badge { display: inline-block; margin-bottom: 8px; padding: 4px 8px; color: #b8ffe6; border-color: rgba(93,227,178,.28); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.track-meta h2 { overflow: hidden; margin-bottom: 5px; text-overflow: ellipsis; white-space: nowrap; }
.track-info, .status { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.icon-button { border: 0; color: var(--muted); background: transparent; font-size: 30px; line-height: 1; cursor: pointer; }
.icon-button:hover { color: var(--text); }

audio { width: 100%; margin: 25px 0 22px; }

.lyrics-toolbar { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.lyrics { display: flex; flex-direction: column; gap: 2px; max-height: 520px; overflow-y: auto; padding: 26px 6px 38px; scroll-behavior: smooth; }
.lyrics::-webkit-scrollbar { width: 7px; }
.lyrics::-webkit-scrollbar-thumb { border-radius: 99px; background: rgba(255,255,255,.14); }
.lyric-line { display: block; width: 100%; padding: 13px 18px; border: 0; border-radius: 13px; color: #78839f; background: transparent; text-align: left; font-size: clamp(16px, 2vw, 19px); line-height: 1.5; cursor: pointer; transition: color .25s, background .25s, transform .25s; }
.lyric-line:hover { color: #d8ddf0; background: rgba(255,255,255,.05); }
.lyric-line.active { color: #fff; background: linear-gradient(90deg, rgba(129, 108, 255, .23), rgba(41, 187, 195, .07)); transform: translateX(5px); }
.lyric-line.active::before { content: ""; display: inline-block; width: 4px; height: 1.2em; margin-right: 10px; border-radius: 5px; vertical-align: -0.22em; background: var(--accent); }
.empty-lyrics { padding: 40px 18px; color: var(--muted); text-align: center; }

.error { margin: 20px 0 0; padding: 14px 16px; border: 1px solid rgba(255, 139, 158, .28); border-radius: 12px; color: #ffc0cb; background: rgba(126, 34, 56, .25); font-size: 13px; line-height: 1.55; }
footer { margin-top: 28px; color: #66718b; font-size: 11px; text-align: center; }
.hidden { display: none !important; }

body.compact { min-height: 0; background: transparent; }
body.compact .shell { width: 100%; padding: 0; }
body.compact .masthead,
body.compact .drop-zone,
body.compact footer { display: none; }
body.compact .player-card {
  margin-top: 0;
  padding: 0 0 6px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
body.compact .track-head,
body.compact .lyrics-toolbar { display: none; }
body.compact audio { display: block; height: 32px; margin: 0; }
body.compact .lyrics {
  max-height: none;
  overflow: hidden;
  padding: 8px 0 0;
}
body.compact .current-lyric {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin: 0;
  overflow: hidden;
  padding: 10px 18px 10px 21px;
  border: 1px solid rgba(242, 183, 86, .22);
  border-left: 3px solid #f2b756;
  border-radius: 12px;
  color: #f3f0e9;
  background: rgba(242, 183, 86, .07);
  font-family: "Iowan Old Style", Baskerville, "Noto Serif TC", "Songti TC", "PingFang TC", Georgia, serif;
  font-weight: 600;
  letter-spacing: .04em;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  line-height: 1.35;
}
body.compact .current-lyric::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  margin-right: 9px;
  border-radius: 50%;
  background: #f2b756;
  box-shadow: 0 0 0 4px rgba(242, 183, 86, .1);
}

@media (max-width: 640px) {
  .shell { width: min(100% - 24px, 960px); padding-top: 28px; }
  .masthead { display: block; }
  .masthead-actions { margin-top: 18px; }
  .privacy-pill { display: inline-flex; margin-top: 18px; }
  .masthead-actions .privacy-pill { margin-top: 0; }
  .drop-zone { display: grid; justify-items: start; min-height: 0; padding: 24px; }
  .drop-zone .button { margin-left: 0; }
  .player-card { padding: 18px; border-radius: 18px; }
  .track-head { align-items: flex-start; flex-wrap: wrap; }
  .lyrics { max-height: 55vh; padding-inline: 0; }
  .lyric-line { padding-inline: 10px; }
}
