/* 相册外层分组容器 */
.img-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: none;
    z-index: 2001;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.img-popup.show {
    display: flex;
    opacity: 1;
}
/* 默认普通窗口：保留边距 */
#popupImg {
    max-width: calc(100% - 20px);
    max-height: calc(100% - 20px);
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.35s ease-in-out;
    /* 缩放拖拽基础 */
    transform: translate(0px,0px) scale(1);
    transition: opacity 0.35s ease-in-out;
    cursor: grab;
    user-select: none;
}
#popupImg:active{
    cursor:grabbing;
}
/* 缩放动画class，单独控制transform过渡，拖拽时移除 */
#popupImg.anim-scale{
    transition: opacity 0.35s ease-in-out, transform 0.35s ease;
}
/* H按钮进入JS全屏：图片去掉边距 */
.img-popup.js-fullscreen #popupImg {
    max-width: 100%;
    max-height: 100%;
}
#popupImg.fade-in {
    opacity: 1;
}
.pop-arrow { z-index: 2002;
    font-family:"DingXian";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 70px;
    height: 70px;
    color: #fff;
    font-size: 70px;
    text-align: center;
    line-height: 70px;
    cursor: pointer;
    user-select: none;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}
.pop-prev {
    left: 0;
}
.pop-next {
    right: 0;
}
.pop-arrow:hover {
    color: #abf4fb;
}
/* 左上角图片名称 */
.pop-name {
    position: absolute;
    top: 14px;
    left: 14px;
    color: #fff;
    font-size: 20px;
    z-index: 1002;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
    max-width: 55%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* 右上角：放大、缩小、全屏、关闭 */
.pop-top-right {
    position: absolute;
    top: 8px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1002;
}
.pop-zoom-in,.pop-zoom-out{
    font-family:"DingXian";
    width: 30px;
    height: 30px;
    color: #fff;
    font-size: 30px;
    text-align: center;
    line-height: 30px;
    cursor: pointer;
    user-select: none;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}
.pop-zoom-in:hover,.pop-zoom-out:hover{
    color: #abf4fb;
}
.pop-fullscreen {   /* 全屏 */
    font-family:"DingXian";
    width: 30px;
    height: 30px;
    color: #fff;
    font-size: 30px;
    text-align: center;
    line-height: 30px;
    cursor: pointer;
    user-select: none;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}
.pop-fullscreen:hover {
    color: #abf4fb;
}
.pop-close {  /* X关闭 */
    font-family:"DingXian";
    width: 30px;
    height: 30px;
    color: #fff;
    font-size: 30px;
    text-align: center;
    line-height: 30px;
    cursor: pointer;
    user-select: none;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}
.pop-close:hover {
    color: #abf4fb;
}
/* ========== 底部整体容器：不再有整行背景 ========== */
.pop-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1002;
    transform: translateY(0);
    /* 同时支持 transform（滑动） + opacity（淡出） */
    transition: transform 0.5s ease, opacity 1s ease;
}
/* 收起后只隐藏微缩图，保留控制行 */
.pop-bar.hide-bar {
    transform: translateY(calc(100% - 40px));
}
/* 控制行：无整体背景 */
.pop-bar-header {
    position: relative;  /* 给中间按钮做绝对定位的父容器 */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    width: 100%;height: 40px;
    box-sizing: border-box;    
}
.pop-bar-left {
    display: flex;
    align-items: center;
}
.pop-bar-center {
    
/* 整行居中 */
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}
.pop-bar-right {
    display: flex;
    gap: 12px;
    align-items: center;
}
/* 页码：无背景，纯文字 */
.pop-index {
    color: #fff;
    font-size: 16px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}
/* 中间收起/展开按钮：保留独立深色小背景 */
.pop-bar-toggle {
    font-family:"DingXian";
    width: 40px;
    height: 25px;padding:0 0 0 18px;margin-top:15px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 40px;
    text-align: center;
    line-height: 20px;
    cursor: pointer;
    border-radius: 10px 10px 0 0;
    user-select: none;
}
.pop-bar-toggle:hover {
    color: #abf4fb;
}
/* 读秒：无背景纯文字 */
.pop-countdown {
    color: #fff;
    font-size: 16px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
    min-width: 32px;
    text-align: center;
}
/* 播放暂停：无背景纯文字 */
.pop-play {
    font-family:"DingXian";
    color: #fff;
    font-size: 22px;
    text-align: center;
    line-height: 22px;
    cursor: pointer;
    user-select: none;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}
.pop-play:hover {
    color: #abf4fb;
}
/* 微缩图栏：背景深度与先前一致 */
.pop-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 14px 14px;
    background: rgba(0,0,0,0.55);
}
.pop-thumbs::-webkit-scrollbar {
    height: 6px;
}
.pop-thumbs::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.35);
    border-radius: 3px;
}
.pop-thumbs img {
    flex: 0 0 auto;
    height: 60px;
    width: auto;
    object-fit: contain;
    border: 2px solid #cccccc;
    cursor: pointer;
    border-radius: 0;
}
.pop-thumbs img.active {
    border-color: #ff0000;
}
/* CSS Loading 旋转动画 */
.PicLoading {
    width: 40px;
    height: 40px;
    position: fixed;
    z-index: 2002;
    top: 50%;
    left: 50%;
    margin: -20px 0 0 -20px;
    border: 4px solid rgba(255,255,255,0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s infinite linear;
    display: none;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
/* ========== 控件自动隐藏：鼠标闲置3秒后淡出 ========== */
.img-popup.idle-hide .pop-name,
.img-popup.idle-hide .pop-top-right,
.img-popup.idle-hide .pop-arrow,
.img-popup.idle-hide .pop-bar {
    opacity: 0;
    pointer-events: none;
}
.pop-name,
.pop-top-right,
.pop-arrow
 {
    transition: opacity 1s ease;
}
/* ==============手机竖屏适配================= */
@media screen and (max-width: 900px) and (orientation: portrait) {
    #popupImg {max-width: 100%;max-height: 100%;}
    .pop-name {top: calc( 8px * var(--ShuPinW) / 360 );left: calc( 10px * var(--ShuPinW) / 360 );;font-size: calc( 15px * var(--ShuPinW) / 360 ); }/*左上角图片名称 */  
    .pop-fullscreen { width: calc( 23px * var(--ShuPinW) / 360 );height: calc( 23px * var(--ShuPinW) / 360 );font-size: calc( 23px * var(--ShuPinW) / 360 );line-height: calc( 23px * var(--ShuPinW) / 360 ); }/*全屏按钮 */
    .pop-close { width:calc( 23px * var(--ShuPinW) / 360 );height:calc( 23px * var(--ShuPinW) / 360 );font-size:calc( 23px * var(--ShuPinW) / 360 );line-height:calc( 23px * var(--ShuPinW) / 360 ); }  /*X关闭按钮 */
    .pop-zoom-in,.pop-zoom-out{
        width: calc( 23px * var(--ShuPinW) / 360 );
        height: calc( 23px * var(--ShuPinW) / 360 );
        font-size: calc( 23px * var(--ShuPinW) / 360 );
        line-height: calc( 23px * var(--ShuPinW) / 360 );
    }
    
    .pop-bar-header {height:calc( 30px * var(--ShuPinW) / 360 ); }                    /*下部控制行 */
    .pop-bar.hide-bar {transform: translateY(calc(100% - calc( 30px * var(--ShuPinW) / 360 )));}/*收起后只隐藏微缩图，保留控制行 */
    .pop-index { font-size:calc( 15px * var(--ShuPinW) / 360 );}                      /*页码 */
    .pop-bar-toggle {width:calc( 30px * var(--ShuPinW) / 360 );height:calc( 30px * var(--ShuPinW) / 360 );padding:0 0 0 calc( 8px * var(--ShuPinW) / 360 );font-size:calc( 25px * var(--ShuPinW) / 360 );line-height:calc( 25px * var(--ShuPinW) / 360 );}               /*中间收起/展开按钮 */
    .pop-countdown {font-size:calc( 15px * var(--ShuPinW) / 360 ); }                   /*读秒 */
    .pop-play { font-size:calc( 25px * var(--ShuPinW) / 360 ); }                      /*播放暂停 */
    .pop-thumbs img {height:calc( 50px * var(--ShuPinW) / 360 );width: auto;}             /*微缩图 */
    .PicLoading { width:calc( 30px * var(--ShuPinW) / 360 );height:calc( 30px * var(--ShuPinW) / 360 );margin: calc( -15px * var(--ShuPinW) / 360 ); 0 0 calc( -15px * var(--ShuPinW) / 360 );border-width:calc( 1.5px * var(--ShuPinW) / 360 );}                          /*CSS Loading 旋转动画 */
}
/* ========== 手机横屏适配 ========== */
@media screen and (max-width: 900px) and (orientation: landscape) {
    .img-popup {background: #000000;}
    #popupImg {max-width: 100%;max-height: 100%;}
    .pop-name {top: 6px;left: 20px;font-size: 16px;}                    /* 左上角图片名称 */  
    .pop-fullscreen {width: 25px;height: 25px;font-size: 25px;line-height: 25px;}/* 全屏按钮 */
    .pop-close {width: 25px;height: 25px;font-size: 25px;line-height: 25px;}    /* X关闭按钮 */
    .pop-zoom-in,.pop-zoom-out{
        width:25px;height:25px;font-size:25px;line-height:25px;
    }
    
    .pop-index { font-size: 14px;}                /* 页码 */
    .pop-bar-toggle {width: 40px;height: 25px;padding:0 0 0 16px;font-size: 30px;line-height: 20px;} /* 中间收起/展开按钮 */
    .pop-countdown {font-size: 14px; }        /* 读秒 */
    .pop-play { font-size: 20px; }          /* 播放暂停 */
    .pop-thumbs img {height: 40px;width: auto;} /* 微缩图 */
    .PicLoading { width: 28px;height: 28px;margin: -14px 0 0 -14px;border-width: 3px;}  /* CSS Loading 旋转动画 */
}