/* ============ 在线音乐站 · 酷狗风前台样式 ============ */
:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --border: #e7e9ee;
  --text: #2b2f33;
  --muted: #86909a;
  --brand: #f5462d;
  --brand-2: #ff6a4d;
  --brand-soft: #fff1ee;
  --ok: #2faa4b;
  --shadow: 0 6px 24px rgba(20, 30, 50, .08);
  --player-h: 74px;
  --top-h: 60px;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #cfd3d9; border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--top-h);
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border); z-index: 50;
}
.tb-inner {
  max-width: 1180px; margin: 0 auto; height: 100%;
  display: flex; align-items: center; gap: 22px; padding: 0 20px;
}
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 18px; letter-spacing: .5px; }
.logo-ico {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-size: 18px;
}
.tb-nav { display: flex; gap: 6px; }
.tb-nav a {
  padding: 7px 14px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 13.5px;
  transition: .18s;
}
.tb-nav a:hover { color: var(--text); background: #f0f1f4; }
.tb-nav a.active { color: var(--brand); background: var(--brand-soft); }
.tb-search { flex: 1; max-width: 340px; }
.tb-search input {
  width: 100%; padding: 9px 14px; border: 1px solid var(--border); border-radius: 20px;
  background: #f6f7f9; font-size: 13.5px; outline: none; transition: .18s;
}
.tb-search input:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-soft); }
.tb-user { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.u-chip {
  display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px;
  background: #f0f1f4; border-radius: 20px; font-weight: 600; font-size: 13px; cursor: pointer;
}
.u-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 13px; }
.u-name { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 按钮 */
.btn { border: 1px solid var(--border); background: #fff; color: var(--text); border-radius: 9px; padding: 8px 16px; font-size: 13.5px; cursor: pointer; font-weight: 600; transition: .16s; }
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); color: #fff; }
.btn.danger:hover { border-color: #e05a3a; color: #d63a1f; background: #fff2ee; }
.btn.sm { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 主区 ---------- */
.main { padding: calc(var(--top-h) + 18px) 20px calc(var(--player-h) + 26px); }
.view { max-width: 1180px; margin: 0 auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 14px; }
.page-title { font-size: 19px; font-weight: 800; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 3px; font-weight: 400; }

/* 分类 tab */
.cats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.cat {
  padding: 7px 15px; border-radius: 20px; background: #fff; border: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; transition: .16s;
}
.cat:hover { color: var(--text); border-color: #cfd3d9; }
.cat.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.cat .cnt { opacity: .7; font-weight: 500; margin-left: 4px; font-size: 11.5px; }

/* 歌曲表 */
.slist { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.srow-head, .srow {
  display: grid; grid-template-columns: 46px 1fr 150px 84px 44px 64px;
  align-items: center; gap: 8px; padding: 11px 16px;
}
.srow-head { font-size: 12px; color: var(--muted); font-weight: 700; background: #f9fafc; border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: .4px; }
.srow { border-bottom: 1px solid #f2f3f6; transition: .14s; }
.srow:last-child { border-bottom: 0; }
.srow:hover { background: #fbfcfd; }
.srow.playing { background: var(--brand-soft); }
.srow.playing .s-title { color: var(--brand); font-weight: 700; }
.c-no { color: var(--muted); font-size: 12.5px; text-align: center; font-variant-numeric: tabular-nums; cursor: pointer; user-select: none; }
.c-no .no-idx { display: inline; }
.c-no .no-play { display: none; color: var(--brand); }
.srow:hover .c-no .no-idx { display: none; }
.srow:hover .c-no .no-play { display: inline; }
.s-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-tag { display: inline-block; font-size: 10.5px; color: var(--brand); background: var(--brand-soft); border-radius: 4px; padding: 1px 5px; margin-left: 7px; vertical-align: 1px; font-weight: 600; }
.c-artist { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-cat { font-size: 12px; color: var(--muted); background: #f1f2f5; border-radius: 5px; padding: 3px 8px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-dur { text-align: right; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.c-fav { text-align: center; font-size: 17px; cursor: pointer; color: #c4c9d0; user-select: none; transition: .15s; }
.c-fav:hover { transform: scale(1.15); }
.c-fav.on { color: var(--brand); }
.c-pl { text-align: center; }
.c-pl button { background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 7px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.c-pl button:hover { color: var(--brand); border-color: var(--brand); }

/* 空状态 */
.empty-box { text-align: center; padding: 70px 20px; color: var(--muted); background: var(--panel); border-radius: var(--radius); border: 1px solid var(--border); }
.empty-box h2 { color: var(--text); margin: 0 0 8px; font-size: 18px; }
.empty-box .err { font-size: 12px; color: #c0392b; max-width: 520px; margin: 8px auto 0; word-break: break-all; }
.spin { width: 26px; height: 26px; margin: 34px auto; border: 3px solid #eceef2; border-top-color: var(--brand); border-radius: 50%; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

/* ---------- 我的歌单 / 收藏视图 ---------- */
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.pl-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.pl-card .pc-name { font-weight: 800; font-size: 15px; }
.pl-card .pc-meta { color: var(--muted); font-size: 12px; }
.pl-card .pc-actions { display: flex; gap: 8px; margin-top: 4px; }
.new-pl-row { display: flex; gap: 10px; margin-bottom: 16px; }
.new-pl-row input { flex: 1; padding: 9px 14px; border: 1px solid var(--border); border-radius: 9px; outline: none; }
.new-pl-row input:focus { border-color: var(--brand); }

/* ---------- 底部播放条 ---------- */
.player {
  position: fixed; inset: auto 0 0 0; height: var(--player-h);
  background: #fff; border-top: 1px solid var(--border); box-shadow: 0 -4px 18px rgba(0,0,0,.06);
  z-index: 60; display: flex; align-items: center; padding: 0 18px; gap: 14px;
}
.pl-left { display: flex; align-items: center; gap: 11px; width: 240px; min-width: 180px; }
.pl-cover { width: 46px; height: 46px; border-radius: 9px; background: linear-gradient(135deg,#f0f1f4,#e2e4e9); display: grid; place-items: center; color: var(--muted); font-size: 20px; flex-shrink: 0; }
.pl-cover.spin { animation: spin 3.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pl-meta { overflow: hidden; }
.pl-title { font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-artist { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pl-center { flex: 1; display: flex; flex-direction: column; gap: 5px; align-items: center; }
.pl-controls { display: flex; align-items: center; gap: 14px; }
.pl-btn { background: none; border: none; color: var(--text); cursor: pointer; padding: 4px; display: grid; place-items: center; }
.pl-btn:hover { color: var(--brand); }
.pl-btn-main { width: 42px; height: 42px; border-radius: 50%; background: var(--brand); color: #fff; box-shadow: 0 3px 10px rgba(245,70,45,.4); }
.pl-btn-main:hover { background: var(--brand-2); color: #fff; }
.pl-progress { display: flex; align-items: center; gap: 9px; width: 100%; max-width: 560px; }
.pl-time { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; }
.pl-time:last-child { text-align: right; }
.pl-bar { position: relative; flex: 1; height: 5px; background: #eceef2; border-radius: 4px; cursor: pointer; }
.pl-bar:hover { height: 6px; }
.pl-fill { position: absolute; left: 0; top: 0; height: 100%; width: 0; background: var(--brand); border-radius: 4px; }
.pl-handle { position: absolute; top: 50%; left: 0; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--brand); transform: translate(-50%, -50%); box-shadow: 0 1px 4px rgba(0,0,0,.2); }

.pl-right { display: flex; align-items: center; gap: 14px; width: 230px; min-width: 150px; justify-content: flex-end; }
.pl-vol { display: flex; align-items: center; gap: 7px; }
.pl-vol-ico { cursor: pointer; font-size: 16px; user-select: none; }
.pl-vol input { width: 74px; accent-color: var(--brand); cursor: pointer; }
.pl-mode { display: flex; align-items: center; gap: 5px; background: none; border: 1px solid var(--border); border-radius: 18px; padding: 5px 11px; cursor: pointer; color: var(--muted); font-size: 12px; }
.pl-mode:hover { color: var(--brand); border-color: var(--brand); }
.pl-mode.active { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(15,20,28,.5); z-index: 100; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.modal-mask[hidden] { display: none; }
.modal { background: #fff; width: 360px; border-radius: 14px; padding: 22px 24px; box-shadow: 0 18px 50px rgba(0,0,0,.22); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; font-weight: 800; font-size: 16px; }
.modal-x { background: none; border: none; font-size: 22px; color: var(--muted); cursor: pointer; line-height: 1; }
.modal-x:hover { color: var(--text); }
.modal-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.mtab { flex: 1; padding: 8px; border: none; background: #f1f2f5; border-radius: 8px; font-weight: 700; font-size: 13.5px; cursor: pointer; color: var(--muted); }
.mtab.active { background: var(--brand-soft); color: var(--brand); }
.auth-form { display: flex; flex-direction: column; gap: 8px; }
.auth-form label { font-size: 12px; color: var(--muted); font-weight: 600; }
.auth-form input { padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; font-size: 14px; outline: none; }
.auth-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.form-err { color: #d63a1f; font-size: 12.5px; min-height: 16px; }
.btn-primary { background: var(--brand); color: #fff; border: none; padding: 11px; border-radius: 9px; font-weight: 700; font-size: 14.5px; cursor: pointer; margin-top: 4px; }
.btn-primary:hover { background: var(--brand-2); }

/* 加入歌单弹窗 */
.pl-modal-mask { position: fixed; inset: 0; background: rgba(15,20,28,.5); z-index: 110; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.pl-modal { background: #fff; width: 340px; border-radius: 14px; padding: 20px 22px; box-shadow: 0 18px 50px rgba(0,0,0,.22); }
.plm-new { display: flex; gap: 8px; margin-bottom: 14px; }
.plm-new input { flex: 1; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; outline: none; font-size: 13.5px; }
.plm-new input:focus { border-color: var(--brand); }
.plm-list { max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: 9px; padding: 4px 0; margin-bottom: 14px; }
.plm-item { display: flex; align-items: center; gap: 9px; padding: 9px 14px; cursor: pointer; font-size: 13.5px; }
.plm-item:hover { background: #f6f7f9; }
.plm-item input { width: 15px; height: 15px; accent-color: var(--brand); }
.plm-foot { display: flex; justify-content: flex-end; gap: 8px; }

/* toast */
#toast { position: fixed; bottom: calc(var(--player-h) + 22px); left: 50%; transform: translateX(-50%); background: rgba(20,26,34,.92); color: #fff; padding: 10px 20px; border-radius: 22px; font-size: 13px; z-index: 200; opacity: 0; pointer-events: none; transition: .25s; }
#toast.show { opacity: 1; bottom: calc(var(--player-h) + 34px); }

/* 窄屏 */
@media (max-width: 860px) {
  .pl-left { width: auto; min-width: 0; }
  .pl-right { display: none; }
  .tb-nav { display: none; }
  .srow-head, .srow { grid-template-columns: 34px 1fr 70px 36px 36px; }
  .c-artist, .c-cat { display: none; }
}
