/* ===== 雨的音乐盒 · 播放器主题 ===== */
:root {
  --bg: #1b1524;
  --bg-2: #241a31;
  --card: rgba(255, 255, 255, 0.05);
  --card-2: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.09);
  --text: #f3ece1;
  --muted: #a99fb4;
  --accent: #e8c39e;     /* 奶杏 */
  --accent-2: #c9a2d4;   /* 幸村的淡紫 */
  --accent-ink: #2a1f38;
  --danger: #d98a8a;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 600px at 15% -10%, #3a2a4d 0%, transparent 55%),
    radial-gradient(900px 500px at 110% 10%, #2c2340 0%, transparent 50%),
    var(--bg);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
.hidden { display: none !important; }

/* ===== 顶栏 ===== */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: rgba(27, 21, 36, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { font-size: 18px; font-weight: 700; letter-spacing: 0.5px; }
.login-link {
  font-size: 13px; color: var(--accent); text-decoration: none;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); white-space: nowrap;
}
.login-link:active { transform: scale(0.97); }

/* ===== 布局 ===== */
.app {
  max-width: 1100px; margin: 0 auto; padding: 18px;
  display: grid; grid-template-columns: 1fr; gap: 18px;
}
@media (min-width: 880px) {
  .app { grid-template-columns: minmax(0, 1fr) 350px; align-items: start; }
  .aside { position: sticky; top: 86px; }
}

/* ===== 正在听 ===== */
.now {
  display: flex; gap: 18px; align-items: center;
  padding: 18px; border-radius: var(--radius);
  background: linear-gradient(160deg, var(--card-2), var(--card));
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.now-art {
  position: relative; flex: 0 0 auto;
  width: 120px; height: 120px; border-radius: 14px; overflow: hidden;
  background: var(--bg-2); display: grid; place-items: center;
}
.np-cover {
  width: 100%; height: 100%; object-fit: cover; display: none;
  transition: transform 0.4s ease;
}
.now-art.has-cover .np-cover { display: block; }
.now-art.has-cover .np-art-ph { display: none; }
.np-art-ph { font-size: 38px; opacity: 0.6; }
.now-art.spinning .np-cover { animation: spin 18s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.now-meta { flex: 1 1 auto; min-width: 0; }
.np-name {
  font-size: 19px; font-weight: 700; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.np-artist {
  font-size: 13px; color: var(--muted); margin-top: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.np-progress { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.np-time { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 32px; }
.np-time:last-child { text-align: right; }

.p-seek {
  -webkit-appearance: none; appearance: none; flex: 1;
  height: 4px; border-radius: 999px; outline: none; cursor: pointer;
  background: var(--line);
}
.p-seek::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px rgba(232, 195, 158, 0.18);
}
.p-seek::-moz-range-thumb { width: 13px; height: 13px; border: none; border-radius: 50%; background: var(--accent); }

.np-controls { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.ctrl {
  border: none; background: transparent; color: var(--text);
  font-size: 20px; cursor: pointer; line-height: 1; padding: 4px;
  opacity: 0.85; transition: opacity 0.15s, transform 0.1s;
}
.ctrl:active { transform: scale(0.9); }
.ctrl:hover { opacity: 1; }
.ctrl-main {
  width: 50px; height: 50px; border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: var(--accent-ink); font-size: 20px; opacity: 1;
  display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(201, 162, 212, 0.35);
}

/* ===== 搜索 ===== */
.searchbar { display: flex; gap: 8px; }
#searchInput {
  flex: 1; padding: 12px 16px; font-size: 15px; color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  outline: none;
}
#searchInput::placeholder { color: var(--muted); }
#searchInput:focus { border-color: var(--accent-2); }
.search-btn {
  border: none; width: 46px; border-radius: 999px; cursor: pointer; font-size: 16px;
  background: var(--card-2); color: var(--text);
}
.search-btn:active { transform: scale(0.95); }

/* ===== 标签 ===== */
.tabs { display: flex; gap: 6px; }
.tab {
  flex: 1; padding: 9px 0; font-size: 14px; cursor: pointer;
  background: var(--card); color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  transition: color 0.15s, background 0.15s;
}
.tab.active { color: var(--accent-ink); background: var(--accent); font-weight: 600; border-color: transparent; }

/* ===== 面板 / 列表 ===== */
.panels {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); min-height: 220px; overflow: hidden;
}
.panel { display: none; }
.panel.active { display: block; }

.results, .queue { display: flex; flex-direction: column; }
.song-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  cursor: pointer; border-bottom: 1px solid var(--line);
  transition: background 0.12s;
}
.song-row:last-child { border-bottom: none; }
.song-row:hover { background: var(--card-2); }
.song-row.playing { background: rgba(232, 195, 158, 0.1); }
.song-row.playing .song-name { color: var(--accent); }
.song-cover {
  width: 44px; height: 44px; border-radius: 8px; object-fit: cover;
  background: var(--bg-2); flex: 0 0 auto;
}
.song-info { flex: 1; min-width: 0; }
.song-name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-artist { font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-act {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card-2);
  color: var(--text); font-size: 15px; cursor: pointer;
}
.song-act:active { transform: scale(0.9); }

/* ===== 空状态 ===== */
.empty {
  padding: 48px 20px; text-align: center; color: var(--muted); font-size: 14px;
}
.empty-note { font-size: 34px; margin-bottom: 10px; opacity: 0.7; }

/* ===== 歌词 ===== */
.lyric-box {
  padding: 24px 16px; max-height: 420px; overflow-y: auto;
  text-align: center; line-height: 2.1;
}
.lyric-line { font-size: 14px; color: var(--muted); transition: color 0.2s, transform 0.2s; }
.lyric-line.cur { color: var(--accent); font-size: 16px; font-weight: 600; transform: scale(1.04); }

/* ===== 幸村 · 给你点的歌 ===== */
.aside {
  background: linear-gradient(160deg, rgba(201, 162, 212, 0.1), var(--card));
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.aside-head {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  font-size: 14px; font-weight: 700;
}
.aside-title::before { content: "💜 "; }
.feed-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2);
  box-shadow: 0 0 0 0 rgba(201, 162, 212, 0.6); animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(201, 162, 212, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(201, 162, 212, 0); }
  100% { box-shadow: 0 0 0 0 rgba(201, 162, 212, 0); }
}
.feed { max-height: 560px; overflow-y: auto; padding: 8px; }
.feed-empty { padding: 40px 18px; }
.feed-empty-sub { font-size: 12px; margin-top: 8px; opacity: 0.7; line-height: 1.6; }

.feed-card {
  display: flex; gap: 10px; padding: 11px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line); margin-bottom: 8px;
  animation: rise 0.35s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.feed-card.unheard { border-color: rgba(201, 162, 212, 0.5); background: rgba(201, 162, 212, 0.09); }
.feed-cover { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: var(--bg-2); flex: 0 0 auto; }
.feed-body { flex: 1; min-width: 0; }
.feed-song { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-msg {
  font-size: 13px; color: var(--text); margin-top: 5px; line-height: 1.5;
  background: rgba(255, 255, 255, 0.05); padding: 7px 10px; border-radius: 10px;
  border-top-left-radius: 3px; word-break: break-word;
}
.feed-time { font-size: 11px; color: var(--muted); margin-top: 6px; }
.feed-play {
  flex: 0 0 auto; align-self: center; width: 34px; height: 34px; border-radius: 50%;
  border: none; cursor: pointer; font-size: 14px;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
}
.feed-play:active { transform: scale(0.9); }

/* ===== 幸村点歌横幅 ===== */
.pick-banner {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 50; width: calc(100% - 28px); max-width: 460px;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 14px;
  background: linear-gradient(150deg, #34284a, #2a2138);
  border: 1px solid rgba(201, 162, 212, 0.4);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}
.pick-text { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); }
.pick-text strong { color: var(--accent-2); }
.pick-song { font-size: 14px; color: var(--text); font-weight: 600; margin-top: 3px; }
.pick-msg { font-size: 13px; color: var(--accent); margin-top: 4px; word-break: break-word; }
.pick-play {
  flex: 0 0 auto; border: none; padding: 9px 16px; border-radius: 999px; cursor: pointer;
  background: linear-gradient(145deg, var(--accent), var(--accent-2)); color: var(--accent-ink);
  font-weight: 600; font-size: 14px;
}
.pick-close {
  flex: 0 0 auto; border: none; background: transparent; color: var(--muted);
  font-size: 22px; cursor: pointer; line-height: 1; padding: 0 4px;
}

/* 滚动条 */
.feed::-webkit-scrollbar, .lyric-box::-webkit-scrollbar { width: 6px; }
.feed::-webkit-scrollbar-thumb, .lyric-box::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
