* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    margin: 0;
    font-family: 'Noto Sans TC', sans-serif;
    background: linear-gradient(to bottom right, #f0f9ff, #dff1ff);
    /* 美化背景 */
    color: #333;
}

/* === 設定 body 為垂直 Flex Container === */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    padding: 35px 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    z-index: 1000;
}

.logo {
    height: 60px;
    /* 根據 header 目前大小 */
    transform: scale(2.0);
    transform-origin: left center;
}

nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-links {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 40px;
    align-items: center;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    text-decoration: none;
    color: #007acc;
    font-weight: 500;
    font-size: 16px;
}

.nav-links a:hover {
    text-decoration: underline;
}

main {
    flex: 1;
    padding: 140px 40px 40px;
    /* 預留 header 的高度空間 */
}

footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #fafafa;
    padding: 20px 40px;
    text-align: center;
    font-size: 14px;
    color: #555;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
    z-index: 1000;
}


nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-links {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 40px;
    align-items: center;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    text-decoration: none;
    color: #007acc;
    font-weight: 500;
    font-size: 16px;
}

.nav-links a:hover {
    text-decoration: underline;
}


.nav-links li:hover .dropdown-content {
    display: block;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.image-link-block {
    text-align: center;
    background-color: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-link-block:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.image-link-block figcaption {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 12px;
    color: #333;
}

.image-link-block img {
    width: 100%;
    height: 300px;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.image-link-block img:hover {
    transform: scale(1.05);
}

/* Responsive */
@media (max-width: 576px) {
    header {
        flex-wrap: nowrap;
        /* 不要上下換行 */
        padding: 16px 20px;
    }

    .logo {
        transform: scale(1.3);
        height: auto;
        max-height: 40px;
        flex-shrink: 0;
        object-fit: contain;
        /* 若需要避免變形 */
    }

    nav {
        flex: 1;
        display: flex;
        justify-content: flex-end;
        overflow-x: auto;
        /* 超出時可左右滑 */
    }

    .nav-links {
        flex-wrap: nowrap;
        gap: 16px;
        justify-content: flex-end;
    }

    .nav-links a {
        font-size: 15px;
        white-space: nowrap;
        /* 防止文字自動換行 */
    }

    /* Main 主內容區塊縮小內距 */
    main {
        padding: 120px 20px 100px;
    }

    .gallery {
        grid-template-columns: 1fr;
        gap: 20px;
        margin: 20px auto;
    }

   .image-link-block {
        padding: 12px;
        border-radius: 8px;
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
        display: block;
        text-decoration: none;
        color: inherit;
    }
    .image-link-block img {
        max-height: 200px;
        height: auto;
        transition: none;
    }

    .image-link-block figcaption {
        font-size: 16px;
        margin-bottom: 8px;
    }
}