/* ════════════════════════════════════════════════════════
   全局 & 布局
   字体：优先系统字体，iOS/macOS → San Francisco，
         Windows → 微软雅黑，Android → Roboto/思源
   ════════════════════════════════════════════════════════ */
* { box-sizing: border-box; margin: 0; padding: 0; }
a {
  text-decoration: none;
}

a:hover {
  text-decoration: underline; /* 悬停时显示下划线，提升可识别性 */
}
body {
  background: #f0f2f8;
  font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", "PingFang SC",
               "Hiragino Sans GB", Roboto, "Noto Sans CJK SC", sans-serif;
  color: #222;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 1rem;
}

/* SVG 图标通用 */
.icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  line-height: 1;
}
.icon svg {
  display: block;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ════════════════════════════════════════════════════════
   容器
   ════════════════════════════════════════════════════════ */
.container {
  width: 100%; max-width: 960px; background: #fff;
  border-radius: 16px; padding: 1.5rem 1.5rem 1rem;
  display: flex; flex-direction: column; gap: 1rem;
  border: 0.5px solid #e0e0e8;
  margin-bottom: 160px;
}

/* ════════════════════════════════════════════════════════
   搜索行
   ════════════════════════════════════════════════════════ */
.search-row { display: flex; gap: 8px; align-items: center; }

.search-wrap { flex: 1; position: relative; }
.search-wrap input {
  width: 100%; background: #f5f5fa; border: 0.5px solid #ddd;
  border-radius: 24px; padding: 9px 16px;
  color: #222; font-size: 16px; outline: none;
  font-family: inherit;
}
.search-wrap input::placeholder { color: #bbb; }
.search-wrap input:focus { border-color: #7c6fcd; background: #fff; }

.btn-search {
  background: #7c6fcd; border: none; border-radius: 24px;
  padding: 9px 20px; color: white; font-size: 14px;
  cursor: pointer; white-space: nowrap; font-family: inherit;
}
.btn-search:hover { background: #6a5ec0; }

/* ════════════════════════════════════════════════════════
   音源下拉
   ════════════════════════════════════════════════════════ */
.source-dropdown { position: relative; flex-shrink: 0; }

.source-btn {
  background: #f5f5fa; border: 0.5px solid #ddd; border-radius: 24px;
  padding: 9px 14px; color: #555; font-size: 13px;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  white-space: nowrap; font-family: inherit;
}
.source-btn:hover { background: #ebebf5; }

.source-btn .icon { font-size: 16px; }

.source-menu {
  position: absolute; right: 0; top: calc(100% + 6px); background: #fff;
  border: 0.5px solid #e0e0e8; border-radius: 10px; padding: 6px;
  min-width: 130px; z-index: 100; display: none; flex-direction: column;
  gap: 2px; box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.source-menu.open { display: flex; }

.source-opt {
  background: none; border: none; border-radius: 6px; padding: 8px 12px;
  color: #555; font-size: 13px; text-align: left; cursor: pointer; width: 100%;
  font-family: inherit;
}
.source-opt:hover { background: #f5f3fc; }
.source-opt.active { background: #ede9fb; color: #5a4db5; font-weight: 500; }

/* ════════════════════════════════════════════════════════
   歌曲列表区域
   ════════════════════════════════════════════════════════ */
.list-section { border: 0.5px solid #eee; border-radius: 12px; overflow: hidden; }

/* Tab 头 */
.tab-header {
  border-bottom: 0.5px solid #f0f0f0;
  display: flex; justify-content: center; align-items: flex-end;
  padding: 0 14px;
}
.tab-header.search-mode {
  justify-content: space-between; align-items: center;
  padding: 10px 14px 9px;
}

.tab-group { display: flex; width: 370px; max-width: 100%; }

.tab-btn {
  background: none; border: none; border-bottom: 2.5px solid transparent;
  flex: 1; width: 0;
  padding: 10px 0; font-size: 12px; font-weight: 500;
  color: #333; cursor: pointer; line-height: 1;
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color .15s, border-color .15s;
  font-family: inherit;
}
.tab-btn:hover { color: #7c6fcd; }
.tab-btn.active { color: #7c6fcd; border-bottom-color: #7c6fcd; font-weight: 600; }

.search-header-label { font-size: 11px; color: #aaa; letter-spacing: 0.06em; }
.list-count { font-size: 11px; color: #ccc; }

/* 歌曲网格 */
.song-grid {
  overflow-y: auto; max-height: auto; padding: 10px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.song-grid::-webkit-scrollbar { width: 3px; }
.song-grid::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

.song-item {
  background: #fafafa; border: 0.5px solid #eee; border-radius: 8px;
  padding: 7px 12px; color: #444; font-size: 12px;
  text-align: left; cursor: pointer; width: 100%; min-width: 0;
  font-family: inherit;
}
.song-item:hover { background: #f5f3fc; border-color: #c9c2f0; }
.song-item.playing { background: #ede9fb; border-color: #7c6fcd; }
.song-item .t {
  font-weight: 500; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; color: #333; margin-bottom: 3px;
}
.song-item.playing .t { color: #5a4db5; }
.song-item .a {
  font-size: 11px; color: #bbb; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

/* ════════════════════════════════════════════════════════
   分页
   ════════════════════════════════════════════════════════ */
.pagination {
  display: none; align-items: center; justify-content: center;
  gap: 6px; padding: 10px 14px 12px;
  border-top: 0.5px solid #f0f0f0; flex-wrap: wrap;
}
.pagination.visible { display: flex; }

.page-btn {
  background: #f5f5fa; border: 0.5px solid #e8e8f0; border-radius: 6px;
  min-width: 32px; height: 30px; padding: 0 8px;
  color: #666; font-size: 13px; cursor: pointer; font-family: inherit;
}
.page-btn:hover:not(:disabled) { background: #ede9fb; border-color: #c9c2f0; color: #5a4db5; }
.page-btn.active { background: #7c6fcd; border-color: #7c6fcd; color: #fff; }
.page-btn:disabled { opacity: 0.35; cursor: default; }

/* ════════════════════════════════════════════════════════
   状态提示条（播放器上方）
   ════════════════════════════════════════════════════════ */
.status-bar {
  display: none;
  font-size: 13px;
  color: #5a4db5;
  text-align: center;
  padding: 2px 0 6px;
  border-bottom: 0.5px solid #e8e4f8;
}
.status-bar.visible { display: block; }

/* ════════════════════════════════════════════════════════
   播放器
   ════════════════════════════════════════════════════════ */
.player-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 999;
  background: #fff; border-top: 0.5px solid #e0e0e8;
  padding: 0.75rem 1.5rem;
  display: flex; flex-direction: column; gap: 8px;
}

.player-info { text-align: center; }
.player-title {
  font-size: 17px; font-weight: 500; color: #222;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player-artist { font-size: 13px; color: #999; margin-top: 3px; }

/* 进度条 */
.progress-wrap { display: flex; align-items: center; gap: 10px; }
.progress-time { font-size: 11px; color: #bbb; min-width: 32px; }
.progress-time.right { text-align: right; }

.progress-bar {
  flex: 1; height: 6px; background: #e8e8f0; border-radius: 3px;
  cursor: pointer; position: relative; margin: 10px 0;
}
.progress-fill {
  height: 100%; width: 0%; background: #7c6fcd;
  border-radius: 3px 0 0 3px; pointer-events: none;
}
.progress-thumb {
  position: absolute; top: 50%; left: 0%;
  transform: translate(-50%, -50%);
  width: 22px; height: 22px;
  background: #fff;
  border: 2px solid #7c6fcd;
  border-radius: 50%;
  box-shadow: 0 1px 6px rgba(124, 111, 205, 0.45);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; user-select: none;
}
.progress-thumb .icon { font-size: 13px; color: #7c6fcd; }

/* 控制按钮 */
.controls-row {
  display: flex; align-items: center; justify-content: center;
  gap: 1.5rem; position: relative;
}

.ctrl-btn {
  background: none; border: none; color: #ccc; cursor: pointer;
  font-size: 26px; padding: 4px; line-height: 1;
  display: flex; align-items: center;
}
.ctrl-btn:hover { color: #7c6fcd; }

.play-btn {
  background: #7c6fcd; border: none; border-radius: 50%;
  width: 50px; height: 50px; display: flex; align-items: center;
  justify-content: center; cursor: pointer; color: white; font-size: 22px;
}
.play-btn:hover { background: #6a5ec0; }

/* 音量 */
.volume-row { position: absolute; right: 0; display: flex; align-items: center; gap: 6px; }
.volume-row .icon { font-size: 15px; color: #bbb; }
.volume-row input[type=range] { width: 70px; accent-color: #7c6fcd; }
.volume-row span { font-size: 12px; color: #bbb; min-width: 22px; }

/* ════════════════════════════════════════════════════════
   底部栏
   ════════════════════════════════════════════════════════ */
.bottom-bar {
  display: flex; align-items: center; justify-content: flex-end;
  flex-wrap: wrap; gap: 8px;
}

.btn-download {
  position: absolute; left: 0;
  background: none; border: none;
  padding: 4px 2px; color: #ccc; font-size: 13px; cursor: pointer;
  display: flex; align-items: center; gap: 5px; font-family: inherit;
  white-space: nowrap;
}
.btn-download:hover { color: #7c6fcd; }
.btn-download .icon { font-size: 18px; }

.status { font-size: 12px; color: #bbb; }

/* ════════════════════════════════════════════════════════
   友情链接
   ════════════════════════════════════════════════════════ */
.friend-links {
  border: 0.5px solid #eee;
  border-radius: 12px;
  padding: 0.75rem 1rem;
}
.friend-links-title {
  font-size: 12px;
  color: #bbb;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 0.5px solid #f0f0f0;
}
.friend-links-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.friend-links-list a {
  font-size: 12px;
  color: #7c6fcd;
  padding: 3px 10px;
  border-radius: 20px;
  text-decoration: none;
}
.friend-links-list a:hover {
  background: #f5f3fc;
  text-decoration: none;
}

/* ════════════════════════════════════════════════════════
   响应式
   ════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  body { padding: 2px 0.5rem; }
  .container { padding: 1rem; gap: 0.75rem; border-radius: 12px; margin-bottom: 140px; }
  .song-grid { grid-template-columns: repeat(2, 1fr); max-height: auto; min-width: 0; }
  .player-bar { padding: 0.6rem 1rem; gap: 6px; }
  .player-title { font-size: 15px; }
  .controls-row { gap: 1.25rem; }
  .ctrl-btn { font-size: 22px; }
  .play-btn { width: 44px; height: 44px; font-size: 20px; }
  .volume-row input[type=range] { width: 40px; }
  .volume-row .icon { font-size: 12px; }
  .btn-search { padding: 9px 14px; font-size: 13px; }
  .volume-row span { display: none; }
  .tab-group { width: 100%; max-width: 370px; }
  .btn-download .dl-label { display: none; }
  .btn-download .icon { font-size: 22px; }
}

/* ─── 歌词面板 ── 追加到 style.css 末尾 ─────────────────────── */

.lyric-panel {
  background: rgba(20, 18, 30, 0.97);
  border-top: 1px solid rgba(124, 111, 205, 0.18);
  border-bottom: 1px solid rgba(124, 111, 205, 0.12);
  transition: max-height 0.35s ease, padding 0.35s ease;
  overflow: hidden;
  max-height: 240px;
}

.lyric-panel.collapsed {
  max-height: 36px;
}

/* 顶部标题栏 */
.lyric-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 36px;
  cursor: default;
  user-select: none;
}

.lyric-header-icon {
  display: flex;
  align-items: center;
  color: #7c6fcd;
  font-size: 14px;
  flex-shrink: 0;
}

.lyric-header-icon svg {
  width: 14px;
  height: 14px;
  stroke: #7c6fcd;
}

.lyric-title-text {
  flex: 1;
  font-size: 12px;
  color: #888;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.lyric-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  padding: 2px 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
  flex-shrink: 0;
}

.lyric-toggle:hover { color: #7c6fcd; }

.lyric-toggle svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 歌词内容区 */
.lyric-body {
  height: 198px;         /* 240 - 36（header） - 6（padding） */
  position: relative;
}

.lyric-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #555;
  pointer-events: none;
}

.lyric-scroll {
  height: 100%;
  overflow-y: auto;
  padding: 12px 0 20px;
  scrollbar-width: none;        /* Firefox */
  -ms-overflow-style: none;     /* IE */
  scroll-behavior: smooth;
}

.lyric-scroll::-webkit-scrollbar { display: none; }

/* 每行歌词 */
.lyric-line {
  text-align: center;
  font-size: 13px;
  color: #555;
  line-height: 1.9;
  padding: 2px 24px;
  transition: color 0.3s, font-size 0.3s, font-weight 0.3s;
  border-left: 3px solid transparent;
  cursor: default;
}

/* 当前播放行 */
.lyric-line.active {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border-left-color: #7c6fcd;
  padding-left: 21px;   /* 24 - 3（border占位） */
}
