﻿/* 全域設定 */
:root {
    --primary-color: #003366; /* 穩重的深藍色 */
    --accent-color: #C00000;  /* 強調色 */
    --text-color: #333;
    --light-bg: #f4f4f4;
    --dark-bg: #222;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* 導覽列 */
.navbar {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    padding: 0 20px;     /* 左右留一點緩衝空間 */
    flex-wrap: nowrap;   /* [新增] 禁止換行，這是防跑版的關鍵 */
}

.logo {
    display: flex;
    align-items: center;
    height: 100%;        /* 跟隨導覽列高度 */
    text-decoration: none; /* 移除超連結底線 */
}

.logo img {
    height: 50px;       /* 固定高度 50px (導覽列高 70px，這樣會留白邊) */
    width: auto;        /* 寬度自動，保持圖片比例 */
    object-fit: contain;
    display: block;      /* 消除圖片底部的預設間隙 */
}

.nav-links {
    display: flex;
}

.nav-links li {
    margin-left: 20px;
}

.nav-links a {
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    height: 90vh; /* 佔滿螢幕高度的 90% */
    background: linear-gradient(rgba(0,51,102,0.8), rgba(0,51,102,0.6)), url('assets/hero.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    margin-top: 70px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--accent-color);
    color: #fff;
    border-radius: 5px;
    transition: background 0.3s;
}

.btn:hover {
    background: #a00000;
}

/* 通用區塊設定 */
.section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 40px;
    color: var(--primary-color);
}

.section-subtitle {
    text-align: center;
    margin-top: -30px;
    margin-bottom: 50px;
    color: #666;
}

.bg-light { background: var(--light-bg); }
.bg-dark { background: var(--dark-bg); color: #fff; }

/* 關於我們 */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.features-list li {
    margin-bottom: 10px;
}

.img-placeholder {
    width: 100%;
    height: 300px;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    border-radius: 8px;
}

/* 服務卡片 */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s;
}

.service-card:hover {
    transform: translateY(-5px);
}

.service-card h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

/* 實績卡片 */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.portfolio-item {
    background: #fff;
    border-left: 5px solid var(--primary-color);
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Footer */
footer {
    background: #111;
    color: #aaa;
    text-align: center;
    padding: 20px 0;
    font-size: 0.9rem;
}

/* 手機版調整 */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        height: auto;
        padding: 10px;
    }
    .nav-links {
        margin-top: 10px;
    }
    .hero h1 {
        font-size: 2rem;
    }
    .about-grid {
        grid-template-columns: 1fr;
    }
    
    .navbar .container {
        padding: 10px;    /* 手機版兩側留白少一點 */
    }

    .logo img {
        height: 35px;     /* [新增] 手機版 Logo 縮小一點，避免太擠 */
    }
}
/* --- 以下是新增的 Portfolio 頁面樣式 --- */

/* 內頁 Header */
.page-header {
    background: var(--primary-color);
    color: #fff;
    padding: 100px 0 60px; /* 上方留白給導覽列 */
    text-align: center;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

/* 分類按鈕 */
.portfolio-filter {
    text-align: center;
    margin-bottom: 40px;
}

.filter-btn {
    display: inline-block;
    padding: 8px 20px;
    margin: 0 5px;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 20px;
    cursor: pointer;
    transition: 0.3s;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--primary-color);
    color: #fff;
}

/* 圖片網格系統 */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* 自動排版 */
    gap: 30px;
}

.gallery-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px); /* 滑鼠移過去會浮起來 */
}

.gallery-img {
    height: 250px;
    background-color: #eee; /* 圖片還沒放進去時的底色 */
    overflow: hidden;
}

.gallery-img img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 讓圖片填滿格子不變形 */
    transition: transform 0.5s;
}

.gallery-item:hover .gallery-img img {
    transform: scale(1.05); /* 圖片微放大特效 */
}

.gallery-info {
    padding: 20px;
}

.gallery-info h3 {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 5px;
}

.gallery-info .category {
    color: var(--accent-color);
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.gallery-info .desc {
    font-size: 0.95rem;
    color: #666;
}

/* 導覽列 Active 狀態 */
.nav-links a.active {
    color: var(--accent-color);
    font-weight: bold;
}

/* --- 修正：將聯絡我們改為亮色系 --- */
#contact {
    background-color: #ffffff !important; /* 強制背景變全白 */
    color: #333333 !important;            /* 強制文字變深灰 */
    border-top: 5px solid #003366;        /* 上方加一條藍色裝飾線，增加層次感 */
}

/* 修正標題顏色，確保在白底上看得到 */
#contact .section-title {
    color: #003366 !important;            /* 標題改回品牌深藍色 */
    text-shadow: none !important;         /* 移除任何可能的陰影 */
}

/* 確保地址、電話等文字清楚 */
#contact p {
    font-size: 1.1rem;                    /* 文字稍微放大一點 */
    font-weight: 500;                     /* 字體加粗一點 */
}

/* --- 修正：保留深色背景，但提亮文字 --- */
#contact {
    /* 確保背景維持深色 */
    background-color: #222 !important; 
}

#contact h2, 
#contact p, 
#contact strong {
    /* 將標題與內文全部強制改為白色 */
    color: #ffffff !important; 
    
    /* 增加文字對比度與易讀性 */
    text-shadow: 0 1px 2px rgba(0,0,0,0.8); 
    font-weight: 500; /* 字體稍微加粗，在深底上會更清楚 */
    letter-spacing: 0.5px; /* 字距微調，讓閱讀更舒適 */
}

/* 針對聯絡資訊的重點部分（地址、電話）特別提亮 */
.contact-info p {
    margin-bottom: 15px; /* 增加行距，不要擠在一起 */
    font-size: 1.1rem;   /* 字體稍微放大 */
}



/* --- PPT 內容擴充區塊 --- */
.about-img img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.capacity-table-wrapper {
    max-width: 800px;
    margin: 0 auto;
    overflow-x: auto;
}

.capacity-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.capacity-table th,
.capacity-table td {
    padding: 14px 18px;
    border-bottom: 1px solid #e6e6e6;
    text-align: left;
}

.capacity-table th {
    background: var(--primary-color);
    color: #fff;
    font-weight: 500;
}

.factory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.factory-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    text-align: center;
}

.factory-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.factory-card h3 {
    color: var(--primary-color);
    margin: 16px 0 6px;
}

.factory-card p {
    padding: 0 16px 18px;
    color: #555;
}

.process-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.process-step {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    text-align: left;
}

.process-step img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.process-step h4 {
    padding: 12px 16px 0;
    color: var(--primary-color);
}

.process-step p {
    padding: 6px 16px 16px;
    color: #555;
}

.image-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.image-card {
    display: block;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
}

.image-card:hover {
    transform: translateY(-4px);
}

.image-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.image-card-info {
    padding: 14px 16px 18px;
}

.image-card-info h4 {
    margin-bottom: 6px;
    color: #333;
}

.image-card-info p {
    color: #777;
    font-size: 0.95rem;
}
