/* ========== reset & 全局基础 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* 全局禁止选中文字，避免长按菜单干扰（输入框除外） */
    user-select: none;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    color: white;
    overflow: hidden;           /* 防止滚动条出现 */
    height: 100vh;
    /* 降级背景：当视频未加载或失败时显示渐变 */
    background: linear-gradient(135deg, #232340 0%, #1e2a52 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    perspective: 1000px;       /* 为3D文字效果预留 */
}

/* ========== Canvas背景（防下载视频方案） ========== */
.bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 保证canvas绘制内容覆盖全屏，不缩放变形 */
    object-fit: cover;
    z-index: -2;               /* 置于最底层，内容在其上方 */
    pointer-events: none;      /* 禁止任何鼠标/触摸事件，不影响点击按钮 */
    background: #1a1a2e;       /* 视频加载前的背景色 */
}

/* 可选：若想增强视频上的暗色蒙层效果，可以添加叠加层，但已在JS中通过drawImage无需额外元素 */
/* 保持简洁，由canvas直接呈现视频帧 */

/* ========== 背景光斑特效 ========== */
.light-spots {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;      /* 让光斑不干扰点击 */
    z-index: -1;               /* 在canvas之上但内容之下？实际背景层级：canvas(-2) -> 光斑(-1) -> 内容(>0) */
    overflow: hidden;
}

.light-spot {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    animation: floatLight 15s infinite linear;
}

/* 光斑浮动动画 */
@keyframes floatLight {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(calc(50vw - 100px), calc(50vh - 100px)) rotate(180deg);
    }
    100% {
        transform: translate(0, 0) rotate(360deg);
    }
}

/* ========== 主要内容区域 ========== */
.content {
    position: relative;
    z-index: 2;                /* 高于背景和光斑 */
    text-align: center;
    max-width: 800px;
    padding: 2rem;
    animation: fadeIn 1.5s ease-out;
}

/* 日语欢迎语 */
.greeting {
    font-size: 3.5rem;
    margin-bottom: 2rem;
    line-height: 1.3;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
    font-weight: 300;
    letter-spacing: 2px;
    font-family: 'Yu Gothic', 'Hiragino Sans', sans-serif;
    transform: translateZ(50px);      /* 3D感 */
    transition: transform 0.3s ease;
    user-select: none;
}

.greeting:hover {
    transform: translateZ(70px) scale(1.05);
}

.greeting span {
    display: block;
    margin-top: 0.5rem;
    font-size: 2.8rem;
    color: #a3d9ff;
    user-select: none;
}

/* 按钮容器 */
.buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 20rem;         /* 下移按钮位置，符合视觉效果 */
}

/* 主按钮样式（毛玻璃） */
.btn {
    padding: 0.9rem 2.3rem;
    font-size: 1rem;
    border-radius: 50px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transform: translateZ(30px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px) translateZ(40px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(1px) translateZ(30px);
}

/* 按钮流光扫过特效 */
.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.btn:hover::after {
    transform: translateX(100%);
}

/* ========== 右侧登录面板（玻璃拟态+光影边框） ========== */
.login-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    z-index: 98;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.login-mask.active {
    opacity: 1;
    visibility: visible;
}

.login-panel {
    position: fixed;
    top: 0;
    right: -420px;             /* 初始完全隐藏右侧外 */
    width: 380px;
    height: 100%;
    background: rgba(20, 25, 55, 0.75);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(122, 252, 255, 0.2);
    z-index: 99;
    transition: right 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    color: white;
    border-radius: 20px 0 0 20px;
}

.login-panel.open {
    right: 0;                 /* 滑入可视区 */
}

.login-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 1rem;
}

.login-header h3 {
    font-size: 1.8rem;
    font-weight: 400;
    letter-spacing: 2px;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.close-login {
    background: none;
    border: none;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
    opacity: 0.7;
}

.close-login:hover {
    transform: scale(1.2);
    opacity: 1;
}

.login-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.9rem;
    letter-spacing: 1px;
    opacity: 0.8;
}

.input-group input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 40px;
    padding: 12px 18px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
    /* 允许输入框内选择文字（方便粘贴），覆盖全局user-select */
    user-select: text;
}

.input-group input:focus {
    border-color: #7afcff;
    box-shadow: 0 0 12px rgba(122, 252, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
}

.btn-login {
    background: linear-gradient(135deg, rgba(122, 252, 255, 0.3), rgba(255, 126, 185, 0.3));
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50px;
    padding: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.btn-login:hover {
    background: linear-gradient(135deg, rgba(122, 252, 255, 0.5), rgba(255, 126, 185, 0.5));
    box-shadow: 0 0 20px rgba(122, 252, 255, 0.4);
    transform: translateY(-2px);
}

.login-tip {
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 1rem;
}

/* ========== 底部信息 ========== */
.footer {
    position: absolute;
    bottom: 2rem;
    width: 100%;
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    z-index: 2;
    transform: translateZ(20px);
}

/* ========== 加载动画（全屏启动器） ========== */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loader-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.spinner {
    width: 80px;
    height: 80px;
    position: relative;
    margin: 0 auto 30px;
}

.spinner-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-radius: 50%;
    animation: rotate 2s linear infinite;
}

.spinner-inner:nth-child(1) {
    border-top-color: #ff7eb9;
    animation-duration: 2.5s;
}

.spinner-inner:nth-child(2) {
    border-right-color: #7afcff;
    animation-duration: 2s;
}

.spinner-inner:nth-child(3) {
    border-bottom-color: #ff65a3;
    animation-duration: 1.5s;
}

.loading-text {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.progress-container {
    width: 300px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff7eb9, #7afcff, #ff65a3);
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* ========== 粒子背景（装饰） ========== */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    animation: floatParticle 15s infinite linear;
}

/* 粒子浮动动画 */
@keyframes floatParticle {
    0% {
        transform: translateY(0px);
    }
    100% {
        transform: translateY(-100px);
    }
}

/* ========== 樱花飘落特效 ========== */
.sakura {
    position: absolute;
    top: -50px;
    z-index: 1;
    color: rgba(255, 200, 200, 0.7);
    font-size: 24px;
    animation: fall linear forwards;
    pointer-events: none;
    user-select: none;
}

@keyframes fall {
    to {
        transform: translateY(105vh) rotate(360deg);
    }
}

/* ========== 通用动画 ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ========== 响应式设计（移动端适配） ========== */
@media (max-width: 768px) {
    .greeting {
        font-size: 2.5rem;
    }
    .greeting span {
        font-size: 2rem;
    }
    .buttons {
        flex-direction: column;
        gap: 1rem;
        margin-top: 12rem;
    }
    .btn {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
    .login-panel {
        width: 85%;
        right: -85%;          /* 移动端面板宽度85%，初始偏移修正 */
    }
    .spinner {
        width: 60px;
        height: 60px;
    }
    .loading-text {
        font-size: 1.2rem;
    }
    .progress-container {
        width: 200px;
    }
}