/* =================================================================
   content.css - 右侧主内容区域样式
   包含: 搜索栏、Tab导航、榜单区域、歌曲列表核心样式
   ================================================================= */

/* ========================================
   1. 基础容器设置
   ======================================== */
.content {
    flex: 1; /* 占据剩余宽度 */
    background: transparent;
    overflow: hidden; /* 防止溢出 */
    padding: 30px 40px 0 40px; /* 顶部及左右内边距 */
    display: flex;
    flex-direction: column;
    position: relative;
}

/* 防止这些头部元素在 flex 布局中被压缩 */
.search-bar,
.tab-header,
#charts-tabs,
#mobile-playlist-controls {
    flex-shrink: 0;
}

/* ========================================
   2. 移动端歌单控件 (PC端默认隐藏，保留结构)
   ======================================== */
#mobile-playlist-controls {
    display: none;
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 12px;
    background: #1e1e1e;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.mobile-controls-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

#mobile-playlist-select {
    flex: 1;
    background: #2a2a2a;
    color: #fff;
    border: 1px solid #333;
    padding: 8px 12px;
    border-radius: 8px;
    outline: none;
    font-size: 14px;
}

.mobile-btn-group {
    display: flex;
    gap: 6px;
}

.mobile-btn-group button {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #333;
    background: #2a2a2a;
    color: #ccc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.mobile-btn-group button:hover {
    background: #333;
    color: #fff;
}

.mobile-btn-group button.btn-delete {
    color: #ff4d4f;
    border-color: rgba(255, 77, 79, 0.2);
}

.mobile-btn-group button.btn-delete:hover {
    background: rgba(255, 77, 79, 0.1);
}

/* ========================================
   3. 搜索栏 (Search Bar) - [已修复]
   修复: 高度统一、背景透明防止遮挡圆角
   ======================================== */
.search-bar {
    display: flex;
    align-items: center;
    gap: 12px; /* 下拉框和输入框的间距 */
    margin-bottom: 25px;
    width: 100%;
}

/* 左侧音源选择下拉框 */
.source-select {
    width: 100px; /* 固定宽度 */
    height: 40px; /* 统一高度 */
    padding: 0 10px;
    border-radius: 20px; /* 胶囊圆角 */
    background-color: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ccc;
    outline: none;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
    appearance: none; /* 移除默认下拉箭头，更简洁 */
    font-family: inherit;
}

.source-select:hover {
    border-color: #555;
    color: #fff;
    background-color: #252525;
}

.source-select option {
    background-color: #1a1a1a;
    color: #fff;
    padding: 10px;
}

/* 右侧搜索输入框容器 */
.search-input-group {
    flex: 1; /* 占满剩余宽度 */
    height: 40px; /* 统一高度 */
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px; /* 胶囊圆角 */
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0 5px 0 15px; /* 左留白给字，右留白给按钮 */
    overflow: hidden; /* [关键] 防止内部元素溢出遮挡圆角 */
    transition: 0.3s;
}

.search-input-group:focus-within {
    border-color: #31c27c;
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 0 2px rgba(49, 194, 124, 0.2);
}

/* 输入框本体 */
.search-input {
    flex: 1;
    height: 100%;
    padding: 0; /* padding由父容器控制 */
    background: transparent !important; /* [关键] 必须透明，否则会有白色底色遮挡圆角 */
    border: none;
    color: #fff;
    outline: none;
    font-size: 14px;
    font-family: inherit;
}

/* 搜索按钮 */
.search-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    cursor: pointer;
    border-radius: 50%;
    transition: 0.3s;
}

.search-btn:active {
    transform: scale(0.9);
}

.search-btn:hover {
    color: #31c27c;
    background-color: rgba(255,255,255,0.05);
}

/* ========================================
   4. Tab 导航栏
   ======================================== */
.tab-header {
    display: flex;
    gap: 35px;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 5px;
}

.tab-item {
    padding: 10px 5px;
    color: #888;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 15px;
    letter-spacing: 0.5px;
}

.tab-item:hover {
    color: #fff;
}

.tab-item.active {
    color: #31c27c;
    border-bottom-color: #31c27c;
}

#tab-my-playlist {
    display: none; /* PC端默认隐藏我的歌单Tab(在侧边栏显示) */
}

/* ========================================
   5. 榜单/分类标签区域
   ======================================== */
#chart-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

#chart-tags-container .nav-item {
    padding: 8px 20px;
    background: #222;
    border-radius: 20px;
    font-size: 13px;
    border: 1px solid #333;
    transition: all 0.2s;
    margin: 0;
    cursor: pointer;
}

#chart-tags-container .nav-item:hover {
    background: #333;
    transform: translateY(-2px);
    border-color: #555;
}

#chart-tags-container .nav-item.active {
    background: #31c27c;
    color: white;
    border-color: #31c27c;
    box-shadow: 0 4px 10px rgba(49, 194, 124, 0.3);
}

/* ========================================
   6. 歌曲列表容器 & 滚动条
   ======================================== */
#song-list-container {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 130px; /* 底部留白，防止被播放条遮挡 */
    padding-right: 5px;
    margin-top: 10px;
    
    /* Firefox 滚动条 */
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    transition: scrollbar-color 0.3s;
}

#song-list-container:hover {
    scrollbar-color: #444 transparent;
}

/* Webkit (Chrome/Edge/Safari) 滚动条 */
#song-list-container::-webkit-scrollbar {
    width: 6px;
}

#song-list-container::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 3px;
}

#song-list-container:hover::-webkit-scrollbar-thumb {
    background: #444;
}

#song-list-container::-webkit-scrollbar-track {
    background: transparent;
}

/* ========================================
   7. 歌曲列表项 (Song Item)
   ======================================== */
.song-item {
    display: grid;
    /* 定义5列宽度: 序号 | 歌名 | 歌手 | 专辑 | 操作 */
    grid-template-columns: 50px 2fr 1.5fr 1.5fr 80px;
    gap: 15px;
    padding: 16px 20px;
    margin-bottom: 6px;
    border-radius: 16px;
    cursor: pointer;
    align-items: center;
    border: 1px solid transparent;
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.song-item:hover {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transform: translateX(5px) scale(1.01);
    border-left: 1px solid rgba(49, 194, 124, 0.5);
}

/* 播放中状态 */
.song-item.playing {
    background: linear-gradient(90deg, rgba(49, 194, 124, 0.15), transparent);
    border-color: rgba(49, 194, 124, 0.1);
    box-shadow: 0 0 20px rgba(49, 194, 124, 0.1);
    animation: playingBreathe 2s ease-in-out infinite alternate;
}

/* 播放中的左侧指示条 */
.song-item.playing::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #31c27c;
    box-shadow: 0 0 10px #31c27c;
}

@keyframes playingBreathe {
    from { box-shadow: 0 0 10px rgba(49, 194, 124, 0.1); }
    to { box-shadow: 0 0 25px rgba(49, 194, 124, 0.3); }
}

/* ========================================
   8. 列表列样式 & 动画
   ======================================== */
.col-index {
    color: #555;
    text-align: center;
    font-family: 'Outfit', monospace;
}

/* 播放中时的音波动画 */
.song-item.playing .col-index {
    font-size: 0; /* 隐藏数字 */
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    height: 16px;
    gap: 2px;
}

.song-item.playing .col-index::before,
.song-item.playing .col-index::after {
    content: '';
    width: 3px;
    background: #31c27c;
    border-radius: 2px;
    animation: soundWave 1s infinite ease-in-out;
}

.song-item.playing .col-index::before {
    height: 10px;
    animation-delay: 0s;
    box-shadow: 5px 0 0 #31c27c;
}

.song-item.playing .col-index::after {
    height: 14px;
    animation-delay: 0.2s;
    margin-left: 5px;
}

@keyframes soundWave {
    0%, 100% { height: 6px; box-shadow: 5px 0 0 #31c27c; }
    50% { height: 16px; box-shadow: 5px -5px 0 #31c27c; }
}

.col-name {
    color: #eee;
    font-weight: 500;
    font-size: 15px;
}

.col-artist,
.col-album {
    color: #888;
    font-size: 13px;
    letter-spacing: 0.3px;
}

.col-action {
    text-align: center;
}

/* ========================================
   9. 通用按钮样式
   ======================================== */
.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: #888;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:active,
.control-btn:active,
.btn-play:active,
.source-select:active {
    transform: scale(0.92) !important;
}

.icon-btn:hover {
    background: #31c27c;
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(49, 194, 124, 0.4);
}
