:root {
  color-scheme: dark;
  --ink: #f7f7f3;
  --muted: rgba(238, 242, 240, 0.63);
  --faint: rgba(229, 236, 235, 0.35);
  --line: rgba(245, 248, 246, 0.2);
  --glass: rgba(14, 25, 32, 0.42);
  --glass-strong: rgba(11, 20, 27, 0.68);
  --cyan: #8ce4ef;
  --sun: #ffd49b;
  --coral: #ff9d8d;
  --range-fill: 0%;
  --volume-fill: 72%;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  width: 100%;
  height: 100%;
  background: #101b25;
}

body {
  min-width: 320px;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background: #101b25;
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
}

button,
input {
  color: inherit;
  font: inherit;
}

button,
a,
input[type="range"] {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
.lyrics-viewport:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}

.cinematic-background,
.cinematic-shade,
.cinematic-grain {
  position: fixed;
  inset: -3%;
  pointer-events: none;
}

.cinematic-background {
  z-index: 0;
  background-color: #243945;
  background-image: var(--scene-image);
  background-position: center center;
  background-size: cover;
  transform: scale(1.045);
  filter: saturate(0.88) contrast(1.03);
}

.is-playing .cinematic-background {
  animation: cinematic-drift 34s ease-in-out infinite alternate;
}

.cinematic-shade {
  z-index: 1;
  background:
    radial-gradient(circle at 72% 40%, transparent 5%, rgba(7, 14, 20, 0.2) 56%, rgba(5, 10, 15, 0.7) 100%),
    linear-gradient(90deg, rgba(7, 15, 22, 0.63) 0%, rgba(7, 15, 22, 0.25) 43%, rgba(7, 15, 22, 0.58) 100%),
    linear-gradient(0deg, rgba(5, 11, 17, 0.86) 0%, transparent 44%, rgba(6, 13, 19, 0.24) 100%);
  backdrop-filter: blur(0.5px);
}

.cinematic-grain {
  z-index: 2;
  opacity: 0.13;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.34'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.floating-header {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  right: 32px;
  left: 32px;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 52px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-color: transparent;
  border-radius: 7px;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  transition: background 240ms ease, border-color 240ms ease, box-shadow 240ms ease, backdrop-filter 240ms ease;
}

.floating-header:hover,
.floating-header:focus-within {
  background: rgba(11, 23, 31, 0.48);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 14px 50px rgba(2, 8, 13, 0.13);
  backdrop-filter: blur(16px) saturate(125%);
}

.brand {
  display: inline-flex;
  align-items: center;
  width: max-content;
  gap: 10px;
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 19px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.26);
}

.brand-wave {
  display: flex;
  align-items: flex-end;
  width: 24px;
  height: 21px;
  gap: 3px;
}

.brand-wave i {
  width: 5px;
  border-radius: 3px;
  background: var(--cyan);
}

.brand-wave i:nth-child(1) { height: 11px; }
.brand-wave i:nth-child(2) { height: 20px; background: var(--sun); }
.brand-wave i:nth-child(3) { height: 15px; background: var(--coral); }

.site-nav {
  display: flex;
  align-self: stretch;
  gap: 26px;
}

.site-nav a {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 36px;
  color: rgba(247, 247, 243, 0.62);
  font-size: 14px;
  transition: color 180ms ease;
}

.site-nav a::after {
  position: absolute;
  right: 8px;
  bottom: -1px;
  left: 8px;
  height: 2px;
  background: var(--sun);
  content: "";
  opacity: 0;
  transform: scaleX(0.3);
  transition: opacity 180ms ease, transform 180ms ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--ink);
}

.site-nav a.active::after {
  opacity: 1;
  transform: scaleX(1);
}

.player-stage {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(390px, 0.96fr) minmax(430px, 1.04fr);
  align-items: center;
  width: min(1250px, calc(100% - 100px));
  height: 100svh;
  margin: 0 auto;
  gap: clamp(54px, 7vw, 108px);
  padding: 88px 0 154px;
}

.record-scene {
  align-self: center;
  min-width: 0;
}

.record-stack {
  position: relative;
  width: min(34vw, 430px);
  aspect-ratio: 1.23 / 1;
  margin-left: 5%;
  filter: drop-shadow(0 30px 42px rgba(0, 0, 0, 0.35));
}

.album-cover {
  position: absolute;
  top: 4%;
  left: 0;
  z-index: 3;
  width: 77%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.34), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.album-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 72% center;
  transform: scale(1.015);
}

.cover-sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.2), transparent 28%, transparent 68%, rgba(4, 12, 18, 0.14));
  pointer-events: none;
}

.glass-record {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  width: 81%;
  aspect-ratio: 1;
  border: 1px solid rgba(241, 252, 252, 0.42);
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle, transparent 0 7px, rgba(240, 252, 251, 0.085) 8px, transparent 9px 15px),
    conic-gradient(from 215deg, rgba(255, 255, 255, 0.48), transparent 12%, rgba(140, 228, 239, 0.1) 24%, transparent 44%, rgba(255, 212, 155, 0.28) 55%, transparent 68%, rgba(255, 255, 255, 0.32) 82%, transparent 92%),
    radial-gradient(circle, rgba(238, 249, 249, 0.22) 0 18%, rgba(186, 232, 238, 0.15) 19% 34%, rgba(162, 222, 231, 0.24) 35% 100%);
  box-shadow: inset 0 0 48px rgba(255, 255, 255, 0.16), 0 28px 58px rgba(0, 0, 0, 0.31);
  mix-blend-mode: screen;
  animation: record-spin 19s linear infinite paused;
}

.is-playing .glass-record {
  animation-play-state: running;
}

.record-reflection {
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  background: conic-gradient(from 30deg, transparent 0 32%, rgba(255, 255, 255, 0.32) 37%, transparent 43% 71%, rgba(255, 255, 255, 0.16) 77%, transparent 84%);
  filter: blur(1px);
}

.record-label {
  position: absolute;
  inset: 37%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 30, 40, 0.92) 0 16%, rgba(237, 249, 249, 0.28) 18% 42%, rgba(110, 197, 211, 0.4) 44% 100%);
  box-shadow: 0 0 24px rgba(199, 243, 248, 0.3);
}

.record-label span {
  width: 16%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(4, 12, 18, 0.92);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.32);
}

.spectrum-wrap {
  width: min(35vw, 450px);
  height: 82px;
  margin: 18px 0 0 3%;
  opacity: 0.9;
}

#spectrum {
  display: block;
  width: 100%;
  height: 100%;
}

.lyric-scene {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-self: stretch;
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding-top: 7vh;
}

.track-heading {
  position: relative;
  z-index: 2;
  padding: 12px 0 20px;
  text-shadow: 0 3px 22px rgba(0, 0, 0, 0.55);
}

.track-index {
  margin: 0 0 9px;
  color: var(--faint);
  font-size: 11px;
}

.track-index span {
  color: var(--sun);
}

#cinematic-player .track-heading h1 {
  margin: 0;
  color: #fffaf2;
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 56px;
  font-weight: 600;
  line-height: 1;
  text-shadow:
    0 2px 6px rgba(0, 0, 0, 0.92),
    0 8px 28px rgba(0, 0, 0, 0.62);
}

.track-heading > p:last-child {
  margin: 13px 0 0;
  color: rgba(246, 247, 243, 0.72);
  font-size: 16px;
}

.lyrics-viewport {
  position: relative;
  min-height: 0;
  overflow: hidden;
  outline: none;
  cursor: grab;
  mask-image: linear-gradient(to bottom, transparent, #000 17%, #000 78%, transparent 100%);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.lyrics-viewport.is-scrubbing {
  cursor: grabbing;
}

.lyrics-viewport::before {
  display: none;
  content: "";
}

.lyrics {
  will-change: transform;
  transition: transform 600ms cubic-bezier(0.22, 0.78, 0.2, 1);
}

.lyrics-viewport.is-scrubbing .lyrics {
  transition: none;
}

.lyrics-spacer {
  display: none;
}

.lyric-line {
  width: min(100%, 620px);
  min-height: 54px;
  margin: 0;
  padding: 13px 12px;
  color: rgba(239, 243, 241, 0.31);
  font-size: clamp(16px, 1.45vw, 21px);
  line-height: 1.5;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
  transform-origin: left center;
  transition: color 280ms ease, opacity 280ms ease, transform 420ms cubic-bezier(0.2, 0.75, 0.22, 1), filter 280ms ease;
}

.lyric-line > span,
.lyric-line > small {
  display: block;
}

.lyric-line > small {
  margin-top: 3px;
  color: inherit;
  font-size: 0.72em;
  font-weight: 400;
  opacity: 0.72;
}

.lyric-line.near {
  color: rgba(242, 245, 242, 0.57);
}

.lyric-line.active {
  color: #ffe0a6;
  font-weight: 600;
  transform: scale(1.12);
  text-shadow: 0 0 18px rgba(255, 212, 155, 0.58), 0 3px 16px rgba(0, 0, 0, 0.72);
  filter: drop-shadow(0 5px 18px rgba(0, 0, 0, 0.46));
}

.lyric-line.seek-target {
  color: #c6f8fb;
  transform: scale(1.07);
  text-shadow: 0 0 16px rgba(140, 228, 239, 0.48), 0 3px 14px rgba(0, 0, 0, 0.7);
}

.lyric-seek-marker {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  z-index: 4;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), rgba(140, 228, 239, 0.18) 52%, transparent);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition: opacity 180ms ease;
}

.lyric-seek-marker time {
  position: absolute;
  top: -25px;
  right: 4px;
  padding: 3px 6px;
  border: 1px solid rgba(140, 228, 239, 0.3);
  border-radius: 3px;
  color: var(--cyan);
  background: rgba(5, 15, 21, 0.34);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(6px);
}

.lyrics-viewport.is-scrubbing .lyric-seek-marker {
  opacity: 1;
}

.control-dock {
  position: fixed;
  right: 28px;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 28px;
  z-index: 30;
  padding: 13px 18px 12px;
  border: 1px solid transparent;
  border-color: transparent;
  border-radius: 7px;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.progress-group {
  display: grid;
  grid-template-columns: 44px minmax(120px, 1fr) 44px;
  align-items: center;
  gap: 10px;
}

.progress-group time {
  color: rgba(243, 247, 245, 0.63);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.progress-group time:last-child {
  text-align: right;
}

input[type="range"] {
  height: 18px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--sun) 0 var(--range-fill), rgba(255, 255, 255, 0.2) var(--range-fill) 100%);
}

input[type="range"]::-moz-range-track {
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
}

input[type="range"]::-moz-range-progress {
  height: 3px;
  border-radius: 2px;
  background: var(--sun);
}

input[type="range"]::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  margin-top: -4.5px;
  appearance: none;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 0 4px rgba(255, 212, 155, 0.12);
  opacity: 0;
  transition: opacity 150ms ease, transform 150ms ease;
}

input[type="range"]::-moz-range-thumb {
  width: 9px;
  height: 9px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: var(--sun);
}

input[type="range"]:hover::-webkit-slider-thumb,
input[type="range"]:focus-visible::-webkit-slider-thumb {
  opacity: 1;
}

.dock-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  min-height: 54px;
  margin-top: 5px;
  gap: 16px;
}

.compact-track {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 11px;
}

.compact-art {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
}

.compact-art img,
.drawer-art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 72% center;
}

.compact-track > span:last-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.compact-track strong,
.compact-track small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-track strong {
  font-size: 14px;
  font-weight: 600;
}

.compact-track small {
  color: var(--muted);
  font-size: 11px;
}

.transport,
.dock-tools {
  display: flex;
  align-items: center;
}

.transport {
  gap: 11px;
}

.transport::after {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  content: "";
  pointer-events: none;
}

.dock-tools {
  justify-content: flex-end;
  gap: 7px;
}

.icon-control,
.play-control,
.drawer-close {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  color: rgba(246, 248, 246, 0.72);
  background: transparent;
  cursor: pointer;
  transition: color 170ms ease, background 170ms ease, transform 170ms ease;
}

.icon-control {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 19px;
}

.icon-control:hover,
.icon-control.active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.1);
}

.playback-mode-icon {
  position: relative;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
}

.playback-mode-icon svg {
  grid-area: 1 / 1;
  width: 22px;
  height: 22px;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.76);
  transition: color 180ms ease, opacity 150ms ease, transform 180ms ease;
}

.playback-mode-icon[data-mode="sequence"] [data-playback-icon="sequence"],
.playback-mode-icon[data-mode="shuffle"] [data-playback-icon="shuffle"],
.playback-mode-icon[data-mode="repeat-one"] [data-playback-icon="repeat-one"],
.playback-mode-icon[data-mode="repeat-list"] [data-playback-icon="repeat-list"] {
  opacity: 1;
  transform: none;
}

#playback-mode-button:hover,
#playback-mode-button:focus-visible {
  color: var(--cyan);
}

.icon-control:active,
.play-control:active {
  transform: scale(0.92);
}

.play-control {
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 50%;
  color: #15232c;
  background: rgba(250, 250, 246, 0.94);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28), 0 0 0 5px rgba(255, 255, 255, 0.06);
}

.play-control:hover {
  color: #101c24;
  background: #fff;
  transform: translateY(-1px);
}

.play-icon {
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid currentColor;
}

.pause-icon {
  display: none;
  gap: 4px;
}

.pause-icon i {
  width: 4px;
  height: 15px;
  border-radius: 1px;
  background: currentColor;
}

.is-playing .play-icon {
  display: none;
}

.is-playing .pause-icon {
  display: flex;
}

.is-loading .play-control {
  cursor: wait;
}

.is-loading .play-control::after {
  position: absolute;
  inset: 7px;
  border: 2px solid transparent;
  border-top-color: #263a45;
  border-radius: 50%;
  content: "";
  animation: loader-spin 700ms linear infinite;
}

.skip-icon {
  position: relative;
  width: 16px;
  height: 14px;
}

.skip-icon::before {
  position: absolute;
  top: 2px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  content: "";
}

.skip-icon::after {
  position: absolute;
  top: 2px;
  width: 2px;
  height: 10px;
  border-radius: 1px;
  background: currentColor;
  content: "";
}

.skip-icon.next::before { left: 2px; border-left: 8px solid currentColor; }
.skip-icon.next::after { right: 1px; }
.skip-icon.previous::before { right: 2px; border-right: 8px solid currentColor; }
.skip-icon.previous::after { left: 1px; }

.volume-range {
  width: 82px;
}

.volume-range::-webkit-slider-runnable-track {
  background: linear-gradient(to right, var(--cyan) 0 var(--volume-fill), rgba(255, 255, 255, 0.2) var(--volume-fill) 100%);
}

.volume-range::-webkit-slider-thumb {
  background: var(--cyan);
  box-shadow: 0 0 0 4px rgba(140, 228, 239, 0.1);
}

.list-icon {
  display: grid;
  width: 17px;
  gap: 3px;
}

.list-icon i {
  height: 2px;
  border-radius: 1px;
  background: currentColor;
}

.list-icon i:nth-child(2) { width: 12px; justify-self: end; }

.fullscreen-icon {
  position: relative;
  width: 17px;
  height: 17px;
}

.fullscreen-icon i {
  position: absolute;
  width: 6px;
  height: 6px;
  border-color: currentColor;
}

.fullscreen-icon i:nth-child(1) { top: 0; left: 0; border-top: 2px solid; border-left: 2px solid; }
.fullscreen-icon i:nth-child(2) { top: 0; right: 0; border-top: 2px solid; border-right: 2px solid; }
.fullscreen-icon i:nth-child(3) { right: 0; bottom: 0; border-right: 2px solid; border-bottom: 2px solid; }
.fullscreen-icon i:nth-child(4) { bottom: 0; left: 0; border-bottom: 2px solid; border-left: 2px solid; }

.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 38;
  display: block;
  visibility: hidden;
  background: rgba(3, 9, 13, 0.14);
  opacity: 0;
  cursor: default;
  transition: opacity 300ms ease, visibility 0s linear 300ms;
}

.playlist-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  width: min(390px, 92vw);
  display: flex;
  flex-direction: column;
  padding: max(32px, env(safe-area-inset-top)) 22px 32px;
  overflow: hidden;
  border-left: 1px solid rgba(255, 255, 255, 0.17);
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  transform: translateX(104%);
  transition: transform 360ms cubic-bezier(0.22, 0.78, 0.2, 1);
}

.drawer-open .drawer-scrim {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}

@media (min-width: 761px) {
  .drawer-open .drawer-scrim {
    right: min(390px, 92vw);
  }
}

.drawer-open .playlist-drawer {
  transform: none;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.drawer-search {
  position: relative;
  display: block;
  flex: 0 0 auto;
  margin-bottom: 12px;
}

.drawer-search input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 36px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 5px;
  outline: none;
  color: var(--ink);
  background: rgba(5, 13, 18, 0.14);
  font: inherit;
  font-size: 12px;
}

.drawer-search input::placeholder { color: var(--faint); }
.drawer-search input:focus { border-color: rgba(140, 228, 239, 0.68); }

.search-icon {
  position: absolute;
  top: 12px;
  left: 13px;
  z-index: 1;
  width: 11px;
  height: 11px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  color: var(--muted);
  pointer-events: none;
}

.search-icon::after {
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 6px;
  height: 1.5px;
  border-radius: 1px;
  background: currentColor;
  content: "";
  transform: rotate(45deg);
}

.playlist-tracks {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(255, 255, 255, 0.24) transparent;
}

.playlist-empty {
  padding: 24px 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.drawer-header p {
  margin: 0 0 6px;
  color: var(--faint);
  font-size: 9px;
}

.drawer-header h2 {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 28px;
  font-weight: 500;
}

.drawer-header h2 span {
  color: var(--sun);
  font-size: 13px;
}

.drawer-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.drawer-close span::before,
.drawer-close span::after {
  position: absolute;
  top: 18px;
  left: 11px;
  width: 16px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  content: "";
}

.drawer-close span::before { transform: rotate(45deg); }
.drawer-close span::after { transform: rotate(-45deg); }

.playlist-track {
  display: grid;
  grid-template-columns: 20px 48px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: var(--ink);
  margin-bottom: 5px;
  background: transparent;
  backdrop-filter: none;
  cursor: pointer;
  gap: 10px;
  text-align: left;
}

.playlist-track:hover,
.playlist-track:focus-visible,
.playlist-track.active {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(5, 13, 18, 0.18);
}

.drawer-art {
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: 4px;
}

.drawer-meta {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.drawer-meta strong,
.drawer-meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-meta strong { font-size: 14px; }
.drawer-meta small { color: var(--muted); font-size: 10px; }
.playlist-track time { color: var(--muted); font-size: 11px; }

.playing-indicator {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 18px;
  gap: 2px;
}

.playlist-track:not(.active) .playing-indicator {
  opacity: 0;
}

.playing-indicator i {
  width: 2px;
  height: 7px;
  border-radius: 1px;
  background: var(--sun);
}

.is-playing .playing-indicator i {
  animation: playing-bar 720ms ease-in-out infinite alternate;
}

.is-playing .playing-indicator i:nth-child(2) { animation-delay: -240ms; }
.is-playing .playing-indicator i:nth-child(3) { animation-delay: -480ms; }

.toast {
  position: fixed;
  top: 90px;
  left: 50%;
  z-index: 60;
  max-width: calc(100% - 32px);
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.84);
  background: rgba(7, 16, 22, 0.76);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px);
  transition: opacity 200ms ease, transform 200ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes cinematic-drift {
  from { transform: scale(1.045) translate3d(-0.35%, -0.2%, 0); }
  to { transform: scale(1.075) translate3d(0.55%, 0.4%, 0); }
}

@keyframes record-spin { to { transform: rotate(360deg); } }
@keyframes loader-spin { to { transform: rotate(360deg); } }
@keyframes playing-bar { from { height: 5px; } to { height: 17px; } }

@media (max-width: 1050px) {
  .player-stage {
    grid-template-columns: minmax(310px, 0.9fr) minmax(370px, 1.1fr);
    width: calc(100% - 64px);
    gap: 38px;
  }

  .record-stack { width: min(39vw, 390px); margin-left: 0; }
  .spectrum-wrap { width: min(40vw, 410px); margin-left: 0; }
  .lyric-line { font-size: 17px; }
  .dock-row { grid-template-columns: minmax(140px, 1fr) auto minmax(140px, 1fr); }
  .volume-range { width: 64px; }
}

@media (max-width: 760px) {
  .cinematic-background {
    background-position: 69% center;
    filter: saturate(0.8) contrast(1.04);
  }

  .cinematic-shade {
    background:
      linear-gradient(180deg, rgba(5, 12, 18, 0.34) 0%, rgba(5, 12, 18, 0.14) 23%, rgba(5, 12, 18, 0.67) 58%, rgba(5, 12, 18, 0.93) 100%),
      radial-gradient(circle at 70% 25%, transparent, rgba(5, 12, 18, 0.42) 76%);
  }

  .floating-header {
    top: max(10px, env(safe-area-inset-top));
    right: 10px;
    left: 10px;
    grid-template-columns: 34px 1fr;
    min-height: 46px;
    padding: 0 10px;
  }

  .brand > span:last-child { display: none; }
  .brand-wave { width: 22px; }
  .site-nav { justify-self: end; gap: clamp(10px, 4.2vw, 22px); }
  .site-nav a { min-width: 28px; font-size: 12px; }
  .site-nav a::after { right: 5px; left: 5px; }

  .player-stage {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(185px, 31vh) minmax(0, 1fr);
    align-items: stretch;
    width: 100%;
    height: 100svh;
    gap: 2px;
    padding: 68px 18px 145px;
  }

  .record-scene {
    position: relative;
    display: grid;
    place-items: center;
    align-self: stretch;
  }

  .record-stack {
    width: min(73vw, 292px);
    margin: 0 0 4px;
  }

  .spectrum-wrap {
    position: absolute;
    right: 3%;
    bottom: 0;
    left: 3%;
    width: auto;
    height: 44px;
    margin: 0;
    opacity: 0.72;
  }

  .lyric-scene {
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    padding: 0 6px;
  }

  .track-heading {
    padding: 3px 0 7px;
    text-align: center;
  }

  .track-index { display: none; }
  #cinematic-player .track-heading h1 { font-size: 28px; }
  .track-heading > p:last-child { margin-top: 5px; font-size: 12px; }
  .lyrics-viewport { text-align: center; }
  .lyrics-viewport::before { display: none; }
  .lyrics-spacer { height: 39%; }

  .lyric-line {
    width: 100%;
    min-height: 42px;
    padding: 9px 5px;
    border-left: 0;
    font-size: 14px;
    line-height: 1.55;
    transform-origin: center;
  }

  .lyric-line.active { transform: scale(1.08); }

  .lyric-seek-marker time {
    right: 50%;
    transform: translateX(50%);
  }

  .control-dock {
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 8px;
    padding: 9px 11px 8px;
  }

  .progress-group {
    grid-template-columns: 34px minmax(100px, 1fr) 34px;
    gap: 7px;
  }

  .progress-group time { font-size: 9px; }
  .dock-row {
    display: flex;
    flex-direction: column;
    min-height: 78px;
    margin-top: 1px;
    gap: 0;
  }
  .compact-track { display: none; }
  .transport { justify-content: center; height: 48px; gap: 3px; }
  .dock-tools { justify-content: center; width: 100%; height: 29px; gap: 0; }
  .dock-tools .volume-range { display: block; width: 58px; }
  .icon-control { width: 34px; height: 34px; }
  .play-control { width: 44px; height: 44px; }
  .dock-tools .icon-control { width: 30px; height: 28px; }

  .playlist-drawer {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: min(46svh, 390px);
    padding: 18px 16px max(20px, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.17);
    border-left: 0;
    border-radius: 8px 8px 0 0;
    transform: translateY(104%);
  }

  .drawer-open .control-dock {
    opacity: 0;
    pointer-events: none;
  }

  .drawer-open .drawer-scrim {
    right: 0;
    bottom: min(46svh, 390px);
  }

  .drawer-header { margin-bottom: 16px; }
  .drawer-header h2 { font-size: 24px; }
  .toast { top: 68px; }
}

@media (max-width: 390px) and (max-height: 720px) {
  .player-stage {
    grid-template-rows: minmax(155px, 28vh) minmax(0, 1fr);
    padding-bottom: 136px;
  }

  .record-stack { width: min(62vw, 230px); }
  #cinematic-player .track-heading h1 { font-size: 24px; }
  .lyric-line { min-height: 38px; padding-block: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .cinematic-background { transform: scale(1.045); }
}

/* Butterfly/PJAX route integration */
body.music-page #body-wrap {
  min-height: 100svh;
  overflow: hidden;
  background: transparent;
}

body.music-page #page-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 30;
  height: 60px !important;
  background: transparent !important;
}

body.music-page #content-inner {
  display: block;
  width: 100%;
  max-width: none;
  height: 100svh;
  margin: 0;
  padding: 0;
}

body.music-page #article-container {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

body.music-page #page {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body.music-page #page > .page-title,
body.music-page #footer,
body.music-page #rightside {
  display: none !important;
}

body.music-page #meteor-canvas {
  z-index: 4;
  mix-blend-mode: screen;
}

body.music-page #nav .menus_items .menus_item > a {
  color: rgba(255, 255, 255, 0.76) !important;
}

body.music-page #nav .menus_items .menus_item > a[href="/music/"] {
  color: #ffffff !important;
}
