/**
 * gallery.css - 我的图库样式
 */

/* === 视图: 我的图库 === */
#view-gallery {
    padding: 0;
    overflow: hidden;
    height: 100%;
    flex-direction: column;
}

#gallery-scroll-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Masonry 瀑布流布局 */
.gallery-grid {
    width: 100%;
}

/* Masonry 使用百分比宽度计算列 */
.gallery-grid-sizer,
.gallery-card {
    width: calc(20% - 12px); /* 5 列 */
}

@media (max-width: 1400px) { 
    .gallery-grid-sizer, .gallery-card { width: calc(25% - 12px); } /* 4 列 */
}
@media (max-width: 1100px) { 
    .gallery-grid-sizer, .gallery-card { width: calc(33.333% - 10px); } /* 3 列 */
}
@media (max-width: 800px) { 
    .gallery-grid-sizer, .gallery-card { width: calc(50% - 8px); } /* 2 列 */
}
@media (max-width: 500px) { 
    .gallery-grid-sizer, .gallery-card { width: 100%; } /* 1 列 */
}

.gallery-card {
    margin-bottom: 15px;
    background: #2b2c2f;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #444;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}
.gallery-card:hover { border-color: var(--accent-color); transform: translateY(-3px); }

.gallery-img-wrapper {
    position: relative;
    cursor: pointer;
}
.gallery-img-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-card-actions {
    padding: 8px;
    display: flex;
    justify-content: center;
    gap: 8px;
    background: rgba(0,0,0,0.2);
    border-top: 1px solid #444;
}

.gallery-type-tab {
    padding: 6px 15px;
    border-radius: 20px;
    background: #2b2c2f;
    color: #888;
    cursor: pointer;
    font-size: 0.85rem;
    border: 1px solid #444;
    transition: all 0.2s;
}
.gallery-type-tab.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* 图库 Tab 样式 */
.gallery-tabs { display: flex; gap: 5px; margin-right: 20px; }
.gallery-tab {
    padding: 6px 15px; border-radius: 20px; background: #2b2c2f;
    color: #888; cursor: pointer; font-size: 0.85rem; border: 1px solid #444;
    transition: all 0.2s;
}
.gallery-tab.active {
    background: var(--accent-color); color: white; border-color: var(--accent-color);
    font-weight: bold;
}
.gallery-tab:hover:not(.active) { background: #3a3b3e; color: white; }

/* 细化和高清放大按钮 */
.upscale-btn {
    background: rgba(16, 163, 127, 0.1);
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: bold;
    justify-content: center;
}
.upscale-btn:hover { background: var(--accent-color); color: white; }
.upscale-btn:disabled { opacity: 0.5; cursor: not-allowed; border-color: #666; color: #888; background: #333; }

/* 🌟 高清放大处理中状态 */
.upscale-btn.processing {
    background: linear-gradient(90deg, #e6a23c 0%, #f0b55a 50%, #e6a23c 100%);
    background-size: 200% 100%;
    animation: upscale-processing 1.5s ease-in-out infinite;
    color: white;
    border-color: #e6a23c;
    cursor: wait;
    pointer-events: none;
}
.upscale-btn.processing::before {
    content: "⏳ ";
}
@keyframes upscale-processing {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.upscale-tag {
    position: absolute; top: 5px; right: 5px; background: #e6a23c;
    color: white; font-size: 10px; padding: 2px 6px; border-radius: 4px;
    font-weight: bold; pointer-events: none; z-index: 5;
}
