:root {
  --primary: #0a2a43;
  /* 深藍色 (品牌主色) */
  --accent: #c7a34b;
  /* 金色 (品牌強調色) */
  --text: #222;
  --light: #f5f5f5;
  --max-width: 1440px;
}

/* Reset & Layout */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Noto Sans TC", sans-serif;
  line-height: 1.7;
  color: var(--text);
}

.container {
  width: 92%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 15px;
}

.section {
  padding: 50px 0;
}

.section:nth-child(even) {
  background-color: var(--light);
}

h2 {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 30px;
  text-align: center;
}

.section-subtitle {
  text-align: center;
  margin-bottom: 50px;
  color: #666;
  font-size: 1.1rem;
}

/* 按鈕樣式 */
.btn-primary {
  display: inline-block;
  padding: 10px 25px;
  border-radius: 5px;
  font-weight: 500;
  transition: all 0.3s ease;
  text-align: center;
  text-decoration: none;
  /* 確保按鈕連結沒有底線 */
}

.btn-primary {
  background: var(--accent);
  color: var(--primary);
  border: 2px solid var(--accent);
}

.btn-primary:hover {
  background: #a38241;
  color: white;
  border-color: #a38241;
}

/* === 新增按鈕樣式 (深藍底白字，hover 金色) === */

.btn-primary2 {
  display: inline-block;
  padding: 10px 25px;
  border-radius: 5px;
  font-weight: 500;
  transition: all 0.3s ease;
  text-align: center;
  text-decoration: none;
}

.btn-primary2 {
  background: var(--primary); /* 使用深藍色 (主色) 作為底色 */
  color: white;
  border: 2px solid var(--primary);
}

.btn-primary2:hover {
  background: var(--accent); /* Hover 時使用金色 (強調色) */
  color: var(--primary);     /* Hover 時文字變回深藍色 */
  border-color: var(--accent);
}

/* 確保在聯絡表單內維持 100% 寬度 */
.contact-form .btn-primary2 {
  width: 100%;
  margin-top: 20px;
  font-size: 1.1rem;
}


/* 導覽列 */
.navbar {
  background: var(--primary);
  color: white;
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.navbar .container {
  display: flex;
  /* justify-content: space-between; */
  align-items: center;
}

.logo {
  font-weight: 700;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
}

.logo svg {
  vertical-align: middle;
  /* 確保 SVG 和文字對齊 */
}

.nav-links {
  margin-left: auto;
  /* 將導覽連結群組推到右側 */
  display: flex;
  /* (新增) 為了讓 dropdown.nav-item 正常排列 */
  align-items: center;
  /* (新增) 垂直置中 */
}

.nav-links a {
  color: white;
  margin: 0 20px;
  padding: 5px 0;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color 0.3s ease;
  font-size: 1.05rem;
}

.nav-links a:hover {
  border-color: var(--accent);
}

/* .nav-contact .phone {
  color: white;
  margin-right: 15px;
  text-decoration: none;
} */

/* === (新增) 導覽列下拉選單 (桌機版) === */
.nav-item.dropdown {
  position: relative;
  display: inline-block;
  /* 讓 item 並排 */
  margin: 0 20px;
}

/* 下拉選單的觸發連結 */
.dropdown-toggle {
  color: white;
  padding: 5px 0;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color 0.3s ease;
  cursor: pointer;
  /* 讓桌機版有手型 */
  background: none;
  /* 確保透明背景 */
  border: none;
  /* 確保無邊框 */
  font-family: inherit;
  /* 繼承字體 */
  font-size: inherit;
  /* 繼承字體大小 */
}

.nav-links .dropdown-toggle:hover {
  border-color: var(--accent);
}

/* 箭頭樣式---取消*/
.dropdown-toggle .fa-caret-down {
  /* margin-left: 5px;
  font-size: 0.9em;
  transition: transform 0.3s ease; */
  display: none;
} 

/* 下拉選單本體 */
.dropdown-menu {
  display: none;
  /* 預設隱藏 */
  position: absolute;
  top: 100%;
  /* 顯示在連結下方 */
  left: 50%;
  transform: translateX(-50%);
  min-width: 160px;
  /* 最小寬度 */
  background: var(--primary);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  border-radius: 0 0 5px 5px;
  z-index: 1100;
  /* 確保在輪播之上 */
  padding: 5px 0;
}

/* 下拉選單中的連結 */
.dropdown-menu a {
  display: block;
  color: white;
  padding: 10px 15px;
  margin: 0;
  /* 覆蓋 .nav-links a 的 margin */
  text-align: center;
  border-bottom: none;
  /* 覆蓋 .nav-links a 的 border */
}

.dropdown-menu a:hover {
  background: var(--accent);
  color: var(--primary);
  border-bottom: none;
  /* 再次確保 */
  border-color: transparent;
  /* 覆蓋 hover 效果 */
}

/* 桌機版 Hover 效果 */
.nav-item.dropdown:hover .dropdown-menu {
  display: block;
}

/* 桌機版 Hover 箭頭旋轉--- 取消 */
/* .nav-item.dropdown:hover .dropdown-toggle .fa-caret-down {
  transform: rotate(180deg);
} */

/* === (新增) 導覽列下拉選單 結束 === */


/* === (已刪除) Hero 樣式 === */


/* === (新增) 文宣輪播 (Carousel) === */
.carousel-container {
  position: relative;
  width: 100%;
  max-width: 100%;
  /* 確保滿版 */
  background: #eee;
  /* 圖片載入前的底色 */
  z-index: 100;
  /* 確保在 navbar 下方，但在 hero 上方 */
}

.carousel-track {
  position: relative;
  width: 100%;
  /* 1200x450 的比例 = 450 / 1200 = 0.375 = 37.5% */
  padding-top: 30%;
  /* 關鍵：保持 1200x450 比例 */
  overflow: hidden;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  /* 漸變效果 */
  visibility: hidden;
}

.carousel-slide.active {
  opacity: 1;
  visibility: visible;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* 裁切以填滿容器，保持比例 */
  display: block;
}

/* 左右控制按鈕 */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(10, 42, 67, 0.5);
  /* 使用品牌色透明 */
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.carousel-btn:hover {
  background: var(--primary);
  /* Hover 時變深色 */
}

.carousel-btn.prev {
  left: 20px;
}

.carousel-btn.next {
  right: 20px;
}

/* 指示器 (小圓點) */
.carousel-indicators {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 10px;
}

.indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: background-color 0.3s ease;
  padding: 0;
  /* 重置 button 預設 padding */
}

.indicator.active {
  background: var(--accent);
  /* 啟用時使用品牌金色 */
  border-color: #fff;
}

/* === 文宣輪播 (Carousel) 結束 === */

/* === 最新消息區塊 (News Section) === */
.news-section {
  background-color: #fff;
  
}

/* 1. 分類篩選按鈕 */
.news-filter {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 50px;
  flex-wrap: wrap; /* 手機版自動換行 */
}

.filter-btn {
  background: transparent;
  border: 1px solid #ddd;
  padding: 8px 25px;
  border-radius: 30px; /* 圓角膠囊狀 */
  font-size: 1rem;
  color: #666;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary); /* 深藍色背景 */
  color: #fff;
  border-color: var(--primary);
}

/* 2. 消息列表容器 */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 30px; /* 列表項目間距 */
  max-width: 1000px; /* 限制內容寬度，避免文字太長難閱讀 */
  margin: 0 auto; /* 列表置中 */
}

/* 3. 單則消息項目 (Card List Style) */
.news-item {
  display: flex;
  align-items: flex-start; /* 頂部對齊 */
  padding-bottom: 30px;
  border-bottom: 1px solid #eee; /* 分隔線 */
  transition: transform 0.3s ease;
}

.news-item:hover {
  transform: translateX(10px); /* Hover 時輕微右移，增加互動感 */
}

/* 左側日期方塊 */
.news-date {
  background: #f8f9fa;
  color: var(--primary);
  width: 80px;
  height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  margin-right: 25px;
  flex-shrink: 0; /* 防止被擠壓 */
  border: 1px solid #e0e0e0;
}

.news-date .day {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent); /* 金色日期 */
}

.news-date .month {
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 600;
}

.news-date .year {
  font-size: 0.7rem;
  color: #999;
  /* display: none; 預設隱藏年份，保持簡潔，亦可開啟 */
}

/* 右側內容區 */
.news-content {
  flex: 1;
}

.news-meta {
  margin-bottom: 8px;
}

.news-meta .tag {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
  background: rgba(199, 163, 75, 0.1); /* 淺金色背景 */
  padding: 2px 8px;
  border-radius: 4px;
}

.news-item h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  line-height: 1.4;
  text-align: left; /* 強制靠左 */
}

.news-item h3 a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s;
}

.news-item h3 a:hover {
  color: var(--accent);
}

.news-item p {
  color: #666;
  font-size: 1rem;
  margin-bottom: 15px;
  line-height: 1.5;
  display: -webkit-box;  
  -webkit-box-orient: vertical;
  overflow: hidden;
  -webkit-line-clamp: 2; /* 限制顯示兩行 */
  line-clamp: 2;
}

.read-more {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.read-more:hover {
  color: var(--accent);
}

/* 4. 分頁導覽 (Pagination) */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 60px;
}

.page-link {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%; /* 圓形 */
  color: var(--primary);
  border: 1px solid #ddd;
  transition: all 0.3s;
  text-decoration: none;
}

.page-link:hover,
.page-link.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.page-dots {
  color: #999;
  letter-spacing: 2px;
}

/* === RWD 手機版調整 === */
@media (max-width: 768px) {
  .news-item {
    flex-direction: column; /* 手機版改為垂直排列 */
  }

  .news-date {
    width: auto;
    height: auto;
    background: transparent;
    border: none;
    flex-direction: row;
    gap: 10px;
    margin-bottom: 10px;
    justify-content: flex-start;
  }
  
  .news-date .day {
    font-size: 1.2rem;
  }
  
  .news-date .month {
    font-size: 1rem;
    color: #666;
  }
}


/* 關於我們 */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.about-video video {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  display: block;
  /* 確保影片表現一致 */
}

.about-text p {
  margin-bottom: 20px;
  font-size: 1.2rem;
}

/* === (新增) 關於我們 - 動態打字機文字 === */
#dynamicText {
  color: var(--primary);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 25px;
  min-height: 2.7rem; /* (1.8rem * 1.5 line-height) 避免內容跳動 */
  opacity: 0; /* 預設隱藏 */
  transition: opacity 0.5s ease-in-out;
  
  /* 模擬打字機游標 (可選，但效果更好) */
  /* 預設無游標 */
  border-right: 3px solid transparent; 
}

#dynamicText.show {
  opacity: 1;
  /* 當 .show 被 JS 加入時，才顯示游標並開始動畫 */
  border-right-color: var(--accent); /* 游標顏色 */
  animation: blink 0.7s step-end infinite;
}

/* (新增) 游標閃爍動畫 */
@keyframes blink {
  from, to { border-color: transparent; }
  50% { border-color: var(--accent); }
}

/* === (已新增) 委任流程 (Flow Section) === */
.flow-section {
  background-color: var(--light);
  /* 使用淺色背景 */
}

.flow-grid {
  display: grid;
  /* 在桌機上，我們希望 5 個項目排成一行 */
  grid-template-columns: repeat(5, 1fr);
  gap: 40px;
  /* 增加間距以便放箭頭 */
}

.flow-card {
  background: white;
  padding: 25px 20px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border-top: 4px solid var(--primary);
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.flow-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  border-top-color: var(--accent);
}

.flow-icon {
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: 15px;
}

.flow-step {
  font-size: 0.9rem;
  color: #999;
  font-weight: 600;
  margin-bottom: 10px;
}

.flow-card h3 {
  color: var(--primary);
  margin-bottom: 10px;
  font-size: 1.15rem;
}

.flow-card p {
  font-size: 0.95rem;
  color: #555;
}

/* 流程箭頭 (桌機版) */
.flow-card:not(:last-child)::after {
  content: '\f061';
  /* Font Awesome 6 - right-arrow */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  top: 50%;
  right: -28px;
  /* 放在卡片外的中間 */
  transform: translateY(-50%);
  font-size: 1.5rem;
  color: var(--accent);
  opacity: 0.6;
}

/* 服務項目 */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.service-card {
  background: white;
  padding: 30px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border: 1px solid #eee;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.service-card:hover,
.service-card.active {
  transform: translateY(-8px);
  box-shadow: 0 8px 25px rgba(199, 163, 75, 0.2);
  border-color: var(--accent);
}

.service-card h3 {
  color: var(--primary);
  font-size: 1.4rem;
  margin: 15px 0 10px;
}

.icon-accent {
  color: var(--accent);
}

/* === 律師團隊樣式 (Team Section) - 修改為透明背景 hover 效果 === */
.team-section {
  background-color: var(--light);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  justify-content: center;
}

.lawyer-card {
  background: rgba(255, 255, 255, 0);
  /* 初始透明背景 */
  border-radius: 8px;
  overflow: hidden;
  /* box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08); /* 初始無陰影 */
  transition:
    transform 0.4s ease,
    box-shadow 0.4s ease,
    background-color 0.4s ease;
  /* 增加背景色過渡 */
  border-top: 5px solid transparent;
  /* 初始透明強調線 */
  text-align: center;
  position: relative;
  /* 用於內部元素定位 */
  padding-bottom: 20px;
  /* 確保內容不會被截斷 */
}

/* hover 時的樣式 */
.lawyer-card:hover {
  transform: scale(1.03);
  /* 輕微放大 */
  box-shadow: 0 15px 40px rgba(10, 42, 67, 0.2);
  /* 較大陰影 */
  background-color: white;
  /* 背景變為白色 */
  border-top-color: var(--accent);
  /* 金色強調線出現 */
}

.lawyer-card img {
  width: 100%;
  height: 300px;
  /* 固定高度 */
  object-fit: cover;
  display: block;
  filter: grayscale(20%);
  /* 初始輕微灰階 */
  transition: filter 0.4s ease, transform 0.4s ease;
  /* 增加 transform 過渡 */
  transform: scale(1);
  /* 初始不放大 */
}

.lawyer-card:hover img {
  filter: grayscale(0%);
  /* 恢復彩色 */
  transform: scale(1.05);
  /* 圖片輕微放大 */
}

.card-content {
  padding: 20px 20px 0px;
  /* 調整 padding */
}

.lawyer-card h3 {
  color: var(--primary);
  font-size: 1.5rem;
  margin-bottom: 5px;
}

.lawyer-card .title {
  color: var(--accent);
  font-weight: 500;
  font-size: 1.1rem;
  margin-bottom: 15px;
}

.expertise-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  text-align: left;
  display: inline-block;
  /* 讓整個列表置中 */
}

.expertise-list li {
  background-color: #e0e9ee;
  /* 淺藍色背景，可調整 */
  color: var(--primary);
  display: inline-block;
  padding: 5px 10px;
  margin: 4px;
  border-radius: 3px;
  font-size: 1 rem;
}

.btn-card-contact {
  background: var(--primary);
  color: white;
  padding: 8px 20px;
  border-radius: 5px;
  display: block;
  margin: 15px auto 0;
  /* 置中按鈕 */
  max-width: 150px;
  /* 限制按鈕寬度 */
  font-weight: 500;
  transition: background 0.3s ease, color 0.3s ease;
  text-decoration: none;
  /* 確保按鈕連結沒有底線 */
}

.btn-card-contact:hover {
  background: var(--accent);
  color: var(--primary);
}

/* === 律師彈窗通用樣式 (基於表單彈窗擴展) === */

/* --- 新增：律師彈窗通用樣式 --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    /* ★ 關鍵修正：將垂直對齊方式從「置中」改為「從頂部開始」 */
    align-items: flex-start; 
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto; /* 確保內容溢出時，外層可以滾動 */
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 1000px; 
    width: 95%;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    margin: 40px auto; 
}

.modal-overlay.show .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
}

/* 彈窗頭部：圖片與基本資訊 */
.modal-header {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.modal-header img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    margin-right: 20px;
}

/* 彈窗內文標題與列表樣式 */
.modal-body h4 {
    color: var(--primary);
    border-left: 4px solid var(--accent);
    padding-left: 10px;
    margin-top: 20px;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.modal-body ul {
    list-style-type: disc;
    padding-left: 25px;
}

.modal-contact-btn {
    display: block !important;
    margin: 30px auto 0 !important;
    max-width: 200px;
}




/* 1. 網格容器佈局 (實現 2x2 視覺效果) */
.profile-card-grid {
    display: grid;
    /* 建立自動響應式的兩欄佈局 */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px dashed #eee; 
}

/* 2. 單個卡片樣式 (實現圓角、白底、陰影) */
.academic-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
    line-height: 1.6;
    transition: transform 0.3s ease;
}

.academic-card:hover {
    transform: translateY(-3px); /* 增加 hover 互動感 */
    box-shadow: 0 6px 15px rgba(10, 42, 67, 0.1);
}

/* 3. 卡片內文樣式 */
.academic-card h5 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary); 
    margin-bottom: 8px;
}

.academic-card p {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 0;
}

/* --- 新增：核心經歷區塊樣式 (Experience Block) --- */

.experience-block {
    margin-bottom: 30px;
}

/* 區塊大標題 (檢察官生涯, 企業界高階經理人) */
.experience-header {
    /* 覆蓋原有 h4 的左邊框 */
    border-left: none !important; 
    padding-left: 0 !important;
    
    font-size: 1.35rem; 
    color: var(--primary);
    margin-bottom: 15px !important; 
    display: flex;
    align-items: center;
}

/* 區塊大標題旁的圖示 */
.experience-header i {
    font-size: 1.5rem;
    margin-right: 10px;
    color: var(--accent); /* ★ 圖示使用金色強調色，更顯眼 */
}

/* 核心經歷 - 箭頭列表 (Arrow List) 樣式 */
.experience-details-list {
    padding-left: 15px; /* 內縮一點，視覺上更舒適 */
    line-height: 1.8;
}

.experience-detail-item {
    display: flex; /* 使用 Flexbox 讓箭頭和文字對齊 */
    align-items: flex-start;
    margin-bottom: 15px;
}

/* 箭頭圖示 (取代傳統圓點) */
.experience-arrow {
    font-size: 1.1em; 
    margin-top: 5px; /* 確保箭頭與文字頂部對齊 */
    margin-right: 10px;
    color: var(--accent); /* ★ 箭頭使用金色 */
    flex-shrink: 0; /* 防止箭頭被文字擠壓 */
}

.experience-detail-item span {
    color: #333;
    flex: 1; 
    /* 確保經驗描述的第一部分 (職稱) 是粗體 */
    /* 這需要您在 dataArray 裡面手動用 <strong> 或 <span> 加強 */
}

.experience-detail-item .experience-title {
    color: var(--primary); /* ★ 使用品牌深藍色 */
    font-weight: 700;      /* 讓職稱更突出 */
}


/* RWD 調整 */
@media (max-width: 600px) {
    .modal-header {
        flex-direction: column;
        text-align: center;
    }
    .modal-header img {
        margin-right: 0;
        margin-bottom: 15px;
    }
    .modal-two-column-grid {
        grid-template-columns: 1fr;
    }
    .academic-row {
        flex-direction: column;
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }
    .academic-row .academic-item {
        width: 100%; 
        margin-bottom: 5px; 
    }
}


/* 聯絡我們 */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 50px;
  align-items: flex-start;
}

.office-details {
  margin-top: 30px;
}

.office-details h4 {
  color: var(--primary);
  margin-bottom: 10px;
  border-left: 4px solid var(--accent);
  padding-left: 10px;
}

.office-details p {
  margin-bottom: 10px;
}

.office-details i {
  color: var(--accent);
  margin-right: 8px;
}

.contact-form-container {
  background-image: url('../images/background_container.jpg'); /* (注意) CSS是在css/資料夾，圖片在images/，所以要用 ../images/ */
  background-size: cover;       /* 讓圖片填滿容器 */
  background-position: center;  /* 圖片置中 */
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.contact-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
  /* 0 垂直間距, 20px 水平間距 */
}

.contact-form label {
  display: block;
  font-weight: 600;
  margin-top: 15px;
  margin-bottom: 5px;
  color: var(--primary);
}

.contact-form input,
.contact-form textarea,
.contact-form select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.contact-form textarea {
  resize: vertical;
}

.contact-form .btn-primary {
  width: 100%;
  margin-top: 20px;
  font-size: 1.1rem;
}

.route-info {
  margin-top: 1rem;
  padding: 1rem;
  background: #e2ecf2;
  border-radius: 8px;
  border-left: 3px solid #B8860B;
}

.route-guide {
  color: #B8860B !important;
  font-weight: 600;
  margin-bottom: 0.5rem;
}


/* === 頁尾樣式 === */
.footer {
  background: #0a2a43;
  color: #ddd;
  padding: 60px 0 30px;
  font-size: 0.95rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 40px;
  align-items: start;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 30px;
  margin-bottom: 20px;
}

.footer h3,
.footer h4 {
  color: #cba35c;
  /* 接近 accent 的金色 */
  margin-bottom: 15px;
}

.footer-about p {
  line-height: 1.6;
  color: #ccc;
}

.footer-contact ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-contact li {
  margin-bottom: 8px;
  color: #ccc;
}

.footer-contact i {
  color: #cba35c;
  margin-right: 8px;
}

.footer-social .social-icons {
  display: flex;
  gap: 15px;
}

.footer-social .social-icons a {
  color: #ccc;
  font-size: 1.2rem;
  transition: color 0.3s ease;
}

.footer-social .social-icons a:hover {
  color: var(--accent);
}

.copyright {
  text-align: center;
  font-size: 0.85rem;
  color: #999;
}


/* ======================================= */
/* === RWD 響應式設計 (手機/平板) 修正區 === */
/* ======================================= */

/* 漢堡排按鈕樣式 */
.menu-toggle {
  display: none;
  /* 平板/電腦版時隱藏 */
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1001;
  /* 確保在導覽列之上 */
  padding: 5px;
}

.menu-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background: white;
  margin: 5px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

/* 漢堡排按鈕 - 點擊後的 "X" 叉叉動畫 */
.menu-toggle.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}


/* * (重要修改) 
 * 將斷點從 768px 提高到 1100px 
 * 這樣平板電腦也會顯示漢堡排選單
 */
@media (max-width: 1100px) {

  .container {
    width: 95%; /* 手機版佔寬一點 */
    padding: 0 10px;
  }

  /* 顯示漢堡排按鈕 */
  .menu-toggle {
    display: block;
  }

  /* (修正) 讓 Logo 和 漢堡排按鈕 在同一行，並確保兩側間距 */
  .navbar .container {
    justify-content: space-between;
  }

  /* 隱藏電腦版的導覽連結 (nav-links 本身要顯示，但內容由 JS 控制) */
  /* .nav-links {
    display: none;
  } */

  /* 隱藏電腦版的右上角聯絡按鈕和電話 */
  /* .nav-contact {
    display: none;
  } */

  /* * (重要) 將 .nav-links 變為彈出式選單 
   */
  .nav-links {
    /* 變更為彈出式選單 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary);
    /* 使用品牌深藍色當底色 */

    /* 垂直置中 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 25px;

    /* 預設為隱藏 (往左移出畫面外) */
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
  }

  /* 當 .nav-links 被 JS 加上 .open 時 (滑入畫面) */
  .nav-links.open {
    display: flex;
    /* (修改) 確保 display 是 flex */
    transform: translateX(0);
  }

  /* 手機版選單內的連結樣式 */
  .nav-links a {
    font-size: 1.5rem;
    /* 放大字體 */
    color: white;
    margin: 0;
    /* 覆蓋電腦版 margin */
    padding: 10px 0;
    /* (新增) 增加點擊區域 */
    display: block;
    /* (新增) 確保佔滿寬度 */
    width: 100%;
    /* (新增) 佔滿寬度 */
    text-align: center;
    /* (新增) 文字置中 */
  }

  .nav-links a:hover {
    color: var(--accent);
    /* 維持金色 hover 效果 */
  }

  /* === (新增) RWD 下拉選單樣式 === */
  .nav-item.dropdown {
    position: relative;
    width: 100%;
    text-align: center;
    margin: 0;
    /* 覆蓋桌機版 margin */
    padding: 0;
    /* 覆蓋桌機版 padding */
  }

  .nav-links .dropdown-toggle {
    font-size: 1.5rem;
    color: white;
    margin: 0;
    padding: 10px 0;
    display: block;
    width: 100%;
    border-bottom: none;
    /* 移除 RWD 的 border */
  }

  .nav-links .dropdown-toggle:hover {
    border-bottom: none;
    /* 移除 RWD 的 border */
    border-color: transparent;
    color: var(--accent);
  }

  .dropdown-menu {
    position: static;
    /* 覆蓋桌機版 */
    display: none;
    /* 預設隱藏 */
    width: 100%;
    background: rgba(0, 0, 0, 0.15);
    /* 輕微暗色背景區分 */
    box-shadow: none;
    /* 覆蓋桌機版 */
    border-radius: 0;
    padding: 0;
    margin-top: 5px;
  }

  /* (新增) RWD .open 時顯示選單 */
  .dropdown-menu.open {
    display: block;
  }

  .dropdown-menu a {
    font-size: 1.1rem;
    /* 子選單字體稍小 */
    padding: 12px 0;
    color: #eee;
  }

  .dropdown-menu a:hover {
    color: var(--accent);
    background: rgba(0, 0, 0, 0.2);
  }

  /* (新增) 箭頭旋轉動畫 */
  .dropdown-toggle .fa-caret-down {
    transition: transform 0.3s ease;
  }

  .dropdown-toggle .fa-caret-down.rotate {
    transform: rotate(180deg);
  }

  /* (覆蓋) 移除 hover 效果，改由 JS 控制 */
  .nav-item.dropdown:hover .dropdown-menu {
    display: none;
  }

  /* === (新增) RWD 下拉選單樣式 結束 === */


  /* 調整區塊 padding */
  .section {
    padding: 60px 0;
  }

  /* 調整字體大小 */
  h2 {
    font-size: 1.8rem;
  }

  /* === (新增) 輪播 RWD 樣式 === */
  .carousel-track {
    /* 在手機上改用 16:9 比例，看起來較舒適 */
    padding-top: 56.25%;
  }

  .carousel-btn {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }

  .carousel-btn.prev {
    left: 10px;
  }

  .carousel-btn.next {
    right: 10px;
  }

  .carousel-indicators {
    bottom: 10px;
    gap: 8px;
  }

  .indicator {
    width: 10px;
    height: 10px;
  }

  /* === (新增) 輪播 RWD 樣式 結束 === */

  /* === (已新增) 委任流程 RWD === */
  .flow-grid {
    /* 在平板和手機上，改為單欄垂直排列 */
    grid-template-columns: 1fr;
    gap: 50px;
    /* 垂直間距加大 */
  }

  /* 流程箭頭 (手機版) - 隱藏桌機的右箭頭 */
  .flow-card:not(:last-child)::after {
    content: '\f063';
    /* Font Awesome 6 - down-arrow */
    top: auto;
    bottom: -35px;
    /* 放在卡片下方 */
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    /* 水平置中 */
    opacity: 0.4;
  }

  /* === (已新增) 委任流程 RWD 結束 === */

  /* 關於我們 RWD */
  .about-grid {
    grid-template-columns: 1fr;
  }

  /* 聯絡我們 RWD */
  .contact-grid {
    grid-template-columns: 1fr;
  }

  /* 兩欄變單欄 */
  .contact-form .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* 律師團隊 RWD */
  .team-grid {
    grid-template-columns: 1fr;
    /* 手機上單欄顯示 */
  }

  .lawyer-card img {
    height: 280px;
    /* 手機上圖片可以稍微縮小 */
  }

}

/* ======================== */
/* === (新增) 表單提示訊息 === */
/* ======================== */
.form-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.form-popup-overlay.show {
  opacity: 1;
  visibility: visible;
}

.form-popup-content {
  background: white;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  text-align: center;
  max-width: 400px;
  width: 90%;
  position: relative;
  /* 動畫 */
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.form-popup-overlay.show .form-popup-content {
  transform: scale(1);
}

.form-popup-close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: #aaa;
  cursor: pointer;
  line-height: 1;
}

.form-popup-close:hover {
  color: #555;
}

#form-message-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

/* 成功樣式 (預設) */
#form-message-icon .fa-check-circle {
  color: #28a745;
  /* 綠色 */
}

#form-message-title {
  color: var(--primary);
  font-size: 1.5rem;
  margin-bottom: 10px;
}

#form-message-text {
  color: #666;
  font-size: 1rem;
}

/* (新增) 失敗圖示樣式 */
#form-message-icon .fa-times-circle {
  color: #dc3545;
  /* Bootstrap 的危險紅色 */
}

/* (新增) 當 .error class 被加入時，標題變紅色 */
.form-popup-content.error #form-message-title {
  color: #dc3545;
}