/*===================== 清除浏览器默认 =====================*/

* {
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    font-size: 100%;
    vertical-align: baseline;
    background: transparent;
    box-sizing: border-box;
    touch-action: pan-y;
    -webkit-tap-highlight-color: transparent;
}

body {
    line-height: 1.2;
    background-color: #1a1a1a;
    font-family: Tahoma, Microsoft YaHei, sans-serif, Arial, Roboto, Helvetica;
    font-size: 12px;
}

article,
aside,
canvas,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section,
summary {
    display: block;
}

ul,
li {
    list-style: none;
}

blockquote,
q {
    quotes: none;
}

blockquote:before,
blockquote:after,
q:before,
q:after {
    content: '';
    content: none;
}

a {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    vertical-align: baseline;
    background: transparent;
    text-decoration: none;
    color: #ffffff;
}

ins {
    background-color: #ff9;
    color: #000;
    text-decoration: none;
}

mark {
    background-color: #ff9;
    color: #000;
    font-style: italic;
    font-weight: bold;
}

del {
    text-decoration: line-through;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

hr {
    display: block;
    height: 1px;
    margin: 1em 0;
    padding: 0;
}

input,
select {
    vertical-align: middle;
}

button {
    cursor: pointer;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

#app {
    width: 100%;
    height: 100%;
    max-width: 450px;
    margin: 0 auto;
    background: #4B40D9;
    overflow: hidden;
}

input::placeholder,
textarea::placeholder {
    color: rgba(255, 255, 255, .4);
    -webkit-text-fill-color: rgba(255, 255, 255, .4);
    font-weight: normal;
}

input:-webkit-autofill {
    -webkit-text-fill-color: #ffffff;
    background-color: transparent !important;
    background-image: none !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* 共用全局样式 */
@media (min-width: 320px) {
    html {
        font-size: 32px;
    }
}

@media (min-width: 360px) {
    html {
        font-size: 36px;
    }
}

@media (min-width: 375px) {
    html {
        font-size: 37.5px;
    }
}

/*
 * 页面固定在可视区域内。
 * 100svh 用于避免 Android 浏览器地址栏导致的 100vh 偏大；
 * 100dvh 用于地址栏收起后实时更新高度。
 */
.app_content {
    width: 100%;
    height: 100vh;
    height: 100svh;
    min-height: 100vh;
    min-height: 100svh;
    padding: 24px 0 14px;
    padding: clamp(14px, 3.4svh, 30px) 0 clamp(10px, 1.8svh, 18px);
    padding-top: max(clamp(14px, 3.4svh, 30px), env(safe-area-inset-top));
    padding-bottom: max(clamp(10px, 1.8svh, 18px), env(safe-area-inset-bottom));
    background: url(../img/bg.jpg) no-repeat center top, #4B40D9;
    background-size: cover;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@supports (height: 100dvh) {
    .app_content {
        height: 100dvh;
        min-height: 100dvh;
    }
}

.top_bg {
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.app_icon {
    width: 100%;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #fff;
    position: relative;
    z-index: 1;
}

.app_icon img {
    width: 76px;
    width: clamp(56px, min(18vw, 10.8svh), 90px);
    height: auto;
    display: block;
}

.app_icon p {
    font-size: 14px;
    font-size: clamp(13px, 3.7vw, 16px);
    line-height: 1.2;
    margin-top: clamp(5px, 0.9svh, 9px);
}

.slogan {
    width: 100%;
    flex: 0 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    margin: 12px 0 7px;
    margin: clamp(10px, 2svh, 18px) 0 clamp(5px, 1svh, 10px);
    padding: 0 20px;
    padding: 0 clamp(14px, 8vw, 20px);
    color: #fff;
    position: relative;
    z-index: 1;
}

.slogan h1 {
    width: 100%;
    font-size: 34px;
    font-size: clamp(24px, min(9.5vw, 5.1svh), 39px);
    line-height: 1.16;
    overflow-wrap: anywhere;
}

.slogan p {
    width: 100%;
    font-size: 16px;
    font-size: clamp(13px, min(4vw, 2.35svh), 18px);
    line-height: 1.25;
    margin-top: clamp(6px, 1svh, 10px);
}

.app_banner {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    margin-top: 7px;
    margin-top: clamp(5px, 1svh, 10px);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.swiper-container {
    width: 100%;
    height: 100%;
    max-width: 450px;
    margin: 0 auto;
    overflow: visible;
}

.swiper-wrapper {
    height: 100%;
    align-items: center;
}

.swiper-slide {
    height: 100%;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: .94;
    -webkit-transform: translate3d(0, 0, 0) scale(.74);
    transform: translate3d(0, 0, 0) scale(.74);
    -webkit-transition: -webkit-transform 300ms ease, opacity 300ms ease;
    transition: transform 300ms ease, opacity 300ms ease;
    will-change: transform;
}

/*
 * Swiper 3.4.2 会在 Android 上添加 .swiper-container-android，
 * 其内置选择器优先级高于普通 .swiper-slide，并把 scale 覆盖成 translate3d。
 * 这里使用同级/更高优先级强制保留两侧缩小效果。
 */
.swiper-container-android .swiper-slide {
    -webkit-transform: translate3d(0, 0, 0) scale(.74);
    transform: translate3d(0, 0, 0) scale(.74);
}

.swiper-slide-active,
.swiper-slide-duplicate-active,
.swiper-container-android .swiper-slide-active,
.swiper-container-android .swiper-slide-duplicate-active {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0) scale(1);
    transform: translate3d(0, 0, 0) scale(1);
}

.swiper-slide img {
    width: auto;
    max-width: 50vw;
    max-width: min(50vw, 200px);
    max-height: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    border-radius: 14px;
    border-radius: clamp(12px, 3.2vw, 16px);
}

.swiper-pagination {
    font-size: .4rem;
}

.swiper-button-prev,
.swiper-button-next {
    width: 28px;
    height: 42px;
    margin-top: -21px;
    background-size: 13px auto;
    opacity: .95;
}

.swiper-button-prev {
    left: 24px;
    left: clamp(18px, 8vw, 36px);
    color: #fff;
    background-image: url(../img/arrow_left.svg);
}

.swiper-button-next {
    right: 24px;
    right: clamp(18px, 8vw, 36px);
    color: #fff;
    background-image: url(../img/arrow_right.svg);
}

.app_btn {
    width: 100%;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    margin-top: clamp(8px, 1.6svh, 15px);
    position: relative;
    z-index: 2;
    margin-bottom: 20px;
}

.app_btn a,
.app_btn img {
    display: block;
}

.app_btn img {
    width: 180px;
    width: clamp(145px, min(51vw, 24svh), 191px);
    height: auto;
    transform-origin: center;
    animation: receive 0.8s linear infinite;
}

@-webkit-keyframes receive {
    0%, 100% {
        -webkit-transform: scale(1.06);
        transform: scale(1.06);
    }
    50% {
        -webkit-transform: scale(1);
        transform: scale(1);
    }
}

@keyframes receive {
    0%, 100% {
        -webkit-transform: scale(1.06);
        transform: scale(1.06);
    }
    50% {
        -webkit-transform: scale(1);
        transform: scale(1);
    }
}

/* 低高度设备：进一步压缩头部和文案，优先保证轮播与按钮完整可见 */
@media (max-height: 667px) {
    .app_content {
        padding-top: 12px;
        padding-bottom: 8px;
        padding-top: max(12px, env(safe-area-inset-top));
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }

    .app_icon img {
        width: clamp(50px, min(17vw, 9.5svh), 68px);
    }

    .app_icon p {
        font-size: 12px;
        margin-top: 4px;
    }

    .slogan {
        margin-top: 7px;
        margin-bottom: 3px;
    }

    .slogan h1 {
        font-size: clamp(22px, min(8.8vw, 4.8svh), 31px);
        line-height: 1.12;
    }

    .slogan p {
        font-size: clamp(12px, min(3.8vw, 2.2svh), 15px);
        line-height: 1.18;
        margin-top: 5px;
    }

    .app_banner {
        margin-top: 3px;
    }

    .app_btn {
        margin-top: 6px;
    }

    .app_btn img {
        width: clamp(132px, min(47vw, 22svh), 165px);
    }
}

/* 极窄屏设备 */
@media (max-width: 340px) {
    .slogan {
        padding-left: 12px;
        padding-right: 12px;
    }

    .swiper-slide img {
        max-width: 48vw;
    }

    .swiper-button-prev {
        left: 12px;
    }

    .swiper-button-next {
        right: 12px;
    }
}

/* 横屏时采用紧凑双区域布局，避免按钮掉出屏幕 */
@media (orientation: landscape) and (max-height: 520px) {
    .app_content {
        display: grid;
        grid-template-columns: 36% 64%;
        grid-template-rows: auto 1fr auto;
        padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    }

    .top_bg {
        grid-column: 1 / -1;
    }

    .app_icon {
        grid-column: 1;
        grid-row: 1;
    }

    .app_icon img {
        width: min(14vw, 18svh, 64px);
    }

    .slogan {
        grid-column: 1;
        grid-row: 2;
        align-self: center;
        margin: 4px 0;
        padding: 0 8px;
    }

    .slogan h1 {
        font-size: clamp(20px, 4.5vw, 30px);
    }

    .slogan p {
        font-size: clamp(11px, 2vw, 14px);
    }

    .app_banner {
        grid-column: 2;
        grid-row: 1 / 4;
        margin: 0;
    }

    .app_btn {
        grid-column: 1;
        grid-row: 3;
        margin: 4px 0 0;
    }

    .app_btn img {
        width: min(26vw, 145px);
    }

    .swiper-slide img {
        max-width: 27vw;
        max-width: min(27vw, 170px);
    }
}
