* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: #070a18;
  color: #f2f4ff;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* 动画画布：铺满全屏，永远在最底层，不拦截点击 */
#bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 18px 48px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.site-header { text-align: center; }

.site-header h1 {
  margin: 0;
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-shadow: 0 2px 24px rgba(120, 140, 255, .55);
}

.site-header h1 span { color: #8b9dff; }

.subtitle {
  margin: 6px 0 0;
  color: #b9c1e8;
  font-size: .92rem;
  letter-spacing: 1px;
}

.source-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.source-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.tab {
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .07);
  color: #dfe4ff;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: .86rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background .2s, border-color .2s, transform .15s;
}

.tab:hover { background: rgba(255, 255, 255, .14); transform: translateY(-1px); }

.tab.active {
  background: linear-gradient(135deg, #6d7cff, #a855f7);
  border-color: transparent;
  color: #fff;
  font-weight: 700;
}

.search-form { display: flex; gap: 8px; }

.search-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: .95rem;
  outline: none;
  backdrop-filter: blur(8px);
}

.search-form input::placeholder { color: #9aa3cc; }
.search-form input:focus { border-color: #8b9dff; }

.search-form button {
  border: none;
  border-radius: 12px;
  padding: 0 20px;
  background: linear-gradient(135deg, #6d7cff, #a855f7);
  color: #fff;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
}

.random-btn {
  border: none;
  border-radius: 16px;
  padding: 16px 20px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #fff;
  background: linear-gradient(135deg, #ff6b9d, #a855f7 55%, #6d7cff);
  background-size: 180% 180%;
  cursor: pointer;
  box-shadow: 0 10px 34px rgba(168, 85, 247, .45);
  animation: gradientShift 6s ease infinite;
  transition: transform .15s, box-shadow .2s;
}

.random-btn:hover { transform: translateY(-2px) scale(1.01); box-shadow: 0 14px 40px rgba(168, 85, 247, .55); }
.random-btn:active { transform: scale(.98); }

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.player-card, .queue-card {
  background: rgba(18, 22, 46, .62);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 22px;
  padding: 22px;
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
}

.cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 340px;
  margin: 0 auto 16px;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(135deg, #2a2f5e, #4c2a72);
  box-shadow: 0 12px 36px rgba(0, 0, 0, .5);
}

.cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  opacity: .85;
}

.track-info { text-align: center; }

.track-info h2 {
  margin: 0 0 6px;
  font-size: 1.3rem;
  line-height: 1.35;
  word-break: break-word;
}

.track-info p { margin: 4px 0; color: #c6cdea; font-size: .95rem; }

.track-info .meta {
  font-size: .8rem;
  color: #8f97c2;
  word-break: break-word;
}

.seek-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 6px;
  font-size: .82rem;
  color: #b9c1e8;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .22);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #8b9dff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .5);
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #8b9dff;
}

#seek { flex: 1; }

.buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 12px 0 4px;
}

.ctrl-btn {
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .08);
  color: #eef1ff;
  border-radius: 999px;
  padding: 11px 18px;
  font-size: .95rem;
  cursor: pointer;
  transition: background .2s, transform .15s;
}

.ctrl-btn:hover { background: rgba(255, 255, 255, .16); transform: translateY(-1px); }

.ctrl-btn.play {
  background: linear-gradient(135deg, #6d7cff, #a855f7);
  border: none;
  font-size: 1.05rem;
  font-weight: 800;
  padding: 13px 26px;
  box-shadow: 0 8px 24px rgba(109, 124, 255, .45);
}

.volume-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.volume-row input { flex: 1; }

.status {
  min-height: 1.3em;
  margin: 12px 0 0;
  text-align: center;
  font-size: .88rem;
  color: #aab3dd;
}

.queue-card h3 {
  margin: 0 0 10px;
  font-size: 1.02rem;
  letter-spacing: 1px;
}

.queue-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.queue-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
}

.queue-list li:hover { background: rgba(255, 255, 255, .08); }

.queue-list .q-num {
  color: #8b9dff;
  font-size: .85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.queue-list .q-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .93rem;
}

.queue-list .q-artist {
  color: #9aa3cc;
  font-size: .82rem;
  max-width: 42%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}

.queue-empty {
  margin: 4px 0 0;
  color: #8f97c2;
  font-size: .88rem;
}

.site-footer {
  text-align: center;
  color: #7d86b3;
  font-size: .8rem;
  line-height: 1.7;
}

@media (max-width: 480px) {
  .app { padding: 20px 14px 36px; }
  .site-header h1 { font-size: 1.7rem; }
  .random-btn { font-size: 1.1rem; padding: 14px 16px; }
  .player-card, .queue-card { padding: 16px; }
  .buttons { gap: 8px; }
  .ctrl-btn { padding: 10px 13px; font-size: .88rem; }
  .ctrl-btn.play { padding: 12px 20px; }
}
