/* 基础设置 */
* { box-sizing: border-box; }
body { margin: 0; background: #fff; font-family: "Microsoft YaHei", sans-serif; overflow: hidden; }
#app { display: flex; height: 100vh; flex-direction: row; }

/* --- 侧边栏 --- */
.sidebar { width: 220px; background: #f6f6f6; border-right: 1px solid #eee; flex-shrink: 0; padding: 20px 10px; z-index: 1000; }
.logo { font-size: 20px; font-weight: bold; color: #409eff; text-align: center; margin-bottom: 20px; }
.nav-group p { font-size: 11px; color: #999; margin: 15px 0 5px 15px; }
.nav-group ul { list-style: none; padding: 0; margin: 0; }
.nav-group li a { display: block; padding: 10px 15px; color: #333; text-decoration: none; border-radius: 6px; font-size: 14px; }
.nav-group li a:hover { background: #e0e0e0; }

/* --- 主内容区 --- */
.main-wrapper { flex: 1; overflow-y: auto; overflow-x: hidden; padding-bottom: 100px; position: relative; }
.content-pannel { padding: 20px; max-width: 1240px; margin: 0 auto; }
.banner-title { font-size: 22px; font-weight: bold; margin-bottom: 20px; color: #333; }

/* 响应式网格布局 */
.music-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); 
    gap: 25px; 
}

/* 核心修复：歌单/音乐缩略图（正方形圆角） */
.song-card { width: 100%; cursor: pointer; }
.img-wrapper { 
    position: relative; 
    width: 100%; 
    aspect-ratio: 1 / 1 !important; /* 强制 1:1 正方形 */
    border-radius: 12px !important; /* 强制圆角数值，可根据喜好调整 */
    overflow: hidden; 
    background: #f0f0f0; 
    display: block;
}
.img-wrapper img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; /* 确保图片不拉伸 */
    display: block;
}

/* 播放按钮遮罩 */
.play-overlay { 
    position: absolute; inset: 0; 
    background: rgba(0,0,0,0.2); 
    display: flex; align-items: center; justify-content: center; 
    opacity: 0; color: #fff; font-size: 30px; transition: 0.2s; 
}
.song-card:hover .play-overlay { opacity: 1; }

/* 文字信息 */
.card-info { margin-top: 10px; }
.song-title { display: block; font-weight: bold; font-size: 14px; color: #333; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.artist-link { font-size: 12px; color: #888; text-decoration: none; }
.artist-link:hover { color: #409eff; }

/* --- 歌手头像（圆形） --- */
.singer-avatar-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1 !important;
    border-radius: 50% !important; /* 歌手头像保持圆形 */
    overflow: hidden;
    background: #f0f0f0;
    border: 3px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    display: block;
    transition: 0.3s;
}
.singer-avatar-wrap img { width: 100%; height: 100%; object-fit: cover; }

/* --- 底部播放器 --- */
.player-bar { position: fixed; bottom: 0; width: 100%; height: 75px; background: #fff; border-top: 1px solid #eee; display: flex; align-items: center; padding: 0 20px; z-index: 1100; justify-content: space-between; }
.p-info { width: 250px; display: flex; align-items: center; gap: 12px; }
#p-cover { width: 50px; height: 50px; border-radius: 6px; flex-shrink: 0; object-fit: cover; }
.p-meta b { font-size: 14px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-meta p { font-size: 12px; color: #999; margin: 0; }

.p-controls { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.btns { display: flex; align-items: center; gap: 25px; font-size: 22px; color: #444; }
#p-toggle { font-size: 32px; color: #409eff; cursor: pointer; }
.progress-container { width: 100%; max-width: 500px; display: flex; align-items: center; gap: 10px; font-size: 11px; color: #999; }
.bar-bg { flex: 1; height: 4px; background: #eee; border-radius: 2px; position: relative; cursor: pointer; }
#p-bar { height: 100%; background: #409eff; width: 0; border-radius: 2px; }

/* --- 移动端自适应 --- */
@media (max-width: 768px) {
    #app { flex-direction: column; }
    .sidebar { width: 100%; height: auto; padding: 10px; border-right: none; border-bottom: 1px solid #eee; }
    .logo, .nav-group p { display: none; }
    .nav-group ul { display: flex; justify-content: space-around; }
    .nav-group li a { padding: 8px 12px; font-size: 14px; }
    
    .content-pannel { padding: 15px; }
    .music-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 15px; }
    
    .p-info { width: 60px; }
    .p-meta, .progress-container { display: none; }
    .p-controls { flex: none; }
    .btns { gap: 40px; }
}