/* ============================================================
   DualStar · 音乐 app
   韩式低饱和度 · 黑白灰莫兰迪
   class 前缀 .ms-
   ============================================================ */

.ms-view {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 1;
}

/* 确保交互元素始终可点击 */
.ms-nav,
.ms-nav-btn,
.ms-tabbar,
.ms-tabbar-item,
.ms-home-search,
.ms-section-more,
.ms-hcard,
.ms-fav-card {
  pointer-events: auto;
}

/* —— 手机主屏音乐 App 图标背景（渐变强调色） —— */
/* 与其他 .app-icon.* 保持一致的视觉风格，使用 CSS 变量跟随主题 */
.app-icon.music {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
}

.ms-shell {
  position: relative;
  width: var(--phone-w);
  height: var(--phone-h);
  max-height: 100vh;
  background: var(--bg);
  border-radius: var(--phone-radius);
  box-shadow:
    0 0 0 12px var(--bg-elevated),
    0 0 0 13px var(--border-strong),
    var(--shadow-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (max-width: 768px) {
  .ms-shell {
    width: 100vw;
    height: 100vh;
    height: 100lvh;
    border-radius: 0;
    box-shadow: none;
  }
}

/* —— 顶部导航 —— */
.ms-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 8px;
  background: var(--bg-glass);
  border-bottom: 0.5px solid var(--border);
  padding-top: calc(10px + var(--safe-area-top, env(safe-area-inset-top, 0px)));
  flex-shrink: 0;
  min-height: 52px;
}

.ms-nav-title {
  flex: 1;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.2px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ms-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-deep, var(--accent));
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color var(--dur-fast), transform var(--dur-fast) var(--ease-out);
}
.ms-nav-btn:hover { background: var(--surface); }
.ms-nav-btn:active { transform: scale(0.92); }

/* —— 搜索栏 —— */
.ms-search-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border-radius: var(--r-full);
  padding: 6px 12px;
  height: 32px;
}
.ms-search-icon { color: var(--text-tertiary); flex-shrink: 0; }
.ms-search-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
}
.ms-search-input::placeholder { color: var(--text-tertiary); }

/* —— 滚动区 —— */
.ms-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 12px 0;
}
.ms-bottom-pad { height: 80px; }

/* —— 搜索框（首页） —— */
.ms-home-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border-radius: var(--r-full);
  padding: 10px 16px;
  color: var(--text-tertiary);
  font-size: 14px;
  cursor: pointer;
  transition: background var(--dur-fast), transform var(--dur-fast);
  margin-bottom: 20px;
}
.ms-home-search:active { transform: scale(0.98); }

/* —— 通用 Section —— */
.ms-section { margin-bottom: 24px; }
.ms-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 2px;
}
.ms-section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.2px;
}
.ms-section-more {
  font-size: 12px;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color var(--dur-fast);
}
.ms-section-more:hover { color: var(--accent); }

/* —— 横向列表 —— */
.ms-hlist {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0 8px;
  scrollbar-width: none;
}
.ms-hlist::-webkit-scrollbar { display: none; }

.ms-hcard {
  flex-shrink: 0;
  width: 110px;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out);
}
.ms-hcard:active { transform: scale(0.96); }
.ms-hcard-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-top: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ms-hcard-artist {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ms-hcard-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* —— 我的喜欢卡片（单张歌单样式） —— */
.ms-fav-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
  border: 0.5px solid var(--border);
}
.ms-fav-card:active { transform: scale(0.98); }
.ms-fav-card-cover {
  width: 56px;
  height: 56px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--accent) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.ms-fav-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ms-fav-card-info {
  flex: 1;
  min-width: 0;
}
.ms-fav-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.ms-fav-card-count {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 3px;
}
.ms-hcard-add .ms-cover-add {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--text-tertiary);
  border: 1px dashed var(--border-strong);
}

/* —— 封面 —— */
.ms-cover-sm,
.ms-cover-md,
.ms-cover-lg {
  background: var(--surface);
  border-radius: var(--r-sm);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}
.ms-cover-sm { width: 44px; height: 44px; }
.ms-cover-md { width: 110px; height: 110px; }
.ms-cover-lg { width: 220px; height: 220px; border-radius: var(--r-md); }

.ms-cover-sm img,
.ms-cover-md img,
.ms-cover-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ms-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  opacity: 0.5;
}

/* —— 每日推荐 —— */
.ms-daily-card {
  background: var(--bg-elevated);
  border-radius: var(--r-md);
  padding: 16px;
  border: 0.5px solid var(--border);
}
.ms-daily-loading,
.ms-daily-empty {
  font-size: 13px;
  color: var(--text-tertiary);
  text-align: center;
  padding: 24px 0;
}
.ms-daily-inner {
  display: flex;
  gap: 14px;
  align-items: center;
}
.ms-daily-info {
  flex: 1;
  min-width: 0;
}
.ms-daily-label {
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.ms-daily-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ms-daily-artist {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ms-btn-play {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: var(--text-inverse);
  border: none;
  border-radius: var(--r-full);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast);
}
.ms-btn-play:hover { opacity: 0.88; }
.ms-btn-play:active { transform: scale(0.94); }

/* —— 空状态 —— */
.ms-empty-hint {
  text-align: center;
  font-size: 13px;
  color: var(--text-tertiary);
  padding: 24px 12px;
  width: 100%;
}
.ms-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
  text-align: center;
  gap: 8px;
}
.ms-empty-state p { font-size: 14px; margin: 0; }
.ms-empty-state .micro { font-size: 12px; opacity: 0.7; }

/* —— 搜索默认页 —— */
.ms-search-default { padding: 4px 0; }
.ms-search-hist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}
.ms-search-hist-clear {
  color: var(--text-tertiary);
  cursor: pointer;
  font-weight: 400;
  transition: color var(--dur-fast);
}
.ms-search-hist-clear:hover { color: var(--danger); }
.ms-search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ms-tag {
  display: inline-block;
  padding: 6px 12px;
  background: var(--surface);
  border-radius: var(--r-full);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast), transform var(--dur-fast);
}
.ms-tag:hover { background: var(--surface-hover); color: var(--text); }
.ms-tag:active { transform: scale(0.94); }

/* —— 搜索结果列表 —— */
.ms-result-list { padding: 4px 0; }
.ms-song-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 0.5px solid var(--border);
  cursor: pointer;
  transition: background var(--dur-fast);
}
.ms-song-item:hover { background: var(--surface); }
.ms-song-item:active { background: var(--surface-hover); }
.ms-song-item-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.ms-song-item-disabled:hover { background: transparent; }
.ms-song-item-disabled:active { background: transparent; }
.ms-song-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: var(--r-full);
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.3px;
}
.ms-song-badge-disabled {
  background: rgba(229, 72, 77, 0.12);
  color: #e5484d;
}
.ms-song-badge-fallback {
  background: rgba(255, 159, 28, 0.12);
  color: #ff9f1c;
}
.ms-song-num {
  flex-shrink: 0;
  width: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}
.ms-song-info { flex: 1; min-width: 0; }
.ms-song-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ms-song-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ms-song-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}
.ms-icon-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: var(--r-full);
  transition: background var(--dur-fast), color var(--dur-fast), transform var(--dur-fast) var(--ease-out);
}
.ms-icon-btn:hover { background: var(--surface); color: var(--text); }
.ms-icon-btn:active { transform: scale(0.88); }
/* 列表项爱心收藏激活态：实心红心 */
.ms-icon-btn.ms-song-fav.active {
  color: #fa5151;
}
.ms-icon-btn.ms-song-fav.active:hover {
  background: rgba(250, 81, 81, 0.08);
}

/* —— 加载 —— */
.ms-loading {
  text-align: center;
  padding: 32px;
  font-size: 13px;
  color: var(--text-tertiary);
}
.hidden { display: none !important; }

/* ============================================================
   播放器视图（网易云风格 flex 布局）
   结构：顶部导航 → 顶部区域(封面+歌名+操作行) → 歌词区(flex:1) → 底部区域(进度条+控制栏)
   ============================================================ */
.ms-player-shell { background: var(--bg); }

/* 空状态：无歌曲时占满主体区域 */
.ms-player-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-tertiary);
  text-align: center;
  gap: 12px;
}
.ms-player-empty p {
  font-size: 14px;
  margin: 0;
}

/* 播放器主体：flex column，撑满 shell 剩余空间 */
/* 网易云风格：紧凑布局，无顶部多余 padding，左右 16px 留白 */
.ms-player-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
  padding: 4px 16px 0;
  overflow: hidden;
}

/* 顶部区域：封面 + 歌曲信息 + 操作行（flex-shrink:0，不可压缩） */
.ms-player-top {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* —— 封面（黑胶唱片样式，圆形，播放时旋转） —— */
/* 真实黑胶效果：深色唱片底盘 + 同心圆纹路 + 中心圆形专辑封面 + 中心孔 */
.ms-cover-square-wrap {
  margin: 0 0 12px;
  display: flex;
  justify-content: center;
  padding: 0;
}
.ms-cover-square {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  position: relative;
  background: #0d0d0d;
  /* 黑胶纹路：同心圆细线 */
  background-image: repeating-radial-gradient(
    circle at center,
    transparent 0px,
    transparent 2px,
    rgba(255, 255, 255, 0.025) 2px,
    rgba(255, 255, 255, 0.025) 3px
  );
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.2),
    0 12px 40px rgba(0, 0, 0, 0.35),
    inset 0 0 24px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  transition: transform var(--dur-base) var(--ease-out);
}
/* 专辑封面：居中圆形，占唱片 72% */
.ms-cover-square .ms-cover-lg {
  width: 72%;
  height: 72%;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5), 0 0 12px rgba(0, 0, 0, 0.3);
}
.ms-cover-square .ms-cover-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  animation: none;
}
/* 占位符也居中圆形 */
.ms-cover-square .ms-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
/* 中心孔：黑胶唱片中心的圆孔 */
.ms-cover-square::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), inset 0 1px 3px rgba(0, 0, 0, 0.4);
  z-index: 3;
}
/* 播放时整个唱片旋转 */
.ms-cover-square.playing {
  animation: ms-rotate 24s linear infinite;
}
.ms-cover-square.playing img {
  animation: none;
}
@keyframes ms-rotate {
  to { transform: rotate(360deg); }
}

/* —— 歌曲信息（歌名大字 18px + 歌手·专辑 小字灰色 13px） —— */
.ms-player-song-info {
  width: 100%;
  text-align: center;
  margin-bottom: 12px;
  padding: 0 8px;
}
.ms-song-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  margin-bottom: 4px;
  padding: 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.ms-song-artist {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 0;
}

/* —— 歌词区域（flex:1 占据剩余空间，可滚动，当前行高亮居中） —— */
.ms-lyrics-wrap {
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  position: relative;
  margin: 4px 0 12px;
  /* 顶部和底部渐变蒙版，让上下歌词半透明渐隐（不用 backdrop-filter） */
  /* 扩大可见区域，让上下四句都能看到 */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
}
.ms-lyrics-inner {
  transition: transform 0.4s var(--ease-out);
  /* 上下留白用于让首尾歌词也能滚动到中心位置 */
  padding: 48px 16px;
  /* 让歌词行垂直居中 */
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
  box-sizing: border-box;
}
.ms-lyric-line {
  text-align: center;
  font-size: 14px;
  color: var(--text-tertiary);
  line-height: 2;
  transition: color var(--dur-base), font-size var(--dur-base), opacity var(--dur-base), transform var(--dur-base);
  opacity: 0.35;
  padding: 2px 0;
}
/* 当前行：高亮 + 居中放大 */
.ms-lyric-line.active {
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  opacity: 1;
  transform: scale(1.02);
}
/* 邻近行（上下各 4 行）：稍亮一点，其余行更淡 */
.ms-lyric-line.near {
  opacity: 0.7;
}
.ms-lyrics-empty {
  text-align: center;
  padding: 40px 0;
  color: var(--text-tertiary);
  font-size: 13px;
}

/* —— 播放器操作行（爱心喜欢 + 加入播放列表，位于歌词下方、进度条上方） —— */
.ms-player-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  width: 100%;
  padding: 8px 8px 4px;
  margin-bottom: 4px;
  flex-shrink: 0;
}
.ms-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 11px;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  transition: color var(--dur-fast), background var(--dur-fast), transform var(--dur-fast) var(--ease-out);
  min-width: 64px;
}
.ms-action-btn:hover { color: var(--text); background: var(--surface); }
.ms-action-btn:active { transform: scale(0.92); }
/* 收藏激活态：实心红心颜色（#fa5151 微信红，与网易云红心一致） */
.ms-action-btn.active {
  color: #fa5151;
}
.ms-action-btn.active:hover {
  color: #fa5151;
  background: rgba(250, 81, 81, 0.08);
}
/* 爱心按钮 SVG 大小一致 */
.ms-action-btn svg {
  display: block;
}

/* —— 底部区域：进度条 + 时间 + 控制栏（固定在底部） —— */
.ms-player-bottom {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--safe-area-bottom, env(safe-area-inset-bottom, 0px));
}

/* —— 进度条（细线，可拖拽） —— */
.ms-progress-wrap {
  width: 100%;
  padding: 0 8px;
  margin-bottom: 10px;
}
.ms-progress-bar {
  position: relative;
  height: 4px;
  background: var(--surface);
  border-radius: var(--r-full);
  cursor: pointer;
  margin-bottom: 6px;
}
.ms-progress-buffer,
.ms-progress-played {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  border-radius: var(--r-full);
  background: var(--accent);
  transition: width 0.1s linear;
}
.ms-progress-played {
  background: var(--accent-deep, var(--accent));
}
.ms-progress-thumb {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  /* 网易云风格：白底 + accent 描边的小圆点 */
  background: #ffffff;
  border: 2px solid var(--accent-deep, var(--accent));
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: left 0.1s linear, transform var(--dur-fast) var(--ease-out);
  box-shadow: var(--shadow-sm);
}
/* 进度条 hover/拖拽时圆点放大 */
.ms-progress-bar:hover .ms-progress-thumb,
.ms-progress-bar.dragging .ms-progress-thumb {
  transform: translate(-50%, -50%) scale(1.25);
}
.ms-time-display {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

/* —— 底部控制栏（模式 | 上一首 | 播放/暂停 | 下一首 | 列表） —— */
/* 网易云风格：5 个按钮均匀分布（space-around），不是 space-between */
.ms-controls {
  display: flex;
  align-items: center;
  justify-content: space-around;
  width: 100%;
  padding: 0 8px;
  margin-bottom: 8px;
}
.ms-ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: var(--r-full);
  transition: background var(--dur-fast), transform var(--dur-fast) var(--ease-out);
  flex-shrink: 0;
}
.ms-ctrl-btn:hover { background: var(--surface); }
.ms-ctrl-btn:active { transform: scale(0.9); }
/* 播放/暂停大号圆形按钮（网易云风格：accent 填充 + 阴影） */
.ms-ctrl-btn.ms-ctrl-play {
  width: 64px;
  height: 64px;
  background: var(--accent);
  color: var(--text-inverse);
  box-shadow: var(--shadow-md);
  transition: background var(--dur-fast), transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast);
}
.ms-ctrl-btn.ms-ctrl-play:hover {
  background: var(--accent-deep, var(--accent));
  box-shadow: var(--shadow-lg);
}
.ms-ctrl-btn.ms-ctrl-play:active {
  transform: scale(0.92);
}
/* 播放模式按钮（order/repeat/shuffle 激活时高亮） */
.ms-ctrl-mode { position: relative; }
.ms-ctrl-mode.mode-repeat,
.ms-ctrl-mode.mode-shuffle {
  color: var(--accent);
}
/* 单曲循环 / 随机播放 激活态背景 */
.ms-ctrl-mode.mode-repeat:hover,
.ms-ctrl-mode.mode-shuffle:hover {
  background: var(--accent-soft);
}

/* —— 和 char 一起听评论 —— */
.ms-char-comment {
  width: 100%;
  background: var(--bg-elevated);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 0.5px solid var(--border);
  animation: ms-fade-in 0.4s var(--ease-out);
}
@keyframes ms-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.ms-char-comment-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.ms-char-comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
}
.ms-char-comment-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.ms-char-comment-body {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.ms-comment-loading {
  color: var(--text-tertiary);
  font-style: italic;
  font-size: 13px;
}
.ms-comment-empty {
  color: var(--text-tertiary);
  font-size: 13px;
}

/* —— 播放列表抽屉（网易云风格底部抽屉 + 顶部小圆条抓手） —— */
.ms-queue-drawer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 60%;
  background: var(--bg-elevated);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  z-index: 100;
  animation: ms-slide-up 0.3s var(--ease-out);
  padding-bottom: var(--safe-area-bottom, env(safe-area-inset-bottom, 0px));
}
/* 顶部小圆条抓手 */
.ms-queue-drawer::before {
  content: '';
  display: block;
  width: 36px;
  height: 4px;
  background: var(--border-strong);
  border-radius: var(--r-full);
  margin: 8px auto 4px;
  flex-shrink: 0;
}
@keyframes ms-slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.ms-queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 14px;
  border-bottom: 0.5px solid var(--border);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
/* 头部左侧：标题 + 数量 */
.ms-queue-head-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.ms-queue-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.ms-queue-count {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}
/* 头部右侧：操作按钮组 */
.ms-queue-head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
/* 操作按钮：添加 / 清空 / 关闭（统一胶囊风格） */
.ms-queue-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--r-full);
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.ms-queue-action-btn:hover {
  background: var(--surface);
  color: var(--text);
}
/* 危险操作（清空）按钮：悬停时变红 */
.ms-queue-action-danger:hover {
  color: #e04848;
  background: rgba(224, 72, 72, 0.08);
}
.ms-queue-clear {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-tertiary);
  cursor: pointer;
}
.ms-queue-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 12px;
}
.ms-queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 0.5px solid var(--border);
  cursor: pointer;
  transition: background var(--dur-fast);
}
.ms-queue-item:hover { background: var(--surface); }
.ms-queue-item.active .ms-queue-name {
  color: var(--accent);
  font-weight: 500;
}
.ms-queue-num {
  width: 24px;
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.ms-queue-info { flex: 1; min-width: 0; }
.ms-queue-name {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ms-queue-artist {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}
/* 删除按钮：每首歌右侧的 ×，悬停时变红 */
.ms-queue-del {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  border-radius: var(--r-full);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.ms-queue-del:hover {
  background: rgba(224, 72, 72, 0.1);
  color: #e04848;
}
.ms-queue-del:active {
  transform: scale(0.9);
}

/* ============================================================
   歌单详情视图
   ============================================================ */
.ms-pl-header {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
  padding: 8px 4px;
}
.ms-pl-cover { flex-shrink: 0; }
.ms-pl-info { flex: 1; min-width: 0; }
.ms-pl-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  word-break: break-word;
}
.ms-pl-count {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}
.ms-pl-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ms-play-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: var(--text-inverse);
  border: none;
  border-radius: var(--r-full);
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 16px;
  transition: opacity var(--dur-fast), transform var(--dur-fast);
}
.ms-play-all:hover { opacity: 0.88; }
.ms-play-all:active { transform: scale(0.96); }

/* ============================================================
   歌单列表视图
   ============================================================ */
.ms-pl-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 4px 0;
}
.ms-pl-card {
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out);
}
.ms-pl-card:active { transform: scale(0.97); }
.ms-pl-card-cover {
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 8px;
  aspect-ratio: 1;
  background: var(--surface);
}
.ms-pl-card-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ms-pl-card-count {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* ============================================================
   底部操作菜单（歌曲菜单、歌单选择、角色选择共用）
   ============================================================ */
.ms-song-menu,
.ms-pl-picker,
.ms-char-picker,
.ms-share-menu {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.ms-song-menu-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background var(--dur-base);
}
/* Bug 3 修复：visible 状态规则必须同时匹配 .ms-song-menu / .ms-pl-picker / .ms-char-picker
   原来只写了 .ms-song-menu.visible，导致角色选择器和歌单选择器弹出时
   遮罩不变暗、sheet 不上滑，用户看不到面板 */
.ms-song-menu.visible .ms-song-menu-mask,
.ms-pl-picker.visible .ms-song-menu-mask,
.ms-char-picker.visible .ms-song-menu-mask,
.ms-share-menu.visible .ms-song-menu-mask {
  background: rgba(0, 0, 0, 0.4);
}
.ms-song-menu-sheet {
  position: relative;
  width: 100%;
  max-width: var(--phone-w);
  background: var(--bg-elevated);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 16px;
  padding-bottom: calc(16px + var(--safe-area-bottom, env(safe-area-inset-bottom, 0px)));
  transform: translateY(100%);
  transition: transform var(--dur-base) var(--ease-out);
  box-shadow: var(--shadow-lg);
}
/* Bug 3 修复：sheet 上滑动画也要覆盖所有底部菜单类型 */
.ms-song-menu.visible .ms-song-menu-sheet,
.ms-pl-picker.visible .ms-song-menu-sheet,
.ms-char-picker.visible .ms-song-menu-sheet,
.ms-share-menu.visible .ms-song-menu-sheet {
  transform: translateY(0);
}
.ms-song-menu-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 0.5px solid var(--border);
}
.ms-song-menu-info { flex: 1; min-width: 0; }
.ms-song-menu-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ms-song-menu-artist {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}
.ms-song-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ms-menu-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 10px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  border-radius: var(--r-sm);
  font-size: 14px;
  transition: background var(--dur-fast), transform var(--dur-fast);
  text-align: left;
  width: 100%;
}
.ms-menu-action:hover { background: var(--surface); }
.ms-menu-action:active { transform: scale(0.98); }
.ms-menu-action svg { flex-shrink: 0; }

.ms-sheet-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.ms-pl-picker-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 50vh;
  overflow-y: auto;
  margin-bottom: 8px;
}
.ms-pl-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 8px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  border-radius: var(--r-sm);
  font-size: 14px;
  transition: background var(--dur-fast);
}
.ms-pl-picker-item:hover { background: var(--surface); }
.ms-pl-picker-count {
  font-size: 12px;
  color: var(--text-tertiary);
}
.ms-pl-picker-create {
  width: 100%;
  padding: 12px;
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--r-sm);
  font-size: 14px;
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.ms-pl-picker-create:hover {
  background: var(--surface);
  color: var(--text);
}

.ms-char-picker-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 50vh;
  overflow-y: auto;
}
.ms-char-picker-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 8px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  border-radius: var(--r-sm);
  font-size: 14px;
  transition: background var(--dur-fast);
  text-align: left;
}
.ms-char-picker-item:hover { background: var(--surface); }
.ms-char-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
}
.ms-char-name {
  flex: 1;
  font-size: 14px;
}

/* ============================================================
   Mini Player（全局悬浮底部，只在音乐播放时显示）
   网易云风格：定位在手机壳底部，不覆盖顶部导航栏（返回键/设置）
   滑入动画：从底部滑出，避免遮挡任何顶部元素
   ============================================================ */
.ms-mini {
  position: fixed;
  /* 桌面端：手机壳居中于视口，bottom 设为手机壳底部位置 */
  bottom: calc(50vh - var(--phone-h, 760px) / 2);
  left: 50%;
  /* 隐藏：向下平移自身高度 + 一点余量，完全移出手机壳底部 */
  transform: translateX(-50%) translateY(calc(100% + 12px));
  width: var(--phone-w);
  height: 48px;
  background: var(--bg-elevated);
  border-top: 0.5px solid var(--border);
  /* 上沿阴影，模拟浮于内容之上 */
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
  z-index: 9999;
  opacity: 0;
  /* 隐藏时不拦截点击，避免遮住底层 tab 栏 */
  pointer-events: none;
  visibility: hidden;
  transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base), visibility 0s linear var(--dur-base);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ms-mini.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base), visibility 0s;
}
@media (max-width: 768px) {
  .ms-mini {
    /* 移动端：手机壳占满视口，bottom 设为安全区底部 */
    bottom: var(--safe-area-bottom, env(safe-area-inset-bottom, 0px));
    width: 100vw;
  }
}
.ms-mini-progress {
  height: 2px;
  background: var(--surface);
  flex-shrink: 0;
}
.ms-mini-progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0;
  transition: width 0.1s linear;
}
.ms-mini-body {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  cursor: pointer;
}
.ms-mini-cover {
  width: 32px;
  height: 32px;
  border-radius: var(--r-xs);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface);
}
.ms-mini-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ms-mini-info {
  flex: 1;
  min-width: 0;
}
.ms-mini-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ms-mini-artist {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.ms-mini-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  transition: background var(--dur-fast), transform var(--dur-fast);
  flex-shrink: 0;
}
.ms-mini-btn:hover { background: var(--surface); }
.ms-mini-btn:active { transform: scale(0.9); }

/* —— 响应式 —— */
@media (max-width: 480px) {
  /* 小屏下黑胶封面更小，留出更多歌词空间 */
  .ms-cover-square { width: 200px; height: 200px; }
  .ms-song-title { font-size: 17px; }
  .ms-section-title { font-size: 16px; }
  /* 小屏下控制按钮稍小，避免溢出 */
  .ms-ctrl-btn { width: 40px; height: 40px; }
  .ms-ctrl-btn.ms-ctrl-play { width: 56px; height: 56px; }
  .ms-controls { padding: 0 4px; }
  /* 小屏下歌词行间距稍小 */
  .ms-lyric-line { line-height: 1.8; padding: 1px 0; }
  .ms-lyrics-inner { padding: 32px 12px; }
  /* 小屏下封面 wrap margin 更紧凑 */
  .ms-cover-square-wrap { margin: 0 0 8px; }
}

/* ============================================================
   char 头像（异步加载 IDB 图片）
   ============================================================ */
.ms-char-avatar-img {
  background-color: var(--accent);
  color: var(--text-inverse);
  transition: background-image var(--dur-base);
}

/* ============================================================
   一起听模式 · 状态条（播放器内）
   ============================================================ */
.ms-listen-together-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: var(--bg-elevated);
  border: 0.5px solid var(--border);
  border-radius: var(--r-md);
  animation: ms-fade-in 0.4s var(--ease-out);
}
.ms-lt-avatars {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.ms-lt-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid var(--bg-elevated);
  position: relative;
}
.ms-lt-avatar + .ms-lt-avatar {
  margin-left: -10px;
}
.ms-lt-avatar-char { background: var(--accent-soft); }
.ms-lt-info {
  flex: 1;
  min-width: 0;
}
.ms-lt-status {
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
}
.ms-lt-duration {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.ms-lt-close {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  border-radius: var(--r-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--dur-fast), color var(--dur-fast), transform var(--dur-fast) var(--ease-out);
}
.ms-lt-close:hover { background: var(--surface); color: var(--danger); }
.ms-lt-close:active { transform: scale(0.88); background: rgba(229, 72, 77, 0.12); color: var(--danger); }

/* —— 播放器顶部一起听头像栏（大头像居中 + 音乐图标连接 + 时长在下） —— */
.ms-player-lt-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 6px;
  flex-shrink: 0;
  animation: ms-fade-in 0.4s var(--ease-out);
}
.ms-lt-header-avatars {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.ms-lt-header-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border: 3px solid var(--bg);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: transform var(--dur-base) var(--ease-out);
  position: relative;
}
.ms-lt-header-avatar + .ms-lt-header-avatar {
  margin-left: -16px;
}
.ms-lt-header-avatar:hover { transform: scale(1.05); }
.ms-lt-header-avatar-char { background: var(--accent-soft); }
.ms-lt-header-duration {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
  flex: 1;
  text-align: center;
}
.ms-lt-header-end {
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.ms-lt-header-end:hover {
  background: rgba(229, 72, 77, 0.15);
  color: #e5484d;
  transform: scale(1.05);
}
.ms-lt-header-end:active {
  transform: scale(0.92);
  background: rgba(229, 72, 77, 0.2);
}

/* ============================================================
   邀请卡片（接受/拒绝时显示）
   ============================================================ */
.ms-invite-card {
  width: 100%;
  margin-bottom: 16px;
  animation: ms-fade-in 0.4s var(--ease-out);
}
.ms-invite-card-inner {
  background: var(--bg-elevated);
  border: 0.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.ms-invite-cover {
  flex-shrink: 0;
}
.ms-invite-info {
  flex: 1;
  min-width: 0;
}
.ms-invite-title {
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.ms-invite-song {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ms-invite-artist {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.ms-invite-char {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}
.ms-invite-msg {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}
.ms-invite-reply {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 0.5px solid var(--border);
}
.ms-invite-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--r-full);
}
.ms-invite-status.accept {
  background: rgba(82, 196, 26, 0.12);
  color: var(--success);
}
.ms-invite-status.reject {
  background: rgba(224, 72, 72, 0.12);
  color: var(--danger);
}
.ms-invite-comment {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
}

/* ============================================================
   评论区 · 时间线
   ============================================================ */
.ms-cmt-song-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 12px;
  background: var(--bg-elevated);
  border-radius: var(--r-md);
  margin-bottom: 16px;
}
.ms-cmt-song-info {
  flex: 1;
  min-width: 0;
}
.ms-cmt-song-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ms-cmt-song-artist {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}
.ms-cmt-add-wrap {
  margin-bottom: 20px;
}
.ms-cmt-add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 12px;
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--r-md);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.ms-cmt-add-btn:hover {
  background: var(--surface);
  color: var(--text);
}
.ms-cmt-timeline {
  padding: 0 4px;
}
.ms-cmt-item {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  animation: ms-fade-in 0.3s var(--ease-out);
}
.ms-cmt-avatar {
  flex-shrink: 0;
}
.ms-cmt-bubble {
  flex: 1;
  min-width: 0;
  background: var(--bg-elevated);
  border-radius: 4px var(--r-md) var(--r-md) var(--r-md);
  padding: 10px 14px;
  border: 0.5px solid var(--border);
}
.ms-cmt-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.ms-cmt-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  word-wrap: break-word;
}
.ms-cmt-time {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 6px;
}
.ms-cmt-loading-item .ms-cmt-text {
  color: var(--text-tertiary);
  font-style: italic;
}

/* ============================================================
   听歌报告
   ============================================================ */
.ms-report-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}
.ms-report-stat {
  flex: 1;
  background: var(--bg-elevated);
  border: 0.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  text-align: center;
}
.ms-report-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}
.ms-report-label {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
}
.ms-report-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 0.5px solid var(--border);
  border-radius: var(--r-sm);
  margin-bottom: 6px;
}
.ms-report-row-name {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}
.ms-report-row-count {
  font-size: 12px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

/* —— 听歌次数榜排名项 —— */
.ms-rank-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}
.ms-rank-item:hover { background: var(--surface); }
.ms-rank-item:active { background: var(--surface-hover); }
.ms-rank-num {
  width: 24px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-tertiary);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.ms-rank-num.ms-rank-top {
  color: var(--accent);
  font-size: 16px;
}
.ms-rank-count {
  font-size: 12px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  white-space: nowrap;
}
.ms-report-hours {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 100px;
  padding: 12px 8px 24px;
  background: var(--bg-elevated);
  border: 0.5px solid var(--border);
  border-radius: var(--r-md);
  position: relative;
}
.ms-hour-bar {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  position: relative;
  min-width: 0;
}
.ms-hour-fill {
  width: 100%;
  background: var(--surface);
  border-radius: 2px 2px 0 0;
  transition: height var(--dur-base) var(--ease-out), background var(--dur-fast);
  min-height: 2px;
}
.ms-hour-bar.active .ms-hour-fill {
  background: var(--accent);
}
.ms-hour-label {
  position: absolute;
  bottom: -18px;
  font-size: 9px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   相似推荐区
   ============================================================ */
.ms-similar-section {
  width: 100%;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg-elevated);
  border: 0.5px solid var(--border);
  border-radius: var(--r-md);
  animation: ms-fade-in 0.3s var(--ease-out);
}
.ms-similar-list .ms-song-item {
  padding: 8px 4px;
}
.ms-similar-list .ms-song-item:last-child {
  border-bottom: none;
}

/* ============================================================
   更多抽屉（睡眠定时 / 音质选择 共用 .ms-queue-drawer 样式）
   网易云风格：底部抽屉 + 顶部小圆条抓手
   ============================================================ */
.ms-more-drawer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 60%;
  background: var(--bg-elevated);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  z-index: 100;
  animation: ms-slide-up 0.3s var(--ease-out);
  padding-bottom: var(--safe-area-bottom, env(safe-area-inset-bottom, 0px));
}
/* 顶部小圆条抓手（网易云风格） */
.ms-more-drawer::before {
  content: '';
  display: block;
  width: 36px;
  height: 4px;
  background: var(--border-strong);
  border-radius: var(--r-full);
  margin: 8px auto 4px;
  flex-shrink: 0;
}
.ms-more-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 12px 16px;
  -webkit-overflow-scrolling: touch;
}
.ms-more-body .ms-menu-action {
  justify-content: flex-start;
  padding: 14px 12px;
  font-size: 15px;
  border-radius: var(--r-sm);
}
.ms-more-body .ms-menu-action svg {
  flex-shrink: 0;
  color: var(--text-secondary);
}
.ms-more-body .ms-menu-action.active {
  color: var(--accent);
  background: var(--surface);
}
.ms-more-body .ms-menu-action.active svg {
  color: var(--accent);
}

/* 睡眠定时器选项 */
.ms-sleep-current {
  padding: 12px;
  margin-bottom: 8px;
  background: var(--surface);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
}
.ms-sleep-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* 音质选项 */
.ms-quality-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ms-quality-options .ms-menu-action {
  justify-content: space-between;
  align-items: center;
}
.ms-quality-desc {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* ============================================================
   Mini Player 一起听模式
   ============================================================ */
.ms-mini.ms-mini-lt-active .ms-mini-body {
  /* 一起听模式下，常规 mini body 隐藏，显示 lt bar */
  display: none;
}
.ms-mini-lt {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  cursor: pointer;
  animation: ms-fade-in 0.3s var(--ease-out);
}
.ms-mini-lt-avatars {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.ms-mini-lt-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid var(--bg-elevated);
  position: relative;
}
.ms-mini-lt-avatar + .ms-mini-lt-avatar {
  margin-left: -10px;
}
.ms-mini-lt-info {
  flex: 1;
  min-width: 0;
}
.ms-mini-lt-status {
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.3px;
}
.ms-mini-lt-duration {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.ms-mini-lt-close {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  flex-shrink: 0;
  transition: color var(--dur-fast);
}
.ms-mini-lt-close:hover { color: var(--danger); }

/* —— 搜索结果 + 按钮 hover 显示更明显 —— */
.ms-song-add:hover {
  color: var(--accent);
  background: var(--surface-hover);
}

/* ============================================================
   Bug 4：分享菜单 + 歌曲卡片样式
   ============================================================ */

/* 分享菜单顶部歌曲卡片预览 */
.ms-share-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 12px;
  background: var(--surface);
  border-radius: var(--r-md);
  /* 圆角浅色背景，模拟歌曲卡片 */
}
.ms-share-preview .ms-cover-sm {
  width: 48px;
  height: 48px;
  border-radius: var(--r-xs);
  flex-shrink: 0;
}
.ms-share-preview-info {
  flex: 1;
  min-width: 0;
}
.ms-share-preview-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ms-share-preview-artist {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ms-share-preview-source {
  font-size: 10px;
  color: var(--text-tertiary);
  flex-shrink: 0;
  padding: 2px 6px;
  background: var(--bg);
  border-radius: var(--r-xs);
}

/* 分享菜单两个操作按钮 */
.ms-share-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ms-share-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 10px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  border-radius: var(--r-sm);
  font-size: 14px;
  transition: background var(--dur-fast);
  text-align: left;
}
.ms-share-action:hover { background: var(--surface); }
.ms-share-action:active { transform: scale(0.98); }
.ms-share-action svg {
  flex-shrink: 0;
  color: var(--text-secondary);
}

/* ============================================================
   Bug 4：微信聊天中的歌曲分享卡片
   wechat.js 渲染 type='music-share' 消息时使用此样式
   ============================================================ */
.msg-music-share-card {
  width: 220px;
  padding: 10px;
  background: var(--surface);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background var(--dur-fast);
}
.msg-music-share-card:active { background: var(--surface-hover); }
.msg-music-share-cover {
  width: 48px;
  height: 48px;
  border-radius: var(--r-xs);
  background: var(--bg);
  overflow: hidden;
  flex-shrink: 0;
}
.msg-music-share-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.msg-music-share-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
}
.msg-music-share-info {
  flex: 1;
  min-width: 0;
}
.msg-music-share-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-music-share-artist {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-music-share-source {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================================
   Bug 1：微信聊天中的"一起听邀请"卡片
   wechat.js 渲染 type='music-invite' 消息时使用此样式
   与 music-share 区分：底部有"邀请你一起听"标识，无来源标签
   圆角浅色背景，封面正方形 48px
   ============================================================ */
.msg-music-invite-card {
  width: 220px;
  padding: 10px;
  background: var(--surface);
  border-radius: var(--r-sm);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  transition: background var(--dur-fast);
}
.msg-music-invite-card:active { background: var(--surface-hover); }
.msg-music-invite-cover {
  width: 48px;
  height: 48px;
  border-radius: var(--r-xs);
  background: var(--bg);
  overflow: hidden;
  flex-shrink: 0;
}
.msg-music-invite-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.msg-music-invite-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
}
.msg-music-invite-info {
  flex: 1;
  min-width: 0;
}
.msg-music-invite-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-music-invite-artist {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-music-invite-footer {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================================
   一起听邀请回复按钮（同意 / 拒绝）
   精致卡片风格：圆角胶囊按钮 + 渐变背景 + 清晰的状态反馈
   ============================================================ */
.msg-invite-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.msg-invite-btn {
  flex: 1;
  padding: 9px 14px;
  border: none;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  letter-spacing: 0.3px;
}
.msg-invite-btn:active {
  transform: scale(0.96);
}
/* 同意按钮：主色填充 */
.msg-invite-btn.accept {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.msg-invite-btn.accept:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  filter: brightness(1.05);
}
/* 拒绝按钮：浅色描边 */
.msg-invite-btn.reject {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}
.msg-invite-btn.reject:hover {
  background: var(--surface-hover);
  color: var(--text);
}
/* 已处理状态：隐藏未选中的按钮，选中的按钮变为静态标签 */
.msg-invite-actions.resolved .msg-invite-btn {
  display: none;
}
.msg-invite-actions.resolved .msg-invite-btn.chosen {
  display: inline-flex;
  cursor: default;
  opacity: 1;
  pointer-events: none;
}
.msg-invite-actions.resolved .msg-invite-btn.chosen.accept {
  background: var(--success);
  color: #fff;
  box-shadow: none;
}
.msg-invite-actions.resolved .msg-invite-btn.chosen.reject {
  background: var(--surface-hover);
  color: var(--text-tertiary);
  border-color: var(--border);
}
.msg-invite-actions-resolved {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  background: var(--surface);
  border-radius: var(--r-sm);
}

/* ============================================================
   一起听结束卡片 — 全宽沉浸式设计
   不使用气泡包裹，直接作为全宽卡片渲染
   ============================================================ */
/* 气泡容器对 music-lt-end 透明化：去除背景、边框、圆角、内边距 */
.bubble-music-lt-end {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  max-width: 100% !important;
  width: 100% !important;
}
.bubble-music-lt-end::before,
.bubble-music-lt-end::after {
  display: none !important;
}
/* 消息行也对 music-lt-end 全宽 */
.message-row:has(.bubble-music-lt-end) {
  padding-left: 0 !important;
  padding-right: 0 !important;
}
.message-row:has(.bubble-music-lt-end) .message-col {
  width: 100% !important;
  max-width: 100% !important;
}

/* 卡片主体 */
.lt-end-card {
  position: relative;
  width: 100%;
  padding: 12px 14px 10px;
  background: linear-gradient(160deg, var(--surface) 0%, var(--bg-elevated) 60%, var(--surface) 100%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* 背景装饰 */
.lt-end-bg-deco {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
}
.lt-end-deco-1 {
  position: absolute;
  top: -20px;
  right: -20px;
  color: var(--accent);
}
.lt-end-deco-2 {
  position: absolute;
  bottom: -15px;
  left: -10px;
  color: var(--accent);
}

/* 顶部：头像组 + 标签 */
.lt-end-top {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}
.lt-end-avatars {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.lt-end-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid var(--bg-elevated);
  background-size: cover;
  background-position: center;
  box-shadow: 0 1px 6px rgba(0,0,0,0.1);
  position: relative;
  z-index: 1;
}
.lt-end-avatar.lt-end-avatar-char {
  margin-left: -12px;
  z-index: 2;
}
.lt-end-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.3px;
}

/* 时长行 */
.lt-end-duration-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-secondary);
  position: relative;
  z-index: 1;
  font-variant-numeric: tabular-nums;
}
.lt-end-duration-row svg {
  color: var(--accent);
  flex-shrink: 0;
}
.lt-end-duration-text {
  font-weight: 600;
  color: var(--text);
}
.lt-end-dot {
  color: var(--text-tertiary);
  margin: 0 2px;
}
.lt-end-count {
  color: var(--text-tertiary);
}

/* 常听榜单 */
.lt-end-songs {
  position: relative;
  z-index: 1;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: var(--r-sm);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.lt-end-songs-header {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 1px;
}
.lt-end-songs-header svg {
  color: var(--accent);
}
.lt-end-song-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lt-end-song-rank {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
.lt-end-song-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}
.lt-end-song-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lt-end-song-sub {
  font-size: 10px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 底部 */
.lt-end-footer {
  font-size: 11px;
  color: var(--text-tertiary);
  text-align: center;
  position: relative;
  z-index: 1;
  padding-top: 2px;
}
/* 减少 music-lt-end 消息行内气泡与时间戳的间距 */
.message-row:has(.bubble-music-lt-end) .message-col {
  gap: 2px !important;
}

/* ============================================================
   Bug 4：朋友圈中的歌曲分享卡片
   moments.js 渲染 post.songInfo 时使用此样式
   ============================================================ */
.moment-song-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin: 8px 0;
  background: var(--surface);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--dur-fast);
  /* 圆角浅色背景，与微信朋友圈链接卡片一致 */
}
.moment-song-card:active { background: var(--surface-hover); }
.moment-song-cover {
  width: 48px;
  height: 48px;
  border-radius: var(--r-xs);
  background: var(--bg);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
}
.moment-song-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.moment-song-info {
  flex: 1;
  min-width: 0;
}
.moment-song-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.moment-song-artist {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.moment-song-source {
  font-size: 10px;
  color: var(--text-tertiary);
  flex-shrink: 0;
  padding: 2px 6px;
  background: var(--bg);
  border-radius: var(--r-xs);
}

/* ============================================================
   底部 Tab 栏（首页 / 我的）
   ============================================================ */
.ms-tabbar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--bg-glass);
  border-top: 0.5px solid var(--border);
  padding: 6px 0 calc(6px + var(--safe-area-bottom, env(safe-area-inset-bottom, 0px)));
  flex-shrink: 0;
  z-index: 100;
}
.ms-tabbar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 0;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color var(--dur-fast);
  -webkit-tap-highlight-color: transparent;
}
.ms-tabbar-item:active { transform: scale(0.92); }
.ms-tabbar-item span {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2px;
}
.ms-tabbar-item.active {
  color: var(--accent);
}
.ms-tabbar-item.active span { font-weight: 600; }

/* 带 tab 栏的滚动区：增加底部留白 */
.ms-scroll-with-tabbar { padding-bottom: 8px; }
.ms-bottom-pad-tabbar { height: 140px; }

/* mini player 在带 tab 栏页面时上移，避开 tab 栏 */
.ms-mini.ms-mini-with-tabbar {
  bottom: calc(50vh - var(--phone-h, 760px) / 2 + 56px);
}
@media (max-width: 768px) {
  .ms-mini.ms-mini-with-tabbar {
    bottom: calc(var(--safe-area-bottom, env(safe-area-inset-bottom, 0px)) + 56px);
  }
}

/* ============================================================
   我的页面（网易云风格个人主页）
   ============================================================ */
.ms-my-shell { background: var(--bg); }

.ms-my-header {
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
}
.ms-my-header-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: var(--accent);
}
.ms-my-header-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.35) 100%);
}
.ms-nav-transparent {
  background: transparent !important;
  border-bottom: none !important;
  position: relative;
  z-index: 2;
}
.ms-nav-transparent .ms-nav-btn,
.ms-nav-transparent .ms-nav-title {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.ms-my-header-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 20px 28px;
  color: #fff;
}
.ms-my-avatar {
  border: 3px solid rgba(255,255,255,0.4);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.ms-my-name {
  font-size: 19px;
  font-weight: 600;
  margin-top: 12px;
  letter-spacing: -0.3px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.ms-my-id {
  font-size: 11px;
  opacity: 0.8;
  margin-top: 4px;
  letter-spacing: 0.3px;
}
.ms-my-edit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  padding: 5px 14px;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: var(--r-full);
  cursor: pointer;
  transition: background var(--dur-fast), transform var(--dur-fast);
  background: rgba(255,255,255,0.1);
}
.ms-my-edit:active { transform: scale(0.94); }
.ms-my-edit:hover { background: rgba(255,255,255,0.2); }

/* 统计区 */
.ms-my-stats {
  display: flex;
  justify-content: space-around;
  padding: 18px 12px 14px;
  border-bottom: 0.5px solid var(--border);
  background: var(--bg-elevated);
}
.ms-my-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: transform var(--dur-fast);
  -webkit-tap-highlight-color: transparent;
}
.ms-my-stat:active { transform: scale(0.92); }
.ms-my-stat-num {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
}
.ms-my-stat-label {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* 歌单列表 */
.ms-my-pl-list { display: flex; flex-direction: column; }
.ms-my-pl-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 0.5px solid var(--border);
  cursor: pointer;
  transition: background var(--dur-fast);
}
.ms-my-pl-item:hover { background: var(--surface); }
.ms-my-pl-item:active { background: var(--surface-hover); }
.ms-my-pl-info { flex: 1; min-width: 0; }
.ms-my-pl-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ms-my-pl-count {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* 最近播放 */
.ms-my-history { display: flex; flex-direction: column; }
.ms-my-hist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 0.5px solid var(--border);
  cursor: pointer;
  transition: background var(--dur-fast);
}
.ms-my-hist-item:hover { background: var(--surface); }
.ms-my-hist-item:active { background: var(--surface-hover); }
.ms-my-hist-info { flex: 1; min-width: 0; }
.ms-my-hist-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ms-my-hist-artist {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* —— 好友列表 —— */
.ms-friends-list { display: flex; flex-direction: column; }
.ms-friend-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 0.5px solid var(--border);
  cursor: pointer;
  transition: background var(--dur-fast);
}
.ms-friend-item:hover { background: var(--surface); }
.ms-friend-item:active { background: var(--surface-hover); }
.ms-friend-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}
.ms-friend-info { flex: 1; min-width: 0; }
.ms-friend-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ms-friend-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   音乐设置页面
   ============================================================ */
.ms-settings-card {
  background: var(--bg-elevated);
  border-radius: var(--r-md);
  border: 0.5px solid var(--border);
  overflow: hidden;
}
.ms-settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 0.5px solid var(--border);
}
.ms-settings-row:last-child { border-bottom: none; }
.ms-settings-row-col {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.ms-settings-row-info { flex: 1; min-width: 0; }
.ms-settings-row-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.ms-settings-row-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 3px;
  line-height: 1.4;
}
.ms-settings-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.btn-sm {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: var(--r-full);
}

/* CSS 编辑器 */
.ms-css-editor {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  border: 0.5px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--text);
  font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', monospace;
  font-size: 12px;
  line-height: 1.6;
  padding: 10px 12px;
  outline: none;
  transition: border-color var(--dur-fast);
}
.ms-css-editor:focus { border-color: var(--accent); }
.ms-css-editor::placeholder { color: var(--text-tertiary); }

/* 预设主题 */
.ms-theme-presets {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0 8px;
  scrollbar-width: none;
}
.ms-theme-presets::-webkit-scrollbar { display: none; }
.ms-theme-preset {
  flex-shrink: 0;
  min-width: 84px;
  height: 84px;
  border-radius: var(--r-sm);
  border: 0.5px solid var(--border);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--dur-fast), border-color var(--dur-fast);
  -webkit-tap-highlight-color: transparent;
}
.ms-theme-preset:active { transform: scale(0.94); }
.ms-theme-preset:hover { border-color: var(--accent); }
.ms-theme-preset-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  text-align: center;
  padding: 0 8px;
}

/* ============================================================
   编辑资料弹窗
   ============================================================ */
.ms-profile-modal { max-width: 360px; }
.ms-profile-edit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.ms-profile-edit-label {
  width: 56px;
  flex-shrink: 0;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}
.ms-profile-edit-avatar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ms-profile-edit-actions {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ============================================================
   播放器详情页背景图支持（通过 CSS 变量 --ms-player-bg）
   --ms-player-bg 值为 url("...") 格式或未设置
   ============================================================ */
.ms-player-shell {
  background-color: var(--bg);
  background-image: var(--ms-player-bg, none);
  background-size: cover;
  background-position: center;
}

/* 一起听背景图支持（通过 CSS 变量 --ms-lt-bg，回退到 --ms-player-bg） */
.ms-lt-section {
  background-image: var(--ms-lt-bg, var(--ms-player-bg, none));
  background-size: cover;
  background-position: center;
}
/* ============================================================
   v360: 恢复小红书链接卡片等被 v352 线删掉的样式（9 块，从 v484 移植）
   ============================================================ */
.msg-rednote-link-wrapper {
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.msg-rednote-link-card {
  width: 240px;
  max-width: 80vw;
  display: flex;
  gap: 10px;
  padding: 10px;
  background: var(--bg-elevated);
  border-radius: var(--r-md);
  border: 0.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: background var(--dur-fast), transform var(--dur-fast);
}

.msg-rednote-link-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--r-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg);
}

.msg-rednote-cover {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

.msg-rednote-cover-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #ff2442 0%, #ff5577 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.7);
}

.msg-rednote-link-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
}

.msg-rednote-link-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.msg-rednote-link-desc {
  font-size: 11px;
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-rednote-link-author { color: var(--text-secondary); }
.msg-rednote-link-source {
  font-size: 10px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
