﻿   /* 主容器置中 */
    .content-wrapper

{
    width: 800px;
    max-width: 100%;
    margin: 50px auto;
    background: #fff;
    border: 1px solid #e5e5e5;
    padding: 20px;
    box-sizing: border-box;
    position: relative;
}

/* 標題文字 */
.content-wrapper .title {
    font-size: 20px;
    text-align: left;
    margin-bottom: 10px;
    padding: 0 10px;
    color: #333;
    font-weight: bold;
}

/* 圖片容器 */
.image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 400px;
    overflow: hidden;
    margin: 20px 0;
}

.sp-wrap img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    max-height: 600px;
    height: auto;
    cursor: zoom-in;
    object-fit: contain;
    transition: transform 0.3s ease;
}

    .sp-wrap img:hover {
        transform: scale(1.02);
    }

/* 自訂 lightbox 樣式 */
#custom-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 10000;
    overflow: hidden;
    cursor: default;
}

#lightbox-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#lightbox-image-wrapper {
    position: absolute;
    transform-origin: 0 0;
    will-change: transform;
}

#lightbox-image {
    display: block;
    cursor: pointer;
    user-select: none;
    -webkit-user-drag: none;
}

#custom-lightbox.draggable {
    cursor: grab;
}

    #custom-lightbox.draggable:active {
        cursor: grabbing;
    }

#close-lightbox {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.5);
    border: 2px solid white;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

    #close-lightbox:hover {
        background: rgba(255,255,255,0.2);
        transform: rotate(90deg);
    }

/* 控制按鈕容器 */
.lightbox-controls {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 10001;
    background: rgba(0,0,0,0.5);
    padding: 10px 20px;
    border-radius: 30px;
    backdrop-filter: blur(10px);
}

.control-btn {
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

    .control-btn:hover {
        background: rgba(255,255,255,0.2);
        border-color: rgba(255,255,255,0.5);
        transform: scale(1.1);
    }

    .control-btn:active {
        transform: scale(0.95);
    }

/* 縮放提示文字 */
.zoom-hint {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0,0,0,0.5);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    opacity: 0.8;
    transition: opacity 0.3s;
    z-index: 10001;
    backdrop-filter: blur(10px);
    pointer-events: none;
}

    .zoom-hint:hover {
        opacity: 1;
    }

/* 圖片說明文字 */
.image-caption {
    font-size: 18px;
    text-align: left;
    padding: 15px 10px;
    color: #333;
    border-top: 1px solid #e5e5e5;
    margin-top: 20px;
}

/* 浮動上一頁按鈕 */
.back-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    background: rgba(51, 51, 51, 0.9);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,.3);
    transition: all .2s ease;
    backdrop-filter: blur(5px);
}

    .back-btn:hover {
        background: rgba(0, 0, 0, 0.95);
        transform: translateY(-2px);
        box-shadow: 0 6px 15px rgba(0,0,0,.4);
    }

/* 手機版微調 */
@media (max-width: 820px) {
    .content-wrapper {
        width: 95%;
        margin: 20px auto;
        padding: 15px;
    }

        .content-wrapper .title {
            font-size: 18px;
            margin-bottom: 8px;
        }

    .image-container {
        min-height: 300px;
    }

    .sp-wrap img {
        max-height: 400px;
    }

    .image-caption {
        font-size: 16px;
        padding: 12px 10px;
    }

    .back-btn {
        width: 56px;
        height: 56px;
        padding: 0;
        font-size: 22px;
        bottom: 20px;
        right: 20px;
        border-radius: 50%;
    }

    .lightbox-controls {
        bottom: 20px;
        padding: 8px 15px;
    }

    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .zoom-hint {
        font-size: 12px;
        padding: 8px 15px;
        top: 15px;
    }
}
