:root {
  --bg: #141519;
  --bg2: #191b21;
  --panel: #1f2128;
  --panel2: #26282f;
  --text: #eef1f5;
  --dim: #9aa3b2;
  --faint: #6b7484;
  --accent: #4d9fff;
  --border: rgba(255, 255, 255, 0.07);
  --sidebar-w: 200px;
  --player-h: 82px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--text); font-family: -apple-system, "Segoe UI", "Microsoft YaHei", Roboto, sans-serif; overflow: hidden; }
#app { display: flex; height: 100%; }
.hidden { display: none !important; }

/* 侧边栏 */
.sidebar { width: var(--sidebar-w); flex-shrink: 0; background: var(--bg2); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 18px 12px; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 20px; font-weight: 800; letter-spacing: 1px; padding: 4px 10px 20px; }
.logo { width: 30px; height: 30px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #4d9fff, #3b82f6); box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px; border: none; background: transparent; color: var(--dim); font-size: 15px; font-weight: 600; border-radius: 10px; cursor: pointer; text-align: left; }
.nav-item i { font-style: normal; font-size: 16px; width: 18px; text-align: center; }
.nav-item:hover { background: var(--panel); color: #fff; }
.nav-item.active { background: rgba(77, 159, 255, 0.14); color: #fff; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 4px; }
.side-btn { height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--panel); color: var(--dim); cursor: pointer; }
.side-tip { color: var(--faint); font-size: 11px; text-align: center; }

/* 主区 */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding-bottom: var(--player-h); }
.topbar { padding: 18px 28px 6px; }
.search { display: flex; align-items: center; gap: 10px; max-width: 620px; height: 44px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 0 14px; }
.search svg { width: 18px; height: 18px; color: var(--faint); flex-shrink: 0; }
.search input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; color: var(--text); font-size: 15px; }
.search input::placeholder { color: var(--faint); }
.primary { border: none; background: linear-gradient(135deg, #4d9fff, #3b82f6); color: #fff; height: 32px; padding: 0 18px; border-radius: 9px; font-size: 14px; font-weight: 600; cursor: pointer; }
.content { flex: 1; overflow-y: auto; padding: 8px 28px 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 0 14px; }
.chips button { border: 1px solid var(--border); background: var(--panel); color: var(--dim); height: 30px; padding: 0 14px; border-radius: 15px; font-size: 13px; cursor: pointer; }
.chips button:hover { color: #fff; border-color: rgba(77, 159, 255, 0.6); }
.status { color: var(--faint); font-size: 13px; padding: 8px 2px; }
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; cursor: pointer; }
.row:hover { background: var(--panel); }
.row.cur { background: rgba(77, 159, 255, 0.12); }
.row-no { width: 26px; text-align: center; color: var(--faint); font-size: 12px; }
.row-cover { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: var(--panel2); flex-shrink: 0; }
.row-main { flex: 1; min-width: 0; }
.row-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 12.5px; color: var(--dim); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-album { color: var(--faint); font-size: 12.5px; max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-dur { color: var(--faint); font-size: 12.5px; }
.more { display: flex; justify-content: center; padding: 16px 0; }
.more button { height: 38px; padding: 0 26px; border-radius: 19px; border: 1px solid var(--border); background: var(--panel); color: var(--dim); cursor: pointer; }

/* 播放条 */
.player { position: fixed; left: var(--sidebar-w); right: 0; bottom: 0; height: var(--player-h); display: flex; align-items: center; gap: 18px; padding: 0 22px; background: var(--bg2); border-top: 1px solid var(--border); z-index: 20; }
.p-left { display: flex; align-items: center; gap: 12px; width: 260px; min-width: 0; }
.p-cover { width: 50px; height: 50px; border-radius: 9px; object-fit: cover; background: var(--panel2); }
.p-info { min-width: 0; }
.p-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-artist { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-center { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.p-btns { display: flex; align-items: center; gap: 18px; }
.p-btns button { border: none; background: transparent; color: var(--text); font-size: 20px; cursor: pointer; }
.p-play { width: 42px; height: 42px; border-radius: 50% !important; background: linear-gradient(135deg, #4d9fff, #3b82f6) !important; color: #fff !important; font-size: 15px !important; box-shadow: 0 8px 20px rgba(59, 130, 246, 0.45); }
.p-bar { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 620px; }
.p-bar span { color: var(--faint); font-size: 11px; width: 40px; text-align: center; }
.bar { position: relative; flex: 1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.14); cursor: pointer; }
#barCur { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: linear-gradient(90deg, #4d9fff, #3b82f6); }
#barDot { position: absolute; top: 50%; left: 0; width: 12px; height: 12px; border-radius: 50%; background: #fff; transform: translate(-50%, -50%); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); }
.p-right { display: flex; align-items: center; gap: 12px; width: 260px; justify-content: flex-end; }
.p-ic { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border); background: var(--panel); color: var(--dim); cursor: pointer; }
.p-ic.wide { width: auto; padding: 0 10px; font-size: 12px; }
#vol { width: 90px; }

/* 我的 */
.overlay { position: fixed; inset: 0 0 var(--player-h) var(--sidebar-w); background: var(--bg); z-index: 15; padding: 24px 32px; overflow-y: auto; }
.ov-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.ov-head h2 { font-size: 22px; }
.mine-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 240px)); gap: 14px; }
.mine-card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.mc-label { color: var(--dim); font-size: 13px; }
.mc-num { font-size: 30px; font-weight: 800; margin-top: 8px; }
.mine-actions { margin-top: 18px; display: flex; gap: 10px; }
.ghost { height: 38px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel); color: var(--text); cursor: pointer; }
.ghost.danger { color: #e06a6a; }

/* 歌词 */
.lyric-panel { position: fixed; top: 0; right: 0; bottom: var(--player-h); width: 420px; max-width: 40vw; background: var(--bg2); border-left: 1px solid var(--border); transform: translateX(100%); transition: transform .25s ease; z-index: 25; display: flex; flex-direction: column; }
.lyric-panel.open { transform: none; }
.lyric-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; font-weight: 700; border-bottom: 1px solid var(--border); }
.lyric-head button { border: none; background: transparent; color: var(--dim); font-size: 16px; cursor: pointer; }
.lyric { flex: 1; overflow-y: auto; padding: 30% 24px; }
.lyric .l { color: var(--faint); font-size: 15px; line-height: 1.5; padding: 8px 0; text-align: center; transition: color .2s, font-size .2s; }
.lyric .l.on { color: #fff; font-size: 17px; font-weight: 700; }

/* 弹层 */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal-box { width: 420px; max-width: 90vw; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 20px; }
.modal-box h3 { font-size: 16px; margin-bottom: 12px; }
.modal-box input { width: 100%; height: 42px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); padding: 0 12px; outline: none; }
.modal-tip { color: var(--faint); font-size: 12px; margin-top: 8px; }
.modal-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.modal-btns .ghost { height: 36px; }
.modal-btns .primary { height: 36px; }

/* ===== 手机端（body.mobile，由设备指纹判定后加类） ===== */
.m-top { display: none; }
.l-cover { display: none; }

body.mobile { --player-h: 64px; }
body.mobile .sidebar { display: none; }
body.mobile .m-top { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 12px; }
body.mobile .m-brand { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 800; letter-spacing: .5px; }
body.mobile .m-mine { height: 32px; padding: 0 14px; border-radius: 16px; }
body.mobile .main { padding-bottom: var(--player-h); }
body.mobile .topbar { padding: 12px 12px 4px; }
body.mobile .search { max-width: none; height: 42px; }
body.mobile .primary { height: 30px; padding: 0 14px; }
body.mobile .content { padding: 6px 12px 18px; }
body.mobile .chips { gap: 6px; padding: 4px 0 10px; }
body.mobile .row { padding: 10px 8px; gap: 8px; }
body.mobile .row-no { width: 22px; }
body.mobile .row-album { display: none; }
body.mobile .row-cover { display: none; }

body.mobile .player { left: 0; right: 0; height: var(--player-h); padding: 0 12px; gap: 8px; border-radius: 14px 14px 0 0; }
body.mobile .p-cover { width: 46px; height: 46px; }
body.mobile .p-left { width: auto; flex: 1; cursor: pointer; }
body.mobile .p-center { flex: 0 0 auto; }
body.mobile .p-bar { display: none; }
body.mobile .p-right { display: none; }
body.mobile .p-btns { gap: 16px; }
body.mobile #prev { display: none; }
body.mobile .p-play { width: 40px; height: 40px; }

body.mobile .overlay { inset: 0; padding: 18px 16px; }
body.mobile .mine-grid { grid-template-columns: 1fr 1fr; }

body.mobile .lyric-panel { width: 100vw; max-width: none; bottom: 0; border-left: none; }
body.mobile .lyric-head { padding: 18px 18px 8px; border-bottom: none; }
body.mobile .l-cover { display: block; width: 62%; max-width: 260px; margin: 8px auto 4px; border-radius: 18px; box-shadow: 0 18px 40px rgba(0, 0, 0, .5); }
body.mobile .lyric { padding: 20px 22px 45%; }
