* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
/* 全局隐藏类：所有带 hidden 的元素（MV徽标/视频块/缓冲层等）依赖此规则 */
.hidden { display: none !important; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #121212;
  color: #eee;
  max-width: 640px;
  margin: 0 auto;
  padding-bottom: 132px;
}
.view { display: none; }
.view.active { display: block; }

/* 顶栏 */
.topbar { padding: 16px 14px 10px; }
.logo { font-size: 20px; font-weight: 800; letter-spacing: 1px; margin-bottom: 12px; }
.logo span { color: #ff5a3c; }
.searchbox input {
  width: 100%; padding: 10px 14px; border: none; border-radius: 20px;
  background: #262626; color: #eee; font-size: 14px; outline: none;
}
.searchbox input::placeholder { color: #888; }

.cats-header {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 12px 14px 8px; font-size: 15px; font-weight: 700;
}
.cats-header small { color: #888; font-weight: 400; font-size: 12px; }

/* 分类网格 */
.cats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 14px 20px; }
.cat-card {
  position: relative; border-radius: 12px; padding: 18px 10px 14px; text-align: center;
  background: linear-gradient(145deg, #26262b, #1d1d22); cursor: pointer; overflow: hidden;
  border: 1px solid #2e2e33;
}
.cat-card:active { transform: scale(0.96); }
.cat-card .c-name { font-size: 15px; font-weight: 700; }
.cat-card .c-num { font-size: 11px; color: #999; margin-top: 5px; }
.cat-card.hide { display: none; }
.cats-more { text-align: center; padding: 2px 0 20px; }
.cats-more button {
  padding: 8px 30px; border: 1px solid #3a3a40; background: #1f1f24; color: #ddd;
  border-radius: 18px; font-size: 13px; cursor: pointer;
}
.cats-more button:active { background: #2a2a30; }
.cat-card::after {
  content: ''; position: absolute; right: -14px; top: -14px; width: 46px; height: 46px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255,90,60,0.35), transparent 70%);
}

/* 导航栏（列表/搜索页） */
.navbar { display: flex; align-items: center; padding: 14px 10px; position: sticky; top: 0; background: #121212; z-index: 10; }
.back { width: 34px; height: 34px; border: none; background: #262626; color: #eee; border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer; }
.nav-title { margin-left: 12px; font-size: 16px; font-weight: 700; display: flex; flex-direction: column; }
.nav-title small { color: #999; font-size: 12px; font-weight: 400; }

/* 歌曲列表 */
.song-list { padding: 0 10px 10px; }
.song-item { display: flex; align-items: center; padding: 10px 8px; border-radius: 10px; cursor: pointer; }
.song-item:active { background: #1f1f24; }
.song-item img { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: #26262b; flex-shrink: 0; }
.song-item .s-info { margin-left: 12px; min-width: 0; flex: 1; }
.song-item .s-title { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-badge { font-size: 9px; background: linear-gradient(135deg, #ff5a3c, #ff8a3c); color: #fff; border-radius: 3px; padding: 1px 4px; margin-left: 5px; font-weight: 700; vertical-align: 1px; }
.song-item .s-singer { font-size: 12px; color: #999; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-item .s-dur { font-size: 11px; color: #777; flex-shrink: 0; margin-left: 8px; }
.song-item.playing .s-title { color: #ff5a3c; }

.loadmore { text-align: center; padding: 6px 0 20px; }
.loadmore button {
  padding: 8px 26px; border: 1px solid #3a3a40; background: #1f1f24; color: #ddd;
  border-radius: 18px; font-size: 13px; cursor: pointer;
}
.tip { color: #888; font-size: 12px; padding: 8px; }

/* 播放器 */
.player {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 640px; background: #1a1a1f; border-top: 1px solid #2a2a30;
  z-index: 100;
}
.player.hidden { display: none; }
.player-main { display: flex; align-items: center; padding: 10px 14px; cursor: pointer; position: relative; }
.p-thumb { position: relative; width: 46px; height: 46px; flex: none; }
.player-main img { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; }
.p-video { position: absolute; inset: 0; width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: #000; z-index: 2; }
.p-mv { font-size: 9px; background: linear-gradient(135deg, #ff5a3c, #ff8a3c); color: #fff; border-radius: 3px; padding: 1px 4px; vertical-align: 2px; margin-left: 5px; font-weight: 700; }

/* MV 全屏播放层 */
.mv-layer { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 300; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.mv-layer.hidden { display: none; }
.mv-layer video { width: 100%; max-width: 720px; max-height: 80vh; background: #000; }
.mv-head { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; }
.mv-title { color: #fff; font-size: 15px; font-weight: 600; max-width: 70%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-close { color: #fff; font-size: 24px; padding: 12px 16px; cursor: pointer; opacity: .9; border-radius: 8px; user-select: none; }
.mv-close:hover { opacity: 1; background: rgba(255,255,255,.12); }
.mv-buffer { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #fff; font-size: 15px; background: #000; }
.mv-buffer.hidden { display: none; }
.mv-spinner { width: 36px; height: 36px; border: 3px solid rgba(255,255,255,.25); border-top-color: #ff5a3c; border-radius: 50%; animation: mv-spin .8s linear infinite; }
@keyframes mv-spin { to { transform: rotate(360deg); } }
.p-info { flex: 1; min-width: 0; margin-left: 12px; }
.p-title-row { display: flex; align-items: center; min-width: 0; }
.p-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-singer { font-size: 12px; color: #999; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-marks { margin-left: auto; display: flex; gap: 2px; align-items: center; flex: none; }
.p-mark { cursor: pointer; font-size: 14px; padding: 2px 7px; color: #777; border-radius: 6px; user-select: none; line-height: 1.4; }
.p-mark:active { background: rgba(255,255,255,.1); }
.p-mark.on { color: #ff5a3c; }
.p-mark#p-dislike.on { color: #ffa33c; }
.p-play {
  width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, #ff5a3c, #ff8a3c); color: #fff; font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.p-progress { display: flex; align-items: center; padding: 0 14px 10px; gap: 8px; font-size: 10px; color: #888; }
.p-bar { flex: 1; height: 4px; background: #333; border-radius: 2px; cursor: pointer; position: relative; }
.p-fill { height: 100%; width: 0; background: linear-gradient(90deg, #ff5a3c, #ff8a3c); border-radius: 2px; }

/* 展开面板 */
.player-panel { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.player-panel.open { max-height: 50vh; overflow-y: auto; }
.p-cats { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 14px 10px; }
.cat-chip {
  padding: 5px 12px; border-radius: 14px; background: #26262b; border: 1px solid #34343a;
  font-size: 12px; color: #ddd; cursor: pointer;
}
.cat-chip:active { background: #33333a; }
.p-lyric { padding: 4px 14px 16px; max-height: 38vh; overflow-y: auto; text-align: center; }
.p-lyric .l-line { padding: 6px 0; color: #666; font-size: 13px; line-height: 1.8; transition: color .2s; }
.p-lyric .l-line .l-char { color: #666; transition: color .15s; }
.p-lyric .l-line.cur { color: #aaa; }
.p-lyric .l-line.cur .l-char { color: #aaa; }
.p-lyric .l-line.cur .l-char.cur { color: #ff5a3c; font-weight: 700; }
.p-lyric .l-empty { color: #666; padding: 20px 0; font-size: 13px; }

/* 偏好选择弹窗 */
.pref-layer { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 400; display: flex; align-items: center; justify-content: center; padding: 20px; }
.pref-layer.hidden { display: none; }
.pref-box { width: 100%; max-width: 400px; background: #1a1a1f; border-radius: 14px; padding: 22px 20px; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.pref-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.pref-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; max-height: 42vh; overflow-y: auto; }
.pref-cat { padding: 7px 14px; border-radius: 16px; background: #26262b; border: 1px solid #34343a; font-size: 13px; color: #ddd; cursor: pointer; user-select: none; }
.pref-cat:active { background: #33333a; }
.pref-cat.on { background: linear-gradient(135deg, #ff5a3c, #ff8a3c); border-color: transparent; color: #fff; }
.pref-cat.shake { animation: pref-shake .3s; }
@keyframes pref-shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.pref-ok { width: 100%; padding: 11px; border: none; border-radius: 10px; background: linear-gradient(135deg, #ff5a3c, #ff8a3c); color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; }
.pref-ok:active { opacity: .85; }
.pref-skip { text-align: center; color: #888; font-size: 12px; margin-top: 12px; cursor: pointer; }
.pref-skip:active { color: #aaa; }
.p-cats-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px 0; font-size: 12px; color: #888; }
.p-pref-edit { color: #ff8a3c; cursor: pointer; font-size: 12px; padding: 4px 6px; border-radius: 6px; user-select: none; }
.p-pref-edit:active { background: rgba(255,138,60,.15); }
.p-next {
  width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer; margin-left: 8px;
  background: #26262b; color: #ddd; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.p-next:active { background: #33333a; }
