/* Header and Navigation */
header {
    background-color: rgba(26, 26, 46, 0.8); /* 半透明深色背景 */
    backdrop-filter: blur(5px); /* 模糊效果 */
    color: #fff;
    padding: 1rem 0;
    width: 100%; /* Header 寬度 100% */
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

nav ul li {
    margin-left: 2rem;
}

nav ul li a {
    text-decoration: none; /* 確保連結沒有下劃線 */
    color: #fff;
    font-weight: 500;
    position: relative;
    padding-bottom: 5px;
}

nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background-color: #8be9fd; /* 淺藍色下劃線 */
    left: 0;
    bottom: 0;
    transition: width 0.3s ease-in-out;
}

nav ul li a:hover::after {
    width: 100%;
}

/* --- Mobile Specific Styles for Navigation --- */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        padding: 0 1rem;
    }

    nav ul {
        margin-top: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    nav ul li {
        margin: 0.5rem 1rem;
    }

    .logo {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.3rem;
    }
}
