/* --- 1. 字体定义 (确认已开启 block 模式，防止字体跳变) --- */
@font-face {
    font-family: 'MyWebFont';
    /* 这一行确保了：没加载完字体前，文字是透明的，不会显示宋体 */
    src: url('https://nanyang-image.oss-cn-chengdu.aliyuncs.com/static/fonts/MyCustomFont.woff2') format('woff2');
    font-display: block;
}

/* --- 2. 基础背景设置 --- */
body {
    /* 建议维持你现有的背景路径，如果之后找不到图再改回 /static/... */
    background-image: url('../images/background-main.webp'); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 100vh;
    margin: 0;
    font-family: 'MyWebFont', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* --- 3. 走路贴纸 --- */
#walking-sticker {
    position: absolute;
    bottom: 0;
    height: 100%;
    z-index: 10;
    left: 5%;
    transform: translateX(0);
    transition: transform 10s linear;
    mix-blend-mode: multiply;
}

#walking-sticker.is-walking {
    transform: translateX(120vw);
}

/* --- 4. 内容容器 --- */
.content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center; 
    /* 增加宽度限制，防止手机上文字太靠边 */
    width: 95%;
    max-width: 800px;
    position: relative;
    z-index: 20;
    text-align: center; 
}

/* --- 5. 标题样式 --- */
h1 {
    color: white;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
    margin: 0; 
    letter-spacing: 2px;
    white-space: nowrap;
    font-size: clamp(2rem, 10vw, 4.5rem);
    /* 移除默认下边距，由分割线来控制间距 */
    margin-bottom: 0;
}

/* --- 6. 分隔线 (隐形桥梁版) --- */
/* 必须保留这个元素，作为连接大标题和副标题的时间桥梁 */
#main-divider {
    /* 1. 彻底隐身 */
    opacity: 0 !important;
    border: none !important;
    background: transparent !important;

    /* 2. 消除空间 */
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;

    /* 3. 让 JS 能读取到它 */
    display: block; 
    
    /* 【核心修复】必须加这个！ */
    /* 给它 0.1秒 的变化时间，仅仅是为了骗过 JS，让它发送“结束信号” */
    transition: all 0.1s; 
}

/* 初始状态类 */
.divider-hidden {
    /* 配合上面的 transition，只要有属性变化即可 */
    width: 0 !important;
    opacity: 0 !important;
}

/* --- 7. 副标题样式 --- */
p {
    color: white; 
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.7);
    margin: 0;                  /* 清除默认边距，完全靠 divider 控制 */
    letter-spacing: 2px; 
    line-height: 1.6;
    font-weight: bold; 
    white-space: nowrap;
    font-size: clamp(0.9rem, 4vw, 1.6rem);
}

/* =========================================
   打字机与按钮样式 (保持原样)
   ========================================= */

.type-hidden {
    opacity: 0; 
}
.typing-cursor::after {
    content: '|';
    color: #fff;
    margin-left: 3px;
    animation: blink 0.7s infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.divider-hidden {
    width: 0 !important;
    opacity: 1; 
}

.button {
    margin-top: 45px;
    text-decoration: none;
    display: inline-block; 
    cursor: pointer;
    border: 1px solid transparent; 
    border-radius: 30px;      
    padding: 10px 35px;       
    background-color: transparent; 
    transition: all 0.5s ease;
}

.button-border-show {
    border-color: white !important;
    background-color: rgba(255, 255, 255, 0.1); 
}

.button-text {
    font-size: 18px; 
    color: white;
    letter-spacing: 2px;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    display: inline-block; 
}

.button-border-show:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* =========================================
   雨水特效
   ========================================= */
#rain-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; 
    pointer-events: none; 
}
/* =========================================
   新增：响应式与手机适配专用代码
   ========================================= */

@media screen and (max-width: 768px) {
    
    /* 1. [关键] 切换手机竖屏背景图 */
    body {
        background-image: url('../images/background-main-mobile.webp') !important;
        background-position: center top; 
        background-attachment: scroll; /* 手机上用 scroll 兼容性更好，防止背景图拉伸变形 */
     }
 }