/* 基础样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 顶部区域透明 - 隐藏alist自带的顶部 */
.header {
  background-color: transparent !important;
  background-image: none !important;
  border: none !important;
  box-shadow: none !important;
}
.nav {
  background-color: transparent !important;
  background-image: none !important;
}
.hope-stack {
  background-color: transparent !important;
  background-image: none !important;
}

/* 基础背景样式 - 加载期间显示纯色背景防止白屏 */
body {
  min-height: 100vh;
  background-color: #f0f0f0; /* 浅灰色背景 */
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
}

/* 加载层 - 覆盖整个屏幕 */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  background: linear-gradient(45deg, 
    rgba(255, 179, 186, 1), 
    rgba(255, 204, 153, 1), 
    rgba(255, 255, 153, 1), 
    rgba(186, 255, 186, 1), 
    rgba(179, 204, 255, 1), 
    rgba(204, 179, 255, 1), 
    rgba(255, 179, 255, 1)
  );
  background-size: 400% 400%;
  animation: smoothRainbowFlow 15s ease infinite;
  transition: opacity 1.5s ease;
}

/* 真正平滑的彩虹流动动画 */
@keyframes smoothRainbowFlow {
  0% { background-position: 0% 0%; }
  25% { background-position: 100% 0%; }
  50% { background-position: 100% 100%; }
  75% { background-position: 0% 100%; }
  100% { background-position: 0% 0%; }
}

/* 加载文字样式 */
#loading-text {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  font-weight: bold;
  color: white;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  transition: opacity 1.5s ease;
}

/* 进度条容器样式 */
#progress-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 20px;
  background-color: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 40px;
  transition: opacity 1.5s ease;
}

/* 进度条样式 */
#progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #ff9a9e, #fecfef, #a7bfe8, #6190e8);
  background-size: 400% 400%;
  animation: progressGradient 8s ease infinite;
  width: 0%;
}

/* 进度条渐变动画 */
@keyframes progressGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* 百分比文字样式 */
#progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: bold;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}

/* 全局字体颜色样式 - 排除加载文字 */
body:not(.mobile-device) p, 
body:not(.mobile-device) span, 
body:not(.mobile-device) a, 
body:not(.mobile-device) div:not(#loading-text):not(#progress-text), 
body:not(.mobile-device) h1, 
body:not(.mobile-device) h2, 
body:not(.mobile-device) h3 {
  color: #FACCDF !important;
  text-decoration: none;
}

body.mobile-device p, 
body.mobile-device span, 
body.mobile-device a, 
body.mobile-device div:not(#loading-text):not(#progress-text), 
body.mobile-device h1, 
body.mobile-device h2, 
body.mobile-device h3 {
  color: #00BFFF !important;
  text-decoration: none;
}

/* 底部链接hover样式 */
#footer a:hover {
  color: #000000 !important;
  text-decoration: underline;
}

/* ========================================
   悬浮球音乐播放器样式
   ======================================== */

/* 播放器容器 */
.music-player {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 悬浮球主体 */
.music-ball {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: move;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
  background: url('https://baka.uncloud.top/d/%E5%96%B5%E5%96%B5%E5%96%B5/Un/Alist/7b351b52326e2c8f3170176db7444916.jpg?sign=OqqeAaMN0uGECDy7nPcZcP8Bx_U65bdq0Vy1X2uyCNM=:0') center/cover;
  user-select: none;
  touch-action: none;
}

/* 隐藏悬浮球内的文字信息 */
.music-info {
  display: none !important;
}

/* 播放器面板 */
.player-panel {
  position: fixed;
  top: 80px;
  right: 20px;
  width: 280px;
  max-height: 400px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transform: translateY(-10px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  z-index: 10000;
}

.player-panel.show {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

/* 面板定位调整 */
.player-panel.position-left {
  right: auto;
  left: 20px;
}

.player-panel.position-bottom {
  top: auto;
  bottom: 80px;
  right: 20px;
}

.player-panel.position-bottom-left {
  top: auto;
  bottom: 80px;
  right: auto;
  left: 20px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px 12px 0 0;
}

.panel-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background-color 0.2s;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* 当前播放曲目 */
.current-track {
  display: flex;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.track-cover {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  margin-right: 12px;
  flex-shrink: 0;
}

.track-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.track-details {
  flex: 1;
  min-width: 0;
}

.track-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-artist {
  font-size: 12px;
  color: #666;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 进度条区域 */
.progress-section {
  padding: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.progress-bar {
  position: relative;
  width: 100%;
  height: 6px;
  background-color: #e0e0e0;
  border-radius: 3px;
  cursor: pointer;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 3px;
  transition: width 0.1s ease;
  position: relative;
}

.progress-handle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background: white;
  border: 2px solid #667eea;
  border-radius: 50%;
  cursor: grab;
  transition: box-shadow 0.2s;
  right: -6px;
}

.progress-handle:active {
  cursor: grabbing;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.time-display {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #666;
}

/* 控制按钮 */
.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  gap: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.control-btn {
  background: none;
  border: none;
  color: #667eea;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.control-btn:hover {
  background-color: rgba(102, 126, 234, 0.1);
  transform: scale(1.1);
}

.control-btn:active {
  transform: scale(0.95);
}

.control-btn svg {
  width: 18px;
  height: 18px;
}

.play-pause-btn {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  width: 44px;
  height: 44px;
}

.play-pause-btn:hover {
  background: linear-gradient(135deg, #5a67d8, #6b46c1);
  transform: scale(1.05);
}

.play-pause-btn svg {
  width: 20px;
  height: 20px;
}

/* 音量控制 */
.volume-section {
  display: flex;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  gap: 12px;
}

.volume-icon {
  width: 16px;
  height: 16px;
  color: #667eea;
  flex-shrink: 0;
}

.volume-slider {
  position: relative;
  flex: 1;
  height: 4px;
  background-color: #e0e0e0;
  border-radius: 2px;
  cursor: pointer;
}

.volume-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 2px;
  transition: width 0.1s ease;
  position: relative;
}

.volume-handle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  background: white;
  border: 2px solid #667eea;
  border-radius: 50%;
  cursor: grab;
  transition: box-shadow 0.2s;
  right: -5px;
}

.volume-handle:active {
  cursor: grabbing;
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
}

/* 播放列表 */
.playlist-section {
  padding: 16px;
  max-height: 180px;
  overflow-y: auto;
}

.playlist-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
}

.playlist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.playlist-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s;
  border: 1px solid transparent;
}

.playlist-item:hover {
  background-color: rgba(102, 126, 234, 0.05);
}

.playlist-item.active {
  background-color: rgba(102, 126, 234, 0.1);
  border-color: rgba(102, 126, 234, 0.2);
}

.playlist-item.current {
  background-color: rgba(102, 126, 234, 0.15);
  border-color: #667eea;
}

.playlist-cover {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  overflow: hidden;
  margin-right: 10px;
  flex-shrink: 0;
}

.playlist-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.playlist-info {
  flex: 1;
  min-width: 0;
}

.playlist-title {
  font-size: 12px;
  font-weight: 500;
  color: #333;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playlist-artist {
  font-size: 10px;
  color: #666;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playlist-duration {
  font-size: 10px;
  color: #999;
  margin-left: 8px;
}

/* 旋转动画 */
@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.music-ball.rotating {
  animation: rotate 3s linear infinite;
}

/* 拖拽时的视觉反馈 */
.music-ball.dragging {
  transform: scale(1.1);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  cursor: grabbing;
}

/* 响应式设计 */
@media (max-width: 768px) {
  body {
    background-size: cover !important;
    background-attachment: scroll !important;
  }
  
  .music-player {
    top: 10px;
    right: 10px;
  }
  
  .music-ball {
    width: 45px;
    height: 45px;
  }
  
  .player-panel {
    width: 260px;
    max-height: 350px;
    top: 65px;
    right: 10px;
  }
  
  .player-panel.position-left {
    left: 10px;
  }
  
  .player-panel.position-bottom {
    bottom: 65px;
    right: 10px;
  }
  
  .player-panel.position-bottom-left {
    bottom: 65px;
    left: 10px;
  }
}

@media (max-width: 480px) {
  .player-panel {
    width: calc(100vw - 40px);
    right: 20px;
    left: 20px;
    max-height: 60vh;
  }
  
  .player-panel.position-left,
  .player-panel.position-bottom-left {
    left: 20px;
    right: 20px;
  }
}

/* 滚动条样式 */
.playlist-section::-webkit-scrollbar {
  width: 4px;
}

.playlist-section::-webkit-scrollbar-track {
  background: transparent;
}

.playlist-section::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.3);
  border-radius: 2px;
}

.playlist-section::-webkit-scrollbar-thumb:hover {
  background: rgba(102, 126, 234, 0.5);
}

/* 隐藏原有播放器样式（兼容性） */
#floating-player {
  display: none !important;
}

.aplayer .aplayer-thumb {
  border-radius: 50% !important;
  width: 10px !important;
  height: 10px !important;
}

.aplayer .aplayer-played {
  background: #ff4500 !important;
}