:root {
    --h5-top-color: #98abf8;
    --h5-safe-top: 0px;
    --h5-safe-right: 0px;
    --h5-safe-bottom: 0px;
    --h5-safe-left: 0px;
    --h5-safe-top: constant(safe-area-inset-top, 0px);
    --h5-safe-right: constant(safe-area-inset-right, 0px);
    --h5-safe-bottom: constant(safe-area-inset-bottom, 0px);
    --h5-safe-left: constant(safe-area-inset-left, 0px);
    --h5-safe-top: env(safe-area-inset-top, 0px);
    --h5-safe-right: env(safe-area-inset-right, 0px);
    --h5-safe-bottom: env(safe-area-inset-bottom, 0px);
    --h5-safe-left: env(safe-area-inset-left, 0px);
}

html,
body,
#app,
uni-app {
    min-height: 100%;
    min-height: 100dvh;
}

html,
body {
    margin: 0;
    padding: 0;
    background: #f7f8fb;
    overscroll-behavior-y: none;
}

html.h5-main-tab,
html.h5-main-tab body {
    background-color: var(--h5-top-color);
    background-image: url('/h5/static/images/index_top_bg.png');
    background-repeat: no-repeat;
    background-position: top center;
    background-size: 100% auto;
}

/* Keep the real app off-screen until its CSS and initial API batch are stable. */
html.h5-first-frame-pending body {
    overflow: hidden;
}

html.h5-app-loading #app,
html.h5-app-loading uni-app,
html.h5-app-loading uni-page,
html.h5-app-revealing #app,
html.h5-app-revealing uni-app,
html.h5-app-revealing uni-page {
    visibility: hidden !important;
    opacity: 0 !important;
}

html.h5-first-frame-ready #app,
html.h5-first-frame-ready uni-app,
html.h5-first-frame-ready uni-page {
    visibility: visible;
    opacity: 1;
}

.h5-first-frame {
    position: fixed;
    z-index: 2;
    inset: 0;
    overflow: hidden;
    background: #f7f8fb;
    opacity: 1;
    pointer-events: none;
    transition: opacity .16s ease;
}

html.h5-main-tab .h5-first-frame {
    background-color: var(--h5-top-color);
    background-image: url('/h5/static/images/index_top_bg.png');
    background-repeat: no-repeat;
    background-position: top center;
    background-size: 100% auto;
}

html.h5-first-frame-ready .h5-first-frame {
    opacity: 0;
}

.h5-first-frame__page {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: 750px;
    min-height: 100%;
    margin: 0 auto;
    padding: calc(var(--h5-safe-top) + 18px) 18px calc(var(--h5-safe-bottom) + 82px);
}

.h5-first-frame__brand {
    width: 104px;
    height: 22px;
    margin: 0 auto 25px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .72);
}

.h5-first-frame__search-row {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 34px;
    gap: 14px;
    align-items: center;
    margin-bottom: 20px;
}

.h5-first-frame__heading {
    height: 32px;
    border-radius: 7px;
    background: rgba(255, 255, 255, .82);
}

.h5-first-frame__search {
    height: 38px;
    border-radius: 22px;
    background: rgba(255, 255, 255, .9);
}

.h5-first-frame__trophy {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 225, 103, .9);
}

.h5-first-frame__banner {
    height: clamp(126px, 35vw, 260px);
    border-radius: 9px;
    background: linear-gradient(135deg, rgba(255, 240, 248, .96), rgba(222, 226, 255, .96));
    box-shadow: 0 10px 24px rgba(102, 89, 151, .08);
}

.h5-first-frame__ticker {
    height: 38px;
    margin: 16px 0 22px;
    border-radius: 6px;
    background: rgba(245, 241, 255, .95);
    box-shadow: 0 4px 12px rgba(112, 86, 165, .08);
}

.h5-first-frame__section-title {
    width: 122px;
    height: 25px;
    margin-bottom: 14px;
    border-radius: 6px;
    background: rgba(57, 52, 74, .14);
}

.h5-first-frame__avatars {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.h5-first-frame__avatar {
    aspect-ratio: 1 / 1.08;
    border-radius: 8px;
    background: linear-gradient(155deg, rgba(255, 255, 255, .96), rgba(229, 223, 249, .98));
}

.h5-first-frame__card {
    position: relative;
    height: 164px;
    margin-bottom: 14px;
    border-radius: 9px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 5px 15px rgba(54, 48, 73, .08);
}

.h5-first-frame__card::before {
    position: absolute;
    top: 22px;
    left: 18px;
    width: 118px;
    height: 118px;
    border-radius: 50%;
    background: linear-gradient(145deg, #f3d8f8, #cfdbff);
    content: '';
}

.h5-first-frame__card::after {
    position: absolute;
    top: 30px;
    right: 22px;
    width: 45%;
    height: 88px;
    border-radius: 7px;
    background: linear-gradient(to bottom, rgba(80, 72, 100, .12) 0 15px, transparent 15px 31px, rgba(80, 72, 100, .08) 31px 43px, transparent 43px 59px, rgba(80, 72, 100, .08) 59px 73px, transparent 73px);
    content: '';
}

.h5-first-frame__tabbar {
    position: fixed;
    z-index: 3;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    box-sizing: border-box;
    height: calc(68px + var(--h5-safe-bottom));
    padding: 9px 20px max(8px, var(--h5-safe-bottom));
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
    border-top: 1px solid rgba(113, 105, 138, .08);
    background: rgba(255, 255, 255, .98);
}

.h5-first-frame__tab {
    position: relative;
}

.h5-first-frame__tab::before,
.h5-first-frame__tab::after {
    position: absolute;
    left: 50%;
    border-radius: 6px;
    background: rgba(77, 72, 91, .18);
    content: '';
    transform: translateX(-50%);
}

.h5-first-frame__tab::before {
    top: 0;
    width: 25px;
    height: 25px;
    border-radius: 50%;
}

.h5-first-frame__tab::after {
    top: 33px;
    width: 38px;
    height: 8px;
}

.h5-first-frame__tab.is-active::before,
.h5-first-frame__tab.is-active::after {
    background: rgba(202, 121, 247, .42);
}

html.h5-external.h5-main-tab .bg {
    padding-top: calc(3.3vw + var(--h5-safe-top)) !important;
}

html.h5-external.h5-home .bg {
    padding-top: calc(4.8vw + var(--h5-safe-top)) !important;
}

html.h5-external.h5-main-tab .index-title {
    box-sizing: border-box !important;
    padding-top: 0 !important;
}

html.h5-external body::before {
    position: fixed;
    z-index: -1;
    top: 0;
    right: 0;
    left: 0;
    height: max(1px, var(--h5-safe-top));
    background: inherit;
    content: '';
}

body::after {
    display: none !important;
    background-image: none !important;
}

html body .u-tabbar__content.u-tabbar--fixed {
    box-sizing: border-box;
    min-height: calc(62px + var(--h5-safe-bottom));
    padding: 7px 8px max(8px, var(--h5-safe-bottom));
    border-top: 1px solid rgba(113, 105, 138, .1);
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 -8px 24px rgba(79, 69, 109, .08);
    transform: translateZ(0);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

html body .u-tabbar__content__item-wrapper {
    height: 54px !important;
    align-items: stretch;
}

html body .u-tabbar-item {
    min-width: 0;
    padding: 2px 0 1px;
}

html body .u-tabbar-item__icon {
    width: 100% !important;
    min-height: 30px;
    align-items: center;
}

html body .u-tabbar-item__text {
    margin-top: 2px !important;
    font-size: 12px !important;
    line-height: 17px;
    white-space: nowrap;
}

html.h5-keyboard-open body .u-tabbar__content.u-tabbar--fixed {
    display: none !important;
}

.firsto,
.firsttip,
uni-app .firsto,
uni-app .firsttip {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.campaign-shell[hidden],
.campaign-modal[hidden],
.campaign-side-button[hidden] {
    display: none !important;
}

.campaign-shell {
    position: relative;
    z-index: 2147482000;
}

html.campaign-open body {
    overflow: hidden;
}

.campaign-side-list {
    position: fixed;
    z-index: 2147482001;
    right: 8px;
    right: max(8px, calc(var(--h5-safe-right) + 6px));
    bottom: 92px;
    bottom: max(92px, calc(var(--h5-safe-bottom) + 82px));
    display: flex;
    width: 60px;
    width: clamp(52px, 15vw, 68px);
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    pointer-events: none;
}

.campaign-side-button {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    filter: drop-shadow(0 5px 9px rgba(48, 43, 70, .18));
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
}

.campaign-side-button:active {
    transform: scale(.96);
}

.campaign-side-button img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 84px;
    object-fit: contain;
}

.campaign-modal {
    position: fixed;
    z-index: 2147482002;
    inset: 0;
    display: flex;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    padding: max(18px, var(--h5-safe-top)) max(18px, var(--h5-safe-right)) max(18px, var(--h5-safe-bottom)) max(18px, var(--h5-safe-left));
    background: rgba(20, 18, 28, .54);
    opacity: 1;
    transition: opacity .18s ease;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.campaign-dialog {
    position: relative;
    display: flex;
    width: min(86vw, 430px);
    max-height: min(80dvh, 720px);
    align-items: center;
    justify-content: center;
    animation: campaign-enter .24s cubic-bezier(.2, .76, .32, 1);
}

.campaign-main-button {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    -webkit-tap-highlight-color: transparent;
}

.campaign-main-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: min(80dvh, 720px);
    background: transparent;
    object-fit: contain;
}

.campaign-close {
    position: absolute;
    top: -42px;
    right: 0;
    display: flex;
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .75);
    border-radius: 50%;
    background: rgba(22, 20, 30, .38);
    color: #fff;
    font: 300 28px/1 Arial, sans-serif;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

@keyframes campaign-enter {
    from { transform: translateY(14px) scale(.96); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

@media (min-width: 768px) {
    .campaign-side-list {
        right: max(18px, calc(var(--h5-safe-right) + 12px));
        bottom: max(110px, calc(var(--h5-safe-bottom) + 96px));
        width: 72px;
    }
}

@media (max-width: 374px) {
    .h5-first-frame__page {
        padding-right: 14px;
        padding-left: 14px;
    }
    .h5-first-frame__avatars {
        gap: 9px;
    }
    .h5-first-frame__card {
        height: 148px;
    }
    .h5-first-frame__card::before {
        width: 104px;
        height: 104px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .campaign-dialog {
        animation: none;
    }
    .campaign-modal,
    .h5-first-frame {
        transition: none;
    }
}
