/* 春风AI 图片库页面样式 */

.pic-page { display: flex; flex-direction: column; height: 100vh; }

.pic-body { display: flex; flex: 1; overflow: hidden; }

/* ===== 左侧分类导航 ===== */
.pic-sidebar {
    width: 280px; flex-shrink: 0;
    background: #f9fafb; display: flex; flex-direction: column;
    overflow: hidden;
    padding-top: 60px;
    border-right: 1px solid #e5e5e5;
}
.pic-sidebar-header {
    padding: 20px 16px 12px;
    border-bottom: 1px solid #eee;
    display: flex; align-items: center; justify-content: space-between;
}
.pic-sidebar-header h3 {
    font-size: 15px; font-weight: 600; color: #141414; margin: 0;
}

/* 排序按钮 */
.pic-sort-btns {
    display: flex; gap: 6px;
}
.pic-sort-btn {
    display: flex; align-items: center; gap: 4px;
    padding: 5px 12px; border-radius: 16px;
    border: 1px solid #e5e5e5; background: #fff;
    font-size: 12px; color: #888; cursor: pointer;
    transition: all .2s;
}
.pic-sort-btn:hover { border-color: #00c375; color: #00c375; }
.pic-sort-btn.active { background: #e6f9f0; color: #00c375; border-color: #00c375; }
.pic-sort-btn svg { width: 14px; height: 14px; }
.pic-category-list {
    flex: 1; overflow-y: auto; padding: 8px;
    max-height: calc(100vh - 140px);
}
.pic-category-list::-webkit-scrollbar { width: 4px; }
.pic-category-list::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

.pic-category-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border-radius: 10px; cursor: pointer;
    transition: all .2s; font-size: 14px; color: #555;
    margin-bottom: 2px;
}
.pic-category-item:hover { background: #e6f9f0; color: #141414; }
.pic-category-item.active {
    background: linear-gradient(135deg, #e6f9f0 0%, #d4f5e8 100%);
    color: #00c375; font-weight: 600;
}
.pic-category-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.pic-category-item .count {
    margin-left: auto; font-size: 12px; color: #999;
    background: #eee; padding: 1px 8px; border-radius: 10px;
}
.pic-category-item.active .count { background: #b8ecd3; color: #00c375; }

/* ===== 右侧瀑布流布局 ===== */
.pic-main {
    flex: 1; overflow-y: auto; padding-top: 60px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    display: flex; flex-direction: column;
}
.pic-main::-webkit-scrollbar { display: none; }

.pic-waterfall {
    column-count: 9; column-gap: 16px;
    padding: 24px;
    flex: 1;
}
@media (max-width: 1600px) { .pic-waterfall { column-count: 7; } }
@media (max-width: 1200px) { .pic-waterfall { column-count: 5; } }
@media (max-width: 768px) { .pic-waterfall { column-count: 3; column-gap: 8px; padding: 10px; } }

/* 瀑布流卡片 */
.pic-card {
    break-inside: avoid; margin-bottom: 16px;
    border-radius: 12px; overflow: hidden;
    background: #fff; cursor: pointer;
    transition: transform .2s, box-shadow .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    position: relative;
}
.pic-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.pic-card:hover .pic-card-download { opacity: 1; }
.pic-card img {
    width: 100%; display: block;
    background: #f5f5f5;
}

/* 卡片右上角下载按钮 - 圆形 */
.pic-card-download {
    position: absolute; top: 8px; right: 8px;
    width: 30px; height: 30px; border-radius: 50%;
    background: rgba(0,0,0,.45); border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #fff; opacity: 0; transition: opacity .2s, background .2s;
    z-index: 2;
}
.pic-card-download:hover { background: rgba(0,0,0,.7); }
.pic-card-download svg { width: 15px; height: 15px; }

/* 卡片右下角点击次数 */
.pic-card-count {
    position: absolute; bottom: 4px; right: 4px;
    padding: 2px 8px; border-radius: 10px;
    background: rgba(0,0,0,.4); color: #fff;
    font-size: 11px; pointer-events: none;
    z-index: 2;
}

/* 加载状态 */
.pic-loading {
    text-align: center; padding: 60px 20px;
    color: #999; font-size: 14px;
    column-span: all;
}

/* 底部分页 */
.pic-pagination {
    display: flex; align-items: center; justify-content: center;
    gap: 6px; padding: 16px 20px 24px;
    flex-shrink: 0;
}
.pic-page-btn {
    width: 36px; height: 36px; border-radius: 8px;
    border: 1px solid #e5e5e5; background: #fff;
    color: #555; font-size: 14px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .2s;
}
.pic-page-btn:hover { border-color: #00c375; color: #00c375; }
.pic-page-btn.active { background: #00c375; color: #fff; border-color: #00c375; }
.pic-page-btn:disabled { opacity: .4; cursor: not-allowed; }
.pic-page-info {
    font-size: 13px; color: #999; margin: 0 8px;
}

/* ===== 图片预览弹窗 ===== */
.pic-preview-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,.92);
    display: none; align-items: center; justify-content: center;
}
.pic-preview-overlay.active { display: flex; }

.pic-preview-container {
    position: relative; display: inline-block;
    max-width: 90vw; max-height: 90vh;
}

.pic-preview-img {
    max-width: 90vw; max-height: 90vh;
    object-fit: contain; border-radius: 4px;
    user-select: none; -webkit-user-drag: none;
    display: block;
}

/* 预览工具栏 - 图片内右上角，圆形按钮 */
.pic-preview-toolbar {
    position: absolute; top: 12px; right: 12px;
    display: flex; gap: 8px; z-index: 10;
}
.pic-preview-tool-btn {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(0,0,0,.5); border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #fff; transition: background .2s;
}
.pic-preview-tool-btn:hover { background: rgba(0,0,0,.75); }
.pic-preview-tool-btn svg { width: 18px; height: 18px; }

.pic-preview-prev,
.pic-preview-next {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 48px; height: 48px; border-radius: 50%;
    background: rgba(255,255,255,.1); border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #fff; z-index: 1001; transition: background .2s;
}
.pic-preview-prev:hover,
.pic-preview-next:hover { background: rgba(255,255,255,.25); }
.pic-preview-prev svg,
.pic-preview-next svg { width: 24px; height: 24px; }
.pic-preview-prev { left: 20px; }
.pic-preview-next { right: 20px; }

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
    .pic-sidebar {
        position: fixed; left: -280px; top: 0; bottom: 0; z-index: 100;
        width: 260px; box-shadow: none; transition: left .3s;
        padding-top: 60px;
    }
    .pic-sidebar.mobile-open {
        left: 0; box-shadow: 4px 0 16px rgba(0,0,0,.15);
    }
    .pic-preview-prev { left: 8px; }
    .pic-preview-next { right: 8px; }
    .pic-preview-prev,
    .pic-preview-next { width: 36px; height: 36px; }
    /* 移动端隐藏下载按钮 */
    .pic-card-download { display: none !important; }
    .pic-preview-tool-btn { display: none !important; }
}
