/* ========== 基础重置 ========== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: #0d0f14;
  color: #e9ecf2;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
:root {
  --bg: #0d0f14;
  --card: rgba(255,255,255,0.055);
  --card-solid: #191d26;
  --line: rgba(255,255,255,0.09);
  --text: #e9ecf2;
  --text-dim: #8b95a8;
  --text-dimmer: #5d6779;
  --accent: #ff5c5c;
  --accent-2: #ff8a4c;
  --radius: 16px;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px calc(40px + env(safe-area-inset-bottom));
}

/* ========== 顶部 ========== */
.hero { position: relative; padding: 36px 0 20px; }
.hero-bg {
  position: absolute; inset: -80px -50vw 0;
  background:
    radial-gradient(60% 60% at 25% 0%, rgba(255,92,92,0.22), transparent 70%),
    radial-gradient(50% 50% at 85% 10%, rgba(120,90,255,0.20), transparent 70%);
  pointer-events: none; z-index: 0;
}
.hero-inner {
  position: relative; z-index: 1;
  display: flex; gap: 16px; align-items: center;
}
.cover-wrap { position: relative; flex: 0 0 auto; }
.cover {
  width: 92px; height: 92px; border-radius: 14px;
  object-fit: cover; display: block;
  box-shadow: 0 8px 28px rgba(0,0,0,0.55);
  background: #222733;
}
.cover-fallback {
  position: absolute; inset: 0; display: none;
  align-items: center; justify-content: center;
  font-size: 36px; color: #4d566b;
  background: linear-gradient(140deg, #262c3a, #1a1f2a);
}
.cover-wrap.no-cover .cover-fallback { display: flex; }

.hero-text { min-width: 0; flex: 1; }
.hero-text h1 {
  margin: 0 0 6px; font-size: 21px; font-weight: 600;
  letter-spacing: -0.01em; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.subtitle {
  margin: 0 0 6px; font-size: 13px; color: var(--text-dim); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.meta { margin: 0; font-size: 12px; color: var(--text-dimmer); }

/* ========== 播放器卡片 ========== */
.player-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 14px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 10px 40px rgba(0,0,0,0.35);
}
.now-playing-label {
  font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--text-dimmer); margin-bottom: 6px;
}
.now-title {
  font-size: 16px; font-weight: 600; line-height: 1.4; margin-bottom: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text);
}
.now-title.empty { color: var(--text-dimmer); font-weight: 400; }

/* 进度条 */
.progress-area { margin-bottom: 8px; }
.progress-row { display: flex; align-items: center; gap: 10px; }
.time {
  font-size: 11px; color: var(--text-dim);
  font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
  flex: 0 0 auto; min-width: 38px; text-align: center;
}
.progress-bar {
  flex: 1; padding: 10px 0; cursor: pointer;
  touch-action: none; -webkit-tap-highlight-color: transparent;
}
.progress-track {
  position: relative; height: 4px; border-radius: 4px;
  background: rgba(255,255,255,0.13); overflow: visible;
  transition: height 0.15s ease;
}
.progress-bar:hover .progress-track,
.progress-bar.dragging .progress-track { height: 6px; }
.progress-buffer {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: rgba(255,255,255,0.16); border-radius: 4px;
}
.progress-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 4px;
}
.progress-thumb {
  position: absolute; right: -6px; top: 50%;
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; transform: translateY(-50%) scale(0);
  box-shadow: 0 1px 6px rgba(0,0,0,0.5);
  transition: transform 0.15s ease;
}
.progress-bar:hover .progress-thumb,
.progress-bar.dragging .progress-thumb { transform: translateY(-50%) scale(1); }

/* 控制按钮 */
.controls {
  display: flex; align-items: center; justify-content: space-between;
  gap: 4px; margin-top: 2px;
}
.btn-icon {
  background: none; border: none; padding: 0; cursor: pointer;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); transition: color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-icon:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.btn-icon:active { transform: scale(0.94); }
.ico { width: 24px; height: 24px; fill: currentColor; display: block; }

.btn-play {
  width: 58px; height: 58px; border-radius: 50%; border: none;
  cursor: pointer; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 6px 22px rgba(255,92,92,0.38);
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-play .ico { width: 28px; height: 28px; }
.btn-play:hover { box-shadow: 0 8px 28px rgba(255,92,92,0.5); }
.btn-play:active { transform: scale(0.94); }
.btn-play.loading { pointer-events: none; opacity: 0.75; }

.btn-text {
  width: auto; min-width: 44px; padding: 0 10px;
  font-size: 12px; font-weight: 600; font-family: inherit;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.btn-text:hover { color: var(--text); }
.btn-text.active { color: var(--accent); }

/* 音量区 */
.controls-sub {
  display: flex; align-items: center; gap: 10px;
  margin-top: 6px;
}
.volume-box { display: flex; align-items: center; gap: 6px; flex: 1; }
.btn-icon.small { width: 32px; height: 32px; }
.btn-icon.small .ico { width: 18px; height: 18px; }

input[type="range"].vol-range {
  -webkit-appearance: none; appearance: none;
  flex: 1; max-width: 130px; height: 4px; border-radius: 4px;
  background: rgba(255,255,255,0.15);
  outline: none; cursor: pointer;
}
input[type="range"].vol-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
input[type="range"].vol-range::-moz-range-thumb {
  width: 12px; height: 12px; border: none; border-radius: 50%;
  background: #fff; cursor: pointer;
}

/* ========== 列表 ========== */
.list-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin: 22px 2px 10px;
}
.list-title {
  font-size: 13px; font-weight: 600; color: var(--text-dim);
  letter-spacing: 0.02em; flex: 0 0 auto;
}
.count {
  font-weight: 400; color: var(--text-dimmer);
  font-variant-numeric: tabular-nums;
}
.list-actions { display: flex; align-items: center; gap: 8px; flex: 1; justify-content: flex-end; }
.search {
  width: 100%; max-width: 170px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  border-radius: 9px; padding: 7px 10px;
  color: var(--text); font-size: 12px; font-family: inherit;
  outline: none; transition: border-color 0.15s, background 0.15s;
}
.search::placeholder { color: var(--text-dimmer); }
.search:focus { border-color: rgba(255,92,92,0.5); background: rgba(255,255,255,0.09); }

/* 专辑切换 */
.album-bar[hidden] { display: none !important; }
.album-bar {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 2px 2px 12px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.album-bar::-webkit-scrollbar { display: none; }
.album-chip {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  color: var(--text-dim); font-size: 13px; font-family: inherit;
  cursor: pointer; white-space: nowrap;
  transition: all 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}
.album-chip:hover { background: rgba(255,255,255,0.1); color: var(--text); }
.album-chip.on {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent; color: #fff; font-weight: 500;
  box-shadow: 0 4px 14px rgba(255,92,92,0.3);
}
.chip-n {
  font-size: 11px; opacity: 0.65;
  font-variant-numeric: tabular-nums;
}

.list {
  list-style: none; margin: 0; padding: 0;
  border-radius: var(--radius); overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
}
.list.collapsed { display: none; }

.track {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px; cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.045);
  transition: background 0.13s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.track:last-child { border-bottom: none; }
.track:hover { background: rgba(255,255,255,0.045); }
.track.active { background: rgba(255,92,92,0.09); }

.track-idx {
  flex: 0 0 26px; text-align: center;
  font-size: 12px; color: var(--text-dimmer);
  font-variant-numeric: tabular-nums;
}
.track.active .track-idx { color: var(--accent); }

/* 播放中的跳动条 */
.bars { display: flex; align-items: flex-end; gap: 2px; height: 14px; justify-content: center; }
.bars span {
  width: 2px; background: var(--accent); border-radius: 1px;
  animation: bar 0.9s ease-in-out infinite;
}
.bars span:nth-child(1) { height: 5px;  animation-delay: 0s; }
.bars span:nth-child(2) { height: 12px; animation-delay: 0.18s; }
.bars span:nth-child(3) { height: 8px;  animation-delay: 0.36s; }
@keyframes bar {
  0%, 100% { transform: scaleY(0.45); }
  50%      { transform: scaleY(1); }
}
.track.paused .bars span { animation-play-state: paused; }

.track-main { flex: 1; min-width: 0; }
.track-name {
  font-size: 14px; line-height: 1.4; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.track.active .track-name { color: var(--accent); font-weight: 500; }
.track-dur {
  font-size: 11px; color: var(--text-dimmer);
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}

.empty-hint {
  padding: 40px 16px; text-align: center;
  color: var(--text-dimmer); font-size: 13px; line-height: 1.8;
}

.list-more {
  text-align: center; padding: 14px 0 0;
}

/* ========== 底部 ========== */
.foot {
  text-align: center; margin-top: 26px;
  font-size: 11px; color: var(--text-dimmer); line-height: 1.7;
}
.foot p { margin: 0; }

/* ========== 微信提示层 ========== */
/* 注意：必须用 .wx-tip[hidden] 覆盖，否则 display:flex 会让 hidden 失效、
   导致透明遮罩拦截页面所有点击 */
.wx-tip[hidden] { display: none !important; }
.wx-tip {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,0.82);
  display: flex; align-items: flex-start; justify-content: flex-end;
  padding: 12px 22px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.wx-tip-inner {
  background: #fff; color: #1a1a1a;
  border-radius: 14px; padding: 16px 20px;
  max-width: 280px; margin-top: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  text-align: left;
}
.wx-arrow {
  font-size: 26px; color: #07c160; line-height: 1;
  margin-bottom: 6px; text-align: right;
}
.wx-tip-inner p { margin: 0 0 6px; font-size: 14px; line-height: 1.55; }
.wx-tip-sub { font-size: 12px !important; color: #666; }
.wx-close {
  margin-top: 8px; width: 100%; padding: 9px 0;
  border-radius: 8px; background: #f2f2f2;
  color: #333 !important; font-size: 13px !important;
}

/* ========== 移动端适配 ========== */
@media (max-width: 420px) {
  .app { padding: 0 12px calc(32px + env(safe-area-inset-bottom)); }
  .hero { padding: 24px 0 16px; }
  .cover { width: 76px; height: 76px; border-radius: 12px; }
  .hero-text h1 { font-size: 18px; }
  .controls { gap: 0; }
  .btn-icon { width: 40px; height: 40px; }
  .btn-play { width: 54px; height: 54px; }
  .time { min-width: 34px; font-size: 10px; }
  .track { padding: 12px 12px; gap: 10px; }
  .track-name { font-size: 13.5px; }
  input[type="range"].vol-range { max-width: 100px; }
}

@media (prefers-reduced-motion: reduce) {
  .bars span { animation: none; height: 8px; }
  * { transition-duration: 0.01ms !important; }
}
