
:root { --primary:#246d91; --dark:#2d3542; --accent:#20b3ba; --muted:#898f95; --bg:#e2e2e0; }
*{box-sizing:border-box} html,body{margin:0;padding:0;font-family:'Noto Sans TC','Microsoft JhengHei',Arial,sans-serif;color:#2a3740;background:var(--bg)}
a{color:var(--primary);text-decoration:none} .header{position:sticky;top:0;z-index:10;background:#fff;border-bottom:1px solid #e6eaef}
.container{max-width:1120px;margin:0 auto;padding:0 16px} .topbar{display:flex;align-items:center;justify-content:space-between;padding:14px 0}
.brand{display:flex;align-items:center;gap:12px}

.logo {
  max-width: 50px;
  height: auto;
  vertical-align: middle;
  background: none !important;
  border: none;
}

.brand h1{font-size:20px;margin:0;color:var(--dark)} .slogan{font-size:12px;color:var(--muted)}
.nav{display:flex;gap:16px;flex-wrap:wrap} .nav a{padding:8px 12px;border-radius:10px;color:#42525c}
.nav a.active,.nav a:hover{background:rgba(36,109,145,0.12);color:var(--dark)}
.hero{position:relative;background:#0e2732;color:#e9f3f7;padding:60px 0} .hero .title{font-size:40px;margin:0 0 8px} .hero .subtitle{font-size:18px;color:#cfe0e6}
.hero .cta{margin-top:18px;display:flex;gap:12px;flex-wrap:wrap} .btn{display:inline-block;padding:10px 16px;border-radius:12px;font-weight:700}
.btn.primary{background:var(--primary);color:#fff} .btn.ghost{border:1px solid var(--primary);color:#fff}
.hero-note{margin-top:16px;color:#d7e6ec} .grid{display:grid;gap:16px}
.grid-3{grid-template-columns:repeat(3,1fr)} .grid-2{grid-template-columns:repeat(2,1fr)}
@media(max-width:900px){.grid-3,.grid-2{grid-template-columns:1fr} .hero .title{font-size:30px} }
.card{background:#fff;border:1px solid #e6eaef;border-radius:16px;padding:18px;box-shadow:0 4px 16px rgba(15,42,56,0.04)}
.card h3{margin:0 0 8px;font-size:18px;color:var(--dark)} .card p{margin:0;color:#4a5a64;line-height:1.7}
.badge{display:inline-block;background:rgba(32,179,186,0.15);color:var(--dark);padding:4px 8px;border-radius:999px;font-size:12px}
.section{padding:28px 0} .kv{color:#3b4c57} .footer{margin-top:48px;border-top:1px solid #e6eaef;background:#fff}
.footer .inner{padding:18px 0;display:flex;gap:12px;flex-wrap:wrap;align-items:center;justify-content:space-between} .small{font-size:14px;color:#6b7b86}
.table{width:100%;border-collapse:collapse} .table th,.table td{border-bottom:1px solid #e6eaef;padding:10px;text-align:left}

/* --- 漢堡選單按鈕基礎樣式 --- */
.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  padding: 10px;
  cursor: pointer;
  z-index: 1001;
}

.hamburger {
  display: block;
  position: relative;
  width: 24px;
  height: 2px;
  background: #333;
  transition: all 0.2s ease-in-out;
}
.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  left: 0;
  width: 24px;
  height: 2px;
  background: #333;
  transition: all 0.2s ease-in-out;
}
.hamburger::before { top: -8px; }
.hamburger::after { bottom: -8px; }

/* --- 漢堡選單按鈕點擊後的 "X" 樣式 --- */
.nav-toggle[aria-expanded="true"] .hamburger {
  background: transparent;
}
.nav-toggle[aria-expanded="true"] .hamburger::before {
  transform: rotate(45deg) translate(5px, 6px);
}
.nav-toggle[aria-expanded="true"] .hamburger::after {
  transform: rotate(-45deg) translate(5px, -6px);
}

/* --- 手機版響應式設計 --- */
@media (max-width: 960px) {
  .topbar {
    align-items: center;
  }
  .brand {
    flex-shrink: 0;
  }
  .brand h1, .brand .slogan {
     white-space: nowrap;
  }
  .nav-toggle {
    display: block;
  }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: #ffffff;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  }
  .nav.is-active {
    display: flex;
  }
  .nav a {
    padding: 15px 20px;
    width: 100%;
    text-align: center;
  }
}

/* --- 聯絡頁面 (contact.html) 的網格排版調整 --- */
.grid.grid-2 {
  grid-template-columns: 0.4fr 0.6fr;
  align-items: start;
}

.grid .card iframe {
  display: block;
  width: 100%;
  height: 400px;
  border: none;
}

/* 聯絡頁面手機版響應式 */
@media (max-width: 768px) {
  .grid.grid-2 {
    grid-template-columns: 1fr; /* 變回單欄 */
  }
}

/* --- 頁尾 (Footer) 響應式設計調整 --- */
.footer .inner span {
  margin: 5px 10px;
}

@media (max-width: 768px) {
  .footer .inner {
    flex-direction: column;
    align-items: flex-start;
    padding-left: 20px;
    padding-right: 20px;
  }
  .footer .inner span {
    margin-left: 0;
    margin-right: 0;
  }
}

/* --- 頁面主圖 (Banner) 的樣式 --- */
.page-banner {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 24px;
}

/* --- 卡片 (Card) 內部圖片的樣式 --- */
.card img {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 16px;
}

/* --- 照片藝廊網格 (Gallery Grid) 樣式 (更新版，解決圖片裁切問題) --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  /* 我們不再需要對整個網格設定背景和內距，而是針對個別項目 */
}

/* 針對藝廊的每一個項目 <a> 進行樣式設定 */
.gallery-grid .gallery-item {
  display: flex; /* 使用 Flexbox 來達成垂直與水平置中 */
  align-items: center;
  justify-content: center;
  background-color: #ffffff; /* 將項目的背景設為白色，這就是您提到的「補空間」的顏色 */
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05); /* 加上非常淡的陰影增加立體感 */
  height: 250px; /* 給定一個統一的高度，讓網格看起來整齊 */
  padding: 8px; /* 增加一點內距，讓圖片不要貼邊 */
  transition: transform 0.2s ease-in-out; /* 增加一個簡單的 hover 效果 */
}
.gallery-grid .gallery-item:hover {
    transform: translateY(-3px); /* 滑鼠移上去時稍微上浮 */
}


/* 針對圖片 <img> 本身，確保它完整顯示 */
.gallery-grid .gallery-item img {
  display: block;
  max-width: 100%;   /* 圖片最大寬度為容器寬度 */
  max-height: 100%;  /* 圖片最大高度為容器高度 */
  width: auto;       /* 寬度自動，依比例縮放 */
  height: auto;      /* 高度自動，依比例縮放 */
  object-fit: contain; /* 【關鍵】確保圖片以完整樣貌被包含在內，絕對不裁切 */
  border-radius: 4px;/* 圖片本身也可以帶一點小圓角 */
}
/* --- 工程實績內頁專用樣式 --- */
.breadcrumbs { font-size:14px; margin:8px 0 16px; color:#64748b; }
.breadcrumbs a { color:var(--brand); text-decoration:none; }
.meta { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px; }
.meta span { background:#eef6fa; color:#0f4c65; padding:6px 10px; border-radius:999px; font-size:12px; }
hr.divider { border:0; border-top:1px solid #e6edf2; margin:18px 0; }

/* --- 針對工程實績頁面 (Project Gallery) 的照片卡片樣式 --- */

/* 移除 project-gallery 原本的背景色和內距，讓卡片自己控制 */
.project-gallery {
    background-color: transparent;
    padding: 0;
}

/* 將 .gallery-item 變成一個包含圖片和文字的卡片 */
.project-gallery .gallery-item {
    display: flex;
    flex-direction: column; /* 讓圖片和文字垂直排列 */
    text-decoration: none;  /* 移除超連結底線 */
    height: 100%;           /* 讓卡片在網格中等高 */
    
    /* 覆蓋掉證照頁面用的樣式 */
    padding: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08); /* 整個卡片有更明顯的陰影 */
    border-radius: 12px;    /* 卡片圓角 */
    background-color: #ffffff; /* 白色卡片背景 */
    overflow: hidden;       /* 確保圖片圓角生效 */
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.project-gallery .gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

/* 工程實績頁的圖片樣式 */
.project-gallery .gallery-item img {
    width: 100%;
    height: auto;
    object-fit: cover;   /* 裁切填滿，讓照片看起來更飽滿 */
    aspect-ratio: 4 / 3; /* 固定為 4:3 比例，讓排版更整齊 */
    
    /* 移除圖片自己的圓角和陰影，由外層容器處理 */
    border-radius: 0;
    box-shadow: none;
    border-top-left-radius: 12px;  /* 只設定上方圓角 */
    border-top-right-radius: 12px;
}

/* 圖片下方標題文字的樣式 */
.project-gallery .gallery-item .caption {
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--dark); /* 使用 CSS 變數中的深色 */
    line-height: 1.5;
    text-align: center; /* 文字置中 */
    background-color: #ffffff;
    margin-top: auto; /* 將文字推到底部，在卡片等高時很有用 */
}

/* --- 全站統一的 Lightbox 燈箱樣式 --- */
.lightbox {
  display: none; /* 預設隱藏 */
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
}

/* JS 會將 display 改為 flex 來顯示 */

.lightbox-content {
  max-width: 90%;
  max-height: 80%;
  object-fit: contain; /* 確保圖片完整顯示 */
  border-radius: 8px; /* 加上圓角更美觀 */
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s; /* 增加 hover 效果 */
}

.lightbox-close:hover {
  color: #ccc;
}

/* --- 工程實績列表 (Project List) 的樣式 --- */
.project-list {
  list-style-type: none; /* 移除項目符號 (小黑點) */
  padding: 0;
  margin: 24px 0;
  border: 1px solid #e6eaef; /* 加上外框 */
  border-radius: 12px;
  background-color: #fff;
  overflow: hidden; /* 確保圓角效果 */
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.project-list li {
  display: flex;
  align-items: center;
  flex-wrap: wrap; /* 在手機上可以換行 */
  padding: 16px 20px;
  border-bottom: 1px solid #e6eaef; /* 項目之間的分隔線 */
  transition: background-color 0.2s;
}

.project-list li:last-child {
  border-bottom: none; /* 最後一項不需要分隔線 */
}

.project-list li:hover {
  background-color: #f9fafb; /* 滑鼠移上去時變色 */
}

/* 列表中的連結樣式 */
.project-list a {
  font-size: 17px;
  color: var(--dark);
  text-decoration: none; /* 預設移除底線 */
  margin: 0 12px;
  font-weight: 600; /* strong 已經加粗，這裡再強化 */
}

.project-list a:hover {
  color: var(--primary); /* 滑鼠移上去時變為主題色 */
  text-decoration: underline; /* 滑鼠移上去時才顯示底線 */
}

/* 地點文字的樣式 */
.project-list .location {
  color: #64748b;
  font-size: 14px;
  margin-left: auto; /* 將地點推到最右邊 */
}

/* 手機版響應式調整 */
@media (max-width: 768px) {
  .project-list li {
    flex-direction: column; /* 垂直堆疊 */
    align-items: flex-start; /* 從左邊對齊 */
  }
  .project-list a {
    margin: 8px 0; /* 調整上下間距 */
  }
  .project-list .location {
    margin-left: 0; /* 取消推到右邊 */
    background-color: #f0f3f5;
    padding: 3px 8px;
    border-radius: 6px;
  }
}

/* ========== Start: LINE QR Code 新增樣式 ========== */

/* --- 1. 聯絡頁面卡片內的 QR Code --- */
.line-contact-box {
  margin-top: 16px;
  text-align: center; /* 讓圖片和文字置中 */
}

.line-contact-box .qr-large {
  display: inline-block;
  max-width: 150px; /* 設定 QR Code 最大寬度，避免太大 */
  height: auto;
  margin: 10px 0;
  border: 1px solid #e6eaef; /* 加個細邊框比較好看 */
  border-radius: 8px;
  padding: 5px;
}

/* ========== Start: Footer & QR Code 優化版樣式 ========== */

/* 1. 頁尾容器設定 */
.footer .inner {
  display: flex;
  justify-content: space-between; /* 左右分佈 */
  align-items: center; /* 垂直置中 */
  padding: 24px 0; /* 增加上下內距，讓空間舒適 */
}

/* 2. 左側公司資訊樣式 */
.footer-info {
  display: flex;
  flex-direction: column; /* 垂直排列 */
  gap: 8px; /* 行與行之間的間距 */
  font-size: 14px;
  color: #6b7b86; /* 使用原本的灰色調 */
}

.footer-info .info-item {
  line-height: 1.5;
}

/* 3. 右側 QR Code 區塊樣式 (移除灰色背景) */
.footer-qr {
  display: flex;
  align-items: center; /* 讓文字與圖片垂直對齊 */
  gap: 15px; /* 文字與 QR Code 的距離 */
  
  /* 加上左邊界線，製造區隔感 (電腦版顯示) */
  border-left: 1px solid #e6eaef;
  padding-left: 20px;
}

.footer-qr img {
  width: 70px; /* 設定適中的大小 */
  height: auto;
  border-radius: 4px;
  /* 加上一點點陰影讓 QR Code 浮起來，比較精緻 */
  box-shadow: 0 2px 8px rgba(0,0,0,0.08); 
}

.footer-qr .qr-text {
  display: flex;
  flex-direction: column;
  align-items: flex-end; /* 文字靠右對齊 (靠近 QR Code) */
  text-align: right;
}

.footer-qr .qr-text span {
  display: block;
  font-weight: 700;
  color: var(--primary); /* 使用品牌藍色 */
  font-size: 14px;
}

.footer-qr .qr-text .qr-sub {
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

/* --- 手機版響應式調整 (關鍵修改) --- */
/* --- 手機版響應式調整 (優化版：置中卡片設計) --- */
@media (max-width: 768px) {
  
  .footer .inner {
    /* 讓 QR Code 在上方，公司資訊在下方 */
    flex-direction: column-reverse; 
    gap: 20px;
    align-items: center; /* 整體置中對齊 (針對容器) */
    padding-bottom: 30px; /* 底部留多一點呼吸空間 */
  }

  /* --- 1. QR Code 區塊：改為置中卡片式設計 --- */
  .footer-qr {
    width: 100%;
    /* 改為置中排列 */
    justify-content: center; 
    
    /* 移除原本的左邊框，改用全圍邊框或背景 */
    border-left: none; 
    border-bottom: none; /* 移除之前的底線 */
    
    /* 加上淡灰色背景與圓角，讓它像張卡片 */
    background-color: #f8f9fa; 
    border: 1px solid #e9ecef;
    border-radius: 12px;
    
    /* 增加內距，讓內容不要貼邊 */
    padding: 16px; 
    margin-bottom: 10px;
  }

  .footer-qr .qr-text {
    align-items: flex-start; /* 卡片內的文字靠左 (對齊 QR Code) */
    text-align: left;
    order: 2; /* 文字在右 */
  }
  
  .footer-qr img {
    order: 1; /* 圖片在左 */
    width: 64px; /* 稍微加大一點點，更清晰 */
    margin-right: 15px; /* 增加圖片與文字的間距 */
  }

  /* --- 2. 公司資訊區塊：維持靠左，但優化對齊 --- */
  .footer-info {
    width: 100%;
    /* 這裡設定 padding-left: 0，讓藍色飾條貼齊版面左側，或者稍微縮進 */
    padding: 0 10px; 
    gap: 12px;
    align-items: flex-start; /* 確保內容靠左 */
  }
  
  /* 針對電話和 Email 增加點擊區域與飾條 */
  .footer-info .info-item {
    font-size: 14px;
    line-height: 1.6;
    border-left: 4px solid var(--primary); /* 加粗一點藍色飾條 */
    padding-left: 12px; /* 增加文字與飾條的距離 */
    width: 100%; /* 讓飾條佔滿整行寬度 */
  }
}
/* ========== End: Footer & QR Code 優化版樣式 ========== */
/* --- 聯絡表單樣式 --- */
.form-card {
  margin-top: 20px; /* 與上方地圖拉開距離 */
}

.contact-form .form-group {
  margin-bottom: 16px;
}

.contact-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--dark);
  font-size: 14px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(36, 109, 145, 0.1);
}

.btn.full-width {
  width: 100%;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 12px;
}

.btn:disabled {
  background-color: var(--muted);
  cursor: not-allowed;
}

/* 讓聯絡頁面變成 1欄(左) + 1欄(右下表單) 的感覺，如果太擠可以考慮調整 */
@media (min-width: 960px) {
  /* 讓地圖和表單都在右側欄位垂直排列 */
  .grid-2 .card:nth-child(2) {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: transparent; /* 移除外層卡片背景，讓內部元素獨立 */
    box-shadow: none;
    padding: 0;
    border: none;
  }
}

/* =========================================
   8. 頁尾樣式 (Footer) - 全站統一
   ========================================= */
.footer {
  margin-top: 48px;
  border-top: 1px solid #e6eaef;
  background: #fff;
  
  /* 修改這裡：原為 40px 0 */
  /* 改為：上下 32px，左右 24px (確保手機版也不會貼邊) */
  padding: 32px 24px; 
}

/* 頁尾排版容器 (Mobile First: 預設垂直堆疊) */
.footer-info-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  
  /* 新增：限制內容最大寬度並置中，讓視覺跟上方的 Container 對齊 */
  max-width: 1120px; 
  margin: 0 auto;
}

.info-item {
  font-size: 15px;
  line-height: 1.8;
  color: #576269;
  margin-bottom: 4px;
}

/* 版權文字 */
.copyright { color: #576264; margin-bottom: 12px; }

/* =========================================
   9. 響應式設計 (Responsive Queries)
   ========================================= */

/* --- 平板與電腦版 (寬度大於 768px) --- */
@media (min-width: 768px) {
  
  /* 聯絡頁面：左資訊、右地圖表單 */
  .grid.grid-2 { grid-template-columns: 0.4fr 0.6fr; align-items: start; }
  
  /* 頁尾：改為橫向兩欄並排 */
  .footer-info-layout {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end; /* 底部對齊 */
  }
  .footer-col.left-col, .footer-col.right-col { text-align: left; }
  .copyright { margin-bottom: 4px; }
}

/* --- 手機版 (寬度小於 960px) --- */
@media (max-width: 960px) {
  .topbar { align-items: center; }
  .brand { flex-shrink: 0; }
  .brand h1, .brand .slogan { white-space: nowrap; }
  
  /* 漢堡選單顯示邏輯 */
  .nav-toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    top: 100%; right: 0; left: 0;
    background: #ffffff;
    flex-direction: column; align-items: center;
    padding: 20px 0;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  }
  .nav.is-active { display: flex; }
  .nav a { padding: 15px 20px; width: 100%; text-align: center; }

  /* 網格變單欄 */
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .hero .title { font-size: 30px; }
}

/* --- 手機版細節調整 (寬度小於 768px) --- */
@media (max-width: 768px) {
  /* 專案列表堆疊 */
  .project-list li { flex-direction: column; align-items: flex-start; }
  .project-list a { margin: 8px 0; }
  .project-list .location { margin-left: 0; background-color: #f0f3f5; padding: 3px 8px; border-radius: 6px; }

  /* 頁尾文字大小與間距微調 */
  .footer { padding: 16px 24px; }
  .footer-info-layout { gap: 30px; }
}