/* 基础布局 */
body {
    margin: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f5f6fa;
    color: #222;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: always;
    text-rendering: optimizeLegibility;
}

/* 页面加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.dark-mode .loading-overlay {
    background: #1a1a1a;
}

.light-mode .loading-overlay {
    background: #f5f6fa;
}

.blue-mode .loading-overlay {
    background: #e3f2fd;
}

.green-mode .loading-overlay {
    background: #e8f5e8;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

header {
    background: #2d3e50;
    padding: 0;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    flex-wrap: wrap;
    gap: 1rem;
    position: relative;
    z-index: 100;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: left center;
}


.navbar-left.collapsed {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    transition: all 0.3s ease;
}


.navbar-left.collapsed * {
    display: none !important;
}


.navbar-left.expanded {
    transform: translateX(0);
    opacity: 1;
}

.collapse-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    margin-right: 0.5rem;
}

.collapse-btn:hover {
    background: rgba(255,255,255,0.2);
}

.collapse-btn.active .collapse-icon {
    transform: rotate(90deg);
}

.collapse-icon {
    transition: transform 0.3s ease;
    display: inline-block;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

/* 实时信息展示样式 */
.real-time-info {
    display: flex;
    align-items: center;
    margin-left: auto;
    margin-right: 1rem;
    color: white;
    font-size: 14px;
}

.time-display {
    font-weight: 500;
}

/* 搜索框样式 */
.search-container {
    position: relative;
    margin-left: auto;
    margin-right: 1rem;
    display: flex;
    align-items: center;
}

#searchInput {
    padding: 8px 36px 8px 16px;
    border: none;
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 14px;
    width: 200px;
    transition: all 0.3s ease;
}

#searchInput::placeholder {
    color: rgba(255,255,255,0.7);
}

#searchInput:focus {
    outline: none;
    background: rgba(255,255,255,0.2);
    width: 250px;
}

.search-btn {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    padding: 0 12px;
    background: transparent;
    color: white;
    border: none;
    border-radius: 0 20px 20px 0;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background: rgba(255,255,255,0.2);
}

.search-results {
    position: absolute;
    top: 100%;
    right: 0;
    width: 300px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    margin-top: 5px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.3s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #f8f9fa;
}

.search-result-title {
    font-weight: 500;
    color: #2d3e50;
    margin-bottom: 4px;
}

.search-result-description {
    font-size: 12px;
    color: #666;
}

.nav-item {
    color: #fff;
    text-decoration: none;
    margin: 0 2rem;
    font-size: 1.1rem;
    position: relative;
    transition: color 0.3s;
}

/* 导航悬停动画 */
.nav-item::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: #00b894;
    transition: width 0.3s;
    position: absolute;
    left: 0;
    bottom: -5px;
}
.nav-item:hover {
    color: #00b894;
}
.nav-item:hover::after {
    width: 100%;
}

/* 登录/注册按钮样式 */
.nav-login-btn,
.nav-register-btn {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-weight: 500;
    margin: 0 0.3rem;
    transition: all 0.3s ease;
}

.nav-login-btn {
    background: transparent;
    border: 2px solid #3498db;
    color: #3498db;
}

.nav-login-btn:hover {
    background: #3498db;
    color: #fff;
}

.nav-login-btn:hover::after {
    width: 0;
}

.nav-register-btn {
    background: #3498db;
    border: 2px solid #3498db;
    color: #fff;
}

.nav-register-btn:hover {
    background: #2980b9;
    border-color: #2980b9;
}

.nav-register-btn:hover::after {
    width: 0;
}

/* 登录后用户名样式 */
.settings-dropdown .settings-btn {
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 0.4rem 1rem;
}

/* 动画定义 */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 底部 */
footer {
    text-align: center;
    padding: 2rem 0;
    background: #2d3e50;
    color: #fff;
    font-size: 0.95rem;
}

/* 板块通用样式 */
section {
    margin: 3rem auto;
    max-width: 1000px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 2.5rem 2rem;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

/* 动画激活类 */
.section-visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* 淡出动画 */
.section-hidden {
    opacity: 0 !important;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* 从上方进入的元素（在视口中心上方的元素） */
.section-hidden.top {
    transform: translateY(-40px) !important;
}

/* 板块悬停效果 */
section:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

/* 板块标题样式 */
section h2 {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: #00b894;
    border-radius: 2px;
    transition: width 0.3s ease;
}

section:hover h2::after {
    width: 100px;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 主体左右布局 */
.main-flex {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    max-width: 1200px;
    margin: 3rem auto;
    gap: 2rem;
}
.left {
    flex: 0 0 340px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
}
.right {
    flex: 1 1 0;
    min-width: 0;
}

@media (max-width: 900px) {
    .main-flex {
        flex-direction: column;
    }
    .right {
        order: 0;
        width: 100%;
    }
    .left {
        order: 1;
        margin: 0 auto;
    }
}

/* 响应式布局 */
@media (max-width: 900px) {
    section {
        padding: 2rem 1rem;
    }

    /* 导航栏移动端适配 */
    .navbar {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem 0;
    }

    .nav-item {
        margin: 0.5rem;
        padding: 0.5rem 1rem;
        font-size: 1rem;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 6px;
    }

    /* 音乐播放器和QQ群图片移动端适配 */
    #music-player-container {
        width: 100%;
        max-width: 400px;
    }

    #music-player {
        width: 100% !important;
        height: auto !important;
        min-height: 300px;
    }

    section img {
        width: 100% !important;
        height: auto !important;
        max-width: 400px;
    }
}

/* 禁止文本选择 */
.unselectable
{
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* 网站标题样式 */
.site-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 18px;
    font-weight: bold;
}

.site-title h1 {
    margin: 0;
    font-size: 24px;
    color: white;
}

.site-title span {
    font-size: 14px;
    opacity: 0.9;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.user-type {
    background: #28a745;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    margin-left: 8px;
    display: inline-block;
    vertical-align: middle;
    line-height: 1.4;
    white-space: nowrap;
}

/* 自定义歌单样式 */
#custom-playlist {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    padding: 20px;
    margin-top: 20px;
    width: 100%;
    box-sizing: border-box;
}

#custom-playlist h3 {
    margin-top: 0;
    margin-bottom: 16px;
    color: #2d3e50;
    font-size: 1.2rem;
    font-weight: 600;
}

#custom-playlist h4 {
    margin-top: 20px;
    margin-bottom: 12px;
    color: #555;
    font-size: 1rem;
    font-weight: 500;
}

#playlist-history {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

#history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
}

.history-item span {
    color: #495057;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-btn {
    padding: 4px 10px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s;
}

.history-btn:hover {
    background: #5a6268;
}

#history-list p {
    color: #6c757d;
    font-size: 14px;
    text-align: center;
    padding: 10px;
}

#playlist-input {
    width: 100%;
    max-width: 280px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    margin-right: 12px;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

#playlist-input:focus {
    outline: none;
    border-color: #00b894;
    box-shadow: 0 0 0 2px rgba(0,184,148,0.1);
}

#save-apply-playlist, #reset-playlist {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    margin-right: 8px;
}

#save-apply-playlist {
    background: #00b894;
    color: white;
}

#save-apply-playlist:hover {
    background: #019875;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,184,148,0.2);
}

#reset-playlist {
    background: #6c757d;
    color: white;
}

#reset-playlist:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108,117,125,0.2);
}

#playlist-message {
    margin-top: 12px;
    color: #666;
    font-size: 13px;
    line-height: 1.4;
    min-height: 20px;
}

/* 设置下拉菜单样式 */
.settings-dropdown {
    position: relative;
    display: inline-block;
}

.settings-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.settings-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 1000;
    overflow: hidden;
}

.settings-dropdown-content a {
    color: #333;
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    transition: background 0.3s;
}

.settings-dropdown-content a:hover {
    background: #f5f6fa;
}

.settings-theme {
    padding: 10px 16px;
}

.settings-theme a {
    padding: 4px 8px;
    margin: 0 4px 4px 0;
    border-radius: 4px;
    display: inline-block;
}

.settings-language {
    padding: 10px 16px;
    border-top: 1px solid #eee;
    margin-top: 4px;
}

.settings-language a {
    padding: 4px 8px;
    margin: 0 4px 0 0;
    border-radius: 4px;
    display: inline-block;
}

.lang-coming-soon {
    font-size: 11px;
    color: #999;
    font-style: italic;
    display: inline-block;
    margin-left: 4px;
}

/* 深色模式样式 */
.dark-mode {
    background-color: #1a1a1a;
    color: #f5f5f5;
}

.dark-mode header {
    background-color: #2d3e50;
}

.dark-mode footer {
    background-color: #2d3e50;
    color: #f5f5f5;
}

.dark-mode section {
    background-color: #2c2c2c;
    color: #f5f5f5;
}

.dark-mode #custom-playlist {
    background-color: #2c2c2c;
    color: #f5f5f5;
}

.dark-mode #custom-playlist h3 {
    color: #00b894;
}

.dark-mode #custom-playlist h4 {
    color: #b0b0b0;
}

.dark-mode #playlist-history {
    border-top-color: #444;
}

.dark-mode .history-item {
    background: #444;
}

.dark-mode .history-item span {
    color: #f5f5f5;
}

.dark-mode #history-list p {
    color: #999;
}

.dark-mode #playlist-input {
    background-color: #444;
    border-color: #666;
    color: #f5f5f5;
}

.dark-mode .settings-dropdown-content {
    background-color: #2c2c2c;
    color: #f5f5f5;
}

.dark-mode .settings-dropdown-content a {
    color: #f5f5f5;
}

.dark-mode .settings-dropdown-content a:hover {
    background-color: #444;
}

.dark-mode .settings-language {
    border-top-color: #444;
}

/* 浅色主题样式 */
.light-mode {
    background-color: #f5f6fa;
    color: #222;
}

.light-mode header {
    background-color: #2d3e50;
}

.light-mode footer {
    background-color: #2d3e50;
    color: #fff;
}

.light-mode section {
    background-color: #fff;
    color: #222;
}

.light-mode #custom-playlist {
    background-color: #fff;
    color: #222;
}

.light-mode #custom-playlist h3 {
    color: #2d3e50;
}

.light-mode #custom-playlist h4 {
    color: #555;
}

.light-mode #playlist-history {
    border-top-color: #eee;
}

.light-mode .history-item {
    background: #f8f9fa;
}

.light-mode .history-item span {
    color: #495057;
}

.light-mode #history-list p {
    color: #6c757d;
}

.light-mode #playlist-input {
    background-color: #fff;
    border-color: #ddd;
    color: #222;
}

.light-mode .settings-dropdown-content {
    background-color: #fff;
    color: #333;
}

.light-mode .settings-dropdown-content a {
    color: #333;
}

.light-mode .settings-dropdown-content a:hover {
    background-color: #f5f6fa;
}

.light-mode .settings-language {
    border-top-color: #eee;
}

/* 蓝色主题样式 */
.blue-mode {
    background-color: #e3f2fd;
    color: #1a237e;
}

.blue-mode header {
    background-color: #1976d2;
}

.blue-mode footer {
    background-color: #1976d2;
    color: #fff;
}

.blue-mode section {
    background-color: #fff;
    color: #1a237e;
}

.blue-mode section h2 {
    color: #1976d2;
}

.blue-mode #custom-playlist {
    background-color: #fff;
    color: #1a237e;
}

.blue-mode #custom-playlist h3 {
    color: #1565c0;
}

.blue-mode #custom-playlist h4 {
    color: #1976d2;
}

.blue-mode #playlist-history {
    border-top-color: #bbdefb;
}

.blue-mode .history-item {
    background: #e3f2fd;
}

.blue-mode .history-item span {
    color: #1a237e;
}

.blue-mode #history-list p {
    color: #1976d2;
}

.blue-mode #playlist-input {
    background-color: #fff;
    border-color: #bbdefb;
    color: #1a237e;
}

.blue-mode #playlist-input:focus {
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25,118,210,0.1);
}

.blue-mode .settings-dropdown-content {
    background-color: #fff;
    color: #1a237e;
}

.blue-mode .settings-dropdown-content a {
    color: #1a237e;
}

.blue-mode .settings-dropdown-content a:hover {
    background-color: #e3f2fd;
}

.blue-mode .settings-language {
    border-top-color: #bbdefb;
}

/* 绿色主题样式 */
.green-mode {
    background-color: #e8f5e8;
    color: #2e7d32;
}

.green-mode header {
    background-color: #388e3c;
}

.green-mode footer {
    background-color: #388e3c;
    color: #fff;
}

.green-mode section {
    background-color: #fff;
    color: #2e7d32;
}

.green-mode section h2 {
    color: #388e3c;
}

.green-mode #custom-playlist {
    background-color: #fff;
    color: #2e7d32;
}

.green-mode #custom-playlist h3 {
    color: #2e7d32;
}

.green-mode #custom-playlist h4 {
    color: #388e3c;
}

.green-mode #playlist-history {
    border-top-color: #c8e6c9;
}

.green-mode .history-item {
    background: #e8f5e8;
}

.green-mode .history-item span {
    color: #2e7d32;
}

.green-mode #history-list p {
    color: #388e3c;
}

.green-mode #playlist-input {
    background-color: #fff;
    border-color: #c8e6c9;
    color: #2e7d32;
}

.green-mode #playlist-input:focus {
    border-color: #388e3c;
    box-shadow: 0 0 0 2px rgba(56,142,60,0.1);
}

.green-mode .settings-dropdown-content {
    background-color: #fff;
    color: #2e7d32;
}

.green-mode .settings-dropdown-content a {
    color: #2e7d32;
}

.green-mode .settings-dropdown-content a:hover {
    background-color: #e8f5e8;
}

.green-mode .settings-language {
    border-top-color: #c8e6c9;
}

/* 响应式调整 */
@media (max-width: 900px), (orientation: portrait) {
    /* 实时信息显示在移动端的适配 */
    .real-time-info {
        order: 2;
        margin: 0.5rem auto;
        width: calc(100% - 1rem);
        justify-content: center;
        font-size: 12px;
        gap: 1rem;
    }

    .time-display {
        font-size: 12px;
    }

    /* 搜索框在移动端的适配 */
    .search-container {
        order: 3;
        margin: 0.5rem auto;
        width: calc(100% - 1rem);
    }

    #searchInput {
        width: 100%;
        max-width: none;
    }

    /* 导航项在移动端和竖屏设备的适配 */
    .navbar {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 0.5rem;
    }

    .nav-item {
        margin: 0;
        padding: 0.8rem 1rem;
        text-align: center;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 6px;
        flex: 1 1 auto;
        min-width: 100px;
        max-width: calc(50% - 0.75rem);
    }

    /* 设置按钮在移动端和竖屏设备的适配 */
    .settings-dropdown {
        order: 1;
        margin: 0.5rem auto 0;
        width: calc(100% - 1rem);
        text-align: center;
    }
}

@media (max-width: 480px), (orientation: portrait) and (max-height: 600px) {
    /* 导航栏适配 */
    .navbar {
        gap: 0.25rem;
        padding: 0.25rem 0.5rem;
    }

    .nav-item {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
        max-width: calc(50% - 0.375rem);
        min-width: 80px;
    }

    /* 优化小高度竖屏设备上的设置按钮 */
    .settings-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    /* 自定义歌单样式适配 */
    #playlist-input {
        max-width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }

    #save-apply-playlist, #reset-playlist {
        width: calc(50% - 6px);
        margin-right: 6px;
        margin-bottom: 6px;
        font-size: 14px;
        padding: 8px 12px;
    }

    #reset-playlist {
        margin-right: 0;
    }

    /* 歌单历史记录适配 */
    #playlist-history {
        margin-top: 15px;
        padding-top: 12px;
    }

    #custom-playlist h4 {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }

    .history-item {
        padding: 6px 10px;
        font-size: 13px;
    }

    .history-btn {
        padding: 3px 8px;
        font-size: 11px;
    }

    /* 音乐播放器适配 */
    #music-player-container {
        max-width: 100%;
    }

    #music-player {
        min-height: 250px;
    }
}
