/* 主样式文件 */

/* 全局加载状态 */
.api-loading {
    cursor: wait;
}

.api-loading * {
    pointer-events: none;
}

/* 全局加载指示器 */
.global-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #10b981, #f59e0b);
    background-size: 200% 100%;
    animation: loading-progress 2s infinite;
    z-index: 9999;
}

@keyframes loading-progress {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 错误状态样式 */
.error-state {
    color: #dc2626;
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 0.375rem;
    padding: 0.75rem;
}

/* 成功状态样式 */
.success-state {
    color: #059669;
    background-color: #d1fae5;
    border: 1px solid #a7f3d0;
    border-radius: 0.375rem;
    padding: 0.75rem;
}

/* 动画效果 */
.fade-enter-active, .fade-leave-active { 
    transition: opacity 0.3s; 
}
.fade-enter-from, .fade-leave-to { 
    opacity: 0; 
}

/* 音乐播放器样式 */
.player-bar {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.progress-bar {
    appearance: none;
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    outline: none;
    cursor: pointer;
}

.progress-bar::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    background: #3b82f6;
    cursor: pointer;
    border-radius: 50%;
}

/* 搜索结果卡片动画 */
.search-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.search-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* 骨架屏动画 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 歌单卡片动画 */
.playlist-card {
    transition: all 0.3s ease;
}

.playlist-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
}

/* 加载状态动画 */
.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 图片加载优化 */
.img-loading {
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.img-error {
    background: #fee2e2;
    color: #dc2626;
}

/* 懒加载图片样式 */
.lazy-img-container {
    position: relative;
    overflow: hidden;
    background: #f3f4f6;
}

.lazy-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #f3f4f6;
    color: #9ca3af;
}

.lazy-img-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #fee2e2;
    color: #dc2626;
}

.lazy-img {
    transition: opacity 0.3s;
    opacity: 0;
}

.lazy-img.loaded {
    opacity: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .search-card {
        margin-bottom: 1rem;
    }
    
    .playlist-card {
        margin-bottom: 1rem;
    }
}

/* 自定义滚动条 */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    min-width: 300px;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.notification.success {
    background-color: #10b981;
    color: white;
}

.notification.error {
    background-color: #ef4444;
    color: white;
}

.notification.warning {
    background-color: #f59e0b;
    color: white;
}

.notification.info {
    background-color: #3b82f6;
    color: white;
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

/* 加载状态 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* 工具提示 */
.tooltip {
    position: relative;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}