:root {
    --safe-area-inset-top: env(safe-area-inset-top);
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow-x: hidden;
}

.official-container {
    width: 100vw;
    max-width: 450px;
    max-height: 2828px;
    margin: 0 auto;
    min-height: 100vh;
    padding-top: calc(var(--safe-area-inset-top, 0px));
    /* 防止页面下滑出现空白 */
    overscroll-behavior-y: contain;
    /* 防止触摸事件冲突 */
    touch-action: pan-y;
}

.page1 {
    width: 100%;
    height: 198.13vw;
    max-height: 892px;
    background: url('./p1.png') no-repeat;
    background-size: 100% 100%;
    position: relative;
}

.page2 {
    width: 100%;
    height: 122.666vw;
    max-height: 551px;
    background: url('./p2.png') no-repeat;
    background-size: 100% 100%;
}

.page3 {
    width: 100%;
    height: 113.33vw;
    max-height: 509px;
    background: url('./p3.png') no-repeat;
    background-size: 100% 100%;
}

.page4 {
    width: 100%;
    height: 161.6vw;
    max-height: 727px;
    background: url('./p4.png') no-repeat;
    background-size: 100% 100%;
}

/* 下载卡片样式（全新布局，按新图） */
.flex-box1 {
    position: absolute;
    bottom: 3%;
    width: 100%;
    height: 57.86vw;
    z-index: 1000;
    transition: all 0.5s ease;
    opacity: 1;
    visibility: visible;
    background: url('./download.png') no-repeat;
    background-size: 100% 100%;
    border-radius: 2.4vw;
    padding: 4vw 5vw;
}

.flex-box1.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 0) scale(0.94);
}

.flex-box1 .dl-card{
   width: 100%;
   height: 35.33vw;
   display: flex;
   justify-content: center;
   align-items: center;
   margin-top: 12.8vw;
   gap:5.2vw;
}


/* 左侧二维码区域 */
.qr-area {
    width: 29.46vw;
    max-width: 221px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5vw;
    border: 2px solid #FF9251;
    border-radius: 5px;
}

.qr-box {
    width: 24vw;
    height: 24vw;
    canvas{
        width: 100% !important;
        height: 100% !important;
    }
    img{
        display: block;
        width: 100% !important;
        height: 100% !important;
    }
   
}


.qr-caption {
    font-size: 3vw;
    color: #212121;
    font-family: Source Han Sans SC;
}

/* 右侧按钮组 */
.btn-list {
    width: 39.33vw;
    max-width: 154px;
    display: flex;
    flex-direction: column;
    gap: 5.46vw;
}

.dl-btn {
    width: 100%;
    height: 13.2vw;
    max-height: 52px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 2.6vw;
    padding: 2.4vw;
    cursor: pointer;
    border: 2px solid #FF9251;
    position: relative;
}


.dl-btn img {
    width: 8.53vw;
    height: 8.53vw;
    object-fit: contain;
    flex-shrink: 0;
}

.dl-btn span {
    font-size: 4vw;
    color: #212121;
    font-weight: 500;
    font-family: Source Han Sans SC;
}

.badge {
    background: #D52810;
    color: #fff;
    font-size: 3vw;
    border-radius: 24px 24px 24px 6px;
    padding: 1vw 1.5vw;
    position: absolute;
    border: 1px solid #FFFFFF;
    top: -29%;
    right: 0;
}

/* flex-box2 横向布局样式 */
.flex-box2 {
    position: fixed;
    bottom: 2%;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.5s ease;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.flex-box2.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-100%);
}

.horizontal-card {
    width: 91.44vw;
    background: #fff;
    margin: 0 auto;
    border-radius: 20px;
    padding: 3.2vw;
    display: flex;
    align-items: center;
    gap: 4vw;
}

/* 横向应用图标 */
.app-icon-horizontal {
    width: 16.6666vw;
    height: 16.6666vw;
    flex-shrink: 0;
}

.app-icon-horizontal img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 右侧内容区域 */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3vw;
}

.app-name-horizontal {
    font-size: 4.5vw;
    font-weight: bold;
    color: #1f2937;
    text-align: left;
}

.feature-tags-horizontal {
    display: flex;
    gap: 1.5vw;
}

.tag-horizontal {
    background: #f7a62d;
    color: #fff;
    padding: 1vw 2vw;
    border-radius: 1.5vw;
    font-size: 2.5vw;
    font-weight: 500;
}

/* 横向下载按钮 */
.download-btn-horizontal {
    background: #d52810;
    color: #fff;
    padding: 2vw 4vw;
    border-radius: 25px;
    font-size: 3.5vw;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.download-btn-horizontal:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

.download-btn-horizontal:active {
    transform: translateY(0);
}

/* Footer 样式 */
.footer {
    background: #f8f9fa;
    padding: 6vw 4vw;
    border-top: 1px solid #e9ecef;
}

.footer-line {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 3vw;
    gap: 4vw;
    flex-wrap: wrap;
}

.footer-line:last-child {
    margin-bottom: 0;
}

.info-item {
    font-size: 2.5vw;
    color: #6c757d;
    white-space: nowrap;
}

.copyright {
    font-size: 2.5vw;
    color: #6c757d;
    text-align: center;
}

.link-item {
    display: flex;
    align-items: center;
    gap: 1vw;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 2vw;
}

.link-icon {
    width: 2.6vw;
    height: 2.6vw;
    display: flex;
    align-items: center;
    justify-content: center;
}

.link-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.link-text {
    font-size: 2.5vw;
    color: #6c757d;
    white-space: nowrap;
    text-align: center;
}

/* Toast 样式 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 3vw 6vw;
    border-radius: 2vw;
    font-size: 3.5vw;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.toast.show {
    opacity: 1;
}

/* PC端适配：当视口>=450px时，将所有以vw为单位的尺寸锚定在390px基准上 */
@media (min-width: 450px) {
    .official-container {
        max-width: 450px;
        margin: 0 auto;
    }
    .qr-caption {
        font-size: 12px;
        color: #212121;
        font-family: Source Han Sans SC;
    }

    /* 顶部四屏高度上限已设置max-height，无需改动 */

    .flex-box1 {
        width: 450px;
        height: 260px;               /* 57.86vw -> 260px */
        border-radius: 11px;          /* 2.4vw -> 11px */
        padding: 18px 23px;           /* 4vw 5vw -> 18px 23px */
        bottom: 10px;
    }

    .flex-box1 .dl-card {
        height: 159px;               /* 35.33vw -> 159px */
        margin-top: 58px;            /* 12.8vw -> 58px */
        gap: 23px;                   /* 5.2vw -> 23px */
    }

    .qr-area {
        gap: 7px;                    /* 1.5vw -> 7px */
        width: 133px;                /* 29.46vw -> 133px，仍受 max-width 约束 */
    }

    .qr-box {
        width: 108px;                 /* 24vw -> 108px */
        height: 108px;
    }

    .btn-list {
        width: 154px;                /* 不超过既有 max-width: 154px */
        gap: 23px;                   /* 5.46vw -> 23px */
    }

    .dl-btn {
        height: 59px;                /* 13.2vw -> 59px */
        gap: 6px;                   /* 2.6vw -> 12px */
        padding: 11px;               /* 2.4vw -> 11px */
        border-radius: 25px;         /* 与视觉保持 */
    }

    .dl-btn img {
        width: 38px;                 /* 8.53vw -> 38px */
        height: 38px;
    }

    .dl-btn span {
        font-size: 16px;             /* 4vw -> 18px */
    }

    .badge {
        font-size: 12px;             /* 3vw -> 14px */
        padding: 5px 7px;            /* 1vw 1.5vw -> 5px 7px */
    }

    /* 横向条卡片区域 */
    .horizontal-card {
        max-width: 411px;            /* 91.44vw -> 411px */
        padding: 14px;               /* 3.2vw -> 14px */
        gap: 18px;                   /* 4vw -> 18px */
    }

    .app-icon-horizontal {
        width: 75px;                 /* 16.6666vw -> 75px */
        height: 75px;
    }

    .content-area {
        gap: 14px;                   /* 3vw -> 14px */
    }

    .app-name-horizontal {
        font-size: 20px;             /* 4.5vw -> 20px */
    }

    .tag-horizontal {
        font-size: 11px;             /* 2.5vw -> 11px */
        padding: 5px 9px;            /* 1vw 2vw -> 5px 9px */
        border-radius: 7px;          /* 1.5vw -> 7px */
    }

    .download-btn-horizontal {
        padding: 9px 18px;           /* 2vw 4vw -> 9px 18px */
        border-radius: 25px;
        font-size: 16px;             /* 3.5vw -> 16px */
    }
    
    .feature-tags-horizontal {
        display: flex;
        gap: 7px;                    /* 1.5vw -> 7px */
    }

    /* Footer 与 Toast 文案尺寸锚定 */
    .footer {
        padding: 27px 18px;          /* 6vw 4vw -> 27px 18px */
    }

    .footer-line {
        margin-bottom: 14px;         /* 3vw -> 14px */
        gap: 18px;                   /* 4vw -> 18px */
    }

    .info-item,
    .copyright,
    .link-text {
        font-size: 11px;             /* 2.5vw -> 11px */
    }

    .link-icon {
        width: 12px;                 /* 2.6vw -> 12px */
        height: 12px;
    }

    .toast {
        padding: 14px 27px;          /* 3vw 6vw -> 14px 27px */
        border-radius: 9px;          /* 2vw -> 9px */
        font-size: 16px;             /* 3.5vw -> 16px */
    }
}