/* Modern local audio player theme */

.music-page-container{
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 16px;
}

.music-header{
  text-align: center;
  margin-bottom: 20px;
}

.music-header h1{
  margin: 0;
  font-size: 34px;
  letter-spacing: 0.2px;
  color: rgba(255,255,255,0.92);
}

.music-header .subtitle{
  margin: 10px 0 0;
  color: rgba(255,255,255,0.55);
  font-size: 14px;
}

.music-player-card{
  display: grid;
  /* 固定左右宽度：左侧播放器 420px，右侧播放列表 320px */
  grid-template-columns: 420px 320px;
  justify-content: center;
  gap: 18px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 20px 70px rgba(0,0,0,0.35);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.player-main{
  border-radius: 18px;
  padding: 18px;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.06);
  min-height: 420px;
  display: grid;
  grid-template-rows: auto auto auto auto;
  gap: 14px;
  min-width: 0;
}

.album-art{
  display: flex;
  justify-content: center;
}

.disk{
  width: 240px;
  height: 240px;
  border-radius: 999px;
  padding: 14px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.25), rgba(255,255,255,0.05) 40%, rgba(0,0,0,0.3));
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
  position: relative;
}

.disk::after{
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.75);
  box-shadow: 0 0 0 10px rgba(0,0,0,0.25);
}

.disk img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
  display: block;
}

.disk.is-playing{
  animation: spin 14s linear infinite;
}

@keyframes spin{
  from{ transform: rotate(0deg); }
  to{ transform: rotate(360deg); }
}

.track-info{
  text-align: center;
  padding: 0 10px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.track-title-wrapper {
  width: 100%;
  max-width: 280px;
  overflow: hidden;
  height: 32px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 6px;
  box-sizing: border-box;
}

.track-title-inner {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  min-width: 100%;
  justify-content: center;
  position: relative;
  padding-right: 8px;
  box-sizing: border-box;
}

.track-title-inner span {
  color: rgba(255,255,255,0.94);
  font-size: 20px;
  font-weight: 700;
  padding-right: 50px;
}

@keyframes marquee-v3 {
  0% { transform: translateX(0); }
  25% { transform: translateX(0); }
  75% { transform: translateX(var(--scroll-dist)); } 
  95% { transform: translateX(var(--scroll-dist)); }
  100% { transform: translateX(0); }
}

.track-title-inner.scrolling {
  justify-content: flex-start !important;
  animation: marquee-v3 12s linear infinite;
  width: max-content !important;
  will-change: transform;
}

.track-info p{
  margin: 4px 0 0;
  color: rgba(255,255,255,0.55);
  font-size: 13px;
}

.progress-section{
  display: grid;
  gap: 10px;
}

.time-info{
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255,255,255,0.6);
}

.progress-bar-container{
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.07);
  overflow: hidden;
  cursor: pointer;
}

.progress-fill{
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(79,140,255,0.95), rgba(132,97,255,0.95));
  box-shadow: 0 10px 22px rgba(79,140,255,0.3);
}

.main-controls{
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.ctrl-btn{
  border: none;
  cursor: pointer;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.ctrl-btn.secondary{
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.78);
  border: 1px solid rgba(255,255,255,0.08);
}

.ctrl-btn.primary{
  width: 54px;
  height: 54px;
  background: rgba(79,140,255,0.22);
  color: rgba(79,140,255,0.98);
  border: 1px solid rgba(79,140,255,0.28);
  box-shadow: 0 18px 36px rgba(79,140,255,0.22);
}

.ctrl-btn:hover{ transform: translateY(-2px); }
.ctrl-btn:active{ transform: translateY(0px) scale(0.98); }

.ctrl-btn.active-mode {
  color: #4f8cff;
  background: rgba(79, 140, 255, 0.15);
}

.extra-controls{
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.65);
}

#volume-slider{
  width: 100%;
  accent-color: #4f8cff;
}

.playlist-section{
  border-radius: 18px;
  padding: 18px;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.06);
  min-height: 420px;
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  overflow: hidden;
}

.playlist-section h3{
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.4px;
  color: rgba(255,255,255,0.75);
}

.playlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.playlist-refresh {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.playlist-refresh:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
  transform: rotate(45deg);
}

.playlist-refresh:active {
  background: rgba(79, 140, 255, 0.4);
  box-shadow: 0 0 15px rgba(79, 140, 255, 0.6);
  transform: scale(0.95) rotate(45deg);
}

.playlist-refresh.loading i {
  animation: spin 1s linear infinite;
}

#playlist{
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  overflow: auto;
}

#playlist li{
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  margin-bottom: 10px;
  transition: background 0.15s ease, border 0.15s ease, transform 0.15s ease;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

#playlist li i{
  justify-self: end;
}

#playlist li:hover{
  background: rgba(255,255,255,0.06);
  transform: translateY(-1px);
}

#playlist li.active{
  background: rgba(79,140,255,0.14);
  border-color: rgba(79,140,255,0.28);
}

.track-num{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
  font-weight: 700;
  font-size: 12px;
}

.track-name-box{
  min-width: 0;
}

.track-name-box .name{
  display: block;
  color: rgba(255,255,255,0.92);
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-name-box .artist{
  display: block;
  color: rgba(255,255,255,0.55);
  font-size: 12px;
  margin-top: 4px;
}

@media (max-width: 820px){
  /* 小屏：改为单列，避免固定 420+320 溢出 */
  .music-player-card{
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .player-main,
  .playlist-section{
    min-height: auto;
    width: 100%;
    max-width: 100%;
  }

  .disk{ width: 210px; height: 210px; }
}

@media (max-width: 420px){
  /* 超小屏：唱片进一步缩小，避免横向滚动 */
  .disk{ width: 180px; height: 180px; }

  .music-page-container{
    margin: 18px auto;
  }
}
