html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  background-image: url("autumn.png");
  background-size: contain;
  background-repeat: repeat-x;
  background-position: center bottom;
  background-color: #FFD17A;
}

canvas {
  display: block;
}

#leaf {
  display: none; /* 叶子图像隐藏，但仍在canvas中使用 */
}

/* ===== 音乐播放器 (毛玻璃, 最上层, 居中) ===== */
.player-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 999;
}
.player-card {
    pointer-events: auto;
    background: rgba(10, 10, 30, 0.25);
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    border-radius: 2.2rem;
    padding: 1.8rem 2.2rem;
    min-width: 320px;
    max-width: 460px;
    width: 90%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f0edff;
    font-family: 'Segoe UI', 'PingFang SC', Roboto, system-ui, sans-serif;
    text-align: center;
    transition: all 0.2s;
}
.player-card .song-name {
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-bottom: 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.player-card .song-name i {
    font-style: normal;
    background: linear-gradient(135deg, #ffe68f, #ffb3b3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
/* ----- 进度条 ----- */
.progress-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    margin: 8px 0 4px 0;
    cursor: pointer;
    position: relative;
    transition: height 0.1s ease;
}
.progress-container:hover {
    height: 6px;
}
.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ffd966, #ffb3b3);
    border-radius: 4px;
    transition: width 0.05s linear;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.3);
}
.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    opacity: 0.6;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.3px;
    padding: 0 2px;
}
.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}
.controls button {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 40px;
    color: #f0edff;
    font-size: 1.4rem;
    width: 3rem;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    line-height: 1;
    padding: 0;
}
.controls button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}
.controls button:active {
    transform: scale(0.94);
}
.controls button.play-btn {
    width: 3.6rem;
    height: 3.6rem;
    font-size: 1.8rem;
    background: rgba(255, 215, 0, 0.15);
    border-color: rgba(255, 215, 0, 0.25);
}
.controls button.play-btn:hover {
    background: rgba(255, 215, 0, 0.3);
}
.mode-btn {
    font-size: 1.2rem !important;
    width: 2.8rem !important;
    height: 2.8rem !important;
    background: rgba(100, 200, 255, 0.08) !important;
    border-color: rgba(100, 200, 255, 0.15) !important;
}
.mode-btn.active {
    background: rgba(255, 215, 0, 0.2) !important;
    border-color: #ffd966 !important;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.25);
}
.list-toggle {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    font-size: 1.2rem !important;
    width: 2.8rem !important;
    height: 2.8rem !important;
}
.music-list-container {
    max-height: 0;
    overflow-y: auto;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, margin 0.3s ease;
    opacity: 0;
    margin-top: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.music-list-container.open {
    max-height: 220px;
    opacity: 1;
    margin-top: 1rem;
}
.music-list-container::-webkit-scrollbar {
    width: 4px;
}
.music-list-container::-webkit-scrollbar-track {
    background: transparent;
}
.music-list-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}
.music-list {
    list-style: none;
    padding: 0.2rem 0.2rem 0.2rem 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}
.music-list li {
    padding: 0.5rem 0.8rem;
    border-radius: 40px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ddd8f5;
    font-weight: 400;
    letter-spacing: 0.3px;
}
.music-list li:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.music-list li.active {
    background: rgba(255, 215, 0, 0.13);
    border-color: rgba(255, 215, 0, 0.2);
    color: #ffecb0;
    font-weight: 500;
}
.music-list li.active::before {
    content: "▶ ";
    font-size: 0.7rem;
    opacity: 0.7;
}
/* 底部信息保留 */
.footer-info {
    position: fixed;
    bottom: 8px;
    left: 0;
    width: 100%;
    text-align: center;
    font: normal 12px/20px 'Microsoft YaHei', sans-serif;
    color: rgba(255,255,255,0.2);
    pointer-events: none;
    z-index: 10;
    text-shadow: 0 0 10px #000;
}
.footer-info a {
    color: rgba(255,255,255,0.3);
    pointer-events: auto;
}
.footer-info p {
    margin: 1px 0;
}
@media (max-width: 500px) {
    .player-card { padding: 1.2rem 1rem; min-width: unset; }
    .controls button { width: 2.6rem; height: 2.6rem; font-size: 1.2rem; }
    .controls button.play-btn { width: 3.2rem; height: 3.2rem; font-size: 1.6rem; }
    .player-card .song-name { font-size: 1.0rem; }
    .music-list li { font-size: 0.8rem; padding: 0.4rem 0.6rem; }
}