/* 全局样式重置与基础配置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Inter", "思源黑体", "Microsoft YaHei", sans-serif;
}

/* 核心：body强制占满单屏幕，禁止滚动 */
body {
    background-color: #f0f4f8;
    /* 强制占满视口高度/宽度 */
    width: 100vw;
    height: 100vh;
    /* 禁止页面滚动 */
    overflow: hidden;
    color: #333;
    position: relative;
    /* 移除多余padding，避免占比超100% */
    padding: 0;
}

/* 粒子背景容器 - 强制占满body */
#particles-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background-color: #f0f4f8;
}

/* 左侧图片容器 - 适配单屏幕 */
.left-image-container {
    position: absolute;
    left: 10vw;
    /* 改用vw单位，适配所有屏幕 */
    top: 50%;
    transform: translateY(-50%);
    width: 40vw;
    /* 相对视口宽度，不超屏 */
    height: 80vh;
    /* 相对视口高度，留边距 */
    z-index: 0;
    overflow: hidden;
    position: relative;
    border-radius: 12px;
}

.left-image-container .particle-flow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    /* 层级介于图片(z5)和视频(z10)之间，不遮挡内容 */
    pointer-events: none;
    /* 不影响视频/图片交互 */
}

.stacked-image {
    position: absolute;
    width: 80%;
    /* 每张图比容器小，避免完全重叠 */
    height: 80%;
    object-fit: cover;
    opacity: 1;
    /* 半透明，叠加后更柔和 */
    filter: saturate(0.7) brightness(1.1);
    /* 统一色调，适配界面 */
    border-radius: 8px;
    /* 加圆角，更柔和 */
    animation: float 10s ease-in-out infinite;
}

.left-image-container video {
    opacity: 0.7;
}

.stacked-image:first-child {
    /* 第一张是图片，强制居中 */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* 绝对居中 */
    width: 70%;
    /* 图片尺寸稍大，作为核心 */
    height: 70%;
    z-index: 5;
    /* 层级最高，确保在视频上层 */
    animation-delay: 0s;
}

/* 2. 单独设置「三个视频」：更小尺寸+围绕图片排列（核心修改） */
.stacked-image:nth-child(2) {
    /* 第一个视频：图片左上方 */
    top: 0%;
    left: 0%;
    width: 20%;
    /* 视频尺寸缩小（原80%→40%） */
    height: 30%;
    z-index: 10;
    /* 层级低于图片 */
    animation-delay: 2s;
}

.stacked-image:nth-child(3) {
    /* 第二个视频：图片右上方 */
    top: 10%;
    left: 70%;
    /* 改left为right，围绕图片 */
    width: 30%;
    height: 30%;
    z-index: 10;
    animation-delay: 4s;
}

.stacked-image:nth-child(4) {
    /* 第三个视频：图片下方 */
    bottom: 0%;
    /* 改top为bottom，围绕图片 */
    left: 70%;
    transform: translateX(-50%);
    /* 水平居中 */
    width: 20%;
    height: 20%;
    z-index: 10;
    animation-delay: 6s;
}

/* 浮动动画（原有样式不变，适配新定位） */
@keyframes float {
    0% {
        transform: translate(0, 0) rotate(0deg);
        /* 兼容图片的居中transform，不影响动画 */
    }

    50% {
        transform: translate(5px, 5px) rotate(1deg);
    }

    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

/* 修复图片居中动画的兼容（新增） */
.stacked-image:first-child {
    animation: centerFloat 10s ease-in-out infinite;
}

/* 图片专属动画：保留居中的同时轻微浮动 */
@keyframes centerFloat {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    50% {
        transform: translate(-48%, -48%) rotate(1deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
}

/* 图片边缘虚化遮罩 */
.left-image-container::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to right,
            transparent 0%,
            rgba(240, 244, 248, 0) 20px,
            rgba(240, 244, 248, 0) calc(100% - 20px),
            transparent 100%),
        linear-gradient(to bottom,
            transparent 0%,
            rgba(240, 244, 248, 0) 20px,
            rgba(240, 244, 248, 0) calc(100% - 20px),
            transparent 100%);
    z-index: 1;
}

/* 登录卡片 - 单屏幕精准定位 */
.login-card {
    /* 固定基础尺寸，适配所有屏幕 */
    width: 400px;
    max-width: 90vw;
    /* 小屏不超视口 */
    min-height: 550px;
    max-height: 90vh;
    /* 不超视口高度 */
    padding: 30px 40px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    /* 单屏幕定位：右侧+垂直居中 */
    position: absolute;
    top: 50%;
    right: 10vw;
    transform: translateY(-50%);
    z-index: 10;
    /* 内容溢出时内部滚动，不超屏幕 */
    overflow-y: auto;
    /* 隐藏滚动条（可选） */
    scrollbar-width: none;
}

/* 隐藏登录卡片滚动条（webkit内核） */
.login-card::-webkit-scrollbar {
    display: none;
}

/* 登录标题 */
.login-title {
    font-size: 24px;
    font-weight: 600;
    color: #343a40;
    margin-bottom: 8px;
    text-align: center;
}

.login-subtitle {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 30px;
    text-align: center;
}

/* 登录方式切换标签 */
.login-method-tabs {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 1px solid #e9ecef;
    height: 50px;
}

.tab-item {
    flex: 1;
    padding: 12px 0;
    font-size: 16px;
    font-weight: 500;
    color: #6c757d;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.tab-item:hover {
    color: #4A6FA5;
}

.tab-item.active {
    color: #4A6FA5;
}

.tab-item.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #4A6FA5;
    border-radius: 3px 3px 0 0;
}

/* 表单容器 */
.form-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 350px;
}

/* 登录表单 */
.login-form {
    display: none !important;
    width: 100%;
    min-height: 350px;
    flex-direction: column;
    justify-content: flex-start;
    gap: 16px;
}

.login-form.active {
    display: flex !important;
}

/* 表单样式 */
.form-group {
    margin-bottom: 0;
    position: relative;
    width: 100%;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #343a40;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    font-size: 15px;
    color: #343a40;
    transition: all 0.3s ease;
    background-color: #f8fafc;
}

.form-input:focus {
    outline: none;
    border-color: #4A6FA5;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.1);
}

/* 密码显示/隐藏图标 */
.password-toggle {
    position: absolute;
    right: 16px;
    bottom: 16px;
    color: #6c757d;
    cursor: pointer;
    font-size: 16px;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: #4A6FA5;
}

/* 验证码输入组 */
.sms-code-group {
    margin-bottom: 0;
    width: 100%;
}

.code-input-wrap {
    display: flex;
    gap: 12px;
    width: 100%;
}

.sms-code-input {
    flex: 1;
    width: calc(100% - 132px);
}

.btn-send-code {
    flex-shrink: 0;
    width: 120px;
    height: 48px;
    background-color: #f0f4f8;
    border: 1px solid #d1d9e6;
    border-radius: 6px;
    color: #4A6FA5;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-send-code:hover {
    background-color: #e8f0f8;
    border-color: #4A6FA5;
}

.btn-send-code:disabled {
    background-color: #f5f5f5;
    color: #aaa;
    cursor: not-allowed;
    border-color: #eee;
}

/* 辅助链接 */
.helper-links {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0;
    font-size: 14px;
    min-height: 20px;
    width: 100%;
}

.helper-links.placeholder {
    visibility: hidden;
    min-height: 20px;
}

.link {
    color: #4A6FA5;
    text-decoration: none;
    transition: color 0.3s ease;
}

.link:hover {
    color: #38588a;
    text-decoration: underline;
}

/* 按钮样式 */
.btn {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    margin-top: 8px;
}

.btn-primary {
    background-color: #4A6FA5;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #38588a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 111, 165, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* 表单底部 */
.form-footer {
    padding-top: 16px;
    margin-top: auto;
    width: 100%;
}

.register-link {
    font-size: 14px;
    color: #6c757d;
    text-align: center;
    margin-bottom: 10px;
}

.agreement {
    font-size: 13px;
    color: #6c757d;
    text-align: center;
    line-height: 1.5;
    margin-bottom: 10px;
}

/* 响应式适配 - 全尺寸单屏幕 */
@media (max-width: 767px) {

    /* 小屏隐藏左侧图片 */
    .left-image-container {
        display: none;
    }

    /* 小屏表单卡片居中 */
    .login-card {
        right: 50%;
        transform: translate(50%, -50%);
        padding: 30px 25px;
        max-width: 90vw;
        max-height: 90vh;
    }

    /* 验证码输入框小屏自适应 */
    .code-input-wrap {
        flex-direction: column;
    }

    .sms-code-input {
        width: 100%;
    }

    .btn-send-code {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 25px 20px;
        max-width: 90vw;
        max-height: 90vh;
    }

    .tab-item {
        font-size: 15px;
        padding: 10px 0;
    }

    .login-title {
        font-size: 22px;
    }

    .login-subtitle {
        font-size: 13px;
    }
}

/* 极小高度屏幕适配（如笔记本小屏） */
@media (max-height: 600px) {
    .login-card {
        min-height: auto;
        padding: 20px 30px;
        max-height: 95vh;
    }

    .login-method-tabs {
        margin-bottom: 20px;
        height: 40px;
    }

    .tab-item {
        padding: 8px 0;
        font-size: 14px;
    }

    .form-input {
        height: 44px;
    }

    .btn {
        height: 48px;
        font-size: 15px;
    }
}