:root {
  --bg: #0e1013;
  --bg-soft: #16191f;
  --bg-card: #1b1f27;
  --bg-hover: #232833;
  --line: #2a303b;
  --text: #e8ecf2;
  --text-dim: #98a2b3;
  --text-mute: #6b7480;
  --accent: #ff5a5f;
  --accent-soft: #ff8a8d;
  --ok: #3ddc97;
  --warn: #ffb454;
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1 { font-size: 22px; margin: 0 0 4px; font-weight: 650; }
h2 { font-size: 18px; margin: 0 0 8px; }
h3 { font-size: 15px; margin: 0 0 8px; font-weight: 600; }
.muted { color: var(--text-dim); }
.hidden { display: none !important; }

#app { display: flex; flex-direction: column; min-height: 100vh; }

/* 顶部栏 */
.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 14px 28px;
  background: rgba(14,16,19,.92);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 260px; }
.logo {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #b23a48);
  font-size: 19px; color: #fff;
}
.brand-name { font-weight: 650; letter-spacing: .2px; }
.brand-sub { font-size: 12px; color: var(--text-mute); }

.tabs { display: flex; gap: 4px; flex: 1; }
.tab {
  background: transparent; border: 0; padding: 8px 16px;
  color: var(--text-dim); border-radius: 999px; transition: .15s;
}
.tab:hover { color: var(--text); background: var(--bg-hover); }
.tab.active { color: #fff; background: var(--bg-card); box-shadow: inset 0 0 0 1px var(--line); }

.account { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); cursor: pointer; }
.account:hover { color: var(--text); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-mute); }
.dot.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }

/* ---- 账号菜单 ---- */
.account-wrap { position: relative; }
.acct-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: var(--bg-hover); }
.acct-caret { font-size: 10px; color: var(--text-mute); }
.acct-menu {
  position: absolute; top: calc(100% + 10px); right: 0; width: 264px; z-index: 120;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .55); padding: 10px;
}
.acct-menu-head { font-size: 12px; color: var(--text-mute); padding: 4px 8px 8px; }
.acct-row {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; cursor: pointer;
}
.acct-row:hover { background: var(--bg-hover); }
.acct-row.active { background: rgba(255, 90, 95, .12); }
.acct-row img, .acct-row .acct-ph {
  width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--bg-hover);
  display: grid; place-items: center; font-size: 13px; color: var(--text-mute); flex: none;
}
.acct-row-main { flex: 1; min-width: 0; }
.acct-row-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-row-sub { font-size: 11px; color: var(--text-mute); }
.acct-row .acct-mark { font-size: 11px; color: var(--accent-soft); }
.acct-row .acct-remove {
  border: 0; background: transparent; color: var(--text-mute); font-size: 13px;
  padding: 2px 6px; border-radius: 6px; opacity: 0;
}
.acct-row:hover .acct-remove { opacity: 1; }
.acct-row .acct-remove:hover { color: var(--accent); background: var(--bg-soft); }
.acct-menu-foot { display: flex; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.acct-menu-foot button { flex: 1; }
button.ghost.danger { color: var(--accent-soft); border-color: rgba(255, 90, 95, .35); }
button.ghost.danger:hover { color: #fff; background: var(--accent); border-color: var(--accent); }

/* 主体 */
main { flex: 1; padding: 26px 28px 120px; max-width: 1180px; width: 100%; margin: 0 auto; }
.panel { display: none; }
.panel.active { display: block; }

.feed-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.feed-actions { display: flex; gap: 8px; }

button.primary {
  background: var(--accent); border: 0; color: #fff;
  padding: 9px 18px; border-radius: 999px; font-weight: 600;
}
button.primary:hover { background: var(--accent-soft); }
button.ghost {
  background: transparent; border: 1px solid var(--line); color: var(--text-dim);
  padding: 8px 16px; border-radius: 999px;
}
button.ghost:hover { color: var(--text); border-color: var(--text-mute); background: var(--bg-hover); }

/* 口味条 */
.profile-strip {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 12px 14px; margin-bottom: 14px;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 13px;
}
/* chip 之间要有间距：连续排列时靠 gap 不够（不同容器拼接会贴在一起） */
.profile-strip > * { margin-right: 2px; }
.chip {
  padding: 3px 10px; border-radius: 999px;
  background: var(--bg-hover); color: var(--text-dim); cursor: pointer;
  border: 1px solid transparent;
}
.chip:hover { color: var(--text); border-color: var(--text-mute); }
.chip.hot { background: rgba(255,90,95,.14); color: var(--accent-soft); }
.chip-label { color: var(--text-mute); margin-right: 2px; }

/* 歌曲列表 */
.song-list { display: flex; flex-direction: column; gap: 2px; }
.song {
  /* 播放按钮与封面共享第 1 列（同格叠放），这样不必为它们增加包裹层——
     DOM 结构保持不变，桌面与手机的差异全部由 CSS 承担。 */
  display: grid; grid-template-columns: 32px 44px minmax(0, 1fr) 48px auto auto auto;
  align-items: center; gap: 12px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  transition: background .12s; cursor: pointer;
}
/* 两者都落在第 1 列第 1 行 */
.song .act-play { grid-column: 1; grid-row: 1; justify-self: center; }
.song .song-cover { grid-column: 2; grid-row: 1; }
.song:hover { background: var(--bg-card); }
.song-idx { color: var(--text-mute); font-variant-numeric: tabular-nums; text-align: right; font-size: 12px; }
.song-cover { width: 44px; height: 44px; border-radius: 6px; background: var(--bg-hover); object-fit: cover; }
.song-cover.no-cover, .album-cover.no-cover {
  display: grid; place-items: center; color: var(--text-mute); font-size: 18px;
  background: linear-gradient(135deg, var(--bg-hover), var(--bg-card));
}
.song-time { font-size: 12px; color: var(--text-mute); font-variant-numeric: tabular-nums; text-align: right; }
/* 播放次数徽标（播放历史页） */
.play-count {
  font-size: 11px; color: var(--accent-soft); background: rgba(255,90,95,.13);
  padding: 2px 8px; border-radius: 999px; white-space: nowrap; font-variant-numeric: tabular-nums;
}
/* 未满 30 秒的收听：中性色，和"已计入"区分开 */
.play-count.short { color: var(--text-mute); background: var(--bg-hover); }
/* 无数据时留空占位，保持网格列对齐 */
.play-count:empty { padding: 2px 8px; background: transparent; }
.song-main { min-width: 0; }
.song-name { font-weight: 520; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-sub { font-size: 12px; color: var(--text-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-reason { font-size: 12px; color: var(--text-mute); white-space: nowrap; }
.song-reason .tag { padding: 2px 8px; border-radius: 999px; background: var(--bg-hover); margin-left: 6px; }
.song-reason .tag.explore { background: rgba(61,220,151,.12); color: var(--ok); }
.album-cover { width: 100%; aspect-ratio: 1; border-radius: 8px; object-fit: cover; background: var(--bg-hover); margin-bottom: 8px; }
.play-btn {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line);
  background: transparent; color: var(--text-dim); display: grid; place-items: center;
}
.play-btn:hover { border-color: var(--accent); color: var(--accent); }
.song-actions { display: flex; gap: 4px; opacity: .25; transition: opacity .15s; }
.song:hover .song-actions { opacity: 1; }
.act {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: var(--text-mute); font-size: 14px;
}
.act:hover { background: var(--bg-hover); color: var(--text); }
.act.on-like { color: var(--accent); }
.act.on-save { color: var(--ok); }
.act.on-dislike { color: var(--text-mute); text-decoration: line-through; }

.more-wrap { display: flex; justify-content: center; padding: 24px 0; }

/* 过滤/搜索条 */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
/*
 * 输入框样式必须覆盖所有出现位置（.filters、.feed-actions、表单里）。
 * 之前只写了 .filters 后代选择器，搜索框移到 .feed-actions 后就丢了深色底，
 * 回退成浏览器默认白底 + 继承的浅色文字，看起来像"字和背景重叠"。
 */
.filters input[type=search],
.filters select,
.filters input[type=number],
.feed-actions input[type=search],
.feed-actions input[type=text],
.crawl-form input {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 16px;
  outline: none;
  color: var(--text);
  min-width: 150px;
}
.filters input[type=search], .feed-actions input[type=search] { flex: 1; min-width: 220px; }
.filters input::placeholder, .feed-actions input::placeholder, .crawl-form input::placeholder { color: var(--text-mute); }
.filters input:focus, .filters select:focus,
.feed-actions input:focus,
.crawl-form input:focus { border-color: var(--accent); }
/* 浏览器自动填充时不要覆盖成白底黑字 */
.feed-actions input:-webkit-autofill,
.filters input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--bg-card) inset;
}

.stats-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 18px; }
.stat {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; min-width: 130px;
}
.stat b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--text-mute); }

/* 卡片与表单 */
.card {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px;
}
.crawl-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 10px; }
.crawl-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-dim); }
.crawl-form input {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px 12px; width: 150px; outline: none;
}
.progress { margin-top: 14px; }
.bar { height: 8px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--warn)); transition: width .4s; }
.progress-text { font-size: 12px; color: var(--text-dim); margin-top: 6px; }
.logs {
  margin-top: 12px; max-height: 240px; overflow: auto;
  background: var(--bg-soft); border-radius: var(--radius-sm); padding: 12px;
  font: 12px/1.5 ui-monospace, Consolas, monospace; color: var(--text-dim); white-space: pre-wrap;
}
.job-list { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.job-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.job-row:last-child { border-bottom: 0; }
.badge { padding: 1px 8px; border-radius: 999px; font-size: 11px; background: var(--bg-hover); }
.badge.done { background: rgba(61,220,151,.14); color: var(--ok); }
.badge.running { background: rgba(255,180,84,.14); color: var(--warn); }
.badge.error { background: rgba(255,90,95,.14); color: var(--accent-soft); }

/* 调口味面板 */
.tuner {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px;
}
.tuner label { display: grid; grid-template-columns: 100px 1fr 46px; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 13px; color: var(--text-dim); }
.tuner input[type=range] { width: 100%; accent-color: var(--accent); }
.tuner-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* 歌手页 */
.artist-body { margin-top: 6px; }
.section-title {
  font-size: 15px; font-weight: 600; margin: 22px 0 12px;
  padding-left: 10px; border-left: 3px solid var(--accent); line-height: 1.2;
}
.section-title:first-child { margin-top: 8px; }

/* 歌手卡片网格：一行放 6-8 张，避免大屏上过于稀疏 */
.artist-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px;
}
.artist-card {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px; cursor: pointer; transition: border-color .15s, transform .15s, background .15s;
}
.artist-card:hover { border-color: var(--text-mute); background: var(--bg-hover); transform: translateY(-2px); }
.artist-cover {
  width: 100%; aspect-ratio: 1; border-radius: 8px; object-fit: cover;
  background: linear-gradient(135deg, var(--bg-hover), var(--bg-card)); margin-bottom: 8px;
}
.artist-cover.no-cover { display: grid; place-items: center; color: var(--text-mute); font-size: 26px; }
.artist-card-body { min-width: 0; }
.artist-card-body b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artist-card-body span { display: block; font-size: 12px; color: var(--text-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artist-rel { color: var(--accent-soft) !important; }

/* 口味歌手横排 */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* 歌手详情头部 */
.artist-detail-head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 6px; }
.artist-detail-cover { width: 132px; height: 132px; border-radius: 12px; object-fit: cover; background: var(--bg-hover); }
.artist-detail-cover.no-cover { display: grid; place-items: center; color: var(--text-mute); font-size: 34px; }
.artist-detail-meta { flex: 1; min-width: 0; }
.artist-detail-meta h2 { font-size: 24px; margin: 0 0 6px; }
.artist-detail-actions { display: flex; gap: 8px; margin-top: 12px; }

.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 14px 0 24px; }
.album { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; cursor: pointer; }
.album:hover { border-color: var(--text-mute); background: var(--bg-hover); }
.album b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.album span { font-size: 12px; color: var(--text-mute); }

/* 我的 */
.me-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.conclusion { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.conclusion:last-child { border-bottom: 0; }
.bar-row { display: grid; grid-template-columns: 62px 1fr 54px; gap: 10px; align-items: center; font-size: 13px; margin-bottom: 6px; }
.bar-row .track { height: 8px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--accent); }

/* ===== 访问口令界面 ===== */
.gate {
  position: fixed; inset: 0; z-index: 500;
  display: grid; place-items: center;
  background: radial-gradient(1200px 600px at 50% -10%, #232833 0%, var(--bg) 60%);
}
.gate-box {
  width: 340px; text-align: center;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 16px;
  padding: 30px 26px 22px;
}
.gate-logo {
  width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 12px;
  display: grid; place-items: center; font-size: 22px; color: #fff;
  background: linear-gradient(135deg, var(--accent), #b23a48);
}
.gate-box h2 { margin: 0 0 6px; }
.gate-box p { font-size: 13px; margin: 0 0 16px; }
.gate-box input {
  width: 100%; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 999px; padding: 11px 18px; outline: none; color: var(--text);
  text-align: center; letter-spacing: 1px; margin-bottom: 12px;
}
.gate-box input:focus { border-color: var(--accent); }
.gate-box button { width: 100%; }
.gate-msg { min-height: 20px; font-size: 13px; color: var(--accent-soft); margin-top: 10px; }
.gate-hint { font-size: 11px !important; margin: 14px 0 0 !important; line-height: 1.6; }
.gate-hint code { background: var(--bg-hover); padding: 1px 5px; border-radius: 4px; }

/* ===== 每日推荐 ===== */
.daily-days { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.daily-days:empty { display: none; }
.day-chip {
  background: var(--bg-card); border: 1px solid var(--line); color: var(--text-dim);
  padding: 4px 12px; border-radius: 999px; font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.day-chip:hover { color: var(--text); border-color: var(--text-mute); }
.day-chip.active { color: #fff; background: var(--accent); border-color: transparent; font-weight: 600; }

/* 标注（"新歌手" / 历史日期）：挂在副标题行内，避免多占一行高度。
   桌面上用 margin-left:auto 推到本行右侧，形成独立视觉列。 */
.song-tag {
  display: inline-block; font-size: 11px; color: var(--text-dim);
  background: var(--bg-hover); padding: 1px 8px; border-radius: 999px;
  white-space: nowrap; margin-left: 8px; vertical-align: 1px;
}
.song-tag.date { color: var(--accent-soft); background: rgba(255, 90, 95, .12); }

/* ===== 播放器 ===== */
/* 音频引擎隐藏：播放控制全部由自定义 UI 驱动 */
#audio { position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none; }

.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: grid; grid-template-columns: minmax(220px, 1fr) minmax(320px, 1.4fr) minmax(200px, 1fr);
  align-items: center; gap: 20px;
  padding: 10px 24px 12px;
  background: rgba(20,23,28,.98); border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.np { display: flex; align-items: center; gap: 12px; min-width: 0; cursor: pointer; }
.np:hover .np-name { color: var(--accent); }
.np-cover { width: 52px; height: 52px; border-radius: 8px; background: var(--bg-hover); object-fit: cover; }
.np-meta { min-width: 0; flex: 1; }
.np-name { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .15s; }
.np-artist { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 播放条两侧空白区可点进歌词，给出可见反馈 */
.player { cursor: pointer; }
.player .controls, .player .player-right, .player .progress-row, .player #npLike { cursor: default; }

.player-center { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.controls { display: flex; align-items: center; gap: 10px; }
.ctrl {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid transparent;
  background: transparent; color: var(--text-dim); font-size: 15px; display: grid; place-items: center;
}
.ctrl:hover { color: var(--text); background: var(--bg-hover); }
.ctrl.active { color: var(--accent); }
.ctrl-main {
  width: 42px; height: 42px; font-size: 17px;
  background: var(--accent); color: #fff; border: 0;
}
.ctrl-main:hover { background: var(--accent-soft); color: #fff; }

.progress-row { display: flex; align-items: center; gap: 10px; width: 100%; }
.time { font-size: 11px; color: var(--text-mute); font-variant-numeric: tabular-nums; width: 38px; text-align: center; }
.seek {
  flex: 1; height: 4px; background: var(--bg-hover); border-radius: 999px;
  position: relative; cursor: pointer;
}
.seek:hover { height: 6px; }
.seek-fill { height: 100%; width: 0; background: var(--accent); border-radius: 999px; }
.seek-knob {
  position: absolute; top: 50%; left: 0; width: 11px; height: 11px; border-radius: 50%;
  background: #fff; transform: translate(-50%, -50%); opacity: 0; transition: opacity .15s;
}
.seek:hover .seek-knob { opacity: 1; }

.player-right { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
#volumeBar { width: 90px; accent-color: var(--accent); }
button.ghost.small { padding: 6px 12px; font-size: 13px; }

/* ===== 歌词页（全屏，参照网易云） ===== */
.lyrics-page {
  position: fixed; inset: 0; z-index: 90;
  transform: translateY(100%); transition: transform .32s cubic-bezier(.4,0,.2,1);
  display: flex; overflow: hidden;
}
.lyrics-page.open { transform: translateY(0); }

/* 封面模糊成的背景，压暗保证歌词可读 */
.lp-bg {
  position: absolute; inset: -10%;
  background: center/cover no-repeat var(--bg);
  filter: blur(60px) brightness(.32) saturate(1.3);
  transform: scale(1.15);
}
.lp-inner {
  position: relative; z-index: 1; flex: 1;
  display: grid; grid-template-rows: auto 1fr auto;
  background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.62));
}

/* 顶部信息 */
.lp-head { display: flex; align-items: center; gap: 18px; padding: 20px 40px 8px; }
.lp-close {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.06); color: #fff; font-size: 16px; line-height: 1;
}
.lp-close:hover { background: rgba(255,255,255,.16); }
.lp-info { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.lp-cover { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; box-shadow: 0 6px 20px rgba(0,0,0,.5); }
.lp-title { font-size: 19px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-artist { font-size: 13px; color: rgba(255,255,255,.75); }
.lp-sub { font-size: 12px; }
.lp-tools { display: flex; align-items: center; gap: 8px; }
.lp-tool {
  padding: 5px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.06); color: rgba(255,255,255,.85); font-size: 13px;
}
.lp-tool:hover { background: rgba(255,255,255,.16); color: #fff; }
.lp-offset { font-size: 12px; color: rgba(255,255,255,.6); width: 44px; text-align: center; font-variant-numeric: tabular-nums; }

/* 歌词主体：左侧滚动歌词，右侧歌曲信息 */
.lp-body { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 32px; padding: 0 40px; min-height: 0; }
.lp-scroll {
  overflow-y: auto; padding: 12vh 0 40vh 8px;
  scrollbar-width: none; scroll-behavior: smooth;
}
.lp-scroll::-webkit-scrollbar { display: none; }

.lyric-line {
  padding: 9px 0; font-size: 17px; line-height: 1.45;
  color: rgba(255,255,255,.42); cursor: pointer;
  transition: color .25s, transform .25s, opacity .25s;
  transform-origin: left center; position: relative;
}
.lyric-line:hover { color: rgba(255,255,255,.8); }
.lyric-line.active { color: #fff; font-weight: 600; transform: scale(1.09); }
.lyric-line.active::before {
  content: ''; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 2px; background: var(--accent);
}
.lyric-trans { font-size: 13px; color: rgba(255,255,255,.45); margin-top: 3px; font-weight: 400; }
.lyric-line.active .lyric-trans { color: var(--accent-soft); }

/* 右侧歌曲信息（与歌词正文分开，和网易云一致） */
.lp-credits {
  align-self: start; margin-top: 12vh; max-height: 56vh; overflow-y: auto;
  font-size: 12px; color: rgba(255,255,255,.5); line-height: 1.9;
  border-left: 1px solid rgba(255,255,255,.12); padding-left: 20px;
}
.lp-credits-title { font-size: 13px; color: rgba(255,255,255,.72); margin-bottom: 8px; font-weight: 600; }

/* 底部播放条 */
.lp-player {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 40px 22px;
}
.lp-mini-cover { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; }
.lp-player .ctrl { border-color: rgba(255,255,255,.2); color: rgba(255,255,255,.8); }
.lp-player .ctrl:hover { background: rgba(255,255,255,.14); color: #fff; }
.lp-progress { display: flex; align-items: center; gap: 12px; flex: 1; }
.lp-progress .time { color: rgba(255,255,255,.6); }
.lp-seek { flex: 1; height: 4px; background: rgba(255,255,255,.2); border-radius: 999px; cursor: pointer; position: relative; }
.lp-seek:hover { height: 6px; }
.lp-seek-fill { height: 100%; width: 0; background: #fff; border-radius: 999px; }

/* ===== 播放队列 ===== */
.queue-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 380px; z-index: 80;
  background: var(--bg-soft); border-left: 1px solid var(--line);
  transform: translateX(105%); transition: transform .25s ease;
  display: flex; flex-direction: column;
}
.queue-panel.open { transform: translateX(0); }
.queue-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.queue-head div { display: flex; gap: 6px; }
.queue-now { padding: 12px 18px; border-bottom: 1px solid var(--line); }
.queue-list { flex: 1; overflow-y: auto; padding: 8px; }

/* ===== 顶栏音质 ===== */
.topbar-right { display: flex; align-items: center; gap: 16px; }
.quality-pick select {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px; font-size: 12px; outline: none; cursor: pointer;
}

/* ===== 播放历史页 ===== */
#panel-history .me-grid { grid-template-columns: 1fr 1fr; }
#panel-history .card { max-height: 520px; overflow-y: auto; }

.song.playing { background: rgba(255,90,95,.09); }
.song.playing .song-name { color: var(--accent); }
/* 当前正在播的行，整行点击是"打开歌词"，用默认指针暗示可点 */
.song.playing { cursor: pointer; }

/* ===== 适配：平板 / 窄窗口 =====
   注意：移动端有一整套规则在文件末尾（触屏专用），这里只处理"变窄但仍是鼠标"的情况 */
@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; gap: 12px; }
  .brand { min-width: auto; }
  .player-right { display: none; }
  .player-note { display: none; }
  .queue-panel { width: 100%; }
  /* 歌词页收紧留白并隐藏右侧信息栏 */
  .lp-head { padding: 14px 18px 6px; }
  .lp-body { grid-template-columns: 1fr; padding: 0 18px; }
  .lp-credits { display: none; }
  .lp-player { padding: 12px 18px 18px; }
  .lyric-line { font-size: 16px; }
}


/* 弹层 */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.7); display: grid; place-items: center;
}
.modal-box {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 16px;
  padding: 26px; width: 340px; text-align: center;
}
.qr-wrap { position: relative; width: 200px; height: 200px; margin: 16px auto; background: #fff; border-radius: 12px; display: grid; place-items: center; }
.qr-wrap img { width: 100%; height: 100%; border-radius: 12px; }
.qr-loading { position: absolute; color: #333; font-size: 13px; }
.qr-status { font-size: 13px; color: var(--text-dim); min-height: 20px; }
.modal-foot { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }

/* 提示 */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 20px; z-index: 200; box-shadow: 0 8px 30px rgba(0,0,0,.5);
}

/* ===== 适配：手机 =========================================================
   几个关键问题的成因与对策（都用 390×844 实测过）：

   1) 歌曲行原来有 7 个网格列（序号/封面/歌名/时长/次数/推荐理由/操作按钮），
      固定占位加起来超过 390px，把歌名那一列挤成 0 —— 表现为"看不到歌名"。
      这里砍成 3 列（播放+封面 / 歌名 / 操作），其余信息折叠进歌名下方一行。

   2) 标签和按钮原来是 flex 项，在窄屏被压到只剩一个字宽，于是"竖排显示"。
      给它们 white-space: nowrap 并允许横向滚动。

   3) 操作按钮平时 opacity:.25、悬停才 1 —— 触屏没有悬停，等于按钮不可见。
      手机上直接常显。

   4) 播放条原来三列并排，手机上挤成一条；改成"曲目+控制"一行 + 进度条一行。
   ========================================================================= */
@media (max-width: 640px) {
  /* ---- 全局触屏体验 ---- */
  html { -webkit-text-size-adjust: 100%; }
  body {
    /* 消除双击缩放带来的 300ms 点击延迟 */
    touch-action: manipulation;
    /* 长按选中文字在播放器里很烦人，仅在需要的地方恢复 */
    -webkit-user-select: none;
    user-select: none;
  }
  input, textarea { -webkit-user-select: text; user-select: text; }
  /* 点按反馈用背景色表达，去掉系统高亮块 */
  * { -webkit-tap-highlight-color: transparent; }
  /* 兜底：任何长串（歌名/URL）都不撑破布局 */
  .song-name, .song-sub, .np-name, .np-artist, .lyric-line { overflow-wrap: anywhere; }

  /* ---- 顶栏：品牌与账号一行，标签另起一行可横滑 ---- */
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
    padding: 10px 14px;
    align-items: center;
  }
  .brand { grid-column: 1; min-width: 0; gap: 9px; }
  .logo { width: 30px; height: 30px; border-radius: 9px; font-size: 16px; }
  .brand-name { font-size: 15px; }
  .brand-sub { font-size: 11px; }
  /* 曲库规模这类副标题在手机上占位且无用，收起来 */
  .topbar-right { grid-column: 2; gap: 10px; }
  .tabs {
    grid-column: 1 / -1;
    order: 3;
    /* 标签横滑而不是被压成竖排 */
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding-bottom: 2px;
    /* 让首尾标签不贴边 */
    margin: 0 -2px;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 7px 14px;
    font-size: 14px;
  }
  /* 账号名可能较长，允许截断 */
  #acctText { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* ---- 内容区 ---- */
  main { padding: 14px 12px calc(150px + env(safe-area-inset-bottom, 0px)); }
  h1 { font-size: 19px; }
  h2 { font-size: 16px; }
  h3 { font-size: 14px; }

  /* 标题与按钮：允许换行，按钮不竖排 */
  .feed-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 12px;
  }
  .feed-actions { flex-wrap: wrap; gap: 8px; }
  .feed-actions button {
    flex: 1 1 auto;
    white-space: nowrap;
    padding: 9px 14px;
  }
  .feed-actions input, .feed-actions select { flex: 1 1 130px; min-width: 0; }

  /* 口味条在手机上收起细节，避免占满首屏 */
  .profile-strip { padding: 10px 12px; font-size: 12px; gap: 6px; }
  .chip { padding: 3px 9px; font-size: 12px; }

  /* ---- 歌曲行：砍到 3 列，让歌名有完整宽度 ---- */
  .song {
    grid-template-columns: 46px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 2px 10px;
    padding: 7px 8px;
  }
  /* 手机上整行可点即播放，◀ 图标没必要再占位置 */
  .song .act-play { display: none; }
  .song .song-cover { grid-column: 1; grid-row: 1 / span 2; align-self: center; width: 46px; height: 46px; }
  .song-idx { display: none; }          /* 序号在手机上没意义 */
  .song-time { display: none; }         /* 时长同理，需要时看歌词页 */
  .song-main { grid-column: 2; grid-row: 1; }
  .song-name { font-size: 15px; }
  .song-sub { font-size: 12px; }
  /* 推荐理由折到歌名下方，不再单独占一列 */
  .song-reason {
    grid-column: 2 / -1;
    grid-row: 2;
    font-size: 11px;
    white-space: normal;
    margin-top: 1px;
  }
  .song-reason:empty { display: none; }
  /* 手机上标注跟着理由一起换行显示，不再单独占位 */
  .song-tag { margin-left: 4px; }
  .play-count {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    margin-top: 1px;
    font-size: 11px;
  }
  .play-count:empty { display: none; }
  /* 推荐理由与播放次数同处第 2 行时，让理由换到第 3 行避免重叠 */
  .play-count:not(:empty) ~ .song-reason:not(:empty) { grid-row: 3; }

  /* 触屏没有悬停：操作按钮常显，并放大到可点 */
  .song-actions {
    grid-column: 3;
    grid-row: 1 / span 2;
    opacity: .9;
    gap: 2px;
    align-self: center;
  }
  .song-actions .act { width: 32px; height: 32px; font-size: 15px; }
  /* 手机上优先保留高频操作，其余收起以免误触 */
  .act-save, .act-dislike { display: none; }

  /* ---- 播放条：曲目与控制一行，进度条一行 ---- */
  .player {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "np controls"
      "progress progress";
    row-gap: 6px;
    column-gap: 10px;
    align-items: center;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  }
  .np { grid-area: np; gap: 9px; }
  .np-cover { width: 42px; height: 42px; }
  .np-name { font-size: 14px; }
  .np-artist { font-size: 11px; }
  .player-center { grid-area: controls; }
  .controls { gap: 2px; }
  .ctrl { width: 36px; height: 36px; font-size: 15px; }
  .ctrl-main { width: 42px; height: 42px; font-size: 17px; }
  /* 播放条右侧（音量等）在手机上收进歌词页，这里隐藏 */
  .player-right { display: none; }
  .player-note { display: none; }
  .progress-row { grid-area: progress; gap: 8px; }
  .time { width: 34px; font-size: 10px; }
  /* 触屏上细进度条不好点，加粗命中区 */
  .seek { height: 6px; }
  .seek::before {
    content: '';
    position: absolute; left: 0; right: 0; top: -9px; bottom: -9px;
  }

  /* 提示条避开播放条 */
  .toast { bottom: calc(120px + env(safe-area-inset-bottom, 0px)); max-width: calc(100vw - 32px); font-size: 13px; }

  /* ---- 歌词页：全屏、大字号、去掉两侧留白 ---- */
  /* 头部原来是一行 flex（关闭 / 封面+标题 / 工具），手机宽度下标题会被工具压住。
     改成两行网格：第一行 关闭+工具，第二行 封面+歌曲信息。 */
  .lp-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "close . tools"
      "info info info";
    align-items: center;
    gap: 6px 10px;
    padding: 10px 14px 2px;
  }
  .lp-close { grid-area: close; width: 34px; height: 34px; }
  .lp-info { grid-area: info; gap: 11px; }
  .lp-tools { grid-area: tools; gap: 6px; }
  .lp-tool { padding: 6px 11px; font-size: 13px; }
  .lp-offset { width: 38px; font-size: 11px; }
  .lp-cover { width: 46px; height: 46px; }
  .lp-title { font-size: 17px; }
  .lp-artist { font-size: 12px; }
  .lp-sub { font-size: 11px; }

  .lp-body { padding: 0 16px; }
  .lp-scroll { padding: 8px 0 20px; }
  .lyric-line { font-size: 18px; padding: 7px 0; }
  /* 高亮行会放大 1.09 倍，手机上容易超出，收紧一点 */
  .lyric-line.active { transform: scale(1.05); }
  .lyric-trans { font-size: 13px; }
  .lp-credits { display: none; }
  .lp-player { padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 0px)); }
  .lp-progress { gap: 8px; }

  /* ---- 队列面板占满宽度 ---- */
  .queue-panel { width: 100%; }

  /* ---- 弹层与口令页 ---- */
  .modal-box { width: calc(100vw - 40px); max-width: 340px; padding: 22px 18px; }
  .gate-box { width: calc(100vw - 40px); max-width: 340px; padding: 26px 20px 20px; }
  .acct-menu { width: calc(100vw - 28px); right: 0; }

  /* ---- 歌手/专辑等卡片：两列更合适 ---- */
  .artist-grid, .album-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }

  /* ---- 数据统计与调参：窄屏单列，避免标签被压成竖排 ---- */
  .me-grid, #panel-history .me-grid { grid-template-columns: 1fr !important; }
  .tuner label { grid-template-columns: 76px minmax(0, 1fr) 40px; gap: 8px; }
  .tuner label span { white-space: nowrap; }
  .bar-row { grid-template-columns: 52px minmax(0, 1fr) 48px; font-size: 12px; }

  /* ---- 曲库/探索页的表单与分页 ---- */
  .crawl-form { flex-wrap: wrap; }
  .crawl-form input, .crawl-form select { flex: 1 1 120px; min-width: 0; }
  .pager { flex-wrap: wrap; gap: 8px; }
}

