@import url("https://schoolweb.tn.edu.tw/uploads/fonts/woff2.css");
@import url("https://fonts.googleapis.com/css?family=Noto+Sans+TC|Noto+Serif+TC&display=swap");

.c {
  text-align: center;
  vertical-align: middle !important;
}

.m {
  vertical-align: middle !important;
}

h1.my,
h2.my,
h1>span.my,
h2>span.my {
  padding: 6px;
  /* 離標題邊框距離 */
  text-align: left;
  /* 文字靠左 */
  font-weight: normal;
  /* 不要粗體 */
  font-family: HanWangMingBlack, jf-openhuninn, 'Noto Sans TC', Mamelon;
  color: rgb(33, 51, 51);
  /* 字型 */
  /* background: -webkit-linear-gradient(rgb(89, 112, 134), rgb(33, 51, 51)); */
  /* 漸層顏色 */
  /* -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; */

}

h3.my,
h4.my,
h5.my,
h3>span.my,
h4>span.my,
h5>span.my {
  padding: 6px;
  /* 離標題邊框距離 */
  text-align: left;
  /* 文字靠左 */
  font-weight: normal;
  /* 不要粗體 */
  font-family: jf-openhuninn, 'Noto Sans TC', Mamelon;
  color: rgb(92, 41, 56);
  /* 字型 */
  /* background: -webkit-linear-gradient(rgb(126, 92, 64), rgb(92, 41, 56)); */
  /* 漸層顏色 */
  /* -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; */
}

.my-title {
  padding: 6px;
  /* 離標題邊框距離 */
  text-align: left;
  /* 文字靠左 */
  font-weight: normal;
  /* 不要粗體 */
  font-family: jf-openhuninn, 'Noto Sans TC', Mamelon;
  color: #3a322e;
}

.my-border {
  padding: 12px 20px;
  border: 1px solid rgb(225, 225, 225);
  border-radius: 8px;
  background: rgb(245, 245, 245);
  /* box-shadow: 0px 0px 6px 1px rgba(37, 37, 37, 0.2); */
  margin: 10px auto;
}

.my-sm-border {
  padding: 6px 10px 8px 10px;
  border: 1px solid rgb(225, 225, 225);
  border-radius: 4px;
  background: rgb(245, 245, 245);
  margin: 10px auto;
}

ol {
  list-style-type: decimal;
  list-style-position: outside;
  padding-left: 20px;
}

ul {
  list-style-type: disc;
  list-style-position: outside;
  padding-left: 20px;
}

.tooltip-inner {
  max-width: 600px;
  font-size: 0.95em;
  background-color: #830d48;
  box-shadow: 2px 2px 5px 0px rgba(0, 0, 0, 0.5);
  line-height: 1.8;
}

.tooltip.bs-tooltip-right .arrow:before {
  border-right-color: #830d48 !important;
}

.tooltip.bs-tooltip-left .arrow:before {
  border-left-color: #830d48 !important;
}

.tooltip.bs-tooltip-bottom .arrow:before {
  border-bottom-color: #830d48 !important;
}

.tooltip.bs-tooltip-top .arrow:before {
  border-top-color: #830d48 !important;
}

.bar {
  text-align: center;
  margin: 3em auto;
}

/* ===== 前台專區列表與頁籤（ntb- 前綴；不用 Bootstrap 的 btn 類別） ===== */
.ntb-btn,
a.ntb-btn,
button.ntb-btn {
  display: inline-block; padding: 3px 10px; margin: 1px 2px; font-size: .85rem; line-height: 1.5;
  border: 1px solid transparent; border-radius: 4px; color: #fff !important; text-decoration: none !important;
  cursor: pointer; vertical-align: middle;
}
.ntb-btn-primary { background: #0d6efd; border-color: #0d6efd; }
.ntb-btn-primary:hover { background: #0b5ed7; }
.ntb-btn-secondary { background: #6c757d; border-color: #6c757d; }
.ntb-btn-secondary:hover { background: #5c636a; }
.ntb-muted { color: #6c757d; }
.ntb-lock { display: inline-block; padding: 1px 8px; border-radius: 10px; background: #fff3cd; color: #664d03; font-size: .8rem; font-weight: 600; }
.ntb-zones { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 10px 0; }
a.ntb-zone-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px solid #dee2e6; border-radius: 8px; background: #fff; color: #212529; text-decoration: none; }
a.ntb-zone-card:hover { border-color: #0d6efd; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.ntb-zone-title { font-size: 1.15rem; font-weight: 700; }
.ntb-zone-desc { color: #6c757d; font-size: .9rem; }
.ntb-zone-head { margin-bottom: 30px; text-align: center; }
.ntb-zone-h { margin: 8px 0; }
/* 專區頁頁籤區下方留白，不直接接頁尾；後台視覺編排預覽（.ntbe-preview）不套用 */
.ntb-tabs:not(.ntbe-preview) { padding-bottom: 300px; }
.ntb-tabbar { display: none; flex-wrap: wrap; justify-content: center; gap: 4px; border-bottom: 2px solid #dee2e6; margin-bottom: 14px; }
.ntb-tabs.ntb-js .ntb-tabbar { display: flex; }
.ntb-tab-btn {
  padding: 7px 16px; border: 1px solid transparent; border-bottom: 0; border-radius: 6px 6px 0 0;
  background: transparent; color: #495057; cursor: pointer; font-size: .95rem;
}
.ntb-tab-btn:hover { background: #e9ecef; }
.ntb-tab-btn.is-active { background: #fff; color: var(--ntb-tab-accent, #0d6efd); font-weight: 700; border-color: #dee2e6; margin-bottom: -2px; border-bottom: 2px solid #fff; }
.ntb-tabs.ntb-js .ntb-tabpanel { display: none; }
.ntb-tabs.ntb-js .ntb-tabpanel.is-active { display: block; }
.ntb-tabs.ntb-js .ntb-panel-title { display: none; }
.ntb-panel-title { margin: 18px 0 10px; font-size: 1.15rem; }
.ntb-items { list-style: none; padding-left: 0; margin: 0; }
.ntb-item { padding: 8px 4px; border-bottom: 1px dashed #dee2e6; }
.ntb-item-link { font-weight: 600; }
.ntb-file-meta { margin-left: 8px; color: #6c757d; font-size: .85rem; }
.ntb-item-desc { color: #6c757d; font-size: .9rem; margin-top: 2px; }
@media (max-width: 768px) {
  .ntb-tab-btn { flex: 1 1 auto; }
  .ntb-tabs:not(.ntbe-preview) { padding-bottom: 150px; }
}
/* ===== 頁籤列顏色與樣式（class 加在 div.ntb-tabs 上；色線畫在按鈕自己的邊框，手機換行時仍貼著選中頁籤） ===== */
.ntb-tabcolor-blue { --ntb-tab-accent: #1d4ed8; --ntb-tab-tint: rgba(29, 78, 216, .08); }
.ntb-tabcolor-indigo { --ntb-tab-accent: #4338ca; --ntb-tab-tint: rgba(67, 56, 202, .08); }
.ntb-tabcolor-purple { --ntb-tab-accent: #7e22ce; --ntb-tab-tint: rgba(126, 34, 206, .08); }
.ntb-tabcolor-magenta { --ntb-tab-accent: #be185d; --ntb-tab-tint: rgba(190, 24, 93, .08); }
.ntb-tabcolor-red { --ntb-tab-accent: #b91c1c; --ntb-tab-tint: rgba(185, 28, 28, .08); }
.ntb-tabcolor-orange { --ntb-tab-accent: #c2410c; --ntb-tab-tint: rgba(194, 65, 12, .08); }
.ntb-tabcolor-green { --ntb-tab-accent: #15803d; --ntb-tab-tint: rgba(21, 128, 61, .08); }
.ntb-tabcolor-teal { --ntb-tab-accent: #0f766e; --ntb-tab-tint: rgba(15, 118, 110, .08); }
.ntb-tabcolor-slate { --ntb-tab-accent: #334155; --ntb-tab-tint: rgba(51, 65, 85, .08); }
.ntb-tabstyle-underline .ntb-tabbar, .ntb-tabstyle-topline .ntb-tabbar, .ntb-tabstyle-topline_fade .ntb-tabbar { border-bottom: 1px solid #dee2e6; }
.ntb-tabstyle-underline .ntb-tab-btn, .ntb-tabstyle-topline .ntb-tab-btn, .ntb-tabstyle-topline_fade .ntb-tab-btn {
  border: 0; border-radius: 0; background: #fff;
}
.ntb-tabstyle-underline .ntb-tab-btn:hover, .ntb-tabstyle-topline .ntb-tab-btn:hover, .ntb-tabstyle-topline_fade .ntb-tab-btn:hover { background: #e9ecef; }
.ntb-tabstyle-underline .ntb-tab-btn { border-bottom: 3px solid transparent; }
.ntb-tabstyle-topline .ntb-tab-btn, .ntb-tabstyle-topline_fade .ntb-tab-btn { border-top: 3px solid transparent; }
.ntb-tabstyle-underline .ntb-tab-btn.is-active { background: #fff; color: var(--ntb-tab-accent, #0d6efd); border-bottom-color: var(--ntb-tab-accent, #0d6efd); margin-bottom: 0; }
.ntb-tabstyle-topline .ntb-tab-btn.is-active { background: #fff; color: var(--ntb-tab-accent, #0d6efd); border-top-color: var(--ntb-tab-accent, #0d6efd); margin-bottom: 0; }
.ntb-tabstyle-topline_fade .ntb-tab-btn.is-active { background: linear-gradient(to bottom, var(--ntb-tab-tint, rgba(13, 110, 253, .08)), #fff); color: var(--ntb-tab-accent, #0d6efd); border-top-color: var(--ntb-tab-accent, #0d6efd); margin-bottom: 0; }
.ntb-tabstyle-topline_fade:not([class*="ntb-tabcolor-"]) .ntb-tab-btn.is-active { color: #0a58ca; }
.ntb-btn-danger { background: #dc3545; border-color: #dc3545; }
.ntb-btn-danger:hover { background: #bb2d3b; }

/* 僅供報讀器讀取（不依賴佈景的 Bootstrap） */
.ntb-sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ===== 項目顯示樣式：按鈕／卡片／圖片卡片／圖示方塊（flex 換行置中；text 仍用上面的 .ntb-items） ===== */
/* 欄數 --ntb-n：<576px 1 欄；576–991px 為 min(N,2) 欄；≥992px 為 N 欄。沒有 ntb-cols-N 時維持 3 欄（向下相容）
   每個項目寬度＝滿排時的寬度；沒排滿的一排（含項目數少於欄數）置中。一欄時群組最寬 36rem 並置中 */
.ntb-grid { --ntb-n: 1; display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin: 0 0 16px; }
.ntb-grid > * { flex: 0 0 calc((100% - (var(--ntb-n) - 1) * 16px) / var(--ntb-n)); max-width: 100%; min-width: 0; box-sizing: border-box; }
.ntb-grid.ntb-cols-1 { max-width: 36rem; margin-left: auto; margin-right: auto; }
@media (min-width: 576px) and (max-width: 991px) {
  .ntb-grid { --ntb-n: 2; }
  .ntb-grid.ntb-cols-1 { --ntb-n: 1; }
  .ntb-grid.ntb-cols-2, .ntb-grid.ntb-cols-3, .ntb-grid.ntb-cols-4, .ntb-grid.ntb-cols-5, .ntb-grid.ntb-cols-6 { --ntb-n: 2; }
}
@media (min-width: 992px) {
  .ntb-grid { --ntb-n: 3; }
  .ntb-grid.ntb-cols-1 { --ntb-n: 1; }
  .ntb-grid.ntb-cols-2 { --ntb-n: 2; }
  .ntb-grid.ntb-cols-3 { --ntb-n: 3; }
  .ntb-grid.ntb-cols-4 { --ntb-n: 4; }
  .ntb-grid.ntb-cols-5 { --ntb-n: 5; }
  .ntb-grid.ntb-cols-6 { --ntb-n: 6; }
}
/* 圖示方塊：每個 140px，換行，沒排滿的一排置中 */
.ntb-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin: 0 0 16px; }
.ntb-tiles > * { flex: 0 0 140px; max-width: 100%; box-sizing: border-box; }
.ntb-bt { display: flex; align-items: center; justify-content: center; min-height: 48px; box-sizing: border-box; padding: 10px 16px; border: 1px solid transparent; border-radius: 8px; text-align: center; font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
a.ntb-bt:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, .18); border-color: currentColor; text-decoration: none; }
a.ntb-bt:focus-visible, a.ntb-tile:focus-visible, a.ntb-card-link:focus-visible { outline: 3px solid #0d6efd; outline-offset: 2px; }
a.ntb-card-link, a.ntb-card-link:hover, a.ntb-card-link:focus { text-decoration: none; }
/* 卡片／圖片卡片（規格 tab-item-style「Card layout」；數值照舊系統截圖卡片）：無色票白底、有色票沿用色票底色；文字欄撐滿高度讓愛心貼齊右下角 */
.ntb-card { position: relative; display: flex; align-items: stretch; gap: .85rem; box-sizing: border-box; padding: 12px; border: 1px solid #dee2e6; border-radius: 8px; color: #212529; }
.ntb-card:not([class*="ntb-c-"]) { background: #fff; }
.ntb-card:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.ntb-card-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: .2rem; overflow-wrap: anywhere; }
/* 標題最多兩行、說明一行：只在視覺上截斷，完整文字仍在 HTML；不支援 line-clamp 的瀏覽器會完整顯示 */
.ntb-card-title { font-size: .95rem; font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ntb-card-link::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 8px; }
.ntb-card-rec { display: flex; align-items: center; gap: .25rem; font-size: .78rem; font-weight: 600; line-height: 1.35; }
.ntb-rec-icon { flex: 0 0 auto; }
.ntb-card:not([class*="ntb-c-"]) .ntb-card-rec { color: #4f46e5; }
[class*="ntb-c-"] .ntb-card-rec { color: inherit; }
.ntb-card .ntb-file-meta { display: block; margin: 4px 0 0; }
.ntb-card .ntb-item-desc { margin-top: 0; font-size: .82rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.ntb-card:not([class*="ntb-c-"]) .ntb-item-desc { color: #64748b; }
/* 縮圖 4:3 靠上，圖片填滿裁切；滑過只放大圖片（類型圖示是 svg 不受影響），減少動態效果時不放大 */
.ntb-card-image_card .ntb-thumb { flex: 0 0 100px; align-self: flex-start; width: 100px; height: 75px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 6px; overflow: hidden; color: #495057; }
.ntb-card-image_card .ntb-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.ntb-card-image_card:hover .ntb-thumb img { transform: scale(1.05); }
@media (prefers-reduced-motion: reduce) {
  .ntb-card-image_card .ntb-thumb img, .ntb-card-image_card:hover .ntb-thumb img { transition: none; transform: none; }
}
.ntb-card-image_card .ntb-icon { width: 40px; height: 40px; }
.ntb-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; box-sizing: border-box; padding: 12px 8px; border: 1px solid transparent; border-radius: 8px; text-align: center; font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
a.ntb-tile:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, .18); border-color: currentColor; text-decoration: none; }
.ntb-tile .ntb-thumb { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; }
.ntb-tile .ntb-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; }
.ntb-tile .ntb-icon { width: 48px; height: 48px; }
/* 八色色票：淡底深字，每組對比 >= 4.5:1（測試會計算） */
.ntb-c-blue { color: #1e3a8a; background-color: #dbeafe; }
.ntb-c-purple { color: #4c1d95; background-color: #ede4fb; }
.ntb-c-pink { color: #831843; background-color: #fce7f3; }
.ntb-c-red { color: #7f1d1d; background-color: #fee2e2; }
.ntb-c-orange { color: #7c2d12; background-color: #ffedd5; }
.ntb-c-green { color: #14532d; background-color: #dcfce7; }
.ntb-c-teal { color: #134e4a; background-color: #ccfbf1; }
.ntb-c-gray { color: #212529; background-color: #e9ecef; }
[class*="ntb-c-"] .ntb-item-link, [class*="ntb-c-"] .ntb-item-desc, [class*="ntb-c-"] .ntb-file-meta, [class*="ntb-c-"] .ntb-thumb { color: inherit; }

/* ===== 通關密碼表單（專區與頁籤共用）：整個置中，輸入框寬度適中；窄螢幕 100% ===== */
.ntb-pass-form, .ntb-tab-pass-form { max-width: 24rem; margin: 16px auto; text-align: center; }
.ntb-pass-form input.form-control, .ntb-tab-pass-form input.form-control { width: 100%; max-width: 16rem; margin-left: auto; margin-right: auto; text-align: center; }
.ntb-pass-form .ntb-btn { margin-left: auto; margin-right: auto; }

/* HTML 頁籤內容（內容已在存入時過濾，這裡只管基本排版） */
.ntb-html { line-height: 1.7; overflow-wrap: anywhere; }
.ntb-html img { max-width: 100%; height: auto; }
.ntb-html table { border-collapse: collapse; max-width: 100%; margin: 0 0 1rem; }
.ntb-html td, .ntb-html th { border: 1px solid #dee2e6; padding: 6px 10px; }
.ntb-html th { background: #f8f9fa; }

/* 卡片愛心（card／image_card）：未按為外框、已按為實心；放在卡片右下角，按鈕在連結之外，並蓋過整卡連結的覆蓋層 */
.ntb-card-foot { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.ntb-like { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 4px; margin: 0; padding: 2px 10px; font: inherit; font-size: .9rem; line-height: 1.5; color: #c2255c; background: #fff; border: 1px solid #e599b5; border-radius: 999px; cursor: pointer; }
.ntb-like .ntb-like-icon { flex: 0 0 auto; fill: none; }
.ntb-like:hover { background: #fff0f6; border-color: #c2255c; }
.ntb-like:focus-visible { outline: 3px solid #0d6efd; outline-offset: 2px; }
.ntb-like[aria-pressed="true"] { background: #fff0f6; border-color: #c2255c; }
.ntb-like[aria-pressed="true"] .ntb-like-icon { fill: currentColor; }
.ntb-like.is-busy { opacity: .6; cursor: progress; }
.ntb-like:disabled, .ntb-like:disabled:hover { cursor: default; opacity: .75; background: #fff; border-color: #e599b5; }
.ntb-like:disabled[aria-pressed="true"] { background: #fff0f6; border-color: #c2255c; }
.ntb-like-notice { position: relative; z-index: 2; font-size: .85rem; color: #b02a37; }

/* ===== 獨立專區頁（page.php，無佈景）：補上沒有佈景 Bootstrap 時樣板用到的基本樣式，只作用在 .ntb-standalone 底下 ===== */
body.ntb-standalone {
  margin: 0; padding: 16px 0 32px; background: #fff; color: #212529;
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem; line-height: 1.5;
}
.ntb-standalone main { max-width: 1140px; margin: 0 auto; padding: 0 16px; box-sizing: border-box; }
.ntb-standalone *, .ntb-standalone *::before, .ntb-standalone *::after { box-sizing: border-box; }
.ntb-standalone .alert { position: relative; padding: 12px 16px; margin: 0 0 16px; border: 1px solid transparent; border-radius: 6px; }
.ntb-standalone .alert-danger { color: #58151c; background: #f8d7da; border-color: #f1aeb5; }
.ntb-standalone .alert-info { color: #055160; background: #cff4fc; border-color: #9eeaf9; }
.ntb-standalone .form-control {
  display: block; width: 100%; max-width: 24rem; padding: 6px 12px; font: inherit; color: #212529;
  background: #fff; border: 1px solid #ced4da; border-radius: 6px;
}
.ntb-standalone .form-control:focus { border-color: #86b7fe; outline: 0; box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25); }
