/* =========================================================
   听见 · 音乐播放器
   ========================================================= */

/* ---------- 设计令牌 ---------- */
:root {
  --r-xs: 6px;  --r-sm: 9px;  --r: 13px;  --r-lg: 20px;  --r-pill: 999px;

  --accent:       #8b7cff;
  --accent-ink:   #ffffff;
  --accent-soft:  rgba(139,124,255,.16);
  --accent-line:  rgba(139,124,255,.38);

  --bg:        #0b0d12;
  --bg-elev:   #10131a;
  --surface:   #151922;
  --surface-2: #1c212c;
  --surface-3: #242a37;
  --line:        rgba(255,255,255,.07);
  --line-strong: rgba(255,255,255,.13);
  --text:   #e9ecf3;
  --text-2: #a4abbd;
  --text-3: #6b7284;
  --danger: #ff6b7a;
  --ok:     #44d7a8;
  --warn:   #ffc46b;

  --shadow-sm: 0 2px 8px rgba(0,0,0,.28);
  --shadow:    0 14px 44px rgba(0,0,0,.46);
  --shadow-lg: 0 28px 80px rgba(0,0,0,.58);

  --ease: cubic-bezier(.22,.61,.36,1);
  --fast: 140ms var(--ease);
  --slow: 320ms var(--ease);

  --sidebar-w: 248px;
  --player-h: 92px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro SC", "SF Pro Text",
          "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei",
          "Noto Sans SC", Inter, "Segoe UI", Roboto, system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

html[data-theme="light"] {
  --accent:      #6554e8;
  --accent-soft: rgba(101,84,232,.11);
  --accent-line: rgba(101,84,232,.32);

  --bg:        #f5f6fa;
  --bg-elev:   #ffffff;
  --surface:   #ffffff;
  --surface-2: #eff1f6;
  --surface-3: #e4e7ef;
  --line:        rgba(16,20,30,.085);
  --line-strong: rgba(16,20,30,.17);
  --text:   #11141b;
  --text-2: #565e70;
  --text-3: #8b92a2;
  --danger: #e04359;
  --ok:     #11a97a;
  --warn:   #c9821a;

  --shadow-sm: 0 2px 6px rgba(16,20,30,.07);
  --shadow:    0 12px 36px rgba(16,20,30,.11);
  --shadow-lg: 0 24px 70px rgba(16,20,30,.16);
}

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

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  transition: background var(--slow), color var(--slow);
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }
img { display: block; max-width: 100%; }
ul { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--accent-soft); color: var(--text); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* 滚动条 */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border: 3px solid transparent;
  background-clip: padding-box;
  border-radius: var(--r-pill);
}
*::-webkit-scrollbar-thumb:hover { background: var(--text-3); background-clip: padding-box; }

/* ---------- 通用按钮 ---------- */
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  transition: background var(--fast), color var(--fast), transform var(--fast);
  flex: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(.93); }
.icon-btn.tiny { width: 30px; height: 30px; border-radius: var(--r-xs); }
.icon-btn.on { color: var(--accent); }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 20px; height: 42px;
  border-radius: var(--r-pill);
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; letter-spacing: .01em;
  transition: filter var(--fast), transform var(--fast), box-shadow var(--fast);
  box-shadow: 0 6px 18px -6px var(--accent);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: scale(.975); }
.btn-primary[disabled] { opacity: .5; pointer-events: none; }

.btn-ghost {
  padding: 0 18px; height: 38px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  font-weight: 550;
  transition: all var(--fast);
}
.btn-ghost:hover { border-color: var(--text-3); color: var(--text); background: var(--surface-2); }

.link { color: var(--accent); font-weight: 600; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* =========================================================
   登录 / 安装页
   ========================================================= */
.gate-body {
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
  background:
    radial-gradient(1100px 620px at 12% -8%,  rgba(139,124,255,.22), transparent 62%),
    radial-gradient(900px 560px at 92% 108%, rgba(80,200,255,.14), transparent 60%),
    var(--bg);
}
.gate { width: 100%; max-width: 392px; }
.gate-brand { text-align: center; margin-bottom: 26px; }
.gate-logo {
  width: 56px; height: 56px; margin: 0 auto 14px;
  display: grid; place-items: center;
  border-radius: 17px;
  background: var(--accent); color: #fff;
  box-shadow: 0 12px 30px -10px var(--accent);
}
.gate-brand h1 { font-size: 25px; letter-spacing: .06em; }
.gate-brand p { color: var(--text-3); font-size: 13.5px; margin-top: 5px; }

.gate-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px 26px 24px;
  box-shadow: var(--shadow);
}
.gate-card h2 { font-size: 15px; color: var(--text-2); font-weight: 600; margin-bottom: 16px; }
.gate-card label { display: block; margin-bottom: 14px; font-size: 12.5px; color: var(--text-3); font-weight: 550; }
.gate-card input {
  display: block; width: 100%; margin-top: 7px;
  height: 44px; padding: 0 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  transition: border-color var(--fast), background var(--fast), box-shadow var(--fast);
}
.gate-card input:focus {
  outline: none;
  border-color: var(--accent-line);
  background: var(--bg-elev);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.gate-card .btn-primary { width: 100%; margin-top: 6px; }
.gate-error {
  background: rgba(255,107,122,.11);
  border: 1px solid rgba(255,107,122,.3);
  color: var(--danger);
  padding: 10px 13px; border-radius: var(--r-sm);
  font-size: 13px; margin-bottom: 14px;
}
.gate-foot { text-align: center; color: var(--text-3); font-size: 13px; margin-top: 18px; }
.check-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; font-size: 13.5px;
  border-bottom: 1px solid var(--line);
}
.check-list li:last-child { border-bottom: 0; }
.check-list span { width: 18px; text-align: center; font-weight: 700; }
.check-list .ok  span { color: var(--ok); }
.check-list .bad { color: var(--danger); }
.check-list .bad span { color: var(--danger); }

/* =========================================================
   主框架
   ========================================================= */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) var(--player-h);
  grid-template-areas: "sidebar main" "player player";
  height: 100dvh;
}

/* ---------- 侧边栏 ---------- */
.sidebar {
  grid-area: sidebar;
  display: flex; flex-direction: column;
  background: var(--bg-elev);
  border-right: 1px solid var(--line);
  min-height: 0;
  z-index: 40;
}

.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 20px 18px 16px;
  flex: none;
}
.brand-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--accent); color: #fff;
  box-shadow: 0 6px 16px -6px var(--accent);
}
.brand-text { font-size: 16.5px; font-weight: 680; letter-spacing: .1em; }
.sidebar-close { display: none; margin-left: auto; }

.nav { padding: 0 10px; display: flex; flex-direction: column; gap: 2px; flex: none; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 0 12px; height: 40px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 13.5px; font-weight: 550;
  text-align: left;
  transition: background var(--fast), color var(--fast);
  position: relative;
}
.nav-item svg { flex: none; opacity: .9; }
.nav-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item em {
  font-style: normal; font-size: 11.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-item.active em { color: var(--accent); opacity: .75; }
.nav-item.active::before {
  content: ""; position: absolute; left: -10px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-section { margin-top: 20px; flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0 10px; }
.nav-section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px 6px;
  font-size: 11px; font-weight: 700;
  color: var(--text-3);
  letter-spacing: .14em; text-transform: uppercase;
  flex: none;
}
.playlist-list { overflow-y: auto; flex: 1; min-height: 0; padding-bottom: 8px; display: flex; flex-direction: column; gap: 1px; }
.pl-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 0 12px; height: 36px;
  border-radius: var(--r-sm);
  color: var(--text-2); font-size: 13px;
  text-align: left;
  transition: background var(--fast), color var(--fast);
}
.pl-item i {
  width: 22px; height: 22px; border-radius: 6px; flex: none;
  background: linear-gradient(135deg, hsl(var(--h),48%,58%), hsl(var(--h2),52%,40%));
}
.pl-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-item em { font-style: normal; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.pl-item:hover { background: var(--surface-2); color: var(--text); }
.pl-item.active { background: var(--accent-soft); color: var(--accent); }
.pl-empty { padding: 10px 12px; font-size: 12.5px; color: var(--text-3); line-height: 1.6; }

.sidebar-foot { flex: none; padding: 12px 14px 16px; border-top: 1px solid var(--line); }
.btn-upload {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 40px;
  border-radius: var(--r-sm);
  background: var(--accent); color: var(--accent-ink);
  font-size: 13.5px; font-weight: 620;
  transition: filter var(--fast), transform var(--fast);
  box-shadow: 0 8px 20px -10px var(--accent);
}
.btn-upload:hover { filter: brightness(1.09); }
.btn-upload:active { transform: scale(.98); }

.user-row { display: flex; align-items: center; gap: 9px; margin-top: 13px; }
.avatar {
  width: 32px; height: 32px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 13px; font-weight: 700;
}
.user-meta { flex: 1; min-width: 0; line-height: 1.3; }
.user-meta strong { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { display: block; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.scrim {
  position: fixed; inset: 0; z-index: 35;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity var(--slow);
}
.scrim.on { opacity: 1; pointer-events: auto; }

/* ---------- 顶栏 ---------- */
.main {
  grid-area: main;
  display: flex; flex-direction: column;
  min-width: 0; min-height: 0;
}

.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 24px;
  flex: none;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}
.menu-btn { display: none; }

.search {
  display: flex; align-items: center; gap: 9px;
  flex: 1; max-width: 460px;
  height: 40px; padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--text-3);
  transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
}
.search:focus-within {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
  color: var(--accent);
}
.search svg { flex: none; }
.search input {
  flex: 1; min-width: 0;
  background: none; border: 0; outline: none;
  color: var(--text); font-size: 13.5px;
}
.search input::placeholder { color: var(--text-3); }
.search input::-webkit-search-cancel-button { display: none; }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.select-wrap { position: relative; display: inline-flex; }
.select-wrap::after {
  content: ""; position: absolute; right: 13px; top: 50%;
  width: 6px; height: 6px; margin-top: -4px;
  border-right: 1.8px solid var(--text-3);
  border-bottom: 1.8px solid var(--text-3);
  transform: rotate(45deg);
  pointer-events: none;
}
.select-wrap select {
  appearance: none; -webkit-appearance: none;
  height: 40px; padding: 0 34px 0 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--text-2);
  font-size: 13px; font-weight: 550;
  cursor: pointer;
  transition: border-color var(--fast), color var(--fast);
}
.select-wrap select:hover { border-color: var(--line-strong); color: var(--text); }
.select-wrap select:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- 内容区 ---------- */
.content {
  flex: 1; min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 26px 24px 40px;
  scroll-behavior: smooth;
}

.page-head { margin-bottom: 22px; display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 27px; letter-spacing: -.02em; }
.page-head .sub { color: var(--text-3); font-size: 13px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.page-head .head-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* 专辑/艺人大头图 */
.hero {
  display: flex; gap: 24px; align-items: flex-end;
  padding: 10px 0 26px;
  margin-bottom: 8px;
}
.hero-art {
  width: 180px; height: 180px; flex: none;
  border-radius: var(--r);
  box-shadow: var(--shadow);
  object-fit: cover;
  background: var(--surface-2);
}
.hero-art.round { border-radius: 50%; }
.hero-meta { min-width: 0; padding-bottom: 6px; }
.hero-kicker { font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.hero-meta h1 { font-size: 36px; line-height: 1.12; margin: 8px 0 10px; letter-spacing: -.028em; word-break: break-word; }
.hero-sub { color: var(--text-2); font-size: 13.5px; }
.hero-sub b { color: var(--text); font-weight: 600; }
.hero-actions { display: flex; gap: 10px; margin-top: 18px; }

/* ---------- 曲目列表 ---------- */
.track-head {
  display: grid;
  grid-template-columns: 34px 1fr 24% 16% 78px 88px;
  gap: 14px; align-items: center;
  padding: 0 14px 9px;
  font-size: 11px; font-weight: 700;
  letter-spacing: .11em; text-transform: uppercase;
  color: var(--text-3);
  border-bottom: 1px solid var(--line);
  margin-bottom: 5px;
}
.track-head .th-dur { text-align: right; }
.track-head .th-act { text-align: right; }

.track-list { display: flex; flex-direction: column; }

.track {
  display: grid;
  grid-template-columns: 34px 1fr 24% 16% 78px 88px;
  gap: 14px; align-items: center;
  padding: 7px 14px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--fast);
  position: relative;
}
.track:hover { background: var(--surface); }
.track.playing { background: var(--accent-soft); }

.t-idx {
  position: relative;
  text-align: center;
  color: var(--text-3);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.t-idx .num { transition: opacity var(--fast); }
.t-idx .ply { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity var(--fast); color: var(--text); }
.track:hover .t-idx .num { opacity: 0; }
.track:hover .t-idx .ply { opacity: 1; }
.track.playing .t-idx .num { opacity: 0; }
.track.playing .t-idx .ply { opacity: 1; color: var(--accent); }

/* 播放中的跳动条 */
.eq { display: flex; align-items: flex-end; gap: 2px; height: 13px; }
.eq i { width: 2.5px; background: var(--accent); border-radius: 2px; animation: eq 1s ease-in-out infinite; height: 40%; }
.eq i:nth-child(2) { animation-delay: .22s; height: 85%; }
.eq i:nth-child(3) { animation-delay: .44s; height: 60%; }
@keyframes eq { 0%,100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
.paused .eq i { animation-play-state: paused; }

.t-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.t-cover {
  width: 40px; height: 40px; flex: none;
  border-radius: 7px;
  object-fit: cover;
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}
.t-name { min-width: 0; line-height: 1.35; }
.t-name strong {
  display: block; font-size: 13.5px; font-weight: 560;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.track.playing .t-name strong { color: var(--accent); }
.t-name small {
  display: none;
  font-size: 12px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.t-artist, .t-album {
  font-size: 12.5px; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.t-artist:hover, .t-album:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

.t-badge { display: flex; justify-content: flex-start; }
.fmt {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--r-xs);
  font-size: 10.5px; font-weight: 700;
  letter-spacing: .05em;
  background: var(--surface-2);
  color: var(--text-3);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.fmt.lossless { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.fmt.warn { color: var(--warn); border-color: rgba(255,196,107,.34); background: rgba(255,196,107,.1); }

.t-end { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.t-dur { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.t-acts { display: flex; gap: 0; opacity: 0; transition: opacity var(--fast); }
.track:hover .t-acts, .track:focus-within .t-acts { opacity: 1; }
.t-acts .icon-btn { width: 30px; height: 30px; }
.t-fav.on { color: var(--danger); }
.t-fav.on svg path { fill: currentColor; }

/* ---------- 网格(专辑 / 艺人 / 歌单) ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
  gap: 22px 18px;
}
.card { cursor: pointer; min-width: 0; }
.card-art {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
  transition: transform var(--slow), box-shadow var(--slow);
}
.card:hover .card-art { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-art img { width: 100%; height: 100%; object-fit: cover; }
.card.round .card-art { border-radius: 50%; }
.card-play {
  position: absolute; right: 10px; bottom: 10px;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #fff;
  box-shadow: 0 8px 22px rgba(0,0,0,.42);
  opacity: 0; transform: translateY(8px) scale(.9);
  transition: all var(--slow);
}
.card:hover .card-play { opacity: 1; transform: none; }
.card-play:hover { filter: brightness(1.1); }
.card.round .card-play { right: 6px; bottom: 6px; }
.card-text { margin-top: 11px; line-height: 1.4; min-width: 0; }
.card.round .card-text { text-align: center; }
.card-text strong {
  display: block; font-size: 13.5px; font-weight: 580;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-text small {
  display: block; font-size: 12px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- 空状态 ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 72px 24px;
  color: var(--text-3);
}
.empty-art {
  width: 88px; height: 88px; margin-bottom: 20px;
  border-radius: 26px;
  display: grid; place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-3);
}
.empty h3 { font-size: 16.5px; color: var(--text); margin-bottom: 7px; }
.empty p { font-size: 13.5px; max-width: 380px; line-height: 1.65; }
.empty .btn-primary { margin-top: 20px; }

.skeleton { display: flex; flex-direction: column; gap: 10px; }
.sk-row { height: 54px; border-radius: var(--r-sm); background: var(--surface); position: relative; overflow: hidden; }
.sk-row::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 6%, transparent), transparent);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* =========================================================
   播放器
   ========================================================= */
.player {
  grid-area: player;
  position: relative;
  background: var(--bg-elev);
  border-top: 1px solid var(--line);
  z-index: 45;
  display: flex; flex-direction: column;
}

.player-progress {
  position: relative;
  height: 4px;
  background: var(--surface-2);
  flex: none;
  cursor: pointer;
}
.player-progress:hover { height: 6px; }
.player-progress { transition: height var(--fast); }
.pp-buffer { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--surface-3); }
.pp-played {
  position: absolute; inset: 0 auto 0 0; width: 0;
  background: var(--accent);
  transition: width 90ms linear;
}
.pp-knob {
  position: absolute; right: 0; top: 50%;
  width: 12px; height: 12px;
  margin: -6px -6px 0 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.45);
  opacity: 0; transform: scale(.6);
  transition: all var(--fast);
}
.player-progress:hover .pp-knob { opacity: 1; transform: none; }
.player-progress input[type=range] {
  position: absolute; inset: -6px 0; width: 100%; height: 16px;
  opacity: 0; cursor: pointer; margin: 0;
}

.player-inner {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 0 20px;
}

.np { display: flex; align-items: center; gap: 12px; min-width: 0; cursor: pointer; }
.np-cover {
  width: 54px; height: 54px; flex: none;
  border-radius: 9px;
  object-fit: cover;
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
  transition: transform var(--slow);
}
.np:hover .np-cover { transform: scale(1.05); }
.np-text { min-width: 0; line-height: 1.35; }
.np-text strong {
  display: block; font-size: 13.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.np-text small {
  display: block; font-size: 12px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.np-fav.on { color: var(--danger); }
.np-fav.on svg path { fill: currentColor; }

.controls { display: flex; align-items: center; gap: 6px; }
.play-btn {
  width: 46px; height: 46px; margin: 0 6px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--text); color: var(--bg);
  transition: transform var(--fast), filter var(--fast);
  box-shadow: var(--shadow-sm);
}
.play-btn > svg { grid-area: 1/1; }
.play-btn:hover { transform: scale(1.06); }
.play-btn:active { transform: scale(.96); }
.ic-load { animation: spin .85s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.player-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.time { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.time i { font-style: normal; }
.volume { display: flex; align-items: center; gap: 6px; }
.v-muted .v-wave { opacity: .25; }

input[type=range].vol, #volume {
  -webkit-appearance: none; appearance: none;
  width: 86px; height: 4px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  outline: none; cursor: pointer;
}
#volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--text-2);
  transition: background var(--fast), transform var(--fast);
}
#volume:hover::-webkit-slider-thumb { background: var(--accent); transform: scale(1.15); }
#volume::-moz-range-thumb {
  width: 12px; height: 12px; border: 0;
  border-radius: 50%; background: var(--text-2);
}

/* =========================================================
   全屏播放页
   ========================================================= */
.nowplaying {
  position: fixed; inset: 0;
  z-index: 60;
  display: grid; place-items: center;
  padding: 40px;
  overflow: hidden;
  animation: npIn var(--slow);
}
@keyframes npIn { from { opacity: 0; transform: translateY(16px); } }
.np-bg {
  position: absolute; inset: -12%;
  background-size: cover; background-position: center;
  filter: blur(72px) saturate(180%) brightness(.55);
  transform: scale(1.18);
  z-index: -2;
}
.nowplaying::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 58%, transparent), color-mix(in srgb, var(--bg) 88%, transparent));
}
.np-close { position: absolute; top: 20px; right: 22px; color: var(--text); background: var(--surface-2); }
.np-stage { display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 520px; }
.np-art {
  width: min(58vh, 380px); height: min(58vh, 380px);
  border-radius: var(--r-lg);
  object-fit: cover;
  box-shadow: var(--shadow-lg);
  background: var(--surface-2);
}
.np-info { margin-top: 30px; min-width: 0; width: 100%; }
.np-info h2 { font-size: 27px; letter-spacing: -.02em; line-height: 1.25; word-break: break-word; }
.np-info p { color: var(--text-2); font-size: 15px; margin-top: 8px; }
.np-chips { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-top: 20px; }
.np-chips i {
  font-style: normal; font-size: 11.5px; font-weight: 600;
  padding: 4px 11px; border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px solid var(--line);
  color: var(--text-2);
  backdrop-filter: blur(8px);
}

/* =========================================================
   队列抽屉
   ========================================================= */
.queue {
  position: fixed; top: 0; right: 0;
  width: 340px; max-width: 86vw;
  height: calc(100dvh - var(--player-h));
  background: var(--bg-elev);
  border-left: 1px solid var(--line);
  z-index: 50;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow);
  animation: slideIn var(--slow);
}
@keyframes slideIn { from { transform: translateX(100%); } }
.queue-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 16px 12px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.queue-head h3 { font-size: 14px; }
.queue-head em { font-style: normal; color: var(--text-3); font-weight: 500; font-size: 12px; margin-left: 4px; }
.queue-list { flex: 1; overflow-y: auto; padding: 8px; }
.q-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 9px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--fast);
}
.q-item:hover { background: var(--surface-2); }
.q-item.playing { background: var(--accent-soft); }
.q-item.playing .q-text strong { color: var(--accent); }
.q-item img { width: 36px; height: 36px; border-radius: 6px; flex: none; object-fit: cover; background: var(--surface-2); }
.q-text { flex: 1; min-width: 0; line-height: 1.32; }
.q-text strong { display: block; font-size: 12.8px; font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-text small { display: block; font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =========================================================
   弹窗 / 上传
   ========================================================= */
.modal {
  position: fixed; inset: 0; z-index: 70;
  display: grid; place-items: center;
  padding: 24px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  animation: fadeIn var(--fast);
}
@keyframes fadeIn { from { opacity: 0; } }
.modal-card {
  width: 100%; max-width: 440px;
  max-height: calc(100dvh - 48px);
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  animation: popIn var(--slow);
  overflow: hidden;
}
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.upload-card { max-width: 560px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 18px 14px;
  flex: none;
}
.modal-head h3 { font-size: 16px; }
.modal-card > div:not(.modal-head):not(.modal-foot) { padding: 0 18px; overflow-y: auto; }
.modal-foot {
  display: flex; align-items: center; gap: 10px; justify-content: flex-end;
  padding: 16px 18px;
  flex: none;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}
.dialog-card #dlgBody { padding-bottom: 6px; color: var(--text-2); font-size: 13.5px; line-height: 1.65; }
.dialog-card label { display: block; font-size: 12.5px; color: var(--text-3); font-weight: 550; margin-bottom: 12px; }
.dialog-card input, .dialog-card textarea {
  display: block; width: 100%; margin-top: 6px;
  min-height: 42px; padding: 10px 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  resize: vertical;
}
.dialog-card input:focus, .dialog-card textarea:focus {
  outline: none; border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.dlg-danger #dlgOk { background: var(--danger); box-shadow: 0 6px 18px -6px var(--danger); }

/* 拖放区 */
.dropzone {
  margin: 0 18px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: 30px 22px 24px;
  border: 1.6px dashed var(--line-strong);
  border-radius: var(--r);
  color: var(--text-3);
  transition: all var(--slow);
  flex: none;
}
.dropzone svg { color: var(--text-3); margin-bottom: 12px; transition: all var(--slow); }
.dropzone strong { font-size: 14.5px; color: var(--text); font-weight: 600; }
.dropzone > span { font-size: 12.5px; margin-top: 5px; }
.dropzone.over {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.dropzone.over svg { color: var(--accent); transform: translateY(-4px) scale(1.08); }
.fmt-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 16px; }
.fmt-chips i {
  font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: .05em;
  padding: 3px 9px; border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-3);
}
.fmt-chips .chip-native  { color: var(--ok);     border-color: color-mix(in srgb, var(--ok) 38%, transparent); }
.fmt-chips .chip-partial { color: var(--accent); border-color: var(--accent-line); }
.fmt-chips .chip-none    { color: var(--warn);   border-color: color-mix(in srgb, var(--warn) 38%, transparent); }
.dz-note { font-size: 11.5px; margin-top: 12px; color: var(--text-3); line-height: 1.6; }

.upload-list { padding: 12px 18px 0 !important; display: flex; flex-direction: column; gap: 7px; }
.up-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  font-size: 12.5px;
  position: relative;
  overflow: hidden;
}
.up-bar {
  position: absolute; left: 0; bottom: 0; height: 2px;
  background: var(--accent);
  transition: width 180ms linear;
}
.up-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-state { font-size: 11.5px; color: var(--text-3); flex: none; font-variant-numeric: tabular-nums; }
.up-item.done .up-state { color: var(--ok); }
.up-item.fail .up-state { color: var(--danger); }
.up-item.skip .up-state { color: var(--warn); }
.up-item .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex: none; }
.up-item.done .dot { background: var(--ok); }
.up-item.fail .dot { background: var(--danger); }
.up-item.skip .dot { background: var(--warn); }
.upload-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; flex: none;
  border-top: 1px solid var(--line);
  margin-top: 12px;
  font-size: 12.5px; color: var(--text-3);
}

/* =========================================================
   Toast / 右键菜单
   ========================================================= */
.toasts {
  position: fixed; left: 50%; bottom: calc(var(--player-h) + 18px);
  transform: translateX(-50%);
  z-index: 90;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 13px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  animation: toastIn var(--slow);
  max-width: min(90vw, 460px);
}
.toast.out { animation: toastOut 220ms var(--ease) forwards; }
.toast.err { border-color: rgba(255,107,122,.4); color: var(--danger); }
.toast.ok .tdot { background: var(--ok); }
.toast .tdot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
@keyframes toastIn  { from { opacity: 0; transform: translateY(12px) scale(.96); } }
@keyframes toastOut { to   { opacity: 0; transform: translateY(8px) scale(.96); } }

.ctxmenu {
  position: fixed; z-index: 95;
  min-width: 182px;
  padding: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  animation: popIn 160ms var(--ease);
}
.ctxmenu button {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 11px;
  border-radius: var(--r-xs);
  font-size: 13px; color: var(--text-2);
  text-align: left;
  transition: background var(--fast), color var(--fast);
}
.ctxmenu button:hover { background: var(--surface-3); color: var(--text); }
.ctxmenu button.danger:hover { color: var(--danger); }
.ctxmenu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }
.ctxmenu .ctx-label { padding: 7px 11px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 1180px) {
  .track-head, .track { grid-template-columns: 34px 1fr 22% 92px 76px; }
  .track-head .th-album, .t-album { display: none; }
}

@media (max-width: 900px) {
  :root { --player-h: 76px; }
  .track-head, .track { grid-template-columns: 30px 1fr 74px 40px; }
  .track-head .th-artist, .t-artist, .track-head .th-fmt, .t-badge { display: none; }
  .t-name small { display: block; }
  .t-acts { opacity: 1; }
  .t-acts .t-more { display: none; }
  .content { padding: 20px 16px 32px; }
  .topbar { padding: 11px 16px; }
  .hero { flex-direction: column; align-items: flex-start; gap: 16px; }
  .hero-art { width: 132px; height: 132px; }
  .hero-meta h1 { font-size: 27px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 18px 14px; }
}

@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "player"; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 272px;
    transform: translateX(-100%);
    transition: transform var(--slow);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .sidebar-close { display: inline-grid; }
  .menu-btn { display: inline-grid; }
  .queue { height: 100dvh; }
}

@media (max-width: 680px) {
  .player-inner { grid-template-columns: minmax(0,1fr) auto; gap: 10px; padding: 0 12px; }
  .player-right { display: none; }
  .controls { gap: 2px; }
  .controls #btnShuffle, .controls #btnRepeat { display: none; }
  .np-cover { width: 44px; height: 44px; }
  .play-btn { width: 42px; height: 42px; margin: 0 2px; }
  .np-fav { display: none; }
  .topbar-actions { display: none; }
  .np-art { width: min(52vh, 300px); height: min(52vh, 300px); }
  .np-info h2 { font-size: 21px; }
  .nowplaying { padding: 24px 20px; }
  .modal { padding: 14px; align-items: flex-end; }
  .modal-card { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
