* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
}

/* 🌌 这里的背景由 background_3d.js (Three.js) 接管 */
body {
    background-color: #020617 !important;
    position: relative;
    color: #f1f5f9;
}

/* 清理所有背景层 */
body::after {
    display: none !important;
}

body::before {
    display: none !important;
}



/* 粒子特效画布 */
#cursorCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    pointer-events: none;
    z-index: 1;
}

/* 布局包装器 - 支持侧边平滑滑出 */
.login-page-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100vw;
    height: 100vh;
    z-index: 10;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 玻璃拟态卡片 - 默认采用星空深色透明质感 */
.glass-card {
    background: rgba(10, 15, 30, 0.5) !important;
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border-radius: 24px;
    padding: 40px;
    color: #f1f5f9;
}

/* 暗黑主题下的登录卡片样式 */
body[data-theme="dark"] .glass-card {
    background: rgba(15, 23, 42, 0.96) !important;
    border-color: #334155 !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    color: #e5e7eb;
}

body[data-theme="dark"] .form-group label {
    color: #cbd5e1;
}

body[data-theme="dark"] .form-group input {
    background: rgba(15, 23, 42, 0.9);
    border-color: #475569;
    color: #e5e7eb;
}

body[data-theme="dark"] .form-group input:focus {
    background: rgba(15, 23, 42, 1);
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.45);
}

.brand-title {
    text-align: center;
    margin-bottom: 35px;
    font-size: 28px;
    font-weight: 700;
}

/* 表单样式 */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #94a3b8;
}

.form-group input {
    width: 100%;
    padding: 14px;
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 16px;
    color: #f1f5f9;
    transition: all 0.3s;
    outline: none;
}

.form-group input:focus {
    background: rgba(15, 23, 42, 0.8) !important;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.3);
}

/* 按钮切换 */
.btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: #f1f5f9 !important;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: #f1f5f9 !important;
}

/* 侧边面板实现区域 */
.side-panel {
    width: 0;
    opacity: 0;
    overflow-y: auto;
    /* 允许超出时滚动，特别是注册表单较长时 */
    overflow-x: hidden;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: translateX(50px) rotateY(-10deg);
    max-height: 90vh;
    /* 防止过高 */
}

/* 当侧边栏显示时，login-page-wrapper 内部的 gap 变大 */
.login-page-wrapper.has-side-panel {
    gap: 30px;
}

.side-panel.show {
    width: 420px;
    opacity: 1;
    transform: translateX(0) rotateY(0);
}

.side-content {
    text-align: center;
}

.side-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

/* 消息提醒 */
.message {
    margin-bottom: 20px;
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    font-size: 14px;
    display: none;
}

.message.error {
    background: rgba(254, 226, 226, 0.8);
    color: #991b1b;
}

.message.success {
    background: rgba(209, 250, 229, 0.8);
    color: #065f46;
}

.links {
    margin-top: 25px;
    text-align: center;
    font-size: 14px;
}

.links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.clear-cache-link {
    display: block;
    margin-top: 15px;
    color: #ef4444 !important;
    font-size: 12px;
}

/* 状态列表 (侧边栏内部) */
.status-list {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 15px;
    margin: 20px 0;
    text-align: left;
    display: none;
}

.status-item {
    padding: 6px 0;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.check {
    color: #10b981;
    font-weight: bold;
    margin-right: 8px;
}

/* 旋转器 */
.spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 移动端适配 - 极佳的覆盖式底栏效果 */
@media (max-width: 768px) {
    body {
        /* overflow: hidden; */
        /* 允许在内容过多时滚动主容器 */
        height: -webkit-fill-available;
    }

    .login-page-wrapper {
        min-height: 100vh;
        min-height: -webkit-fill-available;
        width: 100vw;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 20px 0;
        gap: 0 !important;
        position: relative;
    }

    .container {
        max-width: 92%;
        transition: all 0.5s cubic-bezier(0.32, 0.72, 0, 1);
        z-index: 5;
    }

    /* 当侧边面板打开时，背景登录框稍微缩小并变暗 */
    .login-page-wrapper.has-side-panel .container {
        opacity: 0.15;
        transform: scale(0.9) translateY(-20px);
        filter: blur(4px);
        pointer-events: none;
    }

    .side-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100% !important;
        height: 100%;
        max-height: 100vh;
        opacity: 1 !important;
        z-index: 100;
        display: flex;
        align-items: flex-end;
        /* 底部对齐 */
        transform: translateY(100%) !important;
        /* 默认隐藏在屏幕下方 */
        transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1) !important;
        pointer-events: none;
        visibility: hidden;
        /* 防止在底部露出边距 */
    }

    .side-panel.show {
        transform: translateY(0) !important;
        pointer-events: auto;
        visibility: visible;
    }

    .side-panel.dragging {
        transition: none !important;
    }

    .side-content {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        /* 增加顶部呼吸空间，避开浏览器状态栏和刘海屏 */
        padding: 60px 24px 80px 24px !important;
        padding-top: calc(50px + env(safe-area-inset-top, 0px)) !important;
        border-radius: 32px 32px 0 0 !important;
        border-bottom: none !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4) !important;
        max-height: 92vh;
        /* 稍微放宽高度限制 */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
        /* 为弹性拉动添加过渡 */
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        will-change: transform;
    }

    /* 显式给标题增加一点间距，防止贴顶 */
    .side-content .brand-title {
        margin-top: 10px;
        margin-bottom: 30px;
    }

    /* 增加一个顶部的“拖动手柄”小条，增加移动端质感 */
    .side-content::before {
        content: "";
        position: absolute;
        top: 16px;
        /* 稍微下移一点，更易察觉 */
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 5px;
        background: rgba(0, 0, 0, 0.1);
        /* 改成深色，提高在浅色背景下的辨识度 */
        border-radius: 3px;
    }

    [data-theme="dark"] .side-content::before,
    [data-theme="glass"] .side-content::before {
        background: rgba(255, 255, 255, 0.3);
    }

    /* 强化按钮间距 */
    .side-actions {
        flex-direction: column;
        gap: 16px;
        margin-top: 20px;
        padding-bottom: 20px;
        /* 增加底部防挤压边距 */
    }
}