/* 畫作投票系統 - 前台樣式 */

.avs-gallery {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin: 24px 0;
}

@media (max-width: 1024px) {
    .avs-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .avs-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

.avs-item {
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 10px rgba(30, 30, 60, 0.08);
    border: 1px solid #eef0f6;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.avs-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(30, 30, 60, 0.14);
}

.avs-image-wrap {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    cursor: zoom-in;
    background: linear-gradient(135deg, #fef9e7 0%, #eaf4ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.avs-thumb {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 完整顯示作品，不裁切 */
    display: block;
    transition: transform 0.25s ease;
}

.avs-item:hover .avs-thumb {
    transform: scale(1.03);
}

.avs-zoom-hint {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 11px;
    padding: 4px 9px;
    border-radius: 999px;
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.avs-item:hover .avs-zoom-hint {
    opacity: 1;
}

.avs-title {
    padding: 12px 14px 0;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avs-meta {
    padding: 10px 14px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.avs-vote-btn {
    flex: 0 1 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: linear-gradient(135deg, #ff8a80 0%, #ff5c72 100%);
    color: #fff;
    border: none;
    padding: 7px 15px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(255, 92, 114, 0.3);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
    white-space: nowrap;
}

.avs-vote-btn .avs-btn-icon {
    font-size: 11px;
    line-height: 1;
}

.avs-vote-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255, 92, 114, 0.4);
}

.avs-vote-btn:active:not(:disabled) {
    transform: translateY(0);
}

.avs-vote-btn:disabled {
    background: #eceef2;
    color: #9aa0ac;
    box-shadow: none;
    cursor: not-allowed;
}

.avs-count-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
    min-width: 40px;
    padding: 4px 10px;
    border-radius: 12px;
    background: #eef1ff;
    color: #5063d9;
    font-weight: 700;
    flex: 0 0 auto;
}

.avs-count-badge .avs-count-num {
    font-size: 15px;
}

.avs-count-badge .avs-count-label {
    font-size: 10px;
    font-weight: 500;
    color: #7d86c9;
    margin-top: 1px;
}

.avs-pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 28px 0;
    flex-wrap: wrap;
}

.avs-page-link {
    padding: 7px 14px;
    border: 1px solid #e0e2ea;
    border-radius: 999px;
    text-decoration: none;
    color: #444;
    font-size: 14px;
    transition: all 0.15s ease;
}

.avs-page-link:hover {
    background: #f5f6fa;
}

.avs-page-link.active {
    background: #ff5c72;
    color: #fff;
    border-color: #ff5c72;
}

.avs-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 30, 0.9);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.avs-lightbox.active {
    display: flex;
}

.avs-lightbox img {
    max-width: 92%;
    max-height: 92%;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.avs-lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    line-height: 1;
    color: #fff;
    cursor: pointer;
    opacity: 0.85;
}

.avs-lightbox-close:hover {
    opacity: 1;
}
