html,
body {
  width: 100%;
  height: 101%;
  /*background: linear-gradient(#FEF2E9, #FFFFFF);
    background-size:cover;
    background-attachment: fixed;
    background-repeat: no-repeat;*/
  font-family: Microsoft JhengHei;
}

/* 跳過連結樣式：預設用transform整個移出可視範圍外(依自身高度計算，不受字級/縮放影響)，focus時才移回 */
.skip-link {
  position: absolute;
  top: 6px;
  left: 6px;
  transform: translateY(-150%);
  background: #000;
  color: #fff;
  padding: 8px 12px;
  text-decoration: none;
  z-index: 1000;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
  background: #005fcc;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 95, 204, 0.3);
}

.items {
  border-bottom: 1px #ddd solid;
  padding: 5px;
}

#pnlInformation {
  color: black;
}

#pnlInformation h3 {
  background-color: #323232;
  color: silver;
  padding: 5px;
}

#pnlInformation .pnl-info-window aside:nth-of-type(1) {
  margin: 5px;
}

#pnlCopyRight {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  padding-top: 0.25%;
  padding-bottom: 0.25%;
  background-color: #323232;
  color: silver;
  z-index: 99996;
}

#pnlCopyRight a {
  color: white;
}

.img-full {
  width: 100%;
}

.img-item {
  padding-right: 10px;
  width: 30px;
  margin-bottom: 5px;
}

.pnl-image-link {
  padding-top: 5px;
}

.panel-heading h3 {
  font-weight: 800;
}

/*ckeditor*/
.ckeditor-content {
  max-width: auto;
  overflow-wrap: break-word;
}

/* 圖片自動縮放 */
.ckeditor-content img {
  max-width: 100% !important;
  height: auto !important;
  display: block;
}

/* 表格不要爆版 */
.ckeditor-content table {
  width: auto !important;
  max-width: auto;
  border-collapse: collapse;
}

/* 表格內容也不要亂撐 */
.ckeditor-content td,
.ckeditor-content th {
  word-break: break-word;
}

/* 響應式設計增強 */
@media screen and (max-width: 768px) {
  .container {
    padding-left: 15px;
    padding-right: 15px;
  }

  .card {
    margin-left: 0;
    margin-right: 0;
  }

  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .btn {
    width: 100%;
    margin-bottom: 10px;
  }

  .btn-group .btn {
    width: auto;
    margin-bottom: 0;
  }

  .form-control {
    font-size: 1rem;
    /* 防止 iOS 縮放，改用相對單位 */
  }

  .img-item {
    width: 25px;
    height: auto;
  }
}

@media screen and (max-width: 480px) {
  .container {
    padding-left: 10px;
    padding-right: 10px;
  }

  .card-body {
    padding: 15px;
  }

  .table {
    font-size: 0.875rem;
  }

  .btn {
    font-size: 0.875rem;
    padding: 8px 12px;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  h3 {
    font-size: 1.1rem;
  }
}

@media screen and (max-width: 320px) {
  .container {
    padding-left: 5px;
    padding-right: 5px;
  }

  .card-body {
    padding: 10px;
  }

  .table {
    font-size: 0.8rem;
  }

  .btn {
    font-size: 0.8rem;
    padding: 6px 10px;
  }

  h1 {
    font-size: 1.25rem;
  }

  h2 {
    font-size: 1.1rem;
  }

  h3 {
    font-size: 1rem;
  }

  .img-item {
    width: 20px;
    height: auto;
  }
}

/* 確保所有圖片都是響應式的 */
img {
  max-width: 100%;
  height: auto;
}

/* 確保表格在行動裝置上不會造成水平捲動 */
.table-responsive {
  border: none;
}

/* 改善表單在行動裝置上的體驗 */
@media screen and (max-width: 768px) {
  .form-group {
    margin-bottom: 15px;
  }

  .form-control {
    margin-bottom: 10px;
  }

  .col-form-label {
    margin-bottom: 5px;
    font-weight: bold;
  }
}

/* 確保導航選單在行動裝置上正常顯示 */
@media screen and (max-width: 768px) {
  .navbar-nav {
    text-align: center;
  }

  .navbar-nav .nav-link {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
  }
}

/* 改善模態框在行動裝置上的顯示 */
@media screen and (max-width: 768px) {
  .modal-dialog {
    margin: 10px;
    max-width: calc(100% - 20px);
  }

  .modal-content {
    border-radius: 0;
  }
}

/* 確保文字不會超出容器 */
* {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* 改善連結在行動裝置上的點擊體驗 */
@media screen and (max-width: 768px) {
  a {
    min-height: 44px;
    display: inline-block;
    line-height: 44px;
  }

  .btn {
    min-height: 44px;
  }
}

/* 鍵盤可操作性增強 */
/* 確保所有可互動元素都有明顯的焦點樣式 */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
[tabindex]:focus {
  outline: 2px solid #005fcc;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px rgba(0, 95, 204, 0.2);
}

/* 改善按鈕的鍵盤焦點樣式 */
.btn:focus {
  outline: 3px solid #005fcc;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(0, 95, 204, 0.3);
}

/* 改善導航連結的鍵盤焦點樣式 */
.nav-link:focus {
  outline: 2px solid #005fcc;
  outline-offset: 2px;
  background-color: rgba(0, 95, 204, 0.1);
  border-radius: 4px;
}

/* 改善表單元素的鍵盤焦點樣式 */
.form-control:focus {
  outline: 2px solid #005fcc;
  outline-offset: 2px;
  border-color: #005fcc;
  box-shadow: 0 0 0 2px rgba(0, 95, 204, 0.2);
}

/* 確保模態框中的焦點樣式 */
.modal .btn:focus,
.modal .form-control:focus {
  outline: 2px solid #005fcc;
  outline-offset: 2px;
}

/* 改善卡片中連結的焦點樣式 */
.card a:focus {
  outline: 2px solid #005fcc;
  outline-offset: 2px;
  background-color: rgba(0, 95, 204, 0.1);
  border-radius: 4px;
  padding: 2px 4px;
}

/* 確保跳過連結的焦點樣式 */
.skip-link:focus {
  outline: 3px solid #fff;
  outline-offset: 2px;
  background-color: #000;
  color: #fff;
}

/* 改善表格中連結的焦點樣式 */
.table a:focus {
  outline: 2px solid #005fcc;
  outline-offset: 2px;
  background-color: rgba(0, 95, 204, 0.1);
  border-radius: 3px;
  padding: 1px 3px;
}

/* 確保所有可點擊元素都有足夠的點擊區域 */
a,
button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 改善鍵盤導航的視覺回饋 */
*:focus {
  transition: outline 0.2s ease, box-shadow 0.2s ease;
}

/* 確保鍵盤使用者可以看到焦點指示器 */
@media (prefers-reduced-motion: no-preference) {
  *:focus {
    animation: focus-pulse 0.3s ease-in-out;
  }
}

@keyframes focus-pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.02);
  }

  100% {
    transform: scale(1);
  }
}

/* 輪播本身的無障礙改善 */
.carousel {
  position: relative;
}

.carousel:focus-within {
  outline: 2px solid #005fcc;
  outline-offset: 4px;
  border-radius: 8px;
}

.carousel-indicators button {
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  background-color: transparent;
  transition: all 0.2s ease;
}

.carousel-indicators button:focus {
  outline: 2px solid #005fcc;
  outline-offset: 2px;
  border-color: #005fcc;
  background-color: rgba(0, 95, 204, 0.2);
}

.carousel-indicators button:hover {
  background-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.carousel-indicators button.active {
  background-color: #005fcc;
  border-color: #005fcc;
}

.carousel-control-prev,
.carousel-control-next {
  min-width: 60px;
  min-height: 60px;
  background-color: rgba(0, 0, 0, 0.3);
  border: none;
  transition: all 0.2s ease;
}

.carousel-control-prev:focus,
.carousel-control-next:focus {
  outline: 3px solid #005fcc;
  outline-offset: 2px;
  background-color: rgba(0, 95, 204, 0.5);
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  background-color: rgba(0, 0, 0, 0.5);
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  width: 24px;
  height: 24px;
}

#footer-container{
  background-color: #000000;
}

/* Footer line-height adjustments to prevent oversized spacing on mobile */
footer .small,
footer .small span,
footer .small a,
footer ul li {
  line-height: 1.3;
}

/* Override global mobile link sizing inside footer */
footer a {
  min-height: 0;
  line-height: 1.3;
  display: inline;
}

/* Make carousel prev/next controls transparent (default, hover, focus) */
.carousel-control-prev,
.carousel-control-next {
  background-color: transparent;
}

.carousel-control-prev:hover,
.carousel-control-next:hover,
.carousel-control-prev:focus,
.carousel-control-next:focus {
  background-color: transparent;
}

/* .front-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
} */

/* 無障礙設計：使用媒體查詢解除粘滯頁尾，符合WCAG 2.1指引1.4.10*/
/* 當視窗寬度 ≤ 320px 或高度 ≤ 256px 時，移除固定定位以避免二維捲動 */
/* @media (max-width: 320px),
(max-height: 256px) {

  .front-footer,
  #pnlCopyRight {
    position: static !important;
    bottom: auto !important;
  }
} */

/* 當視窗寬度小於640px時（相當於320px放大200%），解除粘滯頁尾 */
/* @media (max-width: 639px) {

  .front-footer,
  #pnlCopyRight {
    position: static !important;
    bottom: auto !important;
  }
} */

/* 當視窗高度小於512px時（相當於256px放大200%），解除粘滯頁尾 */
/* @media (max-height: 511px) {

  .front-footer,
  #pnlCopyRight {
    position: static !important;
    bottom: auto !important;
  }
} */

/* 無障礙設計：確保AI聊天機器人按鈕支援鍵盤操作，符合WCAG 2.1指引2.1.1 */
/* 為QbiAI聊天機器人按鈕（試務小幫手）添加鍵盤可操作性 */
[class*="qbi"],
[id*="qbi"],
[class*="QbiAI"],
[id*="QbiAI"],
[class*="Qbi"],
[id*="Qbi"],
/* 試務小幫手的特定 ID */
#dvSmartAgent,
#dvSmartAgentICON,
#dvICON,
#dvICONTitle {
  /* 確保按鈕可以被鍵盤聚焦 */
  outline: 2px solid transparent;
  outline-offset: 2px;
  /* 確保按鈕在鍵盤導航時可見且可訪問 */
  opacity: 1 !important;
  visibility: visible !important;
  /* 確保可以透過 Tab 鍵訪問 */
  -webkit-tap-highlight-color: rgba(0, 95, 204, 0.3);
  /* 確保有適當的游標樣式 */
  cursor: pointer;
}

/* 當AI聊天按鈕獲得焦點時顯示明顯的焦點指示器 */
[class*="qbi"]:focus,
[id*="qbi"]:focus,
[class*="QbiAI"]:focus,
[id*="QbiAI"]:focus,
[class*="Qbi"]:focus,
[id*="Qbi"]:focus,
[class*="qbi"]:focus-visible,
[id*="qbi"]:focus-visible,
[class*="QbiAI"]:focus-visible,
[id*="QbiAI"]:focus-visible,
[class*="Qbi"]:focus-visible,
[id*="Qbi"]:focus-visible,
/* 試務小幫手的特定 ID 焦點樣式 */
#dvSmartAgent:focus,
#dvSmartAgentICON:focus,
#dvICON:focus,
#dvICONTitle:focus,
#dvSmartAgent:focus-visible,
#dvSmartAgentICON:focus-visible,
#dvICON:focus-visible,
#dvICONTitle:focus-visible {
  outline: 3px solid #005fcc !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 4px rgba(0, 95, 204, 0.3) !important;
  z-index: 9999 !important;
}

/* 確保按鈕有 tabindex 時可以被鍵盤訪問 */
[class*="qbi"][tabindex],
[id*="qbi"][tabindex],
[class*="QbiAI"][tabindex],
[id*="QbiAI"][tabindex],
[class*="Qbi"][tabindex],
[id*="Qbi"][tabindex],
/* 試務小幫手的特定 ID */
#dvSmartAgent[tabindex],
#dvSmartAgentICON[tabindex],
#dvICON[tabindex],
#dvICONTitle[tabindex] {
  /* 確保按鈕可以被聚焦 */
  display: block !important;
  /* position: relative !important; */
}

.banner-section {
  position: relative;
}

/* 桌機與全域基礎樣式 */
.carousel-control-panel {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  background: rgba(0, 0, 0, 0.45);
  padding: 4px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
  display: flex;
  gap: 4px;
}

/* 提高按鈕在控制面板內的質感 */
.carousel-control-panel .btn-light {
  min-width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  color: #212529;
  transition: background-color 0.2s ease;
}

.carousel-control-panel .btn-light:focus-visible {
  outline: 3px solid #005fcc !important;
  outline-offset: 2px;
}

/* 手機版極簡微調 (<768px)：保留精緻外殼，極致緊湊排版 */
@media (max-width: 767.98px) {
  .carousel-control-panel {
    position: absolute;
    top: auto;
    right: 0px;
    bottom: 0px; /* 懸浮在右下角 */
    margin: 0;
    background: rgba(0, 0, 0, 0.45);
    padding: 3px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
    gap: 3px;

    height: calc(38px + 6px) !important; /* 按鈕 38px + 上下 padding 各 3px */
    box-sizing: border-box !important;
    align-items: center !important;
  }

  .carousel-control-panel .btn {
    min-width: 38px; /* 保留 AA 級的物理尺寸，但外觀縮小 */
    height: 38px;
    background: rgba(255, 255, 255, 0.8);
    color: #000;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0 !important;
    margin: 0 !important;
  }
}

.carousel-control-panel .btn {
  white-space: nowrap;
}

.col-form-label[for="password"] {
    height: calc(2rem); /* 大約是 input 的高度加上 margin */

}

/* 手機版時 label 通常在上方，改回寬度 100% 並靠左 */
@media (max-width: 576px) {
    .col-form-label[for="password"] {
        height: calc(2rem);

    }
}
/* 統一預覽圖尺寸並設定滑鼠游標 */
.img-status-preview {
    height: 60px;
    width: auto;
    object-fit: contain;
    cursor: zoom-in;
}

/* certified_file預覽容器的基本樣式 */
.preview-container {
    position: relative;
    min-height: 220px;
}

.preview-container img {
    max-height: 250px;
    object-fit: contain;
}

/* certified_file選取尚未上傳的PDF時，可點擊開新分頁預覽 */
.preview-clickable {
    cursor: pointer;
}




