/* ================================================================
   QX 登录页 · 全新改版 v2
   特点：粒子星空背景 + 毛玻璃卡片 + 渐变动效 + 现代交互
   ================================================================ */

html, body {
    height: 100%;
}

body.signin {
    height: auto;
    overflow: hidden;
    position: relative;
    background: #0a0a1a;
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
}

/* ========== Canvas 粒子星空背景 ========== */
#bg-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
}

/* ========== 多层渐变遮罩 ========== */
body.signin::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse at 15% 40%, rgba(99, 102, 241, 0.25) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 15%, rgba(6, 182, 212, 0.20) 0%, transparent 50%),
        radial-gradient(ellipse at 55% 85%, rgba(139, 92, 246, 0.20) 0%, transparent 55%),
        radial-gradient(ellipse at 30% 70%, rgba(236, 72, 153, 0.12) 0%, transparent 45%),
        linear-gradient(135deg, #06060f 0%, #0d0d2b 40%, #0a1628 70%, #06060f 100%);
    z-index: 1;
    pointer-events: none;
    animation: auroraPulse 12s ease-in-out infinite alternate;
}

@keyframes auroraPulse {
    0%   { opacity: 0.8; }
    50%  { opacity: 1.0; }
    100% { opacity: 0.85; }
}

/* ========== 中心包装 ========== */
.signin-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========== 毛玻璃登录卡片 ========== */
.login-card {
    width: 420px;
    padding: 50px 45px 45px;
    background: rgba(12, 12, 35, 0.65);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(139, 92, 246, 0.18);
    border-radius: 24px;
    box-shadow:
        0 0 60px rgba(99, 102, 241, 0.10),
        0 25px 60px rgba(0, 0, 0, 0.50),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
    animation: cardAppear 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(30px) scale(0.96);
}

@keyframes cardAppear {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========== Logo 区 ========== */
.login-logo {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo .logo-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.40);
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-6px); }
}

.login-logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 6px;
    letter-spacing: 2px;
}

.login-logo .sub-title {
    font-size: 13px;
    color: rgba(148, 163, 184, 0.70);
    letter-spacing: 4px;
    text-transform: uppercase;
}

/* ========== 表单 ========== */
.login-form {
    width: 100%;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    animation: inputAppear 0.5s ease forwards;
}

.form-group:nth-child(1) { animation-delay: 0.3s; }
.form-group:nth-child(2) { animation-delay: 0.45s; }
.form-group:nth-child(3) { animation-delay: 0.60s; }
.form-group:nth-child(4) { animation-delay: 0.75s; }

@keyframes inputAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: rgba(148, 163, 184, 0.80);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

/* ========== 输入框 ========== */
.form-control {
    width: 100%;
    height: 46px !important;
    padding: 0 16px !important;
    background: rgba(15, 15, 40, 0.70) !important;
    border: 1px solid rgba(99, 102, 241, 0.22) !important;
    border-radius: 12px !important;
    color: #e2e8f0 !important;
    font-size: 15px !important;
    transition: all 0.3s ease !important;
    box-shadow: none !important;
}

.form-control::placeholder {
    color: rgba(100, 116, 139, 0.55);
}

.form-control:focus {
    outline: none !important;
    border-color: rgba(99, 102, 241, 0.70) !important;
    background: rgba(15, 15, 40, 0.85) !important;
    box-shadow:
        0 0 0 3px rgba(99, 102, 241, 0.15),
        0 0 20px rgba(99, 102, 241, 0.08) !important;
}

.has-error .form-control {
    border-color: rgba(239, 68, 68, 0.60) !important;
}

.has-error .form-control:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

/* ========== 验证码行 ========== */
.code-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.code-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.code-row .imgcode {
    width: 110px;
    height: 46px;
    border-radius: 12px;
    cursor: pointer;
    border: 1px solid rgba(99, 102, 241, 0.22);
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.code-row .imgcode:hover {
    transform: scale(1.04);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25);
}

/* ========== 记住我 ========== */
.remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.remember-row label {
    font-size: 13px;
    color: rgba(148, 163, 184, 0.65);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
}

.remember-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #6366f1;
    cursor: pointer;
}

/* ========== 提交按钮 ========== */
.btn-primary {
    width: 100%;
    height: 50px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%) !important;
    border: none !important;
    border-radius: 14px !important;
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.3s ease !important;
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.35) !important;
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: btnAppear 0.5s ease 0.9s forwards;
}

@keyframes btnAppear {
    to { opacity: 1; }
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 36px rgba(99, 102, 241, 0.50) !important;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.30) !important;
}

.btn-primary[disabled] {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* ========== 底部版权 ========== */
.login-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 12px;
    color: rgba(100, 116, 139, 0.45);
    opacity: 0;
    animation: inputAppear 0.5s ease 1.1s forwards;
}

/* ========== 错误提示 ========== */
label.error {
    font-size: 12px;
    color: #f87171;
    margin-top: 5px;
    display: block;
}

/* ========== Layer 弹框美化 ========== */
body .layer-ext-moon-msg[type="dialog"] {
    border-radius: 16px !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4) !important;
}

/* ========== 全局表单控件重置 ========== */
.form-control, .form-control:focus, .has-error .form-control:focus,
.has-success .form-control:focus, .has-warning .form-control:focus,
.navbar-collapse, .navbar-form, .navbar-form-custom .form-control:focus,
.navbar-form-custom .form-control:hover, .open .btn.dropdown-toggle,
.panel, .popover, .progress, .progress-bar {
    box-shadow: none !important;
}

/* ========== 响应式 ========== */
@media (max-width: 480px) {
    .login-card {
        width: calc(100% - 32px);
        padding: 40px 30px 35px;
        border-radius: 20px;
    }
    .login-logo h1 {
        font-size: 20px;
    }
    .code-row .imgcode {
        width: 90px;
        height: 40px;
    }
}

/* ========== 登录状态遮罩 ========== */
.login-loading-mask {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(6, 6, 15, 0.55);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.login-loading-mask.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== 右侧信息栏（可选） ========== */
.login-side-info {
    position: fixed;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    color: rgba(148, 163, 184, 0.20);
    font-size: 13px;
    writing-mode: vertical-rl;
    letter-spacing: 3px;
    text-align: center;
    opacity: 0;
    animation: inputAppear 0.5s ease 1.2s forwards;
}

@media (max-width: 768px) {
    .login-side-info { display: none; }
}
