/* =========================================
   1. RESET & VARIABLES (基礎設定)
   ========================================= */
:root {
    --c-bg: #F9F9F7;            
    --c-text-main: #2D2D2D;     
    --c-text-muted: #666666;    
    --c-border: #E0E0E0;        
    --c-accent: #4A5568;        
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "Helvetica Neue", Arial, sans-serif;
    background-color: var(--c-bg); 
    color: var(--c-text-main);
    line-height: 1.6;
    overflow-x: hidden; /* 防止左右滑動白邊 */
}

a { text-decoration: none; color: inherit; transition: opacity 0.2s; }
a:hover { opacity: 0.7; }

/* =========================================
   2. HEADER & NAVIGATION (導覽列)
   ========================================= */
header {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding: 0 2rem; 
    height: 80px; 
    border-bottom: 1px solid var(--c-border);
    background: #fff; 
    z-index: 100; 
    position: relative;
}

.brand-logo { height: 36px; width: auto; display: block; } 

nav { display: flex; align-items: center; }
nav a { margin-left: 2rem; font-size: 0.95rem; color: var(--c-text-main); white-space: nowrap; }
nav a.active { font-weight: bold; border-bottom: 2px solid var(--c-text-main); }

.lang-switch { border-left: 1px solid #ccc; padding-left: 20px; margin-left: 20px; font-size: 0.9rem; display: flex; }
.lang-switch a { margin-left: 10px; color: #999; }
.lang-switch a.active { color: var(--c-text-main); font-weight: bold; }

/* =========================================
   3. HERO SECTIONS (頁首大圖)
   ========================================= */
.page-hero {
    padding: 6rem 2rem;
    
    /* 關鍵修正：背景圖設定 */
    background-size: cover;       /* 強制填滿 */
    background-position: center;  /* 居中對齊 */
    background-repeat: no-repeat; /* 禁止重複！ */
    
    position: relative;
    color: white;
    background-color: #2D3748; 
}

/* 濾鏡遮罩 */
.page-hero::before { 
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(45, 55, 72, 0.4); 
    backdrop-filter: grayscale(30%); 
    z-index: 1;
}
.page-hero > * { position: relative; z-index: 2; }

.page-hero h1 { font-size: 2.8rem; margin-bottom: 1rem; text-shadow: 0 4px 12px rgba(0,0,0,0.6); }
.page-hero p { color: #f0f0f0; max-width: 600px; font-size: 1.1rem; text-shadow: 0 2px 8px rgba(0,0,0,0.6); font-weight: 500; }

/* =========================================
   4. HOME SPLIT SCREEN (首頁左右分流)
   ========================================= */
.split-screen { display: flex; height: calc(100vh - 80px); width: 100%; }

.split-panel {
    flex: 1;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    text-align: center; padding: 2rem;
    
    /* 1. 設定背景底色：深灰色 (讓它跟圖片載入前的顏色一樣) */
    background-color: #2D2D2D; 
    
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    
    position: relative;
    color: white; 
    text-shadow: 0 4px 15px rgba(0,0,0,0.8); 
}
.split-panel::before {
    content: ''; position: absolute; top:0; left:0; right:0; bottom:0;
    background: rgba(30, 40, 55, 0.5); 
    z-index: 1; transition: background 0.3s;
}
.split-panel:hover::before { background: rgba(30, 40, 55, 0.3); }
.split-panel > * { position: relative; z-index: 2; }
.split-panel h2 { font-size: 2.5rem; margin-bottom: 1rem; font-weight: 400; letter-spacing: 0.05em; }
.split-panel p { color: #fff; margin-bottom: 2rem; font-size: 1.1rem; max-width: 400px; font-weight: 600; }

/* =========================================
   5. UTILS & GRID (通用排版)
   ========================================= */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

.grid-3 { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 2rem; 
    padding-bottom: 4rem; 
}

/* =========================================
   6. CARDS & IMAGES (圖片優化 & 浮水印隱藏)
   ========================================= */
.card { 
    background: white; 
    border: 1px solid var(--c-border); 
    padding: 2rem; 
    transition: transform 0.3s; 
    overflow: hidden; /* 確保放大的圖片邊緣被切掉 */
}
.card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.05); }

/* 卡片圖片設定 */
.card img { 
    width: 100%; 
    height: 200px; 
    object-fit: cover; 
    margin-bottom: 1.5rem; 
    
    filter: grayscale(100%); 
    
    /* 【關鍵修正】放大 5% (1.05)，確保浮水印被擠出去 */
    transform: scale(1.05); 
    
    transition: transform 0.4s ease, filter 0.4s ease; 
}

/* Systems 頁面 & Hero 圖片強制彩色，但維持放大 */
.card img[src*="sys-"], .card img[src*="hero-"] {
    filter: none !important; 
}

.card:hover img { 
    filter: grayscale(0%);
    /* 滑鼠移上去再放大一點 */
    transform: scale(1.08); 
}

.card h3 { margin-bottom: 0.5rem; }
.card p { color: var(--c-text-muted); font-size: 0.9rem; }

.btn { padding: 12px 28px; background-color: #fff; color: #000; font-weight:bold; border-radius: 2px; border:none; cursor:pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
.btn:hover { background-color: #f0f0f0; }

.content-image { width: 100%; height: auto; border-radius: 4px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); display: block; }


/* =========================================
   7. MOBILE RESPONSIVE (手機版專用設定)
   ========================================= */
/* 設定 900px 以下就啟動手機模式，比較安全 */
@media (max-width: 900px) {
    
    /* Header 改為垂直排列 */
    header {
        height: auto;
        flex-direction: column;
        padding: 1.5rem 1rem;
        gap: 1rem;
    }
    
    .brand-logo { 
        height: 40px; /* 手機上 Logo 稍微大一點點 */
        margin-bottom: 0.5rem; 
    }
    
    nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1.5rem; /* 增加間距 */
        width: 100%;
    }
    
    nav a { 
        margin-left: 0; 
        font-size: 1rem; 
        padding: 5px; /* 增加點擊區域 */
    }
    
    .lang-switch {
        border-left: none;
        padding-left: 0;
        margin-left: 0;
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }

    /* 首頁 Split Screen 變成上下堆疊 */
    .split-screen {
        flex-direction: column;
        height: auto; 
    }
    
    .split-panel {
        min-height: 60vh; /* 每個區塊高度增加，讓圖片更好看 */
        padding: 4rem 1.5rem;
        /* 手機版強制 Cover 填滿，不留白邊 */
        background-size: cover;
    }

    /* Hero 字體調整 */
    .page-hero { padding: 4rem 1.5rem; }
    .page-hero h1 { font-size: 2.2rem; }
    
    /* 格線變單欄 */
    .grid-3 { grid-template-columns: 1fr; gap: 2rem; }
    .container { padding: 0 1.5rem; }
    
    /* 修正子頁面雙欄 */
    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    /* 灰底區塊邊距 */
    .highlight-section { margin: 2rem -1.5rem; padding: 3rem 1.5rem; }
}
