/* ============================================================
 * 登录页共享样式 — login-core.css
 * 2026-10-15 Step1 自 casLoginView.html 内嵌 <style> 原样迁出（逐字节保留，仅加本头注释）。
 * 由 casLoginView.html <head> 加载，位置在原 <style> 处（login-common.css 之后），层叠顺序不变。
 * ============================================================ */

        input::-webkit-outer-spin-button,
        input::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
        }

        .loading {
            display: none;
        }

        /* 由JS动态控制登录方式的显隐（从数据库配置接口读取） */
        /* Tab 按钮禁用任何背景填充（2026-10-15 用户要求去掉悬浮蓝底）：
           显式覆盖 hover/focus/active 全部状态，仅保留文字色与底部下划线；
           border 归一化防 UA 默认 outset 描边成框。
           注意：激活下划线颜色仍由模板内主题色注入脚本
           （.tab-btn.border-primary { border-color: X !important }）控制，不受影响。 */
        .login-main .tab-btn,
        .login-main .tab-btn:hover,
        .login-main .tab-btn:focus,
        .login-main .tab-btn:focus-visible,
        .login-main .tab-btn:active {
            background: transparent !important;
            border: 0;
            border-bottom: 2px solid transparent;
            outline: none;
            -webkit-tap-highlight-color: transparent;
        }

        /* 禁止 Tab 区域文本选中：点击登录方式时若选中文本，会出现紧贴文字的
           蓝色 ::selection 选区（用户截图中蓝底紧贴文字即此特征），一并禁掉。 */
        .login-main #loginTabs {
            user-select: none;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
        }

        .login-main .tab-btn::selection {
            background: transparent;
        }

        .tab-btn.login-type-hidden {
            display: none !important;
        }

        .tab-content.login-type-hidden {
            display: none !important;
        }

        /* 企业微信登录进度动画 */
        @keyframes wechatPulse {
            0%, 100% { opacity: 1; transform: scale(1); }
            50% { opacity: 0.8; transform: scale(1.05); }
        }

        .wechat-icon-pulse {
            animation: wechatPulse 2s ease-in-out infinite;
        }

        /* 进度条动画 */
        @keyframes progressShine {
            0% { background-position: -200px 0; }
            100% { background-position: 200px 0; }
        }

        .progress-shine {
            background: linear-gradient(90deg, #10b981, #3b82f6, #10b981);
            background-size: 200px 100%;
            animation: progressShine 2s ease-in-out infinite;
        }

        @keyframes fadeInUp {
            0% {
                opacity: 0;
                transform: translateY(20px);
            }
            100% {
                opacity: 1;
                transform: translateY(0);
            }
        }
        /* 企业微信绑定专用样式 */
        .wechat-binding-container {
            background: white;
            border-radius: 20px;
            margin: 16px 0;
        }

        .wechat-binding-header {
            background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
            border-radius: 16px;
            padding: 20px;
            margin-bottom: 24px;
            border: 1px solid #c7d2fe;
        }

        .wechat-binding-info-card {
            background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
            border-radius: 12px;
            padding: 16px;
            border: 1px solid #93c5fd;
            margin-bottom: 20px;
        }

        /* 优化的输入框样式 */
        .modern-input {
            width: 100%;
            padding: 16px 20px 16px 50px;
            border: 2px solid #e5e7eb;
            border-radius: 12px;
            font-size: 16px;
            transition: all 0.3s ease;
            background: #fafafa;
        }

        .modern-input:focus {
            outline: none;
            border-color: #3b82f6;
            background: white;
            box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
            transform: translateY(-1px);
        }

        .modern-input:hover {
            border-color: #9ca3af;
            background: white;
        }

        .input-icon {
            position: absolute;
            left: 16px;
            top: 50%;
            transform: translateY(-50%);
            color: #9ca3af;
            font-size: 18px;
            transition: color 0.3s ease;
        }

        .modern-input:focus ~ .input-icon {
            color: #3b82f6;
        }

        /* 确保输入框获得焦点时图标仍然显示 */
        .input-icon {
            display: block !important;
            visibility: visible !important;
            opacity: 1 !important;
        }

        /* 现代化按钮样式 */
        .modern-btn-primary {
            width: 100%;
            padding: 16px 24px;
            background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
            color: white;
            border: none;
            border-radius: 12px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
        }

        .modern-btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
            background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
        }

        .modern-btn-primary:active {
            transform: translateY(0);
        }

        .modern-btn-secondary {
            width: 100%;
            padding: 16px 24px;
            background: #f8fafc;
            color: #64748b;
            border: 2px solid #e2e8f0;
            border-radius: 12px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .modern-btn-secondary:hover {
            background: #f1f5f9;
            border-color: #cbd5e1;
            color: #475569;
        }

        /* 验证码输入框样式 */
        .captcha-container {
            display: flex;
            gap: 12px;
            align-items: center;
        }

        .captcha-input {
            flex: 1;
        }

        /* OpenID 显示样式 */
        .openid-display {
            font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
            font-size: 14px;
            font-weight: 600;
            letter-spacing: 1px;
            color: #1e40af;
        }

        /* ========== 自定义确认弹窗 ========== */
        .confirm-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.45);
            z-index: 9999;
            display: none;
            justify-content: center;
            align-items: center;
        }

        .confirm-overlay.show {
            display: flex;
        }

        .confirm-dialog {
            background: #fff;
            border-radius: 12px;
            width: 400px;
            max-width: 90vw;
            padding: 32px 28px 24px;
            text-align: center;
            box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
            animation: confirmFadeIn 0.25s ease-out;
        }

        @keyframes confirmFadeIn {
            from {
                opacity: 0;
                transform: translateY(-20px) scale(0.96);
            }
            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        .confirm-icon {
            width: 52px;
            height: 52px;
            margin: 0 auto 16px;
            background: #fff7e6;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 26px;
            color: #fa8c16;
        }

        .confirm-title {
            font-size: 16px;
            font-weight: 600;
            color: #1f2937;
            margin-bottom: 8px;
        }

        .confirm-message {
            font-size: 14px;
            color: #6b7280;
            margin-bottom: 28px;
            line-height: 1.6;
        }

        .confirm-buttons {
            display: flex;
            gap: 10px;
            justify-content: center;
        }

        .confirm-btn {
            flex: 1;
            max-width: 120px;
            padding: 10px 0;
            border: none;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }

        .confirm-btn-no {
            background: #f3f4f6;
            color: #374151;
        }

        .confirm-btn-no:hover {
            background: #e5e7eb;
        }

        .confirm-btn-yes {
            background: #1677ff;
            color: #fff;
        }

        .confirm-btn-yes:hover {
            background: #4096ff;
        }

        /* 二维码遮罩层样式 */
        .qr-overlay {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(8px);
            display: none;
            align-items: center;
            justify-content: center;
            border-radius: 8px;
            z-index: 10;
        }

        .qr-overlay.show {
            display: flex;
        }

        .qr-overlay-content {
            text-align: center;
            padding: 20px;
        }

        .qr-overlay-icon {
            font-size: 48px;
            margin-bottom: 12px;
        }

        .qr-overlay-text {
            font-size: 16px;
            font-weight: 600;
            color: #1f2937;
            margin-bottom: 8px;
        }

        .qr-overlay-subtext {
            font-size: 14px;
            color: #6b7280;
        }

        /* 扫描动画 */
        @keyframes scanPulse {
            0%, 100% {
                opacity: 1;
                transform: scale(1);
            }
            50% {
                opacity: 0.7;
                transform: scale(1.1);
            }
        }

        .scan-animation {
            animation: scanPulse 1.5s ease-in-out infinite;
        }

        /* 响应式优化 */
        @media (max-width: 640px) {
            .w-\[420px\] {
                width: 100%;
                margin: 0 1rem;
            }

            .wechat-binding-fade-in {
                margin: 0 0.5rem;
            }
        }

        /* 短信验证码发送按钮样式 */
        .sms-send-btn {
            min-width: 120px;
            padding: 12px 16px;
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            color: white;
            border: none;
            border-radius: 12px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
            white-space: nowrap;
        }

        .sms-send-btn:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
            background: linear-gradient(135deg, #059669 0%, #047857 100%);
        }

        .sms-send-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

        /* 错误提示样式 */
        .error-message {
            color: #ef4444;
            font-size: 14px;
            margin-top: 4px;
            display: flex;
            align-items: center;
            gap: 4px;
        }

        /* 成功提示样式 */
        .success-message {
            color: #10b981;
            font-size: 14px;
            margin-top: 4px;
            display: flex;
            align-items: center;
            gap: 4px;
        }

        /* USER_ACTIVE 配置决定是否显示"账号激活"入口 */
        .account-activate-entry { display: none; }
        .account-activate-entry.active { display: inline; }
    /* ===== 登录页动态渐变背景（浅色主题） ===== */
    body.login-body {
        margin: 0;
        min-height: 100vh;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
        background: linear-gradient(135deg, #eef4ff 0%, #f7faff 50%, #ecfdf5 100%);
        overflow-x: hidden;
    }

    .login-page {
        position: relative;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 2rem 1rem 5rem;
        overflow: hidden;
    }

    /* 模板2页面自身已占满视口，容器不再负责居中/背景装饰 */
    /* tpl2 时 body 不带 login-body，重置浏览器默认 8px 外边距，避免模板2 min-h-screen 叠加后出现纵向滚动条 */
    body:not(.login-body) {
        margin: 0;
    }

    body:not(.login-body) .login-page {
        display: block;
        padding: 0;
        min-height: auto;
    }

    /* 动态渐变装饰球 */
    .login-bg-decor {
        position: absolute;
        inset: 0;
        z-index: 0;
        pointer-events: none;
        overflow: hidden;
    }

    .login-bg-decor .blob {
        position: absolute;
        border-radius: 50%;
        filter: blur(60px);
        opacity: 0.5;
        animation: blobFloat 20s ease-in-out infinite;
    }

    .blob-1 {
        width: 440px; height: 440px;
        top: -120px; left: -90px;
        background: radial-gradient(circle at 30% 30%, #bfdbfe, #3b82f6);
        animation-delay: 0s;
        animation-duration: 20s;
    }

    .blob-2 {
        width: 380px; height: 380px;
        bottom: -110px; right: -70px;
        background: radial-gradient(circle at 70% 30%, #a7f3d0, #10b981);
        animation-delay: -6s;
        animation-duration: 24s;
    }

    .blob-3 {
        width: 320px; height: 320px;
        top: 38%; right: 10%;
        background: radial-gradient(circle at 50% 50%, #ddd6fe, #8b5cf6);
        animation-delay: -11s;
        opacity: 0.4;
        animation-duration: 18s;
    }

    .blob-4 {
        width: 280px; height: 280px;
        bottom: 16%; left: 8%;
        background: radial-gradient(circle at 40% 60%, #fbcfe8, #ec4899);
        animation-delay: -15s;
        opacity: 0.35;
        animation-duration: 26s;
    }

    .blob-5 {
        width: 300px; height: 300px;
        top: 10%; left: 15%;
        background: radial-gradient(circle at 50% 50%, #fde68a, #f59e0b);
        animation-delay: -3s;
        opacity: 0.3;
        animation-duration: 22s;
        animation-name: blobFloat2;
    }

    .blob-6 {
        width: 250px; height: 250px;
        bottom: 6%; right: 15%;
        background: radial-gradient(circle at 50% 50%, #a5f3fc, #06b6d4);
        animation-delay: -9s;
        opacity: 0.32;
        animation-duration: 28s;
        animation-name: blobFloat2;
    }

    @keyframes blobFloat {
        0%, 100% { transform: translate(0, 0) scale(1); }
        33% { transform: translate(45px, -35px) scale(1.08); }
        66% { transform: translate(-35px, 28px) scale(0.94); }
    }

    @keyframes blobFloat2 {
        0%, 100% { transform: translate(0, 0) scale(1); }
        50% { transform: translate(-42px, 32px) scale(1.12); }
    }

    /* 漂浮光点粒子层 */
    .login-particles {
        position: absolute;
        inset: 0;
        z-index: 0;
        pointer-events: none;
    }

    .star {
        position: absolute;
        border-radius: 50%;
        background: #ffffff;
        box-shadow: 0 0 10px 2px rgba(96, 165, 250, 0.55);
        animation: twinkle 3.5s ease-in-out infinite;
    }

    @keyframes twinkle {
        0%, 100% { opacity: 0.2; transform: translateY(0) scale(0.7); }
        50% { opacity: 1; transform: translateY(-12px) scale(1.15); }
    }

    /* 缓慢旋转的光晕（增强动态层次）：限定为模板1专属 */
    body.login-body .login-page::before {
        content: "";
        position: absolute;
        inset: -50%;
        z-index: 0;
        background: conic-gradient(from 0deg,
            rgba(59,130,246,0.13),
            rgba(16,185,129,0.13),
            rgba(139,92,246,0.13),
            rgba(59,130,246,0.13));
        animation: spinSlow 40s linear infinite;
        pointer-events: none;
    }

    @keyframes spinSlow {
        to { transform: rotate(360deg); }
    }

    .login-main {
        position: relative;
        z-index: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    /* 模板2自身就是整屏布局，不需要容器再 flex 居中 */
    body:not(.login-body) .login-main {
        display: block;
    }

    .login-card {
        border: 1px solid rgba(255, 255, 255, 0.7);
        box-shadow: 0 24px 60px rgba(59, 130, 246, 0.14), 0 8px 24px rgba(15, 23, 42, 0.06);
        animation: cardFloatIn 0.8s ease-out both;
    }

    @keyframes cardFloatIn {
        from { opacity: 0; transform: translateY(26px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .login-footer {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 2;
        text-align: center;
        color: #64748b;
        font-size: 13px;
        line-height: 1.9;
        padding-bottom: 1rem;
    }

    @media (max-width: 640px) {
        .login-bg-decor .blob { filter: blur(42px); opacity: 0.4; }
    }

        /* ========== 企业微信桌面端快捷登录弹层（Step2 2026-10-16 重建） ========== */
        .wwlogin-overlay {
            display: none; position: fixed; inset: 0; z-index: 9999;
            background: rgba(15, 23, 42, .55); align-items: center; justify-content: center;
        }
        .wwlogin-dialog {
            background: #fff; border-radius: 12px; padding: 0;
            box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
            animation: wwloginPopIn .18s ease-out; overflow: hidden;
        }
        @keyframes wwloginPopIn { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
        .wwlogin-head {
            display: flex; align-items: center; justify-content: space-between;
            padding: 14px 16px; font-size: 15px; font-weight: 600; color: #1f2937;
            border-bottom: 1px solid #f0f0f0;
        }
        .wwlogin-close { cursor: pointer; color: #9ca3af; font-size: 16px; transition: color .2s; }
        .wwlogin-close:hover { color: #4b5563; }
        .wwlogin-mount { display: flex; justify-content: center; padding: 6px 10px; min-width: 500px; min-height: 440px; }
        .wwlogin-tip { padding: 10px 16px 14px; text-align: center; font-size: 12px; color: #9ca3af; }
        /* 确认/取消弹窗（2026-10-16 弹窗方案：纯自有 UI，官方面板移入独立小窗） */
        .wwlogin-confirm { width: 380px; }
        .wwlogin-confirm-body { padding: 30px 28px 6px; text-align: center; }
        .wwlogin-confirm-icon { display: inline-block; font-size: 42px; color: #07c160; margin-bottom: 14px; }
        .wwlogin-confirm-body p { margin: 0 0 8px; font-size: 16px; font-weight: 600; color: #1f2937; }
        .wwlogin-confirm-body .wwlogin-confirm-sub {
            margin: 0 0 4px; font-size: 13px; font-weight: 400;
            color: #9ca3af; line-height: 1.7;
        }
        .wwlogin-actions { display: flex; gap: 12px; padding: 22px 28px 26px; }
        .wwlogin-btn {
            flex: 1; height: 40px; border-radius: 6px; cursor: pointer;
            border: 1px solid #dcdfe6; background: #fff; color: #606266;
            font-size: 14px; transition: all .2s;
        }
        .wwlogin-btn:hover { color: #07c160; border-color: #07c160; background: #f0faf4; }
        .wwlogin-btn.primary { background: #07c160; border-color: #07c160; color: #fff; }
        .wwlogin-btn.primary:hover { background: #06ad56; border-color: #06ad56; color: #fff; }
        /* 一键登录按钮（探测到桌面端登录态才显示，默认 display:none） */
        #wwQuickLoginBtn {
            display: none; align-items: center; gap: 6px;
            padding: 7px 16px; border: 1.5px solid #07c160; border-radius: 8px;
            background: #f0faf4; color: #07c160; font-size: 13px; font-weight: 500;
            cursor: pointer; transition: all .2s; white-space: nowrap;
        }
        #wwQuickLoginBtn:hover { background: #07c160; color: #fff; }
        #wwQuickLoginBtn.show { display: inline-flex; }
        /* 检测中占位（2026-10-19）：探测需数秒，先以灰色不可点状态出现，
           探测出「桌面端已登录」后才变绿可点；未登录则整体隐藏。 */
        #wwQuickLoginBtn.checking {
            border-color: #dcdfe6; background: #f5f7fa; color: #a8abb2;
            cursor: default; pointer-events: none;
        }
        #wwQuickLoginBtn.checking:hover { background: #f5f7fa; color: #a8abb2; }
        #wwQuickLoginBtn .ww-checking-tip { margin-left: 5px; font-size: 12px; opacity: .85; }
        /* 顶部成功轻提示（2026-10-23）：showSuccessMessage 动态创建 #successMessageContainer，
           挂在 body 上，不依赖各模板 DOM，故模板1/2/3/4 共用这一份样式即可。
           用于「验证码已发送」「企业微信一键登录授权成功，正在登录…」等正向反馈。 */
        .login-toast-success {
            position: fixed; top: 24px; left: 50%; z-index: 10000;
            transform: translateX(-50%) translateY(-12px);
            display: flex; align-items: center; gap: 8px;
            max-width: 90vw; padding: 10px 18px; border-radius: 8px;
            background: #f0f9eb; border: 1px solid #e1f3d8; color: #529b2e;
            font-size: 14px; line-height: 1.5; box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
            opacity: 0; visibility: hidden; pointer-events: none;
            transition: opacity .2s ease, transform .2s ease, visibility .2s;
        }
        .login-toast-success.show {
            opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
        }
