/* 分类数据页面样式 */

/* 分类分组 */
.category-group {
    margin-bottom: 40px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    scroll-margin-top: 160px;
}

.group-header {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e9f2 100%);
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #e0e0e0;
}

.group-title {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.group-code {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    background: linear-gradient(135deg, #44aafb 0%, #409eff 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.group-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.group-stat {
    font-size: 13px;
    color: #999;
    margin-left: 15px;
}

.group-summary {
    display: flex;
    align-items: center;
    gap: 30px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.summary-label {
    font-size: 12px;
    color: #999;
    margin-bottom: 3px;
}

.summary-value {
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

.summary-value.rate-high {
    color: #10b981;
}

.summary-value.rate-medium {
    color: #f59e0b;
}

.summary-value.rate-low {
    color: #ef4444;
}

.toggle-group-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s;
    margin-left: 20px;
}

.toggle-group-btn:hover {
    transform: rotate(180deg);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.category-group .group-content {
    transition: all 0.3s ease-in-out;
}

.category-group .group-content.collapsed {
    display: none;
}

/* 默认全部折叠，通过JS控制展开 */
.category-group .group-content {
    display: none;
}
.category-group.open .group-content {
    display: block;
}

/* 响应式表格滚动 */
@media (max-width: 768px) {
    .group-content {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: #2196F3 #f0f0f0;
    }

    .group-content::-webkit-scrollbar {
        height: 6px;
    }

    .group-content::-webkit-scrollbar-track {
        background: #f0f0f0;
        border-radius: 3px;
    }

    .group-content::-webkit-scrollbar-thumb {
        background: #2196F3;
        border-radius: 3px;
    }

    .group-content::-webkit-scrollbar-thumb:hover {
        background: #1976D2;
    }

    .category-table {
        min-width: 800px;
    }
}

/* 主分类行样式 */
.main-category {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8efff 100%);
    font-weight: 600;
}

.main-category td {
    border-top: 3px solid #2196F3;
}

/* 不同级别的背景色区分 */
.category-table tbody tr.level-1:not(.main-category) {
    background: #fafbff;
}

.category-table tbody tr.level-2 {
    background: #ffffff;
}

.category-table tbody tr.level-3 {
    background: #f9f9fc;
}

.category-table tbody tr.level-4 {
    background: #ffffff;
}

/* 层级连接线 */
.category-table tbody tr.level-2 .code-cell,
.category-table tbody tr.level-3 .code-cell,
.category-table tbody tr.level-4 .code-cell {
    position: relative;
}

.category-table tbody tr.level-2 .code-cell::before {
    content: '├';
    color: #ddd;
    margin-right: 8px;
    font-family: monospace;
}

.category-table tbody tr.level-3 .code-cell::before {
    content: '│  ├';
    color: #ddd;
    margin-right: 8px;
    font-family: monospace;
}

.category-table tbody tr.level-4 .code-cell::before {
    content: '│  │  ├';
    color: #ddd;
    margin-right: 8px;
    font-family: monospace;
}



/* 筛选区域 */
.category-filters {
    background: white;
    padding: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    position: sticky;
    top: 0;
    z-index: 998;
    transition: box-shadow 0.3s;
}
.category-filters.is-sticky {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.filter-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.filter-group label i {
    margin-right: 6px;
    color: #2196F3;
}

/* 级别标签 */
.level-tabs {
    display: flex;
    gap: 8px;
}

.level-tab {
    padding: 10px 25px;
    border: 2px solid #e0e0e0;
    background: white;
    color: #666;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.level-tab:hover {
    border-color: #2196F3;
    color: #2196F3;
}

.level-tab.active {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    border-color: #2196F3;
    color: white;
}

/* 搜索输入框 */
.search-input {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    width: 300px;
    transition: all 0.3s;
}

.search-input:focus {
    border-color: #2196F3;
    outline: none;
}

/* 筛选行搜索容器（API实时搜索） */
.filter-search-group .search {
    display: flex;
    background: #fafafa;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    transition: border-color 0.3s;
    position: relative;
}
.filter-search-group .search:focus-within {
    border-color: #2196F3;
}
.filter-search-group .search .search-input {
    flex: 1;
    padding: 10px 15px;
    font-size: 14px;
    color: #666;
    border: none;
    width: auto;
    min-width: 200px;
    border-radius: 8px 0 0 8px;
}
.filter-search-group .search .search-input:focus {
    outline: none;
}
.filter-search-group .search button {
    padding: 10px 16px;
    font-size: 14px;
    color: #2196F3;
    cursor: pointer;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    border-radius: 0 8px 8px 0;
}
.filter-search-group .search-dropdown {
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    width: 100%;
    min-width: 280px;
}

/* 分组操作按钮 */
.group-actions {
    display: flex;
    gap: 10px;
}

.group-action-btn {
    padding: 8px 15px;
    background: white;
    border: 2px solid #e0e0e0;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
}

.group-action-btn:hover {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    border-color: #2196F3;
    transform: translateY(-2px);
}

/* 统计概览 */
.category-stats {
    margin-bottom: 0px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 35px;
}

.stat-item {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s;
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-icon.primary {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
}
.stat-icon.primary i{
    width:100%;
    height: 100%;
    background: url(/images/fl1.png) center  no-repeat;
}

.stat-icon.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}
.stat-icon.success i{
    width:100%;
    height: 100%;
    background: url(/images/fl2.png) center  no-repeat;
}

.stat-icon.warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}
.stat-icon.warning i{
    width:100%;
    height: 100%;
    background: url(/images/fl3.png) center  no-repeat;
}

.stat-icon.info {
    background: linear-gradient(135deg, #ffac7a 0%, #ff8100 100%);
}
.stat-icon.info i{
    width:100%;
    height: 100%;
    background: url(/images/fl4.png) center  no-repeat;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 0px;
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 14px;
    color: #666;
}

/* 分类数据表格区域 */
.category-data-section {
    padding: 30px 0 0 0;
}

.category-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.category-table thead {
        background: linear-gradient(135deg, #41a8f9 0%, #409eff 100%);
    color: white;
}

.category-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.category-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background 0.3s;
}

.category-table tbody tr:hover {
    background: #f9f9f9;
}

.category-table td {
    padding: 15px 12px;
}

/* 级别层级缩进 */
.category-table tbody tr.level-1 td:first-child {
    padding-left: 20px;
}

.category-table tbody tr.level-2 td:first-child {
    padding-left: 40px;
}

.category-table tbody tr.level-3 td:first-child {
    padding-left: 60px;
}

.category-table tbody tr.level-4 td:first-child {
    padding-left: 80px;
}

/* 级别徽章 */
.level-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.level-1-badge {
    background: #FF5630;
    color: #ffffff;
}

.level-2-badge {
    background: #FA8C16;
    color: #ffffff;
}

.level-3-badge {
    background: #36B37E;
    color: #ffffff;
}

.level-4-badge {
    background: #409eff;
    color: #ffffff;
}

/* 代码单元格 */
.code-cell {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

/* 名称单元格 */
.name-cell {
    font-weight: 500;
    color: #333;
}

/* 分成率颜色 */
.rate-high {
    color: #10b981;
    font-weight: 700;
}

.rate-medium {
    color: #f59e0b;
    font-weight: 700;
}

.rate-low {
    color: #ef4444;
    font-weight: 700;
}

/* 操作按钮 */
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #2196F3;
    text-decoration: none;
    font-size: 12px;
    padding: 5px 10px;
    border: 1px solid #2196F3;
    border-radius: 4px;
    margin-right: 8px;
    transition: all 0.3s;
}
.action-btn:hover {
    background: #2196F3;
    color: white;
}
.action-btn:last-child {
    margin-right: 0;
}

/* 响应式设计 */
@media (max-width: 960px) {
    .filter-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-group {
        width: 100%;
    }

    .filter-search-group .search .search-input {
        min-width: 0;
        flex: 1;
    }
    .filter-search-group .search-dropdown {
        min-width: 0;
        width: 100%;
    }

    .search-input {
        width: 100%;
    }

    .level-tabs {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 5px;
    }

    .level-tab {
        padding: 8px 15px;
        white-space: nowrap;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .stat-item{
        padding: 10px;
    }

    .category-table {
        min-width: 1024px;
    }

    .stat-value {
        font-size: 22px;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    .group-header{
        padding: 15px 15px;
    }
    .summary-item{
        display: none;
    }
    .group-code{
        width: 35px;
        height: 35px;
    }
    .group-stat{
        display: none;
    }
    .toggle-group-btn{
        width: 30px;
        height: 30px;
    }
}

