/*
 * 管理员登录页样式 - 简洁专业主题
 */

:root {
    --login-primary: #3b82f6;
    --login-primary-hover: #2563eb;
    --login-bg: #f1f5f9;
    --bg-color: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --red: #ef4444;
    --green: #16a34a;
    --white: #ffffff;
}

/* ========== 基础重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
}

/* ========== 登录容器 ========== */
.login-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ========== 左侧装饰区域（桌面） ========== */
.login-decoration {
    flex: 1;
    background: #0b1f4d;
    border-right: 1px solid #08173a;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

.decoration-content {
    max-width: 440px;
    width: 100%;
    color: #fff;
}

.brand {
    margin-bottom: 40px;
}

.brand-icon {
    width: 72px;
    height: 72px;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.brand-icon i {
    font-size: 34px;
    color: #fff;
}

.brand h1 {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.brand p {
    font-size: 14px;
    color: rgba(255,255,255,0.75);
}

/* ========== 功能特点 ========== */
.features {
    margin-top: 32px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding: 14px 16px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15);
}

.feature-icon {
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-icon i {
    font-size: 16px;
    color: #fff;
}

.feature-text h3 {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
}

.feature-text p {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
}

/* ========== 右侧登录表单 ========== */
.login-form-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.login-form-container {
    width: 100%;
    max-width: 400px;
}

/* ========== 移动端品牌（仅手机显示） ========== */
.mobile-brand {
    display: none;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.mobile-brand .brand-icon {
    width: 44px;
    height: 44px;
    background: #2563eb;
    border-radius: 10px;
    margin-bottom: 0;
}

.mobile-brand .brand-icon i {
    font-size: 20px;
}

.mobile-brand h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ========== 登录框 ========== */
.login-box {
    background: var(--white);
    border-radius: 10px;
    padding: 36px;
    border: 1px solid var(--border-color);
}

.login-box-header {
    margin-bottom: 28px;
}

.login-box-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.login-box-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ========== 错误提示 ========== */
.alert-msg {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 13px;
}

.alert-msg i {
    font-size: 15px;
    flex-shrink: 0;
}

.alert-msg-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--red);
}

/* ========== 弹窗提示 ========== */
.login-popup {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1000;
}

.login-popup-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.login-popup-card {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: 14px;
    padding: 20px 18px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.login-popup-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

.login-popup-success .login-popup-icon {
    background: #dcfce7;
    color: var(--green);
}

.login-popup-error .login-popup-icon {
    background: #fee2e2;
    color: var(--red);
}

.login-popup-info .login-popup-icon {
    background: #dbeafe;
    color: var(--login-primary);
}

.login-popup-content {
    flex: 1;
    min-width: 0;
}

.login-popup-content h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.login-popup-content p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.login-popup-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
    flex-shrink: 0;
}

.login-popup-close:hover {
    color: var(--text-primary);
}

/* ========== 表单 ========== */
.login-form {
    margin-bottom: 20px;
}

.input-group-form {
    margin-bottom: 18px;
}

.input-group-form label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.input-group-form label i {
    color: var(--text-secondary);
    font-size: 13px;
    width: 16px;
    text-align: center;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: var(--white);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--login-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-wrapper input::placeholder {
    color: #94a3b8;
}

.username-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.username-wrapper input {
    flex: 1;
}

.avatar-preview {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.avatar-preview-loaded {
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.15);
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #94a3b8;
    font-size: 16px;
}

.avatar-tip {
    margin-top: 8px;
}

/* 密码显示/隐藏按钮 */
.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
}

.toggle-password:hover {
    color: var(--login-primary);
}

/* ========== 验证码输入框 ========== */
.verify-code-wrapper {
    display: flex;
    gap: 0;
}

.verify-code-wrapper input {
    border-radius: 6px 0 0 6px !important;
    border-right: none !important;
    flex: 1;
}

.btn-get-code {
    padding: 0 14px;
    background: var(--login-primary);
    color: #fff;
    border: 1px solid var(--login-primary);
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    min-width: 100px;
    flex-shrink: 0;
}

.btn-get-code:hover:not(:disabled) {
    background: var(--login-primary-hover);
    border-color: var(--login-primary-hover);
}

.btn-get-code:disabled {
    background: #94a3b8;
    border-color: #94a3b8;
    cursor: not-allowed;
}

.verify-tip {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 7px;
    line-height: 1.4;
}

.verify-tip i {
    font-size: 12px;
    margin-top: 2px;
    flex-shrink: 0;
}

.captcha-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.captcha-img {
    width: 108px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #f8fbff;
    cursor: pointer;
    user-select: none;
}

.btn-refresh-captcha {
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #fff;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.btn-refresh-captcha:hover {
    border-color: var(--login-primary);
    color: var(--login-primary);
}

/* ========== 验证码消息提示 ========== */
.code-msg {
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 14px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.4;
}

.code-msg-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: var(--green);
}

.code-msg-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--red);
}

/* ========== 登录按钮 ========== */
.btn-login {
    width: 100%;
    padding: 12px 24px;
    background: var(--login-primary);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    transition: background-color 0.2s;
}

.btn-login:hover {
    background: var(--login-primary-hover);
}

.btn-login:active {
    background: #1d4ed8;
}

.btn-login i {
    font-size: 13px;
}

/* ========== 登录底部 ========== */
.login-footer {
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    margin-top: 4px;
}

.back-home {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s;
}

.back-home:hover {
    color: var(--login-primary);
}

/* ========== 版权信息 ========== */
.copyright {
    text-align: center;
    margin-top: 24px;
    color: #94a3b8;
    font-size: 12px;
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .login-decoration {
        display: none;
    }

    .login-form-wrapper {
        padding: 30px 20px;
    }

    .mobile-brand {
        display: flex;
    }

    .login-box {
        padding: 28px 20px;
    }
}

@media (max-width: 480px) {
    .login-form-wrapper {
        padding: 24px 16px;
        align-items: flex-start;
        padding-top: 36px;
    }

    .login-box {
        padding: 24px 16px;
    }

    .login-box-header h2 {
        font-size: 20px;
    }

    .input-wrapper input {
        font-size: 15px;
        padding: 12px 14px;
    }

    .username-wrapper {
        gap: 8px;
    }

    .avatar-preview {
        width: 38px;
        height: 38px;
    }

    .btn-login {
        font-size: 14px;
        padding: 13px 20px;
    }

    .copyright {
        margin-top: 20px;
    }
}
