.tooto-loop-grid-carousel-wrapper {
    position: relative;
    width: 100%;
}

/* 顶部 Header 布局：标题左，导航右 */
.tooto-carousel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: absolute;
    right: 0;
    top: -84px;
}

.tooto-carousel-nav {
    display: flex;
    gap: 16px;
}

/* 右上角圆形切换按钮样式 */
.tooto-carousel-arrow {
    width: 36px;
    height: 36px;
    background-color: #ECE7D8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #1a1a1a;
    font-size: 14px;
    border: 1px solid transparent;
}
.tooto-carousel-arrow svg {
    width: 12px;
    height: 18px;
}
.tooto-carousel-arrow:hover {
    opacity: 0.8;
}

.tooto-carousel-arrow.swiper-button-disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Swiper 基础结构 */
.tooto-loop-grid-swiper {
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* 新的滚动容器结构 */
.tooto-scroll-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.tooto-scroll-container::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.tooto-scroll-wrapper {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: var(--tooto-carousel-gap, 20px);
}

.tooto-scroll-item {
    flex: 0 0 calc(25% - var(--tooto-carousel-gap, 20px));
    scroll-snap-align: start;
    width: calc(25% - var(--tooto-carousel-gap, 20px)) !important;
}

/* 响应式：通过百分比控制 */
@media (max-width: 1024px) {
    .tooto-scroll-item {
        flex: 0 0 50%;
        width: 50% !important;
    }
}

@media (max-width: 767px) {
    .tooto-scroll-wrapper {
        display: grid !important;
        /* 核心：创建两行，并让内容按列填充（先上下，再左右） */
        grid-template-rows: repeat(2, auto);
        grid-auto-flow: column;
        gap: 24px 12px;
    }
    .tooto-scroll-item {
        /* 每个项目占容器宽度的 50% 减去间距的一半 */
        width: calc(50vw - 25px) !important;
        flex: none;
    }
    .tooto-carousel-header {
        top: -56px;
    }
    .tooto-carousel-arrow svg {
        width: 12px;
        height: 12px;
    }
}

/* 保持 Header 样式不变 */

/* 响应式调整 */
@media (max-width: 767px) {
    .tooto-carousel-title {
        font-size: 20px;
    }
    .tooto-carousel-arrow {
        width: 36px;
        height: 36px;
    }
}
