html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
    background: #231F20;
    display: flex;
    justify-content: center;
    align-items: center;
}

#tuanjie-canvas {
    width: 100%;
    height: 100%;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    display: none;
}

#loader-wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #231F20;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;

    opacity: 0;
    /* 默认透明 */
    transition: opacity 0.3s ease;
    /* 增加平滑过渡，避免突兀 */
    pointer-events: none;
    /* 没显示前不允许点击 */
}

/* 增加一个“已就绪”状态 */
#loader-wrap.ready {
    opacity: 1;
    pointer-events: auto;
}


#bg-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#loader-bg {
    width: 100%;
    height: 100%;
    background: url('../source/bg.png') no-repeat center center;
    background-position: 0px 0px;
    background-size: 100% 100%;
    opacity: 0.85;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}


.progress-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(14% + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    align-items: center;
    width: clamp(200px, min(60vw, 60vh * (1920/1080)), 800px);
    max-width: 90vw;
}

.progress-text {
    color: #fff;
    font-size: clamp(16px, min(3vh, 3vw), 32px);
    font-weight: 900;
    text-shadow: 0 0 8px #000;
    margin-bottom: clamp(8px, min(1.5vh, 1.5vw), 15px);
    text-align: center;
    white-space: nowrap;
}

.progress-box {
    width: 100%;
    height: clamp(20px, min(4vh, 4vw), 48px);
    position: relative;
    background: url('../source/progress_bg.png') no-repeat center center;
    background-size: 100% 100%;
    border-radius: clamp(10px, min(2vh, 2vw), 24px);
    overflow: visible;
}

.progress-bar {
    position: absolute;
    top: clamp(2px, min(0.4vh, 0.4vw), 5px);
    left: clamp(2px, min(0.4vh, 0.4vw), 4px);
    height: calc(100% - clamp(4px, min(0.8vh, 0.8vw), 10px));
    width: 0%;
    background: url('../source/progress_bar.png') no-repeat left center;
    background-size: 100% 100%;
    transition: width 0.12s ease-out;
    border-radius: clamp(8px, min(1.6vh, 1.6vw), 19px);
}

.bar-tag {
    position: absolute;
    top: 45%;
    left: clamp(2px, min(0.4vh, 0.4vw), 4px);
    transform: translate(-50%, -50%);
    width: clamp(30px, min(6vh, 6vw), 77px);
    height: clamp(45px, min(9vh, 9vw), 110px);
    background: url('../source/bar_tag.png') no-repeat center center;
    background-size: 100% 100%;
    z-index: 10;
    pointer-events: none;
    transition: left 0.12s ease-out;
}

@keyframes breathing {
    0% {
        transform: scale(1);
        opacity: 0.9;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
        filter: brightness(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 0.9;
    }
}

@keyframes shine {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

.start-button {
    cursor: pointer;
    padding: clamp(10px, 2vh, 20px) clamp(30px, 5vw, 60px);
    background: linear-gradient(135deg, #ff9d00 0%, #ff5e00 100%);
    color: white;
    font-size: clamp(18px, min(3vh, 3vw), 32px);
    font-weight: bold;
    border-radius: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 20px rgba(255, 94, 0, 0.5), inset 0 0 10px rgba(255, 255, 255, 0.2);
    animation: breathing 2s infinite ease-in-out;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.start-button:hover {
    transform: scale(1.1);
    filter: brightness(1.3);
}

.start-button::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -100%;
    width: 50%;
    height: 200%;
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(30deg);
    animation: shine 3s infinite;
}

.hidden-element {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}