:root {
  --theme-color: #fa7298;
}

/* ===== 主容器 ===== */
.container-wrap {
  position: relative;
  width: 100vw;
  height: 100vh;
  background-color: #2e323f;
  background-image: url("https://cloud.vansmar.com/f/Gr9T7/08.webp");
  background-size: cover; /* 添加这行，确保背景图片覆盖整个容器 */
  background-position: center; /* 添加这行，确保背景图片居中 */
  background-attachment: fixed; /* 添加这行，确保背景图片固定，不随页面滚动 */
  background-repeat: no-repeat; /* 添加这行，防止背景图片重复 */
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  image-rendering: -webkit-optimize-contrast; /* 添加这行，优化高DPI显示 */
  image-rendering: crisp-edges; /* 添加这行，优化高DPI显示 */
}

/* 背景 */
.container-wrap .bg {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  background-attachment: fixed; /* 添加这行，确保背景图片固定 */
  filter: blur(6px);
  transform: scale(1.05);
  z-index: 0;
  transition: opacity 0.8s ease-in-out; /* 添加过渡效果 */
  opacity: 1; /* 初始不透明度 */
  image-rendering: -webkit-optimize-contrast; /* 添加这行，优化高DPI显示 */
  image-rendering: crisp-edges; /* 添加这行，优化高DPI显示 */
}

/* ===== 卡片 ===== */
.container-wrap .card-wrap {
  position: relative;
  width: 90%;
  height: 80%;
  color: var(--theme-color);
  border-radius: 24px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  background: rgba(250,114,152, 0.05);
  backdrop-filter: blur(6px);
  z-index: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-shadow:
    -1px -1px 0 #ffffff,
    1px -1px 0 #ffffff,
    -1px 1px 0 #ffffff,
    1px 1px 0 #ffffff;
}

/* ===== 头部 ===== */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 12%;
  padding: 2% 4%;
  font-size: clamp(16px, 3vw, 32px);
}

/* ===== 主体 ===== */
.card-body {
  width: 100%;
  height: calc(100% - 120px);
  border-radius: 0 0 46px 46px;
  overflow: hidden;
  position: relative;
}

/* ✅ 缩小并上移可视化画布 */
.card-body canvas#music-canvas {
  display: block;
  width: 100%;             /* 原来 100%，略缩小一点 */
  height: 100%;            /* 原来 100%，略缩小一点 */
  position: absolute;
  top: 30%;               /* ✅ 整体上移，可避免与底部按钮重叠 */
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

/* ✅ 歌词区域稍上移，避免与 canvas 冲突 */
.card-body .lrc-box {
  position: absolute;
  top: 30%;                /* 原来是 30%，稍稍上移一点让出空间 */
  left: 0;
  right: 0;
  height: 90px;
  overflow: hidden;
  z-index: 2;             /* 保证歌词在 canvas 之上显示 */
}

.card-body #music-lrc {
  text-align: center;
  transition: transform 0.3s ease-out;
}

.card-body #music-lrc p.current {
  opacity: 1;
  font-size: 18px;
  font-weight: bolder;
}
.card-body #music-lrc p.current {
  opacity: 1;
  font-size: 18px;
  font-weight: bold;
}

/* ===== 底部控制区 ===== */
.control-widget {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6vw;
  height: 10%;
}

.control-btn {
  width: clamp(40px, 10vw, 70px);
  height: clamp(40px, 10vw, 70px);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s ease;
}

.control-btn:active {
  transform: scale(0.9);
}

/* ======= 手机端优化 ======= */
@media (max-width: 768px) {
  .container-wrap .card-wrap {
    width: 95%;
    height: 85%;
    border-radius: 16px;
  }

  .card-header {
    height: 0%;
    padding: 3% 5%;
  }

  .card-body .lrc-box {
    top: 35%;
    height: 70px;
  }

  .control-widget {
    gap: 10vw;
    height: 18%;
  }

  .container-wrap .bg {
    filter: blur(3px);
  }
}