:root {
  --ink: #0f1230;
  --ink-2: #1d1745;
  --text: #f4f1ff;
  --muted: rgba(244, 241, 255, .62);
  --glass: rgba(255, 255, 255, .09);
  --glass-line: rgba(255, 255, 255, .16);
  --accent: #ffb25b;
  --accent-ink: #2a1600;
  --heart: #ff6b8b;
  --blob-a: #5b3fd1;
  --blob-b: #e0568a;
  --r: 18px;
}
:root.light {
  --ink: #eef0ff;
  --ink-2: #ddd8ff;
  --text: #17133a;
  --muted: rgba(23, 19, 58, .6);
  --glass: rgba(255, 255, 255, .55);
  --glass-line: rgba(255, 255, 255, .8);
  --accent: #e8710a;
  --accent-ink: #fff;
  --blob-a: #9d8cff;
  --blob-b: #ffb3c7;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font: 15px/1.4 -apple-system, "SF Pro Text", Roboto, "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(160deg, var(--ink), var(--ink-2));
  padding-top: env(safe-area-inset-top);
  overscroll-behavior: none;
}
.hidden { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.bg i { position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; filter: blur(80px); opacity: .45; }
.bg i:first-child { background: var(--blob-a); left: -25vmax; top: -20vmax; }
.bg i:last-child { background: var(--blob-b); right: -30vmax; bottom: -25vmax; opacity: .3; }

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  backdrop-filter: blur(22px) saturate(1.4);
}

.top { position: sticky; top: 0; z-index: 5; padding: 12px 14px 8px; }
.bar { display: flex; align-items: center; gap: 8px; }
.bar .search { flex: 1; min-width: 0; }
.menu { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 16px; }
.menu:active { background: var(--glass-line); }
.search { position: relative; z-index: 10; border-radius: 16px; }
.search input {
  width: 100%; padding: 13px 16px; font: inherit; color: var(--text);
  background: none; border: 0; border-radius: 16px;
}
.search input::placeholder { color: var(--muted); }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; border-radius: 16px; z-index: 20; background: var(--ink-2); box-shadow: 0 14px 36px rgba(0, 0, 0, .5); -webkit-backdrop-filter: none; backdrop-filter: none; }
.suggest li { padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.suggest li:active { background: var(--glass); }


main { padding: 6px 14px calc(110px + env(safe-area-inset-bottom)); }
.empty { text-align: center; color: var(--muted); padding: 48px 20px; }
.empty b { display: block; color: var(--text); font-size: 17px; margin-bottom: 4px; }

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.row { cursor: pointer; display: grid; grid-template-columns: 52px 1fr auto auto; gap: 12px; align-items: center; padding: 8px; border-radius: 14px; }
.row:active { background: var(--glass); }
.row.now .title { color: var(--accent); }
.row img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--glass); }
.row .meta { min-width: 0; text-align: left; cursor: pointer; }
.title, .sub { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title { font-weight: 600; }
.sub { color: var(--muted); font-size: 13px; }
.dur { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.row .acts { display: flex; }
.icon { width: 40px; height: 40px; display: grid; place-items: center; font-size: 20px; border-radius: 50%; }
.icon:active { background: var(--glass); }
.icon.on { color: var(--heart); }
.icon.big { font-size: 26px; }

.pl-head { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; }
.pl-head h3 { margin: 0; flex: 1; }
.chip { padding: 8px 14px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-line); }
.pl-card { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 14px 16px; border-radius: var(--r); margin-bottom: 8px; text-align: left; }

.mini { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 8; border-radius: 20px; display: flex; align-items: center; padding: 6px 8px; overflow: hidden; }
.mini-open { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; text-align: left; }
.mini img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; }
.mini .meta { display: grid; min-width: 0; }
.mini b, .mini small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini small { color: var(--muted); }
.mini-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--glass); }
.mini-bar i { display: block; height: 100%; width: 0; background: var(--accent); }

.player { position: fixed; inset: 0; z-index: 20; overflow: hidden; background: var(--ink); animation: rise .28s ease-out; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.pl-bg { position: absolute; inset: -10%; width: 120%; height: 120%; object-fit: cover; filter: blur(60px) saturate(1.5); opacity: .55; }
.pl-inner {
  position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: calc(14px + env(safe-area-inset-top)) 24px calc(22px + env(safe-area-inset-bottom));
  max-width: 480px; margin: 0 auto;
}
.pl-cover { width: min(78vw, 46vh); aspect-ratio: 1; object-fit: cover; border-radius: 26px; box-shadow: 0 24px 60px rgba(0,0,0,.45); background: var(--glass); }
.pl-meta { text-align: center; width: 100%; }
.pl-meta h2 { margin: 6px 0 2px; font-size: 22px; line-height: 1.2; }
.pl-meta p { margin: 0; color: var(--muted); }
.pl-meta .note { font-size: 12px; margin-top: 6px; }
.pl-actions { display: flex; gap: 18px; }
.seek, .vol { width: 100%; }
.times { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.controls { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.controls .icon[aria-pressed="true"] { color: var(--accent); }
.play { width: 68px; height: 68px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 26px; display: grid; place-items: center; box-shadow: 0 10px 30px rgba(255,178,91,.35); }
.vol { display: flex; align-items: center; gap: 6px; margin-top: auto; height: 44px; }
.vol input { opacity: 0; pointer-events: none; transition: opacity .2s; }
.vol.open input { opacity: 1; pointer-events: auto; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 22px; height: 22px; fill: currentColor; display: block; }
.icon.big .ic { width: 30px; height: 30px; }
.play .ic { width: 32px; height: 32px; }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: none; --p: 0%; }
input[type=range]::-webkit-slider-runnable-track { height: 5px; border-radius: 5px; background: linear-gradient(to right, var(--accent) var(--p), var(--glass-line) var(--p)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6.5px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
input[type=range]::-moz-range-track { height: 5px; border-radius: 5px; background: var(--glass-line); }
input[type=range]::-moz-range-progress { height: 5px; border-radius: 5px; background: var(--accent); }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: #fff; }

.sheet { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; }
.sheet-card { width: 100%; max-height: 70vh; overflow: auto; border-radius: 24px 24px 0 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); animation: rise .22s ease-out; background: var(--ink-2); }
.sheet-card h3 { margin: 0 0 10px; }
.new { display: flex; gap: 8px; margin: 6px 0 12px; }
input[type=text] { flex: 1; padding: 11px 14px; font: inherit; color: var(--text); background: var(--glass); border: 1px solid var(--glass-line); border-radius: 12px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 40; padding: 10px 16px; border-radius: 999px; background: var(--text); color: var(--ink); font-size: 14px; }
.spin { width: 28px; height: 28px; margin: 40px auto; border: 3px solid var(--glass-line); border-top-color: var(--accent); border-radius: 50%; animation: sp .8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.section { margin: 8px 2px 10px; font-size: 18px; }
.drawer { position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, .45); animation: fade .18s ease-out; }
.drawer-panel { position: absolute; left: 0; top: 0; bottom: 0; width: min(78vw, 300px); display: flex; flex-direction: column; gap: 6px; padding: calc(18px + env(safe-area-inset-top)) 14px 18px; background: var(--ink-2); border-right: 1px solid var(--glass-line); animation: slide .22s ease-out; }
.drawer-title { margin: 4px 10px 14px; font-size: 20px; }
.drawer-item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 12px; border-radius: 14px; text-align: left; font-size: 16px; }
.drawer-item:active, .drawer-item.on { background: var(--glass); }
.drawer-item.on { color: var(--accent); }
@keyframes slide { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
