/* 共用 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@100..900&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel="stylesheet"');

*{ box-sizing: border-box; }

html, body {
    margin: 0;
    background-size: cover;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    font-family: "Noto Sans TC", "Noto Sans", "Microsoft JhengHei", sans-serif;
    font-weight: 400;
    font-size: 20px;
    position: relative;
     -webkit-font-smoothing:antialiased;
    -moz-osx-font-smoothing:grayscale;
    height:100%;
}

body {
    margin: 0;
    background-color: #f2f2f2; /* 灰色網站底 */
    font-family: sans-serif;
    position: relative;
    z-index: 0;
}

:root{
    /* 背景圖（請換成你的圖檔路徑） */
    --desktop-img: url("../img/bg_pc.png");
    --mobile-img: url("../img/bg_mb.png");

    /* 設計圖尺寸（背景圖在設計時的寬/高）(必須與圖片實際設計一致) */
    --img-w: 1180;  /* px */
    --img-h: 650;   /* px */

    /* 斷點：小於或等於這個視為手機（可改） */
    --mobile-break: 700px;

    /* 背景外層頁面色（如果圖有透明洞，會看到這個色） */
    --page-bg: #f3f3f3;

    /* 內框（可視為圖中白邊內層 rectangle）在設計圖中的 offset px：
        這裡以你前面用過的值（inner rect x=20, y=20, width=1140, height=610）為例 */
    --inner-offset-left: 20;  /* px */
    --inner-offset-top: 20;   /* px */
    --inner-offset-right: 20; /* px */
    --inner-offset-bottom: 20;/* px */

    /* 文字/按鈕等的最大寬（可選） */
    --content-max-width: 960px;
}

/* 一些換算後的百分比（由設計尺寸計算得出）：
    left% = 20 / 1180 * 100% ≈ 1.6949% -> 四捨五入用 1.7%
    top%  = 20 / 650  * 100% ≈ 3.0769% -> 3.08%
    right/bottom 同理 */
/* 我把數值也放在 CSS 變數裡以便閱讀 */
:root{
    --inner-left-pct: 1.7%;
    --inner-right-pct: 1.7%;
    --inner-top-pct: 3.08%;
    --inner-bottom-pct: 3.08%;
}

/* 基本頁面 */

/* 海報容器：aspect-ratio 必須與背景圖（設計寬高）一致 */
.poster {
    width: 100%;
    max-width: var(--img-w);
    margin: 0 auto;
    position: relative;
    box-sizing: border-box;

    /* fallback (若不支援 aspect-ratio) 使用 padding-bottom 保持比例：
        padding-bottom = (height / width) * 100% */
    padding-bottom: calc((var(--img-h) / var(--img-w)) * 100%);
    background-color: var(--page-bg);
    background-image: var(--desktop-img);
    background-repeat: no-repeat;
    background-position: center;
    /* background-size: 100% 100% 在 container 與圖的比例一致時不會造成變形 */
    background-size: 100% 100%;
    /* 視覺微化 */
    /* box-shadow: 0 4px 14px rgba(0,0,0,0.05); */
    overflow: visible;
    margin-top: 14px;
}

/* 如果支援 aspect-ratio，使用它（較乾淨） */
@supports (aspect-ratio: 1 / 1) {
    .poster { padding-bottom: 0; aspect-ratio: calc(var(--img-w) / var(--img-h)); }
}

/* mobile: 換背景與比例（同時保持內框百分比） */
@media (max-width: var(--mobile-break)), (orientation: portrait) {
    .poster {
        background-image: var(--mobile-img);
    }
}

/* 內容放在「內框」之內：使用絕對定位並以百分比 inset（不會因為尺寸改變而跑位） */
.poster-content{
    position: absolute;
    left: var(--inner-left-pct);
    right: var(--inner-right-pct);
    top: var(--inner-top-pct);
    bottom: var(--inner-bottom-pct);
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 46% 1fr; /* 左圖 + 右文案（示意） */
    gap: 20px;
    align-items: start;
    max-width: var(--content-max-width);
    margin: 0 auto;
}

/* 小螢幕改成單欄（上下排列） */
@media (max-width: 700px), (orientation: portrait) {
    .poster-content{ grid-template-columns: 1fr; padding: 10px; gap: 12px; }
}

.site-content {
    position: relative;
    z-index: 1;
    padding: 60px;
}
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 97%;
    margin: auto;
    height: 100vh;
    /* background-color: #CEECF4; */
}

.content-container {
    display: flex;
    flex-direction: row;
    width: 100%;
    max-width: 1600px;
    height: 80vh;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.header {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90%;
    max-width: 1200px;
    background-color: #fff;
    border-radius: 0px 0px 60px 60px;
    padding: 7px 0px;
}

.menu {
    display: flex;
    align-items: center;
}

.logo {
    width: 35px;
    margin-right: 45px;
}

.logo img {
    width: 100%;
}

.menu-list {
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    color: #000;
    padding: 0 25px;
}

.menu-list:hover {
    color: #009944;
}

.menu-list.active {
    color: #009944;
}

.menu-icon {
    width: 24px;
    margin-right: 5px;
}

.menu-divider {
    height: 35px;
    border-left: 1px solid #E663A5;
    margin: 0 10px;
}

/* 首頁 */

/* 隱藏 mobile-only break（桌機看不到） */
.mobile-br { 
    display: none; 
}

.home-left {
    flex: 1;
    max-width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* overflow: hidden; */
    z-index: 2;
}

.home-people {
    width: 84%;
    /* max-width: 570px;
    min-width: 280px; */
    padding: 0;
    position: relative;
    top: 5%;
    left: 3%;
}


.home-people img {
    width: 100%;
    height: auto;
    max-height: 100vh;
    object-fit: contain;
}

.home-right {
    flex: 1;
    max-width: 62%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    overflow: hidden;
    z-index: 1;
}

.event-container {
    width: 40%;
    min-width: 300px;
    margin-top: 25px;
}

.event-container img {
    width: 100%;
}

.event-info {
    width: 90%;
    max-width: 800px;
    height: 70vh;
    min-height: unset;
    background-color: #ffffff;
    border: 3px solid #C5384A;
    padding: 20px;
    border-radius: 45px;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

.event-info h2 {
    font-size: 24px;
    text-align: center;
    margin-top: 0px;
    margin-bottom: 10px;
    padding: 0 10px;
}

.event-info_2 h2 {
    margin-bottom: 30px;
}

.event-text {
    max-height: none;
    padding: 0 20px;
    overflow: auto;
    font-size: 14px;
}

.event-text-p {
    font-size: 14px;
}
.event-text p {
    margin: 0;
}

.prize-title img{
    width: 120px;
    padding: 10px 0;
}

.prize-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 15px 0px;
    width: 95%;
    margin: 0 auto;
}

.prize-container img {
    max-width: 100%;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.prize-second {
    padding: 20px 10px;
}

.prize-second img {
    max-width: 180px;
    /* width: 110px; */
    height: auto;
    object-fit: contain;
}

.small-text {
    font-size: 14px;
    margin-top: 0px;
    text-align: center;
}

.footer {
    width: 90%;
    display: flex;
    align-items: center;
    position: fixed;
    bottom: -15px;
}

.post-logo {
    width: 56px;
    margin: 10px 10px 20px 10px;
}

.post-logo img {
    width: 100%;
}

.footer-bottom {
    width: 100%;
}

.post-logo-text {
    height: 38px;
    background-color: #269352;
    display: flex;
    align-items: center;
}

.post-logo-text img {
    height: 60%;
    margin-left: 5px;
}

.footer-text {
    font-size: 12px;
    display: flex;
}

.footer-text p {
    margin-right: 10px;
    margin-top: 0px;
}

.post-logo-color {
    width: 75px;
    position: absolute;
    right: 0px;
    bottom: 15px;
}

.post-logo-color img {
    width: 100%;
}

/* 個人資料登錄 */
.draw-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.list-title {
    margin-bottom: 5px;
    display: block;
    font-size: 14px;
}

.draw-input {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    box-sizing: border-box;
    margin-bottom: 5px;
}

.verification-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.code-input {
    width: 50%;
    box-sizing: border-box;
}

.verification-code {
    width: 50%;
    background-color: #009944;
    border: 1px solid #ccc;
    color: #fff;
    text-align: center;
    padding: 10px 10px;
    font-size: 14px;
    text-align: left;
}

.draw-btn {
    margin-top: 20px;
    padding: 12px;
    font-size: 16px;
    background-color: #009944;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    width: 50%;
    margin: 20px auto 0 auto;
    display: block;
}

.draw-btn:hover {
    background-color: #D12A46;
}

.link {
    width: 50%;
    margin: 0px auto;
}

.link img {
    width: 100%;
    margin: 5px 0px;
}

.error-message {
    color: #D12A46;
    font-size: 12px;
    margin-bottom: 4px;
}

/* 判斷彈窗 */
.popup {
    position: fixed;
    z-index: 1;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3;
}

.popup-content {
    background: #fff;
    width: 90%;
    max-width: 1000px;
    border-radius: 30px;
    padding: 30px 24px;
    max-height: 90vh;
    position: relative;
    box-sizing: border-box;
    z-index: 3;
}

.popup-title {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
}

.popup-text {
    font-size: 14px;
    line-height: 1.6;
    height: 50vh;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    background-color: #fafafa;
}

.checkbox-area {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.checkbox-area input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
}

.checkbox-area input.error {
    outline: 2px solid red;
    border-radius: 2px;
}

.checkbox-area label {
    font-size: 14px;
    line-height: 1.4;
}

.warning-text {
    text-align: center;
    font-size: 13px;
    margin-bottom: 16px;
}

.warning-text.error {
    color: red;
}

.confirm-button {
    background-color: #009944;
    margin: 16px auto 0 auto;
    display: block;
    align-self: center;
    padding: 12px 40px;
    color: white;
    font-size: 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.close-btn {
    width: 36px;
    height: 36px;
    position: absolute;
    top: 12px;
    right: 16px;
    cursor: pointer;
}

.close-btn img {
    width: 100%;
}

.popup-content2 {
    background-color: white;
    padding: 40px 30px;
    border-radius: 10px;
    text-align: center;
    width: 300px;
}

.popup-content2 h2 {
    margin-top: 0;
    font-size: 24px;
}

.popup-content2 p {
    margin-top: 0;
    font-size: 16px;
}

.popup-content2 button {
    background-color: #009944;
    margin: 16px auto 0 auto;
    display: block;
    align-self: center;
    padding: 12px 60px;
    color: white;
    font-size: 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

ul.flex-list {
    list-style: none;
    padding: 0;
}

ul.flex-list li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1em;
}

ul.flex-list li::before {
    content: "•";
    margin-right: 0.5em;
    line-height: 1.5;
}

/* RWD */
@media (max-width: 1366px) {
    /* 手機顯示換行 */
    .mobile-br {
        display: block; 
    } 

    .event-info {
        max-width: 95%;
        z-index: -1;
        padding: 20px 5px;
    }
}

@media (max-width: 1024px) {
    .event-info {
        height: 44vh;
    }
    .home-people {
        top: 0;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .logo {
        margin-right: 10px;
    }

    .menu-list {
        flex-direction: column;
        padding: 0px 10px;
    }

    .content-container {
        flex-direction: column;
        align-items: center;
    }

    .home-left {
        flex: none;
        max-width: 85%;
        margin: 40px 0 20px;
        /* z-index: 2; */
    }

    .home-right {
        flex: none;
        width: 100%;
        max-width: 85%;
        max-height: 48vh;
        display: flex;
        flex-direction: column;
        gap: 20px;
        margin-top: -20px;
    }

    .home-people {
        max-width: 100%;
        min-width: 100px;
        padding: 0;
        margin: 0 0 -25px;
        top: 0%;
        left: 0%;
    }

    .home-people img {
        content: url('../img/mb/people.png');
        width: 100%;
        min-width: unset;
    }

    .event-container {
        margin: 0px auto;
        min-width: 280px;
    }

    .event-container img {
        width: 100%;
    }

    .prize-container {
        max-width: 90%;
        min-width: 100px;
        padding: 10px 0;
        margin: 0px auto 10px;
    }

    /* .prize-container img {
        content: url('../img/mb/gift.png');
        width: 100%;
        min-width: unset;
    } */

    .prize_1 {
        content: url('../img/mb/gift_1.png');
        width: 100%;
        min-width: unset;
    }

    .prize_2 {
        content: url('../img/mb/gift_2.png');
        width: 100%;
        min-width: unset;
    }

    .event-info {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 20px;
        /* height: 50vh; */
        border-radius: 30px;
        margin-bottom: 0;
        display: flex;
        flex-direction: column;
    }

    .link {
        width: 50%;
    }

    .footer {
        width: 100%;
        bottom: -8px;
    }

    .footer-text {
        font-size: 12px;
        display: flex;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .footer-text p {
        margin: 0px;
        flex: 1 1 45%;
    }
}

@media (min-width: 541px) and (max-width: 767px) {
    .header {
        width: 100%;
    }

    .logo {
        margin-right: 5px;
    }

    .menu-list {
        flex-direction: column;
        padding: 0px 4px;
        font-size: 14px;
    }

    .content-container {
        flex-direction: column;
        justify-content: center;
    }

    .home-left {
        flex: none;
        max-width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        /* overflow: hidden; */
        margin-bottom: 0px;
        margin-top: 10px;
        /* z-index: 2; */
    }

    .home-people {
        width: 70%;
        min-width: 380px;
        padding: 0;
        margin: 0 0 5px;
        top: 0%;
        left: 0%;
    }

    .home-people img {
        content: url('../img/mb/people.png');
        width: 100%;
        /* min-width: unset; */
    }

    .home-right {
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .event-container {
        display: none;
    }

    .event-info {
        width: 100%;
        max-width: 80%;
        height: 50vh;
        min-height: unset;
        padding: 20px;
        border-radius: 30px;
        margin-bottom: 0;
        display: flex;
        flex-direction: column;
    }

    .event-text {
        padding: 0 10px;
    }

    .event-info h2 {
        font-size: 24px;
        text-align: center;
        padding: 0 10px;
        margin-top: 0px;
        margin-bottom: 10px;
    }

    .prize-container {
        max-width: 70%;
        min-width: 100px;
        padding: 0;
        margin: 0 auto 10px;
    }

    .prize-container img {
        /* content: url('../img/mb/gift.png'); */
        width: 100%;
        min-width: unset;
    }

    .footer {
        width: 100%;
        bottom: 0px;
    }

    .post-logo {
        width: 28px;
        margin: -40px 2px 0px 0px;
    }

    .footer-bottom {
        width: 100%;
    }

    .post-logo-text {
        height: 17px;
    }

    .footer-text {
        font-size: 12px;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
    }

    .footer-text p {
        margin: 0px;
    }

    .footer-text p:nth-child(1),
    .footer-text p:nth-child(2) {
        flex: 1 1 35%;
    }

    .footer-text p:nth-child(3),
    .footer-text p:nth-child(4) {
        flex: 1 1 45%;
    }

    .post-logo-color {
        width: 30px;
        right: 0px;
        bottom: 35px;
    }

    .link {
        width: 75%;
    }
}


@media (max-width: 540px) {
    .header {
        width: 100%;
        border-radius: 0px 0px 40px 40px;
    }

    .logo {
        margin-right: 20px;
    }

    .menu-list {
        flex-direction: column;
        padding: 0px 5px;
        font-size: 11px;
    }

    .menu-icon {
        width: 20px;
    }

    .logo {
        width: 25px;
        margin-right: 5px;
    }

    .menu-divider {
        height: 35px;
        margin: 0 4px;
    }

    .content-container {
        flex-direction: column;
        justify-content: center;
        height: 75vh;
    }

    .home-left {
        flex: none;
        max-width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 0px;
        /* z-index: 2; */
    }

    .home-right {
        margin-top: -18px;
    }


    .home-people {
        width: 70%;
        min-width: 378px;
        padding: 0;
        margin: 30px 0 0px;
        top: 0%;
        left: 0%;
    }
    
    .home-people img {
        content: url('../img/mb/people.png');
        width: 100%;
        min-width: unset;
    }


    .home-right {
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .event-container {
        display: none;
    }

    .event-info {
        width: 90%;
        max-width: 100%;
        height: 46vh;
        margin-bottom: 0;
    }

    .event-text {
        padding: 0 10px;
    }

    .event-info h2 {
        font-size: 20px;
    }

    .event-text p {
        font-size: 14px;
    }

    .flex-list {
        font-size: 14px;
    }

    .prize-container {
        max-width: 100%;
        margin: 0 auto 10px;
        padding: 10px 0;
    }

    .prize-container img {
        /* content: url('../img/mb/gift.png'); */
        width: 100%;
        min-width: unset;
    }

    .draw-btn {
        width: 80%;
    }

    .footer {
        width: 100%;
        bottom: 0px;
    }

    .post-logo {
        width: 28px;
        margin: -20px 2px 0px 0px;
    }

    .footer-bottom {
        width: 100%;
    }

    .post-logo-text {
        height: 17px;
    }

    .footer-text {
        font-size: 8px;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 5px;
    }

    .footer-text p {
        margin: 0px;
    }

    .footer-text p:nth-child(1),
    .footer-text p:nth-child(2) {
        flex: 1 1 30%;
    }

    .footer-text p:nth-child(3),
    .footer-text p:nth-child(4) {
        flex: 1 1 45%;
    }

    .post-logo-color {
        width: 30px;
        right: 0px;
        bottom: 10px;
    }

    .close-btn {
        width: 24px;
        height: 24px;
    }

    .link {
        width: 75%;
    }

}

@media (max-width: 420px) {
    
    .event-info {
        height: 46vh;
    }

    .home-right {
        margin-top: -5px;
    }
    .home-people {
        width: 70%;
        min-width: 340px;
        margin: 26px 0 -10px;
        top: 0%;
        left: 0%;
    }

    .link {
        width: 75%;
    }
}

@media (max-width: 375px) {

    .home-people {
        width: 70%;
        min-width: 330px;
        padding: 10px 0 0 ;
        margin: 0px;
        top: 5%;
        left: 0%;
    }
    .home-left {
        margin-top: 10px;
        /* z-index: 120; */
    }

    .home-right {
        margin-top: -10px;
    }

    .event-info {
        height: 44vh;
        border-radius: 20px;
    }

    .event-text {
        padding: 0 5px;
    }

    .event-info h2 {
        font-size: 20px;
        padding: 0 3px;
    }

    .link {
        width: 75%;
    }

}

@media (max-width: 360px) {

    .link {
        width: 75%;
    }
}

@media (max-width: 344px) {

    .home-people {
        min-width: 300px;
        margin: 0px;
        top: 0%;
        left: 0%;
    }

    .event-info {
        height: 60vh;
    }
}