:root {
  --bg: #0b0b12;
  --panel: #14141f;
  --panel2: #1b1b2a;
  --line: rgba(255, 255, 255, .08);
  --text: #f2f2f7;
  --muted: #9a9ab0;
  --accent: #7c5cff;
  --accent2: #22d3ee;
  --grad: linear-gradient(135deg, #7c5cff, #22d3ee);
  --side: 220px;
  --bar: 84px;
  --tab: 0px; --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --radius: 14px;
  color-scheme: dark;
}

/* ---- 主题：配色方案（通过 body[data-accent]) ---- */
body[data-accent="rose"] { --accent: #fb7185; --accent2: #f472b6; --grad: linear-gradient(135deg, #fb7185, #f472b6); }
body[data-accent="sunset"] { --accent: #f97316; --accent2: #facc15; --grad: linear-gradient(135deg, #f97316, #facc15); }
body[data-accent="emerald"] { --accent: #10b981; --accent2: #22d3ee; --grad: linear-gradient(135deg, #10b981, #22d3ee); }
body[data-accent="ocean"] { --accent: #2563eb; --accent2: #22d3ee; --grad: linear-gradient(135deg, #2563eb, #22d3ee); }
body[data-accent="mono"] { --accent: #9ca3af; --accent2: #e5e7eb; --grad: linear-gradient(135deg, #6b7280, #d1d5db); }

/* ---- 主题：明暗模式（通过 body[data-mode="light"]) ---- */
body[data-mode="light"] {
  --bg: #f3f3f8;
  --panel: #ffffff;
  --panel2: #f0f0f6;
  --line: rgba(10, 10, 30, .09);
  --text: #16161f;
  --muted: #6b6b80;
  color-scheme: light;
}
body[data-mode="light"] .cover.ph::after { color: rgba(0,0,0,.35); }
body[data-mode="light"] .now::before { background: rgba(255, 255, 255, .72); }
body[data-mode="light"] .lyrics p { color: rgba(10,10,30,.3); }
body[data-mode="light"] .lyrics p.on { color: #16161f; }
body[data-mode="light"][data-accent="default"] { --accent2: #6d4aff; }
body[data-mode="light"] .playerbar { background: rgba(255, 255, 255, .92); box-shadow: 0 -6px 24px rgba(20, 20, 60, .06); }
body[data-mode="light"] .play-btn { background: #16161f; color: #fff; }
body[data-mode="light"] input[type=range] { background: linear-gradient(90deg, var(--accent2) var(--p, 0%), rgba(10,10,30,.14) var(--p, 0%)); }
body[data-mode="light"] input[type=range]::-webkit-slider-thumb { background: var(--accent2); }
body[data-mode="light"] .btn:disabled, body[data-mode="light"] .btn[disabled] { color: var(--muted); background: var(--panel2); opacity: .7; }
body[data-mode="light"] .btn.ghost { color: var(--text); background: #fff; }
body[data-mode="light"] .chip { background: #fff; }
body[data-mode="light"] .chip.active { background: var(--grad); }
body[data-mode="light"] .searchbox, body[data-mode="light"] .toolbar-field select, body[data-mode="light"] .cookie-field textarea { background: #fff; }
body[data-mode="light"] .searchbox { box-shadow: 0 2px 10px rgba(20, 20, 60, .05); }
body[data-mode="light"] .sidebar, body[data-mode="light"] .tabbar { box-shadow: 0 0 24px rgba(20, 20, 60, .04); }
body[data-mode="light"] .card .cv, body[data-mode="light"] .detail-head .cover, body[data-mode="light"] .queue, body[data-mode="light"] .settings { box-shadow: 0 6px 20px rgba(20, 20, 60, .12); }
body[data-mode="light"] .track:hover { background: rgba(10, 10, 30, .045); }
body[data-mode="light"] .track.playing { background: rgba(109, 74, 255, .1); }
body[data-mode="light"] .mini-tag.ok { color: #15803d; border-color: rgba(21, 128, 61, .35); background: rgba(34, 197, 94, .08); }
body[data-mode="light"] .mini-tag.vip, body[data-mode="light"] .badge.vip { color: #b45309; border-color: rgba(180, 83, 9, .35); background: rgba(245, 158, 11, .1); }
body[data-mode="light"] .mini-tag.fail { color: #b91c1c; border-color: rgba(185, 28, 28, .3); background: rgba(239, 68, 68, .07); }
body[data-mode="light"] .mini-tag.loading { color: #0e7490; border-color: rgba(14, 116, 144, .3); background: rgba(6, 182, 212, .08); }
body[data-mode="light"] .toast { background: #16161f; color: #fff; }
body[data-mode="light"] .qr-card { box-shadow: 0 20px 60px rgba(20, 20, 60, .25); }
body[data-mode="light"] .qr-status.ok { color: #15803d; }
body[data-mode="light"] .qr-status.error { color: #b91c1c; }
/* 浅色沉浸播放页 */
body[data-mode="light"] .now-wash { background: radial-gradient(120% 70% at 50% -10%, var(--now-c1), transparent 60%), rgba(255, 255, 255, .66); }
body[data-mode="light"] .now::before { background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,.3) 60%, rgba(255,255,255,.7) 100%); }
body[data-mode="light"] .now-bg { opacity: .5; }
body[data-mode="light"] .now-head-title, body[data-mode="light"] .now-title, body[data-mode="light"] .now-peek-title { color: #16161f; }
body[data-mode="light"] .now-close, body[data-mode="light"] .now-queue-open { color: #16161f; }
body[data-mode="light"] .now-artist, body[data-mode="light"] .now-peek-artist, body[data-mode="light"] .now-peek-kicker { color: rgba(10,10,30,.62); }
body[data-mode="light"] .now-act { color: rgba(10,10,30,.7); background: rgba(10,10,30,.06); }
body[data-mode="light"] .now-act:hover { background: rgba(10,10,30,.12); color: #16161f; }
body[data-mode="light"] .lyrics p:hover { color: rgba(10,10,30,.6); }
body[data-mode="light"] .lyrics .empty { color: rgba(10,10,30,.5); }
body[data-mode="light"] .now .icon-btn, body[data-mode="light"] .now .seek { color: #16161f; }
body[data-mode="light"] .now .seek { color: rgba(10,10,30,.6); }
body[data-mode="light"] .now .icon-btn.sm { color: rgba(10,10,30,.65); }
body[data-mode="light"] #nowLyricToggle.on { color: var(--accent2); background: rgba(10,10,30,.08); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 14px/1.5 -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
svg { width: 22px; height: 22px; fill: currentColor; flex: none; }
[hidden] { display: none !important; }
a { color: inherit; }

.app { display: grid; height: 100vh; height: 100dvh;
  grid-template-columns: var(--side) 1fr; grid-template-rows: 1fr var(--bar);
  grid-template-areas: "side main" "bar bar"; }

.sidebar { grid-area: side; background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 20px 12px; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; padding: 0 10px; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav button, .nav .tv-link { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: var(--muted); text-align: left; transition: .15s; }
.tv-link { text-decoration: none; }
a[data-client-download] { text-decoration: none; }
.nav button:hover, .nav .tv-link:hover, .nav .tv-link:focus-visible { background: var(--panel2); color: var(--text); }
.nav button.active { background: var(--panel2); color: var(--text); }
.nav button.active svg { color: var(--accent2); }
.side-foot { margin-top: auto; font-size: 12px; color: var(--muted); padding: 0 10px; }
.side-foot a { text-decoration: none; }
.side-foot a:hover { color: var(--text); }

.main { grid-area: main; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 14px 24px; position: sticky; top: 0; z-index: 5;
  background: linear-gradient(var(--bg) 70%, transparent); }
.searchbox { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; padding: 0 16px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; }
.searchbox:focus-within { border-color: var(--accent); }
.searchbox svg { color: var(--muted); width: 18px; height: 18px; }
.searchbox input { flex: 1; background: none; border: 0; outline: 0; color: var(--text); height: 40px; font: inherit; min-width: 0; }
#openSettingsTop { color: var(--muted); }
#openSettingsTop:hover { color: var(--text); }
.content { flex: 1; overflow-y: auto; padding: 4px 24px 32px; min-height: 0; }
.artist-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 16px; }
.artist-heading h3 { margin: 0; font-size: 18px; }
.artist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 16px 12px; }
.artist-card { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px 6px; border-radius: 14px; min-width: 0; transition: background .18s ease; }
.artist-card:hover, .artist-card:focus-visible { background: var(--panel2); }
.artist-avatar { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--panel2); color: var(--accent2); font-size: 26px; font-weight: 600; position: relative; overflow: hidden; }
.artist-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.artist-credits { grid-column: 1 / -1; margin-top: 18px; color: var(--muted); font-size: 12px; }
.artist-credits summary { cursor: pointer; }
.artist-credits a { color: var(--accent2); }
.artist-name { width: 100%; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.artist-group { font-size: 11px; color: var(--muted); }
.artist-tools { margin-bottom: 18px; }
.artist-tools input { width: 100%; padding: 12px 14px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); font: inherit; }
.search-sub { color: var(--muted); font-size: 13px; margin: -4px 0 10px; }

.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--text); transition: .15s; }
.icon-btn:hover { background: var(--panel2); }
.icon-btn.sm { width: 34px; height: 34px; color: var(--muted); }
.icon-btn.sm svg { width: 19px; height: 19px; }
.icon-btn.sm:hover, .icon-btn.on { color: var(--accent2); }

h2.sec { font-size: 20px; margin: 22px 0 14px; display: flex; align-items: center; gap: 12px; }
h2.sec small { color: var(--muted); font-weight: 400; font-size: 13px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 14px; }
.chip { padding: 6px 14px; border-radius: 999px; background: var(--panel2); color: var(--muted); border: 1px solid var(--line); font-size: 13px; }
.chip:hover { color: var(--text); }
.chip.active { background: var(--grad); color: #fff; border-color: transparent; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 20px; }
.card { cursor: pointer; transition: transform .15s; }
.card:hover { transform: translateY(-3px); }
.card .cv { aspect-ratio: 1; border-radius: var(--radius); position: relative; overflow: hidden; }
.card .cv::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 60%, rgba(0,0,0,.45)); opacity: 0; transition: .2s; }
.card:hover .cv::after { opacity: 1; }
.card .nm { margin-top: 10px; font-size: 14px; line-height: 1.35; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .sb { margin-top: 3px; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cover { background-color: var(--panel2); background-size: cover; background-position: center; background-repeat: no-repeat; position: relative; }
.cover.ph { background-image: var(--ph, var(--grad)); }
.cover.ph::after { content: "♪"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 28px; color: rgba(255,255,255,.75); }

.detail-head { display: flex; gap: 22px; align-items: flex-end; margin: 10px 0 20px; flex-wrap: wrap; }
.detail-head .cover { width: 180px; height: 180px; border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0,0,0,.5); }
.detail-head h1 { margin: 0 0 6px; font-size: 28px; }
.detail-head p { margin: 0 0 12px; color: var(--muted); max-width: 640px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 22px; border-radius: 999px; background: var(--grad); color: #fff; font-weight: 600; }
.btn.ghost { background: var(--panel2); border: 1px solid var(--line); }
.btn.slim { padding: 8px 14px; font-size: 13px; }
.btn svg { width: 18px; height: 18px; }

.song-list-wrap { display: flex; flex-direction: column; gap: 10px; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.list-toolbar-copy { display: flex; flex-direction: column; gap: 2px; min-width: 240px; }
.list-toolbar-text { color: var(--muted); font-size: 13px; }
.list-toolbar-meta { color: var(--text); font-size: 12px; }
.list-toolbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar-field { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.toolbar-field select { min-width: 116px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); outline: 0; }
.toolbar-field select:focus { border-color: var(--accent); }

.tracks { display: flex; flex-direction: column; }
.track { display: grid; grid-template-columns: 40px 1fr 140px 56px 72px; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.track:hover { background: var(--panel2); }
.track.playing { background: rgba(124, 92, 255, .16); }
.track.playing .tt { color: var(--accent2); }
.track .idx { text-align: center; color: var(--muted); font-size: 13px; }
.track .info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.track .info .cover { width: 42px; height: 42px; border-radius: 8px; flex: none; }
.track .info .cover.ph::after { font-size: 16px; }
.track .txt { min-width: 0; }
.track .tt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.track .ar { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.mini-tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 999px; font-size: 11px; color: var(--muted); background: var(--panel2); border: 1px solid var(--line); }
.mini-tag.ok { color: #86efac; border-color: rgba(134, 239, 172, .35); }
.mini-tag.vip { color: #fbbf24; border-color: rgba(251, 191, 36, .35); }
.mini-tag.fail { color: #fca5a5; border-color: rgba(252, 165, 165, .35); }
.mini-tag.loading { color: #67e8f9; border-color: rgba(103, 232, 249, .35); }
.mini-tag.pending { color: var(--muted); }
.track .al { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track .dur { color: var(--muted); font-size: 12px; text-align: right; }
.track .acts { display: flex; justify-content: flex-end; opacity: 0; }
.track:hover .acts, .track.playing .acts { opacity: 1; }
.badge { font-size: 10px; padding: 1px 6px; border-radius: 4px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); margin-left: 6px; text-transform: uppercase; }
.badge.vip { color: #fbbf24; border-color: rgba(251,191,36,.4); }

.state { text-align: center; color: var(--muted); padding: 60px 0; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent2); animation: sp .8s linear infinite; margin: 0 auto 12px; }
@keyframes sp { to { transform: rotate(360deg); } }

.playerbar { grid-area: bar; display: grid; grid-template-columns: 1fr minmax(320px, 560px) 1fr; align-items: center; gap: 16px;
  padding: 0 20px; background: rgba(20, 20, 31, .96); border-top: 1px solid var(--line); backdrop-filter: blur(12px); z-index: 20; }
.pb-track { display: flex; align-items: center; gap: 12px; min-width: 0; cursor: pointer; }
.pb-track .cover { width: 56px; height: 56px; border-radius: 10px; flex: none; }
.meta { min-width: 0; }
.meta .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta .a { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-center { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ctrls { display: flex; justify-content: center; align-items: center; gap: 10px; }
.play-btn { width: 44px; height: 44px; border-radius: 50%; background: #fff; color: #111; display: grid; place-items: center; transition: transform .1s; }
.play-btn:hover { transform: scale(1.06); }
.play-btn.loading svg { animation: sp 1s linear infinite; opacity: .4; }
.seek { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.pb-right { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }

input[type=range] { -webkit-appearance: none; appearance: none; height: 4px; border-radius: 4px; outline: none; cursor: pointer;
  background: linear-gradient(90deg, var(--accent2) var(--p, 0%), rgba(255,255,255,.18) var(--p, 0%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #fff; opacity: 0; transition: .15s; }
input[type=range]:hover::-webkit-slider-thumb { opacity: 1; }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 0; }
.seek input { flex: 1; }
#volume { width: 100px; }

.queue { position: fixed; right: 0; top: 0; bottom: var(--bar); width: 360px; max-width: 100%; z-index: 30;
  background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; box-shadow: -20px 0 40px rgba(0,0,0,.4); }
.settings { position: fixed; right: 0; top: 0; bottom: var(--bar); width: 380px; max-width: 100%; z-index: 31;
  background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; box-shadow: -20px 0 40px rgba(0,0,0,.4); }
.q-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px; }
.q-head h3 { margin: 0; }
.q-list { overflow-y: auto; padding: 4px 8px 16px; flex: 1; }
.settings-body { overflow-y: auto; padding: 4px 14px 18px; flex: 1; }
.setting-group { padding: 10px 0 14px; border-bottom: 1px solid var(--line); }
.setting-group h4 { margin: 0 0 8px; font-size: 15px; display: flex; justify-content: space-between; align-items: baseline; }
.setting-group h4 small { font-size: 12px; color: var(--muted); font-weight: 400; }
.setting-actions { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.setting-actions .chip { cursor: pointer; }
.theme-modes { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.theme-modes .chip { cursor: pointer; }
.theme-swatches { display: flex; gap: 12px; flex-wrap: wrap; }
.theme-swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; width: 56px; }
.theme-swatch .dot { width: 36px; height: 36px; border-radius: 50%; background: var(--sw-grad); border: 2px solid transparent; box-shadow: inset 0 0 0 2px rgba(255,255,255,.12); transition: .15s; }
.theme-swatch span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.theme-swatch:hover .dot { transform: scale(1.06); }
.theme-swatch.active .dot { border-color: var(--text); box-shadow: 0 0 0 3px var(--panel), 0 0 0 4px var(--text); }
.theme-swatch.active span { color: var(--text); font-weight: 600; }
.source-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.source-grid label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.source-grid input { accent-color: #22d3ee; }
.source-grid label:hover { color: var(--text); }
.setting-note { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.setting-status { margin-top: 10px; color: var(--muted); font-size: 12px; }
.setting-status.error { color: #fca5a5; }
.cookie-grid { display: grid; gap: 10px; }
.qr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.cookie-adv { margin-top: 8px; }
.cookie-adv summary { cursor: pointer; font-size: 12px; color: var(--muted); padding: 6px 0; }
.qr-modal { position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.6); backdrop-filter: blur(6px); }
.qr-card { position: relative; width: min(320px, 88vw); padding: 22px 20px 18px; border-radius: 22px; background: var(--panel); color: var(--text); text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.qr-card h4 { margin: 0 0 14px; font-size: 16px; }
.qr-x { position: absolute; top: 10px; right: 10px; }
.qr-box { width: 260px; max-width: 100%; height: 260px; margin: 0 auto; display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 14px; overflow: hidden; }
.qr-box canvas, .qr-box img { width: 100%; height: 100%; object-fit: contain; }
.qr-box [hidden] { display: none; }
.qr-loading { color: #555; font-size: 13px; }
.qr-status { margin-top: 12px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.qr-status.ok { color: #22c55e; }
.qr-status.error { color: #f87171; }
.qr-status a { color: var(--accent); }
.qr-actions { margin-top: 10px; }
.cookie-field { display: grid; gap: 6px; }
.cookie-field span { font-size: 12px; color: var(--muted); }
.cookie-field textarea { width: 100%; min-height: 86px; resize: vertical; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); outline: 0; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.cookie-field textarea:focus { border-color: var(--accent); }
.cookie-field textarea::placeholder { color: rgba(148, 163, 184, .72); }
.q-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.q-item:hover { background: var(--panel2); }
.q-item.playing { background: rgba(124, 92, 255, .16); color: var(--accent2); }
.q-item .txt { flex: 1; min-width: 0; }
.q-item .tt, .q-item .ar { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-item .ar { font-size: 12px; color: var(--muted); }

.now { position: fixed; inset: 0 0 var(--bar) 0; z-index: 25; overflow: hidden; background: var(--bg); animation: up .25s ease;
  --now-c1: rgba(124, 92, 255, .55); --now-c2: rgba(8, 8, 14, .4); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.now-bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(80px) saturate(1.5) brightness(.9); opacity: .65; transform: scale(1.25); }
.now-wash { position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(120% 70% at 50% -10%, var(--now-c1), transparent 60%), rgba(6, 6, 12, .62); }
.now::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 0%, rgba(6,6,12,.35) 60%, rgba(6,6,12,.78) 100%); z-index: 1; }
.now.swipe-dragging { user-select: none; }
.now-peek { position: absolute; inset: 52px 0 0; z-index: 2; display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(110px); pointer-events: none; }
.now-peek-inner { width: min(76vw, 360px); display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.now-peek-cover { width: min(58vw, 280px); aspect-ratio: 1; border-radius: 20px; box-shadow: 0 22px 56px rgba(0, 0, 0, .48); }
.now-peek-cover.ph::after { font-size: 74px; }
.now-peek-kicker { font-size: 12px; color: rgba(255,255,255,.62); letter-spacing: .5px; }
.now-peek-title { font-size: 24px; line-height: 1.2; font-weight: 700; color: rgba(255,255,255,.94); }
.now-peek-artist { margin-top: 3px; font-size: 14px; color: rgba(255,255,255,.7); }
.now-head { position: relative; z-index: 4; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; }
.now-head-title { font-size: 14px; font-weight: 600; color: rgba(255,255,255,.85); letter-spacing: .5px; }
.now-close, .now-queue-open { color: #fff; }
.now-body { position: relative; z-index: 3; height: calc(100% - 52px); display: flex; flex-direction: column; align-items: center;
  overflow-y: auto; gap: 14px; padding: 6px 8vw 24px; text-align: center; scrollbar-width: none;
  will-change: transform, opacity; }
.now-body::-webkit-scrollbar { display: none; }
.now-art { display: flex; flex-direction: column; align-items: center; }
.big-cover { width: min(64vw, 320px); aspect-ratio: 1; border-radius: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.big-cover.ph::after { font-size: 90px; }
.now-info { max-width: 560px; }
.now-title { font-size: 21px; font-weight: 700; color: #fff; }
.now-artist { color: rgba(255,255,255,.65); margin-top: 4px; font-size: 13px; }
.now-actions { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 2px 0 6px; flex-wrap: wrap; }
.now-act { display: flex; flex-direction: column; align-items: center; gap: 4px; color: rgba(255,255,255,.75); font-size: 11px;
  padding: 8px 16px; border-radius: 16px; background: rgba(255,255,255,.08); backdrop-filter: blur(6px); transition: .2s; }
.now-act:hover { background: rgba(255,255,255,.16); color: #fff; }
.now-act svg { width: 20px; height: 20px; }
.now-act.on { color: var(--accent2); }
.now-act.on svg { color: #fb7185; }
.lyrics { width: 100%; max-width: 560px; flex: 1; min-height: 160px; overflow-y: auto; scroll-behavior: smooth; padding: 20vh 0;
  mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent); -webkit-mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent); scrollbar-width: none; }
.lyrics::-webkit-scrollbar { display: none; }
.lyrics p { margin: 0; padding: 8px 0; font-size: 17px; font-weight: 600; color: rgba(255,255,255,.4); cursor: pointer; transition: .25s; }
.lyrics p:hover { color: rgba(255,255,255,.65); }
.lyrics p.on { color: #fff; transform: scale(1.05); }
.lyrics .empty { color: rgba(255,255,255,.5); font-size: 15px; font-weight: 400; cursor: default; }
.now-transport { display: none; width: 100%; max-width: 560px; flex: none; }

.toast { position: fixed; left: 50%; bottom: calc(var(--bar) + var(--tab) + 18px); transform: translate(-50%, 20px); background: var(--panel2);
  border: 1px solid var(--line); padding: 10px 18px; border-radius: 999px; opacity: 0; pointer-events: none; transition: .25s; z-index: 50; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.tabbar { display: none; }

@media (max-width: 860px) {
  :root { --side: 0px; --bar: 132px; --tab: calc(56px + var(--sab)); }
  .app { grid-template-columns: 1fr; grid-template-rows: 1fr var(--bar);
    grid-template-areas: "main" "bar"; }
  .sidebar { display: none; }
  .topbar { padding: calc(10px + var(--sat)) 14px 10px; }
  .content { padding: 0 14px calc(var(--tab) + 24px); }
  .playerbar { grid-template-columns: 1fr; gap: 6px; padding: 8px 14px calc(var(--tab) + 6px); position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--bar) + var(--tab)); align-content: start; }
  .pb-track .cover { width: 44px; height: 44px; }
  .pb-right { display: none; }
  .pb-center { order: 2; }
  .seek { display: flex; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: var(--tab); z-index: 21; background: var(--panel); border-top: 1px solid var(--line);
    padding-bottom: var(--sab); }
  .tabbar button, .tabbar .tv-link { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--muted); position: relative; }
  .tabbar button.active { color: var(--accent2); font-weight: 600; }
  .tabbar button.active::before { content: ""; position: absolute; top: 0; width: 22px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent2); }
  .tabbar svg { width: 22px; height: 22px; }
  .app { grid-template-rows: 1fr calc(var(--bar) + var(--tab)); }
  .queue, .settings { bottom: calc(var(--bar) + var(--tab)); width: 100%; }
  .now { inset: 0; z-index: 30; padding-top: var(--sat); }
  .queue, .settings { padding-top: var(--sat); }
  body.now-open .playerbar, body.now-open .tabbar { display: none; }
  .now-body { padding: 6px 20px 10px; justify-content: flex-start; }
  .now-transport { display: flex; flex-direction: column; gap: 10px; position: sticky; bottom: 0; margin-top: auto;
    padding: 16px 0 max(12px, var(--sab)); }
  .now-transport .ctrls { gap: 22px; }
  .now-transport .play-btn { width: 56px; height: 56px; }
  .now-peek-cover { width: min(62vw, 250px); }
  .now-peek-title { font-size: 22px; }
  .big-cover { width: 40vw; }
  /* .now:not(.lyrics-on) .lyrics { display: none; } */
  .now:not(.lyrics-on) .now-body { justify-content: center; }
  /* .now:not(.lyrics-on) .now-transport { margin-top: 0; } */
  .now.lyrics-on .now-art, .now.lyrics-on .now-actions { display: none; }
  .now.lyrics-on .lyrics { min-height: 0; }
  #nowLyricToggle.on { color: var(--accent2); background: rgba(255,255,255,.14); }
  .lyrics { padding: 6vh 0; }
  .lyrics p { font-size: 16px; }
  .track { grid-template-columns: 1fr 52px 40px; }
  .track .idx, .track .al { display: none; }
  .track .acts { opacity: 1; }
  .list-toolbar { align-items: stretch; }
  .list-toolbar-actions { align-items: stretch; }
  .toolbar-field { width: 100%; justify-content: space-between; }
  .toolbar-field select { flex: 1; min-width: 0; }
  .list-toolbar .btn { width: 100%; justify-content: center; }
  .source-grid { grid-template-columns: 1fr; }
  .cookie-field textarea { min-height: 96px; }
  .toast { bottom: calc(var(--bar) + var(--tab) + 14px); }
}
@media (max-width: 860px) and (max-height: 640px) { .big-cover { width: 30vw; } }

/* Native Android shell: the shell draws the status bar inset and the bottom menu. */
body.native-shell { --sab: 0px; --tab: 0px; }
body.native-shell .tabbar { display: none !important; }

/* Page transitions */
.content.pg-fwd { animation: pgFwd .28s cubic-bezier(.2,.8,.2,1); }
.content.pg-back { animation: pgBack .28s cubic-bezier(.2,.8,.2,1); }
.content.pg-fade { animation: pgFade .24s ease-out; }
@keyframes pgFwd { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes pgBack { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes pgFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.queue:not([hidden]), .settings:not([hidden]) { animation: panelIn .26s cubic-bezier(.2,.8,.2,1); }
@keyframes panelIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 860px) {
  .queue:not([hidden]), .settings:not([hidden]) { animation: panelUp .28s cubic-bezier(.2,.8,.2,1); }
  @keyframes panelUp { from { transform: translateY(32px); opacity: 0; } to { transform: none; opacity: 1; } }
}
@media (prefers-reduced-motion: reduce) {
  .content.pg-fwd, .content.pg-back, .content.pg-fade, .queue, .settings, .now { animation: none !important; }
}