* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主色调 */
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #3b82f6;

    /* 辅助色 */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;

    /* 文字颜色 */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;

    /* 背景色 */
    --bg-white: #ffffff;
    --bg-gray: #f8fafc;
    --bg-blue-light: #eff6ff;

    /* 边框颜色 */
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;

    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-blue: 0 8px 24px rgba(37, 99, 235, 0.12);
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg-white);
    color: var(--text-primary);
    line-height: 1.6;
}

/* 登录页面容器 */
.login-page {
    display: flex;
    width: 100vw;
    min-height: 100vh;
    flex-direction: row;
}

/* 右侧登录区 */
.login-right {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-white);
    padding: 40px;
    position: relative;
}

.login-right::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.03) 0%, transparent 70%);
    pointer-events: none;
}

.login-wrapper {
    width: 100%;
    max-width: 440px;
    animation: fadeInRight 0.8s ease-out;
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* 错误提示 */
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: shake 0.5s ease;
}

.error-message::before {
    content: '⚠️';
    font-size: 16px;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* 表单样式 */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-light);
    pointer-events: none;
    transition: color 0.2s ease;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 48px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.2s ease;
    outline: none;
    background: var(--bg-white);
    color: var(--text-primary);
}

.input-wrapper input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.input-wrapper input:focus + .input-icon {
    color: var(--primary-color);
}

.input-wrapper input::placeholder {
    color: var(--text-light);
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: color 0.2s ease;
}

.toggle-password:hover {
    color: var(--primary-color);
}

.toggle-password svg {
    width: 20px;
    height: 20px;
}

/* 表单操作 */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -8px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.forgot-password {
    font-size: 14px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.forgot-password:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* 登录按钮 */
.login-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 8px;
    box-shadow: var(--shadow-md);
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loader svg.spinner {
    width: 20px;
    height: 20px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 注册提示 */
.register-tip {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

.register-tip a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.register-tip a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* 登录页脚 */
.login-footer {
    margin-top: 32px;
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
}

.login-footer p a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.login-footer p a:hover {
    text-decoration: underline;
}

/* 响应式设计 */
@media (min-width: 769px) {
    .login-page {
        flex-direction: row !important;
    }

    .login-left {
        display: flex !important;
    }

    .login-right {
        display: flex !important;
    }
}

@media (max-width: 1024px) {
    .login-left {
        padding: 40px;
    }

    .brand-title {
        font-size: 36px;
    }

    .brand-features {
        display: none;
    }
}

@media (max-width: 768px) {
    .login-page {
        flex-direction: column;
    }

    .login-left {
        display: none;
    }

    .login-right {
        flex: 1;
        min-width: 100%;
    }

    .login-right {
        padding: 20px;
    }

    .login-wrapper {
        max-width: 100%;
    }

    .login-header h2 {
        font-size: 24px;
    }

    .input-wrapper input {
        padding: 12px 44px;
    }
}

@media (max-width: 480px) {
    .login-right {
        padding: 16px;
    }

    .login-wrapper {
        padding: 0;
    }

    .form-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* 动画增强 */
.login-wrapper > * {
    animation-duration: 0.6s;
    animation-fill-mode: both;
}

.login-header {
    animation-delay: 0.1s;
    animation-name: fadeInUp;
}

.login-form {
    animation-delay: 0.2s;
    animation-name: fadeInUp;
}

.login-footer {
    animation-delay: 0.3s;
    animation-name: fadeInUp;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
