:root {
    --magma-dark: #a31d1d;
    --magma-red: #ff3b30;
    --magma-orange: #ff9f0a;
    --magma-bright: #ff4d4d;
    --warm-bg: #4a1b1b;
}

html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* 核心：禁止一切方向的滚动 */
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;

    /* 核心：绝对居中 */
    display: flex;
    justify-content: center;
    align-items: center;

    background-color: var(--warm-bg);
    background-image: linear-gradient(rgba(74, 27, 27, 0.7), rgba(74, 27, 27, 0.85)), url('/static/imgs/bg1.png');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

@media screen and (max-aspect-ratio: 4/5) {
    html, body {
        background-position: center top;
    }
}

.ambient-glow-1 {
    position: absolute;
    top: -15%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(255, 80, 60, 0.45) 0%, rgba(74, 27, 27, 0) 70%);
    border-radius: 50%;
    filter: blur(60px);
    animation: float 10s infinite alternate;
}

.ambient-glow-2 {
    position: absolute;
    bottom: -15%;
    right: -10%;
    width: 70vw;
    height: 70vw;
    background: radial-gradient(circle, rgba(255, 159, 10, 0.4) 0%, rgba(200, 40, 40, 0.4) 40%, rgba(74, 27, 27, 0) 70%);
    border-radius: 50%;
    filter: blur(80px);
    animation: float 12s infinite alternate-reverse;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(40px, 40px);
    }
}

.glass-card {
    position: relative;
    width: 88%;
    max-width: 420px;
    padding: 35px 30px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    z-index: 1000;
    color: #fff;
    overflow: hidden;
    animation: card-enter 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes card-enter {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.magma-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--magma-dark), var(--magma-red), var(--magma-orange), var(--magma-bright));
    background-size: 200% 100%;
    box-shadow: 0 0 15px rgba(255, 59, 48, 0.8);
    animation: magma-flow 3s ease infinite;
}

@keyframes magma-flow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.brand-showcase {
    width: 100%;
    height: 140px;
    border-radius: 20px;
    margin-bottom: 25px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.brand-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.4s ease-out;
}

.brand-showcase:hover .brand-image {
    transform: scale(1.05);
}

.lp-header {
    text-align: center;
    margin-bottom: 30px;
}

.lp-logo-text {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 8px;
    margin: 0;
    background: linear-gradient(125deg, #ffffff, #ffdfd4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(255, 59, 48, 0.6);
}

.lp-subtitle {
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 8px;
    letter-spacing: 1px;
    font-weight: 500;
}

.lp-input-group {
    margin-bottom: 20px;
    position: relative;
}

.lp-input {
    width: 100%;
    padding: 14px 15px;
    padding-left: 45px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 14px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    -webkit-appearance: none;
}

.lp-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.lp-input:focus {
    border-color: #fff;
    box-shadow: 0 0 15px rgba(255, 159, 10, 0.4), inset 0 0 5px rgba(255, 255, 255, 0.3);
    outline: none;
    background: rgba(255, 255, 255, 0.25);
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.85;
    font-size: 16px;
    transition: 0.3s;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.lp-input:focus + .input-icon, .lp-input-group:focus-within .input-icon {
    opacity: 1;
    filter: drop-shadow(0 0 5px #fff);
}

.btn-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.lp-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 14px;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    -webkit-tap-highlight-color: transparent;
}

.lp-btn-login {
    background: linear-gradient(125deg, var(--magma-red), var(--magma-orange));
    color: #fff;
    box-shadow: 0 8px 20px rgba(255, 59, 48, 0.5);
    text-shadow: 0 1px 2px rgba(163, 29, 29, 0.5);
}

.lp-btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(255, 59, 48, 0.7);
    filter: brightness(1.1);
}

.lp-btn-login:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(255, 59, 48, 0.5);
}

.lp-btn-register {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.lp-btn-register:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: #fff;
    transform: translateY(-3px);
}

.lp-links {
    text-align: center;
    margin-top: 25px;
    font-size: 13px;
    font-weight: 500;
}

.lp-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: 0.3s;
    padding: 5px 10px;
}

.lp-link:hover {
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

@media screen and (max-width: 480px) {
    .glass-card {
        padding: 25px 20px;
        border-radius: 24px;
    }

    .brand-showcase {
        height: 110px;
        margin-bottom: 20px;
    }

    .lp-logo-text {
        font-size: 26px;
        letter-spacing: 6px;
    }

    .lp-input-group {
        margin-bottom: 16px;
    }

    .lp-input {
        padding: 12px 15px;
        padding-left: 40px;
    }

    .btn-group {
        gap: 10px;
        margin-top: 25px;
    }

    .lp-btn {
        padding: 12px;
        font-size: 14px;
    }
}

/* === 开屏动画 CSS (已优化手机端兼容性) === */
#splash {
    position: fixed;
    z-index: 99999;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(125deg, #2c0000, #e62117, #ff8c00, #4d0000, #ff1a1a);
    background-size: 500% 500%;
    animation: liquid-bg 4s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
    transition: opacity 0.8s ease;
    opacity: 0;
    display: none;
    will-change: opacity;
    -webkit-backface-visibility: hidden;
}

@keyframes liquid-bg {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.splash-logo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 50px;
    color: #fff;
    font-weight: 900;
    letter-spacing: 15px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    animation: breathe 3s infinite;
    z-index: 10002;
}

@keyframes breathe {
    0%, 100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(0.9);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.pet-x {
    position: absolute;
    top: 0;
    left: 0;
    will-change: transform;
}

.pet-y {
    width: 60px;
    height: 60px;
    will-change: transform;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.4));
    transform: translateZ(0);
}

@keyframes bx {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(100vw - 60px));
    }
}

@keyframes by {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(calc(100vh - 60px));
    }
}

.x1 {
    animation: bx 3.2s linear infinite alternate;
}

.y1 {
    animation: by 2.3s linear infinite alternate;
}

.x2 {
    animation: bx 2.7s linear infinite alternate;
}

.y2 {
    animation: by 3.5s linear infinite alternate;
    animation-delay: -0.5s;
}

.x3 {
    animation: bx 4.1s linear infinite alternate;
}

.y3 {
    animation: by 2.9s linear infinite alternate;
    animation-delay: -1.2s;
}

.x4 {
    animation: bx 3.8s linear infinite alternate;
}

.y4 {
    animation: by 4.5s linear infinite alternate;
    animation-delay: -0.8s;
}

.x5 {
    animation: bx 2.4s linear infinite alternate;
}

.y5 {
    animation: by 3.7s linear infinite alternate;
    animation-delay: -2.0s;
}

.x6 {
    animation: bx 3.1s linear infinite alternate;
}

.y6 {
    animation: by 2.1s linear infinite alternate;
    animation-delay: -1.5s;
}

.x7 {
    animation: bx 4.8s linear infinite alternate;
}

.y7 {
    animation: by 1.7s linear infinite alternate;
    animation-delay: -0.3s;
}

.x8 {
    animation: bx 1.9s linear infinite alternate;
}

.y8 {
    animation: by 4.2s linear infinite alternate;
    animation-delay: -2.5s;
}

.x9 {
    animation: bx 3.6s linear infinite alternate;
}

.y9 {
    animation: by 2.5s linear infinite alternate;
    animation-delay: -1.0s;
}

.x10 {
    animation: bx 2.2s linear infinite alternate;
}

.y10 {
    animation: by 3.9s linear infinite alternate;
    animation-delay: -0.7s;
}

@media screen and (max-width: 480px) {
    .splash-logo-glow {
        font-size: 30px;
        letter-spacing: 6px;
    }

    .pet-y {
        width: 50px;
        height: 50px;
    }
}

/* 登录页签切换样式 */
.login-tabs {
    display: flex;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.login-tab {
    flex: 1;
    text-align: center;
    padding: 12px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5);
    font-weight: bold;
    transition: 0.3s;
}

.login-tab.active {
    color: #fff;
    border-bottom: 3px solid var(--magma-orange);
    text-shadow: 0 0 10px rgba(255, 159, 10, 0.5);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 二维码容器样式 */
.qr-container {
    text-align: center;
    padding: 10px 0;
}

.qr-image-wrapper {
    width: 180px;
    height: 180px;
    margin: 0 auto;
    background: #fff;
    padding: 10px;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    position: relative;
}

#qr-img {
    width: 100%;
    height: 100%;
    display: none;
}

#qr-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #333;
    font-weight: bold;
}

.qr-tip {
    margin-top: 20px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

/* 科技感提示框 (Toast) */
.toast-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(15px);
    border: 1px solid var(--neon-blue);
    color: #fff;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 5px 20px rgba(0, 242, 254, 0.3);
    z-index: 9999999 !important;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    width: max-content;
    max-width: 88vw;
    white-space: normal;
    word-break: break-word;
    line-height: 1.5;
    box-sizing: border-box;
}

.toast-message.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-message.error {
    border-color: #ff3333;
    box-shadow: 0 5px 20px rgba(255, 51, 51, 0.3);
    color: #ffcccc;
}

/* =======================================================
   🚀 升级版：熔岩(Magma)主题拟态玻璃注册模态框
========================================================== */

/* 1. 模态框全屏蒙版：解决遮挡、点击失效的关键 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 999999 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: visibility 0.4s, opacity 0.4s;
}

.modal-overlay.show {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* 2. 拟态玻璃面板：升级颜色匹配 Magma 红色风格 */
.glass-panel {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 59, 48, 0.3); /* Magma Red 边框 */
    border-radius: 24px;
    padding: 40px 30px;
    width: 88%;
    max-width: 360px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 59, 48, 0.15); /* 红/橙光阴影 */
    text-align: center;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    overflow: hidden; /* 🔥 关键：裁切上方流光条超出圆角的部分 */
}

.modal-overlay.show .glass-panel {
    transform: scale(1);
}

/* 🔥 新增：模态框顶部的流动炫光条 (复用 magma-flow 动画) */
.glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--magma-dark), var(--magma-red), var(--magma-orange), var(--magma-bright));
    background-size: 200% 100%;
    box-shadow: 0 0 15px rgba(255, 59, 48, 0.8);
    animation: magma-flow 3s ease infinite;
}

.modal-title {
    color: #fff;
    font-size: 24px;
    margin-bottom: 8px;
    font-weight: 900;
    letter-spacing: 1px;
}

.modal-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    margin-bottom: 30px;
    font-weight: 300;
}

/* 3. 输入框：匹配 login 的橙色系焦点 */
.input-group {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    margin-bottom: 18px;
    padding: 12px 18px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.input-group:focus-within {
    border-color: rgba(255, 159, 10, 0.6); /* 聚焦时变为 Magma Orange */
    box-shadow: 0 0 10px rgba(255, 159, 10, 0.15);
}

.input-group span {
    font-size: 18px;
    margin-right: 14px;
    opacity: 0.7;
}

.input-group input {
    background: transparent;
    border: none;
    color: #fff;
    outline: none;
    width: 100%;
    font-size: 16px;
    font-weight: 400;
    font-family: sans-serif;
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-weight: 300;
}

/* 4. 按钮：统一使用熔岩渐变 */
.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 35px;
}

.btn-cancel, .btn-confirm {
    flex: 1;
    padding: 15px;
    border-radius: 14px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    font-size: 15px;
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.btn-confirm {
    background: linear-gradient(125deg, var(--magma-red), var(--magma-orange));
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 59, 48, 0.4);
}

.btn-confirm:hover {
    box-shadow: 0 8px 25px rgba(255, 59, 48, 0.6);
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.btn-confirm:disabled {
    filter: grayscale(1);
    cursor: not-allowed;
    opacity: 0.5;
}