
/* 側欄選單動畫：手機收合，桌機直接展開 */
.sidebar-nav {
  overflow: hidden;
  transition: max-height .35s ease;
  max-height: 0;
}
@media (min-width: 1024px) {
  .sidebar-nav {
    max-height: none;
    overflow: visible;
  }
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

/* 防止內文任何寬內容撐破容器造成橫向捲軸 */
.content-body {
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* 強制所有子元素不超出容器，文字自動換行 */
.content-body * {
  max-width: 100% !important;
  box-sizing: border-box;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
  white-space: normal !important;
}

/* 內文 HTML 裡的圖片：不超過容器寬度，但不強制拉伸小圖 */
.content-body img {
  height: auto !important;
  display: block !important;
  margin: 0.75rem auto !important;
}

/* 內文表格 wrapper（由 JS 動態加入） */
.table-scroll-wrapper {
  overflow-x: auto;
  max-width: 100%;
  margin: 1rem 0;
}
.content-body table {
  border-collapse: collapse;
  min-width: max-content;
}
.content-body table td,
.content-body table th {
  padding: 6px 10px;
}

/* 內文嵌入的 iframe（YouTube 等）自適應寬度 */
.content-body iframe {
  max-width: 100% !important;
  width: 100% !important;
  aspect-ratio: 16 / 9;
  height: auto !important;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}