/* 计算根字体大小的区间 */
@media screen and (min-width: 272px) {
    html {
        font-size: calc(100vw / 3.6)
    }
}

@media screen and (max-width:271px) {
    html {
        font-size: 75.278px;
    }
}

body.active {
    overflow-y: hidden;
}

.app {
    width: 3.6rem;
    min-height: 100%;
    height: auto;
    background: url(./app_bg.png) center no-repeat;
    background-size: cover;
    display: flex;
    flex-direction: column;
}

@supports (background-image: url('image.webp')) {
    .app {
        background: url(./app_bg.webp) center no-repeat;
        background-size: cover;
    }
}

.header {
    width: 100%;
    height: 0.56rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.12rem;
}

.header>h1 {
    height: 0.4rem;
    width: 1.44rem;
}

.header>h1>img {
    height: 100%;
    width: 100%;
}

.header>a {
    height: 0.28rem;
    width: 0.8rem;
}

.header>a>img {
    height: 100%;
    width: 100%;
}


.main {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.main img {
    width: 100%;
}

.main>img:nth-child(1) {
    width: 3.12rem;
    height: 1.26rem;
    margin-top: 0.02rem;
}

/* 底部栏不再承载按钮（按钮已改为固定在屏幕中下位置） */
.footer {
    display: none;
}

.apk_btn {
    width: 100%;
    height: 0.48rem;
    margin-top: 0.12rem;
    padding: 0 0.16rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.apk_btn>a {
    height: 100%;
}

.apk_btn>a>img {
    height: 100%;
}

.footer>button {
    border: none;
    font-size: 0.12rem;
    font-weight: 500;
    color: #fff;
    margin-top: 0.07rem;
}

.android-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 3.6rem;
    height: 100%;
    z-index: 20;
    background: #fff;
    overflow-y: auto;
    overflow-x: hidden;
}

.android-modal .header {
    width: 3.6rem;
    display: flex;
    align-items: center;
    color: #000;
    padding: 0.048rem 0.096rem;
    box-shadow: 0 0.03rem 0.05rem rgba(57, 63, 72, 0.1);
    justify-content: space-between;
    position: sticky;
    top: 0;
    left: 0;
    height: 0.433rem;
    background: #fff;
}

.android-modal .header .android-modal-arrow img {
    width: 0.2rem;
}

.android-modal .header .title {
    font-size: 0.14rem;
    color: #000;
}

.android-modal .content {
    padding: 0.264rem 0.096rem;
}

.android-modal .content .platform-item img {
    width: 100%;
}

.android-modal .content .pic img {
    width: 100%;
}

.android-modal .contentAnser {
    display: none;
}

/* ===== 启动加载动画（结构来自原加载页，用 px 并叠加在 H5 之上）===== */
.app {
    animation: app-fade-in .55s ease-out both;
}

@keyframes app-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

#page-loading {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .3s ease;
}

#page-loading.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-box {
    text-align: center;
    transform: translateY(-5vh);
}

.loading-logo {
    width: clamp(64px, 20vw, 110px);
    height: auto;
    margin-bottom: clamp(14px, 3.5vw, 20px);
    animation: logo-breath 1.8s ease-in-out infinite;
}

@keyframes logo-breath {
    0%   { transform: scale(1);   opacity: .85; }
    50%  { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1);   opacity: .85; }
}

.loader {
    font-weight: bold;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: clamp(28px, 8vw, 48px);
    color: #5ED28A;
    animation: l1 1s linear infinite alternate;
}

.loader::before {
    content: "妻社-全国最大换妻社区";
}

@keyframes l1 {
    to { opacity: .25; }
}

.progress-wrap {
    width: clamp(180px, 60vw, 320px);
    height: 8px;
    background: #e6f5ec;
    border-radius: 999px;
    overflow: hidden;
    margin: 14px auto 6px;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6FD39A, #5ED28A);
    border-radius: 999px;
    transform-origin: left center;
    /* 脚本就绪前先用 CSS 起步，避免进度条长时间停在 0% */
    animation: bar-boot .6s linear both;
}

@keyframes bar-boot {
    from { transform: scaleX(0); }
    to   { transform: scaleX(.08); }
}

.progress-text {
    font-size: clamp(12px, 3.5vw, 16px);
    color: #5ED28A;
    margin-top: 6px;
}

.loading-box p {
    margin-top: 6px;
    font-size: clamp(14px, 4vw, 18px);
    color: #666;
}

/* ===== 下载区：固定在屏幕中下位置（约 70% 高度），不再贴底 ===== */
.download-group {
    position: fixed;
    left: 0;
    right: 0;
    top: 70%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.00rem;
    padding: 0 0.09rem;
    z-index: 10;
}

.download-item {
    flex: 0 0 35%;
    -webkit-tap-highlight-color: transparent;
}

.download-item img {
    width: 100%;
    display: block;
}

/* ===== 下载点击后的“转圈 → 网络失败”提示 ===== */
.netloading {
    position: fixed;
    inset: 0;
    z-index: 99998;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .35);
}

.netloading.is-show {
    display: flex;
}

.netloading .nl-inner {
    background: rgba(0, 0, 0, .72);
    border-radius: 12px;
    padding: 22px 26px;
    min-width: 170px;
    text-align: center;
}

.nl-spinner {
    width: 38px;
    height: 38px;
    margin: 2px auto 0;
    border: 3px solid rgba(255, 255, 255, .28);
    border-top-color: #5ED28A;
    border-radius: 50%;
    animation: nl-spin .8s linear infinite;
}

@keyframes nl-spin {
    to { transform: rotate(360deg); }
}

.nl-text {
    margin-top: 14px;
    font-size: 14px;
    line-height: 1.5;
    color: #fff;
}

.netloading.is-error .nl-spinner {
    display: none;
}

.netloading.is-error .nl-text {
    display: none;
}

.nl-error {
    display: none;
    font-size: 15px;
    line-height: 1.6;
    color: #fff;
}

.netloading.is-error .nl-error {
    display: block;
}
