/* 登录页（login.php）的样式：2026-10-23 从页面内联搬出（原来两段：页面样式 + 提示框样式），内容未改 */

/* 2026-10-23 改版：只留登录卡片、在屏幕正中（试过左边放公司名的左右分栏，用户觉得丑，去掉了）；
   背景是静态的低饱和雾蓝（原来是会流动的高饱和亮蓝，用户觉得刺眼），去掉漂浮气泡、流星、鼠标光晕、输入粒子、波浪；
   字体中文优先用系统字体（Windows 微软雅黑、Mac 苹方），原来排第一的 Inter 从没加载成功过 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    background: #4c6a91;
    min-height: 100vh;
    padding: 0;
    position: relative;
    overflow-x: hidden;   /* 屏幕矮时可以上下滚动（原来 overflow: hidden，卡片超出屏幕也滚不到） */
}

/* 背景：雾蓝渐变 + 缓慢流动的光斑 + 细网格 */
.animated-background {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #3d5a80 0%, #4c6a91 50%, #5b79a0 100%);
}

/* 光斑（2026-10-23 用户觉得页面太静态）：三团很淡的光（浅蓝、标志里的青绿、淡紫）慢慢漂移，一个来回 1.5–2 分钟，几乎察觉不到在动。
   只动 transform（显卡合成，不重新绘制、不占 CPU）；只在背景层，卡片不动；系统设了「减少动态效果」时不动（见文件末尾） */
.bg-glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    will-change: transform;
    animation: glowDrift1 46s ease-in-out infinite alternate;
}

.bg-glow-1 {
    width: 70vmax;
    height: 70vmax;
    left: -25vmax;
    top: -35vmax;
    background: radial-gradient(circle closest-side, rgba(147, 197, 253, 0.32), rgba(147, 197, 253, 0));
}

.bg-glow-2 {
    width: 64vmax;
    height: 64vmax;
    right: -24vmax;
    bottom: -34vmax;
    background: radial-gradient(circle closest-side, rgba(94, 234, 212, 0.2), rgba(94, 234, 212, 0));
    animation-name: glowDrift2;
    animation-duration: 54s;
}

.bg-glow-3 {
    width: 48vmax;
    height: 48vmax;
    left: 38%;
    top: 30%;
    background: radial-gradient(circle closest-side, rgba(199, 210, 254, 0.18), rgba(199, 210, 254, 0));
    animation-name: glowDrift3;
    animation-duration: 60s;
}

@keyframes glowDrift1 { to { transform: translate(22vw, 16vh); } }
@keyframes glowDrift2 { to { transform: translate(-24vw, -14vh); } }
@keyframes glowDrift3 { to { transform: translate(-30vw, -12vh); } }

.grid-layer {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* 卡片 440 宽，在屏幕正中 */
.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 440px);
    justify-content: center;
    align-content: center;
    padding: 40px 24px 96px;   /* 下面留出页脚的位置 */
}

/* 打开时淡入（不位移、不延迟） */
@keyframes loginFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 登录卡片 */
.login-right {
    display: flex;
    justify-content: center;
    animation: loginFadeIn 0.3s ease both;
}

/* 纯白不透明（原来半透明加毛玻璃，叠在蓝底上发灰，里面的白色扫码区就像套了一层盒子；纯色背景也没有东西可模糊） */
.login-card {
    width: 440px;
    max-width: 100%;
    background: #ffffff;
    border-radius: 24px;
    padding: 32px 40px;
    box-shadow:
        0 24px 56px rgba(15, 23, 42, 0.2),
        0 2px 6px rgba(15, 23, 42, 0.06);
    transition: box-shadow 0.3s ease;
}

/* 卡片不漂浮、悬停不上抬（2026-10-23 用户：鼠标移上去点击时整个卡片轻微位移，可能点错位置）；悬停只加深阴影 */
.login-card:hover {
    box-shadow:
        0 28px 64px rgba(15, 23, 42, 0.26),
        0 2px 6px rgba(15, 23, 42, 0.06);
}

/* 卡片头部：标志 + 系统名 + 公司名 */
.logo-section {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.logo-section img {
    width: 44px;
    height: 44px;
    flex: none;
    object-fit: contain;
}

.logo-section h2 {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    color: #0f172a;
}

.logo-section p {
    font-size: 13px;
    margin-top: 4px;
    color: #64748b;
}

.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
    letter-spacing: 0.2px;
}

.input-wrapper {
    position: relative;
}

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

input[type="text"],
input[type="password"] {
    width: 100%;
    height: 54px;
    padding: 0 16px 0 50px;
    font-size: 15px;
    color: #1e293b;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

/* ---------- 验证码（includes/login-captcha.php）：输入框 + 右边的图片，图片和输入框一样高（下面几条按屏幕调高度的规则也带上它） ---------- */
.captcha-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.captcha-row .input-wrapper {
    flex: 1;
    min-width: 0;
}

.captcha-img {
    display: block;
    flex-shrink: 0;
    width: auto;
    height: 54px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    cursor: pointer;
}

#captcha {
    text-transform: uppercase;
    letter-spacing: 4px;
}

#captcha::placeholder {
    text-transform: none;
    letter-spacing: normal;
}

input[type="text"]:focus ~ .input-icon,
input[type="password"]:focus ~ .input-icon {
    color: #0078d4;
}

input::placeholder {
    color: #cbd5e1;
    font-weight: 400;
}

/* 纯色、轻阴影（原来渐变加一大圈蓝色发光）；悬停、按下只变深，不上浮（按钮不能位移） */
.login-button {
    width: 100%;
    height: 54px;
    background: #0078d4;
    color: white;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 120, 212, 0.25);
    margin-top: 8px;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.login-button:hover {
    background: #006cbe;
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.3);
}

.login-button:active {
    background: #005fa8;
}

/* 涟漪效果 */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: rippleEffect 0.8s ease-out;
    pointer-events: none;
}

@keyframes rippleEffect {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.login-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.page-footer {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    padding: 0 24px;
    text-align: center;
    z-index: 2;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
}

/* 页脚只有文字（原来公司名前有个 16 像素的小标志，糊成一团） */
.footer-company {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.footer-divider {
    color: rgba(255, 255, 255, 0.5);
}

.footer-icp {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-icp:hover {
    color: #ffffff;
}

/* 输入框呼吸光晕 */
input[type="text"]:focus,
input[type="password"]:focus {
    background: #ffffff;
    border-color: #0078d4;
    box-shadow:
        0 0 0 4px rgba(0, 120, 212, 0.1),
        0 0 20px rgba(0, 120, 212, 0.2);
    animation: inputGlow 2s ease-in-out infinite;
}

@keyframes inputGlow {
    0%, 100% {
        box-shadow:
            0 0 0 4px rgba(0, 120, 212, 0.1),
            0 0 20px rgba(0, 120, 212, 0.2);
    }
    50% {
        box-shadow:
            0 0 0 6px rgba(0, 120, 212, 0.15),
            0 0 30px rgba(0, 120, 212, 0.3);
    }
}

/* 输入错误红光效果 */
.input-error {
    border-color: #ef4444 !important;
    animation: errorGlow 0.5s ease-in-out 2;
}

@keyframes errorGlow {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
    }
    50% {
        box-shadow:
            0 0 0 6px rgba(239, 68, 68, 0.2),
            0 0 20px rgba(239, 68, 68, 0.4);
    }
}

/* 响应式设计 */
/* 针对小高度屏幕优化 - 自适应浏览器高度 */
/* 加载状态 */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.login-button.is-loading {
    color: transparent;
    pointer-events: none;
}

.login-button.is-loading::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    width: 20px;
    height: 20px;
    margin: auto;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* 错误抖动动画 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
    20%, 40%, 60%, 80% { transform: translateX(8px); }
}

.shake {
    animation: shake 0.5s;
}

/* 登录选项卡：浅灰底槽 + 当前项白块蓝字（原来白块下面还有一条蓝色下划线，「当前」标了两遍，去掉了） */
/* 窄边距（2026-10-23 用户：原来底槽内边距 6、按钮间隔 8，边距太大）：内边距 3、按钮之间不留空，白块紧贴底槽；
   圆角 = 底槽 10 − 内边距 3 = 7，内外圆角同心 */
.login-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 10px;
    position: relative;
}

/* 当前项的白块：切换时滑过去（原来瞬间跳过去）。和一个按钮一样大，切到账号密码时右移一个按钮宽；
   login.js 切换时给 .login-tabs 加 / 去 is-password。只动 transform，按钮和卡片都不动 */
.tab-slider {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 3px;
    width: calc((100% - 6px) / 2);   /* 左右内边距 3 + 3，按钮之间没有间距 */
    background: #ffffff;
    border-radius: 7px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1), 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.login-tabs.is-password .tab-slider {
    transform: translateX(100%);
}

.tab-button {
    position: relative;   /* 在白块上面 */
    z-index: 1;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: 7px;
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.tab-button svg {
    transition: transform 0.3s ease;
}

/* 悬停只把字加深（按钮之间没有空隙，再加一块浅蓝底会贴着白块，像两个块） */
.tab-button:hover {
    color: #334155;
}

.tab-button.active {
    background: transparent;   /* 白底由下面滑动的 .tab-slider 画 */
    color: #0078d4;
}

.tab-button.active svg {
    transform: scale(1.05);
}

/* 选项卡内容 */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
    min-height: 400px; /* 两个选项卡一样高：扫码区 400（快速登录面板要 376），账号密码表单也是 400 */
}

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

/* 密码登录表单容器 - 与二维码容器高度一致 */
#password-tab form {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@keyframes fadeIn {   /* 切换选项卡：只淡入，不上下位移 */
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 入场：卡片淡入的同时，里面的标题、选项卡、内容依次淡入，0.6 秒内播完，只在打开页面时一次，只变透明度不移动。
   login.php 给卡片写了 is-entering，login.js 0.8 秒后去掉；内容区沿用切换选项卡的 fadeIn，只加延迟，
   去掉 is-entering 时动画名不变，不会重播（之后切换选项卡也不再延迟） */
.login-card.is-entering > .logo-section {
    animation: fadeIn 0.3s ease 0.1s both;
}

.login-card.is-entering > .login-tabs {
    animation: fadeIn 0.3s ease 0.18s both;
}

.login-card.is-entering > .tab-content {
    animation-delay: 0.26s;
    animation-fill-mode: both;
}

/* 企业微信扫码登录区域：不画框（2026-10-23 用户：原来灰底框里再套白框不协调，后来剩的一层灰边框在白卡片上也像套盒子）。
   白底，和卡片、企业微信登录页（iframe）的底色一样，看起来直接放在卡片上；宽度占满，和上面的选项卡对齐 */
.wework-qrcode-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: #ffffff;
    border-radius: 12px;
    min-height: 400px;
    overflow: hidden;
}

/* 放企业微信登录页的位置，本身不画框。高 376：企业微信切到「快速登录」时面板至少 376 高，
   矮了最下面的「继续在浏览器中登录访问」会被裁掉，只剩「在企业微信桌面端打开」（那个是在企业微信内置浏览器里打开网站） */
.qrcode-box {
    width: 100%;
    height: 376px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.qrcode-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #94a3b8;
}

.qrcode-loading p {
    font-size: 14px;
    margin: 0;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e2e8f0;
    border-top-color: #0078d4;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.qrcode-tip {
    font-size: 13px;
    color: #64748b;
    text-align: center;
    margin: 0;
    line-height: 1.5;
}

/* 二维码iframe样式（脚本里也写了宽高 100%） */
.qrcode-box iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* 响应式优化 */
@media (max-width: 480px) {
    .login-tabs {
        margin-bottom: 24px;
    }

    .tab-button {
        padding: 10px 16px;
        font-size: 14px;
        gap: 6px;
    }

    .tab-button svg {
        width: 18px;
        height: 18px;
    }

    .tab-button span {
        display: none;
    }

    .tab-content {
        min-height: 380px;
    }

    .wework-qrcode-container {
        min-height: 380px;
    }

    #password-tab form {
        min-height: 380px;
    }
}

@media (max-width: 968px) {
    .login-card {
        max-width: 100%;
    }
}

/* ---------- 提示框（原页面下方第二段 <style>） ---------- */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    min-width: 340px;
    max-width: 480px;
    padding: 18px 20px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    pointer-events: auto;
    animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;   /* 跟页面一样（原来写的 Inter 从没加载过，中文会落到浏览器默认字体） */
}

.toast.toast-hide {
    animation: toastSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateX(120%);
}

.toast-success {
    background: rgba(255, 255, 255, 0.98);
    color: #10b981;
    border: 2px solid #10b981;
}

.toast-error {
    background: rgba(255, 255, 255, 0.98);
    color: #ef4444;
    border: 2px solid #ef4444;
}

.toast-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border-radius: 50%;
}

.toast-success .toast-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.toast-error .toast-icon {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.toast-content {
    flex: 1;
    word-break: break-word;
    color: #1e293b;
    font-weight: 500;
}

.toast-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s ease;
    background: none;
    border: none;
    color: #64748b;
    font-size: 20px;
    line-height: 1;
    padding: 0;
    border-radius: 50%;
}

.toast-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(120%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(120%) scale(0.95);
    }
}

@media (max-width: 480px) {
    #toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }
}

/* ---------- 按屏幕调整（2026-10-23 改版时重写；放在最后，覆盖前面的默认值） ---------- */

/* 手机 */
@media (max-width: 480px) {
    .login-container {
        min-height: 0;   /* 页脚紧跟在卡片后面，不用先滚过一整屏 */
        align-content: start;
        padding: 16px 16px 24px;
    }

    .login-card {
        padding: 28px 20px;
        border-radius: 20px;
    }

    .logo-section h2 {
        font-size: 22px;
    }

    input[type="text"],
    input[type="password"],
    .login-button,
    .captcha-img {
        height: 50px;
    }

    .page-footer {
        position: relative;
        bottom: auto;
        padding: 0 16px 16px;
    }

    .footer-content {
        font-size: 14px;
        flex-wrap: wrap;
    }
}

/* 屏幕矮：收紧间距、藏起页脚，尽量一屏放下（扫码区不能小于 380：快速登录面板要 376）；再矮就上下滚动 */
@media (max-height: 760px) {
    .login-container {
        padding: 16px 24px;
    }

    .login-card {
        padding: 20px 32px;
    }

    .logo-section {
        margin-bottom: 14px;
    }

    .logo-section img {
        width: 36px;
        height: 36px;
    }

    .logo-section h2 {
        font-size: 20px;
    }

    .login-tabs {
        margin-bottom: 12px;
    }

    .tab-content,
    .wework-qrcode-container,
    #password-tab form {
        min-height: 380px;
    }

    .form-group {
        margin-bottom: 16px;
    }

    .page-footer {
        display: none;
    }
}

/* 更矮（如 1024×560）：上下留白再收一点 */
@media (max-height: 600px) {
    .login-container {
        padding: 8px 24px;
    }

    .login-card {
        padding: 16px 32px;
    }
}

/* 系统设了「减少动态效果」：光斑不动、白块直接到位、不播入场 */
@media (prefers-reduced-motion: reduce) {
    .bg-glow {
        animation: none;
    }

    .tab-slider {
        transition: none;
    }

    .login-right,
    .login-card.is-entering > .logo-section,
    .login-card.is-entering > .login-tabs,
    .login-card.is-entering > .tab-content {   /* 逐个写：要比上面入场规则的选择器一样具体才盖得住 */
        animation: none;
    }
}
