/* ========================================
   主样式文件 - 模仿QQ音乐风格
   ======================================== */

/* ==================== CSS变量 ==================== */
:root {
    --primary-color: #31c27c;
    --primary-hover: #2caf6f;
    --bg-color: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-dark: #1a1a1a;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border-color: #e8e8e8;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --header-height: 68px;
    --sidebar-width: 200px;
    --player-height: 72px;
}

/* ==================== 顶部导航栏 ==================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header__logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
    margin-right: 48px;
}

.header__logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header__logo-icon svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.header__nav {
    display: flex;
    gap: 8px;
    flex: 1;
}

.header__nav-item {
    padding: 8px 20px;
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.header__nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.header__nav-item--active {
    color: var(--primary-color);
    background: rgba(49, 194, 124, 0.1);
}

.header__search {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header__search-input {
    width: 200px;
    height: 36px;
    padding: 0 16px;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: var(--bg-secondary);
    font-size: 13px;
    transition: all 0.3s ease;
}

.header__search-input:focus {
    border-color: var(--primary-color);
    background: var(--bg-color);
    width: 240px;
}

.header__user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: background 0.3s ease;
}

.header__user:hover {
    background: var(--bg-secondary);
}

.header__user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #2caf6f);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

/* ==================== 主容器 ==================== */
.main {
    margin-top: var(--header-height);
    margin-bottom: var(--player-height);
    min-height: calc(100vh - var(--header-height) - var(--player-height));
    background: var(--bg-color);
}

.main__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* ==================== 轮播图区 ==================== */
.banner {
    position: relative;
    height: 220px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 32px;
}

.banner__slides {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease;
}

.banner__slide {
    min-width: 100%;
    height: 100%;
    position: relative;
}

.banner__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner__dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.banner__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.banner__dot--active {
    width: 24px;
    border-radius: 4px;
    background: white;
}

/* ==================== 分区标题 ==================== */
.section {
    margin-bottom: 40px;
}

.section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section__title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
}

.section__more {
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.section__more:hover {
    color: var(--primary-color);
}

/* ==================== 推荐歌单 ==================== */
.playlists {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.playlist-card {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.playlist-card:hover {
    transform: translateY(-4px);
}

.playlist-card__cover {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 12px;
}

.playlist-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.playlist-card__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
    display: flex;
    align-items: flex-end;
    padding: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.playlist-card:hover .playlist-card__overlay {
    opacity: 1;
}

.playlist-card__play {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.playlist-card__play svg {
    width: 16px;
    height: 16px;
    fill: white;
    margin-left: 2px;
}

.playlist-card__info {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.playlist-card__icon {
    font-size: 12px;
}

.playlist-card__name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==================== 热门歌曲 ==================== */
.songs {
    display: flex;
    flex-direction: column;
}

.song-item {
    display: grid;
    grid-template-columns: 48px 1fr 120px 100px 80px;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.3s ease;
}

.song-item:hover {
    background: var(--bg-secondary);
}

.song-item__num {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
}

.song-item__num--top {
    color: var(--primary-color);
}

.song-item__info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.song-item__cover {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.song-item__detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.song-item__title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.song-item__title:hover {
    color: var(--primary-color);
}

.song-item__tags {
    display: flex;
    gap: 4px;
}

.song-item__tag {
    font-size: 11px;
    padding: 1px 4px;
    border: 1px solid var(--primary-color);
    border-radius: 2px;
    color: var(--primary-color);
}

.song-item__tag--vip {
    background: linear-gradient(135deg, #ff9500, #ff5e00);
    border-color: transparent;
    color: white;
}

.song-item__artist {
    font-size: 13px;
    color: var(--text-secondary);
}

.song-item__album {
    font-size: 13px;
    color: var(--text-secondary);
}

.song-item__duration {
    font-size: 13px;
    color: var(--text-muted);
}

/* ==================== 底部播放栏 ==================== */
.player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--player-height);
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 1000;
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.06);
}

.player__left {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 300px;
}

.player__cover {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.player__cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player__info {
    flex: 1;
    min-width: 0;
}

.player__title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player__artist {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player__center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.player__controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.player__btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.player__btn:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.player__btn--play {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
}

.player__btn--play:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.player__btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.player__btn--play svg {
    width: 20px;
    height: 20px;
}

.player__progress {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 400px;
}

.player__time {
    font-size: 11px;
    color: var(--text-muted);
    min-width: 35px;
}

.player__bar {
    flex: 1;
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.player__bar-current {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 30%;
    background: var(--primary-color);
    border-radius: 2px;
}

.player__bar-thumb {
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.player__bar:hover .player__bar-thumb {
    opacity: 1;
}

.player__right {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 300px;
    justify-content: flex-end;
}

.player__volume {
    display: flex;
    align-items: center;
    gap: 8px;
}

.player__volume-bar {
    width: 80px;
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.player__volume-current {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 70%;
    background: var(--text-muted);
    border-radius: 2px;
}

.player__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player__action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.player__action-btn:hover {
    color: var(--text-primary);
}

.player__action-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1024px) {
    .playlists {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .playlists {
        grid-template-columns: repeat(3, 1fr);
    }

    .header__search-input {
        width: 160px;
    }

    .player__left,
    .player__right {
        width: 200px;
    }
}

@media (max-width: 640px) {
    .playlists {
        grid-template-columns: repeat(2, 1fr);
    }

    .header__search {
        display: none;
    }

    .player__center {
        display: none;
    }

    .song-item {
        grid-template-columns: 32px 1fr;
    }

    .song-item__album,
    .song-item__duration {
        display: none;
    }
}
