/* ========================================================
   css/right.css - 右侧曲目表格、响应式自适应排版与浮动批量操作 (遵照 SITE_ARCHITECTURE.md)
   ======================================================== */

.detail-panel {
    width: 100%;
    max-width: 100%;
    flex: 1 1 100%;
    min-width: 0;
    background-color: var(--bg-surface);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    position: relative;
}

/* 实体总览栏 (当前选中的 歌单 或 专辑) */
.detail-header {
    padding: 8px 12px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
}

.detail-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.detail-title-group h2 {
    font-size: var(--fs-t1);
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.detail-subtitle {
    font-size: var(--fs-t3);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.btn-action-icon {
    width: 28px;
    height: 26px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-t3);
    border-radius: 4px;
    cursor: pointer;
    background: var(--bg-surface-hover);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: all 0.15s ease;
}

.btn-action-icon:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.05);
}

.btn-action-icon.btn-play-all {
    background-color: var(--accent-apple);
    border-color: var(--accent-apple);
    color: #fff;
}

.btn-action-icon.btn-play-all:hover {
    opacity: 0.9;
    color: #fff;
}

.btn-action-icon.active {
    color: var(--accent-apple);
    border-color: var(--accent-apple);
    background-color: rgba(250, 45, 72, 0.12);
}

/* 详情主体滚动区 */
.detail-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

/* ========================================================
   曲目列表表格：纯图标、自适应流式排版、序号/Checkbox切换
   ======================================================== */
.track-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-t2);
}

.track-table th {
    background-color: rgba(0, 0, 0, 0.25);
    color: var(--text-muted);
    font-weight: 500;
    text-align: left;
    padding: 6px 8px;
    border-bottom: 1px solid var(--border-color);
    font-size: var(--fs-t4);
    position: sticky;
    top: 0;
    z-index: 2;
}

.track-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    vertical-align: middle;
}

.track-table tr {
    transition: background-color 0.12s ease;
}

.track-table tr:hover td {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
}

.track-row-playing td {
    background-color: rgba(126, 231, 135, 0.08) !important;
}

.track-row-playing .track-name {
    color: #7ee787 !important;
    font-weight: 700;
}

/* 第一列：序号 / 复选框 切换列 */
.track-index-col {
    width: 32px;
    min-width: 32px;
    text-align: center;
    position: relative;
}

.track-index-num {
    font-family: var(--font-mono);
    font-size: var(--fs-t4);
    color: var(--text-muted);
    display: inline-block;
}

.track-checkbox {
    display: none;
    cursor: pointer;
    accent-color: var(--accent-apple);
    width: 14px;
    height: 14px;
    vertical-align: middle;
}

/* 仅在多选模式激活时显现首列复选框，非多选模式保持纯数字序号防误触 */
.multi-select-mode .track-index-num {
    display: none !important;
}
.multi-select-mode .track-checkbox {
    display: inline-block !important;
}

/* 选中行柔和背景高亮 */
.track-row-selected {
    background-color: rgba(88, 166, 255, 0.08) !important;
}

/* 第二列：歌曲名与歌手自适应布局 (flex-wrap)
   默认同行：歌曲名 · 歌手名
   宽度不足或超长时：歌手名自然下沉折行到正下方 */
.track-info-cell {
    width: 100%;
}

.track-title-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 6px;
    line-height: 1.35;
}

.track-name {
    font-size: var(--fs-t2);
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
}

.track-artist {
    font-size: var(--fs-t3);
    color: var(--text-muted);
    word-break: break-word;
}

/* 专辑列 */
.track-album-col {
    font-size: var(--fs-t3);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

@media (max-width: 768px) {
    .track-album-col {
        display: none;
    }
}

/* 时长列 */
.track-duration-col {
    width: 45px;
    font-family: var(--font-mono);
    font-size: var(--fs-t4);
    color: var(--text-muted);
    text-align: right;
    white-space: nowrap;
}

/* 操作列 */
.track-action-col {
    width: 72px;
    text-align: right;
    white-space: nowrap;
}

.btn-track-action {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: var(--fs-t3);
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: all 0.12s ease;
}

.btn-track-action:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-track-action.play-song {
    color: var(--success);
}
.btn-track-action.play-song:hover {
    background-color: rgba(63, 185, 80, 0.15);
}

.btn-track-action.del-song:hover {
    color: #ff7588;
}

/* 占位与空状态 */
.placeholder-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
    gap: 6px;
    padding: 24px;
    font-size: var(--fs-t3);
}

.loading-state {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: var(--fs-t3);
}
