<mah:MetroWindow xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
                 xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
                 x:Class="BDU.Windows.Login"
                 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:BDU.Windows"
                 mc:Ignorable="d"
                 Title="BDU系统"
                 WindowStartupLocation="CenterScreen"
                 Height="315"
                 Width="420"
                 ResizeMode="NoResize"
                 PreviewKeyDown="Login_PreviewKeyDown">

    <Window.Resources>
        <Style TargetType="TextBox"
               BasedOn="{StaticResource MahApps.Styles.TextBox}">
            <Setter Property="FontSize"
                    Value="14" />
            <Setter Property="BorderThickness"
                    Value="0,0,0,2" />
            <Setter Property="BorderBrush"
                    Value="#E0E0E0" />
            <Setter Property="Padding"
                    Value="5,8" />
            <Setter Property="Background"
                    Value="Transparent" />
        </Style>

        <Style TargetType="PasswordBox"
               BasedOn="{StaticResource MahApps.Styles.PasswordBox}">
            <Setter Property="FontSize"
                    Value="14" />
            <Setter Property="BorderThickness"
                    Value="0,0,0,2" />
            <Setter Property="BorderBrush"
                    Value="#E0E0E0" />
            <Setter Property="Padding"
                    Value="5,8" />
            <Setter Property="Background"
                    Value="Transparent" />
        </Style>

        <Style TargetType="Button"
               BasedOn="{StaticResource MahApps.Styles.Button.Flat}">
            <Setter Property="FontSize"
                    Value="15" />
            <Setter Property="FontWeight"
                    Value="SemiBold" />
            <Setter Property="Foreground"
                    Value="White" />
            <Setter Property="Background"
                    Value="#2196F3" />
            <Setter Property="BorderThickness"
                    Value="0" />
            <Setter Property="Margin"
                    Value="0,20,0,0" />
        </Style>
    </Window.Resources>

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="11*"/>
            <ColumnDefinition Width="94*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="40" />
        </Grid.RowDefinitions>

        <!-- 表单区域 -->
        <Border Grid.Row="0"
                Background="White"
                Margin="20,20,20,0"
                CornerRadius="5"
                BorderThickness="1"
                BorderBrush="#E0E0E0"
                Padding="30,20" Grid.ColumnSpan="2">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>


                <Label Content="用户登录"
                       HorizontalAlignment="Center"
                       FontSize="15"
                       Padding="3" />
                <StackPanel Grid.Row="1">

                    <!-- 用户名输入 -->
                    <StackPanel  Orientation="Vertical"
                                 HorizontalAlignment="Center">
                        <StackPanel Orientation="Horizontal"
                                    Margin="17">
                            <iconPacks:PackIconMaterial Kind="Account"
                                                        Foreground="#2196F3"
                                                        VerticalAlignment="Center"
                                                        Margin="0,0,10,0" />
                            <TextBox x:Name="nameBox"
                                     mah:TextBoxHelper.Watermark="请输入账号"
                                     mah:TextBoxHelper.ClearTextButton="True"
                                     VerticalContentAlignment="Center"
                                     Width="180"
                                     Height="30"
                                     Padding="0" />
                        </StackPanel>
                    </StackPanel>

                    <!-- 密码输入 -->
                    <StackPanel Orientation="Vertical"
                                HorizontalAlignment="Center">
                        <StackPanel Orientation="Horizontal"
                                    Margin="7">
                            <iconPacks:PackIconMaterial Kind="Lock"
                                                        Foreground="#2196F3"
                                                        VerticalAlignment="Center"
                                                        Margin="0,0,10,0" />
                            <PasswordBox x:Name="pwdBox"
                                         mah:TextBoxHelper.Watermark="请输入密码"
                                         mah:TextBoxHelper.ClearTextButton="True"
                                         VerticalContentAlignment="Center"
                                         Width="180"
                                         Height="30"
                                         Padding="0" />
                        </StackPanel>
                    </StackPanel>
                </StackPanel>

                <!-- 登录按钮 -->
                <Button Grid.Row="2"
                        Click="LoginClick"
                        Content="登 录"
                        Width="120"
                        Height="33"
                        mah:ControlsHelper.CornerRadius="5">
                    <Button.Effect>
                        <DropShadowEffect BlurRadius="8"
                                          ShadowDepth="3"
                                          Opacity="0.5" />
                    </Button.Effect>
                </Button>
            </Grid>
        </Border>

        <!-- 底部版权信息 -->
        <TextBlock Grid.Row="1"
                   Text="© 2025 BDU系统"
                   Foreground="#777"
                   FontSize="12"
                   HorizontalAlignment="Left"
                   Margin="123,10,0,10" Grid.Column="1" />
    </Grid>
</mah:MetroWindow>