/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a1a;
    color: #ffffff;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 250px;
    background: #2a2a2a;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: calc(100vh - 80px);
    left: 0;
    top: 0;
}

.logo {
    padding: 20px;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #404040;
}

.logo i {
    color: #1db954;
}

.nav-menu {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    color: #b3b3b3;
    text-decoration: none;
    transition: all 0.3s;
}

.nav-item:hover, .nav-item.active {
    background: #404040;
    color: #ffffff;
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.server-info {
    padding: 20px;
    border-top: 1px solid #404040;
    font-size: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

/* 主内容区 */
.main-content {
    margin-left: 250px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #2a2a2a;
    border-bottom: 1px solid #404040;
}

.search-box {
    display: flex;
    background: #404040;
    border-radius: 25px;
    overflow: hidden;
}

.search-box input {
    background: transparent;
    border: none;
    padding: 10px 20px;
    color: white;
    width: 300px;
    outline: none;
}

.search-box button {
    background: transparent;
    border: none;
    padding: 10px 15px;
    color: #b3b3b3;
    cursor: pointer;
}

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

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary {
    background: #1db954;
    color: white;
}

.btn-primary:hover {
    background: #1ed760;
}

.btn-secondary {
    background: #535353;
    color: white;
}

.btn-secondary:hover {
    background: #666666;
}

.btn-icon {
    background: transparent;
    border: none;
    color: #b3b3b3;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s;
}

.btn-icon:hover {
    color: white;
    background: #404040;
}

.btn-play-pause {
    background: white;
    border: none;
    color: black;
    cursor: pointer;
    padding: 12px;
    border-radius: 50%;
    transition: all 0.3s;
}

.btn-play-pause:hover {
    transform: scale(1.05);
}

/* 内容区域 */
.content-area {
    flex: 1;
    overflow: auto;
    padding: 20px;
    background: #121212;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

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

.section-header h2 {
    font-size: 24px;
    font-weight: bold;
}

/* 歌曲列表 */
.songs-list {
    background: #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #404040;
}

th {
    background: #404040;
    font-weight: 600;
    color: #b3b3b3;
}

tbody tr:hover {
    background: #404040;
}

.song-row {
    cursor: pointer;
}

.song-row.playing {
    background: #1db95420;
    color: #1db954;
}

/* 网格布局 */
.artists-grid, .albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.artist-card, .album-card {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.artist-card:hover, .album-card:hover {
    background: #404040;
    transform: translateY(-2px);
}

.artist-avatar, .album-cover {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #404040;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #b3b3b3;
}

.album-cover {
    border-radius: 8px;
}

.artist-name, .album-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.artist-count, .album-info {
    font-size: 12px;
    color: #b3b3b3;
}

/* 播放器控制栏 */
.player-bar {
    height: 80px;
    background: #181818;
    border-top: 1px solid #282828;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
}

.now-playing {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 30%;
}

.album-art {
    width: 56px;
    height: 56px;
}

.album-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.track-info {
    flex: 1;
}

.track-title {
    font-weight: bold;
    margin-bottom: 4px;
}

.track-artist {
    font-size: 12px;
    color: #b3b3b3;
}

.player-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 40%;
}

.control-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 8px;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.progress-bar {
    flex: 1;
}

.volume-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 30%;
    justify-content: flex-end;
}

.volume-container {
    width: 100px;
}

/* 滑块样式 */
.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: #535353;
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
}

.slider:hover::-webkit-slider-thumb {
    opacity: 1;
}

.progress-bar:hover .slider {
    background: #1db954;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.modal-content {
    background: #2a2a2a;
    margin: 15% auto;
    padding: 0;
    border-radius: 8px;
    width: 400px;
    max-width: 90%;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #404040;
}

.close-modal {
    background: none;
    border: none;
    color: #b3b3b3;
    font-size: 24px;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

.modal-body input {
    width: 100%;
    padding: 10px;
    background: #404040;
    border: 1px solid #535353;
    border-radius: 4px;
    color: white;
    outline: none;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #404040;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 加载指示器 */
.loading {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1db954;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}
/* 分页控件样式 */
.pagination-info {
    padding: 10px 0;
    color: #b3b3b3;
    font-size: 14px;
    border-bottom: 1px solid #404040;
    margin-bottom: 15px;
}

.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-top: 1px solid #404040;
    margin-top: 20px;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-pagination {
    background: #404040;
    border: none;
    color: #b3b3b3;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-pagination:hover:not(:disabled) {
    background: #535353;
    color: white;
}

.btn-pagination:disabled {
    background: #2a2a2a;
    color: #666666;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 5px;
    margin: 0 10px;
}

.page-number {
    background: #404040;
    border: none;
    color: #b3b3b3;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 40px;
}

.page-number:hover {
    background: #535353;
    color: white;
}

.page-number.active {
    background: #1db954;
    color: white;
}

.page-jump {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #b3b3b3;
    font-size: 14px;
}

.page-jump input {
    background: #404040;
    border: 1px solid #535353;
    color: white;
    padding: 6px 8px;
    border-radius: 4px;
    width: 60px;
    text-align: center;
}

.page-jump input:focus {
    outline: none;
    border-color: #1db954;
}

/* 排序和页面大小控件 */
.sort-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.sort-select, .sort-order, .page-size-select {
    background: #404040;
    border: 1px solid #535353;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.sort-select:focus, .sort-order:focus, .page-size-select:focus {
    outline: none;
    border-color: #1db954;
}

.sort-order {
    width: 80px;
}

.page-size-select {
    width: 100px;
}

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

.loading-row td {
    border: none;
}

.no-songs {
    text-align: center;
    padding: 40px;
    color: #b3b3b3;
    font-style: italic;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .pagination-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .page-jump {
        order: -1;
    }
    
    .sort-controls {
        flex-wrap: wrap;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }
    
    .sidebar .logo span,
    .sidebar .nav-item span {
        display: none;
    }
    
    .main-content {
        margin-left: 70px;
    }
    
    .now-playing,
    .volume-controls {
        width: 25%;
    }
    
    .player-controls {
        width: 50%;
    }
}

/* 歌曲列表额外样式 */
.song-title {
    font-weight: bold;
}

.track-number {
    font-size: 11px;
    color: #b3b3b3;
    margin-top: 2px;
}

.album-name {
    font-weight: 500;
}

.album-year {
    font-size: 11px;
    color: #b3b3b3;
    margin-top: 2px;
}

/* 搜索分页样式 */
.search-pagination {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.page-info {
    color: #b3b3b3;
    font-size: 14px;
    margin: 0 15px;
}

.page-ellipsis {
    color: #b3b3b3;
    padding: 8px 5px;
}

/* 表格滚动容器 */
.songs-list-container {
    max-height: calc(100vh - 300px);
    overflow-y: auto;
}

/* 自定义滚动条 */
.songs-list-container::-webkit-scrollbar {
    width: 8px;
}

.songs-list-container::-webkit-scrollbar-track {
    background: #2a2a2a;
}

.songs-list-container::-webkit-scrollbar-thumb {
    background: #404040;
    border-radius: 4px;
}

.songs-list-container::-webkit-scrollbar-thumb:hover {
    background: #535353;
}

/* FFmpeg 状态样式 */
.ffmpeg-status {
    padding: 15px 0;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #404040;
}

.status-item:last-child {
    border-bottom: none;
}

.status-item .label {
    color: #b3b3b3;
    font-weight: 500;
}

.status-item .value {
    font-weight: bold;
}

.status-item .value.enabled,
.status-item .value.available {
    color: #1db954;
}

.status-item .value.disabled,
.status-item .value.unavailable {
    color: #e74c3c;
}

.ffmpeg-status .warning {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid #e74c3c;
    border-radius: 4px;
    padding: 12px;
    margin-top: 15px;
}

.ffmpeg-status .warning p {
    margin: 5px 0;
    color: #e74c3c;
}

/* APE 和无损格式特殊样式 */
.lossless-format {
    background: rgba(29, 185, 84, 0.05) !important;
}

.lossless-format:hover {
    background: rgba(29, 185, 84, 0.1) !important;
}

.lossless-format.playing {
    background: rgba(29, 185, 84, 0.15) !important;
}
.modal-overlay {
    position: absolute;
    margin: auto;
    top: -15%;
    bottom: 0;
    left: 0;
    right: 0;
}
/* 格式警告对话框 */
.modal-overlay.warning-overlay {
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.format-warning {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    border-left: 4px solid #e74c3c;
}

.format-warning h3 {
    color: #e74c3c;
    margin-bottom: 15px;
    font-size: 20px;
}

.format-warning p {
    margin-bottom: 10px;
    line-height: 1.5;
}

.warning-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* 格式标签 */
.format-tag {
    display: inline-block;
    background: #404040;
    color: #b3b3b3;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    margin-left: 8px;
    vertical-align: middle;
}

.format-tag.lossless {
    background: #1db954;
    color: white;
}

/* 歌曲格式信息 */
.song-format {
    font-size: 11px;
    color: #b3b3b3;
    margin-top: 2px;
}

/* 下载按钮样式 */
.btn-icon.download-active {
    color: #1db954;
}

/* 网络状态指示器 */
.network-status {
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.network-status.excellent {
    background: rgba(29, 185, 84, 0.9);
    color: white;
}

.network-status.good {
    background: rgba(255, 193, 7, 0.9);
    color: black;
}

.network-status.poor {
    background: rgba(231, 76, 60, 0.9);
    color: white;
}

/* 缓冲进度条 */
.buffer-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(29, 185, 84, 0.3);
    width: 0%;
    transition: width 0.3s ease;
    z-index: 1;
}

.progress-container {
    position: relative;
}

/* 播放质量指示器 */
.quality-indicator {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    background: #404040;
    color: #b3b3b3;
}

.quality-indicator.high {
    background: #1db954;
    color: white;
}

.quality-indicator.lossless {
    background: #9b59b6;
    color: white;
}

/* 连接状态 */
.connection-status {
    position: fixed;
    bottom: 80px;
    right: 20px;
    padding: 10px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 12px;
    z-index: 1000;
    display: none;
}

.connection-status.visible {
    display: block;
}

/* 统计信息面板 */
.stats-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 20px;
    border-radius: 8px;
    color: white;
    z-index: 1001;
    display: none;
}

.stats-panel.visible {
    display: block;
}

.stats-item {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
}

.stats-label {
    color: #b3b3b3;
}

.stats-value {
    font-weight: bold;
}

/* 艺术家网格布局 */
.artists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.artist-card {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid #404040;
}

.artist-card:hover {
    background: #404040;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.artist-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1db954, #1a7cff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.artist-info {
    flex: 1;
}

.artist-name {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
    color: white;
}

.artist-stats {
    font-size: 12px;
    color: #b3b3b3;
    display: flex;
    gap: 8px;
}

.artist-actions {
    display: flex;
    gap: 5px;
    opacity: 0.75;
    transition: opacity 0.3s;
}

.artist-card:hover .artist-actions {
    opacity: 1;
}

/* 艺术家详情 */
.artist-detail {
    padding: 10px 0;
}

.artist-stats-overview {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #404040;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 28px;
    font-weight: bold;
    color: #1db954;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: #b3b3b3;
    margin-top: 5px;
}

.top-albums {
    margin-bottom: 25px;
}

.top-albums h4 {
    margin-bottom: 15px;
    color: white;
    font-size: 16px;
}

.albums-grid.compact {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.album-card.compact {
    padding: 12px;
    text-align: center;
}

.album-card.compact .album-cover {
    width: 80px;
    height: 80px;
    margin: 0 auto 8px;
    font-size: 24px;
}

.album-card.compact .album-name {
    font-size: 12px;
    line-height: 1.3;
    height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.album-card.compact .album-song-count {
    font-size: 10px;
    color: #b3b3b3;
    margin-top: 2px;
}

.artist-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* 大模态框 */
.modal-content.large {
    width: 600px;
    max-width: 90vw;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .artists-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 12px;
    }
    
    .artist-card {
        padding: 15px;
    }
    
    .artist-avatar {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .artist-stats-overview {
        gap: 20px;
    }
    
    .stat-number {
        font-size: 24px;
    }
}