@charset "utf-8";
/* ------------------------------------------------------------------
 * bs5-compat.css
 * Bootstrap 升級到 5.3.8 後，把外觀差異壓回升級前。
 * 必須緊接在 css/bootstrap-5.3.8.min.css 下一行載入。
 * 註解不寫舊版號，套件掃描工具會依檔案內文的版本字串誤判。
 * 影響 12 頁，MobileIndex.aspx 不在其中。
 * ------------------------------------------------------------------ */

/* §1 連結顏色壓回 #337ab7，並補回被移除的 a:hover / a:focus。
 * 後兩條是壓過新版新增的 a:not([href]):not([class])（特異度較高） */
a { color: #337ab7; }
a:hover, a:focus { color: #23527c; text-decoration: underline; }
a:not([href]):not([class]) { color: #337ab7; text-decoration: none; }
a:not([href]):not([class]):hover { color: #23527c; text-decoration: underline; }

/* §2 內文色 #333、標題 line-height 1.1 */
body { color: #333; }
h1, h2, h3, h4, h5, h6 { line-height: 1.1; }

/* §3 補回被移除的 label 粗體與 checkbox/radio 邊距。
 * 影響 13 個 CheckBox + 5 個 RadioButton，及 SignCenter 問卷由 JS 產生的 label */
label { font-weight: 700; max-width: 100%; margin-bottom: 5px; }
input[type="checkbox"], input[type="radio"] {
    box-sizing: border-box; margin: 4px 0 0; line-height: normal; padding: 0;
}
input[type="checkbox"][disabled], input[type="radio"][disabled] { cursor: not-allowed; }

/* §4 補回表單元件的 color / font 繼承，否則 select 下拉箭頭會由 #333 變純黑。
 * jqui-compat §5 的對話框按鈕文字 #222222 也是靠這條 */
button, input, optgroup, select, textarea {
    color: inherit;
    font: inherit;
}

/* §5 th 靠左（新版改成繼承父層），影響 30 個 th */
th { text-align: left; }

/* §6 .btn 的字級 / 行高 / 圓角 / 底色壓回，影響 SignCenter.aspx 三個「離開」鈕 */
.btn {
    --bs-btn-font-size: 14px;
    --bs-btn-line-height: 1.42857143;
    --bs-btn-border-radius: 4px;
    --bs-btn-color: inherit;
    background-color: buttonface;
    background-image: none;
    transition: none;
}

/* §7 .hide 已被移除。SignPassbook 有 6 處，
 * 少了 !important 會被 JS 的 .show() 蓋掉，屬行為變化故補回 */
.hide { display: none !important; }

/* §8 .clearfix 補回 ::before（擋子層 margin 穿透），全站 18 處 */
.clearfix:before, .clearfix:after { content: " "; display: table; }
.clearfix:after { clear: both; }

/* §9 壓回 scroll-behavior:auto（新版預設 smooth，屬行為變化） */
:root { scroll-behavior: auto; }

/* §10 補回被整段移除的 @media print，影響 12 頁。
 * 列印輸出用截圖比對測不到，需人工按 Ctrl+P 實測 */
@media print {
    *, :before, :after { color:#000!important; text-shadow:none!important; background:transparent!important; box-shadow:none!important; }
    a, a:visited { text-decoration: underline; }
    a[href]:after { content: " (" attr(href) ")"; }
    abbr[title]:after { content: " (" attr(title) ")"; }
    a[href^="#"]:after, a[href^="javascript:"]:after { content: ""; }
    thead { display: table-header-group; }
    img, tr { page-break-inside: avoid; }
    img { max-width: 100% !important; }
    h2, h3, p { orphans: 3; widows: 3; }
    h2, h3 { page-break-after: avoid; }
}
