body {
    height: 100dvh;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2f6 100%);
    color: #0f172a;
    font-family: ui-sans-serif, system-ui, sans-serif;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.custom-scroll::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
    border-radius: 10px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.snap-x {
    scroll-snap-type: x mandatory;
    display: flex;
    overflow-x: auto;
}

.snap-center {
    scroll-snap-align: center;
    scroll-snap-stop: always;
    flex-shrink: 0;
    width: 100%;
    height: 100%;
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    display: flex;
}

@media (max-width: 768px) {
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .bottom-sheet {
        width: 100%;
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
        border-top-left-radius: 2.5rem !important;
        border-top-right-radius: 2.5rem !important;
        margin-bottom: 0;
        animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.animate-pop {
    animation: pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #f97316;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== 搜索框 ========== */
#searchWrapper {
    width: 0;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 110;
}

#searchWrapper.active {
    width: auto;
    opacity: 1;
    pointer-events: auto;
}

#siteTitle {
    transition: all 0.3s ease;
}

#siteTitle.pushed {
    transform: translateX(-20px);
    opacity: 0.6;
}

/* ========== 前台分类下拉 ========== */
header .cate-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    z-index: 500;
    display: none;
}

header .cate-dropdown-menu.active {
    display: block;
}

header .cate-dropdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
    cursor: pointer;
}

header .cate-dropdown-item:last-child {
    border-bottom: none;
}

header .cate-dropdown-item:hover {
    background: #f8fafc;
}

header .cate-dropdown-item span:first-child {
    white-space: normal;
    word-break: break-word;
    flex: 1;
    margin-right: 8px;
}

header .cate-dropdown-count {
    background: #e2e8f0;
    color: #64748b;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 20px;
    flex-shrink: 0;
}

/* ========== 商品卡片 ========== */
.item {
    width: calc(50% - 0.5rem);
    margin: 0.25rem;
}

@media (min-width: 640px) {
    .item {
        width: calc(33.333% - 1rem);
        margin: 0.5rem;
    }
}

@media (min-width: 1024px) {
    .item {
        width: calc(16.666% - 1rem);
        margin: 0.5rem;
    }
}

/* ========== 分页条（两排居中，淡绿色箭头） ========== */
.pagination-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px 80px;
    background: transparent;
    width: 100%;
    box-sizing: border-box;
}

.pagination-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pagination-arrow {
    width: 40px;
    height: 40px;
    border-radius: 40px;
    background: #d1fae5;
    color: #047857;
    font-weight: 900;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    transition: background 0.15s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.pagination-arrow:hover {
    background: #a7f3d0;
}

.pagination-arrow:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #e2e8f0;
    color: #64748b;
}

.pagination-current-box {
    background: #f1f5f9;
    padding: 8px 20px;
    border-radius: 40px;
    font-weight: 700;
    font-size: 16px;
    color: #0f172a;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
    min-width: 90px;
    text-align: center;
}

.pagination-jump-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
}

.pagination-jump-input {
    width: 80px;
    height: 40px;
    border-radius: 40px;
    border: 1px solid #e2e8f0;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    background: white;
    outline: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.pagination-go-btn {
    height: 40px;
    padding: 0 22px;
    border-radius: 40px;
    background: #d1fae5;
    color: #047857;
    font-weight: 700;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.pagination-go-btn:hover {
    background: #a7f3d0;
}

/* ========== 其他 ========== */
#detailModal .aspect-square {
    aspect-ratio: 1 / 1 !important;
    height: auto !important;
}

.slider-img-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.slider-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#dropZone {
    border: 4px dashed #e2e8f0;
    border-radius: 2rem;
    transition: all 0.3s;
}

#dropZone.dragover {
    border-color: #f97316;
    background: #fff7ed;
}

#videoOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.98);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

#videoOverlay.active {
    display: flex;
}

.dropdown-menu {
    display: none;
    position: absolute;
    transform-origin: top right;
    z-index: 500;
    animation: scaleIn 0.2s ease forwards;
}

.dropdown-menu.active {
    display: block;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}