@font-face {
  font-family: "myfont";
  src: url("assets/font.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --accent: #49b1f5;
  --accent-2: #39c5bb;
  --text: #eef6ff;
  --muted: #9db4c8;
  --glass: rgba(15, 23, 35, 0.55);
  --glass-strong: rgba(15, 23, 35, 0.78);
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  overflow: hidden;
  font-family: myfont, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: #070c14;
  -webkit-font-smoothing: antialiased;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  display: block;
  width: 20px;
  height: 20px;
}

.bg {
  position: fixed;
  inset: -12%;
  z-index: 0;
  background-image: url("assets/cover.webp");
  background-size: cover;
  background-position: center;
  filter: blur(70px) saturate(165%);
  transform: scale(1.18);
  opacity: 0.55;
  transition: background-image 0.7s ease, opacity 0.7s ease;
}

.bg-mask {
  position: fixed;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(73, 177, 245, 0.2), transparent 62%),
    radial-gradient(90% 70% at 90% 100%, rgba(57, 197, 187, 0.14), transparent 60%),
    linear-gradient(180deg, rgba(4, 9, 16, 0.55), rgba(4, 9, 16, 0.94));
}

.topbar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 34px;
}

.back-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.04);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.back-home:hover {
  color: var(--text);
  border-color: rgba(73, 177, 245, 0.5);
  transform: translateX(-2px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.6px;
  background: linear-gradient(90deg, #ffffff, #9fdcff 45%, #5ee7d5);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 14px rgba(73, 177, 245, 0.9);
}

.top-actions {
  display: flex;
  gap: 10px;
}

.ghost-btn,
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(73, 177, 245, 0.45);
  transform: translateY(-1px);
}

.primary-btn {
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04121d;
  font-weight: 700;
}

.primary-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.layout {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(360px, 1.15fr) minmax(340px, 0.85fr);
  gap: 26px;
  height: calc(100vh - 92px);
  min-height: 0;
  padding: 4px 34px 32px;
}

.glass {
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--glass);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(26px) saturate(160%);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
}

.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: clamp(14px, 3vh, 34px) clamp(18px, 3vw, 40px);
  overflow: hidden;
}

.stage::before {
  content: "";
  position: absolute;
  width: 460px;
  height: 460px;
  top: -220px;
  left: -160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(73, 177, 245, 0.2), transparent 65%);
  pointer-events: none;
}

.stage::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -180px;
  bottom: -220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(57, 197, 187, 0.16), transparent 66%);
  pointer-events: none;
}

.cover-wrap {
  position: relative;
  width: min(33vh, 320px);
  aspect-ratio: 1;
  margin-bottom: clamp(10px, 2.2vh, 26px);
  flex: 0 0 auto;
}

.cover-ring {
  position: absolute;
  inset: -18px;
  z-index: 0;
  border-radius: 38px;
  background: conic-gradient(
    from 0deg,
    rgba(73, 177, 245, 0),
    rgba(73, 177, 245, 0.65),
    rgba(57, 197, 187, 0.65),
    rgba(73, 177, 245, 0)
  );
  filter: blur(18px);
  opacity: 0.75;
  animation: spin 14s linear infinite;
}

.cover {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 26px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}

body.is-playing .cover {
  animation: float 6s ease-in-out infinite;
  box-shadow: 0 34px 70px rgba(0, 0, 0, 0.55), 0 0 40px rgba(73, 177, 245, 0.22);
}

.track-meta {
  position: relative;
  z-index: 1;
  width: 100%;
  text-align: center;
}

.now-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--accent-2);
  font-size: 12px;
  letter-spacing: 2px;
}

.eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.eq i {
  display: block;
  width: 3px;
  height: 5px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

body.is-playing .eq i {
  animation: eq 0.9s ease-in-out infinite;
}

body.is-playing .eq i:nth-child(2) {
  animation-delay: 0.15s;
}

body.is-playing .eq i:nth-child(3) {
  animation-delay: 0.3s;
}

.track-meta h1 {
  font-size: clamp(22px, 2.2vw, 32px);
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-meta p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: clamp(10px, 2.4vh, 26px);
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  outline: none;
  cursor: pointer;
  background: linear-gradient(
    90deg,
    var(--accent) 0%,
    var(--accent-2) var(--p, 0%),
    rgba(255, 255, 255, 0.16) var(--p, 0%)
  );
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(73, 177, 245, 0.3);
  transition: transform 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: none;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(73, 177, 245, 0.3);
}

.controls {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: clamp(8px, 2.2vh, 22px);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease,
    border-color 0.2s ease;
}

.icon-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.icon-btn.active {
  color: var(--accent-2);
  background: rgba(57, 197, 187, 0.12);
  border-color: rgba(57, 197, 187, 0.35);
}

.icon-btn.small {
  width: 34px;
  height: 34px;
}

.play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04121d;
  cursor: pointer;
  box-shadow: 0 16px 40px rgba(73, 177, 245, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.play-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 20px 46px rgba(73, 177, 245, 0.45);
}

.play-btn:active {
  transform: scale(0.97);
}

.play-btn .icon {
  width: 28px;
  height: 28px;
}

.bottom-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  margin-top: clamp(8px, 2.2vh, 22px);
}

.volume {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(200px, 46%);
}

.volume input {
  height: 4px;
}

.source-chip {
  padding: 6px 12px;
  border: 1px solid rgba(73, 177, 245, 0.28);
  border-radius: 999px;
  background: rgba(73, 177, 245, 0.1);
  color: #bfe8ff;
  font-size: 12px;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.source-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.queue {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 24px 20px 18px;
}

.queue-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 6px;
}

.queue-head h2 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.queue-badge {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 1.6px;
}

.queue-head > div:first-child {
  flex: 1;
  min-width: 0;
}

.queue-head-actions {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.queue-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 1px solid rgba(73, 177, 245, 0.32);
  border-radius: 999px;
  background: rgba(73, 177, 245, 0.1);
  color: #bfe8ff;
  font-family: inherit;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.queue-dl-btn .icon {
  width: 15px;
  height: 15px;
}

.queue-dl-btn:hover {
  background: rgba(73, 177, 245, 0.2);
  border-color: rgba(73, 177, 245, 0.6);
}

.queue-dl-btn.is-busy {
  border-color: rgba(57, 197, 187, 0.65);
  color: #8ff5e8;
}

.queue-dl-btn.is-busy .icon {
  animation: dl-pulse 1s ease-in-out infinite;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 4px 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.search-wrap:focus-within {
  border-color: rgba(73, 177, 245, 0.5);
  background: rgba(73, 177, 245, 0.06);
}

.search-wrap input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}

.search-wrap input::placeholder {
  color: rgba(157, 180, 200, 0.7);
}

.track-list {
  flex: 1;
  overflow-y: auto;
  padding: 2px 4px 8px;
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(73, 177, 245, 0.35) transparent;
}

.track-list::-webkit-scrollbar {
  width: 6px;
}

.track-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(73, 177, 245, 0.35);
}

.track-list::-webkit-scrollbar-track {
  background: transparent;
}

.track-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto 30px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.track-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.track-item.active {
  background: linear-gradient(90deg, rgba(73, 177, 245, 0.24), rgba(57, 197, 187, 0.1));
  box-shadow: inset 0 0 0 1px rgba(73, 177, 245, 0.32);
}

.track-index {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.track-item.active .track-index {
  color: var(--accent-2);
}

.track-text {
  min-width: 0;
}

.track-name {
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-artist {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-bars {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.track-item.active .track-bars {
  display: inline-flex;
}

.track-bars i {
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  animation: eq 0.9s ease-in-out infinite;
}

.track-bars i:nth-child(1) {
  height: 6px;
}

.track-bars i:nth-child(2) {
  height: 12px;
  animation-delay: 0.12s;
}

.track-bars i:nth-child(3) {
  height: 8px;
  animation-delay: 0.24s;
}

.track-dl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.track-dl .icon {
  width: 16px;
  height: 16px;
}

.track-item:hover .track-dl,
.track-item.active .track-dl,
.track-dl:focus-visible {
  opacity: 1;
}

.track-dl:hover {
  color: var(--accent);
  background: rgba(73, 177, 245, 0.14);
}

.track-dl:disabled {
  cursor: progress;
}

.track-dl.is-busy {
  opacity: 1;
  color: var(--accent-2);
}

.track-dl.is-busy .icon {
  animation: dl-pulse 1s ease-in-out infinite;
}

@media (hover: none) {
  .track-dl {
    opacity: 1;
  }
}

.queue-empty {
  padding: 30px 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(2, 6, 12, 0.62);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  position: relative;
  width: min(540px, 100%);
  padding: 30px;
  border-radius: 24px;
  background: var(--glass-strong);
  transform: translateY(14px) scale(0.98);
  transition: transform 0.22s ease;
}

.modal-backdrop.open .modal {
  transform: translateY(0) scale(1);
}

.modal h2 {
  font-size: 22px;
}

.modal-desc {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.modal input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
}

.modal input[type="text"]:focus {
  border-color: rgba(73, 177, 245, 0.55);
  box-shadow: 0 0 0 4px rgba(73, 177, 245, 0.12);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.modal-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.hint {
  margin-top: 18px;
  color: rgba(157, 180, 200, 0.7);
  font-size: 12px;
  line-height: 1.7;
}

.hint code {
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: #bfe8ff;
  font-family: Consolas, monospace;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 30;
  max-width: calc(100vw - 40px);
  padding: 12px 20px;
  border: 1px solid rgba(73, 177, 245, 0.35);
  border-radius: 999px;
  background: rgba(12, 20, 32, 0.92);
  color: var(--text);
  font-size: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, 14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

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

body.is-loading .queue-head h2::after {
  content: " · 加载中";
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 400;
}

body.is-loading .track-list {
  opacity: 0.45;
  pointer-events: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes dl-pulse {
  50% {
    opacity: 0.35;
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes eq {
  0%,
  100% {
    transform: scaleY(0.45);
  }
  50% {
    transform: scaleY(1);
  }
}

@media (max-height: 760px) {
  .topbar {
    padding: 12px 26px;
  }

  .layout {
    height: calc(100vh - 74px);
    padding-bottom: 18px;
  }

  .cover-wrap {
    width: min(28vh, 220px);
  }

  .track-meta h1 {
    font-size: clamp(18px, 1.8vw, 24px);
  }

  .track-meta p {
    margin-top: 4px;
    font-size: 13px;
  }

  .now-label {
    margin-bottom: 6px;
  }

  .play-btn {
    width: 58px;
    height: 58px;
  }

  .play-btn .icon {
    width: 24px;
    height: 24px;
  }

  .icon-btn {
    width: 38px;
    height: 38px;
  }

  .queue {
    padding: 18px 16px 14px;
  }
}

@media (max-width: 980px) {
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .topbar {
    padding: 16px 18px;
  }

  .brand {
    font-size: 17px;
  }

  .top-actions .ghost-btn span {
    display: none;
  }

  .top-actions .ghost-btn {
    width: 44px;
    height: 44px;
    padding: 0;
  }

  .layout {
    grid-template-columns: 1fr;
    height: auto;
    gap: 18px;
    padding: 0 18px 24px;
  }

  .stage {
    padding: 26px 22px;
  }

  .cover-wrap {
    width: min(56vw, 260px);
    margin-bottom: 22px;
  }

  .queue {
    max-height: 52vh;
  }

  .queue-head h2 {
    font-size: 18px;
  }

  .controls {
    gap: 12px;
  }

  .play-btn {
    width: 62px;
    height: 62px;
  }

  .bottom-row {
    flex-direction: column;
    gap: 12px;
  }

  .volume {
    width: 100%;
  }

  .source-chip {
    align-self: center;
  }
}

@media (max-width: 640px) {
  .topbar {
    gap: 10px;
    padding: 12px 14px;
  }

  .back-home {
    padding: 8px 12px;
    font-size: 13px;
  }

  .brand {
    gap: 7px;
    font-size: 15px;
    letter-spacing: 0;
  }

  .brand-dot {
    width: 8px;
    height: 8px;
  }

  .top-actions {
    gap: 8px;
  }

  .top-actions .ghost-btn {
    width: 38px;
    height: 38px;
  }

  .layout {
    padding: 0 12px 20px;
  }

  .stage {
    padding: 22px 16px 26px;
  }

  .glass {
    border-radius: 22px;
  }

  .play-btn {
    width: 58px;
    height: 58px;
  }

  .toast {
    bottom: 16px;
    font-size: 13px;
  }
}
