/* 星音sumi 歌切电台 v2 —— 网易云风格（浅色默认 + 深色切换） */
:root {
  --red: #ec4141;
  --red-soft: rgba(236, 65, 65, 0.1);
  --bg: #f5f5f7;
  --panel: #ffffff;
  --panel-2: #fafafa;
  --text: #1f1f1f;
  --muted: #8a8a8a;
  --dim: #b3b3b3;
  --line: #ededed;
  --hover: #f2f2f5;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --player-h: 78px;
  --sidebar-w: 226px;
  --radius: 10px;
}
[data-theme="dark"] {
  --bg: #121212;
  --panel: #1b1b1b;
  --panel-2: #202020;
  --text: #e9e9e9;
  --muted: #9a9a9a;
  --dim: #6f6f6f;
  --line: #2b2b2b;
  --hover: #262629;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC",
    "Hiragino Sans GB", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: inherit; }
img { display: block; }

/* ---------- 布局 ---------- */
.app {
  display: flex;
  height: calc(100vh - var(--player-h));
  min-height: 0;
}
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  z-index: 40;
}
.main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 0 26px 30px;
  scroll-behavior: smooth;
}

/* ---------- 侧边栏 ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 14px;
  text-decoration: none;
}
.logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 19px;
  flex: 0 0 auto;
}
.brand-text b { display: block; font-size: 15px; letter-spacing: 0.2px; }
.brand-text small { display: block; color: var(--muted); font-size: 11px; }
.nav { flex: 1; overflow-y: auto; padding: 4px 10px 10px; }
.nav-group { margin-bottom: 18px; }
.nav-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11.5px;
  padding: 6px 10px;
  letter-spacing: 0.4px;
}
.mini {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  font-size: 13px;
}
.mini:hover { color: var(--red); border-color: var(--red); }
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 13.5px;
  margin-bottom: 2px;
  cursor: pointer;
}
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: var(--red-soft); color: var(--red); font-weight: 600; }
.nav-ico { width: 18px; text-align: center; color: var(--muted); font-size: 13px; }
.nav-item.active .nav-ico { color: var(--red); }
.pill {
  margin-left: auto;
  background: var(--bg);
  color: var(--muted);
  border-radius: 9px;
  font-size: 10.5px;
  padding: 0 7px;
  font-weight: 400;
}
.playlist-nav .pl {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.playlist-nav .pl:hover { background: var(--hover); color: var(--text); }
.playlist-nav .pl.active { color: var(--red); background: var(--red-soft); }
.playlist-nav .pl .ico { font-size: 12px; }
.nav-announce p { color: var(--muted); font-size: 12px; padding: 0 12px; margin: 0; line-height: 1.6; }
.side-foot {
  border-top: 1px solid var(--line);
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  color: var(--dim);
  font-size: 11.5px;
}
.side-foot a { color: var(--muted); text-decoration: none; }
.side-foot a:hover { color: var(--red); }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
}
.search {
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.search:focus-within { border-color: var(--red); }
.search .ico { color: var(--dim); font-size: 16px; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; }
.search input::placeholder { color: var(--dim); }
.search input::-webkit-search-cancel-button { display: none; }
.q-clear {
  border: 0;
  background: var(--line);
  color: var(--muted);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  font-size: 12px;
}
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.hint { color: var(--muted); font-size: 12px; }
.icon-btn {
  border: 0;
  background: none;
  color: var(--muted);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  font-size: 15px;
  position: relative;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.txt { width: auto; padding: 0 10px; border-radius: 16px; font-size: 12.5px; }
.icon-btn.sm { width: auto; padding: 0 8px; font-size: 12px; }
.icon-btn b { font-weight: 500; margin-left: 3px; color: var(--dim); font-size: 11px; }
.only-mobile { display: none; }

/* ---------- 页面通用 ---------- */
.view { padding-bottom: 20px; }
.page-head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin: 10px 0 16px;
  flex-wrap: wrap;
}
.page-head h2 { margin: 0; font-size: 22px; letter-spacing: 0.3px; }
.page-head .sub { color: var(--muted); font-size: 12.5px; margin-bottom: 4px; }
.page-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 18px;
  padding: 7px 16px;
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover { border-color: var(--red); color: var(--red); }
.btn.primary {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.btn.primary:hover { filter: brightness(1.05); color: #fff; }
.btn.subtle { background: transparent; }
.announce {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--red-soft);
  color: var(--red);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 12.5px;
  margin-bottom: 14px;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 60px 0;
}
.empty .big { font-size: 40px; color: var(--dim); margin-bottom: 8px; }

/* ---------- 歌单头部 ---------- */
.pl-head {
  display: flex;
  gap: 22px;
  align-items: flex-end;
  margin: 12px 0 20px;
  flex-wrap: wrap;
}
.pl-cover {
  width: 152px;
  height: 152px;
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--dim);
  font-size: 42px;
}
.pl-cover img { width: 100%; height: 100%; object-fit: cover; }
.pl-info { flex: 1; min-width: 220px; }
.pl-info h2 { margin: 0 0 4px; font-size: 22px; }
.pl-info .desc { color: var(--muted); font-size: 12.5px; margin: 4px 0 10px; }
.pl-info .meta { color: var(--dim); font-size: 12px; }
.pl-info .acts { margin-top: 12px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 歌曲表 ---------- */
.song-table { background: var(--panel); border-radius: var(--radius); overflow: hidden; }
.song-head, .song-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 120px 66px 70px 56px;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
}
.song-head {
  height: 36px;
  color: var(--muted);
  font-size: 11.5px;
  border-bottom: 1px solid var(--line);
}
.song-row {
  height: 58px;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
}
.song-row:hover, .song-row.hover { background: var(--hover); }
.song-row.playing { background: var(--red-soft); }
.song-row.playing .song-name { color: var(--red); }
.song-num { color: var(--dim); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.song-row.playing .song-num { color: var(--red); }
.song-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.song-thumb {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--hover);
  flex: 0 0 auto;
}
.song-text { min-width: 0; }
.song-name {
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.song-artist {
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.song-date, .song-dur { color: var(--muted); font-size: 12px; }
.song-dur { font-variant-numeric: tabular-nums; }
.song-like button, .song-comments button {
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 6px;
}
.song-like button:hover, .song-comments button:hover { color: var(--red); background: var(--hover); }
.song-like button.on { color: var(--red); }
.song-more {
  border: 0;
  background: none;
  color: var(--dim);
  cursor: pointer;
  font-size: 17px;
  padding: 2px 6px;
  border-radius: 6px;
  opacity: 0;
}
.song-row:hover .song-more, .song-row.playing .song-more { opacity: 1; }
.song-more:hover { color: var(--text); background: var(--hover); }
.group-block { margin-bottom: 22px; }
.group-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 650;
}
.group-title small { color: var(--dim); font-size: 11.5px; font-weight: 400; }

/* ---------- 播放器 ---------- */
.player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--player-h);
  z-index: 60;
  display: grid;
  grid-template-columns: 56px minmax(120px, 210px) 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.05);
}
.p-cover {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--hover);
  border: 2px solid var(--line);
}
.p-cover img { width: 100%; height: 100%; object-fit: cover; }
.p-cover.spin img { animation: spin 18s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.p-info { min-width: 0; }
.p-title {
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.p-sub {
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.like-btn {
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 19px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
}
.like-btn:hover { color: var(--red); background: var(--hover); }
.like-btn.on { color: var(--red); }
.p-center { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.p-btns { display: flex; align-items: center; justify-content: center; gap: 6px; }
.play-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: var(--red);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  display: grid;
  place-items: center;
  padding-left: 2px;
}
.play-btn:hover { filter: brightness(1.06); }
.p-progress {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.p-progress span { min-width: 34px; }
.p-progress span:last-child { text-align: right; }
.seek {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--line);
  outline: none;
  cursor: pointer;
}
.seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--red);
}
.seek::-moz-range-thumb { width: 11px; height: 11px; border: 0; border-radius: 50%; background: var(--red); }
.p-right { display: flex; align-items: center; gap: 4px; }
.vol { width: 74px; -webkit-appearance: none; appearance: none; height: 3px; border-radius: 2px; background: var(--line); }
.vol::-webkit-slider-thumb { -webkit-appearance: none; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }

/* ---------- 抽屉 ---------- */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: var(--player-h);
  width: 384px;
  max-width: 96vw;
  background: var(--panel);
  border-left: 1px solid var(--line);
  z-index: 70;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transform: translateX(100%);
  transition: transform 0.2s ease;
}
.drawer.open { transform: none; }
.drawer-head {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.drawer-tabs { display: flex; gap: 4px; flex: 1; }
.drawer-tabs button {
  border: 0;
  background: none;
  color: var(--muted);
  padding: 7px 12px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 13px;
}
.drawer-tabs button.active { background: var(--red-soft); color: var(--red); font-weight: 600; }
.drawer-close { border: 0; background: none; color: var(--muted); font-size: 20px; cursor: pointer; }
.drawer-body { flex: 1; overflow-y: auto; padding: 14px 16px; }

/* 歌词 */
.lyrics { padding: 30% 0 40%; text-align: center; }
.lyric-line {
  color: var(--muted);
  font-size: 14px;
  padding: 8px 0;
  transition: color 0.2s, transform 0.2s;
  cursor: pointer;
}
.lyric-line .tr { display: block; font-size: 12px; color: var(--dim); }
.lyric-line.active { color: var(--red); transform: scale(1.04); font-weight: 600; }
.lyric-line.active .tr { color: var(--red); opacity: 0.8; }

/* 评论 */
.comment-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.comment-form input, .comment-form textarea {
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 8px;
  padding: 9px 11px;
  outline: none;
  resize: vertical;
}
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--red); }
.comment-form .row { display: flex; gap: 8px; align-items: center; }
.comment-form .row input { flex: 1; }
.comment-form button { align-self: flex-end; }
.comment {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.comment-body { min-width: 0; flex: 1; }
.comment-nick { font-size: 12.5px; color: var(--muted); }
.comment-nick b { color: var(--text); font-weight: 600; }
.comment-text { font-size: 13.5px; margin-top: 2px; word-break: break-word; white-space: pre-wrap; }
.comment-time { color: var(--dim); font-size: 11px; margin-top: 3px; }
.pinned-tag {
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: 4px;
  font-size: 10px;
  padding: 0 4px;
  margin-right: 6px;
}
.more-comments { text-align: center; padding: 12px; }

/* 队列 */
.queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 8px;
  cursor: pointer;
}
.queue-item:hover { background: var(--hover); }
.queue-item.playing { color: var(--red); }
.queue-item img { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; }
.queue-item .t { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-item .d { color: var(--dim); font-size: 11px; }

/* ---------- 遮罩 / 弹窗 / toast ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 65;
}
.modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.45);
}
.modal {
  width: 380px;
  max-width: 92vw;
  background: var(--panel);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.modal h3 { margin: 0 0 12px; font-size: 16px; }
.modal .field { margin-bottom: 10px; }
.modal label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.modal input, .modal textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 8px;
  padding: 9px 11px;
  outline: none;
}
.modal input:focus, .modal textarea:focus { border-color: var(--red); }
.modal .acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.pick-list { max-height: 260px; overflow-y: auto; margin: -4px 0 4px; }
.pick-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: 8px;
  cursor: pointer;
}
.pick-item:hover { background: var(--hover); }
.pick-item .n { flex: 1; font-size: 13.5px; }
.pick-item .s { color: var(--dim); font-size: 11px; }
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--player-h) + 16px);
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 95;
  max-width: 90vw;
}

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  :root { --player-h: 70px; --sidebar-w: 210px; }
  .main { padding: 0 14px 24px; }
  .song-head, .song-row { grid-template-columns: 38px minmax(0, 1fr) 62px 40px; }
  .song-head .c-date, .song-row .song-date { display: none; }
  .song-head .c-like, .song-row .song-like { display: none; }
  .song-head .c-comments, .song-row .song-comments { display: none; }
  .player { grid-template-columns: 44px minmax(0, 1fr) auto; padding: 0 12px; gap: 8px; }
  .p-cover { width: 42px; height: 42px; }
  .p-like, .p-right .vol, #btnVolume { display: none; }
  .p-center { grid-column: 1 / -1; }
  .p-btns { justify-content: flex-start; }
  .p-progress { display: none; }
  .p-right { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    width: 250px;
  }
  .sidebar.open { transform: none; }
  .only-mobile { display: inline-grid; }
  .drawer { width: 100%; max-width: 100%; }
}
