/* 【新添加】定义轮播半径的CSS变量及媒体查询 */
:root {
  --carousel-radius: 360px; /* 桌面端默认值 */
  --carousel-card-count: 12; /* 桌面端最多显示12张卡片 */
}

@media (max-width: 820px) {
  :root {
    --carousel-radius: 240px; /* 平板 */
    --carousel-card-count: 8;  /* 平板最多显示8张 */
  }
}

@media (max-width: 480px) {
  :root {
    --carousel-radius: 180px; /* 手机 */
    --carousel-card-count: 7;   /* 手机最多显示6张 */
  }
}

* {
  margin: 0;
  padding: 0;
}


html,
body {
  height: 100%;
  /* for touch screen */
  touch-action: none; 
}

body {
  overflow: hidden;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  background: #111;
  -webkit-perspective: 1000px;
          perspective: 1000px;
  -webkit-transform-style: preserve-3d;
          transform-style: preserve-3d;
}

#drag-container, #spin-container {
  position: relative;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  margin: auto;
  -webkit-transform-style: preserve-3d;
          transform-style: preserve-3d;
  -webkit-transform: rotateX(-10deg);
          transform: rotateX(-10deg);
}

#drag-container img, #drag-container video {
  -webkit-transform-style: preserve-3d;
          transform-style: preserve-3d;
  position: absolute;
  
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  line-height: 200px;
  font-size: 50px;
  text-align: center;
  -webkit-box-shadow: 0 0 8px #fff;
          box-shadow: 0 0 8px #fff;
  -webkit-box-reflect: below 10px linear-gradient(transparent, transparent, #0005);
 
}

#drag-container img:hover, #drag-container video:hover {
  -webkit-box-shadow: 0 0 15px #fffd;
          box-shadow: 0 0 15px #fffd;
  -webkit-box-reflect: below 10px linear-gradient(transparent, transparent, #0007);
}

#drag-container p {
  font-family: Serif;
  position: absolute;
  top: 100%;
  left: 50%;
  -webkit-transform: translate(-50%,-50%) rotateX(90deg);
          transform: translate(-50%,-50%) rotateX(90deg);
  color: #fff;
}

#ground {
  width: 900px;
  height: 900px;
  position: absolute;
  top: 100%;
  left: 50%;
  -webkit-transform: translate(-50%,-50%) rotateX(90deg);
          transform: translate(-50%,-50%) rotateX(90deg);
  background: -webkit-radial-gradient(center center, farthest-side , #9993, transparent);
}

#music-container {
  position: absolute;
  top: 0;
  left: 0;
}

@-webkit-keyframes spin {
  from{
    -webkit-transform: rotateY(0deg);
            transform: rotateY(0deg);
  } to{
    -webkit-transform: rotateY(360deg);
            transform: rotateY(360deg);
  }
}

@keyframes spin {
  from{
    -webkit-transform: rotateY(0deg);
            transform: rotateY(0deg);
  } to{
    -webkit-transform: rotateY(360deg);
            transform: rotateY(360deg);
  }
}
@-webkit-keyframes spinRevert {
  from{
    -webkit-transform: rotateY(360deg);
            transform: rotateY(360deg);
  } to{
    -webkit-transform: rotateY(0deg);
            transform: rotateY(0deg);
  }
}
@keyframes spinRevert {
  from{
    -webkit-transform: rotateY(360deg);
            transform: rotateY(360deg);
  } to{
    -webkit-transform: rotateY(0deg);
            transform: rotateY(0deg);
  }
}

/* 1. 让视频的包裹容器继承原视频卡片的定位和3D样式 */
.video-carousel-item {
  -webkit-transform-style: preserve-3d;
          transform-style: preserve-3d;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

/* 2. 让包裹容器内的视频填充整个容器，并保持视觉效果 */
.video-carousel-item video {
  width: 100%;
  height: 100%;
  -webkit-box-shadow: 0 0 8px #fff;
          box-shadow: 0 0 8px #fff;
  -webkit-box-reflect: below 10px linear-gradient(transparent, transparent, #0005);
}

/* 3. 设置点击覆盖层的样式 */
.click-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2; /* 确保它在视频控件之上 */
  cursor: pointer; /* 桌面端显示可点击手势 */
  /* 该层默认是透明的，用户看不见它 */
}

/* 4. 修正悬停效果，当鼠标悬停在包裹容器上时，让内部的视频发光 */
.video-carousel-item:hover video {
  -webkit-box-shadow: 0 0 15px #fffd;
          box-shadow: 0 0 15px #fffd;
  -webkit-box-reflect: below 10px linear-gradient(transparent, transparent, #0007);
}

/* Modal弹窗样式 */
.modal {
  display: none; 
  position: fixed; 
  z-index: 1; 
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgb(0,0,0); 
  background-color: rgba(0,0,0,0.4); 
}

.modal-content {
  background-color: rgba(40, 40, 40, 0.85);
  margin: 8% auto;
  padding: 20px 20px 20px 20px;
  border: 1px solid #888;
 
  display: flex;
  flex-direction: column;
  align-items: stretch;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  border-radius: 16px;
  min-width: 320px;
  max-width: 900px;
  padding-bottom: 32px;
  position: relative;
  z-index: 10000;
  transform: translateZ(0);
}
.modal-main {
  display: flex;
  flex-direction: row;
  width: 100%;
}
#albumLeft {
  flex: 1;
  min-width: 180px;
  max-width: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-right: 32px;
}
#albumCoverImg {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 18px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
#modalAudioContainer {
  width: 100%;
  max-width: 600px;
  margin: 24px auto 0 auto;
  display: flex;
  justify-content: center;
}
#modalAudioContainer audio {
  width: 100%;
  min-width: 120px;
  max-width: 600px;
  height: 38px;
  margin: 0 auto;
  display: block;
}
#lyrics {
  margin-top: 12px;
  font-style: italic;
  color: #e0e0e0;
  background: rgba(0,0,0,0.15);
  padding: 12px;
  border-radius: 8px;
  width: 100%;
  text-align: left;
  max-height: 300px;
  overflow-y: auto;
  box-sizing: border-box;
  line-height: 1.7;
  /* 隐藏滚动条 */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE 10+ */
}
#lyrics::-webkit-scrollbar {
  display: none; /* Chrome/Safari/Webkit */
}
#albumRight {
  flex: 2 1 0%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  justify-content: flex-start;
}
#albumRight .close {
  align-self: flex-end;
}
#albumRight h2 {
  margin-bottom: 12px;
  color: #fff;
}
#songList {
  flex: 1 1 0%;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  list-style: none;
  padding: 0;
  margin: 16px 0;
  max-height: 400px;
  overflow-y: auto;
}
#songList li {
  padding: 8px 16px;
  margin-bottom: 6px;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
#songList li:hover {
  background: rgba(25, 118, 210, 0.25);
  color: #1976d2;
}
#songList li.playing {
  background: #1976d2;
  color: #fff;
  font-weight: bold;
}
@media (max-width: 700px) {
  .modal-content {
    flex-direction: column;
  
    min-width: 0;
   
    align-items: stretch;
  }

  .modal-main {
    flex-direction: column;
  }
  #albumLeft {
    margin-right: 0;
    margin-bottom: 18px;
    flex-direction: column;
    align-items: center;
    max-width: none;
    display: none;
  }
  #albumRight {
    
    min-width: 0;
    flex: 1 1 0%;
  }
  #albumCoverImg {
    width: 120px;
    height: 120px;
  }
  #songList {
    max-width: 100%;
    width: 100%;
  }
  #modalAudioContainer {
    max-width: 98vw;
  }
  #modalAudioContainer audio {
    max-width: 100vw;
    width: 100%;
  }
  #lyrics {
    max-height: 120px;
    font-size: 14px;
  }
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.close:hover,
.close:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

.disc-spinner {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 50px 0 0 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.disc-spinner img {
   width: 80px;
  height: 80px;
  animation: disc-rotate 4s linear infinite;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
@keyframes disc-rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
#bgMusicPlayIcon {
  pointer-events: none;
  user-select: none;
  text-shadow: 0 1px 4px #fff, 0 0 6px #1976d2;
}

.modal-action-bar {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.modal-close-btn {
  position: static;
  top: unset;
  right: unset;
  z-index: 10;
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
  padding: 0 4px;
}
.modal-close-btn:hover {
  color: #e53935;
}
#albumRight .minimize {
  align-self: flex-end;
  font-size: 28px;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  margin-bottom: 8px;
  margin-right: 15px;
  transition: color 0.2s;
}
#albumRight .minimize:hover {
  color: #1976d2;
}

/* 1. 视频弹窗的遮罩层 */
#videoModal {
  display: none; 
  position: fixed; 
  z-index: 999; 
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.6); /* 使用半透明背景 */

}

/* 2. 视频弹窗的内容区域 */
.video-modal-layout {
  /* 从 .modal-content 继承基础样式，但重写布局 */
  flex-direction: row; /* 核心：左右布局 */
  width: 80%;
  height: 55%;
  max-width: 1000px;
  padding: 15px; /* 统一内边距 */
  gap: 15px; /* 在视频和列表之间创建间隙 */
}

/* 3. 左侧视频播放器容器 */
#videoPlayerContainer {
  flex: 2; /* 占据2份空间 */
  background-color: #000;
  height: 100%;
}

/* 4. 右侧视频列表容器 */
#videoListContainer {
  flex: 1; /* 占据1份空间 */
  height: 100%;
  padding: 20px;
  color: #fff;
  overflow-y: auto;
  background-color: rgba(0,0,0,0.2);
  border-radius: 8px;
}
#videoListContainer div:hover {
  color: #1976d2;
  background-color: rgba(255, 255, 255, 0.1);
}

/* 5. 关闭按钮样式 */
.video-modal-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  cursor: pointer;
  color: #fff;
  background-color: rgba(0, 0, 0, 0.5);
  border: none;
  font-size: 22px;
  width: 50px;
  height: 32px;
  border-radius: 50%;
  line-height: 32px;
  text-align: center;
  transition: background-color 0.2s, transform 0.2s;
}
.video-modal-close-btn:hover {
  background-color: #ff0000;
  transform: scale(1.1);
}

/* 6. 移动端适配：当屏幕宽度小于768px时，变回上下布局 */
@media (max-width: 768px) {
  .video-modal-layout {
    flex-direction: column; /* 变回上下布局 */
    width: 95%;

    padding: 10px;
    gap: 10px;
  }
  
  #videoPlayerContainer {
    flex: none; /* 清除flex比例 */
    width: 100%;
    height: 50%; /* 高度占比 */
  }

  #videoListContainer {
    flex: none; /* 清除flex比例 */
    width: 100%;
    height: 50%; /* 高度占比 */
  }
}