/* =========================================
   1. 全局設定 (Global Reset)
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video{
    font-family: unset;
}

body {
    font-family: 'Plus Jakarta Sans', Arial, sans-serif;
    line-height: 1.5;
    background: #5d1de8;
    /* 備用背景色 */
    color: #fff;
    overflow-x: hidden;
}

img {
    display: block;
    max-width: 100%;
    margin: 0 auto;
}

a {
    text-decoration: none;
    color: inherit;
}

/* 容器 - 默認為 100% 寬度 */
.inner {
    width: 100%;
    margin: 0 auto;
    position: relative;
}

/* --- Header Visibility Logic (新增部分) --- */
/* 手機版默認狀態 (Mobile First) */
.pc {
    display: none !important;
}

.m {
    display: block !important;
}

/* --- 按鈕基礎樣式 (Mobile) --- */
.btn-green {
    /* 關鍵：設為相對定位，讓裡面的 icon 可以根據它來絕對定位 */
    position: relative;
    /* 關鍵：允許圖標超出按鈕範圍顯示 */
    overflow: visible;
    
    display: inline-block;
    background: linear-gradient(180deg, #81ef4e 0%, #46cf1b 100%);
    color: #fff;
    font-weight: 800;
    text-transform: uppercase;
    text-align: center;
    border-radius: 50px;
    box-shadow: 0 4px 0 #2a8a0e, 0 5px 15px rgba(0, 0, 0, 0.3);
    
    /* 文字垂直置中設定 */
    line-height: 0.9rem; /* 與 height 相同 */
    height: 0.9rem;
    
    font-size: 0.36rem;
    padding: 0 0.6rem;
    width: auto;
    text-decoration: none;
}

.btn-green:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #2a8a0e;
}

/* --- 圖標絕對定位設定 (Mobile) --- */
.btn-icon {
    position: absolute;
    z-index: 2; /* 確保浮在按鈕上面 */
    object-fit: contain;
}

/* 1. 禮物圖標 (Banner) - 掛在左邊 */
.icon-gift {
    width: 1.07rem; /* 根據圖片實際大小調整 */
    height: auto;
    
    /* 定位：垂直居中，水平靠左突出 */
    top: 50%;
    transform: translateY(-50%) rotate(-10deg); /* 加一點旋轉更生動 */
    left: -0.4rem; /* 負值讓它跑出按鈕左邊界 */
}

/* 標題通用樣式 (Mobile) */
.title-common {
    text-align: center;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.44rem;
    margin-bottom: 0.5rem;

    /* --- 文字漸層效果 (核心代碼) --- */
    color: #ffc600;
    /* 備用顏色 (瀏覽器不支援時顯示) */
    background: linear-gradient(180deg, #ffff00 0%, #ff9900 100%);
    /* 上亮黃 下深橘 */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;

    /* 注意：使用文字漸層時，原本的 text-shadow 可能會失效或效果不好，建議改用 filter */
    filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.2));
}

/* =========================================
   2. MOBILE STYLES (手機端樣式 - 使用 rem)
   基於 JS: 375px 寬度時 1rem = 50px
   ========================================= */

/* --- Banner 區 --- */
.section-banner {
    /* Mobile 背景圖 + 紫色漸層備用 */
    background: url('../../images/h5-trading/banner_bg_m.png') no-repeat top center;
    background-size: cover;
    /* 讓圖片充滿容器 */

    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
    text-align: center;
}

.sub-head {
    font-size: 0.28rem;
    font-weight: 700;
    margin-bottom: 0.1rem;
}

/* 找到此區塊並替換 (大約在 Mobile Styles 區域) */

.main-head {
    font-size: 0.72rem;
    line-height: 1.1;
    font-weight: 900;
    margin-bottom: 0.2rem;

    /* --- 新增：文字漸層效果 --- */
    color: #ffdd00;
    /* 備用顏色 */
    /* 使用強烈的亮黃到深金漸層 */
    background: linear-gradient(180deg, #ffff00 0%, #ffaa00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    /* 使用 filter 來實現漸層文字的陰影 */
    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.3));
}

.main-head .highlight {
    /* color: #ffdd00;  <-- 已移除此行，讓它繼承上方的漸層 */
    font-size: 0.5rem;
    display: block;
    margin-top: 0.1rem;
}

.tag {
    display: inline-block;

    /* ★★★ 修正這裡：背景改為金黃色漸層 ★★★ */
    background: linear-gradient(180deg, #ffe552 0%, #ffb300 100%);

    /* 字體顏色 (您剛才指定的紫色) */
    color: #3c5dfe;

    font-weight: 700;
    font-size: 0.24rem;
    padding: 0.1rem 0.3rem;
    border-radius: 0.1rem;
    margin-bottom: 0.4rem;

    /* 增加一點陰影讓漸層更有質感 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.img-box {
    margin: 0.2rem auto;
    width: 6.5rem;
    /* 控制圖片大小 */
}

/* Mobile 按鈕包裝 */
.m-btn-wrapper {
    margin-top: 0.3rem;
}

.m-btn-wrapper .btn-green {
    width: 5rem;
    height: 0.9rem;
    line-height: 0.9rem;
    padding: 0;
    font-size: 0.36rem;
}

/* PC 按鈕默認隱藏 */
.pc-btn-wrapper {
    display: none;
}


/* --- Why Choose 區 (藍色) --- */
.section-why {
    /* Mobile 背景圖 + 藍色漸層備用 */
    background: url('../../images/h5-trading/block1_bg_m.png') no-repeat top center;
    background-size: cover;

    padding: 0.8rem 0;
}

/* 橫向滑動容器 */
.why-list {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 0.4rem;
    padding-left: 0.3rem;
}

.why-list::-webkit-scrollbar {
    display: none;
}

.why-item {
    flex: 0 0 5.6rem;
    /* 修正 1: 調整漸變色 (更鮮豔的金黃色 -> 深橘黃) */
    background: linear-gradient(180deg, #ffe552 0%, #ffb300 100%);
    /* 修正 2: 增加白色邊框 */
    border: 2px solid #ffffff;
    border-radius: 0.3rem;
    margin-right: 0.3rem;
    padding: 0.4rem 0.3rem;
    text-align: center;
    color: #333;
    position: relative;
    margin-top: 0.8rem;
    /* 稍微增加頂部空間給 Icon */
    scroll-snap-align: center;
    /* 增加一點陰影讓白色邊框更明顯 */
    box-shadow: 0 0.1rem 0.3rem rgba(0, 0, 0, 0.2);
}

.icon-wrap {
    margin: -1rem auto 0;
    z-index: 2;
    font-size: 0;
}

/* --- 2. 分別設置 4 張背景圖片 --- */

/* 第一個圖標 (Rocket) */
.why-item:nth-child(1) .icon-wrap {
    background-image: url('../../images/h5-trading/block1_icon1.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    width: 1.75rem;
    height: 1.83rem;
}

/* 第二個圖標 (Computer) - 已修正 .ong 為 .png */
.why-item:nth-child(2) .icon-wrap {
    background-image: url('../../images/h5-trading/block1_icon2.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    width: 1.89rem;
    height: 1.56rem;
}

/* 第三個圖標 (Chart/Date) */
.why-item:nth-child(3) .icon-wrap {
    background-image: url('../../images/h5-trading/block1_icon3.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    width: 1.67rem;
    height: 1.57rem;
}

/* 第四個圖標 (Update/Refresh) */
.why-item:nth-child(4) .icon-wrap {
    background-image: url('../../images/h5-trading/block1_icon4.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    width: 1.78rem;
    height: 1.73rem;
}

.why-item h3 {
    color: #0056d6;
    font-size: 0.32rem;
    line-height: 1.3;
    padding-bottom: 0.2rem;
    /* 增加底部內距 */
    margin-bottom: 0.2rem;
    /* 增加底部外距 */

    /* 修正 3: 增加白色分隔線 */
    border-bottom: 3px solid rgba(255, 255, 255, 0.8);
    position: relative;
}

.why-item p {
    font-size: 0.26rem;
    line-height: 1.4;
    /* 確保文字顏色夠深，對比清晰 */
    color: #ffffff;
    font-weight: 500;
}

/* 裝飾性的小點點 */
.dots-m {
    text-align: center;
    margin-top: 0.2rem;
}

.dots-m span {
    display: inline-block;
    width: 0.16rem;
    height: 0.16rem;
    background: #efefef;
    border-radius: 50%;
    margin: 0 0.06rem;
}

.dots-m span.active {
    background: #ff9d46;
}


/* --- Steps 區 (紫色) --- */
.section-steps {
    /* Mobile 背景圖 + 紫色漸層備用 */
    background: url('../../images/h5-trading/block2_bg_m.png') no-repeat top center;
    background-size: cover;

    padding: 0.8rem 0;
}

.steps-list {
    padding: 0 0.4rem;
}

.step-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.6rem;
}

.step-item:last-child {
    margin-bottom: 0;
}

.num-img {
    flex: 0 0 1.8rem;
    margin-right: 0.2rem;
}

.text {
    text-align: left;
}

.text h3 {
    color: #ffe600;
    font-size: 0.36rem;
    margin-bottom: 0.1rem;
}

/* 找到此區塊並替換 (大約在 Mobile Styles 區域) */

.text p {
    font-size: 0.28rem;
    line-height: 1.4;

    /* --- 新增：柔和的文字漸層效果 --- */
    color: #ffe600;
    /* 備用顏色 */
    /* 使用較淺的米黃到金色的漸層 */
    background: linear-gradient(180deg, #fff9c4 0%, #ffc600 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}


/* --- Footer CTA 區 (深藍科技感) --- */
.section-cta {
    /* Mobile 背景圖 + 深藍漸層備用 */
    background: url('../../images/h5-trading/block3_bg_m.png') no-repeat top center;
    background-size: cover;

    padding: 0.8rem 0 1.2rem;
    text-align: center;
}

.cta-title {
    font-size: 0.4rem;
    font-weight: 800;
    line-height: 1.4;
    margin-bottom: 0.4rem;

    /* --- 文字漸層效果 (核心代碼) --- */
    color: #ffdd00;
    /* 備用顏色 */
    background: linear-gradient(180deg, #fff65e 0%, #ffaa00 100%);
    /* 亮一點的漸層 */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;

    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
}

.pro-tip {
    font-size: 0.24rem;
    color: rgba(255, 255, 255, 0.8);
    padding: 0 0.5rem;
    margin-bottom: 0.6rem;
    line-height: 1.6;
}

/* 點擊圖標 (右邊) */
.icon-click {
    width: 1.32rem; /* 根據圖片實際大小調整 */
    height: auto;
    
    /* 定位：右下角懸浮 */
    bottom: -0.2rem;
    right: -0.5rem;
}

/* 底部大按鈕微調 */
.btn-green.big {
    font-size: 0.4rem;
    width: 5.5rem;
    height: 1.1rem;
    line-height: 1.1rem;
    padding: 0;
}


/* =========================================
   3. PC STYLES (電腦端樣式 - 使用 px)
   當螢幕寬度大於 798px 時生效
   ========================================= */
@media screen and (min-width: 799px) {

    /* 切換 Header 顯示 PC 版 */
    .pc {
        display: block !important;
    }

    .m {
        display: none !important;
    }

    /* 修正容器寬度 */
    .inner {
        width: 1200px;
        margin: 0 auto;
        padding: 0 20px;
    }

    /* --- Banner 區 (PC) --- */
    .section-banner {
        /* PC 背景圖 */
        background: url('../../images/h5-trading/banner_bg.png') no-repeat top center;
        background-size: cover;
        /* 或是 1920px auto，視設計圖而定 */

        padding: 80px 0;
        text-align: left;
        height: 600px;
        display: flex;
        align-items: center;
        margin-top:93px;
    }

    .section-banner .inner{
        width: 1440px;
    }

    .banner-content {
        display: flex;
        flex-direction: row;
        /* 左右排列 */
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .txt-box {
        flex: 1;
        padding-left: 50px;
        z-index: 2;
    }

    .img-box {
        flex: 1.2;
        width: auto;
        margin: 0;
    }

    .img-box img {
        margin-right: 0;
        /* 圖片靠右 */
    }

    /* 字體大小改回 px，因為 PC 不吃 rem 腳本的縮放 */
    .sub-head {
        font-size: 20px;
        margin-bottom: 10px;
    }

    .main-head {
        font-size: 60px;
        line-height: 1.1;
        margin-bottom: 20px;
    }

    .main-head .highlight {
        display: inline-table;
        /* PC 上不換行，或接在後面 */
        font-size: 30px;
        margin-left: 10px;
    }

    .tag {
        font-size: 16px;
        padding: 8px 20px;
        margin-bottom: 40px;
        border-radius: 5px;
    }

    /* 按鈕切換 */
    .m-btn-wrapper {
        display: none;
    }

    .pc-btn-wrapper {
        display: block;
        margin-top: 30px;
    }

    .pc-btn-wrapper .btn-green {
        font-size: 24px;
        padding: 0 50px;
        height: 64px; 
        line-height: 64px; /* 垂直居中 */
        width: auto;
    }


    /* --- Why Choose 區 (PC) --- */
    .section-why {
        /* PC 背景圖 */
        background: url('../../images/h5-trading/block1_bg.png') no-repeat top center;
        background-size: cover;

        padding: 80px 0;
    }

    .title-common {
        font-size: 36px;
        margin-bottom: 80px;
    }

    .dots-m {
        display: none;
    }

    /* PC 不需要滑動點 */

    .why-list {
        display: flex;
        overflow: visible;
        /* 取消滑動 */
        padding: 0;
        justify-content: space-between;
        /* 四個均分 */
        gap: 20px;
    }

    .why-item {
        flex: 1;
        margin: 0;
        margin-top: 50px;
        padding: 30px 20px;
        border-radius: 15px;

        /* 同步 Mobile 的視覺風格 */
        border: 2px solid #ffffff;
        background: linear-gradient(180deg, #ffe552 0%, #ffb300 100%);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    }

    .icon-wrap {
        width: 80px;
        height: 80px;
        margin: -70px auto 20px;
        /* 調整 PC 的浮動位置 */
    }

    .why-item h3 {
        font-size: 18px;
        margin-bottom: 15px;
        padding-bottom: 15px;
        min-height: auto;

        /* 同步分隔線 */
        border-bottom: 1px solid rgba(255, 255, 255, 0.8);
    }

    .why-item p {
        font-size: 14px;
    }

    /* 第一個圖標 (Rocket) */
    .why-item:nth-child(1) .icon-wrap {
        background-image: url('../../images/h5-trading/block1_icon1.png');
        background-size: 100% 100%;
        background-repeat: no-repeat;
        width: 175px;
        height: 183px;
    }

    /* 第二個圖標 (Computer) - 已修正 .ong 為 .png */
    .why-item:nth-child(2) .icon-wrap {
        background-image: url('../../images/h5-trading/block1_icon2.png');
        background-size: 100% 100%;
        background-repeat: no-repeat;
        width: 189px;
        height: 156px;
    }

    /* 第三個圖標 (Chart/Date) */
    .why-item:nth-child(3) .icon-wrap {
        background-image: url('../../images/h5-trading/block1_icon3.png');
        background-size: 100% 100%;
        background-repeat: no-repeat;
        width: 167px;
        height: 157px;
    }

    /* 第四個圖標 (Update/Refresh) */
    .why-item:nth-child(4) .icon-wrap {
        background-image: url('../../images/h5-trading/block1_icon4.png');
        background-size: 100% 100%;
        background-repeat: no-repeat;
        width: 178px;
        height: 173px;
    }

    /* --- Steps 區 (PC) --- */
    .section-steps {
        /* PC 背景圖 */
        background: url('../../images/h5-trading/block2_bg.png') no-repeat top center;
        background-size: cover;

        padding: 80px 0;
    }

    .steps-list {
        display: flex;
        /* 變為橫向 */
        justify-content: space-around;
        align-items: baseline;
        padding: 0;
    }

    .step-item {
        flex-direction: column;
        /* 上圖下文 */
        text-align: center;
        width: 30%;
        margin-bottom: 0;
    }

    .num-img {
        flex: 0 0 auto;
        width: 120px;
        margin: 0 auto 20px;
    }

    .num-2 {
        width: 140.4px;
    }

    .text {
        text-align: center;
    }

    .text h3 {
        font-size: 24px;
    }

    .text p {
        font-size: 16px;
        max-width: 250px;
        margin: 0 auto;
    }


    /* --- Footer CTA (PC) --- */
    .section-cta {
        /* PC 背景圖 */
        background: url('../../images/h5-trading/block3_bg.png') no-repeat top center;
        background-size: cover;

        padding: 80px 0;
    }

    .cta-title {
        font-size: 32px;
        margin-bottom: 20px;
    }

    .cta-title br {
        display: none;
    }

    /* PC 標題不需要換行那麼多 */

    .pro-tip {
        font-size: 16px;
        max-width: 700px;
        margin: 0 auto 40px;
    }

    .btn-green.big {
        font-size: 28px;
        width: auto;
        padding: 0 80px; /* 左右留多一點空間給文字 */
        height: 80px;
        line-height: 80px;
    }

    /* --- 新增：PC 端圖標尺寸 (px) --- */
    .btn-icon {
        width: 32px; /* PC 版基礎圖標大小 */
    }

    .icon-gift {
        width: 86px; /* PC 版圖標變大 */
        left: -50px; /* 向左突出 */
        top: 50%;
        transform: translateY(-50%) rotate(-10deg);
    }

    /* 2. 點擊圖標 (PC) */
    .icon-click {
        width: 106px;
        bottom: -20px; /* 向下突出 */
        right: -38px;  /* 向右突出 */
    }
}

/* --- 1. 定義關鍵幀動畫 (Keyframes) --- */

/* 火箭/主圖懸浮效果 (上下漂浮) */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* 禮物圖標搖晃 (吸引點擊) */
/* 注意：保留了 translateY(-50%) 以確保垂直居中不跑位 */
@keyframes shake-gift {
    0% { transform: translateY(-50%) rotate(-10deg); }
    10%, 30% { transform: translateY(-50%) rotate(5deg); }
    20%, 40% { transform: translateY(-50%) rotate(-15deg); }
    50%, 100% { transform: translateY(-50%) rotate(-10deg); }
}

/* 點擊手指動畫 (模擬按壓) */
@keyframes tap-hand {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.9) translateY(5px); }
}

/* --- 2. 應用動畫到元素 --- */

/* Banner 火箭圖片懸浮 */
.img-box img {
    animation: float 3s ease-in-out infinite;
}

/* 禮物 Icon 動畫 */
.icon-gift {
    /* 設定旋轉軸心為底部中心，讓搖晃更自然 */
    transform-origin: center bottom;
    animation: shake-gift 2.5s ease-in-out infinite;
}

/* 手指 Icon 動畫 */
.icon-click {
    transform-origin: bottom right;
    animation: tap-hand 1.5s ease-in-out infinite;
}

/* --- 3. 滾動漸顯效果 (需配合 HTML class="scroll-reveal" 和 JS) --- */

/* 初始狀態：隱藏且稍微下沉 */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

/* 觸發狀態：顯示 (由 JS 添加 .visible) */
.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 設定延遲，讓卡片依序出現 (瀑布流效果) */
.why-item:nth-child(1) { transition-delay: 0.1s; }
.why-item:nth-child(2) { transition-delay: 0.2s; }
.why-item:nth-child(3) { transition-delay: 0.3s; }
.why-item:nth-child(4) { transition-delay: 0.4s; }

.step-item:nth-child(1) { transition-delay: 0.1s; }
.step-item:nth-child(2) { transition-delay: 0.3s; }
.step-item:nth-child(3) { transition-delay: 0.5s; }


/* --- 4. PC 端滑鼠互動特效 (僅 PC 生效) --- */
@media screen and (min-width: 799px) {
    /* 按鈕 Hover: 上浮並發光 */
    .btn-green {
        transition: transform 0.3s, box-shadow 0.3s;
    }
    .btn-green:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 20px rgba(70, 207, 27, 0.4);
    }

    /* Why Item 卡片 Hover: 上浮 + 變亮 */
    .why-item {
        transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
    }
    .why-item:hover {
        transform: translateY(-10px);
        box-shadow: 0 15px 30px rgba(0,0,0,0.2);
        /* Hover 時背景漸層稍微變亮 */
        background: linear-gradient(180deg, #fff09e 0%, #ffc107 100%);
    }

    /* Hover 時圖標旋轉特效 */
    .why-item:hover .icon-wrap {
        transform: scale(1.1) rotate(5deg);
        transition: transform 0.3s;
        border-color: #fff;
    }
}