html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background: #ffe;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', '微软雅黑', 'Helvetica Neue', sans-serif;
    color: #231F20;
    overflow: hidden;
    overscroll-behavior: none;          /* iOS/安卓都别做下拉回弹 */
    -webkit-overflow-scrolling: auto;
    -webkit-text-size-adjust: 100%;     /* 横屏时别自动放大字号 */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;         /* 去掉双击缩放 */
    position: fixed;                    /* iOS Safari 地址栏伸缩时防止整页位移 */
    inset: 0;
}

a { color: #000; font-size: 14px; }

#main {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#wrap {
    position: absolute;
    left: 0;
    top: 0;
    width: 1100px;
    height: 680px;
    transform-origin: top left;
    will-change: transform;             /* 交给合成层，手机上缩放不卡 */
    backface-visibility: hidden;
}

#canvas,
#stage {
    position: absolute;
    left: 0;
    top: 0;
    width: 1100px;
    height: 680px;
    display: block;
}

#stage { pointer-events: none; }

/* 满树的心轻轻随风摆动（只动画面，不动人物层） */
#canvas {
    transform-origin: 790px 662px;
    animation: canopySway 6.5s ease-in-out infinite;
}

@keyframes canopySway {
    0%, 100% { transform: rotate(-0.05deg) scale(1); }
    50% { transform: rotate(0.06deg) scale(1.014); }
}

#error {
    margin: 0 auto;
    text-align: center;
    margin-top: 60px;
    display: none;
}

/* ===== 开场加载（手机网络慢时先给个反馈，别白屏） ===== */
#loading {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #ffeeee;
    transition: opacity .45s ease;
    pointer-events: none;
}

#loading p {
    margin: 18px 0 0;
    font-size: 13px;
    letter-spacing: .12em;
    color: #b46b78;
}

.ld-beat {
    width: 56px;
    height: 56px;
    display: block;
    transform-origin: 50% 62%;
    filter: drop-shadow(0 8px 16px rgba(226, 83, 122, .28));
    animation: ldBeat 1.15s ease-in-out infinite;
}

@keyframes ldBeat {
    0%, 100% { transform: scale(1); }
    14% { transform: scale(1.16); }
    30% { transform: scale(1); }
    44% { transform: scale(1.12); }
    62% { transform: scale(1); }
}
