* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #f0f2f5;
  color: #222;
  min-height: 100vh;
}
header {
  background: linear-gradient(135deg, #c62f2f, #e05656);
  color: #fff;
  padding: 28px 20px;
  text-align: center;
}
header h1 { font-size: 28px; }
header .sub { margin-top: 8px; opacity: .9; font-size: 14px; }
main { max-width: 860px; margin: 24px auto; padding: 0 16px; }

.search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.search-box input {
  flex: 1;
  padding: 12px 16px;
  font-size: 16px;
  border: 2px solid #d9dde3;
  border-radius: 8px;
  outline: none;
}
.search-box input:focus { border-color: #c62f2f; }
button {
  padding: 12px 24px;
  font-size: 15px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: #c62f2f;
  color: #fff;
  transition: background .15s;
}
button:hover { background: #a82525; }
button:disabled { opacity: .5; cursor: not-allowed; }

section {
  background: #fff;
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
section h2 {
  font-size: 18px;
  margin-bottom: 14px;
  color: #333;
  border-bottom: 2px solid #f0f2f5;
  padding-bottom: 8px;
}
.hidden { display: none; }

.song-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 6px;
  border-bottom: 1px solid #f0f2f5;
}
.song-item:last-child { border-bottom: none; }
.song-info { flex: 1; min-width: 0; }
.song-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.song-meta { font-size: 12px; color: #888; margin-top: 2px; }
.song-actions { display: flex; gap: 8px; flex-shrink: 0; }
.song-actions button {
  padding: 7px 14px;
  font-size: 13px;
  background: #f5f6f8;
  color: #333;
  border: 1px solid #ddd;
}
.song-actions button:hover { background: #eef0f3; }
.song-actions .btn-download { background: #c62f2f; color: #fff; border-color: #c62f2f; }
.song-actions .btn-download:hover { background: #a82525; }

#player { width: 100%; margin-bottom: 8px; }
.hint { font-size: 12px; color: #888; }
#lyric-box {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.7;
  max-height: 360px;
  overflow-y: auto;
  color: #444;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid #f0f2f5;
  font-size: 14px;
}
.task-item:last-child { border-bottom: none; }
.task-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-bar { flex: 1; max-width: 280px; height: 8px; background: #eee; border-radius: 4px; overflow: hidden; }
.task-bar .fill { height: 100%; background: #c62f2f; width: 0; transition: width .3s; }
.task-status { width: 90px; text-align: right; font-size: 12px; color: #666; }
.task-status.done { color: #2a8c4a; }
.task-status.error { color: #c62f2f; }

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid #f0f2f5;
}
.file-item:last-child { border-bottom: none; }
.file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-size: 12px; color: #888; }

footer {
  text-align: center;
  color: #aaa;
  font-size: 12px;
  padding: 20px;
}
@media (max-width: 600px) {
  .song-item { flex-wrap: wrap; }
  .song-actions { width: 100%; justify-content: flex-end; }
}

/* ===== 双栏布局 ===== */
main { max-width: 1200px; }
.layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.left-col {
  flex: 1;
  min-width: 0;
}
.right-col {
  width: 380px;
  flex-shrink: 0;
}

/* ===== 播放列表 ===== */
.count-badge {
  display: inline-block;
  background: #c62f2f;
  color: #fff;
  font-size: 12px;
  border-radius: 10px;
  padding: 1px 8px;
  margin-left: 4px;
}
#playlist-list {
  margin-top: 8px;
}
.playlist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 6px;
  border-bottom: 1px solid #f0f2f5;
  font-size: 14px;
}
.playlist-item:last-child { border-bottom: none; }
.playlist-item.playing {
  background: #fff5f5;
  border-radius: 6px;
}
.playlist-item .pl-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.playlist-item .pl-name:hover { color: #c62f2f; }
.playlist-item .pl-meta {
  font-size: 11px;
  color: #999;
  flex-shrink: 0;
}
.playlist-item .pl-remove {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: #ccc;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  border-radius: 4px;
  flex-shrink: 0;
}
.playlist-item .pl-remove:hover { background: #fee; color: #c62f2f; }
.btn-add {
  padding: 7px 10px;
  font-size: 13px;
  background: #f5f6f8;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 6px;
}
.btn-add:hover { background: #eef0f3; }
.btn-add.added { background: #2a8c4a; color: #fff; border-color: #2a8c4a; }

@media (max-width: 768px) {
  .layout { flex-direction: column; }
  .right-col { width: 100%; }
}