/* 文人书斋暗色主题 — 无彩色强调，以字重与明度建立层级 */

:root {
  --bg: #1c1f26;
  --surface: #2a2f3a;
  --surface-emphasis: #303640;
  --border: #3b414c;
  --border-emphasis: #555d6b;
  --text: #d0d0d0;
  --text-secondary: #aaa;
  --muted: #888;

  --font-ui: "Noto Sans SC", "Source Han Sans SC", "PingFang SC",
             "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-text: "Noto Serif SC", "Source Han Serif SC", "STSong",
               Georgia, "Times New Roman", serif;

  --radius-sm: 4px;
  --radius-md: 6px;
  --transition-fast: 0.1s ease-in-out;
  --transition-base: 0.3s ease-in-out;
}

* { box-sizing: border-box; }

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  margin: 0;
  padding: 10px 14px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;
}

/* ---- 歌单选择器 ---- */

.playlist-header {
  flex-shrink: 0;
  margin-bottom: 8px;
}

.playlist-dropdown {
  position: relative;
}

.playlist-dropdown summary::-webkit-details-marker { display: none; }
.playlist-dropdown summary::marker { display: none; }

.playlist-dropdown-btn {
  width: 100%;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-ui);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  transition: background var(--transition-fast);
}

.playlist-dropdown-btn:hover,
.playlist-dropdown[open] .playlist-dropdown-btn {
  background: var(--surface-emphasis);
}

.dropdown-arrow {
  font-size: 11px;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}

.playlist-dropdown[open] .dropdown-arrow {
  transform: rotate(180deg);
}

.playlist-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 100;
  margin-top: 2px;
  max-height: 240px;
  overflow-y: auto;
}

.playlist-checkboxes {
  display: flex;
  flex-direction: column;
  padding: 4px;
}

.playlist-checkbox {
  display: flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
  user-select: none;
  border-left: 2px solid transparent;
}

.playlist-checkbox:hover {
  background: var(--surface-emphasis);
}

.playlist-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.playlist-checkbox.selected {
  font-weight: 700;
  border-left-color: var(--text);
}

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

.song-list-area {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

#song-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

#song-list li {
  padding: 8px 10px;
  border-left: 2px solid transparent;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast),
              border-color var(--transition-base);
}

#song-list li:hover {
  background: var(--surface-emphasis);
  color: var(--text);
}

#song-list li.playing {
  border-left-color: var(--border-emphasis);
  color: var(--text);
  font-weight: 700;
}

#song-list li.empty-msg {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  border: none;
  cursor: default;
}

#song-list li.empty-msg:hover {
  background: transparent;
  color: var(--muted);
}

/* ---- 分页器 ---- */

#pagination {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 6px 0;
  flex-wrap: wrap;
}

#pagination button {
  padding: 3px 8px;
  min-width: 28px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 12px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

#pagination button:hover {
  background: var(--surface-emphasis);
  color: var(--text);
}

#pagination button.active {
  font-weight: 700;
  color: var(--text);
}

/* ---- 播放控制 ---- */

.controls {
  flex-shrink: 0;
  padding: 8px 0;
}

.now-playing {
  text-align: center;
  margin-bottom: 4px;
}

#now-playing-title {
  font-family: var(--font-text);
  font-size: 13px;
  font-weight: 700;
}

#now-playing-title:empty::before {
  content: "未在播放";
  color: var(--muted);
  font-family: var(--font-ui);
  font-weight: 400;
}

#audio-player {
  width: 100%;
  height: 32px;
  accent-color: var(--text-secondary);
}

.playback-options {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
}

.playback-options button {
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 12px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.playback-options button:hover {
  background: var(--surface-emphasis);
  color: var(--text);
}

.playback-options button.active {
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
}

/* ---- 歌词 ---- */

.lyrics-header {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  padding: 2px 0;
}

.toggle-translation {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
}

.toggle-translation input { cursor: pointer; }

.lyrics-area {
  flex-shrink: 0;
  height: 120px;
  overflow: hidden;
}

.lyrics-display {
  text-align: center;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.lyrics-line {
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.lyric-prev, .lyric-next {
  color: var(--muted);
  font-size: 0.9em;
}

.lyric-current {
  font-family: var(--font-text);
  font-size: 1.15em;
  font-weight: 700;
}

.lyrics-empty {
  color: var(--muted);
  font-size: 0.95em;
}

.lyrics-translation {
  color: var(--muted);
  font-style: italic;
  font-size: 0.85em;
  margin-top: 1px;
}
