<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:SHH.CameraDashboard">

    <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />

    <!--  主界面 - 系统按钮  -->
    <Style x:Key="Btn.TitleBar" TargetType="Button">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Foreground" Value="{StaticResource Brush.Text.Primary}" />
        <Setter Property="Width" Value="46" />
        <Setter Property="Height" Value="32" />
        <Setter Property="Padding" Value="0" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                        <ContentPresenter
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            RecognizesAccessKey="True"
                            SnapsToDevicePixels="False" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="{StaticResource Brush.Bg.Hover}" />
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="Background" Value="{StaticResource Brush.Bg.L3}" />
                <Setter Property="Opacity" Value="0.8" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <!--  主界面 - 系统按钮  -->
    <Style
        x:Key="Btn.TitleBar.Close"
        BasedOn="{StaticResource Btn.TitleBar}"
        TargetType="Button">
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="{StaticResource Brush.Status.Danger}" />
                <Setter Property="Foreground" Value="{StaticResource Brush.Text.Inverse}" />
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="Background" Value="#99F44747" />
                <Setter Property="Foreground" Value="{StaticResource Brush.Text.Inverse}" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <!--  按钮颜色  -->
    <Style x:Key="Btn.Icon.Base" TargetType="Button">
        <Setter Property="Width" Value="32" />
        <Setter Property="Height" Value="32" />
        <Setter Property="Foreground" Value="White" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border
                        x:Name="border"
                        Background="{TemplateBinding Background}"
                        CornerRadius="4">
                        <ContentPresenter
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            RecognizesAccessKey="True" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Opacity" Value="0.9" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Opacity" Value="0.7" />
                            <Setter TargetName="border" Property="RenderTransform">
                                <Setter.Value>
                                    <ScaleTransform CenterX="16" CenterY="16" ScaleX="0.95" ScaleY="0.95" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Background" Value="#E0E0E0" />
                            <Setter Property="Foreground" Value="#A0A0A0" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style
        x:Key="Btn.Icon.Success"
        BasedOn="{StaticResource Btn.Icon.Base}"
        TargetType="Button">
        <Setter Property="Background" Value="{DynamicResource Brush.State.Success}" />
    </Style>

    <Style
        x:Key="Btn.Icon.Danger"
        BasedOn="{StaticResource Btn.Icon.Base}"
        TargetType="Button">
        <Setter Property="Background" Value="{DynamicResource Brush.State.Danger}" />
    </Style>

    <Style
        x:Key="Btn.Icon.Warning"
        BasedOn="{StaticResource Btn.Icon.Base}"
        TargetType="Button">
        <Setter Property="Background" Value="{DynamicResource Brush.State.Warning}" />
    </Style>

    <Style
        x:Key="Btn.Icon.Info"
        BasedOn="{StaticResource Btn.Icon.Base}"
        TargetType="Button">
        <Setter Property="Background" Value="{DynamicResource Brush.State.Info}" />
    </Style>

    <Style x:Key="Btn.Ghost.Base" TargetType="Button">
        <Setter Property="Width" Value="32" />
        <Setter Property="Height" Value="32" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Foreground" Value="{DynamicResource Brush.Text.Primary}" />

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border
                        x:Name="border"
                        Background="{TemplateBinding Background}"
                        CornerRadius="4">
                        <ContentPresenter
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            RecognizesAccessKey="True" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Background" Value="{DynamicResource Brush.Bg.Hover}" />
                        </Trigger>

                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Opacity" Value="0.7" />
                            <Setter TargetName="border" Property="RenderTransform">
                                <Setter.Value>
                                    <ScaleTransform CenterX="16" CenterY="16" ScaleX="0.95" ScaleY="0.95" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>

                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Opacity" Value="0.3" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style
        x:Key="Btn.Ghost.Secondary"
        BasedOn="{StaticResource Btn.Ghost.Base}"
        TargetType="Button">
        <Setter Property="Foreground" Value="{DynamicResource Brush.Text.Secondary}" />
    </Style>

    <Style
        x:Key="Btn.Ghost.Danger"
        BasedOn="{StaticResource Btn.Ghost.Base}"
        TargetType="Button">
        <Setter Property="Foreground" Value="{DynamicResource Brush.State.Danger}" />
    </Style>

    <Style
        x:Key="Btn.Ghost.Info"
        BasedOn="{StaticResource Btn.Ghost.Base}"
        TargetType="Button">
        <Setter Property="Foreground" Value="{DynamicResource Brush.State.Info}" />
    </Style>

    <Style
        x:Key="Btn.Ghost.Success"
        BasedOn="{StaticResource Btn.Ghost.Base}"
        TargetType="Button">
        <Setter Property="Foreground" Value="{DynamicResource Brush.State.Success}" />
    </Style>

    <Style x:Key="DangerBtnStyle" TargetType="Button">
        <Setter Property="Background" Value="#DC3545" />
        <Setter Property="Foreground" Value="White" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="Padding" Value="10,5" />
        <Setter Property="Margin" Value="2" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="FontWeight" Value="SemiBold" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border
                        x:Name="border"
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        CornerRadius="4">
                        <ContentPresenter
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            RecognizesAccessKey="True" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="border" Property="Background" Value="#C82333" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="border" Property="Background" Value="#BD2130" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="border" Property="Background" Value="#E2E6EA" />
                            <Setter Property="Foreground" Value="#6C757D" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  TabItem 样式  -->
    <Style x:Key="Style.TabItem.Modern" TargetType="TabItem">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Foreground" Value="{DynamicResource Brush.Text.Secondary}" />
        <Setter Property="FontSize" Value="13" />
        <Setter Property="Padding" Value="16,10" />
        <Setter Property="BorderThickness" Value="0" />

        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />

        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="TabItem">
                    <Grid
                        x:Name="Root"
                        Background="{TemplateBinding Background}"
                        SnapsToDevicePixels="True">

                        <ContentPresenter
                            x:Name="ContentSite"
                            Margin="{TemplateBinding Padding}"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            ContentSource="Header"
                            RecognizesAccessKey="True" />

                        <Border
                            x:Name="SelectionUnderline"
                            Height="2"
                            VerticalAlignment="Bottom"
                            Background="{DynamicResource Brush.Brand}"
                            Visibility="Hidden" />
                    </Grid>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Foreground" Value="{DynamicResource Brush.Text.Primary}" />
                            <Setter TargetName="Root" Property="Background" Value="#1AFFFFFF" />
                        </Trigger>

                        <Trigger Property="IsSelected" Value="True">
                            <Setter Property="Foreground" Value="{DynamicResource Brush.Brand}" />
                            <Setter Property="FontWeight" Value="SemiBold" />
                            <Setter TargetName="SelectionUnderline" Property="Visibility" Value="Visible" />
                        </Trigger>

                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Foreground" Value="{DynamicResource Brush.Text.Disable}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  窄边滚动条  -->
    <Style TargetType="ScrollBar">
        <Setter Property="Background" Value="Transparent" />

        <Setter Property="Width" Value="8" />
        <Setter Property="MinWidth" Value="8" />

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ScrollBar">
                    <Grid Background="Transparent">
                        <Track x:Name="PART_Track" IsDirectionReversed="true">
                            <Track.Thumb>
                                <Thumb>
                                    <Thumb.Template>
                                        <ControlTemplate TargetType="Thumb">
                                            <Border
                                                Margin="2,0"
                                                Background="{DynamicResource Brush.Text.Disabled}"
                                                CornerRadius="2" />
                                        </ControlTemplate>
                                    </Thumb.Template>
                                </Thumb>
                            </Track.Thumb>
                        </Track>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Opacity" Value="1" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="False">
                            <Setter Property="Opacity" Value="0.6" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  滑块样式  -->
    <Style x:Key="Style.CheckBox.Switch" TargetType="CheckBox">
        <Setter Property="Background" Value="{DynamicResource Brush.Bg.Input}" />
        <Setter Property="BorderBrush" Value="{DynamicResource Brush.Border}" />
        <Setter Property="Foreground" Value="{DynamicResource Brush.Text.Primary}" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Padding" Value="10,0,0,0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="CheckBox">
                    <Grid Background="Transparent">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>

                        <Border
                            x:Name="Track"
                            Width="44"
                            Height="24"
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="1"
                            CornerRadius="12">
                            <Border.Style>
                                <Style TargetType="Border">
                                    <Style.Triggers>
                                        <Trigger Property="IsEnabled" Value="False">
                                            <Setter Property="Opacity" Value="0.6" />
                                        </Trigger>
                                    </Style.Triggers>
                                </Style>
                            </Border.Style>
                        </Border>

                        <Grid
                            Width="44"
                            Height="24"
                            HorizontalAlignment="Left">
                            <Ellipse
                                x:Name="Knob"
                                Width="20"
                                Height="20"
                                Margin="2,0,0,0"
                                HorizontalAlignment="Left"
                                Fill="White"
                                Stroke="#DDDDDD"
                                StrokeThickness="0.5">
                                <Ellipse.Effect>
                                    <DropShadowEffect
                                        BlurRadius="5"
                                        Direction="270"
                                        Opacity="0.3"
                                        ShadowDepth="1.5"
                                        Color="Black" />
                                </Ellipse.Effect>
                                <Ellipse.RenderTransform>
                                    <TranslateTransform x:Name="KnobTranslate" X="0" />
                                </Ellipse.RenderTransform>
                            </Ellipse>
                        </Grid>

                        <ContentPresenter
                            Grid.Column="1"
                            Margin="{TemplateBinding Padding}"
                            HorizontalAlignment="Left"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            Content="{TemplateBinding Content}"
                            TextBlock.Foreground="{TemplateBinding Foreground}" />
                    </Grid>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter TargetName="Track" Property="Background" Value="{DynamicResource Brush.State.Success}" />
                            <Setter TargetName="Track" Property="BorderBrush" Value="{DynamicResource Brush.State.Success}" />

                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation
                                            Storyboard.TargetName="KnobTranslate"
                                            Storyboard.TargetProperty="X"
                                            To="20"
                                            Duration="0:0:0.2">
                                            <DoubleAnimation.EasingFunction>
                                                <CubicEase EasingMode="EaseOut" />
                                            </DoubleAnimation.EasingFunction>
                                        </DoubleAnimation>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>

                            <Trigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation
                                            Storyboard.TargetName="KnobTranslate"
                                            Storyboard.TargetProperty="X"
                                            To="0"
                                            Duration="0:0:0.2">
                                            <DoubleAnimation.EasingFunction>
                                                <CubicEase EasingMode="EaseOut" />
                                            </DoubleAnimation.EasingFunction>
                                        </DoubleAnimation>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.ExitActions>
                        </Trigger>

                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsMouseOver" Value="True" />
                                <Condition Property="IsChecked" Value="False" />
                            </MultiTrigger.Conditions>
                            <Setter TargetName="Track" Property="BorderBrush" Value="{DynamicResource Brush.Text.Primary}" />
                        </MultiTrigger>

                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="Button">
        <Setter Property="Background" Value="{DynamicResource Brush.Accent}" />
        <Setter Property="Foreground" Value="{DynamicResource Brush.Text.Inverse}" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="Padding" Value="15,0" />
        <Setter Property="Height" Value="{StaticResource Height.Button}" />
        <Setter Property="FontSize" Value="{StaticResource Size.Font.Normal}" />
        <Setter Property="FontFamily" Value="{StaticResource Font.Normal}" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border
                        x:Name="border"
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        CornerRadius="{StaticResource Radius.Normal}">
                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="border" Property="Background" Value="{DynamicResource Brush.Accent.Hover}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="border" Property="Background" Value="{DynamicResource Brush.Accent.Pressed}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="border" Property="Background" Value="{DynamicResource Brush.Bg.Panel}" />
                            <Setter Property="Foreground" Value="{DynamicResource Brush.Text.Disabled}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style
        x:Key="Btn.Ghost"
        BasedOn="{StaticResource {x:Type Button}}"
        TargetType="Button">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Foreground" Value="{DynamicResource Brush.Text.Primary}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="BorderBrush" Value="{DynamicResource Brush.Border}" />
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Bg.Hover}" />
                <Setter Property="BorderBrush" Value="{DynamicResource Brush.Accent}" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style
        x:Key="Btn.Danger"
        BasedOn="{StaticResource {x:Type Button}}"
        TargetType="Button">
        <Setter Property="Background" Value="{DynamicResource Brush.Status.Danger}" />
        <Setter Property="Foreground" Value="{DynamicResource Brush.Text.Inverse}" />

        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Opacity" Value="0.8" />
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter Property="Opacity" Value="0.6" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style TargetType="TextBox">
        <Setter Property="Background" Value="{DynamicResource Brush.Bg.Input}" />
        <Setter Property="Foreground" Value="{DynamicResource Brush.Text.Primary}" />
        <Setter Property="BorderBrush" Value="{DynamicResource Brush.Border}" />
        <Setter Property="BorderThickness" Value="{StaticResource Thickness.Border}" />
        <Setter Property="Padding" Value="8,0" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Height" Value="{StaticResource Height.Input}" />
        <Setter Property="FontFamily" Value="{StaticResource Font.Code}" />
        <Setter Property="CaretBrush" Value="{DynamicResource Brush.Text.Primary}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="TextBox">
                    <Border
                        x:Name="border"
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        CornerRadius="{StaticResource Radius.Small}">
                        <ScrollViewer x:Name="PART_ContentHost" Margin="{TemplateBinding Padding}" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="border" Property="BorderBrush" Value="{DynamicResource Brush.Text.Secondary}" />
                        </Trigger>
                        <Trigger Property="IsKeyboardFocused" Value="True">
                            <Setter TargetName="border" Property="BorderBrush" Value="{DynamicResource Brush.Border.Focus}" />
                            <Setter TargetName="border" Property="BorderThickness" Value="{StaticResource Thickness.Focus}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="ListView">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="Foreground" Value="{DynamicResource Brush.Text.Primary}" />
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
    </Style>

    <Style TargetType="ListViewItem">
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderThickness" Value="0,0,0,1" />
        <Setter Property="BorderBrush" Value="{DynamicResource Brush.Border}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListViewItem">
                    <Border
                        x:Name="Bd"
                        Padding="8,4"
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}">
                        <ContentPresenter />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="Bd" Property="Background" Value="{DynamicResource Brush.Bg.Hover}" />
                        </Trigger>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter TargetName="Bd" Property="Background" Value="{DynamicResource Brush.Bg.Panel}" />
                            <Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource Brush.Accent}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="DataGrid">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Foreground" Value="{DynamicResource Brush.Text.Primary}" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="RowHeaderWidth" Value="0" />
        <Setter Property="GridLinesVisibility" Value="Horizontal" />
        <Setter Property="HorizontalGridLinesBrush" Value="{DynamicResource Brush.Border}" />
        <Setter Property="VerticalGridLinesBrush" Value="Transparent" />
        <Setter Property="AutoGenerateColumns" Value="False" />
        <Setter Property="CanUserAddRows" Value="False" />
        <Setter Property="CanUserResizeRows" Value="False" />
        <Setter Property="HeadersVisibility" Value="Column" />
        <Setter Property="RowHeight" Value="36" />
    </Style>

    <Style TargetType="DataGridColumnHeader">
        <Setter Property="Background" Value="{DynamicResource Brush.Bg.Header}" />
        <Setter Property="Foreground" Value="{DynamicResource Brush.Text.Secondary}" />
        <Setter Property="Padding" Value="10,0" />
        <Setter Property="Height" Value="40" />
        <Setter Property="BorderThickness" Value="0,0,0,1" />
        <Setter Property="BorderBrush" Value="{DynamicResource Brush.Border}" />
        <Setter Property="FontWeight" Value="SemiBold" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="DataGridColumnHeader">
                    <Border
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}">
                        <ContentPresenter
                            Margin="{TemplateBinding Padding}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="DataGridCell">
        <Setter Property="Padding" Value="10,0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="DataGridCell">
                    <Border Background="Transparent" BorderThickness="0">
                        <ContentPresenter Margin="{TemplateBinding Padding}" VerticalAlignment="Center" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsSelected" Value="True">
                <Setter Property="Background" Value="Transparent" />
                <Setter Property="Foreground" Value="{DynamicResource Brush.Brand}" />
                <Setter Property="FontWeight" Value="Bold" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style TargetType="DataGridRow">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderThickness" Value="0" />
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Bg.Hover}" />
            </Trigger>
            <Trigger Property="IsSelected" Value="True">
                <Setter Property="Background" Value="{DynamicResource Brush.Bg.Selected}" />
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="PrimaryBtnStyle" TargetType="Button">
        <Setter Property="Background" Value="{DynamicResource Brush.Brand}" />
        <Setter Property="Foreground" Value="{DynamicResource Brush.Text.Inverse}" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="Padding" Value="15,6" />
        <Setter Property="Height" Value="32" />
        <Setter Property="FontSize" Value="13" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="FontWeight" Value="SemiBold" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border
                        x:Name="border"
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        CornerRadius="4">
                        <ContentPresenter
                            Margin="{TemplateBinding Padding}"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            RecognizesAccessKey="True" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="border" Property="Opacity" Value="0.9" />
                        </Trigger>

                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="border" Property="Opacity" Value="0.8" />
                            <Setter TargetName="border" Property="RenderTransform">
                                <Setter.Value>
                                    <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="0.98" ScaleY="0.98" />
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="border" Property="RenderTransformOrigin" Value="0.5,0.5" />
                        </Trigger>

                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="border" Property="Background" Value="{DynamicResource Brush.Bg.L4}" />
                            <Setter Property="Foreground" Value="{DynamicResource Brush.Text.Disabled}" />
                            <Setter Property="Opacity" Value="0.6" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="Style.GridViewHeader.Flat" TargetType="GridViewColumnHeader">
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Foreground" Value="{DynamicResource Brush.Text.Secondary}" />
        <Setter Property="Background" Value="{DynamicResource Brush.Bg.Panel}" />
        <Setter Property="Padding" Value="10,8" />
        <Setter Property="FontWeight" Value="SemiBold" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="GridViewColumnHeader">
                    <Border
                        Background="{TemplateBinding Background}"
                        BorderBrush="{DynamicResource Brush.Border}"
                        BorderThickness="0,0,0,1">
                        <ContentPresenter
                            Margin="{TemplateBinding Padding}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            RecognizesAccessKey="True"
                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="Style.ListViewItem.Table" TargetType="ListViewItem">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Foreground" Value="{DynamicResource Brush.Text.Primary}" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Padding" Value="5,0" />
        <Setter Property="Margin" Value="0" />
        <Setter Property="BorderThickness" Value="0,0,0,1" />
        <Setter Property="BorderBrush" Value="#1AFFFFFF" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListViewItem">
                    <Border
                        x:Name="Bd"
                        Height="30"
                        Padding="{TemplateBinding Padding}"
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        SnapsToDevicePixels="true">
                        <GridViewRowPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Bd" Property="Background" Value="#1AFFFFFF" />
                        </Trigger>
                        <Trigger Property="IsSelected" Value="true">
                            <Setter TargetName="Bd" Property="Background" Value="#33007ACC" />
                            <Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource Brush.Brand}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style
        x:Key="Style.TextBox.InTable"
        BasedOn="{StaticResource {x:Type TextBox}}"
        TargetType="TextBox">
        <Setter Property="Background" Value="{DynamicResource Brush.Bg.Input}" />
        <Setter Property="Foreground" Value="{DynamicResource Brush.Text.Primary}" />
        <Setter Property="BorderBrush" Value="{DynamicResource Brush.Border}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Padding" Value="8,4" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Height" Value="36" />
    </Style>

    <Style x:Key="Style.TextBox.CodeEditor" TargetType="TextBox">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Foreground" Value="{DynamicResource Brush.Text.Primary}" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="FontFamily" Value="Consolas, Cascadia Code, Courier New, monospace" />
        <Setter Property="FontSize" Value="13" />
        <Setter Property="Padding" Value="10" />
        <Setter Property="IsReadOnly" Value="True" />
        <Setter Property="TextWrapping" Value="Wrap" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="VerticalScrollBarVisibility" Value="Auto" />
        <Setter Property="HorizontalScrollBarVisibility" Value="Auto" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="TextBox">
                    <Border Background="{TemplateBinding Background}" BorderThickness="0">
                        <ScrollViewer x:Name="PART_ContentHost" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style
        x:Key="TabRadioStyle"
        BasedOn="{StaticResource {x:Type ToggleButton}}"
        TargetType="RadioButton">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Foreground" Value="{DynamicResource Brush.Text.Secondary}" />
        <Setter Property="BorderThickness" Value="0,0,0,2" />
        <Setter Property="BorderBrush" Value="Transparent" />
        <Setter Property="Padding" Value="15,6" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="FontSize" Value="12" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="RadioButton">
                    <Border
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}">
                        <ContentPresenter
                            Margin="{TemplateBinding Padding}"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter Property="BorderBrush" Value="{DynamicResource Brush.Accent}" />
                            <Setter Property="Foreground" Value="{DynamicResource Brush.Text.Primary}" />
                            <Setter Property="FontWeight" Value="Bold" />
                            <Setter Property="Background" Value="{DynamicResource Brush.Bg.L4}" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Foreground" Value="{DynamicResource Brush.Text.Primary}" />
                            <Setter Property="Background" Value="{DynamicResource Brush.Bg.Hover}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="Style.TextBox.Search" TargetType="TextBox">
        <Setter Property="Background" Value="{DynamicResource Brush.Bg.Input}" />
        <Setter Property="Foreground" Value="{DynamicResource Brush.Text.Primary}" />
        <Setter Property="BorderBrush" Value="{DynamicResource Brush.Border}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Height" Value="28" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Padding" Value="25,0,5,0" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="TextBox">
                    <Grid>
                        <Border
                            x:Name="Bd"
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            CornerRadius="4">
                            <Grid>
                                <TextBlock
                                    Margin="8,0,0,0"
                                    HorizontalAlignment="Left"
                                    VerticalAlignment="Center"
                                    FontSize="11"
                                    Foreground="{DynamicResource Brush.Text.Secondary}"
                                    IsHitTestVisible="False"
                                    Text="🔍" />

                                <ScrollViewer x:Name="PART_ContentHost" Margin="{TemplateBinding Padding}" />

                                <TextBlock
                                    x:Name="Watermark"
                                    Margin="28,0,0,0"
                                    VerticalAlignment="Center"
                                    Foreground="{DynamicResource Brush.Text.Secondary}"
                                    IsHitTestVisible="False"
                                    Opacity="0.5"
                                    Text="{TemplateBinding Tag}"
                                    Visibility="Collapsed" />
                            </Grid>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="Text" Value="">
                            <Setter TargetName="Watermark" Property="Visibility" Value="Visible" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource Brush.Accent}" />
                        </Trigger>
                        <Trigger Property="IsFocused" Value="True">
                            <Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource Brush.Accent}" />
                            <Setter TargetName="Bd" Property="Background" Value="{DynamicResource Brush.Bg.Panel}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>