:root {
    /* --primary-color: #0d6efd;
    --hover-color: #0b5ed7; */
    --background-color: #f8f9fa;
    --card-shadow: 0 4px 8px rgba(0,0,0,0.1);
    --card-hover-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

body {
    background-color: var(--background-color);
}

.sticky-top {
    text-align: center;
    background-color: white;
    padding: 3px 0px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
}

.control-panel {
    display: flex;
    justify-content: center;
    gap: 15px;
    align-items: center;
    padding: 8px 16px;
    min-height: 50px;
}

.pinterest-grid {
    display: flex;
    padding: 8px 4px; /* 縮小整體邊距 */
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 576px) {
    .pinterest-column {
        margin: 0 4px !important; /* 縮小列間距 */
    }

    .pinterest-item {
        margin-bottom: 8px !important; /* 縮小項目間距 */
    }

    .control-panel {
        gap: 12px; /* 增加按鈕間距 */
        padding: 8px 12px; /* 增加左右間距 */
    }
    
    .image-actions button {
        width: 32px; /* 縮小按鈕尺寸 */
        height: 32px;
    }

    .image-overlay {
        padding: 12px; /* 縮小 overlay 內邊距 */
    }

}

@media (min-width: 768px) {
    .pinterest-grid {
        column-count: 3;
    }
}

@media (min-width: 1200px) {
    .pinterest-grid {
        column-count: 4;
    }
}

.pinterest-item {
    cursor: pointer;
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    background-color: #fff;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    position: relative;
    width: 100%;
}

.pinterest-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-hover-shadow);
}

.pinterest-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: filter 0.3s ease;
}

.pinterest-item.loading img {
    background-color: #f0f0f0;
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pinterest-item:hover .image-overlay {
    opacity: 1;
}

.image-actions {
    display: flex;
    gap: 10px;
}

.image-actions button {
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.image-actions button:hover {
    background: #fff;
    transform: scale(1.1);
}

.loading-spinner {
    text-align: center;
    padding: 30px;
    color: var(--primary-color);
}

#count {
    background-color: rgba(255,255,255,0.9);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    color: #666;
    margin: 0;
    white-space: nowrap; /* 確保計數器文字不換行 */
}

.btn-custom {
    padding: 8px 20px;
    border-radius: 20px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.top-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(255,255,255,0.9);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1000;
    border: none;
    box-shadow: var(--card-shadow);
    color: #666;
}

.top-button:hover {
    background: #fff;
    transform: scale(1.1);
    box-shadow: var(--card-hover-shadow);
}

.close-modal {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 30px;
    cursor: pointer;
    background: none;
    border: none;
}

.toast-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0,0,0,0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    z-index: 2000;
    display: none;
}

.image-wrapper {
    cursor: pointer;
    width: 100%;
    height: 100%;
    transition: transform 0.2s ease;
}

.image-wrapper:hover {
    transform: scale(1.02);
}

.btn {
    border: none;
    background: #f5f5f5;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.btn:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}

.btn i {
    font-size: 18px;
    color: #333;
}