@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;700&family=Montserrat:wght@400;700&display=swap');

:root {
  --primary-color: #0D3B66;
  --accent-color: #FF6600;
  --bg-color: #FFFFFF;
}

body {
  font-family: 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f9f9f9;
  color: #555;
  line-height: 1.6;
}

/* --- 標題與 Logo --- */
.site-title {
  text-align: center;
  font-weight: bold;
  color: var(--accent-color);
  margin: 0;
  padding: 20px 0 10px 0;
  letter-spacing: 2px;
}

.site-title img {
  width: 400px; /* 電腦版寬度 */
  max-width: 90%; /* 確保在手機上不會超出螢幕 */
  height: auto;
  display: block;
  margin: 0 auto 10px auto;
}

/* --- 導覽列 --- */
.main-nav {
  text-align: center;
  background-color: var(--accent-color);
  padding: 0;
  margin: 0;
}

.main-nav a {
  display: inline-block;
  color: #fff;
  text-decoration: none;
  padding: 14px 28px;
  font-size: 1.08em;
  letter-spacing: 1px;
  transition: background 0.2s;
  margin: 0 4px;
}

.main-nav a:hover,
.main-nav a.active {
  background: #e65c00;
  text-decoration: underline;
}

/* --- Banner --- */
.banner {
  background: url('https://via.placeholder.com/1200x400') center/cover no-repeat;
  height: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  text-align: center;
  text-shadow: 2px 2px 5px rgba(0,0,0,0.5);
}

.banner h1 {
  font-size: 48px;
  margin-bottom: 10px;
}

/* --- 容器與通用設定 --- */
.container {
  width: 95%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 0;
}

img {
  max-width: 100%;
  height: auto;
}

.section {
  background: var(--bg-color);
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  margin-bottom: 30px;
}

/* 服務清單樣式 */
.service-list {
  list-style: none;
  padding: 0;
  font-size: 1.3em;
  line-height: 2;
}

/* --- 產品列表 --- */
.product-list {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
}

.product-item {
  background: #fafbfc;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  width: calc(50% - 12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
  overflow: hidden; /* 關鍵：隱藏超出框框的部分 */

  /*overflow: visible; /* 必須設為 visible，否則放大會被切掉 */
  position: relative;
  
}

/* 統一產品圖片大小 */
.product-item img {
  width: 100%;
  height: 250px; /* 固定高度 */
  object-fit: contain; /* 關鍵：裁切圖片以填滿區域，不變形 */
  border-radius: 4px;
   cursor: zoom-in; /* 滑鼠移上去顯示「放大鏡 +」 */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  z-index: 1;
}

/* 2. 當圖片被點擊放大後的樣式 */
.product-item img.is-zoomed {
  transform: scale(1.3); /* 放大 1.3 倍 */
  z-index: 100; /* 確保放大時圖片在最上層 */
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  cursor: zoom-out; /* 放大後顯示「放大鏡 -」 */
}

.product-item img:hover {
  transform: scale(1.2); /* 滑鼠移入稍微放大 */
}

/* 燈箱效果 (Modal) 的樣式 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
}

.modal-content {
  max-width: 90%;
  max-height: 80%;
  box-shadow: 0 0 20px rgba(255,255,255,0.2);
}

.close-modal {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}




/* --- 回到頂部 --- */
#backToTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 20px;
  cursor: pointer;
  display: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* --- Media Queries (手機版優化) --- */
@media (max-width: 768px) {
  .site-title img {
    width: 280px; /* 手機版縮小 Logo */
  }

  .banner h1 {
    font-size: 32px;
  }

  .main-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }

  .main-nav a {
    flex: 1 1 45%; /* 一排顯示兩個按鈕 */
    padding: 10px 5px;
    font-size: 1em;
    margin: 2px;
  }

  .product-item {
    width: 100%; /* 產品改為單列顯示 */
  }

  .service-list {
    font-size: 1.1em; /* 手機版縮小文字 */
    line-height: 1.8;
  }
}
  
  /* --- 響應式地圖容器 --- */
.map-responsive {
  overflow: hidden;
  padding-bottom: 56.25%; /* 比例維持在 16:9 */
  position: relative;
  height: 0;
  margin-top: 15px;
  border-radius: 8px; /* 增加圓角讓畫面更精緻 */
}

.map-responsive iframe {
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  position: absolute;
  border: 0;
}

/* 確保頁尾樣式正確顯示 */
footer {
  background-color: #333;
  color: #fff;
  text-align: center;
  padding: 20px;
  margin-top: 30px;
  font-size: 14px;
}