<!--
NavisworksTransport 碰撞检测报告对话框 - 采用与主界面一致的Navisworks 2026风格

功能说明：
1. 显示详细的碰撞检测报告，包括统计信息和具体碰撞项目
2. 支持按类型分组显示碰撞（动画、独立检测、其他）
3. 提供导出、刷新、高亮等操作功能
4. 结构化展示，替代原来的简单TextBox显示

设计原则：参考HelpDialog的布局和样式，使用统一的蓝色主题
-->
<Window x:Class="NavisworksTransport.UI.WPF.Views.CollisionReportDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:local="clr-namespace:NavisworksTransport.UI.WPF.Converters"
        mc:Ignorable="d"
        Title="碰撞检测报告" 
        Height="960" 
        Width="900"
        ResizeMode="CanResize" 
        WindowStartupLocation="CenterOwner"
        Topmost="True"
        MinHeight="800"
        MinWidth="600">
        
    <Window.Resources>
        <!-- 引用共享的Navisworks 2026样式资源 -->
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/TransportPlugin;component/src/UI/WPF/Resources/NavisworksStyles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            
            <!-- 转换器定义 -->
            <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
            <local:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
            <local:InverseBooleanToVisibilityConverter x:Key="InverseBooleanToVisibilityConverter"/>
            <local:CountToVisibilityConverter x:Key="CountToVisibilityConverter"/>
            <local:PathToImageConverter x:Key="PathToImageConverter"/>
            <local:EqualityToBooleanConverter x:Key="EqualityToBooleanConverter"/>
            
            <!-- 碰撞报告专用样式 -->
            <Style x:Key="StatisticItemStyle" TargetType="Border">
                <Setter Property="Background" Value="#FFF8FBFF"/>
                <Setter Property="BorderBrush" Value="#FFD4E7FF"/>
                <Setter Property="BorderThickness" Value="1"/>
                <Setter Property="CornerRadius" Value="3"/>
                <Setter Property="Padding" Value="10,8"/>
                <Setter Property="Margin" Value="0,2"/>
            </Style>
            
            <Style x:Key="StatisticLabelStyle" TargetType="TextBlock">
                <Setter Property="FontWeight" Value="Normal"/>
                <Setter Property="FontSize" Value="11"/>
                <Setter Property="Foreground" Value="{StaticResource NavisworksSecondaryBrush}"/>
                <Setter Property="VerticalAlignment" Value="Center"/>
            </Style>
            
            <Style x:Key="StatisticValueStyle" TargetType="TextBlock">
                <Setter Property="FontWeight" Value="Bold"/>
                <Setter Property="FontSize" Value="12"/>
                <Setter Property="Foreground" Value="{StaticResource NavisworksPrimaryBrush}"/>
                <Setter Property="VerticalAlignment" Value="Center"/>
                <Setter Property="HorizontalAlignment" Value="Right"/>
            </Style>
            
            <Style x:Key="CollisionItemStyle" TargetType="Border">
                <Setter Property="Background" Value="White"/>
                <Setter Property="BorderBrush" Value="#FFEEEEEE"/>
                <Setter Property="BorderThickness" Value="1"/>
                <Setter Property="CornerRadius" Value="2"/>
                <Setter Property="Padding" Value="8"/>
                <Setter Property="Margin" Value="0,1"/>
                <Setter Property="Cursor" Value="Hand"/>
                <Style.Triggers>
                    <Trigger Property="IsMouseOver" Value="True">
                        <Setter Property="Background" Value="#FFF8FBFF"/>
                        <Setter Property="BorderBrush" Value="#FFD4E7FF"/>
                    </Trigger>
                </Style.Triggers>
            </Style>
            
            <Style x:Key="CollisionTitleStyle" TargetType="TextBlock">
                <Setter Property="FontWeight" Value="SemiBold"/>
                <Setter Property="FontSize" Value="11"/>
                <Setter Property="Foreground" Value="#FF333333"/>
                <Setter Property="TextWrapping" Value="Wrap"/>
            </Style>
            
            <Style x:Key="CollisionDescriptionStyle" TargetType="TextBlock">
                <Setter Property="FontSize" Value="10"/>
                <Setter Property="Foreground" Value="#FF666666"/>
                <Setter Property="TextWrapping" Value="Wrap"/>
                <Setter Property="Margin" Value="0,2,0,0"/>
            </Style>
            
            <Style x:Key="StatusTagStyle" TargetType="Border">
                <Setter Property="CornerRadius" Value="8"/>
                <Setter Property="Padding" Value="6,2"/>
                <Setter Property="Margin" Value="0,0,0,3"/>
                <Setter Property="HorizontalAlignment" Value="Left"/>
            </Style>
            
            <Style x:Key="StatusTextStyle" TargetType="TextBlock">
                <Setter Property="FontSize" Value="9"/>
                <Setter Property="FontWeight" Value="SemiBold"/>
                <Setter Property="Foreground" Value="White"/>
            </Style>
            
            <Style x:Key="SectionHeaderStyle" TargetType="Label">
                <Setter Property="FontWeight" Value="SemiBold"/>
                <Setter Property="FontSize" Value="13"/>
                <Setter Property="Foreground" Value="{StaticResource NavisworksPrimaryBrush}"/>
                <Setter Property="Padding" Value="0,8,0,4"/>
            </Style>
            
            <Style x:Key="ProgressStyle" TargetType="ProgressBar">
                <Setter Property="Height" Value="4"/>
                <Setter Property="Margin" Value="0,5"/>
                <Setter Property="Foreground" Value="{StaticResource NavisworksPrimaryBrush}"/>
                <Setter Property="Background" Value="#FFEEEEEE"/>
            </Style>

            <!-- 数据模板：碰撞项目 -->
            <DataTemplate x:Key="CollisionItemTemplate">
                <Border Style="{StaticResource CollisionItemStyle}"
                        PreviewMouseLeftButtonDown="OnCollisionItemClick">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        
                        <!-- 序号 -->
                        <TextBlock Grid.Column="0" 
                                   Text="{Binding Index, StringFormat={}{0}.}" 
                                   FontWeight="Bold" 
                                   Foreground="#FF2B579A"
                                   FontSize="14"
                                   VerticalAlignment="Top"
                                   Margin="0,0,8,0"/>
                        
                        <StackPanel Grid.Column="1">
                            <!-- 标题 -->
                            <TextBlock Text="{Binding Title}" Style="{StaticResource CollisionDescriptionStyle}" FontWeight="SemiBold"/>
                            
                            <!-- 全路径 -->
                            <TextBlock Text="{Binding Item1FullPath}" 
                                       Style="{StaticResource CollisionDescriptionStyle}" 
                                       Margin="0,2,0,0"
                                       FontSize="10"
                                       Foreground="#FF666666"
                                       TextTrimming="CharacterEllipsis"/>
                            <TextBlock Text="{Binding Item2FullPath}" 
                                       Style="{StaticResource CollisionDescriptionStyle}" 
                                       Margin="0,1,0,0"
                                       FontSize="10"
                                       Foreground="#FF666666"
                                       TextTrimming="CharacterEllipsis"/>
                            
                            <!-- 位置信息 -->
                            <TextBlock Text="{Binding Details}" 
                                       Style="{StaticResource CollisionDescriptionStyle}" 
                                       Margin="0,3,0,0"
                                       FontSize="10"
                                       Foreground="#FF999999"/>
                        </StackPanel>
                    </Grid>
                </Border>
            </DataTemplate>
            
        </ResourceDictionary>
    </Window.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        
        <!-- 主内容区域 -->
        <Border Grid.Row="0" 
                BorderBrush="#FFD4E7FF" 
                BorderThickness="1" 
                CornerRadius="0" 
                Background="White"
                Margin="15,15,15,10">
            <Grid>
                <!-- 加载进度指示 -->
                <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" 
                            Visibility="{Binding IsGenerating, Converter={StaticResource BooleanToVisibilityConverter}}">
                    <TextBlock Text="正在生成碰撞报告..." HorizontalAlignment="Center" 
                               Style="{StaticResource DialogContentTextStyle}" Margin="0,0,0,10"/>
                    <ProgressBar Value="{Binding ProgressPercentage}" Maximum="100" Width="300" Style="{StaticResource ProgressStyle}"/>
                    <TextBlock Text="{Binding ProgressMessage}" HorizontalAlignment="Center" 
                               Style="{StaticResource DialogContentTextStyle}" Margin="0,5,0,0"/>
                </StackPanel>
                
                <!-- 报告内容 -->
                <ScrollViewer VerticalScrollBarVisibility="Auto" 
                              Padding="15"
                              Visibility="{Binding IsGenerating, Converter={StaticResource InverseBooleanToVisibilityConverter}}">
                    <StackPanel>
                        
                        <!-- 报告标题 -->
                        <Label Content="{Binding ReportTitle}" 
                               FontSize="16"
                               FontWeight="SemiBold"
                               Foreground="{StaticResource NavisworksPrimaryBrush}"
                               HorizontalAlignment="Center"
                               Margin="0,0,0,15"/>
                        
                        <!-- 总体统计信息 -->
                        <Label Content="总体统计" Style="{StaticResource SectionHeaderStyle}"/>
                        <UniformGrid Columns="3" Margin="0,0,0,15">
                            <Border Style="{StaticResource StatisticItemStyle}">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <TextBlock Grid.Row="0" Text="总碰撞数" Style="{StaticResource CenterLabelStyle}"/>
                                    <TextBlock Grid.Row="1" Text="{Binding Statistics.TotalCollisions}" Style="{StaticResource CenterValueStyle}"/>
                                </Grid>
                            </Border>
                            <Border Style="{StaticResource StatisticItemStyle}">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <TextBlock Grid.Row="0" Text="碰撞构件" Style="{StaticResource CenterLabelStyle}"/>
                                    <TextBlock Grid.Row="1" Text="{Binding UniqueCollidedObjectsCount}" Style="{StaticResource CenterValueStyle}"/>
                                </Grid>
                            </Border>
                            <Border Style="{StaticResource StatisticItemStyle}">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <TextBlock Grid.Row="0" Text="检测点" Style="{StaticResource CenterLabelStyle}"/>
                                    <TextBlock Grid.Row="1" Text="{Binding Statistics.AnimationCollisions}" Style="{StaticResource CenterValueStyle}"/>
                                </Grid>
                            </Border>
                        </UniformGrid>

                        <!-- 检测记录信息 -->
                        <Label Content="检测记录" Style="{StaticResource SectionHeaderStyle}"/>
                        <UniformGrid Columns="2" Margin="0,0,0,10">
                            <Border Style="{StaticResource StatisticItemStyle}">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <TextBlock Grid.Row="0" Text="测试名称" Style="{StaticResource CenterLabelStyle}"/>
                                    <TextBlock Grid.Row="1" Text="{Binding TestName}" Style="{StaticResource CenterValueStyle}"/>
                                </Grid>
                            </Border>
                            <Border Style="{StaticResource StatisticItemStyle}">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <TextBlock Grid.Row="0" Text="检测时间" Style="{StaticResource CenterLabelStyle}"/>
                                    <TextBlock Grid.Row="1" Text="{Binding TestTimeDisplay}" Style="{StaticResource CenterValueStyle}"/>
                                </Grid>
                            </Border>
                        </UniformGrid>

                        <!-- 检测参数信息 -->
                        <Label Content="检测参数" Style="{StaticResource SectionHeaderStyle}"/>
                        <UniformGrid Columns="4" Margin="0,0,0,15">
                            <Border Style="{StaticResource StatisticItemStyle}">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <TextBlock Grid.Row="0" Text="路径名称" Style="{StaticResource CenterLabelStyle}"/>
                                    <TextBlock Grid.Row="1" Text="{Binding PathName}" Style="{StaticResource CenterValueStyle}"/>
                                </Grid>
                            </Border>
                            <Border Style="{StaticResource StatisticItemStyle}">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <TextBlock Grid.Row="0" Text="帧率(FPS)" Style="{StaticResource CenterLabelStyle}"/>
                                    <TextBlock Grid.Row="1" Text="{Binding FrameRate}" Style="{StaticResource CenterValueStyle}"/>
                                </Grid>
                            </Border>
                            <Border Style="{StaticResource StatisticItemStyle}">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <TextBlock Grid.Row="0" Text="时长(秒)" Style="{StaticResource CenterLabelStyle}"/>
                                    <TextBlock Grid.Row="1" Text="{Binding Duration}" Style="{StaticResource CenterValueStyle}"/>
                                </Grid>
                            </Border>
                            <Border Style="{StaticResource StatisticItemStyle}">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <TextBlock Grid.Row="0" Text="检测容差(米)" Style="{StaticResource CenterLabelStyle}"/>
                                    <TextBlock Grid.Row="1" Text="{Binding DetectionTolerance, StringFormat={}{0:F2}}" Style="{StaticResource CenterValueStyle}"/>
                                </Grid>
                            </Border>
                        </UniformGrid>

                        <!-- 碰撞场景截图区域 -->
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Label Content="碰撞场景截图" Style="{StaticResource SectionHeaderStyle}" Grid.Column="0"/>
                            <TextBlock Grid.Column="1" 
                                       Text="{Binding ScreenshotCount, StringFormat='{}{0} 张'}" 
                                       VerticalAlignment="Center"
                                       Foreground="#FF666666"
                                       FontSize="11"
                                       Margin="0,0,10,0"/>
                        </Grid>
                        
                        <GroupBox Margin="0,0,0,10" BorderBrush="#FFD4E7FF" BorderThickness="1">
                            <StackPanel>
                                <!-- 主图显示区 -->
                                <Border BorderBrush="Gray" 
                                        BorderThickness="1" 
                                        Background="Black"
                                        MinHeight="300"
                                        Margin="0,0,0,10">
                                    <Grid>
                                        <Image Source="{Binding ScreenshotPreviewSource}" 
                                               Stretch="Uniform"
                                               RenderOptions.BitmapScalingMode="HighQuality">
                                            <Image.Style>
                                                <Style TargetType="Image">
                                                    <Style.Triggers>
                                                        <DataTrigger Binding="{Binding ScreenshotPreviewSource}" Value="{x:Null}">
                                                            <Setter Property="Visibility" Value="Collapsed"/>
                                                        </DataTrigger>
                                                    </Style.Triggers>
                                                </Style>
                                            </Image.Style>
                                        </Image>
                                        <!-- 无截图提示 -->
                                        <TextBlock Text="暂无截图" 
                                                   HorizontalAlignment="Center" 
                                                   VerticalAlignment="Center"
                                                   Foreground="White"
                                                   FontSize="14"
                                                   Visibility="{Binding HasScreenshots, Converter={StaticResource InverseBooleanToVisibilityConverter}}"/>
                                    </Grid>
                                </Border>
                                
                                <!-- 缩略图列表 -->
                                <Border Background="#FFF5F5F5" 
                                        BorderBrush="#FFE0E0E0" 
                                        BorderThickness="1"
                                        Padding="5">
                                    <ScrollViewer HorizontalScrollBarVisibility="Auto" 
                                                  VerticalScrollBarVisibility="Disabled">
                                        <StackPanel Orientation="Horizontal">
                                            <!-- 缩略图列表 -->
                                            <ItemsControl x:Name="ThumbnailsItemsControl"
                                                          ItemsSource="{Binding Screenshots}" 
                                                          VerticalAlignment="Center"
                                                          Visibility="{Binding HasScreenshots, Converter={StaticResource BooleanToVisibilityConverter}}">
                                                <ItemsControl.ItemsPanel>
                                                    <ItemsPanelTemplate>
                                                        <StackPanel Orientation="Horizontal"/>
                                                    </ItemsPanelTemplate>
                                                </ItemsControl.ItemsPanel>
                                                <ItemsControl.ItemTemplate>
                                                    <DataTemplate>
                                                        <Border Width="60" 
                                                                Height="45" 
                                                                Margin="2"
                                                                Cursor="Hand"
                                                                MouseLeftButtonDown="OnThumbnailClick">
                                                            <Border.Style>
                                                                <Style TargetType="Border">
                                                                    <Setter Property="BorderBrush" Value="Transparent"/>
                                                                    <Setter Property="BorderThickness" Value="1"/>
                                                                    <Style.Triggers>
                                                                        <!-- 选中时显示1px蓝色边框 -->
                                                                        <DataTrigger Value="True">
                                                                            <DataTrigger.Binding>
                                                                                <MultiBinding Converter="{StaticResource EqualityToBooleanConverter}">
                                                                                    <Binding />
                                                                                    <Binding ElementName="ThumbnailsItemsControl" Path="DataContext.SelectedScreenshot"/>
                                                                                </MultiBinding>
                                                                            </DataTrigger.Binding>
                                                                            <Setter Property="BorderBrush" Value="#FF2B579A"/>
                                                                        </DataTrigger>
                                                                    </Style.Triggers>
                                                                </Style>
                                                            </Border.Style>
                                                            <Image Source="{Binding FilePath, Converter={StaticResource PathToImageConverter}}" 
                                                                   Stretch="UniformToFill"
                                                                   RenderOptions.BitmapScalingMode="HighQuality">
                                                                <Image.ToolTip>
                                                                    <ToolTip>
                                                                        <StackPanel>
                                                                            <TextBlock Text="{Binding Description, TargetNullValue='无描述'}" FontWeight="SemiBold"/>
                                                                            <TextBlock Text="{Binding CaptureTime, StringFormat='截图时间: {0:yyyy-MM-dd HH:mm}'}" FontSize="11"/>
                                                                            <TextBlock FontSize="11">
                                                                                <TextBlock.Text>
                                                                                    <MultiBinding StringFormat="尺寸: {0} x {1}">
                                                                                        <Binding Path="Width"/>
                                                                                        <Binding Path="Height"/>
                                                                                    </MultiBinding>
                                                                                </TextBlock.Text>
                                                                            </TextBlock>
                                                                        </StackPanel>
                                                                    </ToolTip>
                                                                </Image.ToolTip>
                                                            </Image>
                                                        </Border>
                                                    </DataTemplate>
                                                </ItemsControl.ItemTemplate>
                                            </ItemsControl>
                                            
                                            <!-- 加号按钮 -->
                                            <Border Width="45" 
                                                    Height="45" 
                                                    Margin="2,2,5,2"
                                                    Background="#FFE8F4FF"
                                                    BorderBrush="#FF2B579A"
                                                    BorderThickness="1"
                                                    Cursor="Hand"
                                                    MouseLeftButtonDown="OnAddScreenshotClick">
                                                <TextBlock Text="+" 
                                                           FontSize="24" 
                                                           Foreground="#FF2B579A"
                                                           HorizontalAlignment="Center"
                                                           VerticalAlignment="Center"
                                                           FontWeight="Light"/>
                                            </Border>
                                            
                                            <!-- 减号按钮 - 删除当前选中的截图 -->
                                            <Border Width="45" 
                                                    Height="45" 
                                                    Margin="2"
                                                    Background="#FFFFEBEE"
                                                    BorderBrush="#FFE57373"
                                                    BorderThickness="1"
                                                    Cursor="Hand"
                                                    Visibility="{Binding HasScreenshots, Converter={StaticResource BooleanToVisibilityConverter}}"
                                                    MouseLeftButtonDown="OnDeleteScreenshotClick">
                                                <TextBlock Text="-" 
                                                           FontSize="24" 
                                                           Foreground="#FFD32F2F"
                                                           HorizontalAlignment="Center"
                                                           VerticalAlignment="Center"
                                                           FontWeight="Light"/>
                                            </Border>
                                        </StackPanel>
                                    </ScrollViewer>
                                </Border>
                            </StackPanel>
                        </GroupBox>

                        <!-- 运动构件信息 -->
                        <Border Style="{StaticResource StatisticItemStyle}"
                                Margin="0,0,0,10"
                                Background="#FFF0F8FF"
                                BorderBrush="#FFB0D4F1">
                            <StackPanel HorizontalAlignment="Center">
                                <TextBlock Text="🚛 运动构件信息"
                                           FontSize="11"
                                           FontWeight="SemiBold"
                                           Foreground="{StaticResource NavisworksPrimaryBrush}"
                                           HorizontalAlignment="Center"
                                           Margin="0,0,0,5"/>
                                <TextBlock Text="{Binding MovingObjectInfo}"
                                           FontSize="12"
                                           FontWeight="Normal"
                                           Foreground="#FF333333"
                                           HorizontalAlignment="Center"
                                           TextWrapping="Wrap"/>
                            </StackPanel>
                        </Border>

                        <!-- 碰撞构件清单 -->
                        <StackPanel Visibility="{Binding CollidedObjectsList.Count, Converter={StaticResource CountToVisibilityConverter}}" Margin="0,0,0,15">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Label Content="碰撞构件清单" Style="{StaticResource SectionHeaderStyle}" Grid.Column="0"/>
                                <TextBlock Grid.Column="1" 
                                           Text="{Binding UniqueCollidedObjectsCount, StringFormat='{}{0} 个'}" 
                                           VerticalAlignment="Center"
                                           Foreground="#FF666666"
                                           FontSize="11"
                                           Margin="0,0,10,0"/>
                            </Grid>
                            <Border Style="{StaticResource StatisticItemStyle}" MaxHeight="150" Background="#FFFDF2F2" BorderBrush="#FFF5C6C6">
                                <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
                                    <ItemsControl ItemsSource="{Binding CollidedObjectsList}">
                                        <ItemsControl.ItemTemplate>
                                            <DataTemplate>
                                                <StackPanel Orientation="Horizontal" Margin="5,2">
                                                    <TextBlock Text="⚠️" Margin="0,0,6,0"/>
                                                    <TextBlock Text="{Binding}"
                                                               FontWeight="SemiBold"
                                                               Foreground="#FF721C24"
                                                               TextWrapping="Wrap"/>
                                                </StackPanel>
                                            </DataTemplate>
                                        </ItemsControl.ItemTemplate>
                                    </ItemsControl>
                                </ScrollViewer>
                            </Border>
                        </StackPanel>

                        <!-- 排除对象清单 -->
                        <StackPanel Visibility="{Binding HasExcludedObjects, Converter={StaticResource BooleanToVisibilityConverter}}" Margin="0,0,0,15">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Label Content="排除对象清单" Style="{StaticResource SectionHeaderStyle}" Grid.Column="0"/>
                                <TextBlock Grid.Column="1" 
                                           Text="{Binding ExcludedObjectsCount, StringFormat='{}{0} 个'}" 
                                           VerticalAlignment="Center"
                                           Foreground="#FF666666"
                                           FontSize="11"
                                           Margin="0,0,10,0"/>
                            </Grid>
                            <Border Style="{StaticResource StatisticItemStyle}" MaxHeight="200" Background="#FFFEF9E7" BorderBrush="#FFF9E79F">
                                <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
                                    <ItemsControl ItemsSource="{Binding ExcludedObjects}">
                                        <ItemsControl.ItemTemplate>
                                            <DataTemplate>
                                                <StackPanel Margin="5,3">
                                                    <StackPanel Orientation="Horizontal">
                                                        <TextBlock Text="🚫" Margin="0,0,6,0"/>
                                                        <TextBlock Text="{Binding DisplayName}" 
                                                                   FontWeight="SemiBold" 
                                                                   Foreground="#FF856404"
                                                                   TextWrapping="Wrap"/>
                                                    </StackPanel>
                                                    <StackPanel Orientation="Horizontal" Margin="20,2,0,0">
                                                        <TextBlock Text="原因: " FontSize="10" Foreground="#FF666666"/>
                                                        <TextBlock Text="{Binding Reason, TargetNullValue='无', FallbackValue='无'}" 
                                                                   FontSize="10" 
                                                                   Foreground="#FF666666"
                                                                   TextWrapping="Wrap"/>
                                                    </StackPanel>
                                                    <StackPanel Orientation="Horizontal" Margin="20,2,0,0">
                                                        <TextBlock Text="时间: " FontSize="10" Foreground="#FF999999"/>
                                                        <TextBlock Text="{Binding ExcludedTime, StringFormat={}{0:yyyy-MM-dd HH:mm}}" 
                                                                   FontSize="10" 
                                                                   Foreground="#FF999999"/>
                                                        <TextBlock Text="  |  " FontSize="10" Foreground="#FF999999"/>
                                                        <TextBlock Text="{Binding PathId}" 
                                                                   FontSize="10" 
                                                                   Foreground="#FF999999"
                                                                   FontStyle="Italic"/>
                                                    </StackPanel>
                                                </StackPanel>
                                            </DataTemplate>
                                        </ItemsControl.ItemTemplate>
                                    </ItemsControl>
                                </ScrollViewer>
                            </Border>
                        </StackPanel>

                        <!-- 总结信息 -->
                        <Label Content="总结与建议" Style="{StaticResource SectionHeaderStyle}"/>
                        <Border Style="{StaticResource StatisticItemStyle}" Margin="0,0,0,10">
                            <StackPanel>
                                <TextBlock Text="{Binding SummaryMessage}" 
                                           FontWeight="SemiBold"
                                           FontSize="12"
                                           Foreground="{StaticResource NavisworksPrimaryBrush}"
                                           TextWrapping="Wrap"/>
                                <TextBlock Text="{Binding RecommendationMessage}" 
                                           Style="{StaticResource DialogContentTextStyle}"
                                           Margin="0,8,0,0"
                                           TextWrapping="Wrap"/>
                            </StackPanel>
                        </Border>
                        
                        <!-- 详细碰撞信息 -->
                        <StackPanel Visibility="{Binding HasCollisions, Converter={StaticResource BooleanToVisibilityConverter}}">

                            <!-- 碰撞详情 -->
                            <StackPanel Visibility="{Binding AnimationCollisions.Count, Converter={StaticResource CountToVisibilityConverter}}">
                                <Label Content="碰撞详情（点击项目聚焦到被撞对象）" Style="{StaticResource SectionHeaderStyle}"/>
                                <ItemsControl ItemsSource="{Binding AnimationCollisions}"
                                              ItemTemplate="{StaticResource CollisionItemTemplate}"
                                              Margin="0,0,0,10"/>
                            </StackPanel>

                        </StackPanel>
                        
                        <!-- 无碰撞提示 -->
                        <Border Style="{StaticResource StatisticItemStyle}" 
                                Visibility="{Binding HasCollisions, Converter={StaticResource InverseBooleanToVisibilityConverter}}"
                                Background="#FFF0F8FF" 
                                BorderBrush="#FFB0D4F1">
                            <StackPanel HorizontalAlignment="Center" Margin="20">
                                <TextBlock Text="✅ 未发现碰撞问题" 
                                           FontSize="14" 
                                           FontWeight="SemiBold"
                                           Foreground="#FF28A745"
                                           HorizontalAlignment="Center"/>
                                <TextBlock Text="当前路径规划良好，无需调整。" 
                                           Style="{StaticResource DialogContentTextStyle}"
                                           HorizontalAlignment="Center"
                                           Margin="0,5,0,0"/>
                            </StackPanel>
                        </Border>
                        
                    </StackPanel>
                </ScrollViewer>
            </Grid>
        </Border>
        
        <!-- 底部按钮区域 -->
        <Border Grid.Row="1" 
                BorderBrush="#FFD4E7FF" 
                BorderThickness="1" 
                CornerRadius="0" 
                Background="#FFF8FBFF"
                Margin="15,0,15,15" 
                Padding="15,10">
            <StackPanel Orientation="Horizontal" 
                        HorizontalAlignment="Right">
                
                <Button Content="截图设置" 
                        Command="{Binding ScreenshotSettingsCommand}"
                        Style="{StaticResource SecondaryButtonStyle}"
                        Margin="0,0,10,0"/>
                
                <Button Content="导出报告" 
                        Command="{Binding ExportReportCommand}"
                        Style="{StaticResource SecondaryButtonStyle}" 
                        Margin="0,0,10,0"/>
                
                <Button Content="关闭" 
                        Click="CloseButton_Click" 
                        Style="{StaticResource ActionButtonStyle}"/>
                        
            </StackPanel>
        </Border>
    </Grid>
</Window>
