/* 历史记录页面样式 */

/* 顶部操作栏 */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.content-header h1 {
    font-size: 20px;
    font-weight: 500;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.search-filter {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.search-filter input {
    width: 200px;
    height: 32px;
    padding: 0 var(--space-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.filter-btn {
    height: 32px;
    padding: 0 var(--space-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--white);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    transition: all 0.3s;
}

.filter-btn:hover {
    background-color: var(--bg-color);
}

/* 历史记录主体 */
.history-container {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: var(--space-md);
    height: calc(100vh - 180px);
}

/* 左侧分类树 */
.category-tree {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tree-header {
    height: 48px;
    padding: 0 var(--space-md);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tree-header h3 {
    font-size: 16px;
    font-weight: 500;
}

.tree-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-sm) 0;
}

.tree-list {
    list-style: none;
}

.tree-item {
    margin-bottom: var(--space-xs);
}

.tree-item-header {
    display: flex;
    align-items: center;
    padding: var(--space-xs) var(--space-md);
    cursor: pointer;
    transition: background-color 0.3s;
}

.tree-item-header:hover {
    background-color: var(--bg-color);
}

.expand-icon {
    width: 16px;
    margin-right: var(--space-xs);
    text-align: center;
}

.tree-item-name {
    font-size: 14px;
}

.tree-sublist {
    list-style: none;
    margin-left: var(--space-md);
    display: none;
}

.tree-item.expanded .tree-sublist {
    display: block;
}

.tree-subitem {
    padding: var(--space-xs) var(--space-md);
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
}

.tree-subitem:hover {
    background-color: var(--bg-color);
}

.tree-subitem.active {
    background-color: var(--primary-light);
    color: var(--primary);
}

/* 右侧对话列表 */
.conversation-list {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow-y: auto;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.conversation-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    cursor: pointer;
    transition: all 0.3s;
}

.conversation-item:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.conversation-item.active {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xs);
}

.conversation-header h3 {
    font-size: 16px;
    font-weight: 500;
}

.conversation-actions {
    display: flex;
    gap: var(--space-xs);
}

.conversation-info {
    color: var(--text-secondary);
}

.conversation-meta {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-xs);
    font-size: 12px;
}

.conversation-model {
    background-color: var(--bg-color);
    padding: 2px var(--space-sm);
    border-radius: var(--radius-md);
}

.conversation-summary {
    font-size: 14px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .history-container {
        grid-template-columns: 1fr;
    }
    
    .category-tree {
        display: none;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-actions {
        width: 100%;
        margin-top: var(--space-md);
    }
    
    .search-filter {
        flex: 1;
    }
    
    .search-filter input {
        width: 100%;
    }
}
