.header {
    background-color: #fff;
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 4rem;
    width: 100%;
    min-width: 375px;
    box-sizing: border-box;
    font-weight: 600;
    font-size: 0.875rem;
    border-bottom: 1px solid #ccc;
}

.acc-key {
    position: fixed;
    top: 0;
    left: 0;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.5rem;
    text-decoration: none;
    color: #808F96;
    height: 72px;
}

.header-logo img {
    height: 100%;
}

.divider {
    width: 1px;
    height: 2rem;
    background: #ccc;
}

.header-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    flex: 1 0 0;
}

.header-nav {
    display: flex;
    flex-direction: column;
    align-items: flex-end;

}

.nav-top {
    display: flex;
    gap: 1rem;
}

.nav-top button {
    width: 32px;
    height: 32px;
    color: #3E6CA5;
    font-weight: 600;
    font-size: 0.7rem;
    display: flex;
    position: relative;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    border-radius: 2rem;
    background-color: #DEE1E5;
}

.nav-top button::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 4px;
    background-image: url("../images/Tooltip.png");
    background: url(../images/Tooltip.png) no-repeat center / contain;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.nav-top button::before{
    content: '網站導覽';
    position: absolute;
    white-space: nowrap;
    height: 28px;
    border-radius: 4px;
    bottom: -35px;
    background: #2B5C94;
    color: white;
    padding: 4px 8px;
    text-align: center;
    line-height: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.nav-top button:hover::after,
.nav-top button:hover::before {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

.nav-top button:nth-child(2)::before {
    content: '切換英文';
}


.nav-top button:nth-child(3)::before{
    content: '搜尋';
}

.nav-top button img {
    width: 11px;
    height: 12px;
}

/* ===== 主選單 ===== */
.nav-menu {
    display: flex;
    gap: 10px;
}

.nav-menu .button {
    display: flex;
    align-items: center;
    padding: 0 16px;
    height: 40px;
    text-decoration: none;
    color: #001E2D;
}

.nav-item {
    position: relative;
    border-radius: 2px;
}

/* Mega Menu */
.mega-menu {
    position: fixed;
    top: 120px;
    left: 50%;
    transform: translate(-50%, 0);
    width: calc(100vw - 12rem);
    max-height: 255px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.burger-btn {
    width: 48px;
    height: 48px;
    color: #3E6CA5;
    font-weight: 600;
    font-size: 0.7rem;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    border-radius: 2rem;
    background-color: #DEE1E5;
    display: none;
}

.burger-btn img {
    width: 20px;
    height: 20px;
}

/* hover 顯示 */
.nav-item:hover::after {
    content: "";
    position: absolute;
    left: -50%;
    top: 100%;
    width: 200px;
    height: 30px;
}

.nav-item:hover .mega-menu,
.nav-item:focus-within .mega-menu {
    opacity: 1;
    visibility: visible;
}


/* ===== menu 左側 ===== */
.mega-menu .menu-left {
    display: flex;
    flex-wrap: wrap;
    width: 66%;
    overflow-y: auto;
    padding: 2rem;
    justify-content: space-between;
    box-sizing: border-box;
    gap: 8px;
}

.mega-menu .menu-left .menu-tabs {
    position: relative;
    width: calc(50% - 1rem);
    padding: 12px 16px;
    cursor: pointer;
    transition: 0.2s;
    height: max-content;
}

.menu-left .menu-tabs::before {
    content: '';
    position: absolute;
    background: url("../images/mega-tab.png") 0 0 / contain no-repeat;
    width: 16px;
    height: 16px;
    top: 14px;
    right: 8px;
}

.menu-left .menu-tabs.active::before {
    content: '';
    position: absolute;
    background: url("../images/mega-tab-active.png") 0 0 / contain no-repeat;
    width: 16px;
    height: 16px;
    top: 14px;
    right: 8px;
}

.menu-left .menu-tabs:hover,
.menu-left .menu-tabs:focus,
.menu-left .active {
    background: #e5eef5 !important;
    color: #2B5C94;
}

/* ===== 右側 ===== */
.menu-right {
    flex: 1;
    padding: 2rem;
    background: #eef3f7;
    overflow-y: auto;
}

/* ===== 內容切換 ===== */
.content {
    display: none;
    padding: 0 !important;
}

header .content-title {
    font-weight: 600;
    font-size: 1.25rem;
    color: #2B5C94;
    padding: 8px;
}

.content.active {
    display: block;
}

.right-content {
    padding: 0;
    margin: 0;
    list-style: none;
}

.right-content li a {
    text-decoration: none;
    color: #5E727D;
}

/* 下載 */
.header-link {
    width: 139px;
    height: 59px;   
    border-radius: 2rem;
    text-decoration: none !important;
    color: white;
    background-color: #308445;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.header-link img {
    width: 20px;
    height: 20px;
}

/* rwd-menu 開始 */
.side-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    margin-top: 87px;
    background: #fff;
    box-shadow: -4px 0 10px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    /* 藏在右邊 */
    transition: transform 0.3s ease;
    z-index: 999;
    display: none;
}

/* side-menu 開啟狀態 */
.side-menu.active {
    transform: translateX(0);
}

.side-container {
    overflow-y: auto;
    max-height: 80vh;
}

.side-menu .menu-left {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    overflow-y: auto;
    padding: 2rem 1.5rem;
    justify-content: space-between;
    box-sizing: border-box;
    gap: 8px;
}

.side-menu .menu-left .menu-tabs {
    position: relative;
    width: 100%;
    padding: 12px 16px;
    cursor: pointer;
    transition: 0.2s;
    border: none;
    background: white;
}

.side-menu .menu-right {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: #e5eef5;
    padding: 2rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

/* 右側區塊開啟狀態 */
.side-menu .menu-right.active {
    transform: translateX(0);
}

/* 返回按鈕 */
.side-menu .menu-header {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.side-menu .menu-header .back-btn {
    border: none;
    background: none;
    display: flex;
    padding: 0;
    gap: 0.5rem;
    align-items: center;
    color: #5E727D;
}

.side-menu .menu-header .back-btn img {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    transform: rotate(180deg);
}

.side-menu .menu-header .right-title {
    font-weight: 600;
    font-size: 1.25rem;
    color: #2B5C94;
}

.side-menu .right-content {
    padding: 0;
    list-style: none;
    margin: 0;
}

.right-content li {
    padding: 8px;
}
/* rwd-menu 結束 */