body{
    height: 100vh;
    margin: 0;
    background-repeat: no-repeat;
    background-position: top;
    background-size: cover;
    background-image: url("../../images/background.jpg");
}

#cover {
    position: fixed;
    pointer-events: none;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    z-index: 1000; /* 确保cover覆盖所有元素，包括菜单按钮 */
}

#cover.resources-loaded {
    animation: fadeOut 0.4s 0.2s forwards;
}

#title_container {
    display: flex;
    flex-direction: column;
    justify-content: center; /* 垂直居中排列子元素 */
    align-items: center; /* 水平居中排列子元素 */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: auto;
    min-height: 120px; /* 确保容器有足够高度容纳两个元素 */
    z-index: 1001;
    opacity: 0;
    animation: slideIn 0.5s forwards; /* 添加动画效果 */
}

#title {
    position: relative; /* 修改为相对定位，使其能够正确响应flex布局 */
    padding: 15px;
    width: 100%;
    max-width: 640px;
    border-radius: 25px;
    background-color: rgba(255, 255, 255, 0);
    color: lightblue;
    text-align: center;
    white-space: nowrap;
    font-family: 'valorax';
    font-size: 96px;
    margin: 0;
    z-index: 1001; /* 确保title在cover上面 */
}

#loading_text {
    position: relative;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    font-size: 24px;
    max-height: 30px;
    width: 100%;
    color: lightblue;
    opacity: 0;
    animation: fadeIn 0.3s 0.5s forwards;
    z-index: 1001; /* 确保loading_text在cover上面 */
}

#title.resources-loaded {
    opacity: 1;
    animation: titleZoom 0.5s 0.2s forwards;
}

#title_container.resources-loaded {
    opacity: 1;
    animation: titleMove 0.4s 0.2s forwards;
}

#loading_text.resources-loaded {
    opacity: 1;
    animation: fadeOut 0.2s 0s forwards;
}

#main_screen {
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    background-color: rgba(96, 96, 96, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.18);
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: stretch;
    padding: 20px;
    padding-left: 50px;
    padding-right: 50px;
    top: 55%;
    width: 85%;
    max-width: 1200px;
    border-radius: 20px;
    height: 0;
    max-height: 75%;
    overflow: hidden;
}

#main_screen.loaded {
    animation: fold-y 0.4s 0.4s forwards;
}

#side_list{
    position: relative;
    overflow: hidden;
    height: 100%;
    width: 100%;
    max-width: 280px;
    background-color: rgba(255,255,255,0.75);
    border-radius: 20px;
    opacity: 0;
}

#side_list.loaded{
    animation: fadeIn 0.6s 0.8s forwards;
}

#info_screen{
    position: relative;
    flex: 1;
    width: auto;
    padding: 25px;
    padding-left: 15px;
    padding-right: 15px;
    margin-bottom: 20px;
    opacity: 0;
    right: 0;
    left: 0;
    top: 0;
    background-color: rgba(255,255,255,0.3);;
    border-radius: 20px;
    min-height: 0;
    overflow: hidden;
}

#info_screen.loaded{
    animation: fadeIn 0.8s 1.2s forwards;
}

#link_column{
    position: absolute;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    height: 50%;
    max-height: 120px;
    width: auto;
    background-color: rgb(216, 216, 216);
    border-radius: 20px;
    opacity: 0;
    left: 4%;
    right: 4%;
    bottom: 4%;
    z-index: 15;
}

#link_column.loaded{
    animation: fadeIn 0.6s 1.4s forwards;
}

#user_info{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    width: auto;
    height: auto;
    min-height: 60px;
    flex-shrink: 0;
    opacity: 0;
    padding: 25px; /* 增加上下内边距 */
    border-radius: 20px;
    background-color: rgba(255,255,255,0.6);
}

#user_info.loaded{
    animation: fadeIn 0.6s 1.0s forwards;
}

#login_link{
    text-decoration: none;
    font-size: 25px;
    font-weight: bold; /* 修正为 font-weight */
    white-space: nowrap;
    color: gray;
    margin-bottom: 8px; /* 添加底部间距 */
}

#login_link:hover{
    color: blue;
}

#login_text {
    font-size: 16px;
    color: #222;
    margin: 0;
    text-align: left;
}

#user_info_link {
    text-decoration: none;
    font-size: 16px;
    color: #0066cc;
    margin-top: 10px;
    padding: 5px 10px;
    background-color: rgba(255,255,255,0.7);
    border-radius: 15px;
    transition: all 0.3s;
}

#user_info_link:hover {
    background-color: #0066cc;
    color: white;
}

.CenterContainer{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.ButtonContainer{
    margin: 10px;
    margin-top: 15px;
    display: flex;
    flex: row;
}

.LinkContainer{
    margin-top: 25px;
    margin-left: 15px;
    text-align: center;
    width: 100px;
}

.InfoContainer{
    position: relative;
    margin-left: 25px;
    height: 100%;
    width: 100%;
    float: right;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.welcome_messages_container{
    position: absolute;
    width: fit-content;
    top: 20px;
    left: 25px;
    z-index: 10;
    background-color: transparent;
    padding: 10px;
    margin: 10px;
    overflow: hidden;
}

.welcome-line {
    margin: 5px 0;
    text-align: left;
}

#welcome_message_1{
    font-size: 48px;
    color: #000;
    font-family: 'GunShi';
    width: 0;
    overflow: hidden;
    white-space: nowrap;
}

#welcome_message_1.welcome-start{
    animation: fold-x 0.4s 0s forwards;
    width: auto;
}

#welcome_message_2{
    font-size: 22px;
    color: #222;
    font-family: 'valorax';
    width: 0;
    overflow: hidden;
    white-space: nowrap;
}

#welcome_message_2.welcome-start{
    animation: fold-x 0.4s 0s forwards;
    width: auto;
}

#welcome_message_3{
    font-size: 48px;
    color: #000;
    font-family: 'GunShi';
    width: 0;
    overflow: hidden;
    white-space: nowrap;
}

#welcome_message_3.welcome-start{
    animation: fold-x 0.5s 0s forwards;
    width: auto;
}

#welcome_message_4{
    font-size: 22px;
    color: #222;
    font-family: 'valorax';
    width: 0;
    overflow: hidden;
    white-space: nowrap;
}

#welcome_message_4.welcome-start{
    animation: fold-x 0.5s 0s forwards;
    width: auto;
}

.ButtonIcon{
    text-align: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
}

.ButtonImg{
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-70%, -50%);
    height: 32px;
    width: 32px;
}

.LinkIcon{
    border-radius: 35px;
    height: 70px;
    width: 70px;
}

.LinkIcon:hover{
    transform: scale(1.2);
}

.SideButton {
    text-decoration: none;
    color: black;
    float: left;
    white-space: nowrap;
    padding-left: 15px;
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 24px;
    cursor: pointer;
    font-family: 'YuanTi';
}

.SideButton:hover { 
    color: deepskyblue;
    margin-left: 10px;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 6%;
    left: 12%; /* 距离左侧屏幕宽度的5% */
    z-index: 1003; /* 确保按钮在侧边栏之上 */
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hamburger {
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 3px 0;
    transition: 0.3s;
}

.mobile-menu-btn.active .hamburger:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-btn.active .hamburger:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active .hamburger:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
        transform: translate(-50%, -50%);
        z-index: 999; /* 初始z-index低于cover */
    }
    
    /* 当资源加载完成后，让菜单按钮显示在cover上面 */
    .mobile-menu-btn.resources-loaded {
        z-index: 1003; /* 确保按钮在所有内容之上，包括侧边栏 */
    }
    
    #main_screen {
        flex-direction: column;
        padding: 10px;
        width: 90%;
        max-width: 1200px;
        height: 80%;
        max-height: 80vh;
        align-items: stretch;
    }
    
    #side_list {
        position: absolute; /* 改为绝对定位，相对于main_screen */
        top: 0;
        left: 0;
        width: 100%;
        height: 0; /* 高度为0，通过动画展开 */
        max-height: 100%;
        max-width: 100%;
        background-color: #ffffff6d;
        z-index: 1002; /* 提高z-index，确保覆盖其他内容 */
        animation: none;
        padding-top: 0; /* 初始无内边距 */
        padding-bottom: 0;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        overflow: hidden; /* 隐藏溢出内容 */
        display: flex;
        flex-direction: column;
        align-items: center; /* 使内容居中 */
        border-radius: 20px; /* 保持与main_screen相同的圆角 */
        transition: none;
    }
    
    #side_list.active {
        height: 100%; /* 展开到全高 */
        padding-top: 80px;
        padding-bottom: 30px;
        opacity: 1;
        overflow-y: auto; /* 允许内容滚动 */
        animation: mobileSideListExpand 0.3s forwards;
    }
    
    #side_list.closing {
        animation: mobileSideListCollapse 0.3s forwards;
    }

    .InfoContainer {
        margin-left: 0;
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        gap: 15px;
        position: relative;
    }

    .welcome_messages_container{
        position: absolute;
        top: 15px;
        left: 15px;
        margin-bottom: 0;
        width: calc(100% - 30px);
        z-index: 5;
    }
    
    #info_screen {
        flex: 1;
        padding: 15px;
        min-height: 250px;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        position: relative;
    }
    
    #user_info {
        height: auto;
        min-height: 50px;
        padding: 12px;
        flex-shrink: 0;
        margin-bottom: 10px;
        width: auto;
    }
    
    #welcome_message_1 {
        font-size: 32px;
    }
    
    #welcome_message_2 {
        font-size: 22px;
    }
    
    #welcome_message_3 {
        font-size: 26px;
    }
    
    #welcome_message_4 {
        font-size: 18px;
    }

    #title {
        font-size: 48px;
        width: 100%;
        padding: 10px 25px;
        text-align: center;
    }
    
    #title.resources-loaded {
        animation: titleZoomMobile 0.5s 0.2s forwards;
    }

    #title_container.resources-loaded {
        animation: titleMoveMobile 0.4s 0.2s forwards;
    }

    #loading_text {
        font-size: 14px;
    }
    
    #link_column {
        position: relative;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        height: auto;
        max-height: none;
        align-items: center;
        margin-top: auto;
        bottom: auto;
        left: auto;
        right: auto;
        padding-top: 25px;
        padding-bottom: 25px;
        z-index: 15;
    }
    
    .LinkContainer {
        margin: 8px;
        width: 70px;
    }
    
    .LinkIcon {
        height: 55px;
        width: 55px;
    }
    
    #login_link {
        font-size: 18px;
    }
    
    .SideButton {
        font-size: 20px;
        float: none;
        text-align: center;
        padding-left: 0;
        width: 100%;
    }
    
    .ButtonContainer {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 60%; /* 缩小宽度使按钮更集中 */
    }
    
    .ButtonIcon {
        width: 65px;
        height: 55px;
    }

    .ButtonImg {
        transform: translate(-80%, -50%);
    }
}

/* 平板端适配 */
@media screen and (max-width: 1024px) and (min-width: 769px) {
    #main_screen {
        width: 90%;
        max-width: 1200px;
        padding: 15px;
    }
    
    #welcome_message_1 {
        font-size: 42px;
    }
    
    #welcome_message_2 {
        font-size: 28px;
    }
    
    #welcome_message_3 {
        font-size: 32px;
    }
    
    #welcome_message_4 {
        font-size: 24px;
    }
    
    #title {
        font-size: 72px;
    }
    
    .SideButton {
        font-size: 22px;
    }
}