/* ========== 左侧最新商品滚动栏 ========== */
.sidebar-scroll {
    width: 200px;
    flex-shrink: 0;
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 15px;
    max-height: 300px;
    display: flex;
    flex-direction: column;
}
.sidebar-title {
    padding: 12px 15px;
    font-weight: bold;
    color: #0f0;
    background: #222;
    border-bottom: 1px solid #333;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.scroll-track {
    flex: 1;
    overflow: hidden;
    position: relative;
}
.scroll-inner {
    animation: scrollUp 25s linear infinite;
}
.scroll-track:hover .scroll-inner {
    animation-play-state: paused;
}
@keyframes scrollUp {
    0%   { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}
.sidebar-card {
    display: block;
    padding: 10px;
    border-bottom: 1px solid #2a2a2a;
    text-decoration: none;
    color: #ccc;
    transition: 0.2s;
}
.sidebar-card:hover {
    background: #222;
}
.sc-img img {
    width: 100%;
    aspect-ratio: 1 / 1.5;
    object-fit: cover;
    border-radius: 4px;
    background: #333;
}
.sc-info h4 {
    margin: 5px 0 3px;
    font-size: 0.85rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sc-code,
.sc-region {
    font-size: 0.7rem;
    color: #888;
    margin: 2px 0;
}
.sc-price {
    color: #ccc;
    font-weight: bold;
    font-size: 0.9rem;
}

/* ========== 主页布局（左右结构） ========== */
.main-container {
    display: flex !important;
    flex-wrap: nowrap !important;
    padding: 15px;
    max-width: 1200px;
    margin: 0 auto;
}
.right-content {
    flex: 1 !important;
    min-width: 0;
    display: block !important;
    width: 100% !important;
}
.category-block {
    display: block !important;
    width: 100% !important;
    clear: both !important;
    float: none !important;
    margin-bottom: 30px !important;
}
.cat-title {
    font-size: 1.1rem;
    color: #0f0;
    border-left: 4px solid #0f0;
    padding-left: 10px;
    margin: 0 0 12px;
}
.product-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 10px;
}
.product-card {
    display: block;
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: #ccc;
    transition: transform 0.2s, box-shadow 0.2s;
}
.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,255,0,0.2);
}
.pc-img img {
    width: 100%;
    aspect-ratio: 2 / 3;  /* 宽度1，高度2，竖长图比例 */
    object-fit: cover;     /* 保持cover，确保图片填满不留白，裁切多余部分 */
    background: #2a2a2a;
}

.pc-info {
    padding: 1px;
}
.pc-name-code {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0px;
}
.pc-name {
    color: #fff;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}
.pc-code {
    color: #888;
    font-size: 0.7rem;
}


.shipping_origin_name {
    color: #ddd;
    font-size: 0.75rem;
    margin: 2px 0;
}
.pc-region , .pc-origin{
    color: #aaa;
    font-size: 0.65rem;
    margin: 2px 0;
}
.pc-price {
    font-size: 0.55rem;
    color: #ccc;
    font-weight: bold;
}

/* 手机端主页适配 */
@media (max-width: 768px) {
    .main-container {
        flex-direction: row;
        padding: 10px;
    }
    .sidebar-scroll {
        width: 110px;
        min-width: 110px;
        max-height: 350vh;
        margin-right: 8px;
    }
    .scroll-inner {
        animation: scrollUp 30s linear infinite;
    }
    .sidebar-card {
        padding: 6px;
    }
    .sc-info h4 {
        font-size: 0.7rem;
    }
    .sc-code, .sc-region {
        font-size: 0.6rem;
    }
    .sc-price {
        font-size: 0.65rem;
    }
    .cat-title {
        font-size: 0.9rem;
    }
    .product-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 5px;
    }
    .pc-info {
        padding: 1px;
    }
    .pc-name {
        font-size: 0.65rem;
    }
    .pc-code, .pc-region {
        font-size: 0.65rem;
    }
    .pc-price {
        font-size: 0.47rem;
    }
}

@media (max-width: 480px) {
    .sidebar-scroll {
        width: 90px;
        min-width: 90px;
    }
    .product-grid {
        gap: 3px;
    }
    .pc-name {
        font-size: 0.6rem;
    }
}