﻿:root {
    --primary-color: #795198;
    --secondary-color: #A98BBD;
    --background-color: #F5F3F7;
    --text-color: #333333;
    --card-bg-color: #ffffff;
}

/* 关键布局：确保页面撑满视口且不产生多余滚动条 */
html {
    height: 100%;
}

body {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* 防止body自身滚动 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    font-size: 14px;
}

a {
    text-decoration: none;
    color: black;
}
/* 主内容区，使用flex实现左右布局 */
.main-content {
    flex: 1; /* 占据所有可用空间 */
    display: flex;
    overflow: hidden; /* 关键：让子元素在内部滚动 */
}

/* 左侧分类导航栏 */
.category-sidebar {
    flex: 0 0 90px; /* 固定宽度90px */
    background-color: var(--background-color);
    overflow-y: auto; /* 自身垂直滚动 */
    -webkit-overflow-scrolling: touch; /* iOS平滑滚动 */
}

    .category-sidebar ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

.category-item {
    padding: 16px 5px;
    text-align: center;
    cursor: pointer;
    color: var(--text-color);
    position: relative;
    font-size: 14px;
    transition: background-color 0.2s, color 0.2s;
}

    .category-item.active {
        background-color: var(--card-bg-color);
        color: var(--primary-color);
        font-weight: bold;
    }

        .category-item.active::before {
            content: '';
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            width: 4px;
            height: 24px;
            background-color: var(--primary-color);
            border-radius: 0 2px 2px 0;
        }

/* 右侧商品内容区 */
.product-content {
    flex: 1;
    background-color: var(--card-bg-color);
    overflow-y: auto; /* 自身垂直滚动 */
    -webkit-overflow-scrolling: touch;
    padding: 15px;
}

.category-banner-placeholder {
    width: 100%;
    height: 100px;
    background-color: var(--secondary-color);
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: bold;
}

.content-header h2 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #333;
}

.product-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px; /* 列间距 */
    row-gap: 20px; /* 行间距 */
}

/* 商品卡片样式 */
.product-card {
    display: flex;
    flex-direction: column;
}

.product-image-placeholder {
    width: 100%;
    background-color: #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
}

.product-title {
    font-size: 14px;
    margin-top: 8px;
    /*    height: 40px;*/
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.product-price-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.product-price {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 16px;
}

.add-to-cart-icon {
    cursor: pointer;
}