html:has(.button-container) {
  scroll-behavior: revert;
}

.page-container {
  width: 100%;
  margin: auto;
  letter-spacing: 0.1em;
}

.z-10 {
  z-index: 10 !important;
}

.sticky-2 {
  top: 2.5em !important;
}

.page-container__page-content {
  line-height: 1.5em;
}

.blue-font {
  color: #003772;
  letter-spacing: 0.11em;
  line-height: 1em;
}

.section-block {
  padding: 0.5em 0;
}

.section-block__section-title {
  margin-bottom: 1em;
}

.section-block__section-content {
  line-height: 1.5em;
}

.section-block__section-content>br {
  display: none;
}

/* Table styles */
table {
  position: relative;
  width: 100%;
  border-spacing: 0;
  color: inherit;
  font-size: inherit;
}

.table-container {
  padding: 1em 0em;
}

.table-container__table-content {
  color: #003772;
  width: fit-content;
  letter-spacing: 0.15em;
  width: 100%;
  overflow: auto;
  max-height: 43em;
  font-size: 0.7em;
  font-weight: 500;
}

.table-container__table-title {
  font-weight: 500;
  color: #ffffff;
  background-color: #003772;
  text-align: center;
  padding: 0.5em;
  width: 100%;
}

.table-container__table-content td {
  padding: 0.5em 1.5em;
  text-align: center;
  background-color: #EFEFEF;
  white-space: nowrap;
  border: 1px solid #ffffff;
  align-content: center;
}

.table-container__table-content.wrap td {
  white-space: normal;
}

.table-container__table-content tr:nth-child(even) td {
  background-color: #f8f8f8;
}

.container__footer {
  display: flex;
  justify-content: center;
  flex-direction: column;
  gap: 1em;
  background-color: #DCDDDD;
  color: #003772;
  padding: 2em;
  line-height: 1.5em;
  font-size: 0.8em;
  font-weight: 500;
}

.container__footer__left {
  width: fit-content;
  border: 1px solid #003772;
  margin-right: 1em;
  padding: 0.5em;
}

.container__footer__left br {
  display: none;
}

.container__footer__right {
  /* flex-grow: 1; */
  width: fit-content;
}

.blue-font {
  color: #003772 !important;
}

.red-font {
  color: #DA007E !important;
}

strong {
  font-size: 1.2em;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.promote-text {
  background-color: #DA007E;
  color: #ffffff;
  padding: 0.5em 1em;
  border-radius: 2em 0 2em 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 0.8em;
}

.promote-text .text-item {}

/* Sticky header and first column */
.table-container__table-header {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 5;
}


.table-container__table-header td {
  z-index: 2;
  border: 1px solid #ffffff;
}

.blue-bg {
  background-color: #CDD4EA !important;
}

.white-bg {
  background-color: #fff !important;
}

.table-container__table-header.blue-bg td {
  background-color: #CDD4EA !important;
}

table tr td.lock {
  position: sticky;
  left: 0;
  z-index: 1;
}

table tr td.center {
  vertical-align: middle;
}

table tr td.left {
  text-align: left;
}

/* list */
.page-container ul li~li {
  margin-top: 0.25em;
}

.page-container dl dt h3 {
  font-size: 1.2em;
  font-weight: 600;
  line-height: 1.5;
}

.page-container dl dd {
  margin-top: 0.5em;
}

.table-container__table-content__list {
  width: fit-content;
}

.table-container__table-content__list._center {
  margin: 0 auto;
}

.table-container__table-content__list>li {
  white-space: normal;
  width: fit-content;
  text-align: left;
  list-style: auto;
  margin-left: 2em;
  margin-bottom: 0.5em;
}

.table-container__table-content__list._disc>li {
  list-style: disc;
}

.table-container__table-content__list._alpha>li {
  list-style: lower-alpha;
  margin-left: 3em;
}

.table-container__table-content__list._roman>li {
  list-style: lower-roman;
  margin-left: 4em;
}

.table-container__table-content__list>li:last-child {
  margin-bottom: 0;
}



.table-container__table-content__text {
  text-align: justify;
  color: #000000;
  line-height: 1.5em;
  white-space: normal;
}

.table-container__table-content .table-container__table-header td:first-child {
  z-index: 3;
}

.diagonal-line {
  position: relative;
  overflow: hidden;
}

.deep_blue_bg {
  background-color: #003772 !important;
  color: #ffffff !important;
}

.wrap-text {
  white-space: normal !important;
}

.text-align-left {
  text-align: left !important;
}

.button-container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5em;
}

.button-container__item {
  background-color: #DA007E;
  color: #ffffff;
  padding: 0.5em 1em;
  border-radius: 3em 0 3em 0;
  font-size: 4vw;
  font-weight: 500;
  cursor: pointer;
  width: calc((100% - 1em)/2);
  text-align: center;
}

.button-container._four .button-container__item {
  font-size: 2.8vw;
}

.button-container__item.active {
  background-color: #003772;
}

.diagonal-line::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom right, transparent calc(50% - 1px), #ffffff, transparent calc(50% + 1px));
}

.sponsor_-group {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  flex-direction: column;
  margin-bottom: 15%;
}

.sponsor_-group .sponsor_-title {
  font-size: 1em;
  color: #fff;
  font-weight: 600;
  position: relative;
  width: 100%;
  margin-bottom: 12%;
}

.sponsor_-group .sponsor_-title::after {
  content: "";
  position: absolute;
  bottom: -15px;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(to right, #FBCA47 0%, #D0235A 15%, #23569D 30%, #00125E 49%, #23569D 100%);
}

.sponsor_-group .sponsor_-items {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 3em;
}

.sponsor_-items .sponsor_-item {
  background: #fff;
  border-radius: 50px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-direction: column;
  padding: 20px;
  width: 330px;
  height: 220px;
}

.sponsor_-items .sponsor_-item a {
  width: 100%;
}

.sponsor_-items .sponsor_-hr {
  height: 1.7px;
  background: #000;
  width: 90%;
}

.sponsor_-item .sponsor_-imgwrap {
  width: 330px;
  height: 220px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.sponsor_-item .sponsor_-img {
  max-height: 130px;
  max-width: 200px;
  object-fit: contain;
}

.sponsor_-item .sponsor_-text {
  font-weight: 700;
  font-size: 1.1em;
}



@media (min-width: 768px) {
  .button-container__item {
    font-size: 1em;
    width: calc((100% - 2em)/3);
  }

  .button-container._four .button-container__item {
    font-size: 0.6em;
  }

  .button-container._four .button-container__item._hs {
    font-size: 1em;
  }
}

@media (min-width: 1024px) {
  .sponsor_-item .sponsor_-text {
    font-size: 0.7em;
  }

  .sponsor_-items .sponsor_-item {
    width: 380px;
    height: 250px;
  }

  .sponsor_-item .sponsor_-imgwrap {
    width: 380px;
    height: 250px;
  }

  .sponsor_-item .sponsor_-img {
    max-height: 170px;
    max-width: 250px;
  }

  .section-block__section-content>br {
    display: block;
  }

  .button-container__item {
    font-size: 0.7em;
    padding: 0.2em 0.5em;
    width: calc((100% - 2em)/3);
  }

  .button-container._four .button-container__item._hs {
    font-size: 1em;
  }

  .promote-text {
    font-size: 1em;
  }

  .promote-text .text-item {}


  .table-container__table-content {
    font-size: 0.8em;
    max-height: none;
  }

  .table-container__table-content td {
    white-space: normal;
    padding: 0.5em;
  }

  .table-container__table-content__text {
    padding: 1em 2em;
  }

  .container__footer {
    flex-direction: row;
    align-items: stretch;
    padding: 2em;
  }

  .container__footer__left {
    width: fit-content;
    border: 1px solid #003772;
    margin-right: 1em;
    padding: 0.5em;
    width: 8em;
    align-content: center;
    font-size: 1.35em;
    line-height: 1.5;
    text-align: center;
  }

  .container__footer__left br {
    /* display: block; */
  }

  .container__footer__right {
    /* flex-grow: 1; */
    width: fit-content;
    line-height: 2;
  }

  .wrap-text {
    padding: 1em 2em;
  }

}

@media (max-width: 767px) {
  .table-container__table-content td {
    font-size: 0.8em;
    padding: 0.4em 0.6em;
    white-space: normal;
  }

  table tr td.lock {
    font-size: 0.8em;
  }

  .table-container__table-content {
    font-size: 0.8em;
  }
}

@media (min-width: 1200px) {
  .promote-text {
    padding: 0.5em 2em;
    border-radius: 3em 0 3em 0;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    font-size: 0.7em;
  }

  .promote-text .text-item {
    position: relative;
    text-align: center;
    flex-grow: 1;
  }

  .promote-text .text-item~.text-item {
    /* margin-left: 3em; */
  }

  .promote-text .text-item~.text-item:before {
    content: "";
    position: absolute;
    width: 3px;
    height: 5em;
    background-color: #fff;
    left: 0em;
    top: 50%;
    transform: translate(-50%, -50%) rotate(40deg);
  }

  .sponsor_-group .sponsor_-title {
    margin-bottom: 3%;
  }

  .sponsor_-group {
    margin-bottom: 5%;
  }


}

@media (min-width: 1440px) {
  .promote-text {
    font-size: 0.6em;
  }

  .button-container__item {
    font-size: 1em;
  }
}

@media (min-width: 1680px) {}

.cursor-none {
  cursor: default;
}

/* 圖片畫廊樣式 - 原生 lazy loading + modal */
.gallery-grid-small {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  padding: 20px 0;
}

.gallery-thumbnail-small {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  transition: opacity 0.2s ease;
}

.gallery-thumbnail-small:hover {
  opacity: 0.7;
}

.gallery-thumbnail-small.loaded:hover {
  opacity: 0.7;
}

/* 圖片 Lightbox 置中樣式 */
#image-lightbox.lightbox {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#image-lightbox .lightbox-content {
  margin: auto !important;
  text-align: center !important;
  max-width: 95vw !important;
  max-height: 95vh !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

#image-lightbox #modal-image {
  width: auto;
  height: auto;
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
}

/* Lazy loading 樣式 */
.gallery-thumbnail-small.lazyload {
  opacity: 0.6;
  background-color: #f5f5f5;
}

.gallery-thumbnail-small.loaded {
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* 響應式設計 */
@media (min-width: 768px) {
  .gallery-grid-small {
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
  }
  
  .gallery-thumbnail-small {
    height: 140px;
  }
}

@media (min-width: 1024px) {
  .gallery-grid-small {
    grid-template-columns: repeat(8, 1fr);
    gap: 15px;
  }
  
  .gallery-thumbnail-small {
    height: 150px;
  }
}

@media (max-width: 767px) {
  .gallery-grid-small {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
  
  .gallery-thumbnail-small {
    height: 100px;
  }
}

/* StPageFlip 翻頁功能樣式 */
.flip-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1em;
  padding: 1em;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 1em;
  flex-wrap: wrap;
}

/* 圖標按鈕樣式 */
.flip-toolbar .btn-icon {
  background: #003772;
  color: white;
  border: 1px solid #003772;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0 2px;
}

.flip-toolbar .btn-icon:hover {
  background: #002a5a;
  color: white;
  border-color: #002a5a;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 55, 114, 0.3);
}

.flip-toolbar .btn-icon:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 55, 114, 0.2);
}

.flip-toolbar .btn-icon:disabled {
  background: #ccc;
  color: #999;
  border-color: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.flip-toolbar .btn-icon.ghost {
  background: transparent;
  color: #003772;
  border: 1px solid #003772;
}

.flip-toolbar .btn-icon.ghost:hover {
  background: #003772;
  color: white;
  border-color: #003772;
}

/* SVG 圖標樣式 */
.flip-toolbar .btn-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
  font-weight: bold;
}

.flip-toolbar .btn-icon.ghost svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.5;
  font-weight: bold;
}

.flip-toolbar .sep {
  width: 1px;
  height: 24px;
  background: #ddd;
  margin: 0 0.5em;
}

/* 頁碼群組樣式 */
.flip-toolbar .pager-group {
  display: flex;
  align-items: center;
  margin: 0 0.5em;
  padding: 0 0.5em;
  background: #003772;
  border: 1px solid #003772;
  border-radius: 6px;
  height: 32px;
  min-width: 60px;
}

.flip-toolbar .pager {
  font-size: 0.85em;
  color: white;
  text-align: center;
  width: 100%;
}

/* 縮放群組樣式 */
.flip-toolbar .zoom-group {
  display: flex;
  align-items: center;
  gap: 0.25em;
}

#flipWrap {
  --zoom: 1;
  transform: scale(var(--zoom));
  transform-origin: center top;
  transition: transform 0.2s ease;
  margin: 0 auto;
  max-width: 100%;
  overflow: hidden;
}

#flipWrap[data-zoom] {
  margin-bottom: calc((var(--zoom) - 1) * 50vh);
}

#flipbook {
  width: 100%;
  height: auto;
  margin: 0 auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
  min-height: 600px;
  background: #f5f5f5;
}

#flipbook .page {
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 600px;
  border: 1px solid #ddd;
}

#flipbook .page img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  max-width: 100%;
  max-height: 100%;
}


/* 調試用樣式 */
#flipbook .page:empty::after {
  content: "載入中...";
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #999;
  font-size: 1.2em;
}

/* 響應式設計 */
@media (max-width: 768px) {
  .flip-toolbar {
    padding: 0.5em;
    gap: 0.5em;
  }
  
  .flip-toolbar .btn {
    padding: 0.4em 0.8em;
    font-size: 0.9em;
    min-width: 35px;
    height: 35px;
  }
  
  .flip-toolbar .zoom input[type="range"] {
    width: 80px;
  }
  
  .flip-toolbar .sep {
    display: none;
  }
}

@media (max-width: 480px) {
  .flip-toolbar {
    flex-direction: column;
    gap: 0.5em;
  }
  
  .flip-toolbar .zoom {
    order: -1;
    width: 100%;
    justify-content: center;
  }
  
  .flip-toolbar .zoom input[type="range"] {
    width: 120px;
  }
}

/* 全螢幕模式 */
#flipWrap:fullscreen {
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2em;
}

#flipWrap:fullscreen #flipbook {
  max-width: 90vw;
  max-height: 90vh;
}

/* 載入狀態 */
#flipbook.loading {
  opacity: 0.7;
  pointer-events: none;
}

#flipbook.loading::after {
  content: "載入中...";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 1em 2em;
  border-radius: 4px;
  z-index: 1000;
}

/* 訓練營紀錄頁面樣式 */
.training-photos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3em;
}

.training-photos .photo-item {
  width: 100%;
  background: #e5e7eb;
  border: 1em solid #FFF;
  border-radius: 1.5em;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.photo-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.photo-item h4 {
  font-size: 0.8em;
  color: #FFF;
  font-weight: 400;
}

.photo-item a {
  display: block;
  width: 100%;
  height: 100%;
}

.photo-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 16/9.6;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.photo-item a:hover img {
  transform: scale(1.05);
}

.coming-soon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 250px;
  color: #6b7280;
  font-size: 1.1rem;
  font-weight: 500;
  background: #f9fafb;
  border: 2px dashed #d1d5db;
}

@media all and (min-width: 1024px) {
  .training-photos {
    gap: 1.5em;
  }
  .training-photos .photo-item {
    width: calc((100% - 1.5em) / 2);
  }
}

/* Utility classes for replacing inline styles */
.mb-2em {
  margin-bottom: 2em;
}

.mb-05em {
  margin-bottom: 0.5em;
}

.text-center {
  text-align: center;
}

.fw-400 {
  font-weight: 400;
}

.margin-vertical {
  margin: 1em 0 0.5em;
}

.ml-1em {
  margin-left: 1em;
}

.ml-3em {
  margin-left: 3em;
}

.text-black {
  color: #000000;
}

.ml--3em {
  margin-left: -3em;
}

.mr-25em {
  margin-right: 2.5em;
}

.mt-05em {
  margin-top: 0.5em;
}

.mb-1em {
  margin-bottom: 1em;
}

.fs-08em {
  font-size: 0.8em;
}

.bg-pink {
  background-color: #D0235A;
}

/* Gallery Navigation Styles */
.gallery-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

.gallery-nav-btn {
  background: #003772;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
}

.gallery-nav-counter {
  color: white;
  align-self: center;
  margin: 0 5px;
}

.min-width-10em {
  min-width: 10em;
}

.img-padding-1 {
  padding: 1em 0 1em 0;
}

.img-padding-2 {
  padding: 1em 3em 1em 0;
}

.img-padding-3 {
  padding: 1em 0;
}

.img-padding-4 {
  padding: 1em 0 1em 1em;
}

.flex-center {
  display: flex;
  justify-content: center;
}

.img-width-500 {
  width: 500px;
  max-width: 100%;
}

.img-center {
  margin: auto;
  padding-bottom: 20px;
}

.img-padding-5 {
  padding: 1em 0 1em 3em;
}

.margin-top-0 {
  margin: 1em 0 0 0;
}

.margin-05em {
  margin: 0.5em;
}

.coming-soon-text {
  font-size: 3em;
  font-weight: 500;
  padding: 3em 0;
  text-align: center;
  color: #fff;
}

.img-full {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.error-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 400px;
  color: #999;
  flex-direction: column;
  gap: 10px;
}

.error-title {
  font-size: 1.1em;
  font-weight: bold;
}

.error-message {
  font-size: 0.9em;
}

.error-button {
  margin-top: 10px;
  padding: 8px 16px;
  background: #003772;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}