:root {
  --bg: #0b1020;
  --bg2: #131a33;
  --card: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.1);
  --fg: #f2f5ff;
  --muted: #9aa4c4;
  --accent: #6c8cff;
  --accent2: #22d3a6;
  --danger: #ff6b81;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, sans-serif;
  overscroll-behavior-y: none;
}

body {
  background-image:
    radial-gradient(120% 60% at 10% -10%, rgba(108, 140, 255, 0.28), transparent 60%),
    radial-gradient(100% 55% at 100% 0%, rgba(34, 211, 166, 0.18), transparent 55%);
  background-attachment: fixed;
  min-height: 100dvh;
}

#app {
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 14px calc(96px + var(--safe-b));
}

/* ---------- 顶栏 ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 10px; }
.logo {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  font-size: 22px; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #08111f; font-weight: 700;
}
.brand h1 { font-size: 18px; margin: 0; letter-spacing: .5px; }
.brand p { margin: 2px 0 0; font-size: 11px; color: var(--muted); max-width: 56vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip {
  border: 1px solid var(--line); background: var(--card); color: var(--fg);
  padding: 8px 12px; border-radius: 999px; font-size: 13px; white-space: nowrap;
}

/* ---------- 搜索 ---------- */
.searchbar { display: flex; gap: 8px; margin-bottom: 12px; }
.searchbar input {
  flex: 1; min-width: 0; background: var(--card); border: 1px solid var(--line);
  color: var(--fg); border-radius: 12px; padding: 12px 14px; font-size: 15px; outline: none;
}
.searchbar input::placeholder { color: #7f89a8; }
.searchbar button {
  border: 0; border-radius: 12px; padding: 0 16px; font-size: 15px; font-weight: 600;
  background: linear-gradient(135deg, var(--accent), #8b6cff); color: #fff;
}

/* ---------- 标签页 ---------- */
.tabs {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px;
  scrollbar-width: none; margin-bottom: 8px;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--card); color: var(--muted);
  padding: 9px 14px; border-radius: 999px; font-size: 13px; white-space: nowrap;
}
.tab.active { background: linear-gradient(135deg, var(--accent), #8b6cff); color: #fff; border-color: transparent; font-weight: 600; }

.moodrow { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; margin-bottom: 4px; }
.moodrow::-webkit-scrollbar { display: none; }
.mood {
  flex: 0 0 auto; border: 1px solid var(--line); background: rgba(255,255,255,.04);
  color: var(--muted); padding: 7px 12px; border-radius: 999px; font-size: 12px;
}
.mood.active { color: #cfe0ff; border-color: rgba(108,140,255,.6); background: rgba(108,140,255,.14); }
.settings {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; margin: 6px 0 10px;
}
.settings h3 { margin: 0 0 10px; font-size: 14px; }
.settings label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.settings input {
  display: block; width: 100%; margin-top: 6px; background: rgba(0,0,0,.25);
  border: 1px solid var(--line); color: var(--fg); border-radius: 10px; padding: 10px 12px;
  font-size: 13px; outline: none;
}
.settings-btns { display: flex; gap: 10px; }
.primary-btn {
  flex: 1; border: 0; border-radius: 10px; padding: 11px; font-size: 14px; font-weight: 600;
  background: linear-gradient(135deg, var(--accent), #8b6cff); color: #fff;
}
.checkline { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--muted); }
.checkline input { width: auto; margin: 2px 0 0; }
.tiny { font-size: 11px; color: var(--muted); margin: 10px 0 0; }
.tiny a { color: var(--accent); }
.customrow {
  display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted);
  background: rgba(34,211,166,.10); border: 1px solid rgba(34,211,166,.35);
  border-radius: 10px; padding: 6px 10px; margin-bottom: 6px;
}
.customrow span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-btn {
  border: 1px solid var(--line); background: rgba(255,255,255,.08); color: var(--fg);
  border-radius: 8px; padding: 4px 10px; font-size: 12px;
}

/* ---------- 列表 ---------- */
.list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
}
.row.playing { border-color: rgba(108,140,255,.75); background: rgba(108,140,255,.14); }
.row .idx { width: 22px; text-align: center; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.row img, .row .ph {
  width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex: 0 0 auto;
  background: linear-gradient(135deg, #2a3563, #1b2547); display: grid; place-items: center; color: #8ea3d8; font-size: 18px;
}
.row .meta { flex: 1; min-width: 0; }
.row .t { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.row .tag {
  flex: 0 0 auto; font-size: 10px; padding: 2px 7px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
}
.row .tag.full { color: #0c1a12; background: var(--accent2); border-color: transparent; font-weight: 700; }
.row .play {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.1); color: #fff; font-size: 14px;
}
.row.playing .play { background: linear-gradient(135deg, var(--accent), #8b6cff); }
.row .like { flex: 0 0 auto; background: none; border: 0; color: var(--muted); font-size: 17px; padding: 4px; }
.row .like.on { color: var(--danger); }

.loading, .empty { text-align: center; color: var(--muted); padding: 40px 10px; font-size: 13px; }
.spinner {
  display: inline-block; width: 14px; height: 14px; margin-right: 6px;
  border: 2px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%;
  animation: spin .8s linear infinite; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hint { color: var(--muted); font-size: 11.5px; text-align: center; margin-top: 18px; line-height: 1.7; }

/* ---------- 迷你条 ---------- */
.mini {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px calc(8px + var(--safe-b));
  background: rgba(16, 21, 40, .92); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.mini-progress { position: absolute; top: 0; left: 0; right: 0; height: 2px; background: rgba(255,255,255,.12); }
.mini-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.mini-art { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; background: #1b2547; }
.mini-meta { flex: 1; min-width: 0; }
.mini-meta div:first-child { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-meta div:last-child { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { background: none; border: 0; color: var(--fg); font-size: 18px; padding: 6px; line-height: 1; }
.icon-btn.big { font-size: 20px; }
.icon-btn.play {
  width: 54px; height: 54px; border-radius: 50%; font-size: 22px;
  background: linear-gradient(135deg, var(--accent), #8b6cff); color: #fff; box-shadow: 0 8px 24px rgba(108,140,255,.4);
}

/* ---------- 全屏播放器 ---------- */
.player {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #1a2246 0%, #0b1020 42%);
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px calc(14px + var(--safe-b));
  animation: slideUp .22s ease;
}
@keyframes slideUp { from { transform: translateY(18px); opacity: .4; } to { transform: none; opacity: 1; } }
.player-top { display: flex; align-items: center; justify-content: space-between; }
.p-src { font-size: 12px; color: var(--muted); }
.p-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 6px 0; }
.p-art-wrap { width: min(74vw, 300px); aspect-ratio: 1; position: relative; }
.p-art { width: 100%; height: 100%; border-radius: 20px; object-fit: cover; box-shadow: 0 18px 48px rgba(0,0,0,.5); }
.p-art-ph {
  position: absolute; inset: 0; border-radius: 20px; display: grid; place-items: center; font-size: 64px; color: #7f8fc0;
  background: linear-gradient(135deg, #2a3563, #1b2547);
}
.p-title { font-size: 19px; font-weight: 600; text-align: center; max-width: 100%; }
.p-artist { font-size: 13px; color: var(--muted); text-align: center; }
.p-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.p-badges span { font-size: 10.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; }
.seek { display: flex; align-items: center; gap: 10px; width: 100%; }
.seek span { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 38px; text-align: center; }
input[type="range"] { -webkit-appearance: none; appearance: none; flex: 1; height: 4px; border-radius: 99px; background: rgba(255,255,255,.16); outline: none; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.controls { display: flex; align-items: center; gap: 10px; }
.controls .icon-btn:not(.play) { font-size: 17px; }
.vol { display: flex; align-items: center; gap: 8px; width: 62%; }
.vol span { font-size: 14px; color: var(--muted); }
.ghost-btn {
  border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--muted);
  padding: 9px 16px; border-radius: 999px; font-size: 12.5px;
}
.lyrics {
  position: absolute; inset: 0; z-index: 5; overflow-y: auto; padding: 80px 22px 40px;
  background: rgba(9, 13, 28, .93); text-align: center;
}
.lyrics p { margin: 0 0 16px; font-size: 15px; color: #7d87a8; line-height: 1.5; }
.lyrics p.on { color: #fff; font-size: 17px; font-weight: 600; }

/* ---------- 队列面板 ---------- */
.sheet { position: fixed; inset: 0; z-index: 70; background: rgba(5,8,18,.6); display: flex; align-items: flex-end; }
.sheet-inner {
  width: 100%; max-width: 720px; margin: 0 auto; background: #131a33;
  border-radius: 20px 20px 0 0; padding: 14px 14px calc(16px + var(--safe-b));
  max-height: 76dvh; display: flex; flex-direction: column;
  animation: slideUp .22s ease;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sheet-head h2 { font-size: 16px; margin: 0; }
.queue-list { overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.queue-list .qrow {
  display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 10px;
  background: rgba(255,255,255,.04); font-size: 13px;
}
.queue-list .qrow.on { background: rgba(108,140,255,.18); }
.queue-list .qrow .meta { flex: 1; min-width: 0; }
.queue-list .qrow div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-list .qrow .s { font-size: 11px; color: var(--muted); }
