:root {
    --primary-orange: #ea5803;
    --dark-blue: #0b318f;
    --btn-blue: #007bff;
    --dialog-bg: rgba(255, 255, 255, 0.95);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Noto Sans TC', sans-serif;
    background-color: var(--primary-orange);
    color: #333;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('../images/main_bg.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.1;
    pointer-events: none;
    z-index: -1;
}

/* --- Header --- */
.main-header {
    background: url('../images/bg.png') center center no-repeat;
    background-size: cover;
    height: 575px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}

.header-content {
    z-index: 2;
    position: relative;
    padding: 0 20px;
    width: 100%;
}

.main-title {
    color: #fff;
    text-shadow: 0 4px 6px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 500px;
    align-items: center;
    /* 初始狀態 */
    opacity: 0; 
}

/* 標題動畫 class */
.animate-title {
    animation: slideDownFade 1s ease-out forwards;
}

@keyframes slideDownFade {
    0% {
        opacity: 0;
        transform: translateY(-50px); /* 從上方 50px 處開始 */
    }
    
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}


.main-title img {
    max-width: 100%;
    height: auto;
}

/* --- Intro --- */
.intro-section { 
    padding: 120px 30px; 
    max-width: 900px; 
    margin: 0 auto;
    position: relative;
    z-index: 10; 
}

.container {
    padding: 20px;
    color: #fff;
    line-height: 1.6;
    font-size: 1.2rem;
    border-radius: 15px;
}

.container p { 
    margin-bottom: 10px; 
    text-align: justify; 
}

/* --- Map Section --- */
.map-section {
    position: relative;
    padding: 10px 0 0px;
    text-align: center;
    margin-top: -150px;
    z-index: 1;
}

.section-title {
    background: #fff;
    color: #d00;
    display: inline-block;
    padding: 10px 10px;
    border-radius: 50px;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    position: relative;
    margin-top: 10px;
    z-index: 5;
}

.section-title h2 { font-size: 1.6rem; margin: 0; }
.section-title small { 
    display: inline-block; 
    font-size: 1.4rem; 
    color: #0b318f; 
    margin-top: 5px; 
    margin-left: 10px;
}

/* --- 桌機版地圖顯示區 --- */
.desktop-map-view {
    position: relative;
    width: 100%;
    max-width: 1024px;
    margin: 0 auto;
    aspect-ratio: 4 / 5; 
    z-index: 1;
    display: block;
}

/* --- 手機版文字列表區(預設隱藏) --- */
.mobile-text-list {
    display: none; /* 桌機隱藏 */
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    padding: 0 20px;
    text-align: left;
}

.map-bg {
    width: 100%;
    height: auto;
    display: block;
    margin-top: -650px;
    position: relative;
    z-index: 0;
}

/* Map Points */
.map-point {
    position: absolute;
    z-index: 2;
    opacity: 0;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    width: 24px;
    height: 24px;
    margin-left: -12px;
    margin-top: -12px;
}

.point-penang { top: 52%; left: 33%; animation-delay: 0.5s; }
.point-kl     { top: 69%; left: 43%; animation-delay: 1.5s; }
.point-johor  { top: 85%; left: 64%; animation-delay: 2.5s; }
.point-sg     { top: 91%; left: 76%; animation-delay: 3.0s; }

@keyframes popIn {
    from { opacity: 0; transform: scale(0); }
    to { opacity: 1; transform: scale(1); }
}

.dot {
    width: 24px;
    height: 24px;
    background: #d00;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(0,0,0,0.6);
}

.city-name {
    color: #fff;
    font-weight: bold;
    text-shadow: 0 2px 4px #000;
    font-size: 1.3rem;
    margin-top: 5px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 25px;
    white-space: nowrap;
}

/* 對話框通用設定 */
.dialog-box {
    background: var(--dialog-bg);
    color: #000;
    padding: 12px;
    border-radius: 8px;
    width: 370px;
    text-align: left;
    position: absolute;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 10;
}

.dialog-box h3 { 
    color: #0056b3; 
    margin-bottom: 5px; 
    font-size: 1.1rem; 
}

/* 桌機版對話框位置 */
.point-penang .dialog-box { top: -13px; left: -390px; }
.point-kl .dialog-box     { top: -16px; left: -410px; width: 380px; }
.point-johor .dialog-box  { top: -3px;  left: -390px; }
.point-sg .dialog-box     { left: 40px; width: 300px; }
.point-sg .box-upper      { top: auto; bottom: 210px; }
.point-sg .box-lower      { top: -170px; }


 
/* --- 參訪公司 --- */
.map-note {
    text-align: center;
    color: #fff100;
    font-size: 1.3rem;
    margin-top: -10px;
    margin-bottom: 20px;
    letter-spacing: 1px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}


/* Buttons */
.cta-buttons { 
    margin-top: 15px; 
    display: flex; 
    justify-content: center; 
    gap: 60px;
    position: relative;
    z-index: 20; 
}

.btn-blue {
    background: linear-gradient(to bottom, #007bff, #0056b3);
    color: #fff;
    padding: 10px 35px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    font-size: 2.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease; /* 加入過渡效果 */
}

/* 按鈕滑過效果 */
.btn-blue:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.5); /* 陰影加深 */
    filter: brightness(1.1); /* 稍微變亮 */
}

/* --- Footer --- */
.main-footer {
    background: var(--dark-blue);
    color: #fff;
    padding: 10px 10px 20px 10px;
    margin-top: 50px;
    border-top: 3px solid #FFD700;
}

.footer-container { 
    max-width: 900px; 
    margin: 0 auto; 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
}

/* 價格區塊  */
.price-info-row {
    display: flex;
    justify-content: center;
    align-items: baseline; /* 對齊文字底部 */
    gap: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 25px;
    flex-wrap: wrap; /* 小螢幕自動換行 */
}

.price-item { 
    font-size: 1.6rem; 
}

.price-item.highlight { 
    color: #fff100;
    font-weight: bold;
}

.price-big { 
    font-size: 3.8rem;
}

.divider { 
    color: rgba(255,255,255,0.5); 
    font-size: 1.4rem; 
}

.price-item .note { font-size: 1rem; color: #ccc; font-weight: normal; margin-left: 10px; }

/* 聯絡區塊 */
.contact-area { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    flex-wrap: wrap; 
    gap: 20px; 
}

/* QR & Line */
.contact-left-qr { 
    flex: 1; 
    padding: 15px; 
    border-radius: 10px;
    max-width: 450px;  
}

.qr-group { display: flex; align-items: center; gap: 15px; }
.qr-placeholder img { border-radius: 5px; }

.line-text p { 
    margin: 2px 0; 
    font-size: 1.2rem; 
}

/* 電話 */
.contact-right-phone { 
    flex: 1; 
    text-align: right; 
    min-width: 250px;
}

.contact-right-phone p { 
    font-size: 1.2rem;
    margin-top: -5px; 
}

.phone-number { 
    font-size: 3rem; 
    color: #fff; 
    font-weight: bold; 
    text-decoration: none; 
    display: block; 
    margin: 5px 0; 
}

.sub-text { 
    font-size: 1rem; 
    color: #fff100; 
}



/* --- RWD 手機版 --- */
@media (max-width: 768px) {
    
    /* 1. 表頭背景圖切換 */
    .main-header { 
        height: 400px; 
        background-position: center top; 
        background-image: url('../images/bg_m.png') !important;
        background-size: 100% auto !important; 
        background-repeat: no-repeat !important; 
    }
   
    .main-title { 
        margin-top: 200px; 
        padding: 0 10px;
    }

    .main-title img {
    /* width: 100%; */
        max-width: 380px; 
    }

    .main-footer {
        margin-top: 30px;
    }

   
    .intro-section { 
        padding: 20px 0px; 
    }

    .container { 
        padding: 20px; 
        font-size: 1rem; 
        line-height: 1.6;
        margin-top: -50px; 
    }

    /* 4. 地圖切換：隱藏桌機版，顯示手機版文字列表 */
    .desktop-map-view { display: none !important; }
    .mobile-text-list { display: block; }

    /* 手機版文字區塊動態進場效果 */
    @keyframes fadeInUpCard {
        from {
            opacity: 0;
            transform: translateY(30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }


    /* 手機版文字區塊樣式 */
    .country-block {
        margin-bottom: 30px;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 10px;
        padding: 15px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        /* 初始隱藏，讓動畫執行 */
        opacity: 0;
        animation: fadeInUpCard 0.8s ease-out forwards;
    }

    /* 設定延遲，製造層次感 */
    .country-block:nth-child(1) { animation-delay: 0.2s; }
    .country-block:nth-child(2) { animation-delay: 0.4s; }

    .country-title {
        color: var(--primary-orange);
        border-bottom: 2px solid var(--primary-orange);
        padding-bottom: 10px;
        margin-bottom: 15px;
        font-size: 1.5rem;
    }

    .city-block {
        margin-bottom: 20px;
    }

    .city-title {
        color: var(--dark-blue);
        margin-bottom: 10px;
        font-size: 1.5rem;
    }

    .company-card {
        background: #f9f9f9;
        padding: 15px;
        border-radius: 8px;
        border-left: 4px solid var(--btn-blue);
        margin-bottom: 10px;
    }

    .company-card h4 {
        color: #333;
        margin-bottom: 8px;
        font-size: 1.3rem;
    }

    .company-card p {
        font-size: 0.95rem;
        color: #555;
        line-height: 1.5;
        text-align: justify;
    }

    .mobile-text-list {
        margin: 5px auto;
        padding: 0 15px;
       
    }


    /* --- Map Section --- */
    .map-section {
        margin-top: -30px;  
    }

    .section-title {
        color: #d00;
        padding: 10px 10px;
        border-radius: 50px;
        margin-bottom: 10px;
        display: inline-block;
        width: auto;
        max-width: 90%;
        margin-left: auto;
        margin-right: auto;        
    }

    .section-title h2 { 
        font-size: 2rem;
        line-height: 32px;
    }

    .section-title small { 
        display: inline-block; 
        font-size: 1.4rem; 
        color: #0b318f; 
        margin-top: 5px; 
        margin-left: 10px;
    }


    /* 按鈕 */
    .cta-buttons {
        flex-direction: column;
        gap: 15px;
        align-items: center;
        margin-top: 0px;
    }

    .btn-blue {
        font-size: 2rem;
        padding: 12px 0;
        width: 90%; 
        text-align: center;
        display: block;
    }

    
    /* Footer */
    .price-info-row {
        flex-direction: column;
        align-items: center;
        gap: 0px;
    }

    .price-big { 
        font-size: 3rem;
    }

    .price-item {
        margin-bottom: -10px;
    }

    .divider { display: none; } /* 手機版隱藏分隔線 */
    
    .contact-area { flex-direction: column; } /* 手機版垂直排列 */
    .contact-left-qr, .contact-right-phone { 
        width: 100%; 
        text-align: center; 
        max-width: none;
    }

    .contact-right-phone p { 
        margin-top: -10px; 
    }

    .qr-group { 
        justify-content: center; 
        flex-direction: column; /* QR 圖和文字垂直排 */
    }


}