* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans TC', sans-serif;
}

body.no-scroll {
    overflow: hidden;
}

/* Bilingual Text Styling */
.bilingual {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: baseline;
}

.bilingual .zh {
    font-size: 100%;
}

.bilingual .en {
    font-size: 80%;
}

/* Header and Navigation */
header {
    background: linear-gradient(90deg, rgba(255, 111, 97, 0.7), rgba(42, 157, 143, 0.7)); /* 漸變背景 */
    color: #ffffff;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    overflow: visible;
}

.hamburger {
    font-size: 1.8rem;
    cursor: pointer;
    display: block;
    color: #ffffff; /* 白色漢堡圖標 */
}

nav {
    display: none;
    background: rgba(42, 157, 143, 0.7); /* 導航背景 */
}

nav.active {
    display: block;
    position: fixed;
    top: 3.5rem;
    left: 0;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    height: calc(100vh - 3.5rem);
    overflow-y: auto;
    z-index: 1001; /* 修復遮擋問題，高於 header */
}

nav ul {
    list-style: none;
}

nav ul li {
    position: relative;
}

nav ul li a {
    color: #ffffff; /* 主菜單白色文字 */
    text-decoration: none;
    padding: 0.7rem;
    display: block;
    font-size: 1.1rem;
    transition: background-color 0.3s, color 0.3s, transform 0.1s;
}

nav ul li a:hover {
    background-color: rgba(244, 162, 97, 0.7); /* 橙色hover背景 */
    color: #fff5e6; /* 淺橙色文字 */
}

nav ul li a:active {
    transform: scale(0.95);
    background-color: rgba(231, 111, 81, 0.7); /* 深橙色active背景 */
}

.main-menu .bilingual .en {
    color: #ffffff;
}

nav ul ul {
    display: none;
    background: rgba(233, 245, 242, 0.7); /* 子菜單背景 */
    transition: all 0.3s ease;
}

nav ul li.active > ul {
    display: block;
    animation: slideDown 0.3s ease-in-out;
}

nav ul ul li a {
    color: #264653; /* 子菜單深藍色文字 */
    padding-left: 2rem;
    font-size: 0.9rem;
}

nav ul ul li a::before {
    content: '→ ';
    margin-right: 5px;
    color: #ff6f61; /* 橙色箭頭 */
}

@keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 300px; }
}

/* Responsive Design */
@media (min-width: 769px) {
    nav ul li a {
        font-size: 1.2rem;
    }
    nav ul ul li a {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    nav ul li a {
        font-size: 0.9rem;
    }
    nav ul ul li a {
        font-size: 0.8rem;
    }
}