/* ============================
   Music Works — 音乐作品库
   浏览 / 搜索 / 收藏 / 播放 / 删除
   ============================ */

.music-works-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.mw-back-link {
    display: inline-block;
    color: #4a90d9;
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: color 0.2s;
}
.mw-back-link:hover {
    color: #357abd;
}

.music-works-page h1 {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
}

.music-works-page > p {
    font-size: 14px;
    color: #888;
    margin: 0 0 20px 0;
}

/* ============================
   工具栏：Tab + 搜索 + 刷新
   ============================ */
.mw-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.mw-tabs {
    display: inline-flex;
    gap: 0;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
}

.mw-tab {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    background: #fff;
    border: none;
    border-right: 1px solid #e8e8e8;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    outline: none;
}
.mw-tab:last-child {
    border-right: none;
}
.mw-tab:hover {
    color: #F18D24;
    background: #fafafa;
}
.mw-tab.active {
    color: #fff;
    background: #4a90d9;
    border-color: #4a90d9;
}
.mw-tab.active + .mw-tab {
    border-left-color: #4a90d9;
}

.mw-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mw-search input {
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 14px;
    color: #333;
    background: #fff;
    outline: none;
    width: 200px;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}
.mw-search input:focus {
    border-color: #4a90d9;
    box-shadow: 0 0 0 2px rgba(74,144,217,0.15);
}
.mw-search input::placeholder {
    color: #bbb;
}

.mw-btn-refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    color: #888;
}
.mw-btn-refresh:hover {
    border-color: #4a90d9;
    color: #4a90d9;
    background: #f0f7ff;
}

/* ============================
   元信息
   ============================ */
.mw-meta {
    font-size: 13px;
    color: #999;
    margin-bottom: 16px;
}

/* ============================
   卡片网格 — 3列
   ============================ */
.mw-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

/* ============================
   卡片
   ============================ */
.mw-card {
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 16px;
    background: #fff;
    transition: box-shadow 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.mw-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.mw-card-header {
    min-height: 24px;
}

.mw-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
}

.mw-card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mw-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: #888;
}

.mw-card-type {
    padding: 2px 8px;
    background: #f0f5ff;
    border-radius: 4px;
    color: #4a90d9;
    font-size: 11px;
    white-space: nowrap;
}

.mw-card-duration {
    white-space: nowrap;
}

.mw-card-date {
    white-space: nowrap;
    color: #bbb;
}

.mw-card-player {
    display: flex;
    align-items: center;
}

.mw-play-btn {
    padding: 6px 14px;
    border: 1px solid #4a90d9;
    border-radius: 6px;
    background: #f0f7ff;
    color: #4a90d9;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.mw-play-btn:hover {
    background: #4a90d9;
    color: #fff;
}
.mw-play-btn.playing {
    background: #F18D24;
    border-color: #F18D24;
    color: #fff;
}

.mw-audio {
    display: none;
}

.mw-card-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid #f5f5f5;
}

.mw-fav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}
.mw-fav-btn:hover {
    border-color: #ff4d4f;
    background: #fff2f0;
}
.mw-fav-btn.favorited {
    border-color: #ff4d4f;
    background: #fff2f0;
}

.mw-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}
.mw-delete-btn:hover {
    border-color: #ff4d4f;
    background: #fff2f0;
}

/* ============================
   分页器
   ============================ */
.mw-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.mw-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    background: #fff;
    color: #555;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.mw-page-btn:hover:not(:disabled):not(.active) {
    border-color: #4a90d9;
    color: #4a90d9;
}
.mw-page-btn.active {
    background: #4a90d9;
    color: #fff;
    border-color: #4a90d9;
    cursor: default;
}
.mw-page-btn:disabled {
    color: #ccc;
    cursor: not-allowed;
    border-color: #eee;
}

/* ============================
   加载 / 空状态
   ============================ */
.mw-loading {
    grid-column: 1 / -1;
    padding: 60px 20px;
    text-align: center;
    color: #888;
    font-size: 15px;
}

.mw-empty {
    grid-column: 1 / -1;
    padding: 60px 20px;
    text-align: center;
    color: #aaa;
    font-size: 15px;
}
.mw-empty a {
    color: #4a90d9;
    text-decoration: underline;
    cursor: pointer;
}
.mw-empty a:hover {
    color: #357abd;
}

/* ============================
   响应式
   ============================ */
@media (max-width: 900px) {
    .mw-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .mw-grid {
        grid-template-columns: 1fr;
    }
    .mw-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .mw-toolbar-right {
        justify-content: stretch;
    }
    .mw-search input {
        width: 100%;
        box-sizing: border-box;
    }
    .mw-tabs {
        justify-content: center;
    }
}
