* {
  box-sizing: border-box;
}

/* 無障礙樣式處理 */
*:focus {
  outline: #FFA500 dashed 3px !important;
  outline-offset: 3px !important;
  transition: outline 0.2s ease-in-out;
}

.skip-to-content {
  position: absolute;
  top: -40px;
  left: 10px;
  background-color: #005fcc;
  color: #ffffff;
  padding: 8px 16px;
  z-index: 1000;
  transition: top 0.3s ease;
  text-decoration: none;
  border-radius: 4px;
  outline: none;
}

.skip-to-content:focus {
  top: 10px; /* 當聚焦時，把它移動到可見的位置 */
  outline: 3px dashed #ffffff; /* 添加聚焦樣式，讓其更顯眼 */
}

a[accesskey] {
  left: 10px;
  position: absolute;
  color: gray;
  text-decoration: none;
  font-size: 1rem;
  font-weight: bold;
}

a[accesskey]:focus {
  z-index: 1000;
}

body,
html {
  margin: 0;
  padding: 0;
  width: 100%;
}

.content-item {
  position: relative;
  background-color: rgba(255, 255, 255, 0);
  display: flex;
  gap: 12px;
  padding: 0px 12px;
  transition: transform 0.3s ease-in-out;
}

.content-text {
  margin-top: 13.280px;
  margin-bottom: 13.280px;
  color: #595959;
  font: 600 1rem GenWanMin TW, -apple-system, Roboto, Helvetica, sans-serif;
  cursor: pointer;
  border: none;
  background: none;
}
.content-text a {
  color: #595959;
  text-decoration: none;
}

/* 支援 button 的樣式 */
.content-text.btn-link {
  border: none;
  background: none;
  font: 600 1rem GenWanMin TW, -apple-system, Roboto, Helvetica, sans-serif;
  color: #595959;
  text-decoration: none;
  padding: 0;
  margin: 13.280px 0;
}

.icon-wrapper {
  background-color: rgba(255, 255, 255, 0);
  width: 18px;
  height: 18px;
  margin: auto 0;
  margin-left: 10px;
  margin-bottom: 2px;
}

.content-item .content-children {
  position: absolute;
  display: none;
  top: 100%;
  left: -1rem;
  min-width: 150px;
  z-index: 10;
  background-color: #FFFFFF;
  box-shadow: 0 4px 8px 0 rgba(35, 55, 128, 0.2), 0 6px 20px 0 rgba(35, 55, 128, 0.2);
  opacity: 0;
  /* 初始透明度 */
  transform: translateY(-10px);
  /* 初始位置 */
  transition: opacity 0.3s ease, transform 0.3s ease;
  /* 過渡效果 */

  white-space: nowrap;
}

.content-children .child-item {
  display: block;
  padding: 8px 16px;
  text-decoration: none;
}

.content-children .child-item .child-text {
  color: #000;
}

.content-children .child-item:focus-within,
.content-children .child-item:hover {
  background-color: #E7E6EE;
}

.content-item:hover .content-text,
.content-text:focus,
.content-text:hover {
  color: #8A5691;
}

.content-item:hover .icon-wrapper,
.content-text[aria-expanded="true"] .icon-wrapper {
  transform: rotate(90deg);
}

.content-item:hover .content-children,
.content-children[aria-expanded="true"] {
  display: block;
  opacity: 1;
  /* 懸停時顯示 */
  transform: translateY(0);
  /* 懸停時移動到最終位置 */
}

/* 支援 aria-expanded 狀態 */
.content-text[aria-expanded="true"] + .content-children,
.content-children[style*="display: block"] {
  display: block !important;
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* 確保初始狀態 */
.content-children[style*="display: none"] {
  display: none !important;
  opacity: 0 !important;
  transform: translateY(-10px) !important;
}

.small-icon {
  aspect-ratio: 1;
  object-fit: auto;
  object-position: center;
  width: 10px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* .image-container {
  width: 100%;
}

.responsive-image {
  aspect-ratio: 2.33;
  object-fit: auto;
  object-position: center;
  width: 100%;
  margin-top: 120px;
} */

@media (max-width: 991px) {
  .responsive-image {
    max-width: 100%;
  }
}

.news-section {
  align-items: center;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  font-weight: 600;
  padding: 80px 0;
}

.news-header {
  align-self: start;
  display: flex;
  gap: 16px;
  color: #201515;
  white-space: nowrap;
}

.news-accent {
  border-radius: 0 50px 50px 0;
  background-color: #f4b36e;
  width: 84px;
  height: 84px;
}

.news-title-container {
  justify-content: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.news-title-main {
  font: 48px/48px GenWanMin TW, sans-serif;
  font-weight: 500;
  margin: 0px;
}

.news-title-sub {
  font: 20px GenWanMin TW, sans-serif;
  margin: 0px;
}

.news-categories {
  justify-content: space-between;
  align-self: center;
  border-radius: 42px;
  background-color: #f8f8f8;
  display: flex;
  margin-top: 42px;
  gap: 12px;
  font-size: 18px;
  color: #515151;
  white-space: nowrap;
  line-height: 144%;
  width: 90%;
  padding: 12px;
}

.category-btn {
  font-family: GenWanMin TW, sans-serif;
  font-size: 18px;
  background-color: #f8f8f8;
  justify-content: center;
  border-radius: 23px;
  border-style: none;
  padding: 8px 20px;
}

.category-btn:hover {
  background-color: #E7E6EE;
}

.category-btn:active {
  background-color: #5A3387;
}

.news-list {
  border-radius: 24px;
  align-self: center;
  display: flex;
  margin-top: 42px;
  width: 100%;
  max-width: 90%;
  flex-direction: column;
  padding: 0 12px;
}

.news-item {
  justify-content: space-between;
  border-bottom: 1px solid rgba(209, 217, 226, 1);
  display: flex;
  width: 100%;
  gap: 8px;
  white-space: nowrap;
  padding: 16px 24px;
}

.news-content {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 7px 0;
}

.news-date {
  color: #8a5691;
  font: 14px GenWanMin TW, sans-serif;
  margin: 8px 0;
}

.news-text {
  color: #515151;
  font: 16px GenWanMin TW, sans-serif;
  margin: 8px 0;
}

.news-icon {
  aspect-ratio: 1;
  object-fit: auto;
  object-position: center;
  width: 16px;
  margin: auto 0;
}

@media (max-width: 991px) {

  .news-header,
  .news-title-container {
    white-space: initial;
  }

  .news-title-main {
    font-size: 40px;
  }

  .news-categories {
    flex-wrap: wrap;
    padding-right: 20px;
    margin-top: 40px;
    white-space: initial;
  }

  .news-list {
    max-width: 100%;
    margin-top: 40px;
  }

  .news-item {
    max-width: 100%;
    flex-wrap: wrap;
    white-space: initial;
    padding: 0 20px;
  }

  .news-content {
    flex-wrap: wrap;
    white-space: initial;
    align-items: center;
  }

  .news-text {
    max-width: 100%;
  }
}


#scrollToTopBtn {
  position: fixed;
  z-index: 1000;
  bottom: 3%;
  right: 3%;
  display: none;
}

/* 修改：滾動按鈕 - 移除display: flex */
#scrollToTopBtn {
  width: 60px;
  height: 60px;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  /* display: flex; */
  justify-content: center;
  align-items: center;
  cursor: pointer;
  border: none;
}

#scrollToTopBtn .icon img {
  max-width: 90%;
  max-height: 90%;
}


.page-content.freeze {
  margin-top: 130px;
}

/* 修改：選單按鈕 - 無邊框 */
.navbar-toggler {
  border: none;
}

/* 修改：選單按鈕 - 顏色 */
.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%238a5691' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.offcanvas-body {
  padding: 0;
}

/* 搜尋按鈕 */
.off-search-btn {
  background-color: #8a5691;
  border: none;
  color: #fff;
}

.off-search-btn:hover {
  background-color: #c577d8;
}

/* Offcanvas 選單按鈕 */
.off-nav-button {
  padding: 10px;
}

form {
  border-bottom: hidden;
}

.off-nav-btn {
  transform: rotate(90deg);  /* 初始狀態就先轉90度，讓箭頭指向下 */
  transition: transform 0.3s ease-in-out;
}

.off-nav-btn.collapsed {
  transform: rotate(0deg);  /* 收合時回到原始狀態（指向右） */
  color: #8a5691;
}

.btn-link:active {
  color: #6c3774 !important;
}

.nav-link, .nav-link:hover, .nav-link:focus, .nav-link:active {
  color: #8a5691;
}

.off-nav-btn:not(.collapsed),
.nav-link[aria-expanded="true"] {
  color: #6c3774;
  font-weight: 600;
}

.off-nav-header {
  border-bottom: 1px solid #8a5691;
}

/* 選單按鈕主要 hover */
.off-nav-header:hover {
  background-color: #e7e6ee;
}

/* 選單按鈕次要 hover */
.off-nav-item-child:hover {
  background-color: #9b9b9b;
}

.off-nav-item-child > a {
  padding-left: 0;
}

/* Offcanvas 選單底部選項 */
.nav-button-off-bottom {
  padding: 10px;
}

.nav-button-off-bottom > a {
  border-right: 1px solid #e7e6ee;
}

.nav-button-off-bottom:last-child > a {
  border-right: none;
}

.nav-button-off-bottom:hover {
  background-color: #e7e6ee;
}

/* 修改：手機版選單按鈕 */
@media (max-width: 480px) {
  .nav-button {
    padding: 20px;
  }

  #Accesskey_U {
    left: 5px;
    top: 5px;
  }
}

@media (max-width: 430px) {
  .container-fluid {
    padding: 0;
  }
}

@media (max-width: 375px) {
  .container-fluid {
    padding: 0;
  }

  #Accesskey_U {
    left: 5px;
    top: 5px;
  }
}


/* 全局搜尋按鈕 */
.nav-button.close-search,
.nav-button.open-search {
  background-color: #EEF0F4;
  cursor: pointer;
}

.btn-search {
  font-size: 16px;
  font-weight: 600;
  background-color: #8A5691;
  color: #FFFFFF;
  border: none;
  padding: 24px 32px 24px 32px;
}

.input-search {
  margin: 12px;
  border: 1px solid #D1D9E2;
  border-radius: 12px;
}

.input-search:focus {
  border: 1px solid #D1D9E2;
  box-shadow: 0px 0px 0px 4px #2E59A71A;
}

#search-box {
  background-color: #fff;
  position: absolute;
  top: 0;
  right: 0;
}

.search-hidden {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s, visibility 0.5s;
}

.search-visible {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s, visibility 0.5s;
  z-index: 1045;
}

/* 字體大小類別 */
.font-size-small {
  font-size: 80% !important;
}

.font-size-medium {
  font-size: 100% !important;
}

.font-size-large {
  font-size: 120% !important;
}

/* 字體大小按鈕樣式 - 僅保留必要的自定義樣式 */
.btn-outline-primary.btn-font-size.active {
  background-color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
  color: white !important;
}

.btn-outline-primary.btn-font-size.active:hover {
  background-color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
  color: white !important;
}

img, iframe, table {
  max-width: 100%;
  height: auto;
}

p a, a, span{
  overflow-wrap: anywhere;   /* 現代瀏覽器最穩 */
  word-break: break-word;    /* 舊版 WebKit / iOS 備援 */
  white-space: normal;       /* 確保不是 nowrap */
  display: inline-block;     /* 讓 max-width 生效更穩 */
  max-width: 100%;
}