/* 
 * WooCMS Community Portal - Custom Styles
 */

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1; /* slate-300 */
    border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #334155; /* slate-700 */
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8; /* slate-400 */
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #475569; /* slate-600 */
}

/* Selection Color */
::selection {
    background-color: #4f46e5; /* primary-600 */
    color: white;
}

/* Image Lazy Loading Blur Effect */
img.lazyload {
    filter: blur(10px);
    transition: filter 0.5s ease-in-out;
}

img:not(.lazyload) {
    filter: blur(0);
}

/* Skeleton Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    background: #f1f5f9; /* slate-100 */
    background-image: linear-gradient(to right, #f1f5f9 0%, #e2e8f0 20%, #f1f5f9 40%, #f1f5f9 100%);
    background-repeat: no-repeat;
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear forwards;
}

.dark .skeleton {
    background: #0f172a; /* slate-900 */
    background-image: linear-gradient(to right, #0f172a 0%, #1e293b 20%, #0f172a 40%, #0f172a 100%);
}

/* Markdown Content Styles (for docs and forum posts) */
.prose pre {
    background-color: #1e1e1e !important; /* Dark theme for code blocks */
    color: #d4d4d4 !important;
}

.dark .prose pre {
    background-color: #282a36 !important; /* Dracula theme for dark mode */
    color: #f8f8f2 !important;
}

/* Mobile product archive: use a single-column horizontal list card. */
@media (max-width: 640px) {
    #inventory-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 12px !important;
    }

    #inventory-grid .inventory-card {
        border-radius: 14px !important;
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08) !important;
        transform: none !important;
    }

    #inventory-grid .inventory-card > div {
        display: grid !important;
        grid-template-columns: minmax(116px, 42%) minmax(0, 1fr);
        min-height: 154px;
    }

    #inventory-grid .inventory-card > div > a.group {
        display: block !important;
        height: 100%;
        min-height: 154px;
    }

    #inventory-grid .inventory-card > div > a.group > div {
        height: 100% !important;
        min-height: 154px;
        padding-bottom: 0 !important;
        border-radius: 14px 0 0 14px;
    }

    #inventory-grid .inventory-card img {
        object-fit: contain !important;
        padding: 8px;
        background: #f8fafc;
    }

    #inventory-grid .inventory-card > div > div {
        min-width: 0;
        padding: 10px 12px !important;
    }

    #inventory-grid .inventory-card h2 {
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        min-height: 3.75rem;
        overflow: hidden;
        font-size: 14px !important;
        line-height: 1.25rem !important;
    }

    #inventory-grid .inventory-card p {
        font-size: 17px !important;
        line-height: 1.35 !important;
    }

    #inventory-grid .inventory-card .rounded-full {
        max-width: 100%;
    }

    #inventory-grid .inventory-card [data-best-price-link],
    #inventory-grid .inventory-card .truncate {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }

    #inventory-grid .inventory-card .space-y-1 > :not([hidden]) ~ :not([hidden]) {
        margin-top: 0.2rem !important;
    }

    #inventory-grid .inventory-card .text-sm {
        font-size: 12px !important;
        line-height: 1.25rem !important;
    }
}

/* 隐藏数字输入框的上下箭头 */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}
