/* =============================================================
 * app.css — MusicHub 暗色玻璃：深紫底 + 粉紫/青渐变（#c77dff → #4dd0e1）点缀
 * 暗色「液态玻璃」：半透明深色面板 + backdrop blur/saturate，
 * 细白高光描边 + 柔和黑色投影。底部播放条固定暗色玻璃。
 * 动效用有回弹的弹簧曲线（--spring）。
 * ============================================================= */

/* ---------- Tokens ---------- */
:root {
  /* 背景与材质 — 深紫蓝底 */
  --bg-window:      #0a0a1a;
  --bg-sidebar:     rgba(13, 10, 30, 0.78);
  --bg-content:     #0d0d20;
  --bg-chrome:      rgba(13, 10, 30, 0.70);
  --bg-elevated:    #151530;
  --bg-hover:       rgba(199, 125, 255, 0.08);
  --bg-active:      rgba(199, 125, 255, 0.16);
  --bg-field:       rgba(199, 125, 255, 0.07);
  --bg-segment:     rgba(199, 125, 255, 0.06);
  --bg-segment-knob: #252048;

  /* 文字 */
  --fg:             #f0ecff;
  --fg-secondary:   #b8b0d4;
  --fg-tertiary:    #7a70a0;
  --fg-quaternary:  #504868;

  /* 强调色 — 粉紫 → 青渐变 */
  --accent:         #c77dff;
  --accent-hover:   #d990ff;
  --accent-soft:    rgba(199, 125, 255, 0.14);
  --accent-grad:    linear-gradient(135deg, #c77dff 0%, #4dd0e1 100%);

  /* 平台标识 */
  --tint-netease:   #e8413c;
  --tint-tencent:   #2ea7ff;
  --tint-bilibili:  #fb7299;
  --tint-hires:     #ff9a1f;
  --tint-kuwo:      #1fc66b;

  /* 线条 */
  --line:           rgba(199, 125, 255, 0.10);
  --line-strong:    rgba(199, 125, 255, 0.16);

  /* 液态玻璃投影（带微紫环境光） */
  --glass-shadow:   0 8px 30px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(199,125,255,0.06);
  --glass-shadow-lg:0 18px 60px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(199,125,255,0.08);

  /* 尺寸 */
  --sidebar-w:      232px;
  --toolbar-h:      54px;
  --playbar-h:      80px;
  --radius-sm:      5px;
  --radius:         8px;
  --radius-lg:      14px;

  /* 动效：有回弹的弹簧曲线 */
  --spring:         cubic-bezier(0.34, 1.56, 0.64, 1);
  --spring-soft:    cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out:       cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-press:      110ms;
  --dur-move:       440ms;
  --dur-sheet:      540ms;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: var(--bg-window);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text",
               "Segoe UI Variable Text", "Segoe UI",
               "PingFang SC", "Microsoft YaHei UI", "Hiragino Sans GB",
               system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background-image:
    radial-gradient(1100px 540px at 12% -8%, #15241b 0%, rgba(0,0,0,0) 60%),
    radial-gradient(980px 520px at 100% 0%, #1b1630 0%, rgba(0,0,0,0) 55%);
}

button, input, select, textarea { font: inherit; color: inherit; }

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
}

::selection { background: rgba(199,125,255,0.3); }

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.32); background-clip: content-box; }

/* 字阶 */
.t-title-lg { font-size: 28px; font-weight: 700; letter-spacing: -0.021em; line-height: 1.12; }
.t-title    { font-size: 20px; font-weight: 680; letter-spacing: -0.016em; line-height: 1.2; }
.t-headline { font-size: 15px; font-weight: 600; letter-spacing: -0.008em; }
.t-body     { font-size: 13px; font-weight: 400; letter-spacing: 0; }
.t-caption  { font-size: 11px; font-weight: 500; letter-spacing: 0.006em; }

/* =============================================================
 * 布局骨架
 * ============================================================= */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 1fr var(--playbar-h);
  grid-template-areas:
    "sidebar main"
    "playbar playbar";
  height: 100vh;
}

/* ---------- 侧栏（液态玻璃） ---------- */
.sidebar {
  grid-area: sidebar;
  background: var(--bg-sidebar);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  border-right: 1px solid var(--line);
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar__brand {
  height: var(--toolbar-h);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 16px;
  flex-shrink: 0;
}

.sidebar__mark {
  width: 22px; height: 22px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.sidebar__mark svg { width: 22px; height: 22px; display: block; }

.sidebar__name {
  font-size: 14px;
  font-weight: 660;
  letter-spacing: -0.01em;
}

.sidebar__scroll { flex: 1; overflow-y: auto; padding: 4px 0 16px; }

.nav-group { padding: 8px 10px 2px; }
.nav-group__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-tertiary);
  padding: 0 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  border-radius: var(--radius);
  color: var(--fg-secondary);
  text-align: left;
  transition: background var(--dur-press) var(--ease-out),
              color var(--dur-press) var(--ease-out),
              transform var(--dur-press) var(--ease-out);
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.85; }
.nav-item span { font-size: 13px; letter-spacing: -0.003em; }
.nav-item:hover { background: var(--bg-hover); color: var(--fg); }
.nav-item:active { transform: scale(0.985); }
.nav-item.is-active {
  background: var(--bg-active);
  color: var(--accent);
  font-weight: 580;
}
.nav-item.is-active svg { color: var(--accent); opacity: 1; }
.nav-item__count {
  margin-left: auto;
  font-size: 11px;
  color: var(--fg-tertiary);
  font-variant-numeric: tabular-nums;
}

/* ---------- 主区 ---------- */
.main {
  grid-area: main;
  position: relative;
  overflow: hidden;
  background: var(--bg-content);
  display: flex;
  flex-direction: column;
}

/* 工具条：浮动液态玻璃 */
.toolbar {
  height: var(--toolbar-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  background: var(--bg-chrome);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
  position: sticky;
  top: 0;
  z-index: 20;
}

.toolbar__nav { display: flex; gap: 2px; }
.icon-btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: var(--radius);
  color: var(--fg-secondary);
  transition: background var(--dur-press) var(--ease-out),
              color var(--dur-press) var(--ease-out),
              transform var(--dur-press) var(--ease-out);
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover:not(:disabled) { background: var(--bg-hover); color: var(--fg); }
.icon-btn:active:not(:disabled) { transform: scale(0.92); background: var(--bg-active); }
.icon-btn:disabled { opacity: 0.3; cursor: default; }

/* 搜索框 */
.search-field {
  position: relative;
  width: 280px;
  transition: width var(--dur-move) var(--spring);
}
.search-field:focus-within { width: 360px; }
.search-field svg.search-field__icon {
  position: absolute;
  left: 9px; top: 50%;
  transform: translateY(-50%);
  width: 13px; height: 13px;
  color: var(--fg-tertiary);
  pointer-events: none;
}
.search-field input {
  width: 100%;
  height: 30px;
  padding: 0 28px 0 28px;
  background: var(--bg-field);
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: -0.003em;
  outline: none;
  transition: background 150ms var(--ease-out), border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}
.search-field input::placeholder { color: var(--fg-tertiary); }
.search-field input:focus {
  background: #151530;
  border-color: rgba(199, 125, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(199, 125, 255, 0.12);
}
.search-field__clear {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--fg-secondary);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms var(--ease-out);
}
.search-field__clear svg { width: 11px; height: 11px; }
.search-field.has-value .search-field__clear { opacity: 1; pointer-events: auto; }
.search-field__clear:hover { background: rgba(255, 255, 255, 0.18); }

.toolbar__spacer { flex: 1; }

/* 导入按钮 */
.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--bg-field);
  color: var(--fg-secondary);
  font-size: 12.5px;
  font-weight: 520;
  letter-spacing: -0.003em;
  transition: background var(--dur-press) var(--ease-out), color var(--dur-press) var(--ease-out), transform var(--dur-press) var(--ease-out);
}
.chip-btn svg { width: 14px; height: 14px; }
.chip-btn:hover { background: var(--accent-soft); color: var(--accent); }
.chip-btn:active { transform: scale(0.96); }

/* ---------- 分段控件 (Segmented Control) ---------- */
.segmented {
  position: relative;
  display: inline-flex;
  padding: 3px;
  background: var(--bg-segment);
  border-radius: 9px;
  flex-shrink: 0;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.06);
}
.segmented__knob {
  position: absolute;
  top: 3px; left: 3px;
  height: calc(100% - 6px);
  background: var(--bg-segment-knob);
  border-radius: 7px;
  box-shadow: 0 1px 4px rgba(255, 255, 255, 0.14), 0 0 0 0.5px rgba(255, 255, 255, 0.04);
  transition: transform var(--dur-move) var(--spring),
              width var(--dur-move) var(--spring);
  pointer-events: none;
}
.segmented__item {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 13px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -0.002em;
  color: var(--fg-secondary);
  white-space: nowrap;
  transition: color 180ms var(--ease-out), transform var(--dur-press) var(--ease-out);
}
.segmented__item:active { transform: scale(0.96); }
.segmented__item.is-active { color: var(--accent); font-weight: 600; }
.segmented__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.segmented__dot--netease { background: var(--tint-netease); }
.segmented__dot--tencent { background: var(--tint-tencent); }
.segmented__dot--bilibili { background: var(--tint-bilibili); }
.segmented__dot--kuwo      { background: var(--tint-kuwo); }
.segmented__count {
  font-size: 10.5px;
  color: var(--fg-tertiary);
  font-variant-numeric: tabular-nums;
}
.segmented__item.is-active .segmented__count { color: var(--accent); }

/* ---------- 内容滚动区 ---------- */
.content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 22px 28px;
}

.page-head {
  padding: 20px 0 14px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
}
.page-head h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.021em;
  line-height: 1.12;
}
.page-head__sub {
  font-size: 12.5px;
  color: var(--fg-tertiary);
  padding-bottom: 3px;
}

.section-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 0 8px;
}
.section-bar h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 660;
  letter-spacing: -0.012em;
}
.section-bar__tint {
  width: 3px; height: 15px;
  border-radius: 2px;
  flex-shrink: 0;
}
.section-bar__meta {
  font-size: 11.5px;
  color: var(--fg-tertiary);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

/* =============================================================
 * 首页推荐歌单
 * ============================================================= */
.rec-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 6px 0 4px;
}
@media (min-width: 1100px) {            /* 宽屏多一列，更贴近洛雪密度 */
  .rec-grid { grid-template-columns: repeat(5, 1fr); gap: 16px; }
}
.rec-card {
  display: block;
  text-align: left;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  min-width: 0;
}
.rec-card__cover {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  width: 100%;
  border-radius: 14px;
  background: var(--bg-field, rgba(255, 255, 255, 0.06));
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.10);
  overflow: hidden;
  transition: transform 0.16s var(--ease-out, ease-out), box-shadow 0.16s var(--ease-out, ease-out);
}
.rec-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--bg-field, rgba(255, 255, 255, 0.06));
}
.rec-card__img.is-broken { opacity: 0; }   /* 加载失败：隐藏破图，回退容器底色，不显裂图 */
.rec-card__cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,0.6));
  opacity: 0;                              /* 蒙版仅 hover 显出，平时干净（去掉常驻脏感） */
  transition: opacity 0.18s var(--ease-out, ease-out);
}
.rec-card:hover .rec-card__cover::after { opacity: 1; }
.rec-card__play {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(199, 125, 255, 0.92);
  box-shadow: 0 4px 12px rgba(199, 125, 255, 0.4);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s var(--ease-out, ease-out);
}
.rec-card__play svg { width: 13px; height: 13px; }
.rec-card:hover .rec-card__cover {
  transform: translateY(-3px) scale(1.035);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}
.rec-card:hover .rec-card__play {
  opacity: 1;
  transform: translateY(0);
}
.rec-card__name {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.003em;
  color: var(--fg, #ffffff);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rec-card__meta {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--fg-tertiary, #b8b0d4);
}
.rec-card__meta svg {
  width: 11px;
  height: 11px;
  vertical-align: -1px;
  fill: currentColor;      /* 无 width/height 的裸 svg 默认 300x150，会把卡片撑出巨大空缺 */
}

/* 骨架微光（替代静态灰块，加载时更有「在加载」的质感） */
.skeleton {
  position: relative;
  border-radius: 14px;
  background: var(--bg-field, rgba(255,255,255,.06));
  overflow: hidden;
}
.skeleton.shimmer { aspect-ratio: 1 / 1; }
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* ---------- 歌单广场分类标签（横滑） ---------- */
.square-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 10px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.square-tabs::-webkit-scrollbar { display: none; }
.square-tab {
  flex-shrink: 0;
  scroll-snap-align: start;
  height: 30px;
  padding: 0 14px;
  border: none;
  border-radius: 999px;
  background: var(--bg-field, rgba(255,255,255,.06));
  color: var(--fg-secondary, #b8b0d4);
  font-size: 12.5px;
  font-weight: 520;
  cursor: pointer;
  transition: background .18s var(--ease-out, ease), color .18s var(--ease-out, ease), transform .18s var(--ease-out, ease);
}
.square-tab:hover { background: var(--accent-soft, rgba(199,125,255,.16)); color: var(--accent, #c77dff); }
.square-tab.is-active { background: var(--accent, #c77dff); color: #fff; }
.square-tab:active { transform: scale(0.96); }

/* 歌单详情页头部 */
.pl-detail {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 0 16px;
}
.pl-detail__cover {
  width: 108px;
  height: 108px;
  flex-shrink: 0;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
  background: var(--bg-field, rgba(255, 255, 255, 0.06));
}
.pl-detail__info { min-width: 0; }
.pl-detail__name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.012em;
  color: var(--fg, #ffffff);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}
.pl-detail__meta {
  font-size: 12px;
  color: var(--fg-tertiary, #b8b0d4);
  margin-bottom: 10px;
}
@media (max-width: 760px) {
  .rec-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =============================================================
 * 曲目列表
 * ============================================================= */
.track-list { display: flex; flex-direction: column; }

.track-head {
  display: grid;
  grid-template-columns: 34px 1fr 190px 150px 56px 34px;
  gap: 12px;
  align-items: center;
  padding: 0 10px 6px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-tertiary);
  position: sticky;
  top: 0;
  background: var(--bg-content);
  z-index: 5;
}
.track-head__num { text-align: center; }
.track-head__dur { text-align: right; }

.track-row {
  display: grid;
  grid-template-columns: 34px 1fr 190px 150px 56px 34px;
  gap: 12px;
  align-items: center;
  padding: 5px 10px;
  border-radius: var(--radius);
  cursor: default;
  transition: background var(--dur-press) var(--ease-out);
}
.track-row + .track-row { box-shadow: inset 0 1px 0 var(--line); }
.track-row:hover { background: var(--bg-hover); box-shadow: none; }
.track-row:hover + .track-row { box-shadow: none; }
.track-row.is-playing { background: var(--accent-soft); box-shadow: none; }
.track-row.is-playing + .track-row { box-shadow: none; }

.track-row__num {
  text-align: center;
  font-size: 12px;
  color: var(--fg-tertiary);
  font-variant-numeric: tabular-nums;
  position: relative;
}
.track-row:hover .track-row__num-text { opacity: 0; }
.track-row__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  color: var(--fg);
  transition: opacity 120ms var(--ease-out), transform var(--dur-press) var(--ease-out);
}
.track-row__play svg { width: 12px; height: 12px; fill: currentColor; }
.track-row:hover .track-row__play { opacity: 1; }
.track-row__play:active { transform: scale(0.86); }
.track-row.is-playing .track-row__num-text { opacity: 0; }
.track-row.is-playing .track-row__play { opacity: 1; color: var(--accent); }

/* 音柱 */
.eq-bars { display: flex; align-items: flex-end; gap: 1.5px; height: 11px; }
.eq-bars i {
  display: block;
  width: 2px;
  background: var(--accent);
  border-radius: 1px;
  animation: eq 900ms ease-in-out infinite;
  transform-origin: bottom;
}
.eq-bars i:nth-child(1) { height: 40%; animation-delay: 0ms; }
.eq-bars i:nth-child(2) { height: 90%; animation-delay: 180ms; }
.eq-bars i:nth-child(3) { height: 60%; animation-delay: 360ms; }
@keyframes eq {
  0%, 100% { transform: scaleY(0.4); }
  50%      { transform: scaleY(1); }
}

.track-row__main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.track-cover {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(255, 255, 255, 0.14), 0 0 0 0.5px rgba(255, 255, 255, 0.06);
}
.track-row__text { min-width: 0; }
.track-row__name {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.004em;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}
.track-row.is-playing .track-row__name { color: var(--accent); }
.track-row__alias { color: var(--fg-tertiary); font-weight: 400; }
.track-row__artist,
.track-row__album {
  font-size: 12.5px;
  color: var(--fg-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.002em;
}
.track-row__album { color: var(--fg-tertiary); }
.track-row__dur {
  text-align: right;
  font-size: 12px;
  color: var(--fg-tertiary);
  font-variant-numeric: tabular-nums;
}

.track-row__actions { display: flex; justify-content: center; }
.row-btn {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  color: var(--fg-tertiary);
  opacity: 0;
  transition: opacity 120ms var(--ease-out), color var(--dur-press) var(--ease-out), transform var(--dur-press) var(--ease-out);
}
.row-btn svg { width: 14px; height: 14px; }
.track-row:hover .row-btn { opacity: 1; }
.row-btn:hover { color: var(--fg); background: var(--bg-active); }
.row-btn:active { transform: scale(0.88); }
.row-btn.is-on { opacity: 1; color: var(--tint-netease); }
.row-btn.is-on svg { fill: currentColor; }

/* 平台角标 */
.badge {
  display: inline-flex;
  align-items: center;
  height: 15px;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  flex-shrink: 0;
}
.badge--netease { background: rgba(232, 65, 60, 0.12); color: #e8413c; }
.badge--tencent { background: rgba(46, 167, 255, 0.14); color: #2ea7ff; }
.badge--bilibili { background: rgba(251, 114, 153, 0.16); color: var(--tint-bilibili); }
.badge--kuwo      { background: rgba(31, 198, 107, 0.14); color: var(--tint-kuwo); }
.badge--hires   { background: rgba(255, 154, 31, 0.16); color: var(--tint-hires); }
.badge--dual {
  background: linear-gradient(135deg, rgba(232,65,60,0.14), rgba(46,167,255,0.14));
  color: var(--accent);
  font-weight: 700;
}

/* =============================================================
 * 状态块
 * ============================================================= */
.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 72px 20px;
  text-align: center;
}
.state svg { width: 30px; height: 30px; color: var(--fg-quaternary); }
.state__title { font-size: 14px; font-weight: 550; color: var(--fg-secondary); letter-spacing: -0.006em; }
.state__desc { font-size: 12.5px; color: var(--fg-tertiary); max-width: 440px; line-height: 1.55; }

.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 640ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 骨架 */
.skeleton-row {
  display: grid;
  grid-template-columns: 34px 1fr 190px 150px 56px 34px;
  gap: 12px;
  align-items: center;
  padding: 5px 10px;
}
.sk {
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.06) 25%,
    rgba(255, 255, 255, 0.12) 37%,
    rgba(255, 255, 255, 0.06) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
.sk--cover { width: 36px; height: 36px; border-radius: var(--radius-sm); }
@keyframes shimmer {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* =============================================================
 * 底部播放条（固定浅蓝玻璃，不跟随封面）
 * ============================================================= */
.playbar {
  grid-area: playbar;
  height: var(--playbar-h);
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(360px, 2fr) minmax(220px, 1fr);
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: linear-gradient(180deg, rgba(20,20,20,0.82) 0%, rgba(10,10,10,0.92) 100%);
  -webkit-backdrop-filter: blur(34px) saturate(190%);
  backdrop-filter: blur(34px) saturate(190%);
  border-top: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 -1px 0 var(--line), 0 -10px 30px rgba(0,0,0,0.5);
  position: relative;
  z-index: 30;
}
/* 封面取色环境光：顶部一道柔光晕线，颜色跟随当前封面主色 */
.playbar::before {
  content: '';
  position: absolute;
  top: -1px; left: 8%; right: 8%;
  height: 2.5px;
  border-radius: 2px;
  background: linear-gradient(90deg,
    transparent,
    rgba(var(--now-rgb, 199, 125, 255), 0.9) 30%,
    rgba(var(--now-rgb, 199, 125, 255), 0.9) 70%,
    transparent);
  box-shadow: 0 0 14px rgba(var(--now-rgb, 199, 125, 255), 0.55);
  opacity: 0;
  transition: opacity 0.7s ease;
  pointer-events: none;
}
.app.has-track .playbar::before { opacity: 1; }

/* 左：当前曲目（黑胶唱片） */
.np { display: flex; align-items: center; gap: 11px; min-width: 0; }
.np__disc {
  position: relative;
  flex-shrink: 0;
  width: 50px; height: 50px;
  border-radius: 50%;
}
.np__cover {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: var(--bg-elevated);
  object-fit: cover;
  display: block;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.16), 0 0 0 0.5px rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: transform var(--dur-move) var(--spring), box-shadow var(--dur-press) var(--ease-out);
}
/* 唱片中心孔 + 纹理 */
.np__disc::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at center,
      rgba(255,255,255,0.94) 0 2px,
      rgba(255,255,255,0.25) 2.5px 4px,
      transparent 4.5px),
    repeating-radial-gradient(circle at center,
      rgba(255,255,255,0.045) 0 1px,
      transparent 1px 4px);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}
.np__disc.is-playing .np__cover {
  animation: disc-spin 9s linear infinite;
  box-shadow: 0 4px 18px rgba(var(--now-rgb, 199, 125, 255), 0.42),
              0 0 0 0.5px rgba(255, 255, 255, 0.08);
}
@keyframes disc-spin { to { transform: rotate(360deg); } }
.np__cover:hover { transform: scale(1.05); box-shadow: 0 6px 18px rgba(255, 255, 255, 0.22); }
.np__cover:active { transform: scale(0.97); }
.np__text { min-width: 0; flex: 1; }
.np__name {
  font-size: 13px;
  font-weight: 580;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.np__artist {
  font-size: 11.5px;
  color: var(--fg-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.np__empty { font-size: 12.5px; color: var(--fg-tertiary); }

/* 中：控制 + 进度 */
.pc { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pc__buttons { display: flex; align-items: center; gap: 6px; }

.ctl {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 3px;
  border-radius: 50%;
  color: var(--fg-secondary);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: color var(--dur-press) var(--ease-out),
              transform var(--dur-press) var(--ease-out),
              background var(--dur-press) var(--ease-out);
}
.ctl svg { width: 16px; height: 16px; fill: currentColor; }
.ctl:hover:not(:disabled) { color: var(--fg); background: var(--bg-hover); }
.ctl:active:not(:disabled) { transform: scale(0.88); }
.ctl:disabled { opacity: 0.28; cursor: default; }
.ctl.is-on { color: var(--accent); }

.ctl--play {
  width: 36px; height: 36px;
  color: #fff;
  background: var(--accent-grad);
  margin: 0 4px;
  box-shadow: 0 4px 14px rgba(199, 125, 255, 0.4);
}
.ctl--play svg { width: 16px; height: 16px; }
.ctl--play:hover:not(:disabled) { background: linear-gradient(135deg, #d990ff 0%, #c77dff 100%); }
.ctl--play:active:not(:disabled) { transform: scale(0.93); }

.ctl__speed { font-size: 11px; letter-spacing: -0.01em; }

/* 进度条 */
.pc__progress { display: flex; align-items: center; gap: 8px; width: 100%; }
.time {
  font-size: 10.5px;
  color: var(--fg-tertiary);
  font-variant-numeric: tabular-nums;
  min-width: 32px;
  letter-spacing: 0.01em;
}
.time--right { text-align: right; }

.slider {
  position: relative;
  flex: 1;
  height: 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}
.slider__track {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  overflow: visible;
  transition: height 160ms var(--ease-out);
}
.slider:hover .slider__track,
.slider.is-dragging .slider__track { height: 6px; }

.slider__buffer {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 3px;
}
.slider__fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--accent-hover), var(--accent));
  border-radius: 3px;
  box-shadow: 0 0 8px rgba(var(--now-rgb, 199, 125, 255), 0.45);
}
.slider:hover .slider__fill,
.slider.is-dragging .slider__fill { box-shadow: 0 0 12px rgba(var(--now-rgb, 199, 125, 255), 0.7); }

.slider__knob {
  position: absolute;
  top: 50%;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 5px rgba(255, 255, 255, 0.32), 0 0 0 1px rgba(199, 125, 255, 0.35);
  transform: translate(-50%, -50%) scale(0);
  transition: transform 180ms var(--spring);
  pointer-events: none;
}
.slider:hover .slider__knob { transform: translate(-50%, -50%) scale(1); }
.slider.is-dragging .slider__knob { transform: translate(-50%, -50%) scale(1.25); }

/* 右：音质 / 倍速 / 定时 / 下载 / 歌词 / 音量 */
.pr { display: flex; align-items: center; justify-content: flex-end; gap: 4px; position: relative; }
.volume { display: flex; align-items: center; gap: 6px; width: 108px; }
.volume .slider { flex: 1; }

.quality-chip {
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: background var(--dur-press) var(--ease-out), color var(--dur-press) var(--ease-out), transform var(--dur-press) var(--ease-out);
}
.quality-chip:hover { background: rgba(199, 125, 255, 0.18); }
.quality-chip:active { transform: scale(0.94); }
.quality-chip.is-lossless { background: rgba(255,154,31,0.16); color: var(--tint-hires); }
.quality-chip.is-pending { background: rgba(255, 255, 255, 0.07); color: var(--fg-tertiary); }

/* 歌词来源 chip（只有 B站 曲目才出现，点了可手动校准） */
.lyric-src-chip {
  height: 22px;
  max-width: 190px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: none;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--fg-secondary);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background var(--dur-press) var(--ease-out), color var(--dur-press) var(--ease-out), transform var(--dur-press) var(--ease-out);
}
.lyric-src-chip:hover { background: var(--accent-soft); color: var(--accent); }
.lyric-src-chip[hidden] { display: none; }
.lyric-src-chip:active { transform: scale(0.94); }
.lyric-src-chip.is-warn { background: rgba(255, 154, 31, 0.16); color: var(--tint-hires); }

/* 歌词来源选择弹窗 */
.lyric-pick__search { display: flex; gap: 8px; margin-bottom: 10px; }
.lyric-pick__search .field { flex: 1; }
.lyric-pick__list { max-height: 46vh; overflow-y: auto; margin: 0 -4px; }
.lyric-pick__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.lyric-pick__item:hover { background: rgba(255, 255, 255, 0.06); }
.lyric-pick__item.is-current { background: var(--accent-soft); }
.lyric-pick__main { flex: 1; min-width: 0; }
.lyric-pick__name {
  font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lyric-pick__meta {
  font-size: 11.5px; color: var(--fg-tertiary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lyric-pick__tag {
  flex: none; font-size: 10.5px; font-weight: 600;
  padding: 2px 6px; border-radius: 6px;
  background: rgba(255, 255, 255, 0.08); color: var(--fg-secondary);
}
.lyric-pick__empty { padding: 18px 4px; font-size: 12.5px; color: var(--fg-tertiary); text-align: center; }

/* 音质选择弹窗 */
.quality-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  z-index: 200;
  min-width: 168px;
  padding: 6px;
  border-radius: 14px;
  background: var(--bg-elevated, #151530);
  box-shadow: 0 8px 32px rgba(0,0,0,0.16), 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid var(--line, rgba(255,255,255,0.08));
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: qmIn 0.16s var(--ease-out, ease-out);
}
.quality-menu[hidden] { display: none; }
@keyframes qmIn {
  from { opacity: 0; transform: translateY(6px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.quality-menu__title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-tertiary, #b8b0d4);
  padding: 6px 10px 4px;
}
.quality-menu__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg, #ffffff);
  cursor: pointer;
  transition: background 0.12s ease;
  text-align: left;
  white-space: nowrap;
}
.quality-menu__item:hover { background: var(--accent-soft, rgba(199,125,255,0.12)); }
.quality-menu__item.is-active {
  background: var(--accent-soft, rgba(199, 125, 255, 0.12));
  color: var(--accent, #c77dff);
  font-weight: 700;
}
.quality-menu__item.is-active::after {
  content: '✓';
  font-size: 13px;
  margin-left: 12px;
}

/* =============================================================
 * 沉浸式歌词页（Apple Music 全屏，浅色玻璃）
 * ============================================================= */
.lyric-sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: linear-gradient(160deg, #0a0a1a 0%, #0d0d20 55%, #0a0a0a 100%);
  transform: translateY(100%);
  transition: transform var(--dur-sheet) var(--spring-soft);
  display: grid;
  grid-template-rows: auto 1fr auto;
  will-change: transform;
  overflow: hidden;
}
.lyric-sheet.is-open { transform: translateY(0); }

.lyric-sheet__bg {
  position: absolute;
  inset: -60px;
  background-size: cover;
  background-position: center;
  filter: blur(80px) saturate(160%) brightness(1.08);
  transform: scale(1.3);
  opacity: 0;
  transition: opacity 800ms var(--ease-out);
  pointer-events: none;
}
.lyric-sheet__bg.is-ready { opacity: 0.34; }
.lyric-sheet__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.45) 0%, rgba(10,10,10,0.7) 60%, rgba(8,8,8,0.92) 100%);
  pointer-events: none;
}

.lyric-sheet__top {
  position: relative;
  z-index: 2;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
}
.lyric-sheet__head { min-width: 0; flex: 1; }
.lyric-sheet__name {
  font-size: 14px; font-weight: 640; letter-spacing: -0.01em;
  color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lyric-sheet__artist { font-size: 12px; color: var(--fg-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lyric-sheet__body {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 56px;
  padding: 8px 64px 24px;
  align-items: center;
  overflow: hidden;
}

.lyric-art { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.lyric-art__cover {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1;
  border-radius: 18px;
  object-fit: cover;
  background: var(--bg-elevated);
  box-shadow: 0 26px 70px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.08);
}
.lyric-art__name { font-size: 22px; font-weight: 700; letter-spacing: -0.018em; line-height: 1.18; }
.lyric-art__artist { font-size: 14.5px; color: var(--fg-secondary); margin-top: 5px; letter-spacing: -0.006em; }

.lyric-scroll {
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 80%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 80%, transparent);
  padding: 30vh 0;
}
.lyric-scroll::-webkit-scrollbar { display: none; }

.lyric-line {
  padding: 9px 0;
  font-size: 21px;
  font-weight: 640;
  letter-spacing: -0.014em;
  line-height: 1.34;
  color: rgba(255, 255, 255, 0.32);
  cursor: pointer;
  transform-origin: left center;
  transition: color 320ms var(--ease-out), transform 460ms var(--spring), opacity 320ms var(--ease-out);
}
.lyric-line:hover { color: rgba(255, 255, 255, 0.6); }
.lyric-line.is-current { color: var(--accent); transform: scale(1.045); }
.lyric-line__sub {
  display: block;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.004em;
  color: rgba(255, 255, 255, 0.42);
  margin-top: 3px;
}
.lyric-line.is-current .lyric-line__sub { color: rgba(199, 125, 255, 0.7); }

/* 逐词扫光：每个字是独立 span，未唱到时为极淡幽灵态，唱到时由 JS 用
   background-clip:text 注入白→冷紫玻璃渐变 + 前沿高光。has-words 行自身
   文本透明，只让字 span 显示扫光。 */
.lyric-word {
  display: inline-block;
  padding: 0 .012em;
  background: rgba(255, 255, 255, 0.32); /* JS 未执行时的兜底，避免整行空白 */
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lyric-line.has-words,
.lyric-line.has-words.is-current { color: transparent; }
.lyric-line.has-words.is-current { transform: scale(1.045); }

/* 底部传输控制 */
.lyric-sheet__transport {
  position: relative;
  z-index: 2;
  padding: 10px 40px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lyric-sheet__progress { display: flex; align-items: center; gap: 10px; }
.lyric-sheet__progress .time { color: var(--fg-secondary); }
.lyric-sheet__buttons { display: flex; align-items: center; justify-content: center; gap: 14px; }
.lyric-sheet__buttons .ctl--play { width: 48px; height: 48px; }
.lyric-sheet__buttons .ctl--play svg { width: 20px; height: 20px; }

/* =============================================================
 * 设置面板
 * ============================================================= */
.settings { max-width: 680px; padding-bottom: 40px; }

.card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0) 38%),
    rgba(24, 24, 24, 0.55);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255,255,255,0.05);
  overflow: hidden;
  margin-bottom: 14px;
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  transition: border-color var(--dur-press) var(--ease-out),
              box-shadow var(--dur-move) var(--ease-out),
              transform var(--dur-move) var(--ease-out);
  animation: card-in 560ms var(--spring-soft) both;
}
.card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 12px 38px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.07);
}
.settings > .card:nth-child(2) { animation-delay: 50ms; }
.settings > .card:nth-child(3) { animation-delay: 100ms; }
.settings > .card:nth-child(4) { animation-delay: 150ms; }
.settings > .card:nth-child(5) { animation-delay: 200ms; }
.settings > .card:nth-child(6) { animation-delay: 250ms; }
@keyframes card-in {
  from { opacity: 0; transform: translateY(12px) scale(0.99); }
  to   { opacity: 1; transform: none; }
}
.card__head {
  padding: 13px 16px 11px;
  border-bottom: 1px solid var(--line);
}
.card__title { font-size: 13.5px; font-weight: 620; letter-spacing: -0.007em; }
.card__desc { font-size: 12px; color: var(--fg-tertiary); margin-top: 3px; line-height: 1.5; }

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
}
.row + .row { border-top: 1px solid var(--line); }
.row__label { font-size: 13px; letter-spacing: -0.003em; }
.row__hint { font-size: 11.5px; color: var(--fg-tertiary); margin-top: 2px; line-height: 1.45; }
.row__control { margin-left: auto; flex-shrink: 0; }

select.field {
  height: 28px;
  padding: 0 26px 0 10px;
  background: #151530 url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23b3b3b3'%3E%3Cpath d='M4.5 6.5L8 10l3.5-3.5z'/%3E%3C/svg%3E") no-repeat right 6px center;
  background-size: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 12.5px;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10);
}
select.field:focus { border-color: rgba(199, 125, 255, 0.6); box-shadow: 0 0 0 3px rgba(199, 125, 255, 0.12); }

input.field, textarea.field {
  width: 100%;
  height: 30px;
  padding: 0 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 12.5px;
  outline: none;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}
input.field:focus, textarea.field:focus { border-color: rgba(199, 125, 255, 0.6); box-shadow: 0 0 0 3px rgba(199, 125, 255, 0.12); }

/* 开关 */
.switch {
  position: relative;
  width: 40px; height: 23px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.16);
  transition: background 260ms var(--spring);
  flex-shrink: 0;
}
.switch::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 19px; height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(255, 255, 255, 0.3);
  transition: transform 320ms var(--spring);
}
.switch.is-on { background: var(--accent); }
.switch.is-on::after { transform: translateX(17px); }
.switch:active::after { width: 22px; }

.btn {
  height: 29px;
  padding: 0 14px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  font-size: 12.5px;
  font-weight: 540;
  letter-spacing: -0.002em;
  transition: background var(--dur-press) var(--ease-out), transform var(--dur-press) var(--ease-out);
}
.btn:hover { background: rgba(255, 255, 255, 0.11); }
.btn:active { transform: scale(0.96); }
.btn--accent { background: var(--accent-grad); color: #fff; box-shadow: 0 3px 12px rgba(199, 125, 255, 0.32); }
.btn--accent:hover { filter: brightness(1.04); }

/* 音源自检结果 */
.probe { display: flex; flex-direction: column; }
.probe__item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  font-size: 12.5px;
}
.probe__item + .probe__item { border-top: 1px solid var(--line); }
.probe__dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.probe__dot--ok { background: #30d158; }
.probe__dot--bad { background: #ff453a; }
.probe__dot--pending { background: var(--fg-quaternary); }
.probe__name { font-weight: 520; }
.probe__tag { font-size: 10.5px; color: var(--fg-tertiary); }
.probe__ms { margin-left: auto; font-size: 11px; color: var(--fg-tertiary); font-variant-numeric: tabular-nums; }
.probe__detail { font-size: 11px; color: var(--fg-tertiary); margin-left: 8px; }
/* 卡片内的小节标题（如音源健康度） */
.probe__title {
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  color: var(--fg-tertiary);
}
.probe__title + .probe { margin-top: 6px; }

/* =============================================================
 * 进入密码门（毛玻璃）
 * ============================================================= */
.gate {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
}
.gate[hidden] { display: none; }
.gate__card {
  width: min(300px, calc(100vw - 48px));
  padding: 34px 28px 28px;
  border-radius: 24px;
  text-align: center;
  background: rgba(20,20,20,0.7);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  backdrop-filter: blur(28px) saturate(1.6);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 24px 64px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.08);
  animation: gateIn 0.35s var(--ease-out, ease-out);
}
@keyframes gateIn {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.gate__mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  color: #fff;
  background: var(--accent-grad, linear-gradient(135deg, #d990ff 0%, #c77dff 100%));
  box-shadow: 0 10px 24px rgba(199, 125, 255, 0.4);
}
.gate__mark svg { width: 28px; height: 28px; }
.gate__title {
  font-size: 20px;
  font-weight: 760;
  letter-spacing: -0.01em;
  color: #ffffff;
}
.gate__sub {
  font-size: 12.5px;
  color: rgba(180,180,180,0.7);
  margin: 4px 0 20px;
}
.gate__input {
  width: 100%;
  box-sizing: border-box;
  height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  font-size: 14px;
  color: #ffffff;
  text-align: center;
  letter-spacing: 0.12em;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.gate__input:focus {
  border-color: var(--accent, #c77dff);
  box-shadow: 0 0 0 4px rgba(199, 125, 255, 0.15);
}
.gate__input::placeholder { letter-spacing: 0; color: rgba(180,180,180,0.45); }
.gate__btn {
  width: 100%;
  height: 44px;
  margin-top: 12px;
  border: none;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 650;
  color: #fff;
  cursor: pointer;
  background: var(--accent-grad, linear-gradient(135deg, #d990ff 0%, #c77dff 100%));
  box-shadow: 0 10px 22px rgba(199, 125, 255, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.gate__btn:hover { box-shadow: 0 12px 26px rgba(199, 125, 255, 0.45); }
.gate__btn:active { transform: scale(0.97); }
.gate__err {
  min-height: 18px;
  margin-top: 10px;
  font-size: 12px;
  color: #e8413c;
}

/* =============================================================
 * 授权引导弹窗（未同意时弹出，引导前往 policy.html，非硬跳转）
 * ============================================================= */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.62);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
}
.auth-gate[hidden] { display: none; }
.auth-gate__card {
  width: min(360px, calc(100vw - 48px));
  padding: 34px 30px 28px;
  border-radius: 24px;
  text-align: center;
  background: rgba(20, 20, 20, 0.7);
  -webkit-backdrop-filter: blur(30px) saturate(1.7);
  backdrop-filter: blur(30px) saturate(1.7);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: gateIn 0.38s var(--ease-out, ease-out) both;
}
.auth-gate__icon {
  width: 58px; height: 58px;
  margin: 0 auto 16px;
  display: grid; place-items: center;
  border-radius: 18px;
  color: #fff;
  background: var(--accent-grad, linear-gradient(135deg, #d990ff 0%, #c77dff 100%));
  box-shadow: 0 10px 24px rgba(199, 125, 255, 0.4);
}
.auth-gate__icon svg { width: 28px; height: 28px; }
.auth-gate__title {
  margin: 0;
  font-size: 19px;
  font-weight: 720;
  letter-spacing: -0.01em;
  color: #ffffff;
}
.auth-gate__desc {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(180, 180, 180, 0.78);
  margin: 8px 0 22px;
}
.auth-gate__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 650;
  color: #fff;
  text-decoration: none;
  background: var(--accent-grad, linear-gradient(135deg, #d990ff 0%, #c77dff 100%));
  box-shadow: 0 10px 22px rgba(199, 125, 255, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
.auth-gate__btn:hover { filter: brightness(1.05); box-shadow: 0 12px 26px rgba(199, 125, 255, 0.45); }
.auth-gate__btn:active { transform: scale(0.97); }
.auth-gate__hint {
  font-size: 11.5px;
  color: rgba(180, 180, 180, 0.5);
  margin: 14px 0 0;
}
.auth-gate__note {
  font-size: 11.5px;
  line-height: 1.6;
  color: #ffcf6b;
  margin: 12px 0 0;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(255, 184, 0, 0.10);
  border: 1px solid rgba(255, 184, 0, 0.22);
  text-align: left;
}

/* 未授权时锁定并模糊主应用（弹窗在 body 下，不受此影响） */
body.is-gated .app { filter: blur(10px) saturate(120%); pointer-events: none; user-select: none; }

/* =============================================================
 * 弹窗（歌单导入 / 定时关闭）
 * ============================================================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}
.modal.is-open { display: block; }
.modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: fade-in 200ms var(--ease-out);
}
.modal__card {
  position: relative;
  width: min(520px, calc(100vw - 40px));
  margin: calc(50vh - 160px) auto 0;
  background: rgba(24,24,24,0.82);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  box-shadow: var(--glass-shadow-lg);
  padding: 16px;
  animation: pop-in 320ms var(--spring);
}
.modal__card--menu { width: min(320px, calc(100vw - 40px)); padding: 8px; }
.modal__card--lg { width: min(640px, calc(100vw - 40px)); }
.modal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.modal__title { font-size: 15px; font-weight: 660; letter-spacing: -0.01em; }
.modal__desc { font-size: 12.5px; color: var(--fg-tertiary); line-height: 1.55; margin-bottom: 12px; }
.modal__input {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
}
.modal__err { color: #e8413c; font-size: 12px; min-height: 16px; margin-top: 8px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* =============================================================
 * 我的账号（accounts.js）
 * ============================================================= */
.modal__card--qr { text-align: center; }
.modal__qr {
  display: grid;
  place-items: center;
  min-height: 216px;
  margin: 6px 0 12px;
  border-radius: var(--radius-lg);
  background: #fff;
  padding: 8px;
}
.modal__qr:empty { background: var(--bg-field); }
.modal__hint { font-size: 12px; color: var(--fg-tertiary); }

.acct-hint {
  margin: 0 0 16px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--fg-secondary);
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.acct-hint code { color: var(--accent); font-family: ui-monospace, "SF Mono", Consolas, monospace; }

.acct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 22px; }
.acct-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  box-shadow: var(--glass-shadow);
}
.acct-card__icon {
  flex: none;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  font-size: 17px; font-weight: 700;
}
.acct-card__body { flex: 1; min-width: 0; }
.acct-card__name { font-size: 14px; font-weight: 600; }
.acct-card__status { font-size: 12px; color: var(--fg-tertiary); margin-top: 2px; }
.acct-card__on { color: #4dd0a0; }
.acct-card__off { color: var(--fg-quaternary); }
.acct-card__action { flex: none; display: flex; gap: 8px; }

.modal__hint--sub { margin-top: 8px; font-size: 11.5px; color: var(--fg-quaternary); line-height: 1.5; }

.acct-section { margin-bottom: 22px; }
.acct-section__head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.acct-section__dot { width: 8px; height: 8px; border-radius: 50%; }
.acct-group__label { font-size: 11px; color: var(--fg-tertiary); letter-spacing: 0.04em; margin: 12px 0 8px; }
.acct-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.acct-tile {
  display: block;
  padding: 8px;
  border-radius: var(--radius);
  background: var(--bg-field);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: background var(--dur-press), border-color var(--dur-press), transform var(--dur-press);
}
.acct-tile:hover { background: var(--bg-hover); border-color: var(--line-strong); transform: translateY(-1px); }
.acct-tile__cover { width: 100%; aspect-ratio: 1 / 1; border-radius: var(--radius-sm); object-fit: cover; display: block; }
.acct-tile__cover--ph { background: var(--bg-elevated); }
.acct-tile__name { font-size: 12.5px; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.acct-tile__sub { font-size: 11px; color: var(--fg-tertiary); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-empty { font-size: 12.5px; color: var(--fg-tertiary); padding: 10px 0; }
.acct-empty--err { color: #e8413c; }
.acct-err { color: #e8413c; }

/* ---------- 我的页（账号 + 我喜欢 + 最近播放 整合视图） ---------- */
.mine-sec { margin-bottom: 26px; }
.mine-sec__body { margin-top: 2px; }
.mine-entries { margin: 6px 0 30px; display: flex; flex-direction: column; gap: 8px; }
.mine-entry {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--fg-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.mine-entry:hover { background: var(--bg-hover); border-color: var(--line-strong); color: var(--fg); }
.mine-entry svg { width: 16px; height: 16px; flex: none; }
.mine-entry__label { flex: 1; text-align: left; }
.mine-entry .chev { color: var(--fg-quaternary); }

/* =============================================================
 * 启动同意弹窗（液态玻璃）
 * ============================================================= */
.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fade-in 240ms var(--ease-out) both;
}
.splash[hidden] { display: none; }
.splash.is-leaving {
  opacity: 0;
  transition: opacity 460ms var(--ease-out);
  pointer-events: none;
}
.splash__scrim {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 120% at 50% 28%, rgba(12,12,12,0.52), rgba(0,0,0,0.80));
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  backdrop-filter: blur(8px) saturate(120%);
}
.splash__card {
  position: relative;
  width: min(420px, 100%);
  min-height: 300px;
  padding: 40px 28px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0) 42%),
    rgba(20, 20, 20, 0.66);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 22px;
  box-shadow:
    var(--glass-shadow-lg),
    inset 0 1px 0 rgba(255,255,255,0.10),
    inset 0 0 0 1px rgba(255,255,255,0.02);
  -webkit-backdrop-filter: blur(34px) saturate(180%);
  backdrop-filter: blur(34px) saturate(180%);
  animation: splash-in 620ms var(--spring) both;
  transition: opacity 460ms var(--ease-out), transform 460ms var(--ease-out);
}
.splash.is-leaving .splash__card { opacity: 0; transform: scale(0.97); }
@keyframes splash-in {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}

.splash__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 0 0 22px;
  transform: translateY(110px);   /* 近似居中，JS 再精确修正 */
  transition: transform 640ms var(--spring-soft);
  will-change: transform;
}

.splash__word {
  display: inline-flex;
  font-size: 46px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  filter: drop-shadow(0 4px 16px rgba(199,125,255,0.28));
}
.splash__word span {
  display: inline-block;
  background: linear-gradient(135deg, #ffffff 0%, #e0c8ff 52%, #c77dff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
  transform: translateY(16px) scale(0.82);
  transition: opacity 360ms var(--ease-out), transform 560ms var(--spring);
}
.splash__word span.is-in { opacity: 1; transform: none; }

.splash__dev {
  font-size: 13px;
  color: var(--fg-tertiary);
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 500ms var(--ease-out) 120ms, transform 500ms var(--ease-out) 120ms;
}
.splash.is-settled .splash__dev { opacity: 1; transform: none; }

/* 网络检测指示器 */
.splash__network {
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 500ms var(--ease-out) 200ms, transform 500ms var(--ease-out) 200ms;
}
.splash.is-settled .splash__network { opacity: 1; transform: none; }

.net-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 4px 0;
}
.net-indicator__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fg-tertiary);
  flex-shrink: 0;
  position: relative;
}
.net-indicator__label {
  color: var(--fg-tertiary);
  min-width: 48px;
}
.net-indicator__value {
  color: var(--fg-secondary);
  font-variant-numeric: tabular-nums;
}

/* 检测中：脉冲动画 */
.net-indicator--checking .net-indicator__dot {
  animation: net-pulse 1.2s ease-in-out infinite;
  background: #c77dff;
}
@keyframes net-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50%      { opacity: 1;   transform: scale(1.1); }
}

/* 正常：绿色 */
.net-indicator--ok .net-indicator__dot { background: #4ade80; }
.net-indicator--ok .net-indicator__value { color: #4ade80; }

/* 失败：橙红色 */
.net-indicator--fail .net-indicator__dot { background: #f87171; }
.net-indicator--fail .net-indicator__value { color: #f87171; }

/* 同意区域：初始不占空间，settle 后淡入 */
.splash__consent {
  display: none;
  width: 100%;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 520ms var(--ease-out), transform 520ms var(--ease-out);
}
.splash.is-settled .splash__consent { display: flex; }
.splash__consent.is-shown { opacity: 1; transform: none; }

.agree {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border-radius: 13px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--dur-press) var(--ease-out), background var(--dur-press) var(--ease-out);
}
.agree:hover { border-color: var(--line-strong); background: rgba(255,255,255,0.07); }
.agree__box { position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0; pointer-events: none; }
.agree__mark {
  flex: 0 0 auto;
  width: 21px; height: 21px;
  border-radius: 7px;
  border: 1.6px solid var(--line-strong);
  background: rgba(255,255,255,0.04);
  display: grid;
  place-items: center;
  transition: background var(--dur-press) var(--ease-out),
              border-color var(--dur-press) var(--ease-out);
}
.agree__mark::after {
  content: "";
  width: 11px; height: 6px;
  border-left: 2px solid #06210f;
  border-bottom: 2px solid #06210f;
  transform: rotate(-45deg) translateY(-1px) scale(0);
  transition: transform 220ms var(--spring);
}
.agree__box:checked + .agree__mark { background: var(--accent); border-color: var(--accent); }
.agree__box:checked + .agree__mark::after { transform: rotate(-45deg) translateY(-1px) scale(1); }
.agree__box:focus-visible + .agree__mark { outline: 2px solid rgba(199,125,255,0.9); outline-offset: 2px; }
.agree__text { font-size: 13px; color: var(--fg-secondary); line-height: 1.4; }
.agree__link { color: var(--accent); text-decoration: none; font-weight: 600; cursor: pointer; }
.agree__link:hover { text-decoration: underline; }

.splash__foot {
  display: none;
  width: 100%;
  margin-top: 18px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 520ms var(--ease-out), transform 520ms var(--ease-out);
}
.splash.is-settled .splash__foot { display: block; }
.splash__foot.is-shown { opacity: 1; transform: none; }
.splash__enter {
  width: 100%;
  justify-content: center;
  height: 42px;
  font-size: 14px;
  font-weight: 640;
  letter-spacing: 0.01em;
}
.splash__enter:disabled { opacity: 0.4; cursor: not-allowed; filter: grayscale(0.3); }

/* 同意书弹层（复用 .modal） */
.doc-modal__title { font-size: 15px; font-weight: 660; margin-bottom: 10px; }
.doc-modal__body {
  max-height: 46vh;
  overflow: auto;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--fg-secondary);
  white-space: pre-line;
}
.doc-modal__body h4 { color: var(--fg); font-size: 13px; margin: 14px 0 4px; font-weight: 600; }
.doc-modal__body p { margin: 6px 0; }

.menu { display: flex; flex-direction: column; padding: 4px; }
.menu__item {
  text-align: left;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 520;
  color: var(--fg);
  transition: background var(--dur-press) var(--ease-out);
}
.menu__item:hover { background: var(--bg-hover); }
.menu__item.is-active { color: var(--accent); font-weight: 600; }
.menu__item--danger { color: #e8413c; }
.menu__item--danger:hover { background: rgba(232,65,60,0.08); }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* =============================================================
 * 轻提示
 * ============================================================= */
.toast-host {
  position: fixed;
  left: 50%;
  bottom: calc(var(--playbar-h) + 16px);
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  pointer-events: none;
}
.toast {
  padding: 9px 16px;
  border-radius: 18px;
  background: rgba(24, 24, 24, 0.92);
  color: #fff;
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  box-shadow: 0 8px 26px rgba(0,0,0,0.5);
  font-size: 12.5px;
  letter-spacing: -0.003em;
  white-space: nowrap;
  animation: toast-in 420ms var(--spring);
}
.toast--error { background: rgba(214, 56, 64, 0.92); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.toast.is-out { animation: toast-out 260ms var(--ease-out) forwards; }
@keyframes toast-out {
  to { opacity: 0; transform: translateY(8px) scale(0.96); }
}

/* =============================================================
 * 自适应
 * ============================================================= */
@media (max-width: 1080px) {
  .track-head, .track-row, .skeleton-row { grid-template-columns: 34px 1fr 170px 56px 34px; }
  .track-head__album, .track-row__album { display: none; }
  .lyric-sheet__body { grid-template-columns: minmax(220px, 300px) 1fr; gap: 40px; padding: 8px 40px 24px; }
}
@media (max-width: 860px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .chip-btn span { display: none; }
  .track-head, .track-row, .skeleton-row { grid-template-columns: 30px 1fr 56px 34px; }
  .track-head__artist, .track-row__artist { display: none; }
  .playbar { display: flex; align-items: center; gap: 12px; }
  .np { flex: 1 1 auto; min-width: 0; }
  .pc { flex: 0 1 auto; }
  .pr { flex: 0 0 auto; gap: 2px; }
  .pr { gap: 2px; }
  .volume { display: none; }
  .lyric-sheet__body { grid-template-columns: 1fr; padding: 8px 24px 24px; }
  .lyric-art { display: none; }
}

/* =============================================================
 * 移动端（手机 ≤560px）
 * ============================================================= */
@media (max-width: 560px) {
  :root { --playbar-h: 64px; }
  .toolbar { padding: 0 8px; gap: 6px; height: 48px; }
  .toolbar__nav { display: none; }   /* 手机隐藏主导航图标，腾空间 */
  #btnImport { display: none; }      /* 手机隐藏导入歌单按钮，腾空间 */
  .toolbar__spacer { display: none; }  /* 取消 spacer 弹性空间 */
  .search-field { width: auto; min-width: 0; flex: 1; }
  .search-field:focus-within { width: auto; }
  .search-field input { font-size: 13px; height: 30px; }
  .segmented { padding: 2px; height: 30px; }
  .segmented__item { padding: 0 10px; font-size: 12px; gap: 4px; }
  .segmented__count { display: none; }
  .segmented__dot { width: 6px; height: 6px; }
  .page-head { padding-top: 4px; }
  .page-head h1 { font-size: 20px; }
  .page-head__sub { font-size: 11px; }
  .section-bar { padding: 14px 0 6px; }
  .section-bar h2 { font-size: 15px; }
  .rec-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .rec-card__name { font-size: 12px; margin-top: 6px; white-space: normal; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
  .rec-card__meta { font-size: 10.5px; }
  .square-tabs { gap: 6px; padding-bottom: 8px; }
  .square-tab { height: 28px; padding: 0 11px; font-size: 12px; }
  .playbar { flex-wrap: wrap; padding: 6px 10px; gap: 6px 8px; height: auto; min-height: 64px; }
  .app { grid-template-rows: 1fr auto; }
  .np { gap: 8px; flex: 1 1 auto; min-width: 0; }
  .np__disc { width: 38px; height: 38px; }
  .np__text { min-width: 0; }
  .np__name { font-size: 12px; }
  .np__artist { font-size: 10.5px; }
  /* 喜欢按钮保留在迷你播放条中 */
  .pc {
    order: 3;
    flex: 1 1 100%;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    display: flex;
  }
  .pc__progress { flex: 1; display: flex; }
  .pr { gap: 4px; flex: 0 0 auto; }
  .pc__buttons { gap: 0; }
  #btnShuffle, #btnPrev, #btnNext, #btnRepeat { display: none; }
  #btnPlay { width: 34px; height: 34px; margin: 0; }
  .pr > #btnQuality, .pr > .quality-chip { display: none; }   /* 隐藏音质 */
  .pr > #btnSleep, .pr > .quality-menu { display: none; }
  .lyric-sheet__head { padding: 0 16px; }
  .lyric-sheet__title { font-size: 18px; }
  .pl-detail { padding: 4px 0 12px; gap: 12px; }
  .pl-detail__cover { width: 80px; height: 80px; border-radius: 12px; }
  .pl-detail__name { font-size: 14px; }
  .track-head, .track-row, .skeleton-row {
    grid-template-columns: 24px 1fr 46px 28px;
    gap: 8px;
    padding: 5px 8px;
  }
  .track-head__num, .track-row__num { font-size: 11px; }
  .track-head__dur { font-size: 10.5px; }
  .row-btn { width: 24px; height: 24px; }
  .modal__card { max-width: calc(100vw - 32px); padding: 18px; }
  .card { padding: 14px; }
  .card__head { margin-bottom: 8px; }
  .field { font-size: 13px; height: 32px; }
}

/* =============================================================
 * 无障碍
 * ============================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 140ms !important;
  }
  .lyric-sheet { transition: opacity 180ms linear; transform: none; opacity: 0; pointer-events: none; }
  .lyric-sheet.is-open { opacity: 1; pointer-events: auto; }
  .lyric-line.is-current { transform: none; }
  .eq-bars i { animation: none; height: 60%; }
}

@media (prefers-reduced-transparency: reduce) {
  .sidebar, .toolbar, .playbar, .toast, .card, .modal__card, .modal__scrim {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .sidebar  { background: #151530; }
  .toolbar  { background: #151530; }
  .playbar  { background: #0d0d20; }
  .toast    { background: #151530; }
  .lyric-sheet__bg { display: none; }
}

@media (prefers-contrast: more) {
  :root {
    --fg-secondary: rgba(255, 255, 255, 0.78);
    --fg-tertiary:  rgba(255, 255, 255, 0.6);
    --line:         rgba(255, 255, 255, 0.22);
    --line-strong:  rgba(255, 255, 255, 0.34);
  }
  .track-row.is-playing { outline: 1px solid var(--accent); }
}

:focus-visible {
  outline: 2px solid rgba(199, 125, 255, 0.9);
  outline-offset: 1px;
  border-radius: var(--radius-sm);
}

/* =============================================================
 * 生动化增强：首页极光氛围 + 视图渐入
 * ============================================================= */
.home { position: relative; }
.home > *:not(.home__aurora) { position: relative; z-index: 1; }
.home__aurora {
  position: absolute;
  left: -60px; right: -60px; top: -30px;
  height: 360px;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.home__aurora i {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.55;
  animation: aurora-drift 17s ease-in-out infinite alternate;
}
.home__aurora i:nth-child(1) {
  width: 320px; height: 320px;
  left: -70px; top: 20px;
  background: radial-gradient(circle, rgba(199, 125, 255, 0.42), transparent 66%);
}
.home__aurora i:nth-child(2) {
  width: 280px; height: 280px;
  right: -50px; top: -30px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.38), transparent 66%);
  animation-delay: -6s;
}
.home__aurora i:nth-child(3) {
  width: 240px; height: 240px;
  left: 34%; top: 70px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.38), transparent 66%);
  animation-delay: -11s;
}
@keyframes aurora-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(30px, -18px, 0) scale(1.14); }
}
@media (max-width: 560px) {
  .home__aurora { height: 240px; top: -10px; }
  .home__aurora i { filter: blur(34px); opacity: 0.45; }
}

/* 视图切换：内容区子元素上浮淡入 */
#content > * { animation: view-in 0.3s var(--ease-out, ease-out) both; }
@keyframes view-in {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: none; }
}

/* =============================================================
 * 移动端适配
 * -------------------------------------------------------------
 * 1) 视口高度：手机浏览器的地址栏会占掉一块，100vh 取的是「地址栏收起」
 *    时的高度，于是底部播放条那一行被顶到可视区外；而 html/body 是
 *    overflow:hidden 的，用户也没法滚下去看。改用 dvh 后播放条始终可见，
 *    并给全面屏留出底部安全区。
 * 2) 侧边栏：≤860px 时原来的规则直接 display:none，手机上没有导航入口。
 *    这里改成可滑出的抽屉 + 遮罩，由工具栏的汉堡按钮控制。
 * ============================================================= */
.app { height: 100vh; height: 100dvh; }

.btn-menu,
.sidebar-scrim { display: none; }

@media (max-width: 860px) {
  /* 播放条那一行改为按内容自适应，不再被固定高度裁掉 */
  .app { grid-template-rows: 1fr auto; }

  .playbar {
    height: auto;
    min-height: 58px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  }

  .btn-menu { display: grid; }

  .sidebar {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 272px;
    max-width: 84vw;
    z-index: 80;
    transform: translateX(-102%);
    transition: transform 0.3s var(--ease-out, cubic-bezier(0.32, 0.72, 0, 1));
    box-shadow: 24px 0 60px rgba(0, 0, 0, 0.55);
  }
  .app.sidebar-open .sidebar { transform: none; }

  .sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 79;
    background: rgba(6, 6, 14, 0.52);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  .app.sidebar-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
}

@media (max-width: 560px) {
  .toolbar { padding-left: 6px; }

  /* 账号卡片：按钮换行铺满，方便手指点 */
  .acct-card { flex-wrap: wrap; }
  .acct-card__action { width: 100%; }
  .acct-card__action .btn { width: 100%; }

  /* 弹窗不要顶到屏幕边缘 */
  .modal__card { max-width: calc(100vw - 28px); }
  .modal__card--qr { width: 100%; }
  .modal__qr img { max-width: 62vw; height: auto; }
}

/* =============================================================
 * 更新日志（弹窗内容区）
 * ============================================================= */
.changelog-scroll {
  max-height: min(56vh, 420px);
  overflow-y: auto;
  margin: -2px 0 -4px;
  padding: 0 4px 0 2px;
}
.changelog-scroll::-webkit-scrollbar { width: 6px; }
.changelog-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 3px; }

.chlog__item {
  border-top: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  padding: 14px 0 6px;
}
.chlog__item:first-of-type { border-top: none; padding-top: 4px; }
.chlog__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}
.chlog__ver {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--accent, #2d7ff9);
  background: var(--accent-soft, rgba(45, 127, 249, 0.14));
  letter-spacing: 0.3px;
}
.chlog__date {
  flex: none;
  font-size: 11px;
  color: var(--fg-tertiary, #999);
  white-space: nowrap;
}
.chlog__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--fg, inherit);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chlog__body { padding: 0 0 6px 2px; }
.chlog__sub {
  font-size: 12px;
  font-weight: 700;
  color: var(--fg-secondary, rgba(255, 255, 255, 0.78));
  margin: 8px 0 4px;
}
.chlog__li {
  position: relative;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--fg-secondary, rgba(255, 255, 255, 0.78));
  padding-left: 14px;
}
.chlog__li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.72em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent, #2d7ff9);
  opacity: 0.55;
}
.chlog__p {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--fg-secondary, rgba(255, 255, 255, 0.78));
}
.chlog__gap { height: 6px; }

/* ---------- 音源线路（设置页） ---------- */
.line-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.line {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
  background: var(--bg-field, rgba(199,125,255,0.07));
}
.line--off { opacity: 0.5; }
.line__main { flex: 1; min-width: 0; }
.line__name { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.line__meta { font-size: 11px; color: var(--fg-tertiary, #7a70a0); margin-top: 2px; }
.line__region { font-size: 10px; padding: 1px 5px; border-radius: 5px; font-weight: 600; }
.line__region--cn { background: rgba(45,160,90,0.18); color: #3fbf72; }
.line__region--os { background: rgba(220,120,40,0.18); color: #e08a3c; }
.line__delay {
  font-size: 12px; font-variant-numeric: tabular-nums;
  min-width: 52px; text-align: right; color: var(--fg-tertiary, #7a70a0);
}
.line__delay.good { color: #3fbf72; }
.line__delay.mid  { color: #e0b33c; }
.line__delay.bad  { color: #e0492d; }
.line__ops { display: flex; flex-direction: column; gap: 3px; }
.line__btn {
  width: 24px; height: 18px; border: none; border-radius: 5px;
  background: var(--bg-segment-knob, #252048); color: var(--fg-secondary, #b8b0d4);
  font-size: 11px; line-height: 1; cursor: pointer;
}
.line__btn:active { transform: scale(0.92); }

/* ---------- 换源弹层（播放条「换源」按钮） ---------- */
.src-pop {
  position: fixed;
  bottom: 86px;
  right: 16px;
  z-index: 320;
  min-width: 184px;
  max-width: 260px;
  padding: 6px;
  border-radius: 14px;
  background: var(--bg-elevated, #151530);
  box-shadow: 0 8px 32px rgba(0,0,0,0.16), 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid var(--line, rgba(255,255,255,0.08));
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: qmIn 0.16s var(--ease-out, ease-out);
}
.src-pop[hidden] { display: none; }
.src-pop__title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-tertiary, #b8b0d4);
  padding: 6px 10px 4px;
}
.src-pop__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg, #ffffff);
  cursor: pointer;
  transition: background 0.12s ease;
  text-align: left;
  white-space: nowrap;
}
.src-pop__item:hover { background: var(--accent-soft, rgba(199,125,255,0.12)); }
.src-pop__item.is-active {
  background: var(--accent-soft, rgba(199, 125, 255, 0.12));
  color: var(--accent, #c77dff);
  font-weight: 700;
}
.src-pop__item.is-active::after {
  content: '✓';
  font-size: 13px;
  margin-left: 12px;
}
.src-pop__item.is-loading { color: var(--accent); pointer-events: none; }
.src-pop__item.is-loading::after {
  content: '';
  width: 12px; height: 12px;
  margin-left: 12px;
  border: 2px solid rgba(199,125,255,0.28);
  border-top-color: var(--accent, #c77dff);
  border-radius: 50%;
  animation: spSpin 0.7s linear infinite;
}
@keyframes spSpin { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
  .src-pop { right: 10px; left: 10px; min-width: 0; max-width: none; }
  .src-pop__item { white-space: normal; }
}

