/* 列表页样式 */

/* 页面布局 */
.list-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
}

/* 侧边栏 */
.sidebar {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

/* 过滤器组 */
.filter-group {
    margin-bottom: 1.5rem;
    background: #fff;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filter-group h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group h3 i {
    color: #4299e1;
    font-size: 0.875rem;
}

/* 分类树 */
.category-tree {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-tree li {
    margin-bottom: 0.25rem;
}

.category-tree a {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: #4a5568;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.category-tree a:hover {
    background-color: #ebf8ff;
    color: #2b6cb0;
}

.category-tree a.active {
    background-color: #4299e1;
    color: #fff;
}

.category-tree a.active .count {
    background-color: rgba(255, 255, 255, 0.2);
}

.category-tree i.fa-angle-right {
    font-size: 0.625rem;
    margin-right: 0.5rem;
    width: 0.75rem;
    text-align: center;
}

.category-tree .count {
    margin-left: auto;
    background-color: #e2e8f0;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* 父分类项 */
.parent > a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.category-header {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: #4a5568;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.parent > a:hover .category-header {
    background-color: #ebf8ff;
    color: #2b6cb0;
}

.parent > a.active .category-header {
    background-color: #4299e1;
    color: #fff;
}

.parent > a.active .category-header .count {
    background-color: rgba(255, 255, 255, 0.2);
}

.category-header .expand-icon {
    font-size: 0.625rem;
    margin-right: 0.5rem;
    width: 0.75rem;
    text-align: center;
    transition: transform 0.2s ease;
}

.category-header .expand-icon.expanded {
    transform: rotate(90deg);
}

.category-header .count {
    margin-left: auto;
    background-color: #e2e8f0;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* 子分类列表 */
.children {
    list-style: none;
    padding: 0;
    margin: 0;
    padding-left: 0.5rem;
}

.children li {
    margin-bottom: 0.125rem;
}

/* 二级分类 */
.children.level-2 > li > a {
    padding-left: 0.5rem;
}

.children.level-2 .category-header {
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
}

/* 三级分类 */
.children.level-3 {
    padding-left: 0.5rem;
}

.children.level-3 > li > a {
    padding-left: 1rem;
    font-size: 0.8rem;
}

.children.level-3 > li > a i {
    font-size: 0.5rem;
}

/* 过滤器列表 */
.filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.filter-list li {
    margin-bottom: 0.125rem;
}

.filter-list a {
    display: block;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    color: #4a5568;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.filter-list a:hover {
    background-color: #f7fafc;
    color: #2b6cb0;
}

.filter-list a.active {
    background-color: #4299e1;
    color: #fff;
}

/* 页面标题 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a202c;
}

.page-header .subtitle {
    color: #718096;
    font-size: 0.9rem;
}

/* 标准列表 */
.standard-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

/* 标准卡片 */
.standard-card {
    background: #fff;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
}

.standard-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.standard-card .header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.standard-card .code-badge {
    background-color: #4299e1;
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* 列表页状态徽章 - 继承基础样式 */
.standard-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.standard-card .summary {
    color: #718096;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.standard-card .meta {
    color: #a0aec0;
    font-size: 0.8rem;
}

/* 主内容区 */
.main-content {
    min-width: 0;
}

/* 分页 */
.pagination {
    margin-top: 2rem;
    text-align: center;
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
}

.pagination li {
    display: inline-block;
}

.pagination li a,
.pagination li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    min-width: 2.5rem;
}

.pagination li a {
    color: #4a5568;
    background-color: #fff;
    border: 1px solid #e2e8f0;
}

.pagination li a:hover {
    background-color: #ebf8ff;
    border-color: #4299e1;
    color: #2b6cb0;
}

.pagination li span {
    color: #a0aec0;
    background-color: #f7fafc;
    border: 1px solid #e2e8f0;
}

.pagination li.active span {
    background-color: #4299e1;
    color: #fff;
    border-color: #4299e1;
}

.pagination li.disabled span {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

/* 下拉筛选器 */
.filter-dropdown {
    position: relative;
    display: inline-block;
    min-width: 180px;
}

.filter-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 16px;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
    transition: all 0.2s;
    user-select: none;
    width: 100%;
    box-sizing: border-box;
}

.filter-label:hover {
    border-color: #80bdff;
    background-color: #f8f9fa;
}

.filter-label strong {
    color: #007bff;
    font-weight: 600;
}

.filter-label i {
    color: #6c757d;
    transition: transform 0.2s;
}

.filter-dropdown:hover .filter-label i {
    transform: rotate(180deg);
}

/* 下拉菜单 */
.dropdown-menu {
    position: absolute;
    top: calc(100% - 1px);
    left: 0;
    width: 100%;
    min-width: 180px;
    margin-top: 0;
    padding: 8px 0;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    animation: fadeIn 0.2s ease;
    box-sizing: border-box;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 8px 16px;
    color: #495057;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.15s;
    white-space: nowrap;
}

.dropdown-menu a:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

.dropdown-menu a.active {
    background-color: #e3f2fd;
    color: #007bff;
    font-weight: 500;
}

/* 标准列表网格 */
.standards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

/* 卡片头部 */
.card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.standard-no {
    background-color: #4299e1;
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-danger {
    background-color: #fc8181;
    color: #fff;
}

.badge-success {
    background-color: #48bb78;
    color: #fff;
}

/* 卡片标题 */
.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 卡片描述 */
.card-desc {
    color: #718096;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 卡片元信息 */
.card-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #a0aec0;
    font-size: 0.8rem;
}

.meta-item i {
    font-size: 0.75rem;
}

/* 卡片底部 */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
}

.card-footer .price {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f56565;
}

/* 分页容器 */
.pagination-wrapper {
    margin-top: 2rem;
    text-align: center;
}

/* 响应式 */
@media (max-width: 1024px) {
    .standard-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .standards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .list-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: static;
    }
    
    .standard-list {
        grid-template-columns: 1fr;
    }
    
    .standards-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-dropdown {
        width: 100%;
    }
    
    .filter-label {
        justify-content: space-between;
    }
    
    .dropdown-menu {
        width: 100%;
    }
}
