/* base.css */

/* 基礎設定 - 定義網站的基本樣式 */
body {
  font-family: "Microsoft JhengHei", sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* 防止水平卷軸 */
  width: 100%;
}

/* 主要內容容器 */
main {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* 圖片容器 */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

.product-intro {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* 通用容器樣式 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* 通用標題樣式 */
h1 {
  color: #215585;
  font-size: 1.8em;
}
h2 {
  color: #0066cc;
  font-size: 1.5em;
}
h3,
h4 {
  color: #0066cc;
  margin-bottom: 0.5rem;
}

/* 通用連結樣式 */
a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

a:hover {
  color: #fffd7e;
}

/* 麵包屑 */
.breadcrumb {
  padding: 10px 16px;
  list-style: none;
  background-color: #ececec;
  border-radius: 4px;
  margin-top: 85px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.breadcrumb-basic li {
  display: inline;
  font-size: 14px;
}

.breadcrumb-basic li + li:before {
  padding: 8px;
  color: #666;
  content: "/\00a0";
}

.breadcrumb-basic li a {
  color: #0275d8;
  text-decoration: none;
}

.breadcrumb-basic li a:hover {
  text-decoration: underline;
}

/* 通用列表樣式 */
ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* 通用網格系統 */
.grid {
  display: grid;
  gap: 2rem;
}

/* 響應式圖片 */
img {
  max-width: 100%;
  height: auto;
}

/* 通用間距類別 */
.mt-4 {
  margin-top: 2rem;
}

/* 以其他標題層級呈現相同外觀 (SEO 調整標題層級用) */
h2.h1-style {
  color: #215585;
  font-size: 1.8em;
  margin: 0.67em 0;
}

h1.h3-style {
  color: #0066cc;
  font-size: 1.17em;
  margin: 1em 0 0.5rem;
}

/* 可展開的常見問題 (details / summary) */
details {
  margin: 0 0 0.8rem;
  border: 1px solid #dbe5f0;
  border-left: 4px solid #0a5bb5;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 40, 80, 0.05);
  overflow: hidden;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

details:hover {
  border-color: #b8cfe8;
  border-left-color: #0a5bb5;
  box-shadow: 0 6px 18px rgba(15, 40, 80, 0.1);
}

details[open] {
  border-left-color: #f08a24;
  box-shadow: 0 8px 22px rgba(15, 40, 80, 0.1);
}

summary {
  position: relative;
  display: block;
  list-style: none;
  cursor: pointer;
  padding: 1rem 3rem 1rem 1.2rem;
  font-weight: 600;
  line-height: 1.6;
  color: #0b2545;
  transition: background-color 0.2s ease, color 0.2s ease;
}

summary::-webkit-details-marker {
  display: none;
}

/* 右側圓形三角形指示 */
summary::after {
  content: "";
  position: absolute;
  right: 1.1rem;
  top: 50%;
  width: 26px;
  height: 26px;
  margin-top: -13px;
  border-radius: 50%;
  background: #e8f1fc
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M3.5 2l3.5 3-3.5 3z' fill='%230a5bb5'/%3E%3C/svg%3E")
    center / 12px no-repeat;
  transition: transform 0.25s ease, background-color 0.25s ease;
}

summary:hover {
  background: #f5f9fe;
  color: #0a5bb5;
}

details[open] > summary {
  color: #0a5bb5;
  background: #f5f9fe;
  border-bottom: 1px solid #e2e8f0;
}

details[open] > summary::after {
  transform: rotate(90deg);
  background-color: #fdf0e3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M3.5 2l3.5 3-3.5 3z' fill='%23f08a24'/%3E%3C/svg%3E");
}

details > *:not(summary) {
  margin: 0;
  padding: 0.9rem 1.2rem 1.1rem;
  line-height: 1.85;
  color: #334155;
}

details > *:not(summary) + *:not(summary) {
  padding-top: 0;
}

summary:focus-visible {
  outline: 2px solid #0a5bb5;
  outline-offset: -2px;
}

/* ===== 效益/優勢卡片列表 (CWMS、智慧水務頁共用) ===== */
.benefit-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0.9rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.benefit-list li {
  position: relative;
  padding: 1rem 1.1rem 1rem 3.6rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.benefit-list li:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 40, 80, 0.08);
}

.benefit-list li i {
  position: absolute;
  left: 1rem;
  top: 1rem;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-size: 1.05rem;
  color: #fff;
  background: linear-gradient(135deg, #3fa2f5, #0a5bb5);
}

.benefit-list li:nth-child(2) i { background: linear-gradient(135deg, #5fd6df, #1593a6); }
.benefit-list li:nth-child(3) i { background: linear-gradient(135deg, #ffb062, #f08a24); }
.benefit-list li:nth-child(4) i { background: linear-gradient(135deg, #a4d65e, #4f8f1f); }
.benefit-list li:nth-child(5) i { background: linear-gradient(135deg, #a7b4c6, #6b7c93); }

.benefit-list strong {
  color: #0b2545;
}

/* ===== 建置解決方案與案例 (CWMS、CPMS 頁共用) ===== */
.solution-section {
  margin-top: 2.4rem;
  padding: 1.6rem;
  border-radius: 14px;
  background: linear-gradient(180deg, #f3f8fe 0%, #fff 100%);
  border: 1px solid #dbe8f6;
}

.solution-cta {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1.1rem 1.4rem;
  border-radius: 12px;
  background: linear-gradient(120deg, #062a55 0%, #0a5bb5 100%);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: 0 8px 22px rgba(10, 91, 181, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.solution-cta:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(10, 91, 181, 0.35);
}

.solution-cta .bi-hand-index {
  color: #ffd166;
  font-size: 1.3rem;
}

.solution-cta .cta-arrow {
  margin-left: auto;
  font-size: 1.4rem;
  transition: transform 0.2s ease;
}

.solution-cta:hover .cta-arrow {
  transform: translateX(4px);
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
  margin-top: 1.2rem;
}

.case-card {
  margin: 0;
  display: flex;
  flex-direction: column;
  padding: 1rem 1rem 0.9rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
}

.case-label {
  align-self: center;
  margin: 0 0 0.9rem;
  padding: 0.3rem 1rem;
  border-radius: 999px;
  background: #fdf0e3;
  color: #b45f0c;
  font-size: 0.9rem;
  font-weight: 600;
}

/* 單數張時最後一張橫跨兩欄 */
.case-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.case-card:last-child:nth-child(odd) img {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.case-card img {
  display: block;
  width: 100%;
  height: auto;
  margin: auto 0;
  border-radius: 8px;
}

.case-card figcaption {
  margin-top: 0.8rem;
  padding-top: 0.7rem;
  border-top: 1px dashed #e2e8f0;
  font-size: 0.9rem;
  color: #64748b;
  text-align: center;
}

@media (max-width: 768px) {
  .case-grid {
    grid-template-columns: 1fr;
  }

  .solution-section {
    padding: 1rem;
  }

  .solution-cta {
    font-size: 1rem;
  }

  .case-label {
    border-radius: 10px;
    text-align: center;
  }
}
