/* 519/css/login.css */

/* ============================================================
   1. 公共基础样式 (所有设备通用的基础定义)
   ============================================================ */
html { 
    /* 解决 iOS Safari 工具栏引起的高度跳动问题 */
    height: -webkit-fill-available; 
}

body {
    font-family: 'Poppins', 'Microsoft YaHei', sans-serif;
    margin: 0; 
    padding: 0;
    display: flex; 
    justify-content: center; 
    align-items: center;
    overflow-x: hidden; 
    color: #333;
}

/* 宇宙粒子背景层：置于最底层，不干扰点击 */
.particles { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh; 
    z-index: 0; 
    pointer-events: none; 
}

/* --- 核心修复：Layer.js 提示窗口 (彻底去美化，只保留高清晰度) --- */
.layui-layer.layui-layer-msg { 
    background-color: #fff !important; /* 纯白背景 */
    border-radius: 12px !important; 
    border: none !important; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important; /* 加深阴影增强层次感 */
}

.layui-layer.layui-layer-msg .layui-layer-content {
    padding: 15px 20px 15px 52px !important; /* 左侧留出空间给图标 */
    font-size: 1.1rem !important;
    font-weight: 700 !important; /* 强制加粗 */
    line-height: 1.4 !important;
    text-align: left !important;
    
    /* 强制恢复最清晰的实色黑色，彻底排除标题美化样式的干扰 */
    color: #000000 !important; 
    -webkit-text-fill-color: #000000 !important; 
    background: none !important;
    background-image: none !important;
    text-shadow: none !important; /* 必须关掉阴影，否则文字会发虚 */
    -webkit-background-clip: border-box !important; /* 还原裁剪区域 */
}

/* 提示框图标定位：确保警告/错误图标在左侧垂直居中 */
.layui-layer.layui-layer-msg .layui-layer-content .layui-layer-ico {
    position: absolute !important; 
    left: 16px !important; 
    top: 50% !important; 
    margin-top: -15px !important; /* 图标高度一半，实现完美对齐 */
}

/* ============================================================
   2. 电脑端专用样式 (Desktop: 屏幕宽度 > 1024px)
   ============================================================ */
@media screen and (min-width: 1025px) {
    body {
        height: 100vh;
        /* 电脑背景：使用 CSS 变量动态匹配 */
        background: var(--login-bg) no-repeat center center fixed;
        background-size: 100% 100%;
    }

    .login-container {
        padding: 2.5rem 3rem; 
        width: 460px; /* 电脑端固定宽度，防止容器被按钮撑变形 */
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(15px); 
        border-radius: 20px;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
        z-index: 1; 
        transform-origin: center center;
        animation: fadeIn 0.8s ease-out, scaleUp 0.6s ease-in-out;
    }

    /* 仅针对主标题应用梦幻渐变美化 */
    .login-title {
        font-size: 1.9rem; 
        margin-bottom: 2rem; 
        white-space: nowrap; /* 强制标题不换行 */
        text-align: center; 
        font-family: 'Mochiy Pop P One', cursive;
        background: linear-gradient(45deg, #7aa2d4 30%, #d47a86 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        animation: textAnimateCute 3s ease-out infinite alternate;
    }

    /* 电脑端输入框 */
    .form-input { 
        padding: 0.85rem 1.2rem; 
        font-size: 0.95rem; 
        margin-bottom: 1rem; 
        border-radius: 12px; 
        border: 1px solid #ddd; 
        width: 100%; 
        box-sizing: border-box;
    }

    /* 电脑端按钮尺寸与间距 */
    .form-button, .social-login-button, .verify-code-button { 
        height: 48px !important; 
        border: none !important; 
        border-radius: 12px !important; 
        font-size: 1rem !important; 
        font-weight: 500 !important; 
        display: flex; 
        align-items: center; 
        justify-content: center; 
        cursor: pointer; 
        transition: all 0.3s ease; 
        box-sizing: border-box; 
    }

    /* 员工登录按钮：青蓝色 */
    .form-button { 
        width: 100% !important; 
        background: linear-gradient(45deg, #C1E8FF 0%, #A0E7E5 100%) !important; 
        color: #fff !important; 
        margin-top: 10px; 
    }

    /* 切换/注册按钮：柔紫色，限制宽度防止撑开盒子 */
    .social-login-button { 
        width: 320px !important; 
        margin: 12px auto 0 !important; 
        background: linear-gradient(45deg, #E2D1F9 0%, #C8B6FF 100%) !important; 
        color: #fff !important; 
    }

    /* 找回密码按钮颜色：冷灰色 */
    #forgettype .social-login-button { 
        background: linear-gradient(45deg, #E0E7FF 0%, #BCC6E0 100%) !important; 
    }

    /* 发送验证码按钮样式 */
    .verify-code-button { 
        width: 40% !important; 
        background: linear-gradient(45deg, #BDE4FF 0%, #90E1FF 100%) !important; 
        color: #fff !important; 
    }
}

/* ============================================================
   3. 手机端专用样式 (Mobile: 屏幕宽度 <= 1024px)
   ============================================================ */
@media screen and (max-width: 1024px) {
    body {
        min-height: 100vh; 
        min-height: -webkit-fill-available;
        background: var(--login-bg) no-repeat center center;
        background-size: cover; /* 手机端使用 cover 确保背景铺满 */
    }

    .login-container {
        /* 手机端放大容器宽度上限，增加横向视野 */
        width: 96% !important; 
        max-width: 580px !important; 
        padding: 4rem 1.8rem !important;
        background: rgba(255, 255, 255, 0.98); 
        border-radius: 24px;
        box-shadow: 0 15px 45px rgba(0, 0, 0, 0.2);
        z-index: 1; 
        transform-origin: center center; 
        animation: fadeIn 0.8s ease-out;
    }

    /* 手机端标题：加大加亮 */
    .login-title {
        font-size: 2.2rem !important; 
        margin-bottom: 2.8rem !important; 
        white-space: nowrap; 
        text-align: center; 
        font-family: 'Mochiy Pop P One', cursive;
        background: linear-gradient(45deg, #7aa2d4 30%, #d47a86 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    /* 手机端输入框：高度和字号大幅度增加 */
    .form-input { 
        height: 64px !important; 
        padding: 0 1.5rem !important; 
        font-size: 1.4rem !important; 
        margin-bottom: 1.8rem !important; 
        border-radius: 16px; 
        border: 1px solid #ddd; 
        width: 100%; 
        box-sizing: border-box;
    }

    /* 手机端按钮：极大化尺寸，方便操作 */
    .form-button, .social-login-button, .verify-code-button { 
        height: 68px !important; 
        border: none !important; 
        border-radius: 16px !important; 
        font-size: 1.4rem !important; 
        font-weight: bold !important; 
        display: flex; 
        align-items: center; 
        justify-content: center; 
        box-sizing: border-box; 
    }

    /* 手机端按钮颜色配置 */
    .form-button { 
        width: 100% !important; 
        background: linear-gradient(45deg, #C1E8FF 0%, #A0E7E5 100%) !important; 
        color: #fff !important; 
        margin-top: 10px; 
    }

    .social-login-button { 
        width: 100% !important; 
        background: linear-gradient(45deg, #E2D1F9 0%, #C8B6FF 100%) !important; 
        color: #fff !important; 
        margin-top: 20px; 
    }

    .verify-code-button { 
        width: 38% !important; 
        background: linear-gradient(45deg, #BDE4FF 0%, #90E1FF 100%) !important; 
        color: #fff !important; 
        font-size: 1.1rem !important; 
    }

    #forgettype .social-login-button { 
        background: linear-gradient(45deg, #E0E7FF 0%, #BCC6E0 100%) !important; 
    }
    
    /* 修正输入法弹出时粒子层的定位干扰 */
    .particles { height: 100%; position: absolute; }
}

/* ============================================================
   4. 动画效果定义 (仅给标题和容器使用)
   ============================================================ */
@keyframes scaleUp { 
    0% { transform: scale(0.96); opacity: 0; } 
    100% { transform: scale(1); opacity: 1; } 
}

@keyframes fadeIn { 
    0% { opacity: 0; transform: translateY(20px); } 
    100% { opacity: 1; transform: translateY(0); } 
}

/* 标题渐变色的轻微发光闪烁效果 */
@keyframes textAnimateCute { 
    0% { text-shadow: 1px 1px 10px rgba(255, 182, 193, 0.3); } 
    100% { text-shadow: 1px 1px 15px rgba(168, 213, 255, 0.4); } 
}

/* 预加载进度条专用样式 */
/* 全屏遮罩层 */
#preloader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.68);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.preloader-card {
    background: rgba(255, 255, 255, 0.98);
    width: 88%;
    max-width: 380px;
    padding: 32px 28px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.8);
    animation: scaleUp 0.3s ease-out;
}

.preloader-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

#preloader-percent-text {
    font-size: 2.2rem;
    font-weight: 800;
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #4f46e5, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
    margin: 8px 0;
}

.preloader-progress-bg {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin: 16px 0 12px 0;
}

#preloader-bar-inner {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #4f46e5, #a855f7, #ec4899);
    border-radius: 10px;
    transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.preloader-tips {
    font-size: 0.82rem;
    color: #64748b;
    margin-top: 4px;
}