/* 基本樣式 */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #1a1a1a;
    color: white;
    text-align: center;
}

/* 背景圖片 */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('background.jpg'); /* 請確保路徑正確 */
    background-size: cover;
    background-position: center;
    filter: blur(20px);
    z-index: -1;
}

/* 導航欄 */
.navbar {
    width: 100%;              /* 導航欄寬度占滿頁面 */
    background-color: #333;   /* 背景色，可自行調整 */
    position: fixed;          /* 固定在頁面頂部，可選 */
    top: 0;
    z-index: 1000;            /* 確保導航欄在頂層，可選 */
}

.menu {
    display: flex; /* 正常情況下水平排列 */
    justify-content: flex-end;
    list-style-type: none;
    margin: 0;
    padding: 0;
    margin-right: 100px;
}

.menu li {
    margin: 0 10px;
}

.menu a {
    color: white;
    text-decoration: none;
    padding: 14px 20px;
    display: block;
}

.menu-toggle {
    display: none; /* 預設隱藏縮放按鈕 */
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

/* 響應式設計：手機屏幕 */
@media (max-width: 768px) {
    .menu {
        display: none; /* 隱藏菜單 */
        flex-direction: column; /* 展開時垂直排列 */
        width: 100%;
        background-color: #333;
        position: absolute;
        top: 50px; /* 根據導航欄高度調整 */
        left: 0;
    }

    .menu li {
        margin: 0;
        text-align: center;
    }

    .menu-toggle {
        display: block; /* 顯示縮放按鈕 */
        position: absolute;
        top: 10px;
        right: 10px;
    }

    .menu.active {
        display: flex; /* 當有 active 類別時顯示菜單 */
    }
}

/* 主內容區域 */
.container {
    position: relative;
    z-index: 1;
    padding: 20px;
    margin-top: 50px; /* 留出導航欄空間 */
}

h1 {
    font-size: 4em;
    margin: 0;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
}

p {
    font-size: 1.5em;
    margin: 10px 0;
}

.progress {
    width: 300px;
    height: 20px;
    background-color: #333;
    border-radius: 10px;
    overflow: hidden;
    margin: 20px auto;
}

.progress-bar {
    width: 99%;
    height: 100%;
    background-color: #3498db;
    text-align: center;
    line-height: 20px;
    color: white;
}

.button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 20px;
}

/* 區塊樣式 */
.section {
    height: 100vh; /* 每個區塊佔滿一屏 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.section:nth-child(odd) {
    /* background-color: #e2e2e2; /* 奇數區塊不同背景色 */ */
}

/* 響應式設計 */
@media (max-width: 768px) {
    .section {
        height: auto; /* 小屏幕時高度自適應 */
        padding: 20px;
    }
}

/* 頁腳 */
footer {
    position: fixed;
    bottom: 10px;
    width: 100%;
    font-size: 0.8em;
    color: #bbb;
}

.album-container {
    position: relative;
    width: 90%;
    margin: 0 auto;
}

.album-slider {
    width: 100%;
    height: 580px; /* 可根據需要調整高度 */
    overflow: hidden;
    position: relative;
}

.album-slider img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none; /* 預設隱藏所有照片 */
}

.album-slider img.active {
    display: block; /* 只顯示當前選中的照片 */
}

.prev-btn, .next-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

.scrollbar-container {
    margin-top: 20px;
    text-align: center;
}

.scrollbar {
    width: 80%;
}

dialog {
    width: 90vw; /* 視窗寬度的 50% */
    height: 95vh; /* 視窗高度的 95% */
    border: white;
    background: transparent;
}

/* 大圖樣式 */
#largePhoto {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 保持照片比例，不裁剪 */
}

/* 可選：小照片的樣式 */
.album-slider img {
    cursor: pointer; /* 鼠標懸停時顯示手型 */
}

.dialog-content {
    position: relative; /* 讓子元素可以相對定位 */
    width: 100%;
    height: 100%;
}

.close-btn {
    position: absolute;
    top: 10px; /* 距離頂部 10px */
    right: 10px; /* 距離右側 10px */
    font-size: 24px; /* “X”的大小 */
    color: white; /* 白色 “X” */
    border: 2px solid white; /* 白色圓圈邊框 */
    border-radius: 50%; /* 圓形外觀 */
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent; /* 透明背景 */
    cursor: pointer; /* 鼠標懸停時顯示手型 */
    z-index: 10; /* 確保在照片上方 */
}

.scrollbar-tooltip {
    position: relative;
    background-color: white;
    border: 1px solid black;
    padding: 5px;
    border-radius: 3px;
    white-space: nowrap;
    z-index: 1000; /* 確保在最上層 */
    color: black; /* 黑色文字 */
    font-family: Arial, sans-serif;
    display: none; /* 預設隱藏，由程式控制顯示 */
}

.photo-grid {
    width: 90%;
    margin: 20px auto;
}

.photo-item {
    width: 18%; /* 5 列佈局，每列約 18% 寬度，留空間給間距 */
    margin-bottom: 10px;
}

.photo-item img {
    width: 100%;
    height: auto;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.2s;
}

.photo-item img:hover {
    transform: scale(1.05);
}

.loading {
    display: none;
    text-align: center;
    font-size: 1.2em;
    color: #3498db;
    margin: 20px 0;
}

@media (max-width: 768px) {
    .photo-item {
        width: 30%; /* 手機上改為 3 列 */
    }
}

@media (max-width: 480px) {
    .photo-item {
        width: 45%; /* 極小屏幕改為 2 列 */
    }
}