body {
  /* 確保背景色覆蓋 Bootstrap 預設的白色 */
  background-color: #f8f9fa !important;
  font-family: 'Segoe UI', "Microsoft JhengHei", "微軟正黑體", sans-serif;
}

a {
  text-decoration: none;
}

.main-container {
  max-width: 1600px;
  margin: 30px auto;
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  /* 現代感的柔和陰影 */
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

/* 頁面標題區塊 */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 15px;
}

/* 頂部功能按鈕微調
  針對 .btn 增加間距與圓角，載入順序正確即可覆蓋 Bootstrap .btn 預設值
*/
.top-actions .btn {
  margin-left: 10px;
  border-radius: 20px;
  padding: 8px 20px;
  font-weight: 500;
}

/* 表格優化
  使用較高的權重 (Specificity) 或依賴載入順序來覆蓋 Bootstrap 的 .table 樣式
*/
.table thead th {
  background-color: #f1f3f5 !important;
  /* 強制覆蓋 Bootstrap 表頭背景 */
  color: #495057;
  border: none;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.9rem;
}

/* 表格列互動效果 */
.table tbody tr {
  transition: all 0.2s ease-in-out;
}

.table tbody tr:hover {
  background-color: #f8f9fa !important;
  /* 確保懸停顏色正確 */
  transform: translateY(-2px);
  /* 懸浮微動效 */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  z-index: 1;
  position: relative;
  /* 讓陰影顯示在其他列之上 */
  cursor: pointer;
}

/* 標題連結樣式 */
.news-title {
  font-weight: 600;
  color: #212529;
  text-decoration: none;
  display: block;
  /* 讓整行文字區域都可點擊 */
}

.news-title:hover {
  color: #0d6efd;
  /* Bootstrap Primary Color */
}

/* 部門標籤 */
.badge-dept {
  background-color: #e3f2fd;
  color: #0d6efd;
  font-size: 0.85em;
  font-weight: 600;
}

.required-mark {
  color: red;
  margin-left: 3px;
}

.form-label i {
  margin-right: 5px;
  width: 20px;
  text-align: center;
  color: #555;
}

.note-editor .note-toolbar {
  background: #f8f9fa;
}

/* 自定義大型 Switch 開關樣式 */
.form-check-input.switch-lg {
  width: 4rem !important;
  /* 加寬 */
  height: 1.4rem !important;
  /* 加高 */
  margin-left: 0 !important;
  /* 移除預設左邊距 */
  cursor: pointer;
  float: none;
  /* 修正 Bootstrap 預設浮動 */
}

/* 開關容器：彈性排版，讓文字靠左、開關靠右 */
.switch-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0;
}

/* 設定卡片背景與圓角，讓每個選項更像一個獨立的設定區塊 */
.switch-card {
  background-color: #f8f9fa;
  /* 淺灰背景 */
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  padding: 1rem;
  height: 100%;
  /* 確保同列高度一致 */
}

/*
---------------------------------------------
News Attachment
---------------------------------------------
*/
/* Gmail 風格附件樣式 */
.gmail-attachment {
  background-color: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 10px;
  width: 200px;
  margin-right: 15px;
  position: relative;
  overflow: hidden;
  display: inline-block;
}

.gmail-icon {
  font-size: 40px;
  color: #d93025;
}

.att-name {
  font-weight: bold;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.att-size {
  font-size: 12px;
  color: #666;
}

/* Gmail 風格附件樣式 */
.gmail-att-box {
  background: #f1f3f4;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  padding: 10px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  width: fit-content;
}

.gmail-att-icon {
  font-size: 24px;
  color: #d93025;
  margin-right: 10px;
}

.gmail-att-name {
  font-weight: bold;
  margin-right: 15px;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 預覽頁面專用樣式 */
.preview-label {
  font-weight: bold;
  color: #555;
  margin-bottom: 5px;
}

.preview-value {
  background-color: #fff;
  border: 1px solid #e9ecef;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  min-height: 38px;
}

.preview-content {
  background-color: #fff;
  border: 1px solid #e9ecef;
  padding: 20px;
  border-radius: 0.375rem;
  min-height: 200px;
}

.preview-content img {
  max-width: 100% !important;
  height: auto !important;
}

.preview-gmail-att-box {
  background: #f1f3f4;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  padding: 10px;
  margin-right: 15px;
  margin-bottom: 10px;
  display: inline-flex;
  align-items: center;
  min-width: 250px;
}

.preview-gmail-att-icon {
  font-size: 24px;
  color: #d93025;
  margin-right: 10px;
}

.preview-gmail-att-info {
  display: flex;
  flex-direction: column;
}

.preview-gmail-att-name {
  font-weight: bold;
  font-size: 14px;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-gmail-att-desc {
  font-size: 12px;
  color: #666;
}

/* 新增消息預覽頁面專用樣式 */
/* 針對消息內容中的圖片進行 RWD 響應式控制 */
.news-content img {
  /* 寬度限制：最大不超過父容器 (div.news-content) 的 100% */
  max-width: 100% !important;

  /* 高度限制：自動依比例縮放 */
  height: auto !important;

  /* (選用) 高度限制：若不想圖片太長佔滿整個螢幕高度，可設定視窗高度的 80% */
  /* max-height: 80vh; */

  /* 樣式優化：讓圖片置中或稍微留白 */
  display: block;
  margin: 10px 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  /* 加點陰影增加層次感 */
}