:root {
  --bg: #0b0b10;
  --bg-elev: rgba(28, 28, 35, 0.72);
  --bg-elev-2: rgba(40, 40, 50, 0.9);
  --fg: #f5f5f7;
  --fg-dim: #9b9ba6;
  --accent: #fa2c56;
  --accent-2: #7a5cff;
  --line: rgba(255, 255, 255, 0.09);
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --mini-h: 62px;
  --nav-h: 54px;
}

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

/* iOS 上双击会被当成缩放手势，把第一次点击吞掉；按钮统一走「立即响应」 */
html,
body,
button,
.tab,
.row,
.chip,
.mini,
.pl-item,
.pl-song,
.sheet-item,
.nav-item {
  touch-action: manipulation;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  /* iOS 独立模式（加到主屏幕）里 100% 算出来会比真实屏幕矮一截，
     底下就露一条系统黑边；-webkit-fill-available 会按实际 webview 高度算 */
  min-height: 100%;
  min-height: -webkit-fill-available;
  width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Helvetica Neue", "Microsoft YaHei", sans-serif;
  overscroll-behavior-y: none;
}

body {
  padding-bottom: calc(var(--nav-h) + var(--mini-h) + var(--safe-b) + 20px);
}

/* 背景光晕层 */
.bg-blur {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(45% 35% at 20% 10%, rgba(250, 44, 86, 0.28), transparent 70%),
    radial-gradient(45% 35% at 85% 20%, rgba(122, 92, 255, 0.24), transparent 70%),
    radial-gradient(50% 40% at 50% 90%, rgba(0, 180, 200, 0.14), transparent 70%);
  filter: blur(20px) saturate(120%);
  background-size: cover;
  background-position: center;
  transition: background-image 0.6s ease;
}

/* 底部 140px 渐渐收成纯黑：iOS 独立模式下系统可能在屏幕最底下留一条自己涂色的带子，
   页面画不进去，但只要自家底部本来就是纯黑，那条带子和页面就接成一片，看不出边界。 */
.bg-blur::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 140px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.55) 55%, #000 100%);
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: calc(var(--safe-t) + 10px) 16px 8px;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: linear-gradient(to bottom, rgba(11, 11, 16, 0.92), rgba(11, 11, 16, 0.62));
  border-bottom: 1px solid var(--line);
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar h1 {
  font-size: 26px;
  letter-spacing: 0.5px;
  margin: 4px 0 10px;
  font-weight: 700;
}

.chip {
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--fg);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  flex: 0 0 auto;
  transition: transform 0.12s ease, background 0.2s ease;
}
.chip:active { transform: scale(0.95); }
.chip.small { padding: 5px 11px; font-size: 12px; color: var(--fg-dim); }

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 0 0 auto;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid transparent;
  color: var(--fg-dim);
  font-size: 13.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.18s ease;
}
.tab.active {
  background: var(--fg);
  color: #111;
  font-weight: 600;
}

.searchbar {
  display: flex;
  gap: 8px;
  width: 100%;
  padding-bottom: 4px;
}

.searchbar input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  color: var(--fg);
  font-size: 16px;
  outline: none;
  -webkit-appearance: none;
}
.searchbar input::placeholder { color: rgba(255, 255, 255, 0.35); }
.searchbar input:focus { border-color: rgba(250, 44, 86, 0.55); background: rgba(255, 255, 255, 0.11); }

.searchbar button {
  flex: 0 0 auto;
  border: none;
  border-radius: 12px;
  padding: 0 18px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.searchbar button:active { opacity: 0.8; }

/* ---------- 结果列表 ---------- */
.results {
  padding: 8px 10px 24px;
}

.empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--fg-dim);
  line-height: 1.9;
}
.empty .muted { font-size: 12.5px; opacity: 0.65; }

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.row:active { background: rgba(255, 255, 255, 0.07); }
.row.playing { background: rgba(250, 44, 86, 0.12); }
.row.playing .row-title { color: var(--accent); }

.row-idx {
  width: 22px;
  text-align: center;
  color: var(--fg-dim);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}
.row-main { flex: 1; min-width: 0; }
.row-title {
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-sub {
  font-size: 12.5px;
  color: var(--fg-dim);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-dur {
  font-size: 12px;
  color: var(--fg-dim);
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}

.loading-row {
  text-align: center;
  color: var(--fg-dim);
  padding: 36px;
  font-size: 14px;
}

/* ---------- 迷你播放条 ---------- */
.mini {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: calc(var(--nav-h) + var(--safe-b) + 8px);
  height: var(--mini-h);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 18px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.2s;
}
.mini.hidden { transform: translateY(140%); opacity: 0; pointer-events: none; }

.mini-cover {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #222;
  object-fit: cover;
  flex: 0 0 auto;
}
.mini-meta { flex: 1; min-width: 0; }
.mini-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-sub {
  font-size: 12px;
  color: var(--fg-dim);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-btn {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  flex: 0 0 auto;
}

/* ---------- 全屏播放器 ---------- */
/* 结构说明：.player 只负责「铺满整个初始包含块」并画不透明底色，
   真正的内容在 .player-inner 里、由 JS 按 visualViewport 摆位。
   这样无论 iOS 报的可视高度是多少，底下都不会露出一条黑边。 */
.player {
  position: fixed;
  inset: 0;
  min-height: -webkit-fill-available;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  z-index: 60;
  display: block;
  /* 与 iOS 独立模式底部那条系统色带同色（纯黑），任何缝隙都看不见 */
  background: #000;
  transition: transform 0.36s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.24s;
}
.player.hidden { transform: translateY(100%); opacity: 0; pointer-events: none; }

/* 底部渐隐：把模糊封面顺滑过渡到纯黑，避免与系统色带之间出现一条「红线」
   （iOS 独立模式下 webview 高度可能比屏幕少一个状态栏的高，那部分由系统涂色，
    页面画不进去，只能让自家底部的颜色接上去） */
.player::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 240px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.55) 45%, rgba(0, 0, 0, 0.92) 78%, #000 100%);
  pointer-events: none;
  z-index: 1;
}

/* 内容层：默认铺满，播放器打开时 JS 写 top/height/left/width（可视视口像素值） */
.player-inner {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-t) + 10px) 20px calc(var(--safe-b) + 14px);
  box-sizing: border-box;
  overflow: hidden;
  z-index: 2;
  background: rgba(8, 8, 12, 0.86);
  backdrop-filter: blur(40px) saturate(160%);
  -webkit-backdrop-filter: blur(40px) saturate(160%);
}

/* 打开全屏播放器时锁住页面滚动。
   注意：不要用 body{position:fixed} —— iOS 独立模式下那样做会让 webview 高度变短、
   屏幕底部露出系统黑边。这里只关掉滚动 + 拦住 touchmove（见 app.js）。 */
html.player-open,
body.player-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}

/* 背景图故意「过扫」到边界之外，任何视口差异都不会露出底色 */
.player-bg {
  position: absolute;
  inset: -18%;
  z-index: -1;
  background-size: cover;
  background-position: center;
  filter: blur(60px) brightness(0.42) saturate(150%);
  opacity: 0.92;
  transform: scale(1.12);
}

.player-head {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
}
.player-head-meta { flex: 1; text-align: center; min-width: 0; }
.line { font-size: 12px; color: var(--fg-dim); letter-spacing: 0.4px; }

.icon-btn {
  position: relative;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
/* 视觉上 34px，实际可点区域扩到 48px：刘海屏上小圆钮很点不准 */
.icon-btn::before {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: 50%;
}

.player-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-top: 12px;
}

.cover-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}
.cover {
  width: min(62vw, 260px);
  aspect-ratio: 1;
  border-radius: 18px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

.track { text-align: center; margin-bottom: 10px; }
.track-title {
  font-size: 19px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.track-artist { font-size: 13px; color: var(--fg-dim); margin-top: 5px; }

.lyric {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 82%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 82%, transparent);
  scrollbar-width: none;
}
.lyric::-webkit-scrollbar { display: none; }
.lyric-inner { padding: 40% 0; }

.lyric-line {
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.42);
  text-align: center;
  padding: 7px 6px;
  transition: color 0.25s ease, transform 0.25s ease;
  transform-origin: center;
}
.lyric-line.active {
  color: #fff;
  font-weight: 600;
  transform: scale(1.04);
}
.lyric-line .tr {
  display: block;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 3px;
  font-weight: 400;
}
.lyric-empty { text-align: center; color: var(--fg-dim); font-size: 14px; }

.player-foot { flex: 0 0 auto; padding-top: 6px; }

/* 底部「收起」：不依赖顶部安全区，任何机型都点得到 */
.close-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 10px auto 0;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-dim);
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 999px;
  touch-action: manipulation;
  cursor: pointer;
}
.close-pill:active { background: rgba(255, 255, 255, 0.16); }

.progress {
  display: flex;
  align-items: center;
  gap: 8px;
}
.time {
  font-size: 11px;
  color: var(--fg-dim);
  font-variant-numeric: tabular-nums;
  width: 34px;
  text-align: center;
  flex: 0 0 auto;
}
.seek {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
  outline: none;
}
.seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin: 16px 0 6px;
}
.round {
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 19px;
  cursor: pointer;
}
.round.primary {
  width: 66px;
  height: 66px;
  background: #fff;
  color: #111;
  font-size: 24px;
}
.round:active { transform: scale(0.94); }

.served {
  text-align: center;
  font-size: 11px;
  color: var(--fg-dim);
  min-height: 16px;
  margin-top: 4px;
  opacity: 0.75;
}

/* ---------- 音源抽屉 ---------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.5);
  transition: opacity 0.22s;
}
.drawer.hidden { opacity: 0; pointer-events: none; }

.drawer-panel {
  width: 100%;
  max-height: 82vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #16161d;
  border-radius: 22px 22px 0 0;
  padding: 16px 18px calc(var(--safe-b) + 20px);
  border-top: 1px solid var(--line);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.drawer.hidden .drawer-panel { transform: translateY(100%); }

.drawer-head { display: flex; align-items: center; justify-content: space-between; }
.drawer-head h2 { font-size: 17px; margin: 0; }

.hint { font-size: 12px; color: var(--fg-dim); line-height: 1.6; margin: 10px 0 14px; }

.source-list { display: flex; flex-direction: column; gap: 8px; }

.source-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
}
.source-item.bad { opacity: 0.55; }
.source-item .sname { font-size: 14px; font-weight: 600; }
.source-item .sdesc {
  font-size: 11.5px;
  color: var(--fg-dim);
  margin-top: 4px;
  line-height: 1.5;
  word-break: break-all;
}
.source-item .stags { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.tag {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg-dim);
}
.tag.ok { color: #6ee7a8; background: rgba(110, 231, 168, 0.12); }
.tag.err { color: #ff8080; background: rgba(255, 90, 90, 0.14); }

.drawer-btn {
  width: 100%;
  margin-top: 16px;
  padding: 13px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
  color: var(--fg);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--mini-h) + var(--safe-b) + 22px);
  transform: translate(-50%, 20px);
  max-width: 86vw;
  background: rgba(20, 20, 26, 0.95);
  border: 1px solid var(--line);
  color: var(--fg);
  font-size: 13px;
  line-height: 1.5;
  padding: 11px 15px;
  border-radius: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s, transform 0.24s;
  z-index: 90;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- iOS 兜底：safe-area 读不到时（Safari 标签页 / 页面已滚动）env() 会变成 0，
   顶部按钮被顶进状态栏的点击盲区，出现「按了没反应」，所以给一个最小安全距离 ---------- */
@supports (-webkit-touch-callout: none) {
  .player-inner {
    /* 状态栏改成「不透明白字黑底」后，webview 从状态栏下面开始，safe-t 会是 0；
       只有真拿到安全区（说明内容铺到了状态栏底下）时才补够 76px 躲开灵动岛 */
    padding-top: calc(var(--safe-t) + max(10px, var(--safe-t)));
  }
  .topbar {
    padding-top: calc(var(--safe-t) + max(8px, var(--safe-t)));
  }
  .mini {
    bottom: calc(var(--nav-h) + max(8px, calc(var(--safe-b) + 8px)));
  }
  .nav {
    padding-bottom: max(6px, var(--safe-b));
  }
}

/* ================= 登录页 ================= */
.login {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(120% 80% at 50% 0%, rgba(122, 92, 255, 0.22), transparent 60%), var(--bg);
}
.login.hidden { display: none; }

.login-card {
  width: 100%;
  max-width: 360px;
  padding: 26px 22px 22px;
  border-radius: 24px;
  background: rgba(26, 26, 34, 0.72);
  border: 1px solid var(--line);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.login-logo {
  width: 58px;
  height: 58px;
  margin: 0 auto 12px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 26px rgba(250, 44, 86, 0.35);
}
.login-title {
  margin: 0;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 1px;
}
.login-sub {
  margin: 6px 0 20px;
  text-align: center;
  font-size: 13px;
  color: var(--fg-dim);
}

.login-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}
.login-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--fg-dim);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 0;
  border-radius: 11px;
  touch-action: manipulation;
}
.login-tab.active {
  background: rgba(255, 255, 255, 0.92);
  color: #111;
}

.login-form { display: flex; flex-direction: column; gap: 10px; }
.field { display: block; }
.field input {
  width: 100%;
  padding: 13px 14px;
  font-size: 16px; /* iOS 上 <16px 会触发聚焦缩放 */
  color: var(--fg);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
}
.field input:focus { border-color: rgba(250, 44, 86, 0.6); background: rgba(255, 255, 255, 0.1); }
.login-btn {
  margin-top: 4px;
  padding: 13px 0;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 24px rgba(250, 44, 86, 0.3);
  touch-action: manipulation;
}
.login-btn:disabled { opacity: 0.6; }
.login-note {
  margin: 14px 0 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--fg-dim);
  text-align: center;
}
.login-note code { font-size: 11px; opacity: 0.9; }

/* ================= 页面骨架 ================= */
.app.hidden { display: none; }
.page { padding-bottom: 4px; }
.page.hidden { display: none; }

.page-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(var(--safe-t) + 14px) 16px 10px;
}
.head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.head-actions .chip {
  flex: 0 0 auto;
  white-space: nowrap;
}
.page-head h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.5px;
  flex: 1;
}
.page-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;}
.back-btn {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  flex: 0 0 auto;
}
.section-title {
  margin: 18px 16px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-dim);
  letter-spacing: 0.6px;
}

/* ================= 我的 ================= */
.me-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 16px 0;
  padding: 14px;
  border-radius: 18px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
}
.me-avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  flex: 0 0 auto;
}
.me-meta { flex: 1; min-width: 0; }
.me-name { font-size: 16px; font-weight: 600; }
.me-sub { font-size: 12px; color: var(--fg-dim); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pl-list { padding: 0 12px 8px; }
.pl-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 8px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  touch-action: manipulation;
}
.pl-item:active { background: rgba(255, 255, 255, 0.08); }
.pl-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex: 0 0 auto;
  background: linear-gradient(135deg, rgba(250, 44, 86, 0.85), rgba(122, 92, 255, 0.85));
  color: #fff;
}
.pl-icon.builtin { background: linear-gradient(135deg, #ff5b7f, #ff8fa3); }
.pl-main { flex: 1; min-width: 0; }
.pl-name {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pl-sub { font-size: 12px; color: var(--fg-dim); margin-top: 3px; }
.pl-go { color: var(--fg-dim); font-size: 18px; flex: 0 0 auto; }

/* ================= 收藏夹歌曲列表 ================= */
.list-songs { padding: 4px 12px 16px; }
.pl-song {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 14px;
  touch-action: manipulation;
}
.pl-song:active { background: rgba(255, 255, 255, 0.06); }
.pl-song.playing .ps-title { color: var(--accent); }
.pl-cover {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.07);
  flex: 0 0 auto;
}
.ps-main { flex: 1; min-width: 0; }
.ps-title {
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ps-artist {
  font-size: 12.5px;
  color: var(--fg-dim);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ps-more {
  border: none;
  background: transparent;
  color: var(--fg-dim);
  font-size: 18px;
  padding: 6px 8px;
  flex: 0 0 auto;
  touch-action: manipulation;
}
.list-empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--fg-dim);
  font-size: 13px;
  line-height: 1.8;
}

/* 搜索结果行里的「＋收藏」 */
.row-add {
  border: none;
  background: transparent;
  color: var(--fg-dim);
  font-size: 18px;
  padding: 4px 6px;
  flex: 0 0 auto;
  touch-action: manipulation;
}
.row-add:active { color: var(--fg); }

/* ================= 底部导航 ================= */
.nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex;
  z-index: 45;
  background: rgba(14, 14, 20, 0.88);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}
.nav-item {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--fg-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  padding: 6px 0;
  touch-action: manipulation;
}
.nav-item.active { color: var(--fg); }
.nav-item.active svg { stroke: var(--accent); }

/* ================= 收藏夹选择面板 ================= */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 75;
  display: flex;
  align-items: flex-end;
}
.sheet.hidden { display: none; }
.sheet-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}
.sheet-panel {
  position: relative;
  width: 100%;
  max-height: 78vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 16px calc(var(--safe-b) + 16px);
  border-radius: 22px 22px 0 0;
  background: rgba(22, 22, 30, 0.97);
  border-top: 1px solid var(--line);
  animation: sheet-up 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes sheet-up {
  from { transform: translateY(30px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sheet-head h2 { margin: 0; font-size: 16px; font-weight: 700; }
.sheet-list { margin: 10px 0 12px; }
.sheet-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  border-radius: 14px;
  touch-action: manipulation;
}
.sheet-item:active { background: rgba(255, 255, 255, 0.06); }
.sheet-item .si-name { flex: 1; min-width: 0; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-item .si-count { font-size: 12px; color: var(--fg-dim); flex: 0 0 auto; }
.sheet-item .si-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.6px solid rgba(255, 255, 255, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex: 0 0 auto;
}
.sheet-item.on .si-mark {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}

.player-head-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

/* 播放器里的收藏按钮：已收藏时变成实心红 */
.icon-btn.liked {
  background: var(--accent);
  color: #fff;
}
.icon-btn.liked svg { fill: currentColor; stroke: currentColor; }

/* 弹层里的输入框（新建 / 重命名收藏夹） */
.prompt-form { display: flex; flex-direction: column; gap: 12px; padding: 4px 2px 6px; }
.prompt-input {
  width: 100%;
  padding: 13px 14px;
  font-size: 16px;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
}
.prompt-input:focus { border-color: rgba(250, 44, 86, 0.6); }
.prompt-actions { display: flex; gap: 10px; }
.prompt-actions button {
  flex: 1;
  padding: 12px 0;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 13px;
  touch-action: manipulation;
}
.prompt-cancel { background: rgba(255, 255, 255, 0.1); color: var(--fg); }
.prompt-ok { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }

/* ---------- 诊断浮层（只在地址带 ?diag=1 时出现，平时没有入口） ---------- */

#diag {
  position: fixed;
  left: 6px;
  right: 6px;
  bottom: calc(var(--safe-b) + 6px);
  z-index: 999;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #7dffb3;
  font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre;
  pointer-events: none;
}

/* ---------- 播放器中间区域：封面 ⇄ 歌词（轻点切换，默认封面） ---------- */
#player-stage { position: relative; touch-action: manipulation; }
#player-stage.mode-lyric > .cover-wrap,
#player-stage.mode-lyric > .track { display: none; }
#player-stage:not(.mode-lyric) > .lyric { display: none; }
#player-stage > .cover-wrap,
#player-stage > .track,
#player-stage > .lyric { animation: stage-in 0.26s ease both; }
#player-stage.mode-lyric > .lyric { padding-top: 4px; }
/* 歌词占满整个中间区时，上下留白要让「当前行」落在正中 */
#player-stage.mode-lyric .lyric-inner { padding: 37vh 0; }
@keyframes stage-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
