:root {
    --nav-h: 60px;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h -20px));
}

[id] {
    scroll-padding-top: calc(var(--nav-h) - 20px);
}

body {
    font-family: 'Noto Sans TC', system-ui, sans-serif;
    padding-top: var(--nav-h)
}

section {
    padding: 0px;
}

main {
    margin-left: 150px;
    overflow-y: auto;
}

table {
    width: 100%;
}

th,
td {
    white-space: nowrap;
    /* 不換行 */
}

thead {
    vertical-align: middle !important;
}

.table thead th {
    border-color: rgba(74, 74, 78, .12) !important;
}

a,
p,
span,
label,
div,
table,
.btn,
.col-form-label,
th,
td,
li,
.form-control,
.form-select,
.form-text,
.fs-6 {
    color: #3c3c3c;
    font-size: 15px;
    text-decoration: none !important;
    margin-bottom: .25rem;
}

/* Windows：主要用 Noto Sans TC，備援微軟正黑體/新細明體 */
.tc-win {
    font-family: 'Noto Sans TC', 'Microsoft JhengHei', 'PMingLiU', 'Segoe UI', Arial, sans-serif;
}

/* macOS：主要用 Noto Serif TC，備援蘋方（繁）、宋體（繁） */
.tc-mac {
    font-family: 'Noto Serif TC', 'PingFang TC', 'Songti TC', 'Hiragino Sans', 'Helvetica Neue', serif;
}

/* iOS（iPhone/iPad）：主要 Noto Sans TC，備援蘋方（繁） */
.tc-ios {
    font-family: 'Noto Sans TC', 'PingFang TC', 'Helvetica Neue', Arial, sans-serif;
}

/* Android：主要 Noto Sans TC，備援系統的 Noto Sans CJK 與 Roboto */
.tc-android {
    font-family: 'Noto Sans TC', 'Noto Sans CJK TC', Roboto, 'Droid Sans Fallback', sans-serif;
}

/* Linux：主要 Noto Sans TC，備援常見開源中文字型 */
.tc-linux {
    font-family: 'Noto Sans TC', 'Noto Sans CJK TC', 'WenQuanYi Zen Hei', 'AR PL UMing TW', sans-serif;
}

strong {
    font-weight: 700 !important;
}

em {
    font-style: italic !important;
}

.login-card {
    margin-top: -120px !important;
}

.text-light {
    color: #5d5c5c !important;
}

/* 讓btn被點擊時不會變成有外框 */
.btn:focus,
.btn:active {
    outline: none !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
}

a:hover {
    color: #5d5c5c;
}

.alert {
    z-index: 2000;
    margin-bottom: 0.2rem;
}

.offcanvas {
    width: 250px;
}

.offcanvas .offcanvas-body {
    flex-grow: 0;
}

.border,
.border-top,
.border-bottom,
.border-start,
.border-end {
    box-shadow: 0 1px 4px 0 rgba(74, 74, 78, .12);
}

/* 限定 .sidebar */
.sidebar {
    scrollbar-width: thin;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar button {
    padding-top: 0px;
    padding-bottom: 0px;
}

/* === 通用連結間距（不分層級）=== */
.sidebar .sidebar-link,
.sidebar .sidebar-sub-link,
.sidebar .btn-toggle {
    padding: 0px;
    padding-top: 0.25rem;
    font-weight: 600;
    font-size: 14px;
}

/* === 第一層：可收合按鈕（有箭頭）=== */
.btn-toggle {
    background: transparent;
    border: 0;
    display: flex;
    align-items: center;
    width: 100%;
    padding-left: .5rem;
}

/* 箭頭：收合→右、展開→下 */
.btn-toggle::before {
    content: "";
    width: .9rem;
    height: .9rem;
    margin-right: .5rem;
    flex: 0 0 .9rem;
    background-repeat: no-repeat;
    background-size: .9rem .9rem;
    background-position: center;
    display: inline-block;
    transform: rotate(0deg);
    transition: transform .2s ease;
    background-image: url("data:image/svg+xml;utf8,\<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'>\<polyline points='9 18 15 12 9 6'/></svg>");
}

.btn-toggle[aria-expanded="true"]::before {
    transform: rotate(90deg);
}

/* 保障：強制覆蓋按鈕的 hover/focus/active 視覺（避免外部主題覆蓋） */
.bootstrap-table .btn:hover,
.bootstrap-table .btn:focus,
.bootstrap-table .btn:active,
.bootstrap-table .table tr.selected td .sku-toggle{
    color: var(--bs-btn-color) !important;
    background-color: var(--bs-btn-bg) !important;
    border-color: var(--bs-btn-border-color) !important;
    box-shadow: none !important;
}

.bootstrap-table .btn-secondary {
    background-color: inherit !important;
    border: 0px !important;
}

.bootstrap-table .btn-secondary:hover {
    background-color: inherit !important;
}

/* === 第一層：純連結（無箭頭）=== */
.sidebar .sidebar-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    border-radius: .375rem;
    padding-left: .5rem;
}

.sidebar .sidebar-link::before {
    content: "";
    width: .9rem;
    height: .9rem;
    margin-right: .5rem;
    flex: 0 0 .9rem;
    display: inline-block;
}

.sidebar li {
    padding: 0px;
}

/* === 第二層及更深層：再右移 === */
.sidebar .sidebar-sub-link {
    font-weight: 400;
    font-size: 14px;
    display: flex;
    align-items: center;
    text-decoration: none;
    border-radius: .375rem;
}

.ql-editor {
    padding-bottom: 50px;
    max-height: 600px;
}

.ql-code-block-container {
    padding-top: 1rem;
    padding: .5rem;
    background-color: #3c3c3c !important;
}

.ql-code-block {
    background-color: #3c3c3c;
    color: #fff;
}

.ql-indent-1 {
    margin-left: 3em;
}

.ql-indent-2 {
    margin-left: 6em;
}

.ql-indent-3 {
    margin-left: 9em;
}

.ql-indent-4 {
    margin-left: 12em;
}

.ql-indent-5 {
    margin-left: 15em;
}

.ql-indent-6 {
    margin-left: 18em;
}

.ql-indent-7 {
    margin-left: 21em;
}

.ql-indent-8 {
    margin-left: 24em;
}

.nav-link {
    color: #000 !important;
}

.nav-link.active {
    background-color: transparent !important;
    /* 移除預設藍色背景 */
    color: blue !important;
}

#pills-tab .nav-link.active {
    color: #000 !important;
    box-shadow: inset 0 -3px 0 0 #ff5722;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

#top-alert-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    pointer-events: none;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    padding-top: 0px;
    gap: 4px;
}

@media (max-width: 768px) {
    main {
        margin-left: 0px;
    }

    .offcanvas {
        max-width: 50%;
    }

    .ql-editor {
        padding-bottom: 20px;
        max-height: 300px;
    }

}