/* 算法配置面板优化 */

/* 面板整体优化 */
.algorithm-config-panel {
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.98), rgba(30, 30, 30, 0.95));
    border: 1px solid rgba(0, 212, 255, 0.4);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-top: 0.75rem;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 212, 255, 0.1);
    animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.algorithm-config-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00d4ff, transparent);
    animation: panel-glow 3s ease-in-out infinite;
}

@keyframes panel-glow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* 配置区块优化 */
.config-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.config-section:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(0, 212, 255, 0.2);
    transform: translateY(-1px);
}

.config-section h4 {
    color: #00d4ff;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.config-section h4::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(to bottom, #00d4ff, #0099cc);
    border-radius: 2px;
}

/* 信息项优化 */
.config-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.375rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.info-item:hover {
    background: rgba(0, 212, 255, 0.05);
    border-color: rgba(0, 212, 255, 0.2);
    transform: translateX(2px);
}

.info-item label {
    color: #aaa;
    font-size: 0.9rem;
    font-weight: 500;
}

.info-item span {
    color: #00d4ff;
    font-weight: 600;
    font-size: 0.95rem;
}

/* 参数配置优化 */
.config-parameters {
    display: grid;
    gap: 1rem;
}

.parameter-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0.375rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.parameter-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(0, 212, 255, 0.15);
}

.parameter-item label {
    color: #ccc;
    font-size: 0.9rem;
    min-width: 100px;
    font-weight: 500;
}

.parameter-item input[type="range"] {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.parameter-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #00d4ff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
    transition: all 0.3s ease;
}

.parameter-item input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.8);
}

.parameter-item select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 0.375rem;
    color: #fff;
    padding: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.parameter-item select:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.2);
}

.parameter-item .parameter-value {
    color: #00d4ff;
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 50px;
    text-align: right;
}

/* 按钮组优化 */
.config-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-top: 1rem;
}

.config-actions .btn,
.config-actions .test-btn {
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.config-actions .btn::before,
.config-actions .test-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.config-actions .btn:hover::before,
.config-actions .test-btn:hover::before {
    width: 300px;
    height: 300px;
}

.config-actions .test-btn {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: #fff;
    border-color: #00d4ff;
}

.config-actions .test-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.4);
}

.config-actions .test-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.config-actions .btn-primary {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: #fff;
    border-color: #28a745;
}

.config-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

.config-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
    border-color: rgba(255, 255, 255, 0.3);
}

.config-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-2px);
}

/* 测试结果优化 */
.test-result {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    display: none;
    animation: slideUp 0.3s ease;
    border: 1px solid;
    position: relative;
    overflow: hidden;
}

.test-result::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, currentColor, transparent);
    animation: result-glow 2s ease-in-out infinite;
}

@keyframes result-glow {
    0% { left: -100%; }
    100% { left: 100%; }
}

.test-result.success {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(32, 201, 151, 0.1));
    border-color: rgba(40, 167, 69, 0.5);
    color: #28a745;
}

.test-result.error {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(231, 76, 60, 0.1));
    border-color: rgba(220, 53, 69, 0.5);
    color: #dc3545;
}

.test-result.info {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(0, 153, 204, 0.1));
    border-color: rgba(0, 212, 255, 0.5);
    color: #00d4ff;
}

.test-result.warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(253, 126, 20, 0.1));
    border-color: rgba(255, 193, 7, 0.5);
    color: #ffc107;
}

/* 配置切换按钮优化 */
.config-toggle-btn {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(0, 153, 204, 0.1));
    border: 1px solid rgba(0, 212, 255, 0.4);
    color: #00d4ff;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.config-toggle-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(0, 212, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.config-toggle-btn:hover::before {
    width: 200px;
    height: 200px;
}

.config-toggle-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
    border-color: #00d4ff;
}

.config-toggle-btn:active {
    transform: translateY(0);
}

.config-toggle-btn i {
    transition: transform 0.3s ease;
}

.config-toggle-btn:hover i {
    transform: rotate(90deg);
}

/* 响应式设计优化 */
@media (max-width: 768px) {
    .algorithm-config-panel {
        padding: 1rem;
        margin: 0.5rem;
    }
    
    .config-info {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .config-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .config-actions .btn,
    .config-actions .test-btn {
        justify-content: center;
    }
    
    .parameter-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .parameter-item label {
        min-width: auto;
    }
}

/* 暗色主题优化 */
@media (prefers-color-scheme: dark) {
    .algorithm-config-panel {
        background: linear-gradient(135deg, rgba(15, 15, 15, 0.98), rgba(25, 25, 25, 0.95));
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .algorithm-config-panel {
        border-width: 2px;
    }
    
    .config-section {
        border-width: 2px;
    }
    
    .info-item {
        border-width: 2px;
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    .algorithm-config-panel,
    .config-section,
    .info-item,
    .parameter-item,
    .config-actions .btn,
    .config-actions .test-btn,
    .config-toggle-btn {
        animation: none;
        transition: none;
    }
    
    .algorithm-config-panel::before {
        animation: none;
    }
    
    .test-result::before {
        animation: none;
    }
}