:root {
  /* ===== 网易云风格：经典红 + 简洁浅色 ===== */
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.92);
  --glass-border: rgba(255, 255, 255, 0.95);
  --text: #1b1b2a;
  --text-dim: rgba(27, 27, 42, 0.6);
  --text-faint: rgba(27, 27, 42, 0.4);
  --accent: #ec4141;            /* 网易云红 */
  --accent2: #ff6a3d;           /* 暖红渐变 */
  --accent3: #2f9bff;
  --radius: 18px;
  --blur: 24px;
  --sidebar-w: 232px;
  --player-h: 92px;
  --shadow: 0 10px 36px rgba(120, 60, 60, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* ===== 夜间配色（可切换，仍保留红色调） ===== */
body.dark {
  --glass: rgba(30, 30, 46, 0.55);
  --glass-strong: rgba(40, 40, 60, 0.7);
  --glass-border: rgba(255, 255, 255, 0.12);
  --text: #f5f6fa;
  --text-dim: rgba(245, 246, 250, 0.62);
  --text-faint: rgba(245, 246, 250, 0.38);
  --accent: #ec4141;
  --accent2: #ff6a3d;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC",
    "Helvetica Neue", "Microsoft YaHei", Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #fef6f4 0%, #f7f3fb 48%, #eef4ff 100%);
  overflow: hidden;
  letter-spacing: 0.2px;
  transition: background 0.5s ease, color 0.3s ease;
}
body.dark {
  background: #07060d;
}

/* ---------- 动态背景 ---------- */
.bg {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background: linear-gradient(135deg, #fef6f4 0%, #f7f3fb 48%, #eef4ff 100%);
}
body.dark .bg { background: #07060d; }
/* 用户上传的自定义背景：垫在最底层，毛玻璃面板仍会把它模糊掉 */
.bg-custom {
  position: absolute; inset: 0;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  opacity: 0; transition: opacity 0.45s ease;
}
body.has-bg .bg-custom { opacity: 1; }
/* 有自定义背景时压暗彩色光斑，让照片成为主角（毛玻璃效果保留） */
body.has-bg .blob { opacity: 0.22; }
/* 有自定义背景时，把全屏模糊层调轻、蒙版调淡，让照片清晰透出（玻璃面板仍保留毛玻璃） */
body.has-bg .bg-cover {
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  background: radial-gradient(125% 125% at 50% 0%, transparent 55%, rgba(255,255,255,0.10) 100%);
  transition: background-image 0.8s ease, backdrop-filter 0.4s ease;
}
body.dark.has-bg .bg-cover { background: radial-gradient(125% 125% at 50% 0%, transparent 55%, rgba(0,0,0,0.20) 100%); }
/* 已上传自定义背景时，把同一张图直接画进全屏歌词页 / 沉浸式歌词页（用 CSS 变量）。
   白模式：背景图保留，用中等暗色蒙版压住让白字读得清（不像暗模式压那么狠，图的色彩还在，不会"全黑"），
   歌名/歌手/歌词统一白色；暗模式：更重压暗 + 白字 */
body.has-bg .now-playing,
body.has-bg .immersive {
  background: transparent;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
body.has-bg .now-playing::after,
body.has-bg .immersive::after {
  content: ""; position: absolute; inset: -60px; z-index: -2;
  background-image: var(--custom-bg);
  background-size: cover; background-position: center; background-repeat: no-repeat;
  background-color: rgba(0, 0, 0, 0.42);
  filter: blur(26px) brightness(0.82) saturate(1.1);
}
/* 白模式：歌词 / 歌名 / 歌手 / 标签 全部变白，保证在压暗的背景图上清晰可读 */
body.has-bg .np-line { color: rgba(255, 255, 255, 0.62); }
body.has-bg .np-line.active { color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5); }
body.has-bg .im-line { color: rgba(255, 255, 255, 0.6); }
body.has-bg .np-title { color: #fff; }
body.has-bg .np-artist { color: rgba(255, 255, 255, 0.82); }
body.has-bg .np-tag { color: var(--accent); }
body.has-bg .np-ctrl { color: #fff; background: rgba(255, 255, 255, 0.14); }
body.has-bg .np-ctrl:hover { background: rgba(255, 255, 255, 0.24); }
body.has-bg .np-ctrl.active { color: var(--accent); }
body.has-bg .im-title { color: #fff; }
body.has-bg .im-artist { color: rgba(255, 255, 255, 0.82); }
/* 暗模式：更重压暗 + 白字（与白模式同款白字，背景压得更深） */
body.dark.has-bg .now-playing::after,
body.dark.has-bg .immersive::after {
  background-color: rgba(10, 9, 18, 0.5);
  filter: blur(26px) brightness(0.5) saturate(1.15);
}
body.dark.has-bg .np-line { color: rgba(255, 255, 255, 0.62); }
body.dark.has-bg .np-line.active { color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45); }
body.dark.has-bg .im-line { color: rgba(255, 255, 255, 0.6); }
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: float 22s ease-in-out infinite;
}
.b1 { width: 46vw; height: 46vw; background: #ff9a9e; top: -10vw; left: -8vw; }
.b2 { width: 40vw; height: 40vw; background: #ffb88c; bottom: -12vw; right: -6vw; animation-delay: -6s; }
.b3 { width: 34vw; height: 34vw; background: #a18cd1; top: 28vh; left: 38vw; animation-delay: -12s; opacity: 0.45; }
.b4 { width: 30vw; height: 30vw; background: #8fd3f4; bottom: 8vh; left: 6vw; animation-delay: -3s; opacity: 0.45; }
body.dark .b1 { background: #ff5e8a; }
body.dark .b2 { background: #7c5cff; }
body.dark .b3 { background: #2dd4ff; }
body.dark .b4 { background: #ffb347; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(6vw, 4vh) scale(1.12); }
  66% { transform: translate(-4vw, -3vh) scale(0.94); }
}
.bg-cover {
  position: absolute; inset: 0;
  background: radial-gradient(120% 120% at 50% 0%, transparent 40%, rgba(255,255,255,0.25) 100%);
  backdrop-filter: blur(40px);
  transition: background-image 0.8s ease;
}
body.dark .bg-cover { background: radial-gradient(120% 120% at 50% 0%, transparent 40%, rgba(7,6,13,0.55) 100%), rgba(7,6,13,0.35); }

/* ---------- 布局 ---------- */
#app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: minmax(0, 1fr) var(--player-h);
  grid-template-areas: "side main" "player player";
  height: 100vh;
  height: 100dvh;
  gap: 14px;
  padding: 14px;
}

.glass {
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}

/* ---------- 侧边栏 ---------- */
.sidebar {
  grid-area: side;
  min-height: 0;
  overflow: hidden;
  border-radius: var(--radius);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; }
.logo {
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center; font-size: 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 6px 18px rgba(123, 92, 255, 0.4);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.brand-sub { font-size: 11px; color: var(--text-faint); letter-spacing: 2px; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; flex: 1; padding-right: 2px; }
.nav::-webkit-scrollbar { width: 0; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 14px; cursor: pointer;
  color: var(--text-dim); font-size: 14.5px; font-weight: 600;
  transition: all 0.22s ease; border: 1px solid transparent;
}
.nav-item .ico { font-size: 18px; width: 22px; text-align: center; }
.nav-item:hover { background: var(--glass); color: var(--text); transform: translateX(2px); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(255,59,107,0.18), rgba(123,92,255,0.18));
  color: var(--text); border-color: rgba(123,92,255,0.3);
  box-shadow: 0 4px 16px rgba(123,92,255,0.18);
}

.sidebar-foot { font-size: 12px; color: var(--text-faint); padding: 10px 8px 2px; display: flex; flex-direction: column; gap: 3px; }
.sidebar-foot span { color: var(--text-dim); font-weight: 600; }

/* ---------- 主区域 ---------- */
.main {
  grid-area: main;
  min-height: 0;
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  overflow: hidden; position: relative;
  background: var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
  border: 1px solid var(--glass-border);
}

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px; border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 1px solid var(--glass-border);
}
.back-btn {
  width: 38px; height: 38px; border-radius: 12px; border: none; cursor: pointer;
  background: var(--glass); color: var(--text); font-size: 24px; line-height: 1;
  display: none; place-items: center; transition: 0.2s;
}
.back-btn.show { display: grid; }
.back-btn:hover { background: var(--glass-strong); }

.search-wrap {
  flex: 1; display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.6); border: 1px solid var(--glass-border);
  border-radius: 16px; padding: 0 16px; height: 46px;
  transition: 0.25s;
}
body.dark .search-wrap { background: rgba(0,0,0,0.25); }
.search-wrap:focus-within { border-color: rgba(255,59,107,0.55); box-shadow: 0 0 0 4px rgba(255,59,107,0.12); }
.search-ico { opacity: 0.6; }
#searchInput {
  flex: 1; background: none; border: none; outline: none; color: var(--text);
  font-size: 15px;
}
#searchInput::placeholder { color: var(--text-faint); }
.search-clear { display: none; background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 14px; }
.search-clear.show { display: block; }

.now-btn, .ctrl {
  background: var(--glass); border: 1px solid var(--glass-border); color: var(--text);
  border-radius: 12px; cursor: pointer; transition: 0.2s; display: grid; place-items: center; font-size: 16px;
}
.now-btn { width: 46px; height: 46px; }
.now-btn:hover, .ctrl:hover { background: var(--glass-strong); transform: translateY(-1px); }

/* ---------- SVG 图标统一尺寸（替换原 emoji） ---------- */
.search-ico svg, .logo svg, .now-btn svg, .show-bar-fab svg, .card-play svg, .empty .big svg { display: block; }
.ctrl svg, .np-ctrl svg { display: block; width: 22px; height: 22px; }
.ctrl.play svg, .np-ctrl.play svg { width: 26px; height: 26px; }
.search-ico svg { width: 18px; height: 18px; }
.logo svg { width: 26px; height: 26px; }
.now-btn svg { width: 22px; height: 22px; }
.show-bar-fab svg { width: 22px; height: 22px; }
.card-play svg { width: 18px; height: 18px; }
.empty .big svg { width: 48px; height: 48px; opacity: 0.4; }

.content { flex: 1; overflow-y: auto; padding: 26px 28px 30px; scroll-behavior: smooth; }
.content::-webkit-scrollbar { width: 8px; }
.content::-webkit-scrollbar-thumb { background: rgba(123,92,255,0.25); border-radius: 8px; }

/* ---------- 标题与区块 ---------- */
.section-title { font-size: 22px; font-weight: 800; margin: 6px 0 16px; display: flex; align-items: center; gap: 10px; }
.section-title .sub { font-size: 13px; font-weight: 500; color: var(--text-faint); }

/* Hero */
.hero {
  border-radius: 24px; overflow: hidden; position: relative; margin-bottom: 30px;
  min-height: 200px; display: flex; align-items: flex-end; padding: 28px;
  border: 1px solid var(--glass-border);
  background: linear-gradient(135deg, rgba(255,59,107,0.18), rgba(123,92,255,0.18));
}
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.5; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, rgba(123,92,255,0.35), rgba(255,59,107,0.2)), rgba(255,255,255,0.15); }
.hero-body { position: relative; z-index: 1; }
.hero-tag { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-dim); font-weight: 700; }
.hero-title { font-size: 34px; font-weight: 800; margin: 6px 0 10px; color: var(--text); }
.hero-desc { max-width: 520px; color: var(--text-dim); font-size: 14px; line-height: 1.6; }
.hero-btn {
  margin-top: 14px; padding: 11px 26px; border-radius: 30px; border: none; cursor: pointer;
  font-size: 15px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 8px 22px rgba(123,92,255,0.4); transition: 0.2s;
}
.hero-btn:hover { transform: scale(1.04); }

/* 快捷分区 chips */
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
.chip {
  padding: 9px 16px; border-radius: 30px; cursor: pointer; font-size: 13.5px; font-weight: 700;
  background: var(--glass); border: 1px solid var(--glass-border); color: var(--text-dim);
  transition: 0.2s; display: flex; align-items: center; gap: 6px;
}
.chip:hover { color: var(--text); background: var(--glass-strong); transform: translateY(-2px); }
.chip.active { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; border-color: transparent; }

/* 网格 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 18px; }
.card {
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: 18px;
  overflow: hidden; cursor: pointer; transition: 0.25s; position: relative;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 16px 36px rgba(80,80,160,0.22); border-color: rgba(123,92,255,0.35); }
.card-cover { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: rgba(123,92,255,0.08); }
.card-body { padding: 11px 13px 14px; }
.card-name { font-size: 14px; font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-info { font-size: 11.5px; color: var(--text-faint); margin-top: 6px; display: flex; gap: 8px; align-items: center; }
.card-play {
  position: absolute; right: 12px; bottom: 56px; width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; border: none;
  font-size: 18px; cursor: pointer; display: grid; place-items: center;
  opacity: 0; transform: translateY(8px) scale(0.9); transition: 0.25s; box-shadow: 0 6px 18px rgba(123,92,255,0.45);
}
.card:hover .card-play { opacity: 1; transform: translateY(0) scale(1); }

/* 歌单详情 */
.pl-head { display: flex; gap: 24px; margin-bottom: 26px; align-items: flex-end; }
.pl-cover { width: 190px; height: 190px; border-radius: 20px; object-fit: cover; box-shadow: 0 14px 40px rgba(80,80,160,0.25); border: 1px solid var(--glass-border); }
.pl-meta { flex: 1; min-width: 0; }
.pl-title { font-size: 30px; font-weight: 800; margin-bottom: 10px; word-break: break-word; }
.pl-desc { font-size: 13.5px; color: var(--text-dim); line-height: 1.6; margin-bottom: 16px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pl-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.btn-primary { padding: 12px 30px; border-radius: 30px; border: none; cursor: pointer; font-size: 15px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 8px 22px rgba(123,92,255,0.4); transition: 0.2s; }
.btn-primary:hover { transform: scale(1.04); }
.btn-ghost { padding: 12px 22px; border-radius: 30px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text); background: var(--glass); border: 1px solid var(--glass-border); transition: 0.2s; }
.btn-ghost:hover { background: var(--glass-strong); }

/* 曲目列表 */
.track-list { display: flex; flex-direction: column; gap: 2px; }
.track {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 14px;
  padding: 10px 14px; border-radius: 14px; cursor: pointer; transition: 0.18s; border: 1px solid transparent;
}
.track:hover { background: var(--glass); border-color: var(--glass-border); }
.track.playing { background: linear-gradient(135deg, rgba(255,59,107,0.14), rgba(123,92,255,0.14)); }
.track-idx { color: var(--text-faint); font-size: 14px; text-align: center; }
.track.playing .track-idx { color: var(--accent); font-weight: 700; }
.track-main { min-width: 0; display: flex; align-items: center; gap: 10px; }
.track-name { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track.playing .track-name { color: var(--accent); }
.track-sub { font-size: 12px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.track-dur { font-size: 12.5px; color: var(--text-faint); }
.track-vip { font-size: 10px; color: #b8860b; border: 1px solid rgba(184,134,11,0.4); border-radius: 4px; padding: 1px 4px; }

/* 搜索结果 */
.result-head { font-size: 16px; color: var(--text-dim); margin: 4px 0 14px; }
.result-head b { color: var(--text); }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tab { padding: 8px 18px; border-radius: 20px; cursor: pointer; font-size: 14px; font-weight: 700; color: var(--text-dim); background: var(--glass); border: 1px solid var(--glass-border); transition: 0.2s; }
.tab.active { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; border-color: transparent; }

/* 加载 / 空 */
.loader { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 70px 20px; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid rgba(123,92,255,0.2); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
body.dark .spinner { border-color: rgba(255,255,255,0.18); border-top-color: var(--accent); }
.loading-text { font-size: 14px; color: var(--text-dim); font-weight: 600; letter-spacing: 1px; }
.dots { margin-left: 2px; }
.dots::after { content: "···"; animation: dotsPulse 1.8s steps(1, end) infinite; }
@keyframes dotsPulse {
  0%   { content: "·"; }
  33%  { content: "··"; }
  66%  { content: "···"; }
  100% { content: "·"; }
}
.empty { text-align: center; color: var(--text-faint); padding: 70px 20px; font-size: 15px; }
.empty .big { font-size: 46px; margin-bottom: 14px; }

/* ---------- 底部控制台 ---------- */
.player-bar {
  grid-area: player; border-radius: var(--radius);
  display: grid; grid-template-columns: 1fr 2.2fr 1fr; align-items: center; gap: 16px;
  padding: 0 22px;
}
.pb-left { display: flex; align-items: center; gap: 14px; min-width: 0; cursor: pointer; }
.pb-cover {
  width: 60px; height: 60px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: 2px solid rgba(255,255,255,0.9);
  box-shadow: 0 4px 14px rgba(80,80,160,0.3);
  animation: spin 16s linear infinite; animation-play-state: paused;
}
body.dark .pb-cover { border-color: rgba(255,255,255,0.2); }
.pb-cover.playing { animation-play-state: running; }
@keyframes spin { to { transform: rotate(360deg); } }
.pb-meta { min-width: 0; }
.pb-title { font-size: 14.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-artist { font-size: 12px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.pb-like { background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 19px; transition: 0.2s; margin-left: 4px; }
.pb-like:hover { color: var(--accent); transform: scale(1.15); }
.pb-like.on { color: var(--accent); }

.pb-center { display: flex; flex-direction: column; gap: 9px; align-items: center; }
.pb-lyric {
  width: 100%; max-width: 540px; text-align: center;
  font-size: 12.5px; color: var(--text-dim); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pb-controls { display: flex; align-items: center; gap: 16px; }
.ctrl { width: 42px; height: 42px; }
.ctrl.play { width: 56px; height: 56px; font-size: 22px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent2)); border: none; box-shadow: 0 6px 18px rgba(123,92,255,0.45); }
.ctrl.active { color: var(--accent); border-color: rgba(255,59,107,0.5); }

.pb-progress { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 540px; }
.time { font-size: 11.5px; color: var(--text-faint); min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; }
.bar { flex: 1; height: 7px; border-radius: 7px; background: rgba(123,92,255,0.18); cursor: pointer; position: relative; }
body.dark .bar { background: rgba(255,255,255,0.16); }
.bar-fill { height: 100%; border-radius: 7px; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent2)); position: relative; transition: width 0.1s linear; }
.bar-fill::after { content: ""; position: absolute; right: -6px; top: 50%; transform: translateY(-50%); width: 13px; height: 13px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.25); opacity: 0; transition: 0.2s; }
.bar:hover .bar-fill::after { opacity: 1; }

.pb-right { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.vol-slider { width: 84px; height: 7px; border-radius: 7px; background: rgba(123,92,255,0.18); cursor: pointer; position: relative; }
body.dark .vol-slider { background: rgba(255,255,255,0.16); }
.vol-fill { height: 100%; border-radius: 7px; width: 80%; background: linear-gradient(90deg, var(--accent), var(--accent2)); }

/* 收起播放条 */
body.bar-hidden #app { grid-template-rows: minmax(0, 1fr) 0; }
body.bar-hidden .player-bar { display: none; }
body.bar-hidden .toast { bottom: 24px; }

.show-bar-fab {
  position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom));
  width: 52px; height: 52px; border-radius: 50%; display: none;
  align-items: center; justify-content: center; font-size: 22px; cursor: pointer;
  color: #fff; border: 1px solid var(--glass-border);
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 10px 28px rgba(123,92,255,0.4); z-index: 60; transition: 0.2s;
}
.show-bar-fab:hover { transform: scale(1.08); }
body.bar-hidden .show-bar-fab { display: flex; }
/* 全屏歌词页 / 沉浸式歌词页打开时，隐藏底部可拖动的悬浮球，避免它还浮在右上角 */
body.overlay-open .show-bar-fab { display: none !important; }
#hideBar { font-size: 20px; line-height: 1; }

/* ---------- 全屏浏览：整个界面原样铺满整个屏幕 ---------- */
body.fs #app {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh; height: 100dvh;
  z-index: 90;
}
body.fs { overflow: hidden; }

/* 全屏浏览入口：放在底部播放条右侧，复用 .ctrl 方形按钮样式；
   进全屏后位置不变，仅图标从“展开”切换为“退出”（同一按钮一物两用，不再有右上角独立退出钮） */
.fs-ball .ic-exit { display: none; }
body.fs .fs-ball .ic-enter { display: none; }
body.fs .fs-ball .ic-exit { display: block; }

/* ---------- 沉浸式歌词：极简，只留歌名 + 歌词 ---------- */
.immersive {
  position: fixed; inset: 0; z-index: 95; display: none;
  flex-direction: column; align-items: center;
  padding: max(28px, env(safe-area-inset-top)) 22px calc(28px + env(safe-area-inset-bottom));
  background: var(--glass-strong); color: var(--text);
  backdrop-filter: blur(40px) saturate(160%); -webkit-backdrop-filter: blur(40px) saturate(160%);
}
.immersive.show { display: flex; }
body.dark .immersive { background: rgba(20, 18, 30, 0.92); color: #fff; }
.im-close {
  position: absolute; top: max(18px, env(safe-area-inset-top)); right: 18px;
  width: 50px; height: 50px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; z-index: 2;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 10px 28px rgba(123, 92, 255, 0.4);
  transition: 0.2s;
}
.im-close:hover { transform: scale(1.08); }
.im-close svg { width: 20px; height: 20px; display: block; }
.im-head { text-align: center; margin: 10px 0 18px; max-width: 90%; }
.im-title { font-size: 22px; font-weight: 800; letter-spacing: 0.5px; }
.im-artist { font-size: 14px; color: var(--text-dim); margin-top: 6px; }
.im-lyric {
  flex: 1; width: 100%; max-width: 760px; min-height: 0; overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent);
}
.im-lyric-inner { transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1); will-change: transform; }
.im-line {
  text-align: center; padding: 13px 10px; font-size: 20px; line-height: 1.5;
  color: var(--text-dim); transition: color 0.3s, font-size 0.3s, opacity 0.3s;
}
.im-line.active {
  color: var(--text); font-size: 25px; font-weight: 800;
  text-shadow: 0 2px 16px rgba(255, 59, 107, 0.25);
}

/* ---------- 全屏正在播放 ---------- */
.now-playing {
  position: fixed; inset: 0; z-index: 90; display: none;
  background: rgba(245, 246, 252, 0.88); backdrop-filter: blur(50px) saturate(180%);
  -webkit-backdrop-filter: blur(50px) saturate(180%);
  padding: calc(40px + env(safe-area-inset-top)) calc(40px + env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) calc(40px + env(safe-area-inset-left)); flex-direction: column; overflow: hidden;
}
body.dark .now-playing { background: rgba(10, 9, 18, 0.92); }
body.dark .np-line { color: rgba(255, 255, 255, 0.32); }
body.dark .np-line.active { color: #fff; text-shadow: 0 2px 12px rgba(255,59,107,0.35); }
.now-playing::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(60% 60% at 50% 30%, rgba(255,59,107,0.22), transparent 70%),
              radial-gradient(60% 60% at 70% 80%, rgba(123,92,255,0.22), transparent 70%);
}
.now-playing.show { display: flex; animation: npIn 0.4s ease; }
@keyframes npIn { from { opacity: 0; transform: scale(1.02); } to { opacity: 1; transform: scale(1); } }
.np-close { position: absolute; top: calc(28px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: 50px; height: 6px; border-radius: 6px; background: var(--text-faint); border: none; cursor: pointer; opacity: 0.5; }
.np-close-x {
  position: absolute; top: calc(20px + env(safe-area-inset-top)); right: calc(20px + env(safe-area-inset-right)); z-index: 3;
  width: 50px; height: 50px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 10px 28px rgba(123, 92, 255, 0.4);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: 0.2s;
}
.np-close-x:hover { transform: scale(1.08); }
.np-close-x svg { width: 20px; height: 20px; display: block; }
.np-inner { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 20px; max-width: 1200px; margin: 0 auto; width: 100%; min-height: 0; }
.np-art-wrap { flex-shrink: 0; position: relative; user-select: none; }
.np-disc {
  width: 38vh; height: 38vh; max-width: 300px; max-height: 300px; border-radius: 50%;
  background: conic-gradient(#3a3a3a 0deg, #555 180deg, #3a3a3a 360deg);
  display: grid; place-items: center; position: relative;
  box-shadow: 0 30px 80px rgba(60,60,120,0.4); animation: spin 18s linear infinite; animation-play-state: paused;
  border: 10px solid #1f1f1f; cursor: grab; touch-action: pan-y;
}
.np-disc.playing { animation-play-state: running; }
.np-art { width: 64%; height: 64%; border-radius: 50%; object-fit: cover; box-shadow: inset 0 0 30px rgba(0,0,0,0.6); pointer-events: none; }
.np-needle { position: absolute; top: -34px; left: 50%; width: 10px; height: 46px; background: linear-gradient(#888,#bbb); border-radius: 6px; transform-origin: bottom center; transform: translateX(-50%) rotate(28deg); transition: 0.4s; }
.np-disc.playing .np-needle { transform: translateX(-50%) rotate(0deg); }
.swipe-hint { position: absolute; bottom: -34px; left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--text-faint); white-space: nowrap; }

.np-side { flex: 1; max-width: 640px; width: 100%; display: flex; flex-direction: column; min-height: 0; align-items: center; text-align: center; }
.np-head { margin-bottom: 18px; }
.np-tag { font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--accent); font-weight: 800; }
.np-title { font-size: 28px; font-weight: 800; margin: 8px 0 6px; }
.np-artist { font-size: 15px; color: var(--text-dim); }

.np-lyric { flex: 1; min-height: 0; overflow: hidden; position: relative; width: 100%; mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent); -webkit-mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent); }
.np-lyric-inner { transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1); display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 26% 0; text-align: center; }
.np-line { font-size: 17px; color: rgba(27, 27, 42, 0.3); line-height: 1.5; transition: 0.3s; font-weight: 500; }
.np-line.active { color: #000; font-size: 21px; font-weight: 800; transform: scale(1.04); text-shadow: 0 2px 10px rgba(0,0,0,0.12); }

.np-bar { display: flex; align-items: center; gap: 14px; max-width: 720px; margin: 0 auto; width: 100%; }
.np-controls { display: flex; align-items: center; justify-content: center; gap: 20px; padding: 14px 0 2px; }
.np-ctrl {
  width: 50px; height: 50px; border-radius: 50%; border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.32); color: var(--text); font-size: 19px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: 0.2s;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.np-ctrl:hover { background: rgba(255, 255, 255, 0.55); transform: translateY(-2px); }
.np-ctrl:active { transform: scale(0.92); }
.np-ctrl.active { color: var(--accent); }
.np-ctrl.play {
  width: 66px; height: 66px; font-size: 26px; border: none; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 10px 28px rgba(123, 92, 255, 0.42);
}
.np-ctrl.play:hover { background: linear-gradient(135deg, var(--accent), var(--accent2)); }
body.dark .np-ctrl { background: rgba(255, 255, 255, 0.12); color: #fff; }
body.dark .np-ctrl:hover { background: rgba(255, 255, 255, 0.22); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: calc(var(--player-h) + 24px); left: 50%; transform: translateX(-50%) translateY(20px);
  background: rgba(255,255,255,0.85); backdrop-filter: blur(20px); border: 1px solid var(--glass-border);
  color: var(--text); padding: 12px 22px; border-radius: 14px; font-size: 14px; font-weight: 600; z-index: 100;
  opacity: 0; pointer-events: none; transition: 0.3s; box-shadow: 0 8px 30px rgba(80,80,160,0.2);
}
body.dark .toast { background: rgba(20,18,30,0.85); color: #fff; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 响应式：平板 / 手机 ---------- */
@media (max-width: 860px) {
  :root { --player-h: calc(94px + env(safe-area-inset-bottom)); }
  #app {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) var(--player-h);
    grid-template-areas: "side" "main" "player";
    padding: 8px; gap: 8px;
    padding-top: max(8px, env(safe-area-inset-top));
    padding-left: max(8px, env(safe-area-inset-left));
    padding-right: max(8px, env(safe-area-inset-right));
  }
  /* 侧边栏 → 顶部横向分区条 */
  .sidebar {
    flex-direction: row; align-items: center; gap: 8px;
    padding: 8px 10px; border-radius: 16px; overflow-x: auto; overflow-y: hidden;
  }
  .brand { display: none; }
  .sidebar-foot { display: none; }
  .nav { flex-direction: row; gap: 6px; overflow-x: auto; flex: 1; padding: 0; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item { white-space: nowrap; padding: 8px 13px; border-radius: 12px; }
  .nav-item .ico { width: auto; }
  .main { border-radius: 16px; }
  .topbar { border-radius: 16px 16px 0 0; padding: 12px 14px; gap: 10px; }
  #searchInput { font-size: 14px; }
  .content { padding: 18px 16px 24px; }

  .pl-head { flex-direction: column; align-items: flex-start; }
  .pl-cover { width: 130px; height: 130px; }
  .np-inner { flex-direction: column; gap: 14px; padding: 10px; }
  .np-disc { width: 44vw; height: 44vw; max-width: 200px; max-height: 200px; }
  .np-side { max-width: 100%; width: 100%; }
  .np-lyric { display: block; }
  .np-title { font-size: 24px; }
  .np-head { margin-bottom: 8px; }

  /* 播放器：移动端保留完整控制（上一首/播放/下一首 + 进度） */
  .player-bar { grid-template-columns: auto 1fr; gap: 10px; padding: 0 12px; padding-bottom: env(safe-area-inset-bottom); }
  .pb-cover { width: 46px; height: 46px; }
  .pb-like { display: none; }
  .pb-right { display: none; }
  .pb-center { flex-direction: column; gap: 5px; align-items: stretch; min-width: 0; }
  .pb-lyric { display: none; }
  .pb-progress { width: 100%; max-width: none; }
  .pb-controls { justify-content: center; gap: 10px; }
  .ctrl { width: 38px; height: 38px; font-size: 15px; }
  .ctrl.play { width: 48px; height: 48px; font-size: 20px; }
  .ctrl svg, .np-ctrl svg { width: 19px; height: 19px; }
  .ctrl.play svg, .np-ctrl.play svg { width: 22px; height: 22px; }
}

/* 超小屏微调 */
@media (max-width: 430px) {
  .pb-meta { max-width: 38vw; }
  .ctrl { width: 34px; height: 34px; }
  .ctrl.play { width: 44px; height: 44px; }
  .pb-controls { gap: 7px; }
  .ctrl svg, .np-ctrl svg { width: 17px; height: 17px; }
  .ctrl.play svg, .np-ctrl.play svg { width: 20px; height: 20px; }
}
@media (max-height: 560px) and (orientation: landscape) {
  /* 手机横屏：压缩播放器高度 */
  :root { --player-h: calc(64px + env(safe-area-inset-bottom)); }
  .pb-cover { width: 38px; height: 38px; }
  /* 全屏控制栏紧凑化，避免挤没歌词 */
  .np-disc { width: min(40vh, 200px); height: min(40vh, 200px); }
  .np-controls { gap: 12px; padding: 6px 0 0; }
  .np-ctrl { width: 42px; height: 42px; font-size: 16px; }
  .np-ctrl.play { width: 54px; height: 54px; font-size: 22px; }
  .np-ctrl svg { width: 18px; height: 18px; }
  .np-ctrl.play svg { width: 22px; height: 22px; }
}

/* 平板横屏：音乐播放器兼容（iPad / Android 平板横屏等） */
@media (orientation: landscape) and (min-width: 700px) and (max-width: 1366px) {
  :root { --player-h: calc(80px + env(safe-area-inset-bottom)); }
  #app { padding: 12px; gap: 12px; }
  .sidebar { padding: 16px 12px; }
  .nav-item { padding: 9px 12px; font-size: 13.5px; }
  .nav-item .ico { width: auto; }
  .content { padding: 20px 22px 24px; }
  .player-bar { grid-template-columns: auto 1fr auto; padding: 0 18px; gap: 14px; }
  .pb-cover { width: 54px; height: 54px; }
  .pb-center { gap: 6px; }
  .pb-lyric { display: none; }
  .pb-right { gap: 8px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .pl-cover { width: 150px; height: 150px; }
  .pl-title { font-size: 24px; }
}

/* 横屏全屏：左唱盘 + 右歌词，保证歌词有独立空间不被挤压 */
@media (orientation: landscape) {
  .now-playing {
    padding: calc(14px + env(safe-area-inset-top)) calc(28px + env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) calc(28px + env(safe-area-inset-left));
  }
  .np-inner {
    flex-direction: row; align-items: center; justify-content: center;
    gap: 6%; padding: 12px; max-width: 1100px;
  }
  .np-art-wrap { flex-shrink: 0; }
  .np-disc { width: min(44vh, 340px); height: min(44vh, 340px); }
  .np-side { height: min(80vh, 600px); max-width: 640px; justify-content: center; }
  .np-lyric { flex: 1; }
  .np-lyric-inner { padding: 14% 0; }
}

/* ===== 登录 / VIP 会员中心弹层 ===== */
.vip-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10, 8, 16, 0.5);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 18px;
}
.vip-mask[hidden] { display: none; }
.vip-modal {
  position: relative; width: min(420px, 94vw); max-height: 86vh; overflow-y: auto;
  border-radius: 22px; padding: 22px 20px; box-shadow: var(--shadow);
}
.vip-x {
  position: absolute; top: 12px; right: 12px; width: 32px; height: 32px;
  border-radius: 50%; border: none; cursor: pointer;
  background: var(--glass); color: var(--text); font-size: 14px;
}
.vip-h { font-size: 20px; margin-bottom: 6px; }
.vip-sec { font-weight: 700; margin: 16px 0 6px; display: flex; align-items: center; gap: 8px; }
.vip-price { color: var(--accent); font-size: 15px; }
.vip-tip { font-size: 12.5px; color: var(--text-dim); line-height: 1.7; margin: 6px 0 10px; }
.vip-red { color: var(--accent); }
.vip-input {
  width: 100%; padding: 11px 12px; border-radius: 12px; margin: 6px 0;
  border: 1px solid var(--glass-border); background: var(--glass-strong);
  color: var(--text); font-size: 14px; outline: none;
}
.vip-input:focus { border-color: var(--accent); }
.vip-input.slim { width: 90px; margin: 0; padding: 8px 10px; }
.vip-code-row { display: flex; gap: 8px; align-items: center; }
.vip-code-row .vip-input { flex: 1; }
.vip-btn {
  padding: 10px 14px; border-radius: 12px; border: none; cursor: pointer;
  background: var(--glass-strong); color: var(--text); font-size: 14px; font-weight: 600;
  white-space: nowrap; transition: 0.15s;
}
.vip-btn:disabled { opacity: 0.5; cursor: default; }
.vip-btn.primary {
  width: 100%; margin-top: 8px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 6px 18px rgba(236, 65, 65, 0.35);
}
.vip-btn.primary:disabled { box-shadow: none; }
.vip-status {
  padding: 12px 14px; border-radius: 14px; margin-bottom: 4px;
  background: var(--glass-strong); border: 1px solid var(--glass-border); font-size: 14px;
}
.vip-status b { color: var(--accent); }
.vip-days { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.vip-day {
  padding: 9px 16px; border-radius: 12px; cursor: pointer; font-weight: 600; font-size: 14px;
  border: 1px solid var(--glass-border); background: var(--glass-strong); color: var(--text); transition: 0.15s;
}
.vip-day.on { background: var(--accent); color: #fff; border-color: transparent; }
.vip-custom-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin: 4px 0 6px; }
.vip-amount { color: var(--accent); font-weight: 700; }
.vip-order-line { font-size: 13.5px; margin: 5px 0; word-break: break-all; }
.vip-qr {
  display: block; width: min(230px, 70%); margin: 10px auto; border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.vip-orders { display: flex; flex-direction: column; gap: 8px; }
.vip-order {
  padding: 10px 12px; border-radius: 12px; font-size: 12.5px; line-height: 1.7;
  background: var(--glass-strong); border: 1px solid var(--glass-border); word-break: break-all;
}
.vip-order .st-pending { color: #d98a00; font-weight: 700; }
.vip-order .st-paid { color: #1a9c5b; font-weight: 700; }
.vip-order .st-rejected { color: var(--accent); font-weight: 700; }
