:root {
  --bg: #f0f9ff;
  --bg-gradient: linear-gradient(135deg, #bae6fd 0%, #e0f2fe 30%, #dcfce7 65%, #fef9c3 100%);
  --panel: rgba(255, 255, 255, 0.72);
  --panel-border: rgba(56, 189, 248, 0.28);
  --text: #0c4a6e;
  --text-dim: rgba(12, 74, 110, 0.55);
  --accent: #38bdf8;
  --accent-deep: #0284c7;
  --accent-2: #4ade80;
  --accent-3: #facc15;
  --radius: 18px;
  --shadow: 0 20px 50px rgba(14, 116, 144, 0.15);
}

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

html,
body {
  height: 100%;
}

body {
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  background-image: var(--bg-gradient);
  overflow: hidden;
}

.app {
  position: relative;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px;
  gap: 22px;
}

/* 背景模糊层 */
.bg-blur {
  position: fixed;
  inset: -60px;
  z-index: -1;
  background-size: cover;
  background-position: center;
  filter: blur(60px) brightness(1.1) saturate(1.2);
  transform: scale(1.2);
  transition: background-image 0.8s ease;
}
.bg-blur::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(186, 230, 253, 0.8),
    rgba(220, 252, 231, 0.75),
    rgba(254, 249, 195, 0.8)
  );
}

/* 主体布局 */
.player {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  min-height: 0;
}

/* 左侧 */
.left-pane {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
}

.cover-wrap {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1;
}
.cover {
  width: 100%;
  height: 100%;
  border-radius: 20px;
  background-size: cover;
  background-position: center;
  background-color: #e0f2fe;
  background-image: linear-gradient(135deg, #e0f2fe, #dcfce7 60%, #fef9c3);
  box-shadow: 0 16px 40px rgba(2, 132, 199, 0.22);
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: transform 0.4s ease;
}
.cover.spinning {
  animation: spin 18s linear infinite;
  border-radius: 50%;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.cover-placeholder {
  font-size: 72px;
  color: var(--accent);
}

.track-info {
  text-align: center;
}
.title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.artist {
  font-size: 14px;
  color: var(--text-dim);
}

/* 进度条 */
.progress {
  width: 100%;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.time {
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  min-width: 40px;
  text-align: center;
}
.progress-bar {
  position: relative;
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: rgba(56, 189, 248, 0.15);
  cursor: pointer;
}
.progress-buffered {
  position: absolute;
  height: 100%;
  border-radius: 3px;
  background: rgba(56, 189, 248, 0.25);
  width: 0;
}
.progress-played {
  position: absolute;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  width: 0;
}
.progress-handle {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent-3);
  transform: translate(-50%, -50%);
  left: 0;
  opacity: 0;
  transition: opacity 0.2s;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}
.progress-bar:hover .progress-handle {
  opacity: 1;
}

/* 控制按钮 */
.controls {
  display: flex;
  align-items: center;
  gap: 16px;
}
.btn {
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 20px;
  display: grid;
  place-items: center;
  transition: transform 0.15s ease, background 0.2s ease, opacity 0.2s;
}
.btn:hover {
  transform: scale(1.12);
}
.btn:active {
  transform: scale(0.95);
}
.btn.icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}
.btn.icon:hover {
  background: rgba(56, 189, 248, 0.15);
}
.btn.play {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: 24px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.45);
}
.volume {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 6px;
}
.volume input[type="range"] {
  width: 80px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* 右侧歌词 */
.right-pane {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}
.lyrics-wrap {
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 18%,
    #000 82%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 18%,
    #000 82%,
    transparent 100%
  );
}
.lyrics-wrap::-webkit-scrollbar {
  display: none;
}
.lyrics {
  padding: 50% 32px;
  text-align: center;
}
.lyric-line {
  font-size: 18px;
  line-height: 1.5;
  padding: 12px 0;
  color: var(--text-dim);
  transition: all 0.35s ease;
  cursor: pointer;
}
.lyric-line.placeholder {
  cursor: default;
}
.lyric-line.active {
  color: var(--accent-deep);
  font-size: 24px;
  font-weight: 700;
  transform: scale(1.02);
  text-shadow: 0 0 18px rgba(250, 204, 21, 0.6);
}

/* 底部播放列表 */
.bottom {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  padding: 18px 22px;
  max-height: 30vh;
  display: flex;
  flex-direction: column;
}
.playlist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.playlist-head h2 {
  font-size: 15px;
  font-weight: 600;
}
.import {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.btn.small {
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid var(--panel-border);
}
.btn.small:hover {
  background: rgba(74, 222, 128, 0.22);
}
.btn.small.is-hidden {
  display: none;
}
.playlist {
  list-style: none;
  overflow-y: auto;
  flex: 1;
}
.playlist::-webkit-scrollbar {
  width: 6px;
}
.playlist::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.35);
  border-radius: 3px;
}
.playlist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}
.playlist-item:hover {
  background: rgba(56, 189, 248, 0.1);
}
.playlist-item.active {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.22), rgba(250, 204, 21, 0.18));
}
.playlist-item .idx {
  width: 22px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.playlist-item.active .idx {
  color: #16a34a;
  font-weight: 700;
}
.playlist-item .meta {
  flex: 1;
  min-width: 0;
}
.playlist-item .meta .name {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.playlist-item .meta .sub {
  font-size: 12px;
  color: var(--text-dim);
}
.playlist-item .dur {
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

/* 播放列表空态 */
.playlist-empty {
  padding: 20px 12px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-dim);
  text-align: center;
}

/* 拖放导入遮罩 */
.drop-hint {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  border: 3px dashed var(--accent);
  background: rgba(224, 242, 254, 0.78);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, visibility 0.18s;
}
.drop-hint.show {
  opacity: 1;
  visibility: visible;
}
.drop-hint-inner {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-deep);
  text-align: center;
  line-height: 1.9;
}
.drop-hint-inner span {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
}

/* 提示条 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 40;
  max-width: min(560px, 88vw);
  padding: 12px 18px;
  border-radius: 12px;
  background: rgba(12, 74, 110, 0.92);
  color: #f0f9ff;
  font-size: 13px;
  line-height: 1.7;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}
.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* 响应式 */
@media (max-width: 820px) {
  .app {
    padding: 16px;
    gap: 16px;
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
  }
  .player {
    grid-template-columns: 1fr;
  }
  .right-pane {
    min-height: 280px;
  }
}
