<Window x:Class="MainShell.Alarm.View.AlarmDialogView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:MainShell.Alarm.View"
        mc:Ignorable="d"
        SizeToContent="Height"
        ResizeMode="CanResizeWithGrip"
        WindowStartupLocation="CenterOwner"
        Title="报警提示 (Alarm)" Width="650" MinWidth="500" MaxHeight="800">
    <Window.Resources>
        <Style TargetType="GroupBox" BasedOn="{StaticResource LeftGroupStyle}"/>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <!-- 顶部横幅 -->
            <RowDefinition Height="*"/>
            <!-- 内容区域 -->
            <RowDefinition Height="Auto"/>
            <!-- 按钮区域 -->
        </Grid.RowDefinitions>

        <!-- 顶部横幅区域 -->
        <Border Grid.Row="0" Background="#FFF5E5" BorderBrush="#FFCC80" BorderThickness="0,0,0,1" Padding="15,10">
            <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                <TextBlock Text="⚠" Foreground="#E65100" FontSize="22" FontWeight="Bold" Margin="0,0,10,0" VerticalAlignment="Center"/>
                <TextBlock Text="系统发生报警，请及时处理" Foreground="#D84315" FontSize="16" FontWeight="Bold" VerticalAlignment="Center"/>
            </StackPanel>
        </Border>

        <!-- 内容区域 -->
        <ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" Margin="15,10,15,15">
            <StackPanel>
                <!-- 报警ID和类型 -->
                <GroupBox Header="基本信息" Margin="0,0,0,10">
                    <Grid Margin="5">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="80"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="10"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>

                        <TextBlock Text="报警 ID:" Style="{StaticResource LabelStyle}" Grid.Row="0" Grid.Column="0" VerticalAlignment="Top"/>
                        <TextBlock Text="{Binding AlarmInfo.AlarmID}" Style="{StaticResource ValueStyle}" FontWeight="Bold" Grid.Row="0" Grid.Column="1" TextWrapping="Wrap"/>

                        <TextBlock Text="报警类型:" Style="{StaticResource LabelStyle}" Grid.Row="2" Grid.Column="0" VerticalAlignment="Top"/>
                        <TextBlock Text="{Binding AlarmInfo.AlarmType}" Style="{StaticResource ValueStyle}" Foreground="#D84315" FontWeight="SemiBold" Grid.Row="2" Grid.Column="1" TextWrapping="Wrap"/>
                    </Grid>
                </GroupBox>

                <!-- 报警消息 -->
                <GroupBox Header="报警消息" Margin="0,0,0,10">
                    <Grid Margin="5">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="80"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="10"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>

                        <TextBlock Text="中文消息:" Style="{StaticResource LabelStyle}" Grid.Row="0" Grid.Column="0" VerticalAlignment="Top"/>
                        <TextBlock Text="{Binding AlarmInfo.AlarmMessage}" Style="{StaticResource ValueStyle}" Grid.Row="0" Grid.Column="1" TextWrapping="Wrap" LineHeight="20"/>

                        <TextBlock Text="英文消息:" Style="{StaticResource LabelStyle}" Grid.Row="2" Grid.Column="0" VerticalAlignment="Top"/>
                        <TextBlock Text="{Binding AlarmInfo.AlarmMessageEN}" Style="{StaticResource ValueStyle}" Grid.Row="2" Grid.Column="1" TextWrapping="Wrap" Foreground="#555555" LineHeight="20"/>
                    </Grid>
                </GroupBox>

                <!-- 报警原因 -->
                <GroupBox Header="报警原因" Margin="0,0,0,10">
                    <Grid Margin="5">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="80"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Text="原因描述:" Style="{StaticResource LabelStyle}" Grid.Row="0" Grid.Column="0" VerticalAlignment="Top"/>
                        <TextBlock Text="{Binding AlarmInfo.AlarmReason}" Style="{StaticResource ValueStyle}" Grid.Row="0" Grid.Column="1" TextWrapping="Wrap" LineHeight="20"/>
                    </Grid>
                </GroupBox>

                <!-- 解决方案 -->
                <GroupBox Header="解决方案" Margin="0,0,0,10">
                    <Border Background="#F9FBE7" BorderBrush="#CDDC39" BorderThickness="1" CornerRadius="4" Padding="10">
                        <TextBlock Text="{Binding AlarmInfo.AlarmSolution}" Style="{StaticResource ValueStyle}" TextWrapping="Wrap" Foreground="#33691E" LineHeight="20"/>
                    </Border>
                </GroupBox>

                <!-- 触发时间 -->
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,5,5,0">
                    <TextBlock Text="触发时间:" Style="{StaticResource LabelStyle}" Foreground="#888888" Margin="0,0,5,0" VerticalAlignment="Center"/>
                    <TextBlock Text="{Binding AlarmInfo.TriggerTime, StringFormat='{}{0:yyyy-MM-dd HH:mm:ss}'}" Style="{StaticResource ValueStyle}" Foreground="#888888" VerticalAlignment="Center"/>
                </StackPanel>
            </StackPanel>
        </ScrollViewer>

        <!-- 底部按钮区域 -->
        <Border Grid.Row="2" BorderBrush="#E0E0E0" BorderThickness="0,1,0,0" Padding="10,8" Background="#F8F8F8">
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                <Button Content="复位报警" Style="{StaticResource CloseButtonStyle}" Width="100" Height="32" Margin="0,0,10,0" Command="{Binding ResetCommand}" Cursor="Hand"/>
                <Button Content="关闭" Style="{StaticResource CloseButtonStyle}" Width="100" Height="32" Command="{Binding CloseCommand}" Cursor="Hand"/>
            </StackPanel>
        </Border>
    </Grid>
</Window>
