/* 滚动容器样式 */
.image-container {
    overflow: hidden;
    padding: 0 15px;
}

.image-scroll {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.image-scroll::-webkit-scrollbar {
    height: 6px;
}

.image-scroll::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}

.image-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.image-scroll img {
    flex: 0 0 auto;
    transition: transform 0.2s;
    align-self: flex-start;
}

.image-scroll img:hover {
    transform: scale(1.05);
}

/* 图片查看器样式 */
.image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.viewer-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

#viewerImage {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

/* 新增：图片计数器样式 */
.image-counter {
    position: absolute;
    top: -50px; /* PC端位置靠上 */
    left: 0; /* 水平靠左 */
    color: white;
    font-size: 16px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 6px 16px;
    border-radius: 4px;
    z-index: 1001;
    pointer-events: none; /* 避免遮挡点击 */
}

.viewer-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 2rem;
    padding: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
    z-index: 1001;
}

.viewer-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.prev-btn {
    left: -50px;
}

.next-btn {
    right: -50px;
}

.viewer-close {
    position: absolute;
    top: -40px;
    right: -40px;
    color: white;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1001;
}

/* 文章图片基础样式 */
.font img {
    max-width: 100%;
    height: auto;
    cursor: pointer;
    margin: 15px 0;
    transition: transform 0.2s ease;
}

.font img:hover {
    transform: scale(1.02);
}

.article-image {
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .viewer-btn {
        font-size: 1.5rem;
        padding: 0.5rem;
    }
    
    .prev-btn {
        left: 10px;
    }
    
    .next-btn {
        right: 10px;
    }
    
    .viewer-close {
        top: -30px;
        right: 0;
    }
    
    /* 移动端计数器适配 */
    .image-counter {
        top: -40px; /* 移动端位置稍下 */
        left: 0; /* 左对齐 */
        transform: none; /* 取消居中 */
        font-size: 14px;
        padding: 4px 12px;
    }
}