:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #15171c;
  --muted: #6b7280;
  --line: #e3e6eb;
  --accent: #e8590c;
  --accent-text: #ffffff;
  --row-hover: #f0f2f5;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111318;
    --surface: #1a1d24;
    --text: #eceef2;
    --muted: #9099a8;
    --line: #2a2f3a;
    --accent: #ff8a3d;
    --accent-text: #111318;
    --row-hover: #222631;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: 150px;
}
button, input { font: inherit; color: inherit; }

.top {
  position: sticky; top: 0; z-index: 2;
  display: flex; gap: 12px; align-items: center;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.top h1 { font-size: 18px; margin: 0; white-space: nowrap; }
#search {
  flex: 1; min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface);
}

button {
  border: 0; border-radius: 8px;
  background: var(--surface);
  padding: 8px 12px; cursor: pointer;
}
button.ghost { background: transparent; border: 1px solid var(--line); }
button[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.panel {
  margin: 12px 16px; padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px;
  display: grid; gap: 12px;
}
.panel label { display: grid; gap: 4px; }
.panel input[type=password] {
  padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
}
.hint { margin: 0; color: var(--muted); font-size: 13px; }
.drop {
  border: 2px dashed var(--line); border-radius: 12px;
  padding: 24px; text-align: center; color: var(--muted); cursor: pointer;
}
.drop.over { border-color: var(--accent); color: var(--text); }
.drop input { display: none; }
#uploadList { margin: 0; padding: 0; list-style: none; font-size: 13px; }
#uploadList li { padding: 4px 0; }

main { max-width: 900px; margin: 0 auto; padding: 8px 16px; }
.status { color: var(--muted); }
.tracks { list-style: none; margin: 0; padding: 0; }
.tracks li {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto auto; gap: 12px; align-items: center;
  padding: 10px 8px; border-radius: 8px; cursor: pointer;
}
.tracks li:hover { background: var(--row-hover); }
.tracks li.playing { color: var(--accent); }
.tracks .num { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.tracks .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tracks .a { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tracks .len { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.tracks .del { background: transparent; color: var(--muted); padding: 4px 8px; }

.player {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: 1fr auto 1fr; grid-template-areas: "now controls vol" "seek seek seek";
  gap: 8px 16px; align-items: center;
  padding: 12px 16px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.now { grid-area: now; min-width: 0; }
.now .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now .artist { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.controls { grid-area: controls; display: flex; gap: 8px; align-items: center; }
.controls button { background: transparent; font-size: 18px; }
.controls .big {
  background: var(--accent); color: var(--accent-text);
  width: 44px; height: 44px; border-radius: 50%; font-size: 16px;
}
.controls .small { font-size: 15px; }
.seek { grid-area: seek; display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.seek input { flex: 1; }
.volume { grid-area: vol; justify-self: end; width: 120px; }
input[type=range] { accent-color: var(--accent); }

.chips {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 10px 16px; max-width: 900px; margin: 0 auto;
}
.chips button { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 6px 14px; white-space: nowrap; }
.chips button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

.albums {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.album {
  display: grid; gap: 4px; text-align: left;
  background: transparent; padding: 0; border-radius: 10px; min-width: 0;
}
.album img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 10px; background: var(--surface);
}
.album .t { font-weight: 600; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.album .a { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.album:hover img { outline: 2px solid var(--accent); }

.album-head {
  display: grid; grid-template-columns: 160px 1fr; gap: 16px; align-items: end;
  margin-bottom: 16px;
}
.album-head #back { grid-column: 1 / -1; justify-self: start; }
.album-head img { width: 160px; height: 160px; object-fit: cover; border-radius: 12px; background: var(--surface); }
.album-info { display: grid; gap: 6px; min-width: 0; }
.album-info h2 { margin: 0; font-size: 22px; line-height: 1.2; }
.album-meta { display: flex; gap: 12px; font-size: 13px; }
.album-meta a, .credit a { color: var(--accent); }
.muted { color: var(--muted); }
button.primary { background: var(--accent); color: var(--accent-text); justify-self: start; font-weight: 600; }
.more { display: block; margin: 16px auto; }
.credit { color: var(--muted); font-size: 12px; text-align: center; margin: 24px 0 8px; }


.sc-add { display: flex; gap: 8px; margin-bottom: 12px; }
.sc-add input {
  flex: 1; min-width: 0; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
}
.artists { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.artists button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-size: 13px; }
.artists button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.sections { display: grid; gap: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.section-head h3 { margin: 0; font-size: 17px; }
.section-head .sub { color: var(--muted); font-size: 12px; font-weight: 400; margin-left: 8px; }
.section-head button { background: transparent; color: var(--accent); padding: 4px 0; font-size: 13px; }
.sections .albums { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.note { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.tracks .thumb { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: var(--surface); }
.tracks .badge {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; margin-left: 6px;
  vertical-align: 2px;
}
.tracks .ext { color: var(--accent); font-size: 12px; white-space: nowrap; text-decoration: none; }
.tracks .ext:hover { text-decoration: underline; }
.sc-widget {
  position: fixed; left: 0; right: 0; bottom: 104px; z-index: 3;
  padding: 0 16px 8px; background: var(--bg);
}
.sc-widget iframe { width: 100%; height: 120px; border: 0; border-radius: 8px; display: block; }
body.sc-on { padding-bottom: 290px; }

@media (max-width: 600px) {
  .sc-widget { bottom: 96px; }
  .tracks .ext { display: none; }
  .album-head { grid-template-columns: 110px 1fr; }
  .album-head img { width: 110px; height: 110px; }
  .albums { grid-template-columns: repeat(2, 1fr); }
  .player { grid-template-columns: 1fr auto; grid-template-areas: "now controls" "seek seek"; }
  .volume { display: none; }
  .controls .small { display: none; }
  .top h1 { display: none; }
}
