/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 55Y 主题配色变量 */
:root {
    --bg-main: #12141d;
    --bg-dark: #1a1d26;
    --bg-card: #22262e;
    --primary: #00d4ff;
    --secondary: #9d00ff;
    --text-white: #ffffff;
    --text-gray: #a0a0a0;
    --hover-card: #2a2f3b;
}

body.dark-theme {
    background-color: var(--bg-main);
    color: var(--text-white);
    font-family: "Microsoft Yahei", sans-serif;
    /* 底部留出播放器高度，防止内容被遮挡 */
    padding-bottom: 80px;
    min-height: 100vh;
}

/* 全局内容容器 - 统一居中 + 限制最大宽度（核心居中） */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* 顶部导航栏 - 吸顶导航 */
.nav-bar {
    background-color: var(--bg-dark);
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.nav-bar .container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    color: var(--primary);
}

.logo img {
    height: 40px;
    margin-right: 10px;
}

.menu a {
    color: var(--text-white);
    text-decoration: none;
    margin: 0 15px;
    font-size: 16px;
    transition: color 0.3s ease;
}

.menu a.active,
.menu a:hover {
    color: var(--primary);
}

.user-actions {
    display: flex;
    align-items: center;
}

.user-actions .btn-login {
    color: var(--text-white);
    margin-right: 15px;
    text-decoration: none;
    transition: color 0.3s;
}
.user-actions .btn-login:hover {
    color: var(--primary);
}

.user-actions .btn-reg {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    text-decoration: none;
    transition: opacity 0.3s;
}
.user-actions .btn-reg:hover {
    opacity: 0.9;
}

/* 轮播区域 */
.banner {
    margin: 20px auto;
    border-radius: 15px;
    overflow: hidden;
    height: 300px;
    position: relative;
}

.banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.banner-text {
    position: absolute;
    bottom: 40px;
    left: 40px;
    z-index: 2;
}

.banner-text h2 {
    font-size: 36px;
    margin-bottom: 10px;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.banner-text p {
    font-size: 18px;
    opacity: 0.9;
}

/* 板块通用样式 */
.rank-section,
.category-section {
    margin: 40px auto;
}

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

.section-header h2 {
    font-size: 24px;
    color: var(--primary);
}

.more {
    color: var(--text-gray);
    text-decoration: none;
    transition: color 0.3s;
}
.more:hover {
    color: var(--primary);
}

/* 歌曲列表 */
.song-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.song-item {
    background-color: var(--bg-card);
    height: 80px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.song-item:hover {
    background-color: var(--hover-card);
}

.rank-num {
    width: 30px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    color: var(--text-gray);
}

.rank-num.top {
    color: var(--secondary);
}

.song-cover {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    margin: 0 15px;
    position: relative;
    overflow: hidden;
}

.song-cover img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
    display: block;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    color: white;
    background: rgba(0,0,0,0.5);
    width: 100%;
    height: 100%;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.song-cover:hover .play-icon {
    opacity: 1;
}

.song-info {
    flex: 1;
}

.song-name {
    font-size: 16px;
    margin-bottom: 5px;
}

.song-artist {
    font-size: 14px;
    color: var(--text-gray);
}

.song-play {
    color: var(--text-gray);
    font-size: 14px;
    margin-right: 20px;
}

.song-actions i {
    font-size: 18px;
    color: var(--text-gray);
    margin-left: 15px;
    cursor: pointer;
    transition: color 0.3s;
}

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

/* 分类模块 */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.category-item {
    background-color: var(--bg-card);
    height: 100px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    text-decoration: none;
    transition: all 0.3s ease;
}

.category-item:hover {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    transform: translateY(-5px);
}

.category-item i {
    font-size: 30px;
    margin-bottom: 10px;
}

/* 底部固定播放器 */
.player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background-color: var(--bg-dark);
    display: flex;
    align-items: center;
    padding: 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
    z-index: 999;
}

.player-bar .container {
    height: 100%;
    display: flex;
    align-items: center;
}

.player-info {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.player-cover {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    margin-right: 15px;
    object-fit: cover;
}

.player-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.player-name {
    font-size: 16px;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-progress {
    width: 300px;
    height: 4px;
    background-color: #333;
    border-radius: 2px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 30%;
    transition: width 0.1s linear;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 0 30px;
}

.player-controls button {
    background: none;
    border: none;
    color: var(--text-white);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s;
}
.player-controls button:hover {
    color: var(--primary);
}

.play-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary), var(--secondary)) !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-volume {
    font-size: 20px;
    color: var(--text-white);
    cursor: pointer;
}
.player-volume:hover {
    color: var(--primary);
}

/* 移动端响应式适配 */
@media (max-width: 768px) {
    .nav-bar {
        height: auto;
        flex-wrap: wrap;
    }
    .menu {
        margin: 10px 0;
    }
    .menu a {
        margin: 0 8px;
        font-size: 14px;
    }
    .banner {
        height: 180px;
    }
    .banner-text h2 {
        font-size: 22px;
    }
    .player-progress {
        width: 120px;
    }
    .player-controls {
        gap: 10px;
        margin: 0 15px;
    }
    .play-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* 退出登录按钮样式 */
.user-actions .logout-btn {
    background: #ff5555;
    color: #fff;
    padding: 8px 18px;
    border-radius: 20px;
    text-decoration: none;
    transition: background 0.3s ease;
}
.user-actions .logout-btn:hover {
    background: #e03e3e;
}