/* ===================================
   第四區塊：投資陷阱說明
   =================================== */

.investment-traps-section {
    position: relative;
    width: 100vw;
    height: 110vh;
    overflow: hidden;
    background: #0b5b7c;
    scroll-margin-top: 100px;
}

/* 背景層 */
.traps-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.traps-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* 主要圖片（桌面版） */
.traps-main-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: auto;
    max-width: 80%;
    max-height: 80%;
    display: none; /* 預設隱藏，僅在桌面版顯示 */
}

/* 當有 fade-in-section 效果時，保持居中並添加淡入動畫 */
.traps-main-image.fade-in-section {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 80px));
    transition: opacity 1.5s ease, transform 1.5s ease;
}

.traps-main-image.fade-in-section.is-visible {
    opacity: 1;
    transform: translate(-50%, -50%);
}

.traps-main-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* 裝飾元素：箭頭 */
.decoration-arrow {
    position: absolute;
    left: calc(41.667% + 67px);
    top: 269px;
    width: 128px;
    height: 466px;
    opacity: 0.7;
    filter: drop-shadow(0px 0px 30px rgba(255, 255, 255, 0.25));
    z-index: 3;
}

.decoration-arrow img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 裝飾元素：小星星 */
.decoration-star {
    position: absolute;
    z-index: 5;
}

.decoration-star-1 {
    right: calc(30% - 50px);
    bottom: 120px;
    width: 27px;
    height: 31px;
}

.decoration-star-2 {
    right: calc(25% - 20px);
    bottom: 140px;
    width: 19px;
    height: 21px;
}

.decoration-star-3 {
    left: calc(25% - 30px);
    bottom: 140px;
    width: 24px;
    height: 27px;
}

.decoration-star img {
    width: 100%;
    height: 100%;
}

/* 主要內容容器 */
.investment-traps-section .main-container {
    position: relative;
    width: 75vw;
    max-width: 1440px;
    margin: 0 auto;
    height: 100%;
    z-index: 2;
}

/* 主標題 */
.section-main-title {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 758px;
    text-align: center;
    z-index: 4;
}

.section-main-title h2 {
    font-family: 'AR FangXinShuH7B5Std', 'Noto Sans TC', sans-serif;
    font-size: 60px;
    font-weight: 900;
    font-style: normal;
    line-height: 130%;
    letter-spacing: 2%;
    text-align: center;
    color: #ffffff;
    -webkit-text-stroke: 6px #094862E5;
    text-stroke: 6px #094862E5;
    paint-order: stroke fill;
    text-shadow: 0px 0px 50px #06223733;
    margin: 0;
}

/* 卡片容器 */
.traps-cards-wrapper {
    position: absolute;
    top: 280px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    z-index: 4;
}

/* 卡片樣式 */
.trap-card {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 364px;
}

/* 卡片邊框容器 */
.card-border {
    width: 279px;
    height: 364px;
    border: 2px solid #aff4ff;
    border-radius: 8px;
    opacity: 0.85;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* 卡片背景圖片 */
.card-bg-1 {
    background: url('https://cdn.chainee.io/camp/section2_card_1.png') center/cover no-repeat;
}

.card-bg-2 {
    background: url('https://cdn.chainee.io/camp/section2_card_2.png') center/cover no-repeat;
}

/* 卡片內容 */
.section4-card-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* 卡片標題 */
.card-title {
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    letter-spacing: 0.64px;
    margin-bottom: 20px;
}

/* 卡片圖片 */
.card-image {
    width: 100%;
    max-width: 252px;
    opacity: 0.9;
}

.card-image img {
    width: 100%;
    height: auto;
}

/* 卡片旋轉效果 */
.card-rotate-left {
    transform: rotate(270deg);
}

.card-rotate-right {
    transform: rotate(90deg);
}

/* 卡片內容反旋轉，保持圖片正向 */
.card-rotate-left .section4-card-contentt {
    transform: rotate(90deg);
}

.card-rotate-right .section4-card-contentt {
    transform: rotate(-90deg);
}

/* 副標題 */
.section-sub-title {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 758px;
    text-align: center;
    z-index: 4;
}

.section-sub-title h3 {
    font-family: 'AR FangXinShuH7B5Std', 'Noto Sans TC', sans-serif;
    font-size: 52px;
    font-weight: 900;
    font-style: normal;
    line-height: 130%;
    letter-spacing: 2%;
    text-align: center;
    color: #ffffff;
    -webkit-text-stroke: 6px #094862E5;
    text-stroke: 6px #094862E5;
    paint-order: stroke fill;
    text-shadow: 0px 0px 50px #06223733;
    margin: 0;
}

.section-sub-title .highlight {
    color: #aff4ff;
}

/* 桌面版顯示主要圖片 */
@media (min-width: 1291px) {
    .traps-main-image {
        display: block;
    }
}

/* 響應式設計 - 平板及以下 */
@media (max-width: 1290px) {
    .investment-traps-section {
        height: auto;
        min-height: auto;
        padding: 0;
    }

    /* 背景層改為相對定位,讓圖片自然撐開高度 */
    .traps-background {
        position: relative;
        height: auto;
    }

    /* 背景圖片完整顯示,不裁切 */
    .traps-background img {
        width: 100%;
        height: auto;
        object-fit: contain;
        object-position: top center;
    }

    /* 平板及以下隱藏主要圖片 */
    .traps-main-image {
        display: none;
    }

    .section-main-title {
        position: relative;
        top: auto;
        width: 90%;
        margin-bottom: 60px;
    }

    .section-main-title h2 {
        font-size: 48px;
    }

    .traps-cards-wrapper {
        position: relative;
        top: auto;
        margin-bottom: 60px;
    }

    .trap-card {
        margin-bottom: 30px;
        height: 300px;
    }

    .card-border {
        width: 240px;
        height: 300px;
    }

    .card-title {
        font-size: 28px;
    }

    .section-sub-title {
        position: relative;
        bottom: auto;
        width: 90%;
    }

    .section-sub-title h3 {
        font-size: 40px;
    }

    .decoration-arrow {
        display: none;
    }
}

@media (max-width: 768px) {
    .section-main-title h2 {
        font-size: 36px;
    }

    .card-title {
        font-size: 24px;
    }

    .section-sub-title h3 {
        font-size: 32px;
    }

    .decoration-star {
        display: none;
    }
}
