﻿header {
    background-image: linear-gradient(to right,#0378A6,#3E3E40 250px,#000000); /* 背景色漸層 */
    filter: opacity(90%);
    padding: 15px;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000; /* 讓header固定在最上層 */
}

a {
    text-decoration: none; /* 去除默認的下劃線 */
    color: #F2F2EB; /* 默認顏色 */
    position: relative;
}

.logo img {
    width: 160px;
    
}

    .logo img:hover {
        animation: jello-horizontal 1s forwards; /* 動畫名稱、時長、動作結束後保持最終狀態 */
    }

/* 定義 jello-horizontal 動畫 */
@keyframes jello-horizontal {
    0% {
        -webkit-transform: scale3d(1, 1, 1);
        transform: scale3d(1, 1, 1);
    }

    50% {
        -webkit-transform: scale3d(1.05, 0.95, 1);
        transform: scale3d(1.05, 0.95, 1);
    }

    100% {
        -webkit-transform: scale3d(1, 1, 1);
        transform: scale3d(1, 1, 1);
    }
}


.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    list-style: none;
    display: flex;
    justify-content: flex-end; /* 使選項靠左 */
    width: 80%; /* 這個寬度可以根據需要調整 */
}

.nav-links li {
   margin: 0 15px;
}

.nav-links li a {
    text-decoration: none;
    color: #F2F2EB;
}

.nav-item {
    position: relative;
}

    .nav-item > a {
        display: block;
        padding: 10px 15px;
        text-decoration: none;
    }

/* 隱藏 checkbox */
input[type="checkbox"] {
    display: none;
}

/* 主選單標籤設計 */
label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px;
    margin: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.5s ease;
    position: relative;
    color: #F2F2EB;
}

    /* 滑鼠懸停效果 */
    label:hover {
        background-color: #4a5b6f;
        border-radius: 3px;
    }

/* Checkbox 被選中時箭頭旋轉向上 */
input[type="checkbox"]:checked + label::after {
    transform: rotate(-180deg); /* 旋轉箭頭 */
}

.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #0D0D0D;
    filter: opacity(90%);
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
    min-width: 270px;
    z-index: 1;
}

    .submenu li {
        list-style-type: none;
        margin: 10px 0;
    }

        .submenu li a {
            padding: 5px 10px 5px 10px;
            text-decoration: none;
            color: #F2F2EB;
            font-size: 14px;
        }

    .submenu a:hover {
        background-color: #4a5b6f;
        transition: all 0.5s ease;
    }

.nav-item:hover .submenu {
    display: block;
}

.nav .language-select {
    margin-left: 20px;
}

    .nav .language-select select {
        background-color: #bf9999cc;
        color: #F2F2EB;
        border: none;
        font-size: 14px;
        padding: 5px 10px;
        border-radius: 5px;
    }

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    cursor: pointer;
    position: absolute;
    right: 120px; /* 靠右顯示 */
}

    .menu-toggle .bar {
        width: 100%;
        height: 4px;
        background-color: white;
        border-radius: 20px; /*漢堡選單圓角*/
        transition: all 0.3s ease;
    }

    /* X 圖示 */
    .menu-toggle.active .bar:nth-child(1) {
        transform: translateY(10px) rotate(45deg);
    }

    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-10px) rotate(-45deg);
    }

/* 主內容區域 */
.container {
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1 1 auto;
    overflow: hidden; /* Hide any overflow here */
}

/*網頁底端*/
.footer {
    background-color: #0D0D0D;
    color: #F2F2EB;
    text-align: center;
    padding: 5px;
    font-size: 0.9em;
}

.footer a {
    color: #F2F2EB;
}

/* 小螢幕樣式 */
@media (max-width: 820px) {
    .nav-links {
        display: none; /* 預設隱藏選單 */
        width: 100%;
        position: absolute;
        top: 60px;
        right: 0;
        background-color: #3E3E40;
        flex-direction: column;
        text-align: center;
        z-index: 1000;
    }

    .nav-links.active {
        display: flex; /* 顯示選單 */
    }

        .nav-links.active {
            display: block;
        }

    .nav-item > a {
        padding: 15px;
    }

    .submenu {
        display: none; /* Hide submenus by default */
        position: static;
        box-shadow: none;
        border-radius: 3px;
    }

    /* 加上 v 符號（使用 ::after） */
    label::after {
        content: "▼"; /* 初始向下箭頭 */
        font-size: 0.8em;
        transition: transform 0.8s ease;
    }

    /* Checkbox 被選中時顯示子選單 */
    input[type="checkbox"]:checked ~ .submenu {
        display: block;
    }

    .nav-item:hover .submenu {
        display: none;
    }

    .language-select {
        display: inline-block;
        margin-left: 15px;
    }

    .menu-toggle {
        display: flex;
    }

    .footer {
        font-size: 0.8em;
    }
}

/* 小螢幕調整 */
@media (max-width: 480px) {
    .footer {
        font-size: 0.6em;
    }
}
