/* 內頁區塊樣式 */
li {
    margin-bottom: 8px;
}
.center-text {
    text-align: center;
}

.right-text {
    text-align: right;
}

.main-container {
    display: flex;
    justify-content: center;
    padding: 1rem;
    position: relative;
    margin: 40px auto;
}

.main-content-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 1440px;
    padding-left: 20px;
    padding-right: 20px;
}

.red-text {
    color: var(--op-red) !important;
}

.blue-text {
    color: var(--title-blue) !important;
}

.content-box {
    margin-bottom: 24px;
}

.content-box-center {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 左側選單樣式 */
.pages-menu {
    background-color: #f9fafb;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}


.menu-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--sub-blue2);
    border-bottom: 2px solid var(--sub-blue2);
    padding-bottom: 0.5rem;
}

.menu-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    list-style-type: none;
    padding-left: 0px;
}

.menu-list li a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    color: #374151;
    transition-property: background-color, color;
    transition-duration: 200ms;
}

.menu-list li a:hover {
    background-color: #dbeafe;
    color: #2563eb;
}

/* 下拉選單基礎樣式 */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

.submenu {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    list-style-type: none;
    padding-left: 1rem;
    margin-top: 0.5rem;
}

.submenu li a {
    background-color: #f3f4f6;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
}

/* hover 展開 */
.dropdown:hover .submenu {
    display: flex;
}

/* 新增：active 狀態常駐展開 */
.dropdown.active .submenu {
    display: flex;
}

/* 當下拉選單展開時，改變父項目文字顏色 */
.dropdown.active .dropdown-toggle {

    color: #2563eb;
}

.submenu-item.active a {
    background-color: #dbeafe;
    color: #2563eb;
}

/* 右側內容區塊樣式 */

/* 麵包屑導航 */
.breadcrumb {
    font-size: var(--h6-size);
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.breadcrumb-link {
    color: var(--main-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

.tab-section {
    width: 100%;
}

.tabs-nav {
    display: flex;
    border-bottom: 2px solid #ddd;
    background-color: #fff;
    border-radius: 0.5rem 0.5rem 0 0;
    box-shadow: 0 -2px 1px -2px rgba(0, 0, 0, 0.1), 0 -2px 1px -2px rgba(0, 0, 0, 0.1);
}

.tabs-nav .tab-link {
    text-decoration: none;
    padding: 10px 20px;
    font-size: 18px;
    color: #555;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tabs-nav .tab-link:hover {
    color: var(--sub-blue);
    border-bottom: 3px solid var(--sub-blue);
}

.tabs-nav .tab-link.active {
    color: var(--sub-blue);
    border-bottom: 3px solid var(--sub-blue);
}

.title-share-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.social-share-group {
    display: flex;
    gap: 12px;
}

.bi-line::before {
    font-size: 30px;
    color: #00c300;
}

.bi-rss-fill::before {
    font-size: 30px;
    color: #ff6600;
}

.bi-printer-fill::before {
    font-size: 30px;
    color: #464646;
}

.content-link-wrapper {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-direction: column;
    color: var(--sub-blue2);
}

.content-link-box {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

.process-card {
    width: var(--card-width);
    height: var(--card-height);
    border-radius: var(--card-border-radius);
    background-color: white;
    border: 1px solid var(--sub-blue2);
    color: var(--sub-blue2);
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 8px 12px;
}

.process-card:not(.selected):hover {
    background-color: var(--sub-blue2);
    color: white;
}

.process-card.selected {
    background-color: var(--sub-blue2);
    color: white;
    border-color: var(--sub-blue2);
}

.link-card-text {
    font-size: var(--card-font-size);
    white-space: normal;
}

.card-icon {
    font-size: var(--card-font-size);
    margin-left: var(--icon-spacing);
    flex-shrink: 0;
}

/* 內頁內文 */
.content-area {
    background-color: #ffffff;
    border-radius: 0.5rem;
    padding: 1.5rem;
    flex: 1 1 0%;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.content-area-2 {
    background-color: #ffffff;
    background-image: url(../img/inside_bg.png);
    background-size: 93%;
    background-repeat: no-repeat;
    background-position: 100% 100%;
    border-radius: 0 0 0.5rem 0.5rem;
    padding: 4rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.content-title {
    font-weight: 500;
    color: #fff;
    background-color: #f55800;
    padding: 0.2rem 20px;
    display: inline-block;
    border-radius: 6px;
}

.content {
    color: #4b5563;
}

.content a {
    color: var(--sub-blue);
}

.content h5 {
    color: #1b1b1b;
}

.content-box p {
    margin: 8px 16px;
}

.organizational-chart {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
}

.content-pic {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
}

.nested-list-container p {
    margin-top: 0;
    margin-bottom: 5px;
}

/* 中文數字排序ul */
.chinese-number-list {
    list-style-type: cjk-ideographic;
    margin: 0;
    padding-left: 50px;
    counter-reset: custom-cjk-counter;
}

.chinese-number-list li {
    position: relative;
    margin-bottom: 6px;
    counter-increment: custom-cjk-counter;
}



/* 表格樣式 */
.table {
    color: #4b5563;
}

.download-table-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    margin-top: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
}

.table-header,
.table-row {
    display: grid;
    grid-template-columns: 10% 1fr 20%;
    align-items: center;
    padding: 1rem;
}

/* 偶數行背景變灰 */
.table-row:nth-child(even) {
    background-color: #fff;
}

/* 奇數行背景維持白色 */
.table-row:nth-child(odd) {
    background-color: #eff6ff;
}

/* 表格標題列樣式 */
.table-header {
    background-color: #eff6ff;
    color: #001a35;
    text-align: center;
}

/* 表格單元格樣式 */
.table-cell {
    padding: 0 0.5rem;
}

/* 序號和檔案下載欄位內容置中 */
.table-serial,
.table-download {
    text-align: center;
}

/* 標題欄位內容靠左對齊 */
.table-row .table-title {
    text-align: left;
    text-overflow: ellipsis;
}


/* 移除最後一行的分隔線 */
.table-row:last-child {
    border-bottom: none;
}

/* 下載按鈕樣式 */
.download-btn {
    display: block;
    width: 100%;
    max-width: 150px;
    margin: 0 auto;
    text-align: center;
    text-decoration: none;
    background-color: #293962;
    color: #fff;
    padding: 10px 0;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.download-btn:hover {
    background-color: #1a2745;
}

/* 標題banner */
.banner-box-title {
    background-color: var(--sub-blue2);
    width: 100%;
    text-align: center;
    padding: 6px 0;
    color: #ffffff;
    margin: 20px 0;
}

.banner-line-title {
    font-weight: 700;
    color: var(--sub-blue2);
    text-align: center;
    margin: 24px 0;
    border-bottom: 3px solid var(--sub-blue2);
    padding-bottom: 0.5rem;
}

/* 等分表格 */
.five-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    width: 100%;
    margin: 10px;
}

.four-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    width: 100%;
}

.three-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
}

.grid-text {
    background-color: var(--sub-blue4);
    color: #2c3e50;
    padding: 15px 10px;
    text-align: center;
    border: 1px solid #cceeff;
    border-radius: 5px;
    font-weight: bold;
    font-size: var(--p-size);
}

.blue-text-box {
background-color: #f1f1f1;
    color: #2c3e50;
    padding: 15px 10px;
    text-align: center;
    border: 1px solid #cacaca;
    border-radius: 5px;
    font-weight: bold;
    font-size: var(--p-size);
    display: inline-block;
}

/* 影片 */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 22.5%;
    height: 0;
    overflow: hidden;
    margin: 0 auto;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* 回上一頁按鈕 */
.action-btn {
    flex-grow: 1;
    flex-basis: 0;
    flex-shrink: 1;
    padding: 0.75rem 0.5rem;
    font-size: var(--p-size);
    font-weight: 600;
    text-align: center;
    border-radius: 0.5rem;
    transition: background-color 0.3s ease, color 0.3s ease;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
}

.back-link-box {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.back-link {
    background-color: #f3f4f6;
    color: #4b5563 !important;
    border: 1px solid #d1d5db;
    padding: 12px 36px;
    max-width: 200px;
}

.back-link:hover {
    background-color: #e0f2fe;
    color: var(--sub-blue2) !important;
}

/* 按鈕 */
.button-max-box {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px;
}

.button-box {
    display: flex;
    gap: 1rem;
    margin: 0 auto;
    width: 100%;
    max-width: 600px;
}

.content-button {
    background-color: var(--sub-blue2);
    color: var(--op-white) !important;
    border: none;
    padding: 12px 36px;
}

.content-button:hover {
    background-color: var(--sub-blue);
}


/* 內頁下拉選單 */
.project-dropdown {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%204%205%22%3E%3Cpath%20fill%3D%22%236b7280%22%20d%3D%22M2%200L0%202h4zM2%205L0%203h4z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 8px 10px;
    padding: 6px 24px 6px 12px;
}

.project-dropdown:focus {
    border-color: var(--sub-blue3);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
    outline: none;
}

.form-input.project-dropdown {
    font-size: var(--p-size);
}

.form-label,
.option {
    font-size: var(--p-size);
}

/* pdf內容 */
.pdf-container {
    width: 100%;
    min-height: 130vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

iframe,
object,
embed {
    width: 100%;
    border: none;
    min-height: 125vh;
}

/* 只有手機顯示 */
.only-phone {
    display: none;
}

/* 縮排 */
.indent {
    text-indent: 3rem;
}

/* 提示訊息區塊 */
.note-box {
    background-color: var(--sub-blue4);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 5px solid var(--sub-blue2);
}

.note-box p {
    margin: 5px 0;
    line-height: 1.5;
}

/* pdf按鈕 */
.d-flex {
    display: flex !important;
    margin: 12px 0;
}
.flex-fill {
    flex: 1 1 auto !important;
}

.btn {
    display: inline-block;
    font-weight: 400;
    color: #212529;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    text-decoration: none; /* 針對 <a> 標籤 */
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.btn-outline-secondary {
    color: #d1d5db;
    border-color: #d1d5db;
}

.btn-outline-secondary:hover {
    color: #fff;
    background-color: var(--sub-blue2);
    border-color: var(--sub-blue2);
}

/* 圖標 SVG 基礎樣式 */
.svg-inline--fa {
    display: inline-block;
    font-size: inherit;
    height: 1em;
    overflow: visible;
    vertical-align: -0.125em;
}

.fa-w-12 { width: 0.75rem; }
.fa-w-14 { width: 0.875rem; }

/* 顏色與間距輔助類別 (text-danger, mr-3, ml-3) */
.text-danger {
    color: #dc3545 !important;
}

/* 讓 Hover 時圖標顏色也能變色 (可選) */
.btn-outline-secondary:hover .text-danger {
    color: #fff !important;
}

.mr-3 {
    margin-right: 1rem !important;
}

.ml-3 {
    margin-left: 1rem !important;
}


/* RWD 樣式調整 */
@media (min-width: 1200px) {
    .tabs-nav {
        display: none;
    }

    .main-content-wrapper {
        flex-direction: row;
        gap: 2rem;
    }

    .pages-menu {
        width: 16%;
    }
}

@media (max-width: 1200px) {
    .tabs-nav {
        display: flex;
    }

    .main-container {
        margin: 80px auto;
    }

    .pages-menu {
        display: none;
    }

    .pdf-container {
        height: auto;
        min-height: 0;
    }

    .only-phone {
        display: block;
    }

    .only-pc {
        display: none !important;
    }

}

@media (max-width: 768px) {
    .content-area-2 {
    padding: 1rem;

}

    .download-table-container {
        border: none;
        border-radius: 0;
    }

    .table-header {
        display: none;
    }

    .table-row {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 1.5rem;
        border: 1px solid #e5e7eb;
        border-radius: 0.5rem;
        margin-bottom: 1rem;
    }

    .table-row:nth-child(even),
    .table-row:nth-child(odd) {
        background-color: #fff;
    }

    .table-cell {
        border: none !important;
        width: 100%;
        text-align: left;
        padding: 0;
        margin-bottom: 0.5rem;
    }

    .table-serial {
        display: none;
    }

    .table-title {
        font-size: 1.1rem;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .download-btn {
        width: 100%;
        max-width: none;
    }

    .title-share-bar {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .tabs-nav {
        flex-direction: column;
    }

    .content-link-wrapper {
        justify-content: flex-start;
        gap: 10px;
    }

    .five-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .five-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .four-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .three-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 400px) {
    .five-grid {
        grid-template-columns: repeat(1, 1fr);
    }

    .four-grid {
        grid-template-columns: repeat(1, 1fr);
    }

    .three-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}
