@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;700&display=swap');

body, html {
    margin: 0;
    padding: 0;
    font-family: 'Noto Sans TC', sans-serif;
    color: #4d4d4d;
    min-height: 400px;
    background-color: #FFFFFF;
    min-width: 375px; /* 頁面最小寬度 */
    overflow-y: auto;
    overflow-x: hidden;
    /* overflow: hidden; */
    height: 100%;
    display: flex;
    flex-direction: column;
}

.container {
    position: relative;
    /* width: 100%; */
    /* width: 100vw;  測試手機橫向不破圖 */
    min-height: 100dvh; 
    /* min-height: 320px;   頁面最小高度 */
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
}

.background-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.bg-item {
    position: absolute;
    top: 0;
    left: 0;
    /* width: 100%;
    height: 100%; */
    object-fit: contain;
    object-position: top left;
}

.bg-item.left-item {
    top: 0px;
    left: 0px;
    width: 250px;
    height: auto;
    transform: translateX(-100vw); /* 在動畫開始前，向左移動整個螢幕寬度 */
    animation: flyInLeft 1s ease-out forwards;
    animation-delay: 0.5s;
    z-index: 1;
}

.bg-item.right-item {
    top: auto;
    left: auto;
    bottom: -10px;
    right: 0px;
    width: 300px;
    height: auto;
    transform: translateX(100vw); /* 在動畫開始前，向右移動整個螢幕寬度 */
    animation: flyInRight 1s ease-out forwards;
    animation-delay: 0.8s;
    z-index: 1;
}

.bg-item.layer-1 {
    width: 50%;
    max-width: 640px; 
    top: auto;
    left: auto;
    bottom: 0px;
    transform: translateX(-100vw); /* 在動畫開始前，向左移動整個螢幕寬度 */
    animation: flyInUpLeft 1.2s ease-out forwards;
    animation-delay: 1s;
    z-index: 2;
}

.bg-item.shadow {
    width: 14%;
    max-width: 420px; 
    min-width: 230px;
    top: auto;
    left: auto;
    bottom: 45px;
    transform: translateX(-100vw); /* 在動畫開始前，向左移動整個螢幕寬度 */
    animation: flyInUpLeft 1.2s ease-out forwards;
    animation-delay: 1s;
    z-index: 0;
}


.main-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 5;
}

.title-image img {
    position: relative;
    width: 800px;
    height: auto;
    left: 0px;
    bottom: 30px;
    animation: fadeIn 3.5s ease-in-out forwards; /* 應用淡入動畫 */
}

.button-container {
    margin-top: 30px;
}

.enter-button-img {
    display: block;
    background-image: url('images/首頁按鈕設計_final_分離.png');
    background-size: contain;
    background-repeat: no-repeat;
    width: 240px; /* 設定按鈕的寬度 */
    height: 60px; /* 設定按鈕的高度，根據圖片實際尺寸調整 */
    position: relative;
    top: 0px;
    left: 35px;
    cursor: pointer;
    animation: fadeIn 4.5s ease-in-out forwards; /* 應用淡入動畫 */
    transition: transform 0.3s ease;
}

.enter-button-img:hover {
    background-image: url('images/首頁按鈕設計_final_hover.png');
}

.runner-image {
    position: absolute;
    bottom: 35px; 
    left: 0px;
    width: 45%;
    max-width: 680px;
    z-index: 1;
    transform: translateY(100vh);
    animation: /* bounceInUp 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards */ slideInUp 1s ease-out forwards;
    animation-delay: 1.2s; /* 延遲 1.2 秒，讓背景先載入 */
}

.runner-image img {
    width: 60%;
}

/* --- 新增的頁尾樣式 --- */
.footer-wrapper {
    width: 100%;
    background-color: #FFE9F5; /* 粉色背景 */
    padding: 10px 0;
    position: relative; 
    bottom: 0; /* 讓它固定在瀏覽器底部 */
    left: 0; /* 讓它從瀏覽器左側開始 */
    z-index: 10; 
}

.footer-content {
    max-width: 1200px; /* 內容寬度限制 */
    margin: 0 auto; /* 內容置中 */
    text-align: center;
    padding: 0 20px;
    font-size: clamp(14px, 1vw, 18px);
}

.contact-info {
    display:flex;
    margin: 0;
    font-size: 0.9em;
    color: #555;
    padding-bottom: 10px;
    gap: 45px;
    justify-content: center;
    align-items: center;
}

.contact-info p {
    color: #565656;
    display: block; /* 讓每個 p 都獨佔一行 */
    margin: 5px 0;
}

.link-info {
    font-family: 'Noto Sans TC', sans-serif;
    font-weight: 400;
    font-size: 1.0em;
    margin: 0;
}

.link-info a {
    color: #565656;
    text-decoration: none;
    transition: color 0.3s ease;
    text-shadow: 0px 4px 4px rgba(0,0,0,0.3);
    text-decoration: underline;
    word-break: keep-all;
}

.link-info a:hover {
    color: #ff68a7;
    text-decoration: underline;
}

/* 新增的動畫 */
@keyframes flyInLeft {
    to {
        transform: translateX(0);
    }
}

@keyframes flyInRight {
    to {
        transform: translateX(0);
    }
}

@keyframes bounceInUp {
    0% {
        transform: translateY(100vh); /* 從螢幕底部往上移動 */
    }
    60% {
        transform: translateY(-20px); /* 彈跳效果，稍微超過最終位置 */
    }
    80% {
        transform: translateY(10px); /* 回彈到最終位置 */
    }
    100% {
        transform: translateY(0); /* 停在最終位置 */
    }
}

@keyframes float {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px); /* 向上移動 10 像素 */
    }
    100% {
        transform: translateY(0);
    }
}

@keyframes flyInUpLeft {
    to {
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100vh); /* 從螢幕底部外開始 */
    }
    to {
        transform: translateY(0); /* 移動到最終位置 */
    }
}

/* 新增淡入動畫效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@media (max-width: 1580px) {
    .title-image img {
        width: 68%;
        max-width: 750px;
        bottom: 60px;
    }

    .enter-button-img {
        width: 220px;
        left: 85px;
        top: -35px;
    }

    .runner-image {
        width: 45%;
        min-width: 420px;
    }

    .bg-item.layer-1 {
        width: 52%;
        max-width: 540px; 
    }

    .bg-item.shadow {
        min-width: 200px;
        max-width: 420px; 
    }

    .bg-item.left-item {
        width: 200px;
    } 

    .bg-item.right-item {
        width: 250px;
    }
    
}

/* --- 手機版 RWD 樣式 (螢幕寬度小於 768px) --- */
@media (max-width: 768px) {
    .title-image img {
        bottom: 100px;
    }

    .enter-button-img {
        width: 200px;
        top: -105px;
    }

    .runner-image {
        width: 60%;
    }

    .bg-item.layer-1 {
        width: 60%;
        min-width: 300px; 
    }

    .bg-item.shadow {
        min-width: 180px; 
    }

    .bg-item.left-item {
        width: 180px;
    } 

    .bg-item.right-item {
        width: 210px;
    }
    
}

/* --- Footer 變形 --- */
@media (max-width: 635px) {

    .runner-image {
        width: 68%;
        min-width: 435px;
        bottom: -5px; 
    }

    .bg-item.layer-1 {
        width: 50%;
        bottom: -4px;
    }

    .bg-item.shadow {
        bottom: 22px;
    }

    .contact-info {
        display: block;
    }

    .contact-info p {
        display: block;
    }

    .title-image img {
        left: 0px;
        width: 70%;
        min-width: 320px;
    }

    .enter-button-img {
        width: 150px;
        left: 80px;
    }

    .footer-content {
        text-align: left;
    }

    .bg-item.left-item {
        width: 115px;
    } 

    .bg-item.right-item {
        bottom: -5px;
        width: 150px;
    }

    .link-info a {
        padding: 0px;
    }

}

@media screen and (max-height: 850px) {
    .title-image img {
        width: 60%;
        max-width: 800px;
    }

    .runner-image {
        width: 32%;
    }

    .bg-item.layer-1 {
        width: 30%;
    }

}

/* 小於特定高度 */
@media screen and (max-height: 700px) {
    .runner-image {
        width: 40%;
        bottom: 20px; 
        max-width: 375px;
        min-width: 300px;
    }

    .title-image img {
        top: -30px;
        width: 60%;
        min-width: 250px;
    }

    .bg-item.layer-1 {
        width: 50%;
        max-width: 340px;
    }

    .bg-item.shadow {
        min-width: 120px;
        max-width: 168px;
    }

    .enter-button-img {
        width: 150px;
        top: -35px;
    }

/*     .bg-item.left-item {
        width: 95px;
    } */

/*     .bg-item.right-item {
        width: 95px;
    } */
}

@media screen and (max-height: 515px) {
    .title-image img {
        top: 0px;
        width: 40%;
    }

    .enter-button-img {
        top: 0px;
    }

    .runner-image {
        width: 32%;
        max-width: 300px;
        min-width: 200px;
    }

    .bg-item.left-item {
        width: 145px;
    }

    .bg-item.layer-1 {
        width: 32%;
        min-width: 200px;
        max-width: 300px; 
    }

    .bg-item.right-item {
        width: 175px;
    }

    .bg-item.shadow {
        min-width: 80px;
    }

    .footer-content {
        font-size: 10px;
    }
}

/* 小螢幕尺寸 */
@media screen and (max-height: 700px) and (max-width: 635px) {
    .runner-image {
        min-width: 380px;
        bottom: 5px;
    }

    .bg-item.layer-1 {
        width: 30%;
    }

    .title-image img {
        top: -120px;
        left: 0px;
    }

    .enter-button-img {
        top: -110px;
    }
}

@media screen and (max-height: 585px) and (max-width: 635px)     {
    .title-image img {
        top: -45px;
    }

    .runner-image {
        width: 32%;
        min-width: 200px;
    }

    .bg-item.left-item {
        width: 85px;
    }

    .bg-item.right-item {
        width: 115px;
    }

    .bg-item.layer-1 {
        width: 25%;
        min-width: 180px;
    }

    .enter-button-img {
        width: 120px;
        top: -70px;
        left: 50px;
    }

    .bg-item.shadow {
        min-width: 75px;
    }
}

@media screen and (max-height: 365px) {
    .title-image img {
        top: 0px;
    }

    .runner-image {
        width: 32%;
        min-width: 200px;
    }

    .bg-item.left-item {
        width: 75px;
    }

    .bg-item.right-item {
        width: 105px;
    }

    .enter-button-img {
        width: 120px;
        top: 0px;
        left: 50px;
    }
}

@media screen and (max-height: 500px) and (min-width: 1020px) {
    .title-image img {
        width: 40%;
    }

    .bg-item.layer-1 {
        width: 40%;
    }

    .runner-image {
        width: 38%;
        min-width: 200px;
    }

    .bg-item.left-item {
        width: 145px;
    }

    .bg-item.right-item {
        width: 175px;
    }

}

