/* ============================================
   历史对话面板 - 极简设计
   尺寸: 150px 宽 x 300px 高
   ============================================ */

.history-panel {
    position: absolute;
    top: 56px;           /* 紧贴模型选择器下方 */
    left: 16px;
    width: 150px;
    height: 300px;
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 100;
}

.history-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 10px 6px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
    user-select: none;
}

.history-panel-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-panel-new-btn {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: #bbb;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-left: 4px;
    transition: color 0.15s, background 0.15s;
    opacity: 0.7;
}

.history-panel-new-btn:hover {
    color: #6c5ce7;
    background: #f0eeff;
    opacity: 1;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 0;
}

.history-list::-webkit-scrollbar {
    width: 3px;
}
.history-list::-webkit-scrollbar-track {
    background: transparent;
}
.history-list::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

/* 每条历史记录 */
.history-item {
    display: flex;
    align-items: center;
    padding: 7px 8px;
    cursor: pointer;
    border-radius: 6px;
    margin: 1px 4px;
    transition: background 0.15s;
    position: relative;
    gap: 4px;
}

.history-item:hover {
    background: #f5f5f5;
}

.history-item.active {
    background: #f0f0f0;
}

.history-item-title {
    flex: 1;
    font-size: 11px;
    color: #444;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    line-height: 1.3;
}

.history-item-delete {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border: none;
    background: transparent;
    color: #ccc;
    cursor: pointer;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 14px;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
    opacity: 0;
}

.history-item:hover .history-item-delete {
    opacity: 1;
}

.history-item-delete:hover {
    color: #ff4d4f;
    background: #fff1f0;
}

/* 空状态提示 */
.history-empty {
    font-size: 10px;
    color: #bbb;
    text-align: center;
    padding: 20px 8px;
    line-height: 1.5;
}

/* 移动端隐藏 */
@media (max-width: 768px) {
    .history-panel {
        display: none;
    }
}
