/* 默认样式 */
.player-container {
  display: flex;
  flex-direction: column; /* 将主轴方向改为列方向 */
  align-items: center; /* 垂直居中 */
  justify-content: center; /* 水平居中 */
  background-color: #f9e8a4;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  width: 100%; /* .player-container 占据整个宽度 */
  height: 100%; /* .player-container 占据整个高度 */
  box-sizing: border-box; /* 确保 padding 不会增加总宽度 */
}

.controls {
  display: flex;
  align-items: center;
  height: 100%;
}

.controls button {
  width: 50px;
  height: 50px;
  margin: 0 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  transition: all 0.3s ease;
  outline: none;
  border-radius: 50%;
  color: #4eafff;
}

.controls button:hover,
.controls button:active {
  background-color: #ffbd5ae7;
  color: #fff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.controls button:active {
  transform: translateY(2px);
}

.time-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  margin: 0 20px;
  font-size: 18px;
}

#current-time,
#duration {
  font-size: 18px;
  color: #4eafff;
}

.progress-bar {
  width: 300px;
  height: 15px;
  background-color: #fff3cd;
  border-radius: 8px;
  overflow: hidden;
  margin: 0 20px;
}

#progress {
  height: 100%;
  background-color: #ffbd5ae7;
  width: 0;
  transition: width 0.3s ease;
}

.volume-control {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #f9e8a4;
  border: 1px solid #cccccc;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

#volumeIcon {
  color: #4eafff;
}
/* 设置整个范围输入框的宽度 */
.volume-control input[type="range"] {
  width: 100%;
}

/* 修改滚动条的整体样式 */
.volume-control input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 10px;
  background: #fff3cd;
  border-radius: 5px;
  cursor: pointer;
}

/* 修改滑块的样式 */
.volume-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #333;
  border-radius: 50%;
  margin-top: -3px;
  cursor: pointer;
}

/* 修改当滑块悬停时的样式 */
.volume-control input[type="range"]:hover::-webkit-slider-thumb {
  background: #666;
}

.volume-control label {
  margin-left: 10px;
  font-size: 18px;
}

.controls i {
  transition: color 0.3s ease;
}

.icon-button:hover i,
.icon-button:active i {
  color: #fff;
}

/* 响应式设计 */
@media (max-width: 768px) {
  body,
  html {
    overflow-x: hidden; /* 禁止水平滚动 */
  }

  .player-container {
    padding: 0; /* 减小内边距 */
  }

  .controls {
    flex: 1; /* 使控件区域撑满剩余空间 */
    display: flex;
    align-items: center;
    justify-content: space-between; /* 在控件之间均匀分布 */
  }

  .player-container .controls button {
    width: 30px; /* 进一步减小按钮宽度 */
    height: 30px; /* 进一步减小按钮高度 */
    font-size: 12px; /* 进一步减小图标大小 */
    margin: 0;
  }

  .time-display {
    max-width: 233px; /* 设置最大宽度 */
    flex: 1; /* 使时间显示区域撑满剩余空间 */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0; /* 减小内边距 */
    font-size: 14px; /* 减小字体大小 */
    margin: 0; /* 减小边距 */
  }

  #current-time,
  #duration {
    font-size: 14px; /* 减小字体大小 */
  }

  .progress-bar {
    flex: 1; /* 使进度条撑满剩余空间 */
    height: 10px; /* 进一步减小进度条高度 */
    margin: 0 5px; /* 减小边距 */
  }

  .volume-control input[type="range"] {
    width: 150px; /* 减小滑块宽度 */
  }

  .volume-control label {
    font-size: 16px; /* 减小字体大小 */
  }
}
