/* ============================================================
   统一登录平台 - 登录页专属样式（科技风格）
   <p>
   仅供 index.html 使用，与管理后台样式(admin.css)完全解耦。
   设计要点：深空蓝背景 + 青/紫光晕 + 科技网格 + 毛玻璃卡片。
   ============================================================ */

/* ---------- 设计变量 ---------- */
:root {
    /* 主色调（科技青蓝） */
    --lp-primary: #00d4ff;
    --lp-primary-deep: #0866d9;
    --lp-accent: #7c5cff;              /* 辅助紫，用于渐变与光晕 */
    /* 背景色系（深空蓝，由深到浅） */
    --lp-bg-deepest: #04071a;
    --lp-bg-deep: #070d26;
    --lp-bg-mid: #0b1435;
    /* 文本色系 */
    --lp-text: #eaf2ff;                /* 主文本：高亮度白蓝 */
    --lp-text-secondary: #9db4d9;      /* 次要文本：雾蓝 */
    --lp-text-dim: #5f7799;            /* 弱化文本 */
    /* 功能色 */
    --lp-danger: #ff5d6e;
    --lp-success: #35e0a1;
    /* 线框与玻璃 */
    --lp-border: rgba(120, 170, 255, 0.22);
    --lp-border-strong: rgba(0, 212, 255, 0.55);
    --lp-glass: rgba(13, 22, 48, 0.62);
    /* 阴影与辉光 */
    --lp-glow-primary: 0 0 22px rgba(0, 212, 255, 0.35);
    --lp-shadow-card: 0 24px 70px rgba(0, 0, 0, 0.55);
    /* 圆角 */
    --lp-radius: 14px;
    /* 过渡 */
    --lp-transition: all 0.28s ease;
}

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

html,
body {
    height: 100%;
}

body.login-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
        'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--lp-text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow: hidden;
    position: relative;
    /* 深空底色：多层线性渐变营造纵深感 */
    background:
        linear-gradient(180deg, var(--lp-bg-deepest) 0%, var(--lp-bg-deep) 45%, var(--lp-bg-mid) 100%);
}

/* ============================================================
   背景装饰层（纯 CSS 实现，置于卡片之下）
   ============================================================ */

/* 科技网格：40px 网格线，底部渐隐 */
.login-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(80, 140, 255, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(80, 140, 255, 0.07) 1px, transparent 1px);
    background-size: 40px 40px;
    /* 网格整体向下渐隐，形成地平线效果 */
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 35%, #000 78%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0%, #000 35%, #000 78%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

/* 顶角扫描线：极细的高亮装饰线 */
.login-page::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%, var(--lp-primary) 30%,
        var(--lp-accent) 55%, transparent 85%);
    opacity: 0.6;
    z-index: 0;
    pointer-events: none;
}

/* 漂浮光晕：两个彩色能量场，缓慢呼吸 */
.lp-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
}

/* 左上青色光晕 */
.lp-glow--cyan {
    width: 520px;
    height: 520px;
    top: -180px;
    left: -140px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.28) 0%, transparent 70%);
    animation: lp-breathe 9s ease-in-out infinite;
}

/* 右下紫色光晕 */
.lp-glow--violet {
    width: 620px;
    height: 620px;
    bottom: -240px;
    right: -180px;
    background: radial-gradient(circle, rgba(124, 92, 255, 0.26) 0%, transparent 70%);
    animation: lp-breathe 11s ease-in-out infinite 2.5s;
}

/* 漂浮粒子：3 个高亮小光点，错峰上浮 */
.lp-particle {
    position: fixed;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--lp-primary);
    box-shadow: 0 0 12px 2px rgba(0, 212, 255, 0.75);
    opacity: 0.55;
    pointer-events: none;
    z-index: 0;
    animation: lp-float 14s linear infinite;
}

.lp-particle--p1 {
    left: 16%;
    top: 82%;
    animation-delay: 0s;
}

.lp-particle--p2 {
    left: 78%;
    top: 88%;
    width: 4px;
    height: 4px;
    background: var(--lp-accent);
    box-shadow: 0 0 10px 2px rgba(124, 92, 255, 0.7);
    animation-delay: 4.5s;
}

.lp-particle--p3 {
    left: 63%;
    top: 76%;
    width: 5px;
    height: 5px;
    opacity: 0.4;
    animation-delay: 9s;
}

/* ============================================================
   登录卡片（毛玻璃主体）
   ============================================================ */
.login-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    /* 卡片入场：轻微上浮淡入 */
    animation: lp-rise-in 0.7s cubic-bezier(0.22, 0.85, 0.32, 1.05) both;
}

.login-box {
    position: relative;
    background: var(--lp-glass);
    /* 毛玻璃效果（不支持时自动退化为半透明底色） */
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    backdrop-filter: blur(22px) saturate(150%);
    border: 1px solid var(--lp-border);
    border-radius: var(--lp-radius);
    box-shadow: var(--lp-shadow-card);
    padding: 44px 40px 38px;
    overflow: hidden;
}

/* 卡片顶部高亮描边：与页面顶角扫描线呼应 */
.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 24px;
    right: 24px;
    height: 1px;
    background: linear-gradient(90deg,
        transparent, var(--lp-border-strong), transparent);
}

/* 卡片右下角坐标装饰（角标括线） */
.login-box::after {
    content: '';
    position: absolute;
    right: 14px;
    bottom: 14px;
    width: 34px;
    height: 34px;
    border-right: 1px solid rgba(0, 212, 255, 0.35);
    border-bottom: 1px solid rgba(0, 212, 255, 0.35);
    border-bottom-right-radius: 6px;
    pointer-events: none;
}

/* ============================================================
   卡片头部：徽标 + 标题
   ============================================================ */
.login-header {
    text-align: center;
    margin-bottom: 34px;
}

/* 徽标容器：带辉光的六边形盾牌 */
.login-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.16) 0%, rgba(124, 92, 255, 0.16) 100%);
    border: 1px solid rgba(0, 212, 255, 0.35);
    box-shadow: var(--lp-glow-primary), inset 0 0 14px rgba(0, 212, 255, 0.14);
    animation: lp-logo-pulse 3.6s ease-in-out infinite;
}

.login-logo svg {
    display: block;
    width: 34px;
    height: 34px;
}

/* 主标题：统一登录平台 */
.login-header h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 6px;                /* 加大字距提升科技感 */
    text-indent: 6px;                   /* 抵消最后一字字距，保持视觉居中 */
    margin-bottom: 10px;
    /* 青蓝渐变文字 */
    background: linear-gradient(100deg, #ffffff 8%, var(--lp-primary) 55%, #8ea9ff 96%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 副标题：英文小字 + 两侧装饰短线 */
.login-header p {
    font-size: 11px;
    color: var(--lp-text-secondary);
    letter-spacing: 3.5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-header p::before,
.login-header p::after {
    content: '';
    width: 26px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--lp-border-strong));
}

.login-header p::after {
    background: linear-gradient(90deg, var(--lp-border-strong), transparent);
}

/* ============================================================
   登录表单
   ============================================================ */
.login-form .form-group {
    margin-bottom: 22px;
}

.login-form label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--lp-text-secondary);
    letter-spacing: 1px;
}

/* 登录按钮（渐变 + 辉光） */
.login-btn {
    width: 100%;
    height: 46px;
    margin-top: 4px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 8px;
    text-indent: 8px;
    color: #f2fbff;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: linear-gradient(100deg, var(--lp-primary-deep) 0%, #0aa2e8 48%, var(--lp-primary) 100%);
    box-shadow: 0 10px 28px rgba(8, 102, 217, 0.38);
    transition: var(--lp-transition);
}

.login-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 34px rgba(0, 190, 255, 0.5), var(--lp-glow-primary);
}

.login-btn:active:not(:disabled) {
    transform: translateY(0);
}

/* 按钮流光扫过效果 */
.login-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -80%;
    width: 45%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: skewX(-22deg);
    animation: lp-shine 3.2s ease-in-out infinite;
}

/* 输入框容器：内嵌图标 */
.input-wrap {
    position: relative;
}

.input-wrap .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 17px;
    height: 17px;
    color: var(--lp-text-dim);
    transition: var(--lp-transition);
    pointer-events: none;
}

/* 输入框：深色半透明 + 聚焦发光 */
.input-wrap input {
    width: 100%;
    height: 46px;
    padding: 0 14px 0 42px;
    font-size: 14px;
    color: var(--lp-text);
    background: rgba(6, 12, 32, 0.65);
    border: 1px solid var(--lp-border);
    border-radius: 10px;
    outline: none;
    caret-color: var(--lp-primary);
    transition: var(--lp-transition);
}

.input-wrap input::placeholder {
    color: var(--lp-text-dim);
}

.input-wrap input:hover {
    border-color: rgba(120, 170, 255, 0.4);
}

.input-wrap input:focus {
    border-color: var(--lp-primary);
    background: rgba(8, 16, 40, 0.85);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.16), 0 0 18px rgba(0, 212, 255, 0.14);
}

/* 聚焦时图标点亮 */
.input-wrap input:focus + .input-icon,
.input-wrap:focus-within .input-icon {
    color: var(--lp-primary);
    filter: drop-shadow(0 0 6px rgba(0, 212, 255, 0.6));
}

/* 错误提示：功能与原版一致（#errorMsg），视觉增强 */
.error-msg {
    margin-top: 14px;
    min-height: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--lp-danger);
    letter-spacing: 0.5px;
    text-shadow: 0 0 12px rgba(255, 93, 110, 0.35);
}

/* ============================================================
   卡片底部信息
   ============================================================ */
.login-footer {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid rgba(120, 170, 255, 0.14);
    text-align: center;
    font-size: 11px;
    color: var(--lp-text-dim);
    letter-spacing: 1.5px;
}

.login-footer .lp-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--lp-success);
    box-shadow: 0 0 8px rgba(53, 224, 161, 0.8);
    /* 状态灯闪烁 */
    animation: lp-blink 2.4s ease-in-out infinite;
}

/* ============================================================
   动画定义
   ============================================================ */

/* 光晕呼吸 */
@keyframes lp-breathe {
    0%, 100% { opacity: 0.65; transform: scale(1); }
    50%      { opacity: 1;    transform: scale(1.08); }
}

/* 粒子上浮 */
@keyframes lp-float {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    12% {
        opacity: 0.55;
    }
    88% {
        opacity: 0.2;
    }
    100% {
        transform: translateY(-78vh) translateX(26px);
        opacity: 0;
    }
}

/* 卡片入场 */
@keyframes lp-rise-in {
    from {
        opacity: 0;
        transform: translateY(26px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 徽标辉光脉动 */
@keyframes lp-logo-pulse {
    0%, 100% { box-shadow: 0 0 22px rgba(0, 212, 255, 0.3), inset 0 0 14px rgba(0, 212, 255, 0.12); }
    50%      { box-shadow: 0 0 34px rgba(0, 212, 255, 0.5), inset 0 0 18px rgba(0, 212, 255, 0.22); }
}

/* 按钮流光 */
@keyframes lp-shine {
    0%       { left: -80%; }
    55%, 100% { left: 130%; }
}

/* 状态灯闪烁 */
@keyframes lp-blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; }
}

/* ============================================================
   响应式适配
   ============================================================ */
@media (max-width: 480px) {
    body.login-page {
        padding: 16px;
    }

    .login-box {
        padding: 34px 24px 28px;
    }

    .login-header h1 {
        font-size: 22px;
        letter-spacing: 4px;
        text-indent: 4px;
    }
}

/* 弱动画偏好：尊重系统设置，关闭装饰性动画 */
@media (prefers-reduced-motion: reduce) {
    .lp-glow,
    .lp-particle,
    .login-logo,
    .login-btn::after,
    .login-footer .lp-dot,
    .login-container {
        animation: none;
    }
}
