/**
 * 图片预览增强 - 原生实现样式
 */

/* 全局禁用点击高亮 */
.imgp-overlay,
.imgp-overlay *,
.imgp-overlay *::before,
.imgp-overlay *::after {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
    -webkit-touch-callout: none !important;
    tap-highlight-color: rgba(0, 0, 0, 0) !important;
}

/* 工具栏 */
.imgp-toolbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    z-index: 10;
    background: linear-gradient(to bottom, rgba(0, 0, 0, .7) 0%, transparent 100%);
}

.imgp-toolbar-left,
.imgp-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 计数器 - 添加背景 */
.imgp-counter {
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    user-select: none;
    background: rgba(0, 0, 0, .5);
    padding: 6px 12px;
    border-radius: 20px;
}

.imgp-counter b {
    /*color: #ff6b35;*/
    font-weight: bold;
    font-size: 18px;
}

/* 按钮 */
.imgp-overlay .imgp-btn,
.imgp-overlay button.imgp-btn {
    all: unset;
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    border: none !important;
    border-radius: 50%;
    background: rgba(0, 0, 0, .38) !important;
    color: #fff !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: background .2s, transform .2s;
    flex-shrink: 0;
    padding: 0;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    outline: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
    box-sizing: border-box;
}

.imgp-overlay .imgp-btn:hover {
    background: rgba(255, 255, 255, .25) !important;
    transform: scale(1.1);
}

.imgp-overlay .imgp-btn:active,
.imgp-overlay .imgp-btn:focus,
.imgp-overlay .imgp-btn:focus-visible,
.imgp-overlay .imgp-btn:visited,
.imgp-overlay button.imgp-btn:active,
.imgp-overlay button.imgp-btn:focus {
    background: rgba(0, 0, 0, .38) !important;
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
}

/* 左右切换按钮 */
.imgp-nav {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 5;
}

.imgp-prev,
.imgp-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, .38);
    color: #fff;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .3s, background .2s, transform .2s;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    outline: none;
}

.imgp-prev {
    left: 15px;
}

.imgp-next {
    right: 15px;
}

.imgp-overlay:hover .imgp-prev,
.imgp-overlay:hover .imgp-next {
    opacity: 1;
}

.imgp-prev:hover,
.imgp-next:hover {
    background: rgba(255, 255, 255, .3);
    transform: translateY(-50%) scale(1.1);
}

.imgp-prev:active,
.imgp-next:active {
    background: rgba(255, 255, 255, .15);
}

.imgp-prev:focus,
.imgp-next:focus {
    outline: none;
}

/* 滑动轨道 */
.imgp-track {
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-x;
}

.imgp-track img {
    pointer-events: none;
    -webkit-user-drag: none;
}

/* 缩略图导航栏 */
.imgp-navbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.imgp-navbar::-webkit-scrollbar {
    height: 6px;
}

.imgp-navbar::-webkit-scrollbar-track {
    background: transparent;
}

.imgp-navbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.imgp-navbar img {
    transition: opacity 0.2s, border-color 0.2s, transform 0.2s;
}

.imgp-navbar img:hover {
    opacity: 1 !important;
    transform: scale(1.05);
}

/* 移动端 */
@media (max-width: 768px) {
    .imgp-toolbar {
        height: 50px;
        padding: 0 8px;
    }

    .imgp-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        font-size: 14px;
    }

    .imgp-toolbar-right {
        gap: 5px;
    }

    .imgp-counter {
        font-size: 12px;
        padding: 5px 10px;
    }

    .imgp-counter b {
        font-size: 14px;
    }

    /* 移动端完全隐藏左右切换按钮 */
    .imgp-prev,
    .imgp-next {
        display: none !important;
    }

    .imgp-navbar {
        height: 80px !important;
        padding: 8px !important;
    }

    .imgp-navbar img {
        height: 60px !important;
    }
}

@media (max-width: 480px) {
    .imgp-toolbar {
        padding: 0 6px;
    }

    .imgp-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        font-size: 13px;
    }

    .imgp-toolbar-right {
        gap: 4px;
    }

    .imgp-counter {
        font-size: 11px;
        padding: 4px 8px;
    }

    .imgp-counter b {
        font-size: 13px;
    }
}
