*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family:
        Arial,
        "Microsoft YaHei",
        "PingFang SC",
        sans-serif;

    color: #333;
    background-color: #000;
    overflow-x: hidden;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    /* PC 端背景：使用 fixed 保持视口固定 */
    background:
        #000
        url("../media/pc5.webp")
        center center / cover
        no-repeat
        fixed;
}

body,
button,
input,
textarea,
select {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    display: block;
    max-width: 100%;
    border: 0;
    /* 优化图片在高倍屏与缩放时的清晰度与锯齿问题 */
    image-rendering: -webkit-optimize-contrast;
}

a {
    color: inherit;
    text-decoration: none;
}

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

.main {
    position: relative;

    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 40px 20px 80px;

    /* 独立层叠上下文，隔离遮罩和内容 */
    isolation: isolate;
}

.main::before {
    content: "";

    position: absolute;
    inset: 0;

    background: rgba(0, 0, 0, 0.28);

    z-index: -1;

    pointer-events: none;
}

.logo {
    width: 100%;
    max-width: 400px;

    display: flex;
    justify-content: center;

    padding-bottom: 30px;
}

.logo img {
    width: 180px;
    height: auto;
    object-fit: contain;
}

.content {
    position: relative;

    width: 100%;
    max-width: 400px;

    padding: 35px 40px;

    background: rgba(255, 255, 255, 0.98);

    border-radius: 12px;

    box-shadow:
        0 10px 35px rgba(0, 0, 0, 0.28);

    z-index: 10;

    text-align: center;
}

.progress {
    position: relative;

    width: 200px;
    height: 200px;

    margin: 0 auto 20px;
}

.progress-svg {
    display: block;

    width: 200px;
    height: 200px;

    transform: rotate(-90deg);
}

.progress circle {
    fill: none;
    stroke-width: 10;
}

.circle-bg {
    stroke: #e9e9e9;
}

.circle {
    stroke: #02B95E;

    stroke-dasharray: 553;
    stroke-dashoffset: 0;

    stroke-linecap: round;

    transition:
        stroke-dashoffset 0.25s ease;
}

.percentage {
    position: absolute;

    top: 50%;
    left: 50%;

    transform: translate(-50%, -50%);

    color: #02B95E;

    font-size: 34px;
    font-weight: 700;

    line-height: 1;
}

.continue_btn {
    width: 100%;

    min-height: 53px;

    margin: 0 auto 18px;
}

.continue_btn a {
    display: block;

    width: 100%;
    height: 53px;

    background:
        url("../imgs/continue_btn.png")
        center center / 100% 100%
        no-repeat;

    border: 0;
    outline: 0;

    cursor: pointer;

    -webkit-tap-highlight-color: transparent;

    transition:
        transform 0.12s ease,
        opacity 0.12s ease;
}

.continue_btn a:hover {
    opacity: 0.92;
}

.continue_btn a:active {
    transform: scale(0.98);
}

.help {
    margin-top: 5px;

    color: #ff0000;

    font-size: 16px;
    font-weight: 700;

    line-height: 1.6;
}

.tips {
    margin-top: 5px;

    color: #888;

    font-size: 13px;

    line-height: 1.6;
}

.domains {
    display: flex;
    flex-direction: column;

    gap: 10px;

    width: 100%;

    margin-top: 18px;
}

.domains a {
    display: block;

    width: 100%;
    height: 53px;

    background-position: center;
    background-size: 100% 100%;
    background-repeat: no-repeat;

    border: 0;
    outline: 0;

    cursor: pointer;

    -webkit-tap-highlight-color: transparent;

    transition:
        transform 0.12s ease,
        opacity 0.12s ease;
}

.domains a:hover {
    opacity: 0.92;
}

.domains a:active {
    transform: scale(0.98);
}

.domains a.ios,
.domains a.ios_btn {
    background-image:
        url("../imgs/ios_btn.png");
}

.domains a.android,
.domains a.android_btn {
    background-image:
        url("../imgs/android_btn.png");
}

.corp {
    position: fixed;

    left: 50%;
    bottom: 60px;

    transform: translateX(-50%);

    width: auto;
    max-width: calc(100% - 40px);

    z-index: 5;

    padding: 8px 16px;

    background: rgba(0, 0, 0, 0.32);

    border-radius: 8px;

    pointer-events: none;
}

.corp img {
    width: auto;
    max-width: 100%;
    height: auto;
}

.corp-h5 {
    display: none;
}

html.js-mobile .corp {
    display: none;
}

html.js-mobile .corp-h5 {
    display: flex;
}

html.js-pc .corp {
    display: block;
}

html.js-pc .corp-h5 {
    display: none;
}

/* 矮屏 PC 适配 */
@media (min-width: 769px) and (max-height: 750px) {
    .main {
        justify-content: flex-start;

        padding-top: 30px;
        padding-bottom: 110px;
    }

    .logo {
        padding-bottom: 20px;
    }

    .content {
        padding-top: 25px;
        padding-bottom: 25px;
    }

    .progress {
        margin-bottom: 15px;
    }

    .corp {
        bottom: 30px;
    }
}

/* 移动端 (H5) 响应式 */
@media (max-width: 768px) {
    body {
        /* 移动端降级为 scroll 滚动，修复 iOS Safari 下 background-attachment: fixed 的卡顿与放大 Bug */
        background:
            #000
            url("../imgs/bg.webp")
            center center / cover
            no-repeat
            scroll;

        overflow-x: hidden;
    }

    .main {
        min-height: 100vh;
        min-height: 100dvh;

        justify-content: center;

        padding:
            30px 5%
            calc(80px + env(safe-area-inset-bottom));
    }

    .logo {
        display: none;
    }

    .content {
        width: 90%;
        max-width: 360px;

        padding: 30px 20px;

        border-radius: 12px;

        box-shadow:
            0 8px 28px rgba(0, 0, 0, 0.25);
    }

    .progress {
        width: 45vw;
        height: 45vw;

        max-width: 180px;
        max-height: 180px;

        margin-bottom: 20px;
    }

    .progress-svg {
        width: 100%;
        height: 100%;
    }

    .percentage {
        font-size: 28px;
    }

    .continue_btn {
        min-height: 13vw;

        margin-bottom: 15px;
    }

    .continue_btn a {
        height: 13vw;
        max-height: 55px;
    }

    .help {
        font-size: 15px;
    }

    .tips {
        font-size: 12px;
    }

    .domains {
        gap: 8px;

        margin-top: 15px;
    }

    .domains a {
        height: 13vw;
        max-height: 55px;
    }

    .corp {
        display: none;
    }

    .corp-h5 {
        position: fixed;

        left: 50%;
        bottom:
            calc(15px + env(safe-area-inset-bottom));

        transform: translateX(-50%);

        width: 90%;
        max-width: 360px;

        display: flex;

        align-items: center;
        justify-content: center;

        gap: 10px;

        z-index: 20;

        pointer-events: none;
    }

    .corp-h5 img {
        display: block;

        width: auto;
        height: 42px;

        max-width: 80px;

        object-fit: contain;
        object-position: center;

        flex: 0 1 auto;
    }
}

/* 矮屏手机适配 */
@media (max-width: 768px) and (max-height: 650px) {
    .main {
        justify-content: flex-start;

        padding-top: 20px;
        padding-bottom: 70px;
    }

    .content {
        padding-top: 20px;
        padding-bottom: 20px;
    }

    .progress {
        width: 38vw;
        height: 38vw;

        max-width: 150px;
        max-height: 150px;

        margin-bottom: 12px;
    }

    .percentage {
        font-size: 24px;
    }

    .continue_btn {
        margin-bottom: 10px;
    }

    .help {
        font-size: 14px;
    }

    .tips {
        font-size: 11px;
    }

    .domains {
        margin-top: 10px;
        gap: 6px;
    }

    .corp-h5 {
        /* 修复原代码中少括号的语法错误 */
        bottom:
            calc(8px + env(safe-area-inset-bottom));
    }

    .corp-h5 img {
        height: 36px;
        max-width: 72px;
    }
}

/* 超窄屏手机 (如 iPhone SE / SE2) 适配 */
@media (max-width: 360px) {
    .content {
        width: 94%;

        padding-left: 16px;
        padding-right: 16px;
    }

    .help {
        font-size: 14px;
    }

    .tips {
        font-size: 11px;
    }

    .corp-h5 {
        gap: 7px;
    }

    .corp-h5 img {
        height: 34px;
        max-width: 68px;
    }
}

/* 用户开启“减弱动画”系统的无障碍兼容 */
@media (prefers-reduced-motion: reduce) {
    .circle,
    .continue_btn a,
    .domains a {
        transition: none;
    }
}