* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, 'Segoe UI', 'HarmonyOS Sans', system-ui, sans-serif;
  background: #f2f1f6;
  color: #2c2c2e;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* ========== 背景光晕 ========== */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  z-index: 0;
  animation: floatOrb 16s infinite alternate ease-in-out;
}
.orb-1 {
  width: 350px;
  height: 350px;
  background: #f8d7b3;
  top: -100px;
  left: -80px;
}
.orb-2 {
  width: 280px;
  height: 280px;
  background: #e2c2a4;
  bottom: -90px;
  right: -70px;
  animation-duration: 22s;
}
.orb-3 {
  width: 240px;
  height: 240px;
  background: #eed7c5;
  top: 60%;
  left: 60%;
  animation-duration: 19s;
}
@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, 30px) scale(1.15); }
}

/* ========== 登录/注册卡片 ========== */
.auth-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  background: transparent;
}
.auth-card {
  background: #ffffff;
  border-radius: 28px;
  padding: 2.5rem 2rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.1);
  width: 340px;
  max-width: 90%;
  text-align: center;
  z-index: 101;
  border: 1px solid #f0e0d6;
}
.auth-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}
.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1.1rem;
  font-weight: 500;
  color: #8e8e93;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 20px;
  transition: all 0.2s;
}
.auth-tab.active {
  background: #f5f0eb;
  color: #5e4636;
  font-weight: 600;
}
.form-group {
  margin-bottom: 1rem;
}
.form-group input {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid #e5dfd7;
  border-radius: 16px;
  font-size: 0.95rem;
  background: #fcfaf7;
  outline: none;
  transition: border 0.2s;
}
.form-group input:focus {
  border-color: #c9a27c;
}
.auth-btn {
  width: 100%;
  padding: 0.9rem;
  background: #d9b896;
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 0.5rem;
}
.auth-btn:hover {
  background: #c4a07b;
}
.auth-error {
  color: #d9534f;
  font-size: 0.85rem;
  margin-top: 0.8rem;
  min-height: 1.2em;
}

/* ========== 主应用 ========== */
.app {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: #ffffff;
  border-bottom: 1px solid #e5e5ea;
  height: 64px;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}
.tabs {
  display: flex;
  gap: 0.5rem;
}
.tab {
  border: none;
  background: transparent;
  font-size: 0.95rem;
  font-weight: 500;
  color: #8e8e93;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  transition: all 0.2s;
  white-space: nowrap;
}
.tab.active {
  background: #f2f1f6;
  color: #1d1d1f;
  font-weight: 600;
}
.tab-fav.active {
  background: #fff0f0;
  color: #c44;
}
.right-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.user-area {
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
  min-width: 100px;
  justify-content: flex-end;
  height: 36px;
}
.user-nick {
  font-weight: 500;
  color: #3a3a3c;
  transition: transform 0.3s ease, opacity 0.3s;
  white-space: nowrap;
}
.logout-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: #ff3b30;
  color: white;
  padding: 0.4rem 1.2rem;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  white-space: nowrap;
  min-width: 80px;
}
.user-area.show-logout .logout-btn {
  opacity: 1;
  pointer-events: auto;
}
.user-area.show-logout .user-nick {
  transform: translateX(-30px);
  opacity: 0;
}

.subcat-dropdown {
  position: absolute;
  top: 64px;
  left: 1.5rem;
  background: #ffffff;
  border-radius: 0 0 20px 20px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  display: none;
  z-index: 20;
  min-width: 180px;
  padding: 0.5rem;
  flex-direction: column;
  gap: 0.2rem;
}
.subcat-dropdown.show {
  display: flex;
}
.subcat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: none;
  background: transparent;
  text-align: left;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
  color: #3a3a3c;
  cursor: default;
  transition: background 0.15s;
  position: relative;
}
.subcat-item:hover {
  background: #f2f1f6;
}
.subcat-item .arrow {
  font-size: 0.8rem;
  color: #8e8e93;
}
.subcat-item .subcat-level3 {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  min-width: 140px;
  padding: 0.5rem;
  flex-direction: column;
  gap: 0.2rem;
  z-index: 25;
}
.subcat-item .subcat-level3.show {
  display: flex;
}
.level3-item {
  border: none;
  background: transparent;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  font-size: 0.85rem;
  color: #3a3a3c;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.level3-item:hover {
  background: #f2f1f6;
}

.main-content {
  flex: 1;
  display: flex;
  overflow: hidden;
}
.lyrics-panel {
  flex: 1;
  background: #f2f1f6;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 2rem;
  transition: flex 0.3s ease;
}
.lyrics-center {
  text-align: left;
  font-size: 1.3rem;
  line-height: 2;
  color: #3a3a3c;
  max-width: 600px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 1rem 2rem;
  white-space: normal;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.lyrics-center::-webkit-scrollbar {
  display: none;
}
.lyric-line {
  margin: 0.5rem 0;
  cursor: default;
  transition: all 0.3s ease;
  color: #8e8e93;
  font-size: 1.3rem;
}
.lyric-line.active {
  color: #1d1d1f;
  font-weight: 600;
  font-size: 1.5rem;
  transform: scale(1.02);
}

.song-panel {
  width: 0;
  overflow: hidden;
  background: #ffffff;
  border-left: 1px solid #e5e5ea;
  transition: width 0.3s ease;
  display: flex;
  flex-direction: column;
}
.song-panel:not(.collapsed) {
  width: 16.666%;
  min-width: 200px;
}
.song-panel.collapsed {
  width: 0;
  border-left: none;
}
.song-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1rem 0.8rem;
  overflow-y: auto;
  flex: 1;
}
.song-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.song-item:hover {
  background: #f8f8fc;
}
.song-item.playing {
  background: #fce8e3;
  font-weight: 500;
}
.song-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}
.song-name {
  font-weight: 500;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.song-artist {
  font-size: 0.7rem;
  color: #8e8e93;
}
.song-actions {
  display: flex;
  align-items: center;
  margin-left: 0.4rem;
}
.like-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: #c7c7cc;
  transition: transform 0.15s;
}
.like-btn.liked {
  color: #ff3b30;
}
.like-btn:hover {
  transform: scale(1.2);
}

.toggle-songlist-fab {
  position: fixed;
  right: 20px;
  bottom: 80px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  font-size: 1.3rem;
  color: #3a3a3c;
  cursor: pointer;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}
.toggle-songlist-fab:hover {
  background: #f2f1f6;
  transform: scale(1.08);
}

.now-playing-bar {
  background: #ffffff;
  border-top: 1px solid #e5e5ea;
  padding: 0.7rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 72px;
  flex-shrink: 0;
}
.np-info {
  width: 130px;
  overflow: hidden;
}
.np-title {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.np-artist {
  font-size: 0.75rem;
  color: #8e8e93;
}
.np-controls {
  display: flex;
  gap: 0.5rem;
}
.np-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: #3a3a3c;
}
.np-play {
  font-size: 1.6rem;
}
.np-progress-container {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.np-time {
  font-size: 0.7rem;
  color: #8e8e93;
  min-width: 36px;
  text-align: center;
}
.np-progress-bar {
  flex: 1;
  height: 4px;
  background: #e5e5ea;
  border-radius: 4px;
  cursor: pointer;
}
.np-progress-fill {
  height: 100%;
  width: 0%;
  background: #ff6b6b;
  border-radius: 4px;
  transition: width 0.1s linear;
}
.np-volume {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  pointer-events: auto;   /* 确保可点击 */
}
.np-volume-slider {
  width: 70px;
  accent-color: #ff6b6b;
  position: relative;     /* 新增：建立层叠上下文 */
  z-index: 5;             /* 新增：防止被父级遮挡 */
  pointer-events: auto;   /* 新增：明确可交互 */
}
/* ========== 移动端适配（屏幕宽度 ≤ 768px） ========== */
@media (max-width: 768px) {
  /* 顶部栏：缩小内边距，标签缩小 */
  .top-bar {
    padding: 0.6rem 0.8rem;
    height: auto;
    flex-wrap: wrap;
  }
  .tabs {
    gap: 0.3rem;
    flex-wrap: wrap;
  }
  .tab {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    border-radius: 16px;
  }
  .right-actions {
    gap: 0.5rem;
  }
  .user-nick {
    font-size: 0.8rem;
  }
  .logout-btn {
    font-size: 0.7rem;
    padding: 0.3rem 0.8rem;
    min-width: 60px;
  }

  /* 主内容区：歌词占满，歌曲面板变为浮动层 */
  .main-content {
    position: relative;
    overflow: hidden;
  }
  .lyrics-panel {
    padding: 1rem;
    flex: 1;
  }
  .lyrics-center {
    font-size: 1.1rem;
    padding: 0.5rem;
    max-height: 50vh;
  }
  .lyric-line {
    font-size: 1.1rem;
  }
  .lyric-line.active {
    font-size: 1.3rem;
  }

  /* 歌曲面板：展开时从右侧滑出，覆盖在歌词上方 */
  .song-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    z-index: 25;
    width: 80%;
    max-width: 300px;
    box-shadow: -4px 0 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    transform: translateX(100%);
  }
  .song-panel:not(.collapsed) {
    transform: translateX(0);
    width: 80%;
    min-width: 200px;
  }
  .song-panel.collapsed {
    transform: translateX(100%);
    width: 80%;
    border-left: none;
  }

  /* 歌曲列表项适应小屏 */
  .song-item {
    padding: 0.6rem 0.6rem;
  }
  .song-name {
    font-size: 0.8rem;
  }
  .song-artist {
    font-size: 0.65rem;
  }

  /* 右下角悬浮按钮位置微调 */
  .toggle-songlist-fab {
    right: 12px;
    bottom: 80px;
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
  }

  /* 底部播放条：减小高度和间距 */
  .now-playing-bar {
    padding: 0.5rem 0.8rem;
    height: 60px;
    gap: 0.5rem;
  }
  .np-info {
    width: 90px;
  }
  .np-title {
    font-size: 0.75rem;
  }
  .np-artist {
    font-size: 0.65rem;
  }
  .np-controls {
    gap: 0.3rem;
  }
  .np-btn {
    font-size: 1.1rem;
    width: 30px;
    height: 30px;
  }
  .np-play {
    font-size: 1.3rem;
  }
  .np-progress-container {
    gap: 0.3rem;
  }
  .np-time {
    font-size: 0.65rem;
    min-width: 28px;
  }
  .np-volume-slider {
    width: 50px;
  }

  /* 登录卡片 */
  .auth-card {
    padding: 1.8rem 1.2rem;
  }
  .auth-tab {
    font-size: 1rem;
  }
  .form-group input {
    padding: 0.8rem;
    font-size: 0.9rem;
  }
  .auth-btn {
    font-size: 0.9rem;
    padding: 0.8rem;
  }
}