$merchantDir = "d:\骅锋\医疗\pages\mall\merchant"
$tabbarFile = "d:\骅锋\医疗\components\merchant-tabbar\MerchantTabBar.uvue"
$targetFiles = @(Get-ChildItem "$merchantDir\*.uvue") + @(Get-Item $tabbarFile)
Write-Host "Found $($targetFiles.Count) files to process"
foreach ($file in $targetFiles) {
    $content = [System.IO.File]::ReadAllText($file.FullName, [System.Text.Encoding]::UTF8)
    $original = $content
    # Gradients first
    $content = $content -replace 'linear-gradient\(135deg,\s*rgb\(66,\s*121,\s*240\)\s*0%,\s*#5856D6\s*100%\)', 'linear-gradient(135deg, #A6F1E4 0%, #69DFC2 100%)'
    $content = $content -replace 'linear-gradient\(135deg,\s*rgb\(66,\s*121,\s*240\)\s*0%,\s*rgb\(40,\s*80,\s*180\)\s*100%\)', 'linear-gradient(135deg, #A6F1E4 0%, #69DFC2 100%)'
    $content = $content -replace 'linear-gradient\(180deg,\s*rgb\(66,\s*121,\s*240\)\s*0%,\s*#ece9fa\s*100%\)', 'linear-gradient(180deg, #A6F1E4 0%, #69DFC2 100%)'
    $content = $content -replace 'linear-gradient\(to right,\s*#eef2fe,\s*#ece9fa\)', 'linear-gradient(135deg, #A6F1E4 0%, #69DFC2 100%)'
    $content = $content -replace 'linear-gradient\(135deg,\s*#eef2fe,\s*#ece9fa\)', 'linear-gradient(135deg, #A6F1E4 0%, #69DFC2 100%)'
    # Primary blue
    $content = $content -replace 'rgb\(66,\s*121,\s*240\)', '#09C39D'
    # Shadow
    $content = $content -replace 'rgba\(0,\s*122,\s*255,\s*0\.3\)', 'rgba(9,195,157,0.3)'
    # Blue tints to green tints
    $content = $content -replace '#eef2fe', '#E3F7ED'
    $content = $content -replace '#ece9fa', '#B8EEE0'
    $content = $content -replace '#EFF4FF', '#E3F7ED'
    $content = $content -replace '#dde3f8', '#D8EFE6'
    $content = $content -replace '#E3F2FD', '#E3F7ED'
    $content = $content -replace '#e8f4ff', '#E3F7ED'
    if ($content -ne $original) {
        [System.IO.File]::WriteAllText($file.FullName, $content, [System.Text.Encoding]::UTF8)
        Write-Host "Updated: $($file.Name)"
    } else {
        Write-Host "No changes: $($file.Name)"
    }
}
Write-Host "All done."
