:root {
  --bg: #0e1014;
  --bg-2: #151920;
  --bg-3: #1c2129;
  --line: rgba(255, 255, 255, .08);
  --text: #eef1f6;
  --text-2: #9aa4b2;
  --text-3: #6b7484;
  --accent: #59d3a4;
  --accent-2: #7aa2ff;
  --player-h: 92px;
  --side-w: 232px;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 15% -10%, #1b2a2a 0%, transparent 60%), var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; }

.app { display: flex; height: 100vh; height: 100dvh; padding-bottom: var(--player-h); }

/* ---------- 侧边筛选 ---------- */
.sidebar {
  width: var(--side-w); flex: 0 0 var(--side-w);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent 40%);
  overflow: hidden;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 16px 12px; }
.logo {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #08110d; font-size: 18px;
}
.brand h1 { font-size: 15px; margin: 0; letter-spacing: .5px; }
.brand p { margin: 0; font-size: 11px; color: var(--text-3); }
.filters { overflow-y: auto; padding: 4px 10px 12px; flex: 1; }
.fgroup { margin-bottom: 6px; }
.fgroup h3 {
  font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase;
  letter-spacing: .8px; margin: 12px 6px 6px;
}
.fitem {
  display: flex; justify-content: space-between; gap: 8px; width: 100%;
  padding: 5px 8px; border-radius: 8px; color: var(--text-2); font-size: 13px; text-align: left;
}
.fitem:hover { background: var(--bg-3); color: var(--text); }
.fitem.on { background: rgba(89, 211, 164, .14); color: var(--accent); }
.fitem span:last-child { color: var(--text-3); font-size: 11px; }
.sidefoot { padding: 10px; border-top: 1px solid var(--line); }
.ghost {
  width: 100%; padding: 8px; border-radius: 10px; border: 1px solid var(--line);
  color: var(--text-2); background: var(--bg-2);
}
.ghost:hover { color: var(--text); border-color: rgba(255,255,255,.2); }

/* ---------- 主区 ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; gap: 10px; align-items: center; padding: 14px 18px 8px;
}
.search { flex: 1; }
.search input {
  width: 100%; padding: 10px 14px; border-radius: 999px; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line); outline: none;
}
.search input:focus { border-color: rgba(89,211,164,.45); background: var(--bg-3); }
.sort {
  background: var(--bg-2); color: var(--text-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 9px 12px; outline: none;
}
.active-row { display: flex; align-items: center; gap: 12px; padding: 4px 18px 8px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.chip {
  display: inline-flex; gap: 6px; align-items: center; font-size: 12px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(122,162,255,.12); color: var(--accent-2);
}
.chip b { font-weight: 500; color: var(--text-2); }
.count { color: var(--text-3); font-size: 12px; white-space: nowrap; }

.songlist {
  list-style: none; margin: 0; padding: 0 10px 12px; flex: 1; overflow-y: auto; overflow-x: hidden;
}
.row {
  display: grid;
  grid-template-columns: 30px 46px minmax(0,1.6fr) minmax(0,1fr) 62px 66px;
  gap: 12px; align-items: center;
  padding: 7px 10px; border-radius: 10px; cursor: pointer;
}
.row:hover { background: var(--bg-2); }
.row.on { background: rgba(89,211,164,.1); }
.row.on .r-title { color: var(--accent); }
.r-idx { color: var(--text-3); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.r-cover {
  width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: var(--bg-3);
}
.r-title { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-sub { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-album { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-dur { font-size: 12px; color: var(--text-3); text-align: right; font-variant-numeric: tabular-nums; }
.r-badge {
  font-size: 11px; color: var(--text-3); border: 1px solid var(--line);
  border-radius: 6px; padding: 1px 5px; justify-self: start;
}
.r-badge.s { color: #ffd479; border-color: rgba(255,212,121,.3); }
.listfoot { padding: 0 18px 14px; display: flex; justify-content: center; }
.listfoot p { color: var(--text-3); }

/* ---------- 抽屉 ---------- */
.drawer {
  position: fixed; top: 0; right: 0; bottom: var(--player-h); width: min(420px, 92vw);
  background: var(--bg-2); border-left: 1px solid var(--line);
  transform: translateX(102%); transition: transform .28s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column; z-index: 40;
  box-shadow: -20px 0 60px rgba(0,0,0,.45);
}
.drawer.open { transform: none; }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.drawer-tabs { display: flex; gap: 4px; }
.tab { padding: 6px 12px; border-radius: 8px; color: var(--text-3); font-size: 13px; }
.tab.active { background: var(--bg-3); color: var(--text); }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px 28px; }
.pane { display: none; }
.pane.active { display: block; }

.lyric { white-space: pre-wrap; line-height: 2; color: var(--text-3); font-size: 14px; }
.lyric-tools {
  position: sticky; top: -16px; z-index: 2; display: flex; flex-wrap: wrap; gap: 6px;
  align-items: center; padding: 8px 0 10px; margin: -4px 0 4px;
  background: var(--bg-2); border-bottom: 1px solid var(--line);
}
.lyric-tools .lbl { font-size: 11px; color: var(--text-3); margin-right: 2px; }
.lyric-tools button {
  font-size: 12px; padding: 3px 9px; border-radius: 7px;
  background: var(--bg-3); color: var(--text-2);
}
.lyric-tools button:hover { color: var(--text); background: #262c36; }
.lyric-tools .val { font-size: 12px; color: var(--accent); margin-left: auto; font-variant-numeric: tabular-nums; }
.lyric .ln { transition: color .2s, transform .2s; transform-origin: left; padding: 2px 0; }
.lyric .ln.active { color: var(--accent); font-weight: 600; }
.lyric .ln:hover { color: var(--text); cursor: pointer; }
.lyric .plain { color: var(--text-2); }

.story h4, .artist h4 { margin: 0 0 8px; font-size: 16px; }
.story .meta, .artist .meta { color: var(--text-3); font-size: 12px; margin-bottom: 14px; }
.story p, .artist p { color: var(--text-2); line-height: 1.85; margin: 0 0 12px; }
.tagsrow { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 16px; }
.tg { font-size: 11px; padding: 3px 9px; border-radius: 999px; background: var(--bg-3); color: var(--text-2); }
.morelist { list-style: none; padding: 0; margin: 6px 0 0; }
.morelist li { padding: 6px 0; border-bottom: 1px solid var(--line); color: var(--text-2); font-size: 13px; cursor: pointer; }
.morelist li:hover { color: var(--accent); }
.srcline { font-size: 11px; color: var(--text-3); margin-top: 14px; }

/* ---------- 播放器 ---------- */
.player {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--player-h);
  display: grid; grid-template-columns: minmax(180px, 1fr) minmax(320px, 2fr) minmax(150px, 1fr);
  gap: 16px; align-items: center; padding: 0 18px;
  background: rgba(16,19,24,.92); backdrop-filter: blur(18px);
  border-top: 1px solid var(--line); z-index: 50;
}
.now { display: flex; gap: 12px; align-items: center; min-width: 0; }
.now img { width: 54px; height: 54px; border-radius: 10px; object-fit: cover; background: var(--bg-3); }
.np-meta { min-width: 0; }
.np-title { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-artist { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.controls { display: flex; flex-direction: column; gap: 6px; }
.btns { display: flex; align-items: center; justify-content: center; gap: 6px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  color: var(--text-2); font-size: 15px;
}
.icon-btn:hover { background: var(--bg-3); color: var(--text); }
.icon-btn.on { color: var(--accent); }
.play-btn {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--text); color: #0b0d10; font-size: 15px;
}
.play-btn:hover { transform: scale(1.04); }
.seek-row { display: flex; align-items: center; gap: 10px; }
.t { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; width: 38px; text-align: center; }
.seek { position: relative; flex: 1; height: 18px; display: flex; align-items: center; cursor: pointer; }
.seek::before { content: ""; position: absolute; left: 0; right: 0; height: 4px; border-radius: 2px; background: var(--bg-3); }
.buffered { position: absolute; left: 0; height: 4px; border-radius: 2px; background: rgba(255,255,255,.14); width: 0; }
.bar { position: absolute; left: 0; height: 4px; border-radius: 2px; background: var(--accent); width: 0; }
.bar .dot {
  position: absolute; right: -6px; top: 50%; width: 12px; height: 12px; margin-top: -6px;
  border-radius: 50%; background: var(--text); opacity: 0; transition: opacity .15s;
}
.seek:hover .bar .dot { opacity: 1; }
.extras { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.vol { display: flex; align-items: center; gap: 6px; }
.vol input[type=range] { width: 84px; accent-color: var(--accent); }

.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 35; }
.only-mobile { display: none; }

/* ---------- 移动端 ---------- */
@media (max-width: 860px) {
  :root { --player-h: 128px; }
  .only-mobile { display: grid; }
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 45; width: 82vw; max-width: 320px;
    background: var(--bg-2); transform: translateX(-102%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
  }
  .sidebar.open { transform: none; }
  .topbar { padding: 10px 12px 6px; }
  .active-row { padding: 2px 12px 6px; }
  .songlist { padding: 0 4px 8px; }
  .row { grid-template-columns: 22px 44px minmax(0,1fr) 54px; gap: 8px; padding: 8px 8px; }
  .r-album, .r-badge { display: none; }
  .r-cover { width: 44px; height: 44px; }
  .player {
    grid-template-columns: 1fr; grid-template-rows: auto auto;
    gap: 2px; padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
    height: var(--player-h);
  }
  .now { padding-top: 2px; }
  .now img { width: 42px; height: 42px; }
  .controls { gap: 0; }
  .seek-row { order: 2; }
  .btns { gap: 18px; }
  .extras { position: absolute; right: 12px; top: 14px; }
  .vol { display: none; }
  .drawer { width: 100%; bottom: 0; top: auto; height: 78vh; border-radius: 18px 18px 0 0; transform: translateY(102%); }
  .drawer.open { transform: none; }
  .lyric { font-size: 15px; }
}
@media (max-width: 420px) {
  .btns { gap: 12px; }
  .sort { display: none; }
}
