* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 20px; /* 缩减头部间距 */
}

h1 {
  font-size: 2.2rem; /* 标题缩小 */
  background: linear-gradient(90deg, #ff6b6b, #ffd166);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.subtitle {
  color: #aaa;
  font-size: 1rem;
  font-weight: 300;
}

.player {
  background: rgba(25,25,40,0.8);
  border-radius: 24px;
  padding: 30px; /* 缩减内边距 */
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.3s ease;
}

.player:hover {
  box-shadow: 0 15px 40px rgba(0,0,0,0.6);
  transform: translateY(-5px);
}

/* 竖屏默认：封面缩小+歌词高度拉满，上下排列 */
.player-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px; /* 缩减封面与歌词间距 */
  margin-bottom: 20px;
}

/* 专辑封面缩小，腾出歌词空间 */
.album-art {
  position: relative;
  width: 180px; /* 大幅缩小（原280px） */
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  flex-shrink: 0;
}
.album-art img.play {animation: rotate 15s linear infinite;}
@keyframes rotate {
  from {transform: rotate(0deg);}
  to {transform: rotate(360deg);}
}
.album-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.album-art::before {
  content: '';
  position: absolute;
  top: 0;left: 0;
  width: 100%;height: 100%;
  background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.7) 100%);
  z-index: 1;
}

/* 歌词容器高度拉满，占满剩余空间 */
.song-lyric-wrap {
  width: 100%;
  height: 260px; /* 大幅增高（原200px） */
  display: flex;
  flex-direction: column;
}
.song-info {
  text-align: center;
  margin-bottom: 10px; /* 缩减间距 */
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
/* 歌名缩小 */
.song-title {
  font-size: 1.4rem; /* 原2rem */
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 歌手名缩小 */
.artist {
  font-size: 1rem; /* 原1.3rem */
  color: #ffd166;
}

/* 歌词容器 空间拉满+清晰显示 */
.lyric-container {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  text-align: center;
  padding: 8px 0;
  line-height: 1.9;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overflow-anchor: none;
}
.lyric-item {
  padding: 2px 0;
  font-size: 15px;
  color: #aaa;
  transition: all 0.2s;
}
.lyric-item.active {
  color: #ff6b6b;
  font-size: 17px;
  font-weight: 600;
  padding-left: 0;
  border-left: none;
}
.no-lyric {
  color: #999;
  text-align: center;
  line-height: 260px;
}
.lyric-container::-webkit-scrollbar {width: 4px;}
.lyric-container::-webkit-scrollbar-thumb {background: rgba(255,107,107,0.4);border-radius: 2px;}

/* 进度条+提示时间 */
.progress-container {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  margin: 12px 0;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #ff6b6b, #ffd166);
  width: 0%;
  border-radius: 4px;
  transition: width 0.1s linear;
}
.progress-tooltip {
  position: absolute;
  top: -30px;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  display: none;
  pointer-events: none;
}

.time-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #aaa;
  margin-bottom: 20px;
}

/* 控制按钮微调，不拥挤 */
.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  margin-bottom: 12px;
}
.control-btn {
  background: rgba(255,255,255,0.1);
  border: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  position: relative;
  overflow: hidden;
}
.control-btn:hover {
  background: rgba(255,255,255,0.2);
  transform: scale(1.05);
}
.control-btn:active {transform: scale(0.95);}

.play-btn {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #ff6b6b, #ff8e53);
  font-size: 1.8rem;
}
.play-btn:hover {
  background: linear-gradient(135deg, #ff5252, #ff7a3d);
  box-shadow: 0 0 25px rgba(255,107,107,0.5);
}
.next-btn:hover {color: #ffd166;}

.status {
  text-align: center;
  color: #aaa;
  font-size: 0.95rem;
  min-height: 18px;
  margin: 8px 0;
}
.loading {display: none;text-align: center;margin: 12px 0;}
.loading-spinner {
  width: 35px;height: 35px;margin: 0 auto;
  border: 3px solid rgba(255,255,255,0.1);border-radius: 50%;
  border-top-color: #ff6b6b;animation: spin 1s infinite linear;
}
@keyframes spin {to {transform: rotate(360deg);}}
.error {
  display: none;color: #ff6b6b;text-align: center;
  padding: 10px;background: rgba(255,107,107,0.1);
  border-radius: 8px;margin: 8px 0;
}
.audio-source {display: none;}
.footer {text-align: center;margin-top: 20px;color: #666;font-size: 0.9rem;}

/* 水波纹 */
.ripple {
  position: absolute;border-radius: 50%;
  background: rgba(255,255,255,0.3);transform: scale(0);
  animation: ripple 0.6s linear;
}
@keyframes ripple {to {transform: scale(4);opacity: 0;}}

/* 横屏适配：封面/文字同步缩小，歌词空间拉满 */
@media (orientation: landscape) and (max-height: 500px) {
  .player-main {flex-direction: row;align-items: center;gap: 15px;}
  .album-art {width: 120px;height: 120px;} /* 横屏封面缩小 */
  .song-lyric-wrap {width:calc(100% - 140px);height: 180px;}
  .song-info {text-align:left;}
  .song-title {font-size:1.3rem;}
  .artist {font-size:0.95rem;}
  .lyric-container {text-align:left;height:100%;}
  .lyric-item.active {padding-left:8px;border-left:2px solid #ff6b6b;}
  .no-lyric {line-height:180px;}
  .player {padding: 20px;}
}

/* 小屏竖屏适配，同步缩小不拥挤 */
@media (max-width: 480px) {
  .album-art {width: 150px;height: 150px;}
  .song-title {font-size:1.2rem;}
  .artist {font-size:0.9rem;}
  .song-lyric-wrap {height: 220px;}
  .no-lyric {line-height:220px;}
  .control-btn {width: 55px;height: 55px;font-size:1.4rem;}
  .play-btn {width: 65px;height: 65px;font-size:1.7rem;}
}
