/* 我的音乐 —— 样式
 * 颜色都定义成变量：浅色在 :root，深色在下面两处（跟随系统 / 手动选深色）。
 * 图表用色 --chart-1 已用 dataviz 校验脚本验证过对比度（浅色 #6250d6 on #fff，深色 #9085e9 on #1c1c21）。
 */
:root {
  color-scheme: light;
  --bg: #f4f4f7;
  --surface: #ffffff;
  --surface-2: #f0f0f4;
  --surface-3: #e5e5ec;
  --text: #16161b;
  --text-2: #55555f;
  --text-3: #85858f;
  --line: #e6e6ec;
  --accent: #6250d6;
  --accent-ink: #ffffff;
  --accent-soft: rgba(98, 80, 214, 0.12);
  --danger: #d03b3b;
  --ok: #17803d;
  --warn: #9a6200;
  --chart-1: #6250d6;
  --chart-track: #e6e2fa;
  --grid: #ececf1;
  --axis: #c8c8d1;
  --shadow: 0 10px 34px rgba(24, 22, 48, 0.14);
  --radius: 14px;
  --nav-h: 58px;
  --mini-h: 64px;
  --side-w: 220px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f0f12;
    --surface: #1c1c21;
    --surface-2: #24242a;
    --surface-3: #303037;
    --text: #f1f1f4;
    --text-2: #b9b9c3;
    --text-3: #8a8a94;
    --line: #2c2c33;
    --accent: #9085e9;
    --accent-ink: #15131f;
    --accent-soft: rgba(144, 133, 233, 0.16);
    --danger: #ef6b6b;
    --ok: #46c473;
    --warn: #e2a63c;
    --chart-1: #9085e9;
    --chart-track: #35315a;
    --grid: #2a2a31;
    --axis: #3c3c45;
    --shadow: 0 10px 34px rgba(0, 0, 0, 0.5);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0f12;
  --surface: #1c1c21;
  --surface-2: #24242a;
  --surface-3: #303037;
  --text: #f1f1f4;
  --text-2: #b9b9c3;
  --text-3: #8a8a94;
  --line: #2c2c33;
  --accent: #9085e9;
  --accent-ink: #15131f;
  --accent-soft: rgba(144, 133, 233, 0.16);
  --danger: #ef6b6b;
  --ok: #46c473;
  --warn: #e2a63c;
  --chart-1: #9085e9;
  --chart-track: #35315a;
  --grid: #2a2a31;
  --axis: #3c3c45;
  --shadow: 0 10px 34px rgba(0, 0, 0, 0.5);
}

/* ---------------- 基础 ---------------- */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 22px; height: 22px; flex: none; }
.icon.xl { width: 56px; height: 56px; color: var(--text-3); }
.icon.lg { width: 34px; height: 34px; color: var(--accent); }
.small { font-size: 12.5px; }
.muted { color: var(--text-3); }
.pad { padding: 8px 4px; margin: 0; }
.ok { color: var(--ok); }
.bad { color: var(--danger); }
.warn { color: var(--warn); }
.spacer { flex: 1; }
.link { color: var(--accent); }
.link:hover { text-decoration: underline; }
mark { background: var(--accent-soft); color: var(--accent); border-radius: 3px; padding: 0 1px; }

/* ---------------- 布局 ---------------- */

.content { padding: 0 16px calc(var(--nav-h) + var(--safe-b) + 28px); }
body.has-player .content { padding-bottom: calc(var(--nav-h) + var(--mini-h) + var(--safe-b) + 32px); }
.main { max-width: 900px; margin: 0 auto; outline: none; }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--line);
}
.brand { display: none; }
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; color: var(--text-3);
}
.nav-item.on { color: var(--accent); font-weight: 600; }

@media (min-width: 960px) {
  .nav {
    top: 0; right: auto; width: var(--side-w); height: auto;
    flex-direction: column; gap: 2px; padding: 22px 12px;
    border-top: 0; border-right: 1px solid var(--line);
  }
  .brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 18px; font-size: 17px; font-weight: 700; }
  .brand-mark {
    display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
    background: linear-gradient(135deg, #7a68f0, #4b3bb8); color: #fff;
  }
  .brand-mark .icon { width: 19px; height: 19px; }
  .nav-item {
    flex: none; flex-direction: row; justify-content: flex-start; gap: 12px;
    padding: 10px 12px; border-radius: 10px; font-size: 15px; color: var(--text-2);
  }
  .nav-item:hover { background: var(--surface-2); }
  .nav-item.on { background: var(--accent-soft); color: var(--accent); }
  .content { margin-left: var(--side-w); padding: 0 40px 48px; }
  body.has-player .content { padding-bottom: 120px; }
}

.offline-bar {
  max-width: 900px; margin: calc(var(--safe-t) + 10px) auto 0; padding: 8px 12px;
  border-radius: 10px; background: var(--surface-2); color: var(--text-2); font-size: 13px; text-align: center;
}

.view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(var(--safe-t) + 20px) 0 12px; }
.view-head.compact { padding-top: 6px; }
.view-head h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.view-head p { margin: 2px 0 0; }
.back {
  display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; color: var(--accent);
  padding: calc(var(--safe-t) + 16px) 4px 4px 0; font-size: 15px;
}
.back .icon { width: 20px; height: 20px; }

/* ---------------- 控件 ---------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 14px; font-weight: 500; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn .icon { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.07); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger); filter: brightness(1.07); }
.btn-danger-ghost { background: transparent; border-color: transparent; color: var(--danger); }
.btn-danger-ghost:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn-pill { border-radius: 999px; }
.btn:disabled { opacity: 0.5; cursor: default; filter: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: inherit;
}
.icon-btn:hover { background: var(--surface-2); }
.link-btn { border: 0; background: none; color: var(--accent); font-size: 14px; padding: 2px 0; white-space: nowrap; }

.input {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); outline: none; font-size: 15px;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input:disabled { opacity: 0.6; }
@media (max-width: 720px) { .input { font-size: 16px; } } /* iOS 小于 16px 会放大页面 */

.select {
  height: 34px; padding: 0 30px 0 10px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2385858f' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center / 14px;
  -webkit-appearance: none; appearance: none; font-size: 14px;
}

.seg { display: inline-flex; gap: 2px; background: var(--surface-2); border-radius: 10px; padding: 3px; margin-bottom: 14px; }
.seg a, .seg button { padding: 6px 16px; border: 0; border-radius: 8px; background: none; font-size: 14px; color: var(--text-2); }
.seg .on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.small-seg { margin: 0; }
.small-seg button { padding: 5px 10px; font-size: 13px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip {
  flex: none; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text-2); font-size: 14px;
}
.chip:hover { border-color: var(--text-3); }
.chip.on { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 600; }
.chip.ghost { border-style: dashed; color: var(--text-3); }

.range {
  -webkit-appearance: none; appearance: none; width: 100%; height: 22px; margin: 0;
  background: transparent; cursor: pointer; --p: 0%;
}
.range::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--range-fill, var(--accent)) var(--p), var(--range-track, var(--surface-3)) var(--p));
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px;
  border: 0; border-radius: 50%; background: var(--range-thumb, var(--accent));
}
.range::-moz-range-track { height: 4px; border-radius: 2px; background: var(--range-track, var(--surface-3)); }
.range::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--range-fill, var(--accent)); }
.range::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--range-thumb, var(--accent)); }

.switch {
  -webkit-appearance: none; appearance: none; position: relative; flex: none; margin: 0;
  width: 46px; height: 28px; border-radius: 14px; background: var(--surface-3); cursor: pointer; transition: background 0.2s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.2s;
}
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(18px); }

.empty { text-align: center; padding: 56px 16px; color: var(--text-2); }
.empty p { margin: 6px 0; }
.empty .btn { margin-top: 12px; }

/* ---------------- 封面 ---------------- */

.cover {
  position: relative; display: inline-grid; place-items: center; flex: none; overflow: hidden;
  border-radius: 8px; color: var(--accent);
  background: linear-gradient(135deg, var(--accent-soft), var(--surface-3));
}
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover.sm { width: 44px; height: 44px; }
.cover.sm .icon { width: 20px; height: 20px; }
.cover.md { width: 60px; height: 60px; border-radius: 10px; }
.cover.xl { width: 160px; height: 160px; border-radius: 16px; box-shadow: var(--shadow); }
.cover.xl .icon { width: 54px; height: 54px; }
.cover.round { border-radius: 50%; }
.cover.fill { width: 100%; height: auto; aspect-ratio: 1; border-radius: 12px; }
.cover.fill .icon { width: 36%; height: 36%; }

/* ---------------- 歌曲列表 ---------------- */

.list-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.list-count { flex: 1; min-width: 6em; font-size: 12.5px; color: var(--text-3); }
@media (max-width: 560px) {
  /* 手机上：按钮和排序一行，歌曲数量单独一行 */
  .list-bar .select { margin-left: auto; }
  .list-count { order: 3; flex-basis: 100%; }
  .list-count:empty { display: none; }
}

.song-list, .list { background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.song-row {
  display: flex; align-items: center; gap: 2px; padding-right: 4px;
  border-bottom: 1px solid var(--line);
  content-visibility: auto; contain-intrinsic-size: auto 62px;
}
.song-row:last-child { border-bottom: 0; }
.song-row:hover { background: var(--surface-2); }
.song-hit {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px;
  padding: 8px 4px 8px 12px; border: 0; background: none; text-align: left;
}
.cover-wrap { position: relative; display: inline-flex; flex: none; }
.song-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.song-title { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-sub {
  display: flex; align-items: center; gap: 4px; min-width: 0;
  font-size: 12.5px; color: var(--text-3); white-space: nowrap;
}
.song-sub > span { overflow: hidden; text-overflow: ellipsis; }
.song-extra { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.song-dur { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; padding: 0 2px; }
.song-more { color: var(--text-3); }
.song-row.playing .song-title { color: var(--accent); font-weight: 600; }
.cached-mark { display: none; width: 14px; height: 14px; color: var(--accent); }
.song-row.is-cached .cached-mark { display: inline-block; }
body.offline .song-row:not(.is-cached) { opacity: 0.45; }

.eq {
  position: absolute; inset: 0; display: none; align-items: flex-end; justify-content: center; gap: 3px;
  padding-bottom: 12px; border-radius: 8px; background: rgba(0, 0, 0, 0.45);
}
.song-row.playing .eq { display: flex; }
.eq i { width: 3px; height: 35%; border-radius: 1px; background: #fff; }
.eq i:nth-child(2) { height: 60%; }
.eq i:nth-child(3) { height: 45%; }
body.is-playing .song-row.playing .eq i { animation: eq 0.9s ease-in-out infinite alternate; }
body.is-playing .song-row.playing .eq i:nth-child(2) { animation-delay: -0.3s; }
body.is-playing .song-row.playing .eq i:nth-child(3) { animation-delay: -0.6s; }
@keyframes eq { from { height: 20%; } to { height: 70%; } }

.list-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--surface-2); }
.list-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list-row-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row-sub { font-size: 12.5px; color: var(--text-3); }

.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 18px 14px; }
.album-card { display: flex; flex-direction: column; min-width: 0; }
.album-card:hover .cover { filter: brightness(0.95); }
.album-name { margin-top: 7px; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.album-artist { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------- 详情 / 卡片 ---------------- */

.detail-head { display: flex; align-items: flex-end; gap: 20px; margin: 10px 0 18px; }
.detail-info { min-width: 0; }
.detail-info h1 { margin: 0 0 6px; font-size: 25px; line-height: 1.25; }
.detail-info p { margin: 6px 0 0; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.detail-lyrics p { margin: 0; padding: 4px 0; }
.detail-lyrics .trans { display: block; font-size: 13px; color: var(--text-3); }
@media (max-width: 520px) {
  .detail-head { flex-direction: column; align-items: flex-start; }
}

.card { background: var(--surface); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.card-head h2 { margin: 0; font-size: 16px; font-weight: 650; }
.card-sub { margin: 2px 0 0; font-size: 12.5px; color: var(--text-3); }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.tile-label { font-size: 13px; color: var(--text-2); }
.tile-value { font-size: 23px; font-weight: 650; line-height: 1.3; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) {
  .tile { padding: 12px; }
  .tile-value { font-size: 19px; }
}

/* ---------------- 统计 ---------------- */

.stats-body { transition: opacity 0.2s; }
.stats-body.is-loading { opacity: 0.5; }
.kpis { display: grid; gap: 12px; margin-bottom: 16px; }
.kpis .tiles { margin: 0; }
.hero { background: var(--surface); border-radius: var(--radius); padding: 18px 20px; }
.hero-label { font-size: 14px; color: var(--text-2); }
.hero-value { font-size: clamp(36px, 10vw, 52px); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
@media (min-width: 760px) {
  .kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); align-items: stretch; }
  .kpis .tiles .tile { display: flex; flex-direction: column; justify-content: center; }
}

.chart { position: relative; }
.chart-svg { display: block; width: 100%; height: 220px; overflow: visible; }
.chart-svg .grid { stroke: var(--grid); stroke-width: 1; }
.chart-svg .axis { stroke: var(--axis); stroke-width: 1; }
.chart-svg .tick { fill: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-svg .bar { fill: var(--chart-1); transition: opacity 0.15s; }
.chart-svg .bar.on { opacity: 0.7; }
.chart-svg .hit { fill: transparent; outline: none; }
.chart-svg .hit:focus-visible { fill: var(--accent-soft); }
.chart-tip {
  position: absolute; z-index: 2; pointer-events: none;
  display: flex; flex-direction: column; padding: 7px 10px; border-radius: 8px;
  background: var(--text); color: var(--bg); box-shadow: var(--shadow);
  font-size: 12px; line-height: 1.45; white-space: nowrap;
}
.chart-tip strong { font-size: 14px; }
.chart-tip span { opacity: 0.8; }

.table-wrap { max-height: 360px; overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th, .data-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.data-table th:not(:first-child), .data-table td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.data-table thead th { position: sticky; top: 0; background: var(--surface); color: var(--text-2); font-weight: 600; }

.rank, .recent { list-style: none; margin: 0; padding: 0; }
.rank-row, .recent-row {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 6px;
  border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; border-radius: 0;
}
.rank li:last-child .rank-row, .recent li:last-child .recent-row { border-bottom: 0; }
button.rank-row:hover, button.recent-row:hover { background: var(--surface-2); }
.rank-no { width: 22px; flex: none; text-align: center; color: var(--text-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.rank-main, .recent-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rank-title, .recent-title { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-sub, .recent-sub { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-fig, .recent-fig {
  display: flex; flex-direction: column; align-items: flex-end; flex: none;
  font-size: 12.5px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.rank-fig strong { color: var(--text); font-size: 14px; font-weight: 600; }
.recent-fig span:first-child { color: var(--text-2); }
.meter { display: block; height: 8px; margin-top: 6px; border-radius: 4px; background: var(--chart-track); overflow: hidden; }
.meter-fill { display: block; height: 100%; border-radius: 4px; background: var(--chart-1); }

/* ---------------- 搜索 ---------------- */

.search-box { position: relative; margin-bottom: 12px; }
.search-box > .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: var(--text-3); }
.search-input { height: 46px; padding-left: 40px; font-size: 16px; border-radius: 12px; }
.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none; width: 18px; height: 18px; cursor: pointer; background-color: var(--text-3);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='%23000'/%3E%3Cpath d='M8.5 8.5l7 7M15.5 8.5l-7 7' stroke='%23fff' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20zm-2.7 6L8 9.3l2.7 2.7L8 14.7 9.3 16l2.7-2.7 2.7 2.7 1.3-1.3-2.7-2.7L16 9.3 14.7 8 12 10.7z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.sec-title { margin: 18px 4px 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.search-sec:first-child .sec-title { margin-top: 4px; }

/* ---------------- 设置 ---------------- */

.group-title { margin: 22px 4px 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.group { background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row.column { flex-direction: column; align-items: stretch; gap: 2px; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 15px; }
.row-sub { margin-top: 2px; font-size: 12.5px; color: var(--text-3); }

/* ---------------- 弹窗 ---------------- */

dialog.sheet {
  display: flex; flex-direction: column;
  width: 100%; max-width: 100%; max-height: 90vh; margin: auto 0 0; padding: 0;
  border: 0; border-radius: 18px 18px 0 0;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow);
  animation: sheet-in 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}
dialog.sheet:not([open]) { display: none; }
dialog.sheet::backdrop { background: rgba(8, 8, 14, 0.5); }
@keyframes sheet-in { from { transform: translateY(30px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 8px 6px 20px; }
.sheet-head h2 { margin: 0; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-body { padding: 4px 20px 16px; overflow-y: auto; overscroll-behavior: contain; }
.sheet-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 12px 20px calc(12px + var(--safe-b)); border-top: 1px solid var(--line);
}
.sheet-foot-note { margin-right: auto; }
@media (min-width: 720px) {
  dialog.sheet { margin: auto; width: min(460px, calc(100vw - 32px)); border-radius: 18px; max-height: 86vh; }
  dialog.sheet.wide { width: min(720px, calc(100vw - 32px)); }
  .sheet-foot { padding-bottom: 14px; }
}

.menu { display: flex; flex-direction: column; margin: 0 -10px; }
.menu button {
  display: flex; align-items: center; gap: 14px; padding: 12px; border: 0; border-radius: 10px;
  background: none; text-align: left; font-size: 15px;
}
.menu button:hover { background: var(--surface-2); }
.menu button .icon { color: var(--text-2); }
.menu .danger, .menu .danger .icon { color: var(--danger); }
.menu-song { display: flex; align-items: center; gap: 12px; padding: 0 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.confirm-msg { margin: 4px 0 8px; color: var(--text-2); }
.login-form { display: flex; flex-direction: column; gap: 12px; padding-bottom: 6px; }
.login-form p { margin: 0; }

.queue-list { margin: 0 -10px; }
.queue-row { display: flex; align-items: center; gap: 2px; border-radius: 10px; }
.queue-row:hover { background: var(--surface-2); }
.queue-row.on { background: var(--accent-soft); }
.queue-row.on .song-title { color: var(--accent); font-weight: 600; }
.queue-hit { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 9px 8px; border: 0; background: none; text-align: left; }
.queue-no { width: 26px; flex: none; text-align: center; font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.queue-no .icon { width: 15px; height: 15px; color: var(--accent); }

/* 上传 */
.drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px;
  border: 1.5px dashed var(--line); border-radius: 14px; text-align: center;
}
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop p { margin: 0; }
.drop .btn { margin-top: 6px; }
.up-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.up-item { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.up-item.is-off { opacity: 0.62; }
.up-item.is-done { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.up-check { padding-top: 9px; }
.up-check input, .up-lrc input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.up-fields { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.up-fields .input { height: 36px; }
.up-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.up-status:empty { display: none; }
.progress { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.progress span { display: block; width: 0; height: 100%; background: var(--accent); transition: width 0.2s; }
.up-lyrics h3 { margin: 18px 0 6px; font-size: 14px; }
.up-lrc { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.up-lrc .icon { width: 18px; height: 18px; color: var(--text-3); }
.up-lrc.is-off { opacity: 0.75; }
@media (max-width: 520px) {
  .up-item { grid-template-columns: auto minmax(0, 1fr); }
  .up-item .cover { display: none; }
  .up-row { grid-template-columns: 1fr; }
}

/* 编辑 */
.edit-cover { display: flex; align-items: center; gap: 16px; margin: 4px 0 14px; }
.edit-cover .cover.xl { width: 120px; height: 120px; box-shadow: none; }
.edit-cover-btns { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field > span { font-size: 13px; color: var(--text-2); }
.field-row { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.field-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.field-head > span:first-child { font-size: 13px; color: var(--text-2); }
.field-head .btn { margin-left: auto; }
.lyrics-input {
  height: auto; min-height: 220px; padding: 10px 12px; resize: vertical;
  font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.offset-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.offset-val { min-width: 6.5em; text-align: center; font-size: 14px; font-variant-numeric: tabular-nums; }

/* ---------------- 迷你播放条 ---------------- */

.mini {
  position: fixed; z-index: 29; left: 8px; right: 8px; bottom: calc(var(--nav-h) + var(--safe-b) + 6px);
  height: var(--mini-h); display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "open ctrls";
  align-items: center; gap: 4px; padding: 0 6px 0 8px; overflow: hidden;
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow);
}
.mini-line { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--surface-3); }
.mini-line span { display: block; width: 0; height: 100%; background: var(--accent); }
.mini-open { grid-area: open; display: flex; align-items: center; gap: 10px; min-width: 0; height: 100%; padding: 0; border: 0; background: none; text-align: left; }
.mini-text { display: flex; flex-direction: column; min-width: 0; }
.mini-title { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-sub { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-ctrls { grid-area: ctrls; display: flex; align-items: center; }
.mini-seek { grid-area: seek; align-items: center; gap: 10px; }
.mini-vol { grid-area: vol; align-items: center; gap: 8px; justify-self: end; color: var(--text-3); }
.mini-vol .range { width: 110px; }
.time { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; min-width: 3.2em; }
.time:last-child { text-align: right; }
.mode-on { color: var(--accent); }
.desk { display: none !important; }

@media (min-width: 960px) {
  .mini {
    left: var(--side-w); right: 0; bottom: 0; height: 88px; padding: 0 24px;
    border-radius: 0; border-top: 1px solid var(--line); box-shadow: none;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 560px) minmax(0, 1fr);
    grid-template-areas: "open ctrls vol" "open seek vol";
    align-content: center; row-gap: 0;
  }
  .mini-ctrls { justify-self: center; gap: 6px; }
  .mini .play-btn { background: var(--text); color: var(--bg); }
  .mini .play-btn:hover { background: var(--text); opacity: 0.9; }
  .mini-line { display: none; }
  .icon-btn.desk { display: inline-grid !important; }
  .mini-seek.desk, .mini-vol.desk { display: flex !important; }
  .mini .cover.sm { width: 52px; height: 52px; }
}

/* ---------------- 全屏播放页 ---------------- */

.fp {
  position: fixed; inset: 0; z-index: 50; isolation: isolate;
  display: flex; flex-direction: column; overflow: hidden;
  padding: var(--safe-t) 0 var(--safe-b);
  color: #fff; background: #17151f;
  transform: translateY(100%); transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.fp.open { transform: none; }
.fp-bg {
  position: absolute; inset: -25%; z-index: -1;
  background: radial-gradient(circle at 30% 25%, #5a49c9, #17151f 70%) center / cover no-repeat;
  filter: blur(50px) saturate(1.35);
}
.fp-bg::after { content: ""; position: absolute; inset: 0; background: rgba(14, 12, 22, 0.6); }
.fp .icon-btn:hover { background: rgba(255, 255, 255, 0.12); }
.fp-top { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; }
.fp-top-title { font-size: 13px; letter-spacing: 0.1em; opacity: 0.75; }
.fp-body { flex: 1; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.fp-body::-webkit-scrollbar { display: none; }
.fp-page { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 28px; }
.fp-art {
  display: grid; place-items: center; width: min(78vw, 44vh, 420px); aspect-ratio: 1; padding: 0; overflow: hidden;
  border: 0; border-radius: 18px; background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  transform: scale(0.93); transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
body.is-playing .fp-art { transform: none; }
.fp-art img { width: 100%; height: 100%; object-fit: cover; }
.fp-art .icon { width: 30%; height: 30%; }
.fp-line { margin: 24px 0 0; min-height: 3.2em; max-width: 34em; text-align: center; font-size: 16px; font-weight: 500; opacity: 0.92; cursor: pointer; }
.fp-line .lrc-trans { display: block; margin-top: 2px; font-size: 13px; opacity: 0.7; }
.fp-lyrics-page { align-items: stretch; padding: 0; }
.lyrics {
  position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 0 28px; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent);
}
.lyrics::-webkit-scrollbar { display: none; }
.lrc-pad { height: 42vh; }
.lrc-line {
  margin: 0; padding: 9px 0; font-size: 19px; font-weight: 650; line-height: 1.45;
  color: rgba(255, 255, 255, 0.4); cursor: pointer; transform-origin: left center;
  transition: color 0.25s, transform 0.25s;
}
.lrc-line:hover { color: rgba(255, 255, 255, 0.65); }
.lrc-line.on { color: #fff; transform: scale(1.04); }
.lrc-line.gap { color: rgba(255, 255, 255, 0.25); }
.lrc-trans { display: block; margin-top: 2px; font-size: 14px; font-weight: 500; }
.lyrics.unsynced .lrc-line { color: rgba(255, 255, 255, 0.86); font-weight: 500; cursor: default; }
.lyrics.unsynced .lrc-pad { height: 10vh; }
.lrc-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; opacity: 0.75; }
.lrc-empty p { margin: 0; }
.fp-btn { background: rgba(255, 255, 255, 0.14); border-color: transparent; color: #fff; }
.fp-btn:hover { background: rgba(255, 255, 255, 0.22); }
.fp-dots { display: flex; justify-content: center; gap: 8px; padding: 8px 0 4px; }
.fp-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 4px; background: rgba(255, 255, 255, 0.35); transition: width 0.2s; }
.fp-dots button.on { width: 18px; background: #fff; }
.fp-info { padding: 6px 28px 0; min-width: 0; }
.fp-title { font-size: 21px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-artist { font-size: 14px; opacity: 0.72; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-seek { padding: 10px 28px 0; --range-fill: #fff; --range-track: rgba(255, 255, 255, 0.24); --range-thumb: #fff; }
.fp-times { display: flex; justify-content: space-between; font-size: 12px; opacity: 0.7; font-variant-numeric: tabular-nums; }
.fp-ctrls { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 440px; margin: 0 auto; padding: 6px 20px 18px; }
.fp-ctrls .mode-on { color: #fff; }
.fp-ctrls #fp-mode:not(.mode-on) { opacity: 0.55; }
.fp .icon-btn.lg { width: 56px; height: 56px; }
.fp .icon-btn.lg .icon { width: 30px; height: 30px; }
.fp .icon-btn.xl { width: 70px; height: 70px; background: #fff; color: #17151f; }
.fp .icon-btn.xl:hover { background: #fff; opacity: 0.92; }
.fp .icon-btn.xl .icon { width: 30px; height: 30px; }

@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  .fp {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    grid-template-rows: auto minmax(0, 1fr) auto auto auto;
    grid-template-areas: "top top" "art lyrics" "info lyrics" "seek lyrics" "ctrls lyrics";
    column-gap: 48px; padding: 0 56px 28px;
  }
  .fp-top { grid-area: top; padding: 14px 0; }
  .fp-body { display: contents; }
  .fp-cover-page { grid-area: art; padding: 0; }
  .fp-lyrics-page { grid-area: lyrics; min-height: 0; }
  .fp-dots, .fp-line { display: none; }
  .fp-art { width: min(34vw, 50vh, 460px); }
  .fp-info { grid-area: info; text-align: center; padding-top: 22px; }
  .fp-seek { grid-area: seek; }
  .fp-ctrls { grid-area: ctrls; }
  .lyrics { padding: 0 8px; }
  .lrc-line { font-size: 22px; }
}

/* ---------------- 提示 ---------------- */

.toast {
  position: fixed; left: 50%; z-index: 100; bottom: calc(var(--nav-h) + var(--mini-h) + var(--safe-b) + 18px);
  max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 999px;
  background: var(--text); color: var(--bg); font-size: 14px; text-align: center;
  opacity: 0; pointer-events: none; transform: translate(-50%, 16px); transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 960px) { .toast { left: calc(50% + var(--side-w) / 2); bottom: 110px; } }
body.fp-open .toast { bottom: calc(var(--safe-b) + 140px); left: 50%; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
