:root {
  --ink: #704e60;
  --muted: #a87390;
  --paper: #f9ddea;
  --paper-tint: #f7d8e7;
  --record: #f28cb9;
  --record-deep: #d9649c;
  --record-light: #f7bbd5;
  --label: #b3dfbb;
  --label-edge: #94c99e;
  --arm: #da91ad;
  --arm-deep: #bd678d;
  --cartridge: #dd85a2;
  --line: rgba(139, 77, 107, .18);
  --panel: rgba(255, 251, 254, .86);
  --panel-line: rgba(213, 161, 189, .42);
  --active: #f8c9e3;
  --theme-flower: #ef74a7;
  --flower-solid: #ef4e76;
  --flower-petal: #f5a7c4;
  --flower-core: #ff9d16;
  --flower-white: #fffdf8;
  --flower-shadow: rgba(110, 57, 84, .24);
}

body[data-theme="sea"] {
  --ink: #456775;
  --muted: #6d95a2;
  --paper: #d9eef8;
  --paper-tint: #cfe8f5;
  --record: #5eb6ba;
  --record-deep: #238a91;
  --record-light: #a7dedf;
  --label: #ffc27e;
  --label-edge: #ee9e42;
  --arm: #6c879c;
  --arm-deep: #526e85;
  --cartridge: #148d96;
  --line: rgba(50, 108, 122, .18);
  --panel: rgba(250, 254, 255, .86);
  --panel-line: rgba(138, 190, 207, .48);
  --active: #bde2e9;
  --theme-flower: #2d9ee8;
  --flower-solid: #075f71;
  --flower-petal: #218f8c;
  --flower-core: #ff9e1c;
  --flower-white: #fffdf7;
  --flower-shadow: rgba(33, 91, 106, .24);
}

* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  transition: background-color 80ms linear, color 80ms linear;
}

button, input, label { font: inherit; }
button { color: inherit; cursor: pointer; }

.player {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(ellipse 44% 26% at 43% 35%, rgba(255, 255, 255, .32), transparent 100%),
    linear-gradient(180deg, var(--paper), var(--paper-tint));
}

.topbar {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: calc(100% - clamp(48px, 10vw, 180px));
  margin: 0 auto;
  padding-top: clamp(28px, 8.2vh, 92px);
}

h1 {
  margin: 0;
  font-family: "Baskerville", "Iowan Old Style", "Palatino Linotype", "Songti SC", serif;
  font-size: clamp(19px, 1.6vw, 28px);
  font-weight: 600;
  letter-spacing: .09em;
}

.round-button, .reset-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .8);
  box-shadow: 0 7px 15px rgba(141, 76, 108, .09);
  transition: transform 170ms ease, background-color 80ms linear, color 80ms linear;
}
.round-button:hover, .reset-button:hover { transform: scale(1.06); }
.round-button:active, .reset-button:active { transform: scale(.95); }
.theme-button { justify-self: start; }
.theme-button__symbol {
  display: block;
  color: var(--theme-flower);
  font-family: "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols 2", sans-serif;
  font-size: 25px;
  line-height: 1;
  transform: translateY(1px);
  transition: color 80ms linear;
}
.playlist-button { justify-self: end; color: var(--arm-deep); }
.playlist-button svg { width: 21px; fill: currentColor; }
body.is-playlist-open .playlist-button { background: var(--record); color: #fff; }

.turntable-stage {
  position: absolute;
  top: 53%;
  left: 45.5%;
  width: min(48vw, 820px);
  min-width: 430px;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
}

.record-wrap { position: absolute; inset: 0; }

.record {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(ellipse 14% 8% at 29% 23%, rgba(255,255,255,.36), transparent 86%),
    radial-gradient(ellipse 17% 9% at 71% 77%, rgba(255,255,255,.22), transparent 84%),
    radial-gradient(ellipse 22% 12% at 29% 67%, rgba(255,255,255,.17), transparent 86%),
    radial-gradient(circle at 50% 50%, var(--record-light) 0 13%, transparent 13.35%),
    radial-gradient(circle at 50% 50%, var(--record-light), var(--record) 54%, var(--record-deep) 100%);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .7), inset -8px -9px 22px rgba(155, 50, 98, .09), 0 8px 15px rgba(147, 77, 108, .08);
  transition: background 80ms linear, box-shadow 80ms linear;
}
.record:focus-visible { outline: 3px solid #fff; outline-offset: 7px; }

.record__grooves {
  position: absolute;
  inset: 1.2%;
  border-radius: inherit;
  opacity: .62;
  background: repeating-radial-gradient(circle at center, transparent 0 .9px, rgba(90, 39, 65, .15) 1.12px, transparent 1.48px 2.32px);
  mix-blend-mode: multiply;
}
.record__shine { position: absolute; border-radius: 50%; filter: blur(15px); background: rgba(255, 255, 255, .42); }
.shine-one { top: 21%; left: 17%; width: 15%; height: 8%; }
.shine-two { right: 16%; bottom: 18%; width: 18%; height: 10%; opacity: .45; }

.record__label {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 28.2%;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid var(--label-edge);
  border-radius: 50%;
  background: var(--label);
  box-shadow: 0 3px 6px rgba(102, 62, 78, .2), inset 0 1px 0 rgba(255, 255, 255, .38);
  transform: translate(-50%, -50%);
  transition: background-color 80ms linear, border-color 80ms linear;
}
.record__label::before { position: absolute; width: 10px; height: 10px; border: 1px solid rgba(255,255,255,.7); border-radius: 50%; background: var(--paper); content: ""; }
.record__label i { position: absolute; bottom: 50%; left: 50%; width: 1.5px; height: 37%; background: rgba(255,255,255,.84); transform: translateX(-50%) rotate(90deg); transform-origin: 50% 100%; }

.flowers, .ripples { position: absolute; inset: 0; border-radius: inherit; }
.flowers { transform-origin: 50% 50%; }

.flower {
  --rotation: 0deg;
  position: absolute;
  width: var(--flower-size, 5.5%);
  aspect-ratio: 1;
  filter: drop-shadow(0 4px 2px var(--flower-shadow));
  transform: translate(-50%, -50%) rotate(var(--rotation));
  animation: flower-pop 220ms cubic-bezier(.17,.93,.34,1.31) both;
}
.flower__petal { position: absolute; top: 50%; left: 50%; width: 26%; height: 47%; border-radius: 58% 58% 54% 54%; background: var(--flower-solid); transform: translate(-50%, 0) rotate(var(--petal-angle)); transform-origin: 50% 0; }
.flower__core { position: absolute; top: 50%; left: 50%; z-index: 1; width: 25%; aspect-ratio: 1; border-radius: 50%; background: var(--flower-core); box-shadow: inset 0 1px 1px rgba(255,255,255,.42); transform: translate(-50%, -50%); }
.flower--ghost { opacity: .88; filter: drop-shadow(0 3px 2px var(--flower-shadow)); }
.flower--ghost .flower__petal { border: 1.2px solid color-mix(in srgb, var(--flower-petal), white 34%); background: color-mix(in srgb, var(--flower-petal), transparent 58%); }
.flower--solid .flower__petal { background: linear-gradient(145deg, color-mix(in srgb, var(--flower-solid), white 12%), var(--flower-solid) 68%); }
.flower--solid .flower__core { background: var(--flower-core); }
.flower--white { filter: drop-shadow(0 4px 3px var(--flower-shadow)); }
.flower--white .flower__petal { width: 28%; height: 45%; background: var(--flower-white); }
.flower--white .flower__core { width: 27%; background: var(--flower-core); }

.ripple { position: absolute; width: 18px; aspect-ratio: 1; border: 1.25px solid rgba(255,255,255,.78); border-radius: 50%; transform: translate(-50%, -50%); animation: ripple-out 300ms ease-out forwards; }
.ripple::after { position: absolute; inset: -6px; border: 1px solid rgba(255,255,255,.32); border-radius: inherit; content: ""; }

body.is-playing .flowers { animation: vinyl-spin 8.7s linear infinite; }
body.is-playing .record__label { animation: label-spin 8.7s linear infinite; }
body.is-playing .tonearm { --arm-angle: -58deg; }

.tonearm {
  --arm-angle: -80deg;
  position: absolute;
  top: 0;
  right: -20%;
  width: 86%;
  height: clamp(52px, 6.2vw, 97px);
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transform: rotate(var(--arm-angle));
  transform-origin: calc(100% - clamp(26px, 3.1vw, 48px)) 50%;
  transition: transform 900ms cubic-bezier(.25,.87,.32,1);
}
.tonearm:focus-visible { outline: 2px solid rgba(255,255,255,.95); outline-offset: 6px; }
.tonearm__pivot { position: absolute; top: 0; right: 0; display: block; width: clamp(52px, 6.2vw, 97px); aspect-ratio: 1; border: clamp(9px, 1vw, 15px) solid var(--arm); border-radius: 50%; background: var(--arm-deep); box-shadow: inset 0 2px 2px rgba(255,255,255,.25), 0 4px 8px rgba(78,49,69,.13); }
.tonearm__pivot i { position: absolute; border-radius: 50%; background: rgba(255,255,255,.9); }.tonearm__pivot i:first-child { top: 18%; left: 30%; width: 38%; aspect-ratio: 1; }.tonearm__pivot i:last-child { right: 12%; bottom: 17%; width: 21%; aspect-ratio: 1; }
.tonearm__tube { position: absolute; top: 48%; right: 9%; left: 10%; height: clamp(7px, .75vw, 11px); border: 1px solid color-mix(in srgb, var(--arm), transparent 52%); border-radius: 99px; background: linear-gradient(180deg, #fff 0 47%, color-mix(in srgb, var(--paper), #fff 24%) 48% 100%); box-shadow: 0 0 0 1px rgba(255,255,255,.75); transform: translateY(-50%); }
.tonearm__head { position: absolute; top: 48%; left: 7%; width: clamp(26px, 3.45vw, 50px); height: clamp(23px, 3vw, 42px); border-radius: 8px 7px 10px 10px; background: var(--cartridge); box-shadow: 0 4px 6px rgba(75,48,67,.14); transform: translateY(-50%); }.tonearm__head b { position: absolute; top: 40%; left: 41%; width: 6px; height: 6px; border-radius: 50%; background: #fff; }

.volume-control { position: absolute; top: 36%; left: -11.3%; }
.volume-track { --volume: 74; --volume-offset: 170px; position: relative; width: 40px; height: clamp(168px, 14vw, 242px); border: 1px solid var(--panel-line); border-radius: 99px; background: rgba(255,255,255,.42); box-shadow: inset 0 1px 1px rgba(255,255,255,.72); cursor: ns-resize; touch-action: none; }
.volume-track::before { position: absolute; top: 18px; bottom: 18px; left: 50%; width: 4px; border-radius: 99px; background: var(--arm-deep); content: ""; opacity: .78; transform: translateX(-50%); }.volume-track__knob { position: absolute; bottom: var(--volume-offset); left: 50%; width: 36px; aspect-ratio: 1; border: 4px solid var(--arm); border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(82,51,70,.14); transform: translate(-50%, 50%); }.volume-track__knob::after { position: absolute; top: 50%; left: 50%; width: 44%; aspect-ratio: 1; border-radius: inherit; background: var(--record-deep); content: ""; transform: translate(-50%, -50%); }.volume-track input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }.volume-track:focus-visible { outline: 2px solid rgba(255,255,255,.95); outline-offset: 4px; }

.reset-button { position: absolute; bottom: 27%; left: -11.3%; width: 40px; height: 40px; color: var(--arm-deep); }.reset-button svg { width: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }

.playlist-panel { position: absolute; z-index: 5; top: clamp(90px, 9.1vh, 108px); right: clamp(26px, 2vw, 36px); width: min(332px, calc(100vw - 40px)); overflow: hidden; border: 1px solid var(--panel-line); border-radius: 20px; background: var(--panel); box-shadow: 0 14px 24px rgba(135, 75, 103, .12); opacity: 0; pointer-events: none; transform: translateY(-10px) scale(.98); transform-origin: top right; transition: opacity 220ms ease, transform 360ms cubic-bezier(.2,.8,.25,1), background-color 80ms linear; }.playlist-panel.is-open { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }
.playlist-panel__header { display: flex; align-items: center; justify-content: space-between; height: 50px; padding: 0 17px; border-bottom: 1px solid var(--panel-line); font-size: 16px; letter-spacing: .04em; }.playlist-panel__header button { width: 24px; height: 24px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 21px; line-height: 1; }.playlist-panel__header button:hover { background: rgba(255,255,255,.58); }
.now-playing { padding: 16px 18px 10px; }.now-playing strong { display: block; overflow: hidden; font-family: "Baskerville", "Songti SC", serif; font-size: 16px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.transport { display: flex; align-items: center; justify-content: center; gap: 22px; padding: 8px 0 18px; }.transport button { display: grid; width: 29px; height: 27px; place-items: center; border: 0; background: transparent; color: var(--ink); }.transport button:hover { color: var(--arm-deep); }.transport svg { width: 17px; fill: currentColor; }.transport__play { width: 31px !important; }.pause-icon { display: none; } body.is-playing .play-icon { display: none; } body.is-playing .pause-icon { display: block; }
.playlist-divider { height: 1px; background: var(--panel-line); }.playlist-list { display: grid; gap: 2px; max-height: 204px; overflow: auto; padding: 9px 10px 10px; }.playlist-item { display: flex; align-items: center; min-width: 0; height: 35px; gap: 9px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); text-align: left; }.playlist-item:hover { background: rgba(255,255,255,.54); }.playlist-item.is-active { background: var(--active); }.playlist-item__meter { display: inline-flex; width: 13px; align-items: end; justify-content: center; gap: 2px; opacity: 0; }.playlist-item__meter i { width: 2px; border-radius: 5px; background: currentColor; transform: scaleY(.45); transform-origin: bottom; }.playlist-item__meter i:nth-child(1) { height: 5px; }.playlist-item__meter i:nth-child(2) { height: 10px; }.playlist-item__meter i:nth-child(3) { height: 7px; }.playlist-item.is-active .playlist-item__meter { opacity: .68; }.playlist-item.is-active .playlist-item__meter i { transform: scaleY(.6); }.is-playing .playlist-item.is-active .playlist-item__meter { opacity: 1; }.is-playing .playlist-item.is-active .playlist-item__meter i { animation: meter-pulse .85s ease-in-out infinite alternate; }.is-playing .playlist-item.is-active .playlist-item__meter i:nth-child(2) { animation-delay: -.4s; }.playlist-item span:last-child { overflow: hidden; font-family: "Baskerville", "Songti SC", serif; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.playlist-empty { margin: 3px 0 8px; padding: 14px 10px; color: var(--muted); font-size: 12px; line-height: 1.55; text-align: center; }.library-import { padding: 0 10px 12px; }.import-button { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; padding: 9px; border: 1px dashed var(--panel-line); border-radius: 9px; background: rgba(255,255,255,.35); color: var(--ink); cursor: pointer; font-size: 12px; }.import-button:hover { background: rgba(255,255,255,.68); }.import-button--files { margin-top: 7px; border-style: solid; color: var(--muted); }.import-button svg { width: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }.import-hint { margin: 7px 3px 0; color: var(--muted); font-size: 10px; line-height: 1.45; text-align: center; } body.has-library .library-import { display: none; }.library-change-group { display: none; justify-content: center; gap: 13px; padding: 0 0 12px; }.library-change { padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-family: inherit; font-size: 10px; text-decoration: underline; text-underline-offset: 3px; }.library-change:hover { color: var(--ink); } body.has-library .library-change-group { display: flex; }

.toast { position: fixed; z-index: 10; bottom: 34px; left: 50%; max-width: calc(100vw - 40px); padding: 10px 15px; border-radius: 99px; background: rgba(70, 45, 61, .82); color: #fff; font-size: 13px; opacity: 0; pointer-events: none; transform: translate(-50%, 13px); transition: opacity 170ms ease, transform 170ms ease; }.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@keyframes vinyl-spin { to { transform: rotate(360deg); } }
@keyframes label-spin { from { transform: translate(-50%, -50%) rotate(0); } to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes flower-pop { from { opacity: 0; scale: .3; } 72% { opacity: 1; scale: 1.13; } to { opacity: 1; scale: 1; } }
@keyframes ripple-out { from { opacity: .9; scale: .3; } to { opacity: 0; scale: 4.2; } }
@keyframes meter-pulse { from { scale: 1 .45; } to { scale: 1 1; } }

@media (max-width: 880px) {
  .topbar { width: calc(100% - 32px); padding-top: 18px; }.round-button { width: 40px; height: 40px; }.turntable-stage { top: 50%; left: 50%; width: min(86vw, 610px); min-width: 0; }.tonearm { right: -13%; }.volume-control { left: -7%; transform: scale(.78); transform-origin: center; }.reset-button { left: -1%; bottom: 9%; transform: scale(.9); }.playlist-panel { top: 72px; right: 16px; }
}

@media (max-width: 520px), (max-height: 650px) {
  .turntable-stage { width: min(90vw, 500px); }.volume-control, .reset-button { display: none; }.playlist-list { max-height: 178px; }.playlist-panel { max-height: calc(100dvh - 85px); }.tonearm { right: -14%; }
}

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