/* --- Sidebar Header & Language Switcher --- */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.sidebar-header h3 {
    margin: 0;
    padding-left: 10px;
}

.lang-switcher button {
    background: none;
    border: 1px solid #555;
    color: #c7c7c7;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s ease;
    
    /* 固定按鈕大小 */
    width: 45px;
    height: 35px;
    padding: 5px 10px;
    
    /* 字體設定 */
    font-size: 1.2em;
    font-weight: bold;
    text-align: center;
}

.lang-switcher button:hover {
    background-color: #3c3d3e;
    border-color: #777;
}

.lang-switcher button:active {
    transform: scale(0.95);
}

/* --- 基本重設與深色主題 --- */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #1e1f20; /* 深灰色背景 */
    color: #e0e0e0; /* 淡灰色文字 */
    overflow-x: hidden; /* 防止水平滾動條出現 */
}

/* --- App 主要容器 (使用 Grid 佈局) --- */
.app-container {
    display: grid;
    /* 定義兩欄：第一欄佔 1/5 (20%)，第二欄佔剩下的 4/5 (80%) */
    grid-template-columns: 1fr 4fr; 
    height: 100vh; /* 容器高度佔滿整個視窗 */
}

/* --- 左側選單 Sidebar --- */
#sidebar {
    background-color: #2a2b2c; /* 側邊欄用稍亮的灰色 */
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.sidebar-header h3 {
    margin: 0 0 30px 0;
    color: #ffffff;
    padding-left: 10px;
}

.sidebar-nav a.nav-link {
    display: block;
    color: #c7c7c7;
    text-decoration: none;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar-nav a.nav-link:hover {
    background-color: #3c3d3e;
}

.sidebar-nav a.nav-link.active {
    background-color: #4a4b4d;
    color: #ffffff;
}

/* --- 右側內容區 --- */
#content {
    padding: 40px;
    overflow-y: auto; /* 當內容過多時，只讓這個區域出現滾動條 */
}

/* 預設的標題和容器樣式 */
.container {
    max-width: 1000px;
}

/* =========================================
   打字機效果樣式
========================================= */

/* 當內容正在進行打字效果時，先將所有子元素的文字設為不可見 */
.is-typing * {
    visibility: hidden;
}

/* 閃爍的打字游標效果 */
.typing-cursor::after {
    content: '▋'; /* 您也可以換成底線 '_' 或直線 '|' */
    font-weight: 200;
    margin-left: 2px;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    from, to {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

/* =========================================
   服務方案與商品頁面樣式
========================================= */

/* 服務方案區塊之間的間距 */
.service-item {
    margin-bottom: 30px;
}

/* 分隔線樣式 */
hr {
    border: none;
    border-top: 1px solid #444;
    margin: 40px 0;
}

/* 簡報圖片畫廊 (改為單欄垂直排列) */
.slides-gallery {
    display: grid;
    grid-template-columns: 1fr; /* 強制設定為單一欄位 */
    justify-items: center; /* 讓欄位中的項目水平置中 */
    gap: 25px; /* 圖片之間的垂直間距 */
}

/* 限制圖片的最大寬度，避免在電腦大螢幕上過度放大 */
.slide-item {
    max-width: 800px; /* 您可以調整這個數值，例如 700px 或 900px */
    width: 100%;
}

.slide-item img {
    width: 100%; /* 圖片寬度充滿容器 */
    height: auto;
    border-radius: 8px; /* 圖片圓角 */
    border: 1px solid #444; /* 加上細邊框 */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 滑鼠移到圖片上時，稍微放大並加上光暈效果 */
.slide-item img:hover {
    transform: scale(1.03);
    box-shadow: 0 0 20px rgba(150, 180, 255, 0.3);
}
/* =========================================
   交錯淡入浮現動畫效果
========================================= */

/* 動畫關鍵影格 (Keyframes) 定義 */
@keyframes fadeIn-up {
    from {
        opacity: 0;
        transform: translateY(20px); /* 從下方 20px 的位置開始 */
    }
    to {
        opacity: 1;
        transform: translateY(0); /* 移動到原始位置 */
    }
}

/* 準備一個 .animated-item 類別，
  預設是透明且看不到的，等待 JavaScript 為其加上動畫。
*/
.animated-item {
    opacity: 0;
}
/* --- 聯絡表單樣式 --- */
#contact-form { max-width: 700px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: bold; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #555;
    background-color: #2a2b2c;
    color: #e0e0e0;
    font-size: 1em;
}
.form-actions button {
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    background-color: #a0c4ff;
    color: #1e1f20;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.form-actions button:hover { background-color: #ffffff; }
#form-status { margin-top: 20px; font-weight: bold; }

/* --- Placeholder 樣式 --- */
/* 針對 Chrome, Safari, Edge, Opera */
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #888; /* 設定一個較淺的灰色 */
    opacity: 1; /* 確保顏色是主要的透明度控制器 */
}

/* 針對 Firefox */
.form-group input::-moz-placeholder,
.form-group textarea::-moz-placeholder {
    color: #888;
    opacity: 1;
}

/* 針對 Internet Explorer 10-11 */
.form-group input:-ms-input-placeholder,
.form-group textarea:-ms-input-placeholder {
    color: #888;
}

/* 針對舊版 Microsoft Edge */
.form-group input::-ms-input-placeholder,
.form-group textarea::-ms-input-placeholder {
    color: #888;
}

/* --- 關於我們頁面樣式 (最終正確版) --- */

.about-image {
    float: right;         /* 關鍵：讓圖片浮動到右邊 */
    width: 20%;           /* 關鍵：設定寬度為容器的 1/5 (20%) */
    
    /* 設定圖片與周圍的間距 */
    margin-left: 25px;    /* 讓圖片左邊和文字之間有足夠空隙 */
    margin-bottom: 15px;  /* 讓圖片下方和文字之間有足夠空隙 */
}

.about-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid #444;
}

/* 這是必要的步驟，用來清除浮動效果，避免影響後續頁面排版 */
.about-container::after {
    content: "";
    display: table;
    clear: both;
}
/* --- 首頁 (Homepage) 專屬樣式 --- */

.homepage {
    max-width: 100%;
    padding: 0;
}

.text-center { text-align: center; }
.lead { font-size: 1.25rem; font-weight: 300; color: #c7c7c7; }
.section-title { font-size: 2.5rem; margin-bottom: 50px; }

/* 區塊通用樣式 */
.content-section {
    padding: 80px 40px;
}
.bg-darker {
    background-color: #1a1b1c; /* 一個更深的背景色 */
}

/* 1. 英雄區塊 */
.hero-section {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: linear-gradient(rgba(30, 31, 32, 0.7), rgba(30, 31, 32, 1)),
                url("../images/wavebackground0.png") no-repeat center center;
    background-size: cover; /* 確保背景圖能填滿整個區塊 */
}
.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    color: #fff;
}
.hero-buttons {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 20px;
}
.btn {
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}
.btn-primary {
    background-color: #a0c4ff;
    color: #1e1f20;
}
.btn-primary:hover {
    background-color: #ffffff;
    transform: translateY(-3px);
}
.btn-secondary {
    background-color: transparent;
    color: #a0c4ff;
    border: 1px solid #a0c4ff;
}
.btn-secondary:hover {
    background-color: #a0c4ff;
    color: #1e1f20;
}

/* 2 & 4. 圖文分離區塊 */
.split-layout {
    display: flex;
    align-items: center;
    gap: 50px;
    max-width: 1200px;
    margin: 0 auto;
}
.split-layout.reverse {
    flex-direction: row-reverse;
}
.split-item {
    flex: 1;
}
.split-item img {
    width: 100%;
    border-radius: 8px;
}
.split-item h3 { font-size: 1.8rem; margin-bottom: 20px; }
.split-item ul { list-style: none; padding-left: 0; }
.split-item ul li {
    font-size: 1.1rem;
    margin-bottom: 15px;
    padding-left: 30px;
    position: relative;
}
.split-item ul li::before {
    content: '✓';
    color: #a0c4ff;
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* 3. 解決方案區塊 */
.solution-image img, .solution-steps img {
    max-width: 800px;
    width: 100%;
    border-radius: 8px;
}

/* 5. 最終行動呼籲 */
.final-cta {
    padding: 100px 40px;
    background: linear-gradient(rgba(30, 31, 32, 0.8), rgba(30, 31, 32, 0.5)),
                url("../images/wavebackground.png") no-repeat center center;
    background-size: cover;
}
.final-cta h2 {
    font-size: 3rem;
    color: #fff;
    margin-bottom: 20px;
}

/* 簡易的滾動動畫 */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
/* 這個樣式會由 main.js 控制加入 */
.is-visible {
    opacity: 1;
    transform: translateY(0);
}


/* =========================================
   手機版響應式設計 (修正與優化)
========================================= */

/* --- 側邊選單切換按鈕 --- */
.sidebar-toggler {
    display: none; /* 電腦版預設隱藏 */
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    z-index: 1001; /* 確保在最上層 */
    background: #2a2b2c;
    border: 1px solid #555;
    border-left: 0;
    color: #e0e0e0;
    width: 30px;
    height: 80px;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-size: 24px;
    line-height: 80px; /* 讓箭頭垂直置中 */
    text-align: center;
    transition: left 0.3s ease-in-out;
}

/* --- 當螢幕寬度小於 768px 時套用 --- */
@media (max-width: 768px) {
    .app-container {
        /* 改為單欄佈局 */
        grid-template-columns: 1fr;
    }

    #sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px; /* 設定選單滑出後的寬度 */
        height: 100%;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        box-shadow: 2px 0 10px rgba(0,0,0,0.5); /* 增加立體感 */
    }

    #sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-toggler {
        display: block; /* 在手機上顯示按鈕 */
    }
    
    #content {
        padding: 20px; /* 調整手機版內容區的內距 */
    }

    /* --- 內容縮放與版面調整 --- */

    .content-section {
        padding: 40px 20px;
    }

    .hero-content h1, .final-cta h2 {
        font-size: 2.2rem; /* 縮小主標題字體 */
    }

    .section-title {
        font-size: 1.8rem;
    }

    .lead {
        font-size: 1.1rem;
    }

    .hero-buttons {
        flex-direction: column; /* 讓按鈕垂直排列 */
        align-items: center;
        gap: 15px;
    }

    .btn {
        padding: 12px 25px;
        width: 80%;
    }

    /* 讓圖文區塊改為垂直排列 */
    .split-layout {
        flex-direction: column !important; /* 使用 !important 覆蓋 reverse */
        gap: 30px;
    }
    
    .about-image {
        float: none; /* 取消圖片浮動 */
        width: 60%;  /* 圖片寬度 */
        margin: 0 auto 20px; /* 置中並增加下方間距 */
    }
}