/* Redesigned Music Player - Apple-inspired bottom floating player */
.music-player {
  position: fixed;
  bottom: 20px; /* Floating above bottom edge */
  left: 50%;
  transform: translateX(-50%);
  width: 90vw;
  max-width: 400px; /* Reduced max for compactness */
  height: 60px;
  background: radial-gradient(circle at center, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.6) 10%, rgba(255,255,255,0.4) 30%, rgba(0,0,0,0.17) 45%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.17) 55%, rgba(255,255,255,0.2) 70%, rgba(0,0,0,0.2) 90%, rgba(0,0,0,0.4) 100%); /* Center brightest white, quick fade to mid-white, gradual to edge black (darker at very edge) */
  backdrop-filter: blur(5px) saturate(180%) contrast(120%); /* Enhanced for refraction-like feel */
  border-radius: 30px; /* Rounded like Apple */
  box-shadow: 0 4px 20px rgba(0,0,0,0.15), inset 0 0 10px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.7); /* Softer inner shadow for darker edges, brighter highlight */
  border: 1px solid rgba(255,255,255,0.65); /* Brighter border for edge glow */
  display: flex;
  align-items: center;
  padding: 0 15px;
  opacity: 0;
  transform: translateX(-50%) scale(0); /* Initial hidden and scaled down */
  transform-origin: center; /* Anchor at center for scaling */
  transition: opacity 0.5s ease; /* Only transition opacity here; scale handled by animation */
  z-index: 1000; /* Above other content */
}
.music-player.active {
  opacity: 1;
  animation: expandWithInertia 0.3s ease-out forwards; /* Apply animation on active */
}
/* Keyframes for expand animation: 0% -> 105% -> 100% with inertia (ease-out for slowing down) */
/* Album Art - Square with rounded corners */
.album-art {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
/* Removed box-shadow */
}
.album-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Track Info - Title and Description with Marquee */
.track-info {
  flex: 1;
  margin-left: 10px;
  overflow: hidden;
}
.track-info h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: bold;
  color: #000; /* Adjust for theme */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.track-info .description {
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.8rem;
  color: #555; /* Adjust for theme */
  margin-top: 4px;
}
.track-info .marquee-content {
  display: inline-flex;
  animation: scroll 10s linear infinite; /* Adjust time as needed */
}
.track-info .marquee-content span + span {
  margin-left: 2rem;
}
.player-btn {
  background: transparent;
  border: none;
  color: #000;
  font-size: 24px;
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
  flex-shrink: 0;
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
/* 不再需要字体来渲染图标 */
.player-btn.play-pause {
  font-family: inherit;
}
.player-btn:hover {
  color: #b6b6b6;
  transform: scale(1.1);
}
/* 统一 SVG 图标的定位与动画 */
.player-btn .icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px; /* 你可微调 24~28 */
  height: 30px;
  transform: translate(-50%, -50%);
  fill: currentColor; /* 关键：跟随 color */
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
  opacity: 1;
  transition: opacity 0.25s ease;
}
/* 播放/暂停的显隐逻辑保持一致 */
.player-btn.playing .play-icon {
  opacity: 0;
}
.player-btn.playing .pause-icon {
  opacity: 1;
}
.player-btn:not(.playing) .play-icon {
  opacity: 1;
}
.player-btn:not(.playing) .pause-icon {
  opacity: 0;
}
/* 深色模式保持原有样式 */
@media (prefers-color-scheme: dark) {
  .music-player {
    background: radial-gradient(circle at center, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.4) 10%, rgba(0,0,0,0.2) 30%, rgba(255,255,255,0.17) 45%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.17) 55%, rgba(0,0,0,0.2) 70%, rgba(255,255,255,0.2) 90%, rgba(255,255,255,0.4) 100%);
    border: 1px solid rgba(0,0,0,0.4);
  }
  .track-info h4 {
    color: #fff;
  }
  .track-info .description {
    color: #ccc;
  }
  .player-btn {
    color: #fff;
  }
  .player-btn:hover {
    color: #6a6a6a;
  }
}
@media (max-aspect-ratio: 10/15) {
  .hero {
    height: 70vh;
  }
  .hero-content {
    left: 20px;
    right: 20px;
    bottom: 20px;
  }
  .title {
    font-size: 2.2em;
  }
  .subtitle {
    font-size: 1.2em;
  }
  .intro,
  .body {
    padding: 0 15px;
  }
}
@-moz-keyframes expandWithInertia {
  0% {
    transform: translateX(-50%) scale(0);
  }
  70% {
    transform: translateX(-50%) scale(1.05);
  }
  100% {
    transform: translateX(-50%) scale(1);
  }
}
@-webkit-keyframes expandWithInertia {
  0% {
    transform: translateX(-50%) scale(0);
  }
  70% {
    transform: translateX(-50%) scale(1.05);
  }
  100% {
    transform: translateX(-50%) scale(1);
  }
}
@-o-keyframes expandWithInertia {
  0% {
    transform: translateX(-50%) scale(0);
  }
  70% {
    transform: translateX(-50%) scale(1.05);
  }
  100% {
    transform: translateX(-50%) scale(1);
  }
}
@keyframes expandWithInertia {
  0% {
    transform: translateX(-50%) scale(0);
  }
  70% {
    transform: translateX(-50%) scale(1.05);
  }
  100% {
    transform: translateX(-50%) scale(1);
  }
}
@-moz-keyframes scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-100%);
  }
}
@-webkit-keyframes scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-100%);
  }
}
@-o-keyframes scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-100%);
  }
}
@keyframes scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-100%);
  }
}
