/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.navbar-container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

/* Logo样式 */
.logo h1 {
    font-size: 24px;
    font-weight: 600;
    color: #1890ff;
    margin: 0;
}

/* 导航链接样式 */
.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* 用户名和登录按钮的基本样式 */
.nav-links .nav-link {
    transition: all 0.3s ease;
}

.nav-link {
    color: #666;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 16px;
    outline: none;
}

.nav-link:hover {
    color: #1890ff;
    background-color: #f0f7ff;
}

.nav-link.active {
    color: #1890ff;
    font-weight: 500;
    background-color: #e6f7ff;
}

.nav-link:active {
    transform: none;
    box-shadow: none;
}


/* 主内容区域 */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px 20px; /* 增加顶部padding避开固定导航栏 */
}

/* 页面标题 */
.page-title {
    margin-bottom: 20px;
}

.page-title h1 {
    font-size: 32px;
    font-weight: bold;
    color: #333;
}

/* 筛选区域样式 */
.filter-container {
    margin-bottom: 20px;
    padding: 20px;
    background-color: #f5f5f5;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
    align-items: flex-end;
    margin-bottom: 10px;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-right: 0;
    box-sizing: border-box;
    min-width: 150px;
}

/* 响应式布局：小屏幕设备 */
@media (max-width: 768px) {
    /* 主容器 */
    .filter-row {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;  /* 子元素之间的间距减小 */
        justify-content: flex-start; /* 左对齐 */
    }

    /* 子元素布局，每个元素占 50% 宽度，减去间距 */
    .filter-row > div {
        width: calc(50% - 5px);  /* 每个子元素宽度，减去减小后的间距 */
    }

    /* .filter-item 样式 */
    .filter-item {

        width: 100%;  /* 每个子元素占满一行 */
        margin-bottom: 10px;  /* 下边距 */
        padding: 10px;
        box-sizing: border-box;
        color: black; /* 文字颜色改为黑色 */
    }

    /* 输入框调整 */
    .filter-item .autocomplete-container,
    .filter-item .filter-input {
        width: 80%;  /* 输入框宽度缩小为90% */
        box-sizing: border-box;  /* 包括padding和border */
    }

    /* 筛选和清空按钮 */
    .filter-btn-container {
        width: 100%;
        margin-top: 10px;
        margin-left: 10px; /* 与输入框左边距保持一致 */
        display: flex;
        justify-content: flex-start;  /* 按钮左对齐紧贴 */
        gap: 2 !important; /* 强制清除按钮之间的间距 */
    }

    .filter-btn,
    .clear-btn {
        width: 120px;  /* 设置固定宽度 */
        padding: 10px;
        background-color: #007bff;
        color: white;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        margin-right: 0 !important; /* 强制清除按钮右边距 */
    }
    
    /* 确保清空按钮样式正确 */
    .filter-btn-container .clear-btn {
        background-color: #f5f5f5;
        color: #666;
        border: 1px solid #d9d9d9;
    }
}


.filter-item label {
    font-weight: bold;
    color: #333;
}

/* 主属性字段容器样式 */
.definition-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

/* 主属性字段标签样式 */
.definition-label {
    font-weight: bold;
    color: #333;
    margin-right: 5px;
}

/* 主属性字段按钮容器样式 */
.definition-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
    align-items: center;
}

/* 主属性字段按钮样式 */
.definition-button {
    background-color: #e6f7ff;
    color: #1890ff;
    border: 1px solid #91d5ff;
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

/* 主属性字段按钮悬停样式 */
.definition-button:hover {
    background-color: #1890ff;
    color: white;
    border-color: #1890ff;
}

/* 主属性字段按钮选中样式 */
.definition-button.selected {
    background-color: #1890ff;
    color: white;
    border-color: #1890ff;
}

/* 没有主属性字段时的提示信息 */
.no-definitions {
    font-size: 14px;
    color: #999;
    padding: 6px 16px;
    font-style: italic;
}

/* 提示文字样式 */
.filter-tip {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    margin-left: 15px;
    font-style: italic;
}

/* 自动完成容器样式 */
.autocomplete-container {
    position: relative;
    width: 100%;
}

/* 下拉列表样式 */
.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: none;
}

/* 下拉选项样式 */
.dropdown-option {
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.dropdown-option:hover {
    background-color: #f0f0f0;
}

.filter-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
    width: 100%;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.filter-input:focus {
    outline: none;
    border-color: #007bff;
}

.filter-btn-container {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.filter-btn {
    background-color: #1890ff;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.filter-btn:hover {
    background-color: #40a9ff;
}

.clear-btn {
    background-color: #f5f5f5;
    color: #666;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    background-color: #e8e8e8;
    border-color: #1890ff;
    color: #1890ff;
}

/* 价格区间容器样式 */
.price-ranges-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
}

/* 价格区间选项样式 */
.price-range-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 0;
    margin-right: 20px;
    margin-bottom: 0;
    font-size: 14px;
    color: #333;
}

/* 价格区间复选框样式（点的样式） */
.price-range-option input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #1890ff;
    border-radius: 50%;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

/* 价格区间复选框选中状态 */
.price-range-option input[type="checkbox"]:checked {
    background-color: #1890ff;
    border-color: #1890ff;
}

/* 价格区间复选框选中时的点 */
.price-range-option input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
}

/* 价格区间选项选中状态 */
.price-range-option input[type="checkbox"]:checked + label {
    color: #1890ff;
}

/* 价格区间选项悬停样式 */
.price-range-option:hover {
    color: #1890ff;
}

/* 价格区间文本样式 */
.price-range-option label {
    font-size: 14px;
    cursor: pointer;
}

/* 没有价格区间时的提示信息 */
.no-price-ranges {
    font-size: 14px;
    color: #999;
    padding: 6px 16px;
    font-style: italic;
}

/* 评价列表区域 */
.assessment-list-container {
    margin-top: 20px;
    padding: 0 20px;
    /* 移除最大高度限制和溢出自动设置，让产品列表自然延伸 */
}

/* 分页控制样式 */
.pagination-controls {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 50px;
}

.next-page-btn {
    background-color: #4CAF50;
    color: white;
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.next-page-btn:hover {
    background-color: #45a049;
}

.next-page-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.assessment-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* 产品卡片样式 */
.product-card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 15px;
    transition: box-shadow 0.3s ease;
    text-align: center;
}

.product-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.product-name {
    font-size: clamp(12px, 4vw, 18px);
    font-weight: bold;
    color: #333;
    margin: 0;
    white-space: nowrap;
    width: 100%;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 没有产品时的提示信息 */
.no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 16px;
    background-color: #f5f5f5;
    border-radius: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 导航栏响应式设计 */
    .navbar-container {
        padding: 0 10px;
        height: 60px;
    }
    
    .logo h1 {
        font-size: 18px;
    }
    
    .nav-links {
        gap: 12px;
    }
    
    .nav-link {
        font-size: 14px;
        padding: 6px 12px;
    }
    
    /* 主内容区域调整 */
    .main-container {
        padding-top: 80px;
    }

    .filter-row{
        width: 100%;
    }
    

    .filter-btn-container {
        width: 100%;
        display: flex; /* 设置flex布局 */
        gap: 10px; /* 设置按钮之间的间距，避免直接调整margin-right */
        justify-content: flex-start; /* 左对齐 */
    }

    .filter-btn,
    .clear-btn {
        width: 150px;  /* 固定按钮的宽度 */
        height: 40px;  /* 固定按钮的高度 */
        margin-right: 60px;  /* 设置右边距，用来增加按钮之间的间距 */
        padding: 10px;
    }

    /* 确保最后一个按钮不被多余的右边距影响 */
    .clear-btn {
        margin-right: 0;  /* 最后一个按钮右边距为0 */
    }

    
    /* 主属性字段响应式设计 */
    .definition-container {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .main-container {
        padding: 80px 10px 10px;
    }

    .page-title h1 {
        font-size: 24px;
    }

    .filter-container {
        padding: 15px;
    }

    .filter-input {
        min-width: 100%;
    }
}