/* =========================================
   1. 基礎設定 (Base & Global)
   ========================================= */
:root {
    --primary: #008C99;  /* ARBOR Cyan */
    --primary-dark: #007a85;
    --dark: #111;
    --light: #fff;
    --text-gray: #666;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; 
    color: #333; 
    line-height: 1.5;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    height: 100%;
}

/* --- 按鈕樣式 (Btn) --- */
.btn {
    display: inline-block;
    padding: 12px 35px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: #fff !important;
    border: 2px solid var(--primary);
}
.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 140, 153, 0.4);
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary) !important;
}
.btn-outline:hover {
    background: var(--primary);
    color: #fff !important;
    text-decoration: none;
}

/* 按鈕容器共用 */
.cta-group, .btn-wrapper {
    margin-top: 30px;
    display: flex;
    gap: 15px; /* 桌機版按鈕間距 */
}


/* =========================================
   2. 導航列 (Navbar)
   ========================================= */
.navbar {
    position: fixed; top: 0; left: 0; width: 100%; height: 80px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    z-index: 1000;
    display: flex; align-items: center;
}
.nav-container {
    display: flex; justify-content: space-between; align-items: center; width: 100%;
}
.logo img { height: 50px; width: auto; display: block; }

.nav-links { display: flex; align-items: center; }
.nav-links a {
    text-decoration: none; color: #333; margin-left: 30px;
    font-weight: 600; font-size: 0.95rem; text-transform: uppercase;
    transition: 0.3s;
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.mobile-only-btn { display: none; } /* 桌機隱藏 */

/* 漢堡按鈕 (桌機隱藏) */
.hamburger {
    display: none; 
    cursor: pointer;
    flex-direction: column; gap: 5px; z-index: 1001;
}
.hamburger span {
    display: block; width: 25px; height: 3px; background-color: #333;
    transition: 0.3s; border-radius: 2px;
}
/* 漢堡動畫狀態 */
.hamburger.toggle span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
.hamburger.toggle span:nth-child(2) { opacity: 0; }
.hamburger.toggle span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }


/* =========================================
   3. 第一區塊 (Hero Section)
   ========================================= */
.hero-section {
    position: relative; width: 100%; height: 100vh;
    display: flex; align-items: center; padding-top: 80px;
}
.bg-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: url('../images/ARBOR-Embedded-World-2026-header.jpg') no-repeat center center;
    background-size: cover; z-index: 1;
}

/* [關鍵修正] 增加 padding-top 將文字往下推，達到視覺垂直居中 */
.hero-content { 
    position: relative; 
    z-index: 2; 
    width: 100%; 
    padding-top: 150px; /* 您可以調整這個數字來控制高度 */
}

.ew-logo-wrapper { margin-bottom: 25px; }
.ew-logo-wrapper img { height: 60px; width: auto; }

.headline {
    font-size: 3rem; line-height: 1.25; margin-bottom: 20px;
    color: #111; font-weight: 800;
}
.sub-headline {
    font-size: 1.2rem; color: #444; margin-bottom: 35px;
    line-height: 1.6; max-width: 700px;
}
.promo-code { margin-top: 20px; font-size: 0.9rem; color: #666; font-weight: 500; }


/* =========================================
   4. 第二區塊 (EdgeX-6000)
   ========================================= */
.product-section {
    position: relative; width: 100%; min-height: 100vh;
    display: flex; align-items: center; padding: 80px 0; overflow: hidden;
}
.dark-mode {
    background: url('../images/EdgeX-6000-bg.jpg') no-repeat center center;
    background-size: cover; color: #fff;
}
.bg-overlay-dark {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 17, 32, 0.65); z-index: 1;
}
.split-layout {
    position: relative; z-index: 2; display: flex;
    align-items: center; justify-content: space-between;
    gap: 60px; height: 100%;
}
.text-block { flex: 1; }
.image-block { flex: 1; text-align: center; }

.product-title { font-size: 3.0rem; font-weight: 800; color: #F39C12; margin-bottom: 5px; line-height: 1.1; }
.product-subtitle { font-size: 1.8rem; font-weight: 300; margin-bottom: 25px; color: #fff; }
.intro-text { font-size: 1.1rem; line-height: 1.6; color: #d1d5db; margin-bottom: 40px; max-width: 90%; }
.intro-list {
    margin-bottom: 30px;    /* 列表與下方按鈕的距離 */
    padding-left: 20px;     /* 關鍵：左側縮排，讓項目符號跑出來 */
    list-style-type: disc;  /* 確保顯示圓點符號 */
}

.intro-list li {
    color: #d1d5db;         /* 跟 .intro-text 一樣的淺灰白色 */
    font-size: 1.1rem;      /* 字體大小一致 */
    line-height: 1.6;       /* 行高一致 */
    margin-bottom: 8px;     /* 每個項目之間留點呼吸空間 */
}

/* 規格表 */
.spec-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 30px;
    padding: 0; border: none; background: transparent;
}
.spec-item {
    background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px; padding: 20px; transition: all 0.3s ease;
}
.spec-item:hover {
    background: rgba(255, 255, 255, 0.1); border-color: #F39C12; transform: translateY(-5px);
}
.spec-item h4 { font-size: 0.8rem; text-transform: uppercase; color: #aaa; margin-bottom: 8px; display: inline-block; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 8px; }
.spec-item p { font-size: 1.1rem; font-weight: 500; line-height: 1.3; color: #fff; }
.highlight-num { color: #F39C12; font-weight: 700; font-size: 1.25rem; }

.product-img-wrapper img {
    max-width: 100%; height: auto; filter: drop-shadow(0 15px 30px rgba(0,0,0,0.5));
    transition: transform 0.5s ease;
}
.product-img-wrapper:hover img { transform: translateY(-10px); }


/* =========================================
   5. 第三區塊 (AI System) & Lightbox
   ========================================= */
#ai-system {
    background: url('../images/ARES-1983H-AI-background.jpg') no-repeat center center;
    background-size: cover; position: relative;
}
#ai-system::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.45); z-index: 0;
}
#ai-system .container { position: relative; z-index: 2; }
.light-mode { background-color: #f8f9fa; color: #333; }

.text-cyan { color: var(--primary); }
.text-dark { color: #222; margin-bottom: 20px; font-weight: 400; }
.text-gray { color: #666; }

.product-hero-img {
    width: 80%; max-width: 375px; height: auto;
    transition: transform 0.3s ease; display: block; margin: 0 auto;
}
.video-trigger-wrapper { position: relative; display: inline-block; cursor: pointer; }
.video-trigger-wrapper:hover .product-hero-img { transform: scale(0.98); opacity: 0.9; }

.play-btn-overlay {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 80px; height: 80px; background: rgba(255, 255, 255, 0.9);
    border-radius: 50%; box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex; align-items: center; justify-content: center; z-index: 10;
    transition: all 0.3s ease;
}
.play-icon {
    width: 0; height: 0; border-style: solid; border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent var(--primary); margin-left: 5px;
}
.pulse-ring {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    border-radius: 50%; border: 2px solid var(--primary);
    animation: pulse-animation 2s infinite; z-index: -1;
}
@keyframes pulse-animation {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.6); opacity: 0; }
}
.video-trigger-wrapper:hover .play-btn-overlay { background: var(--primary); transform: translate(-50%, -50%) scale(1.1); }
.video-trigger-wrapper:hover .play-icon { border-color: transparent transparent transparent #fff; }

.feature-card {
    background: #fff; padding: 25px 35px; border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.06); margin: 30px 0;
    display: inline-flex; align-items: center; gap: 30px;
}
#tflops-counter { display: inline-block; min-width: 80px; text-align: right; }
.big-stat { font-size: 3.5rem; font-weight: 800; color: #111; line-height: 1; }
.unit { font-size: 1.2rem; font-weight: 600; color: #888; margin-left: 15px; }
.feature-divider { width: 1px; height: 50px; background: #eee; }

/* 影片燈箱 */
.modal-overlay {
    display: none; position: fixed; z-index: 9999;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.9);
    align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.3s ease;
}
.modal-overlay.show { display: flex; opacity: 1; }
.modal-content {
    position: relative; width: 90%; max-width: 1000px; aspect-ratio: 16 / 9;
    background: #000; box-shadow: 0 0 50px rgba(0, 140, 153, 0.5);
    overflow: hidden; border-radius: 8px; margin: auto; padding: 0;
}
.close-modal {
    position: absolute; top: -40px; right: 0; color: #fff;
    font-size: 40px; font-weight: bold; cursor: pointer;
}
.video-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
#youtube-placeholder { width: 100%; height: 100%; display: block; }
#youtube-placeholder iframe { width: 100% !important; height: 100% !important; display: block; border: none; }


/* =========================================
   6. 第四區塊 (Product List)
   ========================================= */
.list-section {
    background-color: #f4f7f9; padding: 100px 0;
    min-height: auto; height: auto; display: block;
}
.section-header { margin-bottom: 80px; }
.section-title { font-size: 2.5rem; font-weight: 800; color: #333; margin-bottom: 10px; }
.section-desc { font-size: 1.2rem; color: #666; }

.product-zigzag-container { display: flex; flex-direction: column; gap: 0; }

.zigzag-item {
    display: flex; align-items: center; justify-content: space-between;
    gap: 60px; margin-bottom: 100px;
    opacity: 0; transform: translateY(50px); transition: all 0.8s ease-out;
}
.zigzag-item.visible { opacity: 1; transform: translateY(0); }
.zigzag-item:nth-child(even) { flex-direction: row-reverse; }

.z-img-wrapper {
    flex: 1; position: relative; border-radius: 12px;
    overflow: hidden; box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    background: #fff; aspect-ratio: 4 / 3;
}
.z-img-wrapper img {
    width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease;
}
.zigzag-item:hover .z-img-wrapper img { transform: scale(1.05); }

.z-text-wrapper { flex: 1; position: relative; padding: 20px; }
.z-text-wrapper::before {
    content: ''; position: absolute; top: 50%; transform: translateY(-50%);
    border-style: solid; left: -10px; border-width: 10px 10px 10px 0;
    border-color: transparent transparent transparent transparent;
}
.z-tag {
    display: inline-block; padding: 6px 15px; border-radius: 20px;
    font-size: 0.85rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1px; margin-bottom: 15px; color: #fff;
}
/* 產品標籤顏色 */
.tag-handheld { background-color: #F39C12; }
.tag-boxpc { background-color: #008C99; }
.tag-hmi { background-color: #2C3E50; }
.tag-board { background-color: #3d7cc1; }

.z-title { font-size: 2rem; font-weight: 700; color: #222; margin-bottom: 15px; }
.z-desc { font-size: 1.1rem; color: #666; line-height: 1.6; margin-bottom: 25px; }
.z-link {
    color: var(--primary); text-decoration: none; font-weight: 700;
    font-size: 1.1rem; display: inline-flex; align-items: center; transition: 0.3s;
}
.z-link:hover { padding-left: 10px; }


/* =========================================
   7. 預約燈箱 (Book Demo Modal)
   ========================================= */
.demo-modal-content {
    position: relative; width: 90%; max-width: 600px; height: 85vh;
    background: #fff; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    margin: auto; overflow: hidden; display: flex; flex-direction: column;
}
.modal-header-bar {
    height: 60px; background-color: #f8f9fa; border-bottom: 1px solid #eee;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; flex-shrink: 0;
}
.close-demo-modal {
    position: static; color: #666; font-size: 36px; font-weight: bold;
    cursor: pointer; line-height: 1; transition: 0.3s;
    display: flex; align-items: center; height: 100%;
}
.close-demo-modal:hover { color: #008C99; }
#demo-placeholder { width: 100%; flex: 1; background: #fff; overflow: hidden; }


/* =========================================
   8. Floor Plan & Footer
   ========================================= */
.floor-plan-section { padding: 80px 0; background: #eef2f5; }
.floor-plan-card {
    background: #fff; border-radius: 20px; box-shadow: 0 20px 50px rgba(0,0,0,0.08);
    overflow: hidden; display: flex; align-items: stretch;
}
.fp-info { flex: 1; padding: 60px; display: flex; flex-direction: column; justify-content: center; }
.fp-tag { display: inline-block; color: #aaa; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 10px; }
.fp-title { font-size: 2.5rem; font-weight: 800; color: #222; margin-bottom: 30px; }
.fp-details { display: flex; align-items: center; gap: 30px; margin-bottom: 30px; }
.fp-item { display: flex; flex-direction: column; }
.fp-label { font-size: 0.9rem; color: #888; text-transform: uppercase; }
.fp-value { font-size: 3rem; font-weight: 800; line-height: 1; color: #333; }
.fp-divider { width: 2px; height: 50px; background: #eee; }
.fp-desc { color: #666; margin-bottom: 30px; line-height: 1.6; }

.fp-map { flex: 1.2; background: #ddd; position: relative; min-height: 400px; }
.fp-map img { width: 100%; height: 100%; object-fit: cover; }

/* Footer */
.site-footer {
    background-color: #0b121e; color: #fff; padding: 50px 0 30px;
    text-align: center; border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.social-links { margin-bottom: 25px; display: flex; justify-content: center; gap: 25px; }
.social-links a {
    display: flex; align-items: center; justify-content: center;
    width: 45px; height: 45px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.1); color: #fff;
    font-size: 1.2rem; text-decoration: none; transition: all 0.3s ease;
}
.social-links a:hover { background-color: #008C99; transform: translateY(-5px); }
.copyright-text p { font-size: 0.9rem; color: #8892b0; margin-bottom: 5px; }
.footer-note { font-size: 0.8rem !important; opacity: 0.6; }


/* =========================================
   9. 最終版 RWD 手機版修正 (Mobile Fixes)
   ========================================= */
/* 注意：這個 block 必須放在檔案最下方 */
@media (max-width: 768px) {
    
    /* [關鍵修正] 加大手機版左右內縮距離 (原本是 20px，改為 30px) */
    .container {
        padding: 0 30px; 
    }

    /* 1. 漢堡選單修正 */
    .hamburger { display: flex; }
    .nav-links {
        position: fixed; top: 0; right: -100%; width: 80%; height: 100vh;
        background: #fff; flex-direction: column; justify-content: center; align-items: center;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1); transition: 0.4s ease-in-out; z-index: 1000;
    }
    .nav-links.nav-active { right: 0; }
    .nav-links a { margin: 15px 0; font-size: 1.2rem; display: block; }
    .mobile-only-btn { margin-top: 20px; display: block; }

    /* 2. 第一區塊 (Hero) 修正 */
    .hero-section {
        padding-top: 130px; 
        align-items: center; text-align: center;
        background-position: center top;
        height: auto; min-height: 100vh;
    }
    /* 垂直置中修正 (保留之前的 150px 設定) */
    .hero-content { 
        align-items: center; 
        padding-bottom: 50px; 
        padding-top: 150px; 
    }
    
    /* 2.2 大標文字縮小 */
    .headline { font-size: 2.2rem; } 
    .sub-headline { font-size: 1rem; }

    /* 2.3 & 3.1 按鈕組修正 */
    .cta-group, .btn-wrapper {
        display: flex; flex-direction: column; gap: 20px;
        width: 100%; align-items: center;
    }
    .btn, .btn-primary, .btn-outline {
        margin: 0; width: 100%; max-width: 320px; /* 稍微放寬按鈕最大寬度 */
    }

    /* 3. 其他區塊通用修正 */
    .split-layout { flex-direction: column; padding: 40px 0; gap: 40px; }
    .reverse-mobile { flex-direction: column-reverse; }
    .spec-grid { grid-template-columns: 1fr; gap: 15px; }
    
    /* 4.1 第三區塊燈箱修正 */
    .video-trigger-wrapper .play-btn-overlay {
        transform: translate(-50%, -50%) scale(1.1);
        background: rgba(255, 255, 255, 0.9);
    }
    .product-hero-img { opacity: 1; transform: scale(1); }

    /* 5.1 產品列表修正：強制顯示 */
    .zigzag-item {
        opacity: 1 !important; transform: none !important;
        flex-direction: column !important; margin-bottom: 60px;
    }
    .z-img-wrapper { width: 100%; aspect-ratio: 16/9; }
    .z-text-wrapper { padding: 20px 0 0 0; text-align: center; }
    .z-text-wrapper::before { display: none; }

    /* 6. Floor Plan 修正 */
    .floor-plan-card {
        flex-direction: column; width: 100%; max-width: 100%; border-radius: 12px;
    }
    .fp-info { padding: 40px 20px; } /* 這裡保留內部 padding，因為外層 container 已經有縮了 */
    .fp-map { width: 100%; height: 250px; min-height: auto; }
    
    /* 防止左右晃動 */
    body, html { overflow-x: hidden; }
}
/* =========================================
   10. 特殊修正：針對矮螢幕筆電 (Height Fix)
   ========================================= */
/* 當螢幕高度小於 700px 時 (例如 1366x768 或 1280x720 的筆電) */
@media (max-height: 700px) {
    
    .hero-section {
        /* 1. 取消強制 100vh，改用最小高度，內容多時可以捲動 */
        height: auto; 
        min-height: 100vh;
        /* 減少上方留白 */
        padding-top: 100px; 
    }

    .hero-content {
        /* 2. 大幅減少往下推的距離 (原本是 150px) */
        padding-top: 60px; 
        padding-bottom: 60px; /* 底部留點空間 */
    }

    /* 3. 稍微縮小字體，節省垂直空間 */
    .headline { font-size: 2.2rem; margin-bottom: 15px; }
    .sub-headline { font-size: 1rem; margin-bottom: 25px; }
    .ew-logo-wrapper img { height: 50px; } /* Logo 也縮小一點 */
    
    /* 4. 讓按鈕稍微緊湊一點 */
    .cta-group { margin-top: 20px; }
}