/* ==========================================================================
   1. FAQ Detail (內頁標題與基礎設定)
   ========================================================================== */
.main .container {
  /* max-width: 1280px; */
}
/* ==========================================================================
   2. FAQ List (列表頁 - 卡片式排版)
   ========================================================================== */
.cata-description {
  padding: 12px 20px;
  margin: 10px 0 20px 0;
  font-size: 15px;
  line-height: 1.8;
  color: #555;
  background: #f9f9f9;
  border-left: 4px solid #c00;
  border-radius: 4px;
}
.faq-list {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding: 0;
  margin: 20px 0 0 0;
  list-style: none;
  width: 100%;
}
.faq-list li {
  box-sizing: border-box;
  width: calc(50% - 15px); /* 兩欄排版 */
  background-color: #fff;
  border: 1px solid #eaeaea;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  min-width: 0;
  /* 覆蓋舊樣式 */
  float: none !important;
  margin-right: 0 !important;
  margin-bottom: 0 !important;
}
/* 滑鼠移入特效 */
.faq-list li:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.1);
  border-color: transparent;
}
.faq-list li a {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  border: none;
  padding: 0;
  background: #fff;
  color: inherit;
}
.faq-list li a:hover {
  background: #fff;
  color: inherit;
}
/* 強制隱藏列表圖片 */
.faq-list .pic {
  display: none !important;
}
/* 文字區域 */
.faq-list .txt {
  width: 100%;
  padding: 30px;
  box-sizing: border-box;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  float: none;
  letter-spacing: 0.5px;
}
/* 卡片標題 */
.faq-list .name {
  font-size: 20px;
  font-weight: 600;
  color: #333;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
  line-height: 1.4;
  text-align: left;
  white-space: normal;
  /* 多行截斷 */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: auto;
}
.faq-list .name h3 {
  margin: 0;
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
}
.faq-list li:hover .name {
  color: #FF4D4D;
}
/* 卡片描述 */
.faq-list .description {
  font-size: 15px;
  color: #666;
  line-height: 1.8;
  text-align: justify;
  margin-bottom: 0;
  /* 多行截斷 */
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* ==========================================================================
   4. Side Nav & Top Menu (導航與過濾器)
   ========================================================================== */
.main.has-side .content .icon {
  background-position: 10 0;
}
/* 側邊欄 */
.side-nav li a:before {
  background: #FF4D4D;
}
.side-nav li a:hover, .side-nav li a.active {
  color: #FF4D4D;
}
/* =========================================
   1. 共用基礎樣式 (Desktop First)
   ========================================= */
/* --- 共用設定 --- */
.tag-dropdown-wrapper {
  position: relative;
  margin-bottom: 20px;
}
/* 電腦版：隱藏手機按鈕 */
.menu-btn {
  display: none;
}
/* 電腦版：列表樣式 (維持你原本的橫排) */
.top-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}
.top-menu li {
  display: inline-block;
}
.top-menu li a {
  display: block;
  border: 1px solid #C9C9C9;
  padding: 5px 15px;
  color: #444;
  margin: 0 5px 8px 0;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.3s;
}
.top-menu li a:hover, .top-menu li a.active {
  background-color: #1F1F1F;
  border-color: #1F1F1F;
  color: #fff;
}
/* ==========================================================================
   5. Related Link (相關連結區塊)
   ========================================================================== */
.related-link {
  position: relative;
  border: 1px solid #D4D4D4;
  padding: 1px;
  margin-top: 15px;
  min-height: 130px;
  max-width: 1000px;
}
.related-link .link-title {
  float: left;
  background: #ACACAC;
  color: #fff;
  font-size: 22px;
  text-align: center;
  line-height: 28px;
  width: 132px;
  position: absolute;
  top: 1px;
  bottom: 1px;
  letter-spacing: 2px;
  box-sizing: border-box;
}
.related-link .link-title:after {
  content: " ";
  background: url(../images/faq/link_title_deco.png) no-repeat;
  background-size: 100% 100%;
  width: 28px;
  position: absolute;
  right: -28px;
  top: 0;
  bottom: 0;
}
.related-link .link-title h4 {
  font-weight: normal;
  position: absolute;
  width: 50px;
  top: 50%;
  left: 50%;
  margin: -42px 0 0 -25px;
  padding: 0 0 0 10px;
}
.related-link .link-title span {
  letter-spacing: 0;
  display: block;
}
/* ==========================================================================
   6. Media Queries (RWD 響應式設定)
   ========================================================================== */
@media screen and (max-width: 768px) {
  .faq-list {
    gap: 20px;
  }
  .faq-list li {
    width: 100%; /* 手機版強制單欄 */
  }
  .faq-list .pic {
    height: auto;
    aspect-ratio: 16/9;
  }
  .faq-list .txt {
    padding: 20px;
  }
  .faq-list .name {
    font-size: 18px;
  }
  .faq-detail {
    font-size: 18px;
    position: relative;
    padding: 20px 5px 20px 5px;
    border-top: 1px dotted #ccc;
    border-bottom: 1px dotted #ccc;
    background: #fff;
    text-align: justify;
  }
  .faq-detail h1 {
    font-size: 1.3em;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 30px 0;
    padding: 0 0px 20px 0px;
    border-bottom: 3px solid #f0f0f0;
    line-height: 1.3;
    text-align: left; /* 關鍵屬性：強制左對齊 */
  }
  /* =========================================
   2. 手機版樣式 (Max-width: 768px)
   ========================================= */
  /* 1. 顯示下拉按鈕 */
  .menu-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border: 1px solid #C9C9C9;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    color: #333;
  }
  /* 2. 列表預設狀態：隱藏 */
  .top-menu {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin-top: 0;
    transition: all 0.3s ease-in-out; /* 平滑動畫 */
    /* 下拉選單外觀 */
    background: #fff;
    border: 1px solid #e5e5e5;
    border-top: none;
    border-radius: 0 0 8px 8px;
  }
  /* 3. 列表項目改為垂直排列 */
  .top-menu li {
    display: block;
    width: 100%;
  }
  .top-menu li a {
    border: none;
    border-bottom: 1px solid #f0f0f0;
    border-radius: 0;
    margin: 0;
    padding: 12px 15px;
  }
  .top-menu li:last-child a {
    border-bottom: none;
  }
  /* --- 4. 展開狀態 (當 JS 加上 .open 時觸發) --- */
  .tag-dropdown-wrapper.open .top-menu {
    max-height: 500px; /* 設定一個足夠展開的高度 */
    opacity: 1;
    margin-top: -5px; /* 稍微往上修飾接縫 */
  }
  /* 箭頭旋轉 */
  .tag-dropdown-wrapper.open .menu-btn .arrow {
    transform: rotate(180deg);
  }
}