/**
 * Medical Theme Login Page
 * Three.js 医疗主题登录页面样式
 * @version 2.0.0
 */

/* ==================== 全局样式重置 ==================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    font-family: "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow: hidden;
    background: linear-gradient(135deg, #0A1929 0%, #1A2332 100%);
    position: relative;
}

/* ==================== 开场动画层（全屏时空隧道） ==================== */

.intro-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 9999;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 1.5s ease-out;
}

.intro-fullscreen canvas {
    position: absolute;
    width: 100% !important;
    height: 100% !important;
    top: 0;
    left: 0;
}

.intro-fullscreen .loading-text {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 18px;
    font-weight: 300;
    letter-spacing: 3px;
    opacity: 0.8;
    animation: loadingPulse 2s ease-in-out infinite;
}

.intro-fullscreen.fade-out {
    opacity: 0;
    pointer-events: none;
}

@keyframes loadingPulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* ==================== 左右分屏布局 ==================== */

.split-screen-container {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    transition: opacity 1.5s ease-out;
    /* 完整的全屏渐变背景，消除中间分隔线 */
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
}

/* 左侧3D场景区域 */
.left-panel {
    width: 50%;
    height: 100vh;
    position: relative;
    background: transparent;
}

/* 太阳系Canvas适配左侧区域 */
.left-panel #solar-canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* 右侧登录区域 */
.right-panel {
    width: 50%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    position: relative;
}

/* 粒子隧道Canvas作为背景 */
.right-panel #particle-canvas {
    position: absolute;
    width: 100% !important;
    height: 100% !important;
    top: 0;
    left: 0;
    z-index: 1;  /* 背景层 */
}

/* 移动端适配：垂直排列 */
@media (max-width: 768px) {
    .split-screen-container {
        flex-direction: column;
    }

    .left-panel {
        width: 100%;
        height: 40vh;
    }

    .right-panel {
        width: 100%;
        height: 60vh;
    }
}

/* CSS扫描线背景 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(30, 144, 255, 0.03) 2px,
        rgba(30, 144, 255, 0.03) 4px
    );
    pointer-events: none;
    z-index: 2;
    animation: scanlineMove 8s linear infinite;
}

@keyframes scanlineMove {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(4px);
    }
}

/* ==================== Three.js Canvas 背景 ==================== */

/* Canvas现在在.left-panel内部，样式已在上方定义 */
#three-canvas {
    /* 由 .left-panel #three-canvas 控制 */
}

/* ==================== 登录容器 ==================== */

.login-container {
    position: relative;
    z-index: 10;  /* 确保在粒子背景之上 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 450px;
    max-width: 90%;
    padding: 20px;
}

/* 开场动画状态 */
.login-container.intro-animation .login-header,
.login-container.intro-animation .login-main {
    opacity: 0;
    transform: scale(0.3) translateY(50px);
    animation: introZoomIn 2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.login-container.intro-animation .login-header {
    animation-delay: 1.5s;  /* 延迟到1.5秒开始（动画中段） */
}

.login-container.intro-animation .login-main {
    animation-delay: 1.8s;  /* 延迟到1.8秒开始（稍后出现） */
}

/* ==================== 登录标题区域 ==================== */

.login-header {
    text-align: center;
    color: #fff;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease-out;
}

.login-header h1 {
    font-size: 36px;
    font-weight: 300;
    margin: 0 0 10px 0;
    letter-spacing: 2px;
}

.login-header .version {
    font-size: 14px;
    opacity: 0.7;
    margin-left: 10px;
}

.login-header .subtitle {
    font-size: 14px;
    opacity: 0.8;
    margin: 0;
    letter-spacing: 1px;
}

/* ==================== 登录表单主体 ==================== */

.login-main {
    width: 420px;
    max-width: 100%;
    background: rgba(67, 73, 78, 0.35);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 40px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 60px rgba(30, 144, 255, 0.15),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.8s ease-out 0.2s both;
    position: relative;
}

/* 呼吸光效边框 */
.login-main::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg,
        rgba(30, 144, 255, 0.3),
        rgba(0, 206, 209, 0.3),
        rgba(30, 144, 255, 0.3)
    );
    border-radius: 20px;
    z-index: -1;
    filter: blur(10px);
    animation: breathingGlow 2s ease-in-out infinite;
}

/* 全息投影扫描线 */
.login-main::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 3px,
        rgba(30, 144, 255, 0.05) 3px,
        rgba(30, 144, 255, 0.05) 6px
    );
    border-radius: 20px;
    pointer-events: none;
    animation: hologramScan 3s linear infinite;
}

/* 数据流边框动画 */
.login-main .data-flow {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(30, 144, 255, 1);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(30, 144, 255, 0.8);
    z-index: 10;
}

.login-main .data-flow-1 {
    top: 0;
    left: 0;
    animation: dataFlowTop 3s linear infinite;
}

.login-main .data-flow-2 {
    top: 0;
    right: 0;
    animation: dataFlowRight 3s linear infinite 0.75s;
}

.login-main .data-flow-3 {
    bottom: 0;
    right: 0;
    animation: dataFlowBottom 3s linear infinite 1.5s;
}

.login-main .data-flow-4 {
    bottom: 0;
    left: 0;
    animation: dataFlowLeft 3s linear infinite 2.25s;
}

.login-main:hover {
    background: rgba(67, 73, 78, 0.55);
    box-shadow:
        0 12px 48px rgba(30, 144, 255, 0.3),
        0 0 80px rgba(30, 144, 255, 0.2),
        inset 0 1px 1px rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* ==================== 登录标题和切换 ==================== */

.login-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.login-title .title-text {
    font-size: 20px;
    font-weight: 400;
    color: #fff;
}

.login-title .switch-mode {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-title .switch-mode:hover {
    transform: scale(1.1);
}

.login-title .switch-mode .iconfont {
    font-size: 32px;
    color: #fff;
    position: relative;
    z-index: 2;
}

.login-title .switch-mode .switch-tips {
    position: absolute;
    top: -35px;
    right: -10px;
    background: rgba(255, 106, 0, 0.9);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.login-title .switch-mode .switch-tips::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 15px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid rgba(255, 106, 0, 0.9);
}

.login-title .switch-mode:hover .switch-tips {
    opacity: 1;
    transform: translateY(0);
}

/* ==================== 表单样式 ==================== */

.password-form,
.qrcode-form {
    width: 100%;
}

.layui-form-item {
    margin-bottom: 20px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper .layui-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: rgba(255, 255, 255, 0.5);
    z-index: 2;
}

.input-wrapper .layui-input {
    width: 100%;
    height: 48px;
    padding: 0 15px 0 45px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    transition: all 0.3s ease;
}

.input-wrapper .layui-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.input-wrapper .layui-input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: #1E90FF;
    box-shadow: 0 0 0 3px rgba(30, 144, 255, 0.1);
    outline: none;
}

/* ==================== 隐私协议 ==================== */

.privacy-item {
    margin-bottom: 25px !important;
}

.privacy-item label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}

.privacy-item .privacy-link {
    color: #1E90FF;
    text-decoration: none;
    transition: color 0.3s ease;
}

.privacy-item .privacy-link:hover {
    color: #00CED1;
    text-decoration: underline;
}

.layui-form-checkbox[lay-skin=primary] span {
    color: rgba(255, 255, 255, 0.8);
}

/* ==================== 登录按钮 ==================== */

.login-btn {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, #1E90FF 0%, #00CED1 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 4px 15px rgba(30, 144, 255, 0.3),
        0 0 30px rgba(30, 144, 255, 0.2);
    position: relative;
    overflow: hidden;
}

/* 按钮发光动画 */
.login-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transform: rotate(45deg);
    animation: buttonShine 3s ease-in-out infinite;
}

.login-btn:hover:not(.layui-btn-disabled) {
    transform: translateY(-2px);
    box-shadow:
        0 6px 25px rgba(30, 144, 255, 0.5),
        0 0 50px rgba(30, 144, 255, 0.3),
        0 0 80px rgba(0, 206, 209, 0.2);
    filter: brightness(1.15);
}

.login-btn:active:not(.layui-btn-disabled) {
    transform: translateY(0);
}

.login-btn.layui-btn-disabled {
    background: rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}

/* ==================== 微信扫码登录 ==================== */

.qrcode-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}

.qrcode-content {
    text-align: center;
}

.qrcode-img {
    width: 200px;
    height: 200px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    background: #fff;
    padding: 10px;
    margin-bottom: 20px;
}

.qrcode-status {
    color: #fff;
}

.qrcode-status .js_status {
    padding: 10px 0;
}

.qrcode-status .layui-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.qrcode-status .layui-icon-ok-circle {
    color: #00FF00;
}

.qrcode-status .layui-icon-close {
    color: #FF6A00;
}

.qrcode-status h4 {
    font-size: 16px;
    font-weight: 400;
    margin: 10px 0 5px 0;
}

.qrcode-status p {
    font-size: 13px;
    opacity: 0.8;
    margin: 5px 0;
}

.qrcode-status .app-name {
    font-weight: 500;
    opacity: 1;
}

/* ==================== 底部信息 ==================== */

.login-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    z-index: 10;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.3) 0%, transparent 100%);
    opacity: 0;                      /* 初始隐藏 */
    transform: translateY(20px);     /* 初始下移 */
    transition: opacity 1.5s ease-out, transform 1.5s ease-out;
}

.login-footer.show {
    opacity: 1;                      /* 淡入 */
    transform: translateY(0);        /* 上移归位 */
}

.login-footer .copyright,
.login-footer .contact,
.login-footer .icp {
    margin: 5px 0;
}

.login-footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

.login-footer a:hover {
    color: #1E90FF;
}

.login-footer .contact {
    color: rgba(255, 255, 255, 0.5);
}

/* ==================== 动画效果 ==================== */

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 开场缩放动画 */
@keyframes introZoomIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(50px);
    }
    60% {
        opacity: 0.8;
        transform: scale(1.05) translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 辉光脉冲动画 */
@keyframes glowPulse {
    0%, 100% {
        opacity: 0.3;
        filter: blur(10px);
    }
    50% {
        opacity: 0.6;
        filter: blur(15px);
    }
}

/* 按钮光泽扫过动画 */
@keyframes buttonShine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* 呼吸光效动画 */
@keyframes breathingGlow {
    0%, 100% {
        opacity: 0.3;
        filter: blur(10px);
        box-shadow: 0 0 20px rgba(30, 144, 255, 0.3);
    }
    50% {
        opacity: 0.8;
        filter: blur(15px);
        box-shadow: 0 0 40px rgba(30, 144, 255, 0.6);
    }
}

/* 全息扫描动画 */
@keyframes hologramScan {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* 数据流动画 - 顶部 */
@keyframes dataFlowTop {
    0% {
        left: 0;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        left: 100%;
        opacity: 0;
    }
}

/* 数据流动画 - 右侧 */
@keyframes dataFlowRight {
    0% {
        top: 0;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        top: 100%;
        opacity: 0;
    }
}

/* 数据流动画 - 底部 */
@keyframes dataFlowBottom {
    0% {
        right: 0;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        right: 100%;
        opacity: 0;
    }
}

/* 数据流动画 - 左侧 */
@keyframes dataFlowLeft {
    0% {
        bottom: 0;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        bottom: 100%;
        opacity: 0;
    }
}

/* 脉冲动画（用于按钮） */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(30, 144, 255, 0.3);
    }
    50% {
        box-shadow: 0 6px 25px rgba(30, 144, 255, 0.5);
    }
}

/* ==================== 响应式设计 ==================== */

@media screen and (max-width: 768px) {
    .login-header h1 {
        font-size: 28px;
    }

    .login-header .subtitle {
        font-size: 12px;
    }

    .login-main {
        width: 90%;
        padding: 30px 20px;
    }

    .login-title .title-text {
        font-size: 18px;
    }

    .input-wrapper .layui-input {
        height: 44px;
        font-size: 13px;
    }

    .login-btn {
        height: 44px;
        font-size: 15px;
    }

    .qrcode-img {
        width: 180px;
        height: 180px;
    }

    .login-footer {
        font-size: 11px;
        padding: 15px 10px;
    }
}

@media screen and (max-width: 480px) {
    .login-header {
        margin-bottom: 30px;
    }

    .login-header h1 {
        font-size: 24px;
    }

    .login-main {
        padding: 25px 15px;
    }

    .qrcode-img {
        width: 150px;
        height: 150px;
    }
}

/* ==================== 浏览器兼容性 ==================== */

/* IE 降级处理 */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
    .login-main {
        background: rgba(67, 73, 78, 0.9);
    }
}

/* 去除 IE 输入框的清除按钮 */
input::-ms-clear,
input::-ms-reveal {
    display: none;
}

/* 去除 Chrome 输入框的黄色背景 */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.08) inset !important;
    -webkit-text-fill-color: #fff !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* ==================== 打印样式 ==================== */

@media print {
    #three-canvas,
    .login-footer {
        display: none;
    }

    .login-main {
        box-shadow: none;
    }
}
