:root {
    color-scheme: light;
    --brand-red: #ec3347;
    --brand-red-deep: #d91f37;
    --ink: #202432;
    --muted: #72798a;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 12% 12%, rgba(255, 116, 139, .16), transparent 24%),
        radial-gradient(circle at 88% 40%, rgba(255, 98, 126, .12), transparent 25%),
        linear-gradient(180deg, #fff 0%, #fff9fa 74%, #fff 100%);
}

button,
a {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

.h5-download {
    width: min(100%, 620px);
    min-height: 100svh;
    margin: 0 auto;
    padding:
        max(28px, env(safe-area-inset-top))
        clamp(18px, 5vw, 34px)
        max(28px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hero {
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero h1 {
    margin: 0;
    color: var(--brand-red);
    font-size: clamp(31px, 8.2vw, 52px);
    line-height: 1.16;
    letter-spacing: .02em;
}

.hero h1 strong {
    font-weight: 800;
    white-space: nowrap;
}

.hero p {
    margin: 14px 0 0;
    color: #303441;
    font-size: clamp(16px, 4.2vw, 24px);
    line-height: 1.45;
    letter-spacing: .08em;
}

.carousel {
    position: relative;
    width: 100%;
    height: clamp(390px, 58svh, 590px);
    min-height: 390px;
    margin: clamp(14px, 3svh, 30px) auto 8px;
    touch-action: pan-y;
}

.carousel::before {
    content: "";
    position: absolute;
    inset: 9% 3% 4%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(244, 68, 96, .13), rgba(255, 255, 255, 0) 68%);
    filter: blur(10px);
    pointer-events: none;
}

.carousel-card {
    position: absolute;
    top: 50%;
    left: 50%;
    width: clamp(178px, 48vw, 258px);
    height: auto;
    aspect-ratio: 1122 / 2442;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: clamp(22px, 6vw, 36px);
    background: #f6f7fb;
    box-shadow: 0 22px 48px rgba(76, 24, 36, .22);
    transform-origin: center;
    transition: transform .48s ease, opacity .48s ease, filter .48s ease;
    cursor: pointer;
}

.carousel-card img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-card[data-position="front"] {
    z-index: 3;
    opacity: 1;
    filter: none;
    transform: translate(-50%, -50%) scale(1);
    cursor: default;
}

.carousel-card[data-position="left"] {
    z-index: 2;
    opacity: .82;
    filter: saturate(.84) brightness(.96);
    transform: translate(-105%, -50%) scale(.84);
}

.carousel-card[data-position="right"] {
    z-index: 2;
    opacity: .82;
    filter: saturate(.84) brightness(.96);
    transform: translate(5%, -50%) scale(.84);
}

.carousel-card:focus-visible {
    outline: 3px solid var(--brand-red);
    outline-offset: 4px;
}

.carousel-dots {
    position: absolute;
    z-index: 5;
    right: 0;
    bottom: 2px;
    left: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(236, 51, 71, .25);
}

.carousel-dot[aria-current="true"] {
    width: 24px;
    background: var(--brand-red);
}

.download-panel {
    position: relative;
    z-index: 2;
    display: grid;
    justify-items: center;
    margin-top: auto;
    padding-top: 12px;
    text-align: center;
}

.app-logo {
    display: block;
    width: clamp(76px, 20vw, 112px);
    aspect-ratio: 1;
    object-fit: contain;
    filter: drop-shadow(0 12px 18px rgba(98, 13, 33, .18));
}

.download-button {
    width: min(100%, 500px);
    min-height: 66px;
    margin-top: 22px;
    padding: 14px 30px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, #ff566f, var(--brand-red-deep));
    box-shadow: 0 16px 30px rgba(223, 31, 57, .25);
    font-size: clamp(20px, 5.4vw, 28px);
    font-weight: 700;
    letter-spacing: .12em;
    cursor: pointer;
    transition: transform .2s ease, opacity .2s ease;
}

.download-button:active:not(:disabled) {
    transform: scale(.985);
}

.download-button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.download-status,
.browser-tip {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.browser-tip {
    width: min(100%, 500px);
    padding: 10px 14px;
    border-radius: 12px;
    color: #8b4c20;
    background: #fff4e7;
}

.device-modal {
    display: none;
    position: fixed;
    z-index: 100;
    inset: 0;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(19, 22, 35, .64);
}

.device-modal.open {
    display: flex;
}

.device-modal-card {
    width: min(100%, 420px);
    padding: 28px 24px 22px;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
    text-align: center;
}

.device-modal-card h2 {
    margin: 0;
    color: var(--brand-red-deep);
    font-size: 23px;
}

.device-modal-card p {
    margin: 15px 0 0;
    color: #515868;
    font-size: 16px;
    line-height: 1.75;
}

.device-modal-card a {
    color: #164ed8;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.modal-close {
    width: 100%;
    min-height: 46px;
    margin-top: 22px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: var(--brand-red);
    font-weight: 700;
    cursor: pointer;
}

@media (max-height: 760px) {
    .h5-download {
        min-height: 760px;
    }

    .carousel {
        height: 410px;
    }
}

@media (max-width: 360px) {
    .h5-download {
        padding-inline: 14px;
    }

    .hero h1 {
        font-size: 29px;
    }

    .carousel-card {
        width: 172px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .carousel-card,
    .download-button {
        transition: none;
    }
}
