/* elysiamusic.css - Elysia Liquid Glass Player (Apple Music Style & Fixed Alignment & A/B Integrated) */

/* =========================================
   1. 基础容器
   ========================================= */
.elysia-player {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  width: 332px; 
  height: 50px; 
  perspective: 1000px;
  background: transparent;
  animation: elysiaFloat 6s ease-in-out infinite;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* =========================================
   2. 3D 骨架
   ========================================= */
.player-glass-card {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.elysia-player.flipped .player-glass-card {
  transform: rotateX(180deg);
}

.elysia-player:active .player-glass-card {
  transform: scale(0.98);
}
.elysia-player.flipped:active .player-glass-card {
  transform: rotateX(180deg) scale(0.98);
}

/* =========================================
   3. 前后两面 (Face Layout)
   ========================================= */
.player-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 20px;
  
  border-radius: 16px;

  /* 基础颜色提升到 0.08，高光保持 0.35 */
  background: linear-gradient(120deg, 
      rgba(255,255,255,0.08) 0%,   
      rgba(255,255,255,0.08) 35%,  
      rgba(255,255,255,0.35) 50%,  
      rgba(255,255,255,0.08) 65%,  
      rgba(255,255,255,0.08) 100%
  );
  background-size: 250% 250%;   
  background-position: 0% 0%;   
  
  transition: background-position 0.6s ease; 

  border: 1px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(150,110,240,0.25), inset 0 1px 0 rgba(255,255,255,0.08);

  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  z-index: 1; 
}

.elysia-player.flipped .player-face {
  background-position: 100% 100%;
}


/* --- 正面 (Front) --- */
.face-front {
  transform: rotateX(0deg);
  justify-content: flex-start; 
  pointer-events: auto;
}

/* --- 背面 (Back) --- */
.face-back {
  transform: rotateX(180deg);
  justify-content: flex-start; 
  pointer-events: auto;
}

.elysia-player.flipped .face-front { pointer-events: none !important; }
.elysia-player.flipped .face-back { pointer-events: auto !important; }

/* 内部流动的液态光斑 */
.player-glass-card::before {
  content: "";
  position: absolute;
  inset: -30%;
  background:
    radial-gradient(40% 40% at 10% 30%, rgba(156,107,255,0.35), transparent 20%),
    radial-gradient(30% 30% at 70% 20%, rgba(180,120,255,0.25), transparent 18%),
    radial-gradient(35% 35% at 40% 70%, rgba(140,200,255,0.18), transparent 22%);
  filter: blur(36px);
  opacity: 0.9;
  animation: moveBlobs 14s ease-in-out infinite;
  pointer-events: none;
  mix-blend-mode: screen;
  transform: translateZ(-10px); 
  z-index: -1; 
}

/* =========================================
   4. 控件按钮 (Apple Music Style)
   ========================================= */
.elysia-controls { 
  display: flex; 
  gap: 12px; 
  flex-shrink: 0; 
  align-items: center;
}

.elysia-controls button,
.control-btn {
  width: 34px; 
  height: 34px; 
  border-radius: 50%;
  
  /* 磨砂玻璃风格 */
  background: rgba(255, 255, 255, 0.1); 
  border: none; 
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15);
  
  color: #cdbaff; 
  cursor: pointer; 
  transition: all .2s cubic-bezier(0.25, 0.8, 0.25, 1); 
  backdrop-filter: blur(8px);
  
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  -webkit-appearance: none;
  outline: none;
}

/* SVG 图标通用样式 */
.elysia-controls button svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
  fill: currentColor; 
  transition: transform 0.2s;
}

/* 播放按钮视觉修正 */
#playPauseBtn:not(.playing) svg {
  margin-left: 2px;
}

/* 悬停效果 */
.elysia-controls button:hover,
.control-btn:hover { 
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05); 
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.3);
}

/* 点击按压效果 */
.elysia-controls button:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.08);
}

/* --- [修改重点] 爱心激活样式 --- */
#heartBtn.liked {
  color: #ff6b81; /* 仅改变图标颜色为粉色 */
  
  /* 移除了背景色和边框色的覆盖，让它保持默认的磨砂玻璃背景 */
  
  animation: heartPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes heartPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1.05); }
}

/* --- 统一标题样式 --- */
#songTitle,
#playlistTitleBtn {
  color: #cdbaff; 
  font-weight: 600; 
  width: 200px; 
  font-size: 0.95rem;
  text-align: left; 
  text-shadow: none;
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis; 
  cursor: pointer;
  transition: color 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#playlistTitleBtn:hover, #songTitle:hover {
  color: #cdbaff;
  text-shadow: none;
}


/* =========================================
   5. 播放列表 & 歌单菜单
   ========================================= */
.elysia-playlist {
  position: fixed;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%) scale(0.98);
  transform-origin: 50% 100%;
  width: 260px;
  max-height: 260px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255,240,255,0.25);
  border: 1px solid rgba(255,210,255,0.35);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  box-shadow: 0 8px 24px rgba(200,160,255,0.25), inset 0 1px 0 rgba(255,255,255,0.2);
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: pan-y;
  overscroll-behavior-x: none;
  opacity: 0; 
  pointer-events: none;
  z-index: 9998;
  scrollbar-width: thin;
  will-change: transform, opacity;
}

.playlist-item {
  padding: 6px 10px;
  color: #cdbaff; 
  font-size: 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  outline: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-item:hover {
  background: rgba(160, 120, 255, 0.15);
  color: #ffffff;
}

.playlist-item.active {
  background: rgba(160, 120, 255, 0.25);
  color: #fff;
  box-shadow: 0 0 12px rgba(160, 120, 255, 0.6);
  animation: softPulse 3s ease-in-out infinite;
}

.elysia-playlist::after {
  content: ""; 
  position: absolute; 
  inset: 0; 
  border-radius: 16px;
  background: radial-gradient(circle at 50% 30%, rgba(220,190,255,0.45), rgba(200,160,255,0.18) 45%, transparent 65%);
  opacity: 0; 
  transform: scale(0.8); 
  pointer-events: none; 
  transition: opacity .6s ease, transform .6s ease;
  z-index: -1;
}

.elysia-playlist.show::after { opacity: 1; transform: scale(1.35); }
.elysia-playlist.hide::after { opacity: 0; transform: scale(0.6); }

/* =========================================
   6. 动画
   ========================================= */
.elysia-playlist.show {
  opacity: 1; 
  pointer-events: auto;
  animation: dockBounceOpen 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  transform-origin: 50% 100%;
}
.elysia-playlist.hide {
  animation: dockBounceClose 0.4s cubic-bezier(0.3, 0, 0.7, 0.3) both;
  transform-origin: 50% 100%;
}
@keyframes dockBounceOpen {
  0%   { transform: translateX(-50%) scale(0.9) translateY(10px); opacity: 0; }
  60%  { transform: translateX(-50%) scale(1.02) translateY(-2px); opacity: 1; }
  100% { transform: translateX(-50%) scale(1) translateY(0); }
}
@keyframes dockBounceClose {
  0%   { transform: translateX(-50%) scale(1); opacity: 1; }
  35%  { transform: translateX(-50%) scale(1.02); }
  100% { transform: translateX(-50%) scale(0.8) translateY(10px); opacity: 0; }
}
@keyframes moveBlobs { 
  0%,100%{transform:translate3d(0,0,0) scale(1.03);} 
  50%{transform:translate3d(4%,-3%,0) scale(1.05);} 
}
@keyframes softPulse { 
  0%,100%{box-shadow:0 0 10px rgba(160,120,255,0.4);} 
  50%{box-shadow:0 0 18px rgba(160,120,255,0.8);} 
}
@keyframes elysiaFloat {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-6px); }
}

/* =========================================
   7. Plan A: 底部极简进度条 (Apple Minimalist)
   ========================================= */
.elysia-progress-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px; 
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  z-index: 20;
  transition: height 0.2s ease;
  border-radius: 0 0 16px 16px; 
  overflow: hidden; 
}

.elysia-progress-container:hover {
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
}

.elysia-progress-bar {
  height: 100%;
  width: 0%; 
  background: linear-gradient(90deg, #b48eff, #ff9eb5); 
  box-shadow: 0 0 8px rgba(180, 142, 255, 0.8);
  border-radius: 0 2px 2px 0;
  position: relative;
  transition: width 0.1s linear; 
}

.elysia-progress-bar::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 6px #fff, 0 0 10px #ff9eb5;
  opacity: 0;
  transition: opacity 0.2s;
}

.elysia-progress-container:hover .elysia-progress-bar::after {
  opacity: 1;
}

/* =========================================
   8. Plan B: 增强功能整合
   ========================================= */
.scroll-text-mask {
  width: 200px; 
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(90deg, transparent 0%, #000 5%, #000 95%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 5%, #000 95%, transparent 100%);
}

.scroll-text-inner {
  display: inline-block;
  white-space: nowrap;
  padding-left: 0;
  animation: none;
}

.scroll-text-inner.scrolling {
  padding-left: 100%; 
  animation: elysiaMarquee 10s linear infinite;
}

@keyframes elysiaMarquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

.elysia-playlist::-webkit-scrollbar {
  width: 4px;
}
.elysia-playlist::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
}
.elysia-playlist::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.25);
  border-radius: 4px;
}
.elysia-playlist::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.4);
}

#songTitle, #playlistTitleBtn {
  line-height: 1.2; 
  display: flex;
  align-items: center;
}
