/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 仅 html 作为纵向滚动容器；body 禁止纵向 overflow，避免双 Y 轴滚动条（Chrome/WebKit 常见） */
html {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 100%;
    min-height: 100vh;
    background-color: #3a2f25;
    background-image: linear-gradient(180deg, #463023 0%, #382d24 100%);
    background-attachment: fixed;
}

body {
    min-height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    overflow-x: hidden;
    overflow-y: hidden;
    position: relative;
    font-family: 'Noto Sans SC', 'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: transparent;
    color: #fff;
    -webkit-text-size-adjust: 100%;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* 顶/底安全区：固定层叠渐变；iOS 旧版用 constant()，新版用 env()；移动端保底高度防止 env 恒为 0 */
body::before,
body::after {
    content: '';
    position: fixed;
    left: 0;
    right: 0;
    z-index: 0;
    pointer-events: none;
}

body::before {
    top: 0;
    height: constant(safe-area-inset-top);
    height: env(safe-area-inset-top, 0px);
    background: linear-gradient(
        180deg,
        #020403 0%,
        #0a1812 32%,
        #142f22 68%,
        #1b3c2a 100%
    );
}

body::after {
    bottom: 0;
    height: constant(safe-area-inset-bottom);
    height: env(safe-area-inset-bottom, 0px);
    background: linear-gradient(
        0deg,
        #010000 0%,
        #0a0806 38%,
        #14100d 72%,
        #1a1512 100%
    );
}

@media screen and (max-width: 932px) {
    /* 部分 WebView 不暴露 env，用 vh 保底条带与 html 背景衔接 */
    body::before {
        min-height: 11vw;
    }

    body::after {
        min-height: 9vw;
    }
}

/* =====================
   Loading 蒙层（淡出 + 与主内容交叉淡入）
===================== */
.loading-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    min-height: 100%;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    background: rgba(6, 8, 7, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 1;
    visibility: visible;
    transition:
        opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        backdrop-filter 0.55s ease,
        -webkit-backdrop-filter 0.55s ease,
        visibility 0s linear 0s;
}

.loading-overlay.loading-overlay--exiting {
    opacity: 0;
    visibility: hidden;
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
    pointer-events: none;
    transition:
        opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        backdrop-filter 0.55s ease,
        -webkit-backdrop-filter 0.55s ease,
        visibility 0s linear 0.55s;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    transition: opacity 0.42s ease, transform 0.48s cubic-bezier(0.22, 1, 0.36, 1);
}

.loading-overlay.loading-overlay--exiting .loading-content {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(212, 175, 55, 0.25);
    border-top: 3px solid #d4af37;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #d4af37;
    font-size: 16px;
    font-weight: 500;
}

/* =====================
   主内容
===================== */
.main-content {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100%;
    background-color: transparent;
    opacity: 0;
    transform: translateY(12px);
    transition:
        opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
    overflow-x: hidden;
    overflow-y: visible;
}

.main-content.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* =====================
   顶部：轮播 + 叠层 UI
===================== */
.top-section {
    position: relative;
    width: 100%;
    overflow-x: hidden;
    overflow-y: hidden;
}

.carousel-container {
    position: relative;
    width: 100%;
    line-height: 0;
    background: #1b3c2a;
}

.carousel-backdrop {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        rgba(27, 60, 42, 0.45) 0%,
        rgba(27, 60, 42, 0.2) 40%,
        rgba(27, 60, 42, 0.55) 100%
    );
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
    pointer-events: none;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(12px, 4vw, 28px);
}

.hero-brand {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: 20px;
    color: #d4af37;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.35);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.hero-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hero-brand-name {
    font-size: clamp(17px, 4.2vw, 22px);
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #d4af37;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.hero-brand-sub {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 248, 220, 0.88);
    letter-spacing: 0.12em;
}

.hero-headlines {
    text-align: center;
    margin-top: clamp(4px, 1.5vw, 12px);
}

.hero-title {
    font-size: clamp(28px, 8vw, 40px);
    font-weight: 900;
    letter-spacing: 0.2em;
    color: #d4af37;
    text-shadow:
        0 2px 8px rgba(0, 0, 0, 0.35),
        0 0 40px rgba(212, 175, 55, 0.15);
    line-height: 1.2;
}

.hero-subtitle {
    margin-top: 8px;
    font-size: clamp(14px, 3.8vw, 17px);
    font-weight: 600;
    letter-spacing: 0.18em;
    color: #e8c547;
}

.carousel-wrapper {
    position: relative;
    width: 100%;
    line-height: 0;
    z-index: 2;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transition: opacity 0.75s ease-in-out;
    z-index: 1;
}

.carousel-slide.active {
    position: relative;
    opacity: 1;
    z-index: 2;
}

.carousel-image {
    width: 100%;
    height: auto;
    display: block;
    vertical-align: top;
}

.lazy-carousel {
    opacity: 0;
}

.lazy-carousel.loaded {
    opacity: 1;
    transition: opacity 0.6s ease-in-out;
}

.carousel-indicators {
    position: absolute;
    bottom: clamp(14px, 4vw, 22px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 20;
}

.indicator {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: all 0.35s ease;
    border: none;
    pointer-events: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.indicator.active {
    background: #d4af37;
    width: 22px;
    border-radius: 4px;
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.45);
}

.indicator:active {
    transform: scale(0.92);
}

/* 顶部与绿带波浪衔接 */
.hero-wave {
    position: relative;
    z-index: 4;
    margin-top: -1px;
    line-height: 0;
    color: #1f4a33;
}

.hero-wave-svg {
    display: block;
    width: 100%;
    height: clamp(28px, 8vw, 44px);
}

/* =====================
   客服（奖杯位）
===================== */
.customer-service {
    position: absolute;
    z-index: 1000;
    top: calc(constant(safe-area-inset-top) + clamp(5px, 7vw, 44px));
    top: calc(env(safe-area-inset-top, 0px) + clamp(5px, 7vw, 44px));
    right: calc(16px + constant(safe-area-inset-right));
    right: calc(16px + env(safe-area-inset-right, 0px));
}

.kefu-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.3s ease;
    display: block;
    pointer-events: auto;
    box-shadow:
        0 0 0 1px rgba(212, 175, 55, 0.55),
        0 4px 14px rgba(0, 0, 0, 0.35);
}

.kefu-btn:active {
    transform: scale(0.92);
}

/* =====================
   下载区与下方内容（SDK 仅控制 .download-actions）
===================== */
.download-actions {
    display: block;
}

/* 下载区：纵向 flex，底图自适应占位，页脚始终在图片之后、不被遮挡 */
.download-section {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    position: relative;
    z-index: 5;
    background-color: transparent;
    top: -2px;
    overflow: visible;
}

.bottom-banner {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    line-height: 0;
    display: block;
    overflow: hidden;
}

.bottom-banner-img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    vertical-align: top;
}

.top-cta-band {
    width: 100%;
    background: #214831;
    padding-bottom: 50px;
    position: relative;
    top: -2px;
}

.hero-tagline {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: clamp(17px, 4.5vw, 22px);
    color: rgba(255, 252, 245, 0.95);
    text-align: center;
    padding: 6px 24px 0;
    letter-spacing: 0.08em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.hero-tagline img,
.footer-tagline img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    vertical-align: top;
}

.buttons-row {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: stretch;
    padding: 18px 20px 14px;
    gap: 14px;
    box-sizing: border-box;
}

.download-left,
.download-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    max-width: 168px;
}

.btn-wrapper {
    position: relative;
    width: 100%;
    max-width: 160px;
    height: 50px;
    border-radius: 14px;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s ease, opacity 0.2s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
}

.buttons-row:not(.bottom-buttons-row) .btn-wrapper {
    background: linear-gradient(180deg, rgba(125, 184, 158, 1) 0%, rgba(63, 145, 104, 1) 100%);
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.12);
    /* border: 1px solid rgba(212, 175, 55, 0.22); */
}

.bottom-buttons-row .btn-wrapper {
    background: linear-gradient(180deg, #c9a227 0%, #9a7224 45%, #6b4e1c 100%);
    box-shadow:
        0 2px 0 rgba(255, 255, 255, 0.15) inset,
        0 4px 14px rgba(0, 0, 0, 0.35);
    /* border: 1px solid rgba(212, 175, 55, 0.45); */
}

.btn-wrapper:active {
    transform: scale(0.96);
    opacity: 0.94;
}

.btn-overlay {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    pointer-events: none;
}

.btn-icon {
    width: 21px;
    height: 21px;
    object-fit: contain;
    flex-shrink: 0;
    pointer-events: none;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}

.btn-label {
    font-size: 15px;
    font-weight: 600;
    font-family: 'Noto Sans SC', 'PingFang SC', sans-serif;
    color: #fffef5;
    white-space: nowrap;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

/* =====================
   页脚下载（紧随 bottom-banner 之后，文档流内不被底图覆盖）
===================== */
.page-footer {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    width: 100%;
    /* 用负 margin 上提页脚，避免 top 仅做视觉偏移却在 download-section 底部留下同等空白 */
    margin-top: -170px;
    padding: 28px 0 calc(28px + env(safe-area-inset-bottom, 0px));
    background: transparent;
    /* box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35); */
}

.footer-tagline {
    padding-top: 4px;
}

/* =====================
   懒加载（若仍使用）
===================== */
.lazy-load {
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

.lazy-load.loaded {
    opacity: 1;
}

/* =====================
   图片拖拽
===================== */
img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    pointer-events: none;
}

.kefu-btn,
.indicator,
.btn-wrapper {
    pointer-events: auto;
}

.hidden {
    display: none !important;
}

/* =====================
   响应式
===================== */
@media screen and (max-width: 375px) {
    .customer-service {
        right: calc(12px + constant(safe-area-inset-right));
        right: calc(12px + env(safe-area-inset-right, 0px));
    }

    .kefu-btn {
        width: 32px;
        height: 32px;
    }

    .buttons-row {
        padding: 14px 14px 12px;
        gap: 10px;
    }
}

@media screen and (max-width: 320px) {
    .kefu-btn {
        width: 32px;
        height: 32px;
    }

    .buttons-row {
        padding: 12px 10px 10px;
        gap: 8px;
    }
}
