/* 超紧凑图片计数器 - 解决背景过长问题 */
.image-counter {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    z-index: 1046;
    backdrop-filter: blur(3px);
    min-width: auto;
    width: auto;
    display: inline-block;
    text-align: center;
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', monospace;
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    line-height: 1.2;
}

/* 紧凑模式 - 进一步缩小 */
.image-counter.compact {
    padding: 1px 4px;
    font-size: 11px;
    border-radius: 8px;
    min-width: auto;
    background: rgba(0, 0, 0, 0.85);
}

/* 当前页码高亮 */
.image-counter .current {
    color: #4fc3f7;
    font-weight: 700;
}

/* 分隔符样式 */
.image-counter .separator {
    margin: 0 1px;
    opacity: 0.8;
    font-weight: 400;
}

/* 总数样式 */
.image-counter .total {
    opacity: 0.9;
    font-weight: 500;
}

/* 移动端进一步优化 */
@media (max-width: 768px) {
    .image-counter {
        padding: 1px 4px;
        font-size: 11px;
        border-radius: 6px;
        top: 10px;
        right: 10px;
    }
    
    .image-counter.compact {
        padding: 1px 3px;
        font-size: 10px;
        border-radius: 5px;
    }
}

/* 超小屏幕 */
@media (max-width: 480px) {
    .image-counter {
        padding: 1px 3px;
        font-size: 10px;
        border-radius: 5px;
        top: 8px;
        right: 8px;
    }
    
    .image-counter.compact {
        padding: 0px 2px;
        font-size: 9px;
        border-radius: 4px;
        min-width: 20px;
    }
    
    .image-counter .separator {
        margin: 0;
    }
}

/* 极小屏幕 - 最紧凑模式 */
@media (max-width: 360px) {
    .image-counter {
        padding: 0px 2px;
        font-size: 9px;
        border-radius: 4px;
        top: 5px;
        right: 5px;
        min-width: 18px;
    }
    
    .image-counter.compact {
        padding: 0px 1px;
        font-size: 8px;
        border-radius: 3px;
        min-width: 16px;
    }
}

/* 圆形模式 - 适合单数字 */
.image-counter.circle {
    border-radius: 50%;
    width: 20px;
    height: 20px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

@media (max-width: 480px) {
    .image-counter.circle {
        width: 16px;
        height: 16px;
        font-size: 8px;
    }
}

/* 简约模式 - 白色背景 */
.image-counter.simple {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.image-counter.simple .current {
    color: #2196f3;
}

/* 悬停效果 */
.image-counter:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
}

.image-counter.simple:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 无障碍支持 */
.image-counter:focus {
    outline: 2px solid #4fc3f7;
    outline-offset: 2px;
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .image-counter {
        background: rgba(0, 0, 0, 0.95);
        border: 1px solid white;
    }
    
    .image-counter.simple {
        background: white;
        border: 2px solid black;
        color: black;
    }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    .image-counter {
        transition: none;
    }
}