:root {
  --netease-red: #ec4141;
  --netease-red-hover: #d73535;
  --bg-main: #ffffff;
  --bg-sidebar: #f7f8fa;
  --bg-player-dark: #272822;
  --panel-dark: #21221d;
  --text-main: #333333;
  --text-sub: #7e8077;
  --text-dim: #54564e;
  --text-link: #5292fe;
  --border-light: #eceef1;
  --border-dark: #2e3028;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: #f0f2f5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  user-select: none;
}

.app-window {
  width: 100vw;
  height: 100vh;
  background: var(--bg-main);
  display: grid;
  grid-template-rows: 1fr 74px;
  grid-template-columns: 210px 1fr;
  grid-template-areas:
    "sidebar main-area"
    "footer footer";
  position: relative;
  overflow: hidden;
}

/* 侧边栏 */
.app-sidebar {
  grid-area: sidebar;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}

.sidebar-logo-box {
  height: 60px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.logo-icon-svg { width: 28px; height: 28px; color: var(--netease-red); }
.logo-text { font-size: 1.2rem; font-weight: bold; color: #222; letter-spacing: -0.5px; }

.sidebar-nav { padding: 10px 14px; display: flex; flex-direction: column; gap: 18px; }
.menu-group { display: flex; flex-direction: column; gap: 2px; }
.menu-title { font-size: 0.72rem; color: #999; padding: 0 12px; margin-bottom: 6px; }

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #444;
  cursor: pointer;
  transition: background 0.15s;
}
.menu-item:hover { background: #eaebee; }
.menu-item.active { background: var(--netease-red); color: #ffffff; font-weight: 500; }
.menu-item.active svg { color: #ffffff; }

/* 主内容区 */
.app-main-area {
  grid-area: main-area;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--bg-main);
}

.main-top-bar {
  height: 60px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.top-bar-left { display: flex; align-items: center; gap: 14px; }
.back-btn {
  width: 28px; height: 28px; border-radius: 50%; background: #f0f0f2;
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: #666;
}
.back-btn:hover { background: #e4e4e7; color: #111; }

.search-box {
  position: relative; display: flex; align-items: center; background: #f0f0f2;
  border-radius: 20px; padding: 6px 14px; width: 260px; gap: 8px;
}
.search-box input { border: none; background: transparent; outline: none; font-size: 0.82rem; width: 100%; color: #333; }

.top-bar-right { display: flex; align-items: center; gap: 16px; }
.user-profile { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: #555; }
.user-avatar { width: 28px; height: 28px; border-radius: 50%; background: #ffd1d1; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; color: var(--netease-red); font-weight: bold; }
.vip-tag { font-size: 0.65rem; background: #e2e4ea; padding: 1px 4px; border-radius: 4px; color: #666; }
.sys-controls { display: flex; gap: 12px; color: #888; font-size: 0.8rem; }

.main-scroll-view { flex: 1; overflow-y: auto; padding: 24px 32px; position: relative; }
.page-view { display: none; flex-direction: column; gap: 24px; }
.page-view.active { display: flex; }

/* 首页推荐单曲（3 列紧凑网格） */
.home-songs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 20px;
}
.home-song-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.home-song-item:hover {
  background: #f0f2f5;
}
.home-song-cover {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}
.home-song-cover img { width: 100%; height: 100%; object-fit: cover; }
.home-song-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}
.home-song-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-song-artist {
  font-size: 0.75rem;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 盲盒风格标签 */
.tag-box-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.tag-box-scroll::-webkit-scrollbar { display: none; }
.blind-tag-pill {
  background: #f0f2f5;
  padding: 5px 14px;
  border-radius: 14px;
  font-size: 0.8rem;
  color: #555;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}
.blind-tag-pill:hover {
  background: #e2e4ea;
  color: var(--netease-red);
}

.song-table { display: flex; flex-direction: column; width: 100%; }
.song-row {
  display: grid; grid-template-columns: 50px 1.5fr 1fr 60px;
  align-items: center; padding: 10px 12px; font-size: 0.85rem; color: #333; border-radius: 6px; cursor: pointer;
}
.song-row:hover { background: #f5f5f7; }
.song-row.active { background: #fbeeed; color: var(--netease-red); }
.song-row.header { color: #888; font-size: 0.78rem; border-bottom: 1px solid #eee; padding-bottom: 6px; cursor: default; }
.song-row.header:hover { background: transparent; }
.song-title-cell { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.vip-sq-badge { font-size: 0.6rem; border: 1px solid #ec4141; color: #ec4141; padding: 0 2px; border-radius: 2px; }

.rec-cards-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.rec-card {
  position: relative; height: 160px; border-radius: 8px; overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 12px; color: #fff;
}
.rec-card.c1 { background: linear-gradient(135deg, #ff7e5f, #feb47b); }
.rec-card.c2 { background: linear-gradient(135deg, #11998e, #38ef7d); }
.rec-card.c3 { background: linear-gradient(135deg, #ff0844, #ffb199); }
.rec-card.c4 { background: linear-gradient(135deg, #654ea3, #eaafc8); }
.rec-card.c5 { background: linear-gradient(135deg, #2c3e50, #4ca1af); }
.card-badge { position: absolute; top: 8px; left: 8px; font-size: 0.7rem; font-weight: bold; }
.card-title { font-size: 0.85rem; font-weight: 600; line-height: 1.3; }

.playlist-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px 16px; }
.playlist-card { display: flex; flex-direction: column; gap: 8px; cursor: pointer; }
.playlist-cover-box { position: relative; width: 100%; aspect-ratio: 1; border-radius: 8px; overflow: hidden; }
.playlist-cover-box img { width: 100%; height: 100%; object-fit: cover; }
.play-count { position: absolute; top: 6px; right: 8px; font-size: 0.7rem; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.6); }
.playlist-title { font-size: 0.82rem; color: #444; line-height: 1.4; }

.search-tabs { display: flex; gap: 24px; border-bottom: 1px solid #eee; padding-bottom: 10px; font-size: 0.95rem; font-weight: 500; color: #555; }
.search-tab-item { cursor: pointer; }
.search-tab-item.active { color: var(--netease-red); border-bottom: 2px solid var(--netease-red); padding-bottom: 8px; margin-bottom: -11px; font-weight: bold; }

.detail-top-box { display: flex; gap: 24px; align-items: center; margin-bottom: 24px; }
.detail-cover { width: 160px; height: 160px; border-radius: 10px; overflow: hidden; flex-shrink: 0; box-shadow: 0 4px 15px rgba(0,0,0,0.15); }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { display: flex; flex-direction: column; gap: 10px; }
.detail-title { font-size: 1.4rem; font-weight: bold; color: #111; }
.detail-actions { display: flex; gap: 10px; margin-top: 6px; }
.btn-red { background: var(--netease-red); color: #fff; border: none; padding: 6px 18px; border-radius: 16px; font-size: 0.85rem; cursor: pointer; }
.btn-normal { background: #f0f0f2; color: #333; border: 1px solid #dcdde4; padding: 6px 16px; border-radius: 16px; font-size: 0.85rem; cursor: pointer; }

/* 黑胶沉浸播放台 */
.immersive-player-view {
  position: absolute; top: 0; left: 0; width: 100vw; height: calc(100vh - 74px); max-height: calc(100vh - 74px);
  background: var(--bg-player-dark); color: #ffffff; z-index: 50; display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1); overflow: hidden;
}
.immersive-player-view.show { transform: translateY(0); }
.collapse-btn { position: absolute; top: 20px; left: 24px; background: none; border: none; color: #999; cursor: pointer; z-index: 60; font-size: 0.85rem; }
.collapse-btn:hover { color: #fff; }

.player-body {
  flex: 1; height: 100%; min-height: 0; display: grid; grid-template-columns: 1fr 1fr;
  align-items: center; max-width: 1150px; margin: 0 auto; width: 100%; padding: 0 40px; position: relative; overflow: hidden;
}

.player-left { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; min-height: 0; }
.tonearm-container {
  position: absolute; top: calc(50% - 255px); left: calc(50% - 20px); width: 210px; height: 170px;
  z-index: 60; transform-origin: 20px 20px; transform: rotate(0deg); transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1); pointer-events: none;
  filter: drop-shadow(0 15px 15px rgba(0, 0, 0, 0.75));
}
.tonearm-container.playing { transform: rotate(40deg); }

.turntable-tray {
  position: relative; width: 360px; height: 360px; border-radius: 50%; background: #1c1d19;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 25px 60px rgba(0, 0, 0, 0.85);
  display: flex; justify-content: center; align-items: center; margin-top: 50px; flex-shrink: 0;
}
.vinyl-body {
  width: 310px; height: 310px; border-radius: 50%;
  background: repeating-radial-gradient(#0c0d0a, #0c0d0a 2px, #161814 3px, #0c0d0a 4px);
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.95); display: flex; justify-content: center; align-items: center;
  animation: rotateVinyl 22s linear infinite; animation-play-state: paused;
}
.vinyl-body.playing { animation-play-state: running; }
@keyframes rotateVinyl { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.vinyl-artwork { width: 225px; height: 225px; border-radius: 50%; overflow: hidden; border: 4px solid #000000; flex-shrink: 0; }
.vinyl-artwork img { width: 100%; height: 100%; object-fit: cover; }

.player-right { height: 80%; max-height: 80%; min-height: 0; display: flex; flex-direction: column; padding-left: 40px; overflow: hidden; }
.song-title { font-size: 1.65rem; font-weight: 500; margin-bottom: 8px; flex-shrink: 0; }

.song-meta { font-size: 0.85rem; color: var(--text-sub); display: flex; gap: 20px; margin-bottom: 24px; flex-shrink: 0; }
.song-meta span.link-hover { color: var(--text-link); cursor: pointer; text-decoration: none; }
.song-meta span.link-hover:hover { text-decoration: underline; }

.lyrics-view {
  flex: 1; height: 100%; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 22px;
  mask-image: linear-gradient(180deg, transparent 0%, rgba(0,0,0,1) 12%, rgba(0,0,0,1) 82%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, rgba(0,0,0,1) 12%, rgba(0,0,0,1) 82%, transparent 100%);
  scrollbar-width: none;
}
.lyrics-view::-webkit-scrollbar { display: none; }

.lyric-item {
  font-size: 0.98rem; color: var(--text-dim); transition: transform 0.3s ease, font-size 0.3s ease;
  cursor: pointer; line-height: 1.6; display: flex; flex-wrap: wrap; gap: 0;
}
.lyric-item.active {
  font-size: 1.25rem; font-weight: 600; color: #ffffff;
}

.kok-word {
  display: inline-block;
  background: linear-gradient(to right, #ffffff var(--progress, 0%), #666860 var(--progress, 0%));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  will-change: background-size;
}

/* 底部控制栏 */
.app-footer {
  grid-area: footer; position: relative; height: 74px; background: var(--panel-dark);
  border-top: 1px solid var(--border-dark); display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; z-index: 100; color: #fff;
}
.top-progress-bar { position: absolute; top: -2px; left: 0; width: 100%; height: 2px; background: rgba(255, 255, 255, 0.08); cursor: pointer; transition: height 0.15s; }
.top-progress-bar:hover { height: 4px; top: -4px; }
.progress-current { position: absolute; height: 100%; width: 0%; background: var(--netease-red); }

.bar-left { display: flex; align-items: center; gap: 14px; min-width: 320px; }
.mini-cover-box { position: relative; width: 48px; height: 48px; border-radius: 6px; overflow: hidden; cursor: pointer; flex-shrink: 0; }
.mini-cover-box img { width: 100%; height: 100%; object-fit: cover; }
.meta-box { display: flex; flex-direction: column; gap: 3px; }
.meta-title-row { display: flex; align-items: center; gap: 12px; }
.song-name { font-size: 0.92rem; font-weight: 500; color: #eaeaea; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artist-name { font-size: 0.78rem; color: var(--text-sub); }

.badge-group { display: flex; align-items: center; gap: 10px; margin-left: 4px; }
.interactive-badge { display: flex; align-items: center; gap: 3px; color: #9c9e96; cursor: pointer; font-size: 0.68rem; }
.interactive-badge:hover { color: #ffffff; }
.interactive-badge.liked { color: var(--netease-red); }
.interactive-badge.liked svg { fill: var(--netease-red); stroke: var(--netease-red); }

.bar-center { display: flex; align-items: center; gap: 22px; }
.ctrl-btn { background: none; border: none; color: #d1d5db; cursor: pointer; display: flex; align-items: center; justify-content: center; position: relative; }
.ctrl-btn:hover { color: #ffffff; }
.btn-play-round { width: 38px; height: 38px; border-radius: 50%; background: #2e3028; color: #ffffff; }
.btn-play-round:hover { background: #3b3d34; }

.bar-right { display: flex; align-items: center; gap: 16px; min-width: 320px; justify-content: flex-end; }

.quality-wrapper { position: relative; }
.quality-badge { border: 1px solid #9c9e96; color: #9c9e96; font-size: 0.65rem; padding: 1px 4px; border-radius: 3px; font-weight: 600; cursor: pointer; }
.quality-popover {
  position: absolute; bottom: 34px; right: 0; width: 100px; background: #2b2c28; border-radius: 6px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5); display: none; flex-direction: column; padding: 4px 0; z-index: 220;
}
.quality-popover.show { display: flex; }
.quality-opt { padding: 6px 12px; font-size: 0.75rem; color: #ccc; cursor: pointer; }
.quality-opt:hover, .quality-opt.active { background: #383a33; color: var(--netease-red); font-weight: bold; }

.lyric-toggle-btn { font-size: 0.85rem; color: #9c9e96; font-weight: bold; cursor: pointer; }
.lyric-toggle-btn.active { color: #ffffff; }

/* 抽屉面板 */
.comment-drawer, .playlist-drawer {
  position: fixed; top: 0; right: -420px; width: 420px; height: calc(100vh - 74px);
  background: #ffffff; box-shadow: -5px 0 25px rgba(0,0,0,0.15); z-index: 300;
  display: flex; flex-direction: column; transition: right 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.comment-drawer.show, .playlist-drawer.show { right: 0; }

.drawer-header {
  height: 56px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid #eee; font-size: 1.05rem; font-weight: bold; color: #222; flex-shrink: 0;
}
.drawer-close-btn { font-size: 1.4rem; color: #888; cursor: pointer; }

.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.comment-item { display: flex; gap: 12px; font-size: 0.82rem; border-bottom: 1px solid #f2f2f4; padding-bottom: 12px; }
.comment-avatar { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
.comment-content-box { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.comment-user { color: #507daf; font-weight: 500; }
.comment-text { color: #333; line-height: 1.4; word-break: break-all; }
.comment-time { color: #999; font-size: 0.72rem; margin-top: 2px; }
.comment-load-more { text-align: center; padding: 10px; color: var(--netease-red); font-size: 0.8rem; cursor: pointer; }

.playlist-item-row {
  display: flex; align-items: center; justify-content: space-between; padding: 8px 10px;
  font-size: 0.84rem; border-radius: 6px; cursor: pointer; color: #333;
}
.playlist-item-row:hover { background: #f5f5f7; }
.playlist-item-row.active { background: #fbeeed; color: var(--netease-red); font-weight: bold; }