/* ============================================
   登录页面样式
   Created: 2025-12-28
   Version: 1.0
   ============================================ */

/* 引入 MiSans 字体 */
@import url('https://cdn.jsdelivr.net/npm/misans@4.0.0/lib/Normal/MiSans-Normal.min.css');

/* CSS变量定义 */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --error-color: #ef4444;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --border-color: #e5e7eb;
    --bg-white: #ffffff;
    --bg-gray: #f9fafb;
    --focus-ring: rgba(99, 102, 241, 0.25);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'MiSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-gray);
    min-height: 100vh;
    overflow: hidden;
}

/* 主容器 */
.login-container {
    display: flex;
    height: 100vh;
}

/* 左侧品牌区 */
.brand-section {
    flex: 0 0 55%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 60px 80px;
    position: relative;
    overflow: hidden;
}

.brand-section::before,
.brand-section::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.brand-section::before {
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
}

.brand-section::after {
    bottom: -30%;
    left: -10%;
    width: 500px;
    height: 500px;
}

.brand-content {
    position: relative;
    z-index: 1;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 60px;
}

.brand-logo img {
    display: block;
    width: auto;
    height: 80px;
}

.brand-title {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    letter-spacing: -0.025em;
}

.brand-description {
    font-size: 18px;
    line-height: 1.6;
    opacity: 0.9;
    margin-bottom: 50px;
    max-width: 500px;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    opacity: 0.9;
}

.feature-item i {
    font-size: 24px;
    background: rgba(255, 255, 255, 0.2);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.brand-footer {
    position: relative;
    z-index: 1;
    opacity: 0.7;
    font-size: 14px;
}

/* 右侧表单区 */
.form-section {
    flex: 0 0 45%;
    background: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.form-wrapper {
    width: 100%;
    max-width: 420px;
}

.form-header {
    margin-bottom: 32px;
}

.form-header h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-header p {
    font-size: 15px;
    color: var(--text-secondary);
}

/* 错误提示 */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    animation: slideDown 0.3s ease-out;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert i {
    font-size: 18px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 表单 */
.login-form {
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* 输入框包装器 */
.input-group {
    position: relative;
}

/* 左侧图标 - 使用 top + transform 垂直居中 */
/* 必须使用 > i 只选择直接子元素，否则会影响按钮里的眼睛图标 */
.input-group>i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: var(--text-tertiary);
    pointer-events: none;
    transition: color var(--transition-fast);
    z-index: 1;
}

/* 输入框 */
.input-group input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 15px;
    color: var(--text-primary);
    background: var(--bg-gray);
    transition: all var(--transition-fast);
    position: relative;
    z-index: 1;
    /* 确保低于按钮 */
}

/* 密码输入框右侧留空间 */
.input-group input#password {
    padding-right: 48px;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-white);
    box-shadow: 0 0 0 4px var(--focus-ring);
}

.input-group input:focus~i {
    color: var(--primary-color);
}

.input-group input::placeholder {
    color: var(--text-tertiary);
}

/* 密码可见切换按钮 - 使用 top + transform 垂直居中 */
.toggle-password {
    position: absolute;
    right: 14px;
    /* 调整位置让按钮在输入框内部 */
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 8px;
    font-size: 20px;
    transition: color var(--transition-fast);
    z-index: 10;
    /* 提高层级确保可点击 */
    pointer-events: auto;
    /* 确保可以点击 */
}

.toggle-password:hover {
    color: var(--primary-color);
}

/* 表单选项 */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.link-primary {
    font-size: 14px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.link-primary:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* 登录按钮 */
.btn-login {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login i {
    font-size: 18px;
    transition: transform var(--transition-fast);
}

.btn-login:hover i {
    transform: translateX(4px);
}

/* 响应式 */
@media (max-width: 1024px) {
    .brand-section {
        flex: 0 0 50%;
        padding: 40px 50px;
    }

    .brand-title {
        font-size: 36px;
    }

    .form-section {
        flex: 0 0 50%;
    }
}

@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
    }

    .brand-section {
        flex: 0 0 auto;
        min-height: 35vh;
        padding: 30px 24px;
    }

    .brand-title {
        font-size: 28px;
    }

    .brand-description {
        font-size: 16px;
        margin-bottom: 30px;
    }

    .brand-features {
        display: none;
    }

    .form-section {
        flex: 1;
        padding: 24px;
    }

    .form-header h2 {
        font-size: 24px;
    }
}

/* Version: 3.0 */