/* 核心修复：防止页面出现水平滚动溢出 */
body {
    overflow-x: hidden; /* 禁用水平方向的滚动条 */
    width: 100%;        /* 确保 body 宽度不会超过视口 */
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color var(--transition-normal), color var(--transition-normal);
}



/* 增强：重置所有元素的外边距和内边距，减少意外溢出 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* 确保 padding 和 border 不会增加元素总宽度 */
}

/* 全屏欢迎遮罩 - 高斯模糊版（支持响应式） */
.welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    /* 使用网站主题色背景 */
    background-color: var(--bg-overlay);
    /* 添加高斯模糊效果，与导航栏风格统一 */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.8s cubic-bezier(0.65, 0, 0.35, 1); /* 平滑的上滑过渡 */
    will-change: transform;
    /* 添加边缘立体感，与导航栏一致 */
    border-bottom: 1px solid var(--border-light);
    /* 确保在移动端正常显示 */
    box-sizing: border-box;
    overflow: hidden;
    /* 针对iOS设备的额外优化 */
    -webkit-tap-highlight-color: transparent;
}

/* 上滑隐藏效果 */
.welcome-overlay.slide-up {
    transform: translateY(-100%);
}

/* 遮罩内容样式 */
.welcome-content {
    color: var(--text-primary);
    text-align: center;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    z-index: 10000;
    /* 添加毛玻璃效果 */
    background-color: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid var(--border-light);
    box-shadow: 0 10px 30px var(--shadow-medium);
    /* 确保在移动端正常显示 */
    box-sizing: border-box;
}

/* 网站图标容器 */
.welcome-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 25px;
    background-color: var(--bg-hover);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 40px;
    opacity: 0; /* 恢复动画起始状态 */
    animation: fadeIn 1s ease forwards 0.2s;
    color: var(--accent-primary);
    /* 确保在移动端正常显示 */
    box-sizing: border-box;
    transition: background-color var(--transition-normal);
}

/* 艺术标题样式，与网站艺术字风格统一 */
.welcome-content h2 {
    font-family: 'Georgia', serif; /* 与网站艺术字保持一致 */
    font-size: 2.5rem;
    font-weight: 700; /* 加粗字体使其更明显 */
    margin-bottom: 25px;
    opacity: 0; /* 恢复动画起始状态 */
    letter-spacing: 1px;
    color: var(--text-primary); /* 使用CSS变量，根据主题模式自动调整 */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8), 0 0 10px rgba(255, 255, 255, 0.5); /* 增强文字阴影 */
    animation: fadeIn 1s ease forwards 0.4s;
    /* 确保在移动端正常显示 */
    box-sizing: border-box;
}

.welcome-content p {
    font-size: 1.3rem; /* 增大字体 */
    font-family: 'Times New Roman', Times, serif;
    margin-bottom: 15px;
    line-height: 1.6;
    opacity: 0; /* 恢复动画起始状态 */
    color: var(--text-secondary); /* 使用CSS变量，根据主题模式自动调整 */
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); /* 添加文字阴影 */
    animation: fadeIn 1s ease forwards 0.7s;
    /* 确保在移动端正常显示 */
    box-sizing: border-box;
}

/* 进入按钮样式 - 与网站按钮风格统一 */
#welcome-enter-btn {
    margin-top: 30px;
    opacity: 0; /* 恢复动画起始状态 */
    animation: fadeIn 1s ease forwards 1s;
    transform: translateY(10px);
    /* 复用网站按钮样式 */
    display: inline-block;
    padding: 15px 30px; /* 增大按钮尺寸 */
    background-color: var(--accent-primary);
    color: #ffffff; /* 确保文字是白色 */
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 18px; /* 增大字体 */
    font-weight: 700; /* 加粗字体 */
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.1s ease, box-shadow 0.3s ease;
    /* 确保在移动端正常显示 */
    box-sizing: border-box;
    /* 优化移动设备触摸体验 */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    /* 确保按钮足够大，方便移动端点击 */
    min-height: 56px;
    min-width: 140px;
    /* 添加发光效果 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 255, 255, 0.3);
}

#welcome-enter-btn:hover {
    background-color: var(--accent-secondary);
    box-shadow: 0 4px 12px var(--shadow-accent);
    transform: translateY(-2px);
}

#welcome-enter-btn:active {
    transform: scale(0.98);
}

/* 淡入动画定义 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 圆形图片样式 */
.circle-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-primary);
    transition: transform 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 4px 12px var(--shadow-medium);
}

.circle-image:hover {
    transform: scale(1.1);
    border-color: var(--accent-secondary);
    box-shadow: 0 6px 20px var(--shadow-accent);
}

/* 移动端响应式设计 */
@media screen and (max-width: 768px) {
    /* 缩小标题字体 */
    .welcome-content h2 {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }
    
    /* 调整段落字体大小 */
    .welcome-content p {
        font-size: 1rem;
        margin-bottom: 15px;
    }
    
    /* 缩小图标尺寸 */
    .welcome-icon {
        width: 60px;
        height: 60px;
        font-size: 30px;
        margin-bottom: 20px;
    }
    
    /* 调整内容区域内边距 */
    .welcome-content {
        padding: 30px 20px;
        width: 95%;
    }
    
    /* 调整按钮样式 */
    #welcome-enter-btn {
        margin-top: 25px;
        padding: 10px 20px;
        font-size: 15px;
        min-height: 44px;
        min-width: 100px;
    }
}

/* 小屏幕移动设备 */
@media screen and (max-width: 480px) {
    /* 进一步缩小标题字体 */
    .welcome-content h2 {
        font-size: 1.5rem;
    }
    
    /* 进一步调整段落字体大小 */
    .welcome-content p {
        font-size: 0.95rem;
    }
    
    /* 进一步缩小图标尺寸 */
    .welcome-icon {
        width: 50px;
        height: 50px;
        font-size: 25px;
    }
    
    /* 进一步调整内容区域内边距 */
    .welcome-content {
        padding: 25px 15px;
        border-radius: 12px;
    }
}

.read-more-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: bold;
    transition: color var(--transition-normal);
}

.read-more-link:hover {
    color: var(--accent-secondary);
}

.new-world-main {
    min-height: 100vh;
    padding-top: 100px;
    background-color: #0a0018;
    background-image: radial-gradient(circle, #2a004d, #0a0018);
    color: #ffffff; /* 固定使用白色字体，确保亮色模式下也是白色 */
    /* 进一步加深紫色调，增强神秘感 */
    text-align: center;
}

.portal-header {
    margin-bottom: 60px;
    padding: 0 20px;
}

.portal-header .artistic-title {
    color: #ffffff; /* 固定使用白色字体，确保亮色模式下也是白色 */
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5); /* 白色发光效果 */
}


.portal-grid {
    max-width: 960px;
    margin: 0 auto;
    display: flex; /* 使用 Flexbox 实现水平居中和间隔 */
    justify-content: center;
    flex-wrap: wrap; /* 允许换行 */
    gap: 40px;
}

.portal-node {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    /* 恢复原始的深紫色设计风格 */
    background-color: rgba(128, 0, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);

    /* 核心：阴影和发光效果 */
    box-shadow: 0 0 20px rgba(128, 0, 255, 0.5);

    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}


.node-title {
    font-size: 1rem;
    color: #ffffff; /* 固定使用白色字体，确保亮色模式下也是白色 */
    margin-top: 5px; /* 增加与图标的间距 */
    font-weight: bold; /* 加粗文本增加可读性 */
}

.portal-node:hover {
    /* 放大效果 */
    transform: scale(1.15);

    /* 增强发光，模拟"激活" */
    background-color: var(--bg-hover);
    box-shadow:
            0 0 5px var(--text-light),
            0 0 20px var(--accent-primary), /* 亮蓝色光晕 */
            0 0 35px var(--accent-primary);
}

.node-icon-container {
    display: flex;
    justify-content: center;
    align-items: center;

    width: 60px;
    height: 60px;
    margin-bottom: 5px; /* 减小间距，防止溢出 */
    line-height: 1;
}

/* 4a. 字体图标模式 (Icon Font Mode) */
.node-icon-mode i {
    font-size: 3rem;
    color: var(--accent-primary); /* 修改为强调色，确保在亮色模式下清晰可见 */
}

/* 4b. 图片图标模式 (Image Mode) */
.node-image-mode img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 4c. Emoji 图标模式 (Emoji Mode) */
.node-emoji-mode {
    font-size: 3rem; /* 设定 Emoji 大小 */
}



/* 导航栏和footer样式已移至共享样式文件 */






/* 移动端响应式设计 */
@media screen and (max-width: 768px) {
    .new-world-main {
        padding-top: 80px;
    }

    .portal-header {
        margin-bottom: 40px;
        padding: 0 15px;
    }

    .portal-header .artistic-title {
        font-size: 1.8rem;
    }

    .portal-grid {
        flex-direction: column; /* 垂直堆叠 */
        gap: 25px;
        padding: 0 15px;
    }

    .portal-node {
        /* 变为全宽卡片 */
        width: 100%;
        height: 100px;
        border-radius: 10px;
        flex-direction: row; /* 水平排列图标和文字 */
        justify-content: flex-start;
        padding: 0 30px;
    }

    .node-icon-container {
        width: 40px;
        height: 40px;
        margin-right: 20px;
        margin-bottom: 0;
    }

    .node-icon-mode i, .node-emoji-mode {
        font-size: 2rem;
    }

    .node-title {
        font-size: 1.1rem;
        margin-top: 0;
    }
}

/* 小屏幕移动设备 */
@media screen and (max-width: 480px) {
    .new-world-main {
        padding-top: 60px;
    }

    .portal-header .artistic-title {
        font-size: 1.5rem;
    }

    .portal-grid {
        gap: 20px;
        padding: 0 10px;
    }

    .portal-node {
        height: 90px;
        padding: 0 20px;
    }

    .node-icon-container {
        width: 35px;
        height: 35px;
        margin-right: 15px;
    }

    .node-icon-mode i, .node-emoji-mode {
        font-size: 1.8rem;
    }

    .node-title {
        font-size: 1rem;
    }
}