/* 增强版播放器样式 - 集成链接处理器和存储管理器 */

/* 链接验证结果显示 */
#linkValidationResult {
    animation: slideInFromTop 0.3s ease-out;
    margin-top: 8px;
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid;
    font-size: 0.9em;
    line-height: 1.4;
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 不同类型链接的样式 */
#linkValidationResult.valid-direct-link {
    background-color: #c6f6d5;
    color: #2f855a;
    border-left-color: #38a169;
}

#linkValidationResult.convertible-link {
    background-color: #fefcbf;
    color: #d69e2e;
    border-left-color: #d69e2e;
}

#linkValidationResult.invalid-link {
    background-color: #fed7d7;
    color: #c53030;
    border-left-color: #e53e3e;
}

#linkValidationResult.unknown-link {
    background-color: #e2e8f0;
    color: #4a5568;
    border-left-color: #a0aec0;
}

/* 输入框聚焦时的特殊样式 */
#audioUrl:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

/* 根据链接状态改变输入框边框颜色 */
.form-group:has(#linkValidationResult.valid-direct-link) #audioUrl {
    border-color: #38a169;
}

.form-group:has(#linkValidationResult.convertible-link) #audioUrl {
    border-color: #d69e2e;
}

.form-group:has(#linkValidationResult.invalid-link) #audioUrl {
    border-color: #e53e3e;
}

/* 存储模式切换样式 */
.storage-mode-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.storage-mode-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: white;
}

.storage-modes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.mode-option {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.mode-option:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.mode-option input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.mode-option label {
    cursor: pointer;
    display: block;
}

.mode-option label strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.mode-option label p {
    margin: 0;
    font-size: 0.9em;
    opacity: 0.9;
    line-height: 1.4;
}

.storage-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.storage-status {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
}

.status-local {
    background: rgba(56, 161, 105, 0.8);
    color: white;
}

.status-file {
    background: rgba(66, 153, 225, 0.8);
    color: white;
}

.status-error {
    background: rgba(229, 62, 62, 0.8);
    color: white;
}

.mode-description {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.mode-desc {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.mode-desc.active {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
}

.mode-desc h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: white;
}

.mode-desc ul {
    margin: 0;
    padding-left: 20px;
}

.mode-desc li {
    margin-bottom: 8px;
    font-size: 0.9em;
    line-height: 1.4;
}

/* 空状态引导样式 */
.empty-state-guide {
    border: 2px dashed #cbd5e0;
    border-radius: 10px;
    margin: 20px 0;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
}

.empty-state-guide h3 {
    color: #4a5568;
    margin-bottom: 15px;
}

.empty-state-guide p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.empty-state-guide ol {
    text-align: left;
    display: inline-block;
    margin: 15px 0;
}

.empty-state-guide li {
    margin-bottom: 8px;
    color: #2d3748;
}

/* API配置相关样式已在api-config.html中定义 */

/* 响应式设计增强 */
@media (max-width: 768px) {
    .storage-modes,
    .mode-description {
        grid-template-columns: 1fr;
    }
    
    .storage-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .storage-controls .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .admin-controls {
        flex-direction: column;
    }
    
    .pan-controls {
        flex-direction: column;
    }
    
    .control-buttons {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .control-buttons button {
        flex: 1;
        min-width: 60px;
    }
}

/* 加载动画增强 */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast通知增强 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    color: white;
    z-index: 9999;
    font-weight: 500;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 300px;
    word-wrap: break-word;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: #38a169;
}

.toast.error {
    background: #e53e3e;
}

.toast.warning {
    background: #d69e2e;
}

.toast.info {
    background: #4299e1;
}

/* 表单增强样式 */
.form-group {
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #4a5568;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

/* 按钮增强样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-size: 14px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: #4299e1;
    color: white;
}

.btn-primary:hover {
    background: #3182ce;
}

.btn-success {
    background: #38a169;
    color: white;
}

.btn-success:hover {
    background: #2f855a;
}

.btn-secondary {
    background: #a0aec0;
    color: white;
}

.btn-secondary:hover {
    background: #718096;
}

.btn-danger {
    background: #e53e3e;
    color: white;
}

.btn-danger:hover {
    background: #c53030;
}

/* 播放列表增强 */
.playlist-item {
    transition: all 0.3s ease;
    cursor: pointer;
}

.playlist-item:hover {
    background: rgba(66, 153, 225, 0.1);
    transform: translateX(4px);
}

.playlist-item.active {
    background: #4299e1;
    color: white;
}

.playlist-item.active:hover {
    background: #3182ce;
}

/* 搜索框增强 */
#searchInput {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="%23718096" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z" clip-rule="evenodd"/></svg>');
    background-repeat: no-repeat;
    background-position: 12px center;
    background-size: 16px;
    padding-left: 40px;
}

/* 进度条增强 */
.progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
}

#progressBar {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    outline: none;
    cursor: pointer;
}

#progressBar::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4299e1;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#progressBar::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4299e1;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 音量控制增强 */
.volume-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

#volumeSlider {
    width: 120px;
    height: 4px;
    border-radius: 2px;
    background: #e2e8f0;
    outline: none;
    cursor: pointer;
}

#volumeSlider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4299e1;
    cursor: pointer;
}

/* 导航按钮增强 */
nav button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-right: 10px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
}

nav button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

nav button.active {
    background: #4299e1;
    color: white;
}

/* 容器增强 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.section {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 头部增强 */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

header h1 {
    margin: 0 0 20px 0;
    font-size: 2.5em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}