:root {
  --bg: #f6f5fb; --fg: #1b1a2e; --muted: #6b6a80; --card: #ffffff; --line: #e4e2f0;
  --accent: #5b4bd6; --accent-fg: #ffffff; --bar: #ffffffee; --ph: #ded9ff;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14131f; --fg: #f1f0fa; --muted: #9c9ab5; --card: #1f1e30; --line: #2d2c42; --accent: #8f82ff; --accent-fg: #14131f; --bar: #1b1a2eee; --ph: #2b2950; }
}
[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Apple SD Gothic Neo", sans-serif; }
body { padding-bottom: calc(132px + env(safe-area-inset-bottom)); }

.top { position: sticky; top: 0; display: flex; align-items: center; gap: 4px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; background: var(--bg); z-index: 5; }
.top h1 { font-size: 20px; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.icon-btn { border: 0; background: transparent; color: var(--fg); font-size: 26px; width: 48px; height: 48px; border-radius: 24px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn.big { width: 60px; height: 60px; font-size: 30px; background: var(--accent); color: var(--accent-fg); }
.icon-btn.small { font-size: 20px; color: var(--muted); }
.icon-btn.small.on { color: var(--accent); }
.icon-btn:active { opacity: .6; }
.btn { margin-top: 10px; border: 0; background: var(--accent); color: var(--accent-fg); font-size: 16px; font-weight: 600; padding: 12px 18px; border-radius: 12px; cursor: pointer; }

.view { padding: 0 12px; }
.empty { text-align: center; color: var(--muted); padding: 60px 20px; }

.albums { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.album-card { display: block; text-decoration: none; color: inherit; background: var(--card); border-radius: 16px; padding: 12px; box-shadow: 0 1px 0 var(--line); }
.album-cover { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: var(--ph); display: block; }
.album-cover.ph { display: flex; align-items: center; justify-content: center; font-size: 48px; color: var(--accent); }
.album-cover.lg { width: 120px; flex: none; }
.album-title { font-weight: 600; margin-top: 10px; }
.album-title.lg { font-size: 20px; margin-top: 0; }
.album-sub { color: var(--muted); font-size: 14px; }
.album-head { display: flex; gap: 16px; align-items: center; padding: 8px 0 16px; }

.tracks { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: 16px; overflow: hidden; }
.track { display: flex; align-items: center; gap: 12px; padding: 14px 14px; min-height: 56px; border-top: 1px solid var(--line); cursor: pointer; }
.track:first-child { border-top: 0; }
.track:active { background: var(--ph); }
.track-no { width: 26px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.track-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-eq { display: none; color: var(--accent); font-size: 12px; letter-spacing: -2px; }
.track.active { color: var(--accent); font-weight: 600; }
.track.active .track-eq { display: inline; }

.bar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--bar); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); padding: 0 12px calc(8px + env(safe-area-inset-bottom)); z-index: 10; }
.bar-progress { height: 22px; display: flex; align-items: center; cursor: pointer; margin: 0 -12px; padding: 0 12px; }
.bar-progress::before { content: ""; position: absolute; left: 0; right: 0; height: 3px; background: var(--line); }
.bar-progress-fill { position: relative; height: 3px; background: var(--accent); width: 0; border-radius: 2px; transition: width .25s linear; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-cover, .bar-cover-ph { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; background: var(--ph); display: flex; align-items: center; justify-content: center; color: var(--accent); font-size: 22px; }
.bar-meta { flex: 1; min-width: 0; }
.bar-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-ctl { display: flex; align-items: center; gap: 0; flex: none; }
.bar-time { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; padding-top: 2px; }

@media (max-width: 420px) {
  .bar-row { flex-wrap: wrap; }
  .bar-ctl { width: 100%; justify-content: center; gap: 6px; }
}
