:root { color-scheme: light dark; --bg: #f4f5f7; --panel: #fff; --text: #1c1e21; --muted: #6b7280; --line: #e3e5e8; --accent: #2563eb; }
@media (prefers-color-scheme: dark) { :root { --bg: #111318; --panel: #1a1d23; --text: #e8eaed; --muted: #9aa0a6; --line: #2a2e36; --accent: #6ea8fe; } }
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); padding-bottom: 108px; }
button, select, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.topbar { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 12px 16px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.brand { font-weight: 800; font-size: 18px; white-space: nowrap; }
.brand-sub { font-size: 12px; color: var(--muted); font-weight: 400; }
.searchbar { display: flex; gap: 8px; flex: 1; min-width: 280px; }
.searchbar input { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); }
.searchbar select, .searchbar button { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); }
.searchbar button { background: var(--accent); color: #fff; border-color: var(--accent); }
.layout { display: grid; grid-template-columns: 210px 1fr; min-height: calc(100vh - 57px - 108px); }
.sidebar { border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 6px; background: var(--panel); }
.nav-btn { text-align: left; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); }
.nav-btn.active { background: var(--accent); color: #fff; }
.side-note { font-size: 12px; color: var(--muted); line-height: 1.6; padding: 0 4px; }
.main { padding: 16px; max-width: 980px; width: 100%; margin: 0 auto; }
.status { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0 0 12px; word-break: break-all; }
.hint { font-size: 13px; color: var(--muted); line-height: 1.6; }
.song-list { list-style: none; margin: 0; padding: 0; }
.song-list li { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 9px 8px; border-bottom: 1px solid var(--line); }
.song-list li.playing { background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 8px; }
.song-name { font-weight: 600; }
.song-meta { font-size: 13px; color: var(--muted); }
.song-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.song-actions button { padding: 5px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--text); font-size: 13px; }
.row-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.row-head h2 { margin: 0; font-size: 18px; }
.add-source { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.add-source input { flex: 1; min-width: 260px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); }
.add-source button { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); }
.source-list { list-style: none; margin: 0; padding: 0; }
.source-list li { display: flex; gap: 10px; align-items: center; padding: 9px 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.source-list .src-name { font-weight: 600; }
.source-list .src-url { font-size: 12px; color: var(--muted); word-break: break-all; }
.source-list button { padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text); }
.lyrics { margin-top: 18px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--panel); }
.lyrics-body { max-height: 320px; overflow: auto; line-height: 2; text-align: center; }
.lyrics-body div { cursor: pointer; border-radius: 6px; padding: 1px 6px; }
.lyrics-body div.current { color: var(--accent); font-weight: 700; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.player { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--panel); border-top: 1px solid var(--line); padding: 10px 16px 12px; display: grid; grid-template-columns: minmax(180px, 1fr) auto minmax(220px, 1.4fr); gap: 16px; align-items: center; }
html[data-theme="dark"] { --bg: #111318; --panel: #1a1d23; --text: #e8eaed; --muted: #9aa0a6; --line: #2a2e36; --accent: #6ea8fe; }
html[data-theme="light"] { --bg: #f4f5f7; --panel: #fff; --text: #1c1e21; --muted: #6b7280; --line: #e3e5e8; --accent: #2563eb; }
.chart-controls, .file-label { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chart-controls select, .chart-controls button, .add-source select, .file-label { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); cursor: pointer; }
.file-label input { display: none; }
.discover-section { margin-bottom: 18px; }
.discover-section h3 { margin: 12px 0 6px; }
.playlist-card { display: flex; gap: 10px; align-items: center; padding: 8px; border-bottom: 1px solid var(--line); }
.playlist-card img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.lyric-overlay { position: fixed; inset: 0; z-index: 50; background: #0b0d10; color: #f2f3f5; display: flex; flex-direction: column; align-items: center; padding: 28px 18px; overflow: auto; }
.lyric-overlay #closeOverlayBtn { align-self: flex-end; padding: 8px 14px; border-radius: 8px; border: 1px solid #444; background: #1c1f24; color: #fff; }
.overlay-title { font-size: 20px; font-weight: 700; margin: 10px 0 4px; text-align: center; }
.overlay-line { font-size: 30px; font-weight: 800; color: #7db4ff; text-align: center; line-height: 1.4; margin: 18px 0; max-width: 860px; }
.overlay-list { line-height: 2.1; text-align: center; max-width: 860px; }
.overlay-list div.current { color: #7db4ff; font-weight: 700; }
.now { display: flex; gap: 10px; align-items: center; min-width: 0; }
.cover { width: 48px; height: 48px; border-radius: 8px; background: var(--line); display: grid; place-items: center; font-size: 22px; overflow: hidden; flex: none; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.now-meta { min-width: 0; }
.now-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-artist, .now-note { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.controls { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.controls button, .audio-link { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); text-decoration: none; font-size: 13px; }
.progress { display: flex; gap: 8px; align-items: center; }
.progress input[type="range"] { flex: 1; }
.vol { font-size: 12px; color: var(--muted); white-space: nowrap; display: flex; gap: 6px; align-items: center; }
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-note { display: none; }
  .player { grid-template-columns: 1fr; gap: 8px; }
  body { padding-bottom: 190px; }
}
