/* 手機版背景圖片修復 */

/* 基礎背景設定 */
.hero-section {
    background-image: url('../images/RFLbackground.PNG');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    min-height: 100vh;
    position: relative;
}

/* 桌面版使用 fixed attachment */
@media (min-width: 769px) {
    .hero-section {
        background-attachment: fixed;
    }
}

/* 手機版和平板版使用 scroll attachment */
@media (max-width: 768px) {
    .hero-section {
        background-attachment: scroll !important;
        background-size: cover !important;
        background-position: center center !important;
        min-height: 100vh !important;
        background-repeat: no-repeat !important;
        /* 確保背景圖片在小螢幕上正確顯示 */
        -webkit-background-size: cover !important;
        -moz-background-size: cover !important;
        -o-background-size: cover !important;
    }
}

/* iOS Safari 特殊處理 */
@supports (-webkit-touch-callout: none) {
    .hero-section {
        background-attachment: scroll !important;
    }
}

/* 超小螢幕優化 */
@media (max-width: 480px) {
    .hero-section {
        background-position: center top !important;
        min-height: 100vh !important;
    }
}

/* 確保內容在背景上方 */
.hero-section > * {
    position: relative;
    z-index: 2;
}

/* 如果需要覆蓋層 */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1); /* 輕微的暗化效果，可調整 */
    z-index: 1;
    pointer-events: none;
}

/* 高解析度螢幕優化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-section {
        background-image: url('../images/RFLbackground.PNG');
    }
}