:root {
    --primary-color: #4a6cf7;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #e2e8f0;
    --border-color: #334155;
    --hover-color: #2d3748;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏 */
header {
    background-color: var(--card-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.logo-icon {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    border-radius: 8px;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo-icon img, .footer-logo-icon img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 25px;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

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

.nav-right {
    display: flex;
    align-items: center;
}

.theme-toggle, .hamburger {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: 15px;
}

/* 英雄区域 */
.hero {
    background: linear-gradient(135deg, var(--primary-color), #6a11cb);
    padding: 80px 0;
    text-align: center;
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 15px;
}

.hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

/* 镜像选择器 */
.mirror-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.mirror-selector label {
    font-weight: 500;
    color: var(--primary-color);
}

.mirror-selector select {
    background-color: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.9rem;
    min-width: 200px;
    transition: all 0.3s;
}

.mirror-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 108, 247, 0.2);
}

.mirror-selector select:hover {
    border-color: var(--primary-color);
}

.mirror-info {
    margin-left: auto;
    font-size: 0.8rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 5px;
}

.mirror-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981;
}

.status-dot.loading {
    background-color: #f59e0b;
    animation: pulse 1.5s infinite;
}

.status-dot.error {
    background-color: #ef4444;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.test-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.test-button:hover {
    background-color: #3a5bd9;
}

.test-button:disabled {
    background-color: #64748b;
    cursor: not-allowed;
}

.speed-test-button {
    background-color: #10b981;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-left: 5px;
}

.speed-test-button:hover {
    background-color: #0da271;
}

.speed-test-button:disabled {
    background-color: #64748b;
    cursor: not-allowed;
}

/* 测速结果面板 */
.speed-test-results {
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    display: none;
}

.speed-test-results.active {
    display: block;
}

.speed-test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.speed-test-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--primary-color);
}

.speed-test-close {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 1rem;
}

.speed-test-results table {
    width: 100%;
    border-collapse: collapse;
}

.speed-test-results th,
.speed-test-results td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.speed-test-results th {
    font-weight: 500;
    color: #94a3b8;
}

.speed-test-results tr:hover {
    background-color: var(--hover-color);
}

.speed-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
}

.speed-rank-1 {
    background-color: #f59e0b;
}

.speed-rank-2 {
    background-color: #64748b;
}

.speed-rank-3 {
    background-color: #a16207;
}

.speed-value {
    font-weight: 500;
}

.speed-good {
    color: #10b981;
}

.speed-medium {
    color: #f59e0b;
}

.speed-slow {
    color: #ef4444;
}

.recommended-badge {
    display: inline-block;
    background-color: #10b981;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    margin-left: 5px;
}

/* 音乐库布局 */
.music-library {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

.folders-panel {
    flex: 0 0 250px;
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 20px;
    height: fit-content;
}

.songs-panel {
    flex: 1;
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 20px;
}

.playlist-panel {
    flex: 0 0 300px;
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 20px;
    height: fit-content;
}

.panel-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 文件夹列表 */
.folder-list {
    list-style: none;
}

.folder-item {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
}

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

.folder-item.active {
    background-color: var(--primary-color);
}

.folder-icon {
    margin-right: 10px;
    font-size: 1.1rem;
}

/* 歌曲列表 */
.song-list {
    list-style: none;
}

.song-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: background-color 0.3s;
    cursor: pointer;
}

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

.song-item.playing {
    background-color: rgba(74, 108, 247, 0.2);
    border-left: 3px solid var(--primary-color);
}

.song-info {
    flex: 1;
}

.song-title {
    font-weight: 500;
    margin-bottom: 5px;
}

.song-artist {
    font-size: 0.9rem;
    color: #94a3b8;
}

.song-duration {
    color: #94a3b8;
    margin: 0 15px;
}

.song-actions {
    display: flex;
    gap: 10px;
}

.btn {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.3s;
}

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

/* 播放列表 */
.playlist-items {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.playlist-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: background-color 0.3s;
}

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

.playlist-item .song-info {
    flex: 1;
}

.playlist-item .btn-remove {
    color: #f87171;
}

/* 播放器控制 */
.player-controls {
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 20px;
    position: sticky;
    bottom: 20px;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
}

.current-song {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.current-song-info {
    flex: 1;
    margin-left: 15px;
}

.current-song-title {
    font-weight: 500;
    font-size: 1.1rem;
}

.current-song-artist {
    color: #94a3b8;
    font-size: 0.9rem;
}

.progress-container {
    margin-bottom: 15px;
}

.progress-bar {
    height: 5px;
    background-color: var(--border-color);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 5px;
    cursor: pointer;
}

.progress {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
}

.time-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #94a3b8;
}

.control-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.control-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.3s;
}

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

.control-btn.play-pause {
    background-color: var(--primary-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
}

/* 音量控制 */
.volume-control {
    display: flex;
    align-items: center;
    position: relative;
}

.volume-slider-container {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--card-bg);
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 10;
}

.volume-control:hover .volume-slider-container {
    display: block;
}

.volume-slider {
    width: 100px;
    height: 5px;
    -webkit-appearance: none;
    background: var(--border-color);
    border-radius: 5px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
}

/* 页脚 */
footer {
    background-color: var(--card-bg);
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 30px;
}

.footer-column {
    flex: 1;
    min-width: 200px;
    margin-bottom: 20px;
}

.footer-logo {
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.footer-logo-icon {
    width: 30px;
    height: 30px;
    margin-right: 10px;
    border-radius: 5px;
}

.footer-column h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column ul li a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-column ul li a:hover {
    color: var(--primary-color);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    width: 70%;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: #94a3b8;
    font-size: 0.9rem;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 20px;
    color: #94a3b8;
}

.loading i {
    font-size: 2rem;
    margin-bottom: 10px;
}

/* 缓存指示器 */
.cache-indicator {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 5px;
}

.cache-indicator.cached {
    color: #10b981;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .music-library {
        flex-direction: column;
    }
    
    .folders-panel, .playlist-panel {
        flex: 1;
    }

    .footer-links {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }

    .footer-links {
        flex-direction: column;
    }
    
    .mirror-selector {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .mirror-info {
        margin-left: 0;
        width: 100%;
        justify-content: space-between;
    }

    .speed-test-results table {
        font-size: 0.8rem;
    }
}
