/* 本檔載入頁面：環境物聯網 (products/intelligent-integration/intelligent-integration.html) */
/* 使用位置：主要內容區 */
.system-integration-body {
  background: #e1f2ff;
}

/* 使用位置：主要內容區 */
.system-integration-container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 30px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

/* 使用位置：主要內容區 */
.tabs-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* 使用位置：「資料收集 & 智慧化整合」區塊 */
.tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  margin-bottom: 0; /* 移除原本的 margin */
  z-index: 2; /* 確保頁籤在內容上方 */
}

/* 使用位置：「資料收集 & 智慧化整合」區塊 */
.tab-btn {
  padding: 15px 30px;
  background: #f0f0f0;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  /* 桌面版時只有上方圓角 */
  border-radius: 8px 8px 0 0;
}

/* 使用位置：「資料收集 & 智慧化整合」區塊 */
.tab-btn.active {
  background: #2c5686;
  color: white;
}

/* 內容區域 */
/* 使用位置：「環境物聯網」區塊、「可程式監控系統」區塊、「無線感測網路系統」區塊…等 */
.tab-content {
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: none;
  margin-top: -10px; /* 調整這個值來控制上移距離 */
  position: relative; /* 添加這個確保內容在陰影上方 */
  z-index: 1; /* 確保內容在頁籤下方 */
}

/* 使用位置：「環境物聯網」區塊 */
.tab-content.active {
  display: block;
}

/* 使用位置：通用元素樣式：所有 <h2> */
h2 {
  color: #2c5686;
  margin-bottom: 20px;
  font-size: 24px;
}

/* 使用位置：通用元素樣式：所有 <h3> */
h3 {
  color: #2c5686;
  margin-bottom: 10px;
  font-size: 20px;
}

/* 使用位置：通用元素樣式：所有 <p> */
p {
  margin: 10px 0;
}

/* ===== 智慧環保 & 智慧節能 ===== */
/* 使用位置：「放流水水質監測&混凝加藥系統」標題、「智能電錶&節能系統」標題、「室內空氣品質監測&空調系統」標題 */
.sub-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 2rem 0 0.8rem;
  color: #0b2545;
}

/* 使用位置：「放流水水質監測&混凝加藥系統」標題、「智能電錶&節能系統」標題、「室內空氣品質監測&空調系統」標題｜前方裝飾 */
.sub-title::before {
  content: "";
  width: 6px;
  height: 1.2em;
  border-radius: 3px;
  background: linear-gradient(180deg, #4aa3ff, #0a5bb5);
}

/* 使用位置：「放流水水質監測&混凝加藥系統」標題｜第一個 */
.tab-content > .sub-title:first-child {
  margin-top: 0;
}

/* 使用位置：「放流水水質監測&混凝加藥系統」區塊、「智能電錶&節能系統」區塊、「室內空氣品質監測&空調系統」區塊 */
.diagram-card {
  margin: 1.2rem 0 0.5rem;
  padding: 0.8rem;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(15, 40, 80, 0.06);
}

/* 使用位置：「智能電錶&節能系統」區塊 */
.diagram-card svg text {
  font-family: "Microsoft JhengHei", "微軟正黑體", "PingFang TC", "Noto Sans TC", sans-serif;
}

/* 使用位置：「放流水水質監測&混凝加藥系統」區塊、「室內空氣品質監測&空調系統」區塊、「智能電錶&節能系統」區塊 */
.diagram-card img,
.diagram-card svg {
  display: block;
  width: 100%;
  height: auto;
}

/* 架構圖在小螢幕維持可讀尺寸，可左右滑動 */
@media (max-width: 768px) {
  /* 使用位置：「智能電錶&節能系統」區塊｜螢幕寬度 ≤768px（平板/手機）時 */
  .diagram-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 使用位置：「智能電錶&節能系統」區塊｜螢幕寬度 ≤768px（平板/手機）時 */
  .diagram-scroll svg {
    width: 900px;
    max-width: none;
  }
}
